Koci1994
Banned User
- Joined
- Dec 27, 2008
- Messages
- 807
- Reaction score
- 1
Siema.
Mam taki problem mam starego NPC z 8.1 i chciałbym go przerobić, żeby działa na TFS 0.3.5 . Pomoże mi ktoś ??
Oto ten NPC:
Jacek.xml
Nie chodzi mi o to, żeby ktoś to za mnie zrobił . Tylko żeby my powiedział jak to się robi.
Mam taki problem mam starego NPC z 8.1 i chciałbym go przerobić, żeby działa na TFS 0.3.5 . Pomoże mi ktoś ??
Oto ten NPC:
Jacek.xml
jacek.lua<?xml version="1.0"?>
<npc name="Jacek" script="data/npc/scripts/jacek.lua" access="1" lookdir="2" autowalk="25">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="151" head="77" body="108" legs="86" feet="0" addons="3"/>
</npc>
Code:
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('Witaj ' .. getCreatureName(cid) .. '! Moge udzielic ci wskazowek dotyczacych questow. Powiedz "wskazowki".')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Przepraszam, ' .. getCreatureName(cid) .. '! Wlasnie rozmawiamy...')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'wskazowki') then
selfSay('Chcesz uzyskac wskazowki dotyczace "strange rooms","death tower" czy "temple of time"?')
elseif msgcontains(msg, 'strange rooms') then
selfSay('Slyszalem, ze istnieja pomieszczenia, gdzie normalni ludzie dostawali obledu i nigdy nie wracali, lecz po rozwiazaniu zagadki czeka nagroda. Wejscie znajduje sie w starej kaplicy na poludnie od Enigmy.')
elseif msgcontains(msg, 'death tower') then
selfSay('Plotki glosza, ze na poludniowy-zachod od Grit Town jest wieza maga, u szczytu trzyma on swe skarby. Niestety, nie moge tego potwierdzic, bo kazdy kto sie tam zblizyl, juz nigdy nie powrocil.')
elseif msgcontains(msg, 'quest') then
selfSay('Oh, jestes pewien, ze chcesz podjac to "wyzwanie"?.')
elseif msgcontains(msg, 'wyzwanie') then
selfSay('Dobrze wiec. Moj przyjaciel Charlie wybral sie kilka dni temu na wyspe Demigod i już nie powrocil. Chcialbym, zebys go odnalazl.')
elseif msgcontains(msg, 'broken amulet') then
selfSay('O nie! To byl jego ulubiony amulet.. Przykro mi, ze Charlie nie zyje. Zatrzymaj jego amulet, zdaje sie, ze Soya bylaby nim zainteresowana.')
elseif msgcontains(msg, 'temple of time') then
selfSay('Nie wiem zbyt wiele na ten temat, ale mozesz o to spytac maga Daroona. On sie na tym zna.')
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Zegnaj, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 15 then
if focus > 0 then
selfSay('Kiedys zdobede je wszytkie...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 3 then
selfSay('Powodzenia!')
focus = 0
end
end
end
Last edited: