Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small update to channel requirements #3859

Merged
merged 2 commits into from
Jan 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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