/// <summary> /// Receive the fall from the client. /// Damage the client for an 8th of the units fallen? /// Send the client the result of the fall. /// </summary> public void OnSendFall(Packets.Client.SendFall p) { uint value = p.GetValue(); value /= 8; Actor pc = (Actor)this.Char; SagaMap.Map.SkillArgs args = new Map.SkillArgs(); Skills.SkillHandler.PhysicalAttack(ref pc, ref pc, value, SkillHandler.AttackElements.NEUTRAL, ref args); this.SendCharStatus(0); Packets.Server.TakeDamage p1 = new SagaMap.Packets.Server.TakeDamage(); if (this.Char.HP == 0) { p1.SetReason(SagaMap.Packets.Server.TakeDamage.REASON.FALLING_DEAD); } else if (this.Char.HP < (this.Char.maxHP / 10)) { p1.SetReason(SagaMap.Packets.Server.TakeDamage.REASON.FALLING_SURVIVE); } else { p1.SetReason(SagaMap.Packets.Server.TakeDamage.REASON.FALLING); } p1.SetDamage(value); this.netIO.SendPacket(p1, this.SessionID);; }
/// <summary> /// When oxygen runs out, damage the char for 10% of health per second. /// </summary> public void OxygenTakeDamage() { uint damage = (uint)(this.Char.maxHP / 10); Actor pc = (Actor)this.Char; SagaMap.Map.SkillArgs args = new Map.SkillArgs(); Skills.SkillHandler.PhysicalAttack(ref pc, ref pc, damage, SkillHandler.AttackElements.NEUTRAL, ref args); this.SendCharStatus(0); Packets.Server.TakeDamage p1 = new SagaMap.Packets.Server.TakeDamage(); if (this.Char.HP == 0) { p1.SetReason(SagaMap.Packets.Server.TakeDamage.REASON.OXYGEN_DEAD); } else { p1.SetReason(SagaMap.Packets.Server.TakeDamage.REASON.OXYGEN); } p1.SetDamage(damage); this.netIO.SendPacket(p1, this.SessionID);; }
/// <summary> /// When oxygen runs out, damage the char for 10% of health per second. /// </summary> public void OxygenTakeDamage() { uint damage = (uint)(this.Char.maxHP / 10); Actor pc = (Actor)this.Char; SagaMap.Map.SkillArgs args = new Map.SkillArgs(); Skills.SkillHandler.PhysicalAttack(ref pc, ref pc, damage, SkillHandler.AttackElements.NEUTRAL, ref args); this.SendCharStatus(0); Packets.Server.TakeDamage p1 = new SagaMap.Packets.Server.TakeDamage(); if (this.Char.HP == 0) p1.SetReason(SagaMap.Packets.Server.TakeDamage.REASON.OXYGEN_DEAD); else p1.SetReason(SagaMap.Packets.Server.TakeDamage.REASON.OXYGEN); p1.SetDamage(damage); this.netIO.SendPacket(p1, this.SessionID); ; }
/// <summary> /// Receive the fall from the client. /// Damage the client for an 8th of the units fallen? /// Send the client the result of the fall. /// </summary> public void OnSendFall(Packets.Client.SendFall p) { uint value = p.GetValue(); value /= 8; Actor pc = (Actor)this.Char; SagaMap.Map.SkillArgs args = new Map.SkillArgs(); Skills.SkillHandler.PhysicalAttack(ref pc, ref pc, value, SkillHandler.AttackElements.NEUTRAL, ref args); this.SendCharStatus(0); Packets.Server.TakeDamage p1 = new SagaMap.Packets.Server.TakeDamage(); if (this.Char.HP == 0) p1.SetReason(SagaMap.Packets.Server.TakeDamage.REASON.FALLING_DEAD); else if (this.Char.HP < (this.Char.maxHP / 10)) p1.SetReason(SagaMap.Packets.Server.TakeDamage.REASON.FALLING_SURVIVE); else p1.SetReason(SagaMap.Packets.Server.TakeDamage.REASON.FALLING); p1.SetDamage(value); this.netIO.SendPacket(p1, this.SessionID); ; }