Skip to content

Commit

Permalink
chore: adjusting file locations (#2798)
Browse files Browse the repository at this point in the history
Removing several duplicate scripts and adjusting the logic of others.
Also added missing achievements.
  • Loading branch information
omarcopires authored Aug 19, 2024
1 parent dadf8fb commit 2c6b196
Show file tree
Hide file tree
Showing 29 changed files with 11 additions and 287 deletions.
13 changes: 0 additions & 13 deletions data-canary/scripts/actions/other/blessing_charms.lua

This file was deleted.

11 changes: 0 additions & 11 deletions data-canary/scripts/actions/other/blueberry_bush.lua

This file was deleted.

50 changes: 0 additions & 50 deletions data-canary/scripts/actions/other/clay_lump.lua

This file was deleted.

16 changes: 0 additions & 16 deletions data-canary/scripts/actions/other/piggy_bank.lua

This file was deleted.

9 changes: 0 additions & 9 deletions data-canary/scripts/actions/other/watch.lua

This file was deleted.

13 changes: 0 additions & 13 deletions data-canary/scripts/actions/other/waterpipe.lua

This file was deleted.

14 changes: 0 additions & 14 deletions data-canary/scripts/movements/cake.lua

This file was deleted.

19 changes: 0 additions & 19 deletions data-canary/scripts/movements/decay_to.lua

This file was deleted.

16 changes: 0 additions & 16 deletions data-canary/scripts/movements/dough.lua

This file was deleted.

54 changes: 0 additions & 54 deletions data-canary/scripts/movements/trap.lua

This file was deleted.

10 changes: 0 additions & 10 deletions data-otservbr-global/scripts/actions/other/check_bless.lua

This file was deleted.

15 changes: 0 additions & 15 deletions data-otservbr-global/scripts/actions/other/lottery_ticket.lua

This file was deleted.

14 changes: 0 additions & 14 deletions data-otservbr-global/scripts/actions/other/party_hat.lua

This file was deleted.

20 changes: 0 additions & 20 deletions data-otservbr-global/scripts/actions/other/sweet_heart.lua

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,29 @@ local config = {
local clayLump = Action()

function clayLump.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local random, tmpItem = math.random(0, 10000) * 0.01
for i = 1, #config do
tmpItem = config[i]
if random >= tmpItem.chance[1] and random < tmpItem.chance[2] then
local randomChance = math.random() * 100
for _, itemConfig in ipairs(config) do
if randomChance >= itemConfig.chance[1] and randomChance < itemConfig.chance[2] then
item:getPosition():sendMagicEffect(CONST_ME_POFF)

if tmpItem.remove then
if itemConfig.remove then
item:remove()
else
item:transform(tmpItem.transformId)
item:transform(itemConfig.transformId)
end

if tmpItem.sound then
player:say(tmpItem.sound, TALKTYPE_MONSTER_SAY, false, player)
if itemConfig.sound then
player:say(itemConfig.sound, TALKTYPE_MONSTER_SAY, false, player)
end

if tmpItem.description then
item:setDescription(tmpItem.description:gsub("|PLAYERNAME|", player:getName()))
if itemConfig.description then
item:setDescription(itemConfig.description:gsub("|PLAYERNAME|", player:getName()))
end

if tmpItem.achievement then
if itemConfig.achievement then
player:addAchievement("Clay Fighter")
player:addAchievementProgress("Clay to Fame", 5)
end

break
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ function partyHat.onUse(player, item, fromPosition, target, toPosition, isHotkey
end

player:getPosition():sendMagicEffect(CONST_ME_GIFT_WRAPS)
player:addAchievementProgress("Party Animal", 200)
return true
end

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
local cake = MoveEvent()

function cake.onAddItem(moveitem, tileitem, position)
-- has to be a candle
if moveitem.itemid ~= 2918 then
return true
end
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 2c6b196

Please sign in to comment.