本文整理匯總了C#中Server.Network.PacketHitList.AddPacketToParty方法的典型用法代碼示例。如果您正苦於以下問題:C# PacketHitList.AddPacketToParty方法的具體用法?C# PacketHitList.AddPacketToParty怎麽用?C# PacketHitList.AddPacketToParty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Server.Network.PacketHitList
的用法示例。
在下文中一共展示了PacketHitList.AddPacketToParty方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: AppendPartyMemberData
public static void AppendPartyMemberData(Client member, PacketHitList hitlist, int slot)
{
if (!string.IsNullOrEmpty(member.Player.PartyID)) {
Party playerParty = PartyManager.FindPlayerParty(member);
hitlist.AddPacketToParty(playerParty, TcpPacket.CreatePacket("partymemberdata", slot.ToString(), member.Player.Name, member.Player.GetActiveRecruit().Species.ToString(), member.Player.GetActiveRecruit().Form.ToString(), ((int)member.Player.GetActiveRecruit().Shiny).ToString(), ((int)member.Player.GetActiveRecruit().Sex).ToString(),
member.Player.GetActiveRecruit().Exp.ToString(), member.Player.GetActiveRecruit().GetNextLevel().ToString(),
member.Player.GetActiveRecruit().HP.ToString(), member.Player.GetActiveRecruit().MaxHP.ToString()));
}
}
示例2: OnMapLoaded
public static void OnMapLoaded(Client client, IMap map, PacketHitList packetList)
{
try {
//make sure escorts and other allies aren't taken out of the dungeon
if (map.Moral != Enums.MapMoral.None) {
int left = 0;
for (int i = 0; i < Constants.MAX_ACTIVETEAM; i++) {
if (client.Player.Team[i].RecruitIndex < -1) {
client.Player.RemoveFromTeam(i);
left++;
}
}
if (left > 1) {
Messenger.PlayerMsg(client, "Some members left the team.", Text.Grey);
client.Player.SwapActiveRecruit(0);
} else if (left > 0) {
Messenger.PlayerMsg(client, "A member left the team.", Text.Grey);
client.Player.SwapActiveRecruit(0);
}
}
if (exPlayer.Get(client).FirstMapLoaded) {
if (map.Moral == Enums.MapMoral.None && client.Player.IsInParty()) {
packetList.AddPacketToParty(client.Player.PartyID, PacketBuilder.CreateChatMsg("[Party]: " + client.Player.Name + " reached " + map.Name + ".", Text.Cyan));
}
for (int i = 0; i < Constants.MAX_ACTIVETEAM; i++) {
if (client.Player.Team[i] != null && client.Player.Team[i].Loaded) {
RemoveBuffs(client.Player.Team[i]);
}
}
//remove statuses
RemoveAllBondedExtraStatus(client.Player.GetActiveRecruit(), map, packetList, false);
for (int i = 0; i < Constants.MAX_ACTIVETEAM; i++) {
if (client.Player.Team[i] != null && client.Player.Team[i].Loaded) {
client.Player.Team[i].VolatileStatus.Clear();
RefreshCharacterTraits(client.Player.Team[i], map, packetList);
}
}
for (int j = 0; j < Constants.MAX_ACTIVETEAM; j++) {
if (client.Player.Team[j] != null && client.Player.Team[j].Loaded) {
if (HasAbility(client.Player.Team[j], "Illusion")) {
int selectedSlot = j;
for (int i = 1; i < Constants.MAX_ACTIVETEAM; i++) {
if (client.Player.Team[(selectedSlot + i) % Constants.MAX_ACTIVETEAM] != null && client.Player.Team[(selectedSlot + i) % Constants.MAX_ACTIVETEAM].Loaded) {
selectedSlot = (selectedSlot + i) % Constants.MAX_ACTIVETEAM;
break;
}
}
if (selectedSlot != j) {
AddExtraStatus(client.Player.Team[j], client.Player.Map, "Illusion", client.Player.Team[selectedSlot].Species, null, "", packetList, false);
}
}
//set illusion
if (client.Player.GetActiveRecruit().HasActiveItem(213)) {
AddExtraStatus(client.Player.Team[j], client.Player.Map, "Illusion", 25, null, "", packetList, false);
}
if (client.Player.GetActiveRecruit().HasActiveItem(224)) {
AddExtraStatus(client.Player.Team[j], client.Player.Map, "Illusion", 300, null, "", packetList, false);
}
if (client.Player.GetActiveRecruit().HasActiveItem(244)) {
AddExtraStatus(client.Player.Team[j], client.Player.Map, "Illusion", 387, null, "", packetList, false);
}
if (client.Player.GetActiveRecruit().HasActiveItem(245)) {
AddExtraStatus(client.Player.Team[j], client.Player.Map, "Illusion", 390, null, "", packetList, false);
}
if (client.Player.GetActiveRecruit().HasActiveItem(246)) {
AddExtraStatus(client.Player.Team[j], client.Player.Map, "Illusion", 393, null, "", packetList, false);
}
}
}
if (client.Player.Map.MapType == Enums.MapType.RDungeonMap) {
if (HasAbility(client.Player.GetActiveRecruit(), "Honey Gather")
&& client.Player.FindInvSlot(-1) > -1) {
if (Server.Math.Rand(0, 400) <= client.Player.GetActiveRecruit().Level) {
client.Player.GiveItem(11, 0, "");
packetList.AddPacket(client, PacketBuilder.CreateBattleMsg(client.Player.GetActiveRecruit().Name + " gathered honey from somewhere.", Text.WhiteSmoke));
}
}
if (client.Player.Map.MapType == Enums.MapType.RDungeonMap) {
for (int i = 0; i < Constants.MAX_ACTIVETEAM; i++) {
if (client.Player.GetActiveRecruit() != null && client.Player.GetActiveRecruit().Loaded && !client.Player.Dead) {
if (HasAbility(client.Player.GetActiveRecruit(), "Pickup")
&& client.Player.FindInvSlot(-1) > -1) {
RDungeonFloor floor = RDungeonManager.RDungeons[((RDungeonMap)map).RDungeonIndex].Floors[((RDungeonMap)map).RDungeonFloor];
if (floor.Items.Count > 0) {
int rand = Server.Math.Rand(0, floor.Items.Count);
if (Server.Math.Rand(0, 200) <= floor.Items[rand].AppearanceRate) {
int amount = (floor.Items[rand].MinAmount + floor.Items[rand].MaxAmount) / 2;
client.Player.GiveItem(floor.Items[rand].ItemNum, amount, floor.Items[rand].Tag);
packetList.AddPacket(client, PacketBuilder.CreateBattleMsg(client.Player.GetActiveRecruit().Name + " found an item from somewhere.", Text.WhiteSmoke));
}
}
//.........這裏部分代碼省略.........