local actor = actors.register(function(message)
if message.content.id == 'request_info' then
local response = {
id = 'announce',
class = myClass,
name = myName,
buffs = myBuffs,
}
if is_healer(myClass) then
response.heals = myHeals
response.casting = get_casting_info()
end
response.panther_status = panther.has_panther()
message:send(response)
elseif message.content.id == 'announce' then
-- Store info about other actors
local sender = message.sender and message.sender.character or 'unknown'
actors_state[sender] = {
class = message.content.class,
buffs = message.content.buffs,
heals = message.content.heals,
casting = message.content.casting,
panther_status = message.content.panther_status,
last_update = os.time(),
}
elseif message.content.id == 'panther_status' then
local sender = message.sender and message.sender.character or 'unknown'
if not actors_state[sender] then actors_state[sender] = {} end
actors_state[sender].panther_status = message.content
actors_state[sender].last_update = os.time()
elseif message.content.id == 'drop' then
local sender = message.sender and message.sender.character or 'unknown'
actors_state[sender] = nil
elseif message.content.id == 'cure_discovery' then
-- All actors should respond to discovery, not just cure-capable ones
local response = {
id = 'cure_discovery_response',
class = myClass,
name = myName,
timestamp = os.time()
}
actors.send(response)
elseif message.content.id == 'cure_discovery_response' or message.content.id == 'debuff_report' or message.content.id == 'cure_announcement' or message.content.id == 'cure_complete' then
-- Process cure-related messages
local cure_message = cures.process_messages(message, actors_state)
if cure_message then
message:send(cure_message)
end
end
end)