QUOTE |
public virtual Spell GetRandomDamageSpell() { // ARTEGORDONMOD // restrict the damage spells that can be cast by this mob // look for the xmldata attachment named "DamageSpells" // the Data string will contain a list of space-separated spells that can be cast XmlData x = (XmlData)XmlAttach.FindAttachment(m_Mobile, typeof(XmlData), "DamageSpells"); if (x != null) { // get the spell list string[] spells = BaseXmlSpawner.ParseSpaceArgs(x.Data, 20); if (spells != null && spells.Length > 0) { // choose one at random int index = Utility.Random(spells.Length); return SpellRegistry.NewSpell(spells[index], m_Mobile, null); } } int maxCircle = (int)((m_Mobile.Skills[SkillName.Magery].Value + 20.0) / (100.0 / 7.0)); if ( maxCircle < 1 ) maxCircle = 1; switch ( Utility.Random( maxCircle*2 ) ) { case 0: case 1: return new MagicArrowSpell( m_Mobile, null ); case 2: case 3: return new HarmSpell( m_Mobile, null ); case 4: case 5: return new FireballSpell( m_Mobile, null ); case 6: case 7: return new LightningSpell( m_Mobile, null ); case 8: case 9: return new MindBlastSpell( m_Mobile, null ); case 10: return new EnergyBoltSpell( m_Mobile, null ); case 11: return new ExplosionSpell( m_Mobile, null ); default: return new FlameStrikeSpell( m_Mobile, null ); } } |
CODE |
using Server.Engines.XmlSpawner2; |