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

[Trigger] can someone help?spell ,buf,variable problem

Status
Not open for further replies.
Level 4
Joined
Oct 28, 2007
Messages
72
this cant work where is the problem can someone help?
the goal is to all buffed unit ,the casting hero gets they hp copy by 25%
all buffed unit if there is 4 unit and each unit have 100hp full then copy
25% of they hp in this example is 100-25%=25 hp then * 4 unit=100 hp + for
hero and got timer 30 sec
i use all integer in variables but i use string for memorise the hp of buffed unit
before casted spell so where i did wrong?

  • Events
    • Unit - A unit Stops casting an ability
  • Conditions
    • (Ability being cast) Equal to Life Bonus
  • Actions
    • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Picked unit) has buff Roar) Equal to True)) and do (Actions)
      • Loop - Actions
        • Set memoryPICKEDhp = (String((Point-value of (Unit-type of (Picked unit)))))
        • Unit - Set life of (Picked unit) to 25.00%
        • Set CountOFunits = (Number of All buffs considered Magic or physical on (Picked unit) (Exclude expiration timers, Exclude auras))
        • Set HPpickedUNITS = (Integer((Life of (Picked unit))))
        • Unit - Set life of (Picked unit) to (Real(memoryPICKEDhp))
        • Set heroHPbonus = (CountOFunits x HPpickedUNITS)
        • Set HeroHP = (Point-value of (Casting unit))
        • Unit - Set life of (Casting unit) to ((Real(heroHPbonus)) + (Real(HeroHP)))
        • Wait 15.00 seconds
        • Unit - Set life of (Casting unit) to (Real(HeroHP))
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
At Unit Group, you set 'Matching Picked Unit', but the unit will be picked for the Actions, not the trigger itself.
You need to change 'Picked Unit'. Then it will activate the Actions.

Or you can place this Action before your Unit Group Action
  • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Unit Group - Add (Picked unit) to ALL)
ALL = A Unit Group Variable
 
Status
Not open for further replies.
Top