Page 1 of 1

Error protection and log for Procs

PostPosted: Thu Mar 24, 2016 1:22 am
by elcotek
Hello,

i can't say if this work with the dol source, but i spend a little protection off errors and resulting laags for dol, if an proc spells is on an item but no spell is exist and to find items with his wrong proc spells in your Logs.

after this line in GameLiving;
Code: Select all
// Proc chance is 2.5% per SPD, i.e. 10% for a 3.5 SPD weapon. - Tolakram, changed average speed to 3.5 int procChance = (int)Math.Ceiling(((weapon.ProcChance > 0 ? weapon.ProcChance : 10) * (weapon.SPD_ABS / 35.0)));

Code: Select all
//Error protection and log for Item Proc's Spell procSpell = null; Spell procSpell1 = null; if (this is GamePlayer) { SpellLine line = SkillBase.GetSpellLine(GlobalSpellsLines.Item_Effects); if (line != null) { procSpell = SkillBase.FindSpell(weapon.ProcSpellID, line); procSpell1 = SkillBase.FindSpell(weapon.ProcSpellID1, line); if (procSpell == null && weapon.ProcSpellID != 0) { log.Error("- Proc Not Found: " + weapon.ProcSpellID + " " + weapon.Name); } if (procSpell1 == null && weapon.ProcSpellID1 != 0) { log.Error("- Proc1 Not Found: " + weapon.ProcSpellID1 + " " + weapon.Name); } } } // Proc #1 if (procSpell != null && Util.Chance(procChance)) StartWeaponMagicalEffect(weapon, ad, SkillBase.GetSpellLine(GlobalSpellsLines.Item_Effects), procSpell.ID, false); // Proc #2 if (procSpell1 != null && Util.Chance(procChance)) StartWeaponMagicalEffect(weapon, ad, SkillBase.GetSpellLine(GlobalSpellsLines.Item_Effects), procSpell1.ID, false);

Re: Error protection and log for Procs

PostPosted: Thu Mar 24, 2016 7:12 am
by HunabKu
Sounds really interesting Elcotek, thanks.

Re: Error protection and log for Procs

PostPosted: Thu Mar 24, 2016 3:20 pm
by elcotek
Short Update after test,

please use:
Code: Select all
StartWeaponMagicalEffect(weapon, ad, SkillBase.GetSpellLine(GlobalSpellsLines.Item_Effects), weapon.ProcSpellID, false); StartWeaponMagicalEffect(weapon, ad, SkillBase.GetSpellLine(GlobalSpellsLines.Item_Effects), weapon.ProcSpellID1, false);
or you have some errors with Astral proc's:)

Re: Error protection and log for Procs

PostPosted: Fri Mar 25, 2016 7:24 am
by HunabKu
Nice.
Do you do more test or code is ready for commit ?

Re: Error protection and log for Procs

PostPosted: Fri Mar 25, 2016 11:37 am
by elcotek
I have this code active on my server, it works atm.
I can create a patch for dol and post here if you whish:)

Re: Error protection and log for Procs

PostPosted: Fri Mar 25, 2016 11:55 am
by elcotek
oki here is the patch for the actual dol source.

Re: Error protection and log for Procs

PostPosted: Fri Mar 25, 2016 9:02 pm
by Graveen
Please use pull request now. Thank you Elcotek. Can you make this PR on your side ? :)

/worship

Re: Error protection and log for Procs

PostPosted: Sat Mar 26, 2016 9:40 am
by elcotek
I have an Source Forge Account but they say me Authentication are faild, (No more credentials or we tried too many times.), i use TortoiseSVN 1.9.3.2703 to commit, but dont work. :(

I have now created an GitHub Account, but near same result (coult not begin a transaction). :(

Re: Error protection and log for Procs

PostPosted: Sat Mar 26, 2016 10:53 am
by HunabKu
Graveen or Leo need to active your account before. Send them your github account.

Re: Error protection and log for Procs

PostPosted: Sat Mar 26, 2016 12:16 pm
by elcotek
I will do, thank you. :)

Re: Error protection and log for Procs

PostPosted: Sun Mar 27, 2016 5:27 pm
by Leodagan
Code was committed through Github pull request, with some reviews and an automated build ;)

https://github.com/Dawn-of-Light/DOLSharp/pull/10

Github contributions don't need any activation from Graveen or me, you can publish any pull request through github workflow, final merge is up to me or Graveen for now...

Re: Error protection and log for Procs

PostPosted: Mon Mar 28, 2016 11:39 am
by HunabKu
Okai better and nice system ;)