From 6b59d3f58b248a2d6ef1c926056f967bc680d1f6 Mon Sep 17 00:00:00 2001 From: Marco Date: Mon, 26 Feb 2024 00:20:35 -0300 Subject: [PATCH 1/6] refactor: jean pierre foods --- .../actions/other/jean_pierre_food.lua | 224 ------------------ .../actions/items/banana_chocolate_shake.lua | 18 ++ data/scripts/actions/items/blessed_steak.lua | 19 ++ data/scripts/actions/items/carrot_cake.lua | 26 ++ .../actions/items/coconut_shrimp_bake.lua | 24 ++ .../actions/items/demonic_candy_ball.lua | 67 ++++++ .../actions/items/filled_jalapeno_peppers.lua | 23 ++ .../actions/items/hydra_tongue_salad.lua | 35 +++ .../actions/items/northern_fishburger.lua | 26 ++ .../actions/items/pot_of_blackjack.lua | 36 +++ data/scripts/actions/items/potions.lua | 6 +- .../actions/items/roasted_dragon_wings.lua | 26 ++ data/scripts/actions/items/rotworm_stew.lua | 19 ++ .../actions/items/sweet_mangonaise_elixir.lua | 53 +++++ .../items/tropical_fried_terrorbird.lua | 26 ++ .../actions/items/veggie_casserole.lua | 26 ++ 16 files changed, 427 insertions(+), 227 deletions(-) delete mode 100644 data-otservbr-global/scripts/actions/other/jean_pierre_food.lua create mode 100644 data/scripts/actions/items/banana_chocolate_shake.lua create mode 100644 data/scripts/actions/items/blessed_steak.lua create mode 100644 data/scripts/actions/items/carrot_cake.lua create mode 100644 data/scripts/actions/items/coconut_shrimp_bake.lua create mode 100644 data/scripts/actions/items/demonic_candy_ball.lua create mode 100644 data/scripts/actions/items/filled_jalapeno_peppers.lua create mode 100644 data/scripts/actions/items/hydra_tongue_salad.lua create mode 100644 data/scripts/actions/items/northern_fishburger.lua create mode 100644 data/scripts/actions/items/pot_of_blackjack.lua create mode 100644 data/scripts/actions/items/roasted_dragon_wings.lua create mode 100644 data/scripts/actions/items/rotworm_stew.lua create mode 100644 data/scripts/actions/items/sweet_mangonaise_elixir.lua create mode 100644 data/scripts/actions/items/tropical_fried_terrorbird.lua create mode 100644 data/scripts/actions/items/veggie_casserole.lua diff --git a/data-otservbr-global/scripts/actions/other/jean_pierre_food.lua b/data-otservbr-global/scripts/actions/other/jean_pierre_food.lua deleted file mode 100644 index 71627cfc61c..00000000000 --- a/data-otservbr-global/scripts/actions/other/jean_pierre_food.lua +++ /dev/null @@ -1,224 +0,0 @@ -local conditions = { - CONDITION_POISON, - CONDITION_FIRE, - CONDITION_ENERGY, - CONDITION_PARALYZE, - CONDITION_DRUNK, - CONDITION_DROWN, - CONDITION_FREEZING, - CONDITION_DAZZLED, - CONDITION_CURSED, - CONDITION_BLEEDING, -} -local condition_shield = Condition(CONDITION_ATTRIBUTES) -condition_shield:setParameter(CONDITION_PARAM_SUBID, AttrSubId_JeanPierreDefense) -condition_shield:setParameter(CONDITION_PARAM_BUFF_SPELL, 1) -condition_shield:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000) -condition_shield:setParameter(CONDITION_PARAM_SKILL_SHIELD, 10) -condition_shield:setParameter(CONDITION_PARAM_FORCEUPDATE, true) -local condition_ml = Condition(CONDITION_ATTRIBUTES) -condition_ml:setParameter(CONDITION_PARAM_SUBID, AttrSubId_JeanPierreMagic) -condition_ml:setParameter(CONDITION_PARAM_BUFF_SPELL, 1) -condition_ml:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000) -condition_ml:setParameter(CONDITION_PARAM_STAT_MAGICPOINTS, 5) -condition_ml:setParameter(CONDITION_PARAM_FORCEUPDATE, true) -local condition_melee = Condition(CONDITION_ATTRIBUTES) -condition_melee:setParameter(CONDITION_PARAM_SUBID, AttrSubId_JeanPierreMelee) -condition_melee:setParameter(CONDITION_PARAM_BUFF_SPELL, 1) -condition_melee:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000) -condition_melee:setParameter(CONDITION_PARAM_SKILL_MELEE, 10) -condition_melee:setParameter(CONDITION_PARAM_FORCEUPDATE, true) -local condition_dist = Condition(CONDITION_ATTRIBUTES) -condition_dist:setParameter(CONDITION_PARAM_SUBID, AttrSubId_JeanPierreDistance) -condition_dist:setParameter(CONDITION_PARAM_BUFF_SPELL, 1) -condition_dist:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000) -condition_dist:setParameter(CONDITION_PARAM_SKILL_DISTANCE, 10) -condition_dist:setParameter(CONDITION_PARAM_FORCEUPDATE, true) -local condition_f = Condition(CONDITION_ATTRIBUTES) -condition_f:setParameter(CONDITION_PARAM_SUBID, AttrSubId_JeanPierreFishing) -condition_f:setParameter(CONDITION_PARAM_BUFF_SPELL, 1) -condition_f:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000) -condition_f:setParameter(CONDITION_PARAM_SKILL_FISHING, 50) -condition_f:setParameter(CONDITION_PARAM_FORCEUPDATE, true) -local condition_speed = Condition(CONDITION_HASTE) -condition_speed:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000) -condition_speed:setParameter(CONDITION_PARAM_SPEED, 729) -local combat_i = Combat() -combat_i:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED) -combat_i:setParameter(COMBAT_PARAM_AGGRESSIVE, 0) -local condition_i = Condition(CONDITION_INVISIBLE) -condition_i:setParameter(CONDITION_PARAM_TICKS, 600000) -combat_i:addCondition(condition_i) -local itemIds = { [9079] = 0, [9080] = 1, [9081] = 2, [9082] = 3, [9083] = 4, [9084] = 5, [9085] = 6, [9086] = 7, [9087] = 8, [9088] = 9, [11584] = 10, [11586] = 11, [11587] = 12, [11588] = 13 } - -local jeanPierreFood = Action() - -function jeanPierreFood.onUse(player, item, frompos, item2, topos) - local cid = player:getId() - if player:getStorageValue(17110 + itemIds[item.itemid]) > os.time() then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.") - return true - end - player:setStorageValue(17110 + itemIds[item.itemid], os.time() + (15 * 60)) - - if item.itemid == 9079 then - item:remove(1) - Creature(cid):addHealth(getCreatureMaxHealth(cid) - getCreatureHealth(cid)) - player:say("Gulp.", TALKTYPE_MONSTER_SAY) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your health has been refilled.") - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - return true - elseif item.itemid == 9080 then - item:remove(1) - for i = 1, #conditions do - doRemoveCondition(cid, conditions[i]) - end - player:say("Chomp.", TALKTYPE_MONSTER_SAY) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You feel better body condition.") - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - return true - elseif item.itemid == 9081 then - item:remove(1) - Creature(cid):addCondition(condition_shield) - player:say("Chomp.", TALKTYPE_MONSTER_SAY) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You feel less vulnerable.") - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - return true - elseif item.itemid == 9082 then - item:remove(1) - Creature(cid):addCondition(condition_ml) - player:say("Chomp.", TALKTYPE_MONSTER_SAY) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You feel smarter.") - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - return true - elseif item.itemid == 9083 then - item:remove(1) - player:say("Slurp.", TALKTYPE_MONSTER_SAY) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You don't really know what this did to you, but suddenly you feel very happy.") - player:getPosition():sendMagicEffect(CONST_ME_HEARTS) - return true - elseif item.itemid == 9084 then - item:remove(1) - Creature(cid):addCondition(condition_melee) - player:say("Yum.", TALKTYPE_MONSTER_SAY) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You feel stronger.") - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - return true - elseif item.itemid == 9085 then - item:remove(1) - Creature(cid):addCondition(condition_speed) - player:say("Munch.", TALKTYPE_MONSTER_SAY) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your speed has been increased.") - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - return true - elseif item.itemid == 9086 then - item:remove(1) - Creature(cid):addMana(Creature(cid):getMaxMana() - Creature(cid):getMana()) - player:say("Chomp.", TALKTYPE_MONSTER_SAY) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your mana has been refilled.") - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - return true - elseif item.itemid == 9087 then - item:remove(1) - Creature(cid):addCondition(condition_dist) - player:say("Mmmm.", TALKTYPE_MONSTER_SAY) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You feel more focused.") - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - return true - elseif item.itemid == 9088 then - item:remove(1) - Creature(cid):addCondition(condition_f) - player:say("Smack.", TALKTYPE_MONSTER_SAY) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You felt fishing inspiration.") - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - return true - elseif item.itemid == 11584 then - item:remove(1) - player:setStorageValue(15287, os.time() + 86400) - player:say("Yum.", TALKTYPE_MONSTER_SAY) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Underwater walking speed increased.") - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - return true - elseif item.itemid == 11586 then - if math.random(1, 5) == 5 then - item:remove(1) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You take the last gulp from the large bowl. No leftovers!") - else - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You take a gulp from the large bowl, but there's still some blackjack in it.") - end - Creature(cid):addHealth(getCreatureMaxHealth(cid) - getCreatureHealth(cid)) - player:say("Gulp.", TALKTYPE_MONSTER_SAY) - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - return true - elseif item.itemid == 11587 then - item:remove(1) - local c = { condition_shield, condition_ml, condition_melee, condition_dist, condition_speed } - local r = math.random(1, 4) - if r == 1 then - Creature(cid):addCondition(c[math.random(1, #c)]) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You feel stronger, but you have no idea what was increased.") - elseif r == 2 then - doSetCreatureLight(cid, 15, 154, 60 * 60 * 1000) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You feel enlightened.") - elseif r == 3 then - Creature(cid):addCondition(condition_i) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You became invisible.") - elseif r == 4 then - Creature(cid):addHealth(getCreatureMaxHealth(cid) - getCreatureHealth(cid)) - Creature(cid):addMana(Creature(cid):getMaxMana() - Creature(cid):getMana()) - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your vitality has been restored.") - end - player:say("Smack.", TALKTYPE_MONSTER_SAY) - player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - return true - elseif item.itemid == 11588 then - local ring = getPlayerSlotItem(cid, CONST_SLOT_RING) - local r_t = { - [3095] = 3092, - [3096] = 3093, - [6300] = 6299, - [3099] = 3097, - [3088] = 3051, - [3089] = 3052, - [3048] = 3048, - [3087] = 3050, - [16264] = 16114, - [3100] = 3098, - [12670] = 12669, - [3086] = 3049, - [3094] = 3091, - [3090] = 3053, - } - if ring.itemid == 0 then - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "No ring equipped.") - player:getPosition():sendMagicEffect(CONST_ME_POFF) - return true - end - - if r_t[ring.itemid] ~= nil then - item:remove(1) - if ring.itemid == r_t[ring.itemid] then - r_m_am = 20 - else - r_m_am = 1 - end - - for i = 1, 10 do - doPlayerAddItem(cid, r_t[ring.itemid], r_m_am) - end - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your ring has been multiplied.") - player:say("Slurp!", TALKTYPE_MONSTER_SAY) - return true - else - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "This ring cannot be multiplied.") - player:getPosition():sendMagicEffect(CONST_ME_POFF) - return true - end - end -end - -for index, value in pairs(itemIds) do - jeanPierreFood:id(index) -end - -jeanPierreFood:register() diff --git a/data/scripts/actions/items/banana_chocolate_shake.lua b/data/scripts/actions/items/banana_chocolate_shake.lua new file mode 100644 index 00000000000..9c01b4a6b00 --- /dev/null +++ b/data/scripts/actions/items/banana_chocolate_shake.lua @@ -0,0 +1,18 @@ +local bananaChocolateShake = Action() + +function bananaChocolateShake.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if player:hasExhaustion("jean-pierre-foods") 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("jean-pierre-foods", 10 * 60) + item:remove(1) + return true +end + +bananaChocolateShake:id(9083) +bananaChocolateShake:register() diff --git a/data/scripts/actions/items/blessed_steak.lua b/data/scripts/actions/items/blessed_steak.lua new file mode 100644 index 00000000000..a0d487c4614 --- /dev/null +++ b/data/scripts/actions/items/blessed_steak.lua @@ -0,0 +1,19 @@ +local blessedSteak = Action() + +function blessedSteak.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if player:hasExhaustion("jean-pierre-foods") 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("jean-pierre-foods", 10 * 60) + item:remove(1) + return true +end + +blessedSteak:id(9086) +blessedSteak:register() diff --git a/data/scripts/actions/items/carrot_cake.lua b/data/scripts/actions/items/carrot_cake.lua new file mode 100644 index 00000000000..7b3543a0c02 --- /dev/null +++ b/data/scripts/actions/items/carrot_cake.lua @@ -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("jean-pierre-foods") 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("jean-pierre-foods", 10 * 60) + item:remove(1) + return true +end + +carrotCake:id(9087) +carrotCake:register() diff --git a/data/scripts/actions/items/coconut_shrimp_bake.lua b/data/scripts/actions/items/coconut_shrimp_bake.lua new file mode 100644 index 00000000000..7f6c4adae4f --- /dev/null +++ b/data/scripts/actions/items/coconut_shrimp_bake.lua @@ -0,0 +1,24 @@ +local coconutShrimpBake = Action() + +function coconutShrimpBake.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if player:hasExhaustion("jean-pierre-foods") 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 or headItem.itemid ~= 11585 then + return true + end + + player:setExhaustion("coconut-shrimp-bake", 24 * 60 * 60) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Underwater walking speed increased.") + player:say("Yum.", TALKTYPE_MONSTER_SAY) + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) + player:setExhaustion("jean-pierre-foods", 10 * 60) + item:remove(1) + return true +end + +coconutShrimpBake:id(11584) +coconutShrimpBake:register() diff --git a/data/scripts/actions/items/demonic_candy_ball.lua b/data/scripts/actions/items/demonic_candy_ball.lua new file mode 100644 index 00000000000..a2a9466e6f2 --- /dev/null +++ b/data/scripts/actions/items/demonic_candy_ball.lua @@ -0,0 +1,67 @@ +local defenseCondition = Condition(CONDITION_ATTRIBUTES) +defenseCondition:setParameter(CONDITION_PARAM_SUBID, JeanPierreDefense) +defenseCondition:setParameter(CONDITION_PARAM_BUFF_SPELL, 1) +defenseCondition:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000) +defenseCondition:setParameter(CONDITION_PARAM_SKILL_SHIELD, 10) +defenseCondition:setParameter(CONDITION_PARAM_FORCEUPDATE, true) + +local magicLevelCondition = Condition(CONDITION_ATTRIBUTES) +magicLevelCondition:setParameter(CONDITION_PARAM_SUBID, JeanPierreMagicLevel) +magicLevelCondition:setParameter(CONDITION_PARAM_BUFF_SPELL, 1) +magicLevelCondition:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000) +magicLevelCondition:setParameter(CONDITION_PARAM_STAT_MAGICPOINTS, 5) +magicLevelCondition:setParameter(CONDITION_PARAM_FORCEUPDATE, true) + +local meleeCondition = Condition(CONDITION_ATTRIBUTES) +meleeCondition:setParameter(CONDITION_PARAM_SUBID, JeanPierreMelee) +meleeCondition:setParameter(CONDITION_PARAM_BUFF_SPELL, 1) +meleeCondition:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000) +meleeCondition:setParameter(CONDITION_PARAM_SKILL_MELEE, 10) +meleeCondition:setParameter(CONDITION_PARAM_FORCEUPDATE, true) + +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 speedCondition = Condition(CONDITION_HASTE) +speedCondition:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000) +speedCondition:setParameter(CONDITION_PARAM_SPEED, 729) + +local demonicCandyBall = Action() + +function demonicCandyBall.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if player:hasExhaustion("jean-pierre-foods") then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.") + return true + end + + local availableConditions = { defenseCondition, magicLevelCondition, meleeCondition, distanceCondition, speedCondition } + local randomConditionIndex = math.random(1, 4) + + if randomConditionIndex == 1 then + player:addCondition(availableConditions[math.random(1, #availableConditions)]) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You feel stronger, but you have no idea what was increased.") + elseif randomConditionIndex == 2 then + doSetCreatureLight(cid, 15, 154, 60 * 60 * 1000) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You feel enlightened.") + elseif randomConditionIndex == 3 then + player:addCondition(condition_i) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You became invisible.") + elseif randomConditionIndex == 4 then + player:addHealth(player:getMaxHealth()) + player:addMana(player:getMaxMana()) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your vitality has been restored.") + end + + player:say("Smack.", TALKTYPE_MONSTER_SAY) + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) + player:setExhaustion("jean-pierre-foods", 10 * 60) + item:remove(1) + return true +end + +demonicCandyBall:id(11587) +demonicCandyBall:register() diff --git a/data/scripts/actions/items/filled_jalapeno_peppers.lua b/data/scripts/actions/items/filled_jalapeno_peppers.lua new file mode 100644 index 00000000000..b42a4f3187e --- /dev/null +++ b/data/scripts/actions/items/filled_jalapeno_peppers.lua @@ -0,0 +1,23 @@ +local speedCondition = Condition(CONDITION_HASTE) +speedCondition:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000) +speedCondition:setParameter(CONDITION_PARAM_SPEED, 729) + +local filledJalapenoPeppers = Action() + +function filledJalapenoPeppers.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if player:hasExhaustion("jean-pierre-foods") then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.") + return true + end + + player:addCondition(speedCondition) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your speed has been increased.") + player:say("Munch.", TALKTYPE_MONSTER_SAY) + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) + player:setExhaustion("jean-pierre-foods", 10 * 60) + item:remove(1) + return true +end + +filledJalapenoPeppers:id(9085) +filledJalapenoPeppers:register() diff --git a/data/scripts/actions/items/hydra_tongue_salad.lua b/data/scripts/actions/items/hydra_tongue_salad.lua new file mode 100644 index 00000000000..5926f0e3e57 --- /dev/null +++ b/data/scripts/actions/items/hydra_tongue_salad.lua @@ -0,0 +1,35 @@ +local conditionsToRemove = { + CONDITION_POISON, + CONDITION_FIRE, + CONDITION_ENERGY, + CONDITION_PARALYZE, + CONDITION_DRUNK, + CONDITION_DROWN, + CONDITION_FREEZING, + CONDITION_DAZZLED, + CONDITION_CURSED, + CONDITION_BLEEDING, +} + +local hydraTongueSalad = Action() + +function hydraTongueSalad.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if player:hasExhaustion("jean-pierre-foods") then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.") + return true + end + + for _, conditionType in ipairs(conditionsToRemove) do + player:removeCondition(conditionType) + end + + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You feel better body condition.") + player:say("Chomp.", TALKTYPE_MONSTER_SAY) + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) + player:setExhaustion("jean-pierre-foods", 10 * 60) + item:remove(1) + return true +end + +hydraTongueSalad:id(9080) +hydraTongueSalad:register() diff --git a/data/scripts/actions/items/northern_fishburger.lua b/data/scripts/actions/items/northern_fishburger.lua new file mode 100644 index 00000000000..e544c4b07bf --- /dev/null +++ b/data/scripts/actions/items/northern_fishburger.lua @@ -0,0 +1,26 @@ +local fishingCondition = Condition(CONDITION_ATTRIBUTES) +fishingCondition:setParameter(CONDITION_PARAM_SUBID, JeanPierreFishing) +fishingCondition:setParameter(CONDITION_PARAM_BUFF_SPELL, 1) +fishingCondition:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000) +fishingCondition:setParameter(CONDITION_PARAM_SKILL_FISHING, 50) +fishingCondition:setParameter(CONDITION_PARAM_FORCEUPDATE, true) + +local northernFishburger = Action() + +function northernFishburger.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if player:hasExhaustion("jean-pierre-foods") then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.") + return true + end + + player:addCondition(fishingCondition) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You felt fishing inspiration.") + player:say("Smack.", TALKTYPE_MONSTER_SAY) + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) + player:setExhaustion("jean-pierre-foods", 10 * 60) + item:remove(1) + return true +end + +northernFishburger:id(9088) +northernFishburger:register() diff --git a/data/scripts/actions/items/pot_of_blackjack.lua b/data/scripts/actions/items/pot_of_blackjack.lua new file mode 100644 index 00000000000..b46a046c307 --- /dev/null +++ b/data/scripts/actions/items/pot_of_blackjack.lua @@ -0,0 +1,36 @@ +local potOfBlackjack = Action() + +function potOfBlackjack.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if player:hasExhaustion("jean-pierre-foods") then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.") + return true + end + + local maxGulps = math.random(2, 4) + local remainingGulps = player:kv():get("pot-of-blackjack") or maxGulps + + if remainingGulps > 0 then + remainingGulps = remainingGulps - 1 + player:kv():set("pot-of-blackjack", remainingGulps) + + local message + if remainingGulps > 0 then + message = "You take a gulp from the large bowl, but there's still some blackjack in it." + else + message = "You take the last gulp from the large bowl. No leftovers!" + end + + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, message) + end + + player:addHealth(5000) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You take a gulp from the large bowl.") + player:say("Gulp.", TALKTYPE_MONSTER_SAY) + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) + player:setExhaustion("jean-pierre-foods", 10 * 60) + item:remove(1) + return true +end + +potOfBlackjack:id(11586) +potOfBlackjack:register() diff --git a/data/scripts/actions/items/potions.lua b/data/scripts/actions/items/potions.lua index 55bf20e0e18..02e92349363 100644 --- a/data/scripts/actions/items/potions.lua +++ b/data/scripts/actions/items/potions.lua @@ -1,19 +1,19 @@ local berserk = Condition(CONDITION_ATTRIBUTES) berserk:setParameter(CONDITION_PARAM_TICKS, 10 * 60 * 1000) -berserk:setParameter(CONDITION_PARAM_SUBID, AttrSubId_JeanPierreMelee) +berserk:setParameter(CONDITION_PARAM_SUBID, JeanPierreMelee) berserk:setParameter(CONDITION_PARAM_SKILL_MELEE, 5) berserk:setParameter(CONDITION_PARAM_SKILL_SHIELD, -10) berserk:setParameter(CONDITION_PARAM_BUFF_SPELL, true) local mastermind = Condition(CONDITION_ATTRIBUTES) mastermind:setParameter(CONDITION_PARAM_TICKS, 10 * 60 * 1000) -mastermind:setParameter(CONDITION_PARAM_SUBID, AttrSubId_JeanPierreMagic) +mastermind:setParameter(CONDITION_PARAM_SUBID, JeanPierreMagicLevel) mastermind:setParameter(CONDITION_PARAM_STAT_MAGICPOINTS, 3) mastermind:setParameter(CONDITION_PARAM_BUFF_SPELL, true) local bullseye = Condition(CONDITION_ATTRIBUTES) bullseye:setParameter(CONDITION_PARAM_TICKS, 10 * 60 * 1000) -bullseye:setParameter(CONDITION_PARAM_SUBID, AttrSubId_JeanPierreDistance) +bullseye:setParameter(CONDITION_PARAM_SUBID, JeanPierreDistance) bullseye:setParameter(CONDITION_PARAM_SKILL_DISTANCE, 5) bullseye:setParameter(CONDITION_PARAM_SKILL_SHIELD, -10) bullseye:setParameter(CONDITION_PARAM_BUFF_SPELL, true) diff --git a/data/scripts/actions/items/roasted_dragon_wings.lua b/data/scripts/actions/items/roasted_dragon_wings.lua new file mode 100644 index 00000000000..64ed82f0fca --- /dev/null +++ b/data/scripts/actions/items/roasted_dragon_wings.lua @@ -0,0 +1,26 @@ +local defenseCondition = Condition(CONDITION_ATTRIBUTES) +defenseCondition:setParameter(CONDITION_PARAM_SUBID, JeanPierreDefense) +defenseCondition:setParameter(CONDITION_PARAM_BUFF_SPELL, 1) +defenseCondition:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000) +defenseCondition:setParameter(CONDITION_PARAM_SKILL_SHIELD, 10) +defenseCondition:setParameter(CONDITION_PARAM_FORCEUPDATE, true) + +local roastedDragonWings = Action() + +function roastedDragonWings.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if player:hasExhaustion("jean-pierre-foods") then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.") + return true + end + + player:addCondition(defenseCondition) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You feel less vulnerable.") + player:say("Chomp.", TALKTYPE_MONSTER_SAY) + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) + player:setExhaustion("jean-pierre-foods", 10 * 60) + item:remove(1) + return true +end + +roastedDragonWings:id(9081) +roastedDragonWings:register() diff --git a/data/scripts/actions/items/rotworm_stew.lua b/data/scripts/actions/items/rotworm_stew.lua new file mode 100644 index 00000000000..145b5be34de --- /dev/null +++ b/data/scripts/actions/items/rotworm_stew.lua @@ -0,0 +1,19 @@ +local rotwormStew = Action() + +function rotwormStew.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if player:hasExhaustion("jean-pierre-foods") 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("Gulp.", TALKTYPE_MONSTER_SAY) + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) + player:setExhaustion("jean-pierre-foods", 10 * 60) + item:remove(1) + return true +end + +rotwormStew:id(9079) +rotwormStew:register() diff --git a/data/scripts/actions/items/sweet_mangonaise_elixir.lua b/data/scripts/actions/items/sweet_mangonaise_elixir.lua new file mode 100644 index 00000000000..b28a7137ddc --- /dev/null +++ b/data/scripts/actions/items/sweet_mangonaise_elixir.lua @@ -0,0 +1,53 @@ +local ringMultiplicationTable = { + [3095] = 3092, + [3096] = 3093, + [6300] = 6299, + [3099] = 3097, + [3088] = 3051, + [3089] = 3052, + [3048] = 3048, + [3087] = 3050, + [16264] = 16114, + [3100] = 3098, + [12670] = 12669, + [3086] = 3049, + [3094] = 3091, + [3090] = 3053, +} + +local sweetMangonaiseElixir = Action() + +function sweetMangonaiseElixir.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if player:hasExhaustion("jean-pierre-foods") then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.") + return true + end + + local playerRing = player:getSlotItem(CONST_SLOT_RING) + if not playerRing or playerRing:getId() == item:getId() then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "No ring equipped.") + player:getPosition():sendMagicEffect(CONST_ME_POFF) + return true + end + + if ringMultiplicationTable[playerRing.itemid] then + local ringMultiplierAmount = (playerRing.itemid == ringMultiplicationTable[playerRing.itemid]) and 20 or 1 + for i = 1, 10 do + player:addItem(ringMultiplicationTable[playerRing.itemid], ringMultiplierAmount) + end + + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your ring has been multiplied.") + item:remove(1) + else + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "This ring cannot be multiplied.") + player:getPosition():sendMagicEffect(CONST_ME_POFF) + end + + player:say("Slurp.", TALKTYPE_MONSTER_SAY) + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) + player:setExhaustion("jean-pierre-foods", 10 * 60) + return true +end + +sweetMangonaiseElixir:id(11588) +sweetMangonaiseElixir:register() diff --git a/data/scripts/actions/items/tropical_fried_terrorbird.lua b/data/scripts/actions/items/tropical_fried_terrorbird.lua new file mode 100644 index 00000000000..5e83f52f676 --- /dev/null +++ b/data/scripts/actions/items/tropical_fried_terrorbird.lua @@ -0,0 +1,26 @@ +local magicLevelCondition = Condition(CONDITION_ATTRIBUTES) +magicLevelCondition:setParameter(CONDITION_PARAM_SUBID, JeanPierreMagicLevel) +magicLevelCondition:setParameter(CONDITION_PARAM_BUFF_SPELL, 1) +magicLevelCondition:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000) +magicLevelCondition:setParameter(CONDITION_PARAM_STAT_MAGICPOINTS, 5) +magicLevelCondition:setParameter(CONDITION_PARAM_FORCEUPDATE, true) + +local tropicalFriedTerrorbird = Action() + +function tropicalFriedTerrorbird.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if player:hasExhaustion("jean-pierre-foods") then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.") + return true + end + + player:addCondition(magicLevelCondition) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You feel smarter.") + player:say("Chomp.", TALKTYPE_MONSTER_SAY) + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) + player:setExhaustion("jean-pierre-foods", 10 * 60) + item:remove(1) + return true +end + +tropicalFriedTerrorbird:id(9082) +tropicalFriedTerrorbird:register() diff --git a/data/scripts/actions/items/veggie_casserole.lua b/data/scripts/actions/items/veggie_casserole.lua new file mode 100644 index 00000000000..3920cacc5f3 --- /dev/null +++ b/data/scripts/actions/items/veggie_casserole.lua @@ -0,0 +1,26 @@ +local meleeCondition = Condition(CONDITION_ATTRIBUTES) +meleeCondition:setParameter(CONDITION_PARAM_SUBID, JeanPierreMelee) +meleeCondition:setParameter(CONDITION_PARAM_BUFF_SPELL, 1) +meleeCondition:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000) +meleeCondition:setParameter(CONDITION_PARAM_SKILL_MELEE, 10) +meleeCondition:setParameter(CONDITION_PARAM_FORCEUPDATE, true) + +local veggieCasserole = Action() + +function veggieCasserole.onUse(player, item, fromPosition, target, toPosition, isHotkey) + if player:hasExhaustion("jean-pierre-foods") then + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.") + return true + end + + player:addCondition(meleeCondition) + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You feel stronger.") + player:say("Yum.", TALKTYPE_MONSTER_SAY) + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) + player:setExhaustion("jean-pierre-foods", 10 * 60) + item:remove(1) + return true +end + +veggieCasserole:id(9084) +veggieCasserole:register() From 76c5f5fa65a22550d8f034378097169da0eea4a8 Mon Sep 17 00:00:00 2001 From: Marco Date: Mon, 26 Feb 2024 01:15:18 -0300 Subject: [PATCH 2/6] add cooldown check for Coconut Shrimp Bake haste condition --- .../scripts/movements/others/drowning.lua | 36 ------------------- .../actions/items/coconut_shrimp_bake.lua | 4 +-- .../scripts/movements/drowning.lua | 31 ++++++++++++---- 3 files changed, 27 insertions(+), 44 deletions(-) delete mode 100644 data-otservbr-global/scripts/movements/others/drowning.lua rename {data-canary => data}/scripts/movements/drowning.lua (50%) diff --git a/data-otservbr-global/scripts/movements/others/drowning.lua b/data-otservbr-global/scripts/movements/others/drowning.lua deleted file mode 100644 index 6f4fbd7efa6..00000000000 --- a/data-otservbr-global/scripts/movements/others/drowning.lua +++ /dev/null @@ -1,36 +0,0 @@ -local condition = Condition(CONDITION_DROWN) -condition:setParameter(CONDITION_PARAM_PERIODICDAMAGE, -20) -condition:setParameter(CONDITION_PARAM_TICKS, -1) -condition:setParameter(CONDITION_PARAM_TICKINTERVAL, 2000) - -local drowning = MoveEvent() -drowning:type("stepin") - -function drowning.onStepIn(player, item, position, fromPosition) - if player:isPlayer() then - local headItem = player:getSlotItem(CONST_SLOT_HEAD) - if headItem and table.contains({ 5460, 11585, 13995 }, headItem.itemid) then - return true - elseif math.random(1, 10) == 1 then - position:sendMagicEffect(CONST_ME_BUBBLES) - end - player:addCondition(condition) - end - return true -end - -drowning:id(5404, 5405, 5406, 5407, 5408, 5409, 5743, 5764, 8755, 8756, 8757, 9291) -drowning:register() - -drowning = MoveEvent() -drowning:type("stepout") - -function drowning.onStepOut(creature, item, position, fromPosition) - if creature:isPlayer() then - creature:removeCondition(CONDITION_DROWN) - end - return true -end - -drowning:id(5404, 5405, 5406, 5407, 5408, 5409, 5743, 5764, 8755, 8756, 8757, 9291) -drowning:register() diff --git a/data/scripts/actions/items/coconut_shrimp_bake.lua b/data/scripts/actions/items/coconut_shrimp_bake.lua index 7f6c4adae4f..9ed200382ba 100644 --- a/data/scripts/actions/items/coconut_shrimp_bake.lua +++ b/data/scripts/actions/items/coconut_shrimp_bake.lua @@ -7,15 +7,15 @@ function coconutShrimpBake.onUse(player, item, fromPosition, target, toPosition, end local headItem = player:getSlotItem(CONST_SLOT_HEAD) - if not headItem or headItem.itemid ~= 11585 then + if not headItem or (headItem.itemid ~= 5460 and headItem.itemid ~= 11585 and headItem.itemid ~= 13995) then return true end - player:setExhaustion("coconut-shrimp-bake", 24 * 60 * 60) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Underwater walking speed increased.") player:say("Yum.", TALKTYPE_MONSTER_SAY) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) player:setExhaustion("jean-pierre-foods", 10 * 60) + player:setExhaustion("coconut-shrimp-bake", 24 * 60 * 60) item:remove(1) return true end diff --git a/data-canary/scripts/movements/drowning.lua b/data/scripts/movements/drowning.lua similarity index 50% rename from data-canary/scripts/movements/drowning.lua rename to data/scripts/movements/drowning.lua index 00266d57d1e..8f33f2bc756 100644 --- a/data-canary/scripts/movements/drowning.lua +++ b/data/scripts/movements/drowning.lua @@ -3,16 +3,31 @@ condition:setParameter(CONDITION_PARAM_PERIODICDAMAGE, -20) condition:setParameter(CONDITION_PARAM_TICKS, -1) condition:setParameter(CONDITION_PARAM_TICKINTERVAL, 2000) +local conditionHaste = Condition(CONDITION_HASTE) +conditionHaste:setTicks(-1) +conditionHaste:setFormula(1.0, 300, 1.0, 300) + local drowning = MoveEvent() drowning:type("stepin") function drowning.onStepIn(creature, item, position, fromPosition) - if creature:isPlayer() then - if math.random(1, 10) == 1 then - position:sendMagicEffect(CONST_ME_BUBBLES) + local player = creature:getPlayer() + if not player then + return + end + + local headItem = player:getSlotItem(CONST_SLOT_HEAD) + if headItem and table.contains({ 5460, 11585, 13995 }, headItem.itemid) then + if player:hasExhaustion("coconut-shrimp-bake") then + player:addCondition(conditionHaste) end - creature:addCondition(condition) + + return true + elseif math.random(1, 10) == 1 then + position:sendMagicEffect(CONST_ME_BUBBLES) end + + player:addCondition(condition) return true end @@ -23,9 +38,13 @@ drowning = MoveEvent() drowning:type("stepout") function drowning.onStepOut(creature, item, position, fromPosition) - if creature:isPlayer() then - creature:removeCondition(CONDITION_DROWN) + local player = creature:getPlayer() + if not player then + return end + + player:removeCondition(CONDITION_DROWN) + player:removeCondition(CONDITION_HASTE) return true end From 709f3e726ee54a99bdd1cc20416ce3fb4a478411 Mon Sep 17 00:00:00 2001 From: Marco Date: Mon, 26 Feb 2024 12:47:32 -0300 Subject: [PATCH 3/6] resolve conversations --- .../actions/items/coconut_shrimp_bake.lua | 13 +++++++++--- .../actions/items/pot_of_blackjack.lua | 3 +-- .../actions/items/sweet_mangonaise_elixir.lua | 20 +++++++++---------- data/scripts/movements/drowning.lua | 6 +++--- 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/data/scripts/actions/items/coconut_shrimp_bake.lua b/data/scripts/actions/items/coconut_shrimp_bake.lua index 9ed200382ba..23dbea68172 100644 --- a/data/scripts/actions/items/coconut_shrimp_bake.lua +++ b/data/scripts/actions/items/coconut_shrimp_bake.lua @@ -7,13 +7,20 @@ function coconutShrimpBake.onUse(player, item, fromPosition, target, toPosition, end local headItem = player:getSlotItem(CONST_SLOT_HEAD) - if not headItem or (headItem.itemid ~= 5460 and headItem.itemid ~= 11585 and headItem.itemid ~= 13995) then + 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 - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Underwater walking speed increased.") + 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_RED) + player:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN) player:setExhaustion("jean-pierre-foods", 10 * 60) player:setExhaustion("coconut-shrimp-bake", 24 * 60 * 60) item:remove(1) diff --git a/data/scripts/actions/items/pot_of_blackjack.lua b/data/scripts/actions/items/pot_of_blackjack.lua index b46a046c307..a2742e085e7 100644 --- a/data/scripts/actions/items/pot_of_blackjack.lua +++ b/data/scripts/actions/items/pot_of_blackjack.lua @@ -6,8 +6,7 @@ function potOfBlackjack.onUse(player, item, fromPosition, target, toPosition, is return true end - local maxGulps = math.random(2, 4) - local remainingGulps = player:kv():get("pot-of-blackjack") or maxGulps + local remainingGulps = player:kv():get("pot-of-blackjack") or math.random(2, 4) if remainingGulps > 0 then remainingGulps = remainingGulps - 1 diff --git a/data/scripts/actions/items/sweet_mangonaise_elixir.lua b/data/scripts/actions/items/sweet_mangonaise_elixir.lua index b28a7137ddc..f33122e40bf 100644 --- a/data/scripts/actions/items/sweet_mangonaise_elixir.lua +++ b/data/scripts/actions/items/sweet_mangonaise_elixir.lua @@ -24,28 +24,28 @@ function sweetMangonaiseElixir.onUse(player, item, fromPosition, target, toPosit end local playerRing = player:getSlotItem(CONST_SLOT_RING) - if not playerRing or playerRing:getId() == item:getId() then + if not playerRing or not table.contains(ringMultiplicationTable, playerRing:getId()) then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "No ring equipped.") player:getPosition():sendMagicEffect(CONST_ME_POFF) return true end - if ringMultiplicationTable[playerRing.itemid] then - local ringMultiplierAmount = (playerRing.itemid == ringMultiplicationTable[playerRing.itemid]) and 20 or 1 - for i = 1, 10 do - player:addItem(ringMultiplicationTable[playerRing.itemid], ringMultiplierAmount) - end - - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your ring has been multiplied.") - item:remove(1) - else + local ringId = ringMultiplicationTable[playerRing:getId()] + if not ringId then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "This ring cannot be multiplied.") player:getPosition():sendMagicEffect(CONST_ME_POFF) + return false + end + + for i = 1, 10 do + player:addItem(ringId) end + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your ring has been multiplied.") player:say("Slurp.", TALKTYPE_MONSTER_SAY) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) player:setExhaustion("jean-pierre-foods", 10 * 60) + item:remove(1) return true end diff --git a/data/scripts/movements/drowning.lua b/data/scripts/movements/drowning.lua index 8f33f2bc756..a32dcb216cb 100644 --- a/data/scripts/movements/drowning.lua +++ b/data/scripts/movements/drowning.lua @@ -13,11 +13,11 @@ drowning:type("stepin") function drowning.onStepIn(creature, item, position, fromPosition) local player = creature:getPlayer() if not player then - return + return false end local headItem = player:getSlotItem(CONST_SLOT_HEAD) - if headItem and table.contains({ 5460, 11585, 13995 }, headItem.itemid) then + if headItem and table.contains({ 5460, 11585, 13995 }, headItem:getId()) then if player:hasExhaustion("coconut-shrimp-bake") then player:addCondition(conditionHaste) end @@ -40,7 +40,7 @@ drowning:type("stepout") function drowning.onStepOut(creature, item, position, fromPosition) local player = creature:getPlayer() if not player then - return + return false end player:removeCondition(CONDITION_DROWN) From 261ac3858f8ef4e46d8dc7fc3320a90705e8b99e Mon Sep 17 00:00:00 2001 From: Marco Date: Mon, 26 Feb 2024 12:51:16 -0300 Subject: [PATCH 4/6] fix: set special foods cooldown --- data/scripts/actions/items/banana_chocolate_shake.lua | 4 ++-- data/scripts/actions/items/blessed_steak.lua | 4 ++-- data/scripts/actions/items/carrot_cake.lua | 4 ++-- data/scripts/actions/items/coconut_shrimp_bake.lua | 4 ++-- data/scripts/actions/items/demonic_candy_ball.lua | 4 ++-- data/scripts/actions/items/filled_jalapeno_peppers.lua | 4 ++-- data/scripts/actions/items/hireling_foods.lua | 4 ++-- data/scripts/actions/items/hydra_tongue_salad.lua | 4 ++-- data/scripts/actions/items/northern_fishburger.lua | 4 ++-- data/scripts/actions/items/pot_of_blackjack.lua | 4 ++-- data/scripts/actions/items/roasted_dragon_wings.lua | 4 ++-- data/scripts/actions/items/rotworm_stew.lua | 4 ++-- data/scripts/actions/items/sweet_mangonaise_elixir.lua | 4 ++-- data/scripts/actions/items/tropical_fried_terrorbird.lua | 4 ++-- data/scripts/actions/items/veggie_casserole.lua | 4 ++-- 15 files changed, 30 insertions(+), 30 deletions(-) diff --git a/data/scripts/actions/items/banana_chocolate_shake.lua b/data/scripts/actions/items/banana_chocolate_shake.lua index 9c01b4a6b00..083b4f965da 100644 --- a/data/scripts/actions/items/banana_chocolate_shake.lua +++ b/data/scripts/actions/items/banana_chocolate_shake.lua @@ -1,7 +1,7 @@ local bananaChocolateShake = Action() function bananaChocolateShake.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:hasExhaustion("jean-pierre-foods") then + if player:hasExhaustion("special-foods-cooldown") then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.") return true end @@ -9,7 +9,7 @@ function bananaChocolateShake.onUse(player, item, fromPosition, target, toPositi 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("jean-pierre-foods", 10 * 60) + player:setExhaustion("special-foods-cooldown", 10 * 60) item:remove(1) return true end diff --git a/data/scripts/actions/items/blessed_steak.lua b/data/scripts/actions/items/blessed_steak.lua index a0d487c4614..32b2d12162e 100644 --- a/data/scripts/actions/items/blessed_steak.lua +++ b/data/scripts/actions/items/blessed_steak.lua @@ -1,7 +1,7 @@ local blessedSteak = Action() function blessedSteak.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:hasExhaustion("jean-pierre-foods") then + if player:hasExhaustion("special-foods-cooldown") then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.") return true end @@ -10,7 +10,7 @@ function blessedSteak.onUse(player, item, fromPosition, target, toPosition, isHo 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("jean-pierre-foods", 10 * 60) + player:setExhaustion("special-foods-cooldown", 10 * 60) item:remove(1) return true end diff --git a/data/scripts/actions/items/carrot_cake.lua b/data/scripts/actions/items/carrot_cake.lua index 7b3543a0c02..28432188685 100644 --- a/data/scripts/actions/items/carrot_cake.lua +++ b/data/scripts/actions/items/carrot_cake.lua @@ -8,7 +8,7 @@ distanceCondition:setParameter(CONDITION_PARAM_FORCEUPDATE, true) local carrotCake = Action() function carrotCake.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:hasExhaustion("jean-pierre-foods") then + if player:hasExhaustion("special-foods-cooldown") then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.") return true end @@ -17,7 +17,7 @@ function carrotCake.onUse(player, item, fromPosition, target, toPosition, isHotk player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You feel more focused.") player:say("Mmmm.", TALKTYPE_MONSTER_SAY) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - player:setExhaustion("jean-pierre-foods", 10 * 60) + player:setExhaustion("special-foods-cooldown", 10 * 60) item:remove(1) return true end diff --git a/data/scripts/actions/items/coconut_shrimp_bake.lua b/data/scripts/actions/items/coconut_shrimp_bake.lua index 23dbea68172..bc7ba97ddd3 100644 --- a/data/scripts/actions/items/coconut_shrimp_bake.lua +++ b/data/scripts/actions/items/coconut_shrimp_bake.lua @@ -1,7 +1,7 @@ local coconutShrimpBake = Action() function coconutShrimpBake.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:hasExhaustion("jean-pierre-foods") then + if player:hasExhaustion("special-foods-cooldown") then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.") return true end @@ -21,7 +21,7 @@ function coconutShrimpBake.onUse(player, item, fromPosition, target, toPosition, 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("jean-pierre-foods", 10 * 60) + player:setExhaustion("special-foods-cooldown", 10 * 60) player:setExhaustion("coconut-shrimp-bake", 24 * 60 * 60) item:remove(1) return true diff --git a/data/scripts/actions/items/demonic_candy_ball.lua b/data/scripts/actions/items/demonic_candy_ball.lua index a2a9466e6f2..1e716170f27 100644 --- a/data/scripts/actions/items/demonic_candy_ball.lua +++ b/data/scripts/actions/items/demonic_candy_ball.lua @@ -33,7 +33,7 @@ speedCondition:setParameter(CONDITION_PARAM_SPEED, 729) local demonicCandyBall = Action() function demonicCandyBall.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:hasExhaustion("jean-pierre-foods") then + if player:hasExhaustion("special-foods-cooldown") then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.") return true end @@ -58,7 +58,7 @@ function demonicCandyBall.onUse(player, item, fromPosition, target, toPosition, player:say("Smack.", TALKTYPE_MONSTER_SAY) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - player:setExhaustion("jean-pierre-foods", 10 * 60) + player:setExhaustion("special-foods-cooldown", 10 * 60) item:remove(1) return true end diff --git a/data/scripts/actions/items/filled_jalapeno_peppers.lua b/data/scripts/actions/items/filled_jalapeno_peppers.lua index b42a4f3187e..57df8d6b191 100644 --- a/data/scripts/actions/items/filled_jalapeno_peppers.lua +++ b/data/scripts/actions/items/filled_jalapeno_peppers.lua @@ -5,7 +5,7 @@ speedCondition:setParameter(CONDITION_PARAM_SPEED, 729) local filledJalapenoPeppers = Action() function filledJalapenoPeppers.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:hasExhaustion("jean-pierre-foods") then + if player:hasExhaustion("special-foods-cooldown") then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.") return true end @@ -14,7 +14,7 @@ function filledJalapenoPeppers.onUse(player, item, fromPosition, target, toPosit player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your speed has been increased.") player:say("Munch.", TALKTYPE_MONSTER_SAY) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - player:setExhaustion("jean-pierre-foods", 10 * 60) + player:setExhaustion("special-foods-cooldown", 10 * 60) item:remove(1) return true end diff --git a/data/scripts/actions/items/hireling_foods.lua b/data/scripts/actions/items/hireling_foods.lua index 6b86c8d242a..30783fde9c8 100644 --- a/data/scripts/actions/items/hireling_foods.lua +++ b/data/scripts/actions/items/hireling_foods.lua @@ -42,7 +42,7 @@ function hirelingFoods.onUse(player, item, fromPosition, target, toPosition, isH return true end - if player:hasExhaustion("hireling-foods-cooldown") then + if player:hasExhaustion("special-foods-cooldown") then player:sendCancelMessage("You're still too full to eat any gourmet dishes for a while.") return true end @@ -56,7 +56,7 @@ function hirelingFoods.onUse(player, item, fromPosition, target, toPosition, isH end player:say(dish.message, TALKTYPE_MONSTER_SAY) - player:setExhaustion("hireling-foods-cooldown", 10 * 60) + player:setExhaustion("special-foods-cooldown", 10 * 60) item:remove(1) return true diff --git a/data/scripts/actions/items/hydra_tongue_salad.lua b/data/scripts/actions/items/hydra_tongue_salad.lua index 5926f0e3e57..4c8cad3258a 100644 --- a/data/scripts/actions/items/hydra_tongue_salad.lua +++ b/data/scripts/actions/items/hydra_tongue_salad.lua @@ -14,7 +14,7 @@ local conditionsToRemove = { local hydraTongueSalad = Action() function hydraTongueSalad.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:hasExhaustion("jean-pierre-foods") then + if player:hasExhaustion("special-foods-cooldown") then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.") return true end @@ -26,7 +26,7 @@ function hydraTongueSalad.onUse(player, item, fromPosition, target, toPosition, player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You feel better body condition.") player:say("Chomp.", TALKTYPE_MONSTER_SAY) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - player:setExhaustion("jean-pierre-foods", 10 * 60) + player:setExhaustion("special-foods-cooldown", 10 * 60) item:remove(1) return true end diff --git a/data/scripts/actions/items/northern_fishburger.lua b/data/scripts/actions/items/northern_fishburger.lua index e544c4b07bf..3648ba102b3 100644 --- a/data/scripts/actions/items/northern_fishburger.lua +++ b/data/scripts/actions/items/northern_fishburger.lua @@ -8,7 +8,7 @@ fishingCondition:setParameter(CONDITION_PARAM_FORCEUPDATE, true) local northernFishburger = Action() function northernFishburger.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:hasExhaustion("jean-pierre-foods") then + if player:hasExhaustion("special-foods-cooldown") then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.") return true end @@ -17,7 +17,7 @@ function northernFishburger.onUse(player, item, fromPosition, target, toPosition player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You felt fishing inspiration.") player:say("Smack.", TALKTYPE_MONSTER_SAY) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - player:setExhaustion("jean-pierre-foods", 10 * 60) + player:setExhaustion("special-foods-cooldown", 10 * 60) item:remove(1) return true end diff --git a/data/scripts/actions/items/pot_of_blackjack.lua b/data/scripts/actions/items/pot_of_blackjack.lua index a2742e085e7..fd4cc52b920 100644 --- a/data/scripts/actions/items/pot_of_blackjack.lua +++ b/data/scripts/actions/items/pot_of_blackjack.lua @@ -1,7 +1,7 @@ local potOfBlackjack = Action() function potOfBlackjack.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:hasExhaustion("jean-pierre-foods") then + if player:hasExhaustion("special-foods-cooldown") then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.") return true end @@ -26,7 +26,7 @@ function potOfBlackjack.onUse(player, item, fromPosition, target, toPosition, is player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You take a gulp from the large bowl.") player:say("Gulp.", TALKTYPE_MONSTER_SAY) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - player:setExhaustion("jean-pierre-foods", 10 * 60) + player:setExhaustion("special-foods-cooldown", 10 * 60) item:remove(1) return true end diff --git a/data/scripts/actions/items/roasted_dragon_wings.lua b/data/scripts/actions/items/roasted_dragon_wings.lua index 64ed82f0fca..719c7fa0e20 100644 --- a/data/scripts/actions/items/roasted_dragon_wings.lua +++ b/data/scripts/actions/items/roasted_dragon_wings.lua @@ -8,7 +8,7 @@ defenseCondition:setParameter(CONDITION_PARAM_FORCEUPDATE, true) local roastedDragonWings = Action() function roastedDragonWings.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:hasExhaustion("jean-pierre-foods") then + if player:hasExhaustion("special-foods-cooldown") then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.") return true end @@ -17,7 +17,7 @@ function roastedDragonWings.onUse(player, item, fromPosition, target, toPosition player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You feel less vulnerable.") player:say("Chomp.", TALKTYPE_MONSTER_SAY) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - player:setExhaustion("jean-pierre-foods", 10 * 60) + player:setExhaustion("special-foods-cooldown", 10 * 60) item:remove(1) return true end diff --git a/data/scripts/actions/items/rotworm_stew.lua b/data/scripts/actions/items/rotworm_stew.lua index 145b5be34de..7b965da5857 100644 --- a/data/scripts/actions/items/rotworm_stew.lua +++ b/data/scripts/actions/items/rotworm_stew.lua @@ -1,7 +1,7 @@ local rotwormStew = Action() function rotwormStew.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:hasExhaustion("jean-pierre-foods") then + if player:hasExhaustion("special-foods-cooldown") then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.") return true end @@ -10,7 +10,7 @@ function rotwormStew.onUse(player, item, fromPosition, target, toPosition, isHot player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your health has been refilled.") player:say("Gulp.", TALKTYPE_MONSTER_SAY) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - player:setExhaustion("jean-pierre-foods", 10 * 60) + player:setExhaustion("special-foods-cooldown", 10 * 60) item:remove(1) return true end diff --git a/data/scripts/actions/items/sweet_mangonaise_elixir.lua b/data/scripts/actions/items/sweet_mangonaise_elixir.lua index f33122e40bf..028bbd9457b 100644 --- a/data/scripts/actions/items/sweet_mangonaise_elixir.lua +++ b/data/scripts/actions/items/sweet_mangonaise_elixir.lua @@ -18,7 +18,7 @@ local ringMultiplicationTable = { local sweetMangonaiseElixir = Action() function sweetMangonaiseElixir.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:hasExhaustion("jean-pierre-foods") then + if player:hasExhaustion("special-foods-cooldown") then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.") return true end @@ -44,7 +44,7 @@ function sweetMangonaiseElixir.onUse(player, item, fromPosition, target, toPosit player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your ring has been multiplied.") player:say("Slurp.", TALKTYPE_MONSTER_SAY) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - player:setExhaustion("jean-pierre-foods", 10 * 60) + player:setExhaustion("special-foods-cooldown", 10 * 60) item:remove(1) return true end diff --git a/data/scripts/actions/items/tropical_fried_terrorbird.lua b/data/scripts/actions/items/tropical_fried_terrorbird.lua index 5e83f52f676..342ba545a25 100644 --- a/data/scripts/actions/items/tropical_fried_terrorbird.lua +++ b/data/scripts/actions/items/tropical_fried_terrorbird.lua @@ -8,7 +8,7 @@ magicLevelCondition:setParameter(CONDITION_PARAM_FORCEUPDATE, true) local tropicalFriedTerrorbird = Action() function tropicalFriedTerrorbird.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:hasExhaustion("jean-pierre-foods") then + if player:hasExhaustion("special-foods-cooldown") then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.") return true end @@ -17,7 +17,7 @@ function tropicalFriedTerrorbird.onUse(player, item, fromPosition, target, toPos player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You feel smarter.") player:say("Chomp.", TALKTYPE_MONSTER_SAY) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - player:setExhaustion("jean-pierre-foods", 10 * 60) + player:setExhaustion("special-foods-cooldown", 10 * 60) item:remove(1) return true end diff --git a/data/scripts/actions/items/veggie_casserole.lua b/data/scripts/actions/items/veggie_casserole.lua index 3920cacc5f3..d0ef6c99a78 100644 --- a/data/scripts/actions/items/veggie_casserole.lua +++ b/data/scripts/actions/items/veggie_casserole.lua @@ -8,7 +8,7 @@ meleeCondition:setParameter(CONDITION_PARAM_FORCEUPDATE, true) local veggieCasserole = Action() function veggieCasserole.onUse(player, item, fromPosition, target, toPosition, isHotkey) - if player:hasExhaustion("jean-pierre-foods") then + if player:hasExhaustion("special-foods-cooldown") then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need to wait before using it again.") return true end @@ -17,7 +17,7 @@ function veggieCasserole.onUse(player, item, fromPosition, target, toPosition, i player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You feel stronger.") player:say("Yum.", TALKTYPE_MONSTER_SAY) player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) - player:setExhaustion("jean-pierre-foods", 10 * 60) + player:setExhaustion("special-foods-cooldown", 10 * 60) item:remove(1) return true end From 05349c41201ef36d9778a767d45267ba8f99a898 Mon Sep 17 00:00:00 2001 From: Marco Date: Mon, 26 Feb 2024 12:55:42 -0300 Subject: [PATCH 5/6] remove deprecated function --- .../actions/items/demonic_candy_ball.lua | 7 ++++++- .../functions/core/game/global_functions.cpp | 18 ------------------ .../functions/core/game/global_functions.hpp | 2 -- 3 files changed, 6 insertions(+), 21 deletions(-) diff --git a/data/scripts/actions/items/demonic_candy_ball.lua b/data/scripts/actions/items/demonic_candy_ball.lua index 1e716170f27..c2e44c1efb1 100644 --- a/data/scripts/actions/items/demonic_candy_ball.lua +++ b/data/scripts/actions/items/demonic_candy_ball.lua @@ -30,6 +30,11 @@ local speedCondition = Condition(CONDITION_HASTE) speedCondition:setParameter(CONDITION_PARAM_TICKS, 60 * 60 * 1000) speedCondition:setParameter(CONDITION_PARAM_SPEED, 729) +local lightCondition = Condition(CONDITION_LIGHT) +lightCondition:setParameter(CONDITION_PARAM_LIGHT_LEVEL, 15) +lightCondition:setParameter(CONDITION_PARAM_LIGHT_COLOR, 154) +lightCondition:setTicks(60 * 60 * 1000) + local demonicCandyBall = Action() function demonicCandyBall.onUse(player, item, fromPosition, target, toPosition, isHotkey) @@ -45,7 +50,7 @@ function demonicCandyBall.onUse(player, item, fromPosition, target, toPosition, player:addCondition(availableConditions[math.random(1, #availableConditions)]) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You feel stronger, but you have no idea what was increased.") elseif randomConditionIndex == 2 then - doSetCreatureLight(cid, 15, 154, 60 * 60 * 1000) + player:addCondition(lightCondition) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You feel enlightened.") elseif randomConditionIndex == 3 then player:addCondition(condition_i) diff --git a/src/lua/functions/core/game/global_functions.cpp b/src/lua/functions/core/game/global_functions.cpp index 4c956dcb6d4..cbb133211f8 100644 --- a/src/lua/functions/core/game/global_functions.cpp +++ b/src/lua/functions/core/game/global_functions.cpp @@ -94,24 +94,6 @@ int GlobalFunctions::luaDoPlayerAddItem(lua_State* L) { return 1; } -int GlobalFunctions::luaDoSetCreatureLight(lua_State* L) { - // doSetCreatureLight(cid, lightLevel, lightColor, time) - std::shared_ptr creature = getCreature(L, 1); - if (!creature) { - reportErrorFunc(getErrorDesc(LUA_ERROR_PLAYER_NOT_FOUND)); - pushBoolean(L, false); - return 1; - } - - uint16_t level = getNumber(L, 2); - uint16_t color = getNumber(L, 3); - uint32_t time = getNumber(L, 4); - std::shared_ptr condition = Condition::createCondition(CONDITIONID_COMBAT, CONDITION_LIGHT, time, level | (color << 8)); - creature->addCondition(condition); - pushBoolean(L, true); - return 1; -} - int GlobalFunctions::luaIsValidUID(lua_State* L) { // isValidUID(uid) pushBoolean(L, getScriptEnv()->getThingByUID(getNumber(L, -1)) != nullptr); diff --git a/src/lua/functions/core/game/global_functions.hpp b/src/lua/functions/core/game/global_functions.hpp index 1b9f3fbe12f..cef752c6695 100644 --- a/src/lua/functions/core/game/global_functions.hpp +++ b/src/lua/functions/core/game/global_functions.hpp @@ -25,7 +25,6 @@ class GlobalFunctions final : LuaScriptInterface { lua_register(L, "doAreaCombatMana", GlobalFunctions::luaDoAreaCombatMana); lua_register(L, "doChallengeCreature", GlobalFunctions::luaDoChallengeCreature); lua_register(L, "doPlayerAddItem", GlobalFunctions::luaDoPlayerAddItem); - lua_register(L, "doSetCreatureLight", GlobalFunctions::luaDoSetCreatureLight); lua_register(L, "doTargetCombatCondition", GlobalFunctions::luaDoTargetCombatCondition); lua_register(L, "doTargetCombatDispel", GlobalFunctions::luaDoTargetCombatDispel); lua_register(L, "doTargetCombatHealth", GlobalFunctions::luaDoTargetCombatHealth); @@ -66,7 +65,6 @@ class GlobalFunctions final : LuaScriptInterface { static int luaDoAreaCombatMana(lua_State* L); static int luaDoChallengeCreature(lua_State* L); static int luaDoPlayerAddItem(lua_State* L); - static int luaDoSetCreatureLight(lua_State* L); static int luaDoTargetCombatCondition(lua_State* L); static int luaDoTargetCombatDispel(lua_State* L); static int luaDoTargetCombatHealth(lua_State* L); From 83c57be960a169ce13824e7d0358e034a58672b2 Mon Sep 17 00:00:00 2001 From: Marco Date: Mon, 26 Feb 2024 12:59:05 -0300 Subject: [PATCH 6/6] chore: sort ring multiplication table --- .../actions/items/sweet_mangonaise_elixir.lua | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/data/scripts/actions/items/sweet_mangonaise_elixir.lua b/data/scripts/actions/items/sweet_mangonaise_elixir.lua index 028bbd9457b..fc5d1f33272 100644 --- a/data/scripts/actions/items/sweet_mangonaise_elixir.lua +++ b/data/scripts/actions/items/sweet_mangonaise_elixir.lua @@ -1,18 +1,18 @@ local ringMultiplicationTable = { - [3095] = 3092, - [3096] = 3093, - [6300] = 6299, - [3099] = 3097, - [3088] = 3051, - [3089] = 3052, [3048] = 3048, - [3087] = 3050, - [16264] = 16114, - [3100] = 3098, - [12670] = 12669, - [3086] = 3049, - [3094] = 3091, - [3090] = 3053, + [3049] = 3086, + [3050] = 3087, + [3051] = 3088, + [3052] = 3089, + [3053] = 3090, + [3091] = 3094, + [3092] = 3095, + [3093] = 3096, + [3097] = 3099, + [3098] = 3100, + [6299] = 6300, + [12669] = 12670, + [16114] = 16264, } local sweetMangonaiseElixir = Action()