Apoccalypse
New Member
- Joined
- Apr 15, 2017
- Messages
- 114
- Solutions
- 2
- Reaction score
- 4
Hello,
I have a problem with my manarune script .
Specifically with this part:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 2283 then
doSendMagicEffect(getPlayerPosition(cid),12)
doSendAnimatedText(getPlayerPosition(cid), "+++Mana Power+++" , TEXTCOLOR_LIGHTBLUE)
end
return TRUE
end
After using manarune a player gets mana but there is no text and magic effect at the position of the player who is using this rune.
I totally do not understand it.
I declared a function onUse to make the effects happen after I use something
item.itemid == 2283 ----->it should tell the game which item is used
and then the following effects should be acomphlised.
If anyone good person could tell me why is it not working?
I have a problem with my manarune script .
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_MANADRAIN)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
function onGetFormulaValues(cid, level, maglevel)
min = (level * 2 + maglevel * 5) * 1.6 - 25
max = (level * 2 + maglevel * 5) * 2
if max < 250 then
min = 250
end
return min, max
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 2283 then
doSendMagicEffect(playerposition(cid),12)
doSendAnimatedText(getPlayerPosition(cid),"+++Mana Power+++", TEXTCOLOR_LIGHTBLUE)
end
return TRUE
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_MANADRAIN)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
function onGetFormulaValues(cid, level, maglevel)
min = (level * 2 + maglevel * 5) * 1.6 - 25
max = (level * 2 + maglevel * 5) * 2
if max < 250 then
min = 250
end
return min, max
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 2283 then
doSendMagicEffect(playerposition(cid),12)
doSendAnimatedText(getPlayerPosition(cid),"+++Mana Power+++", TEXTCOLOR_LIGHTBLUE)
end
return TRUE
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
Specifically with this part:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 2283 then
doSendMagicEffect(getPlayerPosition(cid),12)
doSendAnimatedText(getPlayerPosition(cid), "+++Mana Power+++" , TEXTCOLOR_LIGHTBLUE)
end
return TRUE
end
After using manarune a player gets mana but there is no text and magic effect at the position of the player who is using this rune.
I totally do not understand it.
I declared a function onUse to make the effects happen after I use something
item.itemid == 2283 ----->it should tell the game which item is used
and then the following effects should be acomphlised.
If anyone good person could tell me why is it not working?