Thread Tools Display Modes
12-11-16, 09:27 AM   #1
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
comunications when dead

Hi,

I think the problems has not a solution, but I try to ask the same...
I wrote a little addon to manage with those nasty gankers (being me a fantastic beta tester :) :)

I'd like to make a kind of fingerprint in a way the ganker know I have record him ... and then if possible YELL to the nearby people about this.

But it has to happened when I am dead and the YELL channel is not usable, like the SAY and emote too :)
So I think there is nothing I can do to comunicate with enemy when I am dead ...

Am I miss something ?

Thanks for any tips/idea ?
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote
12-11-16, 06:54 PM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,308
Perhaps something like this might work. It should only trigger while PvP flagged and ignores when flagged FFA. This should be obvious when you're screwed as everyone is your enemy. I would choose a more personal chat channel as this would alert them to your location as well. The idea is to try to send the alert out before you're dead, and maybe before you're even spotted, but that isn't guaranteed to happen.

Lua Code:
  1. --[[    Localized globals for COMBAT_LOG_EVENT_UNFILTERED   ]]
  2. local bit_band=bit.band;
  3. local COMBATLOG_FILTER_HOSTILE_PLAYERS=COMBATLOG_FILTER_HOSTILE_PLAYERS;
  4. local GetTime=GetTime;
  5. local string_format=string.format;
  6.  
  7. local BitMasks={
  8.     COMBATLOG_OBJECT_AFFILIATION_MASK;
  9.     COMBATLOG_OBJECT_REACTION_MASK;
  10.     COMBATLOG_OBJECT_CONTROL_MASK;
  11.     COMBATLOG_OBJECT_TYPE_MASK;
  12. };
  13.  
  14. --[[    Settings    ]]
  15. local MessageThrottle=60;-- Seconds between messages about the same player
  16. local MessageFormat="Warning: Hostile player %s is nearby!";
  17. local MessageChannel,MessageTarget="YELL",nil;
  18.  
  19. --[[    Internal variables  ]]
  20. local AlertedPlayers={};
  21.  
  22. --[[    Magic stuff ]]
  23. local function HandleAlert(guid,name,flags)
  24.     if guid then
  25. --      Is unit hostile player? (Check flags, exit if a field doesn't match)
  26.         flags=bit_band(flags,COMBATLOG_FILTER_HOSTILE_PLAYERS)--    Trim unused bits
  27.         for _,mask in ipairs(BitMasks) do if bit_band(flags,mask)==0 then return; end end
  28.  
  29. --      Message throttling (don't want to spam chat)
  30.         local now=GetTime();
  31.         if now-(AlertedPlayers[guid] or -MessageThrottle)>MessageThrottle then
  32.             AlertedPlayers[guid]=now;
  33.             SendChatMessage(string_format(MessageFormat,name),nil,MessageChannel,MessageTarget);
  34.         end
  35.     end
  36. end
  37.  
  38. local AlertFrame=CreateFrame("Frame");
  39. AlertFrame:RegisterEvent("PLAYER_ENTERING_WORLD");--    Sanity check when logging in or zoning into PvP area via loading screen
  40. AlertFrame:RegisterUnitEvent("UNIT_FACTION","player");--    Neutral player chose faction? PlayerFrame does this to update PvP texture
  41. AlertFrame:RegisterUnitEvent("HONOR_PRESTIGE_UPDATE","player");--   PvP flag update? Only other PvP event PlayerFrame uses
  42. AlertFrame:SetScript("OnEvent",function(self,event,_,_,_,srcguid,srcname,srcflags,_,destguid,destname,destflags)
  43.     if event=="COMBAT_LOG_EVENT_UNFILTERED" then
  44.         HandleAlert(srcguid,srcname,srcflags);--    Hostile player did something?
  45.         HandleAlert(destguid,destname,destflags);-- Something done to hostile player?
  46.     else--  Code below this point doesn't run frequently, localized globals is unnecessary
  47. --      Enable based on PvP flag and FFA
  48.         if UnitFactionGroup("player")~="Neutral" and UnitIsPVP("player") and not UnitIsPVPFreeForAll("player") then
  49.             self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
  50.         else
  51.             self:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
  52.             table.wipe(AlertedPlayers);--   Clean up when disabling
  53.         end
  54.     end
  55. end);
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 12-15-16 at 02:36 AM.
  Reply With Quote
12-12-16, 11:39 AM   #3
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
Hi SDPhantom,

thanks very much for your kind reply.

Your solution is so great that I have to study it a little bit to put the code inside my addon :)
Btw your comments are soooo helpfull :)

Thanks again so much. It is much appreciated :)
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote
12-13-16, 04:39 PM   #4
JDoubleU00
A Firelord
 
JDoubleU00's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 463
There used to be a wonderful addon called Local Defense (?) it broadcast either the General channel or the Local Defense one (I can't remember). It did scan the combat log IIRC. Good luck with your addon, I stopped playing PvP as it was a bit much for me.
__________________
Author of JWExpBar and JWRepBar.
  Reply With Quote
12-13-16, 04:50 PM   #5
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,308
I don't play PvP either, but during the time my RL friends forced me to play on an RPPvP server, I made a custom combat log filter that would show me the activity of hostile players around me as an early warning system.

PS: I fixed the code I posted previously. It was passing the channel into the language parameter of SendChatMessage(). I also added support of the message target parameter to the config section.

Edit: Also fixed the handler parameters, forgot separate raid flags were a thing.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 12-15-16 at 02:38 AM.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » comunications when dead

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off