Skip to content

Commit

Permalink
Fix version adjustments (#9)
Browse files Browse the repository at this point in the history
Fix version adjustments

- Removed incorrect IDs from higher versions (checked all lua files)
- Fixed items.xml.
- Added Skinning & Dusting systems.
- Added all special foods from 8.6 version.
- Fixed fluids (life fluid and blood), thanks to Celohere (otland)
- Fix bed modification kit
  • Loading branch information
Nottinghster committed Jan 30, 2020
1 parent d06b571 commit 43793ee
Show file tree
Hide file tree
Showing 19 changed files with 61 additions and 438 deletions.
15 changes: 14 additions & 1 deletion data/actions/actions.xml
Expand Up @@ -19,6 +19,8 @@
<action itemid="2554" script="tools/shovel.lua" />
<action itemid="2120" script="tools/rope.lua" />
<action itemid="2553" script="tools/pick.lua" />
<action itemid="5908" script="tools/skinning.lua" />
<action itemid="5942" script="tools/skinning.lua" />

<!-- Transform and decay -->
<action fromid="1479" toid="1480" script="other/decayto.lua" />
Expand Down Expand Up @@ -80,6 +82,17 @@
<action itemid="18397" script="other/food.lua" />
<action itemid="19737" script="other/food.lua" />
<action fromid="20100" toid="20101" script="other/food.lua" />

<!-- Special Foods -->
<action itemid="9992" script="special_foods/rotworm_stew.lua"/>
<action itemid="9993" script="special_foods/hydra_tongue_salad.lua"/>
<action itemid="9994" script="special_foods/roasted_dragon_wings.lua"/>
<action itemid="9995" script="special_foods/fried_tropical_terrorbird.lua"/>
<action itemid="9997" script="special_foods/veggie_casserole.lua"/>
<action itemid="9998" script="special_foods/filled_jalapeno_peppers.lua"/>
<action itemid="9999" script="special_foods/blessed_steak.lua"/>
<action itemid="10000" script="special_foods/carrot_cake.lua"/>
<action itemid="10001" script="special_foods/northern_fishburger.lua"/>

<!-- Other -->
<action itemid="6578" script="other/partyhat.lua" />
Expand Down Expand Up @@ -140,7 +153,7 @@
<action itemid="1775" script="other/fluids.lua" />
<action fromid="2031" toid="2034" script="other/fluids.lua" />
<action fromid="2574" toid="2577" script="other/fluids.lua" />
<action fromid="5792" toid="5797" script="other/die.lua" />
<action fromid="5792" toid="5797" script="other/dice.lua" />
<action itemid="6558" script="other/potions.lua" />
<action fromid="7439" toid="7440" script="other/potions.lua" />
<action itemid="7443" script="other/potions.lua" />
Expand Down
5 changes: 5 additions & 0 deletions 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
Expand Down
7 changes: 3 additions & 4 deletions data/actions/scripts/other/bed_modification_kits.lua
Expand Up @@ -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)
Expand Down Expand Up @@ -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])
Expand Down
3 changes: 1 addition & 2 deletions data/actions/scripts/other/constructionkits.lua
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions data/actions/scripts/other/decayto.lua
Expand Up @@ -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)
Expand Down
15 changes: 0 additions & 15 deletions data/actions/scripts/other/die.lua

This file was deleted.

24 changes: 0 additions & 24 deletions data/actions/scripts/other/enchanting.lua
Expand Up @@ -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
},

Expand All @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions data/actions/scripts/other/fluids.lua
Expand Up @@ -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.",
Expand All @@ -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)
Expand All @@ -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
Expand Down
11 changes: 1 addition & 10 deletions data/actions/scripts/other/food.lua
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions data/actions/scripts/other/music.lua
Expand Up @@ -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)
Expand Down
5 changes: 1 addition & 4 deletions data/actions/scripts/other/potions.lua
Expand Up @@ -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)
Expand Down
7 changes: 1 addition & 6 deletions data/actions/scripts/other/windows.lua
Expand Up @@ -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)
Expand Down
14 changes: 3 additions & 11 deletions 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}
Expand Down Expand Up @@ -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

Expand All @@ -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()

Expand Down
4 changes: 2 additions & 2 deletions data/actions/scripts/tools/rope.lua
Expand Up @@ -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)
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions data/items/items.xml
Expand Up @@ -15661,7 +15661,7 @@
<item id="8843" article="an" name="onion">
<attribute key="weight" value="140" />
</item>
<item id="8844" name="jalape�o pepper" article="a">
<item id="8844" name="jalape�o pepper" article="a">
<attribute key="weight" value="30" />
</item>
<item id="8845" article="a" name="beetroot">
Expand Down Expand Up @@ -17694,7 +17694,7 @@
<attribute key="description" value="This one would be quite healthy if it wasn't for all the melted cheese on top." />
<attribute key="weight" value="1100" />
</item>
<item id="9998" article="a" name="filled jalape�o peppers">
<item id="9998" article="a" name="filled jalape�o peppers">
<attribute key="description" value="The creamy cheese makes a great combination with the spicy peppers." />
<attribute key="weight" value="650" />
</item>
Expand Down Expand Up @@ -21317,13 +21317,13 @@
<attribute key="weight" value="2500" />
</item>
<item id="30001" name="water" />
<item id="30002" name="blood" />
<item id="30002" name="lifefluid" />
<item id="30003" name="beer" />
<item id="30004" name="slime" />
<item id="30005" name="lemonade" />
<item id="30006" name="milk" />
<item id="30007" name="manafluid" />
<item id="30010" name="lifefluid" />
<item id="30010" name="blood" />
<item id="30011" name="oil" />
<item id="30013" name="urine" />
<item id="30014" name="coconut milk" />
Expand All @@ -21335,4 +21335,4 @@
<item id="30028" name="swamp" />
<item id="30035" name="tea" />
<item id="30043" name="mead" />
</items>
</items>

0 comments on commit 43793ee

Please sign in to comment.