mirror of
https://github.com/ZhengPeiRu21/mod-individual-progression
synced 2025-11-29 23:44:51 +08:00
Fix IndividualProgression chat commands
This commit is contained in:
@@ -18,7 +18,7 @@ bool IndividualProgression::hasPassedProgression(Player* player, ProgressionStat
|
|||||||
return player->GetPlayerSetting("mod-individual-progression", SETTING_PROGRESSION_STATE).value >= state;
|
return player->GetPlayerSetting("mod-individual-progression", SETTING_PROGRESSION_STATE).value >= state;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IndividualProgression::isBeforeProgression(Player* player, ProgressionState state) const
|
bool IndividualProgression::isBeforeProgression(Player* player, ProgressionState state)
|
||||||
{
|
{
|
||||||
return player->GetPlayerSetting("mod-individual-progression", SETTING_PROGRESSION_STATE).value < state;
|
return player->GetPlayerSetting("mod-individual-progression", SETTING_PROGRESSION_STATE).value < state;
|
||||||
}
|
}
|
||||||
@@ -34,6 +34,11 @@ void IndividualProgression::UpdateProgressionState(Player* player, ProgressionSt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IndividualProgression::ForceUpdateProgressionState(Player* player, ProgressionState newState)
|
||||||
|
{
|
||||||
|
player->UpdatePlayerSetting("mod-individual-progression", SETTING_PROGRESSION_STATE, newState);
|
||||||
|
}
|
||||||
|
|
||||||
void IndividualProgression::CheckAdjustments(Player* player) const
|
void IndividualProgression::CheckAdjustments(Player* player) const
|
||||||
{
|
{
|
||||||
if (!enabled)
|
if (!enabled)
|
||||||
@@ -533,6 +538,25 @@ public:
|
|||||||
sIndividualProgression->CheckAdjustments(player);
|
sIndividualProgression->CheckAdjustments(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Waiting for PR: https://github.com/azerothcore/azerothcore-wotlk/pull/13046
|
||||||
|
// void OnSetMaxLevel(Player* player, uint32& maxPlayerLevel) override
|
||||||
|
// {
|
||||||
|
// if (!sIndividualProgression->hasPassedProgression(player, PROGRESSION_NAXX40))
|
||||||
|
// {
|
||||||
|
// if (sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) > 60)
|
||||||
|
// {
|
||||||
|
// maxPlayerLevel = 60;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else if (!sIndividualProgression->hasPassedProgression(player, PROGRESSION_TBC_TIER_5))
|
||||||
|
// {
|
||||||
|
// if (sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL) > 70)
|
||||||
|
// {
|
||||||
|
// maxPlayerLevel = 70;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
void OnMapChanged(Player* player) override
|
void OnMapChanged(Player* player) override
|
||||||
{
|
{
|
||||||
sIndividualProgression->CheckAdjustments(player);
|
sIndividualProgression->CheckAdjustments(player);
|
||||||
|
|||||||
@@ -121,8 +121,9 @@ public:
|
|||||||
int progressionLimit, startingProgression;
|
int progressionLimit, startingProgression;
|
||||||
|
|
||||||
bool hasPassedProgression(Player* player, ProgressionState state) const;
|
bool hasPassedProgression(Player* player, ProgressionState state) const;
|
||||||
bool isBeforeProgression(Player* player, ProgressionState state) const;
|
static bool isBeforeProgression(Player* player, ProgressionState state) ;
|
||||||
void UpdateProgressionState(Player* player, ProgressionState newState) const;
|
void UpdateProgressionState(Player* player, ProgressionState newState) const;
|
||||||
|
static void ForceUpdateProgressionState(Player* player, ProgressionState newState) ;
|
||||||
void CheckAdjustments(Player* player) const;
|
void CheckAdjustments(Player* player) const;
|
||||||
void ApplyGearStatsTuning(Player* player, float& computedAdjustment, ItemTemplate const* item) const;
|
void ApplyGearStatsTuning(Player* player, float& computedAdjustment, ItemTemplate const* item) const;
|
||||||
void ApplyGearHealthTuning(Player* player, float& computedAdjustment, ItemTemplate const* item) const;
|
void ApplyGearHealthTuning(Player* player, float& computedAdjustment, ItemTemplate const* item) const;
|
||||||
|
|||||||
@@ -33,10 +33,10 @@ public:
|
|||||||
handler->SendSysMessage("Invalid progression level.");
|
handler->SendSysMessage("Invalid progression level.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Player* target = player->GetConnectedPlayer();
|
player = PlayerIdentifier::FromTargetOrSelf(handler);
|
||||||
if (target)
|
if (player && player->GetConnectedPlayer())
|
||||||
{
|
{
|
||||||
sIndividualProgression->UpdateProgressionState(target, static_cast<ProgressionState>(progressionLevel));
|
sIndividualProgression->ForceUpdateProgressionState(player->GetConnectedPlayer(), static_cast<ProgressionState>(progressionLevel));
|
||||||
handler->SendSysMessage("Progression state updated successfully");
|
handler->SendSysMessage("Progression state updated successfully");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user