本文整理汇总了C#中Client.SendScreen方法的典型用法代码示例。如果您正苦于以下问题:C# Client.SendScreen方法的具体用法?C# Client.SendScreen怎么用?C# Client.SendScreen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client
的用法示例。
在下文中一共展示了Client.SendScreen方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GiveReward
public static void GiveReward(Client.GameState client)
{
if (IsRace)
{
if (No < 10)
{
client.Entity.ConquerPoints += Reward;
Reward -= 400;
No++;
if (No == 1)
{
PhoenixProject.Network.GamePackets._String Packet = new PhoenixProject.Network.GamePackets._String(true);
Packet.UID = client.Entity.UID;
Packet.Type = PhoenixProject.Network.GamePackets._String.Effect;
Packet.TextsCount = 1;
Packet.Texts.Add("ridmatch_first");
client.SendScreen(Packet, true);
client.Entity.RacePoints += 20;
}
if (No == 2)
{
PhoenixProject.Network.GamePackets._String Packet = new PhoenixProject.Network.GamePackets._String(true);
Packet.UID = client.Entity.UID;
Packet.Type = PhoenixProject.Network.GamePackets._String.Effect;
Packet.TextsCount = 1;
Packet.Texts.Add("ridmatch_second");
client.SendScreen(Packet, true);
client.Entity.RacePoints += 15;
}
if (No == 3)
{
PhoenixProject.Network.GamePackets._String Packet = new PhoenixProject.Network.GamePackets._String(true);
Packet.UID = client.Entity.UID;
Packet.Type = PhoenixProject.Network.GamePackets._String.Effect;
Packet.TextsCount = 1;
Packet.Texts.Add("ridmatch_third");
client.SendScreen(Packet, true);
client.Entity.RacePoints += 10;
}
}
else
{
client.Entity.ConquerPoints += 5000;
client.Entity.RacePoints += 5;
No++;
}
SendTimerStatus(client.Entity.Name);
//FinishRace();
}
}
示例2: Mine
public static void Mine(Client.GameState client)
{
if (client.Equipment.Free(4))
{
client.Mining = false;
return;
}
var item = client.Equipment.TryGetItem(4);
var info = Database.ConquerItemInformation.BaseInformations[item.ID];
Data data = new Data(true);
data.ID = Data.SwingPickaxe;
data.UID = client.Entity.UID;
client.SendScreen(data, true);
if (info == null)
{
client.Mining = false;
return;
}
if (info.Name != "PickAxe" && info.Name != "Hoe")
{
client.Mining = false;
return;
}
if (!ServerBase.Kernel.Rate(40))
{
return;
}
switch (client.Entity.MapID)
{
case 1218://meteor zone mine
case 6001://jail war mine
case 6000://jails
{
Mine(700001, 700011, 700031, 700041, 1072010, 1072020, 1072050, 0, client);
break;
}
case 1025://phoenixcity minecave
case 1028://twincity minecave
{
Mine(700011, 700001, 700021, 700071, 1072010, 1072050, 1072031, 0, client);
break;
}
case 1027://DesertMine
case 1026://ApeMine
{
Mine(700051, 700061, 0, 0, 1072010, 1072020, 1072040, 1072050, client);
break;
}
default:
{
client.Send(new Message("You cannot mine here. You must go inside a mine.", System.Drawing.Color.Red, Message.TopLeft));
client.Mining = false;
break;
}
}
}
示例3: PlayerJump
//.........这里部分代码省略.........
}
else if (client.Entity.ContainsFlag(Update.Flags.Ride))
{
int time = (int)ServerBase.Kernel.maxJumpTime(client.lastJumpDistance);
int speedprc = Database.DataHolder.SteedSpeed(client.Equipment.TryGetItem(ConquerItem.Steed).Plus);
if (speedprc != 0)
{
if (Now < client.lastJumpTime.AddMilliseconds(time - (time * speedprc / 100)))
{
}
}
else
{
}
}
}
Jump:
client.lastJumpDistance = ServerBase.Kernel.GetDistance(new_X, new_Y, client.Entity.X, client.Entity.Y);
client.lastClientJumpTime = generalData.TimeStamp;
client.lastJumpTime = Now;
Game.Map Map = client.Map;
if (Map != null)
{
if (Map.Floor[new_X, new_Y, Game.MapObjectType.Player, null])
{
if (ServerBase.Kernel.GetDistance(new_X, new_Y, client.Entity.X, client.Entity.Y) <= 20)
{
client.Entity.Action = Game.Enums.ConquerAction.Jump;
client.Entity.Facing = ServerBase.Kernel.GetAngle(generalData.wParam1, generalData.wParam2, new_X, new_Y);
client.Entity.PX = client.Entity.X;
client.Entity.PY = client.Entity.Y;
client.Entity.X = new_X;
client.Entity.Y = new_Y;
client.SendScreen(generalData, true);
client.Screen.Reload(generalData);
if (client.Entity.MapID == 1005)
{
if (new_X == 42 && new_Y == 51)//stig
{
if (!client.Entity.ContainsFlag(Update.Flags.Stigma) && !client.Entity.ContainsFlag(Update.Flags.Ghost))
{
SpellUse suse = new SpellUse(true);
suse.Attacker = client.Entity.UID;
suse.SpellID = 1095;
suse.SpellLevel = 3;
suse.X = 42;
suse.Y = 51;
suse.Targets.Add(client.Entity.UID, 0);
client.Entity.AddFlag(Update.Flags.Stigma);
client.Entity.StigmaStamp = Time32.Now;
client.Entity.StigmaIncrease = 25;
client.Entity.StigmaTime = 20;
client.SendScreen(suse, true);
if (client.Entity.EntityFlag == PhoenixProject.Game.EntityFlag.Player)
client.Send(ServerBase.Constants.Stigma(25, 20));
}
}
else
{
if (new_X == 42 && new_Y == 48)//rev
{
if (client.Entity.ContainsFlag(Update.Flags.Ghost))
{
SpellUse suse = new SpellUse(true);
suse.Attacker = client.Entity.UID;
suse.SpellID = 1050;
示例4: PlayerGroundMovment
static void PlayerGroundMovment(GroundMovement groundMovement, Client.GameState client)
{
client.Entity.Action = PhoenixProject.Game.Enums.ConquerAction.None;
client.Attackable = true;
client.Mining = false;
if (client.Entity.ContainsFlag3(Network.GamePackets.Update.Flags3.MagicDefender))
{
client.Entity.MagicDefenderTime = 0;
client.Entity.MagicDefenderIncrease = 0;
client.Entity.RemoveFlag3(Network.GamePackets.Update.Flags3.MagicDefender);
SyncPacket packet = new SyncPacket
{
Identifier = client.Entity.UID,
Count = 2,
Type = PhoenixProject.Network.GamePackets.SyncPacket.SyncType.StatusFlag,
StatusFlag1 = (ulong)client.Entity.StatusFlag,
StatusFlag2 = (ulong)client.Entity.StatusFlag2,
Unknown1 = 0x31,
StatusFlagOffset = 0x80,
Time = 0,
Value = 0,
Level = 0
};
client.Entity.Owner.Send((byte[])packet);
foreach (var Client in client.MagicDef)
{
if (Client.Entity.ContainsFlag2(Update.Flags2.kimo4))
{
Client.Entity.RemoveFlag2(Update.Flags2.kimo4);
}
}
client.MagicDef.Clear();
}
if (client.Entity.ContainsFlag(Update.Flags.CastPray))
{
client.Entity.RemoveFlag(Update.Flags.CastPray);
foreach (var Client in client.Prayers)
{
if (Client.Entity.ContainsFlag(Update.Flags.Praying))
{
Client.Entity.RemoveFlag(Update.Flags.Praying);
}
}
client.Prayers.Clear();
}
if (client.Entity.ContainsFlag(Update.Flags.Praying))
{
client.Entity.RemoveFlag(Update.Flags.Praying);
if (client.PrayLead != null)
client.PrayLead.Prayers.Remove(client);
client.PrayLead = null;
}
if (client.Entity.AttackPacket != null)
{
client.Entity.AttackPacket = null;
}
if (client.Entity.ContainsFlag(Update.Flags.Ride))
client.Entity.Vigor -= 1;
client.Entity.PX = client.Entity.X;
client.Entity.PY = client.Entity.Y;
if ((byte)groundMovement.Direction > 7)
groundMovement.Direction = (PhoenixProject.Game.Enums.ConquerAngle)((byte)groundMovement.Direction % 8);
client.Entity.Move(groundMovement.Direction);
if (groundMovement.GroundMovementType == GroundMovement.TwoCoordonates)
client.Entity.Move(groundMovement.Direction);
client.SendScreen(groundMovement, true);
client.Screen.Reload(groundMovement);
if (client.Entity.MapID == 1002)
{
if (client.Entity.X == 436 && client.Entity.Y == 444)//stig
{
if (!client.Entity.ContainsFlag(Update.Flags.Ghost))
{
if (client.Entity.EntityFlag == PhoenixProject.Game.EntityFlag.Player && client.Entity.MaxHitpoints != client.Entity.Hitpoints)
{
SpellUse suse = new SpellUse(true);
suse.Attacker = client.Entity.UID;
suse.SpellID = 1195;
suse.SpellLevel = 0;
suse.X = 436;
suse.Y = 444;
uint Hp = (client.Entity.MaxHitpoints - client.Entity.Hitpoints);
client.Entity.Hitpoints = client.Entity.MaxHitpoints;
suse.Targets.Add(client.Entity.UID, Hp);
client.SendScreen(suse, true);
client.Send(new Message("Your HP Now : " + client.Entity.Hitpoints + "!", System.Drawing.Color.Red, Message.Talk));
}
}
}
}
if (client.Entity.MapID == 1005)
{
if (client.Entity.X == 42 && client.Entity.Y == 51)//stig
//.........这里部分代码省略.........
示例5: CpsFowin
public static void CpsFowin(Client.GameState GC)
{
// Entity GC = new Entity();
if (Kernel.SteedTornament.cps == 1)
{
GC.Entity.ConquerPoints += 20000;
GC.Entity.cp = 20000;
foreach (Client.GameState Chaar in ServerBase.Kernel.GamePool.Values)
{
//Entity Chaar = (Game.Entity)DE.Value;
{
if (Chaar != null)
{
if (Chaar.Entity.MapID == 1950)
{
Kernel.SendWorldMessage(new Message(""+ " "+" ", System.Drawing.Color.Orange, Message.Center), Kernel.GamePool.Values);
Kernel.SendWorldMessage(new Message( " Rank Name Score", System.Drawing.Color.Orange, Message.Center), Kernel.GamePool.Values);
Kernel.SendWorldMessage(new Message( "No.1 " + GC.Entity.Name + " " + (DateTime.Now - GC.Entity.SteedRaceTime) + "", System.Drawing.Color.Orange, Message.Center), Kernel.GamePool.Values);
Conquer_Online_Server.Network.GamePackets._String Packet = new Conquer_Online_Server.Network.GamePackets._String(true);
//GamePackets.poker Packet2 = new GamePackets.poker(true, client);
Packet.UID = GC.Entity.UID;
Packet.Type = _String.Effect;
Packet.TextsCount = 1;
Packet.Texts.Add("ridmatch_first");
GC.SendScreen(Packet, true);
}
}
}
}
}
else if (Kernel.SteedTornament.cps == 2)
{
GC.Entity.ConquerPoints += 17000;
GC.Entity.cp = 17000;
foreach (Client.GameState Chaar in ServerBase.Kernel.GamePool.Values)
{
// Entity Chaar = (Game.Entity)DE.Value;
{
if (Chaar != null)
{
if (Chaar.Entity.MapID == 1950)
{
Kernel.SendWorldMessage(new Message( "No.2 " + GC.Entity.Name + " " + (DateTime.Now - GC.Entity.SteedRaceTime) + "", System.Drawing.Color.Orange, Message.Center), Kernel.GamePool.Values);
Conquer_Online_Server.Network.GamePackets._String Packet = new Conquer_Online_Server.Network.GamePackets._String(true);
//GamePackets.poker Packet2 = new GamePackets.poker(true, client);
Packet.UID = GC.Entity.UID;
Packet.Type = _String.Effect;
Packet.TextsCount = 1;
Packet.Texts.Add("ridmatch_second");
GC.SendScreen(Packet, true);
}
}
}
}
}
else if (Kernel.SteedTornament.cps == 3)
{
GC.Entity.ConquerPoints += 15000;
GC.Entity.cp = 15000;
foreach (DictionaryEntry DE in Kernel.H_Chars)
{
Entity Chaar = (Game.Entity)DE.Value;
{
if (Chaar != null)
{
if (Chaar.MapID == 1950)
{
Kernel.SendWorldMessage(new Message( "No.3 " + GC.Entity.Name + " " + (DateTime.Now - GC.Entity.SteedRaceTime) + "", System.Drawing.Color.Orange, Message.Center), Kernel.GamePool.Values);
Conquer_Online_Server.Network.GamePackets._String Packet = new Conquer_Online_Server.Network.GamePackets._String(true);
//GamePackets.poker Packet2 = new GamePackets.poker(true, client);
Packet.UID = GC.Entity.UID;
Packet.Type = _String.Effect;
Packet.TextsCount = 1;
Packet.Texts.Add("ridmatch_third");
GC.SendScreen(Packet, true);
}
}
}
}
}
else if (Kernel.SteedTornament.cps == 4)
{
GC.Entity.ConquerPoints += 14000;
GC.Entity.cp = 14000;
foreach (DictionaryEntry DE in Kernel.H_Chars)
{
Entity Chaar = (Game.Entity)DE.Value;
{
if (Chaar != null)
{
if (Chaar.MapID == 1950)
{
Kernel.SendWorldMessage(new Message( "No.4 " + GC.Entity.Name + " " + (DateTime.Now - GC.Entity.SteedRaceTime) + "", System.Drawing.Color.Orange, Message.Center), Kernel.GamePool.Values);
Conquer_Online_Server.Network.GamePackets._String Packet = new Conquer_Online_Server.Network.GamePackets._String(true);
//GamePackets.poker Packet2 = new GamePackets.poker(true, client);
Packet.UID = GC.Entity.UID;
Packet.Type = _String.Effect;
//.........这里部分代码省略.........
示例6: Chat
static void Chat(Message message, Client.GameState client)
{
//Console.WriteLine("[" + client.Entity.Name + "][Chat] " + message.__Message);
if (!CheckCommand(message, client))
{
if (message.ChatType != Message.Service)
{
if (client.ChatBanned)
if (DateTime.Now > client.ChatBanTime.AddMinutes(client.ChatBanLasts))
client.ChatBanned = false;
else
{
int minutes = (int)new TimeSpan((client.ChatBanTime.AddMinutes(client.ChatBanLasts) - DateTime.Now).Ticks).TotalMinutes;
client.Send(new Message("You are banned from chat. You have to wait: " + minutes + " minutes before you can speak again!", System.Drawing.Color.Green, Message.Talk));
return;
}
}
if (client.Entity.Name == message._From)
{
switch (message.ChatType)
{
case Message.HawkMessage:
{
if (client.Booth != null)
{
client.Booth.HawkMessage = message;
client.SendScreen(message, true);
}
break;
}
case Message.Talk:
{
client.SendScreen(message, false);
break;
}
case Message.Whisper:
{
foreach (Client.GameState pClient in ServerBase.Kernel.GamePool.Values)
{
if (pClient != null)
{
if (pClient.Entity.Name == message._To)
{
message.Mesh = client.Entity.Mesh;
pClient.Send(message);
if (client.Account.State == Database.AccountTable.AccountState.GameMaster)
{
#region msglog
var dt = DateTime.Now;
string date = dt.Year + "-" + dt.Month + "//";
string datess = +dt.Day + "//";
if (!Directory.Exists(System.Windows.Forms.Application.StartupPath + ServerBase.Constants.Unhandledgmlog))
Directory.CreateDirectory(System.Windows.Forms.Application.StartupPath + "\\" + ServerBase.Constants.Unhandledgmlog);
if (!Directory.Exists(System.Windows.Forms.Application.StartupPath + ServerBase.Constants.Unhandledgmlog + "\\msglog"))
Directory.CreateDirectory(System.Windows.Forms.Application.StartupPath + "\\" + ServerBase.Constants.Unhandledgmlog + "\\msglog");
if (!Directory.Exists(System.Windows.Forms.Application.StartupPath + "\\" + ServerBase.Constants.Unhandledgmlog + "\\msglog\\" + date + ""))
Directory.CreateDirectory(System.Windows.Forms.Application.StartupPath + "\\" + ServerBase.Constants.Unhandledgmlog + "\\msglog\\" + date + "");
if (!File.Exists(System.Windows.Forms.Application.StartupPath + "\\" + ServerBase.Constants.Unhandledgmlog + "\\msglog\\" + date + "\\" + dt.Day + ".txt"))
File.CreateText(System.Windows.Forms.Application.StartupPath + "\\" + ServerBase.Constants.Unhandledgmlog + "\\msglog\\" + date + "\\" + dt.Day + ".txt");
File.WriteAllText(System.Windows.Forms.Application.StartupPath + "\\" + ServerBase.Constants.Unhandledgmlog + "\\msglog\\" + date + "\\" + dt.Day + ".txt",
File.ReadAllText(System.Windows.Forms.Application.StartupPath + "\\" + ServerBase.Constants.Unhandledgmlog + "\\msglog\\" + date + "\\" + dt.Day + ".txt") +
"\r\n" + client.Entity.Name + " Talk to : [" + pClient.Entity.Name + "] Message: [" + message.__Message + "]");
#endregion
}
if (client.Account.State == Database.AccountTable.AccountState.ProjectManager)
{
#region msglog
var dt = DateTime.Now;
string date = dt.Year + "-" + dt.Month + "//";
string datess = +dt.Day + "//";
if (!Directory.Exists(System.Windows.Forms.Application.StartupPath + ServerBase.Constants.Unhandledgmlog))
Directory.CreateDirectory(System.Windows.Forms.Application.StartupPath + "\\" + ServerBase.Constants.Unhandledgmlog);
if (!Directory.Exists(System.Windows.Forms.Application.StartupPath + ServerBase.Constants.Unhandledgmlog + "\\msglog"))
Directory.CreateDirectory(System.Windows.Forms.Application.StartupPath + "\\" + ServerBase.Constants.Unhandledgmlog + "\\msglog");
if (!Directory.Exists(System.Windows.Forms.Application.StartupPath + "\\" + ServerBase.Constants.Unhandledgmlog + "\\msglog\\" + date + ""))
Directory.CreateDirectory(System.Windows.Forms.Application.StartupPath + "\\" + ServerBase.Constants.Unhandledgmlog + "\\msglog\\" + date + "");
if (!File.Exists(System.Windows.Forms.Application.StartupPath + "\\" + ServerBase.Constants.Unhandledgmlog + "\\msglog\\" + date + "\\" + dt.Day + ".txt"))
File.CreateText(System.Windows.Forms.Application.StartupPath + "\\" + ServerBase.Constants.Unhandledgmlog + "\\msglog\\" + date + "\\" + dt.Day + ".txt");
File.WriteAllText(System.Windows.Forms.Application.StartupPath + "\\" + ServerBase.Constants.Unhandledgmlog + "\\msglog\\" + date + "\\" + dt.Day + ".txt",
File.ReadAllText(System.Windows.Forms.Application.StartupPath + "\\" + ServerBase.Constants.Unhandledgmlog + "\\msglog\\" + date + "\\" + dt.Day + ".txt") +
"\r\n" + client.Entity.Name + " Talk to : [" + pClient.Entity.Name + "] Message: [" + message.__Message + "]");
#endregion
}
return;
}
}
}
foreach (Game.ConquerStructures.Society.Friend friend in client.Friends.Values)
{
if (friend.Name == message._To)
{
message.__Message = message.__Message.Replace("'", "¹");
client.OnMessageBoxEventParams = new object[3];
client.OnMessageBoxEventParams[0] = client.Entity.UID;
//.........这里部分代码省略.........
示例7: ChangeAction
static void ChangeAction(Data generalData, Client.GameState client)
{
client.Entity.Action = (ushort)generalData.dwParam;
if (client.Entity.ContainsFlag(Network.GamePackets.Update.Flags.CastPray))
{
foreach (var Client in client.Prayers)
{
generalData.UID = Client.Entity.UID;
generalData.dwParam = (uint)client.Entity.Action;
generalData.wParam1 = Client.Entity.X;
generalData.wParam2 = Client.Entity.Y;
Client.Entity.Action = client.Entity.Action;
if (Time32.Now >= Client.CoolStamp.AddMilliseconds(1500))
{
if (Client.Equipment.IsAllSuper())
generalData.dwParam = (uint)(generalData.dwParam | (uint)(Client.Entity.Class * 0x10000 + 0x1000000));
else if (Client.Equipment.IsArmorSuper())
generalData.dwParam = (uint)(generalData.dwParam | (uint)(Client.Entity.Class * 0x10000));
Client.SendScreen(generalData, true);
Client.CoolStamp = Time32.Now;
}
else
Client.SendScreen(generalData, false);
}
}
generalData.UID = client.Entity.UID;
generalData.dwParam = (uint)client.Entity.Action;
if (client.Entity.Action == PhoenixProject.Game.Enums.ConquerAction.Cool)
{
if (Time32.Now >= client.CoolStamp.AddMilliseconds(1500))
{
if (client.Equipment.IsAllSuper())
generalData.dwParam = (uint)(generalData.dwParam | (uint)(client.Entity.Class * 0x10000 + 0x1000000));
else if (client.Equipment.IsArmorSuper())
generalData.dwParam = (uint)(generalData.dwParam | (uint)(client.Entity.Class * 0x10000));
client.SendScreen(generalData, true);
client.CoolStamp = Time32.Now;
}
else
client.SendScreen(generalData, false);
}
else
client.SendScreen(generalData, false);
}
示例8: AddFriend
static void AddFriend(KnownPersons knownperson, Client.GameState client)
{
if (!client.Friends.ContainsKey(knownperson.UID) && client.Friends.Count < 100)
{
Client.GameState Client = ServerBase.Kernel.GamePool[knownperson.UID];
if (Client != null)
{
Client.OnMessageBoxOK = delegate
{
if (client != null)
{
if (client.Socket != null)
{
if (client.Socket.Connected)
{
if (!Client.Friends.ContainsKey(client.Entity.UID))
{
client.Friends.Add(Client.Entity.UID, new PhoenixProject.Game.ConquerStructures.Society.Friend()
{
ID = Client.Entity.UID,
Name = Client.Entity.Name
});
Client.Friends.Add(client.Entity.UID, new PhoenixProject.Game.ConquerStructures.Society.Friend()
{
ID = client.Entity.UID,
Name = client.Entity.Name
});
client.Send(new KnownPersons(true)
{
UID = Client.Entity.UID,
Type = KnownPersons.AddFriend,
Name = Client.Entity.Name,
Online = true
});
Client.Send(new KnownPersons(true)
{
UID = client.Entity.UID,
Type = KnownPersons.AddFriend,
Name = client.Entity.Name,
Online = true
});
Database.KnownPersons.AddFriend(client, client.Friends[Client.Entity.UID]);
client.SendScreen(new Message(Client.Entity.Name + " has accepted " + client.Entity.Name + "'s friendship request.", System.Drawing.Color.Red, Message.TopLeft), true);
}
}
}
}
};
Client.OnMessageBoxCANCEL = delegate
{
if (client != null)
{
if (client.Socket != null)
{
if (client.Socket.Connected)
{
if (Client != null)
{
if (Client.Socket != null)
{
if (Client.Socket.Connected)
{
client.Send(new Message(Client.Entity.Name + " has rejected your friendship request.", System.Drawing.Color.Red, Message.TopLeft));
}
}
}
}
}
}
};
Client.Send(new NpcReply(NpcReply.MessageBox, client.Entity.Name + " wants to be your friend."));
}
}
}
示例9: UseItem
//.........这里部分代码省略.........
case 724205:
case 724207:
case 724208:
case 724210:
case 724211:
case 724212:
case 724215:
case 725055:
case 725056:
case 725057:
case 725058:
case 725160:
case 725161:
case 725162:
case 725163:
case 725164:
case 725165:
case 725166:
case 725167:
case 725168:
case 725169:
case 725170:
case 725171: GainRefineryItem(item, client); break;
#endregion
#region FireWorks
case 720030://firework
{
client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
_String str = new _String(true);
str.UID = client.Entity.UID;
str.TextsCount = 1;
str.Type = _String.Effect;
str.Texts.Add("zf2-e290");
client.SendScreen(str, true);
break;
}
case 720031://EndlessLove
{
client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
_String str = new _String(true);
str.UID = client.Entity.UID;
str.TextsCount = 1;
str.Type = _String.Effect;
str.Texts.Add("zf2-e355");
client.SendScreen(str, true);
break;
}
case 720032://MyWish
{
client.Inventory.Remove(item, Game.Enums.ItemUse.Remove);
_String str = new _String(true);
str.UID = client.Entity.UID;
str.TextsCount = 1;
str.Type = _String.Effect;
str.Texts.Add("zf2-e240");
client.SendScreen(str, true);
break;
}
#endregion
#region Demon Boxs
#region 10cps
case 720650:
{
Database.MonsterInformation monster = new PhoenixProject.Database.MonsterInformation();
// monster.Boss = true;
monster.Hitpoints = 33;
示例10: HandlePacket
//.........这里部分代码省略.........
break;
}
case 2233:
{
GamePackets.Team_Pk pk = new Team_Pk(client.Entity.UID);
pk.Send(client);
break;
}
case 2252:
{
// byte[] sed = new byte[60];
// ;rver };
client.Send(packet);
break;
}
case 1130:
{
if (client.Entity.TitlePacket != null)
{
if (packet[9] == 4)
{
if (client.Entity.TitlePacket.dwParam2 != 0)
client.Entity.TitlePacket.Send(client);
}
if (packet[9] == 3)
{
client.Entity.TitleActivated = packet[8];
client.Send(packet);
client.SendScreen(client.Entity.SpawnPacket, false);
}
}
break;
}
#endregion
#region TopGuilds
case 1058:
{
if (client.Guild != null && client.AsMember != null)
{
if (client.AsMember != null)
{
Writer.WriteUInt32((uint)client.AsMember.SilverDonation, 8, packet);
if (client.Entity.GuildRank != (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.DeputyLeader)
if (client.Entity.GuildRank != (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
if (client.AsMember.SilverDonation > client.Guild.money_donation)
{
client.Guild.money_donation = (uint)client.AsMember.SilverDonation;
client.Entity.GuildRank = (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.OSupervisor;
client.AsMember.Rank = (Conquer_Online_Server.Game.Enums.GuildMemberRank)client.Entity.GuildRank;
}
Writer.WriteUInt32((uint)client.AsMember.ConquerPointDonation, 20, packet);
if (client.Entity.GuildRank != (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.DeputyLeader)
if (client.Entity.GuildRank != (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.GuildLeader)
if (client.AsMember.ConquerPointDonation > client.Guild.cp_donaion)
{
client.Guild.cp_donaion = (uint)client.AsMember.ConquerPointDonation;
client.Entity.GuildRank = (ushort)Conquer_Online_Server.Game.Enums.GuildMemberRank.CPSupervisor;
client.AsMember.Rank = (Conquer_Online_Server.Game.Enums.GuildMemberRank)client.Entity.GuildRank;
}
示例11: Chat
static void Chat(Message message, Client.GameState client)
{
//Console.WriteLine("[" + client.Entity.Name + "][Chat] " + message.__Message);
if (!CheckCommand(message, client))
{
if (message.ChatType != Message.Service)
{
if (client.ChatBanned)
if (DateTime.Now > client.ChatBanTime.AddMinutes(client.ChatBanLasts))
client.ChatBanned = false;
else
{
int minutes = (int)new TimeSpan((client.ChatBanTime.AddMinutes(client.ChatBanLasts) - DateTime.Now).Ticks).TotalMinutes;
client.Send(new Message("You are banned from chat. You have to wait: " + minutes + " minutes before you can speak again!", System.Drawing.Color.Green, Message.Talk));
return;
}
}
switch (message.ChatType)
{
case Message.HawkMessage:
{
if (client.Booth != null)
{
client.Booth.HawkMessage = message;
client.SendScreen(message, true);
}
break;
}
case Message.Talk:
{
client.SendScreen(message, false);
break;
}
case Message.Whisper:
{
var varr = ServerBase.Kernel.GamePool.Values.GetEnumerator();
varr.MoveNext();
int COunt = ServerBase.Kernel.GamePool.Count;
for (uint x = 0;
x < COunt;
x++)
{
if (x >= COunt) break;
Client.GameState pClient = (varr.Current as Client.GameState);
if (pClient.Entity.Name == message._To)
{
message.Mesh = client.Entity.Mesh;
pClient.Send(message);
return;
}
varr.MoveNext();
}
foreach (Game.ConquerStructures.Society.Friend friend in client.Friends.Values)
{
if (friend.Name == message._To)
{
message.__Message = message.__Message.Replace("'", "¹");
client.OnMessageBoxEventParams = new object[3];
client.OnMessageBoxEventParams[0] = client.Entity.UID;
client.OnMessageBoxEventParams[1] = friend.ID;
client.OnMessageBoxEventParams[2] = Console.TimeStamp() + message.__Message;
client.OnMessageBoxOK =
delegate
{
Database.KnownPersons.UpdateMessageOnFriend(Convert.ToUInt32(client.OnMessageBoxEventParams[0]), Convert.ToUInt32(client.OnMessageBoxEventParams[1]), Convert.ToString(client.OnMessageBoxEventParams[2]));
client.Send(new Message("Message sent!", System.Drawing.Color.Green, Message.TopLeft));
};
client.OnMessageBoxCANCEL =
delegate
{
client.OnMessageBoxEventParams = new object[0];
};
client.Send(new NpcReply(NpcReply.MessageBox, "To " + friend.Name + ": \r\n" + message.__Message + "\r\n\r\nSend? (It will replace other messages.)"));
return;
}
}
client.Send(new Message("The player is not online.", System.Drawing.Color.Orange, Message.Service));
break;
}
case Message.Service:
{
var varr = ServerBase.Kernel.GamePool.Values.GetEnumerator();
varr.MoveNext();
int COunt = ServerBase.Kernel.GamePool.Count;
for (uint x = 0;
x < COunt;
x++)
{
if (x >= COunt) break;
Client.GameState pClient = (varr.Current as Client.GameState);
if (pClient.Account.State == Database.AccountTable.AccountState.GameMaster || pClient.Account.State == Database.AccountTable.AccountState.ProjectManager)
{
message.ChatType = Message.Talk;
string _Message = "Service-> " + client.Entity.Name + " needs your help. Respond to him/her right now!!!";
//.........这里部分代码省略.........
示例12: Reincarnation
public Reincarnation(Client.GameState client, byte new_class)
{
if (client.Entity.Level < 130)
return;
_client = client;
RemoveSkill = new SafeDictionary<ushort, Conquer_Online_Server.Interfaces.ISkill>(500);
Addskill = new SafeDictionary<ushort, Conquer_Online_Server.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 Conquer_Online_Server.Database.ConquerItemInformation(item.ID, item.Plus);
item.ID = cii.LowestID(Network.PacketHandler.ItemMinLevel(Network.PacketHandler.ItemPosition(item.ID)));
item.Mode = Conquer_Online_Server.Game.Enums.ItemMode.Update;
item.Send(client);
client.LoadItemStats(item);
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.SendScreen(client.Entity.SpawnPacket, false);
#endregion
#region Remove Extra Skill
if (client.Entity.FirstRebornClass == 15 && client.Entity.SecondRebornClass == 15 && client.Entity.Class == 15)
{
WontAdd(Conquer_Online_Server.Game.Enums.SkillIDs.DragonWhirl);
}
if (client.Entity.FirstRebornClass == 25 && client.Entity.SecondRebornClass == 25 && client.Entity.Class == 25)
{
WontAdd(Conquer_Online_Server.Game.Enums.SkillIDs.Perseverance);
}
if (client.Entity.FirstRebornClass == 45 && client.Entity.SecondRebornClass == 45 && client.Entity.Class == 45)
{
WontAdd(Conquer_Online_Server.Game.Enums.SkillIDs.StarArrow);
}
if (client.Entity.FirstRebornClass == 55 && client.Entity.SecondRebornClass == 55 && client.Entity.Class == 55)
{
WontAdd(Conquer_Online_Server.Game.Enums.SkillIDs.PoisonStar);
}
if (client.Entity.FirstRebornClass == 65 && client.Entity.SecondRebornClass == 65 && client.Entity.Class == 65)
{
WontAdd(Conquer_Online_Server.Game.Enums.SkillIDs.SoulShackle);
}
if (client.Entity.FirstRebornClass == 135 && client.Entity.SecondRebornClass == 135 && client.Entity.Class == 135)
{
WontAdd(Conquer_Online_Server.Game.Enums.SkillIDs.AzureShield);
}
if (client.Entity.FirstRebornClass == 145 && client.Entity.SecondRebornClass == 145 && client.Entity.Class == 145)
{
WontAdd(Conquer_Online_Server.Game.Enums.SkillIDs.HeavenBlade);
}
#endregion
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.ReincarnationLev = client.Entity.Level;//kikoz
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, Conquer_Online_Server.Interfaces.ISkill>(100);
switch (client.Entity.FirstRebornClass)
{
case 15:
{
Add(Conquer_Online_Server.Game.Enums.SkillIDs.Cyclone);
Add(Conquer_Online_Server.Game.Enums.SkillIDs.Hercules);
Add(Conquer_Online_Server.Game.Enums.SkillIDs.SpiritHealing);
Add(Conquer_Online_Server.Game.Enums.SkillIDs.Robot);
break;
}
case 25:
{
Add(Conquer_Online_Server.Game.Enums.SkillIDs.SuperMan);
//.........这里部分代码省略.........
示例13: CheckForExtraWeaponPowers
public static void CheckForExtraWeaponPowers(Client.GameState client, Entity attacked)
{
#region Right Hand
if (client.Equipment.TryGetItem(ConquerItem.RightWeapon) != null)
{
if (client.Equipment.TryGetItem(ConquerItem.RightWeapon).ID != 0)
{
var Item = client.Equipment.TryGetItem(ConquerItem.RightWeapon);
if (Item.Effect != Enums.ItemEffect.None)
{
if (ServerBase.Kernel.Rate(30))
{
switch (Item.Effect)
{
case Enums.ItemEffect.HP:
{
SpellUse spellUse = new SpellUse(true);
spellUse.SpellID = 1175;
spellUse.SpellLevel = 4;
spellUse.X = client.Entity.X;
spellUse.Y = client.Entity.Y;
spellUse.Targets.Add(client.Entity.UID, 300);
uint damage = Math.Min(300, client.Entity.MaxHitpoints - client.Entity.Hitpoints);
client.Entity.Hitpoints += damage;
client.SendScreen(spellUse, true);
break;
}
case Enums.ItemEffect.MP:
{
SpellUse spellUse = new SpellUse(true);
spellUse.SpellID = 1175;
spellUse.SpellLevel = 2;
spellUse.X = client.Entity.X;
spellUse.Y = client.Entity.Y;
spellUse.Targets.Add(client.Entity.UID, 300);
ushort damage = (ushort)Math.Min(300, client.Entity.MaxMana - client.Entity.Mana);
client.Entity.Mana += damage;
client.SendScreen(spellUse, true);
break;
}
case Enums.ItemEffect.Shield:
{
if (client.Entity.ContainsFlag(Update.Flags.MagicShield))
return;
SpellUse spellUse = new SpellUse(true);
spellUse.SpellID = 1020;
spellUse.SpellLevel = 0;
spellUse.X = client.Entity.X;
spellUse.Y = client.Entity.Y;
spellUse.Targets.Add(client.Entity.UID, 120);
client.Entity.ShieldTime = 0;
client.Entity.ShieldStamp = Time32.Now;
client.Entity.MagicShieldStamp = Time32.Now;
client.Entity.MagicShieldTime = 0;
client.Entity.AddFlag(Update.Flags.MagicShield);
client.Entity.MagicShieldStamp = Time32.Now;
client.Entity.MagicShieldIncrease = 2;
client.Entity.MagicShieldTime = 120;
if (client.Entity.EntityFlag == EntityFlag.Player)
client.Send(ServerBase.Constants.Shield(2, 120));
client.SendScreen(spellUse, true);
break;
}
case Enums.ItemEffect.Poison:
{
if (attacked != null)
{
if (attacked.UID == client.Entity.UID)
return;
if (attacked.ToxicFogLeft > 0)
return;
SpellUse spellUse = new SpellUse(true);
spellUse.SpellID = 5040;
spellUse.Attacker = attacked.UID;
spellUse.SpellLevel = 9;
spellUse.X = attacked.X;
spellUse.Y = attacked.Y;
spellUse.Targets.Add(attacked.UID, 0);
spellUse.Targets[attacked.UID].Hit = true;
attacked.ToxicFogStamp = Time32.Now;
attacked.ToxicFogLeft = 10;
attacked.ToxicFogPercent = 0.05F;
client.SendScreen(spellUse, true);
}
break;
}
}
}
}
}
}
#endregion
#region Left Hand
if (client.Equipment.TryGetItem(ConquerItem.LeftWeapon) != null)
{
if (client.Equipment.TryGetItem(ConquerItem.LeftWeapon).ID != 0)
{
var Item = client.Equipment.TryGetItem(ConquerItem.LeftWeapon);
if (Item.Effect != Enums.ItemEffect.None)
//.........这里部分代码省略.........
示例14: GetDialog
//.........这里部分代码省略.........
}
}
break;
}
#endregion
#region Gates
case 516074:
{
if (client.Guild != null)
{
if (client.Guild.PoleKeeper)
{
switch (npcRequest.OptionID)
{
case 0:
dialog.Text("Select the option you want to pursue.");
if (client.AsMember.Rank != Conquer_Online_Server.Game.Enums.GuildMemberRank.Member)
{
dialog.Option("Open gate.", 1);
}
dialog.Option("Get inside.", 3);
dialog.Option("Nothing.", 255);
dialog.Send();
break;
case 1:
{
Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.LeftGate.Mesh = (ushort)(250 + Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.LeftGate.Mesh % 10);
Update upd = new Update(true);
upd.UID = Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.LeftGate.UID;
upd.Append(Update.Mesh, Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.LeftGate.Mesh);
Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.LeftGate.Hitpoints = Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.LeftGate.MaxHitpoints;
client.SendScreen(upd, true);
break;
}
case 2:
{
Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.LeftGate.Mesh = (ushort)(240 + Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.LeftGate.Mesh % 10);
Update upd = new Update(true);
upd.UID = Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.LeftGate.UID;
upd.Append(Update.Mesh, Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.LeftGate.Mesh);
Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.LeftGate.Hitpoints = Conquer_Online_Server.Game.ConquerStructures.Society.GuildWar.LeftGate.MaxHitpoints;
client.SendScreen(upd, true);
break;
}
case 3:
{
client.Entity.Teleport(1038, 162, 198);
break;
}
}
}
}
break;
}
case 516075:
{
if (client.Guild != null)
{
if (client.Guild.PoleKeeper)
{
switch (npcRequest.OptionID)
{
case 0:
示例15: Win
//.........这里部分代码省略.........
loser.Send(loser.ArenaStatistic);
QualifyEngine.DoQuit(loser);
}
else if (loser == null && winner != null)
{
winner.ArenaStatistic.PlayWith = 0;
winner.ArenaStatistic.AcceptBox = false;
winner.ArenaStatistic.TodayWin++;
winner.ArenaStatistic.TotalWin++;
ArenaSignup sign = new ArenaSignup();
sign.DialogID = ArenaSignup.MainIDs.Match;
sign.OptionID = ArenaSignup.DialogButton.Win;
winner.Send(sign.BuildPacket());
sign = new ArenaSignup();
sign.DialogID = ArenaSignup.MainIDs.Match;
sign.OptionID = ArenaSignup.DialogButton.MatchOff;
winner.Send(sign.BuildPacket());
Sort();
QualifyEngine.DoQuit(winner);
winner.Send(winner.ArenaStatistic);
}
else if (loser == null && winner == null)
{
return;
}
else
{
if (winner.ArenaStatistic.PlayWith != 0 && loser.ArenaStatistic.PlayWith != 0)
{
int diff = (int)winner.ArenaStatistic.ArenaPoints - (int)loser.ArenaStatistic.ArenaPoints;
diff = diff < 0 ? -diff : diff;
if (diff == 0 || diff > 50)
diff = ServerBase.Kernel.Random.Next(30, 50);
ArenaSignup sign = new ArenaSignup();
sign.DialogID = ArenaSignup.MainIDs.Match;
loser.Send(sign.BuildPacket());
sign.OptionID = ArenaSignup.DialogButton.Win;
winner.Send(sign.BuildPacket());
sign = new ArenaSignup();
sign.DialogID = ArenaSignup.MainIDs.Match;
sign.OptionID = ArenaSignup.DialogButton.MatchOff;
loser.Send(sign.BuildPacket());
winner.Send(sign.BuildPacket());
winner.ArenaStatistic.PlayWith = 0;
loser.ArenaStatistic.PlayWith = 0;
winner.ArenaStatistic.AcceptBox = false;
loser.ArenaStatistic.AcceptBox = false;
winner.ArenaStatistic.ArenaPoints += (uint)diff;
Message message = null;
message = new Message("" + winner.ArenaStatistic.Name + " has Defeated " + loser.ArenaStatistic.Name + " in the Qualifier, and is currently ranked No. " + winner.ArenaStatistic.Rank + "!", System.Drawing.Color.Red, Message.Qualifier);
foreach (Client.GameState client in ServerBase.Kernel.GamePool.Values)
{
client.Send(message);
}
loser.ArenaStatistic.ArenaPoints -= (uint)diff;
if (loser.ArenaStatistic.ArenaPoints > 80000)
loser.ArenaStatistic.ArenaPoints = 0;
if (loser.ArenaStatistic.ArenaPoints == 0)
QualifyEngine.DoQuit(loser);
winner.ArenaStatistic.TodayWin++;
winner.ArenaStatistic.TotalWin++;
if (winner.ArenaStatistic.TodayWin == 9)
winner.IncreaseExperience(winner.ExpBall, false);
if (winner.ArenaStatistic.TodayBattles == 20)
winner.IncreaseExperience(winner.ExpBall, false);
if (loser.ArenaStatistic.TodayBattles == 20)
loser.IncreaseExperience(loser.ExpBall, false);
loser.ArenaStatistic.TotalLose++;
Sort();
winner.Send(winner.ArenaStatistic);
loser.Send(loser.ArenaStatistic);
QualifyEngine.DoQuit(winner);
QualifyEngine.DoQuit(loser);
winner.QualifierGroup = null;
loser.QualifierGroup = null;
_String str = new _String(true);
str.UID = winner.Entity.UID;
str.TextsCount = 1;
str.Type = _String.Effect;
str.Texts.Add("sports_victory");
winner.SendScreen(str, true);
_String strs = new _String(true);
strs.UID = loser.Entity.UID;
strs.TextsCount = 1;
strs.Type = _String.Effect;
strs.Texts.Add("sports_failure");
loser.SendScreen(strs, true);
}
}
}