• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] % of Strength gain

Status
Not open for further replies.
Level 11
Joined
Apr 28, 2008
Messages
696
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
 
Level 9
Joined
Aug 21, 2008
Messages
533
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.
 
Level 10
Joined
Mar 31, 2009
Messages
732
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.
 

Rmx

Rmx

Level 19
Joined
Aug 27, 2007
Messages
1,164
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 :)
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
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.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
@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
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
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.
Top