public override void OnResponse(NetState state, RelayInfo info) { Mobile from = state.Mobile; if (from == null || m_SoulStone.Deleted || !m_SoulStone.IsChildOf(from.Backpack)) { return; } if (info.ButtonID > 0) { m_Skill = from.Skills[(info.ButtonID - 1)]; if (m_Skill == null) { return; } int count = from.Skills.Total; int cap = from.SkillsCap; var decreased = new List <Skill>(); int freepool = cap - count; int decreaseamount = 0; int bonuscopy = Math.Min((int)(m_SoulStone.SkillValue * 10.0), m_Skill.CapFixedPoint - m_Skill.BaseFixedPoint); if ((count + bonuscopy) > cap) { foreach (Skill sk in from.Skills.Where(t => t.Lock == SkillLock.Down && t.Base > 0.0)) { //from.SendMessage("{0} has {1}", from.Skills[i].Name, from.Skills[i].Base ); decreased.Add(sk); decreaseamount += sk.BaseFixedPoint; } if (decreaseamount <= 0) { from.SendMessage("You have exceeded the skill cap and do not have enough skill set to be decreased."); return; } } if (/*(m_Skill.Base + bonuscopy) <= m_Skill.Cap*/ m_Skill.Base < m_Skill.Cap && m_Skill.Lock != SkillLock.Locked && m_Skill.Lock != SkillLock.Down) { if (freepool + decreaseamount >= bonuscopy) { m_Skill.BaseFixedPoint += bonuscopy; if (freepool < bonuscopy) { int decreasebonus = bonuscopy; decreasebonus -= freepool; foreach (Skill s in decreased) { if (decreasebonus > 0) { if (s.BaseFixedPoint >= bonuscopy) { s.BaseFixedPoint -= decreasebonus; decreasebonus = 0; } else { decreasebonus -= s.BaseFixedPoint; s.BaseFixedPoint = 0; } } } } m_SoulStone.SkillValue -= (bonuscopy / 10.0); if (m_SoulStone.SkillValue <= 0.0) { m_SoulStone.Delete(); from.SendMessage("Your soul stone has lost all of its charge."); } /* * if ( ( m_SoulStone.Charge -= m_SoulStone.SkillValue ) <= 0.09 ) * m_SoulStone.Delete(); * else * { * m_SoulStone.SkillValue = 0.0; * m_SoulStone.NextUse = DateTime.UtcNow + SoulStone.UseDelay; * } */ from.SendLocalizedMessage(1070713); // You have successfully absorbed the Soulstone's skill points. Effects.SendLocationParticles( EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0, 0, 0, 0, 0, 5060, 0); Effects.PlaySound(from.Location, from.Map, 0x243); Effects.SendMovingParticles( new Entity(Server.Serial.Zero, new Point3D(from.X - 6, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendTargetParticles(from, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100); } else { from.SendMessage("You must have enough skill set down to compensate for the skill gain."); } } else { from.SendMessage("You have to choose another skill."); } } }