Ei e mesmo,o script do Amher!
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 all amulets.')
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, 'amulets') then
selfSay('I sell aol (10k), ancient amulet (1.6k), broken amulet (20k), bronze amulet (100gps), bronzen necklace (300gps), crystal necklace (250gps), dragon necklace (400gps), garlic necklace (450gps), golden amulet (3k), platinum amulet (3.5k), protection amulet (300gps), elven amulet (500gps), ruby necklace (2k), scarab amulet (1.3k), scarf (500gps), silver amulet (300gps), silver necklace (1k), star amulet (1.2k), stone skin amulet (3k), strange symbol (200gps), strange talisman (350gps) and wolves teeth chain (50gps).')
elseif msgcontains(msg, 'amulet of loss') or msgcontains(msg, 'aol') then
buy(cid,2173,1,10000)
elseif msgcontains(msg, 'ancient amulet') then
buy(cid,2142,1,1600)
elseif msgcontains(msg, 'broken amulet') then
buy(cid,2196,1,20000)
elseif msgcontains(msg, 'bronze amulet') then
buy(cid,2172,1,100)
elseif msgcontains(msg, 'bronzen necklace') then
buy(cid,2126,1,300)
elseif msgcontains(msg, 'crystal necklace') then
buy(cid,2125,15,250)
elseif msgcontains(msg, 'dragon necklace') then
buy(cid,2201,15,400)
elseif msgcontains(msg, 'garlic necklace') then
buy(cid,2199,10,450)
elseif msgcontains(msg, 'golden amulet') then
buy(cid,2130,6,3000)
elseif msgcontains(msg, 'platinum amulet') then
buy(cid,2171,6,3500)
elseif msgcontains(msg, 'protection amulet') then
buy(cid,2200,15,300)
elseif msgcontains(msg, 'elven amulet') then
buy(cid,2198,4,500)
elseif msgcontains(msg, 'ruby necklace') then
buy(cid,2133,5,2000)
elseif msgcontains(msg, 'scarab amulet') then
buy(cid,2135,1,1300)
elseif msgcontains(msg, 'scarf') then
buy(cid,2135,1,500)
elseif msgcontains(msg, 'silver amulet') then
buy(cid,2170,1,300)
elseif msgcontains(msg, 'silver necklace') then
buy(cid,2132,1,1000)
elseif msgcontains(msg, 'star amulet') then
buy(cid,2131,1,1200)
elseif msgcontains(msg, 'stone skin amulet') then
buy(cid,2197,1,3000)
elseif msgcontains(msg, 'strange symbol') then
buy(cid,2319,1,200)
elseif msgcontains(msg, 'strange talisman') then
buy(cid,2161,1,350)
elseif msgcontains(msg, 'wolves teeth chain') then
buy(cid,2129,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 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 (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
o do Diamati
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 getPlayerVocation(cid) == 3 then
selfSay('Hello ' .. creatureGetName(cid) .. '! What spell do you want to learn?')
focus = cid
talk_start = os.clock()
else
selfSay('Sorry, I sell spells for paladins.')
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, 'light healing') then
learnSpell(cid,'exura',170)
elseif msgcontains(msg, 'create food') then
learnSpell(cid,'exevo pan',150)
elseif msgcontains(msg, 'intense healing') then
learnSpell(cid,'exura gran',350)
elseif msgcontains(msg, 'conjure arrow') then
learnSpell(cid,'exevo con',450)
elseif msgcontains(msg, 'heavy magic missle') then
learnSpell(cid,'adori gran',600)
elseif msgcontains(msg, 'haste') then
learnSpell(cid,'utani hur',600)
elseif msgcontains(msg, 'magic shield') then
learnSpell(cid,'utamo vita',450)
elseif msgcontains(msg, 'conjure bolt') then
learnSpell(cid,'exevo con mort',750)
elseif msgcontains(msg, 'ultimate healing') then
learnSpell(cid,'exura vita',1000)
elseif msgcontains(msg, 'conjure burst arrow') then
learnSpell(cid,'exevo con flam',1000)
elseif msgcontains(msg, 'conjure power bolt') then
learnSpell(cid,'exevo con vis',2000)
elseif msgcontains(msg, 'greater light') then
learnSpell(cid,'utevo gran lux',500)
elseif msgcontains(msg, 'light') then
learnSpell(cid,'utevo lux',100)
elseif msgcontains(msg, 'invisible') then
learnSpell(cid,'utana vid',1000)
elseif msgcontains(msg, 'find person') then
learnSpell(cid,'exiva',80)
elseif msgcontains(msg, 'magic rope') then
learnSpell(cid,'exani tera',200)
elseif string.find(msg, '(%a*)bye(%a*)') 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 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 (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
o do Mad
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 buy swords, clubs, axes, helmets, boots, legs, shields and armors.')
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, 'demon helmet') then
sell(cid,2498,1,80000)
elseif msgcontains(msg, 'royal helmet') then
sell(cid,2498,1,40000)
elseif msgcontains(msg, 'warrior helmet') then
sell(cid,2475,1,6000)
elseif msgcontains(msg, 'crusader helmet') then
sell(cid,2497,1,9000)
elseif msgcontains(msg, 'crown helmet') then
sell(cid,2491,1,5000)
elseif msgcontains(msg, 'devil helmet') then
sell(cid,2462,1,4000)
elseif msgcontains(msg, 'mystic turban') then
sell(cid,2663,1,500)
elseif msgcontains(msg, 'chain helmet') then
sell(cid,2458,1,35)
elseif msgcontains(msg, 'iron helmet') then
sell(cid,2459,1,30)
elseif msgcontains(msg, 'helmets') then
selfSay('I buy demon (80k), royal (40k), warrior (6k), crusader (9k), crown (5k), devil (4k), chain (35gp) and iron helmets (30gp), also mystic turbans (500gp).')
elseif msgcontains(msg, 'steel boots') and focus == cid then
sell(cid,2645,1,40000)
elseif msgcontains(msg, 'boh') or msgcontains(msg, 'boots of haste') and focus == cid then
sell(cid,2195,1,40000)
elseif msgcontains(msg, 'golden boots') and focus == cid then
sell(cid,2646,1,100000)
elseif msgcontains(msg, 'boots') then
selfSay('I buy golden boots (100k), steel boots (40k) and boots of haste (40k).')
elseif msgcontains(msg, 'magic plate armor') or msgcontains(msg, 'mpa') then
sell(cid,2472,1,100000)
elseif msgcontains(msg, 'dragon scale mail') or msgcontains(msg, 'dsm') then
sell(cid,2492,1,60000)
elseif msgcontains(msg, 'demon armor') then
sell(cid,2494,1,90000)
elseif msgcontains(msg, 'golden armor') then
sell(cid,2466,1,30000)
elseif msgcontains(msg, 'crown armor') then
sell(cid,2487,1,20000)
elseif msgcontains(msg, 'knight armor') then
sell(cid,2476,1,5000)
elseif msgcontains(msg, 'blue robe') then
sell(cid,2656,1,15000)
elseif msgcontains(msg, 'lady armor') then
sell(cid,2500,1,7500)
elseif msgcontains(msg, 'plate armor') then
sell(cid,2463,1,400)
elseif msgcontains(msg, 'brass armor') then
sell(cid,2465,1,200)
elseif msgcontains(msg, 'chain armor') then
sell(cid,2464,1,100)
elseif msgcontains(msg, 'armors') then
selfSay('I buy golden (30k), crown (20k), knight (5k), lady (7,5k), plate (400gp), brass (200gp) and chain armors (100gp), also mpa (100k), dsm (60k) and blue robes (15k).')
elseif msgcontains(msg, 'golden legs') then
sell(cid,2470,1,80000)
elseif msgcontains(msg, 'crown legs') then
sell(cid,2488,1,15000)
elseif msgcontains(msg, 'knight legs') then
sell(cid,2477,1,6000)
elseif msgcontains(msg, 'plate legs') then
sell(cid,2647,1,500)
elseif msgcontains(msg, 'brass legs') then
sell(cid,2478,1,100)
elseif msgcontains(msg, 'chain legs') then
sell(cid,2478,1,50)
elseif msgcontains(msg, 'legs') then
selfSay('I buy golden (80k), crown (15k), knight (6k), plate (500gp), brass (100gp) and chain legs (50gp).')
elseif msgcontains(msg, 'shield of the mastermind') or msgcontains(msg, 'mms') then
sell(cid,2514,1,80000)
elseif msgcontains(msg, 'demon shield') then
sell(cid,2520,1,40000)
elseif msgcontains(msg, 'blessed shield') then
sell(cid,2523,1,150000)
elseif msgcontains(msg, 'great shield') then
sell(cid,2522,1,100000)
elseif msgcontains(msg, 'vampire shield') then
sell(cid,2534,1,25000)
elseif msgcontains(msg, 'medusa shield') then
sell(cid,2536,1,8000)
elseif msgcontains(msg, 'amazon shield') then
sell(cid,2537,1,4000)
elseif msgcontains(msg, 'crown shield') then
sell(cid,2519,1,5000)
elseif msgcontains(msg, 'tower shield') then
sell(cid,2528,1,4000)
elseif msgcontains(msg, 'dragon shield') then
sell(cid,2516,1,3000)
elseif msgcontains(msg, 'guardian shield') then
sell(cid,2515,1,2000)
elseif msgcontains(msg, 'beholder shield') then
sell(cid,2518,1,1500)
elseif msgcontains(msg, 'dwarven shield') then
sell(cid,2525,1,100)
elseif msgcontains(msg, 'shields') then
selfSay('I buy blessed (150k), great (100k), demon (40k), vampire (25k), medusa (8k), amazon (4k), crown (5k), tower (4k), dragon (3k), guardian (2k), beholder (1k), and dwarven shields (100gp), also mms (80k)')
elseif msgcontains(msg, 'magic longsword') then
sell(cid,2390,1,150000)
elseif msgcontains(msg, 'warlord sword') then
sell(cid,2408,1,100000)
elseif msgcontains(msg, 'magic sword') then
sell(cid,2400,1,90000)
elseif msgcontains(msg, 'giant sword') then
sell(cid,2393,1,10000)
elseif msgcontains(msg, 'bright sword') then
sell(cid,2407,1,6000)
elseif msgcontains(msg, 'ice rapier') then
sell(cid,2396,1,4000)
elseif msgcontains(msg, 'fire sword') then
sell(cid,2392,1,3000)
elseif msgcontains(msg, 'serpent sword') then
sell(cid,2409,1,1500)
elseif msgcontains(msg, 'spike sword') then
sell(cid,2383,1,800)
elseif msgcontains(msg, 'two handed sword') then
sell(cid,2377,1,400)
elseif msgcontains(msg, 'broad sword') then
sell(cid,2413,1,70)
elseif msgcontains(msg, 'short sword') then
sell(cid,2406,1,30)
elseif msgcontains(msg, 'sabre') then
sell(cid,2385,1,25)
elseif msgcontains(msg, 'sword') then
sell(cid,2376,1,25)
elseif msgcontains(msg, 'swords') then
selfSay('I buy giant (10k), bright (6k), fire (3k) serpent (1.5k), spike (800gp) and two handed swords (400gp), also ice rapiers (4k), magic longswords (150k), magic swords (90k), warlord swords (100k) broad swords (70gp), short swords (30gp), sabres (25gp) and swords (25gp).')
elseif msgcontains(msg, 'dragon lance') then
sell(cid,2414,1,10000)
elseif msgcontains(msg, 'stonecutters axe') then
sell(cid,2431,1,90000)
elseif msgcontains(msg, 'guardian halberd') then
sell(cid,2427,1,7500)
elseif msgcontains(msg, 'fire axe') then
sell(cid,2432,1,10000)
elseif msgcontains(msg, 'knight axe') then
sell(cid,2430,1,2000)
elseif msgcontains(msg, 'double axe') then
sell(cid,2387,1,200)
elseif msgcontains(msg, 'halberd') then
sell(cid,2381,1,200)
elseif msgcontains(msg, 'battle axe') then
sell(cid,2378,1,100)
elseif msgcontains(msg, 'hatchet') then
sell(cid,2388,1,20)
elseif msgcontains(msg, 'axes') then
selfSay('I buy fire (10k), guardian halberds (7,5k) knight (2k), double (200gp) and battle axes (100gp), also dragon lances (10k), stonecutters axes (90k), halberds (200gp) and hatchets (20gp).')
elseif msgcontains(msg, 'war hammer') then
sell(cid,2391,1,6000)
elseif msgcontains(msg, 'thunder hammer') then
sell(cid,2421,1,90000)
elseif msgcontains(msg, 'skull staff') then
sell(cid,2436,1,10000)
elseif msgcontains(msg, 'dragon hammer') then
sell(cid,2434,1,2000)
elseif msgcontains(msg, 'clerical mace') then
sell(cid,2423,1,200)
elseif msgcontains(msg, 'battle hammer') then
sell(cid,2417,1,60)
elseif msgcontains(msg, 'mace') then
sell(cid,2398,1,30)
elseif msgcontains(msg, 'clubs') then
selfSay('I buy thunder hammers (90k), war (6k), dragon (2k) and battle hammers (60gp), also skull staffs (10k) and clerical maces (200gp).')
elseif msgcontains(msg, 'platinum amulet') then
sell(cid,2171,1,5000)
elseif msgcontains(msg, 'scarf') then
sell(cid,2661,1,1000)
elseif msgcontains(msg, 'amulets') then
selfSay('I buy platinum amulets (5k) and scarfs (1k).')
elseif string.find(msg, '(%a*)bye(%a*)') 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 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 (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
o do Seller
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 ropes (50gp), shovels (20gp), backpacks (10gp), manafluids (100gp), lifefluids (60gp), fishing rods (100gp) and torches (2gp). I buy vials (10gp).')
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, 'Mystic') then
SellHouseTo(cid,182,226,7)
elseif msgcontains(msg, 'shovel') then
buy(cid,2554,1,20)
elseif msgcontains(msg, 'backpack') then
buy(cid,1988,1,10)
elseif msgcontains(msg, 'manafluid') or msgcontains(msg, 'mana fluid') then
buy(cid,2006,7,100)
elseif msgcontains(msg, 'lifefluid') or msgcontains(msg, 'life fluid') then
buy(cid,2006,10,60)
elseif msgcontains(msg, 'fishing rod') then
buy(cid,2580,1,100)
elseif msgcontains(msg, 'torch') then
buy(cid,2050,1,2)
elseif msgcontains(msg, 'vial') or msgcontains(msg, 'flask') then
sell(cid,2006,1,10)
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 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 (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
o da Karina
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 runes, wands and rods.')
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, 'runes') then
selfSay('I sell hmms (50gps), uhs (150gps), gfbs (100gps), explosions (150gps), sds (200gps), Mana Runes (20k) and blank runes (5gps).')
elseif msgcontains(msg, 'wands') then
selfSay('I sell wand of inferno (15k), plague (5k), cosmic energy (10k), vortex (500gp) and dragonbreath (1k).')
elseif msgcontains(msg, 'rods') then
selfSay('I sell quagmire (10k), snakebite (500gp), tempest (15k), volcanic (5k) and moonlight rod (1k).')
elseif msgcontains(msg, 'inferno') then
buy(cid,2187,1,15000)
elseif msgcontains(msg, 'plague') then
buy(cid,2188,1,5000)
elseif msgcontains(msg, 'cosmic energy') then
buy(cid,2189,1,10000)
elseif msgcontains(msg, 'vortex') then
buy(cid,2190,1,500)
elseif msgcontains(msg, 'dragonbreath') then
buy(cid,2191,1,1000)
elseif msgcontains(msg, 'quagmire') then
buy(cid,2181,1,10000)
elseif msgcontains(msg, 'snakebite') then
buy(cid,2182,1,500)
elseif msgcontains(msg, 'tempest') then
buy(cid,2183,1,15000)
elseif msgcontains(msg, 'volcanic') then
buy(cid,2185,1,5000)
elseif msgcontains(msg, 'moonlight') then
buy(cid,2186,1,1000)
elseif msgcontains(msg, '100 hmm') then
buy(cid,2311,100,800)
elseif msgcontains(msg, '10 hmm') then
buy(cid,2311,10,80)
elseif msgcontains(msg, 'hmm') then
buy(cid,2311,5,40)
elseif msgcontains(msg, 'mana rune') then
buy(cid,2281,100,20000)
elseif msgcontains(msg, '100 uh') then
buy(cid,2273,100,4000)
elseif msgcontains(msg, '10 uh') then
buy(cid,2273,10,400)
elseif msgcontains(msg, 'uh') then
buy(cid,2273,1,40)
elseif msgcontains(msg, '100 gfb') then
buy(cid,2304,100,2000)
elseif msgcontains(msg, '10 gfb') then
buy(cid,2304,10,200)
elseif msgcontains(msg, 'gfb') then
buy(cid,2304,3,60)
elseif msgcontains(msg, '100 explosion') then
buy(cid,2313,100,2000)
elseif msgcontains(msg, '10 explosion') then
buy(cid,2313,10,200)
elseif msgcontains(msg, 'explosion') then
buy(cid,2313,3,60)
elseif msgcontains(msg, '100 sd') then
buy(cid,2268,100,9000)
elseif msgcontains(msg, '10 sd') then
buy(cid,2268,10,900)
elseif msgcontains(msg, 'sd') then
buy(cid,2268,1,90)
elseif msgcontains(msg, 'blank') then
buy(cid,2260,100,5)
elseif string.find(msg, '(%a*)bye(%a*)') 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 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 (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
ESSE FOI O FIM,BYE BYE