Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::General Support

Support::General Support Post all topics here having to do with errors while trying to connect to an EQEMu server but not about the setup/running of the Server itself.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #18  
Old 12-27-2013, 01:23 AM
haggzor
Fire Beetle
 
Join Date: Nov 2010
Location: Cincinnati, OH
Posts: 27
Default

Alrighty, that fixed it. Basically I added a flag in the existing special SK and Paladin portion of the code to bypass the spell slot evaluation and memorized spell check that was breaking Harm Touch and Lay on Hands.

client_packet.cpp(line 4581)

Code:
		uint16 spell_to_cast = 0;

		// flag to bypass memorized spell check
		bool isKnightAbility = false;

		//current client seems to send LH in slot 8 now...
		if(castspell->slot == ABILITY_SPELL_SLOT &&
			castspell->spell_id == SPELL_LAY_ON_HANDS && GetClass() == PALADIN) {
			if(!p_timers.Expired(&database, pTimerLayHands)) {
				Message(13,"Ability recovery time not yet met.");
				InterruptSpell(castspell->spell_id);
				return;
			}
			spell_to_cast = SPELL_LAY_ON_HANDS;

			isKnightAbility = true;
			
			p_timers.Start(pTimerLayHands, LayOnHandsReuseTime);
		} else if(castspell->slot == ABILITY_SPELL_SLOT &&
			(castspell->spell_id == SPELL_HARM_TOUCH
				|| castspell->spell_id == SPELL_HARM_TOUCH2
			) && GetClass() == SHADOWKNIGHT) {

			if(!p_timers.Expired(&database, pTimerHarmTouch)) {
				Message(13,"Ability recovery time not yet met.");
				InterruptSpell(castspell->spell_id);
				return;
			}

			if(GetLevel() < 40)
				spell_to_cast = SPELL_HARM_TOUCH;
			else
				spell_to_cast = SPELL_HARM_TOUCH2;
				
			LogFile->write(EQEMuLog::Debug, "Harm Touch Spell to Cast: %d (based on lvl [%d])... starting recast timer.", spell_to_cast, GetLevel());
			
			isKnightAbility = true;

			p_timers.Start(pTimerHarmTouch, HarmTouchReuseTime);
		}

		//handle disciplines, OLD, they keep changing this
		if(castspell->slot == DISCIPLINE_SPELL_SLOT) {
			if(!UseDiscipline(castspell->spell_id, castspell->target_id)) {
				printf("Unknown ability being used by %s, spell being cast is: %i\n",GetName(),castspell->spell_id);
				InterruptSpell(castspell->spell_id);
			}
			return;
		}

		if(castspell->slot < MAX_PP_MEMSPELL)
		{
			LogFile->write(EQEMuLog::Debug, "Slot [%d] is less than MAX_PP_MEMSPELL [%d]", castspell->slot, MAX_PP_MEMSPELL);

			spell_to_cast = m_pp.mem_spells[castspell->slot];
			if(spell_to_cast != castspell->spell_id)
			{
				LogFile->write(EQEMuLog::Debug, "Code thinks I'm a cheater because [%d] does not equal [%d]", spell_to_cast, castspell->spell_id);

				InterruptSpell(castspell->spell_id); //CHEATER!!!
				return;
			}
		}
		else if (castspell->slot >= MAX_PP_MEMSPELL && !isKnightAbility) {
			LogFile->write(EQEMuLog::Debug, "Slot [%d] is greater than or equal to MAX_PP_MEMSPELL [%d]", castspell->slot, MAX_PP_MEMSPELL);

			InterruptSpell();
			return;
		}
		
		LogFile->write(EQEMuLog::Debug, "Casting Spell: [%i] on target [%d]", spell_to_cast, castspell->target_id);

		CastSpell(spell_to_cast, castspell->target_id, castspell->slot);
Reply With Quote
 

Thread Tools
Display Modes

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 03:36 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