EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=590)
-   -   Stun question (https://www.eqemulator.org/forums/showthread.php?t=35644)

Cowboy6534 08-12-2012 10:31 PM

Stun question
 
is this part of the code where the stun duration is?

Code:

                                                if(stun_resist <= 0 || MakeRandomInt(0,99) >= stun_resist)
                                                {
                                                        mlog(COMBAT__HITS, "Stunned. We had %d percent resist chance.");
                                                        Stun(0);
                                                }
                                                else
                                                {
                                                        if(IsClient())
                                                                Message_StringID(MT_Stun, SHAKE_OFF_STUN);
                                                       
                                                        mlog(COMBAT__HITS, "Stun Resisted. We had %dpercent resist chance.");
                                                }

the
Code:

mlog(COMBAT__HITS, "Stunned. We had %d percent resist chance."); Stun(0);
part? I have noticed that even though in the rules_values table there is a place to define how long stun lasts it doesnt seem to effect how long you are stunned. Should that 0 be changed to something that checks the rules_values table to see how long you should be stunned or is that something else?

Kayen 08-13-2012 01:12 AM

You are referencing the stun related to BASH which does not have a duration, just interrupts.


This is stun related to spell effects, which does indeed use the effect duration.

Code:

                        case SE_Stun:
                        {
#ifdef SPELL_EFFECT_SPAM
                                snprintf(effect_desc, _EDLEN, "Stun: %d msec", effect_value);
#endif
                                //Typically we check for immunities else where but since stun immunities are different and only
                                //Block the stun part and not the whole spell, we do it here, also do the message here so we wont get the message on a resist
                                int max_level = spell.max[i];
                                //max_level of 0 means we assume a default of 55.
                                if (max_level == 0)
                                        max_level = RuleI(Spells, BaseImmunityLevel);
                                // NPCs get to ignore max_level for their spells.
                if(SpecAttacks[UNSTUNABLE] ||
                                        ((GetLevel() > max_level)
                                        && caster && (!caster->IsNPC() || (caster->IsNPC() && !RuleB(Spells, NPCIgnoreBaseImmunity)))))
                                {
                                        caster->Message_StringID(MT_SpellFailure, IMMUNE_STUN);
                                }
                                else
                                {
                                        int stun_resist = itembonuses.StunResist+spellbonuses.StunResist;
                                        if(IsClient())
                                                stun_resist += aabonuses.StunResist;

                                        if(stun_resist <= 0 || MakeRandomInt(0,99) >= stun_resist)
                                        {
                                                mlog(COMBAT__HITS, "Stunned. We had %d percent resist chance.", stun_resist);
                                                Stun(effect_value);
                                        }
                                        else {
                                                if(IsClient())
                                                        Message_StringID(MT_Stun, SHAKE_OFF_STUN);
                                                       
                                                mlog(COMBAT__HITS, "Stun Resisted. We had %d percent resist chance.", stun_resist);
                                        }
                                }
                                break;
                        }


Cowboy6534 08-13-2012 11:30 AM

stun from client doesnt but stun from NPCs does have a duration. I am looking from stun from npcs because it is instant and should have a duration.


All times are GMT -4. The time now is 10:01 AM.

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