forked from opentibiabr/canary
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: large seashell and move to core
- Loading branch information
1 parent
e0bfe4f
commit a3ca460
Showing
3 changed files
with
30 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,6 @@ Storage = { | |
}, | ||
}, | ||
|
||
DelayLargeSeaShell = 30002, | ||
Imbuement = 30004, | ||
} | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
local largeSeashell = Action() | ||
|
||
function largeSeashell.onUse(player, item, fromPosition, target, toPosition, isHotkey) | ||
if player:hasExhaustion("delay-large-seashell") then | ||
player:say("You have already opened a shell today.", TALKTYPE_MONSTER_SAY, false, player, item:getPosition()) | ||
return true | ||
end | ||
|
||
local chance = math.random(100) | ||
local message = "Nothing is inside." | ||
|
||
if chance <= 16 then | ||
doTargetCombatHealth(0, player, COMBAT_PHYSICALDAMAGE, -200, -200, CONST_ME_NONE) | ||
message = "Ouch! You squeezed your fingers." | ||
elseif chance > 16 and chance <= 64 then | ||
Game.createItem(math.random(281, 282), 1, player:getPosition()) | ||
message = "You found a beautiful pearl." | ||
player:addAchievementProgress("Shell Seeker", 100) | ||
end | ||
|
||
player:setExhaustion("delay-large-seashell", 20 * 60 * 60) | ||
player:say(message, TALKTYPE_MONSTER_SAY, false, player, item:getPosition()) | ||
item:transform(198) | ||
item:decay() | ||
item:getPosition():sendMagicEffect(CONST_ME_BUBBLES) | ||
return true | ||
end | ||
|
||
largeSeashell:id(197) | ||
largeSeashell:register() |