ModernUO/Scripts/Spells/Fifth/Incognito.cs
mark 208acafd7e Runic sewing kits will no longer apply durability
http://www.uodemise.com/forum/showthread.php?t=133757

Vendor Look/Browse/View will now work properly
http://www.uodemise.com/forum/showthread.php?t=135531

Stacked Eggbombs will now unstack correctly
http://www.uodemise.com/forum/showthread.php?t=134321

Unbonded pets should logout too
http://www.uodemise.com/forum/showthread.php?t=119262

Paragon chests placed on player vendors will now behave correctly
http://www.uodemise.com/forum/showthread.php?t=116864

Proper party fame/karma sharing
http://www.uodemise.com/forum/showthread.php?t=122749

Guild Alliance/War update bug fixed
http://www.uodemise.com/forum/showthread.php?t=115236

Fukiya properties updates and loading bug fixed
http://www.uodemise.com/forum/showthread.php?t=136042

Shuriken, same problems as fukiya
http://www.uodemise.com/forum/showthread.php?t=120212

greater mongbats will now be recognised as quest objectives
http://www.uodemise.com/forum/showthread.php?t=128072

divine fury sound tweaks.
http://www.uodemise.com/forum/showthread.php?t=136489

pet stat gains fix
http://www.uodemise.com/forum/showthread.php?t=134820

Pets follow speed corrected
http://www.uodemise.com/forum/showthread.php?t=124774

E-fields no longer block in trammel rulesets.
http://www.uodemise.com/forum/showthread.php?t=116680

Disguise kit timer fix
http://www.uodemise.com/forum/showthread.php?t=133913

Meer Mage special abilities fixes.
http://www.uodemise.com/forum/showthread.php?t=122134

Missing food property if eggs, in animal lore gump
http://www.uodemise.com/forum/showthread.php?t=135258

Pets will follow after an attack is completed.
http://www.uodemise.com/forum/showthread.php?t=135962

Hides should not be scissored whilst still on the corpse
http://www.uodemise.com/forum/showthread.php?t=118799

Pet bonding changed to include jewelry skill adjustments.
http://www.uodemise.com/forum/showthread.php?t=121060

Skinning knife can be used to cut corpses
http://www.uodemise.com/forum/showthread.php?t=115248

PlayerVendors will correctly send update packets to the client when hair is changed
http://www.uodemise.com/forum/showthread.php?t=120216

Corrections to house sign gump
http://www.uodemise.com/forum/showthread.php?t=134406

pet "guarding" system message added
http://www.uodemise.com/forum/showthread.php?t=134091

Giant toads should be aggressive
http://www.uodemise.com/forum/showthread.php?t=133984

bardiche and halberds are axe tools.
http://www.uodemise.com/forum/showthread.php?t=122739
2010-01-17 06:59:32 +00:00

194 lines
4.7 KiB
C#

using System;
using System.Collections;
using Server;
using Server.Mobiles;
using Server.Misc;
using Server.Items;
using Server.Gumps;
using Server.Spells;
using Server.Spells.Seventh;
namespace Server.Spells.Fifth
{
public class IncognitoSpell : MagerySpell
{
private static SpellInfo m_Info = new SpellInfo(
"Incognito", "Kal In Ex",
206,
9002,
Reagent.Bloodmoss,
Reagent.Garlic,
Reagent.Nightshade
);
public override SpellCircle Circle { get { return SpellCircle.Fifth; } }
public IncognitoSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
{
}
public override bool CheckCast()
{
if ( Factions.Sigil.ExistsOn( Caster ) )
{
Caster.SendLocalizedMessage( 1010445 ); // You cannot incognito if you have a sigil
return false;
}
else if ( !Caster.CanBeginAction( typeof( IncognitoSpell ) ) )
{
Caster.SendLocalizedMessage( 1005559 ); // This spell is already in effect.
return false;
}
else if ( Caster.BodyMod == 183 || Caster.BodyMod == 184 )
{
Caster.SendLocalizedMessage( 1042402 ); // You cannot use incognito while wearing body paint
return false;
}
return true;
}
public override void OnCast()
{
if ( Factions.Sigil.ExistsOn( Caster ) )
{
Caster.SendLocalizedMessage( 1010445 ); // You cannot incognito if you have a sigil
}
else if ( !Caster.CanBeginAction( typeof( IncognitoSpell ) ) )
{
Caster.SendLocalizedMessage( 1005559 ); // This spell is already in effect.
}
else if ( Caster.BodyMod == 183 || Caster.BodyMod == 184 )
{
Caster.SendLocalizedMessage( 1042402 ); // You cannot use incognito while wearing body paint
}
else if ( DisguiseTimers.IsDisguised( Caster ) )
{
Caster.SendLocalizedMessage( 1061631 ); // You can't do that while disguised.
}
else if ( !Caster.CanBeginAction( typeof( PolymorphSpell ) ) || Caster.IsBodyMod )
{
DoFizzle();
}
else if ( CheckSequence() )
{
if ( Caster.BeginAction( typeof( IncognitoSpell ) ) )
{
DisguiseTimers.StopTimer( Caster );
Caster.HueMod = Caster.Race.RandomSkinHue();
Caster.NameMod = Caster.Female ? NameList.RandomName( "female" ) : NameList.RandomName( "male" );
PlayerMobile pm = Caster as PlayerMobile;
if ( pm != null && pm.Race != null )
{
pm.SetHairMods( pm.Race.RandomHair( pm.Female ), pm.Race.RandomFacialHair( pm.Female ) );
pm.HairHue = pm.Race.RandomHairHue();
pm.FacialHairHue = pm.Race.RandomHairHue();
}
Caster.FixedParticles( 0x373A, 10, 15, 5036, EffectLayer.Head );
Caster.PlaySound( 0x3BD );
BaseArmor.ValidateMobile( Caster );
BaseClothing.ValidateMobile( Caster );
StopTimer( Caster );
int timeVal = ((6 * Caster.Skills.Magery.Fixed) / 50) + 1;
if( timeVal > 144 )
timeVal = 144;
TimeSpan length = TimeSpan.FromSeconds( timeVal );
Timer t = new InternalTimer( Caster, length );
m_Timers[Caster] = t;
t.Start();
BuffInfo.AddBuff( Caster, new BuffInfo( BuffIcon.Incognito, 1075819, length, Caster ) );
}
else
{
Caster.SendLocalizedMessage( 1079022 ); // You're already incognitoed!
}
}
FinishSequence();
}
private static Hashtable m_Timers = new Hashtable();
public static bool StopTimer( Mobile m )
{
Timer t = (Timer)m_Timers[m];
if ( t != null )
{
t.Stop();
m_Timers.Remove( m );
BuffInfo.RemoveBuff( m, BuffIcon.Incognito );
}
return ( t != null );
}
private static int[] m_HairIDs = new int[]
{
0x2044, 0x2045, 0x2046,
0x203C, 0x203B, 0x203D,
0x2047, 0x2048, 0x2049,
0x204A, 0x0000
};
private static int[] m_BeardIDs = new int[]
{
0x203E, 0x203F, 0x2040,
0x2041, 0x204B, 0x204C,
0x204D, 0x0000
};
private class InternalTimer : Timer
{
private Mobile m_Owner;
public InternalTimer( Mobile owner, TimeSpan length ) : base( length )
{
m_Owner = owner;
/*
int val = ((6 * owner.Skills.Magery.Fixed) / 50) + 1;
if ( val > 144 )
val = 144;
Delay = TimeSpan.FromSeconds( val );
* */
Priority = TimerPriority.OneSecond;
}
protected override void OnTick()
{
if ( !m_Owner.CanBeginAction( typeof( IncognitoSpell ) ) )
{
if ( m_Owner is PlayerMobile )
((PlayerMobile)m_Owner).SetHairMods( -1, -1 );
m_Owner.BodyMod = 0;
m_Owner.HueMod = -1;
m_Owner.NameMod = null;
m_Owner.EndAction( typeof( IncognitoSpell ) );
BaseArmor.ValidateMobile( m_Owner );
BaseClothing.ValidateMobile( m_Owner );
}
}
}
}
}