What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Reading Combat Log

SuperSlow

New Member
Joined
Jan 15, 2010
Messages
18
Reaction score
0
Has anyone been using the combat log to detect if other faction is attacking? I'd rather not initiate combat on my PVP server at lower levels just because they are targeting me, but if they hit me then I'd open up on them. I remember this from Glider, but that was many beers ago. How do I do this thru LUA? Any help would be great.
 
I think its possible to do this in your CC. You can probably do a (pseudocode):

if me getting attacked and target is player { Combat(); } or similar
 
I think its possible to do this in your CC. You can probably do a (pseudocode):

if me getting attacked and target is player { Combat(); } or similar

yeah that is possible but i dont think that any cc currently has that implemented?
for me i just add factions id's to the avoidmobs list :)
 
Instead of reading through the combat log why not do it another way? At some point you'll combat sequence is going to check if you have adds it is during this check you determine if one of the adds is a player - thing.IsPlayer == true
 
Hoping for an update.

I'd rather not read the combat log, but I want to know when someone is attacking me. Not just targeting me, but doing damage to me. If this is possible please tell me how, if not could you please tell me how to read the combat log, I have seen the chat log reading, but not the combat log.
 
Use the lua events
Lua.Events.Attach("COMBAT_LOG_EVENT", ...
 
Code:
public LuaEventHandlerDelegate m_HandleCombatMessageDelegate;
public static void HandleCombatMessage(object j, LuaEventArgs e)
{
    slog( e.Args[0].ToString());// just print this, will search for players later to decide who to attack
}
public Priest()
{ 
     m_HandleCombatMessageDelegate = new LuaEventHandlerDelegate(HandleCombatMessage);
     Lua.Events.AttachEvent("COMBAT_LOG_EVENT", m_HandleCombatMessageDelegate);
}
ok,
I finally got it, thanks to all especially Nesox
 
Last edited:
Back
Top