- ServUO Version
- Publish 57
- Ultima Expansion
- Endless Journey
So I can't wrap my head around the way serialization works and in this case something was removed but the write number was still increased according to the changes on the github which really confuses me.. anyways I need help merging the following:
with:
And here is the change I was referencing..
I can remove the souldbound portion and it loads fine but if I save and restart it wants to delete all my creatures so clearly I'm not merging those changes right..
C#:
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(30); // version
writer.Write(IsSoulbound);
writer.Write(m_ForceActiveSpeed);
writer.Write(m_ForcePassiveSpeed);
writer.Write(CanMove);
writer.Write(_LockDirection);
writer.Write(ApproachWait);
writer.Write(ApproachRange);
writer.Write((int)m_CurrentAI);
writer.Write((int)m_DefaultAI);
writer.Write(m_iRangePerception);
writer.Write(m_iRangeFight);
writer.Write(m_iTeam);
writer.Write(m_dActiveSpeed);
writer.Write(m_dPassiveSpeed);
writer.Write(m_dCurrentSpeed);
writer.Write(m_pHome.X);
writer.Write(m_pHome.Y);
writer.Write(m_pHome.Z);
// Version 1
writer.Write(m_iRangeHome);
int i = 0;
writer.Write(m_arSpellAttack.Count);
for (i = 0; i < m_arSpellAttack.Count; i++)
{
writer.Write(m_arSpellAttack[i].ToString());
}
writer.Write(m_arSpellDefense.Count);
for (i = 0; i < m_arSpellDefense.Count; i++)
{
writer.Write(m_arSpellDefense[i].ToString());
}
// Version 2
writer.Write((int)m_FightMode);
writer.Write(m_bControlled);
writer.Write(m_ControlMaster);
writer.Write(m_ControlTarget is Mobile ? (Mobile)m_ControlTarget : null);
writer.Write(m_ControlDest);
writer.Write((int)m_ControlOrder);
writer.Write(m_dMinTameSkill);
writer.Write(m_bTamable);
writer.Write(m_bSummoned);
if (m_bSummoned)
{
writer.WriteDeltaTime(m_SummonEnd);
}
writer.Write(m_iControlSlots);
// Version 3
writer.Write(m_Loyalty);
// Version 4
writer.Write(m_CurrentWayPoint);
// Verison 5
writer.Write(m_SummonMaster);
// Version 6
writer.Write(m_HitsMax);
writer.Write(m_StamMax);
writer.Write(m_ManaMax);
writer.Write(m_DamageMin);
writer.Write(m_DamageMax);
// Version 7
writer.Write(m_PhysicalResistance);
writer.Write(m_PhysicalDamage);
writer.Write(m_FireResistance);
writer.Write(m_FireDamage);
writer.Write(m_ColdResistance);
writer.Write(m_ColdDamage);
writer.Write(m_PoisonResistance);
writer.Write(m_PoisonDamage);
writer.Write(m_EnergyResistance);
writer.Write(m_EnergyDamage);
// Version 8
writer.Write(m_Owners, true);
// Version 10
writer.Write(m_IsDeadPet);
writer.Write(m_IsBonded);
writer.Write(m_BondingBegin);
writer.Write(m_OwnerAbandonTime);
// Version 11
writer.Write(m_HasGeneratedLoot);
// Version 12
writer.Write(m_Paragon);
// Version 13
writer.Write((m_Friends != null && m_Friends.Count > 0));
if (m_Friends != null && m_Friends.Count > 0)
{
writer.Write(m_Friends, true);
}
// Version 14
writer.Write(m_RemoveIfUntamed);
writer.Write(m_RemoveStep);
// Version 17
if (IsStabled || (Controlled && ControlMaster != null))
{
writer.Write(TimeSpan.Zero);
}
else
{
writer.Write(DeleteTimeLeft);
}
// Version 18
writer.Write(m_CorpseNameOverride);
// Mondain's Legacy version 19
writer.Write(m_Allured);
// Version 21 FS:ATS EDITS
writer.Write( (bool) m_IsMating );
writer.Write( (int) m_ABPoints );
writer.Write( (int) m_Exp );
writer.Write( (int) m_NextLevel );
writer.Write( (int) m_Level );
writer.Write( (int) m_MaxLevel );
writer.Write( (bool) m_AllowMating );
writer.Write( (bool) m_Evolves );
writer.Write( (int) m_Gen );
writer.Write( (DateTime) m_MatingDelay );
writer.Write( (int) m_Form1 );
writer.Write( (int) m_Form2 );
writer.Write( (int) m_Form3 );
writer.Write( (int) m_Form4 );
writer.Write( (int) m_Form5 );
writer.Write( (int) m_Form6 );
writer.Write( (int) m_Form7 );
writer.Write( (int) m_Form8 );
writer.Write( (int) m_Form9 );
writer.Write( (int) m_Sound1 );
writer.Write( (int) m_Sound2 );
writer.Write( (int) m_Sound3 );
writer.Write( (int) m_Sound4 );
writer.Write( (int) m_Sound5 );
writer.Write( (int) m_Sound6 );
writer.Write( (int) m_Sound7 );
writer.Write( (int) m_Sound8 );
writer.Write( (int) m_Sound9 );
writer.Write( (bool) m_UsesForm1 );
writer.Write( (bool) m_UsesForm2 );
writer.Write( (bool) m_UsesForm3 );
writer.Write( (bool) m_UsesForm4 );
writer.Write( (bool) m_UsesForm5 );
writer.Write( (bool) m_UsesForm6 );
writer.Write( (bool) m_UsesForm7 );
writer.Write( (bool) m_UsesForm8 );
writer.Write( (bool) m_UsesForm9 );
writer.Write( (bool) m_F0 );
writer.Write( (bool) m_F1 );
writer.Write( (bool) m_F2 );
writer.Write( (bool) m_F3 );
writer.Write( (bool) m_F4 );
writer.Write( (bool) m_F5 );
writer.Write( (bool) m_F6 );
writer.Write( (bool) m_F7 );
writer.Write( (bool) m_F8 );
writer.Write( (bool) m_F9 );
writer.Write( (int) m_RoarAttack );
writer.Write( (int) m_PetPoisonAttack );
writer.Write( (int) m_FireBreathAttack );
// Pet Branding version 22
writer.Write(m_EngravedText);
// Version 24 Pet Training
writer.Write(ControlSlotsMin);
writer.Write(ControlSlotsMax);
writer.Write((int)Mastery);
if (_Profile != null)
{
writer.Write(1);
_Profile.Serialize(writer);
}
else
{
writer.Write(0);
}
if (_TrainingProfile != null)
{
writer.Write(1);
_TrainingProfile.Serialize(writer);
}
else
{
writer.Write(0);
}
// Version 25 Current Tame Skill
writer.Write(m_CurrentTameSkill);
}
private static readonly double[] m_StandardActiveSpeeds = new[] { 0.175, 0.1, 0.15, 0.2, 0.25, 0.3, 0.4, 0.5, 0.6, 0.8 };
private static readonly double[] m_StandardPassiveSpeeds = new[] { 0.350, 0.2, 0.4, 0.5, 0.6, 0.8, 1.0, 1.2, 1.6, 2.0 };
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
if (version == 29)
{
reader.Info = "V";
}
switch (version)
{
case 30:
goto case 29;
case 29:
IsSoulbound = reader.ReadBool();
goto case 28;
case 28:
m_ForceActiveSpeed = reader.ReadDouble();
m_ForcePassiveSpeed = reader.ReadDouble();
goto case 27;
case 27: // Pet Slot Fix
case 26:
{
CanMove = reader.ReadBool();
_LockDirection = reader.ReadBool();
ApproachWait = reader.ReadBool();
ApproachRange = reader.ReadInt();
}
break;
}
m_CurrentAI = (AIType)reader.ReadInt();
m_DefaultAI = (AIType)reader.ReadInt();
m_iRangePerception = reader.ReadInt();
m_iRangeFight = reader.ReadInt();
m_iTeam = reader.ReadInt();
m_dActiveSpeed = reader.ReadDouble();
m_dPassiveSpeed = reader.ReadDouble();
m_dCurrentSpeed = reader.ReadDouble();
if (m_iRangePerception == OldRangePerception)
{
m_iRangePerception = DefaultRangePerception;
}
m_pHome.X = reader.ReadInt();
m_pHome.Y = reader.ReadInt();
m_pHome.Z = reader.ReadInt();
if (version >= 1)
{
m_iRangeHome = reader.ReadInt();
int i, iCount;
iCount = reader.ReadInt();
for (i = 0; i < iCount; i++)
{
string str = reader.ReadString();
Type type = Type.GetType(str);
if (type != null)
{
m_arSpellAttack.Add(type);
}
}
iCount = reader.ReadInt();
for (i = 0; i < iCount; i++)
{
string str = reader.ReadString();
Type type = Type.GetType(str);
if (type != null)
{
m_arSpellDefense.Add(type);
}
}
}
else
{
m_iRangeHome = 0;
}
if (version >= 2)
{
m_FightMode = (FightMode)reader.ReadInt();
m_bControlled = reader.ReadBool();
m_ControlMaster = reader.ReadMobile();
m_ControlTarget = reader.ReadMobile();
m_ControlDest = reader.ReadPoint3D();
m_ControlOrder = (OrderType)reader.ReadInt();
m_dMinTameSkill = reader.ReadDouble();
if (version < 9)
{
reader.ReadDouble();
}
m_bTamable = reader.ReadBool();
m_bSummoned = reader.ReadBool();
if (m_bSummoned)
{
m_SummonEnd = reader.ReadDeltaTime();
new UnsummonTimer(m_ControlMaster, this, m_SummonEnd - DateTime.UtcNow).Start();
}
m_iControlSlots = reader.ReadInt();
}
else
{
m_FightMode = FightMode.Closest;
m_bControlled = false;
m_ControlMaster = null;
m_ControlTarget = null;
m_ControlOrder = OrderType.None;
}
if (version >= 3)
{
m_Loyalty = reader.ReadInt();
}
else
{
m_Loyalty = MaxLoyalty; // Wonderfully Happy
}
if (version >= 4)
{
m_CurrentWayPoint = reader.ReadItem() as WayPoint;
}
if (version >= 5)
{
m_SummonMaster = reader.ReadMobile();
}
if (version >= 6)
{
m_HitsMax = reader.ReadInt();
m_StamMax = reader.ReadInt();
m_ManaMax = reader.ReadInt();
m_DamageMin = reader.ReadInt();
m_DamageMax = reader.ReadInt();
}
if (version >= 7)
{
m_PhysicalResistance = reader.ReadInt();
m_PhysicalDamage = reader.ReadInt();
m_FireResistance = reader.ReadInt();
m_FireDamage = reader.ReadInt();
m_ColdResistance = reader.ReadInt();
m_ColdDamage = reader.ReadInt();
m_PoisonResistance = reader.ReadInt();
m_PoisonDamage = reader.ReadInt();
m_EnergyResistance = reader.ReadInt();
m_EnergyDamage = reader.ReadInt();
}
if (version >= 8)
{
m_Owners = reader.ReadStrongMobileList();
}
else
{
m_Owners = new List<Mobile>();
}
if (version >= 10)
{
m_IsDeadPet = reader.ReadBool();
m_IsBonded = reader.ReadBool();
m_BondingBegin = reader.ReadDateTime();
m_OwnerAbandonTime = reader.ReadDateTime();
}
if (version >= 11)
{
m_HasGeneratedLoot = reader.ReadBool();
}
else
{
m_HasGeneratedLoot = true;
}
if (version >= 12)
{
m_Paragon = reader.ReadBool();
}
else
{
m_Paragon = false;
}
if (version >= 13 && reader.ReadBool())
{
m_Friends = reader.ReadStrongMobileList();
}
else if (version < 13 && m_ControlOrder >= OrderType.Unfriend)
{
++m_ControlOrder;
}
if (version < 16 && Loyalty != MaxLoyalty)
{
Loyalty *= 10;
}
double activeSpeed = m_dActiveSpeed;
double passiveSpeed = m_dPassiveSpeed;
if (version >= 28)
{
SpeedInfo.GetSpeedsNew(this, ref activeSpeed, ref passiveSpeed);
m_dActiveSpeed = activeSpeed;
m_dPassiveSpeed = passiveSpeed;
}
else
{
SpeedInfo.GetSpeeds(this, ref activeSpeed, ref passiveSpeed);
bool isStandardActive = false;
for (int i = 0; !isStandardActive && i < m_StandardActiveSpeeds.Length; ++i)
{
isStandardActive = (m_dActiveSpeed == m_StandardActiveSpeeds[i]);
}
bool isStandardPassive = false;
for (int i = 0; !isStandardPassive && i < m_StandardPassiveSpeeds.Length; ++i)
{
isStandardPassive = (m_dPassiveSpeed == m_StandardPassiveSpeeds[i]);
}
if (isStandardActive && m_dCurrentSpeed == m_dActiveSpeed)
{
m_dCurrentSpeed = activeSpeed;
}
else if (isStandardPassive && m_dCurrentSpeed == m_dPassiveSpeed)
{
m_dCurrentSpeed = passiveSpeed;
}
if (isStandardActive && !m_Paragon)
{
m_dActiveSpeed = activeSpeed;
}
if (isStandardPassive && !m_Paragon)
{
m_dPassiveSpeed = passiveSpeed;
}
}
if (version >= 14)
{
m_RemoveIfUntamed = reader.ReadBool();
m_RemoveStep = reader.ReadInt();
}
TimeSpan deleteTime = TimeSpan.Zero;
if (version >= 17)
{
deleteTime = reader.ReadTimeSpan();
}
if (deleteTime > TimeSpan.Zero || LastOwner != null && !Controlled && !IsStabled)
{
if (deleteTime == TimeSpan.Zero)
{
deleteTime = TimeSpan.FromDays(3.0);
}
m_DeleteTimer = new DeleteTimer(this, deleteTime);
m_DeleteTimer.Start();
}
if (version >= 18)
{
m_CorpseNameOverride = reader.ReadString();
}
if (version >= 19)
{
m_Allured = reader.ReadBool();
}
if (version <= 20)
{
reader.ReadInt();
}
if (version < 26)
{
CanMove = true;
ApproachWait = false;
ApproachRange = 10;
}
// FS ATS Starts
if ( version >= 21 )
{
m_IsMating = reader.ReadBool();
m_ABPoints = reader.ReadInt();
m_Exp = reader.ReadInt();
m_NextLevel = reader.ReadInt();
m_Level = reader.ReadInt();
m_MaxLevel = reader.ReadInt();
m_AllowMating = reader.ReadBool();
m_Evolves = reader.ReadBool();
m_Gen = reader.ReadInt();
m_MatingDelay = reader.ReadDateTime();
m_Form1 = reader.ReadInt();
m_Form2 = reader.ReadInt();
m_Form3 = reader.ReadInt();
m_Form4 = reader.ReadInt();
m_Form5 = reader.ReadInt();
m_Form6 = reader.ReadInt();
m_Form7 = reader.ReadInt();
m_Form8 = reader.ReadInt();
m_Form9 = reader.ReadInt();
m_Sound1 = reader.ReadInt();
m_Sound2 = reader.ReadInt();
m_Sound3 = reader.ReadInt();
m_Sound4 = reader.ReadInt();
m_Sound5 = reader.ReadInt();
m_Sound6 = reader.ReadInt();
m_Sound7 = reader.ReadInt();
m_Sound8 = reader.ReadInt();
m_Sound9 = reader.ReadInt();
m_UsesForm1 = reader.ReadBool();
m_UsesForm2 = reader.ReadBool();
m_UsesForm3 = reader.ReadBool();
m_UsesForm4 = reader.ReadBool();
m_UsesForm5 = reader.ReadBool();
m_UsesForm6 = reader.ReadBool();
m_UsesForm7 = reader.ReadBool();
m_UsesForm8 = reader.ReadBool();
m_UsesForm9 = reader.ReadBool();
m_F0 = reader.ReadBool();
m_F1 = reader.ReadBool();
m_F2 = reader.ReadBool();
m_F3 = reader.ReadBool();
m_F4 = reader.ReadBool();
m_F5 = reader.ReadBool();
m_F6 = reader.ReadBool();
m_F7 = reader.ReadBool();
m_F8 = reader.ReadBool();
m_F9 = reader.ReadBool();
m_RoarAttack = reader.ReadInt();
m_PetPoisonAttack = reader.ReadInt();
m_FireBreathAttack = reader.ReadInt();
}
// FS ATS Ends
if (version >= 22)
{
m_EngravedText = reader.ReadString();
}
if (version == 23)
{
reader.ReadBool();
}
if (version >= 24)
{
ControlSlotsMin = reader.ReadInt();
ControlSlotsMax = reader.ReadInt();
Mastery = (SkillName)reader.ReadInt();
if (reader.ReadInt() == 1)
{
_Profile = new AbilityProfile(this, reader);
}
if (reader.ReadInt() == 1)
{
_TrainingProfile = new TrainingProfile(this, reader);
}
}
else
{
if (Tamable)
{
CalculateSlots(m_iControlSlots);
if (m_iControlSlots < ControlSlotsMin)
{
ControlSlotsMin = m_iControlSlots;
}
ControlSlots = ControlSlotsMin;
}
InitializeAbilities();
}
if (version >= 25)
{
CurrentTameSkill = reader.ReadDouble();
if (Controlled && version == 26)
{
AdjustTameRequirements();
}
else if (Controlled && CurrentTameSkill > MaxTameRequirement)
{
CurrentTameSkill = MaxTameRequirement;
}
}
else
{
AdjustTameRequirements();
}
if (version <= 14 && m_Paragon && Hue == 0x31)
{
Hue = Paragon.Hue; //Paragon hue fixed, should now be 0x501.
}
CheckStatTimers();
ChangeAIType(m_CurrentAI);
AddFollowers();
if (IsAnimatedDead)
{
AnimateDeadSpell.Register(m_SummonMaster, this);
}
if (Tamable && CurrentTameSkill == 0)
{
AdjustTameRequirements();
}
}
C#:
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(30); // version
writer.Write(m_ForceActiveSpeed);
writer.Write(m_ForcePassiveSpeed);
writer.Write(CanMove);
writer.Write(_LockDirection);
writer.Write(ApproachWait);
writer.Write(ApproachRange);
writer.Write((int)m_CurrentAI);
writer.Write((int)m_DefaultAI);
writer.Write(m_iRangePerception);
writer.Write(m_iRangeFight);
writer.Write(m_iTeam);
writer.Write(m_dActiveSpeed);
writer.Write(m_dPassiveSpeed);
writer.Write(m_dCurrentSpeed);
writer.Write(m_pHome.X);
writer.Write(m_pHome.Y);
writer.Write(m_pHome.Z);
// Version 1
writer.Write(m_iRangeHome);
int i = 0;
writer.Write(m_arSpellAttack.Count);
for (i = 0; i < m_arSpellAttack.Count; i++)
{
writer.Write(m_arSpellAttack[i].ToString());
}
writer.Write(m_arSpellDefense.Count);
for (i = 0; i < m_arSpellDefense.Count; i++)
{
writer.Write(m_arSpellDefense[i].ToString());
}
// Version 2
writer.Write((int)m_FightMode);
writer.Write(m_bControlled);
writer.Write(m_ControlMaster);
writer.Write(m_ControlTarget is Mobile ? (Mobile)m_ControlTarget : null);
writer.Write(m_ControlDest);
writer.Write((int)m_ControlOrder);
writer.Write(m_dMinTameSkill);
writer.Write(m_bTamable);
writer.Write(m_bSummoned);
if (m_bSummoned)
{
writer.WriteDeltaTime(m_SummonEnd);
}
writer.Write(m_iControlSlots);
// Version 3
writer.Write(m_Loyalty);
// Version 4
writer.Write(m_CurrentWayPoint);
// Verison 5
writer.Write(m_SummonMaster);
// Version 6
writer.Write(m_HitsMax);
writer.Write(m_StamMax);
writer.Write(m_ManaMax);
writer.Write(m_DamageMin);
writer.Write(m_DamageMax);
// Version 7
writer.Write(m_PhysicalResistance);
writer.Write(m_PhysicalDamage);
writer.Write(m_FireResistance);
writer.Write(m_FireDamage);
writer.Write(m_ColdResistance);
writer.Write(m_ColdDamage);
writer.Write(m_PoisonResistance);
writer.Write(m_PoisonDamage);
writer.Write(m_EnergyResistance);
writer.Write(m_EnergyDamage);
// Version 8
writer.Write(m_Owners, true);
// Version 10
writer.Write(m_IsDeadPet);
writer.Write(m_IsBonded);
writer.Write(m_BondingBegin);
writer.Write(m_OwnerAbandonTime);
// Version 11
writer.Write(m_HasGeneratedLoot);
// Version 12
writer.Write(m_Paragon);
// Version 13
writer.Write((m_Friends != null && m_Friends.Count > 0));
if (m_Friends != null && m_Friends.Count > 0)
{
writer.Write(m_Friends, true);
}
// Version 14
writer.Write(m_RemoveIfUntamed);
writer.Write(m_RemoveStep);
// Version 17
if (IsStabled || (Controlled && ControlMaster != null))
{
writer.Write(TimeSpan.Zero);
}
else
{
writer.Write(DeleteTimeLeft);
}
// Version 18
writer.Write(m_CorpseNameOverride);
// Mondain's Legacy version 19
writer.Write(m_Allured);
// Pet Branding version 22
writer.Write(m_EngravedText);
// Version 24 Pet Training
writer.Write(ControlSlotsMin);
writer.Write(ControlSlotsMax);
writer.Write((int)Mastery);
if (_Profile != null)
{
writer.Write(1);
_Profile.Serialize(writer);
}
else
{
writer.Write(0);
}
if (_TrainingProfile != null)
{
writer.Write(1);
_TrainingProfile.Serialize(writer);
}
else
{
writer.Write(0);
}
// Version 25 Current Tame Skill
writer.Write(m_CurrentTameSkill);
}
private static readonly double[] m_StandardActiveSpeeds = new[] { 0.175, 0.1, 0.15, 0.2, 0.25, 0.3, 0.4, 0.5, 0.6, 0.8 };
private static readonly double[] m_StandardPassiveSpeeds = new[] { 0.350, 0.2, 0.4, 0.5, 0.6, 0.8, 1.0, 1.2, 1.6, 2.0 };
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch (version)
{
case 30:
goto case 28;
case 29:
reader.ReadBool();
goto case 28;
case 28:
m_ForceActiveSpeed = reader.ReadDouble();
m_ForcePassiveSpeed = reader.ReadDouble();
goto case 27;
case 27: // Pet Slot Fix
case 26:
{
CanMove = reader.ReadBool();
_LockDirection = reader.ReadBool();
ApproachWait = reader.ReadBool();
ApproachRange = reader.ReadInt();
}
break;
}
m_CurrentAI = (AIType)reader.ReadInt();
m_DefaultAI = (AIType)reader.ReadInt();
m_iRangePerception = reader.ReadInt();
m_iRangeFight = reader.ReadInt();
m_iTeam = reader.ReadInt();
m_dActiveSpeed = reader.ReadDouble();
m_dPassiveSpeed = reader.ReadDouble();
m_dCurrentSpeed = reader.ReadDouble();
if (m_iRangePerception == OldRangePerception)
{
m_iRangePerception = DefaultRangePerception;
}
m_pHome.X = reader.ReadInt();
m_pHome.Y = reader.ReadInt();
m_pHome.Z = reader.ReadInt();
if (version >= 1)
{
m_iRangeHome = reader.ReadInt();
int i, iCount;
iCount = reader.ReadInt();
for (i = 0; i < iCount; i++)
{
string str = reader.ReadString();
Type type = Type.GetType(str);
if (type != null)
{
m_arSpellAttack.Add(type);
}
}
iCount = reader.ReadInt();
for (i = 0; i < iCount; i++)
{
string str = reader.ReadString();
Type type = Type.GetType(str);
if (type != null)
{
m_arSpellDefense.Add(type);
}
}
}
else
{
m_iRangeHome = 0;
}
if (version >= 2)
{
m_FightMode = (FightMode)reader.ReadInt();
m_bControlled = reader.ReadBool();
m_ControlMaster = reader.ReadMobile();
m_ControlTarget = reader.ReadMobile();
m_ControlDest = reader.ReadPoint3D();
m_ControlOrder = (OrderType)reader.ReadInt();
m_dMinTameSkill = reader.ReadDouble();
if (version < 9)
{
reader.ReadDouble();
}
m_bTamable = reader.ReadBool();
m_bSummoned = reader.ReadBool();
if (m_bSummoned)
{
m_SummonEnd = reader.ReadDeltaTime();
new UnsummonTimer(m_ControlMaster, this, m_SummonEnd - DateTime.UtcNow).Start();
}
m_iControlSlots = reader.ReadInt();
}
else
{
m_FightMode = FightMode.Closest;
m_bControlled = false;
m_ControlMaster = null;
m_ControlTarget = null;
m_ControlOrder = OrderType.None;
}
if (version >= 3)
{
m_Loyalty = reader.ReadInt();
}
else
{
m_Loyalty = MaxLoyalty; // Wonderfully Happy
}
if (version >= 4)
{
m_CurrentWayPoint = reader.ReadItem() as WayPoint;
}
if (version >= 5)
{
m_SummonMaster = reader.ReadMobile();
}
if (version >= 6)
{
m_HitsMax = reader.ReadInt();
m_StamMax = reader.ReadInt();
m_ManaMax = reader.ReadInt();
m_DamageMin = reader.ReadInt();
m_DamageMax = reader.ReadInt();
}
if (version >= 7)
{
m_PhysicalResistance = reader.ReadInt();
m_PhysicalDamage = reader.ReadInt();
m_FireResistance = reader.ReadInt();
m_FireDamage = reader.ReadInt();
m_ColdResistance = reader.ReadInt();
m_ColdDamage = reader.ReadInt();
m_PoisonResistance = reader.ReadInt();
m_PoisonDamage = reader.ReadInt();
m_EnergyResistance = reader.ReadInt();
m_EnergyDamage = reader.ReadInt();
}
if (version >= 8)
{
m_Owners = reader.ReadStrongMobileList();
}
else
{
m_Owners = new List<Mobile>();
}
if (version >= 10)
{
m_IsDeadPet = reader.ReadBool();
m_IsBonded = reader.ReadBool();
m_BondingBegin = reader.ReadDateTime();
m_OwnerAbandonTime = reader.ReadDateTime();
}
if (version >= 11)
{
m_HasGeneratedLoot = reader.ReadBool();
}
else
{
m_HasGeneratedLoot = true;
}
if (version >= 12)
{
m_Paragon = reader.ReadBool();
}
else
{
m_Paragon = false;
}
if (version >= 13 && reader.ReadBool())
{
m_Friends = reader.ReadStrongMobileList();
}
else if (version < 13 && m_ControlOrder >= OrderType.Unfriend)
{
++m_ControlOrder;
}
if (version < 16 && Loyalty != MaxLoyalty)
{
Loyalty *= 10;
}
double activeSpeed = m_dActiveSpeed;
double passiveSpeed = m_dPassiveSpeed;
if (version >= 28)
{
SpeedInfo.GetSpeedsNew(this, ref activeSpeed, ref passiveSpeed);
m_dActiveSpeed = activeSpeed;
m_dPassiveSpeed = passiveSpeed;
}
else
{
SpeedInfo.GetSpeeds(this, ref activeSpeed, ref passiveSpeed);
bool isStandardActive = false;
for (int i = 0; !isStandardActive && i < m_StandardActiveSpeeds.Length; ++i)
{
isStandardActive = (m_dActiveSpeed == m_StandardActiveSpeeds[i]);
}
bool isStandardPassive = false;
for (int i = 0; !isStandardPassive && i < m_StandardPassiveSpeeds.Length; ++i)
{
isStandardPassive = (m_dPassiveSpeed == m_StandardPassiveSpeeds[i]);
}
if (isStandardActive && m_dCurrentSpeed == m_dActiveSpeed)
{
m_dCurrentSpeed = activeSpeed;
}
else if (isStandardPassive && m_dCurrentSpeed == m_dPassiveSpeed)
{
m_dCurrentSpeed = passiveSpeed;
}
if (isStandardActive && !m_Paragon)
{
m_dActiveSpeed = activeSpeed;
}
if (isStandardPassive && !m_Paragon)
{
m_dPassiveSpeed = passiveSpeed;
}
}
if (version >= 14)
{
m_RemoveIfUntamed = reader.ReadBool();
m_RemoveStep = reader.ReadInt();
}
TimeSpan deleteTime = TimeSpan.Zero;
if (version >= 17)
{
deleteTime = reader.ReadTimeSpan();
}
if (deleteTime > TimeSpan.Zero || LastOwner != null && !Controlled && !IsStabled)
{
if (deleteTime == TimeSpan.Zero)
{
deleteTime = TimeSpan.FromDays(3.0);
}
m_DeleteTimer = new DeleteTimer(this, deleteTime);
m_DeleteTimer.Start();
}
if (version >= 18)
{
m_CorpseNameOverride = reader.ReadString();
}
if (version >= 19)
{
m_Allured = reader.ReadBool();
}
if (version <= 20)
{
reader.ReadInt();
}
if (version < 26)
{
CanMove = true;
ApproachWait = false;
ApproachRange = 10;
}
if (version >= 22)
{
m_EngravedText = reader.ReadString();
}
if (version == 23)
{
reader.ReadBool();
}
if (version >= 24)
{
ControlSlotsMin = reader.ReadInt();
ControlSlotsMax = reader.ReadInt();
Mastery = (SkillName)reader.ReadInt();
if (reader.ReadInt() == 1)
{
_Profile = new AbilityProfile(this, reader);
}
if (reader.ReadInt() == 1)
{
_TrainingProfile = new TrainingProfile(this, reader);
}
}
else
{
if (Tamable)
{
CalculateSlots(m_iControlSlots);
if (m_iControlSlots < ControlSlotsMin)
{
ControlSlotsMin = m_iControlSlots;
}
ControlSlots = ControlSlotsMin;
}
InitializeAbilities();
}
if (version >= 25)
{
CurrentTameSkill = reader.ReadDouble();
if (Controlled && version == 26)
{
AdjustTameRequirements();
}
else if (Controlled && CurrentTameSkill > MaxTameRequirement)
{
CurrentTameSkill = MaxTameRequirement;
}
}
else
{
AdjustTameRequirements();
}
if (version <= 14 && m_Paragon && Hue == 0x31)
{
Hue = Paragon.Hue; //Paragon hue fixed, should now be 0x501.
}
CheckStatTimers();
ChangeAIType(m_CurrentAI);
AddFollowers();
if (IsAnimatedDead)
{
AnimateDeadSpell.Register(m_SummonMaster, this);
}
if (Tamable && CurrentTameSkill == 0)
{
AdjustTameRequirements();
}
}
And here is the change I was referencing..
I can remove the souldbound portion and it loads fine but if I save and restart it wants to delete all my creatures so clearly I'm not merging those changes right..