#1 2007-07-13 21:50:23

Wymiatacz

http://i37.tinypic.com/2dqpohz.gif

Skąd: Plock
Zarejestrowany: 2007-07-11
Posty: 28
Nick: Sauron
Profesja: epremium.no-ip.org
Server: 1164

POMUZCIE PLS!

Mam do was pytanie jak zrobic npc ktory odnowi soft buty. Pomuzcie pls musze fast zrobic tego npc jak ktos wie niech odpisze na tego posta. Z gory dzieki ;].


o0o0o0o0o0o0o<=Wymiatacz=>o0o0o0o0o0o0o

Offline

 

#2 2007-07-14 16:02:08

wojtek15

http://i36.tinypic.com/25zpd2c.gif

Zarejestrowany: 2007-07-03
Posty: 349

Re: POMUZCIE PLS!

elo ja mam takiego npc

wejdz w nazwaots/data/npc/scripts i stwórz plik softboots.lua
i wpisz to:

Kod:

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

-- OTServ event handling functions start
function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)             npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)     npcHandler:onCreatureSay(cid, type, msg) end
function onThink()                         npcHandler:onThink() end
-- OTServ event handling functions end

function creatureSayCallback(cid, type, msg)
    -- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
    if(npcHandler.focus ~= cid) then
        return false
    end

        if msgcontains(msg, 'specialised') or msgcontains(msg, 'boots') then
            selfSay('Yes, my fathers was a great one blacksmith, it was a wise person , but when he decided to teach me he dies and i just learn about the lovely boots. So, did you bring me some boots? which one?')
        elseif msgcontains(msg, 'soft boots') or msgcontains(msg, 'worn soft boots') or msgcontains(msg, 'soft boot') or msgcontains(msg, 'worn soft boot') then
            selfSay('Did u like that i fix ur worn soft boots? it will cost 100 platinum coins')
            talk_state = 1
        

        elseif msgcontains(msg, 'yes') and talk_state == 1 then
            if getPlayerItemCount(cid,6530) >= 1 and getPlayerItemCount(cid,2152) >= 100 then
                if doPlayerTakeItem(cid,6530,1) and doPlayerTakeItem(cid,2152,100) == 0 then
                selfSay('Here you are.')
                    doPlayerAddItem(cid,2640,1)
                end
            else
                selfSay('Sorry, you don\'t have the item.')
            end
          

        elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 5) then
            selfSay('Ok than.')
            talk_state = 0
        end
    -- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
    return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

później wejdz w nazwaots/data/npc i stwórz plik Soft.xml
i wpisz w nim to:

Kod:

<npc name="Soft" script="data/npc/scripts/softboots.lua" autowalk="25" floorchange="0" access="3" level="1" maglevel="1">
          <health now="150" max="150"/>
        <look type="151" head="114" body="1" legs="1" feet="76" addons="1" corpse="2212"/>
          <parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|. I am specialised in boots" />
                    
          </parameters>
</npc>

I to by było chyba na tyle.

Offline

 

#3 2007-07-14 16:57:19

Wymiatacz

http://i37.tinypic.com/2dqpohz.gif

Skąd: Plock
Zarejestrowany: 2007-07-11
Posty: 28
Nick: Sauron
Profesja: epremium.no-ip.org
Server: 1164

Re: POMUZCIE PLS!

Dzieki bardzo za odpowiedz na mojego posta


o0o0o0o0o0o0o<=Wymiatacz=>o0o0o0o0o0o0o

Offline

 

Stopka forum

RSS
Powered by PunBB
© Copyright 2002–2008 PunBB
Polityka cookies - Wersja Lo-Fi


Darmowe Forum | Ciekawe Fora | Darmowe Fora
www.teenagerworld.pun.pl www.narutograonline.pun.pl www.pokirena.pun.pl www.zarzadzanieumk.pun.pl www.f.pun.pl