Moderator
M
Moderator
20 Dec 2011
Bribe: Looks solid now of course. Approved with 3/5 status (can be useful).
Bribe: Looks solid now of course. Approved with 3/5 status (can be useful).
TS Initialization

Events


Map initialization

Conditions

Actions


-------- Did you want the message to show to enemy? True if you want to. --------


Set TS_EnemyCheck = True


-------- How many player will be using this system? --------


Set TS_PlayerCount = 10


-------- Here you set the prefix word to be used. --------


-------- Don't set anything with the array [0], it will not work. --------


Set TS_String_Prefix[1] = /w


Set TS_String_Prefix[2] = /s


Set TS_String_Prefix[3] = /y


-------- Here you intialize the words added after player's name, when he's talking. --------


Set TS_String_Show[1] = whispers:


Set TS_String_Show[2] = says:


Set TS_String_Show[3] = shouted:


-------- Here you set the maximum prefixes number that are used. --------


Set TS_PrefixCount = 3


-------- The message will only show to players which have their unit within the range. --------


-------- The array is corresponding to the arrays you declared above, --------


-------- Thus TS_CheckingRange[1] is the TS_String[1]'s range check and so on. --------


-------- Don't set anything with the array [0], it will not work. --------


Set TS_CheckRange[1] = 200.00


Set TS_CheckRange[2] = 550.00


Set TS_CheckRange[3] = 1350.00


-------- Here you set color codes for each player. --------


-------- Hits: If you already have initialized some color code, you can set these strings to those color code. --------


Set TS_ColorString[1] = |CFFFF0303


Set TS_ColorString[2] = |CFF0042FF


Set TS_ColorString[3] = |CFF1CE6B9


Set TS_ColorString[4] = |CFF540081


Set TS_ColorString[5] = |CFFFFFF01


Set TS_ColorString[6] = |CFFFE8A0E


Set TS_ColorString[7] = |CFF20C000


Set TS_ColorString[8] = |CFFE55BB0"


Set TS_ColorString[9] = |CFF959697


Set TS_ColorString[10] = |CFF7EBFF1


Set TS_ColorString[11] = |CFF106246


Set TS_ColorString[12] = |CFF4E2A04


-------- Here we adds the events to allows players to use this system. --------


For each (Integer TS_Integer) from 1 to TS_PlayerCount, do (Actions)



Loop - Actions




Trigger - Add to TS Run Trigger <gen> the event (Player - (Player(TS_Integer)) types a chat message containing as A substring)
TS Run Trigger

Events

Conditions

Actions


Set TempString = (Entered chat string)


For each (Integer A) from 0 to (TS_PrefixCount - 1), do (Actions)



Loop - Actions




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





If - Conditions






(Substring(TempString, 1, 2)) Equal to TS_String_Prefix[(Integer A)]





Then - Actions






-------- The custom script below gets the first unit selected by the triggering player --------






Custom script: call GroupEnumUnitsSelected(bj_lastCreatedGroup, GetTriggerPlayer(), null)






Custom script: set udg_TempUnit = FirstOfGroup(bj_lastCreatedGroup)






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







If - Conditions








TempUnit Not equal to No unit







Then - Actions








-------- The string below is displayed to all valid players with units in range --------








Set TempString = ((TS_ColorString[(Player number of (Triggering player))] + ((Name of (Triggering player)) + ( |r + TS_String_Show[(Integer A)]))) + (Substring(TempString, 3, (Length of TempString))))








-------- The next variable filters out players who have already been shown the message --------








Set TS_Shown = False








Set TempLoc = (Position of TempUnit)








Custom script: set bj_wantDestroyGroup = true








Unit Group - Pick every unit in (Units within TS_CheckRange[(Integer A)] of TempLoc) and do (Actions)









Loop - Actions










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











If - Conditions












Or - Any (Conditions) are true













Conditions














TS_AllowEnemies Equal to True














((Picked unit) belongs to an ally of (Triggering player)) Equal to True












TS_Shown Not equal to True











Then - Actions












Set TempPlayer = (Owner of (Picked unit))












-------- Mark that the message has already been shown to this player --------












-------- This avoids multiple messages --------












Custom script: if GetLocalPlayer() == udg_TempPlayer then












Set TS_Shown = True












Custom script: endif












-------- The script below avoids needing to create a "temp force" --------












-------- This is because Blizzard didn't give GUI a "show to player" command --------












Custom script: call DisplayTextToPlayer(udg_TempPlayer, 0, 0, udg_TempString)











Else - Actions








Custom script: call RemoveLocation(udg_TempLoc)








Cinematic - Flash a speech indicator for TempUnit of color (100.00%, 100.00%, 100.00%) with 0.00% transparency







Else - Actions






Custom script: exitwhen true





Else - Actions