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

Development::Feature Requests Post suggestions/feature requests here.

Reply
 
Thread Tools Display Modes
  #1  
Old 10-17-2008, 07:33 PM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default Critical Spell casting Rule

we allready have Rule for Client and NPC critical melee - why not spell casting?

I recomend we add it
we will need CriticalSpellChance for NPC, general Client, and separatetly for Wizards I guess
Reply With Quote
  #2  
Old 10-21-2008, 06:00 PM
Dodie
Sarnak
 
Join Date: Jun 2004
Posts: 67
Default

Much indeed
Reply With Quote
  #3  
Old 10-21-2008, 09:00 PM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

Here's the spell crit code:
zone/effects.cpp, around line 95 in Client::GetActSpellDamage()
Code:
	if(tt != ST_Self) {
		int chance = 0;
		sint32 ratio = 0;

		//normal spell crit
		if(GetClass() == WIZARD && GetLevel() > 11) {
			chance += 7;
			ratio += 15;
		}
		
		//Normal EQ: no class that has ingenuity has reg spell crit AAs too but people
		//are free to customize so lets make sure they don't stack oddly.
		//afaik all ranks provide a 100% bonus in damage on critical
		switch(GetAA(aaIngenuity))
		{
		case 1:
		case 2:
		case 3: 
			if(ratio < 100)
				ratio = 100;
			break;
		default:
			break;
		}
		
		if(tt == ST_Target || tt == ST_Summoned || tt == ST_Undead) {
			//DD spells only...
			//reference: http://www.graffe.com/AA/
			switch (GetAA(aaSpellCastingFury)) //not sure why this was different from Mastery before, both are DD only
			{
				case 1:
					chance += 2;
					ratio += 33;
					break;
				case 2:
					chance += 4; //some reports between 4.5% & 5%, AA description indicates 4%
					ratio += 66;
					break;
				case 3:
					chance += 7;
					ratio += 100;
					break;
			}
			switch (GetAA(aaSpellCastingFuryMastery)) //ratio should carry over from Spell Casting Fury, which is 100% for all ranks
			{
				case 1:
					chance += 3; //10%, Graffe = 9%?
					break;
				case 2:
					chance += 5; //12%, Graffe = 11%?
					break;
				case 3:
					chance += 7; //14%, Graffe = 13%?
					break;
			}
			chance += GetAA(aaFuryofMagic) * 2;  //doesn't look like this is used
			chance += GetAA(aaFuryofMagicMastery) * 2; //doesn't look like this is used
			chance += GetAA(aaFuryofMagicMastery2) * 2;	//this is the current one used in DB; 16%, 18%, 20%; Graffe guesses 18-19% max
			chance += GetAA(aaAdvancedFuryofMagicMastery) * 2; //guessing, not much data on it

			
			if(ratio < 100)	//chance increase and ratio are made up, not confirmed
				ratio = 100;
		} else if(tt == ST_Tap) {
			if(ratio < 100)	//chance increase and ratio are made up, not confirmed
				ratio = 100;
			
			if(spells[spell_id].classes[SHADOWKNIGHT-1] >= 254 && spell_id != SPELL_LEECH_TOUCH){
				switch (GetAA(aaSoulAbrasion)) //Soul Abrasion
				{
					case 1:
						modifier += 100;
						break;
					case 2:
						modifier += 200;
						break;
					case 3:
						modifier += 300;
						break;
				}
			}
		}
		
		chance += GetAA(aaIngenuity); //nothing stating it's DD only, so we'll apply to all damage spells
		
		chance += GetFocusEffect(focusImprovedCritical, spell_id);

		//crit damage modifiers
		if (GetClass() == WIZARD) { //wizards get an additional bonus
			ratio += GetAA(aaDestructiveFury) * 8; //108%, 116%, 124%, close to Graffe's 207%, 215%, & 225%
		} else {
			switch (GetAA(aaDestructiveFury)) //not quite linear
			{
				case 1:
					ratio += 4; //104%, Graffe = 103%
					break;
				case 2:
					ratio += 8; //108%, Graffe = 107%
					break;
				case 3:
					ratio += 16; //116%, Graffe = 115%
			}
		}
		
		if(chance > 0 && MakeRandomInt(0,100) <= chance) {
			modifier += modifier*ratio/100;
			entity_list.MessageClose(this, false, 100, MT_SpellCrits, "%s delivers a critical blast! (%d)", GetName(), ((-value * modifier) / 100));	
		}
	}
Are you thinking something like this?
Code:
	if(tt != ST_Self) {
		int chance = RuleI(Spells, BaseCritChance);
		sint32 ratio = RuleI(Spells, BaseCritRatio);

		//normal spell crit
		if(GetClass() == WIZARD && GetLevel() > 11) {
			chance += RuleI(Spells, WizCritChance);
			ratio += RuleI(Spells, WizCritRatio);
		}
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
Reply With Quote
  #4  
Old 10-21-2008, 10:23 PM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

you are the coder AndMetal
You are our only hope
Reply With Quote
  #5  
Old 10-25-2008, 01:51 PM
Dodie
Sarnak
 
Join Date: Jun 2004
Posts: 67
Default

Cool hope this gets implented
Reply With Quote
  #6  
Old 10-25-2008, 02:20 PM
Rocker8956
Hill Giant
 
Join Date: Sep 2007
Posts: 117
Default

I think it was already implemented in rev127 of the SVN.

http://code.google.com/p/projecteqemu/updates/list
Reply With Quote
  #7  
Old 10-25-2008, 05:45 PM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

well some of us stil waiting for OFFICIAL release posted at download section =)

its been a while

but anyway I thank Addmetal for puting in the code on such short notice =)
Reply With Quote
  #8  
Old 10-25-2008, 09:30 PM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

ok i have looked at changelog and have few questions.

AndMetal: New rules for tweaking spell crits: Spells:BaseCritChance(0), Spells:BaseCritRatio(0), Spells:WizCritLevel(12), Spells:WizCritChance(7), Spells:WizCritRatio(15)


What the difirence bewten Ratio and Chance?
also dose Base only applies only to client (players) or NPCs too?
Reply With Quote
  #9  
Old 10-26-2008, 06:38 PM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

Quote:
Originally Posted by ChaosSlayer View Post
AndMetal: New rules for tweaking spell crits: Spells:BaseCritChance(0), Spells:BaseCritRatio(0), Spells:WizCritLevel(12), Spells:WizCritChance(7), Spells:WizCritRatio(15)


What the difirence bewten Ratio and Chance?
Chance: % chance to crit
Ratio: % of additional damage (100% = 2x damage)

Quote:
Originally Posted by ChaosSlayer View Post
dose Base only applies only to client (players) or NPCs too?
The function is in the Client class (Client::GetActSpellDamage), so that means this would only apply towards clients. Honestly, I don't think there's anything that allows an NPC to crit. If we added this, it would have to be a part of the Mob class (so Mob::GetActSpellDamage, which applies towards both clients & NPCs), unless we wanted it to be different for NPCs (then NPC::GetActSpellDamage).
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
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 03:50 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