Skip to content

Commit

Permalink
fix: 8.6 use canary datapack
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas committed Jan 22, 2024
1 parent 122779f commit a881706
Show file tree
Hide file tree
Showing 83 changed files with 1,311 additions and 86,404 deletions.
6 changes: 3 additions & 3 deletions data-canary/monster/bosses/apocalypse.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ monster.loot = {
{ name = "crystal coin", chance = 36600, maxCount = 15 },
{ name = "gold ring", chance = 28000 },
{ name = "golden legs", chance = 15000 },
{ name = "giant ruby", chance = 31500 },
{ name = "giant sapphire", chance = 31500 },
{ name = "giant emerald", chance = 31500 },
{ name = "giant ruby", chance = 31500, version = 1100 },
{ name = "giant sapphire", chance = 31500, version = 1100 },
{ name = "giant emerald", chance = 31500, version = 1100 },
{ name = "ice rapier", chance = 27500 },
{ name = "magic plate armor", chance = 13000 },
{ name = "mastermind shield", chance = 17500 },
Expand Down
4 changes: 2 additions & 2 deletions data-canary/monster/demons/fury.lua
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ monster.loot = {
monster.attacks = {
{ name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -510 },
{ name = "combat", interval = 2000, chance = 10, type = COMBAT_FIREDAMAGE, minDamage = -200, maxDamage = -300, length = 8, spread = 3, effect = CONST_ME_EXPLOSIONAREA, target = false },
{ name = "combat", interval = 2000, chance = 5, type = COMBAT_DEATHDAMAGE, minDamage = -120, maxDamage = -700, length = 8, spread = 3, target = false },
{ name = "combat", interval = 2000, chance = 10, type = COMBAT_DEATHDAMAGE, minDamage = -120, maxDamage = -300, radius = 4, target = false },
{ name = "combat", interval = 2000, chance = 5, effect = CONST_ME_DRAWBLOOD, type = COMBAT_DEATHDAMAGE, minDamage = -120, maxDamage = -700, length = 8, spread = 3, target = false },
{ name = "combat", interval = 2000, chance = 10, effect = CONST_ME_DRAWBLOOD, type = COMBAT_DEATHDAMAGE, minDamage = -120, maxDamage = -300, radius = 4, target = false },
-- {name ="fury skill reducer", interval = 2000, chance = 5, target = false},
{ name = "combat", interval = 2000, chance = 10, type = COMBAT_LIFEDRAIN, minDamage = -120, maxDamage = -300, radius = 3, effect = CONST_ME_HITAREA, target = false },
{ name = "combat", interval = 2000, chance = 10, type = COMBAT_DEATHDAMAGE, minDamage = -125, maxDamage = -250, range = 7, shootEffect = CONST_ANI_SUDDENDEATH, effect = CONST_ME_SMALLCLOUDS, target = false },
Expand Down
4 changes: 2 additions & 2 deletions data-canary/monster/familiars/sorcerer_familiar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ monster.voices = {
monster.loot = {}

monster.attacks = {
{ name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -200 },
{ name = "combat", interval = 2000, chance = 25, type = COMBAT_LIFEDRAIN, minDamage = -90, maxDamage = -150, length = 2, spread = 0, target = false },
{ name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -280 },
{ name = "combat", interval = 2000, chance = 25, type = COMBAT_LIFEDRAIN, minDamage = -90, maxDamage = -150, length = 2, spread = 0, effect = CONST_ME_MAGIC_RED, target = false },
{ name = "combat", interval = 2000, chance = 25, type = COMBAT_ENERGYDAMAGE, minDamage = -190, maxDamage = -210, length = 2, spread = 0, effect = CONST_ME_ENERGYHIT, target = false },
{ name = "summon challenge", interval = 2000, chance = 40, target = false },
}
Expand Down
4 changes: 2 additions & 2 deletions data-canary/monster/magicals/frazzlemaw.lua
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ monster.loot = {
monster.attacks = {
{ name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -400 },
-- bleed
{ name = "condition", type = CONDITION_BLEEDING, interval = 2000, chance = 10, minDamage = -300, maxDamage = -400, radius = 3, target = false },
{ name = "combat", interval = 2000, chance = 10, type = COMBAT_PHYSICALDAMAGE, minDamage = 0, maxDamage = -700, length = 5, spread = 3, effect = CONST_ME_EXPLOSIONAREA, target = false },
{ name = "condition", type = CONDITION_BLEEDING, interval = 2000, chance = 10, minDamage = -300, maxDamage = -400, radius = 3, effect = CONST_ME_DRAWBLOOD, target = false },
{ name = "combat", interval = 2000, chance = 10, type = COMBAT_LIFEDRAIN, minDamage = 0, maxDamage = -700, length = 5, spread = 0, effect = CONST_ME_EXPLOSIONAREA, target = false },
{ name = "combat", interval = 2000, chance = 15, type = COMBAT_PHYSICALDAMAGE, minDamage = 0, maxDamage = -400, radius = 2, shootEffect = CONST_ANI_LARGEROCK, effect = CONST_ME_STONES, target = true },
{ name = "speed", interval = 2000, chance = 15, speedChange = -600, radius = 5, effect = CONST_ME_MAGIC_RED, target = false, duration = 15000 },
{ name = "combat", interval = 2000, chance = 10, type = COMBAT_MANADRAIN, minDamage = -80, maxDamage = -150, radius = 4, effect = CONST_ME_MAGIC_RED, target = false },
Expand Down
8 changes: 4 additions & 4 deletions data-canary/monster/magicals/guzzlemaw.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ monster.loot = {
monster.attacks = {
{ name = "melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -499 },
-- bleed
{ name = "condition", type = CONDITION_BLEEDING, interval = 2000, chance = 10, minDamage = -500, maxDamage = -1000, radius = 3, target = false },
{ name = "combat", interval = 2000, chance = 10, type = COMBAT_PHYSICALDAMAGE, minDamage = 0, maxDamage = -900, length = 8, spread = 3, effect = CONST_ME_EXPLOSIONAREA, target = false },
{ name = "condition", type = CONDITION_BLEEDING, interval = 2000, chance = 10, minDamage = -500, maxDamage = -1000, radius = 3, effect = CONST_ME_DRAWBLOOD, target = false },
{ name = "combat", interval = 2000, chance = 10, type = COMBAT_LIFEDRAIN, minDamage = 0, maxDamage = -900, length = 8, spread = 0, effect = CONST_ME_EXPLOSIONAREA, target = false },
{ name = "combat", interval = 2000, chance = 20, type = COMBAT_PHYSICALDAMAGE, minDamage = 0, maxDamage = -500, radius = 2, shootEffect = CONST_ANI_LARGEROCK, effect = CONST_ME_STONES, target = true },
{ name = "speed", interval = 2000, chance = 15, speedChange = -100, radius = 6, effect = CONST_ME_MAGIC_RED, target = false, duration = 15000 },
{ name = "combat", interval = 2000, chance = 10, type = COMBAT_LIFEDRAIN, minDamage = 0, maxDamage = -800, length = 8, spread = 3, effect = CONST_ME_MAGIC_RED, target = false },
{ name = "speed", interval = 2000, chance = 15, speedChange = -800, radius = 6, effect = CONST_ME_MAGIC_RED, target = false, duration = 15000 },
{ name = "combat", interval = 2000, chance = 10, type = COMBAT_LIFEDRAIN, minDamage = 0, maxDamage = -800, length = 8, spread = 0, effect = CONST_ME_MAGIC_RED, target = false },
}

monster.defenses = {
Expand Down
4 changes: 0 additions & 4 deletions data-canary/monster/vermins/spider.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
if CLIENT_VERSION < 944 then
return
end

local mType = Game.createMonsterType("Spider")
local monster = {}

Expand Down
5 changes: 2 additions & 3 deletions data-canary/scripts/actions/worldboard.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ local communicates = {
}

local scriptConfig = {
itemId = 19236,
registerPositions = {
{ x = 4998, y = 5000, z = 7 },
{ x = 4971, y = 5300, z = 5 },
Expand All @@ -21,7 +20,7 @@ local worldBoard = Action()

function worldBoard.onUse(player, item, fromPosition, target, toPosition, isHotkey)
-- If the item id is not the one on the worldboard, it will return here
if item:getId() ~= scriptConfig.itemId then
if item:getId() ~= ITEM_WORLD_BOARD then
return false
end

Expand All @@ -34,7 +33,7 @@ end
-- Usage: action:position(position, itemId)
-- Explanation: The variable "item id" is optional, the id or the name of the item can be added, the item will be created in the map if it does not exist. If it already exists on the map, it will send a warning informing (in the distro) so the id must be removed so that the warning disappears keeping only the position)
for index, value in pairs(scriptConfig.registerPositions) do
worldBoard:position(value, scriptConfig.itemId)
worldBoard:position(value, ITEM_WORLD_BOARD)
end

worldBoard:register()
5 changes: 3 additions & 2 deletions data-canary/scripts/lib/register_item_tier.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ end
registerItemClassification.Upgrades = function(itemClassification, mask)
if mask.Upgrades then
for _, value in ipairs(mask.Upgrades) do
if value.TierId and value.Price then
itemClassification:addTier(value.TierId, value.Price, value.Core)
if value.TierId then
logger.debug("Registering tier {}, core {}, regular price {}, fusion price {}, transfer price {}", value.TierId, value.Core, value.RegularPrice, value.ConvergenceFustionPrice, value.ConvergenceTransferPrice)
itemClassification:addTier(value.TierId, value.Core, value.RegularPrice, value.ConvergenceFustionPrice, value.ConvergenceTransferPrice)
else
logger.warn("[registerItemClassification.Upgrades] - Item classification failed on adquire TierID or Price attribute.")
end
Expand Down
64 changes: 52 additions & 12 deletions data-canary/scripts/lib/register_monster_type.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ registerMonsterType.description = function(mtype, mask)
mtype:nameDescription(mask.description)
end
end
registerMonsterType.variant = function(mtype, mask)
if mask.variant then
mtype:variant(mask.variant)
end
end
registerMonsterType.experience = function(mtype, mask)
if mask.experience then
mtype:experience(mask.experience)
Expand Down Expand Up @@ -68,9 +73,6 @@ end
registerMonsterType.bosstiary = function(mtype, mask)
local bossClass = nil
if mask.bosstiary then
if mask.bosstiary.bossRaceId then
mtype:bossRaceId(mask.bosstiary.bossRaceId)
end
if mask.bosstiary.bossRace then
if mask.bosstiary.bossRace == RARITY_BANE then
bossClass = "Bane"
Expand All @@ -79,14 +81,17 @@ registerMonsterType.bosstiary = function(mtype, mask)
elseif mask.bosstiary.bossRace == RARITY_NEMESIS then
bossClass = "Nemesis"
end
if bossClass ~= nil then
mtype:bossRace(mask.bosstiary.bossRace, bossClass)
end
local storage = mask.bosstiary.storageCooldown
if storage ~= nil then
mtype:bossStorageCooldown(storage)
end
end
if bossClass == nil then
Spdlog.error(string.format("Attempting to register a bosstiary boss without a race. Boss name: %s", mtype:name()))
return
end
if mask.bosstiary.bossRaceId then
mtype:bossRaceId(mask.bosstiary.bossRaceId)
else
Spdlog.error(string.format("Attempting to register a bosstiary boss without a raceId. Boss name: %s", mtype:name()))
end
mtype:bossRace(mask.bosstiary.bossRace, bossClass)
end
end
registerMonsterType.skull = function(mtype, mask)
Expand Down Expand Up @@ -193,6 +198,9 @@ registerMonsterType.flags = function(mtype, mask)
if mask.flags.canPushCreatures ~= nil then
mtype:canPushCreatures(mask.flags.canPushCreatures)
end
if mask.flags.critChance ~= nil then
mtype:critChance(mask.flags.critChance)
end
if mask.flags.targetDistance then
mtype:targetDistance(math.max(1, mask.flags.targetDistance))
end
Expand Down Expand Up @@ -335,6 +343,10 @@ registerMonsterType.loot = function(mtype, mask)
SortLootByChance(mask.loot)
local lootError = false
for _, loot in pairs(mask.loot) do
if loot.version and CLIENT_VERSION < loot.version then
goto continue
end

local parent = Loot()
if loot.name then
if not parent:setIdFromName(loot.name) then
Expand Down Expand Up @@ -458,26 +470,49 @@ registerMonsterType.loot = function(mtype, mask)
end
end
mtype:addLoot(parent)

::continue::
end
if lootError then
logger.warn("[registerMonsterType.loot] - Monster: {} loot could not correctly be load", mtype:name())
end
end
end

local playerElements = { COMBAT_PHYSICALDAMAGE, COMBAT_ENERGYDAMAGE, COMBAT_EARTHDAMAGE, COMBAT_FIREDAMAGE, COMBAT_ICEDAMAGE, COMBAT_HOLYDAMAGE, COMBAT_DEATHDAMAGE }
registerMonsterType.elements = function(mtype, mask)
local min = configManager.getNumber(configKeys.MIN_ELEMENTAL_RESISTANCE)
local max = configManager.getNumber(configKeys.MAX_ELEMENTAL_RESISTANCE)
local canClip = false
if type(mask.elements) == "table" then
for _, playerElement in pairs(playerElements) do
local found = false
for _, element in pairs(mask.elements) do
if element.type == playerElement then
found = true
canClip = canClip or element.percent ~= 100
break
end
end
canClip = canClip or not found
end
for _, element in pairs(mask.elements) do
if element.type and element.percent then
mtype:addElement(element.type, element.percent)
local value = element.percent
if canClip then
value = math.min(math.max(element.percent, min), max)
end
mtype:addElement(element.type, value)
end
end
end
end
registerMonsterType.reflects = function(mtype, mask)
local max = configManager.getNumber(configKeys.MAX_DAMAGE_REFLECTION)
if type(mask.reflects) == "table" then
for _, reflect in pairs(mask.reflects) do
if reflect.type and reflect.percent then
mtype:addReflect(reflect.type, reflect.percent)
mtype:addReflect(reflect.type, math.min(reflect.percent, max))
end
end
end
Expand Down Expand Up @@ -923,6 +958,11 @@ function readSpell(incomingLua, mtype)

spell:setConditionDamage(incomingLua.condition.totalDamage, incomingLua.condition.totalDamage, 0)
end
local isArea = (incomingLua.radius and incomingLua.radius > 1) or incomingLua.length or incomingLua.spread
if isArea and incomingLua.effect == nil and not string.find(incomingLua.name, "field") then
logger.warn("[readSpell] - Monster {}: Spell {} is area but has no effect. Set to `false` explicitly to supress this alert and hide the effect", mtype:name(), incomingLua.name)
spell:setCombatEffect(CONST_ME_POFF)
end
elseif incomingLua.script then
spell:setScriptName("monster/" .. incomingLua.script .. ".lua")
if incomingLua.interval then
Expand Down
27 changes: 27 additions & 0 deletions data-canary/scripts/lib/register_spells.lua
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,14 @@ AREADIAGONAL_BEAM7 = {
{ 0, 0, 0, 0, 0, 0, 3 },
}

AREADIAGONAL_SQUAREWAVE5_NAGA = {
{ 0, 0, 0, 0, 0 },
{ 0, 1, 1, 0, 0 },
{ 0, 1, 1, 0, 0 },
{ 0, 0, 0, 1, 0 },
{ 0, 0, 0, 0, 3 },
}

--Circles
AREA_CIRCLE2X2 = {
{ 0, 1, 1, 1, 0 },
Expand Down Expand Up @@ -275,6 +283,18 @@ AREA_CIRCLE1X1 = {
{ 0, 1, 0 },
}

AREA_CIRCLE4X4 = {
{ 0, 0, 0, 0, 1, 0, 0, 0, 0 },
{ 0, 0, 0, 1, 1, 1, 0, 0, 0 },
{ 0, 0, 1, 1, 1, 1, 1, 0, 0 },
{ 0, 1, 1, 1, 1, 1, 1, 1, 0 },
{ 1, 1, 1, 1, 3, 1, 1, 1, 1 },
{ 0, 1, 1, 1, 1, 1, 1, 1, 0 },
{ 0, 0, 1, 1, 1, 1, 1, 0, 0 },
{ 0, 0, 0, 1, 1, 1, 0, 0, 0 },
{ 0, 0, 0, 0, 1, 0, 0, 0, 0 },
}

AREA_CIRCLE5X5 = {
{ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0 },
Expand Down Expand Up @@ -326,6 +346,13 @@ AREA_SQUARE1X1 = {
{ 1, 1, 1 },
}

AREA_SQUAREWAVE5_NAGA = {
{ 1, 1, 1 },
{ 1, 1, 1 },
{ 0, 1, 0 },
{ 0, 3, 0 },
}

-- Walls
AREA_WALLFIELD = {
{ 1, 1, 3, 1, 1 },
Expand Down
2 changes: 1 addition & 1 deletion data-canary/scripts/reward_chest/reward_chest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ local chest = Action()
function chest.onUse(player, item, fromPosition, target, toPosition, isHotkey) end

-- Create reward chest in the Montag temple
chest:position({ x = 5003, y = 4996, z = 7 }, 19250)
chest:position({ x = 5003, y = 4996, z = 7 }, ITEM_REWARD_CHEST)

chest:register()
2 changes: 1 addition & 1 deletion data-canary/world/canary-house.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0"?>
<houses>
<house name="NPC" houseid="1" entryx="19977" entryy="19988" entryz="7" rent="0" townid="3" size="15" />
<house name="NPC" houseid="1" entryx="19977" entryy="19988" entryz="7" rent="0" townid="3" size="17" clientid="0" beds="0" />
</houses>
File renamed without changes.
Binary file modified data-canary/world/canary.otbm
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
if CLIENT_VERSION < 780 then
return
end

local mType = Game.createMonsterType("Quara Constrictor Scout")
local monster = {}

Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/monster/aquatics/quara_pincher.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ monster.loot = {
{ name = "warrior helmet", chance = 1460 },
{ name = "crown armor", chance = 280 },
{ name = "glacier robe", chance = 120 },
{ name = "giant shrimp", chance = 40 },
{ name = "giant shrimp", chance = 40, version = 1100},
}

monster.attacks = {
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/monster/aquatics/quara_predator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ monster.loot = {
{ name = "assassin star", chance = 530 },
{ name = "glacier robe", chance = 440 },
{ name = "skull helmet", chance = 390 },
{ name = "giant shrimp", chance = 10 },
{ name = "giant shrimp", chance = 10, version = 1100 },
}

monster.attacks = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ monster.loot = {
{ id = 3053, chance = 410 }, -- time ring
{ name = "talon", chance = 310 },
{ name = "glacier robe", chance = 200 },
{ name = "giant shrimp", chance = 100 },
{ name = "giant shrimp", chance = 100, version = 1100 },
{ name = "twiceslicer", chance = 100 },
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ monster.loot = {
{ name = "glacier robe", chance = 400 },
{ name = "abyss hammer", chance = 320 },
{ name = "frozen plate", chance = 160 },
{ name = "giant shrimp", chance = 80 },
{ name = "giant shrimp", chance = 80, version = 1100 },
}

monster.attacks = {
Expand Down
6 changes: 3 additions & 3 deletions data-otservbr-global/monster/bosses/apocalypse.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ monster.loot = {
{ name = "crystal coin", chance = 36600, maxCount = 15 },
{ name = "gold ring", chance = 28000 },
{ name = "golden legs", chance = 15000 },
{ name = "giant ruby", chance = 31500 },
{ name = "giant sapphire", chance = 31500 },
{ name = "giant emerald", chance = 31500 },
{ name = "giant ruby", chance = 31500, version = 1100 },
{ name = "giant sapphire", chance = 31500, version = 1100 },
{ name = "giant emerald", chance = 31500, version = 1100 },
{ name = "ice rapier", chance = 27500 },
{ name = "magic plate armor", chance = 13000 },
{ name = "mastermind shield", chance = 17500 },
Expand Down
10 changes: 5 additions & 5 deletions data-otservbr-global/monster/demons/infernal_demon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ monster.loot = {
{ name = "crystal coin", chance = 64000 },
{ name = "ultimate health potion", chance = 22860, maxCount = 5 },
{ name = "gold ingot", chance = 18860 },
{ name = "cyan crystal fragment", chance = 7430 },
{ name = "red crystal fragment", chance = 7430 },
{ name = "blue crystal shard", chance = 5710 },
{ name = "cyan crystal fragment", chance = 7430, version = 1100 },
{ name = "red crystal fragment", chance = 7430, version = 1100 },
{ name = "blue crystal shard", chance = 5710, version = 1100 },
{ name = "small diamond", chance = 4570 },
{ name = "blue gem", chance = 4570 },
{ name = "green crystal fragment", chance = 3430 },
{ name = "green crystal fragment", chance = 3430, version = 1100 },
{ name = "magma amulet", chance = 3430 },
{ name = "mercenary sword", chance = 2860 },
{ name = "onyx chip", chance = 2860 },
{ name = "onyx chip", chance = 2860, version = 1100 },
{ name = "war axe", chance = 2860 },
{ name = "giant sword", chance = 2860 },
{ name = "magma boots", chance = 2290 },
Expand Down
6 changes: 3 additions & 3 deletions data-otservbr-global/monster/demons/many_faces.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ monster.voices = {
monster.loot = {
{ name = "crystal coin", chance = 76710 },
{ name = "ultimate health potion", chance = 14920, maxCount = 7 },
{ name = "apron", chance = 7990 },
{ name = "apron", chance = 7990, version = 1100 },
{ name = "hailstorm rod", chance = 7610 },
{ name = "stone skin amulet", chance = 5780 },
{ name = "green gem", chance = 5710 },
Expand All @@ -93,8 +93,8 @@ monster.loot = {
{ id = 33932, chance = 3500 }, -- head many faces
{ name = "glacier shoes", chance = 2510 },
{ name = "glacier robe", chance = 2130 },
{ name = "gruesome fan", chance = 610 },
{ name = "glacial rod", chance = 610 },
{ name = "gruesome fan", chance = 610, version = 1100 },
{ name = "glacial rod", chance = 610, version = 1100 },
{ id = 34109, chance = 20 }, -- bag you desire
}

Expand Down
Loading

0 comments on commit a881706

Please sign in to comment.