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

merge: merging prs #2443

Closed
wants to merge 16 commits into from
Closed
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
1 change: 0 additions & 1 deletion data-canary/lib/core/storages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ Storage = {
},
},

DelayLargeSeaShell = 30002,
Imbuement = 30004,
}

Expand Down
28 changes: 0 additions & 28 deletions data-canary/scripts/actions/other/large_sea_shell.lua

This file was deleted.

1 change: 0 additions & 1 deletion data-otservbr-global/lib/others/load.lua
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
dofile(DATA_DIRECTORY .. "/lib/others/dawnport.lua")
dofile(DATA_DIRECTORY .. "/lib/others/vip_system.lua")
67 changes: 0 additions & 67 deletions data-otservbr-global/lib/others/vip_system.lua

This file was deleted.

20 changes: 0 additions & 20 deletions data-otservbr-global/scripts/actions/other/sweet_heart.lua

This file was deleted.

1 change: 1 addition & 0 deletions data/libs/systems/load.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ dofile(CORE_DIRECTORY .. "/libs/systems/hazard.lua")
dofile(CORE_DIRECTORY .. "/libs/systems/hireling.lua")
dofile(CORE_DIRECTORY .. "/libs/systems/raids.lua")
dofile(CORE_DIRECTORY .. "/libs/systems/reward_boss.lua")
dofile(CORE_DIRECTORY .. "/libs/systems/vip.lua")
dofile(CORE_DIRECTORY .. "/libs/systems/zones.lua")
62 changes: 62 additions & 0 deletions data/libs/systems/vip.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
-- Bonus mount and outfits
local outfits = {}
local mounts = {}

function Player.onRemoveVip(self)
self:sendTextMessage(MESSAGE_ADMINISTRATOR, "Your VIP days ran out.")

for _, outfit in ipairs(outfits) do
self:removeOutfit(outfit)
end

for _, mount in ipairs(mounts) do
self:removeMount(mount)
end

local playerOutfit = self:getOutfit()
if table.contains(outfits, self:getOutfit().lookType) then
if self:getSex() == PLAYERSEX_FEMALE then
playerOutfit.lookType = 136
else
playerOutfit.lookType = 128
end

playerOutfit.lookAddons = 0
self:setOutfit(playerOutfit)
end

self:kv():scoped("account"):remove("vip-system")
end

function Player.onAddVip(self, days, silent)
if not silent then
self:sendTextMessage(MESSAGE_ADMINISTRATOR, "You have received " .. days .. " VIP days.")
end

for _, outfit in ipairs(outfits) do
self:addOutfitAddon(outfit, 3)
end

for _, mount in ipairs(mounts) do
self:addMount(mount)
end

self:kv():scoped("account"):set("vip-system", true)
end

function CheckPremiumAndPrint(player, msgType)
local msg

if player:getVipDays() == 0xFFFF then
msg = "You have infinite amount of VIP days left."
else
local playerVipTime = player:getVipTime()
if playerVipTime < os.time() then
msg = "You do not have VIP on your account."
else
msg = "You have " .. getFormattedTimeRemaining(playerVipTime) .. " of VIP time left."
end
end

player:sendTextMessage(MESSAGE_ADMINISTRATOR, msg)
end
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ local sweetheartRing = Action()
function sweetheartRing.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if item == player:getSlotItem(CONST_SLOT_RING) then
player:getPosition():sendMagicEffect(CONST_ME_HEARTS)
return true
end
return false

return true
end

sweetheartRing:id(21955)
Expand Down
30 changes: 30 additions & 0 deletions data/scripts/actions/objects/large_seashell.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
local largeSeashell = Action()

function largeSeashell.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:hasExhaustion("delay-large-seashell") then
player:say("You have already opened a shell today.", TALKTYPE_MONSTER_SAY, false, player, item:getPosition())
return true
end

local chance = math.random(100)
local message = "Nothing is inside."

if chance <= 16 then
doTargetCombatHealth(0, player, COMBAT_PHYSICALDAMAGE, -200, -200, CONST_ME_NONE)
message = "Ouch! You squeezed your fingers."
elseif chance > 16 and chance <= 64 then
Game.createItem(math.random(281, 282), 1, player:getPosition())
message = "You found a beautiful pearl."
player:addAchievementProgress("Shell Seeker", 100)
end

player:setExhaustion("delay-large-seashell", 20 * 60 * 60)
player:say(message, TALKTYPE_MONSTER_SAY, false, player, item:getPosition())
item:transform(198)
item:decay()
item:getPosition():sendMagicEffect(CONST_ME_BUBBLES)
return true
end

largeSeashell:id(197)
largeSeashell:register()
Loading