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

[Solved] Need help for a custom spell

Status
Not open for further replies.
Level 2
Joined
Apr 23, 2013
Messages
12
Hello everyone, I'm working on a custom map these days and I'm trying to create a sort of Priest, that has some spells that heal allies and damage enemies at the same time.

His first spell it's called Darklight Blast, it's supposed to single target an enemy, doing 70/90/110/130 damage and healing friendly units within 350 from the damaged target for the same amount.

So, what I've done: I took lightning bolt, took off bounces and animation, and made it a single target damaging spell, then I triggered this:

Event: A unit starts casting a spell
Cond: Spell is Darklight Blast
Act: Pick every unit (within 350 from target of ability being cast) matching (picked unit belongs to an ally of owner of caster) and do action

Set life of picked unit at ((life of picked unit + ((level of spell x 20)+50))


Now, to me it looks simple, but it does not work, I tried to change the condition when picking units, and I've put to pick units within 350 from target of spell, matching (picked unit belongs to enemy of owner of casting unit = false) But nothing..

The spell deals his damage normally, to a single target, but my units that are close to this target don't get the heals.

Can someone help me?
 
Level 2
Joined
Apr 23, 2013
Messages
12
It doesn't work.. To simplify this I'll try to write the trigger as it is, the best I can.

Event: A unit begins the cast of a spell
Conditions: (Ability being cast) Equal to Darklight Blast
Actions: Unit Group - Pick every unit in (Units within 350.00 of (Position of (Target unit of ability being cast)) matching (((Picked unit) belongs to an ally of (Owner of (Casting unit)) Uguale a TRUE)) and do (Actions)
Loop - Actions
Unit - Set life of (Matching unit) to ((Life of (Matching unit)) + (50.00 + ((Real((Level of Darklight Blast for (Casting unit)))) x 20.00)))
 
Level 20
Joined
Jun 27, 2011
Messages
1,864
I mean like this...
Notice the "pick every unit".
  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (MATCHING UNIT)) Equal to Footman)) and do (Actions)
        • Loop - Actions
          • -------- Do actions --------
  • [/stable]
http://www.hiveworkshop.com/forums/miscellaneous-tutorials-456/how-easily-post-triggers-163285/
 
Last edited:
Level 28
Joined
Sep 26, 2009
Messages
2,520
You have it the other way.

The way it works is like this: When you're finding out which unit matches condition for your group, you refer to that unit as matching unit.
If the unit is matching those condition indeed, it will be picked into the group and so in the group action you refer to that unit as picked unit.
 
Status
Not open for further replies.
Top