- Joined
- Dec 26, 2010
- Messages
- 401
Took me a long time of toying with it trying to get it to convert a real to integer until I came across the current set up, I was wondering if this was an efficient way of creating a generic EXP trigger to be used in hero maps in which they want the exp to be triggered and displayed via floating text?
Right now the set up is basically this formula;
(Level of Unit/Hero Level)*(((Level of Unit - 1)*3)+(Random Number 1 to 11))
Or This is the other way I tried writing it out;
(((Level of Unit - 1)*3)+(Random Number 1 to 11))/(Level of Hero/Level of Unit)
Which both return the same value.
-
Exp
-
Events
- Unit - A unit Dies
-
Conditions
- (Owner of (Dying unit)) Equal to Neutral Hostile
-
Actions
- Custom script: set bj_wantDestroyGroup=true
-
Unit Group - Pick every unit in (Units within 1000.00 of (Position of (Dying unit)) matching (((Owner of (Matching unit)) is an enemy of (Owner of (Dying unit))) Equal to True)) and do (Actions)
-
Loop - Actions
- Set Expgain = (((Real((Level of (Dying unit)))) / (Real((Hero level of (Picked unit))))) x ((((Real((Level of (Dying unit)))) - 1.00) x 3.00) + (Random real number between 1.00 and 11.00)))
- Hero - Add (Integer(Expgain)) experience to (Picked unit), Show level-up graphics
- Floating Text - Create floating text that reads ((String(Expgain)) + |caf7f3ac9xp|r) above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
- Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
- Floating Text - Change the fading age of (Last created floating text) to 3.00 seconds
-
Loop - Actions
-
Events
(Level of Unit/Hero Level)*(((Level of Unit - 1)*3)+(Random Number 1 to 11))
Or This is the other way I tried writing it out;
(((Level of Unit - 1)*3)+(Random Number 1 to 11))/(Level of Hero/Level of Unit)
Which both return the same value.
Last edited: