QUOTE |
public override bool AllowHarmful(Mobile from, Mobile target) { if (from == null || target == null) return false; Console.WriteLine("ChallengeRegion: {0} and {1} challengers = {2}", from, target, XmlPoints.AreChallengers(from, target)); // during a challenge games or 1-on-1 duels, restrict harmful acts to opponents return XmlPoints.AreChallengers(from, target); } |
QUOTE (jingz2k2 @ March 09, 2007 09:40 am) |
Okay I've added the mods to ChallengeGameRegion.cs So I have to try to duel in the Challenge Game Region? ![]() |
CODE |
ChallengeRegion: 0x3 "Tessst" and 0x2 "TestingTesting" challengers = True ChallengeRegion: 0x3 "Tessst" and 0x2 "TestingTesting" challengers = True ChallengeRegion: 0x2 "TestingTesting" and 0x3 "Tessst" challengers = True ChallengeRegion: 0x2 "TestingTesting" and 0x3 "Tessst" challengers = True ChallengeRegion: 0x3 "Tessst" and 0x2 "TestingTesting" challengers = True ChallengeRegion: 0x2 "TestingTesting" and 0x3 "Tessst" challengers = True ChallengeRegion: 0x3 "Tessst" and 0x2 "TestingTesting" challengers = True ChallengeRegion: 0x3 "Tessst" and 0x2 "TestingTesting" challengers = True ChallengeRegion: 0x3 "Tessst" and 0x2 "TestingTesting" challengers = True ChallengeRegion: 0x2 "TestingTesting" and 0x3 "Tessst" challengers = True ChallengeRegion: 0x3 "Tessst" and 0x2 "TestingTesting" challengers = True ChallengeRegion: 0x3 "Tessst" and 0x2 "TestingTesting" challengers = True ChallengeRegion: 0x2 "TestingTesting" and 0x3 "Tessst" challengers = True ChallengeRegion: 0x3 "Tessst" and 0x2 "TestingTesting" challengers = True ChallengeRegion: 0x3 "Tessst" and 0x2 "TestingTesting" challengers = True ChallengeRegion: 0x3 "Tessst" and 0x2 "TestingTesting" challengers = True ChallengeRegion: 0x2 "TestingTesting" and 0x3 "Tessst" challengers = True ChallengeRegion: 0x3 "Tessst" and 0x2 "TestingTesting" challengers = True ChallengeRegion: 0x3 "Tessst" and 0x2 "TestingTesting" challengers = True ChallengeRegion: 0x3 "Tessst" and 0x2 "TestingTesting" challengers = True ChallengeRegion: 0x2 "TestingTesting" and 0x3 "Tessst" challengers = True ChallengeRegion: 0x3 "Tessst" and 0x2 "TestingTesting" challengers = True ChallengeRegion: 0x3 "Tessst" and 0x2 "TestingTesting" challengers = True ChallengeRegion: 0x3 "Tessst" and 0x2 "TestingTesting" challengers = True ChallengeRegion: 0x3 "Tessst" and 0x2 "TestingTesting" challengers = True ChallengeRegion: 0x2 "TestingTesting" and 0x3 "Tessst" challengers = True ChallengeRegion: 0x3 "Tessst" and 0x2 "TestingTesting" challengers = True ChallengeRegion: 0x3 "Tessst" and 0x2 "TestingTesting" challengers = True |
QUOTE |
public override bool CanBeHarmful(Mobile target, bool message, bool ignoreOurBlessedness) { if (m_DesignContext != null || (target is PlayerMobile && ((PlayerMobile)target).m_DesignContext != null)) return false; if ((target is BaseVendor && ((BaseVendor)target).IsInvulnerable) || target is PlayerVendor || target is TownCrier) { if (message) { if (target.Title == null) SendMessage("{0} the vendor cannot be harmed.", target.Name); else SendMessage("{0} {1} cannot be harmed.", target.Name, target.Title); } return false; } Console.WriteLine("CanBeHarmful: {0} to {1} = {2}: {3} {4}", this, target, base.CanBeHarmful(target, message, ignoreOurBlessedness), Blessed, target.Blessed); return base.CanBeHarmful(target, message, ignoreOurBlessedness); } |
CODE |
CanBeHarmful: 0x3 "TesterTester" to 0x4 "Testing" = True: False False CanBeHarmful: 0x3 "TesterTester" to 0x4 "Testing" = True: False False CanBeHarmful: 0x4 "Testing" to 0x3 "TesterTester" = True: False False CanBeHarmful: 0x4 "Testing" to 0x3 "TesterTester" = True: False False CanBeHarmful: 0x3 "TesterTester" to 0x4 "Testing" = True: False False CanBeHarmful: 0x3 "TesterTester" to 0x4 "Testing" = True: False False CanBeHarmful: 0x3 "TesterTester" to 0x4 "Testing" = True: False False CanBeHarmful: 0x3 "TesterTester" to 0x4 "Testing" = True: False False CanBeHarmful: 0x3 "TesterTester" to 0x4 "Testing" = True: False False CanBeHarmful: 0x4 "Testing" to 0x3 "TesterTester" = True: False False CanBeHarmful: 0x3 "TesterTester" to 0x4 "Testing" = True: False False CanBeHarmful: 0x3 "TesterTester" to 0x4 "Testing" = True: False False CanBeHarmful: 0x3 "TesterTester" to 0x4 "Testing" = True: False False CanBeHarmful: 0x3 "TesterTester" to 0x4 "Testing" = True: False False CanBeHarmful: 0x3 "TesterTester" to 0x4 "Testing" = True: False False |
QUOTE |
bool ignoreArmor = ( a is ArmorIgnore || (move != null && move.IgnoreArmor( attacker )) ); damageGiven = AOS.Damage( defender, attacker, damage, ignoreArmor, phys, fire, cold, pois, nrgy ); Console.WriteLine("OnHit: from {0} to {1} = {2}/{3}", attacker, defender, damageGiven, damage); double propertyBonus = ( move == null ) ? 1.0 : move.GetPropertyBonus( attacker ); |
CODE |
using System; using System.Collections; using System.Collections.Generic; using Server; using Server.Misc; using Server.Items; using Server.Gumps; using Server.Multis; using Server.Engines.Help; using Server.ContextMenus; using Server.Network; using Server.Spells; using Server.Spells.Fifth; using Server.Spells.Sixth; using Server.Spells.Seventh; using Server.Spells.Necromancy; using Server.Spells.Ninjitsu; using Server.Spells.Bushido; using Server.Targeting; using Server.Engines.Quests; using Server.Factions; using Server.Regions; using Server.Accounting; using Server.Engines.CannedEvil; using Server.Engines.Craft; using Server.Engines.XmlSpawner2; namespace Server.Mobiles { #region Enums [Flags] public enum PlayerFlag // First 16 bits are reserved for default-distro use, start custom flags at 0x00010000 { None = 0x00000000, Glassblowing = 0x00000001, Masonry = 0x00000002, SandMining = 0x00000004, StoneMining = 0x00000008, ToggleMiningStone = 0x00000010, KarmaLocked = 0x00000020, AutoRenewInsurance = 0x00000040, UseOwnFilter = 0x00000080, PublicMyRunUO = 0x00000100, PagingSquelched = 0x00000200, Young = 0x00000400, AcceptGuildInvites = 0x00000800, DisplayChampionTitle= 0x00001000 } public enum NpcGuild { None, MagesGuild, WarriorsGuild, ThievesGuild, RangersGuild, HealersGuild, MinersGuild, MerchantsGuild, TinkersGuild, TailorsGuild, FishermensGuild, BardsGuild, BlacksmithsGuild } public enum SolenFriendship { None, Red, Black } public enum HuntMode { None, Easy, Hard, Extreme, God } public enum HuntRank { None, Squire, Guardsman, Hunter, Stalker, Slayer, General, Elite, Master, GrandMaster, Elder, Legend, Diety, God } public enum HuntReward { None, Squire, Guardsman, Hunter, Stalker, Slayer, General, Elite, Master, GrandMaster, Elder, Legend, Diety, God } public enum SickType { None, Headache, Cold, Flu, Virus, Plague, Disease } #endregion public class PlayerMobile : Mobile, IHonorTarget { #region FS:ATS Edtis private DateTime m_NextTamingBulkOrder; private bool m_Bioenginer; [CommandProperty( AccessLevel.GameMaster )] public TimeSpan NextTamingBulkOrder { get { TimeSpan ts = m_NextTamingBulkOrder - DateTime.Now; if ( ts < TimeSpan.Zero ) ts = TimeSpan.Zero; return ts; } set { try{ m_NextTamingBulkOrder = DateTime.Now + value; } catch{} } } [CommandProperty( AccessLevel.GameMaster )] public bool Bioenginer { get{ return m_Bioenginer; } set{ m_Bioenginer = value; } } #endregion private class CountAndTimeStamp { private int m_Count; private DateTime m_Stamp; public CountAndTimeStamp() { } public DateTime TimeStamp { get{ return m_Stamp; } } public int Count { get { return m_Count; } set { m_Count = value; m_Stamp = DateTime.Now; } } } public SickType m_SickType = SickType.None; private bool m_Sick = false; private bool m_Contagious = false; [CommandProperty( AccessLevel.Owner )] public SickType SicknessType { get { return m_SickType; } set { m_SickType = value; } } [CommandProperty( AccessLevel.Owner )] public bool Sick { get{ return m_Sick; } set{ m_Sick = value; } } [CommandProperty( AccessLevel.Owner )] public bool Contagious { get{ return m_Contagious; } set{ m_Contagious = value; } } #region sickness //System Control On/Off private bool SickSYS = true; //This controls the sickness system, change to false to turn off system. //System Chance Control private int MinorSickness = 2000; //This is the chance of players catching minor sickness (high [4 to 10000] rare). private int MajorSickness = 20000; //This is the chance of players catching major sickness (high [3 to 10000] rare). //System Time Control private int SickDelay = 10; //This sets the delay in seconds between sickness damage done to player. private int MinSickTime = 25; //This is the min counts for sickness to last ( MinSickTime x SickDelay = Total Second min Count ) private int MaxSickTime = 75; //This is the max counts for sickness to last ( MaxSickTime x SickDelay = Total Second max Count ) //System Damage Control private int HeadMin = 1; //This is the min damage done by Headache Sickness. private int HeadMax = 5; //This is the max damage done by Headache Sickness. private int ColdMin = 5; //This is the min damage done by Cold Sickness. private int ColdMax = 10; //This is the max damage done by Cold Sickness. private int FluMin = 5; //This is the min damage done by Flu Sickness. private int FluMax = 15; //This is the max damage done by Flu Sickness. private int VirusMin = 5; //This is the min damage done by Virus Sickness. private int VirusMax = 20; //This is the max damage done by Virus Sickness. private int PlagueMin = 10; //This is the min damage done by Plague Sickness. private int PlagueMax = 25; //This is the max damage done by Plague Sickness. private int DiseaseMin = 10; //This is the min damage done by Disease Sickness. private int DiseaseMax = 25; //This is the max damage done by Disease Sickness. private int ContagiousRange = 5; //Range that a sickness can travel to infect others if contagious. public bool SickSystem { get{ return SickSYS; } set{ SickSYS = value; } } public int MinorSick { get{ return MinorSickness; } set{ MinorSickness = value; } } public int MajorSick { get{ return MajorSickness; } set{ MajorSickness = value; } } public int SD { get{ return SickDelay; } set{ SickDelay = value; } } public int HMN { get{ return HeadMin; } set{ HeadMin = value; } } public int HMX { get{ return HeadMax; } set{ HeadMax = value; } } public int CMN { get{ return ColdMin; } set{ ColdMin = value; } } public int CMX { get{ return ColdMax; } set{ ColdMax = value; } } public int FMN { get{ return FluMin; } set{ FluMin = value; } } public int FMX { get{ return FluMax; } set{ FluMax = value; } } public int VMN { get{ return VirusMin; } set{ VirusMin = value; } } public int VMX { get{ return VirusMax; } set{ VirusMax = value; } } public int PMN { get{ return PlagueMin; } set{ PlagueMin = value; } } public int PMX { get{ return PlagueMax; } set{ PlagueMax = value; } } public int DMN { get{ return DiseaseMin; } set{ DiseaseMin = value; } } public int DMX { get{ return DiseaseMax; } set{ DiseaseMax = value; } } public int CTR { get{ return ContagiousRange; } set{ ContagiousRange = value; } } public int CTN { get{ return MinSickTime; } set{ MinSickTime = value; } } public int CTX { get{ return MaxSickTime; } set{ MaxSickTime = value; } } public static void SicknessCheck( PlayerMobile from ) { PlayerMobile pm = from as PlayerMobile; if ( pm.SickSystem == false ) return; if ( !pm.Alive ) { pm.SicknessType = SickType.None; pm.Sick = false; pm.SendMessage( "You are no longer sick!" ); SickGumpCheck( pm ); return; } if ( pm.Sick && pm.SicknessType != SickType.None ) return; if ( pm.Sick && pm.SicknessType == SickType.None ) { SickGumpCheck( pm ); ChangeSickness( pm ); return; } if ( !pm.Sick && pm.SicknessType != SickType.None ) { SickGumpCheck( pm ); ChangeSickness( pm ); return; } SickGumpCheck( pm ); pm.SicknessType = SickType.None; switch (Utility.Random( pm.MinorSick ) ) { case 0: pm.SicknessType = SickType.Headache; break; case 1: pm.SicknessType = SickType.Cold; break; case 2: pm.SicknessType = SickType.Flu; break; case 3: pm.SicknessType = SickType.Virus; break; default: break; } switch (Utility.Random( pm.MajorSick ) ) { case 0: pm.SicknessType = SickType.Plague; break; case 1: pm.SicknessType = SickType.Disease; break; default: break; } } public static void SickGumpCheck( PlayerMobile from ) { if (from.HasGump( typeof( HeadacheBlue ))) from.CloseGump( typeof( HeadacheBlue ) ); if (from.HasGump( typeof( HeadacheRed ))) from.CloseGump( typeof( HeadacheRed ) ); if (from.HasGump( typeof( ColdBlue ))) from.CloseGump( typeof( ColdBlue ) ); if (from.HasGump( typeof( ColdRed ))) from.CloseGump( typeof( ColdRed ) ); if (from.HasGump( typeof( FluBlue ))) from.CloseGump( typeof( FluBlue ) ); if (from.HasGump( typeof( FluRed ))) from.CloseGump( typeof( FluRed ) ); if (from.HasGump( typeof( VirusBlue ))) from.CloseGump( typeof( VirusBlue ) ); if (from.HasGump( typeof( VirusRed ))) from.CloseGump( typeof( VirusRed ) ); if (from.HasGump( typeof( PlagueBlue ))) from.CloseGump( typeof( PlagueBlue ) ); if (from.HasGump( typeof( PlagueRed ))) from.CloseGump( typeof( PlagueRed ) ); if (from.HasGump( typeof( DiseaseBlue ))) from.CloseGump( typeof( DiseaseBlue ) ); if (from.HasGump( typeof( DiseaseRed ))) from.CloseGump( typeof( DiseaseRed ) ); } public SickTimer m_SickTimer; public class SickTimer : Timer { private PlayerMobile m_defender; private int cnt = 0; private int m_count = 0; private int m_countmax; public SickTimer( PlayerMobile defender, int count ) : base( TimeSpan.Zero, TimeSpan.FromSeconds( defender.SD ), count ) { Priority = TimerPriority.TenMS; m_defender = (PlayerMobile) defender; m_countmax = count; } protected override void OnTick() { if ( m_defender == null ) { m_defender.Sick = false; m_defender.Contagious = false; Stop(); } if ( !m_defender.Alive ) { m_defender.Sick = false; m_defender.Contagious = false; m_defender.SendMessage( "You are no longer sick!" ); Stop(); } if ((!m_defender.Sick) || (m_defender.SicknessType == SickType.None)) Stop(); if ( m_defender.SicknessType == SickType.Headache ) { cnt += 1; m_count += 1; m_defender.Damage( Utility.Random( m_defender.HMN, m_defender.HMX ) ); if ( cnt > 2 ) { m_defender.SendMessage( "You have a bad headache!" ); m_defender.Emote("*head throbbing*"); if ( !m_defender.Female ) m_defender.PlaySound( 0x42B ); else m_defender.PlaySound( 0x31B ); cnt = 0; } m_defender.CloseGump( typeof( HeadacheBlue ) ); if (m_defender.HasGump( typeof( HeadacheRed ))) { m_defender.CloseGump( typeof( HeadacheRed ) ); m_defender.SendGump( new HeadacheBlue() ); return; } m_defender.SendGump( new HeadacheRed() ); } if ( m_defender.SicknessType == SickType.Cold ) { cnt += 1; m_count += 1; m_defender.Damage( Utility.Random( m_defender.CMN, m_defender.CMX ) ); m_defender.Stam -= 2; m_defender.Mana -= 1; if ( cnt > 2 ) { m_defender.SendMessage( "You have a cold!" ); m_defender.Emote("cough*cough"); if ( !m_defender.Female ) m_defender.PlaySound( 0x420 ); else m_defender.PlaySound( 0x311 ); cnt = 0; } m_defender.CloseGump( typeof( ColdBlue ) ); if (m_defender.HasGump( typeof( ColdRed ))) { m_defender.CloseGump( typeof( ColdRed ) ); m_defender.SendGump( new ColdBlue() ); return; } m_defender.SendGump( new ColdRed() ); } if( m_defender.SicknessType == SickType.Flu ) { cnt += 1; m_count += 1; m_defender.Damage( Utility.Random( m_defender.FMN, m_defender.FMX ) ); m_defender.Stam -= 4; m_defender.Mana -= 2; if ( cnt > 2 ) { m_defender.SendMessage( "You have influenza!" ); m_defender.Emote("*feels feverish*"); if ( !m_defender.Female ) m_defender.PlaySound( 0x42B ); else m_defender.PlaySound( 0x31B ); cnt = 0; } m_defender.CloseGump( typeof( FluBlue ) ); if (m_defender.HasGump( typeof( FluRed ))) { m_defender.CloseGump( typeof( FluRed ) ); m_defender.SendGump( new FluBlue() ); return; } m_defender.SendGump( new FluRed() ); } if ( m_defender.SicknessType == SickType.Virus ) { cnt += 1; m_count += 1; m_defender.Damage( Utility.Random( m_defender.VMN, m_defender.VMX ) ); m_defender.Stam -= 8; m_defender.Mana -= 4; if ( cnt > 2 ) { m_defender.SendMessage( "You have a bad virus, you need medical attention!" ); m_defender.Emote("*cold chills run your spine*"); m_defender.PlaySound( m_defender.Female ? 813 : 1087 ); m_defender.Say( "*vomits*" ); if ( !m_defender.Mounted ) { m_defender.Animate( 32, 5, 1, true, false, 0 ); } Point3D p = new Point3D( m_defender.Location ); p.Z = m_defender.Map.GetAverageZ( p.X, p.Y ); Vomit vomit = new Vomit(); vomit.Map = m_defender.Map; vomit.Location = p; cnt = 0; } m_defender.CloseGump( typeof( VirusBlue ) ); if (m_defender.HasGump( typeof( VirusRed ))) { m_defender.CloseGump( typeof( VirusRed ) ); m_defender.SendGump( new VirusBlue() ); return; } m_defender.SendGump( new VirusRed() ); } if ( m_defender.SicknessType == SickType.Plague ) { cnt += 1; m_count += 1; m_defender.Damage( Utility.Random( m_defender.PMN, m_defender.PMX ) ); m_defender.Stam -= 20; m_defender.Mana -= 10; if ( cnt > 2 ) { m_defender.SendMessage( "You have the plague, you'll infect others upon contact!" ); m_defender.Emote("*hot flashes make you dizzy*"); m_defender.PlaySound( m_defender.Female ? 813 : 1087 ); m_defender.Say( "*pukes*" ); if ( !m_defender.Mounted ) { m_defender.Animate( 32, 5, 1, true, false, 0 ); } Point3D p = new Point3D( m_defender.Location ); p.Z = m_defender.Map.GetAverageZ( p.X, p.Y ); Puke puke = new Puke(); puke.Map = m_defender.Map; puke.Location = p; cnt = 0; } m_defender.CloseGump( typeof( PlagueBlue ) ); if (m_defender.HasGump( typeof( PlagueRed ))) { m_defender.CloseGump( typeof( PlagueRed ) ); m_defender.SendGump( new PlagueBlue() ); return; } m_defender.SendGump( new PlagueRed() ); } if ( m_defender.SicknessType == SickType.Disease ) { cnt += 1; m_count += 1; m_defender.Damage( Utility.Random( m_defender.DMN, m_defender.DMX ) ); m_defender.Stam -= 20; m_defender.Mana -= 10; if ( cnt > 2 ) { m_defender.SendMessage( "You have a bad disease, seek medical attention!" ); m_defender.Emote("*feels deathly ill*"); m_defender.PlaySound( m_defender.Female ? 813 : 1087 ); m_defender.Say( "*pukes*" ); if ( !m_defender.Mounted ) { m_defender.Animate( 32, 5, 1, true, false, 0 ); } Point3D p = new Point3D( m_defender.Location ); p.Z = m_defender.Map.GetAverageZ( p.X, p.Y ); Puke puke = new Puke(); puke.Map = m_defender.Map; puke.Location = p; cnt = 0; } m_defender.CloseGump( typeof( DiseaseBlue ) ); if (m_defender.HasGump( typeof( DiseaseRed ))) { m_defender.CloseGump( typeof( DiseaseRed ) ); m_defender.SendGump( new DiseaseBlue() ); return; } m_defender.SendGump( new DiseaseRed() ); } if ( m_count == m_countmax ) { m_defender.SicknessType = SickType.None; m_defender.Sick = false; SickGumpCheck( m_defender ); Stop(); return; } int randominfect = Utility.Random( 1, 99 ); ArrayList RI = new ArrayList(); foreach ( Mobile o in m_defender.Map.GetMobilesInRange( m_defender.Location, m_defender.CTR ) ) { RI.Add(o); } for (int i = 0; i < RI.Count; i++) { Mobile o = RI[i] as Mobile; if ( o is PlayerMobile && m_defender != o && m_defender.SicknessType == SickType.Plague ) { PlayerMobile mob = (PlayerMobile)o; if ( (!mob.Contagious) || (mob.Sick == true) ) { } else if ( mob.SicknessType == SickType.None ) { if ( randominfect > 5 && randominfect < 95 ) mob.SicknessType = m_defender.SicknessType; } } if ( o is PlayerMobile && m_defender != o ) { PlayerMobile mob = (PlayerMobile)o; if ( (!mob.Contagious) || (mob.Sick == true) ) { } else if ( mob.SicknessType == SickType.None ) { if ( randominfect > 43 && randominfect < 50 ) mob.SicknessType = m_defender.SicknessType; } } } } } public static void ChangeSickness( PlayerMobile from ) { PlayerMobile pm = from as PlayerMobile; int count = Utility.Random( pm.CTN, pm.CTX ); Timer m_SickTimer = new SickTimer ( pm, count ); if ( pm.SicknessType == SickType.None ) { pm.Sick = false; pm.Contagious = false; pm.SendMessage( "You are no longer sick!" ); SickGumpCheck( pm ); m_SickTimer.Stop(); return; } if ( pm.SicknessType == SickType.Headache ) { pm.SendMessage( "You feel a bad headache coming on!" ); pm.Sick = true; pm.Contagious= false; pm.SendGump( new HeadacheBlue() ); //m_SickTimer = new SickTimer ( pm, count ); m_SickTimer.Start(); return; } if ( pm.SicknessType == SickType.Cold ) { pm.SendMessage( "You have caught a cold!" ); pm.Sick = true; pm.Contagious= true; pm.SendGump( new ColdBlue() ); //m_SickTimer = new SickTimer ( pm, count ); m_SickTimer.Start(); return; } if ( pm.SicknessType == SickType.Flu ) { pm.SendMessage( "You came down with influenza!" ); pm.Sick = true; pm.Contagious= true; pm.SendGump( new FluBlue() ); //m_SickTimer = new SickTimer ( pm, count ); m_SickTimer.Start(); return; } if ( pm.SicknessType == SickType.Virus ) { pm.SendMessage( "You have been infected by a Virus!" ); pm.Sick = true; pm.Contagious= true; pm.SendGump( new VirusBlue() ); //m_SickTimer = new SickTimer ( pm, count ); m_SickTimer.Start(); return; } if ( pm.SicknessType == SickType.Plague ) { pm.SendMessage( "You have been infected by a Unknown Plague!" ); pm.Sick = true; pm.Contagious= true; pm.SendGump( new PlagueBlue() ); //m_SickTimer = new SickTimer ( pm, count ); m_SickTimer.Start(); return; } if ( pm.SicknessType == SickType.Disease ) { pm.SendMessage( "You have been infected by a Unknown Disease!" ); pm.Sick = true; pm.Contagious= false; pm.SendGump( new DiseaseBlue() ); //m_SickTimer = new SickTimer ( pm, count ); m_SickTimer.Start(); return; } } #endregion #region effects private bool m_VoidEffect = false; //Override for system private bool m_DarkEffect = false; // VV Player effects VV private bool m_FireEffect = false; private bool m_IceEffect = false; private bool m_ToxicEffect = false; private bool m_ElectEffect = false; private bool m_WaterEffect = false; private bool m_MistEffect = false; private bool m_ExplosionEffect = false; private bool m_StoneEffect = false; private bool m_ShineyEffect = false; private bool m_FireFlyEffect = false; // ^^ Player effects ^^ private bool m_RDarkEffect = false; // VV Region effects VV private bool m_RFireEffect = false; private bool m_RIceEffect = false; private bool m_RToxicEffect = false; private bool m_RElectEffect = false; private bool m_RWaterEffect = false; private bool m_RMistEffect = false; private bool m_RExplosionEffect = false; private bool m_RStoneEffect = false; private bool m_RShineyEffect = false; private bool m_RFireFlyEffect = false; // ^^ Region effects ^^ [CommandProperty( AccessLevel.Administrator )] public bool VoidEffect { get{ return m_VoidEffect; } set{ m_VoidEffect = value; } } [CommandProperty( AccessLevel.Administrator )] public bool PDarkEffect { get{ return m_DarkEffect; } set{ m_DarkEffect = value; } } [CommandProperty( AccessLevel.Administrator )] public bool PFireEffect { get{ return m_FireEffect; } set{ m_FireEffect = value; } } [CommandProperty( AccessLevel.Administrator )] public bool PIceEffect { get{ return m_IceEffect; } set{ m_IceEffect = value; } } [CommandProperty( AccessLevel.Administrator )] public bool PToxicEffect { get{ return m_ToxicEffect; } set{ m_ToxicEffect = value; } } [CommandProperty( AccessLevel.Administrator )] public bool PElectEffect { get{ return m_ElectEffect; } set{ m_ElectEffect = value; } } [CommandProperty( AccessLevel.Administrator )] public bool PWaterEffect { get{ return m_WaterEffect; } set{ m_WaterEffect = value; } } [CommandProperty( AccessLevel.Administrator )] public bool PMistEffect { get{ return m_MistEffect; } set{ m_MistEffect = value; } } [CommandProperty( AccessLevel.Administrator )] public bool PExplosionEffect { get{ return m_ExplosionEffect; } set{ m_ExplosionEffect = value; } } [CommandProperty( AccessLevel.Administrator )] public bool PStoneEffect { get{ return m_StoneEffect; } set{ m_StoneEffect = value; } } [CommandProperty( AccessLevel.Administrator )] public bool PShineyEffect { get{ return m_ShineyEffect; } set{ m_ShineyEffect = value; } } [CommandProperty( AccessLevel.Administrator )] public bool PFireFlyEffect { get{ return m_FireFlyEffect; } set{ m_FireFlyEffect = value; } } [CommandProperty( AccessLevel.Administrator )] public bool RDarkEffect { get{ return m_RDarkEffect; } set{ m_RDarkEffect = value; } } [CommandProperty( AccessLevel.Administrator )] public bool RFireEffect { get{ return m_RFireEffect; } set{ m_RFireEffect = value; } } [CommandProperty( AccessLevel.Administrator )] public bool RIceEffect { get{ return m_RIceEffect; } set{ m_RIceEffect = value; } } [CommandProperty( AccessLevel.Administrator )] public bool RToxicEffect { get{ return m_RToxicEffect; } set{ m_RToxicEffect = value; } } [CommandProperty( AccessLevel.Administrator )] public bool RElectEffect { get{ return m_RElectEffect; } set{ m_RElectEffect = value; } } [CommandProperty( AccessLevel.Administrator )] public bool RWaterEffect { get{ return m_RWaterEffect; } set{ m_RWaterEffect = value; } } [CommandProperty( AccessLevel.Administrator )] public bool RMistEffect { get{ return m_RMistEffect; } set{ m_RMistEffect = value; } } [CommandProperty( AccessLevel.Administrator )] public bool RExplosionEffect { get{ return m_RExplosionEffect; } set{ m_RExplosionEffect = value; } } [CommandProperty( AccessLevel.Administrator )] public bool RStoneEffect { get{ return m_RStoneEffect; } set{ m_RStoneEffect = value; } } [CommandProperty( AccessLevel.Administrator )] public bool RShineyEffect { get{ return m_RShineyEffect; } set{ m_RShineyEffect = value; } } [CommandProperty( AccessLevel.Administrator )] public bool RFireFlyEffect { get{ return m_RFireFlyEffect; } set{ m_RFireFlyEffect = value; } } #endregion #region hunting private HuntMode m_HuntMode = HuntMode.None; private HuntRank m_HuntRank = HuntRank.None; private HuntReward m_HuntReward = HuntReward.None; private bool m_Hunting = false; private int m_EasyKills = 0; private int m_HardKills = 0; private int m_ExtremeKills = 0; private int m_GodKills = 0; [CommandProperty( AccessLevel.Administrator )] public HuntMode HuntingMode { get { return m_HuntMode; } set { m_HuntMode = value; } } [CommandProperty( AccessLevel.Administrator )] public HuntRank HuntingRank { get { return m_HuntRank; } set { m_HuntRank = value; } } [CommandProperty( AccessLevel.Administrator )] public HuntReward HuntingReward { get { return m_HuntReward; } set { m_HuntReward = value; } } [CommandProperty( AccessLevel.Administrator )] public bool Hunting { get{ return m_Hunting; } set{ m_Hunting = value; } } [CommandProperty( AccessLevel.Administrator )] public int EasyKills { get { return m_EasyKills; } set { m_EasyKills = value; } } [CommandProperty( AccessLevel.Administrator )] public int HardKills { get { return m_HardKills; } set { m_HardKills = value; } } [CommandProperty( AccessLevel.Administrator )] public int ExtremeKills { get { return m_ExtremeKills; } set { m_ExtremeKills = value; } } [CommandProperty( AccessLevel.Administrator )] public int GodKills { get { return m_GodKills; } set { m_GodKills = value; } } #endregion private DesignContext m_DesignContext; private NpcGuild m_NpcGuild; private DateTime m_NpcGuildJoinTime; private TimeSpan m_NpcGuildGameTime; private PlayerFlag m_Flags; private int m_StepsTaken; private int m_Profession; private DateTime m_LastOnline; private Server.Guilds.RankDefinition m_GuildRank; private int m_GuildMessageHue, m_AllianceMessageHue; [CommandProperty( AccessLevel.Counselor, AccessLevel.Owner )] public new Account Account { get { return base.Account as Account; } set { base.Account = value; } } #region Getters & Setters public Server.Guilds.RankDefinition GuildRank { get { if( this.AccessLevel >= AccessLevel.GameMaster ) return Server.Guilds.RankDefinition.Leader; else return m_GuildRank; } set{ m_GuildRank = value; } } [CommandProperty( AccessLevel.GameMaster )] public int GuildMessageHue { get{ return m_GuildMessageHue; } set{ m_GuildMessageHue = value; } } [CommandProperty( AccessLevel.GameMaster )] public int AllianceMessageHue { get { return m_AllianceMessageHue; } set { m_AllianceMessageHue = value; } } [CommandProperty( AccessLevel.GameMaster )] public int Profession { get{ return m_Profession; } set{ m_Profession = value; } } public int StepsTaken { get{ return m_StepsTaken; } set{ m_StepsTaken = value; } } [CommandProperty( AccessLevel.GameMaster )] public NpcGuild NpcGuild { get{ return m_NpcGuild; } set{ m_NpcGuild = value; } } [CommandProperty( AccessLevel.GameMaster )] public DateTime NpcGuildJoinTime { get{ return m_NpcGuildJoinTime; } set{ m_NpcGuildJoinTime = value; } } [CommandProperty( AccessLevel.GameMaster )] public DateTime LastOnline { get{ return m_LastOnline; } set{ m_LastOnline = value; } } [CommandProperty( AccessLevel.GameMaster )] public TimeSpan NpcGuildGameTime { get{ return m_NpcGuildGameTime; } set{ m_NpcGuildGameTime = value; } } private int m_ToTItemsTurnedIn; [CommandProperty( AccessLevel.GameMaster )] public int ToTItemsTurnedIn { get { return m_ToTItemsTurnedIn; } set { m_ToTItemsTurnedIn = value; } } private int m_ToTTotalMonsterFame; [CommandProperty( AccessLevel.GameMaster )] public int ToTTotalMonsterFame { get { return m_ToTTotalMonsterFame; } set { m_ToTTotalMonsterFame = value; } } #endregion #region PlayerFlags public PlayerFlag Flags { get{ return m_Flags; } set{ m_Flags = value; } } [CommandProperty( AccessLevel.GameMaster )] public bool PagingSquelched { get{ return GetFlag( PlayerFlag.PagingSquelched ); } set{ SetFlag( PlayerFlag.PagingSquelched, value ); } } [CommandProperty( AccessLevel.GameMaster )] public bool Glassblowing { get{ return GetFlag( PlayerFlag.Glassblowing ); } set{ SetFlag( PlayerFlag.Glassblowing, value ); } } [CommandProperty( AccessLevel.GameMaster )] public bool Masonry { get{ return GetFlag( PlayerFlag.Masonry ); } set{ SetFlag( PlayerFlag.Masonry, value ); } } [CommandProperty( AccessLevel.GameMaster )] public bool SandMining { get{ return GetFlag( PlayerFlag.SandMining ); } set{ SetFlag( PlayerFlag.SandMining, value ); } } [CommandProperty( AccessLevel.GameMaster )] public bool StoneMining { get{ return GetFlag( PlayerFlag.StoneMining ); } set{ SetFlag( PlayerFlag.StoneMining, value ); } } [CommandProperty( AccessLevel.GameMaster )] public bool ToggleMiningStone { get{ return GetFlag( PlayerFlag.ToggleMiningStone ); } set{ SetFlag( PlayerFlag.ToggleMiningStone, value ); } } [CommandProperty( AccessLevel.GameMaster )] public bool KarmaLocked { get{ return GetFlag( PlayerFlag.KarmaLocked ); } set{ SetFlag( PlayerFlag.KarmaLocked, value ); } } [CommandProperty( AccessLevel.GameMaster )] public bool AutoRenewInsurance { get{ return GetFlag( PlayerFlag.AutoRenewInsurance ); } set{ SetFlag( PlayerFlag.AutoRenewInsurance, value ); } } [CommandProperty( AccessLevel.GameMaster )] public bool UseOwnFilter { get{ return GetFlag( PlayerFlag.UseOwnFilter ); } set{ SetFlag( PlayerFlag.UseOwnFilter, value ); } } [CommandProperty( AccessLevel.GameMaster )] public bool PublicMyRunUO { get{ return GetFlag( PlayerFlag.PublicMyRunUO ); } set{ SetFlag( PlayerFlag.PublicMyRunUO, value ); InvalidateMyRunUO(); } } [CommandProperty( AccessLevel.GameMaster )] public bool AcceptGuildInvites { get{ return GetFlag( PlayerFlag.AcceptGuildInvites ); } set{ SetFlag( PlayerFlag.AcceptGuildInvites, value ); } } #endregion public static Direction GetDirection4( Point3D from, Point3D to ) { int dx = from.X - to.X; int dy = from.Y - to.Y; int rx = dx - dy; int ry = dx + dy; Direction ret; if ( rx >= 0 && ry >= 0 ) ret = Direction.West; else if ( rx >= 0 && ry < 0 ) ret = Direction.South; else if ( rx < 0 && ry < 0 ) ret = Direction.East; else ret = Direction.North; return ret; } public override bool OnDroppedItemToWorld( Item item, Point3D location ) { if ( !base.OnDroppedItemToWorld( item, location ) ) return false; BounceInfo bi = item.GetBounce(); if ( bi != null ) { Type type = item.GetType(); if ( type.IsDefined( typeof( FurnitureAttribute ), true ) || type.IsDefined( typeof( DynamicFlipingAttribute ), true ) ) { object[] objs = type.GetCustomAttributes( typeof( FlipableAttribute ), true ); if ( objs != null && objs.Length > 0 ) { FlipableAttribute fp = objs[0] as FlipableAttribute; if ( fp != null ) { int[] itemIDs = fp.ItemIDs; Point3D oldWorldLoc = bi.m_WorldLoc; Point3D newWorldLoc = location; if ( oldWorldLoc.X != newWorldLoc.X || oldWorldLoc.Y != newWorldLoc.Y ) { Direction dir = GetDirection4( oldWorldLoc, newWorldLoc ); if ( itemIDs.Length == 2 ) { switch ( dir ) { case Direction.North: case Direction.South: item.ItemID = itemIDs[0]; break; case Direction.East: case Direction.West: item.ItemID = itemIDs[1]; break; } } else if ( itemIDs.Length == 4 ) { switch ( dir ) { case Direction.South: item.ItemID = itemIDs[0]; break; case Direction.East: item.ItemID = itemIDs[1]; break; case Direction.North: item.ItemID = itemIDs[2]; break; case Direction.West: item.ItemID = itemIDs[3]; break; } } } } } } } return true; } public bool GetFlag( PlayerFlag flag ) { return ( (m_Flags & flag) != 0 ); } public void SetFlag( PlayerFlag flag, bool value ) { if ( value ) m_Flags |= flag; else m_Flags &= ~flag; } public DesignContext DesignContext { get{ return m_DesignContext; } set{ m_DesignContext = value; } } public static void Initialize() { if ( FastwalkPrevention ) { PacketHandler ph = PacketHandlers.GetHandler( 0x02 ); ph.ThrottleCallback = new ThrottlePacketCallback( MovementThrottle_Callback ); } EventSink.Login += new LoginEventHandler( OnLogin ); EventSink.Logout += new LogoutEventHandler( OnLogout ); EventSink.Connected += new ConnectedEventHandler( EventSink_Connected ); EventSink.Disconnected += new DisconnectedEventHandler( EventSink_Disconnected ); } public override void OnSkillInvalidated( Skill skill ) { if ( Core.AOS && skill.SkillName == SkillName.MagicResist ) UpdateResistances(); } public override int GetMaxResistance( ResistanceType type ) { int max = base.GetMaxResistance( type ); if ( type != ResistanceType.Physical && 60 < max && Spells.Fourth.CurseSpell.UnderEffect( this ) ) max = 60; if( Core.ML && this.Race == Race.Elf && type == ResistanceType.Energy ) max += 5; //Intended to go after the 60 max from curse return max; } protected override void OnRaceChange( Race oldRace ) { ValidateEquipment(); UpdateResistances(); } public override int MaxWeight { get { return (((Core.ML && this.Race == Race.Human) ? 100 : 40) + (int)(3.5 * this.Str)); } } private int m_LastGlobalLight = -1, m_LastPersonalLight = -1; public override void OnNetStateChanged() { m_LastGlobalLight = -1; m_LastPersonalLight = -1; } public override void ComputeBaseLightLevels( out int global, out int personal ) { global = LightCycle.ComputeLevelFor( this ); if ( this.LightLevel < 21 && AosAttributes.GetValue( this, AosAttribute.NightSight ) > 0 ) personal = 21; else personal = this.LightLevel; } public override void CheckLightLevels( bool forceResend ) { NetState ns = this.NetState; if ( ns == null ) return; int global, personal; ComputeLightLevels( out global, out personal ); if ( !forceResend ) forceResend = ( global != m_LastGlobalLight || personal != m_LastPersonalLight ); if ( !forceResend ) return; m_LastGlobalLight = global; m_LastPersonalLight = personal; ns.Send( GlobalLightLevel.Instantiate( global ) ); ns.Send( new PersonalLightLevel( this, personal ) ); } public override int GetMinResistance( ResistanceType type ) { int magicResist = (int)(Skills[SkillName.MagicResist].Value * 10); int min = int.MinValue; if ( magicResist >= 1000 ) min = 40 + ((magicResist - 1000) / 50); else if ( magicResist >= 400 ) min = (magicResist - 400) / 15; if ( min > MaxPlayerResistance ) min = MaxPlayerResistance; int baseMin = base.GetMinResistance( type ); if ( min < baseMin ) min = baseMin; return min; } private static void OnLogin( LoginEventArgs e ) { Mobile from = e.Mobile; CheckAtrophies( from ); if ( AccountHandler.LockdownLevel > AccessLevel.Player ) { string notice; Accounting.Account acct = from.Account as Accounting.Account; if ( acct == null || !acct.HasAccess( from.NetState ) ) { if ( from.AccessLevel == AccessLevel.Player ) notice = "The server is currently under lockdown. No players are allowed to log in at this time."; else notice = "The server is currently under lockdown. You do not have sufficient access level to connect."; Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), new TimerStateCallback( Disconnect ), from ); } else if ( from.AccessLevel >= AccessLevel.Administrator ) { notice = "The server is currently under lockdown. As you are an administrator, you may change this from the [Admin gump."; } else { notice = "The server is currently under lockdown. You have sufficient access level to connect."; } from.SendGump( new NoticeGump( 1060637, 30720, notice, 0xFFC000, 300, 140, null, null ) ); } } private bool m_NoDeltaRecursion; public void ValidateEquipment() { if ( m_NoDeltaRecursion || Map == null || Map == Map.Internal ) return; if ( this.Items == null ) return; m_NoDeltaRecursion = true; Timer.DelayCall( TimeSpan.Zero, new TimerCallback( ValidateEquipment_Sandbox ) ); } private void ValidateEquipment_Sandbox() { try { if ( Map == null || Map == Map.Internal ) return; List<Item> items = this.Items; if ( items == null ) return; bool moved = false; int str = this.Str; int dex = this.Dex; int intel = this.Int; #region Factions int factionItemCount = 0; #endregion Mobile from = this; #region Ethics Ethics.Ethic ethic = Ethics.Ethic.Find( from ); #endregion for ( int i = items.Count - 1; i >= 0; --i ) { if ( i >= items.Count ) continue; Item item = items[i]; #region Ethics if ( ( item.SavedFlags & 0x100 ) != 0 ) { if ( item.Hue != Ethics.Ethic.Hero.Definition.PrimaryHue ) { item.SavedFlags &= ~0x100; } else if ( ethic != Ethics.Ethic.Hero ) { from.AddToBackpack( item ); moved = true; continue; } } else if ( ( item.SavedFlags & 0x200 ) != 0 ) { if ( item.Hue != Ethics.Ethic.Evil.Definition.PrimaryHue ) { item.SavedFlags &= ~0x200; } else if ( ethic != Ethics.Ethic.Evil ) { from.AddToBackpack( item ); moved = true; continue; ArteGordon- 03-10-2007 it truncates long files like that. You would have to compress it and post it as an attachment. |