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
Teraz do talkactions.xml
Konfiguracja:
2.Staly efekt effekt
creaturescripts/script tworzymy nowy plik o nazwie trans_efekt.lua
do creaturescripts.xml
do login.lua
Konfiguracja:
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
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},