Postado Dezembro 13, 2014 10 anos Esqueci de dizer que, meu OT é o 8.6 muda alguma coisa isso? Obg... Estou tendo alguns problemas para add o script, se você puder ser um pouco mais especifico eu agradeceria obg... Embora não saibamos qual distro você usa e que versão é a dele, deve funcionar sim. Caso acuse alguma função como nula, poste uma screenshot aqui. A adição dos scripts é simples (códigos do Adriano SwaTT): zombieplayer.lua (data/creaturescripts/scripts): local morto = {lookType = 48} -- lookType local cemitery = {x=177, y=168, z=7} -- Coordenada do Cemitério local stor = {12128, 12129} -- {Storage Salva que é Fantasma, Storage de Controle} local condition_outfit = createConditionObject(CONDITION_OUTFIT) setConditionParam(condition_outfit, CONDITION_PARAM_OUTFIT, true) setConditionParam(condition_outfit, CONDITION_PARAM_TICKS, -1) addOutfitCondition(condition_outfit, morto) function onPrepareDeath(cid) if isPlayer(cid) then setPlayerStorageValue(cid, stor[1], 1) setPlayerStorageValue(cid, stor[2], -1) end return true end function onLogin(cid) if getPlayerStorageValue(cid, stor[2]) < 1 then if getPlayerStorageValue(cid, stor[1]) > 0 then setPlayerStorageValue(cid, stor[2], 1) doAddCondition(cid, condition_outfit) doTeleportThing(cid, cemitery) doPlayerSendTextMessage(cid, 4, "Agora és um fantasma.") end else doPlayerSendTextMessage(cid, 4, "Ainda és um fantasma.") doAddCondition(cid, condition_outfit) end return true end Registro do creature event (preparedeath) em login.lua (data/creaturescripts/scripts): registerCreatureEvent(cid, "TurnZombie") Tags - creaturescripts.xml (data/creaturescripts): <event type="preparedeath" name="TurnZombie" event="script" value="zombieplayer.lua"/> <event type="login" name="ZombieLogin" event="script" value="zombieplayer.lua"/> revive.lua (data/actions/scripts): function onUse(cid, item, frompos, item2, topos) local stor = {12128, 12129} -- {Storage Salva que é Fantasma, Storage de Controle} if getPlayerStorageValue(cid, stor[1]) > 0 or getPlayerStorageValue(cid, stor[2]) > 0 then setPlayerStorageValue(cid, stor[1], -1) setPlayerStorageValue(cid, stor[2], -1) doRemoveItem(item.uid, 1) doRemoveCondition(cid, CONDITION_OUTFIT) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) else doPlayerSendCancel(cid, "Você não está morto para usar este item.") end return true end Tag - actions.xml (data/actions): <action itemid="ITEMID" script="revive.lua"/> Editado Dezembro 14, 2014 10 anos por Suicide (veja o histórico de edições) The corrupt fear us. The honest support us. The heroic join us.
Postado Dezembro 13, 2014 10 anos E como ficaria , no caso o player tivesse que puxa uma alavanca ou entra num teleport, para volta no templo com addon normal ?
Postado Dezembro 13, 2014 10 anos Com base nos códigos do membro, a alavanca ficaria:zombielever.lua function onUse(cid, item, frompos, item2, topos) local stor = {12128, 12129} -- {storage zombie, storage humana} if getPlayerStorageValue(cid, stor[1]) > 0 or getPlayerStorageValue(cid, stor[2]) > 0 then setPlayerStorageValue(cid, stor[1], -1) setPlayerStorageValue(cid, stor[2], -1) doRemoveCondition(cid, CONDITION_OUTFIT) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doSendMagicEffect(fromPos, CONST_ME_TELEPORT) else doPlayerSendCancel(cid, "Você não está morto para usar esta alavanca.") end return true end Tag: <action actionid="ACTIONID" script="zombielever.lua"/> E o portal (sem coordenadas pré determinadas nele, apenas contendo o actionID da tag):zombieportal.lua (data/movements/scripts): function onStepIn(cid, item, pos, fromPos) local stor = {12128, 12129} -- {storage zombie, storage humana} if isPlayer(cid) and getPlayerStorageValue(cid, stor[1]) > 0 or getPlayerStorageValue(cid, stor[2]) > 0 then setPlayerStorageValue(cid, stor[1], -1) setPlayerStorageValue(cid, stor[2], -1) doRemoveCondition(cid, CONDITION_OUTFIT) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doSendMagicEffect(fromPos, CONST_ME_TELEPORT) else doTeleportThing(cid, fromPos, true) doSendMagicEffect(fromPos, CONST_ME_POFF) doPlayerSendCancel(cid, "Você não está morto para entrar no portal.") end return true end Tag: <movevent type="StepIn" actionid="ACTIONID" event="script" value="zombieportal.lua"/> The corrupt fear us. The honest support us. The heroic join us.
Postado Dezembro 13, 2014 10 anos Boa noite. O script ficou assim... Em CreatureScripts, o arquivo creaturescripts.xml adicione as seguintes tags: <event type="preparedeath" name="Morto" event="script" value="posmorte.lua"/> <event type="login" name="MortoSeg" event="script" value="posmorte.lua"/>Dentro da pasta scripts da referida acima, em login.lua adicione as tags abaixo junto com as outras do gênero: registerCreatureEvent(cid, "Morto")registerCreatureEvent(cid, "MortoSeg")Agora crie um arquivo com o nome "posmorte.lua" e adicione o script dentro: -------- CONFIGURAÇÕES --------local morto = {lookType = 48} -- lookTypelocal cemitery = {x=177, y=168, z=7} -- Coordenada do Cemitériolocal strg, strg2 = 12128, 12129 -- Storage Salva que é Fantasma, Storage de Controle---- FIM DAS CONFIGURAÇÕES ----local condition_outfit = createConditionObject(CONDITION_OUTFIT)setConditionParam(condition_outfit, CONDITION_PARAM_OUTFIT, true)setConditionParam(condition_outfit, CONDITION_PARAM_TICKS, -1)addOutfitCondition(condition_outfit, morto)function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) if isPlayer(cid) then setPlayerStorageValue(cid, strg, 1) setPlayerStorageValue(cid, strg2, -1) endreturn trueendfunction onLogin(cid) if getPlayerStorageValue(cid, strg2) < 1 then if getPlayerStorageValue(cid, strg) >= 1 then setPlayerStorageValue(cid, strg2, 1) doAddCondition(cid, condition_outfit) doTeleportThing(cid, cemitery) doPlayerSendTextMessage(cid, 4, "Agora és um fantasma.") end else doPlayerSendTextMessage(cid, 4, "Ainda és um fantasma.") doAddCondition(cid, condition_outfit) endreturn trueendCerto, agora em Actions, abra o actions.xml e adicione a tag do item que ressuscitará o player, ficará tipo isso: <action itemid="ID_DO_ITEM" script="reviver.lua"/>E o arquivo "reviver.lua" ficará assim: -------- CONFIGURAÇÕES --------local morto = {lookType = 48} -- lookTypelocal strg, strg2 = 12128, 12129 -- Storage Salva que é Fantasma, Storage de Controle---- FIM DAS CONFIGURAÇÕES ----function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, strg) >= 1 or getPlayerStorageValue(cid, strg2) >= 1 then setPlayerStorageValue(cid, strg, -1) setPlayerStorageValue(cid, strg2, -1) doRemoveItem(item.uid, 1) doRemoveCondition(cid, CONDITION_OUTFIT) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) else doPlayerSendCancel(cid, "Você não está morto para usar este item.") endreturn trueendTestei e funcionou perfeitamente. Caso haja bugs, favor relatar. Boa sorte. Mais isso ?
Postado Dezembro 13, 2014 10 anos Mais isso ? Adicione os creature events, é o que determinará um player como sendo um "zombie". Já a outra parte, você decide como vai querer que o player retorne a forma "humana". Daí fica a seu critério se será por uma action (item/alavanca) ou por um movement (portal/tile); basta adicionar o script referente a sua escolha. Editado Dezembro 13, 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.