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

refactor: jean pierre foods #2320

Merged
merged 6 commits into from
Feb 27, 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
224 changes: 0 additions & 224 deletions data-otservbr-global/scripts/actions/other/jean_pierre_food.lua

This file was deleted.

36 changes: 0 additions & 36 deletions data-otservbr-global/scripts/movements/others/drowning.lua

This file was deleted.

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

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

player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You don't really know what this did to you, but suddenly you feel very happy.")
player:say("Slurp.", TALKTYPE_MONSTER_SAY)
player:getPosition():sendMagicEffect(CONST_ME_HEARTS)
player:setExhaustion("special-foods-cooldown", 10 * 60)
item:remove(1)
return true
end

bananaChocolateShake:id(9083)
bananaChocolateShake:register()
19 changes: 19 additions & 0 deletions data/scripts/actions/items/blessed_steak.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
local blessedSteak = Action()

function blessedSteak.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:hasExhaustion("special-foods-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("Chomp.", TALKTYPE_MONSTER_SAY)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
player:setExhaustion("special-foods-cooldown", 10 * 60)
item:remove(1)
return true
end

blessedSteak:id(9086)
blessedSteak:register()
26 changes: 26 additions & 0 deletions data/scripts/actions/items/carrot_cake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
local distanceCondition = Condition(CONDITION_ATTRIBUTES)
distanceCondition:setParameter(CONDITION_PARAM_SUBID, JeanPierreDistance)
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 carrotCake = Action()

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

player:addCondition(distanceCondition)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You feel more focused.")
player:say("Mmmm.", TALKTYPE_MONSTER_SAY)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
player:setExhaustion("special-foods-cooldown", 10 * 60)
item:remove(1)
return true
end

carrotCake:id(9087)
carrotCake:register()
31 changes: 31 additions & 0 deletions data/scripts/actions/items/coconut_shrimp_bake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
local coconutShrimpBake = Action()

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

local headItem = player:getSlotItem(CONST_SLOT_HEAD)
if not headItem then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You should only eat this dish when wearing a helmet of the deep or a depth galea and walking underwater.")
return true
end

local acceptableHelmets = { 5460, 11585, 13995 }
if not table.contains(acceptableHelmets, headItem:getId()) then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You should only eat this dish when wearing a helmet of the deep or a depth galea and walking underwater.")
return true
end

player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your underwater walking speed while wearing a " .. headItem:getName() .. " has increased for twenty-four hours.")
player:say("Yum.", TALKTYPE_MONSTER_SAY)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
player:setExhaustion("special-foods-cooldown", 10 * 60)
player:setExhaustion("coconut-shrimp-bake", 24 * 60 * 60)
item:remove(1)
return true
end

coconutShrimpBake:id(11584)
coconutShrimpBake:register()
Loading
Loading