Nie tylko o Tibii i OTS...
Witam!Zaprezentuje teraz skrypt na NPC sprzedajacego blessy(blogoslawienstwa):
Na poczatku w data/npc/scripts tworzymy plik o nazwie blessings.lua
Wklejamy do niego:
Spoiler:
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('Pa.')
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) .. ' Sprzedaje "5 blesow" 1 kosztuje 10.000.')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Przepraszam, ' .. getCreatureName(cid) .. '! ale rozmawiam z kims.')
elseif focus == cid then
talk_start = os.clock()
elseif msgcontains(msg, '5 Blesow') then
if pay(cid,10000) then
selfSay('Dodalem Ci blessy.')
doPlayerAddBlessing(cid, 5)
else
selfSay('Sorry, you do not have enough gold')
bless_state = 0
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Nastepny Prosze')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Pa.')
focus = 0
end
end
end
A potem w data/npc tworzymy plik o nazwie : Banor the blessed
Potem wklejamy do niego:
Spoiler:
<npc name="Banor the blessed" script="data/npc/scripts/blessings.lua" autowalk="25" floorchange="0" access="5" level="1" maglevel="1">
<health now="150" max="150"/>
<look type="129" head="114" body="119" legs="114" feet="114" corpse="2212"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|. I sell the five blessings (10k each), for each just say first bless, second bless, etc..." />
</parameters>
</npc>
NPC przeedytowany przez:Piternet
JAK POMOGLEM ZAPODAJ PLUSIKA
Ostatnio edytowany przez piternet (2008-01-12 16:16:01)
Offline
no wielkie gz, ale czy napewno to twoj bo juz widzialem to na otsach
Offline
Seba9 [VIP] napisał:
no wielkie gz, ale czy napewno to twoj bo juz widzialem to na otsach
Przyznaje sie ze to nie moj NPC jedynie zmienilem go na polski(zeby po "polskiemu" mowil)
Offline
Przyznaje sie ze to nie moj NPC jedynie zmienilem go na polski(zeby po "polskiemu" mowil)
i jeszcze wieksze gz ze do tego sie przyznajesz a nie jak inni upieraja sie sie ze sami zrobili a tak naprawde sciagli z jakiegos innego forum:D
Offline
matko nie dziala mi kurfa nic dla siebie nie moge znaleszc
Offline
Przepraszam, że zapytam, co to jest te ' błogosławieństwo ' ?
Offline
Zbanowany
Sasuke, naucz się pisać!
Son-Goku yy... no.. jakby Ci to powiedzieć... nie wiem xD Ale czasem się przydaje dla ludzi, znaczy dla tych co wiedzą co to jest xD Ja mam coś z głową xD
A tak w ogóle to freshujecie old topic
Ostatnio edytowany przez MixFixGirl (2008-02-13 14:58:35)
bless - błogosławieństwo.
a błogosławieństwo w przypadku tego NPC daje po kupieniu mniejszą stratę expa i skilla ; ]
Offline
Heheh ja tego npc mam na ots po polsku
Ostatnio edytowany przez Caliber64 (2009-10-24 19:36:39)
Offline