Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2023-08-05 19:11:41 +08:00
13 changed files with 120 additions and 41 deletions

View File

@@ -180,7 +180,7 @@ void BattlegroundMgr::Update(uint32 diff)
if (GameTime::GetGameTime() > m_NextAutoDistributionTime)
{
sArenaTeamMgr->DistributeArenaPoints();
m_NextAutoDistributionTime = m_NextAutoDistributionTime + 1_days * sWorld->getIntConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS);
m_NextAutoDistributionTime = GameTime::GetGameTime() + Seconds(DAY * sWorld->getIntConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS));
sWorld->setWorldState(WS_ARENA_DISTRIBUTION_TIME, m_NextAutoDistributionTime.count());
}
m_AutoDistributionTimeChecker = 600000; // 10 minutes check

View File

@@ -1091,7 +1091,17 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(creature_ID, petlevel);
if (pInfo) // exist in DB
{
SetCreateHealth(pInfo->health);
// Default scale value of 1 to use if Pet.RankMod.Health = 0
float factorHealth = 1;
// If config is set to allow pets to use health modifiers, apply it to creatures with a DB entry
// Pet.RankMod.Health = 1 use the factor value based on the rank of the pet, most pets have a rank of 0 and so use
// the Elite rank which is set as the default in Creature::_GetHealthMod(int32 Rank)
if (sWorld->getBoolConfig(CONFIG_ALLOWS_RANK_MOD_FOR_PET_HEALTH))
{
factorHealth *= _GetHealthMod(cinfo->rank);
}
SetCreateHealth(pInfo->health*factorHealth);
SetModifierValue(UNIT_MOD_HEALTH, BASE_VALUE, (float)pInfo->health);
if (petType != HUNTER_PET) //hunter pet use focus
{

View File

@@ -2187,7 +2187,7 @@ bool Aura::CanStackWith(Aura const* existingAura, bool remove) const
}
// spell of same spell rank chain
if (m_spellInfo->IsRankOf(existingSpellInfo))
if (m_spellInfo->IsRankOf(existingSpellInfo) && !(m_spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && m_spellInfo->SpellFamilyFlags[1] & 0x80000000))
{
// don't allow passive area auras to stack
if (m_spellInfo->IsMultiSlotAura() && !IsArea())

View File

@@ -127,7 +127,7 @@ public:
{ "cometome", HandleComeToMeCommand, SEC_ADMINISTRATOR, Console::No },
{ "damage", HandleDamageCommand, SEC_GAMEMASTER, Console::No },
{ "combatstop", HandleCombatStopCommand, SEC_GAMEMASTER, Console::Yes },
{ "flusharenapoints", HandleFlushArenaPointsCommand, SEC_ADMINISTRATOR, Console::No },
{ "flusharenapoints", HandleFlushArenaPointsCommand, SEC_ADMINISTRATOR, Console::Yes },
{ "freeze", HandleFreezeCommand, SEC_GAMEMASTER, Console::No },
{ "unfreeze", HandleUnFreezeCommand, SEC_GAMEMASTER, Console::No },
{ "possess", HandlePossessCommand, SEC_GAMEMASTER, Console::No },

View File

@@ -66,7 +66,7 @@ public:
void OnPlayerEnter(Player* player) override
{
if (instance->GetPlayersCountExceptGMs() == 1)
if (instance->GetPlayersCountExceptGMs() <= 1)
CleanupInstance();
EnsureGridLoaded();
@@ -144,8 +144,11 @@ public:
Reposition(thrall);
return;
case DATA_ESCORT_PROGRESS:
_encounterProgress = data;
SaveToDB();
if (_encounterProgress < data)
{
_encounterProgress = data;
SaveToDB();
}
break;
case DATA_BOMBS_PLACED:
{

View File

@@ -261,6 +261,15 @@ struct boss_kiggler_the_crazed : public ScriptedAI
instance->SetBossState(DATA_MAULGAR, NOT_STARTED);
}
void AttackStart(Unit* who) override
{
if (!who)
return;
if (me->Attack(who, true))
me->GetMotionMaster()->MoveChase(who, 25.0f);
}
void JustEngagedWith(Unit* /*who*/) override
{
me->SetInCombatWithZone();

View File

@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Player.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "SpellInfo.h"
@@ -47,6 +48,7 @@ enum Spells
SPELL_BLAZE = 30541,
SPELL_BLAZE_SUMMON = 30542,
SPELL_BERSERK = 27680,
SPELL_SHADOW_GRASP = 30410,
SPELL_SHADOW_GRASP_VISUAL = 30166,
SPELL_MIND_EXHAUSTION = 44032,
SPELL_QUAKE = 30657,
@@ -327,10 +329,29 @@ class spell_magtheridon_quake : public SpellScript
}
};
class go_manticron_cube : public GameObjectScript
{
public:
go_manticron_cube() : GameObjectScript("go_manticron_cube") { }
bool OnGossipHello(Player* player, GameObject* /*go*/) override
{
if (player->HasAura(SPELL_MIND_EXHAUSTION) || player->HasAura(SPELL_SHADOW_GRASP))
return true;
if (Creature* trigger = player->FindNearestCreature(NPC_HELLFIRE_RAID_TRIGGER, 10.0f))
trigger->CastSpell(nullptr, SPELL_SHADOW_GRASP_VISUAL);
player->CastSpell((Unit*)nullptr, SPELL_SHADOW_GRASP, true);
return true;
}
};
void AddSC_boss_magtheridon()
{
RegisterMagtheridonsLairCreatureAI(boss_magtheridon);
RegisterSpellScript(spell_magtheridon_blaze);
RegisterSpellScript(spell_magtheridon_shadow_grasp);
RegisterSpellScript(spell_magtheridon_quake);
new go_manticron_cube();
}

View File

@@ -39,7 +39,8 @@ enum NpcIds
{
NPC_MAGTHERIDON = 17257,
NPC_HELLFIRE_CHANNELER = 17256,
NPC_HELLFIRE_WARDER = 18829
NPC_HELLFIRE_WARDER = 18829,
NPC_HELLFIRE_RAID_TRIGGER = 17376,
};
enum GoIds

View File

@@ -429,38 +429,6 @@ public:
};
};
/*######
## npc_rotting_forest_rager
######*/
class npc_rotting_forest_rager : public CreatureScript
{
public:
npc_rotting_forest_rager() : CreatureScript("npc_rotting_forest_rager") { }
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_rotting_forest_ragerAI(creature);
}
struct npc_rotting_forest_ragerAI : public ScriptedAI
{
npc_rotting_forest_ragerAI(Creature* creature) : ScriptedAI(creature) { }
void Reset() override { }
void JustEngagedWith(Unit* /*who*/) override { }
void DamageTaken(Unit* done_by, uint32& damage, DamageEffectType, SpellSchoolMask) override
{
if (done_by && done_by->GetTypeId() == TYPEID_PLAYER)
if (me->GetHealth() <= damage)
if (rand() % 100 < 75)
//Summon Lots of Wood Mights
DoCast(me, 39134, true);
}
};
};
/*######
## npc_isla_starmane
######*/
@@ -714,7 +682,6 @@ void AddSC_terokkar_forest()
// Theirs
new npc_unkor_the_ruthless();
new npc_rotting_forest_rager();
new npc_isla_starmane();
new go_skull_pile();
new npc_slim();