Taiger 286 Postado Abril 16, 2015 Share Postado Abril 16, 2015 Olá amigos, alguem tem ou sabe editar o script do revive normal para poder usar até o lv 250 e após disso não poder mais, tipo pxg? A outra duvida é com relação a o npc selvagem que tem no pda que ataca players, gostaria de saber se tem como editar ele para quando o player mata-lo ele desse xp e loot como um monstro, e outra coisa, ele atacasse o player que tivesse uma storage especifica. Script do npc: <?xml version="1.0" encoding="UTF-8"?> <npc name="Hunter" script=".aHunter.lua" walkinterval="3000" floorchange="0" speed="50"> <health now="1500" max="1500"/> <look type="1015" head="114" body="119" legs="114" feet="114" corpse="3058"/> <parameters> </parameters> </npc> Script do revive: function onUse(cid, item, frompos, item2, topos) if (item2.itemid == 13860 or item2.itemid == 13810) and (getPlayerGroupId(cid) < 4 or getPlayerGroupId(cid) > 6) then doRemoveItem(item2.uid) return true end if getPlayerStorageValue(cid, 990) >= 1 then doPlayerSendCancel(cid, "You can't use revive during gym battles.") return true elseif getPlayerStorageValue(cid, 52481) >= 1 then doPlayerSendCancel(cid, "You can't do that while a duel.") --alterado v1.6 return true elseif isPlayer(item2.uid) then doPlayerSendCancel(cid, "Please, use revive only on pokeballs.") return true end if item2.uid ~= getPlayerSlotItem(cid, 8).uid then return true end if item2.uid ~= getPlayerSlotItem(cid, 8).uid and not isInArray(getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid), item2.uid) then return true end for a, b in pairs (pokeballs) do if not item2.itemid == b.on or not item2.itemid == b.off then doPlayerSendCancel(cid, "Please, use revive only on pokeballs.") return true end end local pokeball = getPlayerSlotItem(cid, 8) for a, b in pairs (pokeballs) do if item2.itemid == b.on or item2.itemid == b.off then --edited deixei igual ao do PXG doTransformItem(item2.uid, b.on) doSetItemAttribute(item2.uid, "hp", 1) for c = 1, 15 do local str = "move"..c setCD(item2.uid, str, 0) end setCD(item2.uid, "control", 0) setCD(item2.uid, "blink", 0) --alterado v1.6 doSendMagicEffect(getThingPos(cid), 13) doRemoveItem(item.uid, 1) doCureBallStatus(getPlayerSlotItem(cid, 8).uid, "all") doCureStatus(cid, "all", true) cleanBuffs2(item2.uid) --alterado v1.5 --[[if getPlayerStorageValue(cid, storage) > 0 then setPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage)-1) end--]] return true end end return true end Obrigado desde ja. Link para o comentário https://xtibia.com/forum/topic/233234-pda-revive-lv-250-e-npc-que-da-loot-e-exp/ Compartilhar em outros sites More sharing options...
Gabrieltxu 738 Postado Abril 17, 2015 Share Postado Abril 17, 2015 (editado) Testa ai o revive , acho que é assim que está certo .... function onUse(cid, item, frompos, item2, topos)if (item2.itemid == 13860 or item2.itemid == 13810) and (getPlayerGroupId(cid) < 4 or getPlayerGroupId(cid) > 6) thendoRemoveItem(item2.uid)return trueendif getPlayerLevel(cid) => 250 then -- by gabrieltxudoPlayerSendCancel(cid, "Voce e level maior que 250, nao podera usar o mesmo revive.")return trueendif getPlayerStorageValue(cid, 990) >= 1 thendoPlayerSendCancel(cid, "You can't use revive during gym battles.")return trueelseif getPlayerStorageValue(cid, 52481) >= 1 thendoPlayerSendCancel(cid, "You can't do that while a duel.") --alterado v1.6return trueelseif isPlayer(item2.uid) thendoPlayerSendCancel(cid, "Please, use revive only on pokeballs.")return trueendif item2.uid ~= getPlayerSlotItem(cid, 8).uid thenreturn trueendif item2.uid ~= getPlayerSlotItem(cid, 8).uid and not isInArray(getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid), item2.uid) thenreturn trueendfor a, b in pairs (pokeballs) doif not item2.itemid == b.on or not item2.itemid == b.off thendoPlayerSendCancel(cid, "Please, use revive only on pokeballs.")return trueendendlocal pokeball = getPlayerSlotItem(cid, 8)for a, b in pairs (pokeballs) doif item2.itemid == b.on or item2.itemid == b.off then --edited deixei igual ao do PXGdoTransformItem(item2.uid, b.on)doSetItemAttribute(item2.uid, "hp", 1)for c = 1, 15 dolocal str = "move"..csetCD(item2.uid, str, 0)endsetCD(item2.uid, "control", 0)setCD(item2.uid, "blink", 0) --alterado v1.6doSendMagicEffect(getThingPos(cid), 13)doRemoveItem(item.uid, 1)doCureBallStatus(getPlayerSlotItem(cid, 8).uid, "all")doCureStatus(cid, "all", true)cleanBuffs2(item2.uid) --alterado v1.5--[[if getPlayerStorageValue(cid, storage) > 0 thensetPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage)-1)end--]]return trueendendreturn trueend sobre o sistema de npc de battle do pda é por npc mesmo nao sei se vai ter como fazer eles dar xp ao morrerem , pelo motivo de serem npc nao monstros , ja na pxg eles sao monstros ... entao acho que deve fazer isso pela source Editado Abril 17, 2015 por Gabrieltxu Link para o comentário https://xtibia.com/forum/topic/233234-pda-revive-lv-250-e-npc-que-da-loot-e-exp/#findComment-1646815 Compartilhar em outros sites More sharing options...
Taiger 286 Postado Abril 17, 2015 Autor Share Postado Abril 17, 2015 Vlw gabriel , eu ja tinha conseguido aqui igual ao seu, agora só falta o npc Link para o comentário https://xtibia.com/forum/topic/233234-pda-revive-lv-250-e-npc-que-da-loot-e-exp/#findComment-1646816 Compartilhar em outros sites More sharing options...
Gabrieltxu 738 Postado Abril 17, 2015 Share Postado Abril 17, 2015 Blz só reportar para que fechem e enviem para pedidos e duvidas resolvidos ... Link para o comentário https://xtibia.com/forum/topic/233234-pda-revive-lv-250-e-npc-que-da-loot-e-exp/#findComment-1646818 Compartilhar em outros sites More sharing options...
Taiger 286 Postado Abril 17, 2015 Autor Share Postado Abril 17, 2015 mais ainda nao resolvi o problema do npc :0 Link para o comentário https://xtibia.com/forum/topic/233234-pda-revive-lv-250-e-npc-que-da-loot-e-exp/#findComment-1646819 Compartilhar em outros sites More sharing options...
Gabrieltxu 738 Postado Abril 17, 2015 Share Postado Abril 17, 2015 mais ainda nao resolvi o problema do npc :0 já te falei ... só pela source , ctz Link para o comentário https://xtibia.com/forum/topic/233234-pda-revive-lv-250-e-npc-que-da-loot-e-exp/#findComment-1646823 Compartilhar em outros sites More sharing options...
Taiger 286 Postado Abril 18, 2015 Autor Share Postado Abril 18, 2015 Eu dei uma vasculhada nos npcs e achei os da equipe rocket e policiais, eles dropam loot. Tambem percebi que o script deles após matar todos os os pokes, eles se transformam em monstros. O loot consegui adicionar, mas a xp não. Link para o comentário https://xtibia.com/forum/topic/233234-pda-revive-lv-250-e-npc-que-da-loot-e-exp/#findComment-1647065 Compartilhar em outros sites More sharing options...
gabrielbsales 174 Postado Abril 18, 2015 Share Postado Abril 18, 2015 Bom, PDA é um poço de gambiarras, fazer mais uma não é problema.Pra o npc atacar apenas players com certo storage, no script do npc, nesse caso: <npc name="Hunter" script=".aHunter.lua" walkinterval="3000" floorchange="0" speed="50"> .aHunter.lua, procure pela função updateTarget, nessa linha: if isPlayer(_target) and not getTileInfo(getThingPos(_target)).protection then --alterado v1.8 antes do then, adicione: and getPlayerStorageValue(_target, 111222) == 1 onde, 111222 é o storage, e o 1 é o valor que ele checará se são iguais. Ficando assim: if isPlayer(_target) and not getTileInfo(getThingPos(_target)).protection and getPlayerStorageValue(_target, 111222) == 1 then --alterado v1.8 Pronto, agora ele só irá atacar quem tiver esse storage, agora, para o loot, no mesmo arquivo, procure pela chamada da função doCreateMonster, e veja o nome do monstro, vá em data/monster/System/nomedomonstro.xml Nesse caso há dois: monster = doCreateMonster("aHunter", myPos) monster = doCreateMonster("aHunterFemale", myPos) Então é só abrir o xml do monstro e adicionar o loot normalmente. Creio que o mesmo possa ser feito para a experiência, experience="0", mude para outro valor, pode funcionar. Link para o comentário https://xtibia.com/forum/topic/233234-pda-revive-lv-250-e-npc-que-da-loot-e-exp/#findComment-1647072 Compartilhar em outros sites More sharing options...
Taiger 286 Postado Abril 18, 2015 Autor Share Postado Abril 18, 2015 :0 Gabriel coloquei a exp normalmente no arquivo .xml e não deu em nada, adicionei a linha do monstro no configuration e tb nada Link para o comentário https://xtibia.com/forum/topic/233234-pda-revive-lv-250-e-npc-que-da-loot-e-exp/#findComment-1647075 Compartilhar em outros sites More sharing options...
Bruno 536 Postado Julho 14, 2015 Share Postado Julho 14, 2015 O tópico foi fechado e movido para lixeira por estar inativo a mais de 10 dias. Caso seja preciso reabrir o mesmo, favor entrar em contato com a equipe. Link para o comentário https://xtibia.com/forum/topic/233234-pda-revive-lv-250-e-npc-que-da-loot-e-exp/#findComment-1660516 Compartilhar em outros sites More sharing options...
Posts Recomendados