Lots of fixes, changes, rewrites of various things, including but not limited to:

Logging of staff crafting items,
Fixes for the OSI client changes
The potion stacking stuff
BaseWeapon fix, so that damage increase things don't multiply themselves.
admin gump fixes for Firewall
Various display tweaks for weight
SoS no longer spawn in Tokuno
Hiryu hues happified to OSI standards
staff now see alliance chat correctly
Play barkeeper text increased per OSI
Various other OSI skill requirement changes
Various unimplemented features of the SE moves
EventSink for when the client version is received from client.
Client validation moved out of the core.
Client version validation now has options to ignore/kick/warn/annoy.  Automagically tries to detect current client.
Reverted the delayeddamagecontext back to OSI standards.
Can no longer use bags of sending in jail.

MagerySpell implemented. Now only Magery spells have a circle, and various other properties of 'em.
TransformationSpellHelper now implemented.  Things moved around for this.
Spells now need a Timespan for the cast delay, instead of arbitrarily based on Circle.  Circle doesn't make sense for non-Magery spells!
Alot of the spellweaving spells added to OSI standards.
This commit is contained in:
asayre 2007-05-26 03:12:41 +00:00
parent f12e9745c6
commit 2ad37d54aa
214 changed files with 4881 additions and 1243 deletions

View file

@ -19,6 +19,8 @@ namespace Server.Mobiles
set { m_NextMountAbility = value; }
}
protected Item InternalItem { get { return m_InternalItem; } }
public virtual bool AllowMaleRider{ get{ return true; } }
public virtual bool AllowFemaleRider{ get{ return true; } }

View file

@ -17,8 +17,8 @@ namespace Server.Mobiles
[CommandProperty( AccessLevel.GameMaster )]
public bool IsRewardItem
{
get{ return m_IsRewardItem; }
set{ m_IsRewardItem = value; }
get { return m_IsRewardItem; }
set { m_IsRewardItem = value; }
}
public override double DefaultWeight
@ -34,7 +34,8 @@ namespace Server.Mobiles
}
[Constructable]
public EtherealMount( int itemID, int mountID ) : base( itemID )
public EtherealMount( int itemID, int mountID )
: base( itemID )
{
m_MountedID = mountID;
m_RegularID = itemID;
@ -65,11 +66,11 @@ namespace Server.Mobiles
}
set
{
if ( m_MountedID != value )
if( m_MountedID != value )
{
m_MountedID = value;
if ( m_Rider != null )
if( m_Rider != null )
ItemID = value;
}
}
@ -84,77 +85,78 @@ namespace Server.Mobiles
}
set
{
if ( m_RegularID != value )
if( m_RegularID != value )
{
m_RegularID = value;
if ( m_Rider == null )
if( m_Rider == null )
ItemID = value;
}
}
}
public EtherealMount( Serial serial ) : base( serial )
public EtherealMount( Serial serial )
: base( serial )
{
}
public override bool DisplayLootType{ get{ return false; } }
public override bool DisplayLootType { get { return false; } }
public virtual int FollowerSlots{ get{ return 1; } }
public virtual int FollowerSlots { get { return 1; } }
public void RemoveFollowers()
{
if ( m_Rider != null )
if( m_Rider != null )
m_Rider.Followers -= FollowerSlots;
if ( m_Rider != null && m_Rider.Followers < 0 )
if( m_Rider != null && m_Rider.Followers < 0 )
m_Rider.Followers = 0;
}
public void AddFollowers()
{
if ( m_Rider != null )
if( m_Rider != null )
m_Rider.Followers += FollowerSlots;
}
public virtual bool Validate( Mobile from )
{
if ( !IsChildOf( from.Backpack ) )
if( !IsChildOf( from.Backpack ) )
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
return false;
}
else if ( m_IsRewardItem && !Engines.VeteranRewards.RewardSystem.CheckIsUsableBy( from, this, null ) )
else if( m_IsRewardItem && !Engines.VeteranRewards.RewardSystem.CheckIsUsableBy( from, this, null ) )
{
// CheckIsUsableBy sends the message
return false;
}
else if ( !BaseMount.CheckMountAllowed( from, true ) )
else if( !BaseMount.CheckMountAllowed( from, true ) )
{
// CheckMountAllowed sends the message
return false;
}
else if ( from.Mounted )
else if( from.Mounted )
{
from.SendLocalizedMessage( 1005583 ); // Please dismount first.
return false;
}
else if ( from.IsBodyMod && !from.Body.IsHuman )
else if( from.IsBodyMod && !from.Body.IsHuman )
{
from.SendLocalizedMessage( 1061628 ); // You can't do that while polymorphed.
return false;
}
else if ( from.HasTrade )
else if( from.HasTrade )
{
from.SendLocalizedMessage( 1042317, "", 0x41 ); // You may not ride at this time
return false;
}
else if ( (from.Followers + FollowerSlots) > from.FollowersMax )
else if( (from.Followers + FollowerSlots) > from.FollowersMax )
{
from.SendLocalizedMessage( 1049679 ); // You have too many followers to summon your mount.
return false;
}
else if ( !Multis.DesignContext.Check( from ) )
else if( !Multis.DesignContext.Check( from ) )
{
// Check sends the message
return false;
@ -165,7 +167,7 @@ namespace Server.Mobiles
public override void OnDoubleClick( Mobile from )
{
if ( Validate( from ) )
if( Validate( from ) )
new EtherealSpell( this, from ).Cast();
}
@ -173,10 +175,10 @@ namespace Server.Mobiles
{
base.Serialize( writer );
writer.Write( (int) 3 ); // version
writer.Write( (int)3 ); // version
writer.Write( m_IsDonationItem );
writer.Write( (bool) m_IsRewardItem );
writer.Write( (bool)m_IsRewardItem );
writer.Write( (int)m_MountedID );
writer.Write( (int)m_RegularID );
@ -190,35 +192,35 @@ namespace Server.Mobiles
int version = reader.ReadInt();
switch ( version )
switch( version )
{
case 3:
{
m_IsDonationItem = reader.ReadBool();
goto case 2;
}
{
m_IsDonationItem = reader.ReadBool();
goto case 2;
}
case 2:
{
m_IsRewardItem = reader.ReadBool();
goto case 0;
}
{
m_IsRewardItem = reader.ReadBool();
goto case 0;
}
case 1: reader.ReadInt(); goto case 0;
case 0:
{
m_MountedID = reader.ReadInt();
m_RegularID = reader.ReadInt();
m_Rider = reader.ReadMobile();
{
m_MountedID = reader.ReadInt();
m_RegularID = reader.ReadInt();
m_Rider = reader.ReadMobile();
if ( m_MountedID == 0x3EA2 )
m_MountedID = 0x3EAA;
if( m_MountedID == 0x3EA2 )
m_MountedID = 0x3EAA;
break;
}
break;
}
}
AddFollowers();
if ( version < 3 && Weight == 0 )
if( version < 3 && Weight == 0 )
Weight = -1;
}
@ -233,7 +235,7 @@ namespace Server.Mobiles
{
IMount mount = m.Mount;
if ( mount != null )
if( mount != null )
mount.Rider = null;
}
@ -246,9 +248,9 @@ namespace Server.Mobiles
}
set
{
if ( value != m_Rider )
if( value != m_Rider )
{
if ( value == null )
if( value == null )
{
Internalize();
UnmountMe();
@ -258,7 +260,7 @@ namespace Server.Mobiles
}
else
{
if ( m_Rider != null )
if( m_Rider != null )
Dismount( m_Rider );
Dismount( value );
@ -286,7 +288,7 @@ namespace Server.Mobiles
if( Hue == EtherealHue )
Hue = 0;
if ( bp != null )
if( bp != null )
{
bp.DropItem( this );
}
@ -295,7 +297,7 @@ namespace Server.Mobiles
Point3D loc = m_Rider.Location;
Map map = m_Rider.Map;
if ( map == null || map == Map.Internal )
if( map == null || map == Map.Internal )
{
loc = m_Rider.LogoutLocation;
map = m_Rider.LogoutMap;
@ -311,7 +313,7 @@ namespace Server.Mobiles
Layer = Layer.Mount;
Movable = false;
if ( Hue == 0 )
if( Hue == 0 )
Hue = EtherealHue;
ProcessDelta();
@ -331,7 +333,7 @@ namespace Server.Mobiles
public static void StopMounting( Mobile mob )
{
if ( mob.Spell is EtherealSpell )
if( mob.Spell is EtherealSpell )
((EtherealSpell)mob.Spell).Stop();
}
@ -341,28 +343,34 @@ namespace Server.Mobiles
private class EtherealSpell : Spell
{
private static SpellInfo m_Info = new SpellInfo( "Ethereal Mount", "", SpellCircle.Second, 230 );
private static SpellInfo m_Info = new SpellInfo( "Ethereal Mount", "", 230 );
private EtherealMount m_Mount;
private Mobile m_Rider;
public EtherealSpell( EtherealMount mount, Mobile rider ) : base( rider, null, m_Info )
public EtherealSpell( EtherealMount mount, Mobile rider )
: base( rider, null, m_Info )
{
m_Rider = rider;
m_Mount = mount;
}
public override bool ClearHandsOnCast{ get{ return false; } }
public override bool RevealOnCast{ get{ return false; } }
public override bool ClearHandsOnCast { get { return false; } }
public override bool RevealOnCast { get { return false; } }
public override TimeSpan GetCastRecovery()
{
return TimeSpan.Zero;
}
public override TimeSpan GetCastDelay()
public override double CastDelayFastScalar { get { return 0; } }
public override TimeSpan CastDelayBase
{
return TimeSpan.FromSeconds( ( (m_Mount.IsDonationItem && RewardSystem.GetRewardLevel( m_Rider ) < 3 )? 12.5 : 5.0 ) );
get
{
return TimeSpan.FromSeconds( ((m_Mount.IsDonationItem && RewardSystem.GetRewardLevel( m_Rider ) < 3)? 12.5 : 5.0) );
}
}
public override int GetMana()
@ -390,7 +398,7 @@ namespace Server.Mobiles
public override bool CheckDisturb( DisturbType type, bool checkFirst, bool resistable )
{
if ( type == DisturbType.EquipRequest || type == DisturbType.UseRequest/* || type == DisturbType.Hurt*/ )
if( type == DisturbType.EquipRequest || type == DisturbType.UseRequest/* || type == DisturbType.Hurt*/ )
return false;
return true;
@ -398,19 +406,19 @@ namespace Server.Mobiles
public override void DoHurtFizzle()
{
if ( !m_Stop )
if( !m_Stop )
base.DoHurtFizzle();
}
public override void DoFizzle()
{
if ( !m_Stop )
if( !m_Stop )
base.DoFizzle();
}
public override void OnDisturb( DisturbType type, bool message )
{
if ( message && !m_Stop )
if( message && !m_Stop )
Caster.SendLocalizedMessage( 1049455 ); // You have been disrupted while attempting to summon your ethereal mount!
//m_Mount.UnmountMe();
@ -418,7 +426,7 @@ namespace Server.Mobiles
public override void OnCast()
{
if ( !m_Mount.Deleted && m_Mount.Rider == null && m_Mount.Validate( m_Rider ) )
if( !m_Mount.Deleted && m_Mount.Rider == null && m_Mount.Validate( m_Rider ) )
m_Mount.Rider = m_Rider;
FinishSequence();
@ -428,14 +436,16 @@ namespace Server.Mobiles
public class EtherealHorse : EtherealMount
{
public override int LabelNumber{ get{ return 1041298; } } // Ethereal Horse Statuette
public override int LabelNumber { get { return 1041298; } } // Ethereal Horse Statuette
[Constructable]
public EtherealHorse() : base( 0x20DD, 0x3EAA )
public EtherealHorse()
: base( 0x20DD, 0x3EAA )
{
}
public EtherealHorse( Serial serial ) : base( serial )
public EtherealHorse( Serial serial )
: base( serial )
{
}
@ -443,7 +453,7 @@ namespace Server.Mobiles
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( (int)0 ); // version
}
public override void Deserialize( GenericReader reader )
@ -452,24 +462,26 @@ namespace Server.Mobiles
int version = reader.ReadInt();
if ( Name == "an ethereal horse" )
if( Name == "an ethereal horse" )
Name = null;
if ( ItemID == 0x2124 )
if( ItemID == 0x2124 )
ItemID = 0x20DD;
}
}
public class EtherealLlama : EtherealMount
{
public override int LabelNumber{ get{ return 1041300; } } // Ethereal Llama Statuette
public override int LabelNumber { get { return 1041300; } } // Ethereal Llama Statuette
[Constructable]
public EtherealLlama() : base( 0x20F6, 0x3EAB )
public EtherealLlama()
: base( 0x20F6, 0x3EAB )
{
}
public EtherealLlama( Serial serial ) : base( serial )
public EtherealLlama( Serial serial )
: base( serial )
{
}
@ -477,7 +489,7 @@ namespace Server.Mobiles
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( (int)0 ); // version
}
public override void Deserialize( GenericReader reader )
@ -486,21 +498,23 @@ namespace Server.Mobiles
int version = reader.ReadInt();
if ( Name == "an ethereal llama" )
if( Name == "an ethereal llama" )
Name = null;
}
}
public class EtherealOstard : EtherealMount
{
public override int LabelNumber{ get{ return 1041299; } } // Ethereal Ostard Statuette
public override int LabelNumber { get { return 1041299; } } // Ethereal Ostard Statuette
[Constructable]
public EtherealOstard() : base( 0x2135, 0x3EAC )
public EtherealOstard()
: base( 0x2135, 0x3EAC )
{
}
public EtherealOstard( Serial serial ) : base( serial )
public EtherealOstard( Serial serial )
: base( serial )
{
}
@ -508,7 +522,7 @@ namespace Server.Mobiles
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( (int)0 ); // version
}
public override void Deserialize( GenericReader reader )
@ -517,21 +531,23 @@ namespace Server.Mobiles
int version = reader.ReadInt();
if ( Name == "an ethereal ostard" )
if( Name == "an ethereal ostard" )
Name = null;
}
}
public class EtherealRidgeback : EtherealMount
{
public override int LabelNumber{ get{ return 1049747; } } // Ethereal Ridgeback Statuette
public override int LabelNumber { get { return 1049747; } } // Ethereal Ridgeback Statuette
[Constructable]
public EtherealRidgeback() : base( 0x2615, 0x3E9A )
public EtherealRidgeback()
: base( 0x2615, 0x3E9A )
{
}
public EtherealRidgeback( Serial serial ) : base( serial )
public EtherealRidgeback( Serial serial )
: base( serial )
{
}
@ -539,7 +555,7 @@ namespace Server.Mobiles
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( (int)0 ); // version
}
public override void Deserialize( GenericReader reader )
@ -548,21 +564,23 @@ namespace Server.Mobiles
int version = reader.ReadInt();
if ( Name == "an ethereal ridgeback" )
if( Name == "an ethereal ridgeback" )
Name = null;
}
}
public class EtherealUnicorn : EtherealMount
{
public override int LabelNumber{ get{ return 1049745; } } // Ethereal Unicorn Statuette
public override int LabelNumber { get { return 1049745; } } // Ethereal Unicorn Statuette
[Constructable]
public EtherealUnicorn() : base( 0x25CE, 0x3E9B )
public EtherealUnicorn()
: base( 0x25CE, 0x3E9B )
{
}
public EtherealUnicorn( Serial serial ) : base( serial )
public EtherealUnicorn( Serial serial )
: base( serial )
{
}
@ -570,7 +588,7 @@ namespace Server.Mobiles
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( (int)0 ); // version
}
public override void Deserialize( GenericReader reader )
@ -579,21 +597,23 @@ namespace Server.Mobiles
int version = reader.ReadInt();
if ( Name == "an ethereal unicorn" )
if( Name == "an ethereal unicorn" )
Name = null;
}
}
public class EtherealBeetle : EtherealMount
{
public override int LabelNumber{ get{ return 1049748; } } // Ethereal Beetle Statuette
public override int LabelNumber { get { return 1049748; } } // Ethereal Beetle Statuette
[Constructable]
public EtherealBeetle() : base( 0x260F, 0x3E97 )
public EtherealBeetle()
: base( 0x260F, 0x3E97 )
{
}
public EtherealBeetle( Serial serial ) : base( serial )
public EtherealBeetle( Serial serial )
: base( serial )
{
}
@ -601,7 +621,7 @@ namespace Server.Mobiles
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( (int)0 ); // version
}
public override void Deserialize( GenericReader reader )
@ -610,21 +630,23 @@ namespace Server.Mobiles
int version = reader.ReadInt();
if ( Name == "an ethereal beetle" )
if( Name == "an ethereal beetle" )
Name = null;
}
}
public class EtherealKirin : EtherealMount
{
public override int LabelNumber{ get{ return 1049746; } } // Ethereal Ki-Rin Statuette
public override int LabelNumber { get { return 1049746; } } // Ethereal Ki-Rin Statuette
[Constructable]
public EtherealKirin() : base( 0x25A0, 0x3E9C )
public EtherealKirin()
: base( 0x25A0, 0x3E9C )
{
}
public EtherealKirin( Serial serial ) : base( serial )
public EtherealKirin( Serial serial )
: base( serial )
{
}
@ -632,7 +654,7 @@ namespace Server.Mobiles
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( (int)0 ); // version
}
public override void Deserialize( GenericReader reader )
@ -641,21 +663,23 @@ namespace Server.Mobiles
int version = reader.ReadInt();
if ( Name == "an ethereal kirin" )
if( Name == "an ethereal kirin" )
Name = null;
}
}
public class EtherealSwampDragon : EtherealMount
{
public override int LabelNumber{ get{ return 1049749; } } // Ethereal Swamp Dragon Statuette
public override int LabelNumber { get { return 1049749; } } // Ethereal Swamp Dragon Statuette
[Constructable]
public EtherealSwampDragon() : base( 0x2619, 0x3E98 )
public EtherealSwampDragon()
: base( 0x2619, 0x3E98 )
{
}
public EtherealSwampDragon( Serial serial ) : base( serial )
public EtherealSwampDragon( Serial serial )
: base( serial )
{
}
@ -663,7 +687,7 @@ namespace Server.Mobiles
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( (int)0 ); // version
}
public override void Deserialize( GenericReader reader )
@ -672,7 +696,7 @@ namespace Server.Mobiles
int version = reader.ReadInt();
if ( Name == "an ethereal swamp dragon" )
if( Name == "an ethereal swamp dragon" )
Name = null;
}
}

View file

@ -13,13 +13,71 @@ namespace Server.Mobiles
return WeaponAbility.Dismount;
}
public override bool StatLossAfterTame{ get{ return true; } }
public override bool StatLossAfterTame { get { return true; } }
private static int GetHue()
{
int rand = Utility.Random( 1075 );
/*
1000 1075 No Hue Color 93.02% 0x0
*
10 1075 Ice Green 0.93% 0x847F
10 1075 Light Blue 0.93% 0x848D
10 1075 Strong Cyan 0.93% 0x8495
10 1075 Agapite 0.93% 0x8899
10 1075 Gold 0.93% 0x8032
*
8 1075 Blue and Yellow 0.74% 0x8487
*
5 1075 Ice Blue 0.47% 0x8482
*
3 1075 Cyan 0.28% 0x8123
3 1075 Light Green 0.28% 0x8295
*
2 1075 Strong Yellow 0.19% 0x8037
2 1075 Green 0.19% 0x8030 //this one is an approximation
*
1 1075 Strong Purple 0.09% 0x8490
1 1075 Strong Green 0.09% 0x855C
* */
if( rand <= 0 )
return 0x855C;
else if( rand <= 1 )
return 0x8490;
else if( rand <= 3 )
return 0x8030;
else if( rand <= 5 )
return 0x8037;
else if( rand <= 8 )
return 0x8295;
else if( rand <= 11 )
return 0x8123;
else if( rand <= 16 )
return 0x8482;
else if( rand <= 24 )
return 0x8487;
else if( rand <= 34 )
return 0x8032;
else if( rand <= 44 )
return 0x8899;
else if( rand <= 54 )
return 0x8495;
else if( rand <= 64 )
return 0x848D;
else if( rand <= 74 )
return 0x847F;
return 0;
}
[Constructable]
public Hiryu() : base( "a hiryu", 243, 0x3E94, AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
public Hiryu()
: base( "a hiryu", 243, 0x3E94, AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
if ( 0.05 > Utility.RandomDouble() )
Hue = Utility.RandomList( 0x32, 0x37, 0x3C, 0x3D, 0x123, 0x294, 0x295, 0x47F, 0x482, 0x487, 0x48D, 0x490, 0x495, 0x55C, 0x8A0, 0x899, 0x89F ) | 0x8000;
Hue = GetHue();
SetStr( 1201, 1410 );
SetDex( 171, 270 );
@ -50,7 +108,7 @@ namespace Server.Mobiles
ControlSlots = 4;
MinTameSkill = 98.7;
if ( Utility.RandomDouble() < .33 )
if( Utility.RandomDouble() < .33 )
PackItem( Engines.Plants.Seed.RandomBonsaiSeed() );
}
@ -85,18 +143,18 @@ namespace Server.Mobiles
AddLoot( LootPack.FilthyRich, 3 );
AddLoot( LootPack.Gems, 4 );
}
public override int TreasureMapLevel{ get{ return 5; } }
public override int Meat{ get{ return 16; } }
public override int Hides{ get{ return 60; } }
public override FoodType FavoriteFood{ get{ return FoodType.Meat; } }
public override int TreasureMapLevel { get { return 5; } }
public override int Meat { get { return 16; } }
public override int Hides { get { return 60; } }
public override FoodType FavoriteFood { get { return FoodType.Meat; } }
public override bool CanAngerOnTame { get { return true; } }
public override void OnGaveMeleeAttack( Mobile defender )
{
base.OnGaveMeleeAttack( defender );
if ( 0.1 > Utility.RandomDouble() )
if( 0.1 > Utility.RandomDouble() )
{
/* Grasping Claw
* Start cliloc: 1070836
@ -107,7 +165,7 @@ namespace Server.Mobiles
ExpireTimer timer = (ExpireTimer)m_Table[defender];
if ( timer != null )
if( timer != null )
{
timer.DoExpire();
defender.SendLocalizedMessage( 1070837 ); // The creature lands another blow in your weakened state.
@ -135,7 +193,8 @@ namespace Server.Mobiles
private Mobile m_Mobile;
private ResistanceMod m_Mod;
public ExpireTimer( Mobile m, ResistanceMod mod, TimeSpan delay ) : base( delay )
public ExpireTimer( Mobile m, ResistanceMod mod, TimeSpan delay )
: base( delay )
{
m_Mobile = m;
m_Mod = mod;
@ -156,20 +215,27 @@ namespace Server.Mobiles
}
}
public Hiryu( Serial serial ) : base( serial )
public Hiryu( Serial serial )
: base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
writer.Write( (int)1 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
if( version == 0 )
Timer.DelayCall( TimeSpan.Zero, delegate { Hue = GetHue(); } );
if( version <= 1 )
Timer.DelayCall( TimeSpan.Zero, delegate { InternalItem.Hue = this.Hue; } );
}
}
}

View file

@ -13,13 +13,43 @@ namespace Server.Mobiles
return WeaponAbility.Dismount;
}
public override bool StatLossAfterTame{ get{ return true; } }
public override bool StatLossAfterTame { get { return true; } }
private static int GetHue()
{
int rand = Utility.Random( 527 );
/*
500 527 No Hue Color 94.88% 0
10 527 Green 1.90% 0x8295
10 527 Green 1.90% 0x8163 (Very Close to Above Green) //this one is an approximation
5 527 Dark Green 0.95% 0x87D4
1 527 Valorite 0.19% 0x88AB
1 527 Midnight Blue 0.19% 0x8258
* */
if( rand <= 0 )
return 0x8258;
else if( rand <= 1 )
return 0x88AB;
else if( rand <= 6 )
return 0x87D4;
else if( rand <= 16 )
return 0x8163;
else if( rand <= 26 )
return 0x8295;
return 0;
}
[Constructable]
public LesserHiryu() : base( "a lesser hiryu", 243, 0x3E94, AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
if ( 0.05 > Utility.RandomDouble() )
Hue = Utility.RandomList( 0x32, 0x37, 0x3C, 0x3D, 0x123, 0x294, 0x295, 0x47F, 0x482, 0x487, 0x48D, 0x490, 0x495, 0x55C, 0x8A0, 0x899, 0x89F ) | 0x8000;
public LesserHiryu()
: base( "a lesser hiryu", 243, 0x3E94, AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Hue = GetHue();
SetStr( 301, 410 );
SetDex( 171, 270 );
@ -50,7 +80,7 @@ namespace Server.Mobiles
ControlSlots = 3;
MinTameSkill = 98.7;
if ( Utility.RandomDouble() < .33 )
if( Utility.RandomDouble() < .33 )
PackItem( Engines.Plants.Seed.RandomBonsaiSeed() );
}
@ -89,24 +119,24 @@ namespace Server.Mobiles
public override double GetControlChance( Mobile m, bool useBaseSkill )
{
double skill = (useBaseSkill? m.Skills.Bushido.Base : m.Skills.Bushido.Value);
if ( skill >= 90.0 )
if( skill >= 90.0 )
return 1.0;
return base.GetControlChance( m, useBaseSkill );
}
public override int TreasureMapLevel{ get{ return 3; } }
public override int Meat{ get{ return 16; } }
public override int Hides{ get{ return 60; } }
public override FoodType FavoriteFood{ get{ return FoodType.Meat; } }
public override int TreasureMapLevel { get { return 3; } }
public override int Meat { get { return 16; } }
public override int Hides { get { return 60; } }
public override FoodType FavoriteFood { get { return FoodType.Meat; } }
public override bool CanAngerOnTame { get { return true; } }
public override void OnGaveMeleeAttack( Mobile defender )
{
base.OnGaveMeleeAttack( defender );
if ( 0.1 > Utility.RandomDouble() )
if( 0.1 > Utility.RandomDouble() )
{
/* Grasping Claw
* Start cliloc: 1070836
@ -117,7 +147,7 @@ namespace Server.Mobiles
ExpireTimer timer = (ExpireTimer)m_Table[defender];
if ( timer != null )
if( timer != null )
{
timer.DoExpire();
defender.SendLocalizedMessage( 1070837 ); // The creature lands another blow in your weakened state.
@ -145,7 +175,8 @@ namespace Server.Mobiles
private Mobile m_Mobile;
private ResistanceMod m_Mod;
public ExpireTimer( Mobile m, ResistanceMod mod, TimeSpan delay ) : base( delay )
public ExpireTimer( Mobile m, ResistanceMod mod, TimeSpan delay )
: base( delay )
{
m_Mobile = m;
m_Mod = mod;
@ -166,20 +197,27 @@ namespace Server.Mobiles
}
}
public LesserHiryu( Serial serial ) : base( serial )
public LesserHiryu( Serial serial )
: base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
writer.Write( (int)1 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
if( version == 0 )
Timer.DelayCall( TimeSpan.Zero, delegate { Hue = GetHue(); } );
if( version <= 1 )
Timer.DelayCall( TimeSpan.Zero, delegate { InternalItem.Hue = this.Hue; } );
}
}
}

View file

@ -180,7 +180,7 @@ namespace Server.Mobiles
int toHeal = (int)(Skills[SkillName.Magery].Value * 0.4);
toHeal += Utility.Random( 1, 10 );
m.Heal( toHeal );
m.Heal( toHeal, this );
m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
m.PlaySound( 0x202 );

View file

@ -139,7 +139,7 @@ namespace Server.Mobiles
SpellHelper.Turn( this, m );
m.Heal( toHeal );
m.Heal( toHeal, this );
m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
m.PlaySound( 0x202 );

View file

@ -14,7 +14,7 @@ namespace Server.Mobiles
public override double DispelDifficulty { get { return 0.0; } }
public override double DispelFocus { get { return 20.0; } }
public override double GetValueFrom( Mobile m, FightMode acqType, bool bPlayerOnly )
public override double GetFightModeRanking( Mobile m, FightMode acqType, bool bPlayerOnly )
{
return ( m.Str + m.Skills[SkillName.Tactics].Value ) / Math.Max( GetDistanceToSqrt( m ), 1.0 );
}

View file

@ -14,7 +14,7 @@ namespace Server.Mobiles
public override double DispelDifficulty { get { return 80.0; } }
public override double DispelFocus { get { return 20.0; } }
public override double GetValueFrom( Mobile m, FightMode acqType, bool bPlayerOnly )
public override double GetFightModeRanking( Mobile m, FightMode acqType, bool bPlayerOnly )
{
return ( m.Int + m.Skills[SkillName.Magery].Value ) / Math.Max( GetDistanceToSqrt( m ), 1.0 );
}
@ -25,14 +25,16 @@ namespace Server.Mobiles
{
Name = "an energy vortex";
if ( Core.SE && 0.02 > Utility.RandomDouble() ) // Tested on OSI, but is this right? Who knows.
if( Core.SE && 0.02 > Utility.RandomDouble() ) // Tested on OSI, but is this right? Who knows.
{
// Llama vortex!
Body = 0xDC;
Hue = 0x76;
}
else
Body = 164;
{
Body = 164;
}
SetStr( 200 );
SetDex( 200 );

View file

@ -23,6 +23,7 @@ using Server.Regions;
using Server.Accounting;
using Server.Engines.CannedEvil;
using Server.Engines.Craft;
using Server.Spells.Spellweaving;
namespace Server.Mobiles
{
@ -1691,7 +1692,7 @@ namespace Server.Mobiles
public override bool CheckShove( Mobile shoved )
{
if( TransformationSpell.UnderTransformation( this, typeof( WraithFormSpell ) ) )
if( TransformationSpellHelper.UnderTransformation( this, typeof( WraithFormSpell ) ) )
return true;
else
return base.CheckShove( shoved );
@ -2133,7 +2134,7 @@ namespace Server.Mobiles
{
//g.Alliance.AllianceTextMessage( hue, "[Alliance][{0}]: {1}", this.Name, text );
g.Alliance.AllianceChat( this, text );
SendToStaffMessage( this, "[Alliance]: {0}", this.Name, text );
SendToStaffMessage( this, "[Alliance]: {0}", text );
m_AllianceMessageHue = hue;
}
@ -3043,13 +3044,18 @@ namespace Server.Mobiles
if ( checkTurning && (dir & Direction.Mask) != (this.Direction & Direction.Mask) )
return TimeSpan.FromSeconds( 0.1 ); // We are NOT actually moving (just a direction change)
TransformContext context = TransformationSpellHelper.GetContext( this );
if( context != null && context.Type == typeof( ReaperFormSpell ) )
return Mobile.WalkFoot;
bool running = ( (dir & Direction.Running) != 0 );
bool onHorse = ( this.Mount != null );
AnimalFormContext context = AnimalForm.GetContext( this );
AnimalFormContext animalContext = AnimalForm.GetContext( this );
if ( onHorse || (context != null && context.SpeedBoost) )
if( onHorse || (animalContext != null && animalContext.SpeedBoost) )
return ( running ? Mobile.RunMount : Mobile.WalkMount );
return ( running ? Mobile.RunFoot : Mobile.WalkFoot );
@ -3188,6 +3194,8 @@ namespace Server.Mobiles
public DateTime LastSacrificeGain{ get{ return m_LastSacrificeGain; } set{ m_LastSacrificeGain = value; } }
public DateTime LastSacrificeLoss{ get{ return m_LastSacrificeLoss; } set{ m_LastSacrificeLoss = value; } }
[CommandProperty( AccessLevel.GameMaster )]
public int AvailableResurrects{ get{ return m_AvailableResurrects; } set{ m_AvailableResurrects = value; } }
private DateTime m_NextJustAward;

View file

@ -57,7 +57,7 @@ namespace Server.Mobiles
if ( Map != Map.Felucca )
return;
ArrayList toGive = new ArrayList();
List<Mobile> toGive = new List<Mobile>();
List<DamageStore> rights = BaseCreature.GetLootingRights( this.DamageEntries, this.HitsMax );
for ( int i = rights.Count - 1; i >= 0; --i )
@ -73,7 +73,7 @@ namespace Server.Mobiles
for( int i = 0; i < toGive.Count; i++ )
{
Mobile m = (Mobile)toGive[i];
Mobile m = toGive[i];
if( !(m is PlayerMobile) )
continue;
@ -97,64 +97,72 @@ namespace Server.Mobiles
for ( int i = 0; i < toGive.Count; ++i )
{
int rand = Utility.Random( toGive.Count );
object hold = toGive[i];
Mobile hold = toGive[i];
toGive[i] = toGive[rand];
toGive[rand] = hold;
}
for ( int i = 0; i < 6; ++i )
{
Mobile m = (Mobile)toGive[i % toGive.Count];
Mobile m = toGive[i % toGive.Count];
PowerScroll ps = CreateRandomPowerScroll();
m.SendLocalizedMessage( 1049524 ); // You have received a scroll of power!
GivePowerScrollTo( m, ps );
}
}
if ( !Core.SE || m.Alive )
m.AddToBackpack( ps );
public static void GivePowerScrollTo( Mobile m, PowerScroll ps )
{
if( ps == null || m == null ) //sanity
return;
m.SendLocalizedMessage( 1049524 ); // You have received a scroll of power!
if( !Core.SE || m.Alive )
m.AddToBackpack( ps );
else
{
if( m.Corpse != null && !m.Corpse.Deleted )
m.Corpse.DropItem( ps );
else
{
if ( m.Corpse != null && !m.Corpse.Deleted )
((Container)m.Corpse).DropItem( ps );
else
m.AddToBackpack( ps );
}
m.AddToBackpack( ps );
}
if ( m is PlayerMobile )
{
PlayerMobile pm = (PlayerMobile)m;
if( m is PlayerMobile )
{
PlayerMobile pm = (PlayerMobile)m;
for ( int j = 0; j < pm.JusticeProtectors.Count; ++j )
for( int j = 0; j < pm.JusticeProtectors.Count; ++j )
{
Mobile prot = pm.JusticeProtectors[j];
if( prot.Map != m.Map || prot.Kills >= 5 || prot.Criminal || !JusticeVirtue.CheckMapRegion( m, prot ) )
continue;
int chance = 0;
switch( VirtueHelper.GetLevel( prot, VirtueName.Justice ) )
{
Mobile prot = (Mobile)pm.JusticeProtectors[j];
case VirtueLevel.Seeker: chance = 60; break;
case VirtueLevel.Follower: chance = 80; break;
case VirtueLevel.Knight: chance = 100; break;
}
if ( prot.Map != m.Map || prot.Kills >= 5 || prot.Criminal || !JusticeVirtue.CheckMapRegion( m, prot ) )
continue;
if( chance > Utility.Random( 100 ) )
{
PowerScroll powerScroll = new PowerScroll( ps.Skill, ps.Value );
int chance = 0;
prot.SendLocalizedMessage( 1049368 ); // You have been rewarded for your dedication to Justice!
switch ( VirtueHelper.GetLevel( prot, VirtueName.Justice ) )
if( !Core.SE || prot.Alive )
prot.AddToBackpack( powerScroll );
else
{
case VirtueLevel.Seeker: chance = 60; break;
case VirtueLevel.Follower: chance = 80; break;
case VirtueLevel.Knight: chance = 100; break;
}
if ( chance > Utility.Random( 100 ) )
{
ps = CreateRandomPowerScroll();
prot.SendLocalizedMessage( 1049368 ); // You have been rewarded for your dedication to Justice!
if ( !Core.SE || prot.Alive )
prot.AddToBackpack( ps );
if( prot.Corpse != null && !prot.Corpse.Deleted )
prot.Corpse.DropItem( powerScroll );
else
{
if ( prot.Corpse != null && !prot.Corpse.Deleted )
((Container)prot.Corpse).DropItem( ps );
else
prot.AddToBackpack( ps );
}
prot.AddToBackpack( powerScroll );
}
}
}

View file

@ -29,8 +29,8 @@ namespace Server.Mobiles
public override void OnResponse( Mobile from, string text )
{
if ( text.Length > 50 )
text = text.Substring( 0, 50 );
if( text.Length > 130 )
text = text.Substring( 0, 130 );
m_Barkeeper.EndChangeRumor( from, m_RumorIndex, text );
}
@ -54,8 +54,8 @@ namespace Server.Mobiles
public override void OnResponse( Mobile from, string text )
{
if ( text.Length > 50 )
text = text.Substring( 0, 50 );
if( text.Length > 130 )
text = text.Substring( 0, 130 );
m_Barkeeper.EndChangeKeyword( from, m_RumorIndex, text );
}
@ -77,8 +77,8 @@ namespace Server.Mobiles
public override void OnResponse( Mobile from, string text )
{
if ( text.Length > 50 )
text = text.Substring( 0, 50 );
if ( text.Length > 130 )
text = text.Substring( 0, 130 );
m_Barkeeper.EndChangeTip( from, text );
}