Skip to content

Commit

Permalink
Small update to channel requirements (#3859)
Browse files Browse the repository at this point in the history
  • Loading branch information
Evil Puncker authored Jan 24, 2022
1 parent 93da4ee commit f7db9bc
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 19 deletions.
11 changes: 6 additions & 5 deletions data/chatchannels/scripts/advertising-rook.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ function onSpeak(player, type, message)
return true
end

if player:getLevel() == 1 then
player:sendCancelMessage("You may not speak into channels as long as you are on level 1.")
return false
end

if player:getCondition(CONDITION_CHANNELMUTEDTICKS, CONDITIONID_DEFAULT, CHANNEL_ADVERTISING_ROOK) then
player:sendCancelMessage("You may only place one offer in two minutes.")
return false
Expand All @@ -38,3 +33,9 @@ function onSpeak(player, type, message)
end
return type
end

function onJoin(player)
sendChannelMessage(CHANNEL_ADVERTISING_ROOK, MESSAGE_GUILD, "Here you can advertise all kinds of things. Among others, you can trade items, advertise ingame events, seek characters for a quest or a hunting group, find members for your guild or look for somebody to help you with something.")
sendChannelMessage(CHANNEL_ADVERTISING_ROOK, MESSAGE_GUILD, "It goes without saying that all advertisements must conform to the Rules, e.g. it is illegal to advertise trades including real money.")
return true
end
10 changes: 8 additions & 2 deletions data/chatchannels/scripts/advertising.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ function onSpeak(player, type, message)
return true
end

if player:getLevel() == 1 then
player:sendCancelMessage("You may not speak into channels as long as you are on level 1.")
if player:getLevel() < 20 and not player:isPremium() then
player:sendCancelMessage("You may not speak in this channel unless you have reached level 20 or your account has premium status.")
return false
end

Expand All @@ -38,3 +38,9 @@ function onSpeak(player, type, message)
end
return type
end

function onJoin(player)
sendChannelMessage(CHANNEL_ADVERTISING, MESSAGE_GUILD, "Here you can advertise all kinds of things. Among others, you can trade items, advertise ingame events, seek characters for a quest or a hunting group, find members for your guild or look for somebody to help you with something.")
sendChannelMessage(CHANNEL_ADVERTISING, MESSAGE_GUILD, "It goes without saying that all advertisements must conform to the Rules, e.g. it is illegal to advertise trades including real money.")
return true
end
6 changes: 3 additions & 3 deletions data/chatchannels/scripts/englishchat.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
function onSpeak(player, type, message)
local playerAccountType = player:getAccountType()
if player:getLevel() == 1 and playerAccountType < ACCOUNT_TYPE_GAMEMASTER then
player:sendCancelMessage("You may not speak into channels as long as you are on level 1.")
if player:getLevel() < 20 and not player:isPremium() then
player:sendCancelMessage("You may not speak in this channel unless you have reached level 20 or your account has premium status.")
return false
end

local playerAccountType = player:getAccountType()
if type == TALKTYPE_CHANNEL_Y then
if playerAccountType >= ACCOUNT_TYPE_GAMEMASTER then
type = TALKTYPE_CHANNEL_O
Expand Down
6 changes: 0 additions & 6 deletions data/chatchannels/scripts/help.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ muted:setParameter(CONDITION_PARAM_SUBID, CHANNEL_HELP)
muted:setParameter(CONDITION_PARAM_TICKS, 3600000)

function onSpeak(player, type, message)
local playerAccountType = player:getAccountType()
if player:getLevel() == 1 and playerAccountType == ACCOUNT_TYPE_NORMAL then
player:sendCancelMessage("You may not speak into channels as long as you are on level 1.")
return false
end

if player:getCondition(CONDITION_CHANNELMUTEDTICKS, CONDITIONID_DEFAULT, CHANNEL_HELP) then
player:sendCancelMessage("You are muted from the Help channel for using it inappropriately.")
return false
Expand Down
6 changes: 3 additions & 3 deletions data/chatchannels/scripts/worldchat.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
function onSpeak(player, type, message)
local playerAccountType = player:getAccountType()
if player:getLevel() == 1 and playerAccountType < ACCOUNT_TYPE_GAMEMASTER then
player:sendCancelMessage("You may not speak into channels as long as you are on level 1.")
if player:getLevel() < 20 and not player:isPremium() then
player:sendCancelMessage("You may not speak in this channel unless you have reached level 20 or your account has premium status.")
return false
end

local playerAccountType = player:getAccountType()
if type == TALKTYPE_CHANNEL_Y then
if playerAccountType >= ACCOUNT_TYPE_GAMEMASTER then
type = TALKTYPE_CHANNEL_O
Expand Down

0 comments on commit f7db9bc

Please sign in to comment.