WolfieeifloW
WEHZ Helper
- Reaction score
- 372
Hey there.
I've just 'installed' Damage, and am trying to convert all my spells over and I've already ran into problems ().
I've created a 'DamageText' system to pair up with the Damage system.
It's here:
Now, I'm trying to convert my Death Coil spell over, so I set the damage in the Object Editor to 0.
I then created this code:
No floating text is created, and the BJ's show this:
Note the change to the Damage function.
It now shows floating text that says '0', but the BJ's display the same thing.
What am I doing wrong?
I've just 'installed' Damage, and am trying to convert all my spells over and I've already ran into problems ().
I've created a 'DamageText' system to pair up with the Damage system.
It's here:
JASS:
scope DamageText initializer init
private function Conditions takes nothing returns boolean
local texttag tt
set tt = CreateTextTag()
call SetTextTagText(tt, I2S(R2I(GetEventDamage())), 8 * 0.023 / 10)
call SetTextTagPosUnit(tt, GetTriggerUnit(), 0.)
if (Damage_IsAttack()) then
call SetTextTagColor(tt, 255, 255, 255, 255)
elseif (Damage_IsSpell()) then
call SetTextTagColor(tt, 255, 255, 0, 255)
endif
call SetTextTagPermanent(tt, false)
call SetTextTagLifespan(tt, 2)
call SetTextTagFadepoint(tt, 1)
call SetTextTagVelocity(tt, 0, 0.05)
set tt = null
return false
endfunction
private function init takes nothing returns nothing
local trigger t = CreateTrigger()
call Damage_RegisterEvent(t)
call TriggerAddCondition(t, Condition(function Conditions))
set t = null
endfunction
endscope
Now, I'm trying to convert my Death Coil spell over, so I set the damage in the Object Editor to 0.
I then created this code:
JASS:
scope DeathCoilDK initializer init
private function Damage takes integer level returns real
return level * 10.
endfunction
private function Conditions takes nothing returns boolean
call BJDebugMsg("Att: " + GetUnitName(GetAttacker()))
call BJDebugMsg("EDS: " + GetUnitName(GetEventDamageSource()))
call BJDebugMsg("Def: " + GetUnitName(GetTriggerUnit()))
if (GetSpellAbilityId() == deathCoilDK) then
call Damage_Spell(GetEventDamageSource(), GetTriggerUnit(), Damage(GetUnitAbilityLevel(GetEventDamageSource(), deathCoilDK)))
endif
return false
endfunction
private function init takes nothing returns nothing
local trigger t = CreateTrigger()
call Damage_RegisterZeroEvent(t)
call TriggerAddCondition(t, Condition(function Conditions))
set t = null
endfunction
endscope
No floating text is created, and the BJ's show this:
So, I went ahead and set the damage of the Death Coil in the OE to 1, and tried the 'normal' event:Att:
EDS:
Def: TargetUnit
JASS:
scope DeathCoilDK initializer init
private function Damage takes integer level returns real
return (level * 10.) - 1
endfunction
private function Conditions takes nothing returns boolean
call BJDebugMsg("Att: " + GetUnitName(GetAttacker()))
call BJDebugMsg("EDS: " + GetUnitName(GetEventDamageSource()))
call BJDebugMsg("Def: " + GetUnitName(GetTriggerUnit()))
if (GetSpellAbilityId() == deathCoilDK) then
call Damage_Spell(GetEventDamageSource(), GetTriggerUnit(), Damage(GetUnitAbilityLevel(GetEventDamageSource(), deathCoilDK)))
endif
return false
endfunction
private function init takes nothing returns nothing
local trigger t = CreateTrigger()
call Damage_RegisterEvent(t)
call TriggerAddCondition(t, Condition(function Conditions))
set t = null
endfunction
endscope
Note the change to the Damage function.
It now shows floating text that says '0', but the BJ's display the same thing.
What am I doing wrong?