


-------- We are determining what the rewards will be (In this case it's EXP and Gold) YOU MAY MODIFY. --------



Set EXP_ADDED = 100



Set GOLD_ADDED = 50



-------- --------------------------------------- --------



-------- Player has aquired the reward --------



Set QUEST_MAIN_COMPLETE[2] = True



-------- --------------------------------------- --------



-------- Player groups and unit groups for rewards (And stops leaks as well) --------



Set PLAYER_GROUP_REWARDS = (All players)



-------- --------------------------------------- --------



-------- Hiding once more the Exclamation point --------



Unit - Hide Quest_Array[2]



-------- --------------------------------------- --------



-------- This Whole section is the reward Floating text and the rewards we give out to the players. (As a group) --------



Player Group - Pick every player in PLAYER_GROUP_REWARDS and do (Actions)




Loop - Actions





Set UNIT_GROUP_REWARDS = (Units owned by (Picked player) matching (((Matching unit) is A Hero) Equal to True))





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






Loop - Actions







Player - Add GOLD_ADDED to (Picked player) Current gold







Hero - Add EXP_ADDED experience to (Picked unit), Show level-up graphics







Floating Text - Create floating text that reads (|c00540081 + ((String(EXP_ADDED)) + exp|r)) at (Position of (Picked unit)) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 100.00%), and 0.00% transparency







Set EXP_REWARD_TEXT = (Last created floating text)







Floating Text - Change EXP_REWARD_TEXT: Disable permanence







Floating Text - Set the velocity of EXP_REWARD_TEXT to 64.00 towards 90.00 degrees







Floating Text - Change the lifespan of EXP_REWARD_TEXT to 3.00 seconds







Floating Text - Change the fading age of EXP_REWARD_TEXT to 2.50 seconds







-------- --------------------------------------- --------







-------- This wait is to make sure the floating text don't over lap each other --------







-------- --------------------------------------- --------







Wait 0.50 seconds







Floating Text - Create floating text that reads (|c00FFFC01 + ((String(GOLD_ADDED)) + gold|r)) at (Position of (Picked unit)) with Z offset 0.00, using font size 10.00, color (0.00%, 100.00%, 100.00%), and 0.00% transparency







Set GOLD_REWARD_TEXT = (Last created floating text)







Floating Text - Change GOLD_REWARD_TEXT: Disable permanence







Floating Text - Set the velocity of GOLD_REWARD_TEXT to 64.00 towards 90.00 degrees







Floating Text - Change the lifespan of GOLD_REWARD_TEXT to 3.00 seconds







Floating Text - Change the fading age of GOLD_REWARD_TEXT to 2.50 seconds



-------- --------------------------------------- --------



-------- Notice at the end of each beginning quest triggers I am adding one, this is to substract one because we have just finished a quest. --------



Set QUEST_CURRENT_SPOT = (QUEST_CURRENT_SPOT - 1)



-------- --------------------------------------- --------



-------- QUEST_SPOT_CHANGE acts the same way QUEST_CURRENT_SPOT does. I made a second one because QUEST_CURRENT_SPOT is to set up the quests while the QUEST_SPOT_CHANGE is at the end to change the spot of all quests. --------



Set QUEST_SPOT_CHANGE = QUEST_NUMBER[2]



-------- --------------------------------------- --------



-------- To make the current quest disappear (As an empty row) --------



Multiboard - Set the text for QUEST_MULTIBOARD item in column 1, row QUEST_SPOT_CHANGE to <Empty String>



Multiboard - Set the text for QUEST_MULTIBOARD item in column 2, row QUEST_SPOT_CHANGE to <Empty String>



-------- --------------------------------------- --------



-------- The condition is to make sure I'm not changing the spots of a quest we've already completed completely (Reward was collected) --------



For each (Integer current_row) from 1 to (1 + QUEST_TOTAL), do (Actions)



-------- --------------------------------------- --------



-------- We fnished a quest, so the Quest total drops one. --------



Set QUEST_TOTAL = (QUEST_TOTAL - 1)



-------- --------------------------------------- --------



-------- "updating" the number of rows in the multiboard --------



Multiboard - Change the number of rows for QUEST_MULTIBOARD to (1 + QUEST_TOTAL)



-------- --------------------------------------- --------



-------- COMPLETELY DIFFERENT FROM THE MULTIBOARD --------



-------- This is for a follow-up type of quest --------



-------- --------------------------------------- --------



-------- Unhide the exclamation mark (Shows a bit what I mean when I say that we don't remove the units just in case we need them again) --------



Unit - Unhide Quest_Array[2]



-------- --------------------------------------- --------



-------- So it doesn't activate as soon as you get the reward. --------



Trigger - Turn off Quest 3 <gen>



Wait 0.25 seconds



Trigger - Turn on Quest 3 <gen>



Custom script: call DestroyGroup(udg_UNIT_GROUP_REWARDS)



Custom script: call DestroyForce(udg_PLAYER_GROUP_REWARDS)