|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Spell Support Broken Spells? Want them Fixed? Request it here. |
10-04-2013, 09:59 AM
|
Hill Giant
|
|
Join Date: May 2010
Posts: 125
|
|
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
|
10-04-2013, 10:45 AM
|
Dragon
|
|
Join Date: May 2010
Posts: 965
|
|
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.
|
|
|
|
10-04-2013, 11:00 AM
|
|
Developer
|
|
Join Date: Dec 2012
Posts: 515
|
|
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.
|
|
|
|
10-04-2013, 03:17 PM
|
Hill Giant
|
|
Join Date: May 2010
Posts: 125
|
|
One down, is Sympathetic and TriggerOnCast doing the same?
I'll be able to start digging through code tonight, but not before.
-Hate
|
10-04-2013, 03:36 PM
|
Hill Giant
|
|
Join Date: May 2010
Posts: 125
|
|
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
|
10-04-2013, 04:25 PM
|
Demi-God
|
|
Join Date: Apr 2008
Location: MA
Posts: 1,164
|
|
Quote:
Originally Posted by Hateborne
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
|
|
|
|
10-04-2013, 04:51 PM
|
Hill Giant
|
|
Join Date: May 2010
Posts: 125
|
|
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
|
|
|
|
10-04-2013, 05:14 PM
|
|
Developer
|
|
Join Date: Dec 2012
Posts: 515
|
|
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)
|
10-04-2013, 06:22 PM
|
Demi-God
|
|
Join Date: Apr 2008
Location: MA
Posts: 1,164
|
|
Quote:
Originally Posted by NatedogEZ
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)
|
11-06-2013, 09:50 PM
|
Hill Giant
|
|
Join Date: May 2010
Posts: 125
|
|
Quote:
Originally Posted by demonstar55
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
|
11-06-2013, 11:36 PM
|
Demi-God
|
|
Join Date: Apr 2008
Location: MA
Posts: 1,164
|
|
Well Sympathic Proc is not TwinProc, so what does that have to do with TwinProc being fine?
|
11-07-2013, 02:42 AM
|
Hill Giant
|
|
Join Date: May 2010
Posts: 125
|
|
Quote:
Originally Posted by demonstar55
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
|
11-07-2013, 03:35 AM
|
Demi-God
|
|
Join Date: Apr 2008
Location: MA
Posts: 1,164
|
|
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. :/
|
11-07-2013, 02:49 PM
|
Hill Giant
|
|
Join Date: May 2010
Posts: 125
|
|
Quote:
Originally Posted by demonstar55
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
|
11-07-2013, 06:13 PM
|
Developer
|
|
Join Date: Mar 2009
Location: -
Posts: 228
|
|
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
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 04:21 AM.
|
|
|
|
|
|
|
|
|
|
|
|
|