UpInSmoke
Supreme Ruler
- Joined
- Nov 16, 2008
- Messages
- 303
- Reaction score
- 21
Easy to use multiple promotion script.
First make sure you have all of your vocations already added into your vocations.xml
and in your lib/031-vocations folder.
in your actions folder
promotion.lua
actions.xml
Rep++
First make sure you have all of your vocations already added into your vocations.xml
and in your lib/031-vocations folder.
in your actions folder
promotion.lua
Code:
local t = {
[10600] = {50, 2, "a classic "}, -- [10600] is unique id, level needed, new promotion level, promotion name
[10601] = {100, 3, "a relentless "},
[10602] = {200, 4, "a spin "},
[10603] = {350, 5, "an epic "},
[10604] = {500, 6, "a hell fire "},
[10605] = {750, 7, "a death "},
}
local vocations = {
-- these are vocation values, only put the ones you use
sorcerer = {1, 5, 9, 13, 17, 21, 25, 29},
druid = {2, 6, 10, 14, 18, 22, 26, 30},
paladin = {3, 7, 11, 15, 19, 23, 27, 31},
knight = {4, 8, 12, 16, 20, 24, 28, 32},
}
local voc
function onUse(cid, item, fromPosition, itemEx, toPosition)
local v = t[item.uid]
if getPlayerLevel(cid) >= v[1] then
if getPlayerPromotionLevel(cid) < v[2] then
doPlayerSetPromotionLevel(cid, v[2])
if isInArray(vocations.druid,getPlayerVocation(cid)) then
voc = "druid"
elseif isInArray(vocations.sorcerer,getPlayerVocation(cid)) then
voc = "sorcerer"
elseif isInArray(vocations.paladin,getPlayerVocation(cid)) then
voc = "paladin"
elseif isInArray(vocations.knight,getPlayerVocation(cid)) then
voc = "knight"
end
doPlayerSendTextMessage(cid, 19, "Congratulations you are now "..v[3]..voc.."!")
else
doPlayerSendTextMessage(cid, 19, "You already have this promotion.")
end
else
doPlayerSendTextMessage(cid, 19, "Sorry you need to be level "..v[1].." for this promotion.")
end
return true
end
actions.xml
Code:
<action uniqueid="10600-10605" event="script" value="other/promotion.lua"/>
Rep++

Last edited: