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.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #10  
Old 01-22-2002, 09:54 AM
DeletedUser
Fire Beetle
 
Join Date: Sep 2002
Posts: 0
Default

Yes, I am working on combat code, I will post the formulas right here: (Please note these are not on the public emu for two major reasons, 1) npcs do not have "base stats", 2) AC checks aren't functioning properly) PLEASE UNDERSTAND NOT ALL OF THESE ARE CODED INTO THE PROGRAM (meaning you can't copy and paste and they work)

First the chance to hit:
---------------------------------------------------------------------------------
float attacker = ((this->GetLevel()/2) * ((this->GetDEX()/6)+this->GetSTR()+atkbonus+this->pp.skills[skillinuse]));
float defender = (other->GetLevel()/2) * (other->GetAC()+(pp.skills[DEFENSE]/2)+other->GetINT()+other->GetAGI());
float hitsuccess = (attacker / defender);

Note: top of the division is all attacker info, bottom is defender.
---------------------------------------------------------------------------------
Then attack min damage:
---------------------------------------------------------------------------------

float mindmg = ((this->GetLevel()) * (weapon_damage * 2) * ((this->GetAGI()/4) + atkbonus + pp.skills[skillinuse] + this->GetSTR()));
float mindmg2 = ((other->GetLevel()) * (other->GetAC() + other->GetSTA() + other->GetINT() + other->GetAGI()));
float result = mindmg / mindmg2;
---------------------------------------------------------------------------------
Then attack max damage:
---------------------------------------------------------------------------------

float maxdmg = ((this->GetLevel()) * (weapon_damage * 3) * (this->GetAGI() + pp.skills[skillinuse] + this->GetSTR())*3);
float maxdmg2 = ((other->GetLevel()) * (other->GetAC() + other->GetSTA() + other->GetINT() + other->GetAGI()));
float result = maxdmg / maxdmg2;

Note: top of the division is all attacker info, bottom is defender.

---------------------------------------------------------------------------------
A random is put in these attacks so they are not static.
---------------------------------------------------------------------------------
Now for upping attack skills (chance to up your skill)
---------------------------------------------------------------------------------
float chanceskill = (maxskill*skillfactor) - ((curskill/10) * (1+(yourlvl-theirlvl));
float result = chanceskill / 1000; //makes it a decimal percentage

Yes, negatives are possible meaning, you don't get to up your skill! Makes sense, you don't get your skill upped on a lvl 30
Note: skillfactor is a number that can be set for each combat skill, I assumed in a way we would want a difference of the uppage per combat skill. (Ofcourse there will be limits of max skill and max skill per level.)
---------------------------------------------------------------------------------
Yet another, upping trade skills! (similar to combat skills)
---------------------------------------------------------------------------------
float result = ((maxskill*skillfactor) - (curskill)) / 1000;

Note: Yet another decimal to be used for %. (Ofcourse there will be limits of max skill and max skill per level.)
---------------------------------------------------------------------------------
It never ends! Time for some monk combat! (and kick)
---------------------------------------------------------------------------------
MaxDmg:
float result = ((lvl*2)*(str+skill+agi))*5.5 / ((((lvl)*(AC+AGI+STA))/3)/10);

MinDmg:
float result = ((lvl*2)*(str+skill+agi))*1.5 / ((((lvl)*(AC+AGI+STA))/3)/10);

Note: top of the division is all attacker info, bottom is defender. Secondly, the multiplying by 1.5 and 5.5 can be changed for different skills to make it more realistic (flying kick obviousely hits for a lot more than regular kick, thats what you would change to make this work) and ofcourse chance to hit code would also be used on these.

If there are any questions, don't ask I posted this just for reference, nothing else.
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:43 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