I made these scripts, but they cause a lot of lag. Thanks in advance<3
Lua:
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
if attacker and attacker:isPlayer() then
if attacker:getStorageValue(Storage.dromePotions.fireAmplification) > os.time() then
if primaryType == COMBAT_FIREDAMAGE then
primaryDamage = primaryDamage * 1.08
end
if secondaryType == COMBAT_FIREDAMAGE then
secondaryDamage = secondaryDamage * 1.08
end
end
if attacker:getStorageValue(Storage.dromePotions.iceAmplification) > os.time() then
if primaryType == COMBAT_ICEDAMAGE then
primaryDamage = primaryDamage * 1.08
end
if secondaryType == COMBAT_ICEDAMAGE then
secondaryDamage = secondaryDamage * 1.08
end
end
if attacker:getStorageValue(Storage.dromePotions.earthAmplification) > os.time() then
if primaryType == COMBAT_EARTHDAMAGE then
primaryDamage = primaryDamage * 1.08
end
if secondaryType == COMBAT_EARTHDAMAGE then
secondaryDamage = secondaryDamage * 1.08
end
end
if attacker:getStorageValue(Storage.dromePotions.energyAmplification) > os.time() then
if primaryType == COMBAT_ENERGYDAMAGE then
primaryDamage = primaryDamage * 1.08
end
if secondaryType == COMBAT_ENERGYDAMAGE then
secondaryDamage = secondaryDamage * 1.08
end
end
if attacker:getStorageValue(Storage.dromePotions.holyAmplification) > os.time() then
if primaryType == COMBAT_HOLYDAMAGE then
primaryDamage = primaryDamage * 1.08
end
if secondaryType == COMBAT_HOLYDAMAGE then
secondaryDamage = secondaryDamage * 1.08
end
end
if attacker:getStorageValue(Storage.dromePotions.deathAmplification) > os.time() then
if primaryType == COMBAT_DEATHDAMAGE then
primaryDamage = primaryDamage * 1.08
end
if secondaryType == COMBAT_DEATHDAMAGE then
secondaryDamage = secondaryDamage * 1.08
end
end
if attacker:getStorageValue(Storage.dromePotions.physicalAmplification) > os.time() then
if primaryType == COMBAT_PHYSICALDAMAGE then
primaryDamage = primaryDamage * 1.08
end
if secondaryType == COMBAT_PHYSICALDAMAGE then
secondaryDamage = secondaryDamage * 1.08
end
end
end
return primaryDamage, primaryType, secondaryDamage, secondaryType
end
Lua:
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
if creature and creature:isPlayer() then
if creature:getStorageValue(Storage.dromePotions.fireResilience) > os.time() then
if primaryType == COMBAT_FIREDAMAGE then
primaryDamage = primaryDamage * 0.92
end
if secondaryType == COMBAT_FIREDAMAGE then
secondaryDamage = secondaryDamage * 0.92
end
end
if creature:getStorageValue(Storage.dromePotions.iceResilience) > os.time() then
if primaryType == COMBAT_ICEDAMAGE then
primaryDamage = primaryDamage * 0.92
end
if secondaryType == COMBAT_ICEDAMAGE then
secondaryDamage = secondaryDamage * 0.92
end
end
if creature:getStorageValue(Storage.dromePotions.earthResilience) > os.time() then
if primaryType == COMBAT_EARTHDAMAGE then
primaryDamage = primaryDamage * 0.92
end
if secondaryType == COMBAT_EARTHDAMAGE then
secondaryDamage = secondaryDamage * 0.92
end
end
if creature:getStorageValue(Storage.dromePotions.energyResilience) > os.time() then
if primaryType == COMBAT_ENERGYDAMAGE then
primaryDamage = primaryDamage * 0.92
end
if secondaryType == COMBAT_ENERGYDAMAGE then
secondaryDamage = secondaryDamage * 0.92
end
end
if creature:getStorageValue(Storage.dromePotions.holyResilience) > os.time() then
if primaryType == COMBAT_HOLYDAMAGE then
primaryDamage = primaryDamage * 0.92
end
if secondaryType == COMBAT_HOLYDAMAGE then
secondaryDamage = secondaryDamage * 0.92
end
end
if creature:getStorageValue(Storage.dromePotions.deathResilience) > os.time() then
if primaryType == COMBAT_DEATHDAMAGE then
primaryDamage = primaryDamage * 0.92
end
if secondaryType == COMBAT_DEATHDAMAGE then
secondaryDamage = secondaryDamage * 0.92
end
end
if creature:getStorageValue(Storage.dromePotions.physicalResilience) > os.time() then
if primaryType == COMBAT_PHYSICALDAMAGE then
primaryDamage = primaryDamage * 0.92
end
if secondaryType == COMBAT_PHYSICALDAMAGE then
secondaryDamage = secondaryDamage * 0.92
end
end
end
return primaryDamage, primaryType, secondaryDamage, secondaryType
end
function onManaChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
if creature and creature:isPlayer() then
if creature:getStorageValue(Storage.dromePotions.fireResilience) > os.time() then
if primaryType == COMBAT_FIREDAMAGE then
primaryDamage = primaryDamage * 0.92
end
if secondaryType == COMBAT_FIREDAMAGE then
secondaryDamage = secondaryDamage * 0.92
end
end
if creature:getStorageValue(Storage.dromePotions.iceResilience) > os.time() then
if primaryType == COMBAT_ICEDAMAGE then
primaryDamage = primaryDamage * 0.92
end
if secondaryType == COMBAT_ICEDAMAGE then
secondaryDamage = secondaryDamage * 0.92
end
end
if creature:getStorageValue(Storage.dromePotions.earthResilience) > os.time() then
if primaryType == COMBAT_EARTHDAMAGE then
primaryDamage = primaryDamage * 0.92
end
if secondaryType == COMBAT_EARTHDAMAGE then
secondaryDamage = secondaryDamage * 0.92
end
end
if creature:getStorageValue(Storage.dromePotions.energyResilience) > os.time() then
if primaryType == COMBAT_ENERGYDAMAGE then
primaryDamage = primaryDamage * 0.92
end
if secondaryType == COMBAT_ENERGYDAMAGE then
secondaryDamage = secondaryDamage * 0.92
end
end
if creature:getStorageValue(Storage.dromePotions.holyResilience) > os.time() then
if primaryType == COMBAT_HOLYDAMAGE then
primaryDamage = primaryDamage * 0.92
end
if secondaryType == COMBAT_HOLYDAMAGE then
secondaryDamage = secondaryDamage * 0.92
end
end
if creature:getStorageValue(Storage.dromePotions.deathResilience) > os.time() then
if primaryType == COMBAT_DEATHDAMAGE then
primaryDamage = primaryDamage * 0.92
end
if secondaryType == COMBAT_DEATHDAMAGE then
secondaryDamage = secondaryDamage * 0.92
end
end
if creature:getStorageValue(Storage.dromePotions.physicalResilience) > os.time() then
if primaryType == COMBAT_PHYSICALDAMAGE then
primaryDamage = primaryDamage * 0.92
end
if secondaryType == COMBAT_PHYSICALDAMAGE then
secondaryDamage = secondaryDamage * 0.92
end
end
end
return primaryDamage, primaryType, secondaryDamage, secondaryType
end