예제 #1
0
 public CharacterRecord()
 {
     Stats   = new Engines.StatsEngine(this);
     Items   = new Engines.ItemEngine(this);
     Pattern = new Patterns.CharacterPattern(this);
     Spells  = new Engines.SpellBook(this);
     Faction = new Engines.FactionEngine(this);
 }
예제 #2
0
        public void InitMonster()
        {
            try
            {
                StatsEngine = new Engines.StatsEngine(this);

                string[] statsData = this.Stats.Split(',');
                StatsEngine.Life.Base     = int.Parse(statsData[0]) + this.Life;
                StatsEngine.Strenght.Base = int.Parse(statsData[1]);
                StatsEngine.Fire.Base     = int.Parse(statsData[2]);
                StatsEngine.Agility.Base  = int.Parse(statsData[3]);
                StatsEngine.Water.Base    = int.Parse(statsData[4]);

                string[] data = Spells.Split('|');
                foreach (string s in data)
                {
                    if (s != "")
                    {
                        try
                        {
                            string[] spellData  = s.Split(',');
                            int      spellID    = int.Parse(spellData[0]);
                            int      spellLevel = int.Parse(spellData[1]);
                            OwnSpells.Add(new World.Game.Spells.WorldSpell(spellID, spellLevel, 0));
                        }
                        catch (Exception e)
                        {
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Utilities.ConsoleStyle.Error("Can't load the monster ID : " + this.ID + ", " + e.ToString());
            }
        }