• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Damage Detection fires multiple times on single cast

Status
Not open for further replies.
Level 2
Joined
Dec 16, 2011
Messages
12
Casting a very basic Firebolt ability.
Damage detection seems to go off...
1. On application of stun
2. On damage
3. On removal of stun

Am I using the system correctly?

Code:
package Fireball

import AbilityObjEditing
import ObjectIdGenerator
import Icons
import DamageDetection

public constant int FIREBALL_ID = compiletime(ABIL_ID_GEN.next())

public constant string SPELL_NAME = "Fireball"

@compiletime
function genSpell()
    new AbilityDefinitionFireBolt(FIREBALL_ID)
    ..presetTooltipLearn(lvl -> "Learn " + SPELL_NAME + " - Level " + lvl.toString())
    ..presetTooltipNormal(lvl -> SPELL_NAME + " - Level " + lvl.toString())
    ..presetTooltipNormalExtended(lvl -> "Cast a burning ball of fire at target enemy.")
    ..presetCooldown(lvl -> 1.)
    ..presetManaCost(lvl -> 0)
    ..presetCastRange(lvl -> 700.)
    ..presetHotkey("Q")
    ..presetButtonPosResearch(0, 0)
    ..presetButtonPosNormal(0, 2)
    ..presetIcon(Icons.bTNFireBolt)


init
    addOnDamageFunc() ->
        unit damager = GetEventDamageSource()
        unit target = GetTriggerUnit()
        real damageAmount = GetEventDamage()

        print(damager.getName() + " damaged " + target.getName() + " for " + damageAmount.toString())

Code:
Blood Mage damaged Murloc Huntsman for 0.000
Blood Mage damaged Murloc Huntsman for 100.000
Blood Mage damaged Murloc Huntsman for 0.000

WC3ScrnShot_020419_205252_01.png
WC3ScrnShot_020419_205254_02.png
 
Status
Not open for further replies.
Top