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

Get Illusion

Status
Not open for further replies.
Level 11
Joined
Aug 1, 2009
Messages
714
Here's the trigger code
  • Illusion
    • Events
    • Conditions
    • Actions
      • Set Illusion_Point = (Position of (Triggering unit))
      • Unit - Create 1 Dummy Unit - Skill for (Owner of (Triggering unit)) at Illusion_Point facing Default building facing degrees
      • Hero - Create Wand of Illusion and give it to (Last created unit)
      • Hero - Order (Last created unit) to use (Last created item) on (Triggering unit)
      • Unit - Add a 1.53 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation (udg_Illusion_Point)
 
Level 10
Joined
Jun 1, 2008
Messages
485
how about use some indexing?

First, use dummy unit to 'summon' the Illusion. Then, when dummy use the spell, save the target unit by indexing or another way to the dummy unit. Then you can refer back to that data using the dummy unit who summon the illusion when you use Unit - A unit Spawns a summoned unit event

well, I hope I can post the trigger, but I think you get the point.
 
Level 17
Joined
Jun 28, 2008
Messages
776
I think the indexing would be my best bet. Mage Goo, I can't rep you now, just reped you for helping with the Disable Attack ability. Will rep for the help asap.

@ cboy123, that only creates the illusion, I want to set the illusion to a variable so that I can use the illusion with the unit that was illusiofied, but thanks for trying.
 
  • Trigger
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Hashtable - Create a hashtable
    • Set Hashtable = (Last created hashtable)
  • Spell
  • Events
    • Unit - A unit spawns a summoned unit
  • Conditions
    • (Unit-type of (Summoned unit)) Equal to (Unit-type of (Triggering unit))
    • ((Summoned unit) is an Illusion) Equal to True
  • Actions
    • Hashtable - Save (Summoned unit) as (Key(summon)) of (Key(Triggering unit)) in Hashtable
  • trigger2
  • Events
    • Unit - A unit is issued an order with no target
  • Conditions
    • (Issued order) Equal to (order(stop))
    • ((Key(summon)) is stored as a Handle of (Key(Triggering unit)) in Hashtable) Equal to True
  • Actions
    • Unit - Order (Load (Key(summon)) of (Key(Triggering unit) from Hashtable) to Stop
 
Status
Not open for further replies.
Top