What's new

Support Scripts - naprawiamy / tworzymy

Status
Not open for further replies.

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: Support Scripts - naprawiamy / tworzymy

ErMex said:
Dodaje, ?e nie robimy skrypt?w z pokemonami zwi?zanymi!

To na tyle na ten temat.
 

Elvascoo

Active User
Joined
Nov 2, 2010
Messages
59
Reaction score
0
Odp: Support Scripts - naprawiamy / tworzymy

Skrypt:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if doPlayerRemoveMoney(cid, 10000) == TRUE then
doPlayerSendTextMessage(cid,COLOR_RED ,"AOL!")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_SOUND_RED)
doPlayerAddItem(cid, 2173, 1)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Nie Posiadasz 1 Crystal Coin.")
end
return TRUE
end
Opis Skryptu: Przy zakupie aola wyskakuje napis jak na screenie taki sam
screen: pr?bowa?em to zrobi? ale nie dzia?a. Prosze o szybka odpowiedz.
 

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: Support Scripts - naprawiamy / tworzymy

PHP:
local config = {
				bless = 5, --ilosc blessow, ktore gracz otrzyma (od 0 do 5)
				cost = 5000, --cena JEDNEGO blessa
				aol_price = 10000 --cena jednego AoLa
				}
local bless_uid, aol_uid = 1000, 1001

function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.uid == bless_uid then
	if doPlayerRemoveMoney(cid, config.bless * config.cost) then
		doSendAnimatedText(fromPosition, 'BLESS', COLOR_DARKYELLOW)
		doSendMagicEffect(fromPosition, CONST_ME_SOUND_YELLOW)
		for i = 1, config.bless do
			doPlayerAddBlessing(cid, i)
		end
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You need more than '..config.bless * config.cost..' Gold Coins.')
	end
elseif item.uid == aol_uid then
	if doPlayerRemoveMoney(cid, config.aol_price) then
		doPlayerAddItem(cid, 2173, 1)
		doSendAnimatedText(fromPosition, 'AOL', COLOR_RED)
		doSendMagicEffect(fromPosition, CONST_ME_SOUND_RED)
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You need more than '..config.aol_price..' Gold Coins.')
	end
end
return true
end
Uid, kt?re u?ywasz to 1000, 1001.
 
Joined
Aug 8, 2009
Messages
18
Reaction score
0
Odp: Support Scripts - naprawiamy / tworzymy

potrzebuje skryptu ktory byl by taki sam jak ten tylko ze w podwojnej formie np

function onLogin(cid)

if getPlayerVocation(cid) == 2 then
doPlayerSetVocation(cid,2)
doSetCreatureOutfit(cid, {lookType=30}, -1)
else
if getPlayerVocation(cid) == 3 then
doPlayerSetVocation(cid,3)
doSetCreatureOutfit(cid, {lookType=30}, -1)
end

to potrzebuje takiego skrypta w formie podwojnej np. do profesji id 3 itp
 

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: Support Scripts - naprawiamy / tworzymy

PHP:
local cfg = {
			[1] = {new_voc = 2, out = {lookType = 30}},
			[2] = {new_voc = 3, out = {lookType = 30}},
			[3] = {new_voc = 4, out = {lookType = 30}},
			[4] = {new_voc = 5, out = {lookType = 30}}
			}
for k, v in pairs(cfg) do
if getPlayerVocation(cid) == k then
	doPlayerSetVocation(cid, v.new_voc)
	doSetCreatureOutfit(cid, v.out, -1)
end
 

Collerk

Active User
Joined
Jul 12, 2010
Messages
96
Reaction score
2
Odp: Support Scripts - naprawiamy / tworzymy

Siema.
Skrypt:
local config = {
bless = 5, --ilosc blessow, ktore gracz otrzyma (od 0 do 5)
cost = 5000, --cena JEDNEGO blessa
aol_price = 10000 --cena jednego AoLa
}
local bless_uid, aol_uid = 1000, 1001

function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.uid == bless_uid then
if doPlayerRemoveMoney(cid, config.bless * config.cost) then
doSendAnimatedText(fromPosition, 'BLESS', COLOR_DARKYELLOW)
doSendMagicEffect(fromPosition, CONST_ME_SOUND_YELLOW)
for i = 1, config.bless do
doPlayerAddBlessing(cid, i)
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You need more than '..config.bless * config.cost..' Gold Coins.')
end
elseif item.uid == aol_uid then
if doPlayerRemoveMoney(cid, config.aol_price) then
doPlayerAddItem(cid, 2173, 1)
doSendAnimatedText(fromPosition, 'AOL', COLOR_RED)
doSendMagicEffect(fromPosition, CONST_ME_SOUND_RED)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You need more than '..config.aol_price..' Gold Coins.')
end
end
return true
end

Opis skrytu.
Chce poprostu jak kupie ten aol i bless to ?eby odpowiednia ilo?? zabiera?a pieni?dze przy zakupie aola i blessa.
 

Warcho

User
Joined
Nov 10, 2010
Messages
47
Reaction score
1
Odp: Support Scripts - naprawiamy / tworzymy

Skrypt:
Code:
function onUse(cid, item, frompos, item2, topos)
	local level = getPlayerLevel(cid)
	local mlevel = getPlayerMagLevel(cid)
	local exhausted_seconds = 1
	local exhausted_storagevalue = 7480
	local mana_minimum = 50000
	local mana_maximum = 50000
	local mana_add = math.random(mana_minimum, mana_maximum)
		if(item.type >= 100) then
			if(os.time() > getPlayerStorageValue(cid, exhausted_storagevalue)) then
				if(isPlayer(cid) == 1) then
doSendMagicEffect(topos,12)
					doPlayerAddMana(cid, mana_add)
                                        doPlayerAddHealth(cid, mana_add)
doPlayerSay(cid,"I feel the best",1)
					setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
				else
					doSendMagicEffect(frompos, CONST_ME_POFF)
					doPlayerSendCancel(cid, "You are exchausted.")
				end
			else
				doSendMagicEffect(frompos, CONST_ME_POFF)
				doPlayerSendCancel(cid, "You are exhausted.")
			end
		else
			if(os.time() < getPlayerStorageValue(cid, exhausted_storagevalue)) then
				doSendMagicEffect(frompos, CONST_ME_POFF)
				doPlayerSendCancel(cid, "You are exhausted.")
			else
				if(isPlayer(cid) == 1) then
doSendMagicEffect(topos,12)
					doPlayerAddMana(cid, mana_add)
                                        doPlayerAddHealth(cid, mana_add*1.5)
doPlayerSay(cid,"I feel the best",1)
					setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
					doRemoveItem(item.uid, 1)
				else
					doSendMagicEffect(frompos, CONST_ME_POFF)
					doPlayerSendCancel(cid, "You are exchausted.")
				end
			end
		end
	return 1
end
Opis skryptu: jak dam use na senzu to jest effekt i napis a jak na hota ustawie to tylko napis jest effekta juz nie ma
Dodatkowe: z gory dzienki :)
 
Last edited:

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: Support Scripts - naprawiamy / tworzymy

#2up
Przecie? wpisujesz cen? w tabelce...

#up
PHP:
local cfg = {
			exhausted_seconds = 1,
			exhausted_storagevalue = 7480,
			mana_minimum = 50000,
			mana_maximum = 50000
			}
			
function onUse(cid, item, frompos, itemEx, topos)
local mana_add, pos = math.random(cfg.mana_minimum, cfg.mana_maximum), getCreaturePosition(cid)
if item.type >= 100 then
	if os.time() > getPlayerStorageValue(cid, cfg.exhausted_storagevalue) then
		doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)
		doPlayerAddMana(cid, mana_add)
        doPlayerAddHealth(cid, mana_add)
		doCreatureSay(cid, 'I feel the best', TALKTYPE_SAY)
		setPlayerStorageValue(cid, cfg.exhausted_storagevalue, os.time() + cfg.exhausted_seconds)
	else
		doSendMagicEffect(pos, CONST_ME_POFF)
		doPlayerSendCancel(cid, 'You are exchausted.')
	end
else
	print('[ERROR] - I have found some bug (?)')
end
return true
end
 

Warcho

User
Joined
Nov 10, 2010
Messages
47
Reaction score
1
Odp: Support Scripts - naprawiamy / tworzymy

pisze mi "you can not use this obiect"
a w silniku [ERROR] - I have found some bug (?)

help ;p

@edit
Thx dziala ;p
nie dzialalo to ze mowil i feel the best ale dalem
Code:
doPlayerSay(cid,"I feel the best",1)
zamiast
Code:
 doCreatureSay(cid, 'I feel the best', TALKTYPE_SAY)
i dziala :p
jeszcze raz thx
 
Last edited:

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: Support Scripts - naprawiamy / tworzymy

PHP:
local cfg = { 
            exhausted_seconds = 1, 
            exhausted_storagevalue = 7480, 
            mana_minimum = 50000, 
            mana_maximum = 50000 
            } 
             
function onUse(cid, item, frompos, itemEx, topos) 
local mana_add, pos = math.random(cfg.mana_minimum, cfg.mana_maximum), getCreaturePosition(cid) 
    if os.time() > getPlayerStorageValue(cid, cfg.exhausted_storagevalue) then 
        doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE) 
        doPlayerAddMana(cid, mana_add) 
        doPlayerAddHealth(cid, mana_add) 
        doCreatureSay(cid, 'I feel the best', TALKTYPE_SAY) 
        setPlayerStorageValue(cid, cfg.exhausted_storagevalue, os.time() + cfg.exhausted_seconds) 
    else 
        doSendMagicEffect(pos, CONST_ME_POFF) 
        doPlayerSendCancel(cid, 'You are exchausted.') 
    end
return true 
end
 

Collerk

Active User
Joined
Jul 12, 2010
Messages
96
Reaction score
2
Odp: Support Scripts - naprawiamy / tworzymy

No tak ale cena Aola jest ustalona w tym skrypcie?
local config = {
bless = 5, --ilosc blessow, ktore gracz otrzyma (od 0 do 5)
cost = 5000, --cena JEDNEGO blessa
aol_price = 10000 --cena jednego AoLa
}
local bless_uid, aol_uid = 1000, 1001

function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.uid == bless_uid then
if doPlayerRemoveMoney(cid, config.bless * config.cost) then
doSendAnimatedText(fromPosition, 'BLESS', COLOR_DARKYELLOW)
doSendMagicEffect(fromPosition, CONST_ME_SOUND_YELLOW)
for i = 1, config.bless do
doPlayerAddBlessing(cid, i)
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You need more than '..config.bless * config.cost..' Gold Coins.')
end
elseif item.uid == aol_uid then
if doPlayerRemoveMoney(cid, config.aol_price) then
doPlayerAddItem(cid, 2173, 1)
doSendAnimatedText(fromPosition, 'AOL', COLOR_RED)
doSendMagicEffect(fromPosition, CONST_ME_SOUND_RED)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You need more than '..config.aol_price..' Gold Coins.')
end
end
return true
end
 

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: Support Scripts - naprawiamy / tworzymy

PHP:
local config = {
bless = 5, --ilosc blessow, ktore gracz otrzyma (od 0 do 5)
cost = 5000, --cena JEDNEGO blessa
aol_price = 10000 --cena jednego AoLa
}
Czytanie ze zrozumieniem si? k?ania >.<
 

cell

Active User
Joined
May 12, 2008
Messages
80
Reaction score
1
Odp: Support Scripts - naprawiamy / tworzymy

PHP:
local tabela = 
    {
        [1] = {outfit = {lookType=150}, manacost = 0, level = 1, newvoc = 2, effect = 4,},
        [2] = {outfit = {lookType=149}, manacost = 0, level = 1, newvoc = 3, effect = 5},
        [3] = {outfit = {lookType=148}, manacost = 0, level = 1, newvoc = 4, effect = 6},
        [4] = {outfit = {lookType=147}, manacost = 0, level = 1, newvoc = 5, effect = 8},
        [5] = {outfit = {lookType=149}, manacost = 0, level = 1, newvoc = 7, effect = 5},
    }
function onSay(cid, words, param, channel)
trans = tabela[getPlayerVocation(cid)]
    if(trans) then
        if getPlayerLevel(cid) >= trans.level then
            if getPlayerMana(cid) >= trans.manacost then
                doPlayerSetVocation(cid, trans.newvoc)
                doSetCreatureOutfit(cid, trans.outfit, -1)
                doSendMagicEffect(getPlayerPosition(cid), trans.effect)
                 doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, "You are transofrmed!")
                doPlayerAddMana(cid, trans.manacost)
            else
                doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, "Do you need " .. trans.manacost .. " mana points")
                return true
            end
        else
             doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, "Do you need " .. trans.level .. " level")
            return true
        end
    else
        doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, "You don't have more trans!")
        return true
    end
end
Prosz? o dodanie temu skryptu czy dla pacc'a
Przyk?adowo:
[1] = {outfit = {lookType=150}, manacost = 0, level = 1, newvoc = 2, effect = 4, Pacc = yes,},
Yes- dla pacca
no - dla wszystkich
 

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: Support Scripts - naprawiamy / tworzymy

PHP:
local tabela =  
    { 
        [1] = {outfit = {lookType=150}, manacost = 0, level = 1, newvoc = 2, effect = 4, pacc = 'yes'}, 
        [2] = {outfit = {lookType=149}, manacost = 0, level = 1, newvoc = 3, effect = 5, pacc = 'yes'}, 
        [3] = {outfit = {lookType=148}, manacost = 0, level = 1, newvoc = 4, effect = 6, pacc = 'no'}, 
        [4] = {outfit = {lookType=147}, manacost = 0, level = 1, newvoc = 5, effect = 8, pacc = 'yes'}, 
        [5] = {outfit = {lookType=149}, manacost = 0, level = 1, newvoc = 7, effect = 5, pacc = 'yes'}, 
    } 
function onSay(cid, words, param, channel) 
local trans = tabela[getPlayerVocation(cid)] 
    if trans then 
        if getPlayerLevel(cid) >= trans.level then 
            if getPlayerMana(cid) >= trans.manacost then
				if trans.pacc == 'yes' and getPlayerPremiumDays(cid) > 0 then
					doPlayerSetVocation(cid, trans.newvoc) 
					doSetCreatureOutfit(cid, trans.outfit, -1) 
					doSendMagicEffect(getPlayerPosition(cid), trans.effect) 
					doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, "You are transofrmed!") 
					doPlayerAddMana(cid, trans.manacost) 
				else
					doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, "You do not have premium account") 
					return true 
				end 
			else 
                doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, "Do you need " .. trans.manacost .. " mana points") 
                return true 
            end 
        else 
             doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, "Do you need " .. trans.level .. " level") 
            return true 
        end 
    else 
        doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, "You don't have more trans!") 
        return true 
    end 
end
O to chodzi?o?
 

Dybalek

New User
Joined
Mar 22, 2009
Messages
2
Reaction score
0
Odp: Support Scripts - naprawiamy / tworzymy

Witam!
Mia?bym wielk? pro?b? , a mianowicie potrzebuje skrypt na kratk? na kt?r? mo?na wej?? tylko je?li si? ma dany Storage :) Z g?ry dzi?kuje!! Tibia 8.6/8.7
 

ErMex

Egzekucja
Joined
Dec 1, 2010
Messages
574
Reaction score
181
Odp: Support Scripts - naprawiamy / tworzymy

Witam!
Mia?bym wielk? pro?b? , a mianowicie potrzebuje skrypt na kratk? na kt?r? mo?na wej?? tylko je?li si? ma dany Storage :) Z g?ry dzi?kuje!! Tibia 8.6/8.7
Pomyli?e? tematy :(

Code:
function onStepIn(cid, item, position, fromPosition)
local tileConfig = {
	kickPos = fromPosition,
	kickMsg = "Niestety, nie przejdzies tedy.",
	storage = 98442
}
if getPlayerStorageValue(cid, 98442) == -1 then 
        doTeleportThing(cid, tileConfig.kickPos)
        doSendMagicEffect(tileConfig.kickPos, tileConfig.kickEffect)
        doPlayerSendCancel(cid, tileConfig.kickMsg)
	else
        doSendMagicEffect(position, tileConfig.enterEffect)
end       
		return true
end
 

MisterZderzak

Advanced User
Joined
Feb 2, 2010
Messages
191
Reaction score
1
Odp: Support Scripts - naprawiamy / tworzymy

Skrypt: Items
Opis skryptu: Chc? zeby np. jak robie items dla palla zeby to bylo dla palla a nie dla all gdzie mam to zrobic zeby to bylo dla palla?
 

laseczka1991

Advanced User
Joined
Jul 11, 2009
Messages
260
Reaction score
5
Age
32
Odp: Support Scripts - naprawiamy / tworzymy

Witam.
Skrypt na Spell'a Auto Destruction.
Tibia: 8.54 TFS 0.3.6

obaszr:
arr1 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 2, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}

Po uzyciu tego czaru zostaje nam 1hp.

Chyba nic wiecej nie musze tlumaczyc.
Dzieki :)
 

Eturl

We shall know no fear!
Joined
May 21, 2008
Messages
2,280
Reaction score
463
Age
32
Odp: Support Scripts - naprawiamy / tworzymy

Temat tymczasowo zamykam na pro?b? autora
 
Status
Not open for further replies.
Top