esse é o sistema que a equipe do heroserv usa para dar itens stars,no Hero ao atingir level 200 você é teleportado automaticamente há uma sala com as chests,ao dar use numa das chests você recebe o item e é teleportado para o templo.
simples e útil.
CREATURESCRIPTS/SCRIPTS/200.LUA
function onAdvance(cid, skill, oldLevel, newLevel) if skill == SKILL__LEVEL then if newLevel >= 200 and oldLevel < 200 then pos = {x=10475, y=10807, z=7} doTeleportThing(cid,pos) pos = {x=10475, y=10807, z=7} doPlayerSendTextMessage(cid, 22, "parabéns você atingiu o level 200 você pode escolher um star item!") end end end
TAG:
<event type="advance" name="staritem" script="200.lua"/>
em creaturescripts/scripts/login.lua
cole está tag tmbm
if getPlayerLevel(cid) < 200 then registerCreatureEvent(cid, "staritem") end
ACTIONS:
function onUse(cid, item, frompos, item2, topos) if item.uid == 2433 then queststatus = getPlayerStorageValue(cid,7407) if queststatus == -1 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "you received your star item!.") doPlayerAddItem(cid,2433,1) pos = {x=10160, y=10054, z=7} doTeleportThing(cid,pos) pos = {x=10160, y=10054, z=7} setPlayerStorageValue(cid,7407,1) else doPlayerSendTextMessage(cid,22,"Você ja ganhou este bonus!") end else return 0 end return 1 end
function onUse(cid, item, frompos, item2, topos) if item.uid == 7388 then queststatus = getPlayerStorageValue(cid,7407) if queststatus == -1 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "you received your star item!.") doPlayerAddItem(cid,7388,1) pos = {x=10160, y=10054, z=7} doTeleportThing(cid,pos) pos = {x=10160, y=10054, z=7} setPlayerStorageValue(cid,7407,1) else doPlayerSendTextMessage(cid,22,"Você ja ganhou este bonus!") end else return 0 end return 1 end
function onUse(cid, item, frompos, item2, topos) if item.uid == 7407 then queststatus = getPlayerStorageValue(cid,7407) if queststatus == -1 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "you received your star item!.") doPlayerAddItem(cid,7407,1) pos = {x=10160, y=10054, z=7} doTeleportThing(cid,pos) pos = {x=10160, y=10054, z=7} setPlayerStorageValue(cid,7407,1) else doPlayerSendTextMessage(cid,22,"Você ja ganhou este bonus!") end else return 0 end return 1 end
function onUse(cid, item, frompos, item2, topos) if item.uid == 7415 then queststatus = getPlayerStorageValue(cid,7407) if queststatus == -1 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "you received your star item!.") doPlayerAddItem(cid,7415,1) pos = {x=10160, y=10054, z=7} doTeleportThing(cid,pos) pos = {x=10160, y=10054, z=7} setPlayerStorageValue(cid,7407,1) else doPlayerSendTextMessage(cid,22,"Você ja ganhou este bonus!") end else return 0 end return 1 end
TAGS:
<action uniqueid="2433" event="script" value="2433.lua"/> <action uniqueid="7415" event="script" value="7415.lua"/> <action uniqueid="7407" event="script" value="7407.lua"/> <action uniqueid="7388" event="script" value="7388.lua"/>
No map editor crie a area com as chests com as respectivas Unique IDS,mude as POSITIONS q vai ser teleportado NOs scripts.