Convoker - Summoning Mastery. ML9

A place to submit .patch fixes for the DOL SVN

Moderator: Developer Team

Convoker - Summoning Mastery. ML9

Postby Yemla » Tue Aug 03, 2010 2:00 am

    Summoning Mastery
    Boosts effective level of pets to determine enemy damage variance for spells and melee. Effects one targeted pet that you control.
At this time, the spell only affects your "Main Pet", im attempting to make it any pet under your controll (this would be great for Theurgist)...on a side note Elds,Wiz,ect. could ML9 there Crystal Titan than aswell, like live...

Current Code.
Code: Select all
    #region Convoker-9
    [SpellHandlerAttribute("SummonMastery")]
    public class Convoker9Handler : MasterlevelHandling
    //public class Convoker9Handler : MasterlevelBuffHandling
    {
        private GameNPC m_living;

        //public override eProperty Property1 { get { return eProperty.MeleeDamage; } }

        public override void ApplyEffectOnTarget(GameLiving target, double effectiveness)
        {
            foreach (JuggernautEffect jg in target.EffectList.GetAllOfType(typeof(JuggernautEffect)))
            {
                if (jg != null)
                {
                    MessageToCaster("Your Pet already has an ability of this type active", eChatType.CT_SpellResisted);
                    return;
                }
            }
            base.ApplyEffectOnTarget(target, effectiveness);
        }

        public override void OnEffectStart(GameSpellEffect effect)
        {
            GamePlayer player = Caster as GamePlayer;

            m_living = player.ControlledBrain.Body;
            //m_living.Level += 20;
            m_living.BaseBuffBonusCategory[(int)eProperty.MeleeDamage] += 75;
            m_living.BaseBuffBonusCategory[(int)eProperty.ArmorAbsorption] += 75;
            m_living.Size += 40;
            base.OnEffectStart(effect);
        }

        public override int OnEffectExpires(GameSpellEffect effect, bool noMessages)
        {
            //m_living.Level -= 20;
            m_living.BaseBuffBonusCategory[(int)eProperty.MeleeDamage] -= 75;
            m_living.BaseBuffBonusCategory[(int)eProperty.ArmorAbsorption] -= 75;
            m_living.Size -= 40;
            return base.OnEffectExpires(effect, noMessages);
        }

        public Convoker9Handler(GameLiving caster, Spell spell, SpellLine line) : base(caster, spell, line) { }
    }
    #endregion






My New Code.
Code: Select all
    #region Convoker-9
    [SpellHandlerAttribute("SummonMastery")]
    public class Convoker9Handler : MasterlevelHandling
    {
        public override void ApplyEffectOnTarget(GameLiving target, double effectiveness)
        {
            foreach (JuggernautEffect jg in target.EffectList.GetAllOfType(typeof(JuggernautEffect)))
            {
                if (jg != null)
                {
                    MessageToCaster("Your Pet already has an ability of this type active", eChatType.CT_SpellResisted);
                    return;
                }
            }
            if (target != (Caster as GamePlayer).ControlledBrain.Body || target == null)
            {
                MessageToCaster("You must target your pet.", eChatType.CT_SpellResisted);
                return;
            }
            base.ApplyEffectOnTarget(target, effectiveness);
        }

        public override void OnEffectStart(GameSpellEffect effect)
        {
            if (effect.Owner is GameNPC)
            {
                if ((effect.Owner as GameNPC).Brain is ControlledNpcBrain)
                {
                    (effect.Owner as GameNPC).BaseBuffBonusCategory[(int)eProperty.MeleeDamage] += 75;
                    (effect.Owner as GameNPC).BaseBuffBonusCategory[(int)eProperty.ArmorAbsorption] += 75;
                    (effect.Owner as GameNPC).Size += 40;
                    base.OnEffectStart(effect);
                }
            }
        }

        public override int OnEffectExpires(GameSpellEffect effect, bool noMessages)
        {
            if (effect.Owner is GameNPC)
            {
                if ((effect.Owner as GameNPC).Brain is ControlledNpcBrain)
                {
                    (effect.Owner as GameNPC).BaseBuffBonusCategory[(int)eProperty.MeleeDamage] -= 75;
                    (effect.Owner as GameNPC).BaseBuffBonusCategory[(int)eProperty.ArmorAbsorption] -= 75;
                    (effect.Owner as GameNPC).Size -= 40;
                    base.OnEffectStart(effect);
                }
            }
            return base.OnEffectExpires(effect, noMessages);
        }

        public Convoker9Handler(GameLiving caster, Spell spell, SpellLine line) : base(caster, spell, line) { }
    }
    #endregion


I added a check in ApplyEffect which IDK if it is correct for the job im trying to do, let me know if you can tell (or if you've tested)....also i changed it so it would apply to any NPC that is a ControlledNpcBrain (i believe my combination will make it only target your Controlled NPCS that you select
Yemla
Contributor
 
Posts: 215
Joined: Sat Feb 02, 2008 3:21 am
Website: http://www.facebook.com/J.D.Snelling
Location: California

Re: Convoker - Summoning Mastery. ML9

Postby stephenxpimentel » Tue Aug 03, 2010 2:59 am

it looks solid to me, however i would just double check that u can't cast it on OTHER peoples pets. And also do theurgists (etc.) pets use ControlledNpcBrain? i think its just ones that get a pet window..

i would revamp it to check for GamePet, and check GamePet.PlayerOwner, just a couple suggestions in case it doesn't work the way u intended.
Lets have some fun.
stephenxpimentel
Contributor
 
Posts: 1300
Joined: Wed Sep 19, 2007 5:09 pm

Re: Convoker - Summoning Mastery. ML9

Postby Graveen » Tue Aug 03, 2010 9:04 am

i prefer your code yes.

But Juggernaut should be handled with EffectGroup, and the spell should simply add value1 level (+20) and value2 size (+40) to:
- your own pet if you have not selected one
- your own selected pet

Stat changes could be done through StatChanging spell (?name?, instead of being coded in the body of this spell.
If it is not possible then set a value3 (+75) to stats values .
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: Convoker - Summoning Mastery. ML9

Postby stephenxpimentel » Tue Aug 03, 2010 11:21 am

Graveen wrote:i prefer your code yes.

But Juggernaut should be handled with EffectGroup, and the spell should simply add value1 level (+20) and value2 size (+40) to:
- your own pet if you have not selected one
- your own selected pet

Stat changes could be done through StatChanging spell (?name?, instead of being coded in the body of this spell.
If it is not possible then set a value3 (+75) to stats values .


you misunderstand graveen, its not Juggernaut, its ML 9 Convoker ability, it does the same thing so the effects don't stack :)
Lets have some fun.
stephenxpimentel
Contributor
 
Posts: 1300
Joined: Wed Sep 19, 2007 5:09 pm

Re: Convoker - Summoning Mastery. ML9

Postby Graveen » Tue Aug 03, 2010 11:46 am

i understand, i simply think the fact it does not stack must be handled the same way other unstackable spells work (like buffs etc). Only for replacing the first foreach loop.

What i don't exactly remember is if there are facilities refusing - with spell db description and generic spellhandler code - stack or whatever . Now you ae talking about this, i guess *groups are handling the recast time, not the fact an effect stack or not.
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: Convoker - Summoning Mastery. ML9

Postby Tolakram » Tue Aug 03, 2010 12:58 pm

the proper effectgroup will prevent stacking of effects, but effectgroup is not exactly standard from db to db. THe latest public db, when available, will have Storm's effectgroups so we should go with those as a standard.

Just remember, because many make this mistake.

spellgroup is used for grouping spells on the skill page
effectgroup is used for stacking
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: Convoker - Summoning Mastery. ML9

Postby bluraven » Tue Aug 03, 2010 3:00 pm

Be aware that ML9 and Juggernaut do stack to a certain extent. The size of the pet is affected by both abilities and can be stacked to have a really huge pet. There might be other things about them that stack as well. I know that if you use ML9 and then Jugg, Jugg will wear off quickly and you'll lose both effects. If you use Jugg first then ML9, it will last with any stacking attributes for the duration of the ML9. It might be that the only stacking attribute from both abilities is the size of the pet, It's been a long time since I played my ML9 SM.
Image
bluraven
Support Team
 
Posts: 1484
Joined: Mon Mar 19, 2007 8:18 am
Location: Las Vegas, NV

Re: Convoker - Summoning Mastery. ML9

Postby Graveen » Tue Aug 03, 2010 6:29 pm

Thank you Tola for the precisions !

EffectGroup is handling the priority ?

And yes, Juggernaut and ML9 stack for at max 30 levels. So ML9 = +20 and Jugg1 = +10 are stacking iirc.
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: Convoker - Summoning Mastery. ML9

Postby Tolakram » Tue Aug 03, 2010 7:09 pm

If spell are in the same effectgroup then stacking checks to see which one is more powerful and decides if overwrite is ok.

At least that was the intent, but you know how spell code is. :)
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: Convoker - Summoning Mastery. ML9

Postby Graveen » Tue Aug 03, 2010 7:35 pm

/bow
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: Convoker - Summoning Mastery. ML9

Postby stephenxpimentel » Tue Aug 03, 2010 7:59 pm

Tolakram wrote:If spell are in the same effectgroup then stacking checks to see which one is more powerful and decides if overwrite is ok.

At least that was the intent, but you know how spell code is. :)


the way i've always understood effect group from my older experience, it may have changed in the core, but EffectGroup worked before the following


Effect Groups only worked if the SpellType of the spell was the same, and of course the same effect group.. for example a DamageOverTime, and a DamageOverTime can be in the same effect group and work properly.

(I would assume this is because checks for spells value etc. vary from handlers.)

a DamageOverTime and a HealOverTime cannot. It seemed logical to me at the time when i was messing around with stuff, but for a case like this, it doesn't.. Perhaps we should change Juggernaut to cast a "SummonMastery" spell instead of how it works now, as it does really do the same thing, just values are different.
Lets have some fun.
stephenxpimentel
Contributor
 
Posts: 1300
Joined: Wed Sep 19, 2007 5:09 pm

Re: Convoker - Summoning Mastery. ML9

Postby Yemla » Sun Nov 21, 2010 6:34 pm

Code: Select all
public override void OnEffectStart(GameSpellEffect effect)
{
GamePlayer player = Caster as GamePlayer;
mainPet = player.ControlledBrain.Body;
if ((effect.Owner as GameNPC).Brain is ControlledNpcBrain &&
(effect.Owner as IControlledBrain).GetPlayerOwner() == player)
{
(effect.Owner as GameNPC).BaseBuffBonusCategory[(int)eProperty.MeleeDamage] += 75;
(effect.Owner as GameNPC).BaseBuffBonusCategory[(int)eProperty.ArmorAbsorption] += 75;
(effect.Owner as GameNPC).Size += 40;
}
else
{
mainPet.BaseBuffBonusCategory[(int)eProperty.MeleeDamage] += 75;
mainPet.BaseBuffBonusCategory[(int)eProperty.ArmorAbsorption] += 75;
mainPet.Size += 40;
}
base.OnEffectStart(effect);
}

public override int OnEffectExpires(GameSpellEffect effect, bool noMessages)
{
GamePlayer player = Caster as GamePlayer;
if ((effect.Owner as GameNPC).Brain is ControlledNpcBrain &&
(effect.Owner as IControlledBrain).GetPlayerOwner() == player)
{
(effect.Owner as GameNPC).BaseBuffBonusCategory[(int)eProperty.MeleeDamage] -= 75;
(effect.Owner as GameNPC).BaseBuffBonusCategory[(int)eProperty.ArmorAbsorption] -= 75;
(effect.Owner as GameNPC).Size -= 40;
}
else
{
mainPet.BaseBuffBonusCategory[(int)eProperty.MeleeDamage] -= 75;
mainPet.BaseBuffBonusCategory[(int)eProperty.ArmorAbsorption] -= 75;
mainPet.Size -= 40;
}
return base.OnEffectExpires(effect, noMessages);
}

On live you could target example, A Crystal Titan (Convoker ML10), its a pet uncontrollable that last x amount of time level 70 or something that attacks only enemy realm targets....you can ML9 that, or a Brittleguard, Zo pet (artifact spell), Earthlord pet on theurgist which is uncontrollable....ect. it doesn't have to be your main pet...But a main point is if your target was null or wasn't a pet under your control it would automatically ML9 your main pet

won't commit tell tested just getting all my old work done now =}
Yemla
Contributor
 
Posts: 215
Joined: Sat Feb 02, 2008 3:21 am
Website: http://www.facebook.com/J.D.Snelling
Location: California

Re: Convoker - Summoning Mastery. ML9

Postby Tolakram » Sun Nov 21, 2010 9:08 pm

No error checking that caster is a gameplayer and that the caster has a pet.
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA


Return to “%s” DOL Code Contributions

Who is online

Users browsing this forum: No registered users and 1 guest