Beispiel #1
0
        /// <summary>
        /// Changes leader of the arena team
        /// </summary>
        /// <param name="newLeader">ArenaTeamMember of new leader</param>
        /// <param name="update">if true, sends event to the team</param>
        public void ChangeLeader(ArenaTeamMember newLeader)
        {
            if (newLeader.ArenaTeam != this)
            {
                return;
            }

            var currentLeader = Leader;

            currentLeader.Character.SetArenaTeamInfoField(Slot, ArenaTeamInfoType.ARENA_TEAM_MEMBER, 1);

            Leader = newLeader;
            newLeader.Character.SetArenaTeamInfoField(Slot, ArenaTeamInfoType.ARENA_TEAM_MEMBER, 0);

            RealmServer.IOQueue.AddMessage(new Message(() =>
            {
                if (currentLeader != null)
                {
                    currentLeader.Update();
                }
                newLeader.Update();
                Update();
            }));

            if (currentLeader != null)
            {
                //ArenaTeamHandler.SendEventToTeam(this, ArenaTeamEvents.LEADER_CHANGED_SSS, newLeader, currentLeader);
            }
        }
Beispiel #2
0
        /// <summary>Changes leader of the arena team</summary>
        /// <param name="newLeader">ArenaTeamMember of new leader</param>
        /// <param name="update">if true, sends event to the team</param>
        public void ChangeLeader(ArenaTeamMember newLeader)
        {
            if (newLeader.ArenaTeam != this)
            {
                return;
            }
            ArenaTeamMember currentLeader = this.Leader;

            currentLeader.Character.SetArenaTeamInfoField(this.Slot, ArenaTeamInfoType.ARENA_TEAM_MEMBER, 1U);
            this.Leader = newLeader;
            newLeader.Character.SetArenaTeamInfoField(this.Slot, ArenaTeamInfoType.ARENA_TEAM_MEMBER, 0U);
            ServerApp <WCell.RealmServer.RealmServer> .IOQueue.AddMessage((IMessage) new Message((Action)(() =>
            {
                if (currentLeader != null)
                {
                    currentLeader.Update();
                }
                newLeader.Update();
                this.Update();
            })));

            ArenaTeamMember arenaTeamMember = currentLeader;
        }