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

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 01-30-2004, 06:21 AM
Armanthuz
Sarnak
 
Join Date: Apr 2003
Posts: 72
Default question on new npc dmg code im workin on

Is there any way to call a function that will return how much AC a CLIENT has been buffed for by SPELLS ALONE? How exactly would i call this and where is it if it exists?

thinking about replacing line 1271 and down in attack.cpp with this..

Code:
}
		if (mylevel <= 5) {
		    if (min_dmg==0)
			min_dmg=1;
		    if (max_dmg==0)
			max_dmg = mylevel+4;
		    // 1 = 2, 27 = 54
		}
		
		if(max_dmg != 0 && min_dmg <= max_dmg) {
			int DI = ((max_dmg) - (min_dmg)) / 19;
			int DB = (min_dmg) - DI;
			int XX = ((float)rand()/RAND_MAX)*20;

			if (other->IsClient()){
				dmgbonusmod += (float)(((this->spellbonuses->ATK + this->itembonuses->ATK)/2)*.05);
				dmgbonusmod -= ((((float)other->CastToClient()->GetRawItemAC())/2)*.05);
				}

			else if (other->IsNPC()) {
				dmgbonusmod += (float)(((this->spellbonuses->ATK + this->itembonuses->ATK)/2)*.05);
				dmgbonusmod += (float)(((this->GetAC())/2)*.05);
				}

			XX = XX + dmgbonusmod;

			basedamage = DB + (XX*DI);
		}
		else if (other->GetOwnerID()!=0) {
			// FIXME Shouldn't nerf the damage of charmed pets
			basedamage = mylevel*1.9f*clmod;
		}
		else { // Default calculation
			basedamage = mylevel*level_mod*clmod;
		}
		
		
		
		damage = (int)basedamage;

So far ive tested it on my server and it seems in the neighborhood of what i want, but a ways to go. It DOES mitigate dmg similar to eq by armor worn, but i cant get spell AC buffs factored in yet. I also have to factor in mitigating down to a miss which happens in real eq. The formulas used are based off of work from link below if anyone is interested...


http://www.thesteelwarrior.org/forum...mp;threadid=13
Reply With Quote
Reply


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 12:27 PM.


 

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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3