Tibia.net.pl
| (#?)
| [8.21] NpcDyskusja dotycząca tematu [8.21] Npc, który znajduje się w kategorii Skrypty Lua & XML (Znajdują się tutaj potwory, NPC, itd. Publikacja tylko GOTOWYCH skryptów!), na forum NPC (). Treść: Witam
Potrzebuję pilnie NPC który będzie mnie teleportował w dane miejsce "x,y,z"
jeśli będę posiadał dany item....
jaśli nie będę posadal ... | | |
31-08-2008, 11:19
|
| | Początkujący | [8.21] Npc
Witam
Potrzebuję pilnie NPC który będzie mnie teleportował w dane miejsce "x,y,z"
jeśli będę posiadał dany item....
jaśli nie będę posadal będze pisalo "Nie posiadasz .xtegox. itema..
I żeby nie zabierało mi tego itema!!!!
| |
| | |
31-08-2008, 12:22
|
| | Nowicjusz | Odp: [8.21] Npc 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('Did you bring me Magic Paper?')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. getCreatureName(cid) .. '! I talk to you in a minute.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'yes') then
if doPlayerRemoveItem(cid,7491,1) then
buy(cid,7491,1,0)
doTeleportThing(cid,{x=1000,y=1000,z=7})
else
selfSay('Sorry, you dont have this item.')
end
elseif msgcontains(msg, 'magic paper') then
if doPlayerRemoveItem(cid,7491,1) then
buy(cid,7491,1,0)
doTeleportThing(cid,{x=1000,y=1000,z=7})
else
selfSay('Sorry, you dont have this item.')
end
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. getCreatureName(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(1)
end
if ((myy-y==0) and (myx-x>=0 and myx-x<=4)) then
selfTurn(3)
end
if ((myx-x==0) and (myy-y<=0 and myy-y>=-4)) then
selfTurn(2)
end
if ((myx-x==0) and (myy-y>=0 and myy-y<=4)) then
selfTurn(0)
end
if ((myy-y==-2) and (myx-x>=-1 and myx-x<=1)) then
selfTurn(2)
end
if ((myy-y==2) and (myx-x>=-1 and myx-x<=1)) then
selfTurn(0)
end
if ((myx-x==2) and (myy-y>=-1 and myy-y<=1)) then
selfTurn(3)
end
if ((myx-x==-2) and (myy-y>=-1 and myy-y<=1)) then
selfTurn(1)
end
if ((myy-y==-3) and (myx-x>=-2 and myx-x<=2)) then
selfTurn(2)
end
if ((myy-y==3) and (myx-x>=-2 and myx-x<=2)) then
selfTurn(0)
end
if ((myx-x==3) and (myy-y>=-2 and myy-y<=2)) then
selfTurn(3)
end
if ((myx-x==-3) and (myy-y>=-2 and myy-y<=2)) then
selfTurn(1)
end
if ((myy-y==-4) and (myx-x>=-3 and myx-x<=3)) then
selfTurn(2)
end
if ((myy-y==4) and (myx-x>=-3 and myx-x<=3)) then
selfTurn(0)
end
if ((myx-x==4) and (myy-y>=-3 and myy-y<=3)) then
selfTurn(3)
end
if ((myx-x==-4) and (myy-y>=-3 and myy-y<=3)) then
selfTurn(1)
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
@down
POPRAWIONE : P
| |
| | |
31-08-2008, 13:39
|
| | Początkujący | Odp: [8.21] Npc
coś mi nie działa
wywala debugi i jak nie mam papierka to i tak teleportuje...
i czemu to tak strasznie długi skrypt??
i czemu zabiera item
| |
| | |
01-09-2008, 11:59
|
| | Początkujący | Odp: [8.21] Npc
Lol nie dizała wogóle ten NPC zal
| |
| | |
01-09-2008, 12:53
|
| | Nowicjusz | Odp: [8.21] Npc
Ten Scrypt powinien działać a jak nie to pomoge Kod HTML: local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
-- OTServ event handling functions end
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'enigma city'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Czy chcesz zapierdalac do Enigma City za 50 gold coins?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 50, destination = {x=942, y=978, z=6} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})
keywordHandler:addKeyword({'destination'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \'Enigma City\' for just a small fee.'})
-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())
| |
| | |
01-09-2008, 17:27
|
| | Początkujący | Odp: [8.21] Npc
po 1
za item nie za akse
po 2 kase zabiara ttuaj a item ma zostawiać...
Po 3
Poradziłem sobie sam
Teraz mi potrzba addony Jester i Nightmare naprawic bo nie dzialaja NPC..
| |
| | | Narzędzia tematu | | | | Wygląd | Wygląd liniowy | |
Podobne wątki | | [8.21] DeadTouch - DeadTouch
Kolejny dobry silnik pod protokół 8.21, wersja Alpha.
Based on Avesta (OpenTibia 0.7.0) SVN - Rev: 3317. Patched to later revisions by... kolekrks, 02-10-2008 boty do tibi 8.21 - Cześć Założyłem ten temat poniewasz poszukuje jakis botów do tibi 8.21 , jak narazie posiedzialem w necie ładne pare godzin w poszukiwaniu czegoś i... Gallheari, 22-08-2008 [8.21] Devland - Witam chciałbym was poprosić o Devland z linkiem na speedyshare :) będe wdzięczny.
Pozdrawiam DarkMen, 06-08-2008 [8.21] (SQL) SacusOTserv v0.8.0 - Najnowsza wersja jednego z lepiej rozwijających się silników pod 8.21. Osobiście polecam... :)
OFICJALNY LINK
Version 0.8.0
* Bed System
*... kolekrks, 30-07-2008 potrzebuje silnik evo [8.21] - potrzebuje silnik evo
tylko żeby był już prawie zrobiony tylko zmienić w config.lua żeby npc,mapka,itemy itd było gotowe:)
Pozdrawiam jacek1 jacek1, 26-07-2008
| | Tibia.net.pl: NPC () Temat: [8.21] Npc Witam
Potrzebuję pilnie NPC który będzie mnie teleportował w dane [...] | Czasy w strefie GMT +1. Teraz jest 04:41. | | |