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

Heal Spell

Status
Not open for further replies.
Level 16
Joined
May 1, 2008
Messages
1,605
Seas =)

Hmm i got a problem with this trigger here:
  • Heal
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Shaman 3
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Shaman 3 for (Casting unit)) Equal to 1
        • Then - Actions
          • Set Shaman[1] = (Shaman[1] + 45.00)
          • Unit Group - Pick every unit in (Units within 1000.00 of (Position of (Casting unit))) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) belongs to an ally of (Owner of (Casting unit))) Equal to True
                • Then - Actions
                  • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + Shaman[1])
                  • Set Shaman[1] = (Shaman[1] - 45.00)
                • Else - Actions
        • Else - Actions
The idea - each frindly unit should healed by an amount of Shaman[1]

Problem: Sometimes the heal works - sometimes nothing happend - sometimes the picked units got lesser life than befor - maybe some can help plz^^
 
Level 11
Joined
Feb 22, 2006
Messages
752
First of all, use the event Unit Starts the Effect of an Ability. Unit Starts Casting an Ability will actually fire before the spell is actually cast and sometimes won't fire at all. And your units are sometimes losing life because everytime you heal one unit, you decrease the amount healed by 45, so eventually the amount healed will be negative. If you "heal" a unit by a negative number, it will decrease the unit's life. Also, you're leaking a unit group. Before the unit group action, put in a custom script action that says "set bj_wantDestroyGroup = true" (without the quotes).
 
Level 16
Joined
May 1, 2008
Messages
1,605
Seas =)

Ok i show you the full plan.

Variable Shaman (REAL) / Array 2 (1 for heal ability / 2 for damage ability)

First i do:
  • Actions:
    • Set Shaman[1] = Shaman[1]+0
(To set the Variable to 0)

(The Ability I used, has 5 levels - and each level, the heal is higher)

Now I want use (for example)
If Ability lvl = 1 - Set Shaman[1] = Shaman[1]+45 > heal all units in area by 45 > set Shaman[1] to 0
If Ability lvl = 2 - Set Shaman[1] = Shaman[1]+145 > heal all units in area by 145 > set Shaman[1] to 0
..and so on
 
Level 6
Joined
Sep 13, 2008
Messages
261
Seas =)

Ok i show you the full plan.

Variable Shaman (REAL) / Array 2 (1 for heal ability / 2 for damage ability)

First i do:
  • Actions:
    • Set Shaman[1] = Shaman[1]+0
(To set the Variable to 0)

to set the variable to 0 you use
  • Set Shaman[1] = 0
As for the rest of your code it looks like it should work as long as his ability is level 1. If it levels up it won't work, until you complete it.

Your trigger also leaks at least one group and a location.

Also make sure like aznricepuff said
make the event
  • A unit-Starts the effect of an ability
 
Last edited:
Status
Not open for further replies.
Top