Hello, this is my first spell that I release, I worked on it for 3 days.
Credits goes much to me, but I was in need of googling with exhaustion and combat..
How it works:
ulterior - store your current mana
ulterior mana - release all stored mana, by increasing maximum mana
ulterior vis - release all stored mana, by an attack (vis is latin for force, or attack)
ulterior = latin for later
talkaction.xml
createultima.lua
Btw, it hasnt been tested on servers, so it might not be balanced.
GLHF xd
Credits goes much to me, but I was in need of googling with exhaustion and combat..
How it works:
ulterior - store your current mana
ulterior mana - release all stored mana, by increasing maximum mana
ulterior vis - release all stored mana, by an attack (vis is latin for force, or attack)
ulterior = latin for later
talkaction.xml
Code:
<talkaction words="ulterior" event="script" value="createultima.lua"/>
createultima.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
local a = createConditionObject(CONDITION_EXHAUST)
setConditionParam(a, CONDITION_PARAM_TICKS, 2000)
setConditionParam(a, CONDITION_PARAM_SUBID, 4)
function onGetFormulaValues(cid, level, maglevel)
return -getPlayerStorageValue(cid, 12390)
end
arr11 = {
{0, 0, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 2, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 0, 0},
}
local area1 = createCombatArea(arr11)
setCombatArea(combat, area1)
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function removeBuff(cid)
if(getPlayerStorageValue(cid, 12391)==1) then
setCreatureMaxMana(cid, getPlayerStorageValue(cid, 12290))
doPlayerAddMana(cid, -getPlayerStorageValue(cid, 12390))
setPlayerStorageValue(cid, 12390, 0)
doSendAnimatedText(getCreaturePosition(cid), "Buff Removed", 70)
end
return true
end
function onSay(cid, words, param, channel)
if hasCondition(cid, CONDITION_EXHAUST, 4) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return doSendMagicEffect(getCreaturePosition(cid), 2)
else
doAddCondition(cid, a)
if(param == "mana") then
doSendMagicEffect(getCreaturePosition(cid), 5)
doSendAnimatedText(getCreaturePosition(cid), words .. " " .. param, 70)
setPlayerStorageValue(cid, 12290, getPlayerMaxMana(cid))
setCreatureMaxMana(cid, getPlayerMaxMana(cid) + getPlayerStorageValue(cid, 12390))
doPlayerAddMana(cid, getPlayerStorageValue(cid, 12390))
setPlayerStorageValue(cid, 12391, 1)
addEvent(removeBuff, 5000, cid)
end
if(param == "vis") then
doSendMagicEffect(getCreaturePosition(cid), 5)
doSendAnimatedText(getCreaturePosition(cid), words .. " " .. param, 70)
doCombat(cid, combat, positionToVariant(getPlayerPosition(cid)))
return doPlayerSetStorageValue(cid, 12390, 0)
end
if(param == "") then
if getPlayerStorageValue(cid, 12390) > getPlayerMaxMana(cid)*3 then
doSendMagicEffect(getCreaturePosition(cid), 2)
doSendAnimatedText(getCreaturePosition(cid), "Full!", 70)
return doPlayerSendCancel(cid, "You have maximum black mana. You have "
.. getPlayerStorageValue(cid, 12390) .. " mana.")
end
if getPlayerMana(cid) > 499 and getPlayerStorageValue(cid, 12390) < 1 then
doPlayerSetStorageValue(cid, 12390, getPlayerMana(cid))
doCreatureAddMana(cid, -getPlayerMana(cid))
doSendMagicEffect(getCreaturePosition(cid), 13)
doSendAnimatedText(getCreaturePosition(cid), words, 70)
return doPlayerSendCancel(cid, "You have: " .. tostring(getPlayerStorageValue(cid, 12390)) .. " black mana.")
elseif getPlayerMana(cid) > 499 and getPlayerStorageValue(cid, 12390) > 0 then
doPlayerSetStorageValue(cid, 12390, getPlayerMana(cid)+getPlayerStorageValue(cid, 12390))
doCreatureAddMana(cid, -getPlayerMana(cid))
doSendMagicEffect(getCreaturePosition(cid), 13)
doSendAnimatedText(getCreaturePosition(cid), words, 70)
return doPlayerSendCancel(cid, "You have: " .. tostring(getPlayerStorageValue(cid, 12390)) .. " black mana.")
else
doSendMagicEffect(getCreaturePosition(cid), 2)
return doPlayerSendCancel(cid, "You do not have enough mana.")
end
end
end
return true
end
Btw, it hasnt been tested on servers, so it might not be balanced.
GLHF xd