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

feat: cupcakes #2537

Merged
merged 1 commit into from
Apr 17, 2024
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
3 changes: 0 additions & 3 deletions data-otservbr-global/lib/core/storages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ Storage = {
-- unused ExerciseDummyExhaust = 30029,
SamsOldBackpack = 30030,
SamsOldBackpackDoor = 30031,
StrawberryCupcake = 30032,
ChayenneReward = 30033,
SwampDiggingTimeout = 30034,
HydraEggQuest = 30035,
Expand All @@ -125,8 +124,6 @@ Storage = {
Navigator = 30048,
DwarvenLegs = 30049,
PrinceDrazzakTime = 30050,
LemonCupcake = 30052,
BlueberryCupcake = 30053,
-- Reserved in Global.Storage.FamiliarSummonEvent10 = 30054
-- Reserved in Global.Storage.FamiliarSummonEvent60 = 30055
ChayenneKeyTime = 30056,
Expand Down
51 changes: 0 additions & 51 deletions data-otservbr-global/scripts/actions/other/cup_cakes.lua

This file was deleted.

18 changes: 18 additions & 0 deletions data/scripts/actions/items/blueberry_cupcake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
local blueberryCupcake = Action()

function blueberryCupcake.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:hasExhaustion("blueberry-cupcake-cooldown") then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.")
return true
end

player:addMana(player:getMaxMana())
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your mana has been refilled.")
player:say("Mmmm.", TALKTYPE_MONSTER_SAY)
player:setExhaustion("blueberry-cupcake-cooldown", 10 * 60)
item:remove(1)
return true
end

blueberryCupcake:id(28484)
blueberryCupcake:register()
24 changes: 24 additions & 0 deletions data/scripts/actions/items/lemon_cupcake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
local distanceCondition = Condition(CONDITION_ATTRIBUTES)
distanceCondition:setParameter(CONDITION_PARAM_BUFF_SPELL, 1)
distanceCondition:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000)
distanceCondition:setParameter(CONDITION_PARAM_SKILL_DISTANCE, 10)
distanceCondition:setParameter(CONDITION_PARAM_FORCEUPDATE, true)

local lemonCupcake = Action()

function lemonCupcake.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:hasExhaustion("lemon-cupcake-cooldown") then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.")
return true
end

player:addCondition(distanceCondition)
player:sendTextMessage(MESSAGE_FAILURE, "You feel more focused.")
player:say("Mmmm.", TALKTYPE_MONSTER_SAY)
player:setExhaustion("lemon-cupcake-cooldown", 10 * 60)
item:remove(1)
return true
end

lemonCupcake:id(28486)
lemonCupcake:register()
18 changes: 18 additions & 0 deletions data/scripts/actions/items/strawberry_cupcake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
local strawberryCupcake = Action()

function strawberryCupcake.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:hasExhaustion("strawberry-cupcake-cooldown") then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.")
return true
end

player:addHealth(player:getMaxHealth())
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your health has been refilled.")
player:say("Mmmm.", TALKTYPE_MONSTER_SAY)
player:setExhaustion("strawberry-cupcake-cooldown", 10 * 60)
item:remove(1)
return true
end

strawberryCupcake:id(28485)
strawberryCupcake:register()
Loading