Skip to content

Commit

Permalink
Merge branch 'main' into improvement-onlook
Browse files Browse the repository at this point in the history
  • Loading branch information
omarcopires committed Sep 24, 2024
2 parents 42a853a + ae39682 commit 4307c97
Show file tree
Hide file tree
Showing 217 changed files with 8,036 additions and 984 deletions.
71 changes: 35 additions & 36 deletions data-canary/monster/magicals/guzzlemaw.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ monster.Bestiary = {
CharmsPoints = 50,
Stars = 4,
Occurrence = 0,
Locations = "Guzzlemaw Valley, and a single spawn in a tower in Upper Roshamuul \z
(south of the Depot and west of the entrance to Roshamuul Prison).",
Locations = "Guzzlemaw Valley, and a single spawn in a tower in Upper Roshamuul (south of the Depot and west of the entrance to Roshamuul Prison).",
}

monster.health = 6400
Expand Down Expand Up @@ -64,7 +63,6 @@ monster.flags = {
canWalkOnEnergy = true,
canWalkOnFire = true,
canWalkOnPoison = true,
pet = false,
}

monster.light = {
Expand All @@ -78,63 +76,64 @@ monster.voices = {
}

monster.loot = {
{ id = 3031, chance = 100000, maxCount = 100 }, -- gold coin
{ id = 3035, chance = 100000, maxCount = 7 }, -- platinum coin
{ id = 3104, chance = 10700 }, -- banana skin
{ id = 3110, chance = 10500 }, -- piece of iron
{ id = 3111, chance = 9500 }, -- fishbone
{ name = "gold coin", chance = 100000, maxCount = 100 },
{ name = "platinum coin", chance = 100000, maxCount = 7 },
{ name = "banana skin", chance = 10700 },
{ name = "piece of iron", chance = 10500 },
{ name = "fishbone", chance = 9500 },
{ id = 3114, chance = 10400 }, -- skull
{ id = 3115, chance = 9200 }, -- bone
{ id = 3116, chance = 4500 }, -- big bone
{ id = 3265, chance = 2700 }, -- two handed sword
{ name = "two handed sword", chance = 2700 },
{ id = 3578, chance = 7000, maxCount = 3 }, -- fish
{ id = 3582, chance = 10000 }, -- ham
{ id = 5880, chance = 3000 }, -- iron ore
{ id = 5895, chance = 5000 }, -- fish fin
{ id = 5925, chance = 5700 }, -- hardened bone
{ name = "ham", chance = 10000 },
{ name = "iron ore", chance = 3000 },
{ name = "fish fin", chance = 5000 },
{ name = "hardened bone", chance = 5700 },
{ id = 5951, chance = 9400 }, -- fish tail
{ id = 7404, chance = 1000 }, -- assassin dagger
{ id = 7407, chance = 2000 }, -- haunted blade
{ id = 7418, chance = 380 }, -- nightmare blade
{ id = 238, chance = 17000, maxCount = 3 }, -- great mana potion
{ id = 239, chance = 18500, maxCount = 2 }, -- great health potion
{ id = 10389, chance = 1200 }, -- sai
{ id = 16120, chance = 3000 }, -- violet crystal shard
{ id = 16123, chance = 12000, maxCount = 2 }, -- brown crystal splinter
{ id = 16126, chance = 7600 }, -- red crystal fragment
{ name = "assassin dagger", chance = 1000 },
{ name = "haunted blade", chance = 2000 },
{ name = "nightmare blade", chance = 380 },
{ name = "great mana potion", chance = 17000, maxCount = 3 },
{ name = "great health potion", chance = 18500, maxCount = 2 },
{ name = "sai", chance = 1200 },
{ name = "violet crystal shard", chance = 3000 },
{ name = "brown crystal splinter", chance = 12000, maxCount = 2 },
{ name = "red crystal fragment", chance = 7600 },
{ id = 16279, chance = 12000 }, -- crystal rubbish
{ id = 20062, chance = 920 }, -- cluster of solace
{ id = 20198, chance = 15000 }, -- frazzle tongue
{ id = 20199, chance = 14000 }, -- frazzle skin
{ name = "cluster of solace", chance = 8920 },
{ name = "frazzle tongue", chance = 15000 },
{ name = "frazzle skin", chance = 14000 },
}

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 = {
defense = 50,
armor = 50,
armor = 74,
mitigation = 2.31,
{ name = "combat", interval = 2000, chance = 20, type = COMBAT_HEALING, minDamage = 250, maxDamage = 425, effect = CONST_ME_HITBYPOISON, target = false },
}

monster.elements = {
{ type = COMBAT_PHYSICALDAMAGE, percent = 10 },
{ type = COMBAT_ENERGYDAMAGE, percent = 5 },
{ type = COMBAT_EARTHDAMAGE, percent = 15 },
{ type = COMBAT_FIREDAMAGE, percent = 5 },
{ type = COMBAT_PHYSICALDAMAGE, percent = 5 },
{ type = COMBAT_ENERGYDAMAGE, percent = 15 },
{ type = COMBAT_EARTHDAMAGE, percent = 20 },
{ type = COMBAT_FIREDAMAGE, percent = 10 },
{ type = COMBAT_LIFEDRAIN, percent = 0 },
{ type = COMBAT_MANADRAIN, percent = 0 },
{ type = COMBAT_DROWNDAMAGE, percent = 0 },
{ type = COMBAT_ICEDAMAGE, percent = 5 },
{ type = COMBAT_HOLYDAMAGE, percent = 0 },
{ type = COMBAT_DEATHDAMAGE, percent = 5 },
{ type = COMBAT_HOLYDAMAGE, percent = -5 },
{ type = COMBAT_DEATHDAMAGE, percent = 10 },
}

monster.immunities = {
Expand Down
8 changes: 0 additions & 8 deletions data-canary/scripts/actions/tools/kitchen_knife.lua

This file was deleted.

8 changes: 0 additions & 8 deletions data-canary/scripts/actions/tools/sickle.lua

This file was deleted.

100 changes: 54 additions & 46 deletions data-canary/scripts/lib/register_actions.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
local holeId = { 294, 369, 370, 385, 394, 411, 412, 413, 432, 433, 435, 8709, 594, 595, 615, 609, 610, 615, 1156, 482, 483, 868, 874, 4824, 7768, 433, 432, 413, 7767, 411, 370, 369, 7737, 7755, 7768, 7767, 7515, 7516, 7517, 7518, 7519, 7520, 7521, 7522, 7762, 8144, 8690, 8709, 12203, 12961, 17239, 19220, 23364 } -- usable rope holes, for rope spots see global.lua
local wildGrowth = { 2130, 2130, 2982, 2524, 2030, 2029, 10182 } -- wild growth destroyable by machete
local jungleGrass = { [3696] = 3695, [3702] = 3701, [17153] = 17151 } -- grass destroyable by machete
local groundIds = { 354, 355 } -- pick usable ground
local holeId = { 294, 369, 370, 385, 394, 411, 412, 413, 432, 433, 435, 482, 483, 594, 595, 609, 610, 615, 868, 874, 1156, 4824, 7515, 7516, 7517, 7518, 7519, 7520, 7521, 7522, 7737, 7755, 7762, 7767, 7768, 8144, 8690, 8709, 12203, 12961, 17239, 19220, 23364 } -- usable rope holes, for rope spots see global.lua
local wildGrowth = { 2130, 3635, 30224 } -- wild growth destroyable by machete
local jungleGrass = { -- grass destroyable by machete
[3696] = 3695,
[3702] = 3701,
[17153] = 17151,
}
local groundIds = { 354, 355 } -- pick usable grounds
local sandIds = { 231 } -- desert sand
local fruits = { 2673, 2674, 2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 2684, 2685, 5097, 8839, 8840, 8841 } -- fruits to make decorated cake with knife
local fruits = { 3584, 3585, 3586, 3587, 3588, 3589, 3590, 3591, 3592, 3593, 3595, 3596, 5096, 8011, 8012, 8013 } -- fruits to make decorated cake with knife
local holes = { 593, 606, 608, 867, 21341 } -- holes opened by shovel
local ropeSpots = { 386, 421, 12935, 12936, 14238, 17238, 21501, 21965, 21966, 21967, 21968, 23363 }

function destroyItem(player, target, toPosition)
function destroyItem(player, item, fromPosition, target, toPosition, isHotkey)
if type(target) ~= "userdata" or not target:isItem() then
return false
end
Expand Down Expand Up @@ -40,10 +45,8 @@ function destroyItem(player, target, toPosition)
end
end
end

target:remove(1)
end

toPosition:sendMagicEffect(CONST_ME_POFF)
return true
end
Expand All @@ -67,7 +70,7 @@ function onUseMachete(player, item, fromPosition, target, toPosition, isHotkey)
player:addAchievementProgress("Nothing Can Stop Me", 100)
return true
end
return destroyItem(player, target, toPosition)
return destroyItem(player, item, fromPosition, target, toPosition, isHotkey)
end

function onUsePick(player, item, fromPosition, target, toPosition, isHotkey)
Expand All @@ -82,7 +85,6 @@ function onUsePick(player, item, fromPosition, target, toPosition, isHotkey)
else
player:addItem(3028) -- 49% chance of getting small diamond
end

player:addAchievementProgress("Petrologist", 100)
target:getPosition():sendMagicEffect(CONST_ME_BLOCKHIT)
target:remove(1)
Expand All @@ -99,7 +101,7 @@ function onUsePick(player, item, fromPosition, target, toPosition, isHotkey)
return false
end

if table.contains(groundIds, ground.itemid) and ground.actionid == actionIds.pickHole then
if table.contains(groundIds, ground.itemid) and (ground:hasAttribute(ITEM_ATTRIBUTE_UNIQUEID) or ground:hasAttribute(ITEM_ATTRIBUTE_ACTIONID)) then
ground:transform(394)
ground:decay()
toPosition:sendMagicEffect(CONST_ME_POFF)
Expand Down Expand Up @@ -127,41 +129,28 @@ function onUseRope(player, item, fromPosition, target, toPosition, isHotkey)

local ground = tile:getGround()
if ground and table.contains(ropeSpots, ground:getId()) or tile:getItemById(12935) then
tile = Tile(toPosition:moveUpstairs())
if not tile then
return false
end

if tile:hasFlag(TILESTATE_PROTECTIONZONE) and player:isPzLocked() then
if Tile(toPosition:moveUpstairs()):hasFlag(TILESTATE_PROTECTIONZONE) and player:isPzLocked() then
player:sendCancelMessage(RETURNVALUE_PLAYERISPZLOCKED)
return true
end

player:teleportTo(toPosition, false)
return true
end

if table.contains(holeId, target.itemid) then
elseif table.contains(holeId, target.itemid) then
toPosition.z = toPosition.z + 1
tile = Tile(toPosition)
if not tile then
return false
end

local thing = tile:getTopVisibleThing()
if not thing then
return true
end

if thing:isPlayer() then
if Tile(toPosition:moveUpstairs()):queryAdd(thing) ~= RETURNVALUE_NOERROR then
return false
if tile then
local thing = tile:getTopVisibleThing()
if thing:isPlayer() then
if Tile(toPosition:moveUpstairs()):hasFlag(TILESTATE_PROTECTIONZONE) and thing:isPzLocked() then
return false
end
return thing:teleportTo(toPosition, false)
end
if thing:isItem() and thing:getType():isMovable() then
return thing:moveTo(toPosition:moveUpstairs())
end

return thing:teleportTo(toPosition, false)
elseif thing:isItem() and thing:getType():isMovable() then
return thing:moveTo(toPosition:moveUpstairs())
end
player:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
return true
end
return false
Expand All @@ -182,7 +171,13 @@ function onUseShovel(player, item, fromPosition, target, toPosition, isHotkey)
if table.contains(holes, groundId) then
ground:transform(groundId + 1)
ground:decay()

toPosition:moveDownstairs()
toPosition.y = toPosition.y - 1
if Tile(toPosition):hasFlag(TILESTATE_PROTECTIONZONE) and player:isPzLocked() then
player:sendCancelMessage(RETURNVALUE_PLAYERISPZLOCKED)
return true
end
player:teleportTo(toPosition, false)
toPosition.z = toPosition.z + 1
tile:relocateTo(toPosition)
player:addAchievementProgress("The Undertaker", 500)
Expand All @@ -192,14 +187,14 @@ function onUseShovel(player, item, fromPosition, target, toPosition, isHotkey)
player:addAchievementProgress("The Undertaker", 500)
elseif target.itemid == 17950 then -- swamp digging
if not player:hasExhaustion("swamp-digging") then
local chance = math.random(100)
if chance >= 1 and chance <= 42 then
local chance = math.random(1, 100)
if chance <= 42 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You dug up a dead snake.")
player:addItem(4259)
elseif chance >= 43 and chance <= 79 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You dug up a small diamond.")
player:addItem(3028)
elseif chance >= 80 then
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You dug up a leech.")
player:addItem(17858)
end
Expand All @@ -209,16 +204,15 @@ function onUseShovel(player, item, fromPosition, target, toPosition, isHotkey)
end
elseif table.contains(sandIds, groundId) then
local randomValue = math.random(1, 100)
if target.actionid == actionIds.sandHole and randomValue <= 20 then
if target.actionid == 100 and randomValue <= 20 then
ground:transform(615)
ground:decay()
elseif randomValue == 1 then
Game.createItem(3042, 1, toPosition)
Game.createItem(3042, 1, toPosition) -- Scarab Coin
player:addAchievementProgress("Gold Digger", 100)
elseif randomValue > 95 then
Game.createMonster("Scarab", toPosition)
end

toPosition:sendMagicEffect(CONST_ME_POFF)
else
return false
Expand All @@ -238,6 +232,13 @@ function onUseScythe(player, item, fromPosition, target, toPosition, isHotkey)
player:addAchievementProgress("Happy Farmer", 200)
return true
end
return destroyItem(player, item, fromPosition, target, toPosition, isHotkey)
end

function onUseSickle(player, item, fromPosition, target, toPosition, isHotkey)
if not table.contains({ 3293, 3306 }, item.itemid) then
return false
end

if target.itemid == 5464 then -- burning sugar cane
target:transform(5463)
Expand All @@ -246,14 +247,14 @@ function onUseScythe(player, item, fromPosition, target, toPosition, isHotkey)
player:addAchievementProgress("Natural Sweetener", 50)
return true
end
return destroyItem(player, target, toPosition)
return destroyItem(player, item, fromPosition, target, toPosition, isHotkey)
end

function onUseCrowbar(player, item, fromPosition, target, toPosition, isHotkey)
if not table.contains({ 3304, 9598 }, item.itemid) then
return false
end
return destroyItem(player, target, toPosition)
return destroyItem(player, item, fromPosition, target, toPosition, isHotkey)
end

function onUseKitchenKnife(player, item, fromPosition, target, toPosition, isHotkey)
Expand All @@ -269,3 +270,10 @@ function onUseKitchenKnife(player, item, fromPosition, target, toPosition, isHot
end
return false
end

function onUseSpoon(player, item, fromPosition, target, toPosition, isHotkey)
if not table.contains({ 3468, 3470 }, item.itemid) then
return false
end
return false
end
27 changes: 27 additions & 0 deletions data-canary/scripts/spells/monster/fury_skill_reducer.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
local combat = {}

for i = 65, 80 do
combat[i] = Combat()
combat[i]:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_SOUND_YELLOW)

local condition = Condition(CONDITION_ATTRIBUTES)
condition:setParameter(CONDITION_PARAM_TICKS, 5000)
condition:setParameter(CONDITION_PARAM_SKILL_DEFENSEPERCENT, i)

local area = createCombatArea(AREA_CIRCLE3X3)
combat[i]:setArea(area)
combat[i]:addCondition(condition)
end

local spell = Spell("instant")

function spell.onCastSpell(creature, var)
return combat[math.random(65, 80)]:execute(creature, var)
end

spell:name("fury skill reducer")
spell:words("###2")
spell:isAggressive(true)
spell:blockWalls(true)
spell:needLearn(true)
spell: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>
2 changes: 2 additions & 0 deletions data-canary/world/canary-zones.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0"?>
<zones />
Binary file modified data-canary/world/canary.otbm
Binary file not shown.
1 change: 1 addition & 0 deletions data-otservbr-global/lib/quests/quest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ dofile(DATA_DIRECTORY .. "/lib/quests/killing_in_the_name_of.lua")
dofile(DATA_DIRECTORY .. "/lib/quests/svargrond_arena.lua")
dofile(DATA_DIRECTORY .. "/lib/quests/the_cursed_crystal.lua")
dofile(DATA_DIRECTORY .. "/lib/quests/the_queen_of_the_banshees.lua")
dofile(DATA_DIRECTORY .. "/lib/quests/soul_war.lua")
dofile(DATA_DIRECTORY .. "/lib/quests/their_masters_voice.lua")
dofile(DATA_DIRECTORY .. "/lib/quests/the_primal_ordeal.lua")
Loading

0 comments on commit 4307c97

Please sign in to comment.