Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2024-08-12 01:07:20 +08:00
44 changed files with 433 additions and 305 deletions

View File

@@ -68,22 +68,22 @@ public:
if (!enableArg)
{
if (!AccountMgr::IsPlayerAccount(session->GetSecurity()) && session->GetPlayer()->isGMChat())
session->SendNotification(LANG_GM_CHAT_ON);
handler->SendNotification(LANG_GM_CHAT_ON);
else
session->SendNotification(LANG_GM_CHAT_OFF);
handler->SendNotification(LANG_GM_CHAT_OFF);
return true;
}
if (*enableArg)
{
session->GetPlayer()->SetGMChat(true);
session->SendNotification(LANG_GM_CHAT_ON);
handler->SendNotification(LANG_GM_CHAT_ON);
return true;
}
else
{
session->GetPlayer()->SetGMChat(false);
session->SendNotification(LANG_GM_CHAT_OFF);
handler->SendNotification(LANG_GM_CHAT_OFF);
return true;
}
}
@@ -206,14 +206,14 @@ public:
_player->SetGMVisible(true);
_player->UpdateObjectVisibility();
handler->GetSession()->SendNotification(LANG_INVISIBLE_VISIBLE);
handler->SendNotification(LANG_INVISIBLE_VISIBLE);
}
else
{
_player->AddAura(VISUAL_AURA, _player);
_player->SetGMVisible(false);
_player->UpdateObjectVisibility();
handler->GetSession()->SendNotification(LANG_INVISIBLE_INVISIBLE);
handler->SendNotification(LANG_INVISIBLE_INVISIBLE);
}
return true;
@@ -223,7 +223,7 @@ public:
{
handler->GetPlayer()->SetGameMaster(true);
handler->GetPlayer()->UpdateTriggerVisibility();
handler->GetSession()->SendNotification(LANG_GM_ON);
handler->SendNotification(LANG_GM_ON);
return true;
}
@@ -231,7 +231,7 @@ public:
{
handler->GetPlayer()->SetGameMaster(false);
handler->GetPlayer()->UpdateTriggerVisibility();
handler->GetSession()->SendNotification(LANG_GM_OFF);
handler->SendNotification(LANG_GM_OFF);
return true;
}
};

View File

@@ -77,7 +77,7 @@ public:
if (WorldSession* session = handler->GetSession())
name = session->GetPlayer()->GetName();
sWorld->SendGMText(LANG_GM_ANNOUNCE_COLOR, name.c_str(), message.data());
handler->SendGMText(LANG_GM_ANNOUNCE_COLOR, name, message.data());
return true;
}
@@ -92,12 +92,12 @@ public:
}
// announce to logged in GMs
static bool HandleGMAnnounceCommand(ChatHandler* /*handler*/, Tail message)
static bool HandleGMAnnounceCommand(ChatHandler* handler, Tail message)
{
if (message.empty())
return false;
sWorld->SendGMText(LANG_GM_BROADCAST, message.data());
handler->SendGMText(LANG_GM_BROADCAST, message.data());
return true;
}

View File

@@ -464,7 +464,7 @@ public:
auto SetCommentatorMod = [&](bool enable)
{
session->SendNotification(enable ? "Commentator mode on" : "Commentator mode off");
handler->SendNotification(enable ? "Commentator mode on" : "Commentator mode off");
session->GetPlayer()->SetCommentator(enable);
};
@@ -508,7 +508,7 @@ public:
auto SetDevMod = [&](bool enable)
{
session->SendNotification(enable ? LANG_DEV_ON : LANG_DEV_OFF);
handler->SendNotification(enable ? LANG_DEV_ON : LANG_DEV_OFF);
session->GetPlayer()->SetDeveloper(enable);
sScriptMgr->OnHandleDevCommand(handler->GetSession()->GetPlayer(), enable);
};

View File

@@ -77,7 +77,8 @@ public:
static ChatCommandTable morphCommandTable =
{
{ "reset", HandleMorphResetCommand, SEC_MODERATOR, Console::No },
{ "target", HandleMorphTargetCommand, SEC_MODERATOR, Console::No }
{ "target", HandleMorphTargetCommand, SEC_MODERATOR, Console::No },
{ "mount", HandleMorphMountCommand, SEC_MODERATOR, Console::No }
};
static ChatCommandTable commandTable =
@@ -868,6 +869,21 @@ public:
return true;
}
static bool HandleMorphMountCommand(ChatHandler* handler, uint32 displayID)
{
Player* target = handler->getSelectedPlayerOrSelf();
if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer())) // check online security
return false;
if (!target->GetAuraEffectsByType(SPELL_AURA_MOUNTED).empty())
target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, displayID);
else
return false;
return true;
}
//set temporary phase mask for player
static bool HandleModifyPhaseCommand(ChatHandler* handler, uint32 phaseMask)
{

View File

@@ -16,6 +16,7 @@
*/
#include "CreatureScript.h"
#include "GridNotifiers.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
@@ -145,7 +146,12 @@ class spell_anetheron_sleep : public SpellScript
void FilterTargets(std::list<WorldObject*>& targets)
{
if (!targets.empty())
{
if (Unit* victim = GetCaster()->GetVictim())
targets.remove_if(Acore::ObjectGUIDCheck(victim->GetGUID(), true));
Acore::Containers::RandomResize(targets, 3);
}
}
void Register() override

View File

@@ -143,10 +143,10 @@ class spell_mother_shahraz_random_periodic_aura : public AuraScript
return ValidateSpellInfo({ SPELL_SINFUL_PERIODIC, SPELL_SINISTER_PERIODIC, SPELL_VILE_PERIODIC, SPELL_WICKED_PERIODIC });
}
void Update(AuraEffect const* /*effect*/)
void Update(AuraEffect const* effect)
{
PreventDefaultAction();
if (GetUnitOwner())
if (GetUnitOwner() && (effect->GetTickNumber() % 6 == 1 || effect->GetTickNumber() == 1)) // Reapplies 12-18s after the third beam
GetUnitOwner()->CastSpell(GetUnitOwner(), RAND(SPELL_SINFUL_PERIODIC, SPELL_SINISTER_PERIODIC, SPELL_VILE_PERIODIC, SPELL_WICKED_PERIODIC), true);
}

View File

@@ -2221,6 +2221,11 @@ struct dragonmaw_race_npc : public ScriptedAI
}
}
void PathEndReached(uint32 /*pathId*/) override
{
Reset();
}
void UpdateAI(uint32 diff) override
{
scheduler.Update(diff);

View File

@@ -16,6 +16,7 @@
*/
#include "CellImpl.h"
#include "Chat.h"
#include "CreatureScript.h"
#include "GameEventMgr.h"
#include "GameObjectAI.h"
@@ -1081,7 +1082,7 @@ public:
if (player->GetQuestRewardStatus(QUEST_TELE_CRYSTAL_FLAG))
return false;
player->GetSession()->SendNotification(GO_TELE_TO_DALARAN_CRYSTAL_FAILED);
ChatHandler(player->GetSession()).SendNotification(GO_TELE_TO_DALARAN_CRYSTAL_FAILED);
return true;
}
@@ -1599,7 +1600,7 @@ public:
else
{
CloseGossipMenuFor(player);
player->GetSession()->SendNotification(GO_ANDERHOLS_SLIDER_CIDER_NOT_FOUND);
ChatHandler(player->GetSession()).SendNotification(GO_ANDERHOLS_SLIDER_CIDER_NOT_FOUND);
return false;
}
}