LA

Novidade: Poketibia 9.60

Por lazarocp, 05 de mar. de 2014 em OTServer Alternativo (ATS)

9.6
tibia
otserv
script
5.0 (1)
205
35.4k
lazarocpL
16 de março de 2014 às 10:03

.

Editado Outubro 5 por lazarocp

zerefshirouZ
16 de março de 2014 às 15:30
@lazarocp


Sim getPokemonBoost funciona normalmente, ela só existe para organizar, da uma olhada nela...


function getPokemonBoost(poke)
if not isSummon(poke) then return 0 end
return getItemAttribute(getPlayerSlotItem(getCreatureMaster(poke), 8).uid, "boost") or 0
end


Catch não precisa de ID dos corpses (acho que no PDA também não, se precisa, não vi onde, tanto é que eu retirei da tabela), o catch pega o nome pelo corpo (fainted Bulbasaur, retira o "fainted ", volta Bulbasaur), então não precisa do id do corpo...

Como eu disse em um outro post, eu movi algumas funções de seu lugar original pra lib, então se no seu tiver 2 pode dar conflito ou algo assim (imagino eu)


Qual problema que da no catch?

StrogmanS
16 de março de 2014 às 17:11

zeref quando desloga com o poke fora da ball e quando loga o poke ta morto ai coloquei a tang do logout ai quando o poke é atk pede life ai se deslogar e quando logar o poke vai ta com a life cheia mais se o poke for atkd peder life e puxar ele pra ball ai soltar ele e deslogar com ele fora da ball e quando logar ele vai ta com a life que tava quando foi atkd e pedido a life mais ai pede life de novo ai deslogar ele vai voltar com a life que tava antes

lazarocpL
16 de março de 2014 às 17:20

.

Editado Outubro 5 por lazarocp

StrogmanS
16 de março de 2014 às 17:22

O problema não e nada ele só não funciona

 

já tentou trocar o nome do corpo no items.xml para fainted Bulbasaur

lazarocpL
16 de março de 2014 às 17:30

.

Editado Outubro 5 por lazarocp

zerefshirouZ
16 de março de 2014 às 17:35

@gristony

Se for reportar algo, tente reportar em português...

 

Mas pelo que eu entendi, foi erro meu... troque o goback.lua (creaturescripts) por esse:

 

 

 

function onLogout(cid)

if not isCreature(cid) then return true end
thisitem = getPlayerSlotItem(cid, 8)
if thisitem.uid <= 0 then return true end
if not pokeballs[getItemAttribute(thisitem.uid, "btype")] then return true end
pokename = getItemAttribute(thisitem.uid, "poke")
btype = getItemAttribute(thisitem.uid, "btype")
balls = pokeballs[btype]
if #getCreatureSummons(cid) >= 1 and thisitem.uid > 1 then
doReturnPokemon(cid, getCreatureSummons(cid)[1], thisitem, balls.Effect)
end
return true
end
deathtexts = {"Oh no! POKENAME, come back!", "Come back, POKENAME!", "That's enough, POKENAME!", "You did well, POKENAME!", "You need to rest, POKENAME!", "Nice job, POKENAME!", "POKENAME, you are too hurt!"}
function onDeath(cid, deathList)
local owner = getCreatureMaster(cid)
local thisball = getPlayerSlotItem(owner, 8)
local ballName = getItemAttribute(thisball.uid, "poke")
btype = getItemAttribute(thisball.uid, "btype")
balls = pokeballs[btype]
doSendMagicEffect(getThingPos(cid), balls.Effect)
doTransformItem(thisball.uid, balls.all[3])
local say = deathtexts[math.random(#deathtexts)]
doCreatureSay(owner, string.gsub(say, "POKENAME", getCreatureName(cid)), TALKTYPE_SAY)
doItemSetAttribute(thisball.uid, "aid", 0)
doRemoveCreature(cid)
return false
end

@lazarocp
Qual era o problema?
AAAAAAH, era isso, por isso senti que estava esquecendo algo!
Script heal.lua da Nurse:

function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye sir!')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
local msg = string.lower(msg)
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
for a, b in pairs(gobackmsgs) do
local gm = string.gsub(b.go, "doka!", "")
local bm = string.gsub(b.back, "doka!", "")
if string.find(string.lower(msg), string.lower(gm)) or string.find(string.lower(msg), string.lower(bm)) then
return true
end
end
if((msgcontains(msg, 'hi') or msgcontains(msg, 'heal') or msgcontains(msg, 'help')) and (getDistanceToCreature(cid) <= 3)) then
if exhaustion.get(cid, 9211) then
selfSay('Please wait a few moment before asking me to heal your pokemons again!')
return true
end
if not getTileInfo(getThingPos(cid)).protection and nurseHealsOnlyInPZ then
selfSay("Please, get inside the pokémon center to heal your pokemons!")
return true
end
exhaustion.set(cid, 9211, 5)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))
doSendMagicEffect(getThingPos(cid), 132)
local mypb = getPlayerSlotItem(cid, 8)
if #getCreatureSummons(cid) >= 1 then
local s = getCreatureSummons(cid)[1]
doCreatureAddHealth(s, getCreatureMaxHealth(s))
doSendMagicEffect(getThingPos(s), 13)
else
if mypb.itemid >= 1 then
doItemSetAttribute(mypb.uid, "aid", 1)
if getPlayerStorageValue(cid, 17000) <= 0 and getPlayerStorageValue(cid, 17001) <= 0 and getPlayerStorageValue(cid, 63215) <= 0 then
for a, b in pairs (pokeballs) do
if isInArray(b.all, mypb.itemid) then
doTransformItem(mypb.uid, b.all[1])
end
end
end
end
end
local bp = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK)
for cureballs = 1, #pokeballs do
for times = 1, 3 do
local items = getItemsInContainerById(bp.uid, pokeballs[cureballs].all[times])
if #items >= 1 then
for _, uid in pairs(items) do
doItemSetAttribute(uid, "aid", 1)
doTransformItem(uid, pokeballs[cureballs].all[1])
end
end
end
end
selfSay('There you go! You and your pokemons are healthy again.')
end
end

Uma coisa que percebi (pelo menos aqui), não da pra soltar "summon" no Centro Pokemon, acredito que seja nas sources
E se for editar isso, aproveita e coloca pra não entrar em PZ com Fight
Edit:
Fui atacar meu pokémon pra dar dano nele, mas deu erro no "playerattack.lua (creaturescripts)" então alterei o script, só coloquei 2 coisas, não pode atacar player nem summon

function onTarget(cid, target)
if isPlayer(target) or isSummon(target)then return false end
return true
end

Bonus: Fui deixar o Bulbasaur com pouca vida pra ter certeza que a Nurse tava funcionando normalmente deixei ele bater e matei ele, e apareceu isso... Hue Hue
bulbasaur%2520zueiro.png

Editado Março 16 por ZerefShirou

Jakson SouzaJ
16 de março de 2014 às 17:46

oO zeref vicio :)

ExtremexE
16 de março de 2014 às 18:18

lazarocp fiz umas spells esta no face de uma olhada nelas se gostar eu faço mais!

Editado Março 16 por Extremex

StrogmanS
16 de março de 2014 às 18:29

Voce não viu o "deicha pra lá já arrumei kkk

 

não tava editado o seu poste quando eu vi. porriso que comentei pq nao tinha no seu poste dizer que já tinha arrumado quando eu vi ele.

 

 

@gristony

Se for reportar algo, tente reportar em português...

 

Mas pelo que eu entendi, foi erro meu... troque o goback.lua (creaturescripts) por esse:

 

 

 

function onLogout(cid)

if not isCreature(cid) then return true end
thisitem = getPlayerSlotItem(cid, 8)
if thisitem.uid <= 0 then return true end
if not pokeballs[getItemAttribute(thisitem.uid, "btype")] then return true end
pokename = getItemAttribute(thisitem.uid, "poke")
btype = getItemAttribute(thisitem.uid, "btype")
balls = pokeballs[btype]
if #getCreatureSummons(cid) >= 1 and thisitem.uid > 1 then
doReturnPokemon(cid, getCreatureSummons(cid)[1], thisitem, balls.Effect)
end
return true
end
deathtexts = {"Oh no! POKENAME, come back!", "Come back, POKENAME!", "That's enough, POKENAME!", "You did well, POKENAME!", "You need to rest, POKENAME!", "Nice job, POKENAME!", "POKENAME, you are too hurt!"}
function onDeath(cid, deathList)
local owner = getCreatureMaster(cid)
local thisball = getPlayerSlotItem(owner, 8)
local ballName = getItemAttribute(thisball.uid, "poke")
btype = getItemAttribute(thisball.uid, "btype")
balls = pokeballs[btype]
doSendMagicEffect(getThingPos(cid), balls.Effect)
doTransformItem(thisball.uid, balls.all[3])
local say = deathtexts[math.random(#deathtexts)]
doCreatureSay(owner, string.gsub(say, "POKENAME", getCreatureName(cid)), TALKTYPE_SAY)
doItemSetAttribute(thisball.uid, "aid", 0)
doRemoveCreature(cid)
return false
end

@lazarocp
Qual era o problema?
AAAAAAH, era isso, por isso senti que estava esquecendo algo!
Script heal.lua da Nurse:

function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye sir!')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
local msg = string.lower(msg)
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
for a, b in pairs(gobackmsgs) do
local gm = string.gsub(b.go, "doka!", "")
local bm = string.gsub(b.back, "doka!", "")
if string.find(string.lower(msg), string.lower(gm)) or string.find(string.lower(msg), string.lower(bm)) then
return true
end
end
if((msgcontains(msg, 'hi') or msgcontains(msg, 'heal') or msgcontains(msg, 'help')) and (getDistanceToCreature(cid) <= 3)) then
if exhaustion.get(cid, 9211) then
selfSay('Please wait a few moment before asking me to heal your pokemons again!')
return true
end
if not getTileInfo(getThingPos(cid)).protection and nurseHealsOnlyInPZ then
selfSay("Please, get inside the pokémon center to heal your pokemons!")
return true
end
exhaustion.set(cid, 9211, 5)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))
doSendMagicEffect(getThingPos(cid), 132)
local mypb = getPlayerSlotItem(cid, 8)
if #getCreatureSummons(cid) >= 1 then
local s = getCreatureSummons(cid)[1]
doCreatureAddHealth(s, getCreatureMaxHealth(s))
doSendMagicEffect(getThingPos(s), 13)
else
if mypb.itemid >= 1 then
doItemSetAttribute(mypb.uid, "aid", 1)
if getPlayerStorageValue(cid, 17000) <= 0 and getPlayerStorageValue(cid, 17001) <= 0 and getPlayerStorageValue(cid, 63215) <= 0 then
for a, b in pairs (pokeballs) do
if isInArray(b.all, mypb.itemid) then
doTransformItem(mypb.uid, b.all[1])
end
end
end
end
end
local bp = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK)
for cureballs = 1, #pokeballs do
for times = 1, 3 do
local items = getItemsInContainerById(bp.uid, pokeballs[cureballs].all[times])
if #items >= 1 then
for _, uid in pairs(items) do
doItemSetAttribute(uid, "aid", 1)
doTransformItem(uid, pokeballs[cureballs].all[1])
end
end
end
end
selfSay('There you go! You and your pokemons are healthy again.')
end
end

Uma coisa que percebi (pelo menos aqui), não da pra soltar "summon" no Centro Pokemon, acredito que seja nas sources
E se for editar isso, aproveita e coloca pra não entrar em PZ com Fight
Edit:
Fui atacar meu pokémon pra dar dano nele, mas deu erro no "playerattack.lua (creaturescripts)" então alterei o script, só coloquei 2 coisas, não pode atacar player nem summon

function onTarget(cid, target)
if isPlayer(target) or isSummon(target)then return false end
return true
end

Bonus: Fui deixar o Bulbasaur com pouca vida pra ter certeza que a Nurse tava funcionando normalmente deixei ele bater e matei ele, e apareceu isso... Hue Hue
bulbasaur%2520zueiro.png

 

 

blz XD

lazarocpL
16 de março de 2014 às 18:39

.

 

Editado Outubro 5 por lazarocp

SlicerS
16 de março de 2014 às 18:50

@lazarocp

pda poe o id do corpo na lib mas n usa.. eh como o zeref flo, pega pelo nome do corpo tirando o fainted... o id na lib n serve pra nd ^^

lazarocpL
16 de março de 2014 às 19:02

REmovido.

Editado Março 16 por lazarocp

17 de março de 2014 às 06:39

ae vi q precisam de mapper pra desenvolver o mapa sou novo no xtibia e ando meio sem tempo mais posso ajudar...me adc no skype gabriel-1311@hotmail.com q dai a gente conversa :x

Wesleybr17W
17 de março de 2014 às 10:11

pq vc tirou a 5 e 6 geraçao e a mega?? coloca ai de novo