public void AddBuffEffect(BuffType type) { for (int i = 0; i < Effects.Count; i++) { if (!(Effects[i] is BuffEffect)) { continue; } if (((BuffEffect)(Effects[i])).BuffType == type) { return; } } PlayerObject ob = null; if (Race == ObjectType.Player) { ob = (PlayerObject)this; } switch (type) { case BuffType.Fury: Effects.Add(new BuffEffect(Libraries.Magic3, 190, 7, 1400, this, true, type) { Repeat = true }); break; case BuffType.SwiftFeet: if (ob != null) { ob.Sprint = true; } break; case BuffType.MoonLight: case BuffType.DarkBody: if (ob != null) { ob.Sneaking = true; } break; case BuffType.VampireShot: Effects.Add(new BuffEffect(Libraries.Magic3, 2110, 6, 1400, this, true, type) { Repeat = false }); break; case BuffType.PoisonShot: Effects.Add(new BuffEffect(Libraries.Magic3, 2310, 7, 1400, this, true, type) { Repeat = false }); break; case BuffType.EnergyShield: BuffEffect effect; Effects.Add(effect = new BuffEffect(Libraries.Magic2, 1880, 9, 900, this, true, type) { Repeat = false }); SoundManager.PlaySound(20000 + (ushort)Spell.EnergyShield * 10 + 0); effect.Complete += (o, e) => { Effects.Add(new BuffEffect(Libraries.Magic2, 1900, 2, 800, this, true, type) { Repeat = true }); }; break; case BuffType.MagicBooster: Effects.Add(new BuffEffect(Libraries.Magic3, 90, 6, 1200, this, true, type) { Repeat = true }); break; case BuffType.PetEnhancer: Effects.Add(new BuffEffect(Libraries.Magic3, 230, 6, 1200, this, true, type) { Repeat = true }); break; } }
private void ObjectStruck(S.ObjectStruck p) { if (p.ObjectID == User.ObjectID) return; for (int i = MapControl.Objects.Count - 1; i >= 0; i--) { MapObject ob = MapControl.Objects[i]; if (ob.ObjectID != p.ObjectID) continue; if (ob.SkipFrames) return; //if (ob.CurrentAction == MirAction.Struck) return; if (ob.ActionFeed.Count > 0 && ob.ActionFeed[ob.ActionFeed.Count - 1].Action == MirAction.Struck) return; if (ob.Race == ObjectType.Player) ((PlayerObject)ob).BlizzardStopTime = 0; QueuedAction action = new QueuedAction { Action = MirAction.Struck, Direction = p.Direction, Location = p.Location, Params = new List<object>() }; action.Params.Add(p.AttackerID); ob.ActionFeed.Add(action); if (ob.Buffs.Any(a => a == BuffType.EnergyShield)) { for (int j = 0; j < ob.Effects.Count; j++) { BuffEffect effect = null; effect = ob.Effects[j] as BuffEffect; if (effect != null && effect.BuffType == BuffType.EnergyShield) { effect.Clear(); effect.Remove(); ob.Effects.Add(effect = new BuffEffect(Libraries.Magic2, 1890, 6, 600, ob, true, BuffType.EnergyShield) { Repeat = false }); SoundManager.PlaySound(20000 + (ushort)Spell.EnergyShield * 10 + 1); effect.Complete += (o, e) => { ob.Effects.Add(new BuffEffect(Libraries.Magic2, 1900, 2, 800, ob, true, BuffType.EnergyShield) { Repeat = true }); }; break; } } } return; } }
public void AddBuffEffect(BuffType type) { for (int i = 0; i < Effects.Count; i++) { if (!(Effects[i] is BuffEffect)) { continue; } if (((BuffEffect)(Effects[i])).BuffType == type) { return; } } PlayerObject ob = null; if (Race == ObjectType.Player) { ob = (PlayerObject)this; } switch (type) { case BuffType.Fury: Effects.Add(new BuffEffect(Libraries.Magic3, 190, 7, 1400, this, true, type) { Repeat = true }); break; case BuffType.ImmortalSkin: Effects.Add(new BuffEffect(Libraries.Magic3, 570, 5, 1400, this, true, type) { Repeat = true }); break; case BuffType.SwiftFeet: if (ob != null) { ob.Sprint = true; } break; case BuffType.MoonLight: case BuffType.DarkBody: if (ob != null) { ob.Sneaking = true; } break; case BuffType.VampireShot: Effects.Add(new BuffEffect(Libraries.Magic3, 2110, 6, 1400, this, true, type) { Repeat = false }); break; case BuffType.PoisonShot: Effects.Add(new BuffEffect(Libraries.Magic3, 2310, 7, 1400, this, true, type) { Repeat = false }); break; case BuffType.EnergyShield: BuffEffect effect; Effects.Add(effect = new BuffEffect(Libraries.Magic2, 1880, 9, 900, this, true, type) { Repeat = false }); SoundManager.PlaySound(20000 + (ushort)Spell.EnergyShield * 10 + 0); effect.Complete += (o, e) => { Effects.Add(new BuffEffect(Libraries.Magic2, 1900, 2, 800, this, true, type) { Repeat = true }); }; break; case BuffType.MagicBooster: Effects.Add(new BuffEffect(Libraries.Magic3, 90, 6, 1200, this, true, type) { Repeat = true }); break; case BuffType.PetEnhancer: Effects.Add(new BuffEffect(Libraries.Magic3, 230, 6, 1200, this, true, type) { Repeat = true }); break; case BuffType.GameMaster: Effects.Add(new BuffEffect(Libraries.CHumEffect[5], 0, 1, 1200, this, true, type) { Repeat = true }); break; case BuffType.GeneralMeowMeowShield: Effects.Add(new BuffEffect(Libraries.Monsters[(ushort)Monster.GeneralMeowMeow], 529, 7, 700, this, true, type) { Repeat = true, Light = 1 }); MirSounds.SoundManager.PlaySound(8322); break; case BuffType.PowerBeadBuff: Effects.Add(new BuffEffect(Libraries.Monsters[(ushort)Monster.PowerUpBead], 64, 6, 600, this, true, type) { Blend = true, Repeat = true }); break; case BuffType.HornedArcherBuff: Effects.Add(effect = new BuffEffect(Libraries.Monsters[(ushort)Monster.HornedArcher], 468, 6, 600, this, true, type) { Repeat = false }); effect.Complete += (o, e) => { Effects.Add(new BuffEffect(Libraries.Monsters[(ushort)Monster.HornedArcher], 474, 3, 1000, this, true, type) { Blend = true, Repeat = true }); }; break; case BuffType.ColdArcherBuff: Effects.Add(effect = new BuffEffect(Libraries.Monsters[(ushort)Monster.HornedArcher], 477, 7, 700, this, true, type) { Repeat = false }); effect.Complete += (o, e) => { Effects.Add(new BuffEffect(Libraries.Monsters[(ushort)Monster.HornedArcher], 484, 3, 1000, this, true, type) { Blend = true, Repeat = true }); }; break; case BuffType.HornedWarriorShield: Effects.Add(new BuffEffect(Libraries.Monsters[(ushort)Monster.HornedWarrior], 912, 18, 1800, this, true, type) { Repeat = true }); break; case BuffType.HornedCommanderShield: Effects.Add(effect = new BuffEffect(Libraries.Monsters[(ushort)Monster.HornedCommander], 1173, 1, 100, this, true, type) { Repeat = false, Light = 1 }); effect.Complete += (o, e) => { Effects.Add(new BuffEffect(Libraries.Monsters[(ushort)Monster.HornedCommander], 1174, 16, 1600, this, true, type) { Repeat = true, Light = 1 }); }; break; } }
private void Struck(S.Struck p) { LogTime = CMain.Time + Globals.LogDelay; NextRunTime = CMain.Time + 2500; User.BlizzardStopTime = 0; User.ClearMagic(); if (User.ReincarnationStopTime > CMain.Time) Network.Enqueue(new C.CancelReincarnation {}); //if (User.CurrentAction == MirAction.Struck) return; MirDirection dir = User.Direction; Point location = User.CurrentLocation; for (int i = 0; i < User.ActionFeed.Count; i++) if (User.ActionFeed[i].Action == MirAction.Struck) return; if (User.ActionFeed.Count > 0) { dir = User.ActionFeed[User.ActionFeed.Count - 1].Direction; location = User.ActionFeed[User.ActionFeed.Count - 1].Location; } if (User.Buffs.Any(a => a == BuffType.EnergyShield)) { for (int j = 0; j < User.Effects.Count; j++) { BuffEffect effect = null; effect = User.Effects[j] as BuffEffect; if (effect != null && effect.BuffType == BuffType.EnergyShield) { effect.Clear(); effect.Remove(); User.Effects.Add(effect = new BuffEffect(Libraries.Magic2, 1890, 6, 600, User, true, BuffType.EnergyShield) { Repeat = false }); SoundManager.PlaySound(20000 + (ushort)Spell.EnergyShield * 10 + 1); effect.Complete += (o, e) => { User.Effects.Add(new BuffEffect(Libraries.Magic2, 1900, 2, 800, User, true, BuffType.EnergyShield) { Repeat = true }); }; break; } } } QueuedAction action = new QueuedAction { Action = MirAction.Struck, Direction = dir, Location = location, Params = new List<object>() }; action.Params.Add(p.AttackerID); User.ActionFeed.Add(action); }
public void AddBuffEffect(BuffType type) { for (int i = 0; i < Effects.Count; i++) { if (!(Effects[i] is BuffEffect)) continue; if (((BuffEffect)(Effects[i])).BuffType == type) return; } PlayerObject ob = null; if (Race == ObjectType.Player) { ob = (PlayerObject)this; } switch (type) { case BuffType.Fury: Effects.Add(new BuffEffect(Libraries.Magic3, 190, 7, 1400, this, true, type) { Repeat = true }); break; case BuffType.SwiftFeet: if (ob != null) ob.Sprint = true; break; case BuffType.MoonLight: case BuffType.DarkBody: if (ob != null) ob.Sneaking = true; break; case BuffType.VampireShot: Effects.Add(new BuffEffect(Libraries.Magic3, 2110, 6, 1400, this, true, type) { Repeat = false }); break; case BuffType.PoisonShot: Effects.Add(new BuffEffect(Libraries.Magic3, 2310, 7, 1400, this, true, type) { Repeat = false }); break; case BuffType.EnergyShield: BuffEffect effect; Effects.Add(effect = new BuffEffect(Libraries.Magic2, 1880, 9, 900, this, true, type) { Repeat = false }); SoundManager.PlaySound(20000 + (ushort)Spell.EnergyShield * 10 + 0); effect.Complete += (o, e) => { Effects.Add(new BuffEffect(Libraries.Magic2, 1900, 2, 800, this, true, type) { Repeat = true }); }; break; case BuffType.MagicBooster: Effects.Add(new BuffEffect(Libraries.Magic3, 90, 6, 1200, this, true, type) { Repeat = true }); break; case BuffType.PetEnhancer: Effects.Add(new BuffEffect(Libraries.Magic3, 230, 6, 1200, this, true, type) { Repeat = true }); break; } }