ME

[Creatureevents]Pokemon Not Attack

Por meubk, 28 de jan. de 2011 em Globalevents e Spells

script
15
5.4k
meubkM
28 de janeiro de 2011 às 08:18

Olá, muita gente tá com duvida nisso, que o pokemon, ataca com o m1, e sozinho junto, vow enssinar uma formula de ele somente atacar com o m1, simples e rapido...

 

Na pasta creaturescript/scripts, crie um arquivo .lua com nome de notattack.lua, e adc esse script.

 

function onCast(cid, target)
if isMonster(target) or isPlayer(target) then
	return false
end
return true
end

 

no arkivo creaturesscript.xml adc á tag :

<event type="cast" name="NotAttack" event="script" value="notattack.lua"/>

 

agora é a parte + complicadinha...

se vc usa go/back do mkalo vc tem ki adc isso no script de go/back nessa parte :

registerCreatureEvent(pk, "DiePoke")
registerCreatureEvent(cid, "PlayerPokeDeath")
registerCreatureEvent(cid, "LogoutPoke")

 

vc muda para :

 

registerCreatureEvent(pk, "DiePoke")
registerCreatureEvent(pk, "NotAttack")
registerCreatureEvent(cid, "PlayerPokeDeath")
registerCreatureEvent(cid, "LogoutPoke")

 

é só ir adicionando :

registerCreatureEvent(pk, "NotAttack")

vc vai encontrar isso no arquivo tbem, de ride, surf, e fly, mude lá tbem.

 

e nos outros sistemas procure paster parecidas com a acima, e edite...

 

é bem melhor assim, não precisa criar 2 monstros.

 

 

fui.

Editado Janeiro 28 por xotservx

1 mês depois...
eurodrigoE
07 de fevereiro de 2011 às 10:23

cara vlw eu estava precisando muito desse system vlw mesmo

até +

VodkartV
07 de fevereiro de 2011 às 17:02

Muito bom fera

parabéns pelo seu trabalho não só nessa área de scripting como no fórum!

abraços

merda12M
10 de fevereiro de 2011 às 12:40

Aí cara ,eu não consegui.

O nome do meu arquivo não é go/back.

é goback.

 

e o meu arquivo dentro é diferente olha oque tem nele .

 

local pokein, pokeout = 2531,2531

function onDeath(cid, deathList)

local owner = getCreatureMaster(cid)

doPlayerSendTextMessage(owner, 21, "Your pokemon is dead.")

local item = getPlayerItemById(owner, TRUE, pokeout)

doTransformItem(item.uid, pokein)

doItemSetAttribute(item.uid, "aid", -1)

doRemoveCreature(cid)

return FALSE

end

 

 

Tem como ajudar?

Abraços, MERDA12

HolyMaNH
10 de fevereiro de 2011 às 17:41

@xotserv,

teria como alterar para o pokemon atacar somente com os ataques de defesa, se ele estive com battle ativo?

por exemplo ataque passivo?

meubkM
10 de fevereiro de 2011 às 17:49

poste o goback completo

merda12M
12 de fevereiro de 2011 às 15:03

Recitação :

 

 

Postou 10 fevereiro 2011 - 12:40

Aí cara ,eu não consegui.

O nome do meu arquivo não é go/back.

é goback.

 

e o meu arquivo dentro é diferente olha oque tem nele .

 

local pokein, pokeout = 2531,2531

function onDeath(cid, deathList)

local owner = getCreatureMaster(cid)

doPlayerSendTextMessage(owner, 21, "Your pokemon is dead.")

local item = getPlayerItemById(owner, TRUE, pokeout)

doTransformItem(item.uid, pokein)

doItemSetAttribute(item.uid, "aid", -1)

doRemoveCreature(cid)

return FALSE

end

 

 

 

Tem como ajudar?

Abraços, MERDA12

 

 

/\ EU JA ESCREVI MEU GO/BACK COMPLETO .. >:/

 

local pokein, pokeout = 2531,2531

function onDeath(cid, deathList)

local owner = getCreatureMaster(cid)

doPlayerSendTextMessage(owner, 21, "Your pokemon is dead.")

local item = getPlayerItemById(owner, TRUE, pokeout)

doTransformItem(item.uid, pokein)

doItemSetAttribute(item.uid, "aid", -1)

doRemoveCreature(cid)

return FALSE

end

Editado Fevereiro 12 por merda12

kpdoK
13 de fevereiro de 2011 às 19:01

ou se sabe como que coloca pvp no pokemon dash?

tipo eu posso botar pvp mode, colocar arena pvp mais não funciona se sabe como corrigir isso?

 

e tambem colocar sistema pra quando morrer perder xp ;x

por que no server pokemon dash nao da pra arrumar isso ¬¬

infernityI
16 de fevereiro de 2011 às 15:20

bom eu não usso essa versão de catch.

gostaria de saber se alguem sabe impor o script de xotservx nesse script goback ja tentei mas nao deu certo.

 

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 getItemAttribute(item.uid, "aid") == -1 then
return doPlayerSendCancel(cid, "Seu pokemon está morto.")
end	

if getPlayerStorageValue(cid, 25000) == 5 then       
return doPlayerSendCancel(cid, "Você está montando.")
end
if getPlayerStorageValue(cid, 23000) == 5 then
return doPlayerSendCancel(cid, "Você está voando.")
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(pk, "DiePoke")
registerCreatureEvent(cid, "PlayerPokeDeath")
registerCreatureEvent(cid, "LogoutPoke")
doPlayerSay(cid, "Go,"..poke_name.."!!", TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(creature), 188)
doTransformItem(getPlayerSlotItem(cid,8).uid, 2531, 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, 2532, 1)
doItemSetAttribute(getPlayerSlotItem(cid,8).uid,"name", poke_name .." Pokeball")
end
end
end
return true
end

Editado Fevereiro 16 por infernity

meubkM
16 de fevereiro de 2011 às 16:36

lol cara tá ai

 

registerCreatureEvent(pk, "DiePoke")
registerCreatureEvent(cid, "PlayerPokeDeath")
registerCreatureEvent(cid, "LogoutPoke")

 

vc num vio ai naum isso ?

 

só colocar embaixo

 

registerCreatureEvent(pk, "DiePoke")
registerCreatureEvent(cid, "PlayerPokeDeath")
registerCreatureEvent(cid, "LogoutPoke")
registerCreatureEvent(pk, "NotAttack")

 

só ter + atenção.

 

 

@merda12

 

é o goback da pasta do actions.

Editado Fevereiro 16 por xotservx

infernityI
16 de fevereiro de 2011 às 20:30

eu coloquei la so que continuo o pokemon atacando sozinho, gostaria de saber se a versão do pokemon ou ate mesmo o sistema de attack infringe na hora de colocar o script para o pokemon nao ataca sozinho.

 

uso a versão flash do server.

 

script dos moves eh esse : http://www.xtibia.com/forum/topic/148814-talkactionsystem-moves-15151/page_pid_984731#entrey984731

 

 

eu deixei assim no script... voce mando por em baixo

se tiver como coloca o sistema goback ja pronto posso ta errando talvez =/

voce tem alguma dica de um ot bom ai para download?

 

brigadão aii :D

 

 

Edit

esqueçi de add a tag kkkkk :winksmiley02:

Editado Maio 31 por infernity

1 mês depois...
HudsinH
12 de março de 2011 às 23:00

Nesse script o pokemon fica realmente sem atacar...

Teria algum que permite somente o ataque Melee do pokemon?

 

Pq adicionei aqui e o pokemon não ataca melee,fica apena seguindo e funciona os m1,m2...

mas não ataca em melee =/

 

HELP T.T

arkiresA
16 de março de 2011 às 12:30

A melhor maneira e fazendo dois arkivo de pokemon igual so mudando no final tipo paras e paras s o paras contendo so male atk para ser do treinador e paras s cendo selvagem contendo as magia para soltar *.*

2 semanas depois...
eternoE
24 de março de 2011 às 01:54

o meu continua atakando so, so ki demora um pouko para ele atakar!!

4 meses depois...
paviP
16 de julho de 2011 às 16:42

@Hudsin

 

acho que melee tem que fazer o seguinte em cada pokémon:

<attack name="melee" interval="2000" skill="24" attack="25"/>

obs: muda o ataque , interval , etc , em cada poke