piternet - 2008-01-12 15:33:40 |
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 :P
|
Seba9 - 2008-01-12 16:22:40 |
no wielkie gz, ale czy napewno to twoj bo juz widzialem to na otsach :D
|
piternet - 2008-01-12 16:50:16 |
Seba9 [VIP] napisał:no wielkie gz, ale czy napewno to twoj bo juz widzialem to na otsach :D
Przyznaje sie ze to nie moj NPC jedynie zmienilem go na polski(zeby po "polskiemu" mowil)
|
Seba9 - 2008-01-12 19:31:37 |
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
|
Sasuke69 - 2008-02-01 18:54:51 |
matko nie dziala mi kurfa nic dla siebie nie moge znaleszc
|
.Son-Goku - 2008-02-12 18:43:40 |
Przepraszam, że zapytam, co to jest te ' błogosławieństwo ' ?
|
MixFixGirl - 2008-02-13 14:56:55 |
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 :P
|
cVS - 2008-02-13 20:29:21 |
bless - błogosławieństwo. a błogosławieństwo w przypadku tego NPC daje po kupieniu mniejszą stratę expa i skilla ; ]
|
Soldier of the North - 2008-02-19 19:37:01 |
Heheh ja tego npc mam na ots po polsku
|
SmileY - 2008-02-19 21:35:49 |
Heh przyda sie czasami :0
|
DaVo - 2008-03-06 14:08:28 |
przyda sie 9\10
|
serney - 2008-03-06 14:39:26 |
czemu nikt nie pisze pod jaka to tibie?...
|