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

[Spell] Detecting a specific spell

Status
Not open for further replies.
Level 7
Joined
Aug 11, 2010
Messages
269
It's been a while since I've posted here, although -- I've once again became stumped whilst working on my map.

My question is this: How do I detect a SPECIFIC spell when using this system?

If it'd help clarify a little bit; here's a description of the spell I'm wanting to create:
'- (W) Storm Hammer: Thorik tosses a stormforged hammer towards the targeted enemy unit that immediately deals 60/120/180/240/300 spell damage and stuns the primary target upon contact. Additionally, the bolt unleashes a powerful torrent of electricty dealing 15/25/35/45/55 spell damage to enemy units in a short cone behind the primary target.
(125/135/145/155/165 mana cost, 9 second cooldown)'

It's quoted from my hero concepts text file so please pardon the formatting.

Essentially; how do I use this system to detect when Storm Bolt damages the target so that I can then spawn a dummy to cast a modified version of Forked Lightning?
 
Level 23
Joined
Oct 20, 2012
Messages
3,075
I don't think you can't do that with that system (and AFAIK, you can't detect what spell the damage is from even if you use another DDS). Although you can use a triggered version of your spell. You can use a dummy unit as your spell projectile and once the distance between the target and the dummy becomes o or whatever, you can deal the damage, stun and whatever other things need to be done upon impact.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
I don't use that system so I cannot test anything before I post. (too lazy to download)

But I think you can just ask wether the attacked unit has the buff that is caused by the spell.
If your ability doesnt apply a buff, then base if off from another one that does.
 
Level 6
Joined
Nov 24, 2012
Messages
218
Two ways that I can think of:
1) Buff checking
2) Dummy unit casting

1) Already mentioned by others. Not sure about this DDS but I believe you will have to run a 0 second timer then check the buff because the system is most likely going to detect before the buff is placed. Sorry I can't think of any single target stun spell that applies its own debuff right now.

2) The way I've always been using, which may not be the simplest, but works for me.
Have a dummy unit cast the actual storm hammer spell.
The spell on your hero should do essentially nothing (except show tooltip, have cast range, show mana cost, etc).
If you can't make Stormbolt do nothing then have your hero's ability based off Channel -->http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=14972 .
Now you can detect with this trigger (so sorry it's in text I haven't touched wc3 in ages):

Event: PDD_damageEventTrigger becomes Equal to 1.00 (This equates to "something took damage in the game")
Condition: Unit Type of PDD_source is DummyUnit (if using 1 Universal dummy unit type then add condition that it must have the ability StormBolt)
Action: And now you create another dummy at location of PDD_target and have it cast that cone thing.

Note: if this ends up working, but the Action fires just as the dummy begins casting, then that means it detected the casting of the spell as 0 damage (some DDS do this, not sure about the one ur using) - so to workaround I'll leave that up to you but the way I'm thinking of is have another condition that the damage is not 0, certainly more ways to go about this.

So all in all, you have 2 triggers.
Trigger 1)
Detects hero casting fake storm hammer (all it has is icon/tooltip/cast range/mana cost).
Creates dummy, give it expiration time, gives it storm hammer (real) ability, make it cast on target.
Trigger 2)
What I showed above, detect incoming damage, condition that it is this dummy unit-type if you created a specific dummy for this spell, or if it's universal dummy and u added storm hammer to it by trigger then have condition that the damage source has storm hammer ability(real)) So now this event and condition will only fire when there is a unit that casted real storm hammer and it has reached the target. Now for actions, do what you gotta do.
 
1) Already mentioned by others. Not sure about this DDS but I believe you will have to run a 0 second timer then check the buff because the system is most likely going to detect before the buff is placed.
Buff goes before damage. I've used buff detection when I'm lazy to code missiles.
 
Status
Not open for further replies.
Top