demon088
#088 in the Horde
Hello again OtLand!
I need some assistance making a new series of spells for my OTS, and if someone would like to use it, I'm glad to explain how it works or help to insert or edit the spell.
My team had the idea to make a spell which could get one charge each time you use it. So, if you have casted the spell until you get 10 charges, you might inflict adittional damage while spending all the charges, then you would need to use it 10 times again to get the boost. Then, I mixed scripts from spells and actions like this:
This script is currently working like this:
The problem that I have right now, is that I don't know how to set this line into the script:
I would like this to increase 1 charge instead of fixing the value to one. Do anybody know the correct line that I'm looking for?
I'd be glad to share this script to anybody that would like to have such kind of spells. I've thinking on a spell that could be only casted once you have X amount of charges from different spells. I'm already working on the script, but this is issue is my first obstacle.
Thank you all for your help!
I need some assistance making a new series of spells for my OTS, and if someone would like to use it, I'm glad to explain how it works or help to insert or edit the spell.
My team had the idea to make a spell which could get one charge each time you use it. So, if you have casted the spell until you get 10 charges, you might inflict adittional damage while spending all the charges, then you would need to use it 10 times again to get the boost. Then, I mixed scripts from spells and actions like this:
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, true)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EXPLOSION)
function onCastSpell(cid, var)
charges = getPlayerStorageValue(cid,10076)
if charges == 1 then
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Discharge!")
setPlayerStorageValue(cid,10076,0)
function onGetFormulaValues(player, skill, attack, factor)
local fistSkill = player:getEffectiveSkillLevel(SKILL_FIST)
local min = (player:getLevel() + 105) + (fistSkill * 0.38 + attack)
local max = (player:getLevel() + 150) + (fistSkill * 0.5 + attack)
return -min, -max
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Charge!")
setPlayerStorageValue(cid,10076,1)
function onGetFormulaValues(player, skill, attack, factor)
local fistSkill = player:getEffectiveSkillLevel(SKILL_FIST)
local min = (player:getLevel() + 5) + (fistSkill * 0.38 + attack)
local max = (player:getLevel() + 15) + (fistSkill * 0.5 + attack)
return -min, -max
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
end
return doCombat(cid, combat, var)
end
The problem that I have right now, is that I don't know how to set this line into the script:
Code:
From this:
setPlayerStorageValue(cid,10076,1)
To this:
increasePlayerStorageValue(cid,10076,1)
or
addPlayerStorageValue(cid,10076,1)
I would like this to increase 1 charge instead of fixing the value to one. Do anybody know the correct line that I'm looking for?
I'd be glad to share this script to anybody that would like to have such kind of spells. I've thinking on a spell that could be only casted once you have X amount of charges from different spells. I'm already working on the script, but this is issue is my first obstacle.
Thank you all for your help!