• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[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
 
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.
 
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.
 
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.
 
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.
Back
Top