Postado Dezembro 18, 2014 10 anos existe algum meio de fazer tipo o seguinte : no lugar de abrir um teleport na hr qe matar um boss abrir um porta, se for usado storage qeria qe tipo o player qe morre-se dentro da quest não ganha-se o storage pra poder passar na porta
Postado Dezembro 18, 2014 10 anos Solução boss.lua (data/creaturescripts/scripts): local t = {boss = 'Boss', storage = 54321} function onDeath(cid, killer) if isMonster(cid) and getCreatureName(cid) == t.boss then for i = 1, #killer do setPlayerStorageValue(killer[i], t.storage, 1) end doCreatureSay(cid, 'You defeated me..now you can open the door.', TALKTYPE_ORANGE_1) elseif isPlayer(cid) and getPlayerStorageValue(cid, t.storage) > 0 then setPlayerStorageValue(cid, t.storage, -1) end return true end function onLogout(cid) if getPlayerStorageValue(cid, t.storage) > 0 then setPlayerStorageValue(cid, t.storage, -1) end return true end Tags - creaturescripts.xml (data/creaturescripts): <event type="death" name="BPDeath" event="script" value="boss.lua"/> <event type="logout" name="BPLogout" event="script" value="boss.lua"/> Registre o creature event, tanto no XML do monstro: <script> <event name="BPDeath"/> </script> Quanto em login.lua (data/creaturescripts/scripts): registerCreatureEvent(cid, "BPDeath") bossdoor.lua (data/actions/scripts): function onUse(cid, fromPos, toPos) local storage = 54321 if getPlayerStorageValue(cid, storage) > 0 then doTeleportThing(cid, toPos) doSendMagicEffect(fromPos, CONST_ME_MAGIC_BLUE) else doSendMagicEffect(fromPos, CONST_ME_POFF) doPlayerSendCancel(cid, 'You need to kill the boss to open the door.') end return true end Tag - actions.xml (data/actions): <action actionid="ACTIONID" script="bossdoor.lua"/> Nesse caso, sempre que morrer/fizer logout, o player vai ter o valor da storage setado como diferente do necessário para abrir a porta. Editado Dezembro 18, 2014 10 anos por Suicide (veja o histórico de edições) The corrupt fear us. The honest support us. The heroic join us.
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.