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('Good bye then.')
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('Hello ' .. creatureGetName(cid) .. 'Voce Deseja Virar Anbu Medinin diga "sim".')
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('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.') elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'sim') and focus == cid then
buy(cid,6273,1,0)
buy(cid,6226,1,0)
buy(cid,6260,1,0)
setPlayerStorageValue(cid,200,1)
setPlayerStorageValue(cid,5,1)
learnSpell(cid,'anbu prision no jutsu',0)
learnSpell(cid,'anbu heal',0)
learnSpell(cid,'anbu shaikan',0)
learnSpell(cid,'nippon anbu medical',0)
selfSay('/makesay ' .. creatureGetName(cid) .. ',!cmot3416 65')
doPlayerSetVocation(cid,3)
doPlayerSendTextMessage(cid,22,"You have been promoted to a Anbu Medinin.")
talk_start = os.clock()
end
if msgcontains(msg, 'brown bread') and focus == cid then
buy(cid,2691,1,8)
talk_start = os.clock()
end
if msgcontains(msg, 'ham') and focus == cid then
buy(cid,2671,1,8)
talk_start = os.clock()
end
if msgcontains(msg, 'carrot') and focus == cid then
buy(cid,2362,1,8)
talk_start = os.clock()
end
if msgcontains(msg, 'meat') and focus == cid then
buy(cid,2666,1,8)
talk_start = os.clock()
end
if msgcontains(msg, 'apple') and focus == cid then
buy(cid,2674,1,8)
talk_start = os.clock()
end
if msgcontains(msg, 'brown mushroom') and focus == cid then
buy(cid,2789,1,8)
talk_start = os.clock()
end
if msgcontains(msg, 'egg') and focus == cid then
buy(cid,2695,1,8)
talk_start = os.clock()
end
if string.find(msg, '(%a*)bye(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 then
selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
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('Next Please...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 3 then
selfSay('Good bye then.')
focus = 0
end
end
end
end
info
Grupo: Campones
Registrado: 23/08/11
Posts: 60
Reputação: +12
Preciso mudar um script de 7.81 para 8.54 ?? tem como ?
se tiver como alguem saiba mude esse script de npc para mim.
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('Good bye then.') 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('Hello ' .. creatureGetName(cid) .. 'Voce Deseja Virar Anbu Medinin diga "sim".') 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('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.') elseif focus == cid then talk_start = os.clock() if msgcontains(msg, 'sim') and focus == cid then buy(cid,6273,1,0) buy(cid,6226,1,0) buy(cid,6260,1,0) setPlayerStorageValue(cid,200,1) setPlayerStorageValue(cid,5,1) learnSpell(cid,'anbu prision no jutsu',0) learnSpell(cid,'anbu heal',0) learnSpell(cid,'anbu shaikan',0) learnSpell(cid,'nippon anbu medical',0) selfSay('/makesay ' .. creatureGetName(cid) .. ',!cmot3416 65') doPlayerSetVocation(cid,3) doPlayerSendTextMessage(cid,22,"You have been promoted to a Anbu Medinin.") talk_start = os.clock() end if msgcontains(msg, 'brown bread') and focus == cid then buy(cid,2691,1,8) talk_start = os.clock() end if msgcontains(msg, 'ham') and focus == cid then buy(cid,2671,1,8) talk_start = os.clock() end if msgcontains(msg, 'carrot') and focus == cid then buy(cid,2362,1,8) talk_start = os.clock() end if msgcontains(msg, 'meat') and focus == cid then buy(cid,2666,1,8) talk_start = os.clock() end if msgcontains(msg, 'apple') and focus == cid then buy(cid,2674,1,8) talk_start = os.clock() end if msgcontains(msg, 'brown mushroom') and focus == cid then buy(cid,2789,1,8) talk_start = os.clock() end if msgcontains(msg, 'egg') and focus == cid then buy(cid,2695,1,8) talk_start = os.clock() end if string.find(msg, '(%a*)bye(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 then selfSay('Good bye, ' .. creatureGetName(cid) .. '!') focus = 0 talk_start = 0 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('Next Please...') end focus = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 3 then selfSay('Good bye then.') focus = 0 end end end endDo rep ++ quem ajudar