hell_knight
Playing WoW
- Reaction score
- 126
Title says it all.
R2I = Real to Interger
WC3 always rounds up which is annoying.
Pretend I want to multiply the custom value of the dying unit by the heroes natural growth amounts. This can't be possible without doing big jumps.
Basicly I want when a unit kills something he gains points multiplied by his normal growth , so he kills something gets 10 STR points. He has a 1.35X str growth so he gains 13.5 instead of 10. If I do a R2I conversion 1.35 real becomes 2 interger so that won't work.
Does converting to custum script let you bypass this?
Heres my code anyways
Its a 2-d/3-d array whatever you want to call it.
Player 1's hero has str stored in array 1 , agi in array 2 and int in array 3.
This continues all the way to 36. Same applies for HeroGrowth.
R2I = Real to Interger
WC3 always rounds up which is annoying.
Pretend I want to multiply the custom value of the dying unit by the heroes natural growth amounts. This can't be possible without doing big jumps.
Basicly I want when a unit kills something he gains points multiplied by his normal growth , so he kills something gets 10 STR points. He has a 1.35X str growth so he gains 13.5 instead of 10. If I do a R2I conversion 1.35 real becomes 2 interger so that won't work.
Does converting to custum script let you bypass this?
Heres my code anyways
Code:
Stats Per Kill
Events
Unit - A unit Dies
Conditions
((Dying unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
((Killing unit) is A Hero) Equal to True
Actions
Set StatBase3DArray[((Player number of (Owner of (Killing unit))) + 0)] = (((StatBase3DArray[(Player number of (Owner of (Killing unit)))] + 0) + ((Custom value of (Dying unit)) x (Integer(HeroGrowth[((Player number of (Owner of (Killing unit))) + 0)])))) + 0)
Set StatBase3DArray[((Player number of (Owner of (Killing unit))) + 1)] = (((StatBase3DArray[(Player number of (Owner of (Killing unit)))] + 1) + ((Custom value of (Dying unit)) x (Integer(HeroGrowth[((Player number of (Owner of (Killing unit))) + 1)])))) + 0)
Set StatBase3DArray[((Player number of (Owner of (Killing unit))) + 2)] = (((StatBase3DArray[(Player number of (Owner of (Killing unit)))] + 2) + ((Custom value of (Dying unit)) x (Integer(HeroGrowth[((Player number of (Owner of (Killing unit))) + 2)])))) + 0)
Its a 2-d/3-d array whatever you want to call it.
Player 1's hero has str stored in array 1 , agi in array 2 and int in array 3.
This continues all the way to 36. Same applies for HeroGrowth.