Exemplo n.º 1
0
        public void MakeDMGSpellTriggers(Mobile src, Mobile target, LastSpellState state,int dmg)
        {
            int roll;
            #region Additional effects
            #region OnCriticalTalentsHandling
                if(state == LastSpellState.Critical)
                {
                    if(src.Level > 9)
                    {
                        switch (src.Classe)
                        {
                            #region mage
                            case Classes.Mage:
                                // ignite
                                if ( resistance == Resistances.Fire)
                                {
                                    if ( src.HaveTalent( Talents.Ignite ) )
                                    {
                                        AuraEffect ae = (AuraEffect)src.GetTalentEffect( Talents.Ignite );
                                        AuraEffect af = (AuraEffect)Abilities.abilities[12654];
                                        float modif = (float)ae.S1/100;
                                        af.ApplyDot(src, target, (int)(dmg*modif), af.T1, af.Duration(src));
                                    }
                                }
                                break;
                                #endregion
                            #region warrior
                            case Classes.Warrior:

                                break;
                                #endregion
                        }
                    }

                }
                #endregion
            #region Other Spell effecting Talents
                switch (src.Classe)
                {
                    #region mage
                    case Classes.Mage:
                        //Impact
                        if (state == LastSpellState.Normal)
                        {
                            if (src.HaveTalent(Talents.Impact))
                            {
                                if (this.resistance == Resistances.Fire)
                                {
                                    AuraEffect af = (AuraEffect)src.GetTalentEffect(Talents.Impact);
                                    roll = Utility.Random( 100 );
                                    if(roll < af.S1)
                                    {
                                        AuraEffect ef = (AuraEffect)Abilities.abilities[(int)af.AdditionalSpell];
                                        Aura aura = new Aura();
                                        aura.ForceStun = true;
                                        target.AddAura(src,ef,aura,true);
                                    }

                                }
                            }

                            // Improved Scorch
                            if ( src.HaveTalent( Talents.ImprovedScorch ) &&
                                SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 2948 ] )
                            {
                                AuraEffect ae = (AuraEffect)src.GetTalentEffect( Talents.ImprovedScorch);
                                roll = Utility.Random( 100 );
                                if(roll < ae.S1)
                                {
                                    AuraEffect ef = (AuraEffect)Abilities.abilities[(int)ae.AdditionalSpell];
                                    Aura aura = new Aura();
                                    aura.FireDamageTakenModifier = 1 + (float)ef.S1/100;
                                    target.AddAura(src,ef,aura,true);
                                }
                            }

                            // Arcane Concentration
                            int ClearingState = 0xd45a45;
                            if ( src.HaveTalent( Talents.ArcaneConcentration ) )
                            {
                                AuraEffect ae = (AuraEffect)src.GetTalentEffect( Talents.ArcaneConcentration);
                                roll = Utility.Random( 100 );
                                if(roll < ae.H)
                                {
                                    src.AdditionnalStates.Add(ClearingState);
                                }
                            }
                        }

                        break;
                    #endregion
                    #region Warlock
                    case Classes.Warlock:
                        ///aftewmatch
                        if ( AbilityClasses.abilityClasses[ (int)Id ] == (int)ClassesOfSpells.Destruction )
                            if ( src.HaveTalent( Talents.Aftermath ) )
                            {
                                AuraEffect ae = (AuraEffect)src.GetTalentEffect( Talents.Aftermath );
                                if ( Utility.Random( 100 ) < ae.H )
                                {
                                    Aura aura = new Aura();
                                    aura.SpeedModifier = ( -( (float)ae.S1 ) / 100.0f );
                                    aura.OnRelease = new Aura.AuraReleaseDelegate( SpellTemplate.OnCastSpeedModEnd );
                                    target.AddAura(src, ae, aura, true );
                                    target.ChangeRunSpeed( target.RunSpeed );
                                }
                            }
                        // pyroclasm
                        if ( SpellTemplate.SpellEffects[ (int)Id ] == SpellTemplate.SpellEffects[ 1949 ] ||//Hell fire
                            SpellTemplate.SpellEffects[5740] == SpellTemplate.SpellEffects[ (int)Id ] )// Rain of fire
                            if ( src.HaveTalent( Talents.Pyroclasm ) )
                            {
                                int prob = 0;
                                if ( src.TalentLevel( Talents.Pyroclasm ) == 1 )
                                    prob = 13;
                                else
                                    prob = 26;
                                if ( Utility.Random( 100 ) < prob )
                                {
                                    Aura aura = new Aura();
                                    aura.ForceStun = true;
                                    target.AddAura( (AuraEffect)Abilities.abilities[ 18093 ], aura, true );
                                }
                            }
                        break;
                    #endregion
                }
            #endregion
            #endregion
        }
Exemplo n.º 2
0
        public void DrainMana( Mobile src, Mobile target, float dmg )
        {
            int heal = MakeManaDamage( src, target, dmg, true );
            float damage = 0f;
            if ( src.HaveTalent( Talents.ImprovedDrainMana ) )
            {
                AuraEffect ae = (AuraEffect)src.GetTalentEffect( Talents.ImprovedDrainMana );
                if(src.TalentLevel(Talents.ImprovedDrainMana) == 1)
                    damage = (float)(heal*0.15);
                else damage = (float)(heal*0.30);

            }
            if (damage > 0) this.MakeDamage(src,target,damage);
            src.GainMana( target, heal );
        }