EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Archive::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=621)
-   -   question on new npc dmg code im workin on (https://www.eqemulator.org/forums/showthread.php?t=11638)

Armanthuz 01-30-2004 06:21 AM

question on new npc dmg code im workin on
 
Is there any way to call a function that will return how much AC a CLIENT has been buffed for by SPELLS ALONE? How exactly would i call this and where is it if it exists?

thinking about replacing line 1271 and down in attack.cpp with this..

Code:


}
                if (mylevel <= 5) {
                    if (min_dmg==0)
                        min_dmg=1;
                    if (max_dmg==0)
                        max_dmg = mylevel+4;
                    // 1 = 2, 27 = 54
                }
               
                if(max_dmg != 0 && min_dmg <= max_dmg) {
                        int DI = ((max_dmg) - (min_dmg)) / 19;
                        int DB = (min_dmg) - DI;
                        int XX = ((float)rand()/RAND_MAX)*20;

                        if (other->IsClient()){
                                dmgbonusmod += (float)(((this->spellbonuses->ATK + this->itembonuses->ATK)/2)*.05);
                                dmgbonusmod -= ((((float)other->CastToClient()->GetRawItemAC())/2)*.05);
                                }

                        else if (other->IsNPC()) {
                                dmgbonusmod += (float)(((this->spellbonuses->ATK + this->itembonuses->ATK)/2)*.05);
                                dmgbonusmod += (float)(((this->GetAC())/2)*.05);
                                }

                        XX = XX + dmgbonusmod;

                        basedamage = DB + (XX*DI);
                }
                else if (other->GetOwnerID()!=0) {
                        // FIXME Shouldn't nerf the damage of charmed pets
                        basedamage = mylevel*1.9f*clmod;
                }
                else { // Default calculation
                        basedamage = mylevel*level_mod*clmod;
                }
               
               
               
                damage = (int)basedamage;


So far ive tested it on my server and it seems in the neighborhood of what i want, but a ways to go. It DOES mitigate dmg similar to eq by armor worn, but i cant get spell AC buffs factored in yet. I also have to factor in mitigating down to a miss which happens in real eq. The formulas used are based off of work from link below if anyone is interested...


http://www.thesteelwarrior.org/forum...mp;threadid=13


All times are GMT -4. The time now is 05:29 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.