HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Detecing and Killing a Sentry Ward

12-17-2007, 02:29 AM#1
WNxCryptic
I have a trap ability which is based off a sentry ward, and when it deploys I need to destroy the ward, however GetSummonedUnit() doesn't reference the ward...any idea on a native function which would allow me to target that created ward?
12-17-2007, 02:38 AM#2
zen87
GetSummonedUnit() only works for event EVENT_UNIT_SUMMON, u cant use event EVENT_PLAYER_UNIT_SPELL_EFFECT on that.
12-17-2007, 04:41 AM#3
WNxCryptic
Would GetLastCreatedUnit() work for it?
12-17-2007, 05:02 AM#4
Ignitedstar
I think Last Created Unit only works for units created from triggers. You could try detecting the ward through unit grouping and getting rid of it that way. I'm assuming that you're using JASS, so this probably isn't of much help.
12-17-2007, 05:10 AM#5
Pyrogasm
Use something like this:
Trigger:
Collapse Events
Unit - A unit enters (Playable Map Area)
Collapse Conditions
(Unit-type of (Triggering Unit)) equal to Sentry Ward
Collapse Actions
----- Whatever -----
12-17-2007, 05:34 AM#6
Ammorth
Can you not specify a custom sentry unit to create?
12-17-2007, 01:39 PM#7
WNxCryptic
Ammorth, how do you mean?
12-17-2007, 01:52 PM#8
rain9441
If you say ward placing doesnt trigger summon events then an alternative would be to make a custom ability (channel) and trigger the creation of the ward at the point which the unit casted the spell (or random point around caster if its an immediate ward summon). Now you have a unit reference to apply timed life or do whatever it is you need to do.
12-17-2007, 03:18 PM#9
WNxCryptic
Whats the function to apply timed life to a unit?
12-18-2007, 03:38 PM#10
Troll-Brain
Simply native
Collapse JASS:
UnitApplyTimedLife           takes unit whichUnit, integer buffId, real duration returns nothing

Search before ask :p