Problem z Manarune!!

Skizo

New User
Zarejestrowany
Dołączył
Kwiecień 5, 2008
Posty
4
Liczba reakcji
0
Witam.
Mam na moim ots problem z manarune gdy podejde do npc Malak i kupie u niego manarune niemoge jej uzywac.
Mam otsa by Aciek mapka evolution.
Z g?ry dziekuje za pomoc...:D
 
wejdz do folderu: data\actions\scripts edytuj plik manarune.lua

i wklej tam to:
  • 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 = 1555 -- 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 * 3) + (mlevel * 5) - 50
    local mana_maximum = (level * 3) + (mlevel * 5)
    -- Mana Formula Settings END --

    local mana_add = math.random(mana_minimum, mana_maximum)

    -- 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(topos,28)
    doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN)
    doSendAnimatedText(topos, mana_add, TEXTCOLOR_LIGHTBLUE)
    doPlayerSay(cid,"Mana UUPP!!!",1)
    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(topos,28)
    doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN)
    doSendAnimatedText(topos, mana_add, TEXTCOLOR_LIGHTBLUE)
    doPlayerSay(cid,"Mana UUPP!!!",1)
    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

teraz

dodaj ta linijke
Kod:
<action itemid="2270" script="manarune.lua"  />
w pliku actions.xml w folderze actions

i na koniec wejdz do folderu spells\scripts\ i zedytuj plik manarune.lua

i wklej to:
Kod:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

function onCastSpell(cid, var)
	doPlayerAddMana(cid, 100)
	return doCombat(cid, combat, var)
end
 
Back
Do góry