function onAdvance(cid, skill, oldlevel, newlevel)
local level = 20
local playername = getCreatureName(cid)
if getPlayerLevel(cid) == level and getPlayerStorageValue(cid, 44923) == -1 then
setPlayerStorageValue(cid, 44923, 1)
doPlayerAddItem(cid, 2160, 2)
doCreatureSay(cid, "Congratulation .. playername .. you have reached level 20, you will now be rewarded 2 crystal coin. Enjoy your hunting!", TALKTYPE_ORANGE_1)
end
return true
end
function onAdvance(cid, skill, oldlevel, newlevel)
if(skill == SKILL__LEVEL and getPlayerStorageValue(cid, 41024) ~= 1 and newlevel >= 20) then
setPlayerStorageValue(cid, 41024, 1)
doPlayerAddItem(cid, 2160, 2)
doCreatureSay(cid, "Congratulations " .. getCreatureName(cid) .. ", you have reached level 20, you will now be rewarded 2 crystal coins. Enjoy your hunting!", TALKTYPE_ORANGE_1)
end
return true
end
Creature script / Talkaction?
<event type="advance" name="LevelReward" event="script" value="levelreward.lua"/>
registerCreatureEvent(cid, "LevelReward")
function onAdvance(cid, skill, oldlevel, newlevel)
if(skill == SKILL__LEVEL and getPlayerStorageValue(cid, 41024) ~= 1 and newlevel >= 20) then
setPlayerStorageValue(cid, 41024, 1)
doPlayerAddItem(cid, 2160, 2)
doCreatureSay(cid, "Congratulations " .. getCreatureName(cid) .. ", you have reached level 20, you will now be rewarded 2 crystal coins. Enjoy your hunting!", TALKTYPE_ORANGE_1)
end
return true
end
<event type="advance" name="LevelReward2" event="script" value="levelreward2.lua"/>
registerCreatureEvent(cid, "LevelReward2")
function onAdvance(cid, skill, oldlevel, newlevel)
if(skill == SKILL__LEVEL and getPlayerStorageValue(cid, 41025) ~= 1 and newlevel >= 50) then
setPlayerStorageValue(cid, 41025, 1)
doPlayerAddItem(cid, 2160, 5)
doCreatureSay(cid, "Congratulations " .. getCreatureName(cid) .. ", you have reached level 50, you will now be rewarded 5 crystal coins. Enjoy your hunting!", TALKTYPE_ORANGE_1)
end
return true
end
function onAdvance(cid, skill, oldlevel, newlevel)
if(skill == SKILL__LEVEL and getPlayerStorageValue(cid, 41025) ~= 1 and newlevel >= 50) then
setPlayerStorageValue(cid, 41025, 1)
doPlayerAddItem(cid, 2160, 5)
doCreatureSay(cid, "Congratulations " .. getCreatureName(cid) .. ", you have reached level 50, you will now be rewarded 5 crystal coins. Enjoy your hunting!", TALKTYPE_ORANGE_1)
elseif(skill == SKILL__LEVEL and getPlayerStorageValue(cid, 41022) ~= 1 and newlevel >= 20) then
setPlayerStorageValue(cid, 41022, 1)
doPlayerAddItem(cid, 2160, 2)
doCreatureSay(cid, "Congratulations " .. getCreatureName(cid) .. ", you have reached level 50, you will now be rewarded 2 crystal coins. Enjoy your hunting!", TALKTYPE_ORANGE_1)
end
return true
end
function onAdvance(cid, skill, oldlevel, newlevel)
local levels = {20,50}
local storages = {41024, 41025}
if skill == SKILL__LEVEL and isInArray(storages,getPlayerStorageValue(cid)) < 0 and newlevel >= isInArray(levels,getPlayerLevel(cid)) then
setPlayerStorageValue(cid, getPlayerLevel(cid) == levels[1] and storage[1] or getPlayerLevel(cid) == level[2] and storage[2], 1)
doPlayerAddItem(cid, 2160, getPlayerLevel(cid) == levels[1] and 2 or getPlayerLevel(cid) == level[2] and 5)
doCreatureSay(cid, "Congratulation .. playername .. you have reached level " .. getPlayerLevel(cid) .. ", you will now be rewarded " .. getPlayerLevel(cid) == levels[1] and 2 or getPlayerLevel(cid) == levels[2] and 5 .. " crystal coin. Enjoy your hunting!", TALKTYPE_ORANGE_1)
end
return true
end
<event type="advance" name="Reward" event="script" value="reward.lua"/>
function onAdvance(cid, skill, oldlevel, newlevel)
if(getPlayerStorageValue(cid, 60362) == -1 and skill == SKILL__LEVEL and newlevel >= 25) then
doPlayerAddItem(cid, 2160, 1)
setPlayerStorageValue(cid, 60362, 1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREWORK_RED)
local message = "You have received 1 crystal coin due to reaching level 25."
doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
doPlayerSendTextMessage(cid, 19, "You have received 1 crystal coin due to reaching level 25.")
end
return TRUE
end