Ir para conteúdo

[Pokemon] Summon Attack


Faisher

Posts Recomendados

When monsters appears then go attack to player but with this system you have no errors.

Go to creaturescripts/scripts/ create a lua file called attackpokemon.lua and put this:

function onStatsChange(cid, attacker, type, combat, value)
local s = getCreatureSummons(cid)
if type == STATSCHANGE_HEALTHLOSS then	
if isMonster(attacker) then
	if #s == 1 then
	doMonsterSetTarget(attacker, s[1])
	doCreatureAddHealth(cid, value)
	end
end
end
return true
end

 

Creaturescripts.xml


<event type="statschange" name="AttackPokemon" event="script" value="name.lua"/>

 

 

Now go to login.lua and put:

 

registerCreatureEvent(cid, "AttackPokemon")

 

 

 

Bye bye :D

Link para o comentário
Compartilhar em outros sites

The attacked pokemon (wild) will only change target after it loses some life, because you used the function onStatsChange.

Try making it with onAttack / onCombat, and it will change once you click to attack it.

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...