• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Help Me Devise a MPI Gold Request Trigger

Status
Not open for further replies.
Level 18
Joined
Mar 16, 2008
Messages
721
I know this would be possible but not really sure where to begin with the MUI. So there are 4 "king" players (give gold) and 12 "knight" players (request gold). Player would time -request [0000] and would check what player group he is in, check the amount of gold of that player group's king, pop up dynamic dialog window to that king to say yes or no.

I'm not asking for anyone to make the whole trigger but maybe just some tips.

I want this to be efficient and use arrays. I was thinking something like this below but worried that it's not MUI or might not work well with several requests coming in to the same team.

this is like a rough draft:

[draft trigger deleted]
 
Last edited:
Level 18
Joined
Mar 16, 2008
Messages
721
What do you think about this? Is there a way I can make better use of arrays to avoid making multiple triggers or if/then statements?

Set variables:
  • Set Vars Request Dialong Menu
    • Events
      • Time - Elapsed game time is 45.00 seconds
    • Conditions
    • Actions
      • Set VariableSet Request_Grant_String = |cff00ff00Grant|r
      • Set VariableSet Request_Deny_String = |cffff0000Deny|r
      • Set VariableSet Request_Player[5] = |cffffff00Yellow|r
      • Set VariableSet Request_Player[6] = |cffd45e19Orange|r
      • Set VariableSet Request_Player[7] = |cff20bf00Light Green|r
      • Set VariableSet Request_Player[8] = |cffe35bafPink|r
      • Set VariableSet Request_Player[9] = |cff949697Grey|r
      • Set VariableSet Request_Player[10] = |cff7ebff1Light Blue|r
      • Set VariableSet Request_Player[11] = |cff106247Dark Green|r
      • Set VariableSet Request_Player[12] = |cff4f2b05Brown|r
      • Set VariableSet Request_Player[17] = |cffeccc86Light Brown|r
      • Set VariableSet Request_Player[18] = |cfff7a48bPeach|r
      • Set VariableSet Request_Player[19] = |cffbfff80Lime|r
      • Set VariableSet Request_Player[20] = |cffdbb8ecLight Purple|r
      • Dialog - Create a dialog button for Request_Menu[5] labelled Request_Deny_String
      • Set VariableSet Request_Deny_Button[5] = (Last created dialog Button)
      • Dialog - Create a dialog button for Request_Menu[6] labelled Request_Deny_String
      • Set VariableSet Request_Deny_Button[6] = (Last created dialog Button)
      • Dialog - Create a dialog button for Request_Menu[7] labelled Request_Deny_String
      • Set VariableSet Request_Deny_Button[7] = (Last created dialog Button)
      • Dialog - Create a dialog button for Request_Menu[8] labelled Request_Deny_String
      • Set VariableSet Request_Deny_Button[8] = (Last created dialog Button)
      • Dialog - Create a dialog button for Request_Menu[9] labelled Request_Deny_String
      • Set VariableSet Request_Deny_Button[9] = (Last created dialog Button)
      • Dialog - Create a dialog button for Request_Menu[10] labelled Request_Deny_String
      • Set VariableSet Request_Deny_Button[10] = (Last created dialog Button)
      • Dialog - Create a dialog button for Request_Menu[11] labelled Request_Deny_String
      • Set VariableSet Request_Deny_Button[11] = (Last created dialog Button)
      • Dialog - Create a dialog button for Request_Menu[12] labelled Request_Deny_String
      • Set VariableSet Request_Deny_Button[12] = (Last created dialog Button)
      • Dialog - Create a dialog button for Request_Menu[17] labelled Request_Deny_String
      • Set VariableSet Request_Deny_Button[17] = (Last created dialog Button)
      • Dialog - Create a dialog button for Request_Menu[18] labelled Request_Deny_String
      • Set VariableSet Request_Deny_Button[18] = (Last created dialog Button)
      • Dialog - Create a dialog button for Request_Menu[19] labelled Request_Deny_String
      • Set VariableSet Request_Deny_Button[19] = (Last created dialog Button)
      • Dialog - Create a dialog button for Request_Menu[20] labelled Request_Deny_String
      • Set VariableSet Request_Deny_Button[20] = (Last created dialog Button)
      • Dialog - Create a dialog button for Request_Menu[5] labelled Request_Grant_String
      • Set VariableSet Request_Grant_Button[5] = (Last created dialog Button)
      • Dialog - Create a dialog button for Request_Menu[6] labelled Request_Grant_String
      • Set VariableSet Request_Grant_Button[6] = (Last created dialog Button)
      • Dialog - Create a dialog button for Request_Menu[7] labelled Request_Grant_String
      • Set VariableSet Request_Grant_Button[7] = (Last created dialog Button)
      • Dialog - Create a dialog button for Request_Menu[8] labelled Request_Grant_String
      • Set VariableSet Request_Grant_Button[8] = (Last created dialog Button)
      • Dialog - Create a dialog button for Request_Menu[9] labelled Request_Grant_String
      • Set VariableSet Request_Grant_Button[9] = (Last created dialog Button)
      • Dialog - Create a dialog button for Request_Menu[10] labelled Request_Grant_String
      • Set VariableSet Request_Grant_Button[10] = (Last created dialog Button)
      • Dialog - Create a dialog button for Request_Menu[11] labelled Request_Grant_String
      • Set VariableSet Request_Grant_Button[11] = (Last created dialog Button)
      • Dialog - Create a dialog button for Request_Menu[12] labelled Request_Grant_String
      • Set VariableSet Request_Grant_Button[12] = (Last created dialog Button)
      • Dialog - Create a dialog button for Request_Menu[17] labelled Request_Grant_String
      • Set VariableSet Request_Grant_Button[17] = (Last created dialog Button)
      • Dialog - Create a dialog button for Request_Menu[18] labelled Request_Grant_String
      • Set VariableSet Request_Grant_Button[18] = (Last created dialog Button)
      • Dialog - Create a dialog button for Request_Menu[19] labelled Request_Grant_String
      • Set VariableSet Request_Grant_Button[19] = (Last created dialog Button)
      • Dialog - Create a dialog button for Request_Menu[20] labelled Request_Grant_String
      • Set VariableSet Request_Grant_Button[20] = (Last created dialog Button)
      • Trigger - Turn on Knight Request Gold <gen>[/SPOILER]

Knight Requests Gold:
  • Knight Request Gold
    • Events
      • Player - Player 5 (Yellow) types a chat message containing -request as A substring
      • Player - Player 6 (Orange) types a chat message containing -request as A substring
      • Player - Player 7 (Green) types a chat message containing -request as A substring
      • Player - Player 8 (Pink) types a chat message containing -request as A substring
      • Player - Player 9 (Gray) types a chat message containing -request as A substring
      • Player - Player 10 (Light Blue) types a chat message containing -request as A substring
      • Player - Player 11 (Dark Green) types a chat message containing -request as A substring
      • Player - Player 12 (Brown) types a chat message containing -request as A substring
      • Player - Player 17 (Wheat) types a chat message containing -request as A substring
      • Player - Player 18 (Peach) types a chat message containing -request as A substring
      • Player - Player 19 (Mint) types a chat message containing -request as A substring
      • Player - Player 20 (Lavender) types a chat message containing -reqest as A substring
    • Conditions
      • (Substring((Entered chat string), 1, 8)) Equal to -request
      • (Integer((Substring((Entered chat string), 10, 15)))) Greater than 1
      • (Integer((Substring((Entered chat string), 10, 15)))) Less than 99999
      • Or - Any (Conditions) are true
        • Conditions
          • ((Triggering player) is in Group1Red.) Equal to True
          • ((Triggering player) is in Group2Blue.) Equal to True
          • ((Triggering player) is in Group3Teal.) Equal to True
          • ((Triggering player) is in Group4Purp.) Equal to True
    • Actions
      • Set VariableSet Request_Amount_String[(Player number of (Triggering player))] = (Substring((Entered chat string), 10, 15))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) is in Group1Red.) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Integer((Substring((Entered chat string), 10, 15)))) Less than or equal to (Player 1 (Red) Current gold)
            • Then - Actions
              • Dialog - Change the title of Request_Menu[(Player number of (Triggering player))] to (Request_Player[(Player number of (Triggering player))] + ( knight requests + Request_Amount_String[(Player number of (Triggering player))]))
              • Dialog - Show Request_Menu[(Player number of (Triggering player))] for Player 1 (Red)
              • Countdown Timer - Pause Request_Hide_Timer[(Player number of (Triggering player))]
              • Countdown Timer - Start Request_Hide_Timer[(Player number of (Triggering player))] as a One-shot timer that will expire in 10.00 seconds
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Integer((Substring((Entered chat string), 10, 15)))) Greater than (Player 1 (Red) Current gold)
            • Then - Actions
              • Quest - Display to (Player group((Triggering player))) the Quest Failed message: |cffffff00Error|r: ...
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) is in Group2Blue.) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Integer((Substring((Entered chat string), 10, 15)))) Less than or equal to (Player 2 (Blue) Current gold)
            • Then - Actions
              • Dialog - Change the title of Request_Menu[(Player number of (Triggering player))] to (Request_Player[(Player number of (Triggering player))] + ( knight requests + Request_Amount_String[(Player number of (Triggering player))]))
              • Dialog - Show Request_Menu[(Player number of (Triggering player))] for Player 2 (Blue)
              • Countdown Timer - Pause Request_Hide_Timer[(Player number of (Triggering player))]
              • Countdown Timer - Start Request_Hide_Timer[(Player number of (Triggering player))] as a One-shot timer that will expire in 10.00 seconds
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Integer((Substring((Entered chat string), 10, 15)))) Greater than (Player 2 (Blue) Current gold)
            • Then - Actions
              • Quest - Display to (Player group((Triggering player))) the Quest Failed message: |cffffff00Error|r: ...
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) is in Group3Teal.) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Integer((Substring((Entered chat string), 10, 15)))) Less than or equal to (Player 3 (Teal) Current gold)
            • Then - Actions
              • Dialog - Change the title of Request_Menu[(Player number of (Triggering player))] to (Request_Player[(Player number of (Triggering player))] + ( knight requests + Request_Amount_String[(Player number of (Triggering player))]))
              • Dialog - Show Request_Menu[(Player number of (Triggering player))] for Player 3 (Teal)
              • Countdown Timer - Pause Request_Hide_Timer[(Player number of (Triggering player))]
              • Countdown Timer - Start Request_Hide_Timer[(Player number of (Triggering player))] as a One-shot timer that will expire in 10.00 seconds
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Integer((Substring((Entered chat string), 10, 15)))) Greater than (Player 3 (Teal) Current gold)
            • Then - Actions
              • Quest - Display to (Player group((Triggering player))) the Quest Failed message: |cffffff00Error|r: ...
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering player) is in Group4Purp.) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Integer((Substring((Entered chat string), 10, 15)))) Less than or equal to (Player 4 (Purple) Current gold)
            • Then - Actions
              • Dialog - Change the title of Request_Menu[(Player number of (Triggering player))] to (Request_Player[(Player number of (Triggering player))] + ( knight requests + Request_Amount_String[(Player number of (Triggering player))]))
              • Dialog - Show Request_Menu[(Player number of (Triggering player))] for Player 4 (Purple)
              • Countdown Timer - Pause Request_Hide_Timer[(Player number of (Triggering player))]
              • Countdown Timer - Start Request_Hide_Timer[(Player number of (Triggering player))] as a One-shot timer that will expire in 10.00 seconds
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Integer((Substring((Entered chat string), 10, 15)))) Greater than (Player 4 (Purple) Current gold)
            • Then - Actions
              • Quest - Display to (Player group((Triggering player))) the Quest Failed message: |cffffff00Error|r: ...
              • DOES THIS ACTION LEAK??? ^
            • Else - Actions
        • Else - Actions

King grants or denies request. Is there a way to use arrays in a more efficient way for this one or do I need to make 12 different if/then statements?
  • Request Response King
    • Events
      • Dialog - A dialog button is clicked for Request_Menu[5]
      • Dialog - A dialog button is clicked for Request_Menu[6]
      • Dialog - A dialog button is clicked for Request_Menu[7]
      • Dialog - A dialog button is clicked for Request_Menu[8]
      • Dialog - A dialog button is clicked for Request_Menu[9]
      • Dialog - A dialog button is clicked for Request_Menu[10]
      • Dialog - A dialog button is clicked for Request_Menu[11]
      • Dialog - A dialog button is clicked for Request_Menu[12]
      • Dialog - A dialog button is clicked for Request_Menu[17]
      • Dialog - A dialog button is clicked for Request_Menu[18]
      • Dialog - A dialog button is clicked for Request_Menu[19]
      • Dialog - A dialog button is clicked for Request_Menu[20]
    • Conditions
    • Actions
      • -------- --- --------
      • -------- PLAYER 5 YELLOW --------
      • -------- --- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Request_Deny_Button[5]
        • Then - Actions
          • Quest - Display to Solo_Group_Yellow the Quest Update message: (The King has |cffff0000denied|r your request for + (Request_Amount_String[5] + gold.))
          • Countdown Timer - Pause Request_Hide_Timer[5]
          • Dialog - Hide Request_Menu[5] for (Triggering player)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Request_Grant_Button[5]
        • Then - Actions
          • Player - Set (Triggering player).Current gold to (((Triggering player) Current gold) - (Integer(Request_Amount_String[5])))
          • Player - Set Player 5 (Yellow).Current gold to ((Player 5 (Yellow) Current gold) + (Integer(Request_Amount_String[5])))
          • Quest - Display to Solo_Group_Yellow the Quest Update message: (The King has |cff00ff00granted|r your request for + (Request_Amount_String[5] + gold.))
          • Countdown Timer - Pause Request_Hide_Timer[5]
          • Dialog - Hide Request_Menu[5] for (Triggering player)
        • Else - Actions
      • -------- --- --------
      • -------- PLAYER 6 OJ --------
      • -------- --- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Request_Deny_Button[6]
        • Then - Actions
          • Quest - Display to Solo_Group_OJ the Quest Update message: (The King has |cffff0000denied|r your request for + (Request_Amount_String[6] + gold.))
          • Countdown Timer - Pause Request_Hide_Timer[6]
          • Dialog - Hide Request_Menu[6] for (Triggering player)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Request_Grant_Button[6]
        • Then - Actions
          • Player - Set (Triggering player).Current gold to (((Triggering player) Current gold) - (Integer(Request_Amount_String[6])))
          • Player - Set Player 6 (Orange).Current gold to ((Player 6 (Orange) Current gold) + (Integer(Request_Amount_String[6])))
          • Quest - Display to Solo_Group_Yellow the Quest Update message: (The King has |cff00ff00granted|r your request for + (Request_Amount_String[6] + gold.))
          • Countdown Timer - Pause Request_Hide_Timer[6]
          • Dialog - Hide Request_Menu[6] for (Triggering player)
        • Else - Actions
 
Last edited:
Level 18
Joined
Mar 16, 2008
Messages
721
So let's say player 1 clicks dialog button array [5].
Player one is the 'triggering player' but is there an easy way to reference play 5? Or do I need an if/then statement for players 5-20?
 
Status
Not open for further replies.
Top