Skip to content

Commit

Permalink
resolve conversation
Browse files Browse the repository at this point in the history
  • Loading branch information
omarcopires committed Jun 4, 2024
1 parent 9a2bb14 commit ec12291
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
18 changes: 6 additions & 12 deletions data/libs/systems/vip.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
local config = {
activationMessage = "You have received %s VIP days.",
expirationMessage = "Your VIP days have expired.",
vipDaysInfiniteMessage = "You have an infinite amount of VIP days remaining.",
noVipStatusMessage = "You do not have VIP status on your account.",
vipTimeRemainingMessage = "You have %s of VIP time remaining.",

outfits = {},
mounts = {},
}

function Player.onRemoveVip(self)
self:sendTextMessage(MESSAGE_ADMINISTRATOR, config.expirationMessage)
self:sendTextMessage(MESSAGE_ADMINISTRATOR, "Your VIP status has expired. All VIP benefits have been removed.")

for _, outfit in ipairs(config.outfits) do
self:removeOutfit(outfit)
Expand All @@ -21,7 +15,7 @@ function Player.onRemoveVip(self)
end

local playerOutfit = self:getOutfit()
if table.contains(config.outfits, self:getOutfit().lookType) then
if table.contains(config.outfits, playerOutfit.lookType) then
if self:getSex() == PLAYERSEX_FEMALE then
playerOutfit.lookType = 136
else
Expand All @@ -37,7 +31,7 @@ end

function Player.onAddVip(self, days, silent)
if not silent then
self:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format(config.activationMessage, days))
self:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("You have been granted %s days of VIP status.", days))
end

for _, outfit in ipairs(config.outfits) do
Expand All @@ -53,15 +47,15 @@ end

function CheckPremiumAndPrint(player, msgType)
if player:getVipDays() == 0xFFFF then
player:sendTextMessage(msgType, config.vipDaysInfiniteMessage)
player:sendTextMessage(msgType, "You have an unlimited VIP status.")
return true
end

local playerVipTime = player:getVipTime()
if playerVipTime < os.time() then
player:sendTextMessage(msgType, config.noVipStatusMessage)
player:sendTextMessage(msgType, "Your VIP status is currently inactive.")
return true
end

player:sendTextMessage(msgType, string.format(config.vipTimeRemainingMessage, getFormattedTimeRemaining(playerVipTime)))
player:sendTextMessage(msgType, string.format("You have %s of VIP time remaining.", getFormattedTimeRemaining(playerVipTime)))
end
6 changes: 2 additions & 4 deletions data/scripts/creaturescripts/player/login.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ function playerLoginGlobal.onLogin(player)
end

-- Boosted
player:sendTextMessage(MESSAGE_BOOSTED_CREATURE, "Today's boosted creature: " .. Game.getBoostedCreature() .. " \
Boosted creatures yield more experience points, carry more loot than usual and respawn at a faster rate.")
player:sendTextMessage(MESSAGE_BOOSTED_CREATURE, "Today's boosted boss: " .. Game.getBoostedBoss() .. " \
Boosted bosses contain more loot and count more kills for your Bosstiary.")
player:sendTextMessage(MESSAGE_BOOSTED_CREATURE, string.format("Today's boosted creature: %s.\nBoosted creatures yield more experience points, carry more loot than usual, and respawn at a faster rate.", Game.getBoostedCreature()))
player:sendTextMessage(MESSAGE_BOOSTED_CREATURE, string.format("Today's boosted boss: %s.\nBoosted bosses contain more loot and count more kills for your Bosstiary.", Game.getBoostedBoss()))

-- Rewards
local rewards = #player:getRewardList()
Expand Down

0 comments on commit ec12291

Please sign in to comment.