• logo_cipsoft
    Nowe serwery zostały otwarte 19 Lut 2025:
    Noctalia (Open PvP) Ignitera (Open PvP) us_logo Xybra (Open PvP)

[x.x][Skrypty] Zam?wienia

Status
Zamknięty.
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Wersja 7.6 mazurski (6.6.7) :)
Prosze o Npc wymienia item o id 2345 i daje graczowi pacc + promocje :)
Z promocj? to ok, ale nie wiem jak z pacc. Jest funkcja u ciebie, kt?ra dodaje pacca?

Pozdro,
Gelio
 
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

RL Addon System- nie wiem czy to jest do ko?ca system z RL ale chodzi mi o NPC'a kt?ry robi addon w zamian za itemy
Dla obja?nienia itemy na poszczeg?lny addon :
Citizen Outfit
1
- 100 Chicken Feather
- 50 Honeycomb
- 1 Legion Helmet
2
- 100 Minotaur Leather
Hunter Outfit
1
- 1 Sniper Gloves
2
- 1 Engraved Crossbow
- 100 Lizard Leather
- 100 Red Dragon Leather
- 5 Enchanted Chicken Wing
- 1 Royal Steel
- 1 Draconian Steel
- 1 Hell Steel
Knight Outfit
1
- 100 Iron Ore
- 1 Huge Chunk of Crude Iron
2
- 100 Behemoth Fang
- Damaged Steel Helmet
- 1 Warrior's Sweat
- 1 Royal Steel
Mage Outfit
1
- Wszystkie Wandy (dla Sorcerer?w) i Rody (dla Druid?w)
- 10 Magic Sulphur (30 Fire Sword)
- 20 Ankh
- 1 Soul Stone
2
- Ferumbras Hat
Barbarian Outfit
1
- Fighting Spirit
- Warrior's Sweat
- 50 Red Piece of Cloth
- 50 Green Piece of Cloth
- 10 Spool of yarn
2
- 100 Iron Ore
- 1 Huge Chunk of Crude Iron
- 50 Behemoth Fang
- 50 Lizard Leather
My?l? ?e ju? wiesz o jakie itemy chodzi dla tych nowych takich jak
Norseman Outfit
Nightmare Outfit
Brotherhood Outfit
Jester Outfit
Daj addony za 100cc 1
O jezu. Ju? widz?, ?e takie npc b?d? mieli z 500 linijek. A wasz skrypter z teamu (tego co w podpisie masz) nie umie tego zrobi?? Daj odpowied? na priv albo edit.

Pozdro,
Gelio
 
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Potrzebuje jeszcze:
TYP:NPC
WERSJA:8.22 TFS
OPIS:NPC o naziwe Pijany Piotrek,u ktorego wymienimy christmas tokeny na
100 tokenow-figurka smoka
500 tokenow-zloty puchar(kazdy z pucharow mozna wzi?sc tylko raz)
400 tokenow-srebrny puchar
300 tokenow-brazowy puchar
200 tokenow-jakis wisiorek
200 tokenow-jakis pierscionek
I to tyle!
@EDIT:Moj npc z otsa:
Kod:
<?xml version="1.0"?>
<npc name="Franek" script="data/npc/scripts/bank.lua" walkinterval="2000" floorchange="0">
    <mana now="100" max="100"/>
    <health now="100" max="100"/>
    <look type="144" head="115" body="121" legs="34" feet="56" addons="2" />
</npc>
Nie chodzi mi o plik *.xml tylko plik lua. W tym wypadku bank.lua. Wydaje mi si?, ?e to w starym systemie, wi?c dosy? szybko powinienem zrobi?.

Pozdro,
Gelio
 
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Witam ponownie... wiem, ?e mam mo?liwo?? napisania posta kt?ry bedzie przypomina? autorowi o danej pro?bie ^_^. Duzo tu si? pisze u Ciebie :P.
Kod:
Witam. Mam pro?b? aby? utworzy? The Oracle kt?re b?dzie dzia?a? pod TFS (SQL). Poniewa? ka?dy Oracle ko?czy mi na talkstate 2 i po wt?rnym "yes" wraca do wyboru miasta.
Wi?c ?eby by?o jasne:
Rodzaj: NPC
Wersja tibii: 8.31
Skrypt to The Oracle.
Oracle ma nas teleportowa? po 20 lvl do miast:
Enigma City (id 2)
Dane temple
x:993 y:978 z:6
Chcia?bym aby by? zrobiony w pe?ni po Angielsku. Wyt?umacz mi co po kolei edytowa? aby doda? nast?pne miasto samemu. Oczywi?cie mamy zosta? mieszka?cami wybranego miasta ;)
Z g?ry dzi?kuje, Pozdrawiam
./\To o czym zapomnia?e?. Oraz mam pytanie czy mo?esz mi pom?c z SQL ?? Czy si? znasz?? Nie wypisze tu powodu bo nie b?de robi? offtopa ;]. Tylko prosze o PM. Aha ten Oracle by? mi potrzebny na wczoraj :P Tak, ?eby Ci? jako? zmobilizowa? i stre?ci? to co dzieje sie u mnie na rooku xD!! (100 levle wbite na Minosach ... exp x 15)
Dobra, dobra. Ale jak si? zacina na tak, to ja nic nie zrobie. Ja mog? zrobi? ci tak? kratk?, kt?ra przepuszcza tylko xxx lvl i za t? kratk? b?dzie tp do miasta. W temple tego miasta s? przyciski profesji, ?e podchodzisz, naciskasz i wy?wietla si? na tobie efekt oraz zmienia ci profesje. Jak jeste? zainteresowany to napisz.

Pozdro,
Gelio
 
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Napisa? Raptiler Zobacz post
Wersja 7.6 mazurski (6.6.7)
Prosze o Npc wymienia item o id 2345 i daje graczowi pacc + promocje
Z promocj? to ok, ale nie wiem jak z pacc. Jest funkcja u ciebie, kt?ra dodaje pacca?

Pozdro,
Gelio

Dobra wystarczy z promotion na jedno wyjdzie :)
 
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Dobra, dobra. Ale jak si? zacina na tak, to ja nic nie zrobie. Ja mog? zrobi? ci tak? kratk?, kt?ra przepuszcza tylko xxx lvl i za t? kratk? b?dzie tp do miasta. W temple tego miasta s? przyciski profesji, ?e podchodzisz, naciskasz i wy?wietla si? na tobie efekt oraz zmienia ci profesje. Jak jeste? zainteresowany to napisz.
Pozdro,
Gelio

Aha no to lap:
Kod:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
local stan = 0
local stan_two = 0
local player_pattern = '^[a-zA-Z0-9 -]+$'
local number_pattern = '%d'
local target_cid = 0
local number_pattern_two = '%d+'
local b, e = 0
local count = 0
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)
    if(npcHandler.focus ~= cid) then
        return false
    end
    
    if getPlayerStorageValue(cid,8996) <= 0 then
        setPlayerStorageValue(cid,8996,0)
    end
        
    if msgcontains(msg, 'deposit') or msgcontains(msg, 'wplac') then
        if string.find(msg, number_pattern) then
            b, e = string.find(msg, number_pattern_two)
            count = tonumber(string.sub(msg, b, e))
            if pay(cid,count) then
		        stan = getPlayerStorageValue(cid,8996) + count
		        setPlayerStorageValue(cid,8996,stan)
		        doPlayerRemoveMoney(cid,count)
		        selfSay('Kasa wplacona!')
		        talk_state = 0
		    else
			    selfSay('Nie masz tyle kasy!')
			    talk_state = 0
		    end
        else
            selfSay('Ile chcesz wplacic?')
            talk_state = 1
        end
    elseif msgcontains(msg, 'withdraw') or msgcontains(msg, 'wyplac') then
        if string.find(msg, number_pattern) then
            b, e = string.find(msg, number_pattern_two)
            count = tonumber(string.sub(msg, b, e))
            if getPlayerStorageValue(cid,8996) - count >= 0 then
		        stan = getPlayerStorageValue(cid,8996) - count
		        setPlayerStorageValue(cid,8996,stan)
		        doPlayerAddMoney(cid,count)
		        selfSay('Money was withdrawed!')
		        talk_state = 0
			else
				selfSay('Nie masz tyle kasy na koncie!')
				talk_state = 0
		    end
        else
            selfSay('Ile chcesz pobrac z banku?')
            talk_state = 2
        end
    elseif msgcontains(msg, 'transfer') or msgcontains(msg, 'transferuj') then
        selfSay('Want you for who transfer money?')
        talk_state = 3
    elseif msgcontains(msg, 'balance') or msgcontains(msg, 'stan') then
        selfSay('Your account have ' ..  getPlayerStorageValue(cid,8996) .. 'gp.')
        talk_state = 4		  	
	elseif talk_state == 1 then
	   if string.find(msg, number_pattern) then
		   if pay(cid,msg) then
		      stan = getPlayerStorageValue(cid,8996) + msg
		      setPlayerStorageValue(cid,8996,stan)
		      doPlayerRemoveMoney(cid,msg)
		      selfSay('Kasa oddana!')
		      talk_state = 0
		   else
			  selfSay('Nie masz tyle kasy!')
			  talk_state = 0
		   end
		else
		    selfSay('To nie liczba!')
		    talk_state = 0
	    end
	elseif talk_state == 2 then
	    stan = getPlayerStorageValue(cid,8996)
		if string.find(msg, number_pattern) then
		    if getPlayerStorageValue(cid,8996) - msg >= 0 then
		        stan = getPlayerStorageValue(cid,8996) - msg
		        setPlayerStorageValue(cid,8996,stan)
		        doPlayerAddMoney(cid,msg)
		        selfSay('Kasa podjeta!')
		        talk_state = 0
			else
				selfSay('Nie masz tyle kasy na koncie!')
				talk_state = 0
		    end
		else
		    selfSay('To nie liczba!')
		    talk_state = 0
		end
	elseif talk_state == 3 then
		if string.find(msg, player_pattern) then
		    target_cid = getPlayerByName(msg)
		    if isPlayer(target_cid) == 1 then		        		    
		        talk_state = 4
		        selfSay('Ile chcesz przekazac?')
		    else
			    talk_state = 0
		        selfSay('Gracz nie jest w grze lub nie istnieje!')    
		    end
		else
		    selfSay('To nie nazwa!')
		    talk_state = 0
		end
	elseif talk_state == 4 then
	    stan = getPlayerStorageValue(cid,8996)
		if string.find(msg, number_pattern) then
		    if stan - msg >= 0 then
		        stan_two = getPlayerStorageValue(target_cid,8996) + msg
                    stan = getPlayerStorageValue(cid,8996) - msg
                    setPlayerStorageValue(target_cid,8996,stan_two)
                    setPlayerStorageValue(cid,8996,stan)
                    doPlayerRemoveMoney(cid,msg)
                    talk_state = 0
                    selfSay('Kasa przekazana!')
		    else
		        selfSay('Nie masz tyle kasy na koncie!')
		        talk_state = 0
		    end
		else
		    selfSay('To nie liczba!')
		    talk_state = 0
	    end
	elseif talk_state == 5 then				
	end
		   
    return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Aha no to lap:
Kod:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
local stan = 0
local stan_two = 0
local player_pattern = '^[a-zA-Z0-9 -]+$'
local number_pattern = '%d'
local target_cid = 0
local number_pattern_two = '%d+'
local b, e = 0
local count = 0
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)
    if(npcHandler.focus ~= cid) then
        return false
    end
    if getPlayerStorageValue(cid,8996) <= 0 then
        setPlayerStorageValue(cid,8996,0)
    end
    if msgcontains(msg, 'deposit') or msgcontains(msg, 'wplac') then
        if string.find(msg, number_pattern) then
            b, e = string.find(msg, number_pattern_two)
            count = tonumber(string.sub(msg, b, e))
            if pay(cid,count) then
		        stan = getPlayerStorageValue(cid,8996) + count
		        setPlayerStorageValue(cid,8996,stan)
		        doPlayerRemoveMoney(cid,count)
		        selfSay('Kasa wplacona!')
		        talk_state = 0
		    else
			    selfSay('Nie masz tyle kasy!')
			    talk_state = 0
		    end
        else
            selfSay('Ile chcesz wplacic?')
            talk_state = 1
        end
    elseif msgcontains(msg, 'withdraw') or msgcontains(msg, 'wyplac') then
        if string.find(msg, number_pattern) then
            b, e = string.find(msg, number_pattern_two)
            count = tonumber(string.sub(msg, b, e))
            if getPlayerStorageValue(cid,8996) - count >= 0 then
		        stan = getPlayerStorageValue(cid,8996) - count
		        setPlayerStorageValue(cid,8996,stan)
		        doPlayerAddMoney(cid,count)
		        selfSay('Money was withdrawed!')
		        talk_state = 0
			else
				selfSay('Nie masz tyle kasy na koncie!')
				talk_state = 0
		    end
        else
            selfSay('Ile chcesz pobrac z banku?')
            talk_state = 2
        end
    elseif msgcontains(msg, 'transfer') or msgcontains(msg, 'transferuj') then
        selfSay('Want you for who transfer money?')
        talk_state = 3
    elseif msgcontains(msg, 'balance') or msgcontains(msg, 'stan') then
        selfSay('Your account have ' ..  getPlayerStorageValue(cid,8996) .. 'gp.')
        talk_state = 4		  	
	elseif talk_state == 1 then
	   if string.find(msg, number_pattern) then
		   if pay(cid,msg) then
		      stan = getPlayerStorageValue(cid,8996) + msg
		      setPlayerStorageValue(cid,8996,stan)
		      doPlayerRemoveMoney(cid,msg)
		      selfSay('Kasa oddana!')
		      talk_state = 0
		   else
			  selfSay('Nie masz tyle kasy!')
			  talk_state = 0
		   end
		else
		    selfSay('To nie liczba!')
		    talk_state = 0
	    end
	elseif talk_state == 2 then
	    stan = getPlayerStorageValue(cid,8996)
		if string.find(msg, number_pattern) then
		    if getPlayerStorageValue(cid,8996) - msg >= 0 then
		        stan = getPlayerStorageValue(cid,8996) - msg
		        setPlayerStorageValue(cid,8996,stan)
		        doPlayerAddMoney(cid,msg)
		        selfSay('Kasa podjeta!')
		        talk_state = 0
			else
				selfSay('Nie masz tyle kasy na koncie!')
				talk_state = 0
		    end
		else
		    selfSay('To nie liczba!')
		    talk_state = 0
		end
	elseif talk_state == 3 then
		if string.find(msg, player_pattern) then
		    target_cid = getPlayerByName(msg)
		    if isPlayer(target_cid) == 1 then		        		    
		        talk_state = 4
		        selfSay('Ile chcesz przekazac?')
		    else
			    talk_state = 0
		        selfSay('Gracz nie jest w grze lub nie istnieje!')    
		    end
		else
		    selfSay('To nie nazwa!')
		    talk_state = 0
		end
	elseif talk_state == 4 then
	    stan = getPlayerStorageValue(cid,8996)
		if string.find(msg, number_pattern) then
		    if stan - msg >= 0 then
		        stan_two = getPlayerStorageValue(target_cid,8996) + msg
                    stan = getPlayerStorageValue(cid,8996) - msg
                    setPlayerStorageValue(target_cid,8996,stan_two)
                    setPlayerStorageValue(cid,8996,stan)
                    doPlayerRemoveMoney(cid,msg)
                    talk_state = 0
                    selfSay('Kasa przekazana!')
		    else
		        selfSay('Nie masz tyle kasy na koncie!')
		        talk_state = 0
		    end
		else
		    selfSay('To nie liczba!')
		    talk_state = 0
	    end
	elseif talk_state == 5 then				
	end
    return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Nie o to chodzi?o, no ale ok.

Kratka (movements), kt?ra przepuszcza tylko 8 lvl i wy?ej:
Kod:
function onStepIn(cid, item, pos)
local level = 8    -- Jaki lvl moze przejsc
local access = 1   -- Jaki access nie musi miec tego lvl zeby przejsc
local posWhereTp = {x=123, y=123, z=7}   -- Na jaka pozycje ma tp jezeli nie masz tego lvl

if (getPlayerAccess(cid) < access) then
	if (getPlayerLevel(cid) < level) then
		doTeleportThing(cid,posWhereTp)
		doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,"You don\'t have enought level")
		doSendMagicEffect(posWhereTp,CONST_ME_POFF)
	end
end
end
Do movements.xml:
Kod:
<movevent event="StepIn" uniqueid="unique id kratki" script="kratka od lvl.lua" />

Teraz pstryczki, kt?re daj? profesje:
Kod:
function onUse(cid, item, frompos, item2, topos)
local vocation = 1   -- Jaka profesje ma dac
local vocationName = "sorcerer"  -- Nazwa profesji

if (getPlayerVocation(cid) == 0) then
	doPlayerSetVocation(cid,vocation)
	doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,"Now you are ".. vocationName ..".")
else
	doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,"You already have vocation")
end
end
Do ka?dego pstryczka musi by? inny skrypt i inna konfiguracja.
Przyk?adowe dodanie do actions.xml:
Kod:
<action actionid="actionid pstryczka, ktory zamienia na sorca" script="pstryczek sorcerer.lua" />
Da?em action id, dzi?ki kt?remu mo?esz zrobi? niesko?czono?? pstryczk?w. W ka?dym mie?cie pstryczek o tym samym action id, kt?ry b?dzie korzysta? z jednego skryptu.

Pozdro,
Gelio
 
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Nie wyjdzie na jedno, no ale ok. I daj przyk?adowy plik *.lua jakiego? NPC z twojego otsa.
Pozdro,
Gelio

focus = 0
talk_start = 0
target = 0
following = false
attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)

end


function onCreatureAppear(creature)

end


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)
msg = string.lower(msg)

if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfLook(cid)
selfSay('Witam ' .. creatureGetName(cid) .. '! Sprzedaje armors, legi, helmets, shields, boots.')
focus = cid
talk_start = os.clock()

elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Przepraszam, ' .. creatureGetName(cid) .. '! Ale jestem teraz zajety.')

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

if msgcontains(msg, 'armors') then
selfSay('Sprzedaje: crown armor (40k), knight armor (25k), plate armor (1k), brass armor (500gp), chain armor (200gp)')
elseif msgcontains(msg, 'legi') then
selfSay('Sprzedaje: knight legs (22k), plate legs (1,2k), brass legs (500gp)')
elseif msgcontains(msg, 'helmets') then
selfSay('Sprzedaje: warrior helmet (6k), crown helmet (2,5k), devil helmet (3k).')
elseif msgcontains(msg, 'shields') then
selfSay('Sprzedaje: medusa shield (25k), tower shield (15k), dragon shield (6k), dwarven shield (200gp), guardian shield (3k).')
elseif msgcontains(msg, 'boots') then
selfSay('Sprzedaje: crocodile boots (1,5k), boot of haste (45k).')
elseif msgcontains(msg, 'crown armor') then
buy(cid,2487,1,40000)
elseif msgcontains(msg, 'knight armor') then
buy(cid,2476,1,25000)
elseif msgcontains(msg, 'plate armor') then
buy(cid,2463,1,1000)
elseif msgcontains(msg, 'brass armor') then
buy(cid,2465,1,500)
elseif msgcontains(msg, 'chain armor') then
buy(cid,2464,1,200)
elseif msgcontains(msg, 'knight legs') then
buy(cid,2477,1,22000)
elseif msgcontains(msg, 'plate legs') then
buy(cid,2647,1,1200)
elseif msgcontains(msg, 'brass legs') then
buy(cid,2478,1,500)
elseif msgcontains(msg, 'warrior helmet') then
buy(cid,2475,1,6000)
elseif msgcontains(msg, 'crown helmet') then
buy(cid,2491,1,2500)
elseif msgcontains(msg, 'devil helmet') then
buy(cid,2462,1,3000)
elseif msgcontains(msg, 'medusa shield') then
buy(cid,2536,1,25000)
elseif msgcontains(msg, 'tower shield') then
buy(cid,2528,1,15000)
elseif msgcontains(msg, 'dragon shield') then
buy(cid,2516,1,6000)
elseif msgcontains(msg, 'dwarven shield') then
buy(cid,2525,1,200)
elseif msgcontains(msg, 'guardian shield') then
buy(cid,2515,1,3000)
elseif msgcontains(msg, 'crocodile boots') then
buy(cid,3982,1,1500)
elseif msgcontains(msg, 'boh') or msgcontains(msg, 'boots of haste') then
buy(cid,2195,1,45000)


elseif string.find(msg, '(%a*)bye(%a*)') and getDistanceToCreature(cid) < 4 then
selfSay('Dowidzenia, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end


function onCreatureChangeOutfit(creature)

end


function onThink()
if (os.clock() - talk_start) > 15 then
if focus > 0 then
selfSay('Nastepny prosze...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 3 then
selfSay('Dowidzenia.')
focus = 0
end
end
if focus == 0 then
cx, cy, cz = selfGetPosition()
randmove = math.random(1,10)
if randmove == 1 then
nx = cx + 1
end
if randmove == 2 then
nx = cx - 1
end
if randmove == 3 then
ny = cy + 1
end
if randmove == 4 then
ny = cy - 1
end
if randmove >= 5 then
nx = cx
ny = cy
end
moveToPosition(nx, ny, cz)
--summons = 30
--summons2 = 30
end
end

Prosze oto przyk?adowy npc
 
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Prosze oto przyk?adowy npc
Ok. Zrobi?em ju? skrypt:
Kod:
focus = 0
talk_start = 0
target = 0
following = false
attacking = false
talkState = 0

function onThingMove(creature, thing, oldpos, oldstackpos)

end


function onCreatureAppear(creature)

end


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)
msg = string.lower(msg)

if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfLook(cid)
selfSay('Witam ' .. creatureGetName(cid) .. '! Sprzedaje \'promotion\'.')
focus = cid
talk_start = os.clock()

elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Przepraszam, ' .. creatureGetName(cid) .. '! Ale jestem teraz zajety.')

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

if msgcontains(msg, 'promotion') then
selfSay('Czy chcesz kupic promocje za 20 k?')
talkState = 1
elseif msgcontains(msg, 'tak') then
if (getPlayerVocation(cid) < 5) then
if talkState == 1 then
if pay(cid,20000) then
	doPlayerSetVocation(cid,getPlayerVocation(cid)+4)
	selfSay('Dzieki za 20 k. A tu jest twoja promocja.')
	doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_GREEN)
	talkState = 0
else
	selfSay('Nie masz 20 k')
	talkState = 0
end
else
	selfSay('Co?')
	talkState = 0
end
else
	selfSay('Ty juz masz promocje')
	talkState = 0
end
elseif msgcontains(msg, 'nie') then
if (getPlayerVocation(cid) < 5) then
	if (talkState == 1) then
		selfSay('No wiec nie.')
		talkState = 0
	else
		selfSay('Ale o co ci chodzi?')
	end
else
	selfSay('I tak juz masz promocje')
end


elseif string.find(msg, '(%a*)bye(%a*)') and getDistanceToCreature(cid) < 4 then
selfSay('Dowidzenia, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end


function onCreatureChangeOutfit(creature)

end


function onThink()
if (os.clock() - talk_start) > 15 then
if focus > 0 then
selfSay('Nastepny prosze...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 3 then
selfSay('Dowidzenia.')
focus = 0
end
end
if focus == 0 then
cx, cy, cz = selfGetPosition()
randmove = math.random(1,10)
if randmove == 1 then
nx = cx + 1
end
if randmove == 2 then
nx = cx - 1
end
if randmove == 3 then
ny = cy + 1
end
if randmove == 4 then
ny = cy - 1
end
if randmove >= 5 then
nx = cx
ny = cy
end
moveToPosition(nx, ny, cz)
--summons = 30
--summons2 = 30
end
end
Powinno dzia?a?.


Pozdro,
Gelio

@down
Dobra. Codziennie dostaje po 5 pr??b, a stare nie s? jeszcze sko?czone.

@down edit
Prosze:
Kod:
focus = 0
talk_start = 0
target = 0
following = false
attacking = false
talkState = 0
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
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)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfLook(cid)
selfSay('Witam ' .. creatureGetName(cid) .. '! Sprzedaje \'promotion\'.')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Przepraszam, ' .. creatureGetName(cid) .. '! Ale jestem teraz zajety.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'promotion') then
selfSay('Czy chcesz kupic promocje za 20 k?')
talkState = 1
elseif msgcontains(msg, 'tak') then
if (getPlayerVocation(cid) < 5) then
if talkState == 1 then
if doPlayerRemoveItem(cid,2345) == TRUE then
	doPlayerSetVocation(cid,getPlayerVocation(cid)+4)
	selfSay('Dzieki za 20 k. A tu jest twoja promocja.')
	doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_GREEN)
	talkState = 0
else
	selfSay('Nie masz tej rzeczy.')
	talkState = 0
end
else
	selfSay('Co?')
	talkState = 0
end
else
	selfSay('Ty juz masz promocje')
	talkState = 0
end
elseif msgcontains(msg, 'nie') then
if (getPlayerVocation(cid) < 5) then
	if (talkState == 1) then
		selfSay('No wiec nie.')
		talkState = 0
	else
		selfSay('Ale o co ci chodzi?')
	end
else
	selfSay('I tak juz masz promocje')
end
elseif string.find(msg, '(%a*)bye(%a*)') and getDistanceToCreature(cid) < 4 then
selfSay('Dowidzenia, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 15 then
if focus > 0 then
selfSay('Nastepny prosze...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 3 then
selfSay('Dowidzenia.')
focus = 0
end
end
if focus == 0 then
cx, cy, cz = selfGetPosition()
randmove = math.random(1,10)
if randmove == 1 then
nx = cx + 1
end
if randmove == 2 then
nx = cx - 1
end
if randmove == 3 then
ny = cy + 1
end
if randmove == 4 then
ny = cy - 1
end
if randmove >= 5 then
nx = cx
ny = cy
end
moveToPosition(nx, ny, cz)
--summons = 30
--summons2 = 30
end
end
 
Ostatnia edycja:
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Gelio ale prosi?em aby ten NPC wymienia? promocje za item o id 2345 a nie do kupienia :/
 
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Ej, a co z moim skryptem(tym npc), bo ludziom pisalem ze bedzie ok.19:00.
 
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

skrypt : potions
tibia : 8.31


Witam potrzebuje skrypt na great spirit potion zeby dawal mana jak i hp i sie nie konczyl.... co? takiego ::reatHealthPot = 7591
local greatManaPot = 7590
local strongHealthPot = 7588
local strongManaPot = 7589
local healthPot = 7618
local manaPot = 7620
local manaPot = 8472
function onUse(cid, item, frompos, item2, topos)
if(item.itemid == healthPot) then
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 370, 530, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
elseif(item.itemid == manaPot) then
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
if(doTargetCombatMana(0, cid, 380, 450, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
elseif(item.itemid == strongHealthPot) then
if getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 or getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 8 then
if getPlayerLevel(cid) > 50 then
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 550, 850, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
else
doPlayerSendTextMessage(cid, 21, "Your level is too low.")
end
else
doPlayerSendTextMessage(cid, 21, "You do not have the required vocation.")
end
elseif(item.itemid == strongManaPot) then
if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 6 or getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 then
if getPlayerLevel(cid) > 50 then
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
if(doTargetCombatMana(0, cid, 6150, 7250, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
else
doPlayerSendTextMessage(cid, 21, "Your level is too low.")
end
else
doPlayerSendTextMessage(cid, 21, "You do not have the required vocation.")
end
elseif(item.itemid == greatHealthPot) then
if getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 8 then
if getPlayerLevel(cid) > 80 then
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 1050, 1650, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
else
doPlayerSendTextMessage(cid, 21, "Your level is too low.")
end
else
doPlayerSendTextMessage(cid, 21, "You do not have the required vocation.")
end
elseif(item.itemid == greatManaPot) then
if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 6 then
if getPlayerLevel(cid) > 80 then
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
if(doTargetCombatMana(0, cid, 1250, 1350, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
else
doPlayerSendTextMessage(cid, 21, "Your level is too low.")
end
else
doPlayerSendTextMessage(cid, 21, "You do not have the required vocation.")
end
elseif(item.itemid == greatSpiritPot) then
if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 6 or getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 then
if getPlayerLevel(cid) > 50 then
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
if(doTargetCombatMana(0, cid, 6150, 7250, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
else
doPlayerSendTextMessage(cid, 21, "Your level is too low.")
end
else
doPlayerSendTextMessage(cid, 21, "You do not have the required vocation.")
end
end
return TRUE
end
 
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Siemka Gelio mam pro?be m?g?by? mi poprawi? skrypt na runke kt?ra dodaje mlv pod 7.6
--Runa Dodaj?ca Magic Level--
--Konstrukcja--
function onUse(cid, item, frompos, item2, topos)
--Konfiguracja--
doRemoveItem(item.uid,1)
if item.itemid == 2297 then --Id Runki :)--
doPlayerSay(cid,'Dodalo Mi Magic Level!',16) --To Co B?dzie Pisa?o Po U?yciu Runki :)--
doPlayerAddMLev(cid,10) --Ile Ma Dawa? Magic Leveli :)--
--Koniec--
end
end
 
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Ej, a co z moim skryptem(tym npc), bo ludziom pisalem ze bedzie ok.19:00.
NO KUR*A!!!!!!!!!!!!!!! CZY TO WOG?LE CZYTASZ MOJE POSTY EDYTOWANE?? M?WI?EM, ?E JAK CI SI? ZACINA, TO NIE MOJA WINA I ZROBI?EM INNY SKRYPT!!!!!! CZYTAJ TROCHE!!

Pozdro,
Gelio
 
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

no kur*a!!!!!!!!!!!!!!! Czy to wog?le czytasz moje posty edytowane?? M?wi?em, ?e jak ci si? zacina, to nie moja wina i zrobi?em inny skrypt!!!!!! Czytaj troche!!
Pozdro,
gelio


ale mi chodzilo o npc ktory zamienia item na item!!!!
 
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Siemka Gelio mam pro?be m?g?by? mi poprawi? skrypt na runke kt?ra dodaje mlv pod 7.6
Powinno dzia?a?:
Kod:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, 5*7*24*60*60*1000)
setConditionParam(condition, CONDITION_PARAM_STAT_MAGICPOINTS, 10)   -- Koncowa liczba odpowiada ile m lvl ma dodac

setCombatCondition(combat, condition)

function onUse(cid, item, frompos, item2, topos)
doRemoveItem(item,1)
return doCombat(cid, combat, numberToVariant(cid))
end
Niestety b?dzie dzia?a? tylko do resetu serva ;/

Pozdro,
Gelio

@down
No to wykasuj local. Jezu. A to actions scripts.
 
Ostatnia edycja:
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Spoko :) ,a to jest pod Actions bo co? nie widze id runki :)??Wiem mo?? g?upie pytania ,ale nie znam si? na skryptowaniu :)?A i ,?eby nie by?o ?e Ci? poczam ,ale w 7.6 nie ma local :)
 
Ostatnia edycja:
Odp: Skrypty na zam?wienie.

Odp: Skrypty na zam?wienie.

Typ. Runa -spells
tibia-8.10
zrobisz mi super mr ze jak uzyje wyskacza effect 29 pisze super mana i dodaje 2k many?
 
Status
Zamknięty.
Do góry