using System;
using Server.Items;
using Server.Network;
using System.Collections.Generic;
namespace Server.Mobiles
{
public enum BlockMountType
{
None = -1,
Dazed,
BolaRecovery,
DismountRecovery,
RidingSwipe,
RidingSwipeEthereal,
RidingSwipeFlying
}
public abstract class BaseMount : FlyingCreature, IMount
{
private static Dictionary<Mobile, BlockEntry> m_Table = new Dictionary<Mobile, BlockEntry>();
private Mobile m_Rider;
private Item m_InternalItem;
private DateTime m_NextMountAbility;
public BaseMount(string name, int bodyID, int itemID, AIType aiType, FightMode fightMode, int rangePerception, int rangeFight, double activeSpeed, double passiveSpeed)
: base(aiType, fightMode, rangePerception, rangeFight, activeSpeed, passiveSpeed)
{
Name = name;
Body = bodyID;
m_InternalItem = new MountItem(this, itemID);
}
public BaseMount(Serial serial)
: base(serial)
{
}
public virtual TimeSpan MountAbilityDelay
{
get
{
return TimeSpan.Zero;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)1); // version
writer.Write(m_NextMountAbility);
writer.Write(m_Rider);
writer.Write(m_InternalItem);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch ( version )
{
case 1:
{
m_NextMountAbility = reader.ReadDateTime();
goto case 0;
}
case 0:
{
m_Rider = reader.ReadMobile();
m_InternalItem = reader.ReadItem();
if (m_InternalItem == null)
Delete();
break;
}
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(25); // version
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);
// Removed in version 9
//writer.Write( (double) m_dMaxTameSkill );
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);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
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;
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 >= 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();
}
else
{
AdjustTameRequirements();
}
if (version <= 14 && m_Paragon && Hue == 0x31)
{
Hue = Paragon.Hue; //Paragon hue fixed, should now be 0x501.
}
if (Core.AOS && NameHue == 0x35)
{
NameHue = -1;
}
CheckStatTimers();
ChangeAIType(m_CurrentAI);
AddFollowers();
if (IsAnimatedDead)
{
AnimateDeadSpell.Register(m_SummonMaster, this);
}
if (Tamable && CurrentTameSkill == 0)
{
AdjustTameRequirements();
}
}
For those who would like to use it on a fresh install (current release) take files below and replace them.
Got it running with these edits yesterday.
I can't get this script to work either. I merged the three files and it still throws all kinds of errors.
Where do I put this kind of@Safera. Early X-mas. Enjoy!
Pegasus - H anim slot.
PegasusMount - P anim slot.
Credit to someone over on RunUO, might have been Thagoras, but it's been a while and I forget.
Ok how and what program do you use to open this type of .VD file?@Safera. Early X-mas. Enjoy!
Pegasus - H anim slot.
PegasusMount - P anim slot.
Credit to someone over on RunUO, might have been Thagoras, but it's been a while and I forget.
It has a max height. Unicorns fly without wings (so do Nightmares...although I don't have either set up to).
@Safera. Early X-mas. Enjoy!
Pegasus - H anim slot.
PegasusMount - P anim slot.
Credit to someone over on RunUO, might have been Thagoras, but it's been a while and I forgetThat is my pegesus mount f
That is my pegasus mount from many many years ago lool i also did and armored horse mount i didnt think it turned out that great wow cant believe someone still has that animation lol@Safera. Early X-mas. Enjoy!
Pegasus - H anim slot.
PegasusMount - P anim slot.
Credit to someone over on RunUO, might have been Thagoras, but it's been a while and I forget.
The pegasus was done a very long time ago where one vd is for just the creature unmounted and the other vd file is for equipment slot like the old horses were handled as a mountOk. You can *actually* fly except for the phoenix, who doesn't have a gump for some reason.
[doublepost=1503108841][/doublepost]I'd like to use the Pegasus mob but the rar has two VD file types. I don't know how to use those.
You would have to go into each .bmp and edit them then recompile the .vd file. I had to manually take harpy wings hue them and place them on a horse frame for each frame in the animation so it took some work, so its not an easy fix.Is there any way to fix this? The character's legs cover the wings.
In theory it should work but you could also just use a white horse body and not the pegasus since thats all i used to make the pegasus. You just wouldnt have the feet pull up during the flying mode. ut you might get double wings if using the pegasus model since i made it with the feet pulled up during fast run flyingIf I make a .vd only with the wing to hide the body
when the character rides on the Pegasus, and I add in my script that it also equips the animation of the wing.
And if I place this wing on layer 15? (talisman or that of the face) would this allow me to perfectly hide the body?
This was mine from like 2004 or so lol long time ago maybe 2003 I was JoshW back in the RunUo forums@Safera. Early X-mas. Enjoy!
Pegasus - H anim slot.
PegasusMount - P anim slot.
Credit to someone over on RunUO, might have been Thagoras, but it's been a while and I forget.
We use essential cookies to make this site work, and optional cookies to enhance your experience.