public bool PassOnThrone(IAccount account, string characterName) { var member = account.Character.Party.PartyMembers.FirstOrDefault(x => x.Value.Name == characterName).Value; if (member == default(PartyMemberInformations)) { Logger.Default.Log($"Could not find the specified CharacterName. Try using the <.partyMemberList> command ", LogMessageType.Party); } else { if (!IsLeader) { Logger.Default.Log($"Bot is not the PartyLeader."); } else { PartyAbdicateThroneMessage message = new PartyAbdicateThroneMessage(member.Id) { PartyId = PartyId }; account.Network.SendToServer(message); return(true); } } return(false); }
public static void HandlePartyAbdicateThroneMessage(WorldClient client, PartyAbdicateThroneMessage message) { if (client.Character.IsPartyLeader()) { Character member = client.Character.Party.GetMember(message.playerId); client.Character.Party.ChangeLeader(member); } }
public static void HandlePartyAbdicateThrone(PartyAbdicateThroneMessage message, WorldClient client) { if (client.Character.HasParty()) { var target = client.Character.Party.GetMember((long)message.playerId); if (target != null) { client.Character.Party.Abdicate(target); } } else { client.Send(new PartyCannotJoinErrorMessage(0, (sbyte)PartyJoinErrorEnum.PARTY_JOIN_ERROR_PARTY_NOT_FOUND)); } }
public static void HandlePartyAbdicateThroneMessage(WorldClient client, PartyAbdicateThroneMessage message) { if (!client.Character.IsInParty()) { return; } if (!client.Character.IsPartyLeader(message.partyId)) { return; } var member = client.Character.GetParty(message.partyId).GetMember((int)message.playerId); client.Character.GetParty(message.partyId).ChangeLeader(member); }
public static void PartyAbdicateRequest(PartyAbdicateThroneMessage message, WorldClient client) { Party p = WorldServer.Instance.Parties.Find(x => x.Id == message.partyId); if (p == null) { return; } if (p.BossCharacterId == client.Character.Id) { p.ChangeLeader((int)message.playerId); } else { client.Character.Reply("Vous devez être chef de groupe pour nommer votre successeur"); } }