380 lines
8.5 KiB
Plaintext
380 lines
8.5 KiB
Plaintext
//Werewolf mounts By:OtimPyre 6-28-06
|
|
using System;
|
|
using Server.Mobiles;
|
|
using Server.Items;
|
|
using Server.ContextMenus;
|
|
using Server.Spells.Seventh;
|
|
using Server.Spells.Fifth;
|
|
using System.Collections.Generic;
|
|
|
|
|
|
namespace Server.Mobiles
|
|
{
|
|
[CorpseName( "A Werewolf's Corpse" )]
|
|
public class Werewolf : BaseMount
|
|
{
|
|
public override WeaponAbility GetWeaponAbility()
|
|
{
|
|
return WeaponAbility.BleedAttack;
|
|
}
|
|
[Constructable]
|
|
public Werewolf() : this( "Ignor this but don't delete" )
|
|
{
|
|
}
|
|
|
|
[Constructable]
|
|
public Werewolf( string name ) : base( name, 277, 0x3e91, AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )//mounted nightmare
|
|
{
|
|
Title = "The Werewolf";
|
|
Hue = Utility.RandomList ( 0, 2310, 1175, 1109 );
|
|
BaseSoundID = 1248;
|
|
|
|
if ( this.Female = Utility.RandomBool() )//this is the random sex of unmounted mobile
|
|
{
|
|
Body = 0x191;
|
|
Name = NameList.RandomName( "female" );
|
|
}
|
|
else
|
|
{
|
|
Body = 0x190;
|
|
Name = NameList.RandomName( "male" );
|
|
}
|
|
|
|
|
|
SetStr( 496, 525 );
|
|
SetDex( 86, 105 );
|
|
SetInt( 86, 125 );
|
|
|
|
SetHits( 298, 315 );
|
|
|
|
SetDamage( 16, 22 );
|
|
|
|
SetDamageType( ResistanceType.Physical, 40 );
|
|
SetDamageType( ResistanceType.Fire, 40 );
|
|
SetDamageType( ResistanceType.Energy, 20 );
|
|
|
|
SetResistance( ResistanceType.Physical, 55, 65 );
|
|
SetResistance( ResistanceType.Fire, 30, 40 );
|
|
SetResistance( ResistanceType.Cold, 30, 40 );
|
|
SetResistance( ResistanceType.Poison, 30, 40 );
|
|
SetResistance( ResistanceType.Energy, 20, 30 );
|
|
|
|
SetSkill( SkillName.EvalInt, 10.4, 50.0 );
|
|
SetSkill( SkillName.Magery, 10.4, 50.0 );
|
|
SetSkill( SkillName.MagicResist, 85.3, 100.0 );
|
|
SetSkill( SkillName.Tactics, 97.6, 100.0 );
|
|
SetSkill( SkillName.Wrestling, 80.5, 92.5 );
|
|
|
|
Fame = 5;
|
|
Karma = 5;
|
|
|
|
VirtualArmor = 70;
|
|
|
|
Tamable = true;
|
|
ControlSlots = 4;
|
|
MinTameSkill = 95.1;
|
|
|
|
|
|
AddItem( new Sandals(1) );//This is their only rare drop Unless you comment out the movable : false
|
|
|
|
int hue = Utility.RandomMinMax( 1410, 1450 ); //Random Zog Green
|
|
|
|
|
|
Item chest = new ChainChest();
|
|
chest.Hue = hue;
|
|
chest.Movable = false;//can remove this to make Zog Green colored armored drop
|
|
AddItem( chest );
|
|
|
|
Item gloves = new LeatherGloves();
|
|
gloves.Hue = hue;
|
|
gloves.Movable = false;//can remove this to make Zog Green colored armored drop
|
|
AddItem( gloves );
|
|
|
|
Item legs = new ChainLegs();
|
|
legs.Hue = hue;
|
|
legs.Movable = false;//can remove this to make Zog Green colored armored drop
|
|
AddItem( legs );
|
|
|
|
|
|
Item hair = new Item( Utility.RandomList( 0x203B, 0x203C, 0x203D, 0x2049 ) );
|
|
hair.Hue = 0;
|
|
hair.Layer = Layer.Hair;
|
|
hair.Movable = false;
|
|
AddItem( hair );
|
|
|
|
Container pack = Backpack;
|
|
|
|
if ( pack != null )
|
|
pack.Delete();
|
|
|
|
pack = new StrongBackpack();
|
|
pack.Movable = false;
|
|
|
|
AddItem( pack );
|
|
|
|
}
|
|
|
|
public override int GetAngerSound()
|
|
{
|
|
return 1249;
|
|
}
|
|
|
|
public override int GetIdleSound()
|
|
{
|
|
return 1251;
|
|
}
|
|
|
|
public override int GetAttackSound()
|
|
{
|
|
return 1249;
|
|
}
|
|
|
|
public override int GetHurtSound()
|
|
{
|
|
return 233;
|
|
}
|
|
|
|
public override int GetDeathSound()
|
|
{
|
|
return 230;
|
|
}
|
|
|
|
//public override double GetControlChance( Mobile m )
|
|
//{
|
|
// return 1.0;
|
|
//}
|
|
|
|
public override void GenerateLoot()
|
|
{
|
|
AddLoot( LootPack.Rich );
|
|
AddLoot( LootPack.Average );
|
|
AddLoot( LootPack.LowScrolls );
|
|
AddLoot( LootPack.Potions );
|
|
}
|
|
|
|
public override bool HasBreath{ get{ return true; } } // fire breath enabled
|
|
public override FoodType FavoriteFood{ get{ return FoodType.Meat; } }
|
|
|
|
public void Polymorph( Mobile m )
|
|
{
|
|
if ( !m.CanBeginAction( typeof( PolymorphSpell ) ) || !m.CanBeginAction( typeof( IncognitoSpell ) ) || m.IsBodyMod )
|
|
return;
|
|
|
|
IMount mount = m.Mount;
|
|
|
|
if ( mount != null )
|
|
mount.Rider = null;
|
|
|
|
if ( m.Mounted )
|
|
return;
|
|
|
|
if ( m.BeginAction( typeof( PolymorphSpell ) ) )
|
|
{
|
|
Item disarm = m.FindItemOnLayer( Layer.OneHanded );
|
|
|
|
if ( disarm != null && disarm.Movable )
|
|
m.AddToBackpack( disarm );
|
|
|
|
disarm = m.FindItemOnLayer( Layer.TwoHanded );
|
|
|
|
if ( disarm != null && disarm.Movable )
|
|
m.AddToBackpack( disarm );
|
|
|
|
m.BodyMod = 277;
|
|
m.HueMod = 0;
|
|
|
|
new ExpirePolymorphTimer( m ).Start();
|
|
}
|
|
}
|
|
|
|
private class ExpirePolymorphTimer : Timer
|
|
{
|
|
private Mobile m_Owner;
|
|
|
|
public ExpirePolymorphTimer( Mobile owner ) : base( TimeSpan.FromMinutes( 3.0 ) )
|
|
{
|
|
m_Owner = owner;
|
|
|
|
Priority = TimerPriority.OneSecond;
|
|
}
|
|
|
|
protected override void OnTick()
|
|
{
|
|
if ( !m_Owner.CanBeginAction( typeof( PolymorphSpell ) ) )
|
|
{
|
|
m_Owner.BodyMod = 0;
|
|
m_Owner.HueMod = -1;
|
|
m_Owner.EndAction( typeof( PolymorphSpell ) );
|
|
}
|
|
}
|
|
}
|
|
|
|
public void DoSpecialAbility( Mobile target )
|
|
{
|
|
if ( Hits < 500 && !IsBodyMod ) // Werewolf is low on life, polymorph into a CuSidhe
|
|
Polymorph( this );
|
|
}
|
|
|
|
public override void OnGotMeleeAttack( Mobile attacker )
|
|
{
|
|
base.OnGotMeleeAttack( attacker );
|
|
|
|
DoSpecialAbility( attacker );
|
|
}
|
|
|
|
public override void OnGaveMeleeAttack( Mobile defender )
|
|
{
|
|
base.OnGaveMeleeAttack( defender );
|
|
|
|
DoSpecialAbility( defender );
|
|
}
|
|
|
|
public override void OnDamagedBySpell( Mobile caster )
|
|
{
|
|
base.OnDamagedBySpell( caster );
|
|
DoSpecialAbility( caster );
|
|
|
|
}
|
|
|
|
public Werewolf( Serial serial ) : base( serial )
|
|
{
|
|
}
|
|
|
|
#region Pack Animal Methods
|
|
public override bool OnBeforeDeath()
|
|
{
|
|
if ( !base.OnBeforeDeath() )
|
|
return false;
|
|
|
|
PackAnimal.CombineBackpacks( this );
|
|
|
|
return true;
|
|
}
|
|
|
|
public override DeathMoveResult GetInventoryMoveResultFor( Item item )
|
|
{
|
|
return DeathMoveResult.MoveToCorpse;
|
|
}
|
|
|
|
public override bool IsSnoop( Mobile from )
|
|
{
|
|
if ( PackAnimal.CheckAccess( this, from ) )
|
|
return false;
|
|
|
|
return base.IsSnoop( from );
|
|
}
|
|
|
|
public override bool OnDragDrop( Mobile from, Item item )
|
|
{
|
|
if ( CheckFeed( from, item ) )
|
|
return true;
|
|
|
|
if ( PackAnimal.CheckAccess( this, from ) )
|
|
{
|
|
AddToBackpack( item );
|
|
return true;
|
|
}
|
|
|
|
return base.OnDragDrop( from, item );
|
|
}
|
|
|
|
public override bool CheckNonlocalDrop( Mobile from, Item item, Item target )
|
|
{
|
|
return PackAnimal.CheckAccess( this, from );
|
|
}
|
|
|
|
public override bool CheckNonlocalLift( Mobile from, Item item )
|
|
{
|
|
return PackAnimal.CheckAccess( this, from );
|
|
}
|
|
|
|
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.
|
|
}
|
|
}
|
|
|
|
public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
|
|
{
|
|
base.GetContextMenuEntries( from, list );
|
|
|
|
PackAnimal.GetContextMenuEntries( this, from, list );
|
|
}
|
|
#endregion
|
|
|
|
public override void Serialize( GenericWriter writer )
|
|
{
|
|
base.Serialize( writer );
|
|
writer.Write( (int) 0 );
|
|
}
|
|
|
|
public override void Deserialize( GenericReader reader )
|
|
{
|
|
base.Deserialize( reader );
|
|
int version = reader.ReadInt();
|
|
}
|
|
}
|
|
} |