BI

Npc Que Vende Todas As Bp!

Por Big Smoke, 27 de jan. de 2007 em NPCs, monsters e raids

script
4
1.8k
Big SmokeB
27 de janeiro de 2007 às 15:54

Gente eu estava procurando aqui e achei varios NPCs que vendem todo tipo de bp mais todos estavão bugado então resolvi coloca este q eu dei uma editada!

Primeiramente todos sabem vao para data/npcs/scripits copie qualquer um e renomeie para colorbp.lua e ponha isto nele ( apague tudu que tiver e ponha )

 

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 (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
   selfSay('Hello, ' .. creatureGetName(cid) .. '! I sell colored backpacks, each cost 50gps.')
   focus = cid
   talk_start = os.clock()

	 elseif msgcontains(msg, 'hi') 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, 'brown backpack') then
	 buy(cid,1988,1,50)
 elseif msgcontains(msg, 'tiquanda backpack') then
	 buy(cid,3940,1,50)
 elseif msgcontains(msg, 'green backpack') then
	 buy(cid,1998,1,50)
 elseif msgcontains(msg, 'light backpack') then
	 buy(cid,1999,1,50)
 elseif msgcontains(msg, 'red backpack') then
	 buy(cid,2000,1,50)
 elseif msgcontains(msg, 'purple backpack') then
	 buy(cid,2001,1,50)
 elseif msgcontains(msg, 'blue backpack') then
	 buy(cid,2002,1,50)
 elseif msgcontains(msg, 'gray backpack') then
	 buy(cid,2003,1,50)
 elseif msgcontains(msg, 'yellow backpack') then
	 buy(cid,2004,1,50)

 elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
	 selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
	 focus = 0
	 talk_start = 0
 end
end
end


function onCreatureChangeOutfit(creature)

end


function onThink()
	 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) > 5 then
   selfSay('Good bye then.')
   focus = 0
	 end
 end
end

 

Feito isto salve tudu certinho...agora va para data/npcs copie qualquer um e renomeie para Yurinho Doido , apague tudo uq ah dentro e coloque isto:

 

<?xml version="1.0"?>
<npc name="Yurinho Doido" script="data/npc/scripts/colorbp.lua" access="3">
<look type="128" head="4" body="114" legs="132" feet="115"/>
</npc>

 

Ta ae o scripit do Yurinho Doido olha eu so dei uma editada eu nao considero os creditos a min!

 

COMENTE ELOGIOS E CRITICAS

 

Big Smoke

LucasratoL
27 de janeiro de 2007 às 17:43

pra mim ta otimo... foi prestativo :D

1 mês depois...
08 de fevereiro de 2007 às 04:41

Vlw cara, postem mais npcs, tem poucos úteis e que funcionam aqui na galeria.

3 meses depois...
skynagerloasS
24 de maio de 2007 às 21:43

Tópico contendo somente 1 NpC,

essa seção é para DataPacks com 3 ou mais Npcs,

~o{Tópico Movido}o~,

Abraços.