-
-
Notifications
You must be signed in to change notification settings - Fork 648
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: costume bags to core (#2333)
- Loading branch information
1 parent
31a57b0
commit 80a731f
Showing
3 changed files
with
13 additions
and
59 deletions.
There are no files selected for viewing
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
23 changes: 13 additions & 10 deletions
23
...al/scripts/actions/other/costume_bags.lua → data/scripts/actions/items/costume_bags.lua
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 |
---|---|---|
@@ -1,24 +1,27 @@ | ||
local config = { | ||
[653] = { "orc warrior", "pirate cutthroat", "dworc voodoomaster", "dwarf guard", "minotaur mage", "ogre shaman", "ogre brute", "rat" }, -- common | ||
[655] = { "serpent spawn", "demon", "juggernaut", "behemoth", "ashmunrah", "vexclaw", "grimeleech", "hellflayer", "black sheep" }, -- uncommon | ||
[654] = { "quara hydromancer", "diabolic imp", "banshee", "frost giant", "lich", "vexclaw", "grimeleech", "hellflayer", "ogre shaman", "ogre brute", "pig" }, -- deluxe | ||
[24949] = { "old beholder", "old bug", "old wolf", "old giant spider" }, -- old | ||
[653] = { "orc warrior", "pirate cutthroat", "dworc voodoomaster", "dwarf guard", "minotaur mage", "ogre shaman", "ogre brute", "rat" }, | ||
[654] = { "quara hydromancer", "diabolic imp", "banshee", "frost giant", "lich", "vexclaw", "grimeleech", "hellflayer", "ogre shaman", "ogre brute", "pig" }, | ||
[655] = { "serpent spawn", "demon", "juggernaut", "behemoth", "ashmunrah", "vexclaw", "grimeleech", "hellflayer", "black sheep" }, | ||
[24949] = { "old beholder", "old bug", "old wolf", "old giant spider" }, | ||
} | ||
|
||
local costumeBags = Action() | ||
|
||
function costumeBags.onUse(player, item, fromPosition, target, toPosition, isHotkey) | ||
local monsterNames = config[item.itemid] | ||
if not monsterNames then | ||
local creatures = config[item.itemid] | ||
if not creatures then | ||
return true | ||
end | ||
player:sendTextMessage(MESSAGE_STATUS, "You will stay 5 minutes transformed in a monster!") | ||
doSetMonsterOutfit(player, monsterNames[math.random(#monsterNames)], 300 * 1000) | ||
|
||
player:setMonsterOutfit(creatures[math.random(#creatures)], 5 * 60 * 10 * 1000) | ||
player:addAchievementProgress("Masquerader", 100) | ||
item:getPosition():sendMagicEffect(36) | ||
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) | ||
item:remove() | ||
return true | ||
end | ||
|
||
costumeBags:id(653, 655, 654, 24949) | ||
for k, v in pairs(config) do | ||
costumeBags:id(k) | ||
end | ||
|
||
costumeBags:register() |