Quantcast
Start Duel Event - WoWInterface
Thread Tools Display Modes
12-29-20, 03:37 AM   #1
gnulk
A Defias Bandit
Join Date: Dec 2020
Posts: 2
Start Duel Event

Looking for a way to know when i accept a duel request, or my opponent's does. Also my opponent's name.


Best i've found is DUEL_REQUESTED event but is not really what i am lookin for.

Any ideas?
  Reply With Quote
12-29-20, 07:35 AM   #2
gnulk
A Defias Bandit
Join Date: Dec 2020
Posts: 2
Solved

So i figured it out, here is the snippet using 3 events.



Lua Code:
  1. -- A player has requested to duel me
  2. function Duelist:DUEL_REQUESTED(event, playerName)
  3.     opponentName = playerName
  4.     duelingOn = true
  5.  end
  6.  
  7.  --I requested a duel to my target
  8.  function Duelist:CHAT_MSG_SYSTEM(event, text)
  9.     if string.find(text, _G.ERR_DUEL_REQUESTED ) then
  10.         if (UnitExists("target")) then
  11.             duelingOn = true
  12.             opponentName = UnitName("target")
  13.         end
  14.     end
  15.  end
  16.  
  17.   -- The duel finished or was canceled
  18.   function Duelist:DUEL_FINISHED(event)
  19.     opponentName = ""
  20.     duelingOn = false
  21.   end
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Start Duel Event

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