Skip to content

Commit

Permalink
Merge branch 'main' into pr/1599
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas committed Sep 22, 2023
2 parents 3537fd0 + b16bd63 commit 01994f1
Show file tree
Hide file tree
Showing 19 changed files with 1,125 additions and 1,059 deletions.
2 changes: 1 addition & 1 deletion data-canary/scripts/actions/other/cask_kegs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ local targetIdList = {
local flasks = Action()

function flasks.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if not target or not player:getTile():getHouse() then
if not target or not target:getItem() then
return false
end

Expand Down
2 changes: 1 addition & 1 deletion data-canary/scripts/actions/other/potions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ local setting = {
local potions = Action()

function potions.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if type(target) == "userdata" and not target:isPlayer() then
if not target or type(target) == "userdata" and not target:isPlayer() then
return false
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ monster.Bestiary = {
monster.health = 4000
monster.maxHealth = 4000
monster.race = "blood"
monster.corpse = 28668
monster.corpse = 28667
monster.speed = 150
monster.manaCost = 0

Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/scripts/actions/other/cask_kegs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ local targetIdList = {
local flasks = Action()

function flasks.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if not target then
if not target or not target:getItem() then
return false
end

Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/scripts/actions/other/potions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ local potions = {
local flaskPotion = Action()

function flaskPotion.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if type(target) == "userdata" and not target:isPlayer() then
if not target or type(target) == "userdata" and not target:isPlayer() then
return false
end

Expand Down
26 changes: 0 additions & 26 deletions data-otservbr-global/scripts/actions/other/transform_to.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ local transformItems = {
[2663] = 2662, -- cuckoo clock
[2772] = 2773,
[2773] = 2772, -- lever
[2907] = 2908,
[2908] = 2907, -- wall lamp
[2909] = 2910,
[2910] = 2909, -- wall lamp
[2911] = 2912,
[2912] = 2911, -- candelabrum
[2914] = 2915,
Expand All @@ -54,12 +50,6 @@ local transformItems = {
[2931] = 2930, -- torch bearer
[2934] = 2935,
[2935] = 2934, -- table lamp
[2936] = 2937,
[2937] = 2936, -- wall lamp
[2938] = 2939,
[2939] = 2938, -- wall lamp
[2944] = 2945,
[2945] = 2944, -- wall lamp
[2977] = 2978,
[2978] = 2977, -- pumpkinhead
[3046] = 3047,
Expand Down Expand Up @@ -403,18 +393,6 @@ local transformItems = {
[38525] = 38523, -- naga lamp
[38526] = 38528,
[38528] = 38526, -- basin with a glowing flower
[38529] = 38530,
[38530] = 38529, -- wall lamp
[38531] = 38532,
[38532] = 38531, -- wall lamp
[38533] = 38534,
[38534] = 38533, -- wall lamp
[38535] = 38536,
[38536] = 38535, -- wall lamp
[38623] = 38624,
[38624] = 38623, -- wall lamp
[38625] = 38626,
[38626] = 38625, -- wall lamp
[38677] = 38680,
[38704] = 38705, -- beaver of wisdom
[38827] = 38828,
Expand All @@ -428,10 +406,6 @@ local transformItems = {
[39443] = 39444,
[39444] = 39445, -- knightly fire bowl
[39445] = 39443, -- knightly fire bowl
[39446] = 39447,
[39447] = 39446, -- knightly wall lamp
[39496] = 39497,
[39497] = 39496, -- knightly sword lamp
[39498] = 39499,
[39499] = 39498, -- knightly candelabra
[39500] = 39501,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,21 @@ local function revertHorror()
end

local function changeHorror()
local melting = Tile(Position(32267, 31071, 14)):getTopCreature()
local meltingTile = Tile(Position(32267, 31071, 14))
if not meltingTile then
logger.error("Tile not exist on position '{}'", Position(32267, 31071, 14):toString())
return
end

local meltingCreature = meltingTile:getTopCreature()
local pos = 0
local specs, spec = Game.getSpectators(Position(32269, 31091, 14), false, false, 12, 12, 12, 12)
for i = 1, #specs do
spec = specs[i]
if spec:isMonster() and spec:getName():lower() == "solid frozen horror" then
pos = spec:getPosition()
spec:teleportTo(Position(32267, 31071, 14))
melting:teleportTo(pos)
meltingCreature:teleportTo(pos)
end
end
addEvent(revertHorror, 20 * 1000)
Expand Down
1,968 changes: 984 additions & 984 deletions data-otservbr-global/world/otservbr-house.xml

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions data/XML/mounts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,9 @@
<mount id="210" clientid="1615" name="Frostbringer" speed="10" premium="no" type="store" />
<mount id="211" clientid="1616" name="Winterstride" speed="10" premium="no" type="store" />
<mount id="212" clientid="1617" name="Icebreacher" speed="10" premium="no" type="store" />
<mount id="213" clientid="1672" name="Boisterous Bull" speed="10" premium="no" type="store" />
<mount id="214" clientid="1673" name="Surly Steer" speed="10" premium="no" type="store" />
<mount id="215" clientid="1674" name="Obstinate Ox" speed="10" premium="no" type="store" />
<mount id="216" clientid="1677" name="Darkfire Devourer" speed="10" premium="no" type="store" />
<mount id="217" clientid="1682" name="Spirit of Purity" speed="10" premium="yes" type="quest" />
</mounts>
6 changes: 6 additions & 0 deletions data/XML/outfits.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@
<outfit type="0" looktype="1598" name="Ancient Aucar" premium="yes" unlocked="no" enabled="yes" from="quest" />
<outfit type="0" looktype="1613" name="Frost Tracer" premium="no" unlocked="no" enabled="yes" from="store" />
<outfit type="0" looktype="1619" name="Armoured Archer" premium="no" unlocked="no" enabled="yes" from="store" />
<outfit type="0" looktype="1663" name="Decaying Defender" premium="yes" unlocked="no" enabled="yes" from="quest" />
<outfit type="0" looktype="1676" name="Darklight Evoker" premium="no" unlocked="no" enabled="yes" from="store" />
<outfit type="0" looktype="1681" name="Flamefury Mage" premium="no" unlocked="no" enabled="yes" from="store" />

<!-- Male outfits -->
<outfit type="1" looktype="128" name="Citizen" premium="no" unlocked="yes" enabled="yes" />
Expand Down Expand Up @@ -227,4 +230,7 @@
<outfit type="1" looktype="1597" name="Ancient Aucar" premium="yes" unlocked="no" enabled="yes" from="quest" />
<outfit type="1" looktype="1612" name="Frost Tracer" premium="no" unlocked="no" enabled="yes" from="store" />
<outfit type="1" looktype="1618" name="Armoured Archer" premium="no" unlocked="no" enabled="yes" from="store" />
<outfit type="1" looktype="1662" name="Decaying Defender" premium="yes" unlocked="no" enabled="yes" from="quest" />
<outfit type="1" looktype="1675" name="Darklight Evoker" premium="no" unlocked="no" enabled="yes" from="store" />
<outfit type="1" looktype="1680" name="Flamefury Mage" premium="no" unlocked="no" enabled="yes" from="store" />
</outfits>
112 changes: 83 additions & 29 deletions data/items/items.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5532,10 +5532,18 @@
<attribute key="primarytype" value="tools"/>
<attribute key="weight" value="50"/>
</item>
<item id="2907" article="a" name="wall lamp"/>
<item id="2908" article="a" name="lit wall lamp"/>
<item id="2909" article="a" name="wall lamp"/>
<item id="2910" article="a" name="lit wall lamp"/>
<item id="2907" article="a" name="wall lamp">
<attribute key="transformOnUse" value="2908"/>
</item>
<item id="2908" article="a" name="lit wall lamp">
<attribute key="transformOnUse" value="2907"/>
</item>
<item id="2909" article="a" name="wall lamp">
<attribute key="transformOnUse" value="2910"/>
</item>
<item id="2910" article="a" name="lit wall lamp">
<attribute key="transformOnUse" value="2909"/>
</item>
<item id="2911" article="a" name="candelabrum">
<attribute key="primarytype" value="light sources"/>
<attribute key="stopduration" value="1"/>
Expand Down Expand Up @@ -5647,10 +5655,18 @@
<attribute key="primarytype" value="decoration"/>
</item>
<item id="2935" article="a" name="lit table lamp"/>
<item id="2936" article="a" name="wall lamp"/>
<item id="2937" article="a" name="lit wall lamp"/>
<item id="2938" article="a" name="wall lamp"/>
<item id="2939" article="a" name="lit wall lamp"/>
<item id="2936" article="a" name="wall lamp">
<attribute key="transformOnUse" value="2937"/>
</item>
<item id="2937" article="a" name="lit wall lamp">
<attribute key="transformOnUse" value="2936"/>
</item>
<item id="2938" article="a" name="wall lamp">
<attribute key="transformOnUse" value="2939"/>
</item>
<item id="2939" article="a" name="lit wall lamp">
<attribute key="transformOnUse" value="2938"/>
</item>
<item id="2940" article="a" name="torch bearer">
<attribute key="primarytype" value="wall hangings"/>
</item>
Expand All @@ -5663,10 +5679,18 @@
<item id="2943" article="a" name="lit torch bearer">
<attribute key="primarytype" value="wall hangings"/>
</item>
<item id="2944" article="a" name="wall lamp"/>
<item id="2945" article="a" name="lit wall lamp"/>
<item id="2946" article="a" name="wall lamp"/>
<item id="2947" article="a" name="lit wall lamp"/>
<item id="2944" article="a" name="wall lamp">
<attribute key="transformOnUse" value="2945"/>
</item>
<item id="2945" article="a" name="lit wall lamp">
<attribute key="transformOnUse" value="2944"/>
</item>
<item id="2946" article="a" name="wall lamp">
<attribute key="transformOnUse" value="2947"/>
</item>
<item id="2947" article="a" name="lit wall lamp">
<attribute key="transformOnUse" value="2946"/>
</item>
<item id="2948" article="a" name="wooden flute">
<attribute key="primarytype" value="musical instruments"/>
<attribute key="weight" value="200"/>
Expand Down Expand Up @@ -21575,7 +21599,9 @@
<attribute key="primarytype" value="metals"/>
<attribute key="weight" value="250"/>
</item>
<item id="9116" article="a" name="ladder"/>
<item id="9116" article="a" name="ladder">
<attribute key="type" value="ladder"/>
</item>
<item id="9117" article="a" name="unknown item"/>
<item id="9118" name="RESERVED SPRITE"/>
<item id="9119" article="a" name="crucible">
Expand Down Expand Up @@ -48691,13 +48717,13 @@
<attribute key="fluidsource" value="blood"/>
<attribute key="duration" value="10"/>
<attribute key="decayTo" value="28664"/>
<attribute key="containersize" value="20"/>
<attribute key="containersize" value="32"/>
</item>
<item id="28664" article="a" name="dead true dawnfire asura">
<attribute key="fluidsource" value="blood"/>
<attribute key="duration" value="300"/>
<attribute key="decayTo" value="28665"/>
<attribute key="containersize" value="20"/>
<attribute key="containersize" value="32"/>
</item>
<item id="28665" article="a" name="dead true dawnfire asura">
<attribute key="duration" value="300"/>
Expand All @@ -48712,13 +48738,13 @@
<attribute key="fluidsource" value="blood"/>
<attribute key="duration" value="10"/>
<attribute key="decayTo" value="28668"/>
<attribute key="containersize" value="20"/>
<attribute key="containersize" value="32"/>
</item>
<item id="28668" article="a" name="dead true frost flower asura">
<attribute key="fluidsource" value="blood"/>
<attribute key="duration" value="300"/>
<attribute key="decayTo" value="28669"/>
<attribute key="containersize" value="20"/>
<attribute key="containersize" value="32"/>
</item>
<item id="28669" article="a" name="dead true frost flower asura">
<attribute key="duration" value="300"/>
Expand Down Expand Up @@ -64974,20 +65000,44 @@
<item fromid="38522" toid="38525" article="a" name="naga lamp"/>
<item id="38526" article="a" name="basin with a glowing flower"/>
<item id="38528" article="a" name="basin with flower"/>
<item id="38529" article="a" name="wall lamp"/>
<item id="38530" article="a" name="lit wall lamp"/>
<item id="38531" article="a" name="wall lamp"/>
<item id="38532" article="a" name="lit wall lamp"/>
<item id="38533" article="a" name="wall lamp"/>
<item id="38534" article="a" name="lit wall lamp"/>
<item id="38535" article="a" name="wall lamp"/>
<item id="38536" article="a" name="lit wall lamp"/>
<item id="38529" article="a" name="wall lamp">
<attribute key="transformOnUse" value="38530"/>
</item>
<item id="38530" article="a" name="lit wall lamp">
<attribute key="transformOnUse" value="38529"/>
</item>
<item id="38531" article="a" name="wall lamp">
<attribute key="transformOnUse" value="38532"/>
</item>
<item id="38532" article="a" name="lit wall lamp">
<attribute key="transformOnUse" value="38531"/>
</item>
<item id="38533" article="a" name="wall lamp">
<attribute key="transformOnUse" value="38534"/>
</item>
<item id="38534" article="a" name="lit wall lamp">
<attribute key="transformOnUse" value="38533"/>
</item>
<item id="38535" article="a" name="wall lamp">
<attribute key="transformOnUse" value="38536"/>
</item>
<item id="38536" article="a" name="lit wall lamp">
<attribute key="transformOnUse" value="38535"/>
</item>
<item fromid="38537" toid="38613" article="a" name="big naga statue"/>
<item fromid="38614" toid="38622" name="mangrove branches"/>
<item id="38623" article="a" name="wall lamp"/>
<item id="38624" article="a" name="lit wall lamp"/>
<item id="38625" article="a" name="wall lamp"/>
<item id="38626" article="a" name="lit wall lamp"/>
<item id="38623" article="a" name="wall lamp">
<attribute key="transformOnUse" value="38624"/>
</item>
<item id="38624" article="a" name="lit wall lamp">
<attribute key="transformOnUse" value="38623"/>
</item>
<item id="38625" article="a" name="wall lamp">
<attribute key="transformOnUse" value="38626"/>
</item>
<item id="38626" article="a" name="lit wall lamp">
<attribute key="transformOnUse" value="38625"/>
</item>
<item id="38633" name="peacock feather">
<attribute key="primarytype" value="quest items"/>
<attribute key="weight" value="20"/>
Expand Down Expand Up @@ -66632,19 +66682,23 @@
</item>
<item id="39446" article="a" name="knightly wall lamp">
<attribute key="primarytype" value="furniture"/>
<attribute key="transformOnUse" value="39447"/>
<attribute key="wrapableto" value="23398"/>
</item>
<item id="39447" article="a" name="knightly wall lamp">
<attribute key="primarytype" value="furniture"/>
<attribute key="transformOnUse" value="39446"/>
<attribute key="wrapableto" value="23398"/>
</item>
<item fromid="39484" toid="39495" name="some crystals"/>
<item id="39496" article="a" name="knightly sword lamp">
<attribute key="primarytype" value="furniture"/>
<attribute key="transformOnUse" value="39497"/>
<attribute key="wrapableto" value="23398"/>
</item>
<item id="39497" article="a" name="knightly sword lamp">
<attribute key="primarytype" value="furniture"/>
<attribute key="transformOnUse" value="39496"/>
<attribute key="wrapableto" value="23398"/>
</item>
<item id="39498" article="a" name="knightly candelabra">
Expand Down
4 changes: 2 additions & 2 deletions data/libs/functions/container.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ end
function Container:addLoot(loot)
for itemId, item in pairs(loot) do
logger.debug("[Container:addLoot] - Adding loot item id: {} to container id: {}", itemId, self:getId())
local tmpItem = self:addItem(itemId, item.count)
local tmpItem = self:addItem(itemId, item.count, INDEX_WHEREEVER, FLAG_NOLIMIT)
if tmpItem then
if tmpItem:isContainer() and item.childLoot then
if not tmpItem:addLoot(item.childLoot) then
Expand All @@ -32,7 +32,7 @@ function Container:addLoot(loot)
tmpItem:setText(item.text)
end
else
Spdlog.warn(("Container:addLoot: failed to add item: %s"):format(ItemType(itemId):getName()))
logger.warn("Container:addLoot: failed to add item: {}, to corpse {} with id {}", ItemType(itemId):getName(), self:getName(), self:getId())
end

::continue::
Expand Down
5 changes: 5 additions & 0 deletions data/libs/functions/game.lua
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,10 @@ function Game.getStorageValue(key)
end

function Game.setStorageValue(key, value)
if key == nil then
logger.error("[Game.setStorageValue] Key is nil")
return
end

globalStorageTable[key] = value
end
Loading

0 comments on commit 01994f1

Please sign in to comment.