Michcol94
Member
- Joined
- Sep 2, 2021
- Messages
- 105
- Reaction score
- 18
The magic effect when using a spell on the target position is probably some hit effect or I don't know it appears from time to time, it is not displayed every time you use a spell, sometimes it changes to another effect, how to turn it off? Please help, I'll add the lua spell code, but the problem is definitely in the sources, I think.
Use TFS 1.5 DOWNGRADE 8.6 by NEKIRO
I found a solution, I once removed the lines effect = (effect) in the game file.cpp and this probably caused random effects with intervals. And here is my solution:
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_DROWNDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_NONE)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, 50)
function calculateSpellDamage(player)
local level = player:getLevel()
local magicLevel = player:getMagicLevel()
local A = 1.2
local B = 1.5
local C = 10
local damage = A * level + B * magicLevel + C
return math.floor(damage)
end
function onGetFormulaValues(player, level, magicLevel)
local damage = calculateSpellDamage(player)
if player:getStorageValue(500) == 1 then
return -damage * 1.2, -damage * 1.2
else
return -damage, -damage
end
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(creature, variant)
return combat:execute(creature, variant)
end
Post automatically merged:
C++:
case COMBAT_DROWNDAMAGE: {
color = TEXTCOLOR_TEAL;
effect = CONST_ME_NONE;
break;
}
Last edited: