COMMITTED: Spell & DoT Shielding
This also includes a fix for the spell rune effects(Bulwark of Alendar) as they were incorrectly also reducing the damage on DoTs.
edit... this didnt fix the problem with spell runes. edit2... also doesnt seem to apply properly to DoTs and DD, just does the highest one to both(yay for testing at cap for both stats). its late so will fix tomorrow code... mob.h - alter this - line 842 Code:
sint32 ReduceMagicalDamage(sint32 damage); Code:
sint32 ReduceMagicalDamage(sint32 damage, int16 spell_id); Code:
damage = ReduceMagicalDamage(damage); Code:
damage = ReduceMagicalDamage(damage, spell_id); Code:
sint32 Mob::ReduceMagicalDamage(sint32 damage) Code:
sint32 Mob::ReduceMagicalDamage(sint32 damage, int16 spell_id) |
Any chance you could apply the same logic for spell shielding to the following
Spell effect 296 Increase Incomming Spell damage. Basically it would just be a reverse midigation without having to worry about the rune part. |
Yea actually, I needed to fix it as it was easy to get working for single effect spells like Ice Comet(DD) or Horror(DoT) but for spells like Ikaav Venom which have a DD and a DoT component, that was my problem. Then I noticed we have access to the bufftic so it was easy to seperate out those effects and now it is working 100%(as far as I can see), with the added support for SE_SpellVulnerability(or Increase Incoming Spell Damage). This also truly fixes the spell runes being used on DoT ticks as well.
edit... spoke too soon, SpellVulnerability works on clients but doesnt affect nukes cast on NPCs it seems. maybe I can fix it before my edit timer runs out... ... looks like the problem is with the focus code as it only increases spells you can cast on yourself, will have to look into alternative way of limiting what spells are affected by the vulnerability. Ignore the previous code... spell effects.cpp - line 2810 - add this Code:
case SE_SpellVulnerability: Code:
case SE_SpellVulnerability: Code:
focusSpellVulnerability, Code:
sint32 ReduceMagicalDamage(sint32 damage); Code:
sint32 AffectMagicalDamage(sint32 damage, int16 spell_id, const bool iBuffTic); Code:
damage = ReduceMagicalDamage(damage); Code:
damage = AffectMagicalDamage(damage, spell_id, iBuffTic); Code:
sint32 Mob::ReduceMagicalDamage(sint32 damage) Code:
sint32 Mob::AffectMagicalDamage(sint32 damage, int16 spell_id, const bool iBuffTic) |
OK this is fully functional as far as I can tell now. The spell and DoT shielding work perfectly, spell runes are limited to DDs and SE_SpellVulnerability works perfect for clients. I added a section to deal with NPCs casting on clients with vulnerabilities as well, its not the most elegant solution however it allows you to have an NPC cast a spell that will make clients vulnerable to DDs or DoTs of any or all resists. To make clients vulnerable to both DDs and DoTs at the same time you would have to implement both SE_LimitInstant and SE_LimitMinDur in the vulnerability spell, however counterintuitive that may be(perhaps is a better way to code it?).
Going to include all the code even though not all changed(figured this would be easiest for others)... bold headers are the ones that have changed from the second post. spell effects.cpp - line 2810 - add this Code:
case SE_SpellVulnerability: Code:
case SE_SpellVulnerability: Code:
focusSpellVulnerability, Code:
sint32 ReduceMagicalDamage(sint32 damage); Code:
sint32 AffectMagicalDamage(sint32 damage, int16 spell_id, const bool iBuffTic, Mob* attacker); Code:
damage = ReduceMagicalDamage(damage); Code:
damage = AffectMagicalDamage(damage, spell_id, iBuffTic, attacker); Code:
sint32 Mob::ReduceMagicalDamage(sint32 damage) Code:
sint32 Mob::AffectMagicalDamage(sint32 damage, int16 spell_id, const bool iBuffTic, Mob* attacker) |
I just want to say thanks for all of the spell effect submissions, Caryatis.
I would add them to the SVN directly myself, but I haven't messed with spell effect code at all, and I normally don't commit stuff unless I fully understand what it is that I am committing and what effect it will have. Kayen knows spell effects much better than I do and he works on Storm Haven with me. I think I will add all of your submissions to my Live server (as apposed to my test server lol) and let Kayen test them when he has time. Then, if he says they all work as intended and don't seem to break anything else, I will commit them if someone else hasn't already done so. We all appreciate anyone willing to submit new code to these forums and it is great to see someone who is interested in filling in some of the missing spell effects that have been needed for a long time. We have limited devs here and limited time to add submissions, and I don't want you to feel like the submissions you are posting are being ignored, because they are not. We have been busy with other things lately like working on the new Underfoot client from Steam and other projects here and there. Hopefully between Kayen and I, we can get these tested and committed to the SVN. That is, if he is willing to test them out, which I assume he is. I think he is drooling to get at your new spell effects :) |
I'll take a look at all this stuff soonish. I've just been trying to help get underfoot working is all.
|
No worries, I'm excited about the work you guys are doing on the Underfoot client and while I have no ability to help with that, at least I can help out this way. Hopefully soon my understanding of the code increases to where your oversight is minimal however atm I bet there is still many ways to fine tune my code(like you did with the triggeroncast).
edit... ok one more fix to this logic as I think its better to negate spells first, originally I was thinking that would only apply to DDs but really there shouldnt be a limit on that. new AffectMagicalDamage function... Code:
sint32 Mob::AffectMagicalDamage(sint32 damage, int16 spell_id, const bool iBuffTic, Mob* attacker) |
Just went through and added all of the submissions so I can test them out (or rather so Kayen can test them). I noticed that you use line numbers, which is helpful, but in some cases they don't match up with what is on the SVN already. Since things change a lot, it would be good to add in some way to know where to add stuff other than just the line number. That is where the normal diffs come in handy, because they show the surrounding code. If you don't want to do a normal diff, you could just say something like this:
In spell_effects.cpp after this: Code:
case SE_InterruptCasting: Code:
case SE_ImprovedSpellEffect: In spell_effects.cpp in the DoBuffTic function before this (around line 3299): Code:
default: { Code:
case SE_ImprovedSpellEffect: |
I feel retarded lol, I couldn't figure out how to make a diff file and just now realized how simple it is lol. From now on will make all my submissions as diffs, as you are correct the line numbers are only vaguely accurate for some fields(some were done with clean SVN and others done with code already in from previous effects). If you run into to problems I can reupdate the previous code as diffs but nothing is really super sensitive linewise so think it should be ok.
edit... One bug so far is that if you crit a spell on a vulnerable foe, the damage displayed is correct however the crit message is not the new value. I assume I will need to add some code to the crit section as well. Will update it tomo and post a proper diff. |
Here is the code for spell and dot shielding separated out... Spell effect coming later.
mob.h Code:
Index: mob.h Code:
Index: attack.cpp |
OK think this is pretty solid now, its pretty annoying to test but I tested every possible combination and seems working good. The only minor thing is that if you have a DoT spell that has a DD component, the DD won't be affected by the vulnerability(the DoT will be so I'm not sure how vital it is).
mob.h Code:
Index: mob.h Code:
Index: mob.cpp Code:
Index: spell_effects.cpp |
All times are GMT -4. The time now is 11:29 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.