示例#1
0
        public override void OnAdded(object parent)
        {
            if (parent is Mobile)
            {
                Mobile from = (Mobile)parent;

                //-------- Charged Time Left -----------

                m_isequiped = true;
                InvalidateProperties();

                //CARGE TIMER
                if (m_ChargeTimeLeft > 0)
                {
                    ChargeTimeLeft2 = m_ChargeTimeLeft;
                    m_ChargeTimer   = new ChargeTimeLeftTimer(this);
                    m_ChargeTimer.Start();
                    m_ChargeTimeLeft3 = DateTime.Now;
                }

                //------ FIN Charged Time Left ---------

                m_SkillBonuses.AddTo(from);

                int strBonus = m_MagicalAttributes.BonusStr;
                int dexBonus = m_MagicalAttributes.BonusDex;
                int intBonus = m_MagicalAttributes.BonusInt;

                if (strBonus != 0 || dexBonus != 0 || intBonus != 0)
                {
                    string modName = this.Serial.ToString();

                    if (strBonus != 0)
                    {
                        from.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));
                    }

                    if (dexBonus != 0)
                    {
                        from.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));
                    }

                    if (intBonus != 0)
                    {
                        from.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
                    }
                }

                from.CheckStatTimers();
            }
        }
示例#2
0
        public override void OnDoubleClick( Mobile m )
        {
            if ( m_TalismanType == TalismanType.None )
                return;

            if ( this.Parent != m )
            {
                m.SendLocalizedMessage( 502641 ); // You must equip this item to use it.
            }
            else if ( m_ChargeTimeLeft > 0 )
            {
                int tmptime = ( m_ChargeTimeLeft2 - ( DateTime.Now.Second - m_ChargeTimeLeft3.Second ) + 1 );

                if ( tmptime > ( m_ChargeTimeLeft2 + 1 ) )
                    tmptime -= 60;
                if ( tmptime > m_ChargeTimeLeft2 )
                    tmptime = m_ChargeTimeLeft2;

                m.SendLocalizedMessage( 1074882, tmptime.ToString() ); // You must wait ~1_val~ seconds for this to recharge.
            }
            else if ( m_Charges == 0 )
            {
                m.SendLocalizedMessage( 501250 ); // This magic item is out of charges.
            }
            else
            {

                if ( (int) m_TalismanType <= 4 )
                {
                    //Removal
                    m.Target = new InternalTarget( this );
                }
                //Mana Phase
                else if ( m_TalismanType == TalismanType.ManaPhase )
                {
                    ManaPhase.OnUse( m, this );
                }
                else if ( (int) m_TalismanType >= 9 )
                {
                    //Summon creature
                    BaseCreature bc = (BaseCreature) Activator.CreateInstance( SummonEntry.GetNPC( m_TalismanType ) );
                    if ( BaseCreature.Summon( bc, m, m.Location, -1, TimeSpan.FromMinutes( 10.0 ) ) )
                    {
                        bc.FixedParticles( 0x3728, 1, 10, 9910, EffectLayer.Head );
                        bc.PlaySound( bc.GetIdleSound() );
                        m_SummonedCreature = bc;
                        m_Charges--;
                        InvalidateProperties();
                        ChargeTimeLeft = 1800;
                        m_ChargeTimer = new ChargeTimeLeftTimer( this );
                        m_ChargeTimer.Start();
                        m_ChargeTimeLeft3 = DateTime.Now;
                    }
                }
                else if ( m_TalismanType == TalismanType.SummonRandom )
                {
                    //Summon Random
                    TalismanType tmpbc = SummonEntry.GetRandom();
                    BaseCreature bc = (BaseCreature) Activator.CreateInstance( SummonEntry.GetNPC( tmpbc ) );
                    if ( BaseCreature.Summon( bc, m, m.Location, -1, TimeSpan.FromMinutes( 10.0 ) ) )
                    {
                        bc.FixedParticles( 0x3728, 1, 10, 9910, EffectLayer.Head );
                        bc.PlaySound( bc.GetIdleSound() );
                        m_SummonedCreature = bc;
                        m_Charges--;
                        InvalidateProperties();
                        ChargeTimeLeft = 1800;
                        m_ChargeTimer = new ChargeTimeLeftTimer( this );
                        m_ChargeTimer.Start();
                        m_ChargeTimeLeft3 = DateTime.Now;
                    }
                }
                else
                {
                    Item summonitem;
                    int message;

                    // Summon item
                    if ( m_TalismanType == TalismanType.SummonBandage )
                    {
                        summonitem = new Bandage( 10 );
                        summonitem.ItemID = 0x0EE9;
                        summonitem.Hue = 0xA3;
                        message = 1075002; // You have been given some clean bandages.
                    }
                    else if ( m_TalismanType == TalismanType.SummonBoard )
                    {
                        summonitem = new Board( 10 );
                        summonitem.Hue = 0xA3;
                        message = 1075000; // You have been given some wooden boards.
                    }
                    else// if ( m_TalismanType == TalismanType.SummonIngot )
                    {
                        summonitem = new IronIngot( 10 );
                        summonitem.Hue = 0xA3;
                        message = 1075001; // You have been given some ingots.
                    }

                    m.AddToBackpack( summonitem );
                    m.SendLocalizedMessage( message );

                    m_Charges--;
                    InvalidateProperties();
                    ChargeTimeLeft = 60;

                    m_ChargeTimer = new ChargeTimeLeftTimer( this );
                    m_ChargeTimer.Start();
                    m_ChargeTimeLeft3 = DateTime.Now;
                }
            }
        }
示例#3
0
        public override void OnAdded( object parent )
        {
            if ( parent is Mobile )
            {
                Mobile from = (Mobile) parent;

                //-------- Charged Time Left -----------

                m_isequiped = true;
                InvalidateProperties();

                //CARGE TIMER
                if ( m_ChargeTimeLeft > 0 )
                {
                    ChargeTimeLeft2 = m_ChargeTimeLeft;
                    m_ChargeTimer = new ChargeTimeLeftTimer( this );
                    m_ChargeTimer.Start();
                    m_ChargeTimeLeft3 = DateTime.Now;
                }

                //------ FIN Charged Time Left ---------

                m_SkillBonuses.AddTo( from );

                int strBonus = m_MagicalAttributes.BonusStr;
                int dexBonus = m_MagicalAttributes.BonusDex;
                int intBonus = m_MagicalAttributes.BonusInt;

                if ( strBonus != 0 || dexBonus != 0 || intBonus != 0 )
                {
                    string modName = this.Serial.ToString();

                    if ( strBonus != 0 )
                        from.AddStatMod( new StatMod( StatType.Str, modName + "Str", strBonus, TimeSpan.Zero ) );

                    if ( dexBonus != 0 )
                        from.AddStatMod( new StatMod( StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero ) );

                    if ( intBonus != 0 )
                        from.AddStatMod( new StatMod( StatType.Int, modName + "Int", intBonus, TimeSpan.Zero ) );
                }

                from.CheckStatTimers();
            }
        }
示例#4
0
        public void Target( BaseTalisman talis, Mobile owner, Mobile m )
        {
            if ( this.Parent == owner )
            {
                //Curse Removal
                if ( talis.m_TalismanType == TalismanType.CurseRemoval )
                {
                    m.PlaySound( 0xF6 );
                    m.PlaySound( 0x1F7 );
                    m.FixedParticles( 0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head );

                    StatMod mod;

                    mod = m.GetStatMod( "[Magic] Str Malus" );
                    if ( mod != null && mod.Offset < 0 )
                        m.RemoveStatMod( "[Magic] Str Malus" );

                    mod = m.GetStatMod( "[Magic] Dex Malus" );
                    if ( mod != null && mod.Offset < 0 )
                        m.RemoveStatMod( "[Magic] Dex Malus" );

                    mod = m.GetStatMod( "[Magic] Int Malus" );
                    if ( mod != null && mod.Offset < 0 )
                        m.RemoveStatMod( "[Magic] Int Malus" );

                    m.Paralyzed = false;

                    EvilOmenSpell.CheckEffect( m );
                    StrangleSpell.RemoveCurse( m );
                    CorpseSkinSpell.RemoveCurse( m );
                    CurseSpell.RemoveEffect( m );

                    BuffInfo.RemoveBuff( m, BuffIcon.Clumsy );
                    BuffInfo.RemoveBuff( m, BuffIcon.FeebleMind );
                    BuffInfo.RemoveBuff( m, BuffIcon.Weaken );
                    BuffInfo.RemoveBuff( m, BuffIcon.MassCurse );
                    BuffInfo.RemoveBuff( m, BuffIcon.Curse );
                    BuffInfo.RemoveBuff( m, BuffIcon.EvilOmen );
                    StrangleSpell.RemoveCurse( m );
                    CorpseSkinSpell.RemoveCurse( m );

                    if ( owner != m )
                        owner.SendLocalizedMessage( 1072409 ); // Your targets curses have been lifted
                    m.SendLocalizedMessage( 1072408 ); // Any curses on you have been lifted

                }

                //Damage Removal
                if ( talis.m_TalismanType == TalismanType.DamageRemoval )
                {
                    Effects.SendLocationEffect( m.Location, m.Map, 0x3728, 8 );
                    Effects.PlaySound( m, m.Map, 0x201 );
                    BleedAttack.EndBleed( m, false );
                    MortalStrike.EndWound( m );
                    m.CurePoison( m );

                    BuffInfo.RemoveBuff( m, BuffIcon.Bleed );
                    BuffInfo.RemoveBuff( m, BuffIcon.MortalStrike );

                    if ( owner != m )
                        owner.SendLocalizedMessage( 1072406 ); // Your Targets lasting damage effects have been removed!

                    m.SendLocalizedMessage( 1072405 ); // Your lasting damage effects have been removed!
                }

                //Ward Removal
                if ( talis.m_TalismanType == TalismanType.WardRemoval )
                {
                    Effects.SendLocationEffect( m.Location, m.Map, 0x3728, 8 );
                    Effects.PlaySound( m, m.Map, 0x201 );

                    ProtectionSpell.RemoveWard( m );
                    ReactiveArmorSpell.RemoveWard( m );
                    MagicReflectSpell.RemoveWard( m );
                    TransformationSpell.RemoveContext( m, true );
                    ReaperFormSpell.RemoveEffects( m );
                    if ( StoneFormSpell.UnderEffect( m ) )
                        StoneFormSpell.RemoveEffects( m );

                    if ( owner != m )
                        owner.SendLocalizedMessage( 1072403 ); // Your target's wards have been removed!

                    m.SendLocalizedMessage( 1072402 ); // Your wards have been removed!
                }

                //Wildfire Removal
                if ( talis.m_TalismanType == TalismanType.WildfireRemoval )
                    owner.SendLocalizedMessage( 1042753, "Wildfire Removal" ); // ~1_SOMETHING~ has been temporarily disabled.

                //CARGE TIMER
                ChargeTimeLeft = 1200;
                m_ChargeTimer = new ChargeTimeLeftTimer( this );
                m_ChargeTimer.Start();
                m_ChargeTimeLeft3 = DateTime.Now;

            }
            else if ( m_TalismanType != 0 )
                m.SendLocalizedMessage( 502641 ); // You must equip this item to use it.
        }
示例#5
0
        public void Target(BaseTalisman talis, Mobile owner, Mobile m)
        {
            if (this.Parent == owner)
            {
                //Curse Removal
                if (talis.m_TalismanType == TalismanType.CurseRemoval)
                {
                    m.PlaySound(0xF6);
                    m.PlaySound(0x1F7);
                    m.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

                    StatMod mod;

                    mod = m.GetStatMod("[Magic] Str Malus");
                    if (mod != null && mod.Offset < 0)
                    {
                        m.RemoveStatMod("[Magic] Str Malus");
                    }

                    mod = m.GetStatMod("[Magic] Dex Malus");
                    if (mod != null && mod.Offset < 0)
                    {
                        m.RemoveStatMod("[Magic] Dex Malus");
                    }

                    mod = m.GetStatMod("[Magic] Int Malus");
                    if (mod != null && mod.Offset < 0)
                    {
                        m.RemoveStatMod("[Magic] Int Malus");
                    }

                    m.Paralyzed = false;

                    EvilOmenSpell.CheckEffect(m);
                    StrangleSpell.RemoveCurse(m);
                    CorpseSkinSpell.RemoveCurse(m);
                    CurseSpell.RemoveEffect(m);

                    BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
                    BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
                    BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
                    BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
                    BuffInfo.RemoveBuff(m, BuffIcon.Curse);
                    BuffInfo.RemoveBuff(m, BuffIcon.EvilOmen);
                    StrangleSpell.RemoveCurse(m);
                    CorpseSkinSpell.RemoveCurse(m);

                    if (owner != m)
                    {
                        owner.SendLocalizedMessage(1072409);               // Your targets curses have been lifted
                    }
                    m.SendLocalizedMessage(1072408);                       // Any curses on you have been lifted
                }

                //Damage Removal
                if (talis.m_TalismanType == TalismanType.DamageRemoval)
                {
                    Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 8);
                    Effects.PlaySound(m, m.Map, 0x201);
                    BleedAttack.EndBleed(m, false);
                    MortalStrike.EndWound(m);
                    m.CurePoison(m);

                    BuffInfo.RemoveBuff(m, BuffIcon.Bleed);
                    BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);

                    if (owner != m)
                    {
                        owner.SendLocalizedMessage(1072406);               // Your Targets lasting damage effects have been removed!
                    }
                    m.SendLocalizedMessage(1072405);                       // Your lasting damage effects have been removed!
                }

                //Ward Removal
                if (talis.m_TalismanType == TalismanType.WardRemoval)
                {
                    Effects.SendLocationEffect(m.Location, m.Map, 0x3728, 8);
                    Effects.PlaySound(m, m.Map, 0x201);

                    ProtectionSpell.RemoveWard(m);
                    ReactiveArmorSpell.RemoveWard(m);
                    MagicReflectSpell.RemoveWard(m);
                    TransformationSpell.RemoveContext(m, true);
                    ReaperFormSpell.RemoveEffects(m);
                    if (StoneFormSpell.UnderEffect(m))
                    {
                        StoneFormSpell.RemoveEffects(m);
                    }

                    if (owner != m)
                    {
                        owner.SendLocalizedMessage(1072403);               // Your target's wards have been removed!
                    }
                    m.SendLocalizedMessage(1072402);                       // Your wards have been removed!
                }

                //Wildfire Removal
                if (talis.m_TalismanType == TalismanType.WildfireRemoval)
                {
                    owner.SendLocalizedMessage(1042753, "Wildfire Removal");                       // ~1_SOMETHING~ has been temporarily disabled.
                }
                //CARGE TIMER
                ChargeTimeLeft = 1200;
                m_ChargeTimer  = new ChargeTimeLeftTimer(this);
                m_ChargeTimer.Start();
                m_ChargeTimeLeft3 = DateTime.Now;
            }
            else if (m_TalismanType != 0)
            {
                m.SendLocalizedMessage(502641);                   // You must equip this item to use it.
            }
        }
示例#6
0
        public override void OnDoubleClick(Mobile m)
        {
            if (m_TalismanType == TalismanType.None)
            {
                return;
            }

            if (this.Parent != m)
            {
                m.SendLocalizedMessage(502641);                   // You must equip this item to use it.
            }
            else if (m_ChargeTimeLeft > 0)
            {
                int tmptime = (m_ChargeTimeLeft2 - (DateTime.Now.Second - m_ChargeTimeLeft3.Second) + 1);

                if (tmptime > (m_ChargeTimeLeft2 + 1))
                {
                    tmptime -= 60;
                }
                if (tmptime > m_ChargeTimeLeft2)
                {
                    tmptime = m_ChargeTimeLeft2;
                }

                m.SendLocalizedMessage(1074882, tmptime.ToString());                   // You must wait ~1_val~ seconds for this to recharge.
            }
            else if (m_Charges == 0)
            {
                m.SendLocalizedMessage(501250);                   // This magic item is out of charges.
            }
            else
            {
                if ((int)m_TalismanType <= 4)
                {
                    //Removal
                    m.Target = new InternalTarget(this);
                }
                //Mana Phase
                else if (m_TalismanType == TalismanType.ManaPhase)
                {
                    ManaPhase.OnUse(m, this);
                }
                else if ((int)m_TalismanType >= 9)
                {
                    //Summon creature
                    BaseCreature bc = (BaseCreature)Activator.CreateInstance(SummonEntry.GetNPC(m_TalismanType));
                    if (BaseCreature.Summon(bc, m, m.Location, -1, TimeSpan.FromMinutes(10.0)))
                    {
                        bc.FixedParticles(0x3728, 1, 10, 9910, EffectLayer.Head);
                        bc.PlaySound(bc.GetIdleSound());
                        m_SummonedCreature = bc;
                        m_Charges--;
                        InvalidateProperties();
                        ChargeTimeLeft = 1800;
                        m_ChargeTimer  = new ChargeTimeLeftTimer(this);
                        m_ChargeTimer.Start();
                        m_ChargeTimeLeft3 = DateTime.Now;
                    }
                }
                else if (m_TalismanType == TalismanType.SummonRandom)
                {
                    //Summon Random
                    TalismanType tmpbc = SummonEntry.GetRandom();
                    BaseCreature bc    = (BaseCreature)Activator.CreateInstance(SummonEntry.GetNPC(tmpbc));
                    if (BaseCreature.Summon(bc, m, m.Location, -1, TimeSpan.FromMinutes(10.0)))
                    {
                        bc.FixedParticles(0x3728, 1, 10, 9910, EffectLayer.Head);
                        bc.PlaySound(bc.GetIdleSound());
                        m_SummonedCreature = bc;
                        m_Charges--;
                        InvalidateProperties();
                        ChargeTimeLeft = 1800;
                        m_ChargeTimer  = new ChargeTimeLeftTimer(this);
                        m_ChargeTimer.Start();
                        m_ChargeTimeLeft3 = DateTime.Now;
                    }
                }
                else
                {
                    Item summonitem;
                    int  message;

                    // Summon item
                    if (m_TalismanType == TalismanType.SummonBandage)
                    {
                        summonitem        = new Bandage(10);
                        summonitem.ItemID = 0x0EE9;
                        summonitem.Hue    = 0xA3;
                        message           = 1075002;               // You have been given some clean bandages.
                    }
                    else if (m_TalismanType == TalismanType.SummonBoard)
                    {
                        summonitem     = new Board(10);
                        summonitem.Hue = 0xA3;
                        message        = 1075000; // You have been given some wooden boards.
                    }
                    else                          // if ( m_TalismanType == TalismanType.SummonIngot )
                    {
                        summonitem     = new IronIngot(10);
                        summonitem.Hue = 0xA3;
                        message        = 1075001;                  // You have been given some ingots.
                    }

                    m.AddToBackpack(summonitem);
                    m.SendLocalizedMessage(message);

                    m_Charges--;
                    InvalidateProperties();
                    ChargeTimeLeft = 60;

                    m_ChargeTimer = new ChargeTimeLeftTimer(this);
                    m_ChargeTimer.Start();
                    m_ChargeTimeLeft3 = DateTime.Now;
                }
            }
        }