I have some problems when the player is using imbu the damage that is reflected in the boss he is receiving the damage + the healing of the imbu
: attempt to index local 'attacker' (a nil value
and I'm getting this error in the log
edit
if the player is attacking the boss and uses exura vita for example the cure is sent to the boss
: attempt to index local 'attacker' (a nil value
and I'm getting this error in the log
edit
if the player is attacking the boss and uses exura vita for example the cure is sent to the boss
Lua:
local config = {
{
bossName = "The Pale Worm",
bossPosition = Position(33805, 31505, 14)
}
}
local function doCombat(creature, boss, combatType, damage)
doTargetCombatHealth(creature, boss, combatType, -damage, -damage, CONST_ME_NONE, ORIGIN_SPELL)
end
local ThePaleWormReceiveDmg1 = CreatureEvent("ThePaleWormReceiveDmg")
function ThePaleWormReceiveDmg1.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
for _, info in pairs(config) do
local foundBoss = Monster(info.foundBoss)
if foundBoss then
doCombat(attacker:getId(), foundBoss, primaryType, primaryDamage)
doCombat(attacker:getId(), foundBoss, secondaryType, secondaryDamage)
else
local spectators =
Game.getSpectators(info.bossPosition, false, false, 14, 14, 14, 14)
for __, spectator in pairs(spectators) do
if spectator ~= creature then
if spectator:getName() == info.bossName then
doCombat(attacker:getId(), spectator, primaryType, primaryDamage)
doCombat(attacker:getId(), spectator, secondaryType, secondaryDamage)
info.foundBoss = spectator:getId()
break
end
end
end
end
end
return primaryDamage, primaryType, secondaryDamage, secondaryType
end
ThePaleWormReceiveDmg1:register()
Last edited: