• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Soul Trap

Status
Not open for further replies.
Level 9
Joined
Apr 4, 2004
Messages
519
Okay, I'm having a small problem with my Soul Trap ability. The point of it is, that when a hero uses Soul Trap, it creates 4 Soul Wards around the targeted enemy unit, and then the Soul Wards drains the units health over time. This is my current triggers.

  • Events
    • Unit - A units Begins casting an ability
  • Conditions
    • (Ability being cast) Equal to Soul Trap
  • Actions
    • Unit - Move Soul Ward 0004 <gen> instantly to ((Target point of ability being cast) offset by 256.00 towards 0.00 degrees), facing (Target point of ability being cast)
    • Unit - Change ownership of Soul Ward 0004 <gen> to (Owner of (Triggering unit)) and Change color
    • Hero - Order Soul Ward 0004 <gen> to use (Item carried by Soul Ward 0004 <gen> of type Soul Drain)
This is how it goes for all four of the wards. The problem is, that I can't seem to order the Soul Wards to use the item they have on a specific unit. How do I fix this? And yes, obviously the units have a Hero Inventory and the item already on them. Thanks in advance.

~Darkey
 
Level 9
Joined
Apr 4, 2004
Messages
519
Yeah, that was the problem I pointed out. But by making it a direct spell instead, how do I make them use it? I noticed you can't make them use custom spells.
 
Level 3
Joined
May 12, 2006
Messages
31
Whats the exact problem? The wards won't start their spell?
"
Hero - Order Soul Ward 0004 <gen> to use (Item carried by Soul Ward 0004 <gen> of type Soul Drain)"
To tell truth, i don't get what do you want to do with this?
I can't remember what does this trigger do, but i think:
a)This uses an item with no target.
b)Or this is spell, then ->
I think you have to use it's order ID. you can check it in the object editor. Use/turn on.. or something like this.
If it's in item, i think you have to use it like "order a unit with an object target". (don't know the exact name again...)
You might use "event response - spell target" (or smg like this).
I hope I could help you a little.
 
Level 9
Joined
Apr 4, 2004
Messages
519
Whats the exact problem? The wards won't start their spell?

Darkey said:
The problem is, that I can't seem to order the Soul Wards to use the item they have on a specific unit.

That was the exact problem. And Life Drain requires to target a unit to be able to being cast. Unfortunately I don't seem to be able to do that with an item.
 
Level 9
Joined
Apr 4, 2004
Messages
519
Yeah, that was what I did, but it still won't work. I based it on Life Drain, I only changed the mana cost, set it to a creep ability, the duration to 5 seconds and the damage to 18.75 dmg/s. Yet it won't work. And it looks like this.

  • Actions
    • Unit - Order Soul Ward 0004 <gen> to Neutral Dark Ranger - Life Drain (Target unit of ability being cast)
 
Level 24
Joined
May 9, 2007
Messages
3,563
Meh, I dunno. One sec while I try it. Will post triggers.


Here we are.

It works for me.

  • Life Drain
    • Events
      • Player - Player 1 (Red) types a chat message containing -life as An exact match
    • Conditions
    • Actions
      • Unit - Create 1 Priest for Player 2 (Blue) at (Position of hawk900 0000 <gen>) facing Default building facing degrees
      • Unit - Add Life Drain to (Last created unit)
      • Unit - Order (Last created unit) to Neutral Dark Ranger - Life Drain hawk900 0000 <gen>
This leaks but that is easy to fix.
 
Level 9
Joined
Apr 4, 2004
Messages
519
Well, it seems to be partly working now. But the spell only spawns one ward that life drains even though I got it triggered to spawn 4 of them around the unit. This is how the trigger looks like at the moment.

  • Soul Trap
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Soul Trap
    • Actions
      • Unit - Create 1 Soul Ward for (Owner of (Triggering unit)) at ((Position of (Target unit of ability being cast)) offset by 256.00 towards 45.00 degrees) facing 315.00 degrees
      • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Life Drain (Neutral Hostile) to (Last created unit)
      • Unit - Order (Last created unit) to Neutral Dark Ranger - Life Drain (Target unit of ability being cast)
And the problem is not that they all clash into each other, they all got different degrees in their spawning trigger. I tried adding an unwanted Wait 0.10 seconds trigger between each spawn & order unit but that didn't help.
 
Level 9
Joined
Apr 4, 2004
Messages
519
copy that trigger 4 times with wanted angles

Yeah, I got those trigger for all wards, I just didn't bother to write them over and over. :p

Squiggy: I partly understood those triggers but I'm a little confused with the variables. But I'll give it a try and let you know how it went.
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
Here's the fixed one:
  • For each Integer A from 1 to 4 do:
    • Set var = var + 90
    • Set temppoint = Position of (target unit of ability being cast)
    • Set temppoint2 = temppoint with offset 256.00 towards var degrees
    • Unit - Create 1 Soul Ward for (Owner of (Triggering unit)) at temppoint2 facing (target unit of ability being cast) degrees
    • Custom script: call RemoveLocation(udg_temppoint2)
    • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
    • Unit - Add Life Drain (Neutral Hostile) to (Last created unit)
    • Unit - Order (Last created unit) to Neutral Dark Ranger - Life Drain (Target unit of ability being cast)
  • Custom script: call RemoveLocation(udg_temppoint)
  • Set var = 0
Let me explain a bit:
The variable var defines an integer which shall be increased by 90 everytime the loop runs (so, 4*90 = 360) and, of course as you set var for the degrees, it also defines the angle.
The variables temppoint and temppoint2 shall be self-explaining and in the end, the value of var is set back to zero ;)
 
Level 10
Joined
Apr 13, 2005
Messages
630
Sry it took me so long but i was afk. Why dont you just use varibles. They store information and everything. One thing is Last created Unit will only be for the last one created. Set a varible under "Unit - Create 1 blah blah" and set it to last created unit.

Next have a unit alreadyhave the spell so they dont have to get it quick and cast. besides that everything should work. Thanks for rep before
 
Status
Not open for further replies.
Top