Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-16-2011, 03:24 PM
bad_captain
Developer
 
Join Date: Feb 2009
Location: Cincinnati, OH
Posts: 512
Default Bash/Kick & Stun

While working on Bot AAs, I began working on coding the Immobilizing Bash AA. Based on my own recollections (which may be wrong) and research I had to do (I haven't played live since 2004), I think the bash/kick - stun code may need updated. Currently for clients, if the character is level 55 or higher and the mob is less than level 56, a bash (or slam as it uses the same code) or kick always stuns. If the mob is > 56, the client can't stun it. NPCs stun at a rate of RuleI(Character, NPCBashKickStunChance), which defaults to 15% I believe. The stun is of duration 0, which I assume was done to provide a chance to interrupt casting. But, looking at the stun code, unless the mob has items or buffs with persistent casting, it appears as if the stun will always interrupt. I did a little testing on my private server taking my 70 PAL to Karnor's and engaging drolvargs near the zone in. Every bash resulted in a stun (I had many shouts of "I have been stunned!" ) , but it didn't appear to negatively affect their offensive output (they don't cast spells, so I would need to go further in to test interruptions). Questions I have about bash and stuns:
  1. Does bash always stun? I don't believe it does and have read many accounts of it not being a reliable way to interrupt casting because it can miss, not stun, etc. But some state that it does in fact stun every time.
  2. Is bash/kick - stun of duration 0? I believe is should be say 0 - 2 seconds, as I have read players mentioning bashing and stunning mobs who are running, and it causing them to stop running for a few seconds (as is, it doesn't really even slow down weapon attacks when attacking.) I have a vague memory of this as well..
  3. Does a successful stun always interrupt (without persistent casting items, buffs or aas)? This I'm not so sure on, but thought I would throw it out there. Description of PAL AA Divine Stun - "Training this ability gives you a new, fast casting spell that has the chance to interrupt Level 68 or lower NPCs. Normal resist rules apply." Does this mean a landed stun could fail to interrupt, or is it just saying it won't interrupt if the stun is resisted?

So, back to trying to add the AA Immobilizing Bash. It states that it "increases the chance that your bashes will stun the enemy." With the current code, this description doesn't make sense as 1) if the mob is below 56, it will be stunned 100% of the time, and 2) there would need to be an initial chance to stun mobs > level 56 to "increase" the chance to stun on a bash, and would need to affect mobs higher than level 56 to make it worthwhile to train this AA after level 65. Not that Sony hasn't worded spells and AAs incorrectly before, but... I have also read where cleric bashes don't stun, but Warriors and Paladins do stun, because of their bash skill being > 200. Some people also state that there was a greater chance to bash/stun when the mob is fleeing (from behind). Then, there's this note on semanna.net:
Quote:
Note on Bash:
As a side investigation, we asked the Devs why a
bash that failed to stun was so much more likely
to interrupt casting than a bash that would have
stunned , but didn' t (due to resist or immunnity).
It turns out that the mechanism first determines
if a bash will stun or not; if not a stun, it checkes
for interrupt or not . When bash was put in to
the game, they did not take into account stun
immunity or the development of stun resist
mods; so that if the first check yeilds a
(potential ) stun, it doesn't check for interrupt
(assuming the stun would do the interrupting) .
The Ogre racial immunity to frontal stuns seems
to be well worth the 70 levels of experience
penalty at this point.
Which makes be believe a successful stun always interrupts, but also adds in the fact that 1) a bash that doesn't stun (!) can still interrupt, and 2) an attempted stun that is resisted can still interrupt, but at a lower rate. I think I'm even more confused than before.


I have rewritten the bash/kick - stun code and included the AA immobilizing bash just as a test, accounting for my belief that bash should 1) not always stun, and 2) have a chance to stun mobs > level 56, 3) have a chance to interrupt if there is no stun, and 4) have a chance to interrupt even on stun resist. But if it's not 100% for mobs < level 56, what chance is there? If it's not 0% for mobs > level 56, what chance is there? Is there a difference between bashing while in front of a mob as opposed to behind it? What about if it's low in health and fleeing?

Does anyone have any resources that can clarify any of this, or have a recollections that agree with anything here? My first goal is to add Immobilizing Bash in for bots, but I need to know how bash/stun should actually work before being able to add in an increase to the chance to stun.

The current bash/kick - stun code:
Code:
		//check stun chances if bashing
		if (damage > 0 && ((skill_used == BASH || skill_used == KICK) && attacker))
		{
			// NPCs can stun with their bash/kick as soon as they recieve it.
			// Clients can stun mobs under level 56 with their bash/kick when they get level 55 or greater.
			if((attacker->IsNPC()) || (attacker->IsClient() && attacker->GetLevel() >= 55 && GetLevel() < 56))
			{
				if (MakeRandomInt(0,99) < (RuleI(Character, NPCBashKickStunChance)) || attacker->IsClient())
				{
					int stun_resist = itembonuses.StunResist+spellbonuses.StunResist;
			
					if(this->IsClient())
						stun_resist += aabonuses.StunResist;
			
					if(this->GetBaseRace() == OGRE && this->IsClient() && !attacker->BehindMob(this, attacker->GetX(), attacker->GetY())) 
					{
						mlog(COMBAT__HITS, "Stun Resisted. Ogres are immune to frontal melee stuns.");
					}
					else 
					{
						if(stun_resist <= 0 || MakeRandomInt(0,99) >= stun_resist) 
						{
							mlog(COMBAT__HITS, "Stunned. We had %d percent resist chance.");
							Stun(0);
						} 
						else 
						{
							if(this->IsClient())
								Message_StringID(MT_Stun, SHAKE_OFF_STUN);
							
							mlog(COMBAT__HITS, "Stun Resisted. We had %dpercent resist chance.");
						}
					}
				}
			}
		}
The code for Stun:
Code:
void Mob::Stun(int duration)
{
	//make sure a shorter stun does not overwrite a longer one.
	if(stunned && stunned_timer.GetRemainingTime() > uint32(duration))
		return;
	
	if(casting_spell_id) {
		int persistent_casting = spellbonuses.PersistantCasting + itembonuses.PersistantCasting;
		if(IsClient())
			persistent_casting += aabonuses.PersistantCasting;
		
		if(MakeRandomInt(1,99) > persistent_casting)
			InterruptSpell();
	}

	if(duration > 0)
	{
		stunned = true;
		stunned_timer.Start(duration);
	}
}
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 10:19 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3