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

[Trigger] Dont want spell to target natural passive or invulnerable

Status
Not open for further replies.
Level 19
Joined
Feb 15, 2008
Messages
2,184
How i do this?

invulnerable and natural passive.

Under what condition?

  • Hook
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sumo Meat Hook 1 (TSM)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PH_Index[1] Equal to 0
        • Then - Actions
          • Trigger - Turn on Hook Loop <gen>
        • Else - Actions
      • Set PH_Index[1] = (PH_Index[1] + 1)
      • Set PH_Index[2] = (PH_Index[2] + 1)
      • Set PH_Counter[PH_Index[2]] = 0
      • Set PH_Cast_Point = (Position of (Triggering unit))
      • Set PH_Target_Point = (Target point of ability being cast)
      • Set PH_Caster[PH_Index[2]] = (Triggering unit)
      • Unit - Pause PH_Caster[PH_Index[2]]
      • Animation - Play PH_Caster[PH_Index[2]]'s attack animation
      • Set PH_Hook_Angle[PH_Index[2]] = (Angle from PH_Cast_Point to PH_Target_Point)
      • Set PH_Near_Point = (PH_Cast_Point offset by 100.00 towards PH_Hook_Angle[PH_Index[2]] degrees)
      • Unit - Create 1 Hook for (Owner of PH_Caster[PH_Index[2]]) at PH_Near_Point facing Default building facing degrees
      • Set PH_Dummy[PH_Index[2]] = (Last created unit)
      • Set PH_Hooked_Is[PH_Index[2]] = False
      • Set PH_Hooked_Unit[PH_Index[2]] = No unit
      • Custom script: call RemoveLocation(udg_PH_Near_Point)
      • Custom script: call RemoveLocation(udg_PH_Cast_Point)
      • Custom script: call RemoveLocation(udg_PH_Target_Point)
      • Set PH_Damage = (100 x (Level of (Ability being cast) for PH_Caster[PH_Index[2]]))
      • Set PH_Distance = (70 + (10 x (Level of (Ability being cast) for PH_Caster[PH_Index[2]])))
I tried all.

Hope some one helps.
 
Level 19
Joined
Feb 15, 2008
Messages
2,184
hmm ok hope it works because the spell is wierd. Doesent work. Sry.

The spell is a hook. And it should be able to target friends to. So that thing dont work either and dident work at all. I need to change in the trigger dont hook invularble or natural passive.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Add this
  • ((Picked unit) belongs to an enemy of (Owner of PH_Caster[PH_Index[3]])) Equal to True
In here
  • Unit Group - Pick every unit in (Units within 64.00 of PH_Hook_Point[PH_Index[3]] matching (((Matching unit) is alive) Equal to True)) 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 (Owner of PH_Caster[PH_Index[3]])) Equal to True
          • ((Picked unit) is Magic Immune) Equal to False
          • ((Picked unit) is A structure) Equal to False
          • PH_Hooked_Is[PH_Index[3]] Equal to False
That rules out neutral units.

Ruling out invulnerable units is more complicated, since there is no boolean to check that.

You could add units into a unit group when they gain invulnerability and remove them from the group when they lose it. In this spell you then check whether the unit is in the group or not.

Or you can create a dummy unit at the position of caster with some buff that affecs only invulnerable units. Then check whether the target has the buff or not.

Or serch for a IsUnitInvulnerable library.
 
Status
Not open for further replies.
Top