Go Back   EQEmulator Home > EQEmulator Forums > Support > Spell Support

Spell Support Broken Spells? Want them Fixed? Request it here.

Reply
 
Thread Tools Display Modes
  #1  
Old 10-04-2013, 09:59 AM
Hateborne
Hill Giant
 
Join Date: May 2010
Posts: 125
Default Twincast, Sympathetic procs, and TriggerOnCast spells 100% resisting

Ladies/Gents,

I play on EZ Server and we've noticed something strange following a semi-recent source update. All twincast, sympathetic procs, and triggeroncast effects are resisting 100% of the time.

I only did a brief swept of forums, but are we alone in experiencing this or are others noticing similar things? These effects were 100% working before.


-Hate
Reply With Quote
  #2  
Old 10-04-2013, 10:45 AM
sorvani
Dragon
 
Join Date: May 2010
Posts: 966
Default

Resists in general have been reported as odd more than once recently on PEQ. Specific example was Cyno in Qvic. no one changed his stats but he was suddenly resisting everything that was not unresistable.
Reply With Quote
  #3  
Old 10-04-2013, 11:00 AM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

Found the issue...


Code:
void Mob::TryTwincast(Mob *caster, Mob *target, uint32 spell_id)
{
	if(!IsValidSpell(spell_id))
	{
		return;
	}

	if (spells[spell_id].mana <= 10)
	{
		return;
	}
	
	if(this->IsClient())
	{
		sint32 focus = this->CastToClient()->GetFocusEffect(focusTwincast, spell_id); 

		if (focus > 0)
		{
			if(MakeRandomInt(0, 100) <= focus)
			{
				this->Message(MT_Spells,"You twincast %s!",spells[spell_id].name);
				SpellFinished(spell_id, target);
			}
		}
	}

	else
	{
		uint32 buff_count = GetMaxTotalSlots();
		for(int i = 0; i < buff_count; i++) 
		{
			if(IsEffectInSpell(buffs[i].spellid, SE_Twincast))
			{
				sint32 focus = CalcFocusEffect(focusTwincast, buffs[i].spellid, spell_id);
				if(focus > 0)
				{
					if(MakeRandomInt(0, 100) <= focus)
					{
						SpellFinished(spell_id, target);
					}
				}
			}
		}
	}
}

Sending a spell finished for twincast should send the resist adjust because resist adjust is never calculated inside

mob::spellfinished


Does the same thing inside "TrySympatheticProc"


Unless it grabs the resist adjust somewhere else.. but I do not see it.. at all.
Reply With Quote
  #4  
Old 10-04-2013, 03:17 PM
Hateborne
Hill Giant
 
Join Date: May 2010
Posts: 125
Default

One down, is Sympathetic and TriggerOnCast doing the same?

I'll be able to start digging through code tonight, but not before.


-Hate
Reply With Quote
  #5  
Old 10-04-2013, 03:36 PM
Hateborne
Hill Giant
 
Join Date: May 2010
Posts: 125
Default

Hmm.. this could require some pretty significant revisions. Sadness.

I'm flipping through while I'm on hold now. It's looking dirty. Possibly allow an overloaded SpellFinished to handle this, but not sure of the cleanest way to do it.


-Hate
Reply With Quote
  #6  
Old 10-04-2013, 04:25 PM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,165
Default

Quote:
Originally Posted by Hateborne View Post
Hmm.. this could require some pretty significant revisions. Sadness.

I'm flipping through while I'm on hold now. It's looking dirty. Possibly allow an overloaded SpellFinished to handle this, but not sure of the cleanest way to do it.


-Hate
Quickly looking through it, I would have to say no. Just need to have TryTwincast and the other to have resist stuff passed to it as well, so it can pass on the resist stuff to SpellFinished
Reply With Quote
  #7  
Old 10-04-2013, 04:51 PM
Hateborne
Hill Giant
 
Join Date: May 2010
Posts: 125
Default

TriggerOnCast
Code:
void Mob::TriggerOnCast(uint32 focus_spell, uint32 spell_id, bool aa_trigger)
{
	if(!IsValidSpell(focus_spell) || !IsValidSpell(spell_id))
		return;

	uint32 trigger_spell_id = 0;

	if (aa_trigger && IsClient()){
		//focus_spell = aaid
		trigger_spell_id = CastToClient()->CalcAAFocus(focusTriggerOnCast, focus_spell, spell_id);

		if(IsValidSpell(trigger_spell_id) && GetTarget())
			SpellFinished(trigger_spell_id, GetTarget(), 10, 0, -1, spells[trigger_spell_id].ResistDiff);
	}

	else{
		trigger_spell_id = CalcFocusEffect(focusTriggerOnCast, focus_spell, spell_id);

		if(IsValidSpell(trigger_spell_id) && GetTarget()){
			SpellFinished(trigger_spell_id, GetTarget(), 10, 0, -1, spells[trigger_spell_id].ResistDiff);
			CheckHitsRemaining(0, false,false, 0, focus_spell);
		}
	}
}

Twincast
Code:
void Mob::TryTwincast(Mob *caster, Mob *target, uint32 spell_id)
{
	if(!IsValidSpell(spell_id))
		return;

	if(IsClient())
	{
		int32 focus = CastToClient()->GetFocusEffect(focusTwincast, spell_id);

		if (focus > 0)
		{
			if(MakeRandomInt(0, 100) <= focus)
			{
				Message(MT_Spells,"You twincast %s!",spells[spell_id].name);
				SpellFinished(spell_id, target, 10, 0, -1, spells[spell_id].ResistDiff);
			}
		}
	}

	//Retains function for non clients
	else if (spellbonuses.FocusEffects[focusTwincast] || itembonuses.FocusEffects[focusTwincast])
	{
		int buff_count = GetMaxTotalSlots();
		for(int i = 0; i < buff_count; i++)
		{
			if(IsEffectInSpell(buffs[i].spellid, SE_Twincast))
			{
				int32 focus = CalcFocusEffect(focusTwincast, buffs[i].spellid, spell_id);
				if(focus > 0)
				{
					if(MakeRandomInt(0, 100) <= focus)
					{
						SpellFinished(spell_id, target, 10, 0, -1, spells[spell_id].ResistDiff);
					}
				}
			}
		}
	}
}
SympatheticProc
Code:
void Mob::TrySympatheticProc(Mob *target, uint32 spell_id)
{
	if(target == nullptr || !IsValidSpell(spell_id))
		return;

	int focus_spell = CastToClient()->GetSympatheticFocusEffect(focusSympatheticProc,spell_id);

		if(IsValidSpell(focus_spell)){
			int focus_trigger = spells[focus_spell].base2[0];
			// For beneficial spells, if the triggered spell is also beneficial then proc it on the target
			// if the triggered spell is detrimental, then it will trigger on the caster(ie cursed items)
			if(IsBeneficialSpell(spell_id))
			{
				if(IsBeneficialSpell(focus_trigger))
					SpellFinished(focus_trigger, target);

				else
					SpellFinished(focus_trigger, this);
			}
			// For detrimental spells, if the triggered spell is beneficial, then it will land on the caster
			// if the triggered spell is also detrimental, then it will land on the target
			else
			{
				if(IsBeneficialSpell(focus_trigger))
					SpellFinished(focus_trigger, this);

				else
					SpellFinished(focus_trigger, target, 10, 0, -1, spells[focus_trigger].ResistDiff);
			}
			CheckHitsRemaining(0, false,false, 0, focus_spell);
		}
}



Ok, does that look usable? I am following code the best I can using dinky browser windows in-between calls at work.


-Hate

Last edited by Hateborne; 10-04-2013 at 05:19 PM.. Reason: copy/paste error
Reply With Quote
  #8  
Old 10-04-2013, 05:14 PM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

Pretty sure there are other spots where this code would be needed as well... when I was looking earlier I remember seeing them... (TwinProc was one I think)
Reply With Quote
  #9  
Old 10-04-2013, 06:22 PM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,165
Default

Quote:
Originally Posted by NatedogEZ View Post
Pretty sure there are other spots where this code would be needed as well... when I was looking earlier I remember seeing them... (TwinProc was one I think)
TwinProc is fine (SpellOnTarget is called with use_resist_adjust as false so it will get the Resist in the function)
Reply With Quote
  #10  
Old 11-06-2013, 09:50 PM
Hateborne
Hill Giant
 
Join Date: May 2010
Posts: 125
Default

Quote:
Originally Posted by demonstar55 View Post
TwinProc is fine (SpellOnTarget is called with use_resist_adjust as false so it will get the Resist in the function)

I am casting an unresistable spell with 25% sympathetic proc spell with -1000 resist diff on a target with ~77 to all resists.

The unresistable spell is doing it's 1dmg (which I am using merely to test the Sympathetic Proc). The Sympathetic Proc'ed spell resists 9/10 casts. If it's not accepting the resistdiff, why is it sometimes landing? It if it is accepting resistdiff, why is there a resist chance at all? I would like to believe that -923 (-1000 + 77 = -923) resist should not be resistable.


-Hate
Reply With Quote
  #11  
Old 11-06-2013, 11:36 PM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,165
Default

Well Sympathic Proc is not TwinProc, so what does that have to do with TwinProc being fine?
Reply With Quote
  #12  
Old 11-07-2013, 02:42 AM
Hateborne
Hill Giant
 
Join Date: May 2010
Posts: 125
Unhappy

Quote:
Originally Posted by demonstar55 View Post
Well Sympathic Proc is not TwinProc, so what does that have to do with TwinProc being fine?
Oh! Apologies demonstar, I failed to finish my original point. That's what I get for trying to type it out at work. :-\

What I was getting at is how is it that TwinCast and SympatheticProc have nearly similar setups, but TwinCast seems to work while Sympathetic does not?

I've not yet had time to recompile in debug and set a breakpoint or two, but could you shed any light on it?


-Hate
Reply With Quote
  #13  
Old 11-07-2013, 03:35 AM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,165
Default

You are right about TryTwincast and TrySympatheticProc, twincast is handled completely differently. I'll try to look into these again and most likely push your changes, but my initial testing I found little evidence that they were getting resisted 100% of the time, it seemed about equal. :/
Reply With Quote
  #14  
Old 11-07-2013, 02:49 PM
Hateborne
Hill Giant
 
Join Date: May 2010
Posts: 125
Default

Quote:
Originally Posted by demonstar55 View Post
You are right about TryTwincast and TrySympatheticProc, twincast is handled completely differently. I'll try to look into these again and most likely push your changes, but my initial testing I found little evidence that they were getting resisted 100% of the time, it seemed about equal. :/
Thank you! Let me know if I can help.

SpellTrigger (id 340) is functioning similarly with triggered spells with -1000 resistdiff spells failing to land on creatures with ~150 all resists.


-Hate
Reply With Quote
  #15  
Old 11-07-2013, 06:13 PM
Kayen
Developer
 
Join Date: Mar 2009
Location: -
Posts: 228
Default

Wrote/Revised most of this code last summer.

I would have to agree adding the resist diff information to the SpellFinished will likely resolve this.

These spell effects are not common place on most servers so it is not that shocking its only been picked up on now.

Just a fun fact about 'TwicProc'. It is not an actual spell effect and was originally incorrectly given a spell effect ID. I left the code in place, but it isn't actually used (Correct spell effect replaced where TwicProc was). TwinProc effect which is an AA, is actually just TwinCast with a number of limiters.

Kayen
GM Storm Haven
Reply With Quote
Reply


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:08 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3