OTS Red Castle
Forum Red Castle
FAQ
Szukaj
Użytkownicy
Grupy
Galerie
Rejestracja
Profil
Zaloguj się, by sprawdzić wiadomości
Zaloguj
Forum OTS Red Castle Strona Główna
->
Skrypty itp.
Napisz odpowiedź
Użytkownik
Temat
Treść wiadomości
Emotikony
Więcej Ikon
Kolor:
Domyślny
Ciemnoczerwony
Czerwony
Pomarańćzowy
Brązowy
Żółty
Zielony
Oliwkowy
Błękitny
Niebieski
Ciemnoniebieski
Purpurowy
Fioletowy
Biały
Czarny
Rozmiar:
Minimalny
Mały
Normalny
Duży
Ogromny
Zamknij Tagi
Opcje
HTML:
NIE
BBCode
:
TAK
Uśmieszki:
TAK
Wyłącz BBCode w tym poście
Wyłącz Uśmieszki w tym poście
Kod potwierdzający: *
Wszystkie czasy w strefie EET (Europa)
Skocz do:
Wybierz forum
Nowy Red Castle
----------------
Błędy, skargi, problemy, itp.
Propozycje
Pochwały na temat Red Castle
Skrypty
Pochwały na temat Red Castle
O niebieskich migdałach...
Nasz OTS (Stary Red Castle)
----------------
Błędy, skargi, problemy, itp.
Propozycje
Mapy
Skrypty itp.
Pochwały na temat Red Castle
O niebieskich migdałach...
Przegląd tematu
Autor
Wiadomość
son_of_sillve
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
fora.pl
- załóż własne forum dyskusyjne za darmo
Powered by
phpBB
© 2001, 2002 phpBB Group
Regulamin