Nie tylko o Tibii i OTS...
data/monsters tworzymy plik o nazwe Dragon Rider.
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) < 3 then
selfSay('Hello, ' .. creatureGetName(cid) .. '! I sell amulets.'
focus = cid
talk_start = os.clock()
elseif string.find(msg, '(%a*)hi(%a*)' and (focus ~= cid) and getDistanceToCreature(cid) < 3 then
selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.'
elseif msgcontains(msg, 'crystal nacklace' and focus == cid then
buy(cid,2946,1,200)
talk_start = os.clock()
elseif msgcontains(msg, 'wolves tooth chain' and focus == cid then
buy(cid,2950,1,20)
talk_start = os.clock()
elseif msgcontains(msg, 'golden amulet' and focus == cid then
buy(cid,2951,1,1000)
talk_start = os.clock()
elseif msgcontains(msg, 'elven amulet' and focus == cid then
buy(cid,2952,7,500)
talk_start = os.clock()
elseif msgcontains(msg, 'silver amuler' and focus == cid then
buy(cid,2953,10,100)
talk_start = os.clock()
elseif msgcontains(msg, 'ruby necklace' and focus == cid then
buy(cid,2954,1,100)
talk_start = os.clock()
elseif msgcontains(msg, 'silver brooch' and focus == cid then
buy(cid,2955,1,300)
talk_start = os.clock()
elseif msgcontains(msg, 'scarab amulet' and focus == cid then
buy(cid,2956,1,350)
talk_start = os.clock()
elseif msgcontains(msg, 'demonbones amulet' and focus == cid then
buy(cid,2957,1,10000)
talk_start = os.clock()
elseif msgcontains(msg, 'amulet' and focus == cid then
buy(cid,2959,1,10)
talk_start = os.clock()
elseif msgcontains(msg, 'ruby necklace' and focus == cid then
buy(cid,2960,1,500)
talk_start = os.clock()
elseif msgcontains(msg, 'phoenix amulet' and focus == cid then
buy(cid,2962,1,700)
talk_start = os.clock()
elseif msgcontains(msg, 'strange talisman' and focus == cid then
buy(cid,2983,1,700)
talk_start = os.clock()
elseif msgcontains(msg, 'platinum amulet' and focus == cid then
buy(cid,2993,1,700)
talk_start = os.clock()
elseif msgcontains(msg, 'bronze amulet' and focus == cid then
buy(cid,2993,1,700)
talk_start = os.clock()
elseif msgcontains(msg, 'bronze amulet' and focus == cid then
buy(cid,2995,1,750)
talk_start = os.clock()
elseif msgcontains(msg, 'broken amulet' and focus == cid then
buy(cid,3018,1,750)
talk_start = os.clock()
elseif msgcontains(msg, 'stone skin amulet' and focus == cid then
buy(cid,3019,1,850)
talk_start = os.clock()
elseif msgcontains(msg, 'gralic necklace' and focus == cid then
buy(cid,3021,1,850)
talk_start = os.clock()
elseif msgcontains(msg, 'aol' and focus == cid then
buy(cid,2995,1,850)
talk_start = os.clock()
elseif 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 (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Next Please...'
end
focus = 0
end
end
You attack me?
You have problems...
No problems!
No rulez!
Jesli pomoglem prosze o reputka
Offline
jasiu1995l napisał:
data/monsters tworzymy plik o nazwe Dragon Rider.
selfSay('Good bye then.'
selfSay('Hello, ' .. creatureGetName(cid) .. '! I sell amulets.'
selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.'
buy(cid,2946,1,200)
Jeśli się nie mylę, to są komendy npc...
Up@
Byłeś szybszy .
Ostatnio edytowany przez Novis (2007-12-07 14:20:51)
Offline
No faktycznie nie atakuje ani nic. Trochę pomieszałeś.
Offline
ej no sorki cos mi sie pomieszalo
Offline
Zbanowany
NPC a nie potwór ;pp cos ci nie wyszlo ja to przerobie na potwora
Offline
Sułtan łechtaczek
@up nie no co za odkrycie (prawie jak Ameryki)
@topic źle zrobione zero codów popraw
Offline