forked from opentibiabr/canary
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: enhance and organize the server initialization script (open…
…tibiabr#2181) Enhanced and organized the server initialization script, adding functionalities and improving overall structure. Fix checkDuplicateStorageValues for subtable values. --------- Co-authored-by: GitHub Actions <github-actions[bot]@users.noreply.github.com> Co-authored-by: Elson Costa <[email protected]>
- Loading branch information
1 parent
48807ae
commit e40a5eb
Showing
5 changed files
with
214 additions
and
291 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
55 changes: 55 additions & 0 deletions
55
data-otservbr-global/scripts/globalevents/others/map_attributes_loader.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,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() |
174 changes: 0 additions & 174 deletions
174
data-otservbr-global/scripts/globalevents/others/startup.lua
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.