-
-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update to : opentibiabr/canary@8993119
- Loading branch information
Showing
39 changed files
with
565 additions
and
329 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
data-otxserver/scripts/quests/the_order_of_lion/action-bounac_entrance.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
local bounacEntrance = Action() | ||
function bounacEntrance.onUse(player, item, fromPosition, target, toPosition, isHotkey) | ||
if item:getActionId() == 59602 then | ||
if player:getLevel() < 250 then | ||
player:sendCancelMessage("You need at least level 250.") | ||
toPosition:sendMagicEffect(CONST_ME_POFF) | ||
else | ||
player:teleportTo({ x = 32423, y = 32448, z = 7 }) | ||
toPosition:sendMagicEffect(CONST_ME_WATERSPLASH) | ||
Position({ x = 32423, y = 32448, z = 7 }):sendMagicEffect(CONST_ME_WATERSPLASH) | ||
end | ||
elseif item:getActionId() == 59603 then | ||
player:teleportTo({ x = 33183, y = 31756, z = 7 }) | ||
Position({ x = 33183, y = 31756, z = 7 }):sendMagicEffect(CONST_ME_WATERSPLASH) | ||
toPosition:sendMagicEffect(CONST_ME_WATERSPLASH) | ||
end | ||
return true | ||
end | ||
|
||
bounacEntrance:aid(59602) | ||
bounacEntrance:aid(59603) | ||
bounacEntrance:register() |
120 changes: 120 additions & 0 deletions
120
data-otxserver/scripts/quests/the_order_of_lion/action-drume.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
local config = { | ||
lionPosition = { | ||
Position(32444, 32512, 7), | ||
Position(32449, 32516, 7), | ||
Position(32444, 32520, 7), | ||
}, | ||
usurperPosition = { | ||
Position(32450, 32520, 7), | ||
Position(32444, 32516, 7), | ||
Position(32448, 32512, 7), | ||
}, | ||
firstPlayerPosition = Position(32457, 32508, 6), | ||
centerPosition = Position(32439, 32523, 7), -- Center Room | ||
exitPosition = Position(32453, 32503, 7), -- Exit Position | ||
newPosition = Position(32453, 32510, 7), | ||
rangeX = 22, | ||
rangeY = 16, | ||
timeToKill = 20, -- time in minutes to remove the player | ||
} | ||
|
||
local currentEvent = nil | ||
|
||
local function clearRoomDrume(centerPosition, rangeX, rangeY, resetGlobalStorage) | ||
local spectators, spectator = Game.getSpectators(centerPosition, false, false, rangeX, rangeX, rangeY, rangeY) | ||
for i = 1, #spectators do | ||
spectator = spectators[i] | ||
if spectator:isMonster() then | ||
spectator:remove() | ||
end | ||
if spectator:isPlayer() then | ||
spectator:teleportTo(config.exitPosition) | ||
spectator:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Your time is over.") | ||
end | ||
end | ||
if Game.getStorageValue(resetGlobalStorage) == 1 then | ||
Game.setStorageValue(resetGlobalStorage, -1) | ||
end | ||
currentEvent = nil | ||
end | ||
|
||
local drumeAction = Action() | ||
function drumeAction.onUse(player, item, fromPosition, target, toPosition, isHotkey) | ||
if player:getPosition() ~= config.firstPlayerPosition then | ||
return false | ||
end | ||
|
||
local spectators = Game.getSpectators(config.centerPosition, false, true, config.rangeX, config.rangeX, config.rangeY, config.rangeY) | ||
if #spectators ~= 0 then | ||
player:sendCancelMessage("There's someone already in the skirmish.") | ||
player:getPosition():sendMagicEffect(CONST_ME_POFF) | ||
return true | ||
end | ||
|
||
local tempPos, tempTile, tempCreature | ||
local players = {} | ||
for x = config.firstPlayerPosition.x, config.firstPlayerPosition.x + 4 do | ||
tempPos = Position(x, config.firstPlayerPosition.y, config.firstPlayerPosition.z) | ||
tempTile = Tile(tempPos) | ||
if tempTile then | ||
tempCreature = tempTile:getTopCreature() | ||
if tempCreature and tempCreature:isPlayer() then | ||
table.insert(players, tempCreature) | ||
end | ||
end | ||
end | ||
if #players == 0 then | ||
return false | ||
end | ||
for _, pi in pairs(players) do | ||
if not pi:canFightBoss("Drume") then | ||
player:sendCancelMessage("Someone of your team has already fought in the skirmish in the last 10h.") | ||
player:getPosition():sendMagicEffect(CONST_ME_POFF) | ||
return true | ||
end | ||
end | ||
local spectators = Game.getSpectators(config.centerPosition, false, false, config.rangeX, config.rangeX, config.rangeY, config.rangeY) | ||
for _, creature in pairs(spectators) do | ||
if creature:isMonster() then | ||
creature:remove() | ||
end | ||
end | ||
local totalLion = 0 | ||
local totalUsurper = 0 | ||
local tempMonster | ||
for _, pos in pairs(config.lionPosition) do | ||
tempMonster = Game.createMonster("Lion Commander", pos) | ||
if not tempMonster then | ||
player:sendCancelMessage("There was an error, contact an admin.") | ||
player:getPosition():sendMagicEffect(CONST_ME_POFF) | ||
return true | ||
end | ||
totalLion = totalLion + 1 | ||
end | ||
for _, pos in pairs(config.usurperPosition) do | ||
tempMonster = Game.createMonster("Usurper Commander", pos) | ||
if not tempMonster then | ||
player:sendCancelMessage("There was an error, contact an admin.") | ||
player:getPosition():sendMagicEffect(CONST_ME_POFF) | ||
return true | ||
end | ||
totalUsurper = totalUsurper + 1 | ||
end | ||
for _, pi in pairs(players) do | ||
pi:setBossCooldown("Drume", os.time() + (configManager.getNumber(configKeys.BOSS_DEFAULT_TIME_TO_FIGHT_AGAIN))) | ||
pi:teleportTo(config.newPosition) | ||
pi:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have " .. config.timeToKill .. " minutes to defeat Drume.") | ||
end | ||
if currentEvent then | ||
stopEvent(currentEvent) | ||
end | ||
currentEvent = addEvent(clearRoomDrume, config.timeToKill * 60 * 1000, config.centerPosition, config.rangeX, config.rangeY, resetGlobalStorage) | ||
config.newPosition:sendMagicEffect(CONST_ME_TELEPORT) | ||
toPosition:sendMagicEffect(CONST_ME_POFF) | ||
Game.setStorageValue(GlobalStorage.TheOrderOfTheLion.Drume.TotalLionCommanders, totalLion) | ||
Game.setStorageValue(GlobalStorage.TheOrderOfTheLion.Drume.TotalUsurperCommanders, totalUsurper) | ||
return true | ||
end | ||
|
||
drumeAction:aid(59601) | ||
drumeAction:register() |
25 changes: 25 additions & 0 deletions
25
data-otxserver/scripts/quests/the_order_of_lion/action-elevator.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
local elevatorBounacAction = Action() | ||
function elevatorBounacAction.onUse(player, item, fromPosition, target, toPosition, isHotkey) | ||
if player:getPosition() ~= Position(32371, 32496, 7) then | ||
Position(32371, 32496, 7):sendMagicEffect(CONST_ME_POFF) | ||
else | ||
player:teleportTo(Position(32374, 32497, 3)) | ||
Position(32374, 32497, 3):sendMagicEffect(CONST_ME_POFF) | ||
end | ||
return true | ||
end | ||
|
||
elevatorBounacAction:aid(59604) | ||
elevatorBounacAction:register() | ||
|
||
local elevatorBounacMoveEvent = MoveEvent() | ||
function elevatorBounacMoveEvent.onStepIn(creature, item, position, fromPosition) | ||
if creature:isPlayer() then | ||
creature:teleportTo(Position(32371, 32497, 7)) | ||
Position(32371, 32497, 7):sendMagicEffect(CONST_ME_POFF) | ||
end | ||
return true | ||
end | ||
|
||
elevatorBounacMoveEvent:aid(59605) | ||
elevatorBounacMoveEvent:register() |
Oops, something went wrong.