Skip to content

Commit

Permalink
Merge pull request #5 from JNSlevin/Sanity'sEdgeSupport
Browse files Browse the repository at this point in the history
Sanity's edge support
  • Loading branch information
nicokimmel authored Jun 12, 2023
2 parents 00b0ed1 + 9edea8b commit 92a0cdb
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/WizardsWardrobe.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Author: ownedbynico
## Version: 1.10.0
## Description: Throw all your setups into the wardrobe and let the wizard equip them exactly when you need it.
## APIVersion: 101035
## APIVersion: 101038
## DependsOn: LibAddonMenu-2.0 LibChatMessage>=105
## SavedVariables: WizardsWardrobeSV

Expand Down Expand Up @@ -56,4 +56,5 @@ zones/SS.lua
zones/KA.lua
zones/RG.lua
zones/DSR.lua
zones/SE.lua
zones/BRP.lua
8 changes: 7 additions & 1 deletion src/lang/de.lua
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,12 @@ local language = {
WW_DSR_TALERIA = "Gezeitengeborene Taleria",
WW_DSR_SAILRIPPER = "Segelreißerin",
WW_DSR_BOWBREAKER = "Bogenbrecher",

WW_SE_NAME = "Rand des Wahnsinns",
WW_SE_DESCENDER = "Gewundender Herablasser",
WW_SE_YASEYLA = "Exarchanikerin Yaseyla",
WW_SE_TWELVANE = "Erzzaubermeisterin Twelvane",
WW_SE_ANSUUL = "Ansuul die Quälende",

WW_MSA_NAME = "Mahlstrom-Arena",

Expand Down Expand Up @@ -272,4 +278,4 @@ local language = {
for key, value in pairs(language) do
SafeAddVersion(key, 1)
ZO_CreateStringId(key, value)
end
end
6 changes: 6 additions & 0 deletions src/lang/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,12 @@ local language = {
WW_DSR_TALERIA = "Tideborn Taleria",
WW_DSR_SAILRIPPER = "Sail Ripper",
WW_DSR_BOWBREAKER = "Bow Breaker",

WW_SE_NAME = "Sanity's Edge",
WW_SE_DESCENDER = "Spiral Descender",
WW_SE_YASEYLA = "Exarchanic Yaseyla",
WW_SE_TWELVANE = "Archwizard Twelvane",
WW_SE_ANSUUL = "Ansuul the Tormentor",

WW_MSA_NAME = "Maelstrom Arena",

Expand Down
4 changes: 2 additions & 2 deletions src/zones/BRP.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local BRP = WW.zones["BRP"]
BRP.name = GetString(WW_BRP_NAME)
BRP.tag = "BRP"
BRP.icon = "/esoui/art/icons/achievement_blackrose_veteran.dds"
BRP.priority = 12
BRP.priority = 13
BRP.id = 1082
BRP.node = 378

Expand Down Expand Up @@ -198,4 +198,4 @@ function BRP.OnPortalSpawn(_, result, _, _, _, _, _, _, _, _, _, _, _, _, _, _,
end
BRP.lastPortalSpawn = spawnTime
end
end
end
111 changes: 111 additions & 0 deletions src/zones/SE.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
----------
--This file was created by @JN_Slevin with help from @Ghostbane
---------
local WW = WizardsWardrobe
WW.zones[ "SE" ] = {}
local SE = WW.zones[ "SE" ]

SE.name = GetString( WW_SE_NAME )
SE.tag = "SE"
SE.icon = "/esoui/art/icons/achievement_u38_vtrial_meta.dds"
SE.priority = 12
SE.id = 1427
SE.node = 434 -- Not sure whats the use of this. I used a random positive number

SE.bosses = {
[ 1 ] = {
name = GetString( WW_TRASH ),
},
[ 2 ] = {
name = GetString( WW_SE_DESCENDER ), -- Appears randomly, therefore no postition saved
},
[ 3 ] = {
name = GetString( WW_SE_YASEYLA ),
},
[ 4 ] = {
name = GetString( WW_SE_TWELVANE ), --
},
[ 5 ] = {
name = GetString( WW_SE_ANSUUL ),
},

}

SE.LOCATIONS = {
YASEYLA = {
x1 = 81530,
x2 = 87530,
y1 = 14637,
y2 = 15637,
z1 = 33077,
z2 = 42277,
},
TWELVANE = {
x1 = 181951,
x2 = 187951,
y1 = 39840,
y2 = 40840,
z1 = 216024,
z2 = 225224,
},
ANSUUL = {
x1 = 196953,
x2 = 202953,
y1 = 29699,
y2 = 30699,
z1 = 33632,
z2 = 42832,
},
}

function SE.Init()
EVENT_MANAGER:UnregisterForEvent( WW.name, EVENT_BOSSES_CHANGED )
EVENT_MANAGER:RegisterForUpdate( WW.name .. SE.tag .. "MovementLoop", 2000, SE.OnMovement )
EVENT_MANAGER:RegisterForEvent( WW.name .. SE.tag, EVENT_PLAYER_COMBAT_STATE, SE.OnCombatChange )
end

function SE.Reset()
EVENT_MANAGER:UnregisterForEvent( WW.name .. SE.tag, EVENT_PLAYER_COMBAT_STATE )
EVENT_MANAGER:UnregisterForUpdate( WW.name .. SE.tag .. "MovementLoop" )
EVENT_MANAGER:RegisterForEvent( WW.name, EVENT_BOSSES_CHANGED, WW.OnBossChange )
end

function SE.OnCombatChange( _, inCombat )
if inCombat then
EVENT_MANAGER:UnregisterForUpdate( WW.name .. SE.tag .. "MovementLoop" )
else
EVENT_MANAGER:RegisterForUpdate( WW.name .. SE.tag .. "MovementLoop", 2000, SE.OnMovement )
end
end

function SE.OnMovement()
local bossName = SE.GetBossByLocation()
if not bossName then return end
WW.OnBossChange( _, true, bossName )
end

function SE.GetBossByLocation()
local zone, x, y, z = GetUnitWorldPosition( "player" )

if zone ~= SE.id then return nil end

if x > SE.LOCATIONS.YASEYLA.x1 and x < SE.LOCATIONS.YASEYLA.x2
and y > SE.LOCATIONS.YASEYLA.y1 and y < SE.LOCATIONS.YASEYLA.y2
and z > SE.LOCATIONS.YASEYLA.z1 and z < SE.LOCATIONS.YASEYLA.z2 then
return GetString( WW_SE_YASEYLA )
elseif x > SE.LOCATIONS.TWELVANE.x1 and x < SE.LOCATIONS.TWELVANE.x2
and y > SE.LOCATIONS.TWELVANE.y1 and y < SE.LOCATIONS.TWELVANE.y2
and z > SE.LOCATIONS.TWELVANE.z1 and z < SE.LOCATIONS.TWELVANE.z2 then
return GetString( WW_SE_TWELVANE )
elseif x > SE.LOCATIONS.ANSUUL.x1 and x < SE.LOCATIONS.ANSUUL.x2
and y > SE.LOCATIONS.ANSUUL.y1 and y < SE.LOCATIONS.ANSUUL.y2
and z > SE.LOCATIONS.ANSUUL.z1 and z < SE.LOCATIONS.ANSUUL.z2 then
return GetString( WW_SE_ANSUUL )
else
return GetString( WW_TRASH )
end
end

function SE.OnBossChange( bossName )
WW.conditions.OnBossChange( bossName )
end

0 comments on commit 92a0cdb

Please sign in to comment.