• 🏆 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!

[Trigger] slashemall (angle problems...)

Status
Not open for further replies.
Level 1
Joined
Apr 25, 2008
Messages
2
Hello, this spell is supposed to damage enemies in front of the caster, like, only damage enemies if the caster is facing the enemies, now it works like this: it only damages enemies when the caster is at North, and the enemies are at East, even if the caster is not facing the enemies :cry:

btw. i am new, but +rep to the helpers : )))

thank you.

  • Slashemall
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Slash'em'all
    • Actions
      • Wait 0.01 seconds
      • Unit - Pause (Casting unit)
      • Animation - Play (Casting unit)'s Attack Slam - OgreLord Only animation
      • Wait 0.50 seconds
      • Unit - Unpause (Casting unit)
      • Set Slash_Pos = (Position of (Casting unit))
      • Set Slash_Facing = (Facing of (Casting unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Slash'em'all for (Casting unit)) Equal to 1
        • Then - Actions
          • Unit Group - Pick every unit in (Units within 325.00 of (Position of (Casting unit)) matching ((((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is alive) Equal to True)))) and do (Actions)
            • Loop - Actions
              • Set Slash_Enemy_Pos = (Position of (Picked unit))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Cos((Slash_Facing + 90.00))) - (Angle from Slash_Pos to Slash_Enemy_Pos)) Greater than (Cos(45.00))
                • Then - Actions
                  • Unit - Cause (Casting unit) to damage (Picked unit), dealing (25.00 + (1.00 x (Real((Strength of (Casting unit) (Include bonuses)))))) damage of attack type Normal and damage type Normal
                  • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
                  • Special Effect - Destroy (Last created special effect)
                • Else - Actions
              • Custom script: call RemoveLocation (udg_Slash_Enemy_Pos)
          • Custom script: call RemoveLocation (udg_Slash_Pos)
        • Else - Actions
 
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

Actually you can you something like that:

  • Test
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Thunder Clap
    • Actions
      • Set Loc1 = (Position of (Triggering unit))
      • Set Loc2 = (Loc1 offset by 200.00 towards (Facing of (Triggering unit)) degrees)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 400.00 of Loc2) and do (Actions)
        • Loop - Actions
          • Unit - Cause (Triggering unit) to damage (Picked unit), dealing 125.00 damage of attack type Spells and damage type Normal
      • Custom script: call RemoveLocation(udg_Loc1)
      • Custom script: call RemoveLocation(udg_Loc2)
Greetings
~ The Bomb King > Dr. Boom
 
Status
Not open for further replies.
Top