Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.41 KB | None | 0 0
  1. -- Colour and Format Messages
  2. local function BuildMessage(sourceGUID, sourceName, destGUID, destName )
  3.     local playerFaction, _ = UnitFactionGroup( "player" );
  4.     local killerString, killedString;
  5.     local killerFaction, killedFaction
  6.  
  7.     --Build Killer Info
  8.     killerFaction, _ = UnitFactionGroup( sourceName );
  9.     if( killerFaction == playerFaction ) then -- Killer on our Faction
  10.         if( playerFaction == "Horde" ) then
  11.             killerString = format("|cffFE2E2E%s|r", sourceName ); -- Print Red
  12.         else
  13.             killerString = format("|cff2E9AFE%s|r", sourceName ); -- Print Blue
  14.         end
  15.     else -- Killer opposite Faction
  16.         if( playerFaction == "Horde" ) then
  17.             killerString = format("|cff2E9AFE%s|r", sourceName ); -- Print Blue
  18.         else
  19.             killerString = format("|cffFE2E2E%s|r", sourceName ); -- Print Red
  20.         end
  21.     end
  22.  
  23.     killedFaction, _ = UnitFactionGroup( destName );
  24.     if( killedFaction == playerFaction ) then -- Killed Player on our Faction
  25.         if( playerFaction == "Horde" ) then
  26.             killedString = format("|cffFE2E2E%s|r", destName ); -- Print Red
  27.         else
  28.             killedString = format("|cff2E9AFE%s|r", destName ); -- Print Blue
  29.         end
  30.     else -- Killed Player opposite Faction
  31.         if( playerFaction == "Horde" ) then
  32.             killedString = format("|cff2E9AFE%s|r", destName ); -- Print Blue
  33.         else
  34.             killedString = format("|cffFE2E2E%s|r", destName ); -- Print Red
  35.         end
  36.     end
  37.  
  38.     return format("%s killed %s", killerString, killedString);
  39. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement