[SVN:3359] Memories Of War - Updates

A place to submit .patch fixes for the DOL SVN

Moderator: Developer Team

[SVN:3359] Memories Of War - Updates

Postby Crazys » Mon Sep 08, 2014 4:10 am

Issues.
Memories of War only does 15% currently should be 20% per live.
Gives 2ndary Resist identical to Avoidance of Magic. - currently does a modified change in spell handler and doesn't actually give the 2ndary resist. Not showing up in stats like /bonuses

http://camelotherald.wikia.com/wiki/Pat ... rsion_1.81

updated my ability database to text for Memories of War to say 2% per level 20% at 50 vs the 2-3% and 15% total it says now.

Updated MemeoriesOfWar.cs
Code: Select all
/* * DAWN OF LIGHT - The first free open source DAoC server emulator * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * */ using DOL.GS; using DOL.Database; namespace DOL.GS.SkillHandler { //Memories of War: Upon reaching level 41, the Hero, Warrior and Armsman will begin to gain more magic resistance //(spell damage reduction only) as they progress towards level 50. At each level beyond 41 they gain 2% extra //resistance per level. At level 50, they will have the full 20% benefit. [SkillHandlerAttribute(Abilities.MemoriesOfWar)] public class MemoriesOfWar : StatChangingAbility { /// <summary> /// The list of properties this ability affects /// </summary> public static eProperty[] properties = new eProperty[] { eProperty.Resist_Body, eProperty.Resist_Cold, eProperty.Resist_Energy, eProperty.Resist_Heat, eProperty.Resist_Matter, eProperty.Resist_Spirit, }; public MemoriesOfWar(DBAbility dba, int level) : base(dba, level, properties) { } public override int GetAmountForLevel(int level) { switch (level) { case 1: return 2; case 2: return 4; case 3: return 6; case 4: return 8; case 5: return 10; case 6: return 12; case 7: return 14; case 8: return 16; case 9: return 18; default: return 20; } } } }
updated warrior and arms lelvel 41-50 grant area
Code: Select all
if (player.Level >= 41) { player.AddAbility(SkillBase.GetAbility(Abilities.MemoriesOfWar, 1)); player.AddAbility(SkillBase.GetAbility(Abilities.ScarsOfBattle)); } if (player.Level >= 42) { player.AddAbility(SkillBase.GetAbility(Abilities.MemoriesOfWar, 2)); } if (player.Level >= 43) { player.AddAbility(SkillBase.GetAbility(Abilities.MemoriesOfWar, 3)); } if (player.Level >= 44) { player.AddAbility(SkillBase.GetAbility(Abilities.MemoriesOfWar, 4)); } if (player.Level >= 45) { player.AddAbility(SkillBase.GetAbility(Abilities.MemoriesOfWar, 5)); } if (player.Level >= 46) { player.AddAbility(SkillBase.GetAbility(Abilities.MemoriesOfWar, 6)); } if (player.Level >= 47) { player.AddAbility(SkillBase.GetAbility(Abilities.MemoriesOfWar, 7)); } if (player.Level >= 48) { player.AddAbility(SkillBase.GetAbility(Abilities.MemoriesOfWar, 8)); } if (player.Level >= 49) { player.AddAbility(SkillBase.GetAbility(Abilities.MemoriesOfWar, 9)); } if (player.Level >= 50) { player.AddAbility(SkillBase.GetAbility(Abilities.Fury)); player.AddAbility(SkillBase.GetAbility(Abilities.MemoriesOfWar, 10)); }
updated hero level 41-50 ability area
Code: Select all
if (player.Level >= 41) { player.AddAbility(SkillBase.GetAbility(Abilities.MemoriesOfWar, 1)); player.AddAbility(SkillBase.GetAbility(Abilities.ScarsOfBattle)); } if (player.Level >= 42) { player.AddAbility(SkillBase.GetAbility(Abilities.MemoriesOfWar, 2)); } if (player.Level >= 43) { player.AddAbility(SkillBase.GetAbility(Abilities.MemoriesOfWar, 3)); } if (player.Level >= 44) { player.AddAbility(SkillBase.GetAbility(Abilities.MemoriesOfWar, 4)); } if (player.Level >= 45) { player.AddAbility(SkillBase.GetAbility(Abilities.Stag, 4)); player.AddAbility(SkillBase.GetAbility(Abilities.MemoriesOfWar, 5)); } if (player.Level >= 46) { player.AddAbility(SkillBase.GetAbility(Abilities.MemoriesOfWar, 6)); } if (player.Level >= 47) { player.AddAbility(SkillBase.GetAbility(Abilities.MemoriesOfWar, 7)); } if (player.Level >= 48) { player.AddAbility(SkillBase.GetAbility(Abilities.MemoriesOfWar, 8)); } if (player.Level >= 49) { player.AddAbility(SkillBase.GetAbility(Abilities.MemoriesOfWar, 9)); } if (player.Level >= 50) { player.AddAbility(SkillBase.GetAbility(Abilities.Fury)); player.AddAbility(SkillBase.GetAbility(Abilities.MemoriesOfWar, 10)); }
removal of hardcoded ability in SpellHandler.cs
LINE TO REMOVE
3670-3685
Code: Select all
/*Variance by Memories of War * - Memories of War: Upon reaching level 41, the Hero, Warrior and Armsman * will begin to gain more magic resistance (spell damage reduction only) * as they progress towards level 50. At each level beyond 41 they gain * 2%-3% extra resistance per level. At level 50, they will have the full 15% benefit. * from http://www.camelotherald.com/article.php?id=208 * * - assume that "spell damage reduction only" indicates resistcategory 2 */ if (ad.Target is GamePlayer && (ad.Target as GamePlayer).HasAbility(Abilities.MemoriesOfWar) && ad.Target.Level >= 40) { int levelbonus = Math.Min(target.Level - 40, 10); secondaryResistModifier += (int)((levelbonus * 0.1 * 15)); }
Crazys
Contributor
 
Posts: 346
Joined: Tue Nov 07, 2006 10:18 pm

Re: Memories Of War - Updates

Postby Graveen » Mon Sep 08, 2014 7:21 am

Thank you Crazys,

Can you provide a patch in regard of the current SVN ? TYVM
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: Memories Of War - Updates

Postby Crazys » Mon Sep 08, 2014 1:31 pm

I followed the instructions from the post on how to.. hopefully i did it right!
Attachments
MemoriesOfWar.patch
(11.46 KiB) Downloaded 34 times
Crazys
Contributor
 
Posts: 346
Joined: Tue Nov 07, 2006 10:18 pm

Re: Memories Of War - Updates

Postby Tolakram » Mon Sep 08, 2014 1:46 pm

Hi Crazys, are you sure this works as intended?

Just taking a snippet of the patch:
Code: Select all
+ if (player.Level >= 47) + { + player.AddAbility(SkillBase.GetAbility(Abilities.MemoriesOfWar, 7)); + } + if (player.Level >= 48) + { + player.AddAbility(SkillBase.GetAbility(Abilities.MemoriesOfWar, 8)); + } + if (player.Level >= 49) + { + player.AddAbility(SkillBase.GetAbility(Abilities.MemoriesOfWar, 9)); + } + if (player.Level >= 50) + { + player.AddAbility(SkillBase.GetAbility(Abilities.Fury)); + player.AddAbility(SkillBase.GetAbility(Abilities.MemoriesOfWar, 10)); + }
So at level 50 I will get Memories of War 1 - 10. I'm unclear on how add ability works, will it correctly only assign the latest ability?

I disagree with putting the logic for how much resistance to get in the player class by re-adding the ability over and over, unless you have a clear explanation on why this method is preferred over adjusting resist levels in the MoW ability code.

I DO like getting rid of the extra garbage in spell handler! :)
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: Memories Of War - Updates

Postby Crazys » Mon Sep 08, 2014 1:57 pm

I did it this way in an attempt to follow the formatting of the rest of the player abilities.
For Example Stag ability is given to the warrior and as he levels up it gets stronger. or say Mastery of Evasion one of those.

In this aspect
At level 41 - the first rank of the ability is 2%
at level 42 - the 2nd rank of the ability is 4%.
all the way to 50 = full value of 20%

I personally felt that formatting it in this way made it match the rest of the abilities progression...
Since all of the other ability handlers like Avoidance of Magic and Physical Defense just return values and res types in the handler and leave the actual progression to the RA training or like stag and other scaling skills in the level progression of the player.

*if you feel there is a better way i'd have no objections. I just know the above worked and tested correctly with only needing a text change to the DB abilitys to match the 20% vs the incorrect 15% currently shown.

*edit - I checked to see how vamps handled their scaling stat changes w/ levels. Which puts extra modification into GamePlayer.cs. I personally feel that the few lines added to having it scale in Player Classes for those classes is better then having the GamePlayer.cs itself modified to handle the change.
So at level 50 I will get Memories of War 1 - 10. I'm unclear on how add ability works, will it correctly only assign the latest ability?
Adding a higher level of the same ability overrides the lower level ability
Aka I have 1 then I get 2. 2 replaces my 1 and so on
Crazys
Contributor
 
Posts: 346
Joined: Tue Nov 07, 2006 10:18 pm

Re: Memories Of War - Updates

Postby Tolakram » Mon Sep 08, 2014 4:31 pm

That's a good enough reason IMO. I was not aware, or forgot, other abilities followed this technique as well.
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: Memories Of War - Updates

Postby Crazys » Mon Sep 08, 2014 5:42 pm

That's a good enough reason IMO. I was not aware, or forgot, other abilities followed this technique as well.
I have to admit. I was waiting for your questions this time :) You've always seemed to be my biggest hurdle of approval :) To hear that the first time without any changes I think I finally did it right!
I applaud you sir!
Crazys
Contributor
 
Posts: 346
Joined: Tue Nov 07, 2006 10:18 pm

Re: Memories Of War - Updates

Postby Graveen » Tue Sep 09, 2014 11:20 am

ahah gj Crazys so i'll commit ;)
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: Memories Of War - Updates

Postby Leodagan » Tue Sep 16, 2014 3:34 pm

Graveen don't bother committing this

I had similar fixes already in my code...

I'm merging them as they are shorter and cleaner....
Code: Select all
if (player.Level >= 41) { player.AddAbility(SkillBase.GetAbility(Abilities.MemoriesOfWar, player.Level-40));
Code: Select all
// Caps at level 10. public override int GetAmountForLevel(int level) { return Math.Min(10, level) * 2; }
this will apply every level until top level...
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Memories Of War - Updates

Postby Leodagan » Tue Sep 16, 2014 6:49 pm

hum...

Remember that with "passive abilities" you need to set the "Implementation" Field of Ability database to the correct string :
Code: Select all
UPDATE `ability` SET `Name` = 'Memories of War %n', `Implementation` = 'DOL.GS.SkillHandler.MemoriesOfWar' WHERE `KeyName` = 'Memories of War';

Edit : Committed update to DOL SVN Revision 3359. Tested, it even displays correctly in Char stats !
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 Code Contributions

Who is online

Users browsing this forum: No registered users and 1 guest