mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-29 08:33:47 +00:00
Merge commit '26c583c24ab7dbbf1fecf3dcd737c1ad543c8b33' into Playerbot_1017
This commit is contained in:
@@ -3708,6 +3708,24 @@ uint32 Creature::GetPlayerDamageReq() const
|
||||
return _playerDamageReq;
|
||||
}
|
||||
|
||||
bool Creature::CanCastSpell(uint32 spellID) const
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellID);
|
||||
int32 currentPower = GetPower(getPowerType());
|
||||
|
||||
if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED) || IsSpellProhibited(spellInfo->GetSchoolMask()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (spellInfo && (currentPower < spellInfo->CalcPowerCost(this, spellInfo->GetSchoolMask())))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string Creature::GetDebugInfo() const
|
||||
{
|
||||
std::stringstream sstr;
|
||||
|
||||
@@ -366,6 +366,7 @@ public:
|
||||
|
||||
// Handling caster facing during spellcast
|
||||
void SetTarget(ObjectGuid guid = ObjectGuid::Empty) override;
|
||||
void ClearTarget() { SetTarget(); };
|
||||
void FocusTarget(Spell const* focusSpell, WorldObject const* target);
|
||||
void ReleaseFocus(Spell const* focusSpell);
|
||||
[[nodiscard]] bool IsMovementPreventedByCasting() const override;
|
||||
@@ -398,6 +399,12 @@ public:
|
||||
* */
|
||||
void ResumeChasingVictim() { GetMotionMaster()->MoveChase(GetVictim()); };
|
||||
|
||||
/**
|
||||
* @brief Returns true if the creature is able to cast the spell.
|
||||
*
|
||||
* */
|
||||
bool CanCastSpell(uint32 spellID) const;
|
||||
|
||||
std::string GetDebugInfo() const override;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -1175,6 +1175,14 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_PCT, aurEff->GetAmount(), true);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case NPC_VOIDWALKER:
|
||||
{
|
||||
if (AuraEffect* aurEff = owner->GetAuraEffectDummy(SPELL_GLYPH_OF_VOIDWALKER))
|
||||
{
|
||||
HandleStatModifier(UNIT_MOD_STAT_STAMINA, TOTAL_PCT, aurEff->GetAmount(), true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case NPC_WATER_ELEMENTAL_PERM:
|
||||
|
||||
@@ -147,6 +147,7 @@ enum PetScalingSpells
|
||||
SPELL_WARLOCK_PET_SCALING_04 = 34958,
|
||||
SPELL_WARLOCK_PET_SCALING_05 = 61013, // Hit / Expertise
|
||||
SPELL_GLYPH_OF_FELGUARD = 56246,
|
||||
SPELL_GLYPH_OF_VOIDWALKER = 56247,
|
||||
SPELL_INFERNAL_SCALING_01 = 36186,
|
||||
SPELL_INFERNAL_SCALING_02 = 36188,
|
||||
SPELL_INFERNAL_SCALING_03 = 36189,
|
||||
|
||||
@@ -11272,12 +11272,12 @@ void Unit::SendEnergizeSpellLog(Unit* victim, uint32 spellID, uint32 damage, Pow
|
||||
|
||||
void Unit::EnergizeBySpell(Unit* victim, uint32 spellID, uint32 damage, Powers powerType)
|
||||
{
|
||||
victim->ModifyPower(powerType, damage, false);
|
||||
int32 gainedPower = victim->ModifyPower(powerType, damage, false);
|
||||
|
||||
if (powerType != POWER_HAPPINESS)
|
||||
if (powerType != POWER_HAPPINESS && gainedPower)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellID);
|
||||
victim->getHostileRefMgr().threatAssist(this, float(damage) * 0.5f, spellInfo);
|
||||
victim->getHostileRefMgr().threatAssist(this, float(gainedPower) * 0.5f, spellInfo);
|
||||
}
|
||||
|
||||
SendEnergizeSpellLog(victim, spellID, damage, powerType);
|
||||
@@ -20255,7 +20255,7 @@ bool Unit::CanSwim() const
|
||||
// Mirror client behavior, if this method returns false then client will not use swimming animation and for players will apply gravity as if there was no water
|
||||
if (HasUnitFlag(UNIT_FLAG_CANNOT_SWIM))
|
||||
return false;
|
||||
if (HasUnitFlag(UNIT_FLAG_POSSESSED)) // is player
|
||||
if (HasUnitFlag(UNIT_FLAG_POSSESSED) || HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED)) // is player
|
||||
return true;
|
||||
if (HasUnitFlag2(UNIT_FLAG2_UNUSED_6))
|
||||
return false;
|
||||
|
||||
@@ -676,7 +676,8 @@ InstancePlayerBind* InstanceSaveMgr::PlayerBindToInstance(ObjectGuid guid, Insta
|
||||
stmt->SetData(2, permanent);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_RAID, 1);
|
||||
if (player)
|
||||
player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_RAID, 1);
|
||||
}
|
||||
|
||||
if (bind.save != save)
|
||||
|
||||
@@ -1930,13 +1930,6 @@ void Spell::EffectEnergize(SpellEffIndex effIndex)
|
||||
case 48542: // Revitalize
|
||||
damage = int32(CalculatePct(unitTarget->GetMaxPower(power), damage));
|
||||
break;
|
||||
case 67490: // Runic Mana Injector (mana gain increased by 25% for engineers - 3.2.0 patch change)
|
||||
{
|
||||
if (Player* player = m_caster->ToPlayer())
|
||||
if (player->HasSkill(SKILL_ENGINEERING))
|
||||
AddPct(damage, 25);
|
||||
break;
|
||||
}
|
||||
case 71132: // Glyph of Shadow Word: Pain
|
||||
damage = int32(CalculatePct(unitTarget->GetCreateMana(), 1)); // set 1 as value, missing in dbc
|
||||
break;
|
||||
|
||||
@@ -212,8 +212,8 @@ std::array<SpellImplicitTargetInfo::StaticData, TOTAL_SPELL_TARGETS> SpellImplic
|
||||
{TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, //
|
||||
{TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 1 TARGET_UNIT_CASTER
|
||||
{TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NEARBY, TARGET_CHECK_ENEMY, TARGET_DIR_NONE}, // 2 TARGET_UNIT_NEARBY_ENEMY
|
||||
{TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NEARBY, TARGET_CHECK_PARTY, TARGET_DIR_NONE}, // 3 TARGET_UNIT_NEARBY_PARTY
|
||||
{TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NEARBY, TARGET_CHECK_ALLY, TARGET_DIR_NONE}, // 4 TARGET_UNIT_NEARBY_ALLY
|
||||
{TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NEARBY, TARGET_CHECK_ALLY, TARGET_DIR_NONE}, // 3 TARGET_UNIT_NEARBY_ALLY
|
||||
{TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NEARBY, TARGET_CHECK_PARTY, TARGET_DIR_NONE}, // 4 TARGET_UNIT_NEARBY_PARTY
|
||||
{TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 5 TARGET_UNIT_PET
|
||||
{TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_ENEMY, TARGET_DIR_NONE}, // 6 TARGET_UNIT_TARGET_ENEMY
|
||||
{TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_SRC, TARGET_SELECT_CATEGORY_AREA, TARGET_CHECK_ENTRY, TARGET_DIR_NONE}, // 7 TARGET_UNIT_SRC_AREA_ENTRY
|
||||
|
||||
@@ -1028,14 +1028,6 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(6);
|
||||
});
|
||||
|
||||
// Glyph of Voidwalker
|
||||
ApplySpellFix({ 56247 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_ADD_FLAT_MODIFIER;
|
||||
spellInfo->Effects[EFFECT_0].MiscValue = SPELLMOD_EFFECT1;
|
||||
spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(0x8000000, 0, 0);
|
||||
});
|
||||
|
||||
// Everlasting Affliction
|
||||
ApplySpellFix({ 47201, 47202, 47203, 47204, 47205 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
@@ -3922,12 +3914,6 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
spellInfo->ExcludeCasterAuraSpell = 42299;
|
||||
});
|
||||
|
||||
// Catch the Wild Wolpertinger!
|
||||
ApplySpellFix({ 41621 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_DUMMY;
|
||||
});
|
||||
|
||||
// Brewfest quests
|
||||
ApplySpellFix({ 47134, 51798 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
@@ -4580,6 +4566,12 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
spellInfo->ProcChance = 3;
|
||||
});
|
||||
|
||||
// Summon Water Elementals
|
||||
ApplySpellFix({ 29962, 37051, 37052, 37053 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13); // 50000yd
|
||||
});
|
||||
|
||||
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
|
||||
{
|
||||
SpellInfo* spellInfo = mSpellInfoMap[i];
|
||||
|
||||
Reference in New Issue
Block a user