Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #12  
Old 09-08-2014, 10:18 PM
Torven
Sarnak
 
Join Date: Aug 2014
Posts: 76
Default

I just ran your code and it has the same problem mine had before I changed spell_effects.cpp.

If you cast a low level DD spell on a mob with near-immunity, it will do zero damage, show no non-melee text, and instead display two emote messages, like this:

Code:
[Mon Sep 08 17:49:52 2014] You say, '#cast 93'
[Mon Sep 08 17:49:52 2014] Your Earring of Influxed Gravity begins to glow.
[Mon Sep 08 17:49:52 2014] The Idol of Rallos Zek singes as the Burst of Flame hits them.
[Mon Sep 08 17:49:52 2014] The Idol of Rallos Zek singes as the Burst of Flame hits them.
[Mon Sep 08 17:49:53 2014] You say, '#cast 93'
[Mon Sep 08 17:49:53 2014] Your Earring of Influxed Gravity begins to glow.
[Mon Sep 08 17:49:53 2014] Your target resisted the Burst of Flame spell.
(I am however using a very old client)

The cause is because spell_effects.cpp floors the damage when it converts to an int32:

dmg = (int32) (dmg * partial / 100);

And low damage spells and/or very low partial rolls will result in a damage that is < 1.

In fact since spells can't hit for anywhere near full damage at near-immunity resist levels, if you for example cast burst of flame on a target with 570 fire resist, every single non-resist will hit for 0 damage.

partial_modifier = ((150 * (resist_chance - roll)) / resist_chance);

Fill in 570 for resist chance (mob resist value, modified by level and such if applicable) and 200 for roll (maximum possible roll) then you get ~97.3684. Floor it since partial_modifier is an int, you get 97. So the absolute highest damage possible spell at 570 resist is 3% the spell's maximum.

ResistSpell() returning 0 will register as a full resist-- it's the non-zero returns that are resulting in 0 damage casts but no resist message. All these casts should not be full resisting either, otherwise you'll end up with NPCs being immune to low damage spells below the 600 threshold. If you view my Soldier of Fire logs at -58 resist debuff, you can see that every single non-resist cast hits for 1 damage (using a 20 damage spell).
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 05:59 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3