Full Version : how do I remove the beatdown to tame?
xmlspawner >>Scripting Support >>how do I remove the beatdown to tame?


<< Prev | Next >>

Crystal Jem- 07-12-2006
Good Morning all,


it seams I somehow have gotten it that the mount and new wyrm i have scripted need to be beatten down when i didn't want that, but i do not see what i need to change. is there an overwrite phraze i need to add?

Thank you.


Zyle- 07-12-2006
I'm at work so I can't check - but I *think* there is a bool which you can just set to false. I have a feeling there will be a line saying something like:
subdue = true;

and then change that to false, or alternatively post the script(s) you are having trouble with, and it will be easier to help you out.

Crystal Jem- 07-12-2006
QUOTE (Zyle @ July 12, 2006 01:54 pm)
I'm at work so I can't check - but I *think* there is a bool which you can just set to false. I have a feeling there will be a line saying something like:
subdue = true;

and then change that to false, or alternatively post the script(s) you are having trouble with, and it will be easier to help you out.

I looked and still don't see where it is, here's one of the cripts there all the same but for names and loot.


[CODE]sing System;
using Server.Items;
using Server.Mobiles;

namespace Server.Mobiles
{
[CorpseName( "a crystal steed corpse" )]
public class AmberCrystalSteed : BaseMount
{
[Constructable]
public AmberCrystalSteed() : this("an Amber crystal steed" )
{
}

public override WeaponAbility GetWeaponAbility()
{
return WeaponAbility.BleedAttack;
}

[Constructable]
public AmberCrystalSteed( string name ) : base( name, 0x74, 0x3EA7, AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
{

BaseSoundID = 0xA8;
Hue = 0x30;

SetStr( 900, 1000 );
SetDex( 500, 600 );
SetInt( 800, 900 );

SetHits( 1000, 1250 );

SetDamage( 20, 40 );

SetDamageType( ResistanceType.Physical, 100 );
SetDamageType( ResistanceType.Fire, 100 );

SetResistance( ResistanceType.Physical, 90, 110 );
SetResistance( ResistanceType.Fire, 90, 110 );
SetResistance( ResistanceType.Cold, 90, 110 );
SetResistance( ResistanceType.Poison, 90, 110 );
SetResistance( ResistanceType.Energy, 90, 110 );

SkillsCap = 16000;

Skills[SkillName.Tactics].Cap = 200.0;
Skills[SkillName.Wrestling].Cap = 200.0;
Skills[SkillName.MagicResist].Cap = 200.0;
Skills[SkillName.Anatomy].Cap = 200.0;
Skills[SkillName.Magery].Cap = 200.0;
Skills[SkillName.EvalInt].Cap = 200.0;
Skills[SkillName.Parry].Cap = 200.0;

SetSkill( SkillName.MagicResist, 110.0, 120.0 );
SetSkill( SkillName.Tactics, 120.0 );
SetSkill( SkillName.Wrestling, 120.0 );
SetSkill( SkillName.Magery, 120.0 );
SetSkill( SkillName.Parry, 90.0 );
SetSkill( SkillName.EvalInt, 90.0 );

Fame = 25000;
Karma = -25000;

VirtualArmor = 84;

Tamable = true;
ControlSlots = 3;
MinTameSkill = 106.0;
}

public override void GenerateLoot()
{
PackItem( new AmberCrystal( Utility.RandomMinMax( 20, 50 ) ) );
PackItem( new SulfurousAsh( Utility.RandomMinMax( 151, 300 ) ) );
PackItem( new Amber( Utility.RandomMinMax( 16, 30 ) ) );
PackItem( new Gold( Utility.RandomMinMax( 1600, 3000 ) ) );
}

public override bool HasBreath{ get{ return true; } } // fire breath enabled
public override FoodType FavoriteFood{ get{ return FoodType.Meat; } }
public override PackInstinct PackInstinct{ get{ return PackInstinct.Equine; } }

public override Poison PoisonImmune{ get{ return Poison.Lethal; } }
public override int TreasureMapLevel{ get{ return 6; } }

public AmberCrystalSteed( 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();

if ( BaseSoundID <= 0 )
BaseSoundID = 0xA8;
}
}
}



Zyle- 07-12-2006
Unless I've gone entirely blind I can't see anything in there which would make you have to subdue it before you tame it.

This line is from the script for a giant beetle and is what makes you have to subdue first:

CODE
public override bool SubdueBeforeTame{ get{ return true; } } // Must be beaten into submission


but that line isn't in your code and I can't see anything else which would cause it sad.gif

Haazen- 07-12-2006
If infact this critter requires subdue, the code line referred to by Zyle has to be up stream. Check you BaseMount.cs for the line.

Crystal Jem- 07-12-2006
QUOTE (Haazen @ July 12, 2006 09:25 pm)
If infact this critter requires subdue, the code line referred to by Zyle has to be up stream. Check you BaseMount.cs for the line.

I can't see it still maybe i'm going blind also. heres my bacemount.

[CODE]using System;
using System.Collections;
using Server;

namespace Server.Mobiles
{
public abstract class BaseMount : BaseCreature, IMount
{
private Mobile m_Rider;
private Item m_InternalItem;
private DateTime m_NextMountAbility;

public virtual TimeSpan MountAbilityDelay { get { return TimeSpan.Zero; } }

[CommandProperty( AccessLevel.GameMaster )]
public DateTime NextMountAbility
{
get { return m_NextMountAbility; }
set { m_NextMountAbility = value; }
}

public virtual bool AllowMaleRider{ get{ return true; } }
public virtual bool AllowFemaleRider{ get{ return true; } }

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 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 );
}

[Hue, CommandProperty( AccessLevel.GameMaster )]
public override int Hue
{
get
{
return base.Hue;
}
set
{
base.Hue = value;

if ( m_InternalItem != null )
m_InternalItem.Hue = value;
}
}

public override bool OnBeforeDeath()
{
Rider = null;

return base.OnBeforeDeath();
}

public override void OnAfterDelete()
{
if ( m_InternalItem != null )
m_InternalItem.Delete();

m_InternalItem = null;

base.OnAfterDelete();
}

public override void OnDelete()
{
Rider = null;

base.OnDelete();
}

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 virtual void OnDisallowedRider( Mobile m )
{
m.SendMessage( "You may not ride this creature." );
}

public override void OnDoubleClick( Mobile from )
{
if ( IsDeadPet )
return;

if ( from.IsBodyMod && !from.Body.IsHuman )
{
if ( Core.AOS ) // You cannot ride a mount in your current form.
PrivateOverheadMessage( Network.MessageType.Regular, 0x3B2, 1062061, from.NetState );
else
from.SendLocalizedMessage( 1061628 ); // You can't do that while polymorphed.

return;
}

if ( !CheckMountAllowed( from, true ) )
return;

if ( from.Mounted )
{
from.SendLocalizedMessage( 1005583 ); // Please dismount first.
return;
}

if ( from.Female ? !AllowFemaleRider : !AllowMaleRider )
{
OnDisallowedRider( from );
return;
}

if ( !Multis.DesignContext.Check( from ) )
return;

if ( from.HasTrade )
{
from.SendLocalizedMessage( 1042317, "", 0x41 ); // You may not ride at this time
return;
}

if ( from.InRange( this, 1 ) )
{
bool canAccess = ( from.AccessLevel >= AccessLevel.GameMaster )
|| ( Controlled && ControlMaster == from )
|| ( Summoned && SummonMaster == from );

if ( canAccess )
{
if ( this.Poisoned )
PrivateOverheadMessage( Network.MessageType.Regular, 0x3B2, 1049692, from.NetState ); // This mount is too ill to ride.
else
Rider = from;
}
else if ( !Controlled && !Summoned )
{
// That mount does not look broken! You would have to tame it to ride it.
PrivateOverheadMessage( Network.MessageType.Regular, 0x3B2, 501263, from.NetState );
}
else
{
// This isn't your mount; it refuses to let you ride.
PrivateOverheadMessage( Network.MessageType.Regular, 0x3B2, 501264, from.NetState );
}
}
else
{
from.SendLocalizedMessage( 500206 ); // That is too far away to ride.
}
}

[CommandProperty( AccessLevel.GameMaster )]
public int ItemID
{
get
{
if ( m_InternalItem != null )
return m_InternalItem.ItemID;
else
return 0;
}
set
{
if ( m_InternalItem != null )
m_InternalItem.ItemID = value;
}
}

public static void Dismount( Mobile m )
{
IMount mount = m.Mount;

if ( mount != null )
mount.Rider = null;
}

[CommandProperty( AccessLevel.GameMaster )]
public Mobile Rider
{
get
{
return m_Rider;
}
set
{
if ( m_Rider != value )
{
if ( value == null )
{
Point3D loc = m_Rider.Location;
Map map = m_Rider.Map;

if ( map == null || map == Map.Internal )
{
loc = m_Rider.LogoutLocation;
map = m_Rider.LogoutMap;
}

Direction = m_Rider.Direction;
Location = loc;
Map = map;

if ( m_InternalItem != null )
m_InternalItem.Internalize();
}
else
{
if ( m_Rider != null )
Dismount( m_Rider );

Dismount( value );

if ( m_InternalItem != null )
value.AddItem( m_InternalItem );

value.Direction = this.Direction;

Internalize();
}

m_Rider = value;
}
}
}

private class BlockEntry
{
public BlockMountType m_Type;
public DateTime m_Expiration;

public bool IsExpired{ get{ return ( DateTime.Now >= m_Expiration ); } }

public BlockEntry( BlockMountType type, DateTime expiration )
{
m_Type = type;
m_Expiration = expiration;
}
}

private static Hashtable m_Table = new Hashtable();

public static void SetMountPrevention( Mobile mob, BlockMountType type, TimeSpan duration )
{
if ( mob == null )
return;

DateTime expiration = DateTime.Now + duration;

BlockEntry entry = m_Table[mob] as BlockEntry;

if ( entry != null )
{
entry.m_Type = type;
entry.m_Expiration = expiration;
}
else
{
m_Table[mob] = entry = new BlockEntry( type, expiration );
}
}

public static void ClearMountPrevention( Mobile mob )
{
if ( mob != null )
m_Table.Remove( mob );
}

public static BlockMountType GetMountPrevention( Mobile mob )
{
if ( mob == null )
return BlockMountType.None;

BlockEntry entry = m_Table[mob] as BlockEntry;

if ( entry == null )
return BlockMountType.None;

if ( entry.IsExpired )
{
m_Table.Remove( mob );
return BlockMountType.None;
}

return entry.m_Type;
}

public static bool CheckMountAllowed( Mobile mob, bool message )
{
BlockMountType type = GetMountPrevention( mob );

if ( type == BlockMountType.None )
return true;

if ( message )
{
switch ( type )
{
case BlockMountType.Dazed:
{
mob.SendLocalizedMessage( 1040024 ); // You are still too dazed from being knocked off your mount to ride!
break;
}
case BlockMountType.BolaRecovery:
{
mob.SendLocalizedMessage( 1062910 ); // You cannot mount while recovering from a bola throw.
break;
}
case BlockMountType.DismountRecovery:
{
mob.SendLocalizedMessage( 1070859 ); // You cannot mount while recovering from a dismount special maneuver.
break;
}
}
}

return false;
}

public virtual void OnRiderDamaged( int amount, Mobile from, bool willKill )
{
if( m_Rider == null )
return;

Mobile attacker = from;
if( attacker == null )
attacker = m_Rider.FindMostRecentDamager( true );

if( !(attacker == this || attacker == m_Rider || willKill || DateTime.Now < m_NextMountAbility) )
{
if( DoMountAbility( amount, from ) )
m_NextMountAbility = DateTime.Now + MountAbilityDelay;

}
}

public virtual bool DoMountAbility( int damage, Mobile attacker )
{
return false;
}
}

public class MountItem : Item, IMountItem
{
private BaseMount m_Mount;

public MountItem( BaseMount mount, int itemID ) : base( itemID )
{
Layer = Layer.Mount;
Movable = false;

m_Mount = mount;
}

public MountItem( Serial serial ) : base( serial )
{
}

public override void OnAfterDelete()
{
if ( m_Mount != null )
m_Mount.Delete();

m_Mount = null;

base.OnAfterDelete();
}

public override DeathMoveResult OnParentDeath(Mobile parent)
{
if ( m_Mount != null )
m_Mount.Rider = null;

return DeathMoveResult.RemainEquiped;
}

public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );

writer.Write( (int) 0 ); // version

writer.Write( m_Mount );
}

public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );

int version = reader.ReadInt();

switch ( version )
{
case 0:
{
m_Mount = reader.ReadMobile() as BaseMount;

if ( m_Mount == null )
Delete();

break;
}
}
}

public IMount Mount
{
get
{
return m_Mount;
}
}
}

public enum BlockMountType
{
None = -1,
Dazed,
BolaRecovery,
DismountRecovery
}
}

Let me know if you need the script to try it out.
Thank you

Haazen- 07-13-2006
Again there is nothing here to require subduebeforetame in this script.
Do a search through all the scripts for the words SubdueBeforeTame. You are using RunUO version 2. In version 2 that phrase in only in BaseCreature.cs AnimalTaming.cs and the different critters that require beat down. The next script up the chain is basecreature.cs. But if that script has public virtual bool SubdueBeforeTame{ get{ return true; } } all critters would require beatdown before tameing.

I will ask a stupid question. You are talking about beat to submission while trying to tame this critter? Have you installed any different BaseCreature.cs or Taming.cs or are these distro RunUO files?

Test taming on some other critters too.

ArteGordon- 07-13-2006
are you actually getting this message when you try to tame?

"You must subdue this creature before you can tame it!"

If not, then the creature does not need to be subdues.

Crystal Jem- 07-14-2006
QUOTE (ArteGordon @ July 13, 2006 05:06 pm)
are you actually getting this message when you try to tame?

"You must subdue this creature before you can tame it!"

If not, then the creature does not need to be subdues.

No it's is you have no chance of tameing this creature.


I know i set all my admins skills to 200 but i can't log on right now to check if i forgot yhe skillscap.

ArteGordon- 07-14-2006
QUOTE (Crystal Jem @ July 14, 2006 12:21 pm)
QUOTE (ArteGordon @ July 13, 2006 05:06 pm)
are you actually getting this message when you try to tame?

"You must subdue this creature before you can tame it!"

If not, then the creature does not need to be subdues.

No it's is you have no chance of tameing this creature.


I know i set all my admins skills to 200 but i can't log on right now to check if i forgot yhe skillscap.

yeah, that message means that you dont need to subdue it first. You just dont have the skill.
I'm sure that it is just an issue with the cap.

Crystal Jem- 07-14-2006
QUOTE (ArteGordon @ July 14, 2006 04:23 pm)
QUOTE (Crystal Jem @ July 14, 2006 12:21 pm)
QUOTE (ArteGordon @ July 13, 2006 05:06 pm)
are you actually getting this message when you try to tame?

"You must subdue this creature before you can tame it!"

If not, then the creature does not need to be subdues.

No it's is you have no chance of tameing this creature.


I know i set all my admins skills to 200 but i can't log on right now to check if i forgot yhe skillscap.

yeah, that message means that you dont need to subdue it first. You just dont have the skill.
I'm sure that it is just an issue with the cap.

Cool thanks Arte. I think i can handle that one lol