Ir para conteúdo

[Npc] Hachibi - Para Narutibia


Posts Recomendados

Nome: Hachibi

Testado: Evolutions xml 7.81

 

Tae um npc pra quem queria no ot, as magias são padrão do Dno v2, você pode mudar...

É especialmente para os Googlers, então para de besteira e se cadastra logo.

E editado de outra org, mas foi retirado aquele negócio do npc vender comida, ja era :bigode:

Eu nao escrevo coisa com coisa, para de me olhar assim

 

Obs: O looktype é padrão do Client Dno v2 tambem.

Hachibi.xml

<?xml version="1.0"?>

 

<npc name="Hachibi" script="data/npc/scripts/Hachibi.lua" access="5" lookdir="3">

<mana now="800" max="800"/>

<health now="200" max="200"/>

<look type="236" head="2" body="95" legs="60" feet="132"/>

</npc>

 

Hachibi.lua

focus = 0

talk_start = 0

target = 0

following = false

attacking = false

 

function onThingMove(creature, thing, oldpos, oldstackpos)

 

end

 

 

function onCreatureAppear(creature)

 

end

 

 

function onCreatureDisappear(cid, pos)

if focus == cid then

selfSay('Até mais.')

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)

msg = string.lower(msg)

if ((string.find(msg, '(%a*)hi(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 4 then

if getPlayerStorageValue(cid,853) < 1 then

selfSay('Você passou nos testes, diga {sim} para continuar.')

focus = cid

talk_start = os.clock()

else

selfSay('Hey! Leave out of there! You are a renegade ninja!')

focus = 0

talk_start = 0

end

 

elseif string.find(msg, '(%a*)hi(%a*)') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then

selfSay('Desculpe, ' .. creatureGetName(cid) .. '! Falo com você em um minuto.') elseif focus == cid then

talk_start = os.clock()

 

 

if msgcontains(msg, 'sim') and focus == cid then

setPlayerStorageValue(cid,200,1)

setPlayerStorageValue(cid,5,1)

learnSpell(cid,'jinchuuriki hachibi adagas',0)

learnSpell(cid,'jinchuuriki hachibi ferry',0)

learnSpell(cid,'jinchuuriki hachibi no chakra',0)

learnSpell(cid,'jinchuuriki hachibi tizo',0)

learnSpell(cid,'hachibi atack',0) learnSpell(cid,'hachibi explosion',0)

learnSpell(cid,'hachibi protect',0)

selfSay('/makesay ' .. creatureGetName(cid) .. ',!cmot3416 236')

doPlayerSetVocation(cid,3)

doPlayerSendTextMessage(cid,22,"Você foi promovido a Hachibi, use seu novo jinchuuriki agora mesmo {jinchuuriki hachibi no chakra}.")

talk_start = os.clock()

end

end

 

 

function onCreatureChangeOutfit(creature)

 

end

 

 

function onThink()

if focus > 0 then

x, y, z = creatureGetPosition(focus)

myx, myy, myz = selfGetPosition()

if ((myy-y==0) and (myx-x<=0 and myx-x>=-4)) then

selfTurn(0)

end

if ((myy-y==0) and (myx-x>=0 and myx-x<=4)) then

selfTurn(2)

end

if ((myx-x==0) and (myy-y<=0 and myy-y>=-4)) then

selfTurn(1)

end

if ((myx-x==0) and (myy-y>=0 and myy-y<=4)) then

selfTurn(3)

end

if ((myy-y==-2) and (myx-x>=-1 and myx-x<=1)) then

selfTurn(1)

end

if ((myy-y==2) and (myx-x>=-1 and myx-x<=1)) then

selfTurn(3)

end

if ((myx-x==2) and (myy-y>=-1 and myy-y<=1)) then

selfTurn(2)

end

if ((myx-x==-2) and (myy-y>=-1 and myy-y<=1)) then

selfTurn(0)

end

if ((myy-y==-3) and (myx-x>=-2 and myx-x<=2)) then

selfTurn(1)

end

if ((myy-y==3) and (myx-x>=-2 and myx-x<=2)) then

selfTurn(3)

end

if ((myx-x==3) and (myy-y>=-2 and myy-y<=2)) then

selfTurn(2)

end

if ((myx-x==-3) and (myy-y>=-2 and myy-y<=2)) then

selfTurn(0)

end

if ((myy-y==-4) and (myx-x>=-3 and myx-x<=3)) then

selfTurn(1)

end

if ((myy-y==4) and (myx-x>=-3 and myx-x<=3)) then

selfTurn(3)

end

if ((myx-x==4) and (myy-y>=-3 and myy-y<=3)) then

selfTurn(2)

end

if ((myx-x==-4) and (myy-y>=-3 and myy-y<=3)) then

selfTurn(0)

end

end

if focus == 0 then

randmove = math.random(1,50)

if randmove == 1 then

selfMove(0)

end

if randmove == 2 then

selfMove(1)

end

if randmove == 3 then

selfMove(2)

end

if randmove == 4 then

selfMove(3)

end

end

if (os.clock() - talk_start) > 30 then

if focus > 0 then

selfSay('Próximo...')

end

focus = 0

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 3 then

selfSay('Até mais.')

focus = 0

end

end

end

end

 

Vermelho - magias ganhadas ao promover o char

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...