From 8e184cacd72bf297596e5aff84b3a227de07cf66 Mon Sep 17 00:00:00 2001 From: Marco Date: Wed, 6 Mar 2024 15:11:51 -0300 Subject: [PATCH] refactor: sweetheart ring to core and adjust conditional in romantic ring script. --- .../scripts/actions/other/sweet_heart.lua | 20 ------------------- .../actions/items}/sweetheart_ring.lua | 4 ++-- 2 files changed, 2 insertions(+), 22 deletions(-) delete mode 100644 data-otservbr-global/scripts/actions/other/sweet_heart.lua rename {data-canary/scripts/actions/other => data/scripts/actions/items}/sweetheart_ring.lua (91%) diff --git a/data-otservbr-global/scripts/actions/other/sweet_heart.lua b/data-otservbr-global/scripts/actions/other/sweet_heart.lua deleted file mode 100644 index 1a2c7caf277..00000000000 --- a/data-otservbr-global/scripts/actions/other/sweet_heart.lua +++ /dev/null @@ -1,20 +0,0 @@ -local sweetHeart = Action() - -function sweetHeart.onUse(cid, item, fromPosition, itemEx, toPosition) - local player = Player(cid) - if not player then - return false - end - - if player:getSlotItem(CONST_SLOT_RING) then - if player:getSlotItem(CONST_SLOT_RING):getId() == item:getId() then - player:getPosition():sendMagicEffect(CONST_ME_HEARTS) - end - else - return false - end - return true -end - -sweetHeart:id(21955) -sweetHeart:register() diff --git a/data-canary/scripts/actions/other/sweetheart_ring.lua b/data/scripts/actions/items/sweetheart_ring.lua similarity index 91% rename from data-canary/scripts/actions/other/sweetheart_ring.lua rename to data/scripts/actions/items/sweetheart_ring.lua index a464ff839ad..5f122069ac1 100644 --- a/data-canary/scripts/actions/other/sweetheart_ring.lua +++ b/data/scripts/actions/items/sweetheart_ring.lua @@ -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)