#1 2007-07-10 02:59:54

wilku705

http://i38.tinypic.com/2ni1vub.gif

4333343
Skąd: Warszawa
Zarejestrowany: 2007-07-08
Posty: 78
Nick: Ximishe
Profesja: Askara
Server: 100

Czy poda mi ktoś scrypt do NPC Zamieniajacego itemki??? Pod Evo 7.8

Czy poda mi ktoś scrypt do NPC Zamieniajacego itemki??? Pod Evo 7.8

Znalalem juz 1 npc ale muwie power tak jak bylu ustawione w pliku i npc sie nieodzywa a na serverze nic sie niewyświetla ze bład jest w npc niewiem dlaczego tak jest ale podam wrazie czego script pomurzcie PLZ

Z Gury Thx

function onCreatureSay(cid, type, msg)
      cname = creatureGetName(cid)

      if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
          selfSay('Hey ' .. cname .. '! What can I get for ya?')
            talk_state = 1
            focus = cid
              talk_start = os.clock()
      elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
          selfSay('Chill out '.. creatureGetName(cid) ..', Ill be done in a second.')

    elseif focus == cid then       
        soulorbs = getPlayerItemCount(cid,5944)    -- this is the item you are going to give the NPC
        talk_start = os.clock()       
            if msgcontains(msg, 'power') then -- you will change this to what you want
            if (soulorbs > 0) then -- this says if you have more then 0 soul orbs.
                selfSay('I will give you '..(soulorbs*5)..' power bolts for your '..soulorbs..' soul orbs.  Are you intrested?')
                -- this npc will offer you 100 power bolts if you are carrying 20 soul orbs.  (soul orbs * 5)
                talk_state = 2
            else
                selfSay('You dont have any soul orbs, come back when you have some.')
                focus = 0
            end
            elseif msgcontains(msg, 'bye') then
                selfSay('See ya.')
                focus = 0
            end

    if msgcontains(msg, 'yes') then
        freeCap = getPlayerFreeCap(cid)
            if talk_state == 2 then
                if (freeCap > (soulorbs*4)) then -- you can edit this to the exact weight of other items, bolts are stackable though.                   
                    doPlayerTakeItem(cid,5944,soulorbs) -- he takes this item
                    selfSay('Enjoy the bolts and come back soon!')
                    doPlayerAddItem(cid,2547,(soulorbs*5)) -- he gives this item
                    focus = 0
                else                   
                    selfSay('You cant even carry them, get back to me later.')
                    focus = 0
                end
            end
    end
    end
end


Niewdzięcznicy..

Offline

 

#2 2007-07-12 01:48:04

patryk12

http://i33.tinypic.com/21bk4jn.jpg

Skąd: Polska
Zarejestrowany: 2007-04-20
Posty: 158

Re: Czy poda mi ktoś scrypt do NPC Zamieniajacego itemki??? Pod Evo 7.8

a może zamiast cname
function onCreatureSay(cid, type, msg)
      cname = creatureGetName(cid)

      if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
          selfSay('Hey ' .. cname .. '! What can I get for ya?')
            talk_state = 1
            focus = cid
              talk_start = os.clock()
      elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
          selfSay('Chill out '.. creatureGetName(cid) ..', Ill be done in a second.')

    elseif focus == cid then       
        soulorbs = getPlayerItemCount(cid,5944)    -- this is the item you are going to give the NPC
        talk_start = os.clock()       
            if msgcontains(msg, 'power') then -- you will change this to what you want
            if (soulorbs > 0) then -- this says if you have more then 0 soul orbs.
                selfSay('I will give you '..(soulorbs*5)..' power bolts for your '..soulorbs..' soul orbs.  Are you intrested?')
                -- this npc will offer you 100 power bolts if you are carrying 20 soul orbs.  (soul orbs * 5)
                talk_state = 2
            else
                selfSay('You dont have any soul orbs, come back when you have some.')
                focus = 0
            end
            elseif msgcontains(msg, 'bye') then
                selfSay('See ya.')
                focus = 0
            end

    if msgcontains(msg, 'yes') then
        freeCap = getPlayerFreeCap(cid)
            if talk_state == 2 then
                if (freeCap > (soulorbs*4)) then -- you can edit this to the exact weight of other items, bolts are stackable though.                   
                    doPlayerTakeItem(cid,5944,soulorbs) -- he takes this item
                    selfSay('Enjoy the bolts and come back soon!')
                    doPlayerAddItem(cid,2547,(soulorbs*5)) -- he gives this item
                    focus = 0
                else                   
                    selfSay('You cant even carry them, get back to me later.')
                    focus = 0
                end
            end
    end
    end
end


daj to getCreatureName(cid)

Offline

 

Stopka forum

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


Darmowe Forum | Ciekawe Fora | Darmowe Fora
ホテル カリュイール・エ・キュイール