public void Reload(Mobile from, FukiyaDarts darts) { int need = (MaxUses - m_UsesRemaining); if (need <= 0) { // You cannot add anymore fukiya darts from.SendLocalizedMessage(1063330); } else if (darts.UsesRemaining > 0) { if (need > darts.UsesRemaining) { need = darts.UsesRemaining; } if (darts.Poison != null && darts.PoisonCharges > 0) { if (m_PoisonCharges <= 0 || m_Poison == null || m_Poison.Level <= darts.Poison.Level) { if (m_Poison != null && m_Poison.Level < darts.Poison.Level) { Unload(from); } if (need > darts.PoisonCharges) { need = darts.PoisonCharges; } if (m_Poison == null || m_PoisonCharges <= 0) { m_PoisonCharges = need; } else { m_PoisonCharges += need; } m_Poison = darts.Poison; darts.PoisonCharges -= need; if (darts.PoisonCharges <= 0) { darts.Poison = null; } } else { from.SendLocalizedMessage(1070767); // Loaded projectile is stronger, unload it first } } else { m_UsesRemaining += need; darts.UsesRemaining -= need; } if (darts.UsesRemaining <= 0) { darts.Delete(); } InvalidateProperties(); } }
public void Reload( Mobile from, FukiyaDarts darts ) { int need = ( MaxUses - m_UsesRemaining ); if ( need <= 0 ) { // You cannot add anymore fukiya darts from.SendLocalizedMessage( 1063330 ); } else if ( darts.UsesRemaining > 0 ) { bool canload = false; bool poison = false; if ( need > darts.UsesRemaining ) need = darts.UsesRemaining; if( darts.Poison != null && darts.PoisonCharges > 0 ) { poison = true; if( m_Poison == null || ( m_Poison.Level < darts.Poison.Level )) { Unload( from ); canload = true; } else if( m_Poison != null && ( m_Poison.Level == darts.Poison.Level )) { canload = true; } } else if( darts.Poison == null || darts.PoisonCharges <= 0 ) { if( m_Poison == null || m_PoisonCharges <= 0 ) { canload = true; } } if( !canload ) { from.SendLocalizedMessage( 1070767 ); // Loaded projectile is stronger, unload it first } else { if( poison ) { if ( need > darts.PoisonCharges ) { need = darts.PoisonCharges; } if ( m_Poison == null || m_PoisonCharges <= 0 ) { PoisonCharges = need; } else { PoisonCharges += need; } Poison = darts.Poison; darts.PoisonCharges -= need; if ( darts.PoisonCharges <= 0 ) { darts.Poison = null; } } UsesRemaining += need; darts.UsesRemaining -= need; } if ( darts.UsesRemaining <= 0 ) darts.Delete(); } }
public void Reload( Mobile from, FukiyaDarts darts ) { int need = ( MaxUses - m_UsesRemaining ); if ( need <= 0 ) { // You cannot add anymore fukiya darts from.SendLocalizedMessage( 1063330 ); } else if ( darts.UsesRemaining > 0 ) { if ( need > darts.UsesRemaining ) need = darts.UsesRemaining; if ( darts.Poison != null && darts.PoisonCharges > 0 ) { #region Mondain's Legacy mod if ( m_PoisonCharges <= 0 || m_Poison == null || m_Poison.RealLevel <= darts.Poison.RealLevel ) { if ( m_Poison != null && m_Poison.RealLevel < darts.Poison.RealLevel ) Unload( from ); if ( need > darts.PoisonCharges ) need = darts.PoisonCharges; if ( m_Poison == null || m_PoisonCharges <= 0 ) m_PoisonCharges = need; else m_PoisonCharges += need; m_Poison = darts.Poison; darts.PoisonCharges -= need; if ( darts.PoisonCharges <= 0 ) darts.Poison = null; m_UsesRemaining += need; darts.UsesRemaining -= need; } #endregion else { from.SendLocalizedMessage( 1070767 ); // Loaded projectile is stronger, unload it first } } else { m_UsesRemaining += need; darts.UsesRemaining -= need; } if ( darts.UsesRemaining <= 0 ) darts.Delete(); InvalidateProperties(); } }
public void Reload(Mobile from, FukiyaDarts darts) { int need = (MaxUses - m_UsesRemaining); if (need <= 0) { // You cannot add anymore fukiya darts from.SendLocalizedMessage(1063330); } else if (darts.UsesRemaining > 0) { bool canload = false; bool poison = false; if (need > darts.UsesRemaining) { need = darts.UsesRemaining; } if (darts.Poison != null && darts.PoisonCharges > 0) { poison = true; if (m_Poison == null || (m_Poison.Level < darts.Poison.Level)) { Unload(from); canload = true; } else if (m_Poison != null && (m_Poison.Level == darts.Poison.Level)) { canload = true; } } else if (darts.Poison == null || darts.PoisonCharges <= 0) { if (m_Poison == null || m_PoisonCharges <= 0) { canload = true; } } if (!canload) { from.SendLocalizedMessage(1070767); // Loaded projectile is stronger, unload it first } else { if (poison) { if (need > darts.PoisonCharges) { need = darts.PoisonCharges; } if (m_Poison == null || m_PoisonCharges <= 0) { PoisonCharges = need; } else { PoisonCharges += need; } Poison = darts.Poison; darts.PoisonCharges -= need; if (darts.PoisonCharges <= 0) { darts.Poison = null; } } UsesRemaining += need; darts.UsesRemaining -= need; } if (darts.UsesRemaining <= 0) { darts.Delete(); } } }