本文整理汇总了C#中Client.SendStatMessage方法的典型用法代码示例。如果您正苦于以下问题:C# Client.SendStatMessage方法的具体用法?C# Client.SendStatMessage怎么用?C# Client.SendStatMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client
的用法示例。
在下文中一共展示了Client.SendStatMessage方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Reincarnation
//.........这里部分代码省略.........
item.Send(client);
client.LoadItemStats(client.Entity);
client.CalculateStatBonus();
client.CalculateHPBonus();
Database.ConquerItemTable.UpdateItemID(item, client);
}
catch
{
Console.WriteLine("Reborn item problem: " + item.ID);
}
}
}
}
#region Alt Fix By Amjad
Interfaces.IConquerItem AltRing = client.Equipment.TryGetItem(26);
if (AltRing != null)
{
client.Equipment.Remove(26);
client.CalculateStatBonus();
client.CalculateHPBonus();
}
else
client.SendScreen(client.Entity.SpawnPacket, false);
Interfaces.IConquerItem AltRightHand = client.Equipment.TryGetItem(24);
if (AltRightHand != null)
{
client.Equipment.Remove(24);
client.CalculateStatBonus();
client.CalculateHPBonus();
}
else
client.SendScreen(client.Entity.SpawnPacket, false);
Interfaces.IConquerItem AltNecklace = client.Equipment.TryGetItem(22);
if (AltNecklace != null)
{
client.Equipment.Remove(22);
client.CalculateStatBonus();
client.CalculateHPBonus();
}
else
client.SendScreen(client.Entity.SpawnPacket, false);
Interfaces.IConquerItem AltHead = client.Equipment.TryGetItem(21);
if (AltHead != null)
{
client.Equipment.Remove(21);
client.CalculateStatBonus();
client.CalculateHPBonus();
}
else
client.SendScreen(client.Entity.SpawnPacket, false);
Interfaces.IConquerItem AltLeftHand = client.Equipment.TryGetItem(25);
if (AltLeftHand != null)
{
client.Equipment.Remove(25);
client.CalculateStatBonus();
client.CalculateHPBonus();
}
else
client.SendScreen(client.Entity.SpawnPacket, false);
Interfaces.IConquerItem AltBoots = client.Equipment.TryGetItem(28);
if (AltBoots != null)
{
client.Equipment.Remove(28);
client.CalculateStatBonus();
client.CalculateHPBonus();
}
else
client.SendScreen(client.Entity.SpawnPacket, false);
Interfaces.IConquerItem AltArmor = client.Equipment.TryGetItem(23);
if (AltArmor != null)
{
client.Equipment.Remove(23);
client.CalculateStatBonus();
client.CalculateHPBonus();
}
else
client.SendScreen(client.Entity.SpawnPacket, false);
#endregion
Interfaces.IConquerItem hand = client.Equipment.TryGetItem(5);
if (hand != null)
{
client.Equipment.Remove(5);
client.CalculateStatBonus();
client.CalculateHPBonus();
client.SendStatMessage();
}
else
client.SendScreen(client.Entity.SpawnPacket, false);
#endregion
Database.DataHolder.GetStats(client.Entity.Class, client.Entity.Level, client);
// client.loadi
client.CalculateStatBonus();
client.CalculateHPBonus();
client.GemAlgorithm();
client.SendStatMessage();
client.Equipment.UpdateEntityPacket();
//Database.ReincarnationTable.NewReincarnated(client.Entity);
Network.PacketHandler.WorldMessage(client.Entity.Name + " has got Reincarnation! Congratulations!");
}
示例2: Reincarnation
public Reincarnation(Client.GameState client, byte new_class)
{
if (client.Entity.Level < 130)
return;
_client = client;
RemoveSkill = new SafeDictionary<ushort, PhoenixProject.Interfaces.ISkill>(500);
Addskill = new SafeDictionary<ushort, PhoenixProject.Interfaces.ISkill>(500);
#region Low level items
for (byte i = 1; i < 9; i++)
{
if (i != 7)
{
Interfaces.IConquerItem item = client.Equipment.TryGetItem(i);
if (item != null && item.ID != 0)
{
try
{
//client.UnloadItemStats(item, false);
Database.ConquerItemInformation cii = new PhoenixProject.Database.ConquerItemInformation(item.ID, item.Plus);
item.ID = cii.LowestID(Network.PacketHandler.ItemMinLevel(Network.PacketHandler.ItemPosition(item.ID)));
item.Mode = PhoenixProject.Game.Enums.ItemMode.Update;
item.Send(client);
client.LoadItemStats(client.Entity);
Database.ConquerItemTable.UpdateItemID(item, client);
}
catch
{
Console.WriteLine("Reborn item problem: " + item.ID);
}
}
}
}
Interfaces.IConquerItem hand = client.Equipment.TryGetItem(5);
if (hand != null)
{
client.Equipment.Remove(5);
client.CalculateStatBonus();
client.CalculateHPBonus();
client.SendStatMessage();
}
else
//client.Screen.send(client.Entity.SpawnPacket, false);
#endregion
#region Remove Extra Skill
if (client.Entity.FirstRebornClass == 15 && client.Entity.SecondRebornClass == 15 && client.Entity.Class == 15)
{
WontAdd(PhoenixProject.Game.Enums.SkillIDs.DragonWhirl);
}
if (client.Entity.FirstRebornClass == 25 && client.Entity.SecondRebornClass == 25 && client.Entity.Class == 25)
{
WontAdd(PhoenixProject.Game.Enums.SkillIDs.Perseverance);
}
if (client.Entity.FirstRebornClass == 45 && client.Entity.SecondRebornClass == 45 && client.Entity.Class == 45)
{
WontAdd(PhoenixProject.Game.Enums.SkillIDs.StarArrow);
}
if (client.Entity.FirstRebornClass == 55 && client.Entity.SecondRebornClass == 55 && client.Entity.Class == 55)
{
WontAdd(PhoenixProject.Game.Enums.SkillIDs.PoisonStar);
}
if (client.Entity.FirstRebornClass == 65 && client.Entity.SecondRebornClass == 65 && client.Entity.Class == 65)
{
WontAdd(PhoenixProject.Game.Enums.SkillIDs.SoulShackle);
}
if (client.Entity.FirstRebornClass == 135 && client.Entity.SecondRebornClass == 135 && client.Entity.Class == 135)
{
WontAdd(PhoenixProject.Game.Enums.SkillIDs.AzureShield);
}
if (client.Entity.FirstRebornClass == 145 && client.Entity.SecondRebornClass == 145 && client.Entity.Class == 145)
{
WontAdd(PhoenixProject.Game.Enums.SkillIDs.HeavenBlade);
}
#endregion
Database.ReincarnationTable.NewReincarnated(client.Entity);
Game.Features.Reincarnation.ReincarnateInfo info = new Game.Features.Reincarnation.ReincarnateInfo();
info.UID = client.Entity.UID;
info.Level = client.Entity.Level;
info.Experience = client.Entity.Experience;
ServerBase.Kernel.ReincarnatedCharacters.Add(info.UID, info);
client.Entity.FirstRebornClass = client.Entity.SecondRebornClass;
client.Entity.SecondRebornClass = client.Entity.Class;
client.Entity.Class = new_class;
client.Entity.SecondRebornLevel = client.Entity.Level;
client.Entity.Level = 15;
client.Entity.Experience = 0;
client.Entity.Atributes =
(ushort)(client.ExtraAtributePoints(client.Entity.FirstRebornClass, client.Entity.FirstRebornLevel) +
client.ExtraAtributePoints(client.Entity.SecondRebornClass, client.Entity.SecondRebornLevel) + 62);
client.Spells.Clear();
client.Spells = new SafeDictionary<ushort, PhoenixProject.Interfaces.ISkill>(100);
switch (client.Entity.FirstRebornClass)
{
case 15:
{
Add(PhoenixProject.Game.Enums.SkillIDs.Cyclone);
Add(PhoenixProject.Game.Enums.SkillIDs.Hercules);
Add(PhoenixProject.Game.Enums.SkillIDs.SpiritHealing);
//.........这里部分代码省略.........
示例3: LoginMessages
//.........这里部分代码省略.........
// data.ID = Network.GamePackets.Data.OpenCustom;
// data.dwParam = Network.GamePackets.Data.CustomCommands.Minimize;
// client.Send(data);
// client.Send(new Message(ServerBase.Constants.ServerWebsite + ServerBase.Constants.WebAccExt + ServerBase.Constants.WebVoteExt, System.Drawing.Color.Red, Network.GamePackets.Message.Website));
// };
// client.Send(new NpcReply(NpcReply.MessageBox, "Would you like to consider voting for us? With more votes we will be come a bigger community."));
//}
/*if (client.Entity.VIPLevel != 0)
{
Database.PremiumTable.getVipInfo(client);
if (client.VIPDays != 0)
{
if (DateTime.Now >= client.VIPDate.AddDays(client.VIPDays))
{
client.Entity.VIPLevel = 0;
client.Send(ServerBase.Constants.VIPExpired);
}
else
{
DateTime VipEnds = client.VIPDate.AddDays(client.VIPDays);
TimeSpan span = VipEnds.Subtract(DateTime.Now);
client.Send(ServerBase.Constants.VIPRemaining(span.Days.ToString(), span.Hours.ToString()));
}
}
else
client.Send(ServerBase.Constants.VIPLifetime);
}*/
//if (Program.Today == DayOfWeek.Saturday || Program.Today == DayOfWeek.Sunday)
// client.Send(new Message("Double experience is on.", System.Drawing.Color.Red, Message.World));
client.Send(new MapStatus() { BaseID = client.Map.BaseID, ID = client.Map.ID, Status = Database.MapsTable.MapInformations[client.Map.ID].Status });
if (client.Entity.Hitpoints == 0)
client.Entity.Hitpoints = 1;
client.Entity.VIPLevel = (byte)(client.Entity.VIPLevel + 0);
client.Entity.HandleTiming = true;
if (client.Entity.ExtraBattlePower != 0)
client.Entity.Update(Network.GamePackets.Update.ExtraBattlePower, client.Entity.ExtraBattlePower, false);
if (client.Guild != null)
client.Guild.SendAllyAndEnemy(client);
if (Game.ConquerStructures.Broadcast.CurrentBroadcast.EntityID > 2)
client.Send(new Network.GamePackets.Message(Game.ConquerStructures.Broadcast.CurrentBroadcast.Message, "ALLUSERS", Game.ConquerStructures.Broadcast.CurrentBroadcast.EntityName, System.Drawing.Color.Red, Network.GamePackets.Message.BroadcastMessage));
client.Entity.Update(Network.GamePackets.Update.LuckyTimeTimer, client.BlessTime, false);
if (client.Entity.HeavenBlessing != 0)
client.Entity.Update(Network.GamePackets.Update.OnlineTraining, client.OnlineTrainingPoints, false);
if (client.ClaimableItem.Count > 0)
foreach (var item in client.ClaimableItem.Values)
item.Send(client);
if (client.DeatinedItem.Count > 0)
foreach (var item in client.DeatinedItem.Values)
item.Send(client);
foreach (Interfaces.IConquerItem item in client.Inventory.Objects)
item.Send(client);
foreach (Interfaces.IConquerItem item in client.Equipment.Objects)
if (item != null)
{
if (Database.ConquerItemInformation.BaseInformations.ContainsKey(item.ID))
{
item.Send(client);
ItemUsage usage = new ItemUsage(true) { ID = ItemUsage.EquipItem };
usage.UID = item.UID;
usage.dwParam = item.Position;
client.Send(usage);
client.LoadItemStats(item);
}
else
{
client.Equipment.DestroyArrow(item.Position);
Console.WriteLine("Announcement: Item have been removed because of invalid info. UID: " + item.UID + ". OWNER: " + client.Entity.Name);
}
}
if (!client.Equipment.Free(5))
{
if (IsArrow(client.Equipment.TryGetItem(5).ID))
{
if (client.Equipment.Free(4))
client.Equipment.DestroyArrow(5);
else
{
if (client.Equipment.TryGetItem(4).ID / 1000 != 500)
client.Equipment.DestroyArrow(5);
}
}
}
client.GemAlgorithm();
client.CalculateStatBonus();
client.CalculateHPBonus();
client.SendStatMessage();
// Conquer_Online_Server.Game.Attacking.Calculate.Vitals(client.Entity, true);
client.Equipment.UpdateEntityPacket();
EntityEquipment equips = new EntityEquipment(true);
equips.ParseHero(client);
client.Send(equips);
System.Threading.Thread.Sleep(3500);
//if ((int)client.Account.State >= 3)
// client.Entity.AddFlag(Update.Flags.Flashy);
}
示例4: HandlePacket
//.........这里部分代码省略.........
{
client.Entity.Atributes -= AddStr;
client.Entity.Strength += AddStr;
}
}
if (AddAgi > 0)
{
if (client.Entity.Atributes >= AddAgi)
{
client.Entity.Atributes -= AddAgi;
client.Entity.Agility += AddAgi;
}
}
if (AddVit > 0)
{
if (client.Entity.Atributes >= AddVit)
{
client.Entity.Atributes -= AddVit;
client.Entity.Vitality += AddVit;
}
}
if (AddSpi > 0)
{
if (client.Entity.Atributes >= AddSpi)
{
client.Entity.Atributes -= AddSpi;
client.Entity.Spirit += AddSpi;
}
}
//Conquer_Online_Server.Game.Attacking.Calculate.Vitals(client.Entity, true);
client.CalculateStatBonus();
client.CalculateHPBonus();
client.GemAlgorithm();
client.SendStatMessage();
break;
}
#endregion
#region Socketing (1027)
case 1027:
{
EmbedSocket socket = new EmbedSocket(false);
socket.Deserialize(packet);
SocketItem(socket, client);
break;
}
#endregion
#region ItemAdding Stabilization
case 1038:
{
ItemAddingStabilization stabilization = new ItemAddingStabilization(false);
stabilization.Deserialize(packet);
StabilazeArtifact(stabilization, client);
break;
}
#endregion
#region LoginPacket (1052)
case 1052:
{
if (client.Action == 1)
{
Connect connect = new Connect();
connect.Deserialize(packet);
AppendConnect(connect, client);
}
else
client.Disconnect();
示例5: EquipItem
//.........这里部分代码省略.........
return;
}
else if (itemUsage.dwParam == 0 && ItemPosition(item.ID) == 0)
{
UseItem(item, client);
return;
}
break;
}
}
#region Sanity checks
bool can2hand = false;
bool can2wpn = false;
if (client.Entity.Class >= 11 && client.Entity.Class <= 65)
can2hand = true;
if (client.Entity.Class >= 11 && client.Entity.Class <= 15 || client.Entity.Class >= 51 && client.Entity.Class <= 55 || client.Entity.Class >= 61 && client.Entity.Class <= 65 || client.Entity.Class >= 71 && client.Entity.Class <= 75)
can2wpn = true;
if (!Equipable(item, client))
return;
if (ItemPosition(item.ID) == 5)
{
itemUsage.dwParam = 5;
if (!can2hand && !can2wpn)
return;
if (client.Equipment.Free(4) || (client.Equipment.TryGetItem(4).ID / 1000 != 500 && IsArrow(item.ID)))
return;
}
if (ItemPosition(item.ID) == 4)
{
if (itemUsage.dwParam == 5)
if (!can2hand || !can2wpn)
return;
}
if (!((itemUsage.dwParam == 4 || itemUsage.dwParam == 5) && (ItemPosition(item.ID) == 4 || ItemPosition(item.ID) == 5)))
{
if (!IsAccessory(item.ID))
itemUsage.dwParam = ItemPosition(item.ID);
}
bool twohand = IsTwoHand(item.ID);
if (!twohand && itemUsage.dwParam == 4)
if (!client.Equipment.Free(5))
if (client.Inventory.Count < 40)
{
if (IsArrow(client.Equipment.TryGetItem(5).ID))
client.Equipment.Remove(5);
else
{
if (client.Equipment.TryGetItem(4) != null)
{
if (IsTwoHand(client.Equipment.TryGetItem(4).ID))
client.Equipment.Remove(4);
}
}
}
#endregion
if (client.Map.ID == 1039)
client.Entity.AttackPacket = null;
item.Position = (ushort)itemUsage.dwParam;
if (ItemPosition(item.ID) == 5 && !IsArrow(item.ID))
{
if (IsTwoHand(client.Equipment.TryGetItem(4).ID))
{
if (!client.Spells.ContainsKey(10311))//Perseverance
{
client.Send(new Message("You need to know Perseverance (Warrior Pure skill) to be able to wear 2-handed weapon and shield.", System.Drawing.Color.White, Message.Talk));
return;
}
}
}
Database.ConquerItemTable.ClearPosition(client.Entity.UID, (byte)itemUsage.dwParam);
client.Inventory.Remove(item, Game.Enums.ItemUse.Move);
if (client.Equipment.Free((byte)itemUsage.dwParam))
{
if (twohand)
client.Equipment.Remove(5);
item.Position = (byte)itemUsage.dwParam;
client.Equipment.Add(item);
item.Mode = Game.Enums.ItemMode.Update;
item.Send(client);
}
else
{
if (twohand)
client.Equipment.Remove(5);
client.Equipment.Remove((byte)itemUsage.dwParam);
item.Position = (byte)itemUsage.dwParam;
client.Equipment.Add(item);
}
client.CalculateStatBonus();
client.CalculateHPBonus();
client.SendStatMessage();
EntityEquipment equips = new EntityEquipment(true);
equips.ParseHero(client);
client.Send(equips);
}
}
示例6: CheckCommand
//.........这里部分代码省略.........
if (Data.Length > 2)
proficiency.Level = byte.Parse(Data[2]);
if (Data.Length > 3)
proficiency.Experience = uint.Parse(Data[3]);
client.AddProficiency(proficiency);
break;
}
case "spell":
{
Interfaces.ISkill spell = new GamePackets.Spell(true);
if (Data.Length > 1)
spell.ID = ushort.Parse(Data[1]);
if (Data.Length > 2)
spell.Level = byte.Parse(Data[2]);
if (Data.Length > 3)
spell.Experience = uint.Parse(Data[3]);
client.AddSpell(spell);
break;
}
case "level":
{
byte level = client.Entity.Level;
byte.TryParse(Data[1], out level);
level = Math.Min((byte)140, Math.Max((byte)1, level));
client.Entity.Level = level;
client.Entity.Experience = 0;
if (client.Entity.Reborn == 0)
{
Database.DataHolder.GetStats(client.Entity.Class, level, client);
client.CalculateStatBonus();
client.CalculateHPBonus();
client.GemAlgorithm();
client.SendStatMessage();
}
break;
}
case "class":
{
byte _class = client.Entity.Class;
byte.TryParse(Data[1], out _class);
_class = Math.Min((byte)145, Math.Max((byte)1, _class));
client.Entity.Class = _class;
if (client.Entity.Reborn == 0)
{
Database.DataHolder.GetStats(_class, client.Entity.Level, client);
client.CalculateStatBonus();
client.CalculateHPBonus();
client.GemAlgorithm();
client.SendStatMessage();
}
break;
}
case "body":
{
ushort body = client.Entity.Body;
ushort.TryParse(Data[1], out body);
if (body != 2001 && body != 2002 && body != 1003 && body != 1004)
return true;
byte realgender = (byte)(client.Entity.Body % 10);
byte gender = (byte)(body % 10);
if (client.Equipment.Objects[8] != null)
if (gender >= 3 && realgender <= 2)
return true;
client.Entity.Body = body;
if (gender >= 3 && realgender <= 2)
示例7: UnequipItem
static void UnequipItem(ItemUsage usage, Client.GameState client)
{
if (client.Equipment.Remove((byte)usage.dwParam))
{
if (client.Map.ID == 1039)
client.Entity.AttackPacket = null;
client.CalculateStatBonus();
client.CalculateHPBonus();
client.SendStatMessage();
EntityEquipment equips = new EntityEquipment(true);
equips.ParseHero(client);
client.Send(equips);
}
}