PlayerInGuildParty criteria and delve code fix

This commit is contained in:
luis
2026-11-08 08:19:49 -03:00
parent 3b92be628a
commit dabc54d2a1
2 changed files with 61 additions and 3 deletions
@@ -28,7 +28,7 @@
#include "GameEventMgr.h"
#include "GameTime.h"
#include "Garrison.h"
#include "Group.h"
#include "ObjectAccessor.h"
#include "InstanceScript.h"
#include "Item.h"
#include "ItemBonusMgr.h"
@@ -2251,8 +2251,32 @@ bool CriteriaHandler::ModifierSatisfied(ModifierTreeEntry const* modifier, uint6
return false;
break;
}
case ModifierTreeType::PlayerInGuildParty: // 61 NYI
return false;
case ModifierTreeType::PlayerInGuildParty: // 61
{
Group* group = referencePlayer->GetGroup();
if (!group || referencePlayer->GetGuildId() == 0)
return false;
bool hasGuildMate = false;
for (Group::MemberSlot const& slot : group->GetMemberSlots())
{
if (slot.guid == referencePlayer->GetGUID())
continue;
Player* member = ObjectAccessor::FindPlayer(slot.guid);
if (!member)
continue;
if (member->GetGuildId() != referencePlayer->GetGuildId())
return false;
hasGuildMate = true;
}
if (!hasGuildMate)
return false;
break;
}
case ModifierTreeType::PlayerGuildReputationEqualOrGreaterThan: // 62
if (referencePlayer->GetReputationMgr().GetReputation(1168) < int32(reqValue))
return false;
@@ -27,6 +27,8 @@
#include "delves_common.h"
#include "DB2Structure.h"
#include "InstanceScenario.h"
#include "Log.h"
#include "Map.h"
#include "ScriptMgr.h"
@@ -46,6 +48,12 @@ enum CollegiateCalamityIds : uint32
{
NPC_VOIDSCORNED_VAGRANT = 254773, // "Voidscorned Vagrant" - final boss (DungeonEncounter 3404)
DUNGEON_ENCOUNTER_VAGRANT = 3404, // SMSG_ENCOUNTER_START/END + SMSG_BOSS_KILL
// Scenario 3187 step 0: "Speak with Bloomkeeper Thornflare". The NPC (251541) never appears in the
// 12.1.0.70783 capture, so there is no observed gossip/spell trigger for it - complete the step
// automatically when it becomes current instead of leaving the delve soft-locked.
SCENARIO_STEP_BLOOMKEEPER = 16112,
NPC_BLOOMKEEPER_THORNFLARE = 251541,
};
// Boss death position (8704.081, -4310.297, 97.217) is used as fallback for completion objects.
@@ -95,10 +103,36 @@ public:
Delves::DelveInstanceScript::OnUnitDeath(unit);
}
void OnScenarioStepChanged(ScenarioStepEntry const* step) override
{
// "Speak with Bloomkeeper Thornflare" (step 16112): NPC 251541 has no captured interaction
// and may not be spawned, so advance the scenario as soon as the step goes live.
if (step && step->ID == SCENARIO_STEP_BLOOMKEEPER)
ForceCompleteCurrentScenarioStep();
}
bool IsFinalBoss(Creature const* creature) const override
{
return creature->GetEntry() == NPC_VOIDSCORNED_VAGRANT;
}
private:
void ForceCompleteCurrentScenarioStep()
{
if (InstanceMap* instanceMap = instance->ToInstanceMap())
{
if (InstanceScenario* scenario = instanceMap->GetInstanceScenario())
{
ScenarioStepEntry const* currentStep = scenario->GetStep();
if (currentStep)
{
TC_LOG_DEBUG("scripts.delve", "Collegiate Calamity: Force-completing scenario step {}", currentStep->ID);
scenario->SetStepState(currentStep, SCENARIO_STEP_DONE);
scenario->CompleteStep(currentStep);
}
}
}
}
};
InstanceScript* GetInstanceScript(InstanceMap* map) const override