#1
Chat trriggers help
ive been having headaches to discover how do you do this thing:like a triger that (example) when i write -gold X ill get X ammounnt of gold. how do i do that?
LoneSlayerI can help, but I don't rember off the top of my head. LEt me load up my map.
Bloody hell, WE isn't working...
I think it is something like "Event: player types a chat message -gold 100 as an exact match." Action: "Give triggering player 100 gold."
Please correct me if I am wrong.
Gold
Events
Player - Player 1 (Red) types a chat message containing -gold as A substring
Conditions
Actions
Player - Set [(Player number of (Triggering player))] gold to (Integer((Substring((Entered chat string), 7,12))))
give1
Events
Player - Player 1 (Red) types a chat message containing -give1 as A substring
Conditions
((Player((Player number of (Triggering player)))) Current gold) Greater than or equal to (Integer((Substring((Entered chat string), 8, 12))))
Actions
Player - Add (Integer((Substring((Entered chat string), 8, 12)))) to Player 1 (Red) Current gold
Player - Add (Integer((- + (Substring((Entered chat string), 8, 12))))) to Player 1 (Red) Current gold
Game - Display to (Player group((Player((Player number of (Triggering player)))))) the text: (you gave + ((Name of Player 1 (Red)) + ( + ((Substring((Entered chat string), 8, 12)) + Gold.))))
Resource giving system
Events
Player - Player 1 (Red) types a chat message containing -give ally as An exact match
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 2 (Blue) slot status) Equal to Is playing
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Triggering player) Current gold) Greater than or equal to (Integer((Substring((Entered chat string), 12, 17))))
Then - Actions
Player - Add (Integer((Substring((Entered chat string), 12, 17)))) to Player 2 (Blue) Current gold
Player - Set (Triggering player) Current gold to (((Triggering player) Current gold) - (Integer((Substring((Entered chat string), 12, 17)))))
Game - Display to Player 2 (Blue), at offset (0.00, 0.00) for 8.00 seconds the text: (|cffc5dbffYou recieved |cffffcc00 + ((String((Integer((Substring((Entered chat string), 12, 17)))))) + ( |cffc5dbffresources from + (PlayerColors[1] + (Name of Player 1 (Red))))))
Game - Display to Player 1 (Red), at offset (0.00, 0.00) for 8.00 seconds the text: (|cffc5dbffYou transferred |cffffcc00 + ((String((Integer((Substring((Entered chat string), 12, 17)))))) + ( |cffc5dbffresources to + (PlayerColors[2] + (Name of Player 2 (Blue))))))
Else - Actions
Else - Actions
Player - Player 1 (Red) types a chat message containing -give ally as A substringGame - Display to Player Group - Player 1 (Red) the text: ((|cffc5dbffYou received |cffffcc00 + ((Substring((Entered chat string), 12, 17)) + |cffc5dbff resources from )) + (PlayerColors[1] + (Name of Player 1 (Red)))MaldarianYou basically nailed it.. but for your player event you want it to be a substing not an exact match.Player - Player 1 (Red) types a chat message containing -give ally as A substring
also.. as for the message display. i'd try something like thisGame - Display to Player Group - Player 1 (Red) the text: ((|cffc5dbffYou received |cffffcc00 + ((Substring((Entered chat string), 12, 17)) + |cffc5dbff resources from )) + (PlayerColors[1] + (Name of Player 1 (Red)))
Resource giving system
Events
Player - Player 1 (Red) types a chat message containing -give ally as A substring
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Player 2 (Blue) slot status) Equal to Is playing
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Integer((Substring((Entered chat string), 12, 17)))) Greater than 0
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Triggering player) Current gold) Greater than or equal to (Integer((Substring((Entered chat string), 12, 17))))
Then - Actions
Player - Add (Integer((Substring((Entered chat string), 12, 17)))) to Player 2 (Blue) Current gold
Player - Set (Triggering player) Current gold to (((Triggering player) Current gold) - (Integer((Substring((Entered chat string), 12, 17)))))
Game - Display to Player 2 (Blue), at offset (0.00, 0.00) for 8.00 seconds the text: (|cffc5dbffYou recieved |cffffcc00 + ((String((Integer((Substring((Entered chat string), 12, 17)))))) + ( |cffc5dbffresources from + (PlayerColors[1] + (Name of Player 1 (Red))))))
Game - Display to Player 1 (Red), at offset (0.00, 0.00) for 8.00 seconds the text: (|cffc5dbffYou transferred |cffffcc00 + ((String((Integer((Substring((Entered chat string), 12, 17)))))) + ( |cffc5dbffresources to + (PlayerColors[2] + (Name of Player 2 (Blue))))))
Else - Actions
Advanced - For (Triggering player) display (Error: You do not have + ((String((Integer((Substring((Entered chat string), 12, 17)))))) + resources.)) as error message
Else - Actions
Advanced - For (Triggering player) display Error: Invalid value. as error message
Else - Actions
Advanced - For (Triggering player) display Error: Ally not ingame. as error message