• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Actually brain lag why monster damage doesnt increase in spell

SixNine

Active Member
Joined
Dec 12, 2018
Messages
452
Reaction score
41
Its so weird or im just blind and not noticing something but for some reason my monster spell does only 10 energydamage damage even tho i changed formula to a thousands
Lua:
local combats = {}
local areas = {
    -- Area 1
    { arr = {{1, 0, 1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 3, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1, 0, 1}},
        effect = 57
    },
    -- Area 2
    { arr = {{1, 0, 1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 3, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1, 0, 1}},
        type = COMBAT_ENERGYDAMAGE,
        effect = CONST_ME_FIREAREA
    },
    -- Area 3
    { arr = {{0, 1, 0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 3, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0, 1, 0}},
        effect = 57
    },
    -- Area 4
    { arr = {{0, 1, 0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 3, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0, 1, 0},
             {1, 0, 1, 0, 1, 0, 1, 0, 1},
             {0, 1, 0, 1, 0, 1, 0, 1, 0}},
        type = COMBAT_ENERGYDAMAGE,
        effect = CONST_ME_FIREAREA
    }
}
 
for i, arr in pairs(areas) do
combats[i] = Combat()
if arr.effect then combats[i]:setParameter(COMBAT_PARAM_EFFECT, arr.effect) end
combats[i]:setArea(createCombatArea(arr.arr))
if arr.type then
    combats[i]:setParameter(COMBAT_PARAM_TYPE, arr.type)
function onGetFormulaValues(player, level, magicLevel)
    local min = (level * 230) + (magicLevel * 1200.5) + 25
    local max = (level * 230) + (magicLevel * 1310) + 50

    return -min, -max
end
 
    combats[i]:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
    end
end
local function castSpell(creatureId, variant, combatIndex)
    local creature = Creature(creatureId)
    if creature then
        combats[combatIndex]:execute(creature, variant)
    end
end
 
function onCastSpell(creature, variant)
    for i = 2, #areas do
        addEvent(castSpell, 800 * i, creature:getId(), variant, i)
    end
    return combats[1]:execute(creature, variant)
end

Than i even changed it in monsters.xml
Code:
<attack name="spell name" interval="15000" min="-25000" max="-30000"/>

Code:
    <instant name="spell name" words="spell name" enabled="1" prem="0" exhaustion="1000" soul="0" mana="1" maglv="300" lvl="500" aggressive="1" selftarget="1" script="Skill spells/spell name.lua">
    <vocation id="0"/>       
    </instant>

actually confused
 
function onGetFormulaValues(player, level, magicLevel)
local min = (level * 230) + (magicLevel * 1200.5) + 25
local max = (level * 230) + (magicLevel * 1310) + 50

return -min, -max
end

is inside another function, can be the reason not sure
 
function onGetFormulaValues(player, level, magicLevel)
local min = (level * 230) + (magicLevel * 1200.5) + 25
local max = (level * 230) + (magicLevel * 1310) + 50

return -min, -max
end

is inside another function, can be the reason not sure
This "not sure" isnt helpful that much :D :D
 
im not interested, but you might want to try because you have no idea what is the meaning of nested functions :)

maybe not effective but should be helpful you don't know how to solve a problem with requires basics of programming so i told you the solution, if you are waiting for somebody to rewrite it for you enjoy waiting because it won't be me
 
This is a bigger issue :)

local min = (level * 230) + (magicLevel * 1200.5) + 25
local max = (level * 230) + (magicLevel * 1310) + 50
does monsters have levels or magic levels? does monsters really have some kind of variable called magicLevel or Level? maybe and i don't know

what do you expect? (0 * 230) + ( 0 * 1200) + 25 = 25 - player defense = the 10 dmg you talking about.
 
This is a bigger issue :)

local min = (level * 230) + (magicLevel * 1200.5) + 25
local max = (level * 230) + (magicLevel * 1310) + 50
does monsters have levels or magic levels? does monsters really have some kind of variable called magicLevel or Level? maybe and i don't know

what do you expect? (0 * 230) + ( 0 * 1200) + 25 = 25 - player defense = the 10 dmg you talking about.
they doesnt have any level or magiclevel but thats why there is function in monsters.xml where it puts min and max damage
<attack name="spell name" interval="15000" min="-25000" max="-30000"/>
 
im not 100% sure but if there is damage formula inside the spell itself it will be prioritized over monsters.xml
are you sure its true? Because i have multiple spells that uses damage formula inside spell but once i adjust the min max value in monster.xml the damage changes, but with this spell its different somehow
 
Pretty sure you add the damage in the monster file.

XML:
<attack name="spellName" interval="2000" min="1000" max="2000"/>
 
Back
Top