Witam czy dałby ktoś radę przerobic tego skrypta aby po wpisaniu transform dawał powiedzmy 5000 punktów many i hp , ale po wpisaniu revert lub wylogowaniu była początkowa mana i hp.
Transform
Revert
Transform
Code:
function onSay(cid, words, param, channel)
if(not isPlayer(cid))then
return true
end
local voc = getPlayerVocation(cid)
local transform = TRANSFORM[voc]
local lvl = getPlayerLevel(cid)
local mana = getPlayerMana(cid)
local pos = getCreaturePosition(cid)
if(transform)then
if(transform.level <= lvl)then
if(mana > 10)then
local newVoc, effect = transform.newVoc, transform.effect
return doSendMagicEffect(pos, effect) and doPlayerSetVocation(cid, newVoc) and Outfit(cid) and manaLoss(cid) and true
else
return doPlayerSendCancel(cid, "You need more ki to transform") and doSendMagicEffect(pos, CONST_ME_POFF) and true
end
else
return doPlayerSendCancel(cid, "You need " .. transform.level .. " level to transform") and doSendMagicEffect(pos, CONST_ME_POFF) and true
end
else
return doPlayerSendCancel(cid, "You cannot transform.") and doSendMagicEffect(pos, CONST_ME_POFF) and true
end
return true
end
Revert
Code:
elseif getPlayerVocation(cid) == 204 then
doCreatureChangeOutfit(cid, {lookType=165})
doPlayerSetVocation(cid,121)
doPlayerAddHealthMax(cid,-(getPlayerLevel(cid)*70))
doPlayerAddManaMax(cid,-(getPlayerLevel(cid)*70))