Canibas 0 Postado Fevereiro 12, 2011 Share Postado Fevereiro 12, 2011 Tipo do script: Pokeball Individual Protocolo (versão do Tibia): 8.54 Servidor utilizado: The Forgotten Server Nível de experiência: Intermediário Adicionais/Informações: Pokeballs individuais, quando vc clica nela sumona o monstro, clica nele volta para a pokeball e se o monstro morrer a pokeball some! Se alguem conseguir fazer esse script pra mim eu agradeço! ReP + Link para o comentário https://xtibia.com/forum/topic/151455-pokeballs-individuais/ Compartilhar em outros sites More sharing options...
jeancassio2010 13 Postado Fevereiro 12, 2011 Share Postado Fevereiro 12, 2011 (editado) Tipo do script: Pokeball Individual Protocolo (versão do Tibia): 8.54 Servidor utilizado: The Forgotten Server Nível de experiência: Intermediário Adicionais/Informações: Pokeballs individuais, quando vc clica nela sumona o monstro, clica nele volta para a pokeball e se o monstro morrer a pokeball some! Se alguem conseguir fazer esse script pra mim eu agradeço! ReP + Vá na Pasta data/actions/scripts copie um arquivo qualquer e renomeie para ball.lua abra apague tudo o que tem dentro e bote isso: function onUse(cid, item, fromPosition, itemEx, toPosition) function getPokemonMaxLife(name) local file = io.open('data/monster/monsters.xml','r') local arquivo = file:read(-1):lower():match('<monster name="'..name:lower()..'" file="(.-)"/>') file:close() local data = io.open('data/monster/'..(arquivo or ''),'r') if not data then return 100 end local maximo = data:read(-1):match('max%s*=%s*"(%d+)"') data:close() return maximo end ----- Config ----- local MaximoSummon = 1 local nome = getItemName(item.uid) local poke_name = nome:match('(.-) Pokeball') local summons = getCreatureSummons(cid) local action_id = getItemAttribute(item.uid, "aid") ----- Config ----- if getPlayerStorageValue(cid, 63215) >= 1 then return doPlayerSendCancel(cid, "You can't use pokeball while surfing.") end if getPlayerStorageValue(cid, 62314) >= 1 then return doPlayerSendCancel(cid, "You can't use pokeball while flying.") end local summons = getCreatureSummons(cid) if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid then doPlayerSendCancel(cid, "Para Soltar seus pokemons, coloque-os no slot da pokeball.") return TRUE end if(table.maxn(summons) < MaximoSummon) then -- no summons creature = doSummonCreature(poke_name, getCreaturePosition(cid)) doConvinceCreature(cid, creature) registerCreatureEvent(creature, "ball") registerCreatureEvent(cid, "PlayerPokeDeath") registerCreatureEvent(cid, "LogoutPoke") doPlayerSay(cid, "Go,"..poke_name.."!!", TALKTYPE_ORANGE_1) doSendMagicEffect(getCreaturePosition(creature), 188) doTransformItem(getPlayerSlotItem(cid,8).uid, 2569, 1) doItemSetAttribute(getPlayerSlotItem(cid,8).uid,"name", poke_name .." Pokeball") if action_id ~= 0 then doCreatureAddHealth(creature, -(tonumber(getPokemonMaxLife(poke_name) - action_id))) else doCreatureAddHealth(creature, getPokemonMaxLife(poke_name)) end else for _, pid in ipairs(summons) do if (table.maxn(summons) >= 1) then doItemSetAttribute(item.uid, "aid", getCreatureHealth(summons[1])) doSendMagicEffect(getCreaturePosition(getCreatureSummons(cid)[1]), 188) doPlayerSay(cid, "Back,"..poke_name..".", TALKTYPE_ORANGE_1) doRemoveCreature(pid) doTransformItem(getPlayerSlotItem(cid,8).uid, 2533, 1) doItemSetAttribute(getPlayerSlotItem(cid,8).uid,"name", poke_name .." Pokeball") end end end return true end depois em actions.xml adicione essa tag: <action itemid="2569;2533" event="script" value="ball.lua"/> Agora vá em data/creaturescripts/scripts, copie um arquivo qualquer e renomeie para ball.lua, apague o que tem dentro e adicione isso: local pokein, pokeout = 2533,2569 function onDeath(cid, deathList) local owner = getCreatureMaster(cid) doPlayerSendTextMessage(owner, 21, "You pokemon died.") local item = getPlayerItemById(owner, TRUE, pokeout) doRemoveItem(item.uid, pokein) return FALSE end Em creaturescripts.xml adicione essa tag: <event type="death" name="ball" event="script" value="ball.lua"/> Em items.xml na pasta data/items edite isso: <item id="2533" article="a" name="griffin shield"> <attribute key="weight" value="5000" /> <attribute key="defense" value="29" /> <attribute key="weaponType" value="shield" /> Para isso: <item id="2533" article="a" name="pokebal3"> <attribute key="weight" value="100" /> <attribute key="slotType" value="feet" /> Agora procure por isso: <item id="2569" article="an" name="oven spatula"> <attribute key="weight" value="1400" /> <attribute key="slotType" value="feet" /> Mude para isso: <item id="2569" article="an" name="pokebal4"> <attribute key="slotType" value="feet" /> Testado. de rep+ aew falow. ----Edited----- Se vc quiser o catch poste aki que posto ok. Editado Fevereiro 12, 2011 por jeancassio Link para o comentário https://xtibia.com/forum/topic/151455-pokeballs-individuais/#findComment-1000596 Compartilhar em outros sites More sharing options...
Canibas 0 Postado Fevereiro 12, 2011 Autor Share Postado Fevereiro 12, 2011 funcionou vlw lek! rep+ :smile_positivo: Link para o comentário https://xtibia.com/forum/topic/151455-pokeballs-individuais/#findComment-1000728 Compartilhar em outros sites More sharing options...
Posts Recomendados