There's a few things I've been wanting to ask since I can't seem to figure them out on my own.
1. I have successfully created a mana rune. However, I want to be able to use it on itself and give the mana to me. (e.j. right-click on it, then left-click on it), instead of having to aim it at my character. I tried doing "needtarget=0" and "selftarget=1" but neither worked.
2. On a similar topic, I want to make a rune that heals both hp and mana.
manarune.lua
ultimate_healing_rune.lua
3. I want to modify ultimate explosion damage so that the damage depends on your level ONLY (Disregard mlvl) and that the damage has little to no fluctuation (e.j. damage is now 1000-6000, and I want it to be just 6000 or 5000-6000) How can I do this?
There's this combat formula that I don't quite understand.
ultimate_explosion.lua
I know I'm asking a lot but believe me, I wouldn't be asking if I hadn't already tried to do it myself. I always try to figure it out myself and understand the scripts before asking. Thank you for your time.
1. I have successfully created a mana rune. However, I want to be able to use it on itself and give the mana to me. (e.j. right-click on it, then left-click on it), instead of having to aim it at my character. I tried doing "needtarget=0" and "selftarget=1" but neither worked.
2. On a similar topic, I want to make a rune that heals both hp and mana.
manarune.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_MANADRAIN)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
--setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 2.5, -30, 2.5, 0)
function onGetFormulaValues(cid, level, maglevel)
min = (level * 100000 + maglevel * 3) * 1.5
max = (level * 100000 + maglevel * 3) * 2.0
if min < 200 then
min = 200
end
return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
ultimate_healing_rune.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
--setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 2.5, -30, 2.5, 0)
function onGetFormulaValues(cid, level, maglevel)
min = (level * 2 + maglevel * 3) * 1.5
max = (level * 2 + maglevel * 3) * 2.0
if min < 200 then
min = 200
end
return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
3. I want to modify ultimate explosion damage so that the damage depends on your level ONLY (Disregard mlvl) and that the damage has little to no fluctuation (e.j. damage is now 1000-6000, and I want it to be just 6000 or 5000-6000) How can I do this?
There's this combat formula that I don't quite understand.
ultimate_explosion.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONAREA)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1.92, -0, -3.0, -0)
arr = {
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
}
local area = createCombatArea(arr)
setCombatArea(combat, area)
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
I know I'm asking a lot but believe me, I wouldn't be asking if I hadn't already tried to do it myself. I always try to figure it out myself and understand the scripts before asking. Thank you for your time.