eqsubi15
Ultimate seasoned veteran member
- Joined
- Jul 11, 2020
- RedCents
- 953¢
Hey all,
I'm trying to make a LEM for phase two of Spirt Fades event to move when emotes trigger to avoid the manadrain. Can anyone help me review what I have and see if I'm on the right track or need to fix it?
The idea would be all toons in chase mode using CWTN plugins. When an emote happens, the driving toon (MT) self-targets to have everyone break off and target the MT. Then have him run to one of the two designated waypoints based on which emote fired. Then I'd manually re-engage after.
I'm trying to make a LEM for phase two of Spirt Fades event to move when emotes trigger to avoid the manadrain. Can anyone help me review what I have and see if I'm on the right track or need to fix it?
The idea would be all toons in chase mode using CWTN plugins. When an emote happens, the driving toon (MT) self-targets to have everyone break off and target the MT. Then have him run to one of the two designated waypoints based on which emote fired. Then I'd manually re-engage after.
Code:
-- Define the coordinates for Waypoints 1 and 2
local waypoint1 = { x = 688, y = -816, z = 203 }
local waypoint2 = { x = 851, y = -935, z = 185 }
-- Define the warning emotes for each waypoint
local waypoint1Emotes = {
"Weakness Evinced sends energy toward the rear of the cave.",
"Weakness Evinced sends energy at the great spirits.",
"Weakness Evinced sends energy into the tunnel."
}
local waypoint2Emotes = {
"Weakness Evinced sends energy at Grakaw.",
"Weakness Evinced sends energy toward the center of the cave.",
"Weakness Evinced sends energy at Grakaw and the great spirits."
}
-- Function to move to a specified waypoint
local function moveToWaypoint(waypoint)
-- Target self
MQ.cmd("/target self")
-- Move to the waypoint
MQ.cmdf("/nav loc %d %d %d", waypoint.x, waypoint.y, waypoint.z)
-- Wait for navigation to complete
MQ.delay(1000) -- Adjust the delay as needed
while MQ.TLO.Navigation.Active() do
MQ.delay(100)
end
end
-- Function to check if a message matches any emote in a list
local function matchesEmote(message, emoteList)
for _, emote in ipairs(emoteList) do
if message:find(emote) then
return true
end
end
return false
end
-- Main event listener
MQ.event("WarningEmote", "#*#Weakness Evinced sends energy#*#", function(event, message)
if matchesEmote(message, waypoint1Emotes) then
print("Warning emote detected: Moving to Waypoint 1")
moveToWaypoint(waypoint1)
elseif matchesEmote(message, waypoint2Emotes) then
print("Warning emote detected: Moving to Waypoint 2")
moveToWaypoint(waypoint2)
end
end)


