Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Windows Servers

Support::Windows Servers Support forum for Windows EQEMu users.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #38  
Old 10-16-2015, 04:15 PM
AdrianD
Discordant
 
Join Date: Dec 2013
Posts: 297
Default

I added a mechanic to <channelchance> and am wondering if it looks right or if it could be done better. It may be a little confusing but the purpose was learning as much as adding this code. It's an exercise in futility trying to channel at lower levels and the added mechanic mitigates this a bit. It also reinforces those who practice skills when they level, like the old days.

Also, the <distance_moved> and <distancemod> formulas do not do as advertised. The idea seems proper but the implementation is off. I will add to this my results when I get to it.

The big thing I am wondering is if the code in the header is returning the value for the previous level max skill. This mechanic seems to work upon initial testing.

\zone\client.h(695)
Code:
	inline uint16 PrevMaxSkill(SkillUseTypes skillid) const { return MaxSkill(skillid, GetClass(), GetLevel()-1); }
\zone\spells.cpp(1105) - <void Mob::CastedSpellFinished>
Code:
				// max 93% chance at 252 skill
				channelchance = 30 + GetSkill(SkillChanneling) / 400.0f * 100;
				
				uint16 cS = CastToClient()->GetRawSkill(SkillChanneling); // current skill
				uint16 mS = CastToClient()->MaxSkill(SkillChanneling); // current level max skill
				uint16 pS = CastToClient()->PrevMaxSkill(SkillChanneling); // current level - 1 max skill
				double iA = 20 / (mS - pS); // adjustment interval
				double cA = 0; // cA = adjustement coefficient
				double param, result;
				param = (pow((.0005*cS), 2));

				while (true)
				{
					if (cS >= 200) { 
						break;
					}					
					else if (cS <= pS) {
						break;
					}
					else if (GetLevel () <= 1) {
						cA = (cS * 2);
						result = cA - param;
						channelchance += result;
						break;
					}
					else {
						cA = ((cS - pS)*iA);
						result = cA - param;
						channelchance += result;						
					}
					break;
				}
				channelchance -= attacked_count * 2;
				channelchance += channelchance * channelbonuses / 100.0f;
			}

<snip code>
					distance_moved = d_x * d_x + d_y * d_y;
					// if you moved 1 unit, that's 25% off your chance to regain.
					// if you moved 2, you lose 100% off your chance
					distancemod = distance_moved * 25;
					channelchance -= distancemod;
				}
Thanks

EDIT: here is a visualization of the behavior http://prnt.sc/8s311y

The blue line is the current, unadjusted channelchance. The lower red function is the formula I added. The upper red function is max skill channelchance after adding the the formula.
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 04: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