• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent Reward For Each Single Vocation OnAdvance

Blorin Mage

Member
Joined
Jan 26, 2012
Messages
90
Reaction score
13
1) go to your creaturescripts\scripts and create Vocationreward.lua
level to take the reward is 45
to change the reward level change this
Lua:
newlevel >= 45
to change the reward change this
Lua:
doPlayerAddItem(cid, itemid, count)
for example
Lua:
doPlayerAddItem(cid, 2160, 5)
Lua:
function onAdvance(cid, skill, oldlevel, newlevel)
if(getPlayerStorageValue(cid, 99963) ~= 1 and skill == SKILL__LEVEL and newlevel >= 45) then
if isSorcerer(cid) then
doPlayerAddItem(cid, 2160, 5)
elseif isDruid(cid) then
doPlayerAddItem(cid, 2160, 10)
elseif isPaladin(cid) then
doPlayerAddItem(cid, 2160, 15)
elseif isKnight(cid) then
doPlayerAddItem(cid, 2160, 20)
end
setPlayerStorageValue(cid, 99963, 1)
doPlayerSendTextMessage(cid, 22, "Congratulations For Receving Your Vocation's Reward!")
end
return true
end
2) go to login.lua and after
Lua:
registerCreatureEvent(cid, "ReportBug")
add this
Lua:
registerCreatureEvent(cid, "Vocationreward")

3) go to creaturescripts.xml add this
XML:
<event type="advance" name="Vocationreward" event="script" value="Vocationreward.lua"/>
 
Last edited:
Take out step 2 and make it just "Add
Lua:
registerCreatureEvent(cid, "Vocationreward")
to your login."


It can be under anything, not just 'ReportBug'

Other than that, nice script. Works perfectly.
Tested on TFS 0.4.
 
lol i explained for people who dont know how to rigster but thx :)
 
Last edited:
Back
Top