perfection
FATAL DAMAGE
- Joined
- Aug 27, 2011
- Messages
- 196
- Reaction score
- 8
Ok this script is an onAdvance System which is When a player reaches lvl 200 he will get a temple teleport scroll and on lvl 400 will get a Red Skull Remover i know its simple but it might be usefull to someone
first in data/creaturescripts/scripts/items.lua
in creaturescripts.xml
now for the items : in data/actions/scripts/rewards.lua
and in actions.xml
i rly hope u like it
first in data/creaturescripts/scripts/items.lua
Lua:
local levelx = 200 -- Level Needed for first item
local levelxx = 400 -- Level Needed for second item
local itemx = 6087 -- First Reward Id
local itemxx = 9969 -- Second Reward Id
function onAdvance(cid, skill, oldLevel, newLevel)
if getPlayerLevel(cid) >= levelx and (getPlayerStorageValue(cid, 1002)) ~= 1 then
doPlayerAddItem(cid, itemx, 1)
doPlayerSendTextMessage(cid, 23,"You Have Recieved a "..getItemNameById(itemx).." For Reaching Level "..levelx.." .")
setPlayerStorageValue(cid, 1002, 1)
end
if getPlayerLevel(cid) >= levelxx and (getPlayerStorageValue(cid, 1002)) ~= 2 then
doPlayerAddItem(cid, itemxx, 1)
doPlayerSendTextMessage(cid, 23,"You Have Recieved a "..getItemNameById(itemxx).." For Reaching Level "..levelxx.." .")
setPlayerStorageValue(cid, 1002, 2)
end
return 1
end
in creaturescripts.xml
Lua:
<event type="advance" name="Reward" event="script" value="items.lua"/>
now for the items : in data/actions/scripts/rewards.lua
Lua:
local itemId = 6087
local itemId2 = 9969
function onUse(cid, item, frompos, item2, topos)
if item.itemid == itemId and (getPlayerLevel(cid)) >= 200 and isPlayerPzLocked(cid) == FALSE then
doTeleportThing(cid, getPlayerMasterPos(cid))
doSendMagicEffect(getPlayerPosition(cid), 10)
doPlayerSendTextMessage(cid, 20,"You Have Been Teleported To Temple.")
else
doPlayerSendCancel(cid,"You Are Currently in a fight")
end
return 1
end
function onUse(cid, item, frompos, item2, topos)
if item.itemid == itemId2 and (getPlayerLevel(cid)) >= 200 and (getCreatureSkullType(cid)) >= 4 then
doCreatureSetSkullType(cid, 0)
doRemoveItem(cid, item.uid, 1)
doPlayerSendTextMessage(cid, 20,"You Successfully Got Ur Red/Black Skull Removed .")
else
doPlayerSendCancel(cid,"You Dont Have A Red/Black Skull")
end
return 1
end
and in actions.xml
Lua:
<action itemid="6087;9969" event="script" value="rewards.lua" />
i rly hope u like it
Last edited: