Ir para conteúdo

Pokes Passivos E Agressivos


ADMWolf

Posts Recomendados

Tipo do script:Creaturescripts

Protocolo (versão do Tibia):8.54

Servidor utilizado:Pokemon dash v6

Nível de experiência:intermediario

Adicionais/Informações:(

 

Estou precisando de um script que deixa os pokemons passivos igual svke eles só atacam se atacos o meu não funciona se alguem pudesse disponibilizar um tuturial...que funciona dou 1 semana de rep+

 

Ajuda no script

 

Wildpoke:

function onAttack(cid, target)
if isPlayer(getCreatureMaster(cid)) then
return true
end

local name = ""..getCreatureName(getCreatureMaster(target))..","
if not string.find(getPlayerStorageValue(cid,200), name) then
setPlayerStorageValue(cid, 17, 4)
doMonsterChangeTarget(cid)
local function walkagain(params)
if isCreature(params.cid) then
if not isCreature(getCreatureTarget(params.cid)) then
	if getCreatureSpeed(cid) == 0 then
	doChangeSpeed(cid, 110)
	end
end
end
end
addEvent(walkagain, 2000, {cid = cid})
if isCreature(getCreatureTarget(cid)) then
if getPlayerStorageValue(cid, 16) >= 1 then
return true
end
local newdir = math.random(0,3)
if isWalkable(getPosByDir(getThingPos(cid), newdir), cid) then
doPushCreature(cid, newdir, 1, 0)
	local function delay(params)
	if isCreature(cid) then
	setPlayerStorageValue(cid, 16, 0)
	end
	end
setPlayerStorageValue(cid, 16, 1)
addEvent(delay, math.random(2200, 3200), {cid = cid})
end
end
return true
end
if getPlayerStorageValue(cid, 17) == 4 then
setPlayerStorageValue(cid, 17, 5)
end
if isPlayer(getCreatureTarget(cid)) and #getCreatureSummons(target) >= 1 then
doMonsterSetTarget(cid, getCreatureSummons(target)[1])
end
return true
end


function onCast(cid, target)
if getPlayerStorageValue(cid, 17) == 4 then
return false
end
return true
end

function onDirection(cid, old, current)
if isPlayer(cid) then
return true
end
if isPlayer(getCreatureMaster(cid)) then
return true
end
if getPlayerStorageValue(cid, 17) == 4 then
if getCreatureSpeed(cid) >= 1 then
doChangeSpeed(cid, -getCreatureSpeed(cid))
end

return false
end
if getPlayerStorageValue(cid, 17) == 5 then
if getCreatureSpeed(cid) == 0 and isCreature(getCreatureTarget(cid)) then
doChangeSpeed(cid, getCreatureBaseSpeed(cid))
end
return true
end
return true
end

 

Poke Passivo Exemplo (Pidgey s):

<?xml version="1.0" encoding="UTF-8"?>
<monster name="Pidgey" nameDescription="a Pidgey" race="flying" experience="70" speed="160" manacost="300">
 <health now="500" max="500"/>
 <look type="30" head="0" body="0" legs="0" feet="0" corpse="5961"/>
 <strategy attack="100" defense="0"/>
 <flags>
   <flag summonable="1"/>
   <flag attackable="1"/>
   <flag hostile="1"/>
   <flag illusionable="1"/>
   <flag convinceable="1"/>
   <flag pushable="1"/>
   <flag canpushitems="0"/>
   <flag canpushcreatures="0"/>
   <flag targetdistance="1"/>
   <flag staticattack="90"/>
   <flag runonhealth="15"/>
 </flags>
   <attacks>
   <attack name="peck" interval="1000" chance="50" min="-10" max="-30">
   </attack>
   <attack name="mirror move" interval="3500" chance="90" min="-30" max="-45">
   </attack>
   <attack name="gust" interval="5000" chance="90" min="-20" max="-60">
   </attack>
   <attack name="wing attack" interval="4500" chance="90" min="-20" max="-50">
   </attack>
   <attack name="whirlwind" interval="7000" chance="90" min="-60" max="-80">
   </attack>
 </attacks>
 <defenses armor="1" defense="1"/>
 <immunities>
   <immunity physical="0"/>
   <immunity energy="0"/>
   <immunity fire="0"/>
   <immunity poison="0"/>
   <immunity lifedrain="0"/>
   <immunity paralyze="0"/>
   <immunity outfit="0"/>
   <immunity drunk="0"/>
   <immunity invisible="0"/>
 </immunities>
<voices interval="5000" chance="10">
   <voice sentence="Pidgey!"/>
   <voice sentence="Geyyy!"/>
</voices>
<loot>
   <item id="8823" countmax="1" chance="4000"/><!-- feather -->
   <item id="2694" countmax="10" chance="10000"/><!-- straw -->
</loot>
       <script>
<event name="BlockHit3"/>
<event name="BlockSpells"/>
<event name="AvoidLook"/>
<event name="Exp"/>
       </script>
</monster>

 

E o speed ta 100% e muito bobinho para postar aqui aguardo a resposta :construction:

Editado por AdimistradorWolf
Link para o comentário
Compartilhar em outros sites

Olá amigo,

 

substitua o seu wildpoke.xml por esse:

 

function onAttack(cid, target)

if isPlayer(getCreatureMaster(cid)) then

return true

end

 

local name = ""..getCreatureName(getCreatureMaster(target))..","

if not string.find(getPlayerStorageValue(cid,200), name) then

setPlayerStorageValue(cid, 17, 4)

doMonsterChangeTarget(cid)

local function walkagain(params)

if isCreature(params.cid) then

if not isCreature(getCreatureTarget(params.cid)) then

if getCreatureSpeed(cid) == 0 then

doChangeSpeed(cid, 110)

end

end

end

end

addEvent(walkagain, 2000, {cid = cid})

if isCreature(getCreatureTarget(cid)) then

if getPlayerStorageValue(cid, 16) >= 1 then

return true

end

local newdir = math.random(0,3)

if isWalkable(getPosByDir(getThingPos(cid), newdir), cid) then

doPushCreature(cid, newdir, 1, 0)

local function delay(params)

if isCreature(cid) then

setPlayerStorageValue(cid, 16, 0)

end

end

setPlayerStorageValue(cid, 16, 1)

addEvent(delay, math.random(2200, 3200), {cid = cid})

end

end

return true

end

if getPlayerStorageValue(cid, 17) == 4 then

setPlayerStorageValue(cid, 17, 5)

end

if isPlayer(getCreatureTarget(cid)) and #getCreatureSummons(target) >= 1 then

doMonsterSetTarget(cid, getCreatureSummons(target)[1])

end

return true

end

 

 

function onCast(cid, target)

if getPlayerStorageValue(cid, 17) == 4 then

return false

end

return true

end

 

function onDirection(cid, old, current)

if isPlayer(cid) then

return true

end

if isPlayer(getCreatureMaster(cid)) then

return true

end

if getPlayerStorageValue(cid, 17) == 4 then

if getCreatureSpeed(cid) >= 1 then

doChangeSpeed(cid, -getCreatureSpeed(cid))

end

 

return false

end

if getPlayerStorageValue(cid, 17) == 5 then

if getCreatureSpeed(cid) == 0 and isCreature(getCreatureTarget(cid)) then

doChangeSpeed(cid, getCreatureBaseSpeed(cid))

end

return true

end

return true

end

 

 

Acredito que agora vai funcionar.

Qualque dúvida poste aqui. :smile_positivo:

Link para o comentário
Compartilhar em outros sites

Novo PokeTibia Acaba de Inalgurar http://www.poke.oxiderpg.com.br/ Entre ja e Confira !!!

Novo Server de OpenTIBIA PVP Global Oxide Otserv 8.60 250xp http://www.ot.oxiderpg.com.br !!!

Tambem temos outros Servers de Games RPG/MMORPG Entre no Nosso Portal http://www.oxiderpg.com.br

OxideRPG Muito além de um so Mundo Muito alem de um so Jogo...

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...