From 6112b720af3b433bd4b9df055d61de30ce48ca59 Mon Sep 17 00:00:00 2001 From: Evil Puncker Date: Fri, 17 Dec 2021 00:01:25 -0300 Subject: [PATCH 1/2] Small update to channel requirements --- data/chatchannels/scripts/advertising-rook.lua | 11 ++++++----- data/chatchannels/scripts/advertising.lua | 10 ++++++++-- data/chatchannels/scripts/englishchat.lua | 6 +++--- data/chatchannels/scripts/help.lua | 6 ------ data/chatchannels/scripts/worldchat.lua | 6 +++--- 5 files changed, 20 insertions(+), 19 deletions(-) diff --git a/data/chatchannels/scripts/advertising-rook.lua b/data/chatchannels/scripts/advertising-rook.lua index e652a2423d..af1257f728 100644 --- a/data/chatchannels/scripts/advertising-rook.lua +++ b/data/chatchannels/scripts/advertising-rook.lua @@ -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 @@ -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 diff --git a/data/chatchannels/scripts/advertising.lua b/data/chatchannels/scripts/advertising.lua index 0998faa203..c53396cbce 100644 --- a/data/chatchannels/scripts/advertising.lua +++ b/data/chatchannels/scripts/advertising.lua @@ -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 or 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 @@ -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 diff --git a/data/chatchannels/scripts/englishchat.lua b/data/chatchannels/scripts/englishchat.lua index 42517d2a59..8142c2202c 100644 --- a/data/chatchannels/scripts/englishchat.lua +++ b/data/chatchannels/scripts/englishchat.lua @@ -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 or 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 diff --git a/data/chatchannels/scripts/help.lua b/data/chatchannels/scripts/help.lua index 8e13a7844b..31a90d2fd7 100644 --- a/data/chatchannels/scripts/help.lua +++ b/data/chatchannels/scripts/help.lua @@ -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 diff --git a/data/chatchannels/scripts/worldchat.lua b/data/chatchannels/scripts/worldchat.lua index 42517d2a59..8142c2202c 100644 --- a/data/chatchannels/scripts/worldchat.lua +++ b/data/chatchannels/scripts/worldchat.lua @@ -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 or 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 From 66459a864196da18c664b3eea7296d3e70380031 Mon Sep 17 00:00:00 2001 From: Evil Puncker Date: Tue, 21 Dec 2021 14:54:43 -0300 Subject: [PATCH 2/2] or -> and --- data/chatchannels/scripts/advertising.lua | 2 +- data/chatchannels/scripts/englishchat.lua | 2 +- data/chatchannels/scripts/worldchat.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/chatchannels/scripts/advertising.lua b/data/chatchannels/scripts/advertising.lua index c53396cbce..1de484e2dc 100644 --- a/data/chatchannels/scripts/advertising.lua +++ b/data/chatchannels/scripts/advertising.lua @@ -16,7 +16,7 @@ function onSpeak(player, type, message) return true end - if player:getLevel() < 20 or not player:isPremium() then + 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 diff --git a/data/chatchannels/scripts/englishchat.lua b/data/chatchannels/scripts/englishchat.lua index 8142c2202c..7bedb4665e 100644 --- a/data/chatchannels/scripts/englishchat.lua +++ b/data/chatchannels/scripts/englishchat.lua @@ -1,5 +1,5 @@ function onSpeak(player, type, message) - if player:getLevel() < 20 or not player:isPremium() then + 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 diff --git a/data/chatchannels/scripts/worldchat.lua b/data/chatchannels/scripts/worldchat.lua index 8142c2202c..7bedb4665e 100644 --- a/data/chatchannels/scripts/worldchat.lua +++ b/data/chatchannels/scripts/worldchat.lua @@ -1,5 +1,5 @@ function onSpeak(player, type, message) - if player:getLevel() < 20 or not player:isPremium() then + 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