|
المشاركات 1,993 |
+التقييم 1.00 |
تاريخ التسجيل Jun 2019 |
الاقامة |
نظام التشغيل ويندوز 0 |
رقم العضوية 279 |
public class Reincarnate
public class Reincarnate
{
private Client.GameState _client ;
public static void Reincarnation(Client.GameState client, byte new_class)
{
if (client.Entity.Level < 120)
return;
if (Kernel.ReincarnatedCharacters.ContainsKey(client.Entity.UID)) return;
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;
Kernel.ReincarnatedCharacters.Add(info.UID, info);
Database.MagicTypeOP.Reborn(client, new_class);
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 = 140;
client.Entity.Experience = 0;
client. Entity.Agility = 0;
client.Entity.Strength = 0;
client.Entity.Vitality = 0;
client.Entity.Spirit = 0;
client.Entity.Atributes = 900;
#region Low level items
for (byte i = 1; i < 9; i++)
{
if (i != 7)
{
ConquerItem item = client.Equipment.TryGetItem(i);
if (item != null && item.ID != 0)
{
try
{
Database.ConquerItemInformation cii =
new Database.ConquerItemInformation(item.ID, item.Plus);
item.ID =
cii.LowestID(
ItemMinLevel(ItemPosition(item.ID)));
item.Mode = Game.Enums.ItemMode.Update;
item.Send(client);
client.LoadItemStats();
Database.ConquerItemTable.UpdateItemID(item, client);
}
catch
{
}
}
}
}
ConquerItem hand = client.Equipment.TryGetItem(5);
if (hand != null)
{
client.Equipment.Remove(5);
client.CalculateStatBonus();
client.CalculateHPBonus();
}
hand = client.Equipment.TryGetItem(25);
if (hand != null)
{
client.Equipment.Remove(25);
client.CalculateStatBonus();
client.CalculateHPBonus();
}
client.LoadItemStats();
client.SendScreen(client.Entity.SpawnPacket, false);
#endregion
Database.DataHolder.GetStats(client.Entity.Class, client.Entity.Level, client);
client.CalculateStatBonus();
client.CalculateHPBonus();
client.GemAlgorithm();
client.SendStatMessage();
foreach (var Entity in Kernel.GamePool.Values)
Entity.Send(new Message(client.Entity.Name + " has been Reincarnation!", System.Drawing.Color.White, Message.Talk));
Database.EntityTable.SaveEntity(client);
#region ProdectSkills
if (client.Entity.SecondRebornClass == 25 && !client.Spells.ContainsKey(3060))
{
client.AddSpell(new Spell(true) { ID = 3060 });
}
if (client.Spells.ContainsKey(12300) && !client.Entity.PureLeeLong())
{
client.RemoveSpell(new Spell(true) { ID = 12300 });
}
if (client.Spells.ContainsKey(12200) && !client.Entity.x2LeeLong())
{
client.RemoveSpell(new Spell(true) { ID = 12200 });
}
if (client.Spells.ContainsKey(11040) && !client.Entity.PurePirate())
{
client.RemoveSpell(new Spell(true) { ID = 11040 });
}
#endregion
}
}
if (!pass && attack.AttackType != Attack.Magic)
{
int milliSeconds = 1000 - attacker.Agility - decrease;
if (milliSeconds < 0 || milliSeconds > 5000)
milliSeconds = 0;
if (!pass && attack.AttackType != Attack.Magic)
{
int milliSeconds = 1000 - attacker.Agility - decrease;
if (milliSeconds < 0 || milliSeconds > 5000)
milliSeconds = 0;
if (Time32.Now < attacker.AttackStamp.AddMilliseconds(milliSeconds))
return;
attacker.AttackStamp = Time32.Now;
}
if (!pass && attack.AttackType == Attack.Magic)
if (!pass && attack.AttackType == Attack.Magic)
{
if (!(doWep1Spell || doWep2Spell))
{
if (SpellID == 11960 || SpellID == 1045 || SpellID == 1046 || SpellID == 11005 || SpellID == 11000 || SpellID == 1100) // FB and SS
{
//do checks
}
else
{
int milliSeconds = 1000 - attacker.Agility - decrease;
if (milliSeconds < 0 || milliSeconds > 5000)
milliSeconds = 0;
if (Time32.Now < attacker.AttackStamp.AddMilliseconds(milliSeconds))
return;
}
attacker.AttackStamp = Time32.Now;
}
}
if (!pass && attack.AttackType == Attack.Magic)
{
if (!(doWep1Spell || doWep2Spell))
{
if (SpellID == 11960 || SpellID == 1045 || SpellID == 1046 || SpellID == 11005 || SpellID == 11000 || SpellID == 1100) // FB and SS
{
//do checks
}
attacker.AttackStamp = Time32.Now;
}
}