 |
OTS Red Castle Forum Red Castle
|
Zobacz poprzedni temat :: Zobacz następny temat |
Autor |
Wiadomość |
son_of_sillve
Miotacz Postów
Dołączył: 09 Kwi 2007
Posty: 167
Przeczytał: 0 tematów
Ostrzeżeń: 0/5 Skąd: Z Nienacka
|
Wysłany: Wto 20:40, 15 Maj 2007 Temat postu: NPC Ogrodnik (mówi, jak zrobić manafluida) |
|
|
mam npc Ogrodnik on sluzy do lisci mana a tak wogole to przekonacie sie jak go uzyjecie xD
wchodzimy do data/npc i robimy plik XML o nazwie Ogrodnik.xml i wklejamy to :
Kod: |
<?xml version="1.0"?>
<npc name="Ogrodnik" script="data/npc/scripts/ogrodnik.lua" access="3" monster="1" speed="50" level="100" maglevel="100" exp="0" pushable="0" lookdir="0">
<mana now="100" max="100"/>
<health now="100" max="100"/>
<look type="57" head="78" body="61" legs="52" feet="114" corpse="2276"/>
<attack type="melee" damage="10"/>
</npc> |
potem wchodzimy do data/npc/scripts i robimy plik LUA o nazwie ogrodnik.lua i wklejamy to :
Kod: |
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, '(%a*)hi(%a*)')) and getDistanceToCreature(cid) < 3 then
selfSay('Witaj ' .. creatureGetName(cid) .. ' Potrafie robic Mana Fluidy z lisci tych drzew :D moge ci sprzedac przepis za 10k [mana]')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 3 then
selfSay('Poczekaj ' .. creatureGetName(cid) .. '! Za chwile z toba porozmawiam.')
elseif msgcontains(msg, 'mana') and (focus ~= cid) and getDistanceToCreature(cid) < 3 then
selfSay('Poczekaj ' .. creatureGetName(cid) .. '! Za chwile z toba porozmawiam.')
elseif msgcontains(msg, 'golden sickle') and (focus ~= cid) and getDistanceToCreature(cid) < 3 then
selfSay('Poczekaj ' .. creatureGetName(cid) .. '! Za chwile z toba porozmawiam.')
elseif (msgcontains(msg, '(%a*)mana(%a*)')) and getDistanceToCreature(cid) < 3 then
if pay(cid, 10000) then
selfSay('No wiec aby mozna bylo zrobic mana fluida trzeba sciac liscie z tych drzew przy pomocy golden sickle ktora moge ci sprzedac za 5k [golden sickle].. a liscie namoczyc woda np. z Vial :D')
focus = cid
talk_start = os.clock()
else
selfSay('Nie masz tyle pieniedzy..')
end
elseif (msgcontains(msg, '(%a*)golden sickle(%a*)')) and getDistanceToCreature(cid) < 3 then
if pay(cid, 5000) then
buy(cid,2418,1,0)
selfSay('Prosze.. oto nowa Mana sickle :D')
focus = cid
talk_start = os.clock()
else
selfSay('Nie masz tyle pieniedzy..')
focus = cid
talk_start = os.clock()
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 15 then
if focus > 0 then
selfSay('Next Please...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 3 then
selfSay('Good bye then.')
selfSay('/clean')
focus = 0
end
end
if focus == 0 then
cx, cy, cz = selfGetPosition()
randmove = math.random(1,20)
if randmove == 1 then
nx = cx + 1
end
if randmove == 2 then
nx = cx - 1
end
if randmove == 3 then
ny = cy + 1
end
if randmove == 4 then
ny = cy - 1
end
if randmove == 5 then
nx = cx
ny = cy
end
moveToPosition(nx, ny, cz)
--summons = 50
--summons2 = 50
end
end |
Post został pochwalony 0 razy
|
|
Powrót do góry |
|
 |
|
 |
|
|
Możesz pisać nowe tematy Możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach
|
fora.pl - załóż własne forum dyskusyjne za darmo
Powered by phpBB © 2001, 2002 phpBB Group
|