jona21
Member
- Joined
- Jan 19, 2010
- Messages
- 38
- Reaction score
- 5
Well a long time last time i posted a sript so here is one.
first what it does??
You need first to charge before you can make a spell.
lets start first create a document .lua named charge and put this
and in spells.xml put
an example of the uses
add this before the end line:
you can change the 1 to the numer of charges it consume.
hope you like it.
Tested on CrystalServer V9.10.
first what it does??
You need first to charge before you can make a spell.
lets start first create a document .lua named charge and put this
PHP:
function onCastSpell(cid, var)
if(getPlayerStorageValue(cid, 9999) == 0) then
doPlayerSetStorageValue(cid, 9999, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Charge +1.")
elseif(getPlayerStorageValue(cid, 9999) == 1) then
doPlayerSetStorageValue(cid, 9999, 2)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Charge +2.")
elseif(getPlayerStorageValue(cid, 9999) == 2) then
doPlayerSetStorageValue(cid, 9999, 3)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Charge +3.")
elseif(getPlayerStorageValue(cid, 9999) == 3) then
doPlayerSetStorageValue(cid, 9999, 4)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Charge +4.")
elseif(getPlayerStorageValue(cid, 9999) == 4) then
doPlayerSetStorageValue(cid, 9999, 5)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Charge +5.")
else
doPlayerSendCancel(cid, "You cant do this.")
end
return TRUE
end
and in spells.xml put
PHP:
<instant name="Charging" words="exutura" lvl="1" mana="40" aggressive="0" selftarget="1" exhaustion="1000" groups="2,1000" icon="123" needlearn="0" event="script" value="charge/charge.lua">
<vocation id="4"/>
<vocation id="8"/>
</instant>
an example of the uses
PHP:
function onGetFormulaValues(cid, level, skill, attack, factor)
local skillTotal, levelTotal = skill + attack * 4, level / 5 * 4
return -(skillTotal / 2 + levelTotal), -(skillTotal + levelTotal)
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onCastSpell(cid, var)
if (getPlayerStorageValue(cid, 9999) >= 1) then
return doCombat(cid, combat, var) and
(doPlayerSetStorageValue(cid, 9999, (getPlayerStorageValue(cid, 9999)-1))) and
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Charge -1.")
else
doPlayerSendCancel(cid, "You need to charge.")
end
end
add this before the end line:
Code:
function onCastSpell(cid, var)
if (getPlayerStorageValue(cid, 9999) >= [COLOR="#00FFFF"]1[/COLOR]) then
return doCombat(cid, combat, var) and
(doPlayerSetStorageValue(cid, 9999, (getPlayerStorageValue(cid, 9999)-[COLOR="#00FFFF"]1[/COLOR]))) and
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Charge -1.")
else
doPlayerSendCancel(cid, "You need to charge.")
end
you can change the 1 to the numer of charges it consume.
hope you like it.
Tested on CrystalServer V9.10.