• 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] Max number of stats

Status
Not open for further replies.

hdm

hdm

Level 9
Joined
Nov 19, 2011
Messages
384
I made a tigger that for each enemy killed,unit or hero, the killing hero gains +4 inteligence for the kill.Something like
  • Events
    • Unit - Learns a skill
  • Conditions
    • (Learned Hero Skill) Equal to *My Ability
  • Actions
    • Set *My 1 Variable = Learning Hero
    • Tigger - Turn the Tigger below
  • Events
    • Unit - A unit Dies
  • Conditions
    • (Killing unit) Equal to Owner of *My 1 variable
  • Actions
    • Hero - Modify Intelligence of *My 1 variable: Add (1+ (Level of My Spell for *My 1 variable)
How can I make the tigger have a maximum number of inteligence, I mean, after reach a certain number of inteligence added, any unit that dies does not add more intelligence ?

Like nevermore's necromastery that souls maximum are 72.Should I make it a maximun number of units or of the added inteligence ?
 
Last edited:

hdm

hdm

Level 9
Joined
Nov 19, 2011
Messages
384
nononono,I forgot to post "Level of ability for My Variable",Srry,my fault.It's only if the hero has a custom passive ability,which runs this tiggrer.
 

hdm

hdm

Level 9
Joined
Nov 19, 2011
Messages
384
er,I think that no,he controls more than 1 unit...And this spell is not for all units...There is another tigger before this,i'll edit the new tigger.But I also have problems with passives abilities,like this,when the owner of ability has a Ilusion.Since cuz It bugs the ttigger cuz there will be 2 passive spells and the tigger doesn't recognizes which of the unit is the unit of tigger.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
But I also have problems with passives abilities,like this,when the owner of ability has a Ilusion.Since cuz It bugs the ttigger cuz there will be 2 passive spells and the tigger doesn't recognizes which of the unit is the unit of tigger.
  • ((Killing unit) is an illusion) Equal to False
Okay, a Player can control more than 1 unit of this unit-type, I'll working on it.
 
Level 8
Joined
Oct 26, 2008
Messages
387
I made a tigger that for each enemy killed,unit or hero, the killing hero gains +4 inteligence for the kill.Something like
  • Events
    • Unit - Learns a skill
  • Conditions
    • (Learned Hero Skill) Equal to *My Ability
  • Actions
    • Set *My 1 Variable = Learning Hero
    • Tigger - Turn the Tigger below
  • Events
    • Unit - A unit Dies
  • Conditions
    • (Killing unit) Equal to Owner of *My 1 variable
  • Actions
    • Hero - Modify Intelligence of *My 1 variable: Add (1+ (Level of My Spell for *My 1 variable)
How can I make the tigger have a maximum number of inteligence, I mean, after reach a certain number of inteligence added, any unit that dies does not add more intelligence ?

Like nevermore's necromastery that souls maximum are 72.Should I make it a maximun number of units or of the added inteligence ?


You will need 3 Real Variables

1 Representing the Current Hero Level
1 Representing the total Number of units your Hero has killed
1 Representing your Current Intelligence

Variables: HeroCurrentLevel - HeroKills - HeroRealInt
Your triggers should be like this,


  • Events
    • Unit - A unit Dies
  • Conditions
    • (Killing unit) Equal to Owner of *My 1 variable
  • Actions
  • Set HeroKills = (HeroKills + 1)
  • Set HeroRealInt = (*Initial Intelligence* + (HeroKills x (Level of My Spell) for *My 1 variable) + (HeroCurrentLevel x *Itelligence per level*)
  • If HeroRealInt is Less Than *your limit number*
  • Then
    • Hero - Modify Intelligence of *My 1 variable: Add (1+ (Level of My Spell for *My 1 variable)
  • Else
  • Do Nothing
Also you will need to add a trigger,

  • Event
    • Unit - Gains a Level
  • Conditions
    • (Triggering unit) Equal to (My 1 Variable)
  • Actions
    • Set HeroCurrentLevel = (HeroCurrentLevel +1)
NOTE:
Initial Intelligence and Itelligence per level are values taken from Object Editor, from your unit stats.
HeroCurrentLevel variable default value = 1 not 0
 
Status
Not open for further replies.
Top