public override void OnResponse(NetState sender, RelayInfo info) { if (info.ButtonID >= 100 && info.ButtonID <= 100 + m_Entries.Length) { int mana = m_Spell.ScaleMana(m_Spell.RequiredMana); if (mana > m_Caster.Mana) { m_Caster.SendLocalizedMessage(1060174, mana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability. } else { int entryID = info.ButtonID - 100; if (AnimalForm.Morph(m_Caster, entryID) == MorphResult.Fail) { m_Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 502632); // The spell fizzles. m_Caster.FixedParticles(0x3735, 1, 30, 9503, EffectLayer.Waist); m_Caster.PlaySound(0x5C); } else { m_Caster.Mana -= mana; } } } }
public override void OnResponse(NetState sender, RelayInfo info) { int entryID = info.ButtonID - 1; if (entryID < 0 || entryID >= m_Entries.Length) { return; } int mana = m_Spell.ScaleMana(m_Spell.RequiredMana); AnimalFormEntry entry = AnimalForm.Entries[entryID]; if (mana > m_Caster.Mana) { m_Caster.SendLocalizedMessage(1060174, mana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability. } else if (BaseFormTalisman.EntryEnabled(sender.Mobile, entry.Type)) { if (AnimalForm.Morph(m_Caster, entryID) == MorphResult.Fail) { m_Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 502632); // The spell fizzles. m_Caster.FixedParticles(0x3735, 1, 30, 9503, EffectLayer.Waist); m_Caster.PlaySound(0x5C); } else { m_Caster.FixedParticles(0x3728, 10, 13, 2023, EffectLayer.Waist); m_Caster.Mana -= mana; } } }
public override void OnResponse(NetState sender, RelayInfo info) { int entryID = info.ButtonID - 1; if (entryID < 0 || entryID >= m_Entries.Length) { return; } int mana = m_Spell.ScaleMana(m_Spell.RequiredMana); AnimalFormEntry entry = AnimalForm.Entries[entryID]; if (mana > m_Caster.Mana) { m_Caster.SendLocalizedMessage(1060174, mana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability. } else if (BaseFormTalisman.EntryEnabled(sender.Mobile, entry.Type)) { #region Dueling if (m_Caster is PlayerMobile && ((PlayerMobile)m_Caster).DuelContext != null && !((PlayerMobile)m_Caster).DuelContext.AllowSpellCast(m_Caster, m_Spell)) { } #endregion else if (Morph(m_Caster, entryID) == MorphResult.Fail) { m_Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 502632); // The spell fizzles. m_Caster.FixedParticles(0x3735, 1, 30, 9503, EffectLayer.Waist); m_Caster.PlaySound(0x5C); } else { m_Caster.FixedParticles(0x3728, 10, 13, 2023, EffectLayer.Waist); m_Caster.Mana -= mana; string typename = entry.Name; BuffInfo.AddBuff(m_Caster, new BuffInfo(BuffIcon.AnimalForm, 1060612, 1075823, String.Format("{0}\t{1}", "aeiouy".IndexOf(typename.ToLower()[0]) >= 0 ? "an" : "a", typename))); } } }
public override void OnResponse(NetState sender, RelayInfo info) { int entryID = info.ButtonID - 1; if (entryID < 0 || entryID >= AnimalForm.Entries.Length) { return; } int mana = m_Spell.ScaleMana(m_Spell.RequiredMana); AnimalFormEntry entry = AnimalForm.Entries[entryID]; if (mana > m_Caster.Mana) { m_Caster.SendLocalizedMessage(1060174, mana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability. } else if (m_Caster is PlayerMobile mobile && mobile.MountBlockReason != BlockMountType.None) { mobile.SendLocalizedMessage(1063108); // You cannot use this ability right now. }
public override void OnResponse(NetState sender, RelayInfo info) { int entryID = info.ButtonID - 1; if (entryID < 0 || entryID >= AnimalForm.Entries.Length) { return; } int mana = m_Spell.ScaleMana(m_Spell.RequiredMana); AnimalFormEntry entry = AnimalForm.Entries[entryID]; if (mana > m_Caster.Mana) { m_Caster.SendLocalizedMessage(1060174, mana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability. } else if ((m_Caster is PlayerMobile) && (m_Caster as PlayerMobile).MountBlockReason != BlockMountType.None) { m_Caster.SendLocalizedMessage(1063108); // You cannot use this ability right now. } else if (BaseFormTalisman.EntryEnabled(sender.Mobile, entry.Type)) { #region Dueling if (m_Caster is PlayerMobile && ((PlayerMobile)m_Caster).DuelContext != null && !((PlayerMobile)m_Caster).DuelContext.AllowSpellCast(m_Caster, m_Spell)) { } #endregion else if (AnimalForm.Morph(m_Caster, entryID) == MorphResult.Fail) { m_Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 502632); // The spell fizzles. m_Caster.FixedParticles(0x3735, 1, 30, 9503, EffectLayer.Waist); m_Caster.PlaySound(0x5C); } else { m_Caster.FixedParticles(0x3728, 10, 13, 2023, EffectLayer.Waist); m_Caster.Mana -= mana; } } }