diff --git a/data/actions/actions.xml b/data/actions/actions.xml index 0315034145..01d61e4615 100644 --- a/data/actions/actions.xml +++ b/data/actions/actions.xml @@ -19,6 +19,8 @@ + + @@ -80,6 +82,17 @@ + + + + + + + + + + + @@ -140,7 +153,7 @@ - + diff --git a/data/actions/lib/actions.lua b/data/actions/lib/actions.lua index 70c48479aa..a6afa11ca7 100644 --- a/data/actions/lib/actions.lua +++ b/data/actions/lib/actions.lua @@ -1,3 +1,8 @@ +SPECIAL_FOODS = { + [9992] = {"Gulp."}, [9993] = {"Chomp."}, [9994] = {"Chomp."}, [9995] = {"Chomp."}, [9997] = {"Yum."}, + [9998] = {"Munch."}, [9999] = {"Chomp."}, [10000] = {"Mmmm."}, [10001] = {"Smack."} +} + function destroyItem(player, target, toPosition) if type(target) ~= "userdata" or not target:isItem() then return false diff --git a/data/actions/scripts/other/bed_modification_kits.lua b/data/actions/scripts/other/bed_modification_kits.lua index 4b1f0a99ec..4be13504a9 100644 --- a/data/actions/scripts/other/bed_modification_kits.lua +++ b/data/actions/scripts/other/bed_modification_kits.lua @@ -2,8 +2,7 @@ local beds = { [7904] = {{7811, 7812}, {7813, 7814}}, -- green kit [7905] = {{7819, 7820}, {7821, 7822}}, -- yellow kit [7906] = {{7815, 7816}, {7817, 7818}}, -- red kit - [7907] = {{1754, 1755}, {1760, 1761}}, -- removal kit - [20252] = {{20197, 20198}, {20199, 20200}} -- canopy kit + [7907] = {{1754, 1755}, {1760, 1761}} -- removal kit } local function internalBedTransform(item, targetItem, toPosition, itemArray) @@ -34,12 +33,12 @@ function onUse(player, item, fromPosition, target, toPosition, isHotkey) end for _, bed in pairs(beds) do - if bed[1][1] == targetItemId or table.contains({1758, 5502, 18027}, targetItemId) then + if bed[1][1] == targetItemId or table.contains({1758, 5502}, targetItemId) then toPosition:sendMagicEffect(CONST_ME_POFF) toPosition.y = toPosition.y + 1 internalBedTransform(item, target, toPosition, newBed[1]) break - elseif bed[2][1] == targetItemId or table.contains({1756, 5500, 18029}, targetItemId) then + elseif bed[2][1] == targetItemId or table.contains({1756, 5500}, targetItemId) then toPosition:sendMagicEffect(CONST_ME_POFF) toPosition.x = toPosition.x + 1 internalBedTransform(item, target, toPosition, newBed[2]) diff --git a/data/actions/scripts/other/constructionkits.lua b/data/actions/scripts/other/constructionkits.lua index 1e12d56876..f39a6502de 100644 --- a/data/actions/scripts/other/constructionkits.lua +++ b/data/actions/scripts/other/constructionkits.lua @@ -9,8 +9,7 @@ local constructionKits = { [3936] = 3811, [3937] = 2101, [3938] = 3812, [5086] = 5046, [5087] = 5055, [5088] = 5056, [6114] = 6111, [6115] = 6109, [6372] = 6356, [6373] = 6371, [8692] = 8688, [9974] = 9975, [11126] = 11127, [11133] = 11129, [11124] = 11125, - [11205] = 11203, [14328] = 1616, [14329] = 1615, [16075] = 16020, [16099] = 16098, - [20254] = 20295, [20255] = 20297, [20257] = 20299 + [11205] = 11203 } function onUse(player, item, fromPosition, target, toPosition, isHotkey) diff --git a/data/actions/scripts/other/decayto.lua b/data/actions/scripts/other/decayto.lua index 02b2699e65..7eddd1e4e2 100644 --- a/data/actions/scripts/other/decayto.lua +++ b/data/actions/scripts/other/decayto.lua @@ -16,8 +16,7 @@ local decayItems = { [8686] = 8687, [8687] = 8686, [8688] = 8689, [8689] = 8688, [8690] = 8691, [8691] = 8690, [9575] = 9576, [9576] = 9575, [9577] = 9578, [9578] = 9577, [9579] = 9580, [9580] = 9579, [9581] = 9582, [9582] = 9581, [9747] = 9748, - [9748] = 9747, [9749] = 9750, [9750] = 9749, [19691] = 19692, - [19692] = 19691, + [9748] = 9747, [9749] = 9750, [9750] = 9749 } function onUse(player, item, fromPosition, target, toPosition, isHotkey) diff --git a/data/actions/scripts/other/die.lua b/data/actions/scripts/other/die.lua deleted file mode 100644 index 86505a5dc5..0000000000 --- a/data/actions/scripts/other/die.lua +++ /dev/null @@ -1,15 +0,0 @@ -function onUse(player, item, fromPosition, target, toPosition, isHotkey) - local position = item:getPosition() - local value = math.random(1, 6) - local isInGhostMode = player:isInGhostMode() - - position:sendMagicEffect(CONST_ME_CRAPS, isInGhostMode and player) - - local spectators = Game.getSpectators(position, false, true, 3, 3) - for _, spectator in ipairs(spectators) do - player:say(player:getName() .. " rolled a " .. value .. ".", TALKTYPE_MONSTER_SAY, isInGhostMode, spectator, position) - end - - item:transform(5791 + value) - return true -end diff --git a/data/actions/scripts/other/enchanting.lua b/data/actions/scripts/other/enchanting.lua index 5ea484470c..70a1093a39 100644 --- a/data/actions/scripts/other/enchanting.lua +++ b/data/actions/scripts/other/enchanting.lua @@ -71,29 +71,6 @@ local items = { [COMBAT_FIREDAMAGE] = {id = 9933, say = {text = "Take the boots off first."}}, slot = {type = CONST_SLOT_FEET, check = true} }, - [24716] = { -- werewolf amulet - [COMBAT_NONE] = { - id = 24717, - effects = {failure = CONST_ME_POFF, success = CONST_ME_THUNDER}, - message = {text = "The amulet cannot be enchanted while worn."} - }, - slot = {type = CONST_SLOT_NECKLACE, check = true} - }, - [24718] = { -- werewolf helmet - [COMBAT_NONE] = { - id = { - [SKILL_CLUB] = {id = 24783}, - [SKILL_SWORD] = {id = 24783}, - [SKILL_AXE] = {id = 24783}, - [SKILL_DISTANCE] = {id = 24783}, - [SKILL_MAGLEVEL] = {id = 24783} - }, - effects = {failure = CONST_ME_POFF, success = CONST_ME_THUNDER}, - message = {text = "The helmet cannot be enchanted while worn."}, - usesStorage = true - }, - slot = {type = CONST_SLOT_HEAD, check = true} - }, charges = 1000, effect = CONST_ME_MAGIC_RED }, @@ -110,7 +87,6 @@ local items = { [7760] = {combatType = COMBAT_FIREDAMAGE}, -- small enchanted ruby [7761] = {combatType = COMBAT_EARTHDAMAGE}, -- small enchanted emerald [7762] = {combatType = COMBAT_ENERGYDAMAGE}, -- small enchanted amethyst - [24739] = {combatType = COMBAT_NONE} -- moonlight crystals } function onUse(player, item, fromPosition, target, toPosition, isHotkey) diff --git a/data/actions/scripts/other/fluids.lua b/data/actions/scripts/other/fluids.lua index 7ea9f270d3..0e99408e89 100644 --- a/data/actions/scripts/other/fluids.lua +++ b/data/actions/scripts/other/fluids.lua @@ -10,6 +10,7 @@ poison:setParameter(CONDITION_PARAM_TICKINTERVAL, 4000) poison:setParameter(CONDITION_PARAM_FORCEUPDATE, true) local fluidMessage = { + [2] = "Aaaah...", [3] = "Aah...", [4] = "Urgh!", [5] = "Mmmh.", @@ -18,8 +19,7 @@ local fluidMessage = { [11] = "Urgh!", [13] = "Urgh!", [15] = "Aah...", - [19] = "Urgh!", - [43] = "Aaaah..." + [19] = "Urgh!" } function onUse(player, item, fromPosition, target, toPosition, isHotkey) @@ -40,14 +40,14 @@ function onUse(player, item, fromPosition, target, toPosition, isHotkey) if item.type == 0 then player:sendTextMessage(MESSAGE_STATUS_SMALL, "It is empty.") elseif target.uid == player.uid then - if table.contains({3, 15, 43}, item.type) then + if table.contains({3, 15}, item.type) then player:addCondition(drunk) elseif item.type == 4 then player:addCondition(poison) elseif item.type == 7 then player:addMana(math.random(50, 150)) fromPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) - elseif item.type == 10 then + elseif item.type == 2 then player:addHealth(60) fromPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) end diff --git a/data/actions/scripts/other/food.lua b/data/actions/scripts/other/food.lua index 8c3b7d14fd..d3096d68eb 100644 --- a/data/actions/scripts/other/food.lua +++ b/data/actions/scripts/other/food.lua @@ -86,16 +86,7 @@ local foods = { [12418] = {9, "Crunch."}, -- cauliflower [12637] = {55, "Gulp."}, -- ectoplasmic sushi [12638] = {18, "Yum."}, -- dragonfruit - [12639] = {2, "Munch."}, -- peas - [13297] = {20, "Crunch."}, -- haunch of boar - [15405] = {55, "Munch."}, -- sandfish - [15487] = {14, "Urgh."}, -- larvae - [15488] = {15, "Munch."}, -- deepling filet - [16014] = {60, "Mmmm."}, -- anniversary cake - [18397] = {33, "Munch."}, -- mushroom pie - [19737] = {10, "Urgh."}, -- insectoid eggs - [20100] = {15, "Smack."}, -- soft cheese - [20101] = {12, "Smack."} -- rat cheese + [12639] = {2, "Munch."} -- peas } function onUse(player, item, fromPosition, target, toPosition, isHotkey) diff --git a/data/actions/scripts/other/music.lua b/data/actions/scripts/other/music.lua index 5410fa9b07..cd2920a7f5 100644 --- a/data/actions/scripts/other/music.lua +++ b/data/actions/scripts/other/music.lua @@ -29,8 +29,7 @@ local instruments = { [3957] = {effect = CONST_ME_SOUND_YELLOW, itemId = 2681, itemCount = 10, chance = 80, remove = true}, -- cornucopia [5786] = {effects = {failure = CONST_ME_SOUND_RED, success = CONST_ME_SOUND_YELLOW}, monster = "war wolf", chance = 60, remove = true}, -- wooden whistle [6572] = {effect = CONST_ME_SOUND_GREEN, text = "TOOOOOOT", transformId = 13578, decayId = 6572}, -- party trumpet - [6573] = {effect = CONST_ME_SOUND_GREEN, text = "TOOOOOOT", transformId = 13578, decayId = 6573}, -- party trumpet - [13759] = {effect = CONST_ME_SOUND_BLUE} -- small whistle (actual effect is unknown) + [6573] = {effect = CONST_ME_SOUND_GREEN, text = "TOOOOOOT", transformId = 13578, decayId = 6573} -- party trumpet } function onUse(player, item, fromPosition, target, toPosition, isHotkey) diff --git a/data/actions/scripts/other/potions.lua b/data/actions/scripts/other/potions.lua index 7883da5af8..29f668c4b2 100644 --- a/data/actions/scripts/other/potions.lua +++ b/data/actions/scripts/other/potions.lua @@ -29,10 +29,7 @@ local potions = { [8472] = {health = {250, 350}, mana = {100, 200}, vocations = {3, 7}, level = 80, flask = 7635, description = "Only paladins of level 80 or above may drink this fluid."}, [8473] = {health = {650, 850}, vocations = {4, 8}, level = 130, flask = 7635, description = "Only knights of level 130 or above may drink this fluid."}, [8474] = {antidote = true, flask = 7636}, - [8704] = {health = {60, 90}, flask = 7636}, - [26029] = {mana = {425, 575}, vocations = {1, 2, 5, 6}, level = 130, flask = 7635, description = "Only druids and sorcerers of level 130 or above may drink this fluid."}, - [26030] = {health = {420, 580}, mana = {200, 350}, vocations = {3, 7}, level = 130, flask = 7635, description = "Only paladins of level 130 or above may drink this fluid."}, - [26031] = {health = {875, 1125}, vocations = {4, 8}, level = 200, flask = 7635, description = "Only knights of level 200 or above may drink this fluid."} + [8704] = {health = {60, 90}, flask = 7636} } function onUse(player, item, fromPosition, target, toPosition, isHotkey) diff --git a/data/actions/scripts/other/windows.lua b/data/actions/scripts/other/windows.lua index 6d3fa49f97..18b9af6c6e 100644 --- a/data/actions/scripts/other/windows.lua +++ b/data/actions/scripts/other/windows.lua @@ -13,12 +13,7 @@ local windows = { [7027] = 7025, [7025] = 7027, [7028] = 7026, [7026] = 7028, [7031] = 7029, [7029] = 7031, [7032] = 7030, [7030] = 7032, [10264] = 10266, [10266] = 10264, [10265] = 10267, [10267] = 10265, - [10488] = 10490, [10490] = 10488, [10489] = 10491, [10491] = 10489, - [19427] = 19447, [19428] = 19448, [19441] = 19450, [19440] = 19449, - [19443] = 20180, [19444] = 20181, [19445] = 20183, [19446] = 20184, - [19447] = 19427, [19448] = 19428, [19449] = 19440, [19450] = 19441, - [19974] = 20182, [19975] = 20185, [20180] = 19443, [20181] = 19444, - [20182] = 19974, [20183] = 19445, [20184] = 19446, [20185] = 19975 + [10488] = 10490, [10490] = 10488, [10489] = 10491, [10491] = 10489 } function onUse(player, item, fromPosition, target, toPosition, isHotkey) diff --git a/data/actions/scripts/tools/fishing.lua b/data/actions/scripts/tools/fishing.lua index cd5827144f..3e670b6b6c 100644 --- a/data/actions/scripts/tools/fishing.lua +++ b/data/actions/scripts/tools/fishing.lua @@ -1,4 +1,4 @@ -local waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 7236, 10499, 15401, 15402} +local waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 7236, 10499} local lootTrash = {2234, 2238, 2376, 2509, 2667} local lootCommon = {2152, 2167, 2168, 2669, 7588, 7589} local lootRare = {2143, 2146, 2149, 7158, 7159} @@ -38,7 +38,7 @@ function onUse(player, item, fromPosition, target, toPosition, isHotkey) toPosition:sendMagicEffect(CONST_ME_LOSEENERGY) end - if targetId == 493 or targetId == 15402 then + if targetId == 493 then return true end @@ -48,15 +48,7 @@ function onUse(player, item, fromPosition, target, toPosition, isHotkey) return true end - if targetId == 15401 then - target:transform(targetId + 1) - target:decay() - - if math.random(1, 100) >= 97 then - player:addItem(15405, 1) - return true - end - elseif targetId == 7236 then + if targetId == 7236 then target:transform(targetId + 1) target:decay() diff --git a/data/actions/scripts/tools/rope.lua b/data/actions/scripts/tools/rope.lua index 6e71c4c56f..f8e8c1b472 100644 --- a/data/actions/scripts/tools/rope.lua +++ b/data/actions/scripts/tools/rope.lua @@ -2,7 +2,7 @@ local holeId = { 294, 369, 370, 383, 392, 408, 409, 410, 427, 428, 429, 430, 462, 469, 470, 482, 484, 485, 489, 924, 1369, 3135, 3136, 4835, 4837, 7933, 7938, 8170, 8249, 8250, 8251, 8252, 8254, 8255, 8256, 8276, 8277, 8279, 8281, 8284, 8285, 8286, 8323, - 8567, 8585, 8595, 8596, 8972, 9606, 9625, 13190, 14461, 19519, 21536 + 8567, 8585, 8595, 8596, 8972, 9606, 9625 } function onUse(player, item, fromPosition, target, toPosition, isHotkey) @@ -11,7 +11,7 @@ function onUse(player, item, fromPosition, target, toPosition, isHotkey) return false end - if table.contains(ropeSpots, tile:getGround():getId()) or tile:getItemById(14435) then + if table.contains(ropeSpots, tile:getGround():getId()) then if Tile(toPosition:moveUpstairs()):hasFlag(TILESTATE_PROTECTIONZONE) and player:isPzLocked() then player:sendCancelMessage(RETURNVALUE_PLAYERISPZLOCKED) return true diff --git a/data/items/items.xml b/data/items/items.xml index 484e81df45..f00aa97af5 100644 --- a/data/items/items.xml +++ b/data/items/items.xml @@ -15661,7 +15661,7 @@ - + @@ -17694,7 +17694,7 @@ - + @@ -21317,13 +21317,13 @@ - + - + @@ -21335,4 +21335,4 @@ - + \ No newline at end of file diff --git a/data/movements/movements.xml b/data/movements/movements.xml index dc9b28ce40..58d22e643a 100644 --- a/data/movements/movements.xml +++ b/data/movements/movements.xml @@ -190,30 +190,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -349,23 +325,6 @@ - - - - - - - - - - - - - - - - - @@ -406,23 +365,6 @@ - - - - - - - - - - - - - - - - - @@ -460,11 +402,6 @@ - - - - - @@ -571,36 +508,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -860,60 +767,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -979,138 +832,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1199,61 +920,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/data/movements/scripts/walkback.lua b/data/movements/scripts/walkback.lua index 30b00f21f2..bcf274f380 100644 --- a/data/movements/scripts/walkback.lua +++ b/data/movements/scripts/walkback.lua @@ -1,6 +1,15 @@ function onStepIn(creature, item, position, fromPosition) if item.uid > 0 and item.uid <= 65535 then - creature:teleportTo(fromPosition, false) - end + if position == fromPosition then + if creature:isPlayer() then + local temple = creature:getTown():getTemplePosition() + creature:teleportTo(temple, false) + else + creature:remove() + end + else + creature:teleportTo(fromPosition, false) + end + end return true -end +end \ No newline at end of file diff --git a/data/scripts/actions/spellbook.lua b/data/scripts/actions/spellbook.lua index c89682dcac..f2ffb1549f 100644 --- a/data/scripts/actions/spellbook.lua +++ b/data/scripts/actions/spellbook.lua @@ -33,5 +33,5 @@ function spellbook.onUse(player, item, fromPosition, target, toPosition, isHotke return true end -spellbook:id(2175, 6120, 8900, 8901, 8902, 8903, 8904, 8918, 23771) -spellbook:register() +spellbook:id(2175, 6120, 8900, 8901, 8902, 8903, 8904, 8918) +spellbook:register() \ No newline at end of file diff --git a/src/const.h b/src/const.h index 78ec995f19..5b7ab68ed0 100644 --- a/src/const.h +++ b/src/const.h @@ -194,14 +194,14 @@ enum FluidColors_t : uint8_t { enum FluidTypes_t : uint8_t { FLUID_NONE = FLUID_EMPTY, FLUID_WATER = FLUID_BLUE, - FLUID_BLOOD = FLUID_RED, + FLUID_LIFE = FLUID_RED, FLUID_BEER = FLUID_BROWN, FLUID_SLIME = FLUID_GREEN, FLUID_LEMONADE = FLUID_YELLOW, FLUID_MILK = FLUID_WHITE, FLUID_MANA = FLUID_PURPLE, - FLUID_LIFE = FLUID_RED + 8, + FLUID_BLOOD = FLUID_RED + 8, FLUID_OIL = FLUID_BROWN + 8, FLUID_URINE = FLUID_YELLOW + 8, FLUID_COCONUTMILK = FLUID_WHITE + 8, @@ -225,7 +225,7 @@ const uint8_t reverseFluidMap[] = { FLUID_MANA, FLUID_BEER, FLUID_EMPTY, - FLUID_BLOOD, + FLUID_LIFE, FLUID_SLIME, FLUID_EMPTY, FLUID_LEMONADE, @@ -238,13 +238,13 @@ const uint8_t clientToServerFluidMap[] = { FLUID_MANA, FLUID_BEER, FLUID_MUD, - FLUID_BLOOD, + FLUID_LIFE, FLUID_SLIME, FLUID_RUM, FLUID_LEMONADE, FLUID_MILK, FLUID_WINE, - FLUID_LIFE, + FLUID_BLOOD, FLUID_URINE, FLUID_OIL, FLUID_FRUITJUICE,