public void Target(BaseCreature bc) { if (!Caster.CanSee(bc)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } if (!Caster.InRange(bc, 6)) { Caster.SendLocalizedMessage(500643); // Target is too far away. } else if (!Caster.CanBeHarmful(bc) || !bc.CanBeDamaged()) { Caster.SendLocalizedMessage(1074379); // You cannot charm that! } else if (bc.Controlled || bc.Name == null) { Caster.SendLocalizedMessage(1074379); // You cannot charm that! } else if (bc is BaseChampion || bc.IsParagon || bc is Medusa || bc is Lurg || !SlayerGroup.GetEntryByName(SlayerName.Repond).Slays(bc)) { Caster.SendLocalizedMessage(1074379); // You cannot charm that! } else if (CheckSequence()) { double chance = Caster.Skills[SkillName.Spellweaving].Fixed / 1000; chance += (SpellweavingSpell.GetFocusLevel(Caster) * 2) / 100; if (chance > Utility.RandomDouble()) { SpellHelper.Turn(Caster, bc); bc.ControlSlots = 3; bc.ActiveSpeed = 2; bc.PassiveSpeed = 2; bc.Owners.Add(Caster); bc.SetControlMaster(Caster); bc.IsBonded = false; Caster.SendLocalizedMessage(1072527); // You allure the humanoid to follow and protect you. Caster.PlaySound(0x5C4); } else { bc.Combatant = Caster; Caster.SendLocalizedMessage(1072528); // The humanoid becomes enraged by your charming attempt and attacks you. Caster.PlaySound(0x5C5); } } FinishSequence(); }
public override void OnCast() { if (Factions.Sigil.ExistsOn(Caster)) { Caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil. } else if (!Caster.CanBeginAction(typeof(PolymorphSpell))) { Caster.SendLocalizedMessage(1061628); // You can't do that while polymorphed. } else if (Caster.IsBodyMod || !Caster.CanBeginAction(typeof(IncognitoSpell)) || !Caster.CanBeginAction(typeof(PolymorphSpell)) || Necromancy.TransformationSpell.UnderTransformation(Caster)) { DoFizzle(); } else if (CheckSequence()) { if (Caster.Mount != null) { IMount mt = Caster.Mount; if (mt != null) { mt.Rider = null; } } Caster.Flying = false; double duration = 25 + (Caster.Skills[SkillName.Spellweaving].Fixed / 240); duration += SpellweavingSpell.GetFocusLevel(Caster) * 2; Caster.BodyMod = 770; Caster.HueMod = 1167; Timer t = (Timer)m_Table[Caster]; if (t != null) { t.Stop(); } m_Table[Caster] = t = Timer.DelayCall(TimeSpan.FromSeconds(duration), new TimerStateCallback(Expire_Callback), Caster); Caster.PlaySound(0x5C8); Caster.SendLocalizedMessage(1074770); // You are now under the effects of Ethereal Voyage. BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.EtherealVoyage, 1075804, TimeSpan.FromSeconds(duration), Caster)); } FinishSequence(); }