What's new

-Skrypt Przerobienie skryptu na manarune

Status
Not open for further replies.

kubixox

Active User
Joined
Dec 15, 2008
Messages
129
Reaction score
6
Prosz? was, o przerobienie tego o to skryptu:
Code:
local config = {
    exhaustTime = 1,
    exhaustStorageId = 15435
    }
function onUse(cid, item, frompos, item2, topos)
    local lvl, mlvl = getPlayerLevel(cid), getPlayerMagLevel(cid)
    -- formula settings
    local manaMin = (lvl * 3.0) + (mlvl * 3.0)
    local manaMax = (lvl * 3.0) + (mlvl * 5.0)
    -- the rest of the script, don't edit if you don't know what are you doing
    local manaAdd = math.random(manaMin, manaMax)
    if(os.time() <= getPlayerStorageValue(cid, config.exhaustStorageId)) then
        doSendMagicEffect(frompos, CONST_ME_POFF)
        doPlayerSendCancel(cid, "You are exhausted.")
        return 1
    end
    if(isPlayer(item2.uid) == 1) then
        doSendMagicEffect(topos, 30)
        doSendAnimatedText(getPlayerPosition(cid), manaAdd, TEXTCOLOR_PURPLE)
        doPlayerAddMana(item2.uid, manaAdd)
        setPlayerStorageValue(cid, config.exhaustStorageId, os.time() + config.exhaustTime)
    else
        doSendMagicEffect(frompos, CONST_ME_POFF)
        doPlayerSendCancel(cid, "You may use this rune only on players.")
    end
    if(item.type > 1) then
        doChangeTypeItem(item.uid, item.type - 1)
    else
        doRemoveItem(item.uid, 1)
    end
end
Tak aby warto?? dodania many by?a losowa, ale nie mniejsza ni? z tego wzoru, ani nie wi?ksza.
 

zygzagZ

Advanced User
Joined
Aug 14, 2008
Messages
281
Reaction score
34
Odp: Przerobienie skryptu na manarune

Przecie? jest:
Code:
doPlayerAddMana(item2.uid, manaAdd)
Czyli dodaje manaAdd many graczowi item2.uid
A manaAdd jest losowane [local manaAdd = math.random(manaMin, manaMax)] mi?dzy manaMin
Code:
local manaMin = (lvl * 3.0) + (mlvl * 3.0)
A manaMax
Code:
local manaMax = (lvl * 3.0) + (mlvl * 5.0)
 

kubixox

Active User
Joined
Dec 15, 2008
Messages
129
Reaction score
6
Odp: Przerobienie skryptu na manarune

Napisa?em, poniewa? na 300 lvl i 0mlvl ca?y czas dostawia?em 900 many, teraz zauwa?y?em, ?e dostawa?em ca?y czas 900 bo mia?em 0 mlvl.
 
Status
Not open for further replies.
Top