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

Basic Fear spell having trouble returning to previous owner

Status
Not open for further replies.
For whatever reason returning the unit to previous owner does not work. See if you can check out the problem. I think the problem is that I have the same variable for every spell but I'm not entirely sure. This is the spell.

  • Eternal Fear level 1
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Eternal Fear
      • (Level of (Ability being cast) for (Triggering unit)) Equal to 1
    • Actions
      • Set Target_Unit = (Target unit of ability being cast)
      • Unit - Change ownership of Target_Unit to Neutral Passive and Retain color
      • Unit - Order Target_Unit to Move To (Random point in (Region centered at (Position of (Target unit of ability being cast)) with size (2400.00, 2400.00)))
      • Wait 8.00 seconds
      • Unit - Order Target_Unit to Attack (Triggering unit)
      • Unit - Change ownership of Target_Unit to (Previous owner) and Retain color
Please help in any way you can. I wish to find the answer to this intriguing problem.
 
  • Trigger0
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Hashtable - Create a Hashtable
    • Set EternalFearHash = (Lat created Hashtable)
  • Trigger1
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Eternal Fear
  • Actions
    • Hashtable - Save EternalTimer as (Key(timer)) of (Key(Target unit of ability being cast)) in EternalFearHash
    • Countdown Timer - Start (Load (Key(timer)) of (Key(Target unit of ability being cast)) in EternalTimer) as a one-shot timer that will expire in 8.00 seconds
    • Hashtable - Save (Target unit of ability being cast) as ((Key(target) of (Key(Last Started Timer)) in EternalFearHash)
    • Hashtable - Save (Owner of (Target unit of ability being cast)) as (Key(owner)) of (Key(Target unit of ability being cast)) in EternalFearHash
    • Set Temp_P[1] = (Position of (Target unit of ability being cast))
    • Set Temp_R = (Region centered at (Temp_P[1]) with size (2400.00, 2400.00))
    • Set Temp_P[2] = (Random Point in (Temp_R))
    • Unit - Order (Target unit of ability being cast) to Move to (Temp_P[2])
    • Unit - Change ownership of (Target unit of ability being cast) to Neutral Passive and Retain Color
    • Custom script: call RemoveLocation (udg_Temp_P[1])
    • Custom script: call RemoveRect (udg_Temp_R)
    • Custom script: call RemoveLocation (udg_Temp_P[2])
  • Trigger2
  • Events
    • Time - EternalTimer expires
  • Conditions
    • ((Load (Key(target)) of (Key(Expiring Timer)) is alive) Equal to True
  • Actions
    • Unit - Change ownership of ((Load (Key(target)) of (Key(Expiring Timer)) to (Load (Key(owner)) of Key(((Load (Key(target)) of (Key(Expiring Timer))) and Retain color
    • Hashtable - Clear all child hashtables of (Key(Expiring Timer))
 
I know this is a stupid question but I can't find just plain timer on the handle ID option anyone know where it is?
While you're at it I'm still learning hashes(this is the first time I've used one :}) help me figure out this one.

  • PsychoBolt level 1
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Psycho-bolt
      • (Level of (Ability being cast) for (Triggering unit)) Equal to 1
    • Actions
      • Set Target_Unit = (Target unit of ability being cast)
      • Special Effect - Create a special effect at (Position of (Target unit of ability being cast)) using Abilities\Spells\NightElf\Barkskin\BarkSkinTarget.mdl
      • Set SFX_1 = (Last created special effect)
      • Unit - Change ownership of Target_Unit to Neutral Hostile and Retain color
      • Wait 3.00 seconds
      • Unit - Change ownership of Target_Unit to (Previous owner) and Retain color
      • Special Effect - Destroy SFX_1
These are the triggers they failed to work maybe because I didn't execute them properly

  • Eternal Fear level 1
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Eternal Fear
      • (Level of (Ability being cast) for (Triggering unit)) Equal to 1
    • Actions
      • Hashtable - Save Handle OfEF_Timer as (Key (Last started timer)) of (Key (Target unit of ability being cast)) in EF_Hash
      • Countdown Timer - Start (Load (Key (Last started timer)) of (Key (Target unit of ability being cast)) in EF_Hash) as a One-shot timer that will expire in 8.00 seconds
      • Hashtable - Save Handle Of(Target unit of ability being cast) as (Key (Target unit of ability being cast)) of (Key (Last started timer)) in EF_Hash
      • Hashtable - Save Handle Of(Owner of (Target unit of ability being cast)) as (Key (Owner of (Target unit of ability being cast))) of (Key (Target unit of ability being cast)) in EF_Hash
      • Set Temp_P[1] = (Position of (Target unit of ability being cast))
      • Set Temp_R = (Region centered at Temp_P[1] with size (2400.00, 2400.00))
      • Set Temp_P[2] = (Random point in Temp_R)
      • Unit - Order (Target unit of ability being cast) to Move To Temp_P[1]
      • Unit - Change ownership of (Target unit of ability being cast) to Neutral Passive and Retain color
      • Custom script: call RemoveLocation (udg_Temp_P[1])
      • Custom script: call RemoveRect (udg_Temp_R)
      • Custom script: call RemoveLocation (udg_Temp_P[2])
  • ------------------------------------------------------------------------------------------------
  • EternalFear expiration
    • Events
      • Time - EF_Timer expires
    • Conditions
      • ((Load (Key (Target unit of ability being cast)) of (Key (Expiring timer)) in EF_Hash) is alive) Equal to True
    • Actions
      • Unit - Change ownership of (Load (Key (Target unit of ability being cast)) of (Key (Expiring timer)) in EF_Hash) to (Load (Key (Owner of (Target unit of ability being cast))) of (Key (Expiring timer)) in EF_Hash) and Change color
      • Hashtable - Clear all child hashtables of child (Key (Expiring timer)) in EF_Hash
Please explain why they probably didn't work
 
Last edited:
Status
Not open for further replies.
Top