Style Procs and relation to LineXspell

Discussions on various DOL development features

Moderator: Support Team

Style Procs and relation to LineXspell

Postby Yay » Wed Sep 23, 2015 7:16 pm

Hello,

After some research on an errorless error, I found that some style proc spells are missing the LineXspell entry. There is obviously an error message or even an "not implemented" error missing.

CreateMagicEffect in StyleProcessor.cs (beginning at line 621) is the culprite here. To do a conservative fix I would just use
Code: Select all
ISpellHandler spellHandler = ScriptMgr.CreateSpellHandler(caster, styleSpell, styleLine); if (styleSpell == null || (spellHandler == null && caster is GamePlayer)) { .... }
But here is the reason of my post: Is this association even necessary? Because CreateMagicEffect is already only used for style procs and therefore I thought it is sensible to just set the SpellLine to GlobalSpellsLines.Combat_Styles_Effect

It would look like this:
Code: Select all
protected static ISpellHandler CreateMagicEffect(GameLiving caster, GameLiving target, int spellID) { SpellLine styleLine = SkillBase.GetSpellLine(GlobalSpellsLines.Combat_Styles_Effect); Spell styleSpell = SkillBase.GetSpellByID(spellID); if (styleLine == null) return null; ISpellHandler spellHandler = ScriptMgr.CreateSpellHandler(caster, styleSpell, styleLine); if (spellHandler == null && caster is GamePlayer) { ((GamePlayer)caster).Out.SendMessage(styleSpell.Name + " not implemented yet (" + styleSpell.SpellType + ")", eChatType.CT_System, eChatLoc.CL_SystemWindow); } // No negative effects can be applied on a keep door or via attacking a keep door if ((target is GameKeepComponent || target is GameKeepDoor) && spellHandler.HasPositiveEffect == false) { return null; } return spellHandler; }
You can then delete most if not all LineXspell entries with the LineName 'Combat style effects'. It would also make implementing more intuitive and less error prone.

But obviously I maybe oversaw something and therefore I ask if this is sensible to just hardcode the styleLine for procs. (And therefore delete the checks)

Kind regards,

YaY
User avatar
Yay
Contributor
 
Posts: 174
Joined: Mon May 21, 2012 9:06 pm

Re: Style Procs and relation to LineXspell

Postby HunabKu » Thu Sep 24, 2015 6:36 am

Your research is interesting, i think Leodagan can tell us more.
"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: Style Procs and relation to LineXspell

Postby Leodagan » Thu Sep 24, 2015 7:46 am

I can't check this from work, but anyway message-less errors is wrong :D

Even if we may have a lot of Garbage in Log from Warning/Errors that don't break the game we need as much verbosity as we can achieve and ultimately filter message through log4net config...

For the Combat_Styles_Effect there is something wrong in the actual code...

SkillBase Class will mostly never return "null" from a GetSpellLine as this method default to a newly created spell line if it can't be found...

Iterating through hardcoded Line "Combat_Styles_Effect" to match spell ID is also wrong for two reasons :

- It Could be simplified with a LINQ Where() expression :)
- It won't match spell thats aren't attached to the hardcoded Line in Database...

I remember there is some specific Method in SkillBase, you can look for a Spell ID inside a Specific Line and it will also look for global spell cache to return the spell anyway even if not found in given line (but if spell is found in the given line, spell Level will be set to the Line Required Level...)
Code: Select all
/// <summary> /// Will attempt to find either in the spell line given or in the list of all spells /// </summary> /// <param name="spellID"></param> /// <param name="line"></param> /// <returns></returns> public static Spell FindSpell(int spellID, SpellLine line)
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Style Procs and relation to LineXspell

Postby Yay » Thu Sep 24, 2015 4:30 pm

Also there is no error whatsoever. It makes sense, because the output is just no proc and the delve is searching for the proc differently. Finally it's just the condition that leads to the missing error message (not implemented). It would show up otherwise.

But the question is, does it even make sense to search in the spellLine? I mean the spell is already selected by stylexspell and therefore ofc a combat_style_effect and furthermore there is currently no way of using a spell in another line than this line, if I understand this correctly.

Btw the hardcoded version (the second) is working, because I just hardcoded it to combat_style_effects line when casting the spell.
User avatar
Yay
Contributor
 
Posts: 174
Joined: Mon May 21, 2012 9:06 pm

Re: Style Procs and relation to LineXspell

Postby Leodagan » Sat Sep 26, 2015 10:51 am

I don't really know all the effects of this kind of Hardcoded Line...

I can just tell that matching spell outside of its spell line will create a Level 1 Spell instead of its line level...

Maybe there are other checks around Style Spell to raise the effectiveness to the Level of the user or the Style Level or anything else, but I can't remember :D

Anyway we should try to make procs work most of the time even if there is some relation missing in hardcoded lines ;)
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon


Return to “%s” DOL Development Discussion

Who is online

Users browsing this forum: No registered users and 1 guest