What's new

[8.54] Transform By Dominik ms

Status
Not open for further replies.

dominikms1

Senior User
Joined
Feb 6, 2010
Messages
696
Reaction score
66
Skrypt ma zastosowanie mied? innymi do takich otsow jak naruto czy dragon ball. W grze, gdy wpiszemy !trans i jesli mamy spe?nione wymagania to nasza posta? zmienia na ustalon? profesj? oraz mamy na sobie sta?y magiczny efekt (nawet po relogu). Wiele os?b mnie juz prosi?o o owy skrypt, wi?c daje go do publicznego u?ytku.
1.Do talk talkactions/scripts tworzymy plik o nazwie transofrm.lua
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

Teraz do talkactions.xml
PHP:
	<talkaction words="!trans" script="transofrm.lua"/>

Konfiguracja:
PHP:
		[id profesji] = {outfit = nowy wyglad, manacost = koszt many, level = wymagany poziom, newvoc = nowa profesja, effect = efekt,},

2.Staly efekt effekt
creaturescripts/script tworzymy nowy plik o nazwie trans_efekt.lua
PHP:
function onThink(cid, interval, lastExecution)
local tabela = 
{
	[1] = 1,
	[2] = 2,
	[3] = 3,
	[4] = 4,
}

local efekt = tabela[getPlayerVocation(cid)]
	if (efekt) then
		doSendMagicEffect(getCreaturePosition(cid), efekt)
	end
	return true
end
do creaturescripts.xml
PHP:
	<event type="think" name="effect" script="trans_efekt.lua"/>

do login.lua
PHP:
	registerCreatureEvent(cid, "effect")

Konfiguracja:
PHP:
	[id profesji] = {efekt = id naszego efektu},
 

The Potar

Active User
Joined
Aug 3, 2010
Messages
77
Reaction score
1
Odp: [8.54] Transform By Dominik ms

Mo?e troche rozpiszesz i podasz zastosowanie? I opiszesz sw?j skrypt?
 

Yondaime

Advanced User
Joined
Apr 5, 2008
Messages
311
Reaction score
21
Odp: [8.54] Transform By Dominik ms

Ale? si? wysili? przerobiony skrypt rahima gz....
 

dominikms1

Senior User
Joined
Feb 6, 2010
Messages
696
Reaction score
66
Odp: [8.54] Transform By Dominik ms

Ja ?adnych skrypt?w nie przerabiam, jeszcze nigdy nie ?ci?gn??em ?adnego gotowca, wszystko sam pisz?, wiec mnie nie obra?aj.

Ju? zmieni?em, dzi?ki za rad?.
A ten przecinek to nie koniecznie trzeba usun??, jak jest, to ?adna krzywda si? nie dzieje :)

M?w co jeszcze ?le zrobi?em, ch?tnie wys?ucham.
 
Last edited:
R

Rahim

Guest
Odp: [8.54] Transform By Dominik ms

dominikms1 said:
[id profesji] = {outfit = nowy wyglad, manacost = koszt many, level = wymagany poziom, newvoc = nowa profesja, effect = efekt,},
Czy to nie powinno by? w komentarzu? ;)
dominikms1 said:
[5] = {outfit = {lookType=149}, manacost = 0, level = 1, newvoc = 7, effect = 5},
}
Czy to tylko mi przypomina cz??? konfiguracyjn? z mojego skryptu? xd. Btw. wiesz skrypterze, ?e po ostatnim polu w tabeli nie daje si? przecinka?

M?g?bym si? przyczepi? do jeszcze wielu rzeczy, ale a? mi si? nie chce xd.
 

mateusz2010

Active User
Joined
Mar 26, 2010
Messages
124
Reaction score
10
Odp: [8.54] Transform By Dominik ms

Ktos to testowal? Ani skrypt Rahima ani ten mi nie dziala. Ten to wog?le masa bledow z funkcja doCOmbat ktorej wog?le nie mam.
 

Fikusek

Banned
Joined
May 17, 2010
Messages
248
Reaction score
9
Odp: [8.54] Transform By Dominik ms

@mateusz2010
Ja Go Testowa?em i mi r?wnie? nie dzia?a pobawie si? troche moze ogarne tego skrypta i wrzuce go tu !!! ;DD
 
Status
Not open for further replies.
Top