[COLOR="#808080"]
-- simple world chat WITHOUT the '#chat' command...WTF you say?
-- just turn it on and chat away.
-- when your done you just turn it off.
-- names are clickable for whispers and sub menu.
local on = "#chat on";
local off = "#chat off";
local WC_commands = "#help world chat"; -- "/help" won't work. it gets parsed prior to Eluna chat hook.
local Wchat = {};
local Team = {
[0] = "[|TInterface\\icons\\Inv_Misc_Tournaments_banner_Human.png:13|t]",
[1] = "[|TInterface\\icons\\Inv_Misc_Tournaments_banner_Orc.png:13|t]"
};
local Class = {
[1] = "[|TInterface\\icons\\INV_Sword_27.png:13|t]",
[2] = "[|TInterface\\icons\\INV_Hammer_01.png:13|t]",
[3] = "[|TInterface\\icons\\INV_Weapon_Bow_07.png:13|t]",
[4] = "[|TInterface\\icons\\INV_ThrowingKnife_04.png:13|t]",
[5] = "[|TInterface\\icons\\INV_Staff_30.png:13|t",
[6] = "[|TInterface\\icons\\Spell_Deathknight_ClassIcon.png:13|t]",
[7] = "[|TInterface\\icons\\inv_jewelry_talisman_04.png:13|t]",
[8] = "[|TInterface\\icons\\INV_Staff_30.png:13|t]",
[9] = "[|TInterface\\icons\\INV_Staff_30.png:13|t]",
[11] = "[|TInterface\\icons\\Ability_Druid_Maul.png:13|t]",
};
local Gmrank = {
[0] = "|cff00ffff[Player]|r",
[1] = "[|TINTERFACE/CHATFRAME/UI-CHATICON-BLIZZ:13:13:0:-1|t]|cffff0000[GM1]|r",
[2] = "|TINTERFACE/CHATFRAME/UI-CHATICON-BLIZZ:13:13:0:-1|t|cffff0000[GM2]|r",
[3] = "|TINTERFACE/CHATFRAME/UI-CHATICON-BLIZZ:13:13:0:-1|t|cffff0000[GM3]|r",
[4] = "[|TINTERFACE/CHATFRAME/UI-CHATICON-BLIZZ:13:13:0:-1|t][|cff999999ADMIN|r]",
};
function ChatSystem(event, player, msg, type, lang, channel)
local acctid = player:GetAccountId();
if(msg ~= "")then
if(msg ~= "Away")then
if(msg == off)then
Wchat[acctid].chat = 0;
player:SendBroadcastMessage("|cff3399ffWorld chat off.|r")
return false;
end
if(msg == on)then
Wchat[acctid].chat = 1;
player:SendBroadcastMessage("|cff3399ffWorld chat on.|r")
return false;
end
if(Wchat[acctid].chat == 1)and(msg ~= WC_commands)then -- 0 = world chat off :: 1 = world chat on
local t = table.concat{Team[player:GetTeam()], Class[player:GetClass()], Gmrank[player:GetGMRank()], "[|cff3399ff","|Hplayer:", player:GetName(), "|h", player:GetName(), "|h", "|r]:|cff00cc00", msg};
SendWorldMessage(t)
return false;
end
else
end
else
end
end
RegisterPlayerEvent(18, ChatSystem)
function VIP_Wchat_comm(event, player, message, type, language)
if(event == 3)or(message:lower() == WC_commands)then
player:SendBroadcastMessage("|cff00cc00World Chat System:|r")
player:SendBroadcastMessage("-->/say "..on.."|cff00cc00 to turn on the world chat.|r")
player:SendBroadcastMessage("-->|cff00cc00Then just chat away on `/say` channel.|r")
player:SendBroadcastMessage("-->/say "..off.."|cff00cc00 to turn off the world chat.|r")
player:SendBroadcastMessage("-->/say "..WC_commands.."|cff00cc00 for this list of commands.|r")
end
return;
end
RegisterPlayerEvent(3, VIP_Wchat_comm)
RegisterPlayerEvent(18, VIP_Wchat_comm)
local function SetChat(event, player)
local acctid = player:GetAccountId();
Wchat[acctid] = {
chat = 0,
};
end
RegisterPlayerEvent(3, SetChat)
print("Grumbo'z World Chat loaded.")
[/COLOR]