using System;
using Server.Mobiles;
using Server.Targeting;
namespace Server.Items
{
public class PetBondingPotion : Item
{
public override int LabelNumber { get { return 1152921; } } // Pet Bonding Potion
[Constructable]
public PetBondingPotion() : base(0x0F04)
{
Weight = 1.0;
LootType = LootType.Blessed;
Hue = 2629;
}
public override void OnDoubleClick(Mobile from) // Override double click of the deed to call our target
{
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
else
{
from.SendLocalizedMessage(1152922); // Target the pet you wish to bond with. Press ESC to cancel. This item is consumed on successful use, so choose wisely!
from.Target = new BondingTarget(this);
}
}
public PetBondingPotion(Serial serial) : base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
public class BondingTarget : Target
{
private PetBondingPotion m_Potion;
public BondingTarget(PetBondingPotion potion) : base(1, false, TargetFlags.None)
{
m_Potion = potion;
}
protected override void OnTarget(Mobile from, object target)
{
if (m_Potion == null || m_Potion.Deleted || !m_Potion.IsChildOf(from.Backpack))
return;
if (target is BaseCreature)
{
BaseCreature t = (BaseCreature)target;
if (t.IsBonded == true)
{
from.SendLocalizedMessage(1152925); // That pet is already bonded to you.
}
else if (t.ControlMaster != from)
{
from.SendLocalizedMessage(1114368); // This is not your pet!
}
else
{
t.IsBonded = !t.IsBonded;
from.SendLocalizedMessage(1049666); // Your pet has bonded with you!
m_Potion.Delete();
}
}
else
{
from.SendLocalizedMessage(1152924); // That is not a valid pet.
}
}
}
}
using System;
// These two preprocessor directives will most likely be needed.
// We know this because the item we copied had the same requirements...
using Server.Mobiles;
using Server.Targeting;
// ONE //
// Your script has to reside in an appropriate namespace
namespace Server.Items
{
// TWO //
// It needs to have a unique name...
public class PetBoostingDeed : Item
{
[Constructable]
public PetBoostingDeed()
// THREE //
: base(0x0F04) // This number needs to match the graphic you want the deed to look like
{
Weight = 1.0;
LootType = LootType.Blessed;
Hue = 2629;
// FOUR //
Name = "Pet Boosting Deed"; // Here you name the deed since there is no appropriate LabelNumber that would give us the name we need.
}
// FIVE //
// This method is required by the Server...
public PetBoostingDeed(Serial serial) : base(serial)
{
}
// SIX //
// These two methods are needed for EVERY item, to preserve World Save and Load stability...
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
using System;
// These two preprocessor directives will most likely be needed.
// We know this because the item we copied had the same requirements...
using Server.Mobiles;
using Server.Targeting;
// Your script has to reside in an appropriate namespace
namespace Server.Items
{
// It needs to have a unique name...
public class PetBoostingDeed : Item
{
[Constructable]
public PetBoostingDeed()
: base(0x0F04) // This number needs to match the graphic you want the deed to look like
{
Weight = 1.0;
LootType = LootType.Blessed;
Hue = 2629;
Name = "Pet Boosting Deed"; // Here you name the deed since there is no appropriate LabelNumber that would give us the name we need.
}
// This method is required by the Server...
public PetBoostingDeed(Serial serial) : base(serial)
{
}
// ########## //
// We add this method so that the deed does what we want it to do when they use it...
public override void OnDoubleClick(Mobile from) // Override double click of the deed to call our target
{
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
else
{
// We have to customize this message, since the Localization does not contain the text we need...
from.SendMessage("Target the pet you wish to boost.");
from.Target = new BoostingTarget(this);
}
}
// These two methods are needed for EVERY item, to preserve World Save and Load stability...
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
using System;
// These two preprocessor directives will most likely be needed.
// We know this because the item we copied had the same requirements...
using Server.Mobiles;
using Server.Targeting;
// Your script has to reside in an appropriate namespace
namespace Server.Items
{
// It needs to have a unique name...
public class PetBoostingDeed : Item
{
[Constructable]
public PetBoostingDeed()
: base(0x0F04) // This number needs to match the graphic you want the deed to look like
{
Weight = 1.0;
LootType = LootType.Blessed;
Hue = 2629;
Name = "Pet Boosting Deed"; // Here you name the deed since there is no appropriate LabelNumber that would give us the name we need.
}
// This method is required by the Server...
public PetBoostingDeed(Serial serial) : base(serial)
{
}
// We add this method so that the deed does what we want it to do when they use it...
public override void OnDoubleClick(Mobile from) // Override double click of the deed to call our target
{
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
else
{
// We have to customize this message, since the Localization does not contain the text we need...
from.SendMessage("Target the pet you wish to boost.");
from.Target = new BoostingTarget(this);
}
}
// These two methods are needed for EVERY item, to preserve World Save and Load stability...
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
// ########## //
public class BoostingTarget : Target
{
private PetBoostingDeed m_Deed;
public BoostingTarget(PetBoostingDeed deed) : base(1, false, TargetFlags.None)
{
m_Deed = deed;
}
protected override void OnTarget(Mobile from, object target)
{
if (m_Deed == null || m_Deed.Deleted || !m_Deed.IsChildOf(from.Backpack))
return;
if (target is BaseCreature)
{
BaseCreature t = (BaseCreature)target;
if (t.ControlMaster != from)
{
from.SendLocalizedMessage(1114368); // This is not your pet!
}
else
{
// This is probably the hardest part. You need to create the method here that will do the effect you need...
DoTheBoostingThing(t, from, m_Deed);
}
}
else
{
from.SendLocalizedMessage(1152924); // That is not a valid pet.
}
}
}
}
DoTheBoostingThing(BaseCreature pet, Mobile from, PetBoostingDeed deed)
{
// Etc. etc.
}
using System.Collections;
using System.Collections.Generic;
using Server;
using System;
using Server.Mobiles;
namespace Custom.Jerbal.Jako
{
#region Enums
[Flags]
public enum JakoAttributesEnum
{
None = 0x00000000,
Hits = 0x00000001,
Stam = 0x00000002,
Mana = 0x00000004,
BonusPhysResist = 0x00000008,
BonusFireResist = 0x00000010,
BonusColdResist = 0x00000020,
BonusEnerResist = 0x00000040,
BonusPoisResist = 0x00000080
}
#endregion
public class JakoAttributes
{
private Hashtable m_attributes = new Hashtable();
public JakoAttributes()
{
m_attributes.Add(JakoAttributesEnum.Hits, new JakoHitsAttribute());
m_attributes.Add(JakoAttributesEnum.Stam, new JakoStamAttribute());
m_attributes.Add(JakoAttributesEnum.Mana, new JakoManaAttribute());
m_attributes.Add(JakoAttributesEnum.BonusPhysResist, new JakoRPhyAttribute());
m_attributes.Add(JakoAttributesEnum.BonusFireResist, new JakoRFirAttribute());
m_attributes.Add(JakoAttributesEnum.BonusColdResist, new JakoRColAttribute());
m_attributes.Add(JakoAttributesEnum.BonusEnerResist, new JakoREneAttribute());
m_attributes.Add(JakoAttributesEnum.BonusPoisResist, new JakoRPoiAttribute());
}
public JakoBaseAttribute GetAttribute(JakoAttributesEnum value)
{
if (m_attributes.ContainsKey(value))
return (JakoBaseAttribute)m_attributes[value];
return null;
}
[CommandProperty(AccessLevel.GameMaster)]
public virtual JakoBaseAttribute Hits
{
get
{
return GetAttribute(JakoAttributesEnum.Hits);
}
}
[CommandProperty(AccessLevel.GameMaster)]
public virtual JakoBaseAttribute Stam
{
get
{
return GetAttribute(JakoAttributesEnum.Stam);
}
}
[CommandProperty(AccessLevel.GameMaster)]
public virtual JakoBaseAttribute Mana
{
get
{
return GetAttribute(JakoAttributesEnum.Mana);
}
}
[CommandProperty(AccessLevel.GameMaster)]
public virtual JakoBaseAttribute PhysicalResist
{
get
{
return GetAttribute(JakoAttributesEnum.BonusPhysResist);
}
}
[CommandProperty(AccessLevel.GameMaster)]
public virtual JakoBaseAttribute FireResist
{
get
{
return GetAttribute(JakoAttributesEnum.BonusFireResist);
}
}
[CommandProperty(AccessLevel.GameMaster)]
public virtual JakoBaseAttribute ColdResist
{
get
{
return GetAttribute(JakoAttributesEnum.BonusColdResist);
}
}
[CommandProperty(AccessLevel.GameMaster)]
public virtual JakoBaseAttribute EnergyResist
{
get
{
return GetAttribute(JakoAttributesEnum.BonusEnerResist);
}
}
[CommandProperty(AccessLevel.GameMaster)]
public virtual JakoBaseAttribute PoisonResist
{
get
{
return GetAttribute(JakoAttributesEnum.BonusPoisResist);
}
}
/// <summary>
/// Increase the given attribute byThis.</summary>
/// <paramref name="att"/> Attribute by JakoAtributesEnum.</param>
/// <param name="bc"/> The Creature we are increasing the stats for.</param>
/// <param name="byThis"/> The int amount of the increase/decrease.</param>
public void IncBonus(JakoAttributesEnum att, BaseCreature bc, int byThis)
{
GetAttribute(att).IncBonus(bc, (uint)byThis);
}
/// <summary>
/// Sets the specified Bonus and the mobile's attribute accordingly.</summary>
/// <paramref name="att"/> Attribute by JakoAttributes.</param>
/// <param name="bc"/> The Creature we are increasing the stats for.</param>
/// <paramref name="value"/> How much to increase or decrease the current attribute by.</param>
public void SetBonus(JakoAttributesEnum att, BaseCreature bc, int value)
{
GetAttribute(att).SetBonus(bc, (uint)value);
}
#region Serial Functions/Flags
private static void SetSaveFlag(ref JakoAttributesEnum flags, JakoAttributesEnum toSet, bool setIf)
{
if (setIf)
flags |= toSet;
}
private static bool GetSaveFlag(JakoAttributesEnum flags, JakoAttributesEnum toGet)
{
return ((flags & toGet) != 0);
}
public virtual void Serialize(GenericWriter writer)
{
writer.Write(1);//Version
JakoAttributesEnum flags = JakoAttributesEnum.None;
SetSaveFlag(ref flags, JakoAttributesEnum.Hits, GetAttribute(JakoAttributesEnum.Hits).IncreasedBy != 0);
SetSaveFlag(ref flags, JakoAttributesEnum.Stam, GetAttribute(JakoAttributesEnum.Stam).IncreasedBy != 0);
SetSaveFlag(ref flags, JakoAttributesEnum.Mana, GetAttribute(JakoAttributesEnum.Mana).IncreasedBy != 0);
SetSaveFlag(ref flags, JakoAttributesEnum.BonusPhysResist, GetAttribute(JakoAttributesEnum.BonusPhysResist).IncreasedBy != 0);
SetSaveFlag(ref flags, JakoAttributesEnum.BonusFireResist, GetAttribute(JakoAttributesEnum.BonusFireResist).IncreasedBy != 0);
SetSaveFlag(ref flags, JakoAttributesEnum.BonusColdResist, GetAttribute(JakoAttributesEnum.BonusColdResist).IncreasedBy != 0);
SetSaveFlag(ref flags, JakoAttributesEnum.BonusEnerResist, GetAttribute(JakoAttributesEnum.BonusEnerResist).IncreasedBy != 0);
SetSaveFlag(ref flags, JakoAttributesEnum.BonusPoisResist, GetAttribute(JakoAttributesEnum.BonusPoisResist).IncreasedBy != 0);
writer.WriteEncodedInt((int)flags);
if (GetSaveFlag(flags, JakoAttributesEnum.Hits))
GetAttribute(JakoAttributesEnum.Hits).Serialize(writer);
if (GetSaveFlag(flags, JakoAttributesEnum.Stam))
GetAttribute(JakoAttributesEnum.Stam).Serialize(writer);
if (GetSaveFlag(flags, JakoAttributesEnum.Mana))
GetAttribute(JakoAttributesEnum.Mana).Serialize(writer);
if (GetSaveFlag(flags, JakoAttributesEnum.BonusPhysResist))
GetAttribute(JakoAttributesEnum.BonusPhysResist).Serialize(writer);
if (GetSaveFlag(flags, JakoAttributesEnum.BonusFireResist))
GetAttribute(JakoAttributesEnum.BonusFireResist).Serialize(writer);
if (GetSaveFlag(flags, JakoAttributesEnum.BonusColdResist))
GetAttribute(JakoAttributesEnum.BonusColdResist).Serialize(writer);
if (GetSaveFlag(flags, JakoAttributesEnum.BonusEnerResist))
GetAttribute(JakoAttributesEnum.BonusEnerResist).Serialize(writer);
if (GetSaveFlag(flags, JakoAttributesEnum.BonusPoisResist))
GetAttribute(JakoAttributesEnum.BonusPoisResist).Serialize(writer);
}
public virtual void Deserialize(GenericReader reader)
{
int version = reader.ReadInt();
switch (version)
{
case 1:
{
JakoAttributesEnum flags = (JakoAttributesEnum)reader.ReadEncodedInt();
if (GetSaveFlag(flags, JakoAttributesEnum.Hits))
GetAttribute(JakoAttributesEnum.Hits).Deserialize(reader);
if (GetSaveFlag(flags, JakoAttributesEnum.Stam))
GetAttribute(JakoAttributesEnum.Stam).Deserialize(reader);
if (GetSaveFlag(flags, JakoAttributesEnum.Mana))
GetAttribute(JakoAttributesEnum.Mana).Deserialize(reader);
if (GetSaveFlag(flags, JakoAttributesEnum.BonusPhysResist))
GetAttribute(JakoAttributesEnum.BonusPhysResist).Deserialize(reader);
if (GetSaveFlag(flags, JakoAttributesEnum.BonusFireResist))
GetAttribute(JakoAttributesEnum.BonusFireResist).Deserialize(reader);
if (GetSaveFlag(flags, JakoAttributesEnum.BonusColdResist))
GetAttribute(JakoAttributesEnum.BonusColdResist).Deserialize(reader);
if (GetSaveFlag(flags, JakoAttributesEnum.BonusEnerResist))
GetAttribute(JakoAttributesEnum.BonusEnerResist).Deserialize(reader);
if (GetSaveFlag(flags, JakoAttributesEnum.BonusPoisResist))
GetAttribute(JakoAttributesEnum.BonusPoisResist).Deserialize(reader);
break;
}
}
}
#endregion
public override string ToString()
{
return "...";
}
}
}
using System;
using Server;
using Server.Mobiles;
namespace Server
{
public class PetLeveling
{
public static void DoDeathCheck( BaseCreature from )
{
Mobile cm = from.ControlMaster;
if ( cm != null && from.Controlled == true && from.Tamable == true )
{
if ( from.IsBonded == true )
{
if ( Utility.Random( 100 ) < 5 )
{
int strloss = from.Str / 20;
int dexloss = from.Dex / 20;
int intloss = from.Int / 20;
int hitsloss = from.Hits / 20;
int stamloss = from.Stam / 20;
int manaloss = from.Mana / 20;
int physloss = from.PhysicalResistance / 20;
int fireloss = from.FireResistance / 20;
int coldloss = from.ColdResistance / 20;
int energyloss = from.EnergyResistance / 20;
int poisonloss = from.PoisonResistance / 20;
int dminloss = from.DamageMin / 20;
int dmaxloss = from.DamageMax / 20;
if ( from.Str > strloss )
from.Str -= strloss;
if ( from.Str > dexloss )
from.Dex -= dexloss;
if ( from.Str > intloss )
from.Int -= intloss;
if ( from.HitsMaxSeed > hitsloss )
from.HitsMaxSeed -= hitsloss;
if ( from.StamMaxSeed > stamloss )
from.StamMaxSeed -= stamloss;
if ( from.ManaMaxSeed > manaloss )
from.ManaMaxSeed -= manaloss;
if ( from.PhysicalResistanceSeed > physloss )
from.PhysicalResistanceSeed -= physloss;
if ( from.FireResistSeed > fireloss )
from.FireResistSeed -= fireloss;
if ( from.ColdResistSeed > coldloss )
from.ColdResistSeed -= coldloss;
if ( from.EnergyResistSeed > energyloss )
from.EnergyResistSeed -= energyloss;
if ( from.PoisonResistSeed > poisonloss )
from.PoisonResistSeed -= poisonloss;
if ( from.DamageMin > dminloss )
from.DamageMin -= dminloss;
if ( from.DamageMax > dmaxloss )
from.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 static void DoBioDeath( BaseCreature from )
{
Mobile cm = from.ControlMaster;
if ( cm != null && from.Controlled == true && from.Tamable == true )
{
if ( from.IsBonded == true )
{
if ( Utility.Random( 100 ) < 25 )
{
int strloss = from.Str / 20;
int dexloss = from.Dex / 20;
int intloss = from.Int / 20;
int hitsloss = from.Hits / 20;
int stamloss = from.Stam / 20;
int manaloss = from.Mana / 20;
int physloss = from.PhysicalResistance / 20;
int fireloss = from.FireResistance / 20;
int coldloss = from.ColdResistance / 20;
int energyloss = from.EnergyResistance / 20;
int poisonloss = from.PoisonResistance / 20;
int dminloss = from.DamageMin / 20;
int dmaxloss = from.DamageMax / 20;
if ( from.Str > strloss )
from.Str -= strloss;
if ( from.Str > dexloss )
from.Dex -= dexloss;
if ( from.Str > intloss )
from.Int -= intloss;
if ( from.HitsMaxSeed > hitsloss )
from.HitsMaxSeed -= hitsloss;
if ( from.StamMaxSeed > stamloss )
from.StamMaxSeed -= stamloss;
if ( from.ManaMaxSeed > manaloss )
from.ManaMaxSeed -= manaloss;
if ( from.PhysicalResistanceSeed > physloss )
from.PhysicalResistanceSeed -= physloss;
if ( from.FireResistSeed > fireloss )
from.FireResistSeed -= fireloss;
if ( from.ColdResistSeed > coldloss )
from.ColdResistSeed -= coldloss;
if ( from.EnergyResistSeed > energyloss )
from.EnergyResistSeed -= energyloss;
if ( from.PoisonResistSeed > poisonloss )
from.PoisonResistSeed -= poisonloss;
if ( from.DamageMin > dminloss )
from.DamageMin -= dminloss;
if ( from.DamageMax > dmaxloss )
from.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 static void DoEvoCheck( BaseCreature attacker )
{
if ( attacker.Str >= 20 )
attacker.Str += attacker.Str / 20;
else
attacker.Str += 1;
if ( attacker.Dex >= 20 )
attacker.Dex += attacker.Dex / 20;
else
attacker.Dex += 1;
if ( attacker.Int >= 20 )
attacker.Int += attacker.Int / 20;
else
attacker.Int += 1;
}
public static void DoLevelBonus( BaseCreature attacker )
{
int chance = Utility.Random( 100 );
if ( chance < 35 )
{
attacker.Str += Utility.RandomMinMax( 1, 3 );
attacker.Dex += Utility.RandomMinMax( 1, 3 );
attacker.Int += Utility.RandomMinMax( 1, 3 );
}
}
public static void CheckLevel( Mobile defender, BaseCreature attacker, int count )
{
bool nolevel = false;
Type typ = attacker.GetType();
string nam = attacker.Name;
foreach ( string check in FSATS.NoLevelCreatures )
{
if ( check == nam )
nolevel = true;
}
if ( nolevel != false )
return;
int expgainmin, expgainmax;
if ( defender is BaseCreature )
{
if ( attacker.Controlled == true && attacker.ControlMaster != null && attacker.Summoned == false )
{
BaseCreature bc = (BaseCreature)defender;
expgainmin = bc.HitsMax * 6; //25
expgainmax = bc.HitsMax * 17; // 50
int xpgain = Utility.RandomMinMax( expgainmin, expgainmax );
if ( count > 1 )
xpgain = xpgain / count;
if ( attacker.Level <= attacker.MaxLevel - 1 )
{
attacker.Exp += xpgain;
attacker.ControlMaster.SendMessage( "Your pet has gained {0} experience points.", xpgain );
}
int nextLevel = attacker.NextLevel * attacker.Level;
if ( attacker.Exp >= nextLevel && attacker.Level <= attacker.MaxLevel - 1 )
{
DoLevelBonus( attacker );
Mobile cm = attacker.ControlMaster;
attacker.Level += 1;
attacker.Exp = 0;
attacker.FixedParticles( 0x373A, 10, 15, 5012, EffectLayer.Waist );
attacker.PlaySound( 503 );
cm.SendMessage( 38, "Your pets level has increased to {0}.", attacker.Level );
int gain = Utility.RandomMinMax( 10, 50 );
attacker.AbilityPoints += gain;
if ( attacker.ControlMaster != null )
{
attacker.ControlMaster.SendMessage( 38, "Your pet {0} has gained some ability points.", gain );
}
if ( attacker.Level == 9 )
{
attacker.AllowMating = true;
cm.SendMessage( 1161, "Your pet is now at the level to mate." );
}
if ( attacker.Evolves == true )
{
if ( attacker.UsesForm1 == true && attacker.F0 == true )
{
DoEvoCheck( attacker );
attacker.BodyValue = attacker.Form1;
attacker.BaseSoundID = attacker.Sound1;
attacker.F1 = true;
attacker.F2 = false;
attacker.F3 = false;
attacker.F4 = false;
attacker.F5 = false;
attacker.F6 = false;
attacker.F7 = false;
attacker.F8 = false;
attacker.F9 = false;
attacker.UsesForm1 = false;
cm.SendMessage( 64, "Your pet has evoloved." );
}
else if ( attacker.UsesForm2 == true && attacker.F1 == true )
{
DoEvoCheck( attacker );
attacker.BodyValue = attacker.Form2;
attacker.BaseSoundID = attacker.Sound2;
attacker.F1 = false;
attacker.F2 = true;
attacker.F3 = false;
attacker.F4 = false;
attacker.F5 = false;
attacker.F6 = false;
attacker.F7 = false;
attacker.F8 = false;
attacker.F9 = false;
attacker.UsesForm2 = false;
cm.SendMessage( 64, "Your pet has evoloved." );
}
else if ( attacker.UsesForm3 == true && attacker.F2 == true )
{
DoEvoCheck( attacker );
attacker.BodyValue = attacker.Form3;
attacker.BaseSoundID = attacker.Sound3;
attacker.F1 = false;
attacker.F2 = false;
attacker.F3 = true;
attacker.F4 = false;
attacker.F5 = false;
attacker.F6 = false;
attacker.F7 = false;
attacker.F8 = false;
attacker.F9 = false;
attacker.UsesForm3 = false;
cm.SendMessage( 64, "Your pet has evoloved." );
}
else if ( attacker.UsesForm4 == true && attacker.F3 == true )
{
DoEvoCheck( attacker );
attacker.BodyValue = attacker.Form4;
attacker.BaseSoundID = attacker.Sound4;
attacker.F1 = false;
attacker.F2 = false;
attacker.F3 = false;
attacker.F4 = true;
attacker.F5 = false;
attacker.F6 = false;
attacker.F7 = false;
attacker.F8 = false;
attacker.F9 = false;
attacker.UsesForm4 = false;
cm.SendMessage( 64, "Your pet has evoloved." );
}
else if ( attacker.UsesForm5 == true && attacker.F4 == true )
{
DoEvoCheck( attacker );
attacker.BodyValue = attacker.Form5;
attacker.BaseSoundID = attacker.Sound5;
attacker.F1 = false;
attacker.F2 = false;
attacker.F3 = false;
attacker.F4 = false;
attacker.F5 = true;
attacker.F6 = false;
attacker.F7 = false;
attacker.F8 = false;
attacker.F9 = false;
attacker.UsesForm5 = false;
cm.SendMessage( 64, "Your pet has evoloved." );
}
else if ( attacker.UsesForm6 == true && attacker.F5 == true )
{
DoEvoCheck( attacker );
attacker.BodyValue = attacker.Form6;
attacker.BaseSoundID = attacker.Sound6;
attacker.F1 = false;
attacker.F2 = false;
attacker.F3 = false;
attacker.F4 = false;
attacker.F5 = false;
attacker.F6 = true;
attacker.F7 = false;
attacker.F8 = false;
attacker.F9 = false;
attacker.UsesForm6 = false;
cm.SendMessage( 64, "Your pet has evoloved." );
}
else if ( attacker.UsesForm7 == true && attacker.F6 == true )
{
DoEvoCheck( attacker );
attacker.BodyValue = attacker.Form7;
attacker.BaseSoundID = attacker.Sound7;
attacker.F1 = false;
attacker.F2 = false;
attacker.F3 = false;
attacker.F4 = false;
attacker.F5 = false;
attacker.F6 = false;
attacker.F7 = true;
attacker.F8 = false;
attacker.F9 = false;
attacker.UsesForm7 = false;
cm.SendMessage( 64, "Your pet has evoloved." );
}
else if ( attacker.UsesForm8 == true && attacker.F7 == true )
{
DoEvoCheck( attacker );
attacker.BodyValue = attacker.Form8;
attacker.BaseSoundID = attacker.Sound8;
attacker.F1 = false;
attacker.F2 = false;
attacker.F3 = false;
attacker.F4 = false;
attacker.F5 = false;
attacker.F6 = false;
attacker.F7 = false;
attacker.F8 = true;
attacker.F9 = false;
attacker.UsesForm8 = false;
cm.SendMessage( 64, "Your pet has evoloved." );
}
else if ( attacker.UsesForm9 == true && attacker.F8 == true )
{
DoEvoCheck( attacker );
attacker.BodyValue = attacker.Form9;
attacker.BaseSoundID = attacker.Sound9;
attacker.F1 = false;
attacker.F2 = false;
attacker.F3 = false;
attacker.F4 = false;
attacker.F5 = false;
attacker.F6 = false;
attacker.F7 = false;
attacker.F8 = false;
attacker.F9 = true;
attacker.UsesForm9 = false;
cm.SendMessage( 64, "Your pet has evoloved." );
}
}
}
}
}
}
}
}
using System;
using Server.Mobiles;
using Server.Targeting;
namespace Server.Items
{
public class PetPhysicalResistanceBonusPotion : Item
{
public override int LabelNumber { get { return 1152921; } } // Pet Bonding Potion
[Constructable]
public PetPhysicalResistanceBonusPotion() : base(0x0F04)
{
Weight = 1.0;
LootType = LootType.Blessed;
Hue = 2629;
}
public override void OnDoubleClick(Mobile from) // Override double click of the deed to call our target
{
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
else
{
from.SendLocalizedMessage(1152922); // Target the pet you wish to bond with. Press ESC to cancel. This item is consumed on successful use, so choose wisely!
from.Target = new PhysicalResistanceSeed(this);
}
}
public PetPhysicalResistanceBonusPotion(Serial serial) : base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
public class PhysicalResistanceSeed : Target
{
private PetPhysicalResistanceBonusPotion m_Potion;
public PhysicalResistanceSeed(PetPhysicalResistanceBonusPotion potion) : base(1, false, TargetFlags.None)
{
m_Potion = potion;
}
protected override void OnTarget(Mobile from, object target)
{
if (m_Potion == null || m_Potion.Deleted || !m_Potion.IsChildOf(from.Backpack))
return;
if (target is BaseCreature)
{
BaseCreature t = (BaseCreature)target;
if (t.IsBonded == true)
{
from.SendLocalizedMessage(1152925); // That pet is already bonded to you.
}
else if (t.ControlMaster != from)
{
from.SendLocalizedMessage(1114368); // This is not your pet!
}
else
{
t.IsBonded = !t.IsBonded;
from.SendLocalizedMessage(1049666); // Your pet has bonded with you!
m_Potion.Delete();
}
}
else
{
from.SendLocalizedMessage(1152924); // That is not a valid pet.
}
}
}
}
protected override void OnTarget(Mobile from, object target)
{
if (m_Potion == null || m_Potion.Deleted || !m_Potion.IsChildOf(from.Backpack))
return;
if (target is BaseCreature)
{
BaseCreature t = (BaseCreature)target;
if (t.IsBonded == true)
{
from.SendLocalizedMessage(1152925); // That pet is already bonded to you.
}
else if (t.ControlMaster != from)
{
from.SendLocalizedMessage(1114368); // This is not your pet!
}
else
{
t.IsBonded = !t.IsBonded;
from.SendLocalizedMessage(1049666); // Your pet has bonded with you!
m_Potion.Delete();
}
}
else
{
from.SendLocalizedMessage(1152924); // That is not a valid pet.
}
}
using System;
using Server.Mobiles;
using Server.Targeting;
namespace Server.Items
{
public class PetPhysicalResistanceBonusPotion : Item
{
public override int LabelNumber { get { return 1152921; } } // Pet Bonding Potion
[Constructable]
public PetPhysicalResistanceBonusPotion() : base(0x0F04)
{
Weight = 1.0;
LootType = LootType.Blessed;
Hue = 2629;
}
public override void OnDoubleClick(Mobile from) // Override double click of the deed to call our target
{
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
else
{
from.SendLocalizedMessage(1152922); // Target the pet you wish to bond with. Press ESC to cancel. This item is consumed on successful use, so choose wisely!
from.Target = new PhysicalResistanceSeed(this);
}
}
public PetPhysicalResistanceBonusPotion(Serial serial) : base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
public class PhysicalResistanceSeed : Target
{
private PetPhysicalResistanceBonusPotion m_Potion;
public PhysicalResistanceSeed(PetPhysicalResistanceBonusPotion potion) : base(1, false, TargetFlags.None)
{
m_Potion = potion;
}
protected override void OnTarget(Mobile from, object target)
{
if (m_Potion == null || m_Potion.Deleted || !m_Potion.IsChildOf(from.Backpack))
return;
if (target is BaseCreature)
{
BaseCreature t = (BaseCreature)target;
if (t.PhysicalResistanceSeed == true)
{
from.SendLocalizedMessage(1152925); // That pet is already bonded to you.
}
else if (t.ControlMaster != from)
{
from.SendLocalizedMessage(1114368); // This is not your pet!
}
else
{
t.IsBonded = !t.IsBonded;
from.SendLocalizedMessage(1049666); // Your pet has bonded with you!
t.PhysicalResistanceSeed += 1;
from.SendMessage("You have reinforced your pet by 1 point of physical resistance. Total: [{0}]", t.PhysicalResistanceSeed);
m_Potion.Delete();
}
}
else
{
from.SendLocalizedMessage(1152924); // That is not a valid pet.
}
}
}
}
why are you trying to add this check?if (t.PhysicalResistanceSeed == true)
if (target is BaseCreature)
{
BaseCreature t = (BaseCreature)target;
if (t.IsBonded == true)
{
from.SendLocalizedMessage(1152925); // That pet is already bonded to you.
}
else if (t.ControlMaster != from)
{
from.SendLocalizedMessage(1114368); // This is not your pet!
}
else
{
t.IsBonded = !t.IsBonded;
from.SendLocalizedMessage(1049666); // Your pet has bonded with you!
t.PhysicalResistanceSeed += 1;
from.SendMessage("You have reinforced your pet by 1 point of physical resistance. Total: [{0}]", t.PhysicalResistanceSeed);
m_Potion.Delete();
using System;
using Server.Mobiles;
using Server.Targeting;
namespace Server.Items
{
public class PetPhysicalResistanceBonusPotion : Item
{
[Constructable]
public PetPhysicalResistanceBonusPotion() : base(0x0F04)
{
Weight = 1.0;
Name = "Pet Physical Resistance Bonus Potion";
LootType = LootType.Blessed;
Hue = 2629;
}
public override void OnDoubleClick(Mobile from) // Override double click of the deed to call our target
{
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
else
{
from.SendMessage("Target the pet you with to upgrate");
from.Target = new PhysicalResistanceSeed(this);
}
}
public PetPhysicalResistanceBonusPotion(Serial serial) : base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
public class PhysicalResistanceSeed : Target
{
private PetPhysicalResistanceBonusPotion m_Potion;
public PhysicalResistanceSeed(PetPhysicalResistanceBonusPotion potion) : base(1, false, TargetFlags.None)
{
m_Potion = potion;
}
protected override void OnTarget(Mobile from, object target)
{
if (m_Potion == null || m_Potion.Deleted || !m_Potion.IsChildOf(from.Backpack))
return;
if (target is BaseCreature)
{
BaseCreature t = (BaseCreature)target;
if (t.ControlMaster != from)
{
from.SendLocalizedMessage(1114368); // This is not your pet!
}
else
{
t.PhysicalResistanceSeed += 1;
from.SendMessage("You have reinforced your pet by 1 point of physical resistance. Total: [{0}]", t.PhysicalResistanceSeed);
m_Potion.Delete();
}
}
else
{
from.SendLocalizedMessage(1152924); // That is not a valid pet.
}
}
}
}
//Add AttackChance to an item
using System;
using Server.Network;
using Server.Prompts;
using Server.Items;
using Server.Targeting;
using Server;
namespace Server.Items
{
public class AttackChanceIncreaseTarget : Target
{
private AttackChanceIncreaseDeed m_Deed;
public AttackChanceIncreaseTarget( AttackChanceIncreaseDeed deed ) : base( 1, false, TargetFlags.None )
{
m_Deed = deed;
}
protected override void OnTarget( Mobile from, object target )
{
int AttackChanceAdd = 1; //Amount of Attack Chance to be added
int AttackChanceCap = 1000; //Limit of Attack Chance that an item can have
//Change to false if you don't want it to be used on any of these items
bool allowWeapon = true;
bool allowArmor = false;
bool allowJewel = false;
bool allowClothing = false;
bool allowSpellbook = true;
bool allowTalisman = false;
bool allowQuiver = false;
if ( target is BaseWeapon && allowWeapon)
{
Item item = (Item)target;
if( item.RootParent != from )
{
from.SendMessage( "You cannot add Attack Chance to that item there!" );
}
else
{
AttackChanceAdd = AttackChanceToAdd(((BaseWeapon)item).Attributes.AttackChance, AttackChanceAdd, AttackChanceCap, from);
if( AttackChanceAdd > 0 )
{
((BaseWeapon)item).Attributes.AttackChance += AttackChanceAdd;
m_Deed.Delete();
}
}
return;
}
else if ( target is BaseArmor && allowArmor )
{
Item item = (Item)target;
if( item.RootParent != from )
{
from.SendMessage( "You cannot add Attack Chance to that item there!" );
}
else
{
AttackChanceAdd = AttackChanceToAdd(((BaseArmor)item).Attributes.AttackChance, AttackChanceAdd, AttackChanceCap, from);
if( AttackChanceAdd > 0 )
{
((BaseArmor)item).Attributes.AttackChance += AttackChanceAdd;
m_Deed.Delete();
}
}
}
else if ( target is BaseClothing && allowClothing )
{
Item item = (Item)target;
if( item.RootParent != from )
{
from.SendMessage( "You cannot add Attack Chance to that item there!" );
}
else
{
AttackChanceAdd = AttackChanceToAdd(((BaseClothing)item).Attributes.AttackChance, AttackChanceAdd, AttackChanceCap, from);
if( AttackChanceAdd > 0 )
{
((BaseClothing)item).Attributes.AttackChance += AttackChanceAdd;
m_Deed.Delete();
}
}
}
else if ( target is BaseTalisman && allowTalisman )
{
Item item = (Item)target;
if( item.RootParent != from )
{
from.SendMessage( "You cannot add Attack Chance to that item there!" );
}
else
{
AttackChanceAdd = AttackChanceToAdd(((BaseTalisman)item).Attributes.AttackChance, AttackChanceAdd, AttackChanceCap, from);
if( AttackChanceAdd > 0 )
{
((BaseTalisman)item).Attributes.AttackChance += AttackChanceAdd;
m_Deed.Delete();
}
}
}
else if ( target is BaseJewel && allowJewel )
{
Item item = (Item)target;
if( item.RootParent != from )
{
from.SendMessage( "You cannot add Attack Chance to that item there!" );
}
else
{
AttackChanceAdd = AttackChanceToAdd(((BaseJewel)item).Attributes.AttackChance, AttackChanceAdd, AttackChanceCap, from);
if( AttackChanceAdd > 0 )
{
((BaseJewel)item).Attributes.AttackChance += AttackChanceAdd;
m_Deed.Delete();
}
}
}
else if ( target is Spellbook && allowSpellbook )
{
Item item = (Item)target;
if( item.RootParent != from )
{
from.SendMessage( "You cannot add Attack Chance to that item there!" );
}
else
{
AttackChanceAdd = AttackChanceToAdd(((Spellbook)item).Attributes.AttackChance, AttackChanceAdd, AttackChanceCap, from);
if( AttackChanceAdd > 0 )
{
((Spellbook)item).Attributes.AttackChance += AttackChanceAdd;
m_Deed.Delete();
}
}
}
else if ( target is BaseQuiver && allowQuiver )
{
Item item = (Item)target;
if( item.RootParent != from )
{
from.SendMessage( "You cannot add Attack Chance to that item there!" );
}
else
{
AttackChanceAdd = AttackChanceToAdd(((BaseQuiver)item).Attributes.AttackChance, AttackChanceAdd, AttackChanceCap, from);
if( AttackChanceAdd > 0 )
{
((BaseQuiver)item).Attributes.AttackChance += AttackChanceAdd;
m_Deed.Delete();
}
}
}
else
{
from.SendMessage( "You cannot use this deed on that!" );
}
}
public int AttackChanceToAdd(int itemAttackChance, int AttackChanceAdd ,int AttackChanceCap, Mobile from)
{
int ret = 0;
if(itemAttackChance < AttackChanceCap)
{
if( (itemAttackChance + AttackChanceAdd ) > AttackChanceCap )
{
ret = AttackChanceAdd - ( (itemAttackChance + AttackChanceAdd ) - AttackChanceCap );
from.SendMessage("You increase the Attack Chance on the item and it has now reached it's max. +"+ret+" Attack Chance has been added.");
}
else{
from.SendMessage( "You increase the Attack Chance on the item. +"+AttackChanceAdd+" Attack Chance has been added." );
ret = AttackChanceAdd;
}
}
else
{
from.SendMessage( "That item has reached the maximum amount of Attack Chance." );
}
return ret;
}
}
public class AttackChanceIncreaseDeed : Item
{
[Constructable]
public AttackChanceIncreaseDeed() : base( 0x14F0 )
{
Weight = 1.0;
Name = "+1 Attack Chance Increase Deed";
LootType = LootType.Blessed;
}
public AttackChanceIncreaseDeed( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
LootType = LootType.Blessed;
int version = reader.ReadInt();
}
public override bool DisplayLootType{ get{ return false; } }
public override void OnDoubleClick( Mobile from )
{
if ( !IsChildOf( from.Backpack ) )
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
else
{
from.SendMessage("Which item would you like to increase Attack Chance?" );
from.Target = new AttackChanceIncreaseTarget( this );
}
}
}
}
Change:This script has it how can we borrow this cap limit, and put it in the other one?
t.PhysicalResistanceSeed += 1;
from.SendMessage("You have reinforced your pet by 1 point of physical resistance. Total: [{0}]", t.PhysicalResistanceSeed);
m_Potion.Delete();
if (t.PhysicalResistanceSeed < 70)
{
t.PhysicalResistanceSeed += 1;
from.SendMessage("You have reinforced your pet by 1 point of physical resistance. Total: [{0}]", t.PhysicalResistanceSeed);
m_Potion.Delete();
}
else
{
from.SendMessage("Your pet have a maximum physical resistance.");
return;
}
thanks, post edited)you forgot the brackets for the if but besides that yes thats how you can do it
using System;
using Server.Mobiles;
using Server.Targeting;
namespace Server.Items
{
public class PetPhysicalResistanceBonusPotion : Item
{
[Constructable]
public PetPhysicalResistanceBonusPotion() : base(0x0F04)
{
Weight = 1.0;
Name = "Pet Physical Resistance Bonus Potion";
LootType = LootType.Blessed;
Hue = 2629;
}
public override void OnDoubleClick(Mobile from) // Override double click of the deed to call our target
{
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
else
{
from.SendMessage("Target the pet you with to upgrate");
from.Target = new PhysicalResistanceSeed(this);
}
}
public PetPhysicalResistanceBonusPotion(Serial serial) : base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
public class PhysicalResistanceSeed : Target
{
private PetPhysicalResistanceBonusPotion m_Potion;
public PhysicalResistanceSeed(PetPhysicalResistanceBonusPotion potion) : base(1, false, TargetFlags.None)
{
m_Potion = potion;
}
protected override void OnTarget(Mobile from, object target)
{
if (m_Potion == null || m_Potion.Deleted || !m_Potion.IsChildOf(from.Backpack))
return;
if (target is BaseCreature)
{
BaseCreature t = (BaseCreature)target;
if (t.ControlMaster != from)
{
from.SendLocalizedMessage(1114368); // This is not your pet!
}
else
{
if (t.PhysicalResistanceSeed < 70)
{
t.PhysicalResistanceSeed += 1;
from.SendMessage("You have reinforced your pet by 1 point of physical resistance. Total: [{0}]", t.PhysicalResistanceSeed);
m_Potion.Delete();
}
else
{
from.SendMessage("Your pet have a maximum physical resistance.");
return;
}
else
{
from.SendLocalizedMessage(1152924); // That is not a valid pet.
}
}
}
}
using System;
using Server.Mobiles;
using Server.Targeting;
namespace Server.Items
{
public class PetPhysicalResistanceBonusPotion : Item
{
[Constructable]
public PetPhysicalResistanceBonusPotion() : base(0x0F04)
{
Weight = 1.0;
Name = "Pet Physical Resistance Bonus Potion";
LootType = LootType.Blessed;
Hue = 2629;
}
public override void OnDoubleClick(Mobile from) // Override double click of the deed to call our target
{
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
else
{
from.SendMessage("Target the pet you with to upgrate");
from.Target = new PhysicalResistanceSeed(this);
}
}
public PetPhysicalResistanceBonusPotion(Serial serial) : base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
public class PhysicalResistanceSeed : Target
{
private PetPhysicalResistanceBonusPotion m_Potion;
public PhysicalResistanceSeed(PetPhysicalResistanceBonusPotion potion) : base(1, false, TargetFlags.None)
{
m_Potion = potion;
}
protected override void OnTarget(Mobile from, object target)
{
if (m_Potion == null || m_Potion.Deleted || !m_Potion.IsChildOf(from.Backpack))
return;
if (target is BaseCreature)
{
BaseCreature t = (BaseCreature)target;
if (t.ControlMaster != from)
{
from.SendLocalizedMessage(1114368); // This is not your pet!
}
else
{
if (t.PhysicalResistanceSeed < 70)
{
t.PhysicalResistanceSeed += 1;
from.SendMessage("You have reinforced your pet by 1 point of physical resistance. Total: [{0}]", t.PhysicalResistanceSeed);
m_Potion.Delete();
}
else
{
from.SendMessage("Your pet have a maximum physical resistance.");
return;
}
}
}
else
{
from.SendLocalizedMessage(1152924); // That is not a valid pet.
}
}
}
}
you would have enough 2-3 days to solve the problem yourself, if you began to study C#Confirmed it work thank you all great job it took 7 days, but it got the job done lol.
if (target is BaseCreature)
{
BaseCreature t = (BaseCreature)target;
if (t.ControlMaster != from)
{
from.SendLocalizedMessage(1114368); // This is not your pet!
}
else
{
if (t.ControlSlots < 0)
{
t.ControlSlots += 1;
from.SendMessage("You have reduce your pet by 1 point of Control Slots . Total: [{0}]", t.ControlSlots);
m_Potion.Delete();
}
else
{
from.SendMessage("Your pet control slots can't get any lower.");
return;
}
}
}
else
{
from.SendLocalizedMessage(1152924); // That is not a valid pet.
}
}
}
}
using System;
using Server.Mobiles;
using Server.Targeting;
namespace Server.Items
{
public class PetDamageMinBonusPotion : Item
{
[Constructable]
public PetDamageMinBonusPotion() : base(0x0F04)
{
Weight = 1.0;
Name = "Pet Damage Min Point Bonus Potion";
LootType = LootType.Blessed;
Hue = 2629;
}
public override void OnDoubleClick(Mobile from) // Override double click of the deed to call our target
{
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
else
{
from.SendMessage("Target the pet you with to upgrate");
from.Target = new DamageMin(this);
}
}
public PetDamageMinBonusPotion(Serial serial) : base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
public class DamageMin : Target
{
private PetDamageMinBonusPotion m_Potion;
public DamageMin(PetDamageMinBonusPotion potion) : base(1, false, TargetFlags.None)
{
m_Potion = potion;
}
protected override void OnTarget(Mobile from, object target)
{
if (m_Potion == null || m_Potion.Deleted || !m_Potion.IsChildOf(from.Backpack))
return;
if (target is BaseCreature)
{
BaseCreature t = (BaseCreature)target;
if (t.ControlMaster != from)
{
from.SendLocalizedMessage(1114368); // This is not your pet!
}
else
{
if (t.DamageMin < 1000000)
{
t.DamageMin += 1;
from.SendMessage("You have reinforced your pet by 1 point of DamageMin. Total: [{0}]", t.DamageMin);
m_Potion.Delete();
}
else
{
from.SendMessage("Your pet have a maximum DamageMin.");
return;
}
}
}
else
{
from.SendLocalizedMessage(1152924); // That is not a valid pet.
}
}
}
}
using System;
using Server.Mobiles;
using Server.Targeting;
namespace Server.Items
{
public class PetDamageMaxBonusPotion : Item
{
[Constructable]
public PetDamageMaxBonusPotion() : base(0x0F04)
{
Weight = 1.0;
Name = "Pet Damage Max Point Bonus Potion";
LootType = LootType.Blessed;
Hue = 2629;
}
public override void OnDoubleClick(Mobile from) // Override double click of the deed to call our target
{
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
else
{
from.SendMessage("Target the pet you with to upgrate");
from.Target = new DamageMax(this);
}
}
public PetDamageMaxBonusPotion(Serial serial) : base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
public class DamageMax : Target
{
private PetDamageMaxBonusPotion m_Potion;
public DamageMax(PetDamageMaxBonusPotion potion) : base(1, false, TargetFlags.None)
{
m_Potion = potion;
}
protected override void OnTarget(Mobile from, object target)
{
if (m_Potion == null || m_Potion.Deleted || !m_Potion.IsChildOf(from.Backpack))
return;
if (target is BaseCreature)
{
BaseCreature t = (BaseCreature)target;
if (t.ControlMaster != from)
{
from.SendLocalizedMessage(1114368); // This is not your pet!
}
else
{
if (t.DamageMax < 1000000)
{
t.DamageMax += 1;
from.SendMessage("You have reinforced your pet by 1 point of Damage Max. Total: [{0}]", t.DamageMax);
m_Potion.Delete();
}
else
{
from.SendMessage("Your pet have a maximum Damage Max.");
return;
}
}
}
else
{
from.SendLocalizedMessage(1152924); // That is not a valid pet.
}
}
}
}
using System;
using Server.Mobiles;
using Server.Targeting;
namespace Server.Items
{
public class PetStamPointBonusPotion : Item
{
[Constructable]
public PetStamPointBonusPotion() : base(0x0F04)
{
Weight = 1.0;
Name = "Pet Stam Point Bonus Potion";
LootType = LootType.Blessed;
Hue = 2629;
}
public override void OnDoubleClick(Mobile from) // Override double click of the deed to call our target
{
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
else
{
from.SendMessage("Target the pet you with to upgrate");
from.Target = new StamMaxSeed(this);
}
}
public PetStamPointBonusPotion(Serial serial) : base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
public class StamMaxSeed : Target
{
private PetStamPointBonusPotion m_Potion;
public StamMaxSeed(PetStamPointBonusPotion potion) : base(1, false, TargetFlags.None)
{
m_Potion = potion;
}
protected override void OnTarget(Mobile from, object target)
{
if (m_Potion == null || m_Potion.Deleted || !m_Potion.IsChildOf(from.Backpack))
return;
if (target is BaseCreature)
{
BaseCreature t = (BaseCreature)target;
if (t.ControlMaster != from)
{
from.SendLocalizedMessage(1114368); // This is not your pet!
}
else
{
if (t.StamMaxSeed < 1000000)
{
t.StamMaxSeed += 1;
from.SendMessage("You have reinforced your pet by 1 point of stamina point. Total: [{0}]", t.StamMaxSeed);
m_Potion.Delete();
}
else
{
from.SendMessage("Your pet have a maximum stamina point.");
return;
}
}
}
else
{
from.SendLocalizedMessage(1152924); // That is not a valid pet.
}
}
}
}
using System;
using Server.Mobiles;
using Server.Targeting;
namespace Server.Items
{
public class PetHitsPointBonusPotion : Item
{
[Constructable]
public PetHitsPointBonusPotion() : base(0x0F04)
{
Weight = 1.0;
Name = "Pet Hits Point Bonus Potion";
LootType = LootType.Blessed;
Hue = 2629;
}
public override void OnDoubleClick(Mobile from) // Override double click of the deed to call our target
{
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
else
{
from.SendMessage("Target the pet you with to upgrate");
from.Target = new HitsMaxSeed(this);
}
}
public PetHitsPointBonusPotion(Serial serial) : base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
public class HitsMaxSeed : Target
{
private PetHitsPointBonusPotion m_Potion;
public HitsMaxSeed(PetHitsPointBonusPotion potion) : base(1, false, TargetFlags.None)
{
m_Potion = potion;
}
protected override void OnTarget(Mobile from, object target)
{
if (m_Potion == null || m_Potion.Deleted || !m_Potion.IsChildOf(from.Backpack))
return;
if (target is BaseCreature)
{
BaseCreature t = (BaseCreature)target;
if (t.ControlMaster != from)
{
from.SendLocalizedMessage(1114368); // This is not your pet!
}
else
{
if (t.HitsMaxSeed < 1000000)
{
t.HitsMaxSeed += 1;
from.SendMessage("You have reinforced your pet by 1 point of hits point. Total: [{0}]", t.HitsMaxSeed);
m_Potion.Delete();
}
else
{
from.SendMessage("Your pet have a maximum hits point.");
return;
}
}
}
else
{
from.SendLocalizedMessage(1152924); // That is not a valid pet.
}
}
}
}
if (t.StamMaxSeed < 1000000)
{
t.StamMaxSeed = t.Stam + 1;
from.SendMessage("You have reinforced your pet by 1 point of stamina point. Total: [{0}]", t.StamMaxSeed);
m_Potion.Delete();
}
using System;
using Server.Mobiles;
using Server.Targeting;
namespace Server.Items
{
public class PetStamPointBonusPotion : Item
{
[Constructable]
public PetStamPointBonusPotion() : base(0x0F04)
{
Weight = 1.0;
Name = "a Stamina Potion";
LootType = LootType.Blessed;
Stackable = false;
Hue = 437;
}
public override void OnSingleClick( Mobile from )
{
base.OnSingleClick( from );
LabelTo( from, "+1 Pet Bonus" );
}
public override void GetProperties( ObjectPropertyList list )
{
base.GetProperties( list );
list.Add( "+1 Pet Bonus" );
}
public override void OnDoubleClick(Mobile from) // Override double click of the deed to call our target
{
if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
else
{
from.SendMessage("Target the pet you wish to pour the potion over!");
from.Target = new StamMaxSeed(this);
}
}
public PetStamPointBonusPotion(Serial serial) : base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
public class StamMaxSeed : Target
{
private PetStamPointBonusPotion m_Potion;
public StamMaxSeed(PetStamPointBonusPotion potion) : base(1, false, TargetFlags.None)
{
m_Potion = potion;
}
protected override void OnTarget(Mobile from, object target)
{
if (m_Potion == null || m_Potion.Deleted || !m_Potion.IsChildOf(from.Backpack))
return;
if (target is BaseCreature)
{
BaseCreature t = (BaseCreature)target;
if (t.ControlMaster != from)
{
from.SendLocalizedMessage(1114368); // This is not your pet!
}
else
{
if (t.StamMaxSeed < 1000000)
{
t.StamMaxSeed = t.Stam + 1;
from.SendMessage("Total: [{0}]", t.StamMaxSeed);
from.Say( "I applied 1 point to your Base Stamina!" );
from.PlaySound(665);
m_Potion.Delete();
}
else
{
from.SendMessage("Your pet has reached it's maximum amount of Stamina points!");
return;
}
}
}
else
{
from.SendLocalizedMessage(1152924); // That is not a valid pet.
}
}
}
}
else
{
if (t.StamMaxSeed < 1000000)
{
t.StamMaxSeed = t.StamMaxSeed + 1;
t.Stam = t.Stam + 1;
from.SendMessage("Total: [{0}]", t.StamMaxSeed);
from.Say( "I applied 1 point to your Base Stamina!" );
from.PlaySound(665);
m_Potion.Delete();
}
else
{
from.SendMessage("Your pet has reached it's maximum amount of Stamina points!");
return;
}
We use essential cookies to make this site work, and optional cookies to enhance your experience.