Merge branch 'azerothcore:master' into Playerbot

This commit is contained in:
ZhengPeiRu21
2023-04-23 13:53:58 -06:00
committed by GitHub
33 changed files with 2102 additions and 446 deletions

View File

@@ -14712,6 +14712,7 @@ void Player::_SaveCharacter(bool create, CharacterDatabaseTransaction trans)
stmt->SetData(index++, GetByteValue(PLAYER_FIELD_BYTES, 2));
stmt->SetData(index++, m_grantableLevels);
stmt->SetData(index++, _innTriggerId);
stmt->SetData(index++, m_extraBonusTalentCount);
}
else
{
@@ -14851,6 +14852,7 @@ void Player::_SaveCharacter(bool create, CharacterDatabaseTransaction trans)
stmt->SetData(index++, GetByteValue(PLAYER_FIELD_BYTES, 2));
stmt->SetData(index++, m_grantableLevels);
stmt->SetData(index++, _innTriggerId);
stmt->SetData(index++, m_extraBonusTalentCount);
stmt->SetData(index++, IsInWorld() && !GetSession()->PlayerLogout() ? 1 : 0);
// Index

View File

@@ -4954,8 +4954,8 @@ bool Player::LoadFromDB(ObjectGuid playerGuid, CharacterDatabaseQueryHolder cons
//"arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, "
// 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
//"health, power1, power2, power3, power4, power5, power6, power7, instance_id, talentGroupsCount, activeTalentGroup, exploredZones, equipmentCache, ammoId, knownTitles,
// 70 71 72
//"actionBars, grantableLevels, innTriggerId FROM characters WHERE guid = '{}'", guid);
// 70 71 72 73
//"actionBars, grantableLevels, innTriggerId, extraBonusTalentCount FROM characters WHERE guid = '{}'", guid);
PreparedQueryResult result = holder.GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_FROM);
if (!result)
@@ -5473,7 +5473,10 @@ bool Player::LoadFromDB(ObjectGuid playerGuid, CharacterDatabaseQueryHolder cons
_LoadMonthlyQuestStatus(holder.GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_MONTHLY_QUEST_STATUS));
_LoadRandomBGStatus(holder.GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_RANDOM_BG));
// after spell and quest load
// Extra Bonus Talent Points
m_extraBonusTalentCount = fields[73].Get<uint8>();
// after spell, bonus talents, and quest load
InitTalentForLevel();
// must be before inventory (some items required reputation check)

View File

@@ -11651,6 +11651,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
// done scripted mod (take it from owner)
Unit* owner = GetOwner() ? GetOwner() : this;
int32 DoneAdvertisedBenefit = 0;
AuraEffectList const& mOverrideClassScript = owner->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
for (AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
{
@@ -11667,36 +11668,68 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
case 5148: // Idol of the Shooting Star
case 6008: // Increased Lightning Damage
case 8627: // Totem of Hex
{
DoneTotal += (*i)->GetAmount();
break;
}
{
DoneAdvertisedBenefit += (*i)->GetAmount();
break;
}
}
}
// Custom scripted damage
if (spellProto->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT)
switch (spellProto->SpellFamilyName)
{
// Sigil of the Vengeful Heart
if (spellProto->SpellFamilyFlags[0] & 0x2000)
if (AuraEffect* aurEff = GetAuraEffect(64962, EFFECT_1))
AddPct(DoneTotal, aurEff->GetAmount());
case SPELLFAMILY_DRUID:
{
// Insect Swarm vs Item - Druid T8 Balance Relic
if (spellProto->SpellFamilyFlags[0] & 0x00200000)
{
if (AuraEffect const* relicAurEff = GetAuraEffect(64950, EFFECT_0))
{
DoneAdvertisedBenefit += relicAurEff->GetAmount();
}
}
// Impurity
if (AuraEffect* aurEff = GetDummyAuraEffect(SPELLFAMILY_DEATHKNIGHT, 1986, 0))
AddPct(ApCoeffMod, aurEff->GetAmount());
// Nourish vs Idol of the Flourishing Life
if (spellProto->SpellFamilyFlags[1] & 0x02000000)
{
if (AuraEffect const* relicAurEff = GetAuraEffect(64949, EFFECT_0))
{
DoneAdvertisedBenefit += relicAurEff->GetAmount();
}
}
break;
}
case SPELLFAMILY_DEATHKNIGHT:
{
// Sigil of the Vengeful Heart
if (spellProto->SpellFamilyFlags[0] & 0x2000)
{
if (AuraEffect* aurEff = GetAuraEffect(64962, EFFECT_1))
{
AddPct(DoneTotal, aurEff->GetAmount());
}
}
// Blood Boil - bonus for diseased targets
if (spellProto->SpellFamilyFlags[0] & 0x00040000)
if (victim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DEATHKNIGHT, 0, 0, 0x00000002, GetGUID()))
// Impurity
if (AuraEffect* aurEff = GetDummyAuraEffect(SPELLFAMILY_DEATHKNIGHT, 1986, 0))
{
AddPct(ApCoeffMod, aurEff->GetAmount());
}
// Blood Boil - bonus for diseased targets
if ((spellProto->SpellFamilyFlags[0] & 0x00040000) && victim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DEATHKNIGHT, 0, 0, 0x00000002, GetGUID()))
{
DoneTotal += 95;
ApCoeffMod = 1.5835f;
}
break;
}
default:
break;
}
// Done fixed damage bonus auras
int32 DoneAdvertisedBenefit = SpellBaseDamageBonusDone(spellProto->GetSchoolMask());
DoneAdvertisedBenefit += SpellBaseDamageBonusDone(spellProto->GetSchoolMask());
// Check for table values
float coeff = spellProto->Effects[effIndex].BonusMultiplier;
@@ -12428,37 +12461,70 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui
// done scripted mod (take it from owner)
Unit* owner = GetOwner() ? GetOwner() : this;
int32 DoneAdvertisedBenefit = 0;
AuraEffectList const& mOverrideClassScript = owner->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
for (AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
{
if (!(*i)->IsAffectedOnSpell(spellProto))
continue;
switch ((*i)->GetMiscValue())
{
case 4415: // Increased Rejuvenation Healing
case 4953:
DoneTotal += (*i)->GetAmount() / 5; // 5 ticks of Rejuvenation
DoneAdvertisedBenefit += (*i)->GetAmount();
break;
case 3736: // Hateful Totem of the Third Wind / Increased Lesser Healing Wave / LK Arena (4/5/6) Totem of the Third Wind / Savage Totem of the Third Wind
DoneTotal += (*i)->GetAmount();
DoneAdvertisedBenefit += (*i)->GetAmount();
break;
}
}
// Done fixed damage bonus auras
int32 DoneAdvertisedBenefit = SpellBaseHealingBonusDone(spellProto->GetSchoolMask());
float coeff = spellProto->Effects[effIndex].BonusMultiplier;
switch (spellProto->SpellFamilyName)
{
case SPELLFAMILY_DRUID:
{
// Nourish vs Idol of the Flourishing Life
if (spellProto->SpellFamilyFlags[1] & 0x02000000)
{
if (AuraEffect const* relicAurEff = GetAuraEffect(64949, EFFECT_0))
{
DoneAdvertisedBenefit += relicAurEff->GetAmount();
}
}
// Lifebloom vs Idol of Lush Moss/Increased Lifebloom Periodic
if (spellProto->SpellFamilyFlags[1] & 00000010)
{
if (AuraEffect const* relicAurEff = GetAuraEffect(60779, EFFECT_0))
{
DoneAdvertisedBenefit += relicAurEff->GetAmount();
}
if (AuraEffect const* relicAurEff = GetAuraEffect(34246, EFFECT_0))
{
DoneAdvertisedBenefit += relicAurEff->GetAmount();
}
}
break;
}
case SPELLFAMILY_DEATHKNIGHT:
{
// Impurity
if (AuraEffect* aurEff = GetDummyAuraEffect(SPELLFAMILY_DEATHKNIGHT, 1986, 0))
{
AddPct(ApCoeffMod, aurEff->GetAmount());
}
break;
}
default:
break;
}
// Done fixed damage bonus auras
DoneAdvertisedBenefit += SpellBaseHealingBonusDone(spellProto->GetSchoolMask());
float coeff = spellProto->Effects[effIndex].BonusMultiplier;
// Check for table values
SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id);
if(bonus)