Spell Revamp Campain.

Discussions on various DOL development features

Moderator: Support Team

Re: Spell Revamp Campain.

Postby Leodagan » Tue May 19, 2015 1:35 pm

... And here it is in Revision 3480 :

using table "SpellXCustomValues" will allow to link multiple spell by creating multiple relations with key "MultipleSubSpellID" and one SpellID by row.
Code: Select all
ed11b9007af489d860f214833a0552fdbd53e507 DOLSharp/trunk/GameServer/spells/Spell.cs | 10 +++++++++- DOLSharp/trunk/GameServer/spells/SpellHandler.cs | 20 ++++++++++++++------ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/DOLSharp/trunk/GameServer/spells/Spell.cs b/DOLSharp/trunk/GameServer/spells/Spell.cs index 5d167c2..38e5d5b 100644 --- a/DOLSharp/trunk/GameServer/spells/Spell.cs +++ b/DOLSharp/trunk/GameServer/spells/Spell.cs @@ -548,7 +548,7 @@ namespace DOL.GS { get { - return SubSpellID > 0; + return SubSpellID > 0 || MultipleSubSpells.Count > 0; } } @@ -638,6 +638,14 @@ namespace DOL.GS return this.GetParamValue<ushort>("InternalIconID"); } } + + public IList<int> MultipleSubSpells + { + get + { + return this.GetParamValues<int>("MultipleSubSpellID").Where(id => id > 0).ToList(); + } + } /// <summary> /// Initialize Param Cache from DB Relation Collection. diff --git a/DOLSharp/trunk/GameServer/spells/SpellHandler.cs b/DOLSharp/trunk/GameServer/spells/SpellHandler.cs index 821bb6a..cf8cad7 100644 --- a/DOLSharp/trunk/GameServer/spells/SpellHandler.cs +++ b/DOLSharp/trunk/GameServer/spells/SpellHandler.cs @@ -19,6 +19,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Linq; using System.Reflection; using System.Text; using DOL.AI.Brain; @@ -2329,14 +2330,21 @@ namespace DOL.GS.Spells /// <param name="target"></param> public virtual void CastSubSpells(GameLiving target) { - if (m_spell.SubSpellID > 0 && Spell.SpellType != "Archery" && Spell.SpellType != "Bomber" && Spell.SpellType != "SummonAnimistFnF" && Spell.SpellType != "SummonAnimistPet" && Spell.SpellType != "Grapple") + if (Spell.SpellType != "Archery" && Spell.SpellType != "Bomber" && Spell.SpellType != "SummonAnimistFnF" && Spell.SpellType != "SummonAnimistPet" && Spell.SpellType != "Grapple") { - Spell spell = SkillBase.GetSpellByID(m_spell.SubSpellID); - //we need subspell ID to be 0, we don't want spells linking off the subspell - if (target != null && spell != null && spell.SubSpellID == 0) + List<int> subSpellList = new List<int>(); + if (m_spell.SubSpellID > 0) + subSpellList.Add(m_spell.SubSpellID); + + foreach (int spellID in subSpellList.Union(m_spell.MultipleSubSpells)) { - ISpellHandler spellhandler = ScriptMgr.CreateSpellHandler(m_caster, spell, SkillBase.GetSpellLine(GlobalSpellsLines.Reserved_Spells)); - spellhandler.StartSpell(target); + Spell spell = SkillBase.GetSpellByID(spellID); + //we need subspell ID to be 0, we don't want spells linking off the subspell + if (target != null && spell != null && spell.SubSpellID == 0) + { + ISpellHandler spellhandler = ScriptMgr.CreateSpellHandler(m_caster, spell, SkillBase.GetSpellLine(GlobalSpellsLines.Reserved_Spells)); + spellhandler.StartSpell(target); + } } } }
Legacy Field "SubSpellID" in "Spell" table is still acting like before, except it won't allow any type of chaining.
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Spell Revamp Campain.

Postby HunabKu » Tue May 19, 2015 6:26 pm

Nice job like always !
"C'est l'ignorance qui apporte le chaos, pas la connaissance."
Scarlett Johansson dans "Lucy" de Luc Besson
-------------------------------------------------------------------------------
"Ignorance brings chaos, not knowledge."
Scarlett Johansson on "Lucy" by Luc Besson
User avatar
HunabKu
Developer
 
Posts: 1905
Joined: Sat Jun 18, 2011 4:48 am

Re: Spell Revamp Campain.

Postby Graveen » Mon May 25, 2015 11:46 pm

clap clap :) Thank you Leo :)

Anybody interest in reviewing the class spells to move them to new system ? :)
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: Spell Revamp Campain.

Postby Leodagan » Tue May 26, 2015 5:28 am

I'll be doing some tests around "Monster Rez" which is one of the few "Class Spell" needing multiple sub spells references...

The other use cases are more targeted to "Items Spell" I think
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Spell Revamp Campain.

Postby Dinberg » Tue Sep 08, 2015 11:37 pm

Hey Leo,

I run on quite an old code revision. What are the important changes made here? What is the current status of this? Did you ever finish it off?

Also, I suppose you still make use of ISpellHandler, so if need be I can always refactor SpellHandler -> OldSpellHandler and reinherit my custom handlers from OldSpellHandler instead to retain functionality?
The Marvelous Contraption begins to stir...
User avatar
Dinberg
Inactive Staff Member
 
Posts: 4695
Joined: Sat Mar 10, 2007 9:47 am
Yahoo Messenger: dinberg_darktouch
Location: Jordheim

Re: Spell Revamp Campain.

Postby Leodagan » Wed Sep 09, 2015 8:53 am

SpellHandlers are still not heavily modified in latest revision...

there are only some new feature like buff stacking with disabled effect (to enable multiple similar buff but keeping only the best one in effect)

and the features of SpellXCustomValues that allow to implement arbitrary data for SpellHandlers without modifying the Spell Table :)

but nothing code breaking up to now :p
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Spell Revamp Campain.

Postby Dinberg » Wed Sep 09, 2015 6:44 pm

Do you have a timeline for anything code breaking? I'm working on a custom project that relies heavily on the current spell system and I want to know if/when it is going to break.

As an aside: I still like the idea behind this, but I do have concerns about overhauls of this scale in a project which is in decline in terms of users. But feel free to ignore me there - I think you are doing a great job. I'm probably just a little too attached to my scripts :)
The Marvelous Contraption begins to stir...
User avatar
Dinberg
Inactive Staff Member
 
Posts: 4695
Joined: Sat Mar 10, 2007 9:47 am
Yahoo Messenger: dinberg_darktouch
Location: Jordheim

Re: Spell Revamp Campain.

Postby Leodagan » Thu Sep 10, 2015 8:19 am

Well I don't really have a time line because I mostly do this when I have some free time and I feel like coding (and testing afterwards...)

But there won't be huge code break "at once", the biggest change should be around splitting most of check methods or other big functions, to make them more atomic, allowing spell handler subclass to override only small part of code to make their own effect instead of the current behavior where spell rewrite WHOLE method of SpellHandler base class to enforce all its custom behavior

Example :

A "CheckCast" Method will be modified to be the main entrance for checking a lot of "sub function", "CheckCast" will have to call "CheckCasterIncapacited", "CheckAttackTarget", "CheckTargetInView", "CheckCasterPower" etc etc...

And any Spell Handler will have to only override these small methods, like a spell not needing Power can override CheckCasterPower to only return "true" whatever happen, an other spell like "Purge" which can be casted when CC'ed will override "CheckCasterIncapacited" to return always false, etc...

But any "Old" spell handler still overriding the WHOLE "CheckCast" method to make its own checks will still work like before (I just need to keep most Method Name untouched...)


This Methodology will be used for every aspects of spell handlers that are currently widely overridden for "live behavior"
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Spell Revamp Campain.

Postby Dinberg » Thu Sep 10, 2015 7:47 pm

Looks good :)
The Marvelous Contraption begins to stir...
User avatar
Dinberg
Inactive Staff Member
 
Posts: 4695
Joined: Sat Mar 10, 2007 9:47 am
Yahoo Messenger: dinberg_darktouch
Location: Jordheim


Return to “%s” DOL Development Discussion

Who is online

Users browsing this forum: No registered users and 1 guest