• 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!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

TFS 1.X+ onhealth bonus

ZeroSkyer

Member
Joined
May 17, 2019
Messages
59
Reaction score
9
Location
EEUU
Hello, I've been like 3 hours and I can't do that works. I also want to know if it is safe to register the event in OnSpawn? Same as self:registerEvent('amplificationPotions')

What does not work is the attacker:getStorageValue(Storage.dromePotions.iceAmplification), the rest works fine

Lua:
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
    if attacker:getStorageValue(Storage.dromePotions.iceAmplification) == 1 then
        if primaryType == COMBAT_FIREDAMAGE then
            print("Primary damage type is FIRE.. amplyfing damage")
            print("Initial damage value: " .. primaryDamage)
            primaryDamage = primaryDamage / 0.92
            print("Modified damage value: " .. primaryDamage)
        end
        if secondaryType == COMBAT_FIREDAMAGE then
            print("Primary damage type is FIRE.. amplyfing damage")
            print("Initial damage value: " .. primaryDamage)
            secondaryDamage = secondaryDamage / 0.92
            print("Modified damage value: " .. primaryDamage)
        end
    end
    return primaryDamage, primaryType, secondaryDamage, secondaryType
end
 
Solution
register it for players with onLogin
register it for monsters with onSpawn

Before you check for a storage value, check if attacker is a player.

Should be good to go. And safe.

Xikini

I whore myself out for likes
Senator
Joined
Nov 17, 2010
Messages
6,245
Solutions
545
Reaction score
4,489
register it for players with onLogin
register it for monsters with onSpawn

Before you check for a storage value, check if attacker is a player.

Should be good to go. And safe.
 
Solution
Top