Skip to content

Commit

Permalink
Merge branch 'opentibiabr:main' into live
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonyrewind authored Dec 16, 2023
2 parents e08afe9 + 6219e9e commit ba4eb98
Show file tree
Hide file tree
Showing 8 changed files with 302 additions and 7 deletions.
4 changes: 2 additions & 2 deletions data-canary/scripts/spells/support/sharpshooter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ skill:setParameter(CONDITION_PARAM_DISABLE_DEFENSE, true)
skill:setParameter(CONDITION_PARAM_BUFF_SPELL, true)
combat:addCondition(skill)

local speed = Condition(CONDITION_PARALYZE)
local speed = Condition(CONDITION_HASTE)
speed:setParameter(CONDITION_PARAM_TICKS, 10000)
speed:setFormula(-0.73, 0, -0.73, 0)
speed:setFormula(0.7, 0, 0.7, 0)
combat:addCondition(speed)

local exhaustHealGroup = Condition(CONDITION_SPELLGROUPCOOLDOWN)
Expand Down
2 changes: 1 addition & 1 deletion data-canary/scripts/spells/support/swift_foot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ combat:addCondition(exhaust)

local condition = Condition(CONDITION_HASTE)
condition:setParameter(CONDITION_PARAM_TICKS, 10000)
condition:setFormula(0.8, -72, 0.8, -72)
condition:setFormula(1.8, 72, 1.8, 72)
combat:addCondition(condition)

local exhaustAttackGroup = Condition(CONDITION_SPELLGROUPCOOLDOWN)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ GrandMasterOberonResponses = {
[6] = { msg = "Excuse me but I still do not get the message!", msg2 = oberonOthersMessages[2] },
[7] = { msg = "Dare strike up a Minnesang and you will receive your last accolade!", msg2 = oberonOthersMessages[1] },
[8] = { msg = "Then why are we fighting alone right now?", msg2 = oberonOthersMessages[2] },
[9] = { msg = "SEHWO ASIMO, TOLIDO ESD!", msg2 = oberonOthersMessages[2] },
[9] = { msg = "SEHWO ASIMO, TOLIDO ESD", msg2 = oberonOthersMessages[2] },
}

GrandMasterOberonConfig = {
Expand Down
33 changes: 33 additions & 0 deletions data-otservbr-global/scripts/movements/teleport/oskayaat.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
SimpleTeleport(Position(33028, 32953, 8), Position(33042, 32950, 9))
SimpleTeleport(Position(33043, 32950, 9), Position(33028, 32952, 8))

local wallTeleport = Action()
function wallTeleport.onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:getPosition().y < 32915 then
player:teleportTo(Position(33038, 32916, 9))
else
player:teleportTo(Position(33038, 32914, 9))
end
return true
end

wallTeleport:position(Position(33038, 32915, 9))
wallTeleport:register()

local boatExit = Action()
function boatExit.onUse(player, item, fromPosition, target, toPosition, isHotkey)
player:teleportTo(Position(33176, 32882, 7))
return true
end

boatExit:position(Position(33069, 32915, 7))
boatExit:register()

local boatEntry = Action()
function boatEntry.onUse(player, item, fromPosition, target, toPosition, isHotkey)
player:teleportTo(Position(33069, 32916, 7))
return true
end

boatEntry:position(Position(33176, 32883, 7))
boatEntry:register()
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
local bossZone = Zone("boss.the-monster")

local puddleId = 42075
local jailBarsId = 2184

local encounter = Encounter("The Monster", {
zone = bossZone,
timeToSpawnMonsters = "10ms",
})

local function freeMonster()
local tile = Tile(Position(33844, 32591, 12))
if tile then
while true do
local item = tile:getItemById(jailBarsId)
if item then
item:remove()
else
break
end
end
end
end

function encounter:onReset(position)
encounter:removeMonsters()
freeMonster()
end

encounter:addRemoveMonsters():autoAdvance()
encounter
:addStage({
start = function()
Game.createItem(jailBarsId, 1, Position(33844, 32591, 12))
end,
})
:autoAdvance()

encounter:addSpawnMonsters({
{
name = "Doctor Marrow",
event = "fight.the-monster.DoctorMarrowHealth",
positions = {
Position(33838, 32591, 12),
},
spawn = function(monster)
monster:setInvulnerable()
end,
},
{
name = "The Monster",
event = { "fight.the-monster.TheMonsterHealth", "fight.the-monster.TheMonsterDeath" },
positions = {
Position(33845, 32591, 12),
},
spawn = function(monster)
monster:setIcon("the-monster", CreatureIconCategory_Quests, CreatureIconQuests_PurpleShield, 20)
end,
},
{
name = "Antenna",
event = "fight.the-monster.AntennaDeath",
positions = {
Position(33834, 32589, 12),
Position(33840, 32589, 12),
Position(33834, 32593, 12),
Position(33840, 32593, 12),
},
},
})

encounter:addStage({
start = function()
local monsters = encounter:getZone():getMonstersByName("Doctor Marrow")
if not monsters or #monsters == 0 then
return false
end
local doctor = monsters[1]
doctor:removeInvulnerable()
end,
})

encounter:addStage({
start = function()
freeMonster()
end,
})

encounter:register()

local spawnContainers = GlobalEvent("fight.the-monster.containers.onThink")
function spawnContainers.onThink(interval, lastExecution)
return true
end

spawnContainers:interval(4000)
spawnContainers:register()

local doctorHealth = CreatureEvent("fight.the-monster.DoctorMarrowHealth")
function doctorHealth.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType)
if not creature then
return primaryDamage, primaryType, secondaryDamage, secondaryType
end
local newHealth = creature:getHealth() - primaryDamage - secondaryDamage
if newHealth <= creature:getMaxHealth() * 0.5 then
creature:setHealth(creature:getMaxHealth())
creature:remove()
encounter:nextStage()
return false
end
return primaryDamage, primaryType, secondaryDamage, secondaryType
end

doctorHealth:register()

local antennaDeath = CreatureEvent("fight.the-monster.AntennaDeath")
function antennaDeath.onDeath()
-- The monster count is only updated AFTER the event is called, so we need to subtract 1
local count = encounter:countMonsters("antenna") - 1
if count == 0 then
encounter:nextStage()
end
end

antennaDeath:register()

local alchemistContainerDeath = CreatureEvent("fight.the-monster.AlchemistContainerDeath")
function alchemistContainerDeath.onDeath(creature)
local directions = { DIRECTION_NORTH, DIRECTION_EAST, DIRECTION_SOUTH, DIRECTION_WEST }
for _, direction in ipairs(directions) do
local position = creature:getPosition()
position:getNextPosition(direction)
local tile = Tile(position)
if tile:isWalkable(false, false, false, true, true) then
local item = Game.createItem(puddleId, 1, position)
item:decay()
break
end
end
end

alchemistContainerDeath:register()

local alchemistContainerSpawns = GlobalEvent("fight.the-monster.containers.alchemist.onThink")
local alchemistContainerPositions = {
{ x = 33834, y = 32585, z = 12 },
{ x = 33840, y = 32585, z = 12 },
{ x = 33845, y = 32587, z = 12 },
{ x = 33845, y = 32595, z = 12 },
{ x = 33840, y = 32597, z = 12 },
{ x = 33834, y = 32597, z = 12 },
{ x = 33829, y = 32595, z = 12 },
{ x = 33829, y = 32592, z = 12 },
{ x = 33829, y = 32590, z = 12 },
{ x = 33829, y = 32587, z = 12 },
}

function alchemistContainerSpawns.onThink()
for _, position in ipairs(alchemistContainerPositions) do
local tile = Tile(position)
if tile and tile:getCreatureCount() == 0 then
local corpse = tile:getItemById(39949)
if corpse then
corpse:remove()
end
local monster = Game.createMonster("alchemist container", position)
if monster then
monster:registerEvent("fight.the-monster.AlchemistContainerDeath")
end
end
end
return true
end

alchemistContainerSpawns:interval(10000)
alchemistContainerSpawns:register()

local function getShields(creature)
local currentIcon = creature:getIcon("the-monster")
if not currentIcon or currentIcon.category ~= CreatureIconCategory_Quests or currentIcon.icon ~= CreatureIconQuests_PurpleShield then
return 0
end
if currentIcon.count <= 0 then
creature:removeIcon("magma-bubble")
return 0
end
return currentIcon.count
end

local function setShields(creature, count)
if count <= 0 then
creature:removeIcon("the-monster")
return
end
creature:setIcon("the-monster", CreatureIconCategory_Quests, CreatureIconQuests_PurpleShield, count)
end

local monsterHealth = CreatureEvent("fight.the-monster.TheMonsterHealth")
function monsterHealth.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType)
if not creature then
return primaryDamage, primaryType, secondaryDamage, secondaryType
end
local shields = getShields(creature)
local multiplier = 1 - shields * 0.05
return primaryDamage * multiplier, primaryType, secondaryDamage * multiplier, secondaryType
end

monsterHealth:register()

local monsterDeath = CreatureEvent("fight.the-monster.TheMonsterDeath")
function monsterDeath.onDeath(creature)
encounter:nextStage()
end

monsterDeath:register()

local puddleStepIn = MoveEvent("fight.the-monster.PuddleStepIn")
function puddleStepIn.onStepIn(creature, item, position, fromPosition)
if not creature or creature:getName() ~= "The Monster" then
return true
end
item:remove()
local current = getShields(creature)
if current <= 0 then
return true
end
setShields(creature, current - 1)
creature:getPosition():sendMagicEffect(CONST_ME_ORANGE_ENERGY_SPARK)
return true
end

puddleStepIn:type("stepin")
puddleStepIn:id(puddleId)
puddleStepIn:register()
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
local config = {
boss = { name = "The Monster" },
encounter = "The Monster",
requiredLevel = 250,

playerPositions = {
{ pos = { x = 33812, y = 32584, z = 12 }, teleport = { x = 33831, y = 32591, z = 12 }, effect = CONST_ME_TELEPORT },
{ pos = { x = 33811, y = 32584, z = 12 }, teleport = { x = 33831, y = 32591, z = 12 }, effect = CONST_ME_TELEPORT },
{ pos = { x = 33810, y = 32584, z = 12 }, teleport = { x = 33831, y = 32591, z = 12 }, effect = CONST_ME_TELEPORT },
{ pos = { x = 33809, y = 32584, z = 12 }, teleport = { x = 33831, y = 32591, z = 12 }, effect = CONST_ME_TELEPORT },
{ pos = { x = 33808, y = 32584, z = 12 }, teleport = { x = 33831, y = 32591, z = 12 }, effect = CONST_ME_TELEPORT },
},
specPos = {
from = { x = 33828, y = 32584, z = 12 },
to = { x = 33846, y = 32598, z = 12 },
},
exitTeleporter = { x = 33829, y = 32591, z = 12 },
exit = { x = 33810, y = 32587, z = 12 },
}

local lever = BossLever(config)
lever:position({ x = 33813, y = 32584, z = 12 })
lever:register()

-- Entrance to lever room
SimpleTeleport({ x = 33792, y = 32581, z = 12 }, { x = 33806, y = 32584, z = 12 })
-- Exit from lever room
SimpleTeleport({ x = 33804, y = 32584, z = 12 }, { x = 33792, y = 32579, z = 12 })
4 changes: 2 additions & 2 deletions data-otservbr-global/scripts/spells/support/sharpshooter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)

local speed = Condition(CONDITION_PARALYZE)
local speed = Condition(CONDITION_HASTE)
speed:setParameter(CONDITION_PARAM_TICKS, spellDuration)
speed:setFormula(-0.7, 56, -0.7, 56)
speed:setFormula(0.7, 0, 0.7, 0)
combat:addCondition(speed)

local exhaustHealGroup = Condition(CONDITION_SPELLGROUPCOOLDOWN)
Expand Down
2 changes: 1 addition & 1 deletion data-otservbr-global/scripts/spells/support/swift_foot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0)

local condition = Condition(CONDITION_HASTE)
condition:setParameter(CONDITION_PARAM_TICKS, spellDuration)
condition:setFormula(0.8, -72, 0.8, -72)
condition:setFormula(1.8, 72, 1.8, 72)
combat:addCondition(condition)

local spell = Spell("instant")
Expand Down

0 comments on commit ba4eb98

Please sign in to comment.