forked from opentibiabr/canary
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'opentibiabr:main' into live
- Loading branch information
Showing
11 changed files
with
270 additions
and
383 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
data-otservbr-global/scripts/actions/object/golden_outfit_display.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,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() |
62 changes: 0 additions & 62 deletions
62
data-otservbr-global/scripts/actions/other/golden_outfit_display.lua
This file was deleted.
Oops, something went wrong.
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
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() |
Oops, something went wrong.