Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #region Assassin skills
- case 11650:
- {
- if (CanUseSpell(spell, attacker.Owner))
- {
- if (attacker.MapID == 1844)
- return;
- PrepareSpell(spell, attacker.Owner);
- ShekoProject.Network.GamePackets.SpellUse suse = new ShekoProject.Network.GamePackets.SpellUse(true);
- suse.Attacker = attacker.UID;
- suse.SpellID = spell.ID;
- suse.SpellLevel = spell.Level;
- suse.X = X;
- suse.Y = Y;
- attack.X = X;
- attack.Y = Y;
- attack.Attacker = attacker.UID;
- attack.AttackType = 53;
- attack.X = X;
- attack.Y = Y;
- Writer.WriteUInt16(spell.ID, 24, attack.ToArray());
- Writer.WriteByte(spell.Level, 26, attack.ToArray());
- attacker.Owner.SendScreen(attack, true);
- attacker.X = X;
- attacker.Y = Y;
- if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Range)
- {
- foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
- {
- if (_obj == null)
- continue;
- if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
- {
- attacked = _obj as Entity;
- if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
- {
- if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
- {
- attack.Effect1 = Attack.AttackEffects1.None;
- //Attack.AttackEffects1 s = Attack.AttackEffects1.None;
- uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
- damage = (damage * 30) / 100;
- suse.Effect1 = attack.Effect1;
- if (attacked.EntityFlag == EntityFlag.Monster)
- {
- if (!(attacked.Name.Contains("TeratoDragon") || attacked.Name.Contains("SnowBanshee") || attacked.Name.Contains("BabyiFranko") || attacked.Name.Contains("Guard") || attacked.Name.Contains("ThrillingSpook")))
- damage = (damage * 5);
- }
- else
- {
- if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= 5)
- damage = (damage * 20) / 100;
- else { continue; }
- }
- ReceiveAttack(attacker, attacked, attack, damage, spell);
- suse.Targets.Add(attacked.UID, damage);
- }
- }
- }
- else if (_obj.MapObjType == MapObjectType.SobNpc)
- {
- attackedsob = _obj as SobNpcSpawn;
- if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Distance)
- {
- if (CanAttack(attacker, attackedsob, spell))
- {
- attack.Effect1 = Attack.AttackEffects1.None;
- //Attack.AttackEffects1 s = Attack.AttackEffects1.None;
- uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
- damage = (damage * 30) / 100;
- ////if (ServerBase.Kernel.Rate((attacker.CriticalStrike) / 100)) { uint calc = (uint)(damage * 1.5F); attack.Damage = (uint)(damage * 1.5F); damage = calc; attack.Effect1 = ShekoProject.Network.GamePackets.Attack.AttackEffects1.CriticalStrike; }
- damage = (uint)(damage * spell.PowerPercent);
- ReceiveAttack(attacker, attackedsob, attack, damage, spell);
- suse.Effect1 = attack.Effect1;
- suse.Targets.Add(attackedsob.UID, damage);
- }
- }
- }
- }
- }
- else
- {
- attacker.AttackPacket = null;
- }
- attacker.Owner.SendScreen(suse, true);
- }
- break;
- }
- case 11610: //BladeFlurry
- {
- if (CanUseSpell(spell, attacker.Owner))
- {
- if (attacker.MapID == 1844)
- return;
- PrepareSpell(spell, attacker.Owner);
- SpellUse suse = new SpellUse(true);
- suse.Attacker = attacker.UID;
- suse.SpellID = spell.ID;
- suse.SpellLevel = spell.Level;
- suse.X = X;
- suse.Y = Y;
- if (!attacker.ContainsFlag3(Update.Flags3.BladeFlurry))
- {
- // attacker.RemoveFlag(Update.Flags.XPList);
- attacker.BladeFlurryStamp = Time32.Now;
- attacker.BladeFlurry = 43;
- attacker.AddFlag3(Update.Flags3.BladeFlurry);
- }
- if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= 10)
- {
- for (int c = 0; c < attacker.Owner.Screen.Objects.Count(); c++)
- {
- //For a multi threaded application, while we go through the collection
- //the collection might change. We will make sure that we wont go off
- //the limits with a check.
- if (c >= attacker.Owner.Screen.Objects.Count())
- break;
- Interfaces.IMapObject _obj = attacker.Owner.Screen.Objects[c];
- if (_obj == null)
- continue;
- if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
- {
- attacked = _obj as Entity;
- if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= 10)
- {
- if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
- {
- uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
- if (spell.Power > 0)
- damage = Game.Attacking.Calculate.Magic(attacker, attacked, spell, ref attack);
- if (spell.ID == 8030)
- damage = Game.Attacking.Calculate.Ranged(attacker, attacked, ref attack);
- ReceiveAttack(attacker, attacked, attack, damage, spell);
- suse.Targets.Add(attacked.UID, damage);
- //attacked.AddFlag(Update.Effects.CannonBarrage);
- }
- }
- }
- else if (_obj.MapObjType == MapObjectType.SobNpc)
- {
- attackedsob = _obj as SobNpcSpawn;
- if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= 10)
- {
- if (CanAttack(attacker, attackedsob, spell))
- {
- uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
- if (spell.Power > 0)
- damage = Game.Attacking.Calculate.Magic(attacker, attackedsob, spell, ref attack);
- if (spell.ID == 8030)
- damage = Game.Attacking.Calculate.Ranged(attacker, attackedsob, ref attack);
- ReceiveAttack(attacker, attackedsob, attack, damage, spell);
- suse.Targets.Add(attackedsob.UID, damage);
- //attacked.AddFlag(Update.Effects.CannonBarrage);
- }
- }
- }
- }
- }
- else
- {
- attacker.AttackPacket = null;
- }
- attacker.Owner.SendScreen(suse, true);
- }
- break;
- }
- case 11660:
- {
- if (CanUseSpell(spell, attacker.Owner))
- {
- if (attacker.MapID == 1844)
- return;
- PrepareSpell(spell, attacker.Owner);
- TryTrip suse = new TryTrip(true);
- suse.Attacker = attacker.UID;
- suse.SpellID = spell.ID;
- suse.SpellLevel = spell.Level;
- if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= attacker.AttackRange + 1)
- {
- if (attackedsob != null)
- {
- if (CanAttack(attacker, attackedsob, spell))
- {
- PrepareSpell(spell, attacker.Owner);
- uint power = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
- power = (uint)(power * spell.PowerPercent);
- ReceiveAttack(attacker, attackedsob, attack, power, spell);
- suse.Damage = power;
- suse.Attacked = attackedsob.UID;
- }
- }
- else
- {
- if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
- {
- PrepareSpell(spell, attacker.Owner);
- uint power = Game.Attacking.Calculate.Melee(attacker, attacked, spell, ref attack);
- power = (power * 10) / 100;
- ReceiveAttack(attacker, attacked, attack, power, spell);
- suse.Damage = power;
- suse.Attacked = attacked.UID;
- }
- }
- attacker.AttackPacket = null;
- }
- else
- {
- attacker.AttackPacket = null;
- }
- attacker.Owner.SendScreen(suse, true);
- }
- attacker.AttackPacket = null;
- break;
- }
- case 11670://SpiritFocus
- {
- if (CanUseSpell(spell, this.attacker.Owner))
- {
- PrepareSpell(spell, this.attacker.Owner);
- if (this.attacker.ContainsFlag3(Update.Flags.Intensify))
- {
- this.attacker.RemoveFlag3(Update.Flags.Intensify);
- break;
- }
- this.attacker.AddFlag3(Update.Flags.Intensify);
- SpellUse spellUse = new SpellUse(true);
- spellUse.Attacker = this.attacker.UID;
- spellUse.SpellID = spell.ID;
- spellUse.SpellLevel = spell.Level;
- spellUse.X = X;
- spellUse.Y = Y;
- spellUse.Targets.Add(this.attacker.UID, 0);
- this.attacker.Owner.SendScreen(spellUse, true);
- }
- break;
- }
- case 11620:
- {//pathofshadow
- if (CanUseSpell(spell, attacker.Owner))
- {
- if (attacker.MapID == 1844)
- return;
- PrepareSpell(spell, attacker.Owner);
- if (attacker.ContainsFlag3(Update.Flags3.PathOfShadow))
- {
- attacker.RemoveFlag3(Update.Flags3.PathOfShadow);
- break;
- }
- _String str = new _String(true);
- str.UID = attacker.UID;
- str.TextsCount = 1;
- str.Type = _String.Effect;
- str.Texts.Add("superxp2");
- attacker.Owner.SendScreen(str, true);
- attacker.AddFlag3(Update.Flags3.PathOfShadow);
- SpellUse spellUse = new SpellUse(true);
- spellUse.Attacker = attacker.UID;
- spellUse.SpellID = spell.ID;
- spellUse.SpellLevel = spell.Level;
- spellUse.X = X;
- spellUse.Y = Y;
- spellUse.Targets.Add(attacker.UID, 0);
- attacker.Owner.SendScreen(spellUse, true);
- }
- break;
- }
- case 11590:
- {//KineticSpark
- if (CanUseSpell(spell, attacker.Owner))
- {
- if (attacker.MapID == 1844)
- return;
- PrepareSpell(spell, attacker.Owner);
- if (attacker.ContainsFlag3(Update.Flags3.KineticSpark))
- {
- attacker.RemoveFlag3(Update.Flags3.KineticSpark);
- if (attacker.CriticalStrike >= 2000)
- {
- attacker.CriticalStrike -= 2000;
- }
- break;
- }
- attacker.AddFlag3(Update.Flags3.KineticSpark);
- attacker.CriticalStrike += 2000;
- SpellUse spellUse = new SpellUse(true);
- spellUse.Attacker = attacker.UID;
- spellUse.SpellID = spell.ID;
- spellUse.SpellLevel = spell.Level;
- spellUse.X = X;
- spellUse.Y = Y;
- spellUse.Targets.Add(attacker.UID, 0);
- attacker.Owner.SendScreen(spellUse, true);
- }
- break;
- }
- #region daggerstorm
- case 11600: // Scurvey Bomb
- {
- if (CanUseSpell(spell, attacker.Owner))
- {
- PrepareSpell(spell, attacker.Owner);
- SpellUse suse = new SpellUse(true);
- suse.Attacker = attacker.UID;
- suse.SpellID = spell.ID;
- suse.SpellLevel = spell.Level;
- spell.UseStamina = 50;
- spell.UseMana = 0;
- suse.X = X;
- suse.Y = Y;
- suse.Effect1 = 0;
- bool sheko = false;
- if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= spell.Distance)
- {
- foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
- foreach (Client.GameState clients in Kernel.GamePool.Values)
- {
- if (_obj == null)
- continue;
- if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
- {
- attacked = _obj as Entity;
- if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= spell.Range)
- {
- if (CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee))
- {
- clients.Entity.DaggerTimeStamp = DateTime.Now;
- clients.Entity.DaggerTimeTime = 45;
- attacker.AddFlag3(1UL << 20);
- attack.Effect1 = Attack.AttackEffects1.None;
- PrepareSpell(spell, attacker.Owner);
- //Attack.AttackEffects1 s = Attack.AttackEffects1.None;
- uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
- suse.Effect1 = attack.Effect1;
- Database.SpellInformation spell2 = null;
- if (attacked.EntityFlag == EntityFlag.Player)
- {
- if (attacked.Action == Enums.ConquerAction.Sit)
- if (attacked.Stamina > 20)
- attacked.Stamina -= 20;
- else
- attacked.Stamina = 0;
- attacked.Action = Enums.ConquerAction.None;
- //Console.WriteLine("ssS");
- }
- spell2 = Database.SpellTable.SpellInformations[11600][attacker.Owner.Spells[11600].Level];
- damage = (uint)(damage + spell2.Power);
- ReceiveAttack(attacker, attacked, attack, damage, spell);
- suse.Targets.Add(attacked.UID, damage);
- attacked.Update(_String.Effect, "Ia_appear", true);
- attacked.Update(_String.Effect, "Ia_appear", true);
- attacked.Update(_String.Effect, "Ia_appear", true);
- attacked.Update(_String.Effect, "Ia_appear", true);
- }
- }
- }
- else if (_obj.MapObjType == MapObjectType.SobNpc)
- {
- attackedsob = _obj as SobNpcSpawn;
- if (ServerBase.Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= spell.Distance)
- {
- if (CanAttack(attacker, attackedsob, spell))
- {
- attack.Effect1 = Attack.AttackEffects1.None;
- //Attack.AttackEffects1 s = Attack.AttackEffects1.None;
- sheko = attacked.BlackSpots;
- PrepareSpell(spell, attacker.Owner);
- uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);////if (ServerBase.Kernel.Rate((attacker.CriticalStrike) / 100)) { uint calc = (uint)(damage * 1.5F); attack.Damage = (uint)(damage * 1.5F); damage = calc; attack.Effect1 = ShekoProject.Network.GamePackets.Attack.AttackEffects1.CriticalStrike; }
- damage = (damage * 65) / 100;
- suse.Effect1 = attack.Effect1;
- ReceiveAttack(attacker, attackedsob, attack, damage, spell);
- suse.Targets.Add(attackedsob.UID, damage);
- }
- }
- }
- }
- }
- else
- {
- attacker.AttackPacket = null;
- }
- attacker.Owner.SendScreen(suse, true);
- }
- break;
- }
- #endregion
- #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement