Lua GetGroupLeader

From ArcEmu-Wiki
Jump to: navigation, search
+/-
Main Page        LuaArcEmu Website     ArcEmu Forum     Bug Tracker


Syntax

pLeader = pPlayer:GetGroupLeader()

Returns a object of the player's group leader.

Example

function NPC_GossipHello(pUnit, event, pPlayer)
 
  if (pPlayer:IsInGroup()) then
    pUnit:GossipCreateMenu(100, pPlayer, 0)
    if (pPlayer:GetName() == pPlayer:GetGroupLeader():GetName()) then 
      pUnit:GossipMenuAddItem(0, "My companions are all accounted for, Muradin. Let's go!", 5, 0)
    else
      pUnit:GossipMenuAddItem(0, "I'm not the raid leader...", 6,  0)
    end
    pUnit:GossipSendMenu(pPlayer)
  end
 
end
 
RegisterUnitGossipEvent(50006, 1, NPC_GossipHello)
Personal tools