Updates to focus effect related code

This commit is contained in:
KayenEQ
2014-02-08 23:26:09 -05:00
parent ae730b7055
commit 791ba8e38b
8 changed files with 381 additions and 498 deletions
+5 -13
View File
@@ -1607,10 +1607,6 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses* ne
newbon->MeleeMitigation -= effect_value;
break;
case SE_IncreaseHitDmgTaken:
newbon->MeleeMitigation += effect_value;
break;
case SE_CriticalHitChance:
{
@@ -2777,12 +2773,12 @@ uint8 Mob::IsFocusEffect(uint16 spell_id,int effect_index, bool AA,uint32 aa_eff
case SE_TriggerOnCast:
//return focusTriggerOnCast;
return 0; //This is calculated as an actual bonus
case SE_SpellVulnerability:
case SE_FcSpellVulnerability:
return focusSpellVulnerability;
case SE_BlockNextSpellFocus:
//return focusBlockNextSpell;
return 0; //This is calculated as an actual bonus
case SE_Twincast:
case SE_FcTwincast:
return focusTwincast;
case SE_SympatheticProc:
return focusSympatheticProc;
@@ -2800,12 +2796,14 @@ uint8 Mob::IsFocusEffect(uint16 spell_id,int effect_index, bool AA,uint32 aa_eff
return focusFcHealPctIncoming;
case SE_FcBaseEffects:
return focusFcBaseEffects;
case SE_IncreaseNumHits:
case SE_FcIncreaseNumHits:
return focusIncreaseNumHits;
case SE_FcLimitUse:
return focusFcLimitUse;
case SE_FcMute:
return focusFcMute;
case SE_FcTimerRefresh:
return focusFcTimerRefresh;
case SE_FcStunTimeMod:
return focusFcStunTimeMod;
case SE_FcHealPctCritIncoming:
@@ -3119,12 +3117,6 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
aabonuses.MeleeMitigation = effect_value;
break;
case SE_IncreaseHitDmgTaken:
spellbonuses.MeleeMitigation = effect_value;
itembonuses.MeleeMitigation = effect_value;
aabonuses.MeleeMitigation = effect_value;
break;
case SE_CriticalHitChance:
{
for(int e = 0; e < HIGHEST_SKILL+1; e++)
+16 -16
View File
@@ -6736,7 +6736,7 @@ int16 Bot::CalcBotAAFocus(BotfocusType type, uint32 aa_ID, uint16 spell_id)
if((spell.classes[(GetClass()%16) - 1]) < base1)
LimitFound = true;
break;
case SE_LimitCastTime:
case SE_LimitCastTimeMin:
if (spell.cast_time < base1)
LimitFound = true;
break;
@@ -6782,7 +6782,7 @@ int16 Bot::CalcBotAAFocus(BotfocusType type, uint32 aa_ID, uint16 spell_id)
}
break;
case SE_LimitManaCost:
case SE_LimitManaMin:
if(spell.mana < base1)
LimitFound = true;
break;
@@ -6800,7 +6800,7 @@ int16 Bot::CalcBotAAFocus(BotfocusType type, uint32 aa_ID, uint16 spell_id)
}
break;
case SE_CombatSkills:
case SE_LimitCombatSkills:
// 1 is for disciplines only
if(base1 == 1 && !IsDiscipline(spell_id))
LimitFound = true;
@@ -6817,13 +6817,13 @@ int16 Bot::CalcBotAAFocus(BotfocusType type, uint32 aa_ID, uint16 spell_id)
break;
case SE_LimitSpellSkill:
case SE_LimitCastingSkill:
LimitSpellSkill = true;
if(base1 == spell.skill)
SpellSkill_Found = true;
break;
case SE_LimitExcludeSkill:{
case SE_LimitSpellSubclass:{
int16 spell_skill = spell.skill * -1;
if(base1 == spell_skill)
LimitFound = true;
@@ -6941,7 +6941,7 @@ int16 Bot::CalcBotAAFocus(BotfocusType type, uint32 aa_ID, uint16 spell_id)
}
break;
}
case SE_SpellVulnerability:
case SE_FcSpellVulnerability:
{
if(type == focusSpellVulnerability)
{
@@ -6958,7 +6958,7 @@ int16 Bot::CalcBotAAFocus(BotfocusType type, uint32 aa_ID, uint16 spell_id)
}
break;
}
case SE_Twincast:
case SE_FcTwincast:
{
if(type == focusTwincast)
{
@@ -7057,7 +7057,7 @@ int16 Bot::CalcBotAAFocus(BotfocusType type, uint32 aa_ID, uint16 spell_id)
break;
}
case SE_IncreaseNumHits:
case SE_FcIncreaseNumHits:
{
if(type == focusIncreaseNumHits)
value = base1;
@@ -7338,7 +7338,7 @@ int16 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel
return(0);
break;
case SE_LimitCastTime:
case SE_LimitCastTimeMin:
if (spells[spell_id].cast_time < (uint16)focus_spell.base[i])
return(0);
break;
@@ -7398,7 +7398,7 @@ int16 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel
}
break;
case SE_LimitManaCost:
case SE_LimitManaMin:
if(spell.mana < focus_spell.base[i])
return 0;
break;
@@ -7413,7 +7413,7 @@ int16 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel
break;
case SE_CombatSkills:
case SE_LimitCombatSkills:
// 1 is for disciplines only
if(focus_spell.base[i] == 1 && !IsDiscipline(spell_id))
return 0;
@@ -7429,13 +7429,13 @@ int16 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel
return 0;
break;
case SE_LimitSpellSkill:
case SE_LimitCastingSkill:
LimitSpellSkill = true;
if(focus_spell.base[i] == spell.skill)
SpellSkill_Found = true;
break;
case SE_LimitExcludeSkill:{
case SE_LimitSpellSubclass:{
int16 spell_skill = spell.skill * -1;
if(focus_spell.base[i] == spell_skill)
return 0;
@@ -7602,7 +7602,7 @@ int16 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel
break;
}
case SE_SpellVulnerability:
case SE_FcSpellVulnerability:
{
if(bottype == BotfocusSpellVulnerability)
{
@@ -7619,7 +7619,7 @@ int16 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel
}
break;
}
case SE_Twincast:
case SE_FcTwincast:
{
if(bottype == BotfocusTwincast)
{
@@ -7715,7 +7715,7 @@ int16 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel
break;
}
case SE_IncreaseNumHits:
case SE_FcIncreaseNumHits:
{
if(bottype == BotfocusIncreaseNumHits)
value = focus_spell.base[i];
+1
View File
@@ -78,6 +78,7 @@ typedef enum { //focus types
focusIncreaseNumHits,
focusFcLimitUse,
focusFcMute,
focusFcTimerRefresh,
focusFcStunTimeMod,
focusFcHealPctCritIncoming,
focusFcHealAmt,
+2 -2
View File
@@ -3336,7 +3336,7 @@ void Mob::TryTwincast(Mob *caster, Mob *target, uint32 spell_id)
int buff_count = GetMaxTotalSlots();
for(int i = 0; i < buff_count; i++)
{
if(IsEffectInSpell(buffs[i].spellid, SE_Twincast))
if(IsEffectInSpell(buffs[i].spellid, SE_FcTwincast))
{
int32 focus = CalcFocusEffect(focusTwincast, buffs[i].spellid, spell_id);
if(focus > 0)
@@ -3378,7 +3378,7 @@ int32 Mob::GetVulnerability(Mob* caster, uint32 spell_id, uint32 ticsremaining)
int buff_count = GetMaxTotalSlots();
for(int i = 0; i < buff_count; i++) {
if((IsValidSpell(buffs[i].spellid) && IsEffectInSpell(buffs[i].spellid, SE_SpellVulnerability))){
if((IsValidSpell(buffs[i].spellid) && IsEffectInSpell(buffs[i].spellid, SE_FcSpellVulnerability))){
int32 focus = caster->CalcFocusEffect(focusSpellVulnerability, buffs[i].spellid, spell_id);
+337 -451
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -2689,7 +2689,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2,
effect1 == SE_LimitMinDur ||
effect1 == SE_LimitInstant ||
effect1 == SE_LimitMinLevel ||
effect1 == SE_LimitCastTime)
effect1 == SE_LimitCastTimeMin)
continue;
/*