1function onSpeak(player, type, message)
2 local playerAccountType = player:getAccountType()
3 if player:getLevel() == 1 and playerAccountType < ACCOUNT_TYPE_GAMEMASTER then
4 player:sendCancelMessage("You may not speak into channels as long as you are on level 1.")
5 return false
6 end
7
8 if type == TALKTYPE_CHANNEL_Y then
9 if playerAccountType >= ACCOUNT_TYPE_GAMEMASTER then
10 type = TALKTYPE_CHANNEL_O
11 end
12 elseif type == TALKTYPE_CHANNEL_O then
13 if playerAccountType < ACCOUNT_TYPE_GAMEMASTER then
14 type = TALKTYPE_CHANNEL_Y
15 end
16 elseif type == TALKTYPE_CHANNEL_R1 then
17 if playerAccountType < ACCOUNT_TYPE_GAMEMASTER and not player:hasFlag(PlayerFlag_CanTalkRedChannel) then
18 type = TALKTYPE_CHANNEL_Y
19 end
20 end
21 return type
22end
23