|
public void Die(UInt32 killer)
{
_String str = new _String(true);
if (str.Texts.Contains("ghost")) return;
str.UID = this.UID;
str.TextsCount = 1;
str.Type = _String.Effect;
str.Texts.Add("ghost");
Owner.SendScreen(str, true);
if (MyClones.Count > 0)
{
foreach (var item in MyClones.Values)
{
Data data = new Data(true);
data.UID = item.UID;
data.ID = Network.GamePackets.Data.RemoveEntity;
item.MonsterInfo.SendScreen(data);
}
MyClones.Clear();
}
this.RemoveFlag2(18014398509481984uL);
if (EntityFlag == EntityFlag.Entity)
{
Owner.XPCount = 0;
if (OnDeath != null) OnDeath(this);
if (Owner.Booth != null)
{
Owner.Booth.Remove();
Owner.Booth = null;
}
}
Killed = true;
Hitpoints = 0;
DeathStamp = Time32.Now;
ToxicFogLeft = 0;
if (Companion)
{
AddFlag(Network.GamePackets.Update.Flags.Ghost | Network.GamePackets.Update.Flags.Dead | Network.GamePackets.Update.Flags.FadeAway);
Network.GamePackets.Attack attack = new Network.GamePackets.Attack(true);
attack.Attacked = UID;
attack.AttackType = Network.GamePackets.Attack.Kill;
attack.X = X;
attack.Y = Y;
MonsterInfo.SendScreen(attack);
Owner.Map.RemoveEntity(this);
Owner.Pet.RemovePet(pettype);
}
if (EntityFlag == EntityFlag.Entity)
{
if (Constants.PKFreeMaps.Contains(MapID))
goto Over;
Over:
AddFlag(Network.GamePackets.Update.Flags.Ghost);
AddFlag((ulong)Network.GamePackets.Update.Flags.Dead);
RemoveFlag((ulong)Network.GamePackets.Update.Flags.Fly);
RemoveFlag((ulong)Network.GamePackets.Update.Flags.Ride);
RemoveFlag((ulong)Network.GamePackets.Update.Flags.Cyclone);
RemoveFlag((ulong)Network.GamePackets.Update.Flags.Superman);
RemoveFlag((ulong)Network.GamePackets.Update.Flags.FatalStrike);
RemoveFlag((ulong)Network.GamePackets.Update.Flags.FlashingName);
RemoveFlag((ulong)Network.GamePackets.Update.Flags.ShurikenVortex);
RemoveFlag((ulong)Network.GamePackets.Update.Flags.CastPray);
RemoveFlag((ulong)Network.GamePackets.Update.Flags.Praying);
RemoveFlag2((ulong)Network.GamePackets.Update.Flags2.Oblivion);
RemoveFlag3((ulong)Network.GamePackets.Update.Flags3.SuperCyclone);
RemoveFlag3((ulong)Network.GamePackets.Update.Flags3.DragonCyclone);
RemoveFlag2((ulong)Network.GamePackets.Update.Flags2.AzureShield);
//RemoveFlag((ulong)Network.GamePackets.Update.Flags.GodlyShield);
RemoveFlag2((ulong)Network.GamePackets.Update.Flags2.CarryingFlag);
Attack attack = new Attack(true);
attack.AttackType = Network.GamePackets.Attack.Kill;
attack.X = X;
attack.Y = Y;
attack.Attacked = UID;
attack.Attacker = killer;
attack.Damage = 0;
Owner.SendScreen(attack, true);
if (Body % 10 < 3)
TransformationID = 99;
else
TransformationID = 98;
Owner.Send(new MapStatus() { BaseID = Owner.Map.BaseID, ID = Owner.Map.ID, Status = Database.MapsTable.MapInformations[Owner.Map.ID].Status, Weather = Database.MapsTable.MapInformations[Owner.Map.ID].Weather });
Owner.EndQualifier();
}
else
{
Kernel.Maps[MapID].Floor[X, Y, MapObjType, this] = true;
}
if (EntityFlag == EntityFlag.Entity)
if (OnDeath != null) OnDeath(this);
}
public Entity Killer;
public int StraightLife;
public void Die(Entity killer)
{
try
{
#region Unique Killer
if (EntityFlag == EntityFlag.Entity && killer.EntityFlag == EntityFlag.Entity)
{
if (killer.MapID == 2014)
{
if (killer.MapID == 2014)
{
killer.Owner.uniquepoints += 1;
if (killer.Owner.uniquepoints >= 20)
{
Network.GamePackets.NpcReply npc = new Network.GamePackets.NpcReply(6, "Congratulations, You Have Now " + killer.Owner.uniquepoints + " Points you can claim your prize now!");
npc.OptionID = 255;
killer.Owner.Send(npc.ToArray());
}
else
{
Network.GamePackets.NpcReply npc = new Network.GamePackets.NpcReply(6, "You Have Now " + killer.Owner.uniquepoints + " Points Congratz you still need " + (20 - killer.Owner.uniquepoints) + " more!");
npc.OptionID = 255;
killer.Owner.Send(npc.ToArray());
}
}
}
#endregion
#region CpsDraobMAP
if (killer.MapID == 1234)
{
if (ConquerPoints >= 1200)
{
ConquerPoints -= 1200;
killer.ConquerPoints += 1200;
}
}
if (killer.MapID == 1235)
{
if (ConquerPoints >= 800)
{
ConquerPoints -= 800;
killer.ConquerPoints += 800;
}
}
if (killer.MapID == 1236)
{
if (ConquerPoints >= 600)
{
ConquerPoints -= 600;
killer.ConquerPoints += 600;
}
}
if (killer.MapID == 1237)
{
if (ConquerPoints >= 400)
{
ConquerPoints -= 400;
killer.ConquerPoints += 400;
}
}
if (killer.MapID == 1238)
{
if (ConquerPoints >= 500)
{
ConquerPoints -= 500;
killer.ConquerPoints += 500;
}
}
#endregion
#region Xocount and countkilling
if (Owner.Spells.ContainsKey(12660) && Owner.Entity.EpicWarrior())
{
XPCountTwist = Owner.XPCount;
}
if (killer.CountKilling >= 100 && killer.HeavenBlessing > 0 && killer.BlessedHunting < 4578)
{
killer.CountKilling = 0;
killer.BlessedHunting += 1;
}
#endregion
#region Flag
if (ContainsFlag3((ulong)1UL << 53))
RemoveFlag3((ulong)1UL << 53);
if (Owner.Spells.ContainsKey(12660))
{
XPCountTwist = Owner.XPCount;
}
#endregion
#region Experince
if (!Constants.PKFreeMaps.Contains(MapID))
{
if (Level < 140 && Experience != 0)
{
ulong amount = 0;
if (VIPLevel < 4)
{
Experience -= Math.Min(Hitpoints * MaxHitpoints * Level, Experience);
amount = Math.Min(Hitpoints * MaxHitpoints * Level, Experience);
killer.Owner.IncreaseExperience(amount, false);
}
else
{
Experience -= Math.Min(Hitpoints * MaxHitpoints * Level, Experience) / 2;
amount = Math.Min(Hitpoints * MaxHitpoints * Level, Experience) / 2;
killer.Owner.IncreaseExperience(amount, false);
}
Owner.Send(new Message("You lost " + amount + " EXP!", System.Drawing.Color.Red, Message.System));
}
}
#endregion
if (killer.MapID == 3979)
{
//killer.MessiPoints += 25;
}
Owner.Send(new Message("You are dead.", System.Drawing.Color.Red, Message.System));
}
#region MyClones
if (MyClones.Count > 0)
{
foreach (var item in MyClones.Values)
{
Data data = new Data(true);
data.UID = item.UID;
data.ID = Network.GamePackets.Data.RemoveEntity;
item.MonsterInfo.SendScreen(data);
}
MyClones.Clear();
}
#endregion
if (killer.MapID == 5928)
{
if (killer.MapID == 5928)
{
AddFlag(0x8000000);
AddFlag(Network.GamePackets.Update.Flags2.IceBlock);
FlyTime = 20;
FlyStamp = Time32.Now;
FreezeTime = 20;
FreezeStamp = Time32.Now;
GameState owner = killer.Owner;
owner.Nodie++;
Network.GamePackets.NpcReply npc = new Network.GamePackets.NpcReply(6, "Well Done : You Kill got 1 No Die Point You Have Now " + killer.Owner.Nodie + " Die Points!");
npc.OptionID = 255;
killer.Owner.Send(npc.ToArray());
//HeshamYuriServer.Game.ConquerStructures.Society.NoDie.AddScore(, Owner.UID)
Hitpoints = MaxHitpoints;
//Hitpoints = Math.Min(Hitpoints, MaxHitpoints);
return;
}
}
#region Perfection
if (EntityFlag == EntityFlag.Entity && Perfection != null)
{
Game.Enums.PerfectionEffect effect = Enums.PerfectionEffect.StraightLife;
byte chance = 0;
new MsgRefineEffect().HandleStraightLife(this, ref chance);
killer.StraightLife = 0;//true
if (Kernel.Rate(chance))
{
new MsgRefineEffect().SendEffect(this, killer, effect);
}
}
#endregion
#region CaptureTheFlag
if (killer.GuildID != 0 && killer.MapID == CaptureTheFlag.MapID && CaptureTheFlag.IsWar)
{
if (GuildID != 0)
{
if (killer.Owner.Guild.Enemy.ContainsKey(GuildID))
killer.Owner.Guild.CTFPoints += 1;
else if (killer.Owner.Guild.Ally.ContainsKey(GuildID))
killer.Owner.Guild.CTFPoints += 1;
}
if (ContainsFlag2(Network.GamePackets.Update.Flags2.CarryingFlag))
{
StaticEntity entity = new StaticEntity((uint)(X * 1000 + Y), X, Y, MapID);
entity.DoFlag();
Owner.Map.AddStaticEntity(entity);
RemoveFlag2(Network.GamePackets.Update.Flags2.CarryingFlag);
Owner.Send(Program.World.CTF.generateTimer(0));
Owner.Send(Program.World.CTF.generateEffect(Owner));
if (killer.GuildID != GuildID)
{
Killer.AddFlag2(Network.GamePackets.Update.Flags2.CarryingFlag);
Time32 end = FlagStamp.AddSeconds(60) - Time32.Now;
killer.FlagStamp = end;
killer.Owner.Send(Program.World.CTF.generateTimer((uint)end.Value));
killer.Owner.Send(Program.World.CTF.generateEffect(killer.Owner));
killer.Owner.Guild.CTFPoints += 3;
}
}
}
#endregion
#region Die Guild System
if (killer.EntityFlag == EntityFlag.Entity && EntityFlag == EntityFlag.Entity)
{
if (Owner.Guild != null && killer.Owner.Guild != null && Owner.Map.ID == 1015)
{
Owner.Guild.pkp_donation += 2;
Owner.Guild.pkp_donation -= 2;
foreach (var client in Kernel.GamePool.Values)
{
client.Send(new Message("The " + killer.Owner.AsMember.Rank + " " + killer.Name + " of the Guild " + killer.Owner.Guild.Name + " has killed the " + killer.Owner.AsMember.Rank + " " + Name + " of the Guild " + Owner.Guild.Name + " at BirdIsland!", System.Drawing.Color.Yellow, Network.GamePackets.Message.Guild));
}
}
if (Owner.Guild != null && killer.Owner.Guild != null && Owner.Map.ID == 1020)
{
Owner.Guild.pkp_donation += 2;
Owner.Guild.pkp_donation -= 2;
foreach (var client in Kernel.GamePool.Values)
client.Send(new Message("The " + killer.Owner.AsMember.Rank + " " + killer.Name + " of the Guild " + killer.Owner.Guild.Name + " has killed the " + killer.Owner.AsMember.Rank + " " + Name + " of the Guild " + Owner.Guild.Name + " at ApeCity!", System.Drawing.Color.Yellow, Network.GamePackets.Message.Guild));
}
if (Owner.Guild != null && killer.Owner.Guild != null && Owner.Map.ID == 1011)
{
Owner.Guild.pkp_donation += 2;
Owner.Guild.pkp_donation -= 2;
foreach (var client in Kernel.GamePool.Values)
client.Send(new Message("The " + killer.Owner.AsMember.Rank + " " + killer.Name + " of the Guild " + killer.Owner.Guild.Name + " has killed the " + killer.Owner.AsMember.Rank + " " + Name + " of the Guild " + Owner.Guild.Name + " at PhoenixCastle!", System.Drawing.Color.Yellow, Network.GamePackets.Message.Guild));
}
if (Owner.Guild != null && killer.Owner.Guild != null && Owner.Map.ID == 1000)
{
Owner.Guild.pkp_donation += 2;
Owner.Guild.pkp_donation -= 2;
foreach (var client in Kernel.GamePool.Values)
client.Send(new Message("The " + killer.Owner.AsMember.Rank + " " + killer.Name + " of the Guild " + killer.Owner.Guild.Name + " has killed the " + killer.Owner.AsMember.Rank + " " + Name + " of the Guild " + Owner.Guild.Name + " at DesertCity!", System.Drawing.Color.Yellow, Network.GamePackets.Message.Guild));
}
}
#endregion
#region Booth
if (EntityFlag == EntityFlag.Entity)
{
Owner.XPCount = 0;
if (OnDeath != null) OnDeath(this);
if (Owner.Booth != null)
{
Owner.Booth.Remove();
Owner.Booth = null;
}
}
#endregion
#region killerCountM
killer.CountKilling++;
killer.KillCount++;
killer.KillCount2++;
Killer = killer;
Hitpoints = 0;
DeathStamp = Time32.Now;
ToxicFogLeft = 0;
#endregion
#region Companion
if (Companion)
{
if (Hitpoints < 1)
{
Hitpoints = 0;
AddFlag((ulong)Network.GamePackets.Update.Flags.Ghost | (ulong)Network.GamePackets.Update.Flags.Dead | (ulong)Network.GamePackets.Update.Flags.FadeAway);
Attack attackx = new Attack(true);
attackx.Attacked = UID;
attackx.AttackType = Network.GamePackets.Attack.Kill;
attackx.X = X;
attackx.Y = Y;
MonsterInfo.SendScreen(attackx);
Owner.Map.RemoveEntity(this);
Owner.Pet.RemovePet(pettype);
}
}
#endregion
if (EntityFlag == EntityFlag.Entity)
{
if (killer.EntityFlag == EntityFlag.Entity)
{
if (Constants.PKFreeMaps.Contains(killer.MapID))
goto Over;
if (killer.Owner.Map.BaseID == 700)
goto Over;
if (((killer.PKMode != AbdoRedaGxV4.Game.Enums.PKMode.Jiang) && (killer.PKMode != AbdoRedaGxV4.Game.Enums.PKMode.Guild) && (killer.PKMode != AbdoRedaGxV4.Game.Enums.PKMode.Revenge) && (!ContainsFlag(Network.GamePackets.Update.Flags.FlashingName) && !ContainsFlag(Network.GamePackets.Update.Flags.BlackName)) && !this.ContainsFlag(1L)) && !this.ContainsFlag(0x8000L))
{
killer.AddFlag(Network.GamePackets.Update.Flags.FlashingName);
killer.FlashingNameStamp = Time32.Now;
killer.FlashingNameTime = 60;
if (killer.GuildID != 0)
{
if (killer.Owner.Guild.Enemy.ContainsKey(GuildID))
{
killer.PKPoints += 3;
killer.Cursed = Time32.Now;
Update update = new Update(true) { UID = killer.UID };
update.Append(Network.GamePackets.Update.CursedTimer, UID);
killer.AddFlag(Network.GamePackets.Update.Flags.Cursed);
killer.Owner.Send(update.ToArray());
}
else
{
if (!killer.Owner.Enemy.ContainsKey(UID))
killer.PKPoints += 10;
else
killer.PKPoints += 5;
killer.PKPoints += 3;
killer.Cursed = Time32.Now;
Update update = new Update(true) { UID = killer.UID };
update.Append(Network.GamePackets.Update.CursedTimer, UID);
killer.AddFlag(Network.GamePackets.Update.Flags.Cursed);
killer.Owner.Send(update.ToArray());
}
}
else
{
if (!killer.Owner.Enemy.ContainsKey(UID))
{
killer.PKPoints += 10;
}
else
{
killer.PKPoints += 5;
}
killer.Cursed = Time32.Now;
Update update = new Update(true) { UID = killer.UID };
update.Append(Network.GamePackets.Update.CursedTimer, UID);
killer.AddFlag(Network.GamePackets.Update.Flags.Cursed);
killer.Owner.Send(update.ToArray());
}
if (killer.EntityFlag == Game.EntityFlag.Entity)
{
if (EntityFlag == Game.EntityFlag.Entity)
{
Game.PkExpeliate pk = new Game.PkExpeliate();
if (!killer.PkExplorerValues.ContainsKey(UID))
{
pk.UID = killer.UID;
pk.killedUID = UID;
pk.Name = Name;
pk.KilledAt = GetMapName(MapID);
pk.LostExp = 0;
pk.Times = 1;
pk.Potency = (uint)BattlePower;
pk.Level = Level;
PkExpelTable.PkExploitAdd(killer.Owner, pk);
}
else
{
pk.UID = killer.UID;
pk.killedUID = UID;
pk.Name = Name;
pk.KilledAt = GetMapName(MapID);
pk.LostExp = 0;
killer.PkExplorerValues[UID].Times += 1;
pk.Times = killer.PkExplorerValues[UID].Times;
pk.Potency = (uint)BattlePower;
pk.Level = Level;
PkExpelTable.Update(killer.Owner, pk);
}
}
}
Network.PacketHandler.AddEnemy(this.Owner, killer.Owner);
}
if (killer.PKMode != AbdoRedaGxV4.Game.Enums.PKMode.Jiang)
{
if (killer.EntityFlag == AbdoRedaGxV4.Game.EntityFlag.Entity)
{
if (Kernel.Rate(50))
{
DropRandomStuff(Killer);
}
}
}
}
}
Over:
Network.GamePackets.Attack attack = new Attack(true);
attack.Attacker = killer.UID;
attack.Attacked = UID;
attack.AttackType = Network.GamePackets.Attack.Kill;
attack.X = X;
attack.Y = Y;
if (EntityFlag == EntityFlag.Entity)
{
AddFlag(Network.GamePackets.Update.Flags.Ghost);
AddFlag(Network.GamePackets.Update.Flags.Dead);
RemoveFlags();
SpiritFocus = false;
#region Aura
if (Aura_isActive)
{
RemoveFlag2(Aura_actType);
Owner.removeAuraBonuses(Aura_actType, Aura_actPower, 1);
Aura_isActive = false;
AuraTime = 0;
Aura_actType = 0;
Aura_actPower = 0;
}
#endregion
الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
|
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
مشكله في الاي بوله في السيرفر | Amr Khalid | مشكلات السيرفيرات كونكر الشخصيه | 10 | 2020-05-04 05:39 PM |
عاوز اول ما الاكونت يموت يصحي علي طول | Mr3bdallahPro | مشكلات السيرفيرات كونكر الشخصيه | 4 | 2020-05-02 03:47 PM |
مشكلة لمة الاميل يموت | Omar | مشكلات السيرفيرات كونكر الشخصيه | 8 | 2020-01-23 08:31 PM |
حل مشكله الاج[Alex] | محمد ياسر | تطوير سيرفرات كونكر | 2 | 2019-11-14 11:02 PM |
اذاي اخلي الاكونت اول ما يموت ميتحولش شبح علي طول يقع الاول uncelsam | Tefa | تطوير سيرفرات كونكر | 7 | 2019-07-21 06:47 PM |