• 🏆 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] Deal damage before the projective hit the target

Status
Not open for further replies.

Kusanagi Kuro

Hosted Project: SC
Level 10
Joined
Mar 11, 2012
Messages
708
Hi guys. I've made several spell and all of them use this kind of trigger:
  • Soul Break
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ability
    • Actions
      • Set SB_Caster = (Triggering unit)
      • Set SB_Target = (Target unit of ability being cast)
      • Set SB_Damage = Damage
      • Unit - Cause SB_Caster to damage SB_Target, dealing SB_Damage damage of attack type Hero and damage type Normal
This trigger always cause damage even when the projective hasnt hit the target yet.
All the spell I used is unit target. Is there any way to make the spell deal damage when the projective hit the target, not before? I dont use JASS so plz make it as trigger. :D
 
Level 23
Joined
Jan 1, 2009
Messages
1,608
Depending on your need you either have to register when the projectile hits the unit, or let the projectile itself make the damage.
You also could make a dummycaster (invisible dummyunit) that has a missile-samage spell (e.g. Fireball, stormbolt) with the same projectile speed but with damage,
and cast it on the target unit.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
It's a bit more complex.

You have to create a dummy and save the values (damage, duration, range, speed, whatever, depending on the ability) on it (On it's HandleId if you use a Hashtable, or on it's Custom value, if you use Bribe's Unit Indexer).

Then with a periodic Loop you move the dummy towards the target unit, and check constantly if the target is alive and the other conditions you have (max distance traveled, etc.) When distance between dummy and target is low enough, you kill the dummy, clear the hashtable (if you used it) and do the damage effect.

Obviously, you have to turn on the Periodic Trigger once you add a unit, and constantly check if there's any unit in the group, else, turn off the periodic loop.
 

nGy

nGy

Level 11
Joined
Apr 15, 2011
Messages
123
If you want different effects from only damage and stun (or don't want ministun), you'll have to do what Spartipilo said. Probably just clarify, what exactly you want the spell to do and we can help you.
 
Level 12
Joined
Oct 16, 2010
Messages
680
if this is the only one thing you want ( fire a projectile and damage when it hits exactly)
use a simple blizzard skill with modified stats.
theres plenty of skills like that...

I mean why would you do triggers for this?

if there's something more you want, tell us.
 

Kusanagi Kuro

Hosted Project: SC
Level 10
Joined
Mar 11, 2012
Messages
708
no no. U misunderstnd me. Since it damage base on the attribute of the hero, I need to trigger it. And Blizzard isnt a unit target skill. It's a point target skill.
 
Status
Not open for further replies.
Top