Werewolf
Forbidden Ascension
- Joined
- Jul 15, 2012
- Messages
- 886
- Reaction score
- 123
Okay im sorry if this looks like a Frankenstein spell but i have been jumping through hoops to try and get a DOT spell that goes up with levels,
Okay so atm, when i cast the spell, it shoots at the target, gits them. they get hit by fire dmg, but no attrition damage is applied, in my console it says
when i take out local condition = createConditionObject(CONDITION_FIRE) from the oncastspell and put it abouve local combat, i no longer get the console error but the attrition still does not work. Does anyone perhaps know what im doing wrong?
LUA:
local arr = {
{
{1},
{2}
},
{
{0, 0, 0},
{1, 3, 1}
},
{
{1, 0, 1},
{0, 2, 0},
{0, 1, 0}
},
{
{1, 0, 1},
{0, 2, 0},
{1, 0, 1}
},
{
{1, 1, 1},
{0, 2, 0},
{1, 0, 1}
},
{
{1, 1, 1},
{0, 2, 0},
{1, 1, 1}
},
{
{1, 1, 1},
{0, 2, 1},
{1, 1, 1}
},
{
{1, 1, 1},
{1, 2, 1},
{1, 1, 1}
},
{
{0, 1, 0},
{1, 1, 1},
{1, 2, 1},
{1, 1, 1}
},
{
{0, 1, 0},
{1, 1, 1},
{1, 2, 1},
{1, 1, 1},
{0, 1, 0}
}
}
local combat = {}
for a = 1, 10 do
combat[a] = createCombatObject()
setCombatParam(combat[a], COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat[a], COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE)
setCombatParam(combat[a], COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)
setCombatArea(combat[a], createCombatArea(arr[a]))
setCombatFormula(combat[a], COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1)
end
function onCastSpell(cid, var)
local condition = createConditionObject(CONDITION_FIRE)
local level = getPlayerLevel(cid)
if level < 75 then
doCombat(cid, combat[1], var)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 5, 1000, -10)
elseif level < 125 then
doCombat(cid, combat[2], var)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 5, 1000, -15)
elseif level < 175 then
doCombat(cid, combat[3], var)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 5, 1000, -20)
elseif level < 225 then
doCombat(cid, combat[4], var)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 5, 1000, -25)
elseif level < 275 then
doCombat(cid, combat[5], var)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 5, 1000, -30)
elseif level < 325 then
doCombat(cid, combat[6], var)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 5, 1000, -35)
elseif level < 375 then
doCombat(cid, combat[7], var)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 5, 1000, -40)
elseif level < 425 then
doCombat(cid, combat[8], var)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 5, 1000, -45)
elseif level < 475 then
doCombat(cid, combat[9], var)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 5, 1000, -50)
else
doCombat(cid, combat[10], var)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 3, 1000, -55)
end
setCombatCondition(combat[1], condition)
setCombatCondition(combat[2], condition)
setCombatCondition(combat[3], condition)
setCombatCondition(combat[4], condition)
setCombatCondition(combat[5], condition)
setCombatCondition(combat[6], condition)
setCombatCondition(combat[7], condition)
setCombatCondition(combat[8], condition)
setCombatCondition(combat[9], condition)
setCombatCondition(combat[10], condition)
return true
end
Okay so atm, when i cast the spell, it shoots at the target, gits them. they get hit by fire dmg, but no attrition damage is applied, in my console it says
PHP:
[9:57:24.284] [Error - Spell Interface]
[9:57:24.285] data/spells/scripts/advancable attrition.lua:onCastSpell
[9:57:24.286] Description:
[9:57:24.286] (luaAddDamageCondition) Condition not found
when i take out local condition = createConditionObject(CONDITION_FIRE) from the oncastspell and put it abouve local combat, i no longer get the console error but the attrition still does not work. Does anyone perhaps know what im doing wrong?