What's new

Seller BP Potion's! [8.1]

Status
Not open for further replies.

Koybi

Senior User
Joined
Aug 7, 2008
Messages
742
Reaction score
43
Witam. Mam tu dla was NPC , kt?ry sprzedaje BP Potion's pod Tibia 8.1. Skrypt nie m?j odrazu m?wi? , udost?pniam go , ?eby mogli?cie z niego skorzysta?!

w data/npc tworzysz plik o nazwie Vortah.xml i dodajesz :

Code:
<?xml version="1.0"?>

<npc name="Vortah" script="data/npc/scripts/potions.lua" access="5" lookdir="1">
    <health now="1000" max="1000"/>
<look type="133" head="0" body="86" legs="0" feet="38" addons="1"/>
</npc>

Teraz do data/npc/scripts dodajesz potions.lua i wklejasz to :

Code:
function onCreatureDisappear(cid, pos)
      if focus == cid then
          selfSay('Good bye then.')
          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)
      local msg = string.lower(msg)

      if msgcontains(msg, 'hi') and focus == 0 and getDistanceToCreature(cid) < 4 then
          selfSay('Witaj ' .. creatureGetName(cid) .. '! Sprzedaje wszystkie rodzaje potionow. Sprzedam ci "bp mana potions" , "bp great health potions" etc, a takze zwykle "backpack"s Dla poznania cen powiedz "offer"!')
          focus = cid
          talk_start = os.clock()

      elseif msgcontains(msg, 'hi') and focus ~= cid and getDistanceToCreature(cid) < 4 then
          selfSay('Przepraszam, ' .. creatureGetName(cid) .. '! Wlasnie rozmawiamy.')

    elseif focus == cid then
        talk_start = os.clock()

        if msgcontains(msg, 'offer') then
            selfSay('Sprzedaje bhp i bmp za 2k, bshp i bsmp za 5k, bghp i bgmp za 10k.')
          
            elseif msgcontains(msg, 'bp health potions') or msgcontains(msg, 'bhp') then
            buyContainer(cid,2000,7618,1,2000)
            
                elseif msgcontains(msg, 'bp mana potions') or msgcontains(msg, 'bmp') then
            buyContainer(cid,2002,7620,1,2000)            
                
                elseif msgcontains(msg, 'bp great health potions') or msgcontains(msg, 'bghp') then
            buyContainer(cid,2000,7591,1,10000)                
                
                elseif msgcontains(msg, 'bp great mana potions') or msgcontains(msg, 'bgmp') then
            buyContainer(cid,2002,7590,1,10000)        
        
                elseif msgcontains(msg, 'bp strong health potions') or msgcontains(msg, 'bshp') then
            buyContainer(cid,2000,7588,1,5000)              
        
                elseif msgcontains(msg, 'bp strong mana potions') or msgcontains(msg, 'bsmp') then
            buyContainer(cid,2002,7589,1,5000) 

                elseif msgcontains(msg, 'backpack') or msgcontains(msg, 'bp') then
			buy(cid,1988,getCount(msg),10)              
        
                          
               elseif string.find(msg, '(%a*)bye(%a*)') and getDistanceToCreature(cid) < 4 then
            selfSay('Zegnaj, ' .. creatureGetName(cid) .. '!')
            focus = 0
            talk_start = 0
        end
    end
end

function onCreatureChangeOutfit(creature)

end


function onThink()
      if (os.clock() - talk_start) > 30 then
          if focus > 0 then
              selfSay('Nastepny!')
          end
        
        focus = 0
      end
    
    if focus ~= 0 then
        if getDistanceToCreature(focus) > 4 then
            selfSay('Nie wypij wszystkiego odrazu!')
            focus = 0
        end
    end
    
end
 

CIeLmA

User
Joined
Sep 19, 2008
Messages
14
Reaction score
0
Odp: [8.1]Seller BP Potion's!

Odp: [8.1]Seller BP Potion's!

Mi ten Npc nie dziala ;/
 

karas93

New User
Joined
Sep 28, 2008
Messages
1
Reaction score
0
Odp: [8.1]Seller BP Potion's!

Odp: [8.1]Seller BP Potion's!

@up

Mi tak samo ;/
 

God Tyran

User
Joined
May 18, 2008
Messages
42
Reaction score
1
Odp: [8.1]Seller BP Potion's!

Odp: [8.1]Seller BP Potion's!

Fajny Npc przyda sie na ots
Jesli dziala to za checi rozpowrzechnienia npc dam 8/10
Jesli nie dziala to sprawdze i dam edita
Pozdro GoD Tyran
 

Skrypter

Advanced User
Joined
May 17, 2008
Messages
243
Reaction score
23
Odp: [8.1]Seller BP Potion's!

Odp: [8.1]Seller BP Potion's!

mi ten skrypt nie dzia?a a testowa?em go na Evo jak napisze Hi
on mi odpowiada
Przepraszam game master w?asnie rozmawiamy
 

Sorem

New User
Joined
Nov 8, 2008
Messages
6
Reaction score
0
Odp: [8.1]Seller BP Potion's!

Odp: [8.1]Seller BP Potion's!

Dzieje mi si? tak samo jak koledze wy?ej.

16:02 Vortah: Przepraszam, Wlasnie rozmawiamy.
 

dawidno3

New User
Joined
Nov 7, 2008
Messages
1
Reaction score
0
Odp: [8.1]Seller BP Potion's!

Odp: [8.1]Seller BP Potion's!

ej djacie linka ots z real mapka
 

Eleonore12

User
Joined
Nov 9, 2008
Messages
12
Reaction score
0
Odp: [8.1]Seller BP Potion's!

Odp: [8.1]Seller BP Potion's!

cos nei tak z tym skryptem jest
 

Roberto_93

Active User
Joined
Oct 13, 2008
Messages
85
Reaction score
6
Odp: Seller BP Potion's! [8.1]

no to chyba kazdy ma ten sam problem ;s bo ja tez ;/
 

Tovern

Active User
Joined
Feb 16, 2009
Messages
50
Reaction score
2
Odp: Seller BP Potion's! [8.1]

mi dziale wszystko ok jest
 

MappingFOR

Advanced User
Joined
Apr 3, 2009
Messages
431
Reaction score
18
Odp: Seller BP Potion's! [8.1]

Wydaj? mi si?, ?e skrypt jest pod wy?sz? wersje ni? 8.1...
 

Sqrdi

User
Joined
Apr 14, 2008
Messages
48
Reaction score
1
Odp: Seller BP Potion's! [8.1]

Mi to dziala ;]. Co prawda troche poprawilem skrypt ale dziala :p
10/10 ;]
 

morfixnh

New User
Joined
Dec 13, 2008
Messages
8
Reaction score
1
Odp: Seller BP Potion's! [8.1]

a mi te? nie dzia?a co? nie tak z tym skryptem ziomu? ale daje 5/10 za dobre ch?ci :down:
 
Status
Not open for further replies.
Top