
Nie tylko o Tibii i OTS...
Zbanowany
Hej
pokaze wam jak sie robi eq sellera
wchodzimy do data/npc i robimy plik XML o nazwie Ron.xml i wklejamy to:
<?xml version="1.0"?>
<npc name="Ron" script="data/npc/scripts/eq.lua" access="3">
<look type="129" head="76" body="114" legs="124" feet="86"/>
</npc>
potem wchodzimy do data/npc/scripts i robimy plik LUA o nazwie eq.lua i wklejamy to:
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 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, 'royal helmet') then
buy(cid,2498,1,50000)
elseif msgcontains(msg, 'warrior helmet') then
buy(cid,2475,1,6000)
elseif msgcontains(msg, 'crusader helmet') then
buy(cid,2497,1,8000)
elseif msgcontains(msg, 'crown helmet') then
buy(cid,2491,1,3000)
elseif msgcontains(msg, 'devil helmet') then
buy(cid,2462,1,2000)
elseif msgcontains(msg, 'mystic turban') then
buy(cid,2663,1,1000)
elseif msgcontains(msg, 'chain helmet') then
buy(cid,2458,1,35)
elseif msgcontains(msg, 'iron helmet') then
buy(cid,2459,1,30)
elseif msgcontains(msg, 'helmets') then
selfSay('I sell royal (50k), warrior (6k), crusader (8k), crown (3k), devil (2k), chain (35gp) and iron helmets (30gp), also mystic turbans (1k).')
elseif msgcontains(msg, 'steel boots') and focus == cid then
buy(cid,2645,1,100000)
elseif msgcontains(msg, 'boh') or msgcontains(msg, 'boots of haste') and focus == cid then
buy(cid,2195,1,50000)
elseif msgcontains(msg, 'boots') then
selfSay('I sell steel boots (100k) and boots of haste (50k).')
elseif msgcontains(msg, 'magic plate armor') or msgcontains(msg, 'mpa') then
buy(cid,2472,1,300000)
elseif msgcontains(msg, 'dragon scale mail') or msgcontains(msg, 'dsm') then
buy(cid,2492,1,90000)
elseif msgcontains(msg, 'golden armor') then
buy(cid,2466,1,50000)
elseif msgcontains(msg, 'crown armor') then
buy(cid,2487,1,15000)
elseif msgcontains(msg, 'knight armor') then
buy(cid,2476,1,5000)
elseif msgcontains(msg, 'blue robe') then
buy(cid,2656,1,12000)
elseif msgcontains(msg, 'lady armor') then
buy(cid,2500,1,1000)
elseif msgcontains(msg, 'plate armor') then
buy(cid,2463,1,500)
elseif msgcontains(msg, 'brass armor') then
buy(cid,2465,1,200)
elseif msgcontains(msg, 'chain armor') then
buy(cid,2464,1,100)
elseif msgcontains(msg, 'armors') then
selfSay('I sell golden (50k), crown (15k), knight (5k), lady (1k), plate (500gp), brass (200gp) and chain armors (100gp), also mpa (300k), dsm (90k) and blue robes (12k).')
elseif msgcontains(msg, 'golden legs') then
buy(cid,2470,1,150000)
elseif msgcontains(msg, 'crown legs') then
buy(cid,2488,1,25000)
elseif msgcontains(msg, 'knight legs') then
buy(cid,2477,1,15000)
elseif msgcontains(msg, 'plate legs') then
buy(cid,2647,1,800)
elseif msgcontains(msg, 'brass legs') then
buy(cid,2478,1,100)
elseif msgcontains(msg, 'chain legs') then
buy(cid,2478,1,50)
elseif msgcontains(msg, 'legs') then
selfSay('I sell golden (150k), crown (25k), knight (15k), plate (800gp), brass (100gp) and chain legs (50gp).')
elseif msgcontains(msg, 'shield of the mastermind') or msgcontains(msg, 'mms') then
buy(cid,2514,1,120000)
elseif msgcontains(msg, 'demon shield') then
buy(cid,2520,1,60000)
elseif msgcontains(msg, 'vampire shield') then
buy(cid,2534,1,25000)
elseif msgcontains(msg, 'medusa shield') then
buy(cid,2536,1,12000)
elseif msgcontains(msg, 'amazon shield') then
buy(cid,2537,1,10000)
elseif msgcontains(msg, 'crown shield') then
buy(cid,2519,1,8000)
elseif msgcontains(msg, 'tower shield') then
buy(cid,2528,1,5000)
elseif msgcontains(msg, 'dragon shield') then
buy(cid,2516,1,1500)
elseif msgcontains(msg, 'guardian shield') then
buy(cid,2515,1,1200)
elseif msgcontains(msg, 'beholder shield') then
buy(cid,2518,1,1000)
elseif msgcontains(msg, 'dwarven shield') then
buy(cid,2525,1,100)
elseif msgcontains(msg, 'shields') then
selfSay('I sell demon (60k), vampire (25k), medusa (12k), amazon (10k), crown (8k), tower (5k), dragon (1.5k), guardian (1.2k), beholder (1k), and dwarven shields (100gp), also mms (120k)')
elseif msgcontains(msg, 'giant sword') then
buy(cid,2393,1,15000)
elseif msgcontains(msg, 'bright sword') then
buy(cid,2407,1,20000)
elseif msgcontains(msg, 'ice rapier') then
buy(cid,2396,1,4000)
elseif msgcontains(msg, 'fire sword') then
buy(cid,2392,1,5000)
elseif msgcontains(msg, 'serpent sword') then
buy(cid,2409,1,1500)
elseif msgcontains(msg, 'spike sword') then
buy(cid,2383,1,800)
elseif msgcontains(msg, 'two handed sword') then
buy(cid,2377,1,400)
elseif msgcontains(msg, 'broad sword') then
buy(cid,2413,1,70)
elseif msgcontains(msg, 'short sword') then
buy(cid,2406,1,30)
elseif msgcontains(msg, 'sabre') then
buy(cid,2385,1,25)
elseif msgcontains(msg, 'sword') then
buy(cid,2376,1,25)
elseif msgcontains(msg, 'swords') then
selfSay('I sell giant (15k), bright (20k), fire (5k) serpent (1.5k), spike (800gp) and two handed swords (400gp), also ice rapiers (4k), broad swords (70gp), short swords (30gp), sabres (25gp) and swords (25gp).')
elseif msgcontains(msg, 'dragon lance') then
buy(cid,2414,1,25000)
elseif msgcontains(msg, 'fire axe') then
buy(cid,2432,1,10000)
elseif msgcontains(msg, 'knight axe') then
buy(cid,2430,1,2000)
elseif msgcontains(msg, 'double axe') then
buy(cid,2387,1,200)
elseif msgcontains(msg, 'halberd') then
buy(cid,2381,1,200)
elseif msgcontains(msg, 'battle axe') then
buy(cid,2378,1,100)
elseif msgcontains(msg, 'hatchet') then
buy(cid,2388,1,20)
elseif msgcontains(msg, 'axes') then
selfSay('I sell fire (10k), knight (2k), double (200gp) and battle axes (100gp), also dragon lances (25k), halberds (200gp) and hatchets (20gp).')
elseif msgcontains(msg, 'war hammer') then
buy(cid,2391,1,6000)
elseif msgcontains(msg, 'skull staff') then
buy(cid,2436,1,5000)
elseif msgcontains(msg, 'dragon hammer') then
buy(cid,2434,1,2000)
elseif msgcontains(msg, 'clerical mace') then
buy(cid,2423,1,200)
elseif msgcontains(msg, 'battle hammer') then
buy(cid,2417,1,60)
elseif msgcontains(msg, 'mace') then
buy(cid,2398,1,30)
elseif msgcontains(msg, 'clubs') then
selfSay('I sell war (6k), dragon (2k) and battle hammers (60gp), also skull staffs (5k) and clerical maces (200gp).')
elseif msgcontains(msg, 'platinum amulet') then
buy(cid,2171,1,5000)
elseif msgcontains(msg, 'scarf') then
buy(cid,2661,1,500)
elseif msgcontains(msg, 'amulets') then
selfSay('I sell platinum amulets (5k) and scarfs (500gp).')
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 (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
i powinno byc dobrze jak ktos nie wie jak sie wstawia na mape niech pisze NarKa !!!
Gressis:
Edytowałem bo było źle złapane w ramki to co mamy napisać u siebie.
Ostatnio edytowany przez Gressis (2006-11-29 13:22:15)
Offline

Dla tych co nie wiedza napisze jak dac go na mape:
(1) Idziemy do ...data/world... i tam jest taki plik "npc.xml" (przynajmniej ja tak mam, tylko nie pisze .xml).
(2) Klikamy na niego PPM i naciskamy "Otworz za pomoca" i wybieramy "Aplikacja WordPad MFC".
(3) Gdy juz wlaczymy wklejamy ta linijke pod Dark Rod'em
<npc name="Ron" x="161" y="54" z="7" dir="2"/>
I ostatni punkt....
....(4) Zamykamy i zapisujemy, wlaczamy server i wszystko mamy!
mi tak dziala
Troche trudno przeczytac? ^^^
A i sorka za bledy bo mi sie z klawiatura cos stalo!
Offline

ladnie ladnie wiencej takich skrypuw i tlumaczcie odrazu wszystko bo tacy nowi nie wiedza duzo rzeczy ;]
Offline