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
  #1  
Old 03-28-2008, 08:39 AM
moydock
Discordant
 
Join Date: Jun 2005
Posts: 286
Default npc chancetohit?

This code seems to be doing the calculations in attack.cpp but for some reason a lvl 1 npc hitting a lvl 1 player only hits about 30% or less, of his swings. I must be missing something?
Code:
	else{
		//some class combos have odd caps, base our attack skill based off of a warriors 1hslash since 
		//it scales rather evenly across all levels for warriors, based on the defenders level so things like
		//light blues can still hit their target.
		uint16 atkSkill = (database.GetSkillCap(WARRIOR, (SkillType)_1H_SLASHING, defender->GetLevel()) + 5);
		int skilldiff = defender->GetSkill(DEFENSE) - atkSkill;
		bonus = 0;
		if(skilldiff > 10){
			bonus = -(10 + ((defender->GetSkill(DEFENSE) - atkSkill - 10) * 2 / 5));
		}
		else if(skilldiff <= 10 && skilldiff > 0){
			bonus = -(2 + ((defender->GetSkill(DEFENSE) - atkSkill) / 10));
		}
		else{
			bonus = 1 + ((atkSkill - defender->GetSkill(DEFENSE)) / 25);
		}
		chancetohit += bonus;
	}
__________________
-Croup (the rogue)
Creator of Pandemic (PvP-Racewars)
Reply With Quote
 


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 04:02 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