• 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!

TFS 1.X+ utito tempo

alcapone

Member
Joined
Jan 13, 2021
Messages
89
Reaction score
10
I have a problem when the player uses a lot of time and says the exori magic has no difference in damage as if the exori magic was not detecting the increase in skills

Lua:
local condition = Condition(CONDITION_ATTRIBUTES)
condition:setParameter(CONDITION_PARAM_SUBID, 5)
condition:setParameter(CONDITION_PARAM_TICKS, 10000)
condition:setParameter(CONDITION_PARAM_SKILL_MELEEPERCENT, 135)
condition:setParameter(CONDITION_PARAM_BUFF_DAMAGERECEIVED, 115)
condition:setParameter(CONDITION_PARAM_DISABLE_DEFENSE, true)
condition:setParameter(CONDITION_PARAM_BUFF_SPELL, true)

local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0)
combat:addCondition(condition)

function onCastSpell(creature, var)
    if creature:getCondition(CONDITION_ATTRIBUTES, CONDITIONID_COMBAT, 5) then
        creature:removeCondition(CONDITION_ATTRIBUTES, CONDITIONID_COMBAT, 5)
    end
    return combat:execute(creature, var)
end

--- exori

Lua:
local function Formula(skill, level, attack)
local skillTotal = skill*attack
local levelTotal = level / 5
return {-(((skillTotal * 0.04) + 8) + (levelTotal)), -(((skillTotal * 0.09) + 13) + (levelTotal))}
end

local area = createCombatArea(AREA_SQUARE1X1)

function onCastSpell(creature, var)
  local weapon = creature:getSlotItem(CONST_SLOT_LEFT)
    local dmg = ItemType(weapon.itemid):getAttack()
    local edmg = elementalDamage(weapon.itemid)
    local skill = creature:getSkillFromId(weapon.itemid)
    local level = creature:getLevel()
    local result = Formula(skill, level, dmg + edmg)
    local position = creature:getPosition()
    if getConfigInfo("removeWeaponCharges") == true and weapon:hasAttribute("charges") then
    local charges = weapon:getAttribute("charges")
    if charges == 1 then
    weapon:remove(1)
    else
    weapon:setAttribute("charges", charges-1)
    end
    end

    if dmg > 0 then
    doAreaCombatHealth(creature, COMBAT_PHYSICALDAMAGE, position, area, math.min(0, result[1] * dmg / (edmg + dmg)), math.min(0, result[2] * dmg / (edmg+dmg)), CONST_ME_HITAREA)
    end
    if edmg > 0 then
    doAreaCombatHealth(creature, ItemType(weapon.itemid):getElementType(), position, area, math.min(0, result[1] * edmg / (edmg + dmg)), math.min(0, result[2] * edmg / (edmg+dmg)), CONST_ME_HITAREA)
    end
    return true
end
 
Top