Magiczne Fajerwerki

Status
Zamknięty.

Firentis

Advanced User
Zarejestrowany
Dołączył
Lipiec 13, 2009
Posty
174
Liczba reakcji
25
Wi?c jest to prosty skrypt na fajerwerki, kt?re daj? items lub mog? wybuchn?? i odj?? HP graczowi. :D
Prosz? pro elo tnetowskich skrypter?w o popraw? je?li co? jest ?le.

Wchodzimy w data/actions/script i tworzymy plik o nazwie fajerwerki.lua a w nim:

function onUse(cid, item, frompos, item2, topos)
if frompos.x ~= 65535 or frompos.y < 64 then
n = math.random(28, 30)
doSendMagicEffect(frompos, n)
sorte = math.random(1,12)
if sorte == 1 then
doPlayerAddItem(cid,7744,1)
elseif sorte == 2 then
doPlayerAddItem(cid,2523,1)
elseif sorte == 3 then
doPlayerAddItem(cid,2472,1)
elseif sorte == 4 then
doPlayerAddItem(cid,2506,1)
elseif sorte == 5 then
doPlayerAddItem(cid,2640,1)
elseif sorte == 6 then
doPlayerSay(cid,'Arhhh',16)
doPlayerAddHealth(cid,-100)
doSendMagicEffect(frompos, 0)
elseif sorte == 7 then
doPlayerAddItem(cid,6393,1)
elseif sorte == 8 then
doPlayerAddItem(cid,7369,1)
elseif sorte == 9 then
doPlayerAddItem(cid,6576,1)
elseif sorte == 10 then
doPlayerAddItem(cid,7487,1)
elseif sorte == 11 then
doPlayerAddItem(cid,2160,50)
elseif sorte == 12 then
doPlayerAddItem(cid,7499,1)
else
doPlayerAddHealth(cid,-100)
doSendMagicEffect(frompos, 0)
end
doRemoveItem(item.uid, 1)
end
return 1
end

Skrypt mo?emy ?atwo zmieni?!
Kolor - ID itemka
Kolor - Ilo?? itemk?w
Kolor - Ile ma zabiera? ?ycia jak wybuchnie
Kolor - Jaki ma by? napis po wybuchu


Teraz wchodzimy do data/actions p??niej w plik actions.xml i dopisujemy tam linijk?:

<action itemid="6576" script="fajerwerki.lua"/>

Prosz? o komentarze....

Pozdro!
 
Odp: Magiczne Fajerwerki

Fajne, moze ssie komus przyda?, szczeg?lnie na sylwestra (mimo ze jest wielkanoc)

Moja ocena: 7/20
 
Odp: Magiczne Fajerwerki

Na pewno Fajne wypr?buje na swoim otsie moja ocena 10/10
 
Odp: Magiczne Fajerwerki

Tabele nie gryz? xS

Kod:
local table_ = {
	[1] = {id = 7744}, [2] = {id = 2523}, [3] = {id = 2472}, [4] = {id = 2506},
	[5] = {id = 2640}, [6] = {txt = 'Arhhh', hp = -100, effect = 0},
	[7] = {id = 6393}, [8] = {id = 7369}, [9] = {id = 6576}, [10] = {id = 7487},
	[11] = {id = 2160, count = 50}, [12] = {id = 7499}
}

function onUse(cid, item, frompos, item2, topos)
if frompos.x ~= 65535 or frompos.y < 64 then
	local sorte = math.random(1,12)
	local t = table_[sorte]
	if t.id ~= nil then
		doPlayerAddItem(cid, t.id, ((t.count == nil) and 1 or t.count))
	end
	if t.txt ~= nil then
		doPlayerSay(cid, t.txt, 16)
	end
	if t.hp ~= nil then
		doPlayerAddHealth(cid, t.hp)
	end
	if t.effect ~= nil then
		doSendMagicEffect(frompos, t.effect)
	end
	doRemoveItem(item.uid, 1)
	doSendMagicEffect(frompos, math.random(28, 30))
	end
	return 1
end
 
Odp: Magiczne Fajerwerki

Yyy... Losuje od 1 do 12. Od 1 do 12 ma sprawdzi? i da? przedmiot, a je?li b?dzie 6 to dostajemy po ?apach. Je?li b?dzie inna warto?? ni? 1-12 to wysy?a efekt. Nie mo?e by? inna warto?? skoro by?o ich tylko 12... Chyba, ?e co? ?le przeczyta?em, ale w?tpi?.

Pozdrawiam,
Szaki.
 
Status
Zamknięty.
Back
Do góry