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 Feb 9, 2024
2 parents a837389 + 5248cf0 commit 238ec3d
Show file tree
Hide file tree
Showing 11 changed files with 270 additions and 383 deletions.
80 changes: 0 additions & 80 deletions data-canary/scripts/globalevents/startup.lua

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
local transformations = {
[31509] = 31500,
[31500] = 31505,
[31505] = 31513,
[31513] = 31509,
[31510] = 31502,
[31502] = 31506,
[31506] = 31514,
[31514] = 31510,
[31511] = 31503,
[31503] = 31507,
[31507] = 31515,
[31515] = 31511,
[31512] = 31504,
[31504] = 31508,
[31508] = 31516,
[31516] = 31512,
}

local goldenOutfitDisplay = Action()

function goldenOutfitDisplay.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local newItemID = transformations[item:getId()]
if not newItemID then
return true
end

if player:getStorageValue(Storage.OutfitQuest.GoldenOutfit) == 3 then
item:transform(newItemID)
item:getPosition():sendMagicEffect(CONST_ME_EARLY_THUNDER)
else
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need Full Golden Outfit to use it.")
item:getPosition():sendMagicEffect(CONST_ME_POFF)
end
return true
end

for index, value in pairs(transformations) do
goldenOutfitDisplay:id(index)
end

goldenOutfitDisplay:register()

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ local function copyContainerItem(originalContainer, newContainer)
local originalItem = originalContainer:getItem(i)
local newItem = Game.createItem(originalItem.itemid, originalItem.type)
if not newItem then
Spdlog.error("[questSystem1.copyContainerItem] failed to create item " .. originalItem.itemid)
logger.error("[questSystem1.copyContainerItem] failed to create item: {}", originalItem.itemid)
return false
end
newItem:setActionId(originalItem:getActionId())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
local function loadMapActionsAndUniques()
loadLuaMapAction(ChestAction)
loadLuaMapUnique(ChestUnique)
loadLuaMapAction(CorpseAction)
loadLuaMapUnique(CorpseUnique)
loadLuaMapAction(KeyDoorAction)
loadLuaMapAction(LevelDoorAction)
loadLuaMapAction(QuestDoorAction)
loadLuaMapUnique(QuestDoorUnique)
loadLuaMapAction(ItemAction)
loadLuaMapUnique(ItemUnique)
loadLuaMapAction(ItemUnmovableAction)
loadLuaMapAction(LeverAction)
loadLuaMapUnique(LeverUnique)
loadLuaMapAction(TeleportAction)
loadLuaMapUnique(TeleportUnique)
loadLuaMapAction(TeleportItemAction)
loadLuaMapUnique(TeleportItemUnique)
loadLuaMapAction(TileAction)
loadLuaMapUnique(TileUnique)
loadLuaMapAction(TilePickAction)
CreateMapItem(CreateItemOnMap)
updateKeysStorage(QuestKeysUpdate)
end

local function loadMapAttributes()
logger.debug("Loading map attributes")
loadLuaMapSign(SignTable)
loadLuaMapBookDocument(BookDocumentTable)

loadMapActionsAndUniques()
logger.debug("Loaded all actions and uniques in the map")
end

local function resetGlobalStorages()
for i = 1, #startupGlobalStorages do
Game.setStorageValue(startupGlobalStorages[i], 0)
end
end

local function resetFerumbrasAscendantQuestHabitats()
for i = 1, #GlobalStorage.FerumbrasAscendant.Habitats do
Game.setStorageValue(GlobalStorage.FerumbrasAscendant.Habitats[i], 0)
end
end

local mapAttributesLoader = GlobalEvent("Map Attributes Loader")

function mapAttributesLoader.onStartup()
loadMapAttributes()
resetGlobalStorages()
resetFerumbrasAscendantQuestHabitats()
end

mapAttributesLoader:register()
Loading

0 comments on commit 238ec3d

Please sign in to comment.