HU

[Encerrado] Npc De Duel

Por Huntre, 23 de abr. de 2011 em Tópicos Sem Resposta

18
3.3k
HuntreH
23 de abril de 2011 às 17:18

so esperando respostas !!

Editado Abril 27 por Huntre

MatheuzinhoulM
24 de abril de 2011 às 16:03

Tente usar o xml sem a tag parameters, ou o NPC vai ficar desconfigurado.

 

Assim:

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Brock" script="brock.lua" walkinterval="0" floorchange="0">
<health now="100" max="100"/>
<look type="178" head="17" body="54" legs="114" feet="0" addons="0"/>
</npc>

 

Tem quase certeza que irá funcionar, abraços.

 

#Edit

Responda: Yes

Editado Abril 24 por MatheusGuedes

HuntreH
26 de abril de 2011 às 16:45

agora ele so fala 16:43 Brock: Welcome, [GOD] Peteer! I have been expecting you. e no server diz [26/04/2011 16:43:30] [Warning - Npc::loadFromXml] Cannot load npc file (data/npc/brok.xml).

[26/04/2011 16:43:30] Info: failed to load external entity "data/npc/brok.xml"

 

 

falo battle , yes , e ele nao responde ):

Editado Abril 26 por Huntre

MatheuzinhoulM
26 de abril de 2011 às 20:34
[Warning - Npc::loadFromXml] Cannot load npc file (data/npc/brok.xml).

[26/04/2011 16:43:30] Info: failed to load external entity "data/npc/brok.xml"

 

Não seria Brock?

 

E outra, você precisa falar Duel e depois Yes.

Editado Abril 26 por MatheusGuedes

HuntreH
27 de abril de 2011 às 12:46

hmmm VLW MSM VELHO MAIS TTEM UMA COISA,

quando eu falo duel ele fala go golem ta dai o golem vem tudo certinho mais,quando mato o golem apareçe o corpo do golem :S e dai ele nao solta mais nenhum pokk(o negocio do pokemon ate que eu consigo add outros mais quando mato ele ele fica com o corpo dead no chao :S )

 

tem como arruma isso?

Editado Abril 27 por Huntre

luangustavo123456L
01 de maio de 2011 às 22:36

bom axo q vc deve ter feito um xml do Pokemon, só vc muda o corpse do golem dentro do xml dele ;)

sandim69S
02 de maio de 2011 às 13:29

Pow cara eu to tentando fazer o seguinte neste script, criar o pokeGolemBrock.LUA e colocar no script para chamar o Golem assim que ele morrer ao inves do corpse aparecer.

Mas to me complicando se vc tem mais facilidade com script tenta isso.

HuntreH
03 de maio de 2011 às 14:23

to tentando fazer assim que algum de nois conseguir bota aqui no topico blz?

sandim69S
04 de maio de 2011 às 12:41

Achei esse Npc Gary mas também ainda não consegui que ele funcione, deem uma olhada nele e vejam o que ta faltando.

 

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid)                          npcHandler:onCreatureAppear(cid)                        end
function onCreatureDisappear(cid)                       npcHandler:onCreatureDisappear(cid)                     end
function onCreatureSay(cid, type, msg)                  npcHandler:onCreatureSay(cid, type, msg)                end
function onThink()                                      npcHandler:onThink()                                    end


function creatureSayCallback(cid, type, msg)
       if(not npcHandler:isFocused(cid)) then
               return false
       end
       local storage = 9981
       local destino = {x=320,y=558,z=7,stackpos=1} 
       local pos = {x=320,y=558,z=7,stackpos=1}    
       local getstorage = getPlayerStorageValue(cid, storage)
       local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid


       if (msgcontains(msg:lower(), "hi") and getstorage == 0) then
	selfSay('Oi, eu sou Gary Oak, o sobrinho do grande pesquisador pokemon Prof. Oak e eu nao vou deixar vc sair daki sem um duelo ok?', cid)
	talk_state = 1
   if (msgcontains(msg:lower(), "yes") or msgcontains(msg:lower(), "duel")) and talk_state == 1 then
			selfSay('Go, Spearow', cid)
			doCreateMonster("Gary Spearow", getCreaturePosition(getNpcId()))
			doSendMagicEffect(getCreaturePosition(getNpcId()) , 10)
			setPlayerStorageValue(cid, storage, 1)
			end
	end		





   return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

HuntreH
04 de maio de 2011 às 18:08

oks vou ver isso mas primeiro temos que tenta resolver o bug do golem do brock ;s

 

 

 

gogog agente consegue !!

 

ae galera o forum do meu server embreve apresentarei no xtibia hehe http://pokemonfinalbattle.maisforum.com/

sandim69S
06 de maio de 2011 às 12:41

oks vou ver isso mas primeiro temos que tenta resolver o bug do golem do brock ;s

 

Tenho alguns arquivos que já estavam em meu OTS, mas não consigo adciona-los

Data/CreatureScripts/Scripts;

 

PlayerGym.lua;

function onKill(cid, target, lastHit)

if getCreatureTarget(cid) == 0 then
return true
end

if getPlayerStorageValue(cid, 55778) == 1 then
	if getCreatureName(getCreatureTarget(cid)) == "Gym Geodude" then
		setPlayerStorageValue(cid,987876, 1)
           doPlayerSendTextMessage(cid, 20,"Voce derrotou o Geodude do Brock.")
	elseif getCreatureName(getCreatureTarget(cid)) == "Gym Onix" then
           setPlayerStorageValue(cid,987877, 1)
           doPlayerSendTextMessage(cid, 20,"Você derrotou o Ônix do Brock.")
	end
end

return true
end

 

 

PokeGym.lua

function isSummon(uid)
return uid ~= getCreatureMaster(uid) or false
end

function onKill(cid, target, lastHit)

        if isSummon(target) then
           doSendMagicEffect(getCreaturePosition(cid), 10)
		setPlayerStorageValue(getCreatureMaster(target),64999, 1)
		if getCreatureName(cid) == "Gym Geodude" then
		setPlayerStorageValue(getCreatureMaster(target),574225, -1)
		doRemoveCreature(cid)
		elseif getCreatureName(cid) == "Gym Onix" then
		setPlayerStorageValue(getCreatureMaster(target),574226, -1)
		doRemoveCreature(cid)
		end
        elseif isPlayer(target) then
		doSendMagicEffect(getCreaturePosition(cid), 10)
		if getCreatureName(cid) == "Gym Geodude" then
		doRemoveCreature(cid)
		setPlayerStorageValue(target, 574225, -1)
		elseif getCreatureName(cid) == "Gym Onix" then
		setPlayerStorageValue(target ,574226, -1)
		doRemoveCreature(cid)
		end
	 end


return true
end

 

AJUDEM POR FAVOR!!!!

kelserificK
06 de maio de 2011 às 14:41

fale o erro, assim fica bem mais facil de ajudar..

sandim69S
06 de maio de 2011 às 15:36

fale o erro, assim fica bem mais facil de ajudar..

 

Vejam se é assim;

eu tenho que adciona-los em CreatureScript.xml certo?

mas como fasso isso?

 

tentei assim mas não funcionou;

<event type="death" name="PlayerGym" event="script" value="playergym.lua"/>
     <event type="death" name="PokeGym" event="script" value="pokegym.lua"/>

 

outra coisa nesse NPC do Brock como faz pra ele chamar o poke de volta?

fiz outro script diferentes mas ainda não consegui, apenas aparece o corpse do poke e ele nao volta pra pokebola.

 

Tentei fazer com apenas um poke

local nomeMonst = "Gym Geodude"
local itemid = 2150

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}                                                                                               

function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end

function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end

local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid

if getPlayerStorageValue(cid, 9755) == -1 then
if(msgcontains(msg, 'yes')) then
selfSay('Vai Geodude!', cid)
doSendMagicEffect(getCreaturePosition(getNpcId()) , 10) 
doCreateMonster(nomeMonst,getThingPos(cid))
talkState[talkUser] = 1
end
return true
end
if getPlayerStorageValue(cid, 9755) == 1 then
doSendMagicEffect(getCreaturePosition(getNpcId()) , 10)
selfSay('E..eu perdi.', cid)
doPlayerAddItem(cid, itemid,1)
setPlayerStorageValue(cid, 9755,2)
talkState[talkUser] = 0
return true
end
if getPlayerStorageValue(cid, 9755) == 2 then
selfSay('não quero mais batalhar com você.', cid)
talkState[talkUser] = 0
return true
end

return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

Vou tentar fazer uma quest do Brock pra ver se funciona.

 

VALEWWW!!

Editado Maio 6 por Sandim69

HuntreH
09 de maio de 2011 às 09:51

eae conseguiu?

sandim69S
09 de maio de 2011 às 18:54

eae conseguiu?

Nada!ta dificil ninguém qr ajudar, quem tem esses sistemas nao disponibiliza.

mas to tentando!!!!!