- Joined
- Aug 17, 2005
- Messages
- 82
Hey guys...I'm not quite sure what I did, but in my head it made sense. I've tried various things to fix it but...the math is just not getting to me. I normally work easily through math problems on wc3 but..this ones just killed me. The objective of the trigger is to pick all "Spawns" (Summoned units that are heroes instantly set to the summoners level to scale) and transfer the experience points they gain to nearby heroes(of all players) since they drain experience points. Heres the trigger I have:
Give Spawn EXP to Hero
Events
Unit - A unit Dies
Conditions
Actions
Set Temp_Point = (Position of (Triggering unit))
Set Temp_UGroup = (Units within 800.00 of Temp_Point matching (((Unit-type of (Matching unit)) Equal to (==) Spawn) or ((Unit-type of (Matching unit)) Equal to (==) Spawn)))
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in Temp_UGroup) Greater than (>) 0
Then - Actions
Do Multiple ActionsFor each (Integer A) from 1 to 12, do (Actions)
Loop - Actions
Unit Group - Pick every unit in Temp_UGroup and do (Actions)
Loop - Actions
Do Multiple ActionsFor each (Integer A) from 1 to (Hero level of (Picked unit)), do (Actions)
Loop - Actions
Set Max_Spawn_Xp = ((((Integer A) x 100) + 100) + Max_Spawn_Xp)
Set EXP_FROM_SPAWN[(Integer A)] = (Max_Spawn_Xp - (Hero experience of (Picked unit)))
Hero - Add (EXP_FROM_SPAWN[(Integer A)] x -1) experience to (Picked unit), Hide level-up graphics
Hero - Add EXP_FROM_SPAWN[(Integer A)] experience to Player_Hero[(Integer A)], Show level-up graphics
Set EXP_FROM_SPAWN[(Integer A)] = 0
Else - Actions
Custom script: call DestroyGroup (udg_Temp_UGroup)
Custom script: call RemoveLocation (udg_Temp_Point)
______END_____
Thanks in advance ;]
Give Spawn EXP to Hero
Events
Unit - A unit Dies
Conditions
Actions
Set Temp_Point = (Position of (Triggering unit))
Set Temp_UGroup = (Units within 800.00 of Temp_Point matching (((Unit-type of (Matching unit)) Equal to (==) Spawn) or ((Unit-type of (Matching unit)) Equal to (==) Spawn)))
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in Temp_UGroup) Greater than (>) 0
Then - Actions
Do Multiple ActionsFor each (Integer A) from 1 to 12, do (Actions)
Loop - Actions
Unit Group - Pick every unit in Temp_UGroup and do (Actions)
Loop - Actions
Do Multiple ActionsFor each (Integer A) from 1 to (Hero level of (Picked unit)), do (Actions)
Loop - Actions
Set Max_Spawn_Xp = ((((Integer A) x 100) + 100) + Max_Spawn_Xp)
Set EXP_FROM_SPAWN[(Integer A)] = (Max_Spawn_Xp - (Hero experience of (Picked unit)))
Hero - Add (EXP_FROM_SPAWN[(Integer A)] x -1) experience to (Picked unit), Hide level-up graphics
Hero - Add EXP_FROM_SPAWN[(Integer A)] experience to Player_Hero[(Integer A)], Show level-up graphics
Set EXP_FROM_SPAWN[(Integer A)] = 0
Else - Actions
Custom script: call DestroyGroup (udg_Temp_UGroup)
Custom script: call RemoveLocation (udg_Temp_Point)
______END_____
Thanks in advance ;]