Skip to content

Commit

Permalink
feat: cupcakes
Browse files Browse the repository at this point in the history
  • Loading branch information
omarcopires committed Apr 12, 2024
1 parent 167bae5 commit 3c34a3b
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 54 deletions.
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()

0 comments on commit 3c34a3b

Please sign in to comment.