Here is a mod that will give the option of making Dex and agi matter in hit probability . Dex is used by the attacker to help hit and agi is used by the defender to avoid the hit. This will give the possibility to world builder to tune mob and make them hard to hit or very good at hitting.
Add the bold line to commons/ruletypes.h
Code:
RULE_CATEGORY( Combat )
RULE_REAL ( Combat, BaseCritChance, 0.0 ) //The base crit chance for non warriors, NOTE: This will apply to NPCs as well
RULE_REAL ( Combat, WarBerBaseCritChance, 0.03 ) //The base crit chance for warriors and berserkers, only applies to clients
RULE_REAL ( Combat, BerserkBaseCritChance, 0.06 ) //The bonus base crit chance you get when you're berserk
RULE_INT ( Combat, NPCBashKickLevel, 6 ) //The level that npcs can KICK/BASH
RULE_REAL ( Combat, ClientBaseCritChance, 0.0 ) //The base crit chance for all clients, this will stack with warrior's/zerker's crit chance.
RULE_BOOL ( Combat, UseIntervalAC, false)
RULE_INT ( Combat, PetAttackMagicLevel, 30)
RULE_BOOL ( Combat, UseDexAgiForHitChance, false)
RULE_CATEGORY_END()
And add the following Bold code to the Mob::CheckHitChance in attack.cpp
Code:
AA_mod += 3*GetAA(aaPhysicalEnhancement);
AA_mod += 2*GetAA(aaLightningReflexes);
chancetohit -= chancetohit * AA_mod / 100;
if (RuleB(Combat, UseDexAgiForHitChance))
{
chancetohit += ((attacker->GetDEX() / 200) - (defender->GetAGI() / 200));
}
// Chance to hit; Max 95%, Min 30%
if(chancetohit > 1000) {
//if chance to hit is crazy high, that means a discipline is in use, and let it stay there
}
else if(chancetohit > 99) {
chancetohit = 99;
}
else if(chancetohit < 5) {
chancetohit = 5;
}
By giving high amount of AGI or DEX you can make a npc very hard to hit or give him more chance to hit the player without raising the levels .
I divide the stat by 200 so that the change does not unbalance the current system. A player with 600 dex hitting a mob with 200 agi will only gain a 2% hit chance increase. This value can be adjusted has the dev see fit or put has a rule if they want to .
Thanks,
--
Pyronis/Kahell
Dev Jest 3 server