Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2024-07-11 12:32:13 +08:00
74 changed files with 1708 additions and 1401 deletions

View File

@@ -1810,20 +1810,23 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
break;
}
case SMART_TARGET_RANDOM_POINT:
if (me)
{
float range = (float)e.target.randomPoint.range;
Position srcPos = { e.target.x, e.target.y, e.target.z, e.target.o };
Position randomPoint = me->GetRandomPoint(srcPos, range);
me->GetMotionMaster()->MovePoint(
e.action.moveToPos.pointId,
randomPoint.m_positionX,
randomPoint.m_positionY,
randomPoint.m_positionZ,
true,
true,
isControlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE
);
if (me)
{
float range = (float)e.target.randomPoint.range;
Position srcPos = { e.target.x, e.target.y, e.target.z, e.target.o };
Position randomPoint = me->GetRandomPoint(srcPos, range);
me->GetMotionMaster()->MovePoint(
e.action.moveToPos.pointId,
randomPoint.m_positionX,
randomPoint.m_positionY,
randomPoint.m_positionZ,
true,
true,
isControlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE
);
}
break;
}

View File

@@ -204,8 +204,8 @@ void CalendarMgr::RemoveEvent(CalendarEvent* calendarEvent, ObjectGuid remover)
trans->Append(stmt);
CharacterDatabase.CommitTransaction(trans);
delete calendarEvent;
_events.erase(calendarEvent);
delete calendarEvent;
return;
}

View File

@@ -1921,7 +1921,7 @@ void GameObject::Use(Unit* user)
if (info->entry == 194097)
spellId = 61994; // Ritual of Summoning
else
spellId = 59782; // Summoning Stone Effect
spellId = 23598; // Meeting Stone Summon
break;
}

View File

@@ -2503,7 +2503,7 @@ float Pet::GetNativeObjectScale() const
if (creatureFamily && creatureFamily->minScale > 0.0f && getPetType() & HUNTER_PET)
{
float minScaleLevel = creatureFamily->minScaleLevel;
uint8 level = getLevel();
uint8 level = GetLevel();
float minLevelScaleMod = level >= minScaleLevel ? (level / minScaleLevel) : 0.0f;
float maxScaleMod = creatureFamily->maxScaleLevel - minScaleLevel;
@@ -2513,15 +2513,32 @@ float Pet::GetNativeObjectScale() const
float scaleMod = creatureFamily->maxScaleLevel != minScaleLevel ? minLevelScaleMod / maxScaleMod : 0.f;
float scale = (creatureFamily->maxScale - creatureFamily->minScale) * scaleMod + creatureFamily->minScale;
float maxScale = creatureFamily->maxScale;
scale = std::min(scale, creatureFamily->maxScale);
if (CreatureDisplayInfoEntry const* displayInfo = sCreatureDisplayInfoStore.LookupEntry(GetNativeDisplayId()))
// override maxScale
switch (ctFamily)
{
if (scale < 1.f && displayInfo->scale > 1.f)
scale *= displayInfo->scale;
case CREATURE_FAMILY_CHIMAERA:
case CREATURE_FAMILY_CORE_HOUND:
case CREATURE_FAMILY_CRAB:
case CREATURE_FAMILY_DEVILSAUR:
case CREATURE_FAMILY_NETHER_RAY:
case CREATURE_FAMILY_RHINO:
case CREATURE_FAMILY_SPIDER:
case CREATURE_FAMILY_TURTLE:
case CREATURE_FAMILY_WARP_STALKER:
case CREATURE_FAMILY_WASP:
case CREATURE_FAMILY_WIND_SERPENT:
maxScale = 1.0f;
break;
default:
break;
}
float scale = (maxScale - creatureFamily->minScale) * scaleMod + creatureFamily->minScale;
scale = std::min(scale, maxScale);
return scale;
}

View File

@@ -173,12 +173,13 @@ void Totem::UnSummon(uint32 msTime)
bool Totem::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const
{
// xinef: immune to all positive spells, except of stoneclaw totem absorb and sentry totem bind sight
// xinef: immune to all positive spells, except of stoneclaw totem absorb, sentry totem bind sight and intervene
// totems positive spells have unit_caster target
if (spellInfo->Effects[index].Effect != SPELL_EFFECT_DUMMY &&
spellInfo->Effects[index].Effect != SPELL_EFFECT_SCRIPT_EFFECT &&
spellInfo->IsPositive() && spellInfo->Effects[index].TargetA.GetTarget() != TARGET_UNIT_CASTER &&
spellInfo->Effects[index].TargetA.GetCheckType() != TARGET_CHECK_ENTRY && spellInfo->Id != 55277 && spellInfo->Id != 6277)
spellInfo->Effects[index].TargetA.GetCheckType() != TARGET_CHECK_ENTRY &&
spellInfo->Id != SPELL_STONECLAW && spellInfo->Id != SPELL_BIND_SIGHT && spellInfo->Id != SPELL_INTERVENE)
return true;
// Cyclone shouldn't be casted on totems

View File

@@ -37,7 +37,15 @@ enum class TotemSpellIds : uint32
#define SENTRY_TOTEM_ENTRY 3968
#define EARTHBIND_TOTEM_ENTRY 2630
constexpr uint32 SPELL_CYCLONE = 33786;
enum TotemImmunitySpells
{
// Immune
SPELL_CYCLONE = 33786,
// Not Immune
SPELL_STONECLAW = 55277,
SPELL_BIND_SIGHT = 6277,
SPELL_INTERVENE = 3411
};
class Totem : public Minion
{

View File

@@ -20597,7 +20597,7 @@ void Unit::CastDelayedSpellWithPeriodicAmount(Unit* caster, uint32 spellId, Aura
}
// xinef: delay only for casting on different unit
if (this == caster)
if (this == caster || !sWorld->getBoolConfig(CONFIG_MUNCHING_BLIZZLIKE))
caster->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, addAmount, this, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_NO_PERIODIC_RESET), nullptr, nullptr, caster->GetGUID());
else
caster->m_Events.AddEvent(new AuraMunchingQueue(*caster, GetGUID(), addAmount, spellId), caster->m_Events.CalculateQueueTime(400));

View File

@@ -1066,7 +1066,7 @@ void Spell::EffectTriggerRitualOfSummoning(SpellEffIndex effIndex)
finish();
m_caster->CastSpell((Unit*)nullptr, spellInfo, false);
m_caster->CastSpell((Unit*)nullptr, spellInfo, true);
}
void Spell::EffectJump(SpellEffIndex effIndex)

View File

@@ -1943,7 +1943,8 @@ void SpellMgr::LoadSpellInfoCorrections()
});
// Ulduar, Mimiron, Magnetic Core (summon)
ApplySpellFix({ 64444 }, [](SpellInfo* spellInfo)
// Meeting Stone Summon
ApplySpellFix({ 64444, 23598 }, [](SpellInfo* spellInfo)
{
spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_CASTER);
});
@@ -4807,6 +4808,12 @@ void SpellMgr::LoadSpellInfoCorrections()
spellInfo->Effects[EFFECT_0].TriggerSpell = 38530; // Quest Credit for Eye of Grillok
});
// Greater Fireball
ApplySpellFix({ 33051 }, [](SpellInfo* spellInfo)
{
spellInfo->AttributesEx4 |= SPELL_ATTR4_NO_CAST_LOG;
});
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
{
SpellInfo* spellInfo = mSpellInfoMap[i];

View File

@@ -185,6 +185,7 @@ enum WorldBoolConfigs
CONFIG_STRICT_NAMES_RESERVED,
CONFIG_STRICT_NAMES_PROFANITY,
CONFIG_ALLOWS_RANK_MOD_FOR_PET_HEALTH,
CONFIG_MUNCHING_BLIZZLIKE,
BOOL_CONFIG_VALUE_COUNT
};

View File

@@ -1283,6 +1283,8 @@ void World::LoadConfigSettings(bool reload)
_bool_configs[CONFIG_ALLOWS_RANK_MOD_FOR_PET_HEALTH] = sConfigMgr->GetOption<bool>("Pet.RankMod.Health", true);
_bool_configs[CONFIG_MUNCHING_BLIZZLIKE] = sConfigMgr->GetOption<bool>("MunchingBlizzlike.Enabled", true);
_int_configs[CONFIG_DAILY_RBG_MIN_LEVEL_AP_REWARD] = sConfigMgr->GetOption<uint32>("DailyRBGArenaPoints.MinLevel", 71);
_int_configs[CONFIG_AUCTION_HOUSE_SEARCH_TIMEOUT] = sConfigMgr->GetOption<uint32>("AuctionHouse.SearchTimeout", 1000);