Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Show us what you have tried. Also tell us what is going wrong with yours.
Party Exp

Events


Unit - A unit Dies

Conditions


((Dying unit) is A structure) Equal to False

Actions


Set Exp_ValueParty = (Exp_ValueParty x (Hero level of (Dying unit)))


Set Exp_PickedPoint = (Position of (Picked unit))


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(((Dying unit) is A Hero) Equal to True) and (((Killing unit) is A Hero) Equal to True)



Then - Actions




Unit Group - Pick every unit in (Units within Exp_Area of (Position of (Killing unit)) matching ((((Picked unit) is A Hero) Equal to True) and ((((Picked unit) belongs to an ally of (Owner of (Killing unit))) Equal to True) and (((Dying unit) belongs to an enemy of (Owner of (Killing unit)) and do (Actions)





Loop - Actions






Hero - Add Exp_ValueParty experience to (Picked unit), Hide level-up graphics






Floating Text - Create floating text that reads (+ + ((String(Exp_GainByLevelHero)) + party exp)) at Exp_PickedPoint with Z offset 100.00, using font size 9.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency






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 1.25 seconds






Floating Text - Set the velocity of (Last created floating text) to 70.00 towards 90.00 degrees






Custom script: call RemoveLocation(udg_Exp_PickedPoint)






Custom script: set udg_Exp_PickedPoint = null



Else - Actions
Party Exp

Events


Unit - A unit Dies

Conditions


((Dying unit) is A structure) Equal to False

Actions


Set TempUnit = (Triggering unit)


Set TempUnit2 = (Killing unit)


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




((TempUnit is A Hero) Equal to True) and ((TempUnit2 is A Hero) Equal to True)



Then - Actions




Set Exp_ValueParty = (Exp_ValueParty x (Hero level of TempUnit))




Set TempPoint = (Position of TempUnit2)




Unit Group - Pick every unit in (Units within Exp_Area of TempPoint) and do (Actions)





Loop - Actions






Set TempUnit3 = (Picked unit)






If (All Conditions are True) then do (Then Actions) else do (Else Actions)







If - Conditions








(TempUnit3 belongs to an ally of (Owner of TempUnit2)) Equal to True








(TempUnit3 is A Hero) Equal to True








(TempUnit3 is alive) Equal to True







Then - Actions








Set Exp_PickedPoint = (Position of TempUnit3)








Hero - Add Exp_ValueParty experience to TempUnit3, Hide level-up graphics








Floating Text - Create floating text that reads (+ + ((String(Exp_GainByLevelHero)) + party exp)) at Exp_PickedPoint with Z offset 100.00, using font size 9.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency








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 - Set the velocity of (Last created floating text) to 70.00 towards 90.00 degrees








Floating Text - Change the fading age of (Last created floating text) to 1.25 seconds








Custom script: call RemoveLocation(udg_Exp_PickedPoint)








Custom script: set udg_Exp_PickedPoint = null







Else - Actions




Custom script: call RemoveLocation(udg_TempPoint)



Else - Actions
Imo it seems like a LOT of exp is given but maybe because the party and killing unit xp are given at the same time, not sure. This worked for me.
Party Exp
Events
Unit - A unit Dies
Conditions
((Dying unit) is A structure) Equal to False
Actions
Set TempUnit = (Triggering unit)
Set TempUnit2 = (Killing unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((TempUnit is A Hero) Equal to True) and ((TempUnit2 is A Hero) Equal to True)
Then - Actions
Set Exp_ValueParty = (Exp_ValueParty x (Hero level of TempUnit))
Set TempPoint = (Position of TempUnit2)
Unit Group - Pick every unit in (Units within Exp_Area of TempPoint) and do (Actions)
Loop - Actions
Set TempUnit3 = (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TempUnit3 belongs to an ally of (Owner of TempUnit2)) Equal to True
(TempUnit3 is A Hero) Equal to True
(TempUnit3 is alive) Equal to True
Then - Actions
Set Exp_PickedPoint = (Position of TempUnit3)
Hero - Add Exp_ValueParty experience to TempUnit3, Hide level-up graphics
Floating Text - Create floating text that reads (+ + ((String(Exp_GainByLevelHero)) + party exp)) at Exp_PickedPoint with Z offset 100.00, using font size 9.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
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 - Set the velocity of (Last created floating text) to 70.00 towards 90.00 degrees
Floating Text - Change the fading age of (Last created floating text) to 1.25 seconds
Custom script: call RemoveLocation(udg_Exp_PickedPoint)
Custom script: set udg_Exp_PickedPoint = null
Else - Actions
Custom script: call RemoveLocation(udg_TempPoint)
Else - Actions
Party Exp

Events


Unit - A unit Dies

Conditions


((Dying unit) is A structure) Equal to False

Actions


Set TempUnit = (Triggering unit)


Set TempUnit2 = (Killing unit)


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




((TempUnit is A Hero) Equal to True) and ((TempUnit2 is A Hero) Equal to True)



Then - Actions




Set Exp_ValueParty = (Exp_ValueParty / (Hero level of TempUnit2))




Set TempPoint = (Position of TempUnit2)




Unit Group - Pick every unit in (Units within Exp_Area of TempPoint) and do (Actions)





Loop - Actions






Set TempUnit3 = (Picked unit)






If (All Conditions are True) then do (Then Actions) else do (Else Actions)







If - Conditions








(TempUnit3 belongs to an ally of (Owner of TempUnit2)) Equal to True








(TempUnit3 is A Hero) Equal to True








(TempUnit3 is alive) Equal to True







Then - Actions








Set Exp_PickedPoint = (Position of TempUnit3)








Hero - Add Exp_ValueParty experience to TempUnit3, Show level-up graphics








Floating Text - Create floating text that reads (+ + ((String(Exp_ValueParty)) + party exp)) at Exp_PickedPoint with Z offset 100.00, using font size 9.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency








Floating Text - Change (Last created floating text): Disable permanence








Floating Text - Change the lifespan of (Last created floating text) to 3.50 seconds








Floating Text - Change the fading age of (Last created floating text) to 2.25 seconds








Floating Text - Set the velocity of (Last created floating text) to 40.00 towards 90.00 degrees








Custom script: call RemoveLocation(udg_Exp_PickedPoint)








Custom script: set udg_Exp_PickedPoint = null







Else - Actions








Set Exp_ValueParty2 = (Exp_ValueParty2 / (Hero level of TempUnit2))








If (All Conditions are True) then do (Then Actions) else do (Else Actions)









If - Conditions










((TempUnit is A Hero) Equal to False) and ((TempUnit2 is A Hero) Equal to True)










(TempUnit3 belongs to an ally of (Owner of TempUnit2)) Equal to True










(TempUnit3 is A Hero) Equal to True










(TempUnit3 is alive) Equal to True









Then - Actions










Hero - Add Exp_ValueParty2 experience to TempUnit3, Show level-up graphics










Floating Text - Create floating text that reads (+ + ((String(Exp_ValueParty2)) + party exp)) at Exp_PickedPoint with Z offset 100.00, using font size 9.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency










Floating Text - Change (Last created floating text): Disable permanence










Floating Text - Change the lifespan of (Last created floating text) to 3.50 seconds










Floating Text - Change the fading age of (Last created floating text) to 2.25 seconds










Floating Text - Set the velocity of (Last created floating text) to 40.00 towards 90.00 degrees










Custom script: call RemoveLocation(udg_Exp_PickedPoint)










Custom script: set udg_Exp_PickedPoint = null









Else - Actions




Custom script: call RemoveLocation(udg_TempPoint)




Custom script: set udg_TempPoint = null



Else - Actions
Party Exp

Events


Unit - A unit Dies

Conditions


((Dying unit) is A structure) Equal to False

Actions


Set TempUnit = (Triggering unit)


Set TempUnit2 = (Killing unit)


Set Exp_ValueParty = (100 x (Level of TempUnit))


Set TempPoint = (Position of TempUnit2)


Set TempGroup = (Units within Exp_Area of TempPoint)


Set TempInteger = 0


Unit Group - Pick every unit in TempGroup and do (Actions)



Loop - Actions




Set TempUnit3 = (Picked unit)




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






(TempUnit3 belongs to an ally of (Owner of TempUnit2)) Equal to True






(TempUnit3 is A Hero) Equal to True






(TempUnit3 is alive) Equal to True





Then - Actions






Set TempInteger = (TempInteger + 1)





Else - Actions


Set TempInt = (Exp_ValueParty / TempInteger)


Unit Group - Pick every unit in TempGroup and do (Actions)



Loop - Actions




Set TempUnit3 = (Picked unit)




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






(TempUnit3 belongs to an ally of (Owner of TempUnit2)) Equal to True






(TempUnit3 is A Hero) Equal to True






(TempUnit3 is alive) Equal to True





Then - Actions






Set Exp_PickedPoint = (Position of TempUnit3)






Hero - Add TempInt experience to TempUnit3, Hide level-up graphics






Floating Text - Create floating text that reads (+ + ((String(TempInt)) + party exp)) at Exp_PickedPoint with Z offset 100.00, using font size 9.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency






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 - Set the velocity of (Last created floating text) to 70.00 towards 90.00 degrees






Floating Text - Change the fading age of (Last created floating text) to 1.25 seconds






Custom script: call RemoveLocation(udg_Exp_PickedPoint)






Custom script: set udg_Exp_PickedPoint = null





Else - Actions


Custom script: call DestroyGroup(udg_TempGroup)


Custom script: call RemoveLocation(udg_TempPoint)
Hmm seems I made a few mistakes, this one is probably not that efficient since I pick the same group twice but I'm exhausted, someone can help you from here.
The initial Ifs seems kind of pointless to me, we should be checking every time a unit dies if we need to give XP to a nearby hero, not just when a hero gets the last hit. Maybe you want to give more XP if the hero gets the last hit, if that is the case you will need to add an IF back in. However I don't think its needed as you seem to want 100 as the base amount (which is a lot early btw)
Btw use Level of unit (it works for heroes and units)
Party Exp
Events
Unit - A unit Dies
Conditions
((Dying unit) is A structure) Equal to False
Actions
Set TempUnit = (Triggering unit)
Set TempUnit2 = (Killing unit)
Set Exp_ValueParty = (100 x (Level of TempUnit))
Set TempPoint = (Position of TempUnit2)
Set TempGroup = (Units within Exp_Area of TempPoint)
Set TempInteger = 0
Unit Group - Pick every unit in TempGroup and do (Actions)
Loop - Actions
Set TempUnit3 = (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TempUnit3 belongs to an ally of (Owner of TempUnit2)) Equal to True
(TempUnit3 is A Hero) Equal to True
(TempUnit3 is alive) Equal to True
Then - Actions
Set TempInteger = (TempInteger + 1)
Else - Actions
Set TempInt = (Exp_ValueParty / TempInteger)
Unit Group - Pick every unit in TempGroup and do (Actions)
Loop - Actions
Set TempUnit3 = (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TempUnit3 belongs to an ally of (Owner of TempUnit2)) Equal to True
(TempUnit3 is A Hero) Equal to True
(TempUnit3 is alive) Equal to True
Then - Actions
Set Exp_PickedPoint = (Position of TempUnit3)
Hero - Add TempInt experience to TempUnit3, Hide level-up graphics
Floating Text - Create floating text that reads (+ + ((String(TempInt)) + party exp)) at Exp_PickedPoint with Z offset 100.00, using font size 9.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
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 - Set the velocity of (Last created floating text) to 70.00 towards 90.00 degrees
Floating Text - Change the fading age of (Last created floating text) to 1.25 seconds
Custom script: call RemoveLocation(udg_Exp_PickedPoint)
Custom script: set udg_Exp_PickedPoint = null
Else - Actions
Custom script: call DestroyGroup(udg_TempGroup)
Custom script: call RemoveLocation(udg_TempPoint)
I'm not really following what you're saying...
My last post works for if a regular unit (non-hero) OR a hero dies.
The trigger gets the total XP (to be given) based on the Dying units level * the 100 constant you had chosen.
If there are 2 hero units in range, when a level 5 unit (hero or non-hero) dies it will split the 500xp between these 2 units giving 250 each.
I think if you want to give extra XP for getting the last hit you should just do that separately, but I think you're going to want to make it minimal, and not do some multiple. i.e. Map Initialization set LastHitXp[1] = 15 LastHitXp[2] = 23
And then just check the level of the unit when it dies and give it the flat amount based on your predefined values.
yeap i'm stupid, because i didn't see a part in the conditions that tempunit is a hero or not, which means it works for both.you mean to say that the trigger you created is for hero and non-hero units already? if so, then i'm so stupid and wasted 5 hours trying to make a same trigger for non-hero units.