diff --git a/New Text Document.txt b/New Text Document.txt index 9ea74f3..363659e 100644 --- a/New Text Document.txt +++ b/New Text Document.txt @@ -1 +1 @@ -next: 17739 \ No newline at end of file +next: 17740 \ No newline at end of file diff --git a/data/creaturescripts/scripts/login.lua b/data/creaturescripts/scripts/login.lua index 7f1ba9a..47a4334 100644 --- a/data/creaturescripts/scripts/login.lua +++ b/data/creaturescripts/scripts/login.lua @@ -11,12 +11,15 @@ function onLogin(player) loginStr = string.format("Your last visit on " .. configManager.getString(configKeys.SERVER_NAME) .. ": %s.", os.date("%a %b %d %X %Y", player:getLastLoginSaved())) end - local dayNow = tonumber(os.date("%d", os.time())) - local hourNow = tonumber(os.date("%H", os.time())) - if dayNow == 8 and hourNow <= 20 then - if player:getPremiumDays() == 0 then + if not player:isPremium() then + local dayNow = tonumber(os.date("%d", os.time())) + local hourNow = tonumber(os.date("%H", os.time())) + if dayNow == 8 and hourNow == 20 then player:addPremiumDays(5) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Congratulations " .. player:getName() .. " on starting your adventure at the " .. configManager.getString(configKeys.SERVER_NAME) .. "! 5 premium days have been added to your account!") + elseif dayNow == 8 then + player:addPremiumDays(2) + player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Congratulations " .. player:getName() .. " on starting your adventure at the " .. configManager.getString(configKeys.SERVER_NAME) .. "! 2 premium days have been added to your account!") end end @@ -33,6 +36,8 @@ function onLogin(player) -- Premium system if player:isPremium() then player:setStorageValue(43434, 1) + elseif player:getStorageValue(43434) == 1 then + player:setStorageValue(43434, 0) end -- Events diff --git a/data/globalevents/scripts/startup.lua b/data/globalevents/scripts/startup.lua index b2cbff8..0d67f7e 100644 --- a/data/globalevents/scripts/startup.lua +++ b/data/globalevents/scripts/startup.lua @@ -196,6 +196,7 @@ function onStartup() end spawnRashid() + addEvent(function () Game.setGameState(GAME_STATE_CLOSED) end, 5000) setGlobalStorageValue(17657, 0) -- reset POI levers setGlobalStorageValue(8420, monsterOfTheDay[math.random(1, #monsterOfTheDay)].id) setGlobalStorageValue(8421, math.random(10, 25))