//Advanced Pet System
public void DoDeathCheck()
{
Mobile cm = this.ControlMaster;
if ( cm != null && this.Controled == true && Tamable == true )
{
if ( this.IsBonded == true )
{
if ( this.AbilityPoints >= 0 && Utility.Random( 100 ) < 25 )
{
this.AbilityPoints = this.AbilityPoints / 2;
cm.SendMessage( 38, "Your pet has lost half of thier ability points due to its untimely death." );
}
else if ( this.Exp >= 0 && Utility.Random( 100 ) < 25 )
{
this.Exp = this.Exp / 2;
cm.SendMessage( 38, "Your pet has lost half of thier exp due to its untimely death." );
}
else if ( Utility.Random( 100 ) < 25 )
{
int strloss = this.Str / 20;
int dexloss = this.Dex / 20;
int intloss = this.Int / 20;
int hitsloss = this.Hits / 20;
int stamloss = this.Stam / 20;
int manaloss = this.Mana / 20;
int physloss = this.PhysicalResistance / 20;
int fireloss = this.FireResistance / 20;
int coldloss = this.ColdResistance / 20;
int energyloss = this.EnergyResistance / 20;
int poisonloss = this.PoisonResistance / 20;
int dminloss = this.DamageMin / 20;
int dmaxloss = this.DamageMax / 20;
this.Str -= strloss;
this.Dex -= dexloss;
this.Int -= intloss;
if ( this.HitsMaxSeed >= 0 )
this.HitsMaxSeed -= hitsloss;
if ( this.StamMaxSeed >= 0 )
this.StamMaxSeed -= stamloss;
if ( this.ManaMaxSeed >= 0 )
this.ManaMaxSeed -= manaloss;
if ( this.PhysicalResistanceSeed >= 0 )
this.PhysicalResistanceSeed -= physloss;
if ( this.FireResistSeed >= 0 )
this.FireResistSeed -= fireloss;
if ( this.ColdResistSeed >= 0 )
this.ColdResistSeed -= coldloss;
if ( this.EnergyResistSeed >= 0 )
this.EnergyResistSeed -= energyloss;
if ( this.PoisonResistSeed >= 0 )
this.PoisonResistSeed -= poisonloss;
this.DamageMin -= dminloss;
this.DamageMax -= dmaxloss;
cm.SendMessage( 38, "Your pet has suffered a 5% stat lose due to its untimely death." );
}
cm.SendMessage( 64, "Your pet has been killed!" );
}
else
{
cm.SendMessage( 64, "Your pet has been killed!" );
}
}
}
public void DoBioDeath()
{
Mobile cm = this.ControlMaster;
if ( cm != null && this.Controled == true && Tamable == true )
{
if ( this.IsBonded == true )
{
if ( Utility.Random( 100 ) < 25 )
{
int strloss = this.Str / 20;
int dexloss = this.Dex / 20;
int intloss = this.Int / 20;
int hitsloss = this.Hits / 20;
int stamloss = this.Stam / 20;
int manaloss = this.Mana / 20;
int physloss = this.PhysicalResistance / 20;
int fireloss = this.FireResistance / 20;
int coldloss = this.ColdResistance / 20;
int energyloss = this.EnergyResistance / 20;
int poisonloss = this.PoisonResistance / 20;
int dminloss = this.DamageMin / 20;
int dmaxloss = this.DamageMax / 20;
this.Str -= strloss;
this.Dex -= dexloss;
this.Int -= intloss;
if ( this.HitsMaxSeed >= 0 )
this.HitsMaxSeed -= hitsloss;
if ( this.StamMaxSeed >= 0 )
this.StamMaxSeed -= stamloss;
if ( this.ManaMaxSeed >= 0 )
this.ManaMaxSeed -= manaloss;
if ( this.PhysicalResistanceSeed >= 0 )
this.PhysicalResistanceSeed -= physloss;
if ( this.FireResistSeed >= 0 )
this.FireResistSeed -= fireloss;
if ( this.ColdResistSeed >= 0 )
this.ColdResistSeed -= coldloss;
if ( this.EnergyResistSeed >= 0 )
this.EnergyResistSeed -= energyloss;
if ( this.PoisonResistSeed >= 0 )
this.PoisonResistSeed -= poisonloss;
this.DamageMin -= dminloss;
this.DamageMax -= dmaxloss;
cm.SendMessage( 38, "Your pet has suffered a 5% stat lose due to its untimely death." );
}
cm.SendMessage( 64, "Your pet has been killed!" );
}
else
{
cm.SendMessage( 64, "Your pet has been killed!" );
}
}
}
public void CheckLevel( Mobile defender )
{
int expgainmin, expgainmax;
if ( this is BaseBioCreature )
{
}
else if ( defender is BaseCreature )
{
if ( this.Controled == true && this.ControlMaster != null && Summoned == false )
{
BaseCreature bc = (BaseCreature)defender;
expgainmin = 5 + ( bc.HitsMax ) / 10;
expgainmax = 5 + ( bc.HitsMax ) / 5;
if ( m_Level <= m_MaxLevel - 1 )
m_Exp += Utility.RandomList( expgainmin, expgainmax );
int nextLevel = m_NextLevel * m_Level;
if ( m_Exp >= nextLevel && m_Level <= m_MaxLevel - 1 )
{
Mobile cm = this.ControlMaster;
m_Level += 1;
m_Exp = 0;
this.FixedParticles( 0x373A, 10, 15, 5012, EffectLayer.Waist );
this.PlaySound( 503 );
cm.SendMessage( 38, "Your pets level has increased to {0}.", m_Level );
int gain = Utility.RandomList( 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 6 );
int random = Utility.Random( 100 );
if ( random < 2 )
gain = gain * 10;
else if ( random < 4 )
gain = gain * 5;
else if ( random < 6 )
gain = gain * 4;
else if ( random < 8 )
gain = gain * 3;
else if ( random < 10 )
gain = gain * 2;
else
gain = gain;
this.AbilityPoints += gain;
if ( this.ControlMaster != null )
{
this.ControlMaster.SendMessage( 38, "Your pet {0} has gained some ability points, Goto your pets 'NPC Info' and click the red diamond to apply these points." );
//this.ControlMaster.CloseGump( typeof( LevelGump ) );
//this.ControlMaster.CloseGump( typeof( PetLevelGump ) );
//this.ControlMaster.SendGump( new LevelGump( this ) );
}
if ( m_Level == 9 )
{
m_AllowMating = true;
cm.SendMessage( 1161, "Your pet is now at the level to mate." );
}
if ( m_Evolves == true )
{
if ( UsesForm1 == true && F0 == true )
{
this.BodyValue = m_Form1;
this.BaseSoundID = m_Sound1;
m_F1 = true;
m_F2 = false;
m_F3 = false;
m_F4 = false;
m_F5 = false;
m_F6 = false;
m_F7 = false;
m_F8 = false;
m_F9 = false;
UsesForm1 = false;
cm.SendMessage( 64, "Your pet has evoloved." );
}
else if ( UsesForm2 == true && F1 == true )
{
this.BodyValue = m_Form2;
this.BaseSoundID = m_Sound2;
m_F1 = false;
m_F2 = true;
m_F3 = false;
m_F4 = false;
m_F5 = false;
m_F6 = false;
m_F7 = false;
m_F8 = false;
m_F9 = false;
UsesForm2 = false;
cm.SendMessage( 64, "Your pet has evoloved." );
}
else if ( UsesForm3 == true && F2 == true )
{
this.BodyValue = m_Form3;
this.BaseSoundID = m_Sound3;
m_F1 = false;
m_F2 = false;
m_F3 = true;
m_F4 = false;
m_F5 = false;
m_F6 = false;
m_F7 = false;
m_F8 = false;
m_F9 = false;
UsesForm3 = false;
cm.SendMessage( 64, "Your pet has evoloved." );
}
else if ( UsesForm4 == true && F3 == true )
{
this.BodyValue = m_Form4;
this.BaseSoundID = m_Sound4;
m_F1 = false;
m_F2 = false;
m_F3 = false;
m_F4 = true;
m_F5 = false;
m_F6 = false;
m_F7 = false;
m_F8 = false;
m_F9 = false;
UsesForm4 = false;
cm.SendMessage( 64, "Your pet has evoloved." );
}
else if ( UsesForm5 == true && F4 == true )
{
this.BodyValue = m_Form5;
this.BaseSoundID = m_Sound5;
m_F1 = false;
m_F2 = false;
m_F3 = false;
m_F4 = false;
m_F5 = true;
m_F6 = false;
m_F7 = false;
m_F8 = false;
m_F9 = false;
UsesForm5 = false;
cm.SendMessage( 64, "Your pet has evoloved." );
}
else if ( UsesForm6 == true && F5 == true )
{
this.BodyValue = m_Form6;
this.BaseSoundID = m_Sound6;
m_F1 = false;
m_F2 = false;
m_F3 = false;
m_F4 = false;
m_F5 = false;
m_F6 = true;
m_F7 = false;
m_F8 = false;
m_F9 = false;
UsesForm6 = false;
cm.SendMessage( 64, "Your pet has evoloved." );
}
else if ( UsesForm7 == true && F6 == true )
{
this.BodyValue = m_Form7;
this.BaseSoundID = m_Sound7;
m_F1 = false;
m_F2 = false;
m_F3 = false;
m_F4 = false;
m_F5 = false;
m_F6 = false;
m_F7 = true;
m_F8 = false;
m_F9 = false;
UsesForm7 = false;
cm.SendMessage( 64, "Your pet has evoloved." );
}
else if ( UsesForm8 == true && F7 == true )
{
this.BodyValue = m_Form8;
this.BaseSoundID = m_Sound8;
m_F1 = false;
m_F2 = false;
m_F3 = false;
m_F4 = false;
m_F5 = false;
m_F6 = false;
m_F7 = false;
m_F8 = true;
m_F9 = false;
UsesForm8 = false;
cm.SendMessage( 64, "Your pet has evoloved." );
}
else if ( UsesForm9 == true && F8 == true )
{
this.BodyValue = m_Form9;
this.BaseSoundID = m_Sound9;
m_F1 = false;
m_F2 = false;
m_F3 = false;
m_F4 = false;
m_F5 = false;
m_F6 = false;
m_F7 = false;
m_F8 = false;
m_F9 = true;
UsesForm9 = false;
cm.SendMessage( 64, "Your pet has evoloved." );
}
}
}
}
}
}
//End Advanced Pet System