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 24203f0 commit 603bb66
Show file tree
Hide file tree
Showing 25 changed files with 212 additions and 86,314 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
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
Expand Up @@ -99,5 +99,5 @@ function adventurersStone.onUse(player, item, fromPosition, target, toPosition,
return true
end

adventurersStone:id(16277)
adventurersStone:id(ITEM_ADVENTURERS_STONE)
adventurersStone:register()
Loading

0 comments on commit 603bb66

Please sign in to comment.