Ok, i understand and also agree. All of this was just a first glance "how can I get this working properly with what is already here" thing. That link to lucy is what i have been using, this code is just all over the place and hard to do things with...
The issue with this spell specifically at the moment is:
1. It is not supposed to be resistable period, I have gotten resist messages with it in game.
2. The attacks it does are supposed to hit 100% of the time
3. The skill mod the spell applies to the characters skill is not applied when calculating damage.
4. The berserker AA damage mods are not taken into account when calculating damage.
Solving #1: I'm not sure about how to do this, in lucy it says UNRESISTABLE, yet when i randomly tried it on an iksar guard outside sebilis I got a resist message with it, though that is the only one I have seen and may be a fluke. Put this off until I see it again or someone else does.
Solving #2: (this is the biggest issue, i've only seen issue #1 a few times on PEQ)
This issue is caused by line 2,290 in zone/spell_effects.cpp. It does a normal CheckHitChance as if it were a regular melee attack and does not take into account any spell accuracy modifiers as far as I can tell after examining the lines of code in CheckHitChance. I don't have experience with other melee classes discs to know whether or not they are unavoidable, so completely omitting this section could be bad. The if statement here that uses wpnD confuses me and seems like it's only purpose is to force a CheckHitChance.
After looking/finding a monk disc that is similar:
http://lucy.allakhazam.com/spellraw....52&source=Live I believe that the base2_# that corrisponds to the base# is the hit chance mod and if it is 10000 it is a 100% hit chance.
So to test/fix this we should edit line 2,290 in zone/spell_effects.cpp:
From:
Code:
if(CheckHitChance(caster, spells[spell_id].skill, 13))
To: (i is the EFFECT_COUNT counter the for loop is using)
Code:
if(spells[spell_id].base2[i] == 10000 || CheckHitChance(caster, spells[spell_id].skill, 13))
Solving #3: This can be done by changing line 2,240. This should probably be done for all the damage calcs under the SkillAttack effect, but to see if i'm right just do it for throwing/archery and we'll test with rage volley.
From:
Code:
dam = effect_value + itm->GetItem()->Damage * 2 + (itm->GetItem()->Damage * (GetSkill(spells[spell_id].skill) + GetDEX()) / 225);
To: spells[spell_id].base[i] (i is the EFFECT_COUNT counter the for loop is using)
Code:
dam = effect_value + itm->GetItem()->Damage * 2 + (itm->GetItem()->Damage * (GetSkill(spells[spell_id].skill) + spells[spell_id].base[i] + GetDEX()) / 225);
Solving #4: Easily solved by moving the AA check from throwing attack to ApplyMeleeDamageBonus function like so:
Take lines 1,015 to 1,027 from zone/special_attacks.cpp:
Code:
switch(GetAA(aaThrowingMastery))
{
case 1:
MaxDmg = MaxDmg * 115/100;
break;
case 2:
MaxDmg = MaxDmg * 125/100;
break;
case 3:
MaxDmg = MaxDmg * 150/100;
break;
}
And insert them into zone/attack.cpp at line 4,762 (Don't forget to remove from ThrowingAttack function or else it will get done twice). This will cause both a normal throwing attack and a spell based throwing attack to catch these bonuses.