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

[Trigger] % of Strength gain

Status
Not open for further replies.
To get a %value of strength as bonus you have to convert the strength to real:

  • Set YourHero = Your hero //self explaning :)
  • Set YourPercentValue = 25.00 // For a bonus of 25%
  • Hero - Modify Strength of YourHero: Add (Integer((((Real((Kraft of YourHero (Exclude bonuses)))) / 100.00) x YourPercentValue))) //Adds 25% of the basestrength of yourhero
 
i also would add the difference beetwen the old and the new value cause its only a spell which shouldnt last forever.
If you dont have values like 100k str you may make a abilty with 100 lvl which gives 1 str for every lvl and at the right one when the spell is casted. Remove it later.
 
i also would add the difference beetwen the old and the new value cause its only a spell which shouldnt last forever.
If you dont have values like 100k str you may make a abilty with 100 lvl which gives 1 str for every lvl and at the right one when the spell is casted. Remove it later.

If he wants it like battle shout, then its going to be an aoe buff (roar), so the value will be different for every unit affected.
 
Yes u can......... First make ...

Set Integer1 = Strenght of the hero ... example = 20

Okay now we have .... Set Integer1 = 20

Then Set Integer1 = (20/100) x (the percent u want) ...

If u want it 10% ..... then ... Set Integer1 = (20/100) x (10) = 2 strenght ...

Then add it to the hero when he level up ... simple :)
 
Can we please stop posting here already? The percentage question has already been answered trice, while I don't think that's really his question because it's too simple and he's an experienced mapper. I think his real question was how to get numbers rounded to the nearest full number, which I already explained.

So please stop posting more posts here, because his question is solved unless he encounters problems, doesn't understand it or has more questions.
 
@RMX and Ciebron

If i have 48 strength, then 1.20 (20%) would = 57.6, therefore, warcraft will not input this number and the trigger will be innactive.

only whole number integers are counted when dealing with attribute modifications.

Try converting the strength to a real variable, then set the strength to "Convert Real to Integer" and set your variable (which represents the strength) there.
It will round the real down, so the 57.6 will become 57
 
The easiest way actually would be to use a simple local and a wait (seeing as it's probably more then one second, who cares about the accuracy), as this shows, assuming you want the triggering unit.
I didn't put the actual Jass actions because you might want to use the GUI-Local bug.

  • Custom script: local unit u = GetTriggerUnit()
  • Add attribute to u
  • Sleep
  • Remove attribute from u
 
Status
Not open for further replies.
Back
Top