/// <summary> /// Copy constructor. /// </summary> /// <param name="mob"></param> public MobTemplate(MobTemplate mob) { _actionFlags = new int[mob._actionFlags.Length]; mob._actionFlags.CopyTo(_actionFlags, 0); _affectedBy = new int[mob._affectedBy.Length]; mob._affectedBy.CopyTo(_affectedBy, 0); _alignment = mob._alignment; _area = mob._area; _characterClass = mob._characterClass; _chatterBotName = mob._chatterBotName; _className = mob._className; _customActions = new List <CustomAction>(mob._customActions); _deathFun = new List <MobSpecial>(mob._deathFun); _deathFunName = mob._deathFunName; _defaultPosition = mob._defaultPosition; _description = mob._description; _fullDescription = mob._fullDescription; _immune = mob._immune; _indexNumber = _area.HighMobIndexNumber + 1; _level = mob._level; _numActive = 0; _numberKilled = 0; ++_numMobIndex; _playerName = mob._playerName; _race = mob._race; _resistant = mob._resistant; _sex = mob._sex; // TODO: Deep copy this. _shopData = mob._shopData; _shortDescription = mob._shortDescription; _specFun = new List <MobSpecial>(mob._specFun); _specFunNames = mob._specFunNames; _susceptible = mob._susceptible; _vulnerable = mob._vulnerable; }
/// <summary> /// Adds the special function for a character class to this mobile's list of /// special functions. /// </summary> /// <param name="cClass"></param> public void AddSpecClass(int cClass) { MobTemplate mobTemplate = this; switch (cClass) { default: break; case (int)CharClass.Names.shaman: mobTemplate.AddSpecFun("spec_cast_shaman"); break; case (int)CharClass.Names.elementAir: mobTemplate.AddSpecFun("spec_cast_air_ele"); break; case (int)CharClass.Names.elementEarth: mobTemplate.AddSpecFun("spec_cast_earth_ele"); break; case (int)CharClass.Names.elementFire: mobTemplate.AddSpecFun("spec_cast_fire_ele"); break; case (int)CharClass.Names.elementWater: mobTemplate.AddSpecFun("spec_cast_water_ele"); break; case (int)CharClass.Names.druid: mobTemplate.AddSpecFun("spec_cast_druid"); break; case (int)CharClass.Names.ranger: mobTemplate.AddSpecFun("spec_cast_ranger"); break; case (int)CharClass.Names.hunter: mobTemplate.AddSpecFun("spec_cast_hunter"); break; case (int)CharClass.Names.warrior: mobTemplate.AddSpecFun("spec_warrior"); break; case (int)CharClass.Names.monk: mobTemplate.AddSpecFun("spec_monk"); break; case (int)CharClass.Names.bard: mobTemplate.AddSpecFun("spec_bard"); break; case (int)CharClass.Names.illusionist: mobTemplate.AddSpecFun("spec_cast_illusionist"); break; case (int)CharClass.Names.paladin: mobTemplate.AddSpecFun("spec_cast_paladin"); break; case (int)CharClass.Names.antipaladin: mobTemplate.AddSpecFun("spec_cast_antipaladin"); break; case (int)CharClass.Names.thief: mobTemplate.AddSpecFun("spec_thief"); break; case (int)CharClass.Names.mercenary: mobTemplate.AddSpecFun("spec_mercenary"); break; case (int)CharClass.Names.assassin: mobTemplate.AddSpecFun("spec_assassin"); break; case (int)CharClass.Names.cleric: mobTemplate.AddSpecFun("spec_cast_cleric"); break; case (int)CharClass.Names.sorcerer: mobTemplate.AddSpecFun("spec_cast_sorcerer"); break; case (int)CharClass.Names.psionicist: mobTemplate.AddSpecFun("spec_cast_psionicist"); break; case (int)CharClass.Names.necromancer: mobTemplate.AddSpecFun("spec_cast_necromancer"); break; case (int)CharClass.Names.chronomancer: mobTemplate.AddSpecFun("spec_cast_chronomancer"); break; } return; }