Dark Side OTS

Nie tylko o tibii...

  • Nie jesteś zalogowany.
  • Polecamy: Moda

#1 2009-02-18 11:58:42

Nix

http://img27.imageshack.us/img27/2596/administratorm.jpg

Zarejestrowany: 2009-02-17
Posty: 119
Punktów :   

Manaruna

Manaruna

W data/actions/scripts tworzymy plik manarune.lua i wklejamy ten tekst

Spoiler:

function onUse(cid, item, frompos, item2, topos)

    local level = getPlayerLevel(cid)
    local mlevel = getPlayerMagLevel(cid)
   
    -- Exhausted Settings --
    local exhausted_seconds = 1 -- How many seconds manarune will be unavailible to use. --
    local exhausted_storagevalue = 7000 -- Storage Value to store exhaust. It MUST be unused! --
    -- Exhausted Settings END --
   
    -- Mana Formula Settings --
    -- You can use "level" and "mlevel" --
    local mana_minimum = (level * 1) + (mlevel * 2) - 100
    local mana_maximum = (level * 1) + (mlevel * 2)
    -- Mana Formula Settings END --
   
    local mana_add = math.random(500, 2000)
   
        -- We check the charges. --
        if(item.type > 1) then
            -- Exhausted check. --
            if(os.time() > getPlayerStorageValue(cid, exhausted_storagevalue)) then
                -- Entity is player? --
                if(isPlayer(item2.uid) == 1) then
                    doSendMagicEffect(frompos, CONST_ME_MAGIC_RED)
                    doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN)
                    doSendAnimatedText(topos, mana_add, TEXTCOLOR_LIGHTBLUE)
                    doPlayerAddMana(item2.uid, mana_add)
                    setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
                    doChangeTypeItem(item.uid, item.type - 1)
                else
                    doSendMagicEffect(frompos, CONST_ME_POFF)
                    doPlayerSendCancel(cid, "You can use this rune only on players.")
                end
            else
                doSendMagicEffect(frompos, CONST_ME_POFF)
                doPlayerSendCancel(cid, "You are exhausted.")
            end
        else
            if(os.time() < getPlayerStorageValue(cid, exhausted_storagevalue)) then
                doSendMagicEffect(frompos, CONST_ME_POFF)
                doPlayerSendCancel(cid, "You are exhausted.")
            else
                if(isPlayer(item2.uid) == 1) then
                    doSendMagicEffect(frompos, CONST_ME_MAGIC_RED)
                    doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN)
                    doSendAnimatedText(topos, mana_add, TEXTCOLOR_LIGHTBLUE)
                    doPlayerAddMana(item2.uid, mana_add)
                    setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
                    doRemoveItem(item.uid, 1)
                else
                    doSendMagicEffect(frompos, CONST_ME_POFF)
                    doPlayerSendCancel(cid, "You can use this rune only on players.")
                end
            end
        end
                       
    return 1
end

po wklejeniu dopisujemy do pliku data/actions/actions.xml
linijke

Spoiler:

<action itemid="2270" script="manarune.lua" />

i możemy sie cieszyc manaruną


Masz jakieś pytanie?? Pisz na e-mail

Jeśli chcesz miec u nas reklamę (widoczne w stopce) pisz na e-mail

Offline

 

Stopka forum

RSS
Powered by PunBB
© Copyright 2002–2008 PunBB
Polityka cookies - Wersja Lo-Fi


Darmowe Forum | Ciekawe Fora | Darmowe Fora
https://rudolfov.ibetonovejimky.cz Hotels Zambia fretka hodowla