Moderator
M
Moderator
16:42, 27th Nov 2009
TriggerHappy:
Could be useful.
TriggerHappy:
Could be useful.
Quest Multiboard

Events


Time - Elapsed game time is 1.00 seconds

Conditions

Actions


-------- Create the multiboard. CHANGE THE TITLE HERE! --------


Multiboard - Create a multiboard with 2 columns and (1 + QUEST_TOTAL) rows, titled Quests


Set QUEST_MULTIBOARD = (Last created multiboard)


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


-------- This is set so that every row will have a certain width and no icons. Once again you may change on preference. --------


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



Loop - Actions




Multiboard - Set the display style for QUEST_MULTIBOARD item in column 1, row 1 to Show text and Hide icons




Multiboard - Set the display style for QUEST_MULTIBOARD item in column 2, row 1 to Show text and Hide icons




Multiboard - Set the display style for QUEST_MULTIBOARD item in column 1, row current_row to Show text and Hide icons




Multiboard - Set the display style for QUEST_MULTIBOARD item in column 2, row current_row to Show text and Hide icons




Multiboard - Set the width for QUEST_MULTIBOARD item in column 1, row current_row to 20.00% of the total screen width




Multiboard - Set the width for QUEST_MULTIBOARD item in column 2, row current_row to 5.00% of the total screen width




Multiboard - Set the text for QUEST_MULTIBOARD item in column 1, row 1 to |cffffcc00Current Q...


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


-------- CHANGE THE FIRST ROW HERE --------


-------- You MUST show this at the end. If you don't your Multiboard will never show up. --------


Multiboard - Show QUEST_MULTIBOARD
Quest 1

Events


Player - Player 1 (Red) Selects a unit


Player - Player 2 (Blue) Selects a unit


Player - Player 3 (Teal) Selects a unit


Player - Player 4 (Purple) Selects a unit


Player - Player 5 (Yellow) Selects a unit


Player - Player 6 (Orange) Selects a unit


Player - Player 7 (Green) Selects a unit


Player - Player 8 (Pink) Selects a unit


Player - Player 9 (Gray) Selects a unit


Player - Player 10 (Light Blue) Selects a unit

Conditions


QUEST_MAIN[1] Equal to False


(Triggering unit) Equal to Villager (Male 2) 0000 <gen>

Actions


-------- Because we have activated the quest, we also activate this trigger. This is to make sure the player can't repeat the same trigger twice. --------


Set QUEST_MAIN[1] = True


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


-------- This is what will be written in the multiboard as a quest (YOU MAY MODIFY SO IT FITS YOUR QUESTS) --------


Set QUESTS_COL_1[QUEST_CURRENT_SPOT] = |cffff0000Quest 1|r


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


-------- Hides the first exclamation mark. Notice I didn't remove, in ase we may neeed it later on for further quests, --------


Unit - Hide Quest_Array[1]


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


-------- We add a quest, so we also add one t the Quest Total, this will also add a row in our multiboard. --------


Set QUEST_TOTAL = (QUEST_TOTAL + 1)


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


-------- We "update" the multiboard by setting the number of rows to 1 + QUEST TOTALS --------


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


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


-------- We renew the row width so the new row also takes part of this. --------


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


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



Loop - Actions




Multiboard - Set the display style for QUEST_MULTIBOARD item in column 1, row 1 to Show text and Hide icons




Multiboard - Set the display style for QUEST_MULTIBOARD item in column 2, row 1 to Show text and Hide icons




Multiboard - Set the display style for QUEST_MULTIBOARD item in column 1, row current_row to Show text and Hide icons




Multiboard - Set the display style for QUEST_MULTIBOARD item in column 2, row current_row to Show text and Hide icons




Multiboard - Set the width for QUEST_MULTIBOARD item in column 1, row current_row to 20.00% of the total screen width




Multiboard - Set the width for QUEST_MULTIBOARD item in column 2, row current_row to 5.00% of the total screen width




Multiboard - Set the text for QUEST_MULTIBOARD item in column 1, row 1 to |cffffcc00Current Q...


-------- We are setting the text in the new spot --------


Multiboard - Set the text for QUEST_MULTIBOARD item in column 1, row QUEST_CURRENT_SPOT to QUESTS_COL_1[QUEST_CURRENT_SPOT]


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


-------- QUEST_CURRENT_SPOT is the current row where we will modify our text. --------


-------- QUEST_NUMBER[*number*] is once again reffered as the Quest number (Each quest hasa number) and this quest is set on the Current Spot (row) --------


Set QUEST_NUMBER[1] = QUEST_CURRENT_SPOT


-------- We add 1 to Quest Current Spot so that the next quest doesn't interfere with this row. --------


Set QUEST_CURRENT_SPOT = (QUEST_CURRENT_SPOT + 1)
Collect an item complete

Events


Player - Player 1 (Red) Selects a unit


Player - Player 2 (Blue) Selects a unit


Player - Player 3 (Teal) Selects a unit


Player - Player 4 (Purple) Selects a unit


Player - Player 5 (Yellow) Selects a unit


Player - Player 6 (Orange) Selects a unit


Player - Player 7 (Green) Selects a unit


Player - Player 8 (Pink) Selects a unit


Player - Player 9 (Gray) Selects a unit


Player - Player 10 (Light Blue) Selects a unit

Conditions


QUEST_MAIN_COMPLETE[2] Equal to False


QUEST_DONE[2] Equal to True


(Triggering unit) Equal to Villager (Male) 0001 <gen>

Actions


-------- 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)



Loop - Actions




Multiboard - Set the display style for QUEST_MULTIBOARD item in column 1, row 1 to Show text and Hide icons




Multiboard - Set the display style for QUEST_MULTIBOARD item in column 2, row 1 to Show text and Hide icons




Multiboard - Set the display style for QUEST_MULTIBOARD item in column 1, row current_row to Show text and Hide icons




Multiboard - Set the display style for QUEST_MULTIBOARD item in column 2, row current_row to Show text and Hide icons




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




-------- Moving each quest up one row so the current quest disappears --------




Multiboard - Set the text for QUEST_MULTIBOARD item in column 1, row QUEST_SPOT_CHANGE to QUESTS_COL_1[(QUEST_SPOT_CHANGE + 1)]




Multiboard - Set the text for QUEST_MULTIBOARD item in column 2, row QUEST_SPOT_CHANGE to QUESTS_COL_2[(QUEST_SPOT_CHANGE + 1)]




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




-------- Because we are in a loop, we have to do this for every quest on that were on top of the quest we are trying to get rid of. --------




Set QUEST_SPOT_CHANGE = (QUEST_SPOT_CHANGE + 1)


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


-------- 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)
Quest 2 item drops

Events


Unit - A unit Dies

Conditions


(Unit-type of (Triggering unit)) Equal to Gnoll

Actions


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


-------- Notice the QUEST_DONE[*number*] trigger, This is to make sure the Quest isn't done in a way that we didn't meet every requirement for the quest. --------


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



If - Conditions




QUEST_MAIN[2] Equal to True




QUEST_DONE[2] Equal to False



Then - Actions




Item - Create Quest 2 item at (Position of (Triggering unit))




Item - Make (Last created item) Invulnerable



Else - Actions
Pickup quest item 2

Events


Unit - A unit Acquires an item

Conditions


(Item-type of (Item being manipulated)) Equal to Quest 2 item

Actions


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


-------- Destroys the item you just picked up --------


Hero - Drop (Item being manipulated) from (Triggering unit)


Item - Remove (Last dropped item)


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


-------- This first if is to make sure the multiboard doesn't pass 0 --------


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



If - Conditions




QUEST2_COLLECTED Greater than or equal to 1



Then - Actions




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




-------- We set to how many we need. (A sort of countdown) --------




Set QUEST2_COLLECTED = (QUEST2_COLLECTED - 1)




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




-------- We update the string (The number on the multiboard) --------




Set QUESTS_COL_2[QUEST_NUMBER[2]] = (String(QUEST2_COLLECTED))




Multiboard - Set the text for QUEST_MULTIBOARD item in column 2, row QUEST_NUMBER[2] to QUESTS_COL_2[QUEST_NUMBER[2]]



Else - Actions


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


-------- This second one is if we have enough quest items, the quest is now done, as we met all requirements. --------


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



If - Conditions




QUEST2_COLLECTED Equal to 0



Then - Actions




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




-------- QUEST_DONE[*number*]? Where have we seen that...Ah, in the Item drop trigger. --------




Set QUEST_DONE[2] = True




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




-------- Updating the text to say that the quest is now complete. YOU MAY MODIFY. --------




Set QUESTS_COL_1[QUEST_NUMBER[2]] = |cff32cd32Quest 2 complete|r




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




-------- Showing the text --------




Multiboard - Set the text for QUEST_MULTIBOARD item in column 1, row QUEST_NUMBER[2] to QUESTS_COL_1[QUEST_NUMBER[2]]




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




-------- Unhiding the Exclamation point --------




Unit - Unhide Quest_Array[2]



Else - Actions