-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from JNSlevin/Sanity'sEdgeSupport
Sanity's edge support
- Loading branch information
Showing
5 changed files
with
128 additions
and
4 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
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 |