Exemple #1
0
        /// <summary>
        /// Set's the initial spawn coords of the specified point.
        /// </summary>
        /// <param name="startpoint">Startpoint</param>
        public override void OnInitialize(Point startpoint)
        {
            this.RespawnOrigin = startpoint;

            //Create hate & damage table
            hatetable   = new HateCollection();
            damagetable = new DamageCollection();

            //Clear collection table
            collection = null;

            //Load skill rotator
            string file        = Server.SecurePath("~/mobskills/{0}.xml", this.ModelId);
            string defaultfile = Server.SecurePath("~/mobskills/default.xml");

            if (File.Exists(file))
            {
                skills = SkillRotatorCollection.CreateFromFile(file);
            }
            else if (File.Exists(defaultfile))
            {
                skills = SkillRotatorCollection.CreateFromFile(defaultfile);
            }
            else
            {
                skills = SkillRotatorCollection.Empty;
            }

            //Call base
            base.OnInitialize(startpoint);
        }
Exemple #2
0
        /// <summary>
        /// Occurs when you die
        /// </summary>
        /// <param name="d"></param>
        public override void OnDie(MapObject d)
        {
            if (d != null && MapObject.IsPlayer(d))
            {
                Die((Character)d);
            }

            //Clear all hate
            hatetable = new HateCollection();

            //Stop attacking
            Saga.Tasks.BattleThread.Unsubscribe(this);

            //Subscribe as corpse
            Corpses.Subscribe(this);
        }