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!
Anyone Here know how to make a xp system based on damage done by a hero?
if you do could you please send me a map with it? if you can i will give credit thanks
U Said U Wanted A XP System Based On A Unit's Damage. Bt U Did Nt Mention Hw U Wanted It.
Did U Meant Exp Given = Total Damage Dealt To Unit, Or
Did U Meant Avrg Damage Dealt To Unit Convert To Exp?
If It Is The 1st 1 Use Blooper's Trigger. If Its The Latter,
U R Supposed To Do The Following:
-Events-
A unit is attacked
-Conditions-
Skip~
-Actions-
Set <Variable(Unit)> equals to attacked unit.
Set <Variable(Integer)> equals to [<Variable(Integer)>+1]
-Events-
A unit dies
-Conditions-
Dying unit equals to <Variable(Unit)> equals to true
-Actions-
Set <Variable(Integer2)> equals to [Max life of <Variable(Unit)> divided by <Variable(Integer)]
Set <Variable(Real)> equals to [Real<Variable(Integer2)>]
Add <Variable(Real)> to killing unit, show level-up graphics
If U Did Not Understand Why I Set <Variable(Integer)> To Itself +1, It Is Because Im Using It To Count The Number Of Hits U Took To Kill The Unit, And Thn Use The Max Life Of Killed Unit Divided By It To Obtain An Avrg Score.
What Are The Cons Of This Trigger:
[X] Exp Given Wil Be Inaccurate If Thrs More Than 1 Unit Attacking
[X] Causes Lag
[X] Can Onli Apply On 1 Unit
[X] If Thr Is Mor Than 1 Unit Attacking At The Same Time, The Following Might Happen:
[X]Wc3 TFT Crashes
[X]Trigger Fails And Leaks Totally
First Trigger : Add all unit into specific unit in trigger 2.
Attacked
Events
Time - Every 0.10 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) is in XP_Picked_Unit) Equal to False)) and do (Actions)
Loop - Actions
Unit Group - Add (Picked unit) to XP_Picked_Unit
Trigger - Add to Take EXP <gen> the event (Unit - (Picked unit) Takes damage)
Second Trigger : Give exp to attacking unit.
Take EXP
Events
Conditions
Actions
Hero - Add (Integer((Damage taken))) experience to (Damage source), Show level-up graphics
The example i make for you need 2 trigger to function.
The 1st 1 is to add unit that being attacked into "Specified Unit"
of the event of the second trigger.
The second trigger is use to add XP to the unit that damage enermy .
The trigger above is just basic concept of this XP system.
Well , to make it more complete ,
you can try replace the action in second trigger with this .
Actions
Set DamagedTarget_Point = (Position of (Triggering unit))
Set Damages = (Integer((Damage taken)))
Unit Group - Pick every unit in (Units within 1200.00 of DamagedTarget_Point matching ((((Matching unit) belongs to an ally of (Owner of (Damage source))) Equal to True) and (((Matching unit) is A Hero) Equal to True))) and do (Actions)
Loop - Actions
Unit Group - Add (Picked unit) to Hero_Picked
Unit Group - Pick every unit in Hero_Picked and do (Actions)
Loop - Actions
Hero - Add (Damages / (Number of units in Hero_Picked)) experience to (Picked unit), Show level-up graphics
Variable That added :
unit group - Hero_Picked
point - DamagedTarget_Point
integer - Damages
This will add XP to heroes which are in 1200 range ( Default Maximum XP Gain Range ) of the unit that took damages equally whenever the unit own by the owner of hero attack units.The variables added is to prevent leakage.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.