|
|
المشاركات 209 |
+التقييم 0.04 |
تاريخ التسجيل Oct 2011 |
الاقامة |
نظام التشغيل |
رقم العضوية 22 |
#region Clans
case 1312:
{
switch (packet[4])
{
case 21://transfer
{
if (client.Entity.Myclan != null)
{
PrintPacket(packet);
uint lider = 0;
string name_receive = System.Text.Encoding.ASCII.GetString(packet, 18, packet[17]);
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 clien = (varr.Current as Client.GameState);
if (clien.Entity.Name == name_receive)
lider = clien.Entity.UID;
varr.MoveNext();
}
if (lider == client.Entity.UID) return;
Client.GameState aClient = null;
if (Conquer_Online_Server.ServerBase.Kernel.GamePool.TryGetValue(lider, out aClient))
{
if (Conquer_Online_Server.ServerBase.Kernel.ServerClans.ContainsKey(client.Entity.Myclan.ClanId))
{
if (Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId].Members.ContainsKey(aClient.Entity.UID))
{
Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId].ClanLider = aClient.Entity.Name;
aClient.Entity.ClanRank = 100;
aClient.Entity.Myclan.Members[aClient.Entity.UID].Rank = 100;
if (aClient.Entity.Myclan.Members.ContainsKey(client.Entity.UID))
aClient.Entity.Myclan.Members[client.Entity.UID].Rank = 0;
client.Entity.ClanRank = 0;
Database.Clans.SaveClan(aClient.Entity.Myclan);
Database.Clans.JoinClan(client);
}
}
}
else
{
Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId].ClanLider = name_receive;
client.Entity.ClanRank = 0;
Database.Clans.JoinClan(client);
Database.Clans.SaveClan(client.Entity.Myclan);
Database.Clans.TransferClan(name_receive);
}
}
break;
}
/* case 14://add enemy
{
break;
}*/
case 9://recruit member
{
break;
}
case 23://client exit
{
if (client.Entity.Myclan != null)
{
if (Conquer_Online_Server.ServerBase.Kernel.ServerClans.ContainsKey(client.Entity.Myclan.ClanId))
{
if (Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId].Members.ContainsKey(client.Entity.UID))
{
Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId].Members.Remove(client.Entity.UID);
}
}
client.Entity.ClanId = 0;
client.Entity.ClanName = "";
client.Entity.Myclan = null;
Database.Clans.KickClan(client.Entity.Name);
client.Send(packet);
}
break;
}
case 25://buleitn
{
if (client.Entity.Myclan == null) return;
string buletin = System.Text.Encoding.ASCII.GetString(packet, 18, packet[17]);
if (Conquer_Online_Server.ServerBase.Kernel.ServerClans.ContainsKey(client.Entity.Myclan.ClanId))
Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId].ClanBuletion = buletin;
Database.Clans.SaveClan(Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId]);
client.Send(packet);
break;
}
case 22://give kick
{
if (client.Entity.Myclan != null)
{
if (client.Entity.ClanRank == 100)
{
string name = System.Text.Encoding.ASCII.GetString(packet, 18, packet[17]);
uint Key = 0;
foreach (Game.ClanMembers mem in client.Entity.Myclan.Members.Values)
{
if (mem.Name == name)
Key = mem.UID;
}
if (Key != 0)
{
if (Conquer_Online_Server.ServerBase.Kernel.GamePool.ContainsKey(Key))
{
if (Conquer_Online_Server.ServerBase.Kernel.ServerClans.ContainsKey(client.Entity.Myclan.ClanId))
{
if (Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId].Members.ContainsKey(Key))
{
Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId].Members.Remove(Key);
Network.GamePackets.ClanMembers clan = new Network.GamePackets.ClanMembers(client);
client.Send(clan.ToArray());
Network.GamePackets.Clan cl = new Conquer_Online_Server.Network.GamePackets.Clan(client, 22);
ServerBase.Kernel.GamePool[Key].Send(cl.ToArray());
ServerBase.Kernel.GamePool[Key].Entity.ClanName = "";
ServerBase.Kernel.GamePool[Key].Entity.ClanId = 0;
ServerBase.Kernel.GamePool[Key].Entity.Myclan = null;
ServerBase.Kernel.GamePool[Key].Screen.FullWipe();
ServerBase.Kernel.GamePool[Key].Screen.Reload(null);
}
}
}
}
Database.Clans.KickClan(name);
}
}
break;
}
case 26://donation
{
uint money = BitConverter.ToUInt32(packet, 8);
if (client.Entity.Money >= money && client.Entity.Myclan != null)
{
client.Entity.Myclan.Members[client.Entity.UID].Donation += money;
client.Entity.Money -= money;
if (Conquer_Online_Server.ServerBase.Kernel.ServerClans.ContainsKey(client.Entity.Myclan.ClanId))
Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId].ClanDonation += money;
Network.GamePackets.Clan cl = new Conquer_Online_Server.Network.GamePackets.Clan(client, 1);
client.Send(cl.ToArray());
Database.Clans.SaveClientDonation(client);
Database.Clans.SaveClan(Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId]);
}
break;
}
case 11://add player
{
uint lider = BitConverter.ToUInt32(packet, 8);
if (Conquer_Online_Server.ServerBase.Kernel.GamePool.ContainsKey(lider))
{
packet[4] = 11;
Network.Writer.WriteUInt32(client.Entity.UID, 8, packet);
packet[16] = 1;
packet[17] = (byte)client.Entity.Name.Length;
for (int i = 0; i < client.Entity.Name.Length; i++)
{
try
{
packet[18 + i] = Convert.ToByte(client.Entity.Name[i]);
}
catch { }
}
if (Conquer_Online_Server.ServerBase.Kernel.GamePool[lider].Entity.Myclan != null)
Conquer_Online_Server.ServerBase.Kernel.GamePool[lider].Send(packet);
}
break;
}
case 12:
{
if (packet[16] == 1)
{
if (client.Entity.Myclan != null)
if (client.Entity.Myclan.Members[client.Entity.UID].Rank == 100)
{
//if (client.Entity.Myclan != null)
{
if (client.Entity.Myclan.Members.Count < 7)
{
uint memeber = BitConverter.ToUInt32(packet, 8);
if (ServerBase.Kernel.GamePool.ContainsKey(memeber))
{
Game.ClanMembers member = new Conquer_Online_Server.Game.ClanMembers();
member.UID = ServerBase.Kernel.GamePool[memeber].Entity.UID;
member.Donation = 0;
member.Rank = 10;
member.Class = ServerBase.Kernel.GamePool[memeber].Entity.Class;
member.Level = ServerBase.Kernel.GamePool[memeber].Entity.Level;
member.Name = ServerBase.Kernel.GamePool[memeber].Entity.Name;
if (!client.Entity.Myclan.Members.ContainsKey(memeber))
client.Entity.Myclan.Members.Add(member.UID, member);
ServerBase.Kernel.GamePool[memeber].Entity.ClanRank = 0;
ServerBase.Kernel.GamePool[memeber].Entity.ClanId = client.Entity.ClanId;
ServerBase.Kernel.GamePool[memeber].Entity.Myclan = client.Entity.Myclan;
ServerBase.Kernel.GamePool[memeber].Entity.ClanName = client.Entity.ClanName;
Database.Clans.JoinClan(ServerBase.Kernel.GamePool[memeber]);
ServerBase.Kernel.GamePool[memeber].Screen.FullWipe();
ServerBase.Kernel.GamePool[memeber].Screen.Reload(null);
}
}
}
}
}
break;
}
case 4://memebers
{
ClanMembers clan = new ClanMembers(client);
client.Send(clan.ToArray());
break;
}
case 0x1d:
{
if (client.Entity.Myclan != null)
{
Network.Writer.WriteUInt32(client.Entity.Myclan.ClanId, 8, packet);
Network.Writer.WriteByte(1, 16, packet);
Network.Writer.WriteByte(0x0d, 17, packet);
Network.Writer.WriteString("0 0 0 0 0 0 0", 18, packet);
client.Send(packet);
Network.GamePackets.Clan cl = new Conquer_Online_Server.Network.GamePackets.Clan(client, 1);
client.Send(cl.ToArray());
client.Send(packet);
if (client.Entity.Myclan.ClanBuletion != "")
client.Send(cl.UpgradeBuletin(client.Entity.Myclan.ClanBuletion));
}
else
{
client.Send(packet);
packet[4] = 23;
}
break;
}
case 0x18:
{
client.Send(packet);
break;
}
case (byte)Game.Clan_Typ.AddAlly:
{
Game.Clans clan = client.Entity.Myclan;
if (clan != null)
{
Client.GameState target;
UInt32 Identifier = BitConverter.ToUInt32(packet, 8);
if (client.Entity.ClanRank == 100)
{
if (clan.Allies.Count >= 5)
{ client.Send(new Message("The Ammount of Allies You can Have has exceeded", System.Drawing.Color.Red, Message.TopLeft)); break; }
if (ServerBase.Kernel.GamePool.TryGetValue(Identifier, out target))
{
Game.Clans tclan = target.Entity.Myclan;
if (tclan != null)
{
if (target.Entity.ClanRank == 100)
{
if (tclan.Allies.Count >= 5)
{ client.Send(new Message("The Ammount of Allies the Target Clan can Have has exceeded", System.Drawing.Color.Red, Message.TopLeft)); break; }
if (!clan.Allies.ContainsKey(tclan.ClanId))
{
if (!clan.Enemies.ContainsKey(tclan.ClanId))
{
String clanName = client.Entity.ClanName;
Clan2 clanp = new Clan2();
clanp.Deserialize(packet);
clanp.Offset16 = 2;
clanp.Identifier = client.Entity.UID;
Writer.WriteByte((Byte)clanName.Length, 17, clanp.ToArray());
Writer.WriteString(clanName, 18, clanp.ToArray());
tclan.AllyRequest = clan.ClanId;
target.Send(clanp);
}
else client.Send(new Message("That clan is Your Enemy.", System.Drawing.Color.Red, Message.TopLeft));
}
}
else client.Send(new Message("This target is not the clan leader.", System.Drawing.Color.Red, Message.TopLeft));
}
}
else client.Send(new Message("Can not find target.", System.Drawing.Color.Red, Message.TopLeft));
}
else client.Send(new Message("You are not the clan leader.", System.Drawing.Color.Red, Message.TopLeft));
}
break;
}
case (byte)Game.Clan_Typ.AcceptAlliance:
{
Game.Clans clan = client.Entity.Myclan;
if (clan != null)
{
if (client.Entity.ClanRank == 100)
{
Game.Clans tclan;
if (ServerBase.Kernel.ServerClans.TryGetValue(clan.AllyRequest, out tclan))
{
if (tclan != null)
{
if (!tclan.Enemies.ContainsKey(clan.ClanId))
{
if (!clan.Enemies.ContainsKey(tclan.ClanId))
{
if (!clan.Allies.ContainsKey(tclan.ClanId))
clan.Allies.Add(tclan.ClanId, tclan);
tclan.Allies.Add(clan.ClanId, clan);
clan.SendMessage(new ClanRelations(clan, ClanRelations.RelationTypes.Allies));
tclan.SendMessage(new ClanRelations(tclan, ClanRelations.RelationTypes.Allies));
clan.SendMessage(new Message(String.Format("Our Clan has Allianced with {0}", tclan.ClanName), System.Drawing.Color.Red, Message.Clan));
tclan.SendMessage(new Message(String.Format("Our Clan has Allianced with {0}", clan.ClanName), System.Drawing.Color.Red, Message.Clan));
clan.AddRelation(tclan.ClanId, ClanRelations.RelationTypes.Allies);
tclan.AddRelation(clan.ClanId, ClanRelations.RelationTypes.Allies);
clan.AllyRequest = tclan.AllyRequest = 0;
}
else client.Send(new Message("This Clan is Your Enemy.", System.Drawing.Color.Red, Message.TopLeft));
}
client.Send(new Message("This Clan Has Enemied You!.", System.Drawing.Color.Red, Message.TopLeft));
}
}
else client.Send(new Message("Can not find target", System.Drawing.Color.Red, Message.TopLeft));
}
else client.Send(new Message("You are not the clan leader.", System.Drawing.Color.Red, Message.TopLeft));
}
break;
}
case (byte)Game.Clan_Typ.DeleteEnemy:
{
Game.Clans clan = client.Entity.Myclan;
if (clan != null)
{
if (client.Entity.ClanRank == 100)
{
Clan2 clanp = new Clan2();
clanp.Deserialize(packet);
String EnemyTarget = clanp.Offset18String;
UInt32 ClanId = clanp.GetClanId(EnemyTarget);
Game.Clans tclan;
if (ServerBase.Kernel.ServerClans.TryGetValue(ClanId, out tclan))
{
clan.Enemies.Remove(ClanId);
clan.DeleteRelation(ClanId, ClanRelations.RelationTypes.Enemies);
clan.SendMessage(new ClanRelations(clan, ClanRelations.RelationTypes.Enemies));
clan.SendMessage(new Message(String.Format("We are no longer Enemies With {0}", clan.ClanId), System.Drawing.Color.Red, Message.Clan));
client.Send(clanp);
}
}
else client.Send(new Message("You are not authorized to continue with this action", System.Drawing.Color.Red, Message.TopLeft));
}
break;
}
case (byte)Game.Clan_Typ.DeleteAlly:
{
Game.Clans clan = client.Entity.Myclan;
if (clan != null)
{
if (client.Entity.ClanRank == 100)
{
Clan2 clanp = new Clan2();
clanp.Deserialize(packet);
String AlliedTarget = clanp.Offset18String;
UInt32 ClanId = clanp.GetClanId(AlliedTarget);
Game.Clans tclan;
if (clan.Allies.TryGetValue(ClanId, out tclan))
{
clan.Allies.Remove(ClanId);
tclan.Allies.Remove(clan.ClanId);
clan.DeleteRelation(ClanId, ClanRelations.RelationTypes.Allies);
tclan.DeleteRelation(clan.ClanId, ClanRelations.RelationTypes.Allies);
clan.SendMessage(new ClanRelations(clan, ClanRelations.RelationTypes.Allies));
tclan.SendMessage(new ClanRelations(tclan, ClanRelations.RelationTypes.Allies));
clan.SendMessage(new Message(String.Format("We are no longer allied with {0}", tclan.ClanName), System.Drawing.Color.Red, Message.Clan));
tclan.SendMessage(new Message(String.Format("We are no longer allied with {0}", clan.ClanName), System.Drawing.Color.Red, Message.Clan));
client.Send(clanp);
}
}
else client.Send(new Message("You are not authorized to continue with this action", System.Drawing.Color.Red, Message.TopLeft));
}
break;
}
case (byte)Game.Clan_Typ.AddEnemy:
{
Game.Clans clan = client.Entity.Myclan;
if (clan != null)
{
if (client.Entity.ClanRank == 100)
{
String Enemy = System.Text.Encoding.ASCII.GetString(packet, 18, packet[17]).Trim(new Char[] { '\0' });
UInt32 ClanId = 0;
var AllCland = ServerBase.Kernel.ServerClans.Values.ToArray();
foreach (Game.Clans c_clan in AllCland)
{
if (Enemy == c_clan.ClanName)
{
ClanId = c_clan.ClanId;
break;
}
}
if (ClanId == 0) break;
if (!clan.Enemies.ContainsKey(ClanId))
{
if (!clan.Allies.ContainsKey(ClanId))
{
if (clan.Enemies.Count >= 5)
{ client.Send(new Message("The Ammount of Enemies You can Have has exceeded", System.Drawing.Color.Red, Message.TopLeft)); break; }
Game.Clans tclan;
if (ServerBase.Kernel.ServerClans.TryGetValue(ClanId, out tclan))
{
if (!clan.Enemies.ContainsKey(tclan.ClanId))
clan.Enemies.Add(tclan.ClanId, tclan);
clan.AddRelation(ClanId, ClanRelations.RelationTypes.Enemies);
clan.SendMessage(new ClanRelations(clan, ClanRelations.RelationTypes.Enemies));
clan.SendMessage(new Message(String.Format("We Have Enemied the clan {0}", tclan.ClanName), System.Drawing.Color.Red, Message.Clan));
tclan.SendMessage(new Message(String.Format("The Clan {0} Has Made us their Enemy!", clan.ClanName), System.Drawing.Color.Red, Message.Clan));
}
}
else client.Send(new Message("This clan is one of your alliance, What has gone wrong?", System.Drawing.Color.Red, Message.TopLeft));
}
else client.Send(new Message("This clan is Already One of Your Enemies", System.Drawing.Color.Red, Message.TopLeft));
}
}
break;
}
default:
Console.WriteLine("Clan Type " + packet[4]);
break;
}
break;
/* switch (packet[4])
{
case 23://client exit
{
if (client.Entity.Myclan != null)
{
foreach (var clien in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
{
if (clien.Entity.Myclan != null)
{
if (clien.Entity.Myclan.ClanId == client.Entity.Myclan.ClanId)
{
if (clien.Entity.Myclan.Members.ContainsKey(client.Entity.UID))
clien.Entity.Myclan.Members.Remove(client.Entity.UID);
}
}
}
client.Entity.ClanName = "";
client.Entity.Myclan = null;
Database.Clans.KickClan(client.Entity.Name);
client.Send(packet);
}
break;
}
case 14://enemy
{
string Enemy = System.Text.Encoding.ASCII.GetString(packet, 18, packet[17]);
client.Send(packet);
Network.GamePackets.Clan cl = new Conquer_Online_Server.Network.GamePackets.Clan(client, 14);
client.Send(cl.SendAlies(Enemy, "Lider"));
break;
}
case 25://buleitn
{
if (client.Entity.Myclan == null) return;
string buletin = System.Text.Encoding.ASCII.GetString(packet, 18, packet[17]);
foreach (var clan in Conquer_Online_Server.ServerBase.Kernel.ServerClans.Values)
{
if (clan.ClanId == client.Entity.Myclan.ClanId)
clan.ClanBuletion = buletin;
}
foreach (var member in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
{
if (member.Entity.Myclan != null)
{
if (member.Entity.UID != client.Entity.UID)
if (member.Entity.Myclan.ClanId == client.Entity.Myclan.ClanId)
{
member.Entity.Myclan.ClanBuletion = buletin;
}
}
}
Database.Clans.SaveClan(Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId]);
client.Send(packet);
client.Entity.Myclan.ClanBuletion = buletin;
break;
}
case 22://give kick
{
if (client.Entity.Myclan != null)
{
if (client.Entity.ClanRank == 100)
{
string name = System.Text.Encoding.ASCII.GetString(packet, 18, packet[17]);
uint Key = 0;
foreach (Game.ClanMembers mem in client.Entity.Myclan.Members.Values)
{
if (mem.Name == name)
Key = mem.UID;
}
if (Key != 0)
{
if (Conquer_Online_Server.ServerBase.Kernel.GamePool.ContainsKey(Key))
{
foreach (var clien in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
{
if (clien.Entity.UID == client.Entity.UID) continue;
if (clien.Entity.Myclan != null)
{
if (clien.Entity.Myclan.ClanId == client.Entity.Myclan.ClanId)
{
if (clien.Entity.Myclan.Members.ContainsKey(Key))
{
clien.Entity.Myclan.Members.Remove(Key);
Network.GamePackets.ClanMembers clan = new Network.GamePackets.ClanMembers(client);
client.Send(clan.ToArray());
clien.Entity.ClanName = "";
clien.Entity.Myclan = null;
}
}
}
}
}
}
Database.Clans.KickClan(name);
}
}
break;
}
case 26:
{
uint money = BitConverter.ToUInt32(packet, 8);
if (client.Entity.Money >= money && client.Entity.Myclan != null)
{
client.Entity.Myclan.Members[client.Entity.UID].Donation += money;
client.Entity.Money -= money;
Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId].ClanDonation += money;
foreach (var clien in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
{
if (clien.Entity.Myclan != null)
{
if (clien.Entity.UID != client.Entity.UID)
{
if (clien.Entity.Myclan.ClanId == client.Entity.Myclan.ClanId)
{
clien.Entity.Myclan.ClanDonation = Conquer_Online_Server.ServerBase.Kernel.ServerClans[clien.Entity.Myclan.ClanId].ClanDonation;
}
}
}
}
client.Entity.Myclan.ClanDonation = Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId].ClanDonation;
Network.GamePackets.Clan cl = new Conquer_Online_Server.Network.GamePackets.Clan(client, 1);
client.Send(cl.ToArray());
Database.Clans.SaveClientDonation(client);
Database.Clans.SaveClan(Conquer_Online_Server.ServerBase.Kernel.ServerClans[client.Entity.Myclan.ClanId]);
}
break;
}
case 11://add player
{
uint lider = BitConverter.ToUInt32(packet, 8);
if (Conquer_Online_Server.ServerBase.Kernel.GamePool.ContainsKey(lider))
{
packet[4] = 11;
Network.Writer.WriteUInt32(client.Entity.UID, 8, packet);
packet[16] = 1;
packet[17] = (byte)client.Entity.Name.Length;
for (int i = 0; i < client.Entity.Name.Length; i++)
{
try
{
packet[18 + i] = Convert.ToByte(client.Entity.Name[i]);
}
catch { }
}
Conquer_Online_Server.ServerBase.Kernel.GamePool[lider].Send(packet);
}
break;
}
case 12:
{
if (packet[16] == 1)
{
if (client.Entity.Myclan.Members[client.Entity.UID].Rank == 100)
{
if (client.Entity.Myclan != null)
{
if (client.Entity.Myclan.Members.Count < 7)
{
uint memeber = BitConverter.ToUInt32(packet, 8);
if (ServerBase.Kernel.GamePool.ContainsKey(memeber))
{
Game.ClanMembers member = new Conquer_Online_Server.Game.ClanMembers();
member.UID = ServerBase.Kernel.GamePool[memeber].Entity.UID;
member.Donation = 0;
member.Rank = 10;
member.Class = ServerBase.Kernel.GamePool[memeber].Entity.Class;
member.Level = ServerBase.Kernel.GamePool[memeber].Entity.Level;
member.Name = ServerBase.Kernel.GamePool[memeber].Entity.Name;
if (!client.Entity.Myclan.Members.ContainsKey(memeber))
client.Entity.Myclan.Members.Add(member.UID, member);
foreach (var clien in Conquer_Online_Server.ServerBase.Kernel.GamePool.Values)
{
if (clien.Entity.Myclan != null)
{
if (clien.Entity.Myclan.ClanId == client.Entity.Myclan.ClanId)
{
if (!clien.Entity.Myclan.Members.ContainsKey(memeber))
clien.Entity.Myclan.Members.Add(member.UID, member);
}
}
}
ServerBase.Kernel.GamePool[memeber].Entity.ClanRank = 0;
ServerBase.Kernel.GamePool[memeber].Entity.Myclan = client.Entity.Myclan;
ServerBase.Kernel.GamePool[memeber].Entity.ClanName = client.Entity.ClanName;
Database.Clans.JoinClan(ServerBase.Kernel.GamePool[memeber]);
ServerBase.Kernel.GamePool[memeber].Entity.Teleport(ServerBase.Kernel.GamePool[memeber].Entity.MapID
, ServerBase.Kernel.GamePool[memeber].Entity.X
, ServerBase.Kernel.GamePool[memeber].Entity.Y);
}
}
}
}
}
break;
}
case 4://memebers
{
ClanMembers clan = new ClanMembers(client);
client.Send(clan.ToArray());
break;
}
case 0x1d:
{
if (client.Entity.Myclan != null)
{
Network.Writer.WriteUInt32(client.Entity.Myclan.ClanId, 8, packet);
Network.Writer.WriteByte(1, 16, packet);
Network.Writer.WriteByte(0x0d, 17, packet);
Network.Writer.WriteString("0 0 0 0 0 0 0", 18, packet);
client.Send(packet);
Network.GamePackets.Clan cl = new Conquer_Online_Server.Network.GamePackets.Clan(client, 1);
client.Send(cl.ToArray());
client.Send(packet);
if (client.Entity.Myclan.ClanBuletion != "")
client.Send(cl.UpgradeBuletin(client.Entity.Myclan.ClanBuletion));
}
else
{
client.Send(packet);
packet[4] = 23;
}
break;
}
case 0x18:
{
client.Send(packet);
break;
}
default:
Console.WriteLine("Clan Type " + packet[4]);
break;
}
break;*/
}
#endregion
#region Clan
case 9873:
{
switch (npcRequest.OptionID)
{
case 0:
{
if (client.Entity.Myclan == null)
{
dialog.Text("Hellow! You wana create clan?If you need 500.000 Silvers");
dialog.Option("Yes, i wana", 1);
dialog.Option("No ty", 255);
dialog.Avatar(40);
dialog.Send();
}
else
{
dialog.Text("Hellow! You upgrade level at clan?");
dialog.Option("Upgrade level", 2);
dialog.Option("Delete my clan", 10);
dialog.Option("No ty", 255);
dialog.Avatar(40);
dialog.Send();
}
break;
}
case 12:
{
if (Conquer_Online_Server.ServerBase.Kernel.ServerClans.ContainsKey(client.Entity.Myclan.ClanId))
Conquer_Online_Server.ServerBase.Kernel.ServerClans.Remove(client.Entity.Myclan.ClanId);
Database.Clans.DeleteClan(client.Entity.Myclan.ClanId);
var varr = ServerBase.Kernel.GamePool.Values.GetEnumerator();
varr.MoveNext();
int COunt = ServerBase.Kernel.GamePool.Count;
for (uint c = 0;
c < COunt;
c++)
{
if (c >= COunt) break;
Client.GameState clien = (varr.Current as Client.GameState);
if (clien.Entity.Myclan != null)
{
if (client.Entity.UID != clien.Entity.UID)
{
if (clien.Entity.Myclan.ClanId == client.Entity.Myclan.ClanId)
{
Network.GamePackets.Clan cl = new Conquer_Online_Server.Network.GamePackets.Clan(clien, 22);
clien.Send(cl.ToArray());
clien.Entity.ClanId = 0;
clien.Entity.ClanRank = 0;
clien.Entity.Myclan = null;
clien.Entity.ClanName = null;
Database.Clans.KickClan(clien.Entity.Name);
}
}
}
varr.MoveNext();
}
Network.GamePackets.Clan acl = new Conquer_Online_Server.Network.GamePackets.Clan(client, 22);
client.Send(acl.ToArray());
client.Entity.Myclan = null;
client.Entity.ClanRank = 0;
client.Entity.ClanId = 0;
client.Entity.ClanName = null;
Database.Clans.KickClan(client.Entity.Name);
client.Entity.Myclan = null;
break;
}
case 10:
{
dialog.Text("You sure? You wana delete?");
dialog.Option("Yes i wana", 12);
dialog.Option("No ty", 255);
dialog.Avatar(40);
dialog.Send();
break;
}
case 2:
{
if (client.Entity.Myclan.ClanLevel < 4)
{
dialog.Text("You need " + Game.Clans.MoneyClanLevel[client.Entity.Myclan.ClanLevel] + " Silvers to upgrade ClandLevel! You are sure?");
dialog.Option("Yes upgrad.", 4);
dialog.Option("No thanks.", 255);
dialog.Avatar(88);
dialog.Send();
}
else
{
dialog.Text("Sorry, you clan name is level max");
dialog.Option("Ah, ok", 255);
dialog.Avatar(88);
dialog.Send();
}
break;
}
case 4:
{
if (client.Entity.Money >= Game.Clans.MoneyClanLevel[client.Entity.Myclan.ClanLevel])
{
client.Entity.Money -= Game.Clans.MoneyClanLevel[client.Entity.Myclan.ClanLevel];
var varr = ServerBase.Kernel.GamePool.Values.GetEnumerator();
varr.MoveNext();
int COunt = ServerBase.Kernel.GamePool.Count;
for (uint c = 0;
c < COunt;
c++)
{
if (c >= COunt) break;
Client.GameState clien = (varr.Current as Client.GameState);
if (clien.Entity.Myclan != null)
{
if (clien.Entity.UID != client.Entity.UID)
{
if (clien.Entity.Myclan.ClanId == client.Entity.Myclan.ClanId)
{
clien.Entity.Myclan.ClanId += 1;
}
}
}
varr.MoveNext();
}
dialog.Text("Done");
dialog.Send();
client.Entity.Myclan.ClanLevel += 1;
Database.Clans.SaveClan(client.Entity.Myclan);
Network.GamePackets.Clan cl = new Conquer_Online_Server.Network.GamePackets.Clan(client, 1);
client.Send(cl.ToArray());
}
else
{
dialog.Text("Sorry, you need " + Game.Clans.MoneyClanLevel[client.Entity.Myclan.ClanLevel] + " Silvers");
dialog.Option("Ah, Ok", 255);
dialog.Avatar(40);
dialog.Send();
}
break;
}
case 1:
{
dialog.Text("Say me, what name you wana?");
dialog.Input("Clan Name", 3, 14);
dialog.Option("Let me think it over.", 255);
dialog.Avatar(88);
dialog.Send();
break;
}
case 3:
{
string name = npcRequest.Input;
foreach (KeyValuePair<uint, Game.Clans> cl in Conquer_Online_Server.ServerBase.Kernel.ServerClans)
{
if (cl.Value.ClanName == name)
{
dialog.Text("Sorry, but this clan exist! change name");
dialog.Option("Ah, Ok", 255);
dialog.Avatar(88);
dialog.Send();
return;
}
}
if (client.Entity.Money >= 500000)
{
client.Entity.Money -= 500000;
Game.Clans clan = new Conquer_Online_Server.Game.Clans();
clan.ClanName = name;
clan.ClanDonation = 500000;
clan.ClanLider = client.Entity.Name;
Game.ClanMembers member = new Conquer_Online_Server.Game.ClanMembers();
member.Name = client.Entity.Name;
member.UID = client.Entity.UID;
member.Donation = 500000;
member.Class = client.Entity.Class;
member.Rank = 100;
member.Level = client.Entity.Level;
if (!clan.Members.ContainsKey(member.UID))
clan.Members.Add(member.UID, member);
client.Entity.Myclan = clan;
Database.Clans.CreateClan(client);
dialog.Text("Done");
dialog.Send();
}
else
{
dialog.Text("Sorry, but need 500.000 Silver");
dialog.Option("Ah, Ok", 255);
dialog.Avatar(88);
dialog.Send();
}
break;
}
}
break;
}
#endregion
INSERT INTO `npcs` VALUES ('9873', '0', '0', '', '0002', '9450', '-1', '1002', '0409', '0388', '0000', '0000', '0000', '0000', '0000', '0000', '0000', '0000', '0', '0', '0', '0', 'ط·آ·ط¢آ·ط·آ¢ط¢آ', '0000', '00', '00', '0000', '00', null);
[]d] lk hpl] vtuj hf,hgodv ;ghk lhk[v s,vs 5530 hpgn ;lhk
الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
أدوات الموضوع | |
انواع عرض الموضوع | |
|
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
سورس MR.Omany.v1 الاصدار الاول بالقرصان كامل 5530 والكمال لله وحده | Shicoo | تطوير وشروحات وسورسات [5095] - Conquer Private Servers | 36 | 03-26-2024 01:10 PM |
حصريا سورس DARK.Co 5530 الحق حمل فرصه متتعودش | Shicoo | مواضيع قديمة | 60 | 03-13-2024 11:10 PM |
انترنت داونلود مانجر | حمدي سعيد | الإعلانات وعروض المواقع التجارية والاعلانية - WEB ADS | 0 | 06-07-2020 12:00 AM |
لوجو لكل سيرفر 5095,5530,جديد,متجددباستمرار بتريح اليوم | Shicoo | تطوير وشروحات وسورسات [5095] - Conquer Private Servers | 8 | 10-15-2017 04:09 PM |
سورس الإبداع |5095 | Scorpion-Co |New Quests | فكسد 100% تروجن جديد وننيجا جديد | amrsheko | قسم إعلانات السيرفرات الشخصية | 1 | 06-24-2015 07:05 PM |