|
المشاركات 454 |
+التقييم 0.23 |
تاريخ التسجيل Jun 2019 |
الاقامة |
نظام التشغيل |
رقم العضوية 271 |
private void AutoAttackCallback(GameState client, int time)
}
private void AutoAttackCallback(GameState client, int time)
{
if (!Valid(client)) return;
Time32 Now = new Time32(time);
if (client.Entity.AttackPacket != null || client.Entity.VortexAttackStamp != null)
{
try
{
if (client.Entity.ContainsFlag((ulong)Update.Flags.ShurikenVortex))
{
if (client.Entity.VortexPacket != null && client.Entity.VortexPacket.ToArray() != null)
{
if (Now > client.Entity.VortexAttackStamp.AddMilliseconds(1400))
{
client.Entity.VortexAttackStamp = Now;
new Game.Attacking.Handle(client.Entity.VortexPacket, client.Entity, null);
}
}
}
else
{
client.Entity.VortexPacket = null;
var AttackPacket = client.Entity.AttackPacket;
if (AttackPacket != null && AttackPacket.ToArray() != null)
{
uint AttackType = AttackPacket.AttackType;
if (AttackType == Attack.Magic || AttackType == Attack.Melee || AttackType == Attack.Ranged)
{
if (AttackType == Attack.Magic)
{
if (Now > client.Entity.AttackStamp.AddSeconds(1))
{
if (AttackPacket.Damage != 12160 &&
AttackPacket.Damage != 12170 &&
AttackPacket.Damage != 12120 &&
AttackPacket.Damage != 12130 &&
AttackPacket.Damage != 12140 &&
AttackPacket.Damage != 12320 &&
AttackPacket.Damage != 12330 &&
AttackPacket.Damage != 12340 &&
AttackPacket.Damage != 12210)
new Game.Attacking.Handle(AttackPacket, client.Entity, null);
}
}
else
{
int decrease = -300;
if (client.Entity.OnCyclone())
decrease = 700;
if (client.Entity.OnSuperman())
decrease = 200;
if (Now > client.Entity.AttackStamp.AddMilliseconds((300 - client.Entity.Agility - decrease) * (int)(AttackType == Attack.Ranged ? 1 : 1)))
{
new Game.Attacking.Handle(AttackPacket, client.Entity, null);
}
}
}
}
}
}
catch (Exception e)
{
Program.SaveException(e);
client.Entity.AttackPacket = null;
client.Entity.VortexPacket = null;
}
}
}
case "bantime":
{
foreach (var Client in Program.Values)
{
if (Client.Account.State >= client.Account.State)
continue;
if (Client.Player.LoweredName.Contains(Data[1]))
{
Client.Account.State = Database.AccountTable.AccountState.Banned;
Client.Account.SaveState();
Client.Account.CopraState(Database.AccountTable.AccountState.Banned);
Client["banhours"] = Data[2].Cast<int>();
Client["banreason"] = message_.Substring(Data[0].Length + 1 + Data[1].Length + 1 + Data[2].Length + 1);
Client["banstamp"] = DateTime.Now;
Client.Disconnect();break;
}
}
break;
}
client.Variables = variables;
if (client["banhours"] == 0)
{
client["banhours"] = -1;
client["banreason"] = "Infinite time.";
client["banstamp"] = DateTime.Now.AddYears(100);
}
if (Account.State == Database.AccountTable.AccountState.Banned)
{
if (client["banhours"] != -1)
{
DateTime banStamp = client["banstamp"];
if (DateTime.Now > banStamp.AddDays(((int)client["banhours"]) / 24).AddHours(((int)client["banhours"]) % 24))
Account.State = Database.AccountTable.AccountState.Entity;
}
}
string Message = "";
if (Protection.SystemBannedAccount.IsBanned(client.Account.EntityID, out Message))
{
}
else if (Account.State == Database.AccountTable.AccountState.Banned)
{
DateTime banStamp = client["banstamp"];
banStamp = banStamp.AddHours(client["banhours"]);
Message = "You are banned for " + client["banhours"] + " hours [until " + banStamp.ToString("HH:mm MM/dd/yyyy") + "]. Reason: " + client["banreason"];
}
#region Jiang Npc
case 88854:
{
switch (npcRequest.OptionID)
{
case 0:
{
if (client.Player.MyJiang == null)
{
dialog.Text("Sorry But You Don't Have Jiang Yet.");
dialog.Option("I'll think about it!", 255);
dialog.Send();
return;
}
dialog.Text("Hello Messi Jiang Seller.");
for (int i = 0; i < client.Player.MyJiang.Stagers.Length; i++)
{
var stage = client.Player.MyJiang.Stagers[i];
if (stage.Activate)
dialog.Option("Stage [" + (byte)(i + 1) + "]", (byte)(i + 1));
}
dialog.Option("I'll think about it!", 255);
dialog.Send();
break;
}
default:
{
int mStage = npcRequest.OptionID;
if (mStage >= 1 && mStage <= 9)
{
foreach (var item in Database.JiangHu.CultivateStatus[(byte)mStage])
{
dialog.Option(((Game.JiangHu.JiangStages.AtributesType)item).ToString(), (byte)((item * 10) + mStage));
}
}
else
{
if (client.Player.ConquerPoints < 10)
{
dialog.Text("Sorry But You Don't Have 1 cps ");
dialog.Option("I'll think about it!", 255);
dialog.Send();
return;
}
client.Player.ConquerPoints -= 10;
client.Player.Teleport(1002, 300, 278);
var typex = mStage / 10;
mStage = mStage % 10;
byte stageno = (byte)Math.Min(9, mStage);
byte level = 6;
var type = (Game.JiangHu.JiangStages.AtributesType)Math.Min(15, typex);
if (client.Player.MyJiang.Stagers.Length >= stageno)
{
var stage = client.Player.MyJiang.Stagers[(stageno - 1)];
for (byte i = 1; i < stage.Stars.Length + 1; i++)
{
client.Player.MyJiang.MyNewStart = new Game.JiangHu.GetNewStar();
client.Player.MyJiang.MyNewStart.PositionStar = i;
client.Player.MyJiang.MyNewStart.Stage = stageno;
client.Player.MyJiang.MyNewStart.Star = new Game.JiangHu.JiangStages.Star();
client.Player.MyJiang.MyNewStart.Star.Activate = true;
client.Player.MyJiang.MyNewStart.Star.Level = level;
client.Player.MyJiang.MyNewStart.Star.Typ = type;
client.Player.MyJiang.MyNewStart.Star.UID = client.Player.MyJiang.ValueToRoll(client.Player.MyJiang.MyNewStart.Star.Typ, client.Player.MyJiang.MyNewStart.Star.Level);
Network.GamePackets.JiangHuUpdate upd = new Network.GamePackets.JiangHuUpdate();
upd.Atribute = client.Player.MyJiang.MyNewStart.Star.UID;
upd.FreeCourse = client.Player.MyJiang.FreeCourse;
upd.Stage = stageno;
upd.Star = i;
upd.FreeTimeTodeyUsed = (byte)client.Player.MyJiang.FreeTimeTodeyUsed;
upd.RoundBuyPoints = client.Player.MyJiang.RoundBuyPoints;
client.Send(upd.ToArray());
client.Player.MyJiang.ApplayNewStar(client);
}
if (client.Player.MyJiang != null)
client.Player.MyJiang.SendStatus(client, client);
}
}
break;
}
}
break;
}
#endregion
ان بي سي التشي
#region Chi Npc
case 4444:
{
switch (npcRequest.OptionID)
{
case 0:
{
if (client.ChiPowers.Count == 0)
{
dialog.Text("Sorry But You Don't Have chi Yet.");
dialog.Option("I'll think about it!", 255);
dialog.Send();
return;
}
dialog.Text("Hello I'M Mr.online Chi Seller.");
for (int i = 0; i < client.ChiPowers.Count; i++)
{
var stage = client.ChiPowers[i];
dialog.Option(((Game.Enums.ChiPowerType)(i + 1)).ToString(), (byte)(i + 1));
}
dialog.Option("I'll think about it!", 255);
dialog.Send();
break;
}
default:
{
int mStage = npcRequest.OptionID;
if (mStage >= 1 && mStage <= 4)
{
client.Player.SelectedStage = mStage;
dialog.Text("You Choose " + ((Game.Enums.ChiPowerType)mStage).ToString() + " stage. please select Attribute you want to change ");
for (int i = 0; i < 4; i++)
{
dialog.Option("Attribute [" + (byte)(i + 1) + "]", (byte)(i + 1 + 4));
}
dialog.Option("Back", 0);
dialog.Option("I'll think about it!", 255);
dialog.Send();
break;
}
else if (mStage >= 4 && mStage <= 8)
{
client.Player.SelectedAttribute = mStage - 4;
var mychiattribute = new List<Enums.ChiAttribute>();
var powers = client.ChiPowers[(int)client.Player.SelectedStage - 1];
for (int i = 0; i < powers.Attributes.Length; i++)
{
var Attribute = powers.Attributes[i];
mychiattribute.Add(Attribute.Type);
}
dialog.Text("You Choose Attribute [" + client.Player.SelectedAttribute + "] please select AttributeType you want to change ");
for (int i = 0; i < (int)Enums.ChiAttribute.MagicDamageDecrease; i++)
{
var type = ((Enums.ChiAttribute)(i + 1));
if (!mychiattribute.Contains(type))
dialog.Option(type.ToString(), (byte)(((i + 1) * 10)));
}
dialog.Option("Back", (byte)client.Player.SelectedStage);
dialog.Option("I'll think about it!", 255);
dialog.Send();
break;
}
else
{
if (client.Player.ConquerPoints <= 1)
{
dialog.Text("Sorry But You Don't Have 1 cps ");
dialog.Option("I'll think about it!", 255);
dialog.Send();
return;
}
var typex = mStage / 10;
var Mode = client.Player.SelectedStage;
var pos = client.Player.SelectedAttribute - 1;
var powers = client.ChiPowers[Mode - 1];
var attributes = powers.Attributes;
foreach (var attr in attributes)
{
if (attr == null) continue;
if (attr.Type == (Enums.ChiAttribute)typex)
{
client.MessageBox("Sorry you can't muliplay stats", null, null);
return;
}
}
attributes[pos].Type = (Enums.ChiAttribute)typex;
attributes[pos].Value = (ushort)Game.Enums.ChiMaxValues(attributes[pos].Type);
powers.CalculatePoints();
Database.ChiTable.Sort((Enums.ChiPowerType)Mode);
powers.Power = (Enums.ChiPowerType)Mode;
client.Player.ConquerPoints -= 1;
client.Player.Teleport(1002, 300, 278);
client.Send(new ChiPowers(true).Query(client));
#region update ranking
Database.ChiTable.ChiData[] array = null;
switch ((Enums.ChiPowerType)Mode)
{
case Game.Enums.ChiPowerType.Dragon:
array = Database.ChiTable.Dragon;
break;
case Game.Enums.ChiPowerType.Phoenix:
array = Database.ChiTable.Phoenix;
break;
case Game.Enums.ChiPowerType.Tiger:
array = Database.ChiTable.Tiger;
break;
case Game.Enums.ChiPowerType.Turtle:
array = Database.ChiTable.Turtle;
break;
}
foreach (var chiData in array)
{
if (Kernel.GamePool.ContainsKey(chiData.UID))
{
var pClient = Kernel.GamePool[chiData.UID];
if (pClient == null) continue;
if (pClient.ChiData == null) continue;
// make it public instead of private
PacketHandler.SendRankingQuery(new GenericRanking(true) { Mode = GenericRanking.QueryCount }, pClient, GenericRanking.Chi + (uint)Mode, pClient.ChiData.SelectRank((Enums.ChiPowerType)Mode), pClient.ChiData.SelectPoints((Enums.ChiPowerType)Mode));
if (pClient.Player.UID == client.Player.UID || pClient.ChiData.SelectRank((Enums.ChiPowerType)Mode) < 50)
pClient.LoadItemStats();
}
}
#endregion
Database.ChiTable.Save(client);
}
break;
}
}
break;
}
#endregion
الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
|
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
التيم الاسكل الاليت الي عندو مشاكل فيهم يخوش هنااا | ElSaher | تطوير سيرفرات كونكر | 15 | 2023-06-29 09:19 PM |
ازاي تخلي الوحوش تمها يظهر خوش هنااا | ElSaher | تطوير سيرفرات كونكر | 0 | 2020-04-03 07:44 AM |
اغلاق موقت لقسم المشكلات | محمد ياسر | قسم الاقتراحات والابداع | 2 | 2020-02-26 08:32 AM |
ا انا مسحت localhost من القدعة مش كان اصضي ارجعها ازاي تاني | ElSaher | مشكلات السيرفيرات كونكر الشخصيه | 3 | 2019-08-25 03:21 PM |
عاوز اخلي التشي والجينج اخرهم سوبر هنااا | uncelsam | مشكلات السيرفيرات كونكر الشخصيه | 5 | 2019-07-05 12:56 AM |