• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Add Hp

Skoczi

New Member
Joined
Jun 6, 2012
Messages
115
Reaction score
0
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

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))
 
Jak dla mnie powinienes dodaj storage przed transform i tam zapisac aktualna ilosc HP/MP, albo jezeli gracz ma to cos to storage == 1. I jezeli napisze to co chcesz to sprawdza czy ma 1 i wtedy oblicza mu HP w zaleznosci od lvl. I jezeli loguje to sprawdza czy ma to storage == 1 i wtedy tak samo oblicza HP.

Skrypt wydaje mi sie dosc prosty do napisania.
 
Back
Top