Sonpabo
Active User
- Joined
- Jun 29, 2009
- Messages
- 71
- Reaction score
- 6
Witam napisa?em skrypt na Transform i chce sie z wami nim podzieli?
Autorabo
transform.lua
Wyja?nienie :
revert.lua
login.lua
Lub
Autorabo
transform.lua
PHP:
local Konfiguracja = {
[1] = {profesja = 2, level = 50, wyglad = 342, efekt = 15, maxhp = 300, maxmana = 300, text = "Transform"},
[2] = {profesja = 3, level = 100, wyglad = 343, efekt = 16, maxhp = 500, maxmana = 500, text = "Transform"}
}
function onCastSpell(cid, var)
local voc = getPlayerVocation(cid)
local config = Konfiguracja[voc]
if(config) then
if getPlayerLevel(cid) >= config.level then
doCreatureChangeOutfit(cid,config.wyglad)
doPlayerSetVocation(cid,config.profesja)
doSendMagicEffect(getCreaturePosition(cid),config.efekt)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid),config.maxhp)
setCreatureMaxMana(cid, getCreatureMaxMana(cid),config.maxmana)
else
doPlayerSendCancel(cid, "Transform - "..config.level.." for "..config.text.." .")
end
else
doPlayerSendCancel(cid,"You Cannot Transform.")
end
end
Wyja?nienie :
PHP:
[voc przed transem] = {profesja = na jaki zmienia, level = wymagany lvl, wyglad = jak ma postac wyglodac, efekt = efekt przy trasie, maxhp = bonushp, maxmana = bonusmany, text = "Napis"}
revert.lua
PHP:
local Konfiguracja = {
[2] = {profesja = 1, nowy_wyglad = 342, maxhp =-300, maxmana= -300, efekt = 15},
[3] = {profesja = 1, wyglad = 342, maxhp =-500, maxmana = -500, efekt = 15}
}
function onCastSpell(cid, var)
local voc = getPlayerVocation(cid)
local config = Konfiguracja[voc]
if(config) then
doCreatureChangeOutfit(cid,config.wyglad)
doPlayerSetVocation(cid,config.profesja)
doSendMagicEffect(getPlayerPosition(cid),config.efekt)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid),config.maxhp)
setCreatureMaxMana(cid, getCreatureMaxMana(cid),config.maxmana)
else
doPlayerSendCancel(cid,"Normal State.")
end
end
login.lua
PHP:
function onLogin(cid)
local Konfiguracja = {
[1] = {profesja = 2, maxhp = -300, maxmana = -300},
}
function onCastSpell(cid, var)
local voc = getPlayerVocation(cid)
local config = Konfiguracja[voc]
if(config) then
doPlayerSetVocation(cid,config.profesja)
doSendMagicEffect(getCreaturePosition(cid),config.efekt)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid),config.maxhp)
setCreatureMaxMana(cid, getCreatureMaxMana(cid),config.maxmana)
end
end
Lub
PHP:
function onLogin(cid)
if (getPlayerVocation(cid) == 2) then
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doPlayerAddMana(cid, getPlayerMaxMana(cid))
doPlayerSetVocation(cid, 1)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - 300)
setCreatureMaxMana(cid, getPlayerMaxMana(cid) - 300)