Ejemplo n.º 1
0
        /// <summary>
        /// If the client is dead, send back to the home point.
        /// If the type is 1, send back to a save point at the Cattleya's co=ords.
        /// Remove some durability from the items as a dying penalty.
        /// </summary>
        public void OnSendHomePoint(SagaMap.Packets.Client.SendHomePoint p)
        {
            if (this.state != SESSION_STATE.MAP_LOADED)
            {
                return;
            }
            if (this.Char.stance != Global.STANCE.DIE || this.Char.HP != 0)
            {
                return;
            }

            Pc.OnHomePoint();

            if (p.GetType() == 1 && this.map.CattleyaMapID != 0)
            {
                float z;
                if (this.map.HasHeightMap())
                {
                    z = this.map.GetHeight(this.map.CattleyaX, this.map.CattleyaY);
                }
                else
                {
                    z = this.map.CattleyaZ;
                }
                this.map.SendActorToMap(this.Char, (byte)this.map.CattleyaMapID, this.map.CattleyaX, this.map.CattleyaY, z);
                SkillHandler.EquiptLoseDurabilityOnDeath(this.Char);
            }
            else
            {
                this.map.SendActorToMap(this.Char, this.Char.save_map, this.Char.save_x, this.Char.save_y, this.Char.save_z);
            }
        }