• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Spell] can someone tell where is problem in trigger

Status
Not open for further replies.
Level 6
Joined
Aug 27, 2013
Messages
103
Spell is based on thunder clap, and i want it to damage only enemy units but i can't see why it is not working, armor part is working

  • deep freeze
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Deep Freeze
    • Actions
      • Set unitgroup = (Units within 400.00 of deeppoint)
      • Set deeppoint = (Position of (Casting unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Deep Freeze for (Casting unit)) Equal to 1
        • Then - Actions
          • Unit Group - Pick every unit in unitgroup and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (((Picked unit) belongs to an ally of (Owner of (Casting unit))) Equal to False) and (((Picked unit) is alive) Equal to True)
                • Then - Actions
                  • Unit - Cause (Casting unit) to damage (Picked unit), dealing (0.10 x (Max life of (Casting unit))) damage of attack type Spells and damage type Normal
                • Else - Actions
          • Unit - Create 1 dummy for Player 1 (Red) at (Position of (Casting unit)) facing Default building facing degrees
          • Unit - Add Frost Armor1 (dummy) to (Last created unit)
          • Unit - Order (Last created unit) to Undead Lich - Frost Armor (Casting unit)
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Custom script: call DestroyGroup(udg_unitgroup)
          • Custom script: call RemoveLocation(udg_deeppoint)
        • Else - Actions
 
Level 13
Joined
Jul 15, 2007
Messages
763
OK two tips:
  • unitgroup uses deeppoint BUT you set deeppoint after it is set so chances are the spell is firing off somewhere at the center of the playable map area because it has no point to use
  • NEVER use Casting unit - it sucks arse, use Triggering unit instead
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
This should work:
  • DF Example
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Deep Freeze
    • Actions
      • Set VariableSet deeppoint = (Position of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of (Ability being cast) for (Triggering unit)) Equal to 1
        • Then - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within 400.00 of deeppoint.) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) belongs to an enemy of (Triggering player).) Equal to True
                • Then - Actions
                  • Unit - Cause (Triggering unit) to damage (Picked unit), dealing ((Max life of (Triggering unit)) x 0.10) damage of attack type Spells and damage type Normal
                • Else - Actions
        • Else - Actions
      • -------- Do Frost Armor stuff (you said this works so I left it out) --------
      • Custom script: call RemoveLocation (udg_deeppoint)
Also, some problems with your Dummy:
-Create the dummy at deeppoint instead of Position of Casting Unit (Leaks a Point)
-Create the dummy for Triggering Player instead of Player 1

Also, I assume you intended to do this but you're only dealing damage if Deep Freeze is level 1.
 
Last edited:
Level 6
Joined
Aug 27, 2013
Messages
103
This should work:
  • DF Example
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Deep Freeze
    • Actions
      • Set VariableSet deeppoint = (Position of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of (Ability being cast) for (Triggering unit)) Equal to 1
        • Then - Actions
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within 400.00 of deeppoint.) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) belongs to an enemy of (Triggering player).) Equal to True
                • Then - Actions
                  • Unit - Cause (Triggering unit) to damage (Picked unit), dealing ((Max life of (Triggering unit)) x 0.10) damage of attack type Spells and damage type Normal
                • Else - Actions
        • Else - Actions
      • -------- Do Frost Armor stuff (you said this works so I left it out) --------
      • Custom script: call RemoveLocation (udg_deeppoint)
Also, some problems with your Dummy:
-Create the dummy at deeppoint instead of Position of Casting Unit (Leaks a Point)
-Create the dummy for Triggering Player instead of Player 1

Also, I assume you intended to do this but you're only dealing damage if Deep Freeze is level 1.

i fixed it already, just like you posted, works fine now
 
Status
Not open for further replies.
Top