- Forum ExCity OTS http://www.excity.pun.pl/index.php - Skrypty http://www.excity.pun.pl/viewforum.php?id=6 - [8.1]npc all addon seller !! HIT http://www.excity.pun.pl/viewtopic.php?id=11 |
ziele - 2008-11-18 18:11:40 |
Więc Robimy plik może najpierw data/npc/scripts/addony.lua Kod:local focus = 0 local talk_start = 0 local target = 0 local following = false local 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('Elo, ' .. creatureGetName(cid) .. '! Ja sprzedaje Item na Addon.') focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('Przepraszam, ' .. creatureGetName(cid) .. '! Rozmiawiam z toba juz minute.') elseif focus == cid then talk_start = os.clock() if msgcontains(msg, 'oferta') then selfSay('Sprzedaje Wszystkie itemki na addon!') elseif msgcontains(msg, 'magic sulphurs') then buy(cid,5904,getCount(msg),1000) elseif msgcontains(msg, 'ankhs') then buy(cid,2327,getCount(msg),100) elseif msgcontains(msg, 'soul stone') then buy(cid,5809,getCount(msg),20000) elseif msgcontains(msg, 'minotaur leather') then buy(cid,5878,getCount(msg),100) elseif msgcontains(msg, 'chicken feather') then buy(cid,5890,getCount(msg),10) elseif msgcontains(msg, 'honeycomb') then buy(cid,5902,getCount(msg),20) elseif msgcontains(msg, 'engraved crossbow') then buy(cid,5947,getCount(msg),8000) elseif msgcontains(msg, 'lizard leather') then buy(cid,5876,getCount(msg),100) elseif msgcontains(msg, 'red dragon leather') then buy(cid,5948,getCount(msg),100) elseif msgcontains(msg, 'enchanted chicken wings') then buy(cid,5891,getCount(msg),2500) elseif msgcontains(msg, 'royal steel') then buy(cid,5887,getCount(msg),5000) elseif msgcontains(msg, 'hell steel') then buy(cid,5888,getCount(msg),5000) elseif msgcontains(msg, 'draconian steel') then buy(cid,5889,getCount(msg),5000) elseif msgcontains(msg, 'sniper glove') then buy(cid,5875,getCount(msg),5000) elseif msgcontains(msg, 'chunk of crude iron') then buy(cid,5892,getCount(msg),13000) elseif msgcontains(msg, 'iron ores') then buy(cid,5880,getCount(msg),100) elseif msgcontains(msg, 'behemoth fangs') then buy(cid,5893,getCount(msg),100) elseif msgcontains(msg, 'damaged steel helmet') then buy(cid,5924,getCount(msg),8000) elseif msgcontains(msg, 'warriors sweat') then buy(cid,5885,getCount(msg),20000) elseif msgcontains(msg, 'winning lottery ticket') then buy(cid,5958,getCount(msg),16000) elseif msgcontains(msg, 'bat wing') then buy(cid,5894,getCount(msg),50) elseif msgcontains(msg, 'red pieces of cloth') then buy(cid,5911,getCount(msg),300) elseif msgcontains(msg, 'ape fur') then buy(cid,5883,getCount(msg),100) elseif msgcontains(msg, 'holy orchid') then buy(cid,5922,getCount(msg),400) elseif msgcontains(msg, 'spools of spider silk yarn') then buy(cid,5886,getCount(msg),2000) elseif msgcontains(msg, 'lizard scale') then buy(cid,5881,getCount(msg),100) elseif msgcontains(msg, 'red dragon scale') then buy(cid,5882,getCount(msg),300) elseif msgcontains(msg, 'fighting spirit') then buy(cid,5884,getCount(msg),20000) elseif msgcontains(msg, 'vampire dust') then buy(cid,5905,getCount(msg),1000) elseif msgcontains(msg, 'green pieces of cloth') then buy(cid,5910,getCount(msg),500) elseif msgcontains(msg, 'wolf paws') then buy(cid,5897,getCount(msg),200) elseif msgcontains(msg, 'bear paws') then buy(cid,5896,getCount(msg),200) elseif msgcontains(msg, 'griffinclaw flower sample') then buy(cid,5937,getCount(msg),1000) elseif msgcontains(msg, 'water from the hydra cave') then buy(cid,5938,getCount(msg),5000) elseif msgcontains(msg, 'demon dust') then buy(cid,5906,getCount(msg),800) elseif msgcontains(msg, 'blessed wooden stake') then buy(cid,5942,getCount(msg),8000) elseif msgcontains(msg, 'Ceirons wolf tooth chain') then buy(cid,5940,getCount(msg),1000) elseif msgcontains(msg, 'mermaid comb') then buy(cid,5945,getCount(msg),10000) elseif msgcontains(msg, 'fish fins') then buy(cid,5895,getCount(msg),300) elseif msgcontains(msg, 'blue piece of cloth') then buy(cid,5912,getCount(msg),200) elseif msgcontains(msg, 'hardened bones') then buy(cid,5925,getCount(msg),300) elseif msgcontains(msg, 'turtle shells') then buy(cid,5899,getCount(msg),200000) elseif msgcontains(msg, 'dragon claw') then buy(cid,5919,getCount(msg),18000) elseif msgcontains(msg, 'ring of the sky') then buy(cid,2123,getCount(msg),1800) elseif msgcontains(msg, 'beholder eye') then buy(cid,5898,getCount(msg),100) elseif msgcontains(msg, 'yellow piece of cloth') then buy(cid,5914,getCount(msg),150) elseif msgcontains(msg, 'white piece of cloth') then buy(cid,5909,getCount(msg),200) elseif msgcontains(msg, 'brown piece of cloth') then buy(cid,5913,getCount(msg),120) elseif msgcontains(msg, 'dwarven beard') then buy(cid,5900,getCount(msg),1000) elseif msgcontains(msg, 'simons favourite staff') then buy(cid,6107,getCount(msg),30000) elseif msgcontains(msg, 'peg legs') then buy(cid,6126,getCount(msg),100) elseif msgcontains(msg, 'hooks') then buy(cid,6097,getCount(msg),100) elseif msgcontains(msg, 'eye patches') then buy(cid,6098,getCount(msg),100) elseif msgcontains(msg, 'ron the rippers sabre') then buy(cid,6101,getCount(msg),14000) elseif msgcontains(msg, 'Lethal Lissy shirt') then buy(cid,6100,getCount(msg),6000) elseif msgcontains(msg, 'Brutus Bloodbeards hat') then buy(cid,6099,getCount(msg),5000) elseif msgcontains(msg, 'Deadeye Devious eye patch') then buy(cid,6102,getCount(msg),5000) elseif msgcontains(msg, 'dworc vodoo doll') then buy(cid,3955,getCount(msg),2000) elseif msgcontains(msg, 'mandrake') then buy(cid,5015,getCount(msg),10000) elseif msgcontains(msg, 'banana staff') then buy(cid,3966,getCount(msg),20000) elseif msgcontains(msg, 'tribal mask') then buy(cid,3967,getCount(msg),4000) elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('3maj sie, ' .. 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('Następny do cenzura!...') end focus = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 5 then selfSay('CYA!.') focus = 0 end end end teraz robimy plik /data/npc/ChlopakAddonowy.xml Kod:<?xml version="1.0"?> <npc name="ChlopakAddonowy" script="data/npc/scripts/addony.lua" access="5" lookdir="2" autowalk="25"> <mana now="800" max="800"/> <health now="200" max="200"/> <look type="75" head="78" body="88" legs="0" feet="88"/> </npc> pozdro |