You can probably use "spells" and it will work better but i wasnt thinking when i made this for my server.
from data\talkactions\scripts\pallyUpgrade.lua
in pallyUpgrade.lua
in data\vocations.xml
above "</vocations>"
add
that is the vocation the character will become upon casting the spell.
if you make it have faster attack speed and the same name, it will seem as if only the attack speed changed.
in data\talkactions\talkactions.xml
above "</talkactions>"
spellname can be made whatever you'd like
the spell works for royal paladins only - i tried to make it easy enough so a beginer can edit it.
from data\talkactions\scripts\pallyUpgrade.lua
in pallyUpgrade.lua
Code:
function m(cid) -- addEvent makes this function begin within the set ammount of time.
if getPlayerVocation(cid) == 10 then -- this will make the spell wear off.
doPlayerSetVocation(cid,7) -- 7 should be set to the vocation of the player before casting the spell
doSendMagicEffect(getPlayerPosition(cid),13)
end
end
function onSay(cid, words, param, frompos)
if (getPlayerVocation(cid) == 7) then -- if the player is a royal paladin (in vocations I have RP set as #7)
playermana = getPlayerMana(cid) -- checks the players mana
manaReq = 1000 -- this is how much mana you need to have to cast the spell
-- this makes sure u arent exhausted
if (playermana >= manaReq) then -- if they have more then 1000 mana (defined above as "manaReq")
doPlayerAddMana(cid,-1000) -- this will remove 1000 mana from the player
doPlayerSetVocation(cid,10) -- this is the vocation of a royal paladin aswell, but this one has a faster attack speed in vocations.xml
doSendMagicEffect(getPlayerPosition(cid),13)
addEvent(m,22000,cid) -- this will activate the function at the top of the script ( function m(cid) ) but it wont start for 22 seconds (40000 would be 40 seconds)
else
doPlayerSendCancel(cid,"You do not have enough mana.") -- it gives this msg if the player doesnt have more then the manaReq (1000 as above)
doSendMagicEffect(getPlayerPosition(cid), 2)
end
elseif (getPlayerVocation(cid) == 10) then -- if the player has alrdy casted this spell, his vocation will be 10.
doPlayerSendCancel(cid,"Wait for this spell to wear off before casting it again.") -- if the vocation is 10, it will send this message
doSendMagicEffect(getPlayerPosition(cid), 2)
else
doSendMagicEffect(getPlayerPosition(cid),2)
doPlayerSendCancel(cid,"Only paladins may use this spell.") -- incase sorcerers and druids and knights use this spell, they will get this message.
end
return words
end
in data\vocations.xml
above "</vocations>"
add
Code:
<vocation id="10" name="Royal Paladin" description="a royal paladin" gaincap="20" gainhp="10" gainmana="15" gainhpticks="3" gainhpamount="30" gainmanaticks="3" gainmanaamount="30" gainsoulticks="15" gainsoulamount="1" maxsoul="200" manamultiplier="1.4" attackspeed="750" prevoc="3" basespeed="220">
<diepercent experience="7" magic="7" skill="7" equipment="20" container="100"/>
<formula damage="1.3" defense="1.1" armor="1.1"/>
<skill id="0" multiplier="1.2"/>
<skill id="1" multiplier="1.2"/>
<skill id="2" multiplier="1.2"/>
<skill id="3" multiplier="1.2"/>
<skill id="4" multiplier="1.1"/>
<skill id="5" multiplier="1.1"/>
<skill id="6" multiplier="1.1"/>
</vocation>
if you make it have faster attack speed and the same name, it will seem as if only the attack speed changed.
in data\talkactions\talkactions.xml
above "</talkactions>"
Code:
<talkaction words="spellname" script="pallyUpgrade.lua" />
<talkaction words="Spellname" script="pallyUpgrade.lua" />
<talkaction words="SpellName" script="pallyUpgrade.lua" />
<talkaction words="SPELLNAME" script="pallyUpgrade.lua" />
spellname can be made whatever you'd like
the spell works for royal paladins only - i tried to make it easy enough so a beginer can edit it.
Last edited by a moderator: