PDA

View Full Version : Critical Spell casting Rule


ChaosSlayer
10-17-2008, 07:33 PM
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

Dodie
10-21-2008, 06:00 PM
Much indeed

AndMetal
10-21-2008, 09:00 PM
Here's the spell crit code:
zone/effects.cpp, around line 95 in Client::GetActSpellDamage()

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?

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);
}

ChaosSlayer
10-21-2008, 10:23 PM
you are the coder AndMetal :D
You are our only hope :cool:

Dodie
10-25-2008, 01:51 PM
Cool hope this gets implented

Rocker8956
10-25-2008, 02:20 PM
I think it was already implemented in rev127 of the SVN.

http://code.google.com/p/projecteqemu/updates/list

ChaosSlayer
10-25-2008, 05:45 PM
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 =)

ChaosSlayer
10-25-2008, 09:30 PM
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?

AndMetal
10-26-2008, 06:38 PM
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)

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).

ChaosSlayer
10-26-2008, 11:31 PM
Chance: % chance to crit
Ratio: % of additional damage (100% = 2x damage)



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).

I see.
the reason I asked is cuase there is a melee critical for mobs in Rules which works rather nicely

AndMetal
10-27-2008, 12:35 AM
I think the big question here is, do mobs crit spells on Live? I don't remember them critting, but it may have changed. If not, I'm sure this would do well as custom code.

Looking into the code, GetActSpellDamage is a virtual function already defined in zone/mob.h (http://code.google.com/p/projecteqemu/source/browse/trunk/EQEmuServer/zone/mob.h#565) in the Mob class, and just returns the damage passed to it, unmodified, by default. That means we just need to add the function for NPCs somewhere (probably also in zone/effects.cpp & declared in zone/npc.h).

ChaosSlayer
10-27-2008, 12:59 AM
I think the big question here is, do mobs crit spells on Live? I don't remember them critting, but it may have changed. If not, I'm sure this would do well as custom code.

Looking into the code, GetActSpellDamage is a virtual function already defined in zone/mob.h (http://code.google.com/p/projecteqemu/source/browse/trunk/EQEmuServer/zone/mob.h#565) in the Mob class, and just returns the damage passed to it, unmodified, by default. That means we just need to add the function for NPCs somewhere (probably also in zone/effects.cpp & declared in zone/npc.h).

well back from when I played on LIVE mobs did not melee critical neither - at least you would never know that unless mob woudl hit you for some abnormal ammount of damage.

with spell it was even greater mistery. For a very long time you did not even know how much you been nuked for (you would simply see a message like - "you are bathed in fire" and no dmg was specified), and considering that critical doubles dmg done (unlike other games like say WoW where critical automaticly outputs Max dmg posible and then doubles it) - its prety much imposible to check unless due to chance you get nuked for some ungoodly ammount of damage

Personaly I don't realy concern with it. I am simply coming from bases that if Mobs Melee Critical was put it - I don't see a reason not to put in mob spell critical :cool:

paaco
11-17-2008, 12:35 PM
Did this ever make it into the CVS? I was trying to look through it and figure out why it's not working on my server. Doesn't appear to be there but I have the rules for it in my DB.

paaco
11-17-2008, 12:49 PM
OK I didn't look very well, it is in the source actually. It doesn't work on my server at all though.

trevius
11-17-2008, 05:08 PM
You need to be downloading the newer versions of the emu code from the new SVN here:

http://code.google.com/p/projecteqemu/

paaco
11-17-2008, 05:21 PM
Thats what I'm using. I compiled rev 212 yesterday.

paaco
11-17-2008, 05:44 PM
My settings in the rules table.

Spells:BaseCritChance 10
Spells:BaseCritRatio 15

I just made a lvl 51 Druid, no aa's or anything and spammed the spell Burn on a mob in hate about 100 times. Not a single crit using rev 212 :(

So_1337
11-18-2008, 09:18 AM
No class except wizards should have spell crits without AAs. Likewise, no class except warriors should have melee crits without AAs.

paaco
11-18-2008, 09:33 AM
No class except wizards should have spell crits without AAs. Likewise, no class except warriors should have melee crits without AAs.

I could be wrong but it seems like this code gives all classes a chance to crit spells innately? Similar to the melee crits rules, which works fine for me for every class. Maybe I misunderstood the code :(

So_1337
11-18-2008, 12:15 PM
Er, yeah. Sorry. Forgot this was a rule for customization's sake. You're right, from how I understand the code to work, it should be firing for you then.

AndMetal
11-18-2008, 04:57 PM
My settings in the rules table.

Spells:BaseCritChance 10
Spells:BaseCritRatio 15

I just made a lvl 51 Druid, no aa's or anything and spammed the spell Burn on a mob in hate about 100 times. Not a single crit using rev 212 :(

I just set Spells:BaseCritChance to 100, Spells:BaseCritRatio to 33, and had a level 70 Shaman (w/ no Spell Casting Fury AAs) cast Ice Age (http://lucy.allakhazam.com/spell.html?id=5408), and it crits for 1693 (133%) every time. It also crits if I use #cast or use a clickie, for example Fabled Jaundiced Bone Bracer (http://lucy.allakhazam.com/item.html?id=82715).

Are they set for the correct rule_set? Also, are you running SVN Rev 127 (http://code.google.com/p/projecteqemu/source/detail?r=127) or higher?

paaco
11-18-2008, 05:19 PM
I have revision 215 currently, let me make a shaman and cast over and over and see how it goes and post back :)

paaco
11-18-2008, 05:30 PM
Are they set for the correct rule_set?

Ok I feel stupid now, I dunno why it didn't click in my head to check this...It was exactly the problem, sorry bro, thanks for looking at it :(

AudioGarden21
07-13-2010, 08:33 PM
Regardless of what I enter into the fields:

Spells:WizCritLevel
Spells:WizCritChance
Spells:WizCritRatio

It makes no difference. Above someone mentioned the rule_sets and I'm curious what I have to modify to get these values to work.

trevius
07-13-2010, 11:27 PM
Here is a list straight from the source with all current rules:

http://code.google.com/p/projecteqemu/source/browse/trunk/EQEmuServer/common/ruletypes.h

Those are included there, so they should be working. Make sure you are using the rules that you set them to. I think by default they are set to 0, but I am not sure what your default ruleset is set to. Mine are are set to 1 when I want to activate them, otherwise, it uses the defaults as seen in that ruletypes.h file.

AudioGarden21
07-14-2010, 01:23 AM
Thanks for the reply Trevius, I greatly appreciate it.

All the values for rulesets under rule_values were set to 1 by default with my database.

The only thing that works for spell crits is base chance, that's it. Changing values for BaseCritRatio, WizCritLevel, WizCritChance, or WizCritRatio do nothing, with their rulesets all set to 1.

However I did manage to get WizCritChance to work AFTER I went into the code with that link you provided me. I changed the hard coded WizCritChance to a value of 100. After doing that it allowed me to adjust the values on the database itself as though it were working as normal. 5% on the database = 5% chance to crit for my Test Wizard. However I would have liked to have all of them working (I'm still unable to get WizCritRatio to do anything) because I want Wizards to have a slightly superior DD structure for my server.

I'm unsure why the change to the hard coding allows me to adjust the WizCritChance in rule_values now but it does... Your guess is as good as mine.

Have you double checked that adjusting WizCritRatio works on your server?

EDIT

Also, is there a hard cap on spell crit from focus? I'm guessing 6 is a hard cap. All of the data I've seen in the spells_new file is 6% tops for any spell crit modifiers.

trevius
07-14-2010, 02:13 PM
No, I don't mess with those rules on Storm Haven, so I don't know, sorry.

Make sure that if you are changing rules, that you are reloading the rules or restarting your server. They do not allow changes in real-time unless you do a "#rules reload".

AudioGarden21
07-14-2010, 02:42 PM
I'm aware that those kinds of changes don't take effect unless you restart the server, and I restart the server every time I make changes to rules.