This commit is contained in:
SecretsOTheP
2014-02-13 12:02:37 -05:00
26 changed files with 960 additions and 1069 deletions
+93 -129
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)
{
@@ -7010,37 +7010,30 @@ int16 Bot::CalcBotAAFocus(BotfocusType type, uint32 aa_ID, uint16 spell_id)
break;
}
case SE_CriticalHealRate:
{
if (type == focusCriticalHealRate)
case SE_FcHealAmtIncoming:
if(type == focusFcHealAmtIncoming)
value = base1;
break;
}
case SE_AdditionalHeal:
{
if(type == focusAdditionalHeal)
case SE_FcHealPctCritIncoming:
if (type == focusFcHealPctCritIncoming)
value = base1;
break;
}
case SE_AdditionalHeal2:
{
if(type == focusAdditionalHeal2)
case SE_FcHealAmtCrit:
if(type == focusFcHealAmtCrit)
value = base1;
break;
}
case SE_HealRate2:
{
if(type == focusHealRate)
case SE_FcHealAmt:
if(type == focusFcHealAmt)
value = base1;
break;
case SE_FcHealPctIncoming:
if(type == focusFcHealPctIncoming)
value = base1;
break;
}
case SE_FcBaseEffects:
{
@@ -7057,7 +7050,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 +7331,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 +7391,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 +7406,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 +7422,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 +7595,7 @@ int16 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel
break;
}
case SE_SpellVulnerability:
case SE_FcSpellVulnerability:
{
if(bottype == BotfocusSpellVulnerability)
{
@@ -7619,7 +7612,7 @@ int16 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel
}
break;
}
case SE_Twincast:
case SE_FcTwincast:
{
if(bottype == BotfocusTwincast)
{
@@ -7660,45 +7653,30 @@ int16 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel
break;
}
case SE_FcDamageAmtIncoming:
{
if(bottype == BotfocusFcDamageAmtIncoming)
case SE_FcHealAmtIncoming:
if(bottype == BotfocusFcHealAmtIncoming)
value = focus_spell.base[i];
break;
}
case SE_CriticalHealRate:
{
if (bottype == BotfocusCriticalHealRate)
case SE_FcHealPctCritIncoming:
if (bottype == BotfocusFcHealPctCritIncoming)
value = focus_spell.base[i];
break;
}
case SE_AdditionalHeal:
{
if(bottype == BotfocusAdditionalHeal)
case SE_FcHealAmtCrit:
if(bottype == BotfocusFcHealAmtCrit)
value = focus_spell.base[i];
break;
}
case SE_AdditionalHeal2:
{
if(bottype == BotfocusAdditionalHeal2)
case SE_FcHealAmt:
if(bottype == BotfocusFcHealAmt)
value = focus_spell.base[i];
break;
}
case SE_HealRate2:
{
if(bottype == BotfocusHealRate)
case SE_FcHealPctIncoming:
if(bottype == BotfocusFcHealPctIncoming)
value = focus_spell.base[i];
break;
}
case SE_FcBaseEffects:
{
@@ -7715,7 +7693,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];
@@ -9119,23 +9097,6 @@ void Bot::SetAttackTimer() {
}
}
int32 Bot::Additional_SpellDmg(uint16 spell_id, bool bufftick)
{
int32 spell_dmg = 0;
spell_dmg += GetBotFocusEffect(BotfocusFcDamageAmtCrit, spell_id);
spell_dmg += GetBotFocusEffect(BotfocusFcDamageAmt, spell_id);
//For DOTs you need to apply the damage over the duration of the dot to each tick (this is how live did it)
if (bufftick){
int duration = CalcBuffDuration(this, this, spell_id);
if (duration > 0)
return spell_dmg /= duration;
else
return 0;
}
return spell_dmg;
}
int32 Bot::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) {
if (spells[spell_id].targettype == ST_Self)
@@ -9196,7 +9157,7 @@ int32 Bot::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) {
value -= GetBotFocusEffect(BotfocusFcDamageAmt, spell_id);
if(itembonuses.SpellDmg && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5)
value += GetExtraSpellDmg(spell_id, itembonuses.SpellDmg, value)*ratio/100;
value += GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, value)*ratio/100;
entity_list.MessageClose(this, false, 100, MT_SpellCrits, "%s delivers a critical blast! (%d)", GetName(), -value);
@@ -9220,70 +9181,73 @@ int32 Bot::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) {
value -= GetBotFocusEffect(BotfocusFcDamageAmt, spell_id);
if(itembonuses.SpellDmg && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5)
value += GetExtraSpellDmg(spell_id, itembonuses.SpellDmg, value);
value += GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, value);
return value;
}
int32 Bot::Additional_Heal(uint16 spell_id)
{
int32 heal_amt = 0;
int32 Bot::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) {
if (target == nullptr)
target = this;
heal_amt += GetBotFocusEffect(BotfocusAdditionalHeal, spell_id);
heal_amt += GetBotFocusEffect(BotfocusAdditionalHeal2, spell_id);
if (heal_amt){
int duration = CalcBuffDuration(this, this, spell_id);
if (duration > 0)
return heal_amt /= duration;
}
return heal_amt;
}
int32 Bot::GetActSpellHealing(uint16 spell_id, int32 value) {
int32 modifier = 100;
int16 heal_amt = 0;
modifier += GetBotFocusEffect(BotfocusImprovedHeal, spell_id);
modifier += GetBotFocusEffect(BotfocusFcBaseEffects, spell_id);
heal_amt += Additional_Heal(spell_id);
int chance = 0;
int32 value_BaseEffect = 0;
int16 chance = 0;
int8 modifier = 1;
bool Critical = false;
value_BaseEffect = value + (value*GetBotFocusEffect(BotfocusFcBaseEffects, spell_id)/100);
value = value_BaseEffect;
value += int(value_BaseEffect*GetBotFocusEffect(BotfocusImprovedHeal, spell_id)/100);
// Instant Heals
if(spells[spell_id].buffduration < 1) {
uint8 botlevel = GetLevel();
uint8 botclass = GetClass();
// Formula = HealAmt * (casttime + recastime) / 7; Cant trigger off spell less than 5 levels below and cant heal more than the spell itself.
if(this->itembonuses.HealAmt && spells[spell_id].classes[(botclass%16) - 1] >= botlevel - 5) {
heal_amt = this->itembonuses.HealAmt * (spells[spell_id].cast_time + spells[spell_id].recast_time) / 7000;
if(heal_amt > value)
heal_amt = value;
}
// Check for buffs that affect the healrate of the target and critical heal rate of target
if(GetTarget()) {
value += value * GetHealRate(spell_id) / 100;
chance += GetCriticalHealRate(spell_id);
}
chance += itembonuses.CriticalHealChance + spellbonuses.CriticalHealChance + aabonuses.CriticalHealChance;
//Live AA - Healing Gift, Theft of Life
chance += itembonuses.CriticalHealChance + spellbonuses.CriticalHealChance + aabonuses.CriticalHealChance;
chance += target->GetFocusIncoming(focusFcHealPctCritIncoming, SE_FcHealPctCritIncoming, this, spell_id);
if (spellbonuses.CriticalHealDecay)
chance += GetDecayEffectValue(spell_id, SE_CriticalHealDecay);
if(chance && (MakeRandomInt(0,99) < chance)) {
Critical = true;
modifier = 2; //At present time no critical heal amount modifier SPA exists.
}
value *= modifier;
value += GetBotFocusEffect(BotfocusFcHealAmtCrit, spell_id) * modifier;
value += GetBotFocusEffect(BotfocusFcHealAmt, spell_id);
value += target->GetFocusIncoming(focusFcHealAmtIncoming, SE_FcHealAmtIncoming, this, spell_id);
if(MakeRandomInt(0,99) < chance) {
entity_list.MessageClose(this, false, 100, MT_SpellCrits, "%s performs an exceptional heal! (%d)", GetName(), ((value * modifier / 50) + heal_amt*2));
return ((value * modifier / 50) + heal_amt*2);
}
else{
return ((value * modifier / 100) + heal_amt);
}
if(itembonuses.HealAmt && spells[spell_id].classes[(GetClass()%16) - 1] >= GetLevel() - 5)
value += GetExtraSpellAmt(spell_id, itembonuses.HealAmt, value) * modifier;
value += value*target->GetHealRate(spell_id, this)/100;
if (Critical)
entity_list.MessageClose(this, false, 100, MT_SpellCrits, "%s performs an exceptional heal! (%d)", GetName(), value);
return value;
}
// Hots
//Heal over time spells. [Heal Rate and Additional Healing effects do not increase this value]
else {
chance += itembonuses.CriticalHealChance + spellbonuses.CriticalHealChance + aabonuses.CriticalHealChance;
if(MakeRandomInt(0,99) < chance)
return ((value * modifier / 50) + heal_amt*2);
chance = itembonuses.CriticalHealOverTime + spellbonuses.CriticalHealOverTime + aabonuses.CriticalHealOverTime;
chance += target->GetFocusIncoming(focusFcHealPctCritIncoming, SE_FcHealPctCritIncoming, this, spell_id);
if (spellbonuses.CriticalRegenDecay)
chance += GetDecayEffectValue(spell_id, SE_CriticalRegenDecay);
if(chance && (MakeRandomInt(0,99) < chance))
return (value * 2);
}
return ((value * modifier / 100) + heal_amt);
return value;
}
int32 Bot::GetActSpellCasttime(uint16 spell_id, int32 casttime) {