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

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
|
 |
|
 |
Thread Tools |
|
Display Modes |
Hybrid Mode
|
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 06:08 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |