Example #1
0
        public SurgeEventArgs(string sourceName, string targetName, SurgeType surgeType)
        {
            SourceName = sourceName;
            TargetName = targetName;

            SurgeType = surgeType;
        }
Example #2
0
		public SurgeEventArgs(string sourceName, string targetName, SurgeType surgeType)
		{
			SourceName = sourceName;
			TargetName = targetName;

			SurgeType = surgeType;
		}
Example #3
0
		public SurgeShield()
		{
            if (0.90 > Utility.RandomDouble())
                Hue = 2125;
            else
                Hue = 448;

            Attributes.Brittle = 1;

			switch(Utility.Random(5))
			{
				case 0: PhysicalBonus = 5; break;
				case 1: FireBonus = 5; break;
				case 2: ColdBonus = 5; break;
				case 3: PoisonBonus = 5; break;
				case 4: EnergyBonus = 5; break;
			}

			switch(Utility.Random(3))
			{
				case 0: Surge = SurgeType.Hits; break;
				case 1: Surge = SurgeType.Stam; break;
				case 2: Surge = SurgeType.Mana; break;
			}

			if(Utility.RandomBool())
				Attributes.AttackChance = 5;
			else
				Attributes.LowerManaCost = 4;

			if(Utility.RandomBool())
				Attributes.SpellChanneling = 1;			
			else
				Attributes.CastSpeed = 1;
		}
Example #4
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            m_Charges = reader.ReadInt();
            m_Surge   = (SurgeType)reader.ReadInt();
        }
Example #5
0
        public static void CheckHit(Mobile m, int damage, SurgeType type)
        {
            var item = m.Items.OfType <IEpiphanyArmor>().FirstOrDefault(i => i.Type == type);

            if (item == null)
            {
                return;
            }

            if (Table == null)
            {
                Table = new Dictionary <Mobile, Dictionary <SurgeType, int> >();
            }

            if (!Table.ContainsKey(m))
            {
                Table[m] = new Dictionary <SurgeType, int>();
            }

            if (!Table[m].ContainsKey(type))
            {
                Table[m][type] = damage;
            }
            else
            {
                damage += Table[m][type];
            }

            int freq  = GetFrequency(m, item);
            int bonus = GetBonus(m, item);

            if (freq > 0 && bonus > 0 && damage > Utility.Random(10000 / freq))
            {
                Table[m].Remove(type);

                if (Table[m].Count == 0)
                {
                    Table.Remove(m);
                }

                switch (type)
                {
                case SurgeType.Hits: m.Hits = Math.Min(m.HitsMax, m.Hits + bonus); break;

                case SurgeType.Stam: m.Hits = Math.Min(m.HitsMax, m.Hits + bonus); break;

                default:
                case SurgeType.Mana: m.Hits = Math.Min(m.HitsMax, m.Hits + bonus); break;
                }
            }
            else
            {
                Table[m][type] = damage;
            }
        }
Example #6
0
        public SurgeShield()
        {
            if (0.90 > Utility.RandomDouble())
            {
                Hue = 2125;
            }
            else
            {
                Hue = 448;
            }

            Attributes.Brittle = 1;

            switch (Utility.Random(5))
            {
            case 0: PhysicalBonus = 5; break;

            case 1: FireBonus = 5; break;

            case 2: ColdBonus = 5; break;

            case 3: PoisonBonus = 5; break;

            case 4: EnergyBonus = 5; break;
            }

            switch (Utility.Random(3))
            {
            case 0: Surge = SurgeType.Hits; break;

            case 1: Surge = SurgeType.Stam; break;

            case 2: Surge = SurgeType.Mana; break;
            }

            if (Utility.RandomBool())
            {
                Attributes.AttackChance = 5;
            }
            else
            {
                Attributes.LowerManaCost = 4;
            }

            if (Utility.RandomBool())
            {
                Attributes.SpellChanneling = 1;
            }
            else
            {
                Attributes.CastSpeed = 1;
            }
        }
Example #7
0
 public static bool IsUnderEffects(Mobile from, SurgeType type)
 {
     return(m_Table.ContainsKey(from) && m_Table[from] == type);
 }
Example #8
0
        void Current_ChatBoxMessage(object sender, ChatTextInterceptEventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(e.Text))
                {
                    return;
                }

                if (Util.IsChat(e.Text))
                {
                    return;
                }

                string sourceName = String.Empty;
                string targetName = String.Empty;

                // First person intercepts
                // You cast Cloaked in Skill on yourself
                // The cloak of MyPlayerName weaves the magic of Cloaked in Skill!
                //
                // You cast Shroud of Darkness (Melee) on Invading Iron Blade Knight
                // You cast Shroud of Darkness (Magic) on Infernal Zefir
                // Your cloak reduced the damage from 162 down to 0!

                // Third person intercepts
                // The cloak of PlayerName weaves the magic of Shroud of Darkness (Melee)!
                // The cloak of PlayerName weaves the magic of Cloaked in Skill!

                if (e.Text.StartsWith("You cast ") || e.Text.StartsWith("Your cloak "))
                {
                    if (e.Text.Contains("Shroud of Darkness") && !e.Text.Contains("yourself"))
                    {
                        sourceName = CoreManager.Current.CharacterFilter.Name;

                        if (e.Text.Contains(" on "))
                        {
                            targetName = e.Text.Remove(0, e.Text.IndexOf(" on ") + 4);
                        }
                    }

                    if (e.Text.Contains("Cloaked in Skill"))
                    {
                        sourceName = CoreManager.Current.CharacterFilter.Name;
                        targetName = CoreManager.Current.CharacterFilter.Name;
                    }

                    if (e.Text.Contains("Your cloak reduced the damage"))
                    {
                        sourceName = CoreManager.Current.CharacterFilter.Name;
                        targetName = CoreManager.Current.CharacterFilter.Name;
                    }
                }

                SurgeType surgeType = SurgeType.Unknown;

                if (e.Text.Contains("Shroud of Darkness (Melee)"))
                {
                    surgeType = SurgeType.ShroudOfDarknessMelee;
                }
                if (e.Text.Contains("Shroud of Darkness (Missile)"))
                {
                    surgeType = SurgeType.ShroudOfDarknessMissile;
                }
                if (e.Text.Contains("Shroud of Darkness (Magic)"))
                {
                    surgeType = SurgeType.ShroudOfDarknessMagic;
                }

                if (e.Text.Contains("Cloaked in Skill"))
                {
                    surgeType = SurgeType.CloakedInSkill;
                }
                if (e.Text.Contains("Your cloak reduced the damage"))
                {
                    surgeType = SurgeType.DamageReduction;
                }

                if (surgeType == SurgeType.Unknown)
                {
                    return;
                }

                SurgeEventArgs surgeEventArgs = new SurgeEventArgs(sourceName, targetName, surgeType);

                if (SurgeEvent != null)
                {
                    SurgeEvent(surgeEventArgs);
                }
            }
            catch (Exception ex) { Debug.LogException(ex, e.Text); }
        }
Example #9
0
        void Current_ChatBoxMessage(object sender, ChatTextInterceptEventArgs e)
        {
            try
            {
                if (String.IsNullOrEmpty(e.Text))
                {
                    return;
                }

                if (Util.IsChat(e.Text))
                {
                    return;
                }

                string sourceName = String.Empty;
                string targetName = String.Empty;

                // For messages where your aetheria casts a spell on the target, we cannot track whose aetheria
                // actually cast the spell so we do not know the source.

                // Aetheria surges on PlayerName with the power of Surge of Destruction!
                // Aetheria surges on Pyreal Target Drudge with the power of Surge of Festering!
                //
                // You cast Surge of Destruction on yourself
                // Aetheria surges on MyCharactersName with the power of Surge of Destruction!
                // Surge of Destruction has expired.
                //
                // You cast Surge of Festering on yourself
                // Aetheria surges on MyCharactersName with the power of Surge of Festering!

                // Prevent duplicate event raises for the same aetheria surge
                if (e.Text.StartsWith("You cast") || e.Text.Contains("has expired."))
                {
                    return;
                }

                if (e.Text.StartsWith("Aetheria surges on ") && e.Text.Contains(" with the "))
                {
                    targetName = e.Text.Replace("Aetheria surges on ", "");
                    targetName = targetName.Substring(0, targetName.IndexOf(" with the "));

                    // These surges can only be cast on yourself
                    if (e.Text.Contains("Surge of Destruction"))
                    {
                        sourceName = targetName;
                    }
                    if (e.Text.Contains("Surge of Protection"))
                    {
                        sourceName = targetName;
                    }
                    if (e.Text.Contains("Surge of Regeneration"))
                    {
                        sourceName = targetName;
                    }
                }

                SurgeType surgeType = SurgeType.Unknown;

                if (e.Text.Contains("Surge of Destruction"))
                {
                    surgeType = SurgeType.SurgeOfDestruction;
                }
                if (e.Text.Contains("Surge of Protection"))
                {
                    surgeType = SurgeType.SurgeOfProtection;
                }
                if (e.Text.Contains("Surge of Regeneration"))
                {
                    surgeType = SurgeType.SurgeOfRegeneration;
                }
                if (e.Text.Contains("Surge of Affliction"))
                {
                    surgeType = SurgeType.SurgeOfAffliction;
                }
                if (e.Text.Contains("Surge of Festering"))
                {
                    surgeType = SurgeType.SurgeOfFestring;
                }

                if (surgeType == SurgeType.Unknown)
                {
                    return;
                }

                SurgeEventArgs surgeEventArgs = new SurgeEventArgs(sourceName, targetName, surgeType);

                if (SurgeEvent != null)
                {
                    SurgeEvent(surgeEventArgs);
                }
            }
            catch (Exception ex) { Debug.LogException(ex, e.Text); }
        }
Example #10
0
		public override void Deserialize(GenericReader reader)
		{
		 	base.Deserialize(reader);
			int version = reader.ReadInt();

            m_Charges = reader.ReadInt();
            m_Surge = (SurgeType)reader.ReadInt();
		}
Example #11
0
 public static bool IsUnderEffects(Mobile from, SurgeType type)
 {
     return m_Table.ContainsKey(from) && m_Table[from] == type;
 }