• 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.

[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,615
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.
 

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