Spell problem :(

n1mr0d

Member
Reaction score
1
Ok i have an passive spell, his effect : whenever the owner of the spell cast a spell , he get an buff, and whenever this unit under the buff attacks , near the attacked unit , all enemys will be slowed, but when my hero/unit attacks(he is ranger btw) the effect starts before the missile touches the attacked unit, some help on fixing it :)?
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
this is a very complex problem because it is very difficult to detect physical damage/magic damage and your problem is that a unit is attacked event actually refers to when the missle launches not deals damage, there is no event that detects the actual collision of missle and target...
BUT

you can detect this a few different ways:

  • Trigger all cast damage, then when a unit deals damage from a cast, set a boolean variable to true, then false right after the damage is dealt, then when a unit takes damage if the damage source has that buff and the boolean variable is false, slow the units
  • This is more complex but works as well and is favorable in many situations... You give every unit an orb effect that applies a debuff that does nothing, then when a unit takes damage detect if it has that debuff and remove it if it does, then if it did it was an attack, if it didnt it was a cast... so if the unit has the debuff and the damage dealer has the buff you are talking about, do the slow...
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
sure... NOTE: you must trigger every spell damage in order for this way to work

heres a basic spell with the damage:
Trigger:
  • Spell
    • Events
      • A unit begins the effect of an ability
    • Conditions
      • Ability cast is equal to Spell
    • Actions
      • Set Bool = True (Boolean variable)
      • Unit - Cause (Triggering unit) to damage (Target unit of ability cast) for 150 damage of type magic
      • Set Bool = False (Boolean variable)


now the actual detecting of damage should be done via a damage detection system, ie: weeps (GUI friendly damage detection)

Trigger:
  • Detect Damage
    • Events
      • Game - GDD_Event becomes equal to 0.00
    • Conditions
      • Bool is equal to false (boolean variable from the first trigger)
      • (Triggering unit) has (Your buff) is equal to True
    • Actions
      • Do your slowing stuffs
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top