manarune nie zwieksza sie z lvl i guild master nie dziala

paker228

Active User
Zarejestrowany
Dołączył
Marzec 30, 2010
Posty
98
Liczba reakcji
0
witam nie dziala mi manarune no dziala ale sie nie konczy a inne runy sie koncz?
i nie wzrasta ilosc dodawania many przy wiekszym lvlu. I guild master jak pisz hi to nic nie odpisuje a w silniku wyskakuje mi blad

[15/04/2010 18:42:33] Lua Script Error: [Npc interface]
[15/04/2010 18:42:33] data/npc/scripts/guild.lua:onCreatureSay

[15/04/2010 18:42:33] luaCreatureGetName(). Deprecated function, use getCreatureName.

[15/04/2010 18:42:33] Lua Script Error: [Npc interface]
[15/04/2010 18:42:33] data/npc/scripts/guild.lua:onCreatureSay

[15/04/2010 18:42:33] data/npc/scripts/guild.lua:55: attempt to compare nil with number
[15/04/2010 18:42:33] stack traceback:
[15/04/2010 18:42:33] data/npc/scripts/guild.lua:55: in function <data/npc/scripts/guild.lua:52>
 
Odp: manarune nie zwieksza sie z lvl i guild master nie dziala

Podaj skrypty kt?rych u?ywasz o postaram si? pomoc.
Jak cos dam ci manarune ktorej ja uzywam:
W data/spells/script zrob plik manrune.lua i wklej tam:
PHP:
-- >>CONFIG<< --
local MIN_MANA_GAIN = 200 -- How much is the lowest mana you can possibly gain (If your heal less than that amount of mana you will get that mana instead) ?
local MIN_MANA_RAND = 300 -- The minimum amount of mana to be given (random)
local MAX_MANA_RAND = 1000 -- The maximum amount of mana to be given (random)
local ACCEPT_LUCK = true -- Should it be possible to get lucky and receive extra mana? true, false
local MAG_LEVEL_MULTI = 3 -- How many times should Magic Level be multiplied, to be added to the mana formula? 1 = same, 0 = nothing etc
local LEVEL_MULTI = 2.5 -- How many times should Level be multiplied, to be added to the mana formula? 1 = same, 0 = nothing etc 
local MAGIC_EFFECT = CONST_ME_FIREWORK_RED -- Magic effect that will be casted on the player each time it heals the mana.
local ANIMATION_COLOR = 135 -- What animation color will there be when you heal (Comes over player showing how much mana you healed) 1 - 255 (?)
local HEAL_TIMES = 1 -- How many times should you be healed when using the manarune once? Atleast 1
local FIRST_HEAL_DELAY = 0 -- How long time will it take before it heals FIRST time? In milliseconds
local HEAL_DELAY = 2000 -- How long time will it take before it heals one? In milliseconds
-- >>CONFIG<< --

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local exhaust = createConditionObject(CONDITION_EXHAUST_HEAL)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, HEAL_TIMES * HEAL_DELAY + FIRST_HEAL_DELAY)

function onCastSpell(cid, var)
doTargetCombatCondition(0, cid, exhaust, CONST_ME_NONE)
local function doHealMana(parameters)
local random = math.random(MIN_MANA_RAND, MAX_MANA_RAND)
if ACCEPT_LUCK == true then
local luck = math.random(1, 100)
if luck >= 90 then
random = random * 2
elseif luck == 50 then
random = random * 3
end
end
local formula = (getPlayerLevel(cid) * LEVEL_MULTI) + (getPlayerMagLevel(cid) * MAG_LEVEL_MULTI) + random
local manaGain = math.max(MIN_MANA_GAIN, formula)
doPlayerAddMana(cid, manaGain)
doSendAnimatedText(getPlayerPosition(cid), manaGain, ANIMATION_COLOR)
doSendMagicEffect(getPlayerPosition(cid), MAGIC_EFFECT)
doCombat(parameters.cid, parameters.combat, parameters.var)
end

local times = HEAL_TIMES
local parameters = {cid = cid, combat = combat, var = var}
while times > 0 do
if times == HEAL_TIMES then
addEvent(doHealMana, FIRST_HEAL_DELAY, parameters)
else
addEvent(doHealMana, HEAL_DELAY * times, parameters) 
end
times = times - 1
end
end
A w data/spells/spells.xml dodaj
Kod:
<rune name="Mana Rune" id="[COLOR="Blue"]2298[/COLOR]"  aggressive="0" charges="15" lvl="50" maglv="5" soul="0" exhaustion="1" prem="0" enabled="1" allowfaruse="1" script="manarune.lua">
</rune>

id="2298" - Tu zmieniasz ID runki kt?ra ma byc manarun?
 
Ostatnia edycja:
Back
Do góry