Project 1999

Go Back   Project 1999 > Blue Community > Blue Server Chat

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 11-20-2009, 05:16 AM
Skeletonya Skeletonya is offline
Aviak


Join Date: Nov 2009
Posts: 99
Default

[You must be logged in to view images. Log in or Register.]
  #2  
Old 11-20-2009, 10:36 AM
Haynar Haynar is offline
Developer

Haynar's Avatar

Join Date: Oct 2009
Location: West of the Mississippi
Posts: 2,953
Default

Here are the changes I made to attack.cpp

I changed the combat rating slightly, lowering just a tad.

Changed the scaling on d1_chance and d2_d19_chance.

I added a d20_chance which basically says any mob can hit for max, 5% of time, no matter how high your AC.

It scales pretty well I think.

Hope this helps in coming up with a solution for melee.

Haynar

Code:
void Mob::MeleeMitigation(Mob *attacker, sint32 &damage, sint32 minhit)
{
	if(damage <= 0)
		return;

	Mob* defender = this;
	int totalMit = 0;

	switch(GetAA(aaCombatStability)){
		case 1:
			totalMit += 2;
			break;
		case 2:
			totalMit += 5;
			break;
		case 3:
			totalMit += 10;
			break;
	}

	totalMit += GetAA(aaPhysicalEnhancement)*2;
	totalMit += GetAA(aaInnateDefense);
	totalMit += GetAA(aaDefensiveInstincts)*0.5;

	if(RuleB(Combat, UseIntervalAC)){
		//AC Mitigation
		sint32 attackRating = 0;
		uint16 ac_eq100 = 125;
		if(defender->GetLevel() < 20)
		{
			ac_eq100 += 15 * defender->GetLevel();
		}
		else if(defender->GetLevel() < 50)
		{
			ac_eq100 += (285 + ((defender->GetLevel()-19)*30));
		}
		else if(defender->GetLevel() < 60)
		{
			ac_eq100 += (1185 + ((defender->GetLevel()-49)*60));
		}
		else if(defender->GetLevel() < 70)
		{
			ac_eq100 += (1785 + ((defender->GetLevel()-59)*90));
		}
		else
		{
			ac_eq100 += (2325 + ((defender->GetLevel()-69)*125));
		}

		attackRating = 10 + attacker->GetATK();

		sint32 defenseRating = defender->GetAC();
		defenseRating += 125;
		defenseRating += (totalMit * defenseRating / 100);

		double d1_chance;
		double d2_d19_chance;
		double d20_chance;

		double combat_rating = (defenseRating - attackRating);

		combat_rating = 100 * combat_rating / (double)ac_eq100;
		combat_rating -= 20;

		d1_chance = ((combat_rating) * 0.3);
		d2_d19_chance = 48.0 + ((combat_rating) * 0.42);

		if(d1_chance < 1.0)
			d1_chance = 1.0;

		if(d2_d19_chance < 4.0)
			d2_d19_chance = 4.0;

		d20_chance = d1_chance + d2_d19_chance;

		if (d20_chance > 95.0)
			d20_chance = 95.0;

		double roll = MakeRandomFloat(0, 100);
	
		int interval_used = 0;
		if(roll <= d1_chance)
		{
			interval_used = 1;
		}
		else if(roll <= (d20_chance))
		{
			interval_used = 1 + (int)((((roll-d1_chance) / d2_d19_chance) * 18) + 1);
		}
		else
		{
			interval_used = 20;
		}

		//PS: this looks WRONG but there's a method to the madness
		int db = minhit;
		double di = ((double)(damage-minhit)/19);
		damage = db + (di * (interval_used - 1));
	}
	else{
		////////////////////////////////////////////////////////
		// Scorpious2k: Include AC in the calculation
		// use serverop variables to set values
		int myac = GetAC();
		if (damage > 0 && myac > 0) {
			int acfail=1000;
			char tmp[10];

			if (database.GetVariable("ACfail", tmp, 9)) {
				acfail = (int) (atof(tmp) * 100);
				if (acfail>100) acfail=100;
			}

			if (acfail<=0 || rand()%101>acfail) {
				float acreduction=1;
				int acrandom=300;
				if (database.GetVariable("ACreduction", tmp, 9))
				{
					acreduction=atof(tmp);
					if (acreduction>100) acreduction=100;
				}
		
				if (database.GetVariable("ACrandom", tmp, 9))
				{
					acrandom = (int) ((atof(tmp)+1) * 100);
					if (acrandom>10100) acrandom=10100;
				}
				
				if (acreduction>0) {
					damage -= (int) (GetAC() * acreduction/100.0f);
				}		
				if (acrandom>0) {
					damage -= (myac * MakeRandomInt(0, acrandom) / 10000);
				}
				if (damage<1) damage=1;
				mlog(COMBAT__DAMAGE, "AC Damage Reduction: fail chance %d%%. Failed. Reduction %.3f%%, random %d. Resulting damage %d.", acfail, acreduction, acrandom, damage);
			} else {
				mlog(COMBAT__DAMAGE, "AC Damage Reduction: fail chance %d%%. Did not fail.", acfail);
			}
		}

		damage -= (totalMit * damage / 100);

		if(damage != 0 && damage < minhit)
			damage = minhit;
	}


	//reduce the damage from shielding item and aa based on the min dmg
	//spells offer pure mitigation
	damage -= (minhit * defender->itembonuses.MeleeMitigation / 100);
	damage -= (damage * defender->spellbonuses.MeleeMitigation / 100);

	if(damage < 0)
		damage = 0;

	mlog(COMBAT__DAMAGE, "Applied %d percent mitigation, remaining damage %d", totalMit, damage);
}
  #3  
Old 11-20-2009, 11:57 AM
Enig Enig is offline
Skeleton


Join Date: Nov 2009
Posts: 15
Default

Thanks Haynar, keep fighting the good fight [You must be logged in to view images. Log in or Register.]
  #4  
Old 11-20-2009, 12:08 PM
Wildir Wildir is offline
Orc


Join Date: Oct 2009
Posts: 37
Default

thanks for the work, I am not melee class atm, but as a cleric, I can appreciate the concern, and hope this gets "tweeked".
I think productive posts like this is what is needed, the whining needs to stop and lets find a solution to help.
I love this game, and am having fun again playing MMO, so keep up the good work!
Wildir
  #5  
Old 11-20-2009, 12:54 PM
Aeolwind Aeolwind is offline
Developer

Aeolwind's Avatar

Join Date: Oct 2009
Location: Watauga, TN
Posts: 1,641
Send a message via AIM to Aeolwind Send a message via MSN to Aeolwind Send a message via Yahoo to Aeolwind
Default

Nice code Haynar, going to submit it to KLS and see what she thinks about it. If not ready for prime time Emu as a rule value but would work for us we'll get it implemented here exclusively.
  #6  
Old 11-20-2009, 12:58 PM
Tollen Tollen is offline
Kobold


Join Date: Nov 2009
Posts: 115
Default

Quote:
Originally Posted by Aeolwind [You must be logged in to view images. Log in or Register.]
Nice code Haynar, going to submit it to KLS and see what she thinks about it. If not ready for prime time Emu as a rule value but would work for us we'll get it implemented here exclusively.
YAY! keep us updated Aeolwind.

Last night I spend 5 hours LFG, I don't mind cause I still did some stuff but if I can solo some LB/DB mobs in that time I'm LFG for that long it would make the grind that much less mind numbing.
__________________
Tollen - 22 Bard - P1999
Tollen - 65 Bard - EQmac
Tollen - 60 Bard <Powerslave> - p2002
  #7  
Old 11-20-2009, 01:10 PM
Aeolwind Aeolwind is offline
Developer

Aeolwind's Avatar

Join Date: Oct 2009
Location: Watauga, TN
Posts: 1,641
Send a message via AIM to Aeolwind Send a message via MSN to Aeolwind Send a message via Yahoo to Aeolwind
Default

Keep in mind, it will be going to the test server first, I'll notify in a separate thread when it does so people can go test. And with all the people complaining, I better see at least 20 people over there! I'll see about getting Nilbog to do a character transfer from live to test as well.
  #8  
Old 11-20-2009, 01:08 PM
messiah_b messiah_b is offline
Sarnak


Join Date: Nov 2009
Posts: 206
Default

That's really awesome thanks to Haynar and Aeol for forwarding it on.

I really hope it is a very tiny adjustment. I also don't want to see melee turning into zol knights overnight.
Closed Thread


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:45 PM.


Everquest is a registered trademark of Daybreak Game Company LLC.
Project 1999 is not associated or affiliated in any way with Daybreak Game Company LLC.
Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.