Shawak
Intermediate OT User
Realase / shorter, more configurable.
This Script promote your Character. :thumbup:
data/talkactions/scripts/promote.lua
data/talkactions/talkactions.xml
Now you can use !promote.
You can change the Settings in the config.
Tested (TFS 0.3.4.), all works fine.
I hope you like it :thumbup:.
Regards,
Shawak
This Script promote your Character. :thumbup:
data/talkactions/scripts/promote.lua
Code:
function onSay(cid, words, param, channel)
sorcerer = {
cost = 200000,
level = 20,
text = "Promoted to Master Sorcerer",
}
druid = {
cost = 200000,
level = 20,
text = "Promoted to Elder Druid",
}
paladin = {
cost = 200000,
level = 20,
text = "Promoted to Royal Paladin",
}
knight = {
cost = 200000,
level = 20,
text = "Promoted to Elite Knight",
}
if getPlayerVocation(cid) == 1 then
voc = sorcerer
elseif getPlayerVocation(cid) == 2 then
voc = druid
elseif getPlayerVocation(cid) == 3 then
voc = paladin
elseif getPlayerVocation(cid) == 4 then
voc = knight
else
voc = nil
end
if voc ~= nil then
if getPlayerLevel(cid) >= voc.level then
if doPlayerRemoveMoney(cid,voc.cost) == TRUE then
setPlayerPromotionLevel(cid, 1)
doSendMagicEffect(getCreaturePosition(cid),14)
doSendAnimatedText(getCreaturePosition(cid),voc.text,49)
else
doPlayerSendTextMessage(cid,18,"You need "..voc.cost.." to promote.")
end
else
doPlayerSendTextMessage(cid,18,"You need level "..voc.level.." to promote.")
end
else
doPlayerSendTextMessage(cid,18,"You already promoted.")
end
return TRUE
end
data/talkactions/talkactions.xml
HTML:
<talkaction words="!promote" event="script" value="promote.lua"/>
Now you can use !promote.
You can change the Settings in the config.
Tested (TFS 0.3.4.), all works fine.
I hope you like it :thumbup:.
Regards,
Shawak
Last edited: