Skip to content

Commit

Permalink
Botanica - add intro trigger for bloodwarder protector group running … (
Browse files Browse the repository at this point in the history
#674)

* Botanica - add intro trigger for bloodwarder protector group running out of laj room

* readd gm check
  • Loading branch information
miraco authored May 13, 2024
1 parent c161407 commit da4e32f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ enum BotanicaActions
BOTANICA_TRIGGER_BLOODWARDER_PROTECTOR_02,
BOTANICA_TRIGGER_BLOODWARDER_PROTECTOR_03,
BOTANICA_TRIGGER_BLOODWARDER_PROTECTOR_04,
BOTANICA_TRIGGER_BLOODWARDER_PROTECTOR_05,
BOTANICA_ACTION_MAX,
};

Expand All @@ -36,6 +37,8 @@ instance_botanica::instance_botanica(Map* map) : ScriptedInstance(map)
auto posCheckTrigger03 = [](Unit const* unit) -> bool { return unit->GetPositionY() > 219.038f; };
// trigger 4 X: -8.046078 Y: 288.01355 Z: 0.2993633
auto posCheckTrigger04 = [](Unit const* unit) -> bool { return unit->GetPositionX() > -8.046f && unit->GetPositionY() > 288.013f; };
// trigger 5 X: -157.25734, Y: 498.22766, Z:-17.824787,
auto posCheckTrigger05 = [](Unit const* unit) -> bool { return unit->GetPositionX() < -157.257f && unit->GetPositionY() < 498.22f; };

auto successEvent01 = [&]()
{
Expand Down Expand Up @@ -96,10 +99,26 @@ instance_botanica::instance_botanica(Map* map) : ScriptedInstance(map)
}
}
};

auto successEvent05 = [&]()
{
auto m_bloodwarderGroup = instance->GetCreatures(SEVEN_BLOODWARDER_STRING);
if (m_bloodwarderGroup != nullptr)
{
for (Creature* creature : *m_bloodwarderGroup)
{
if (!creature->IsAlive())
continue;

creature->GetMotionMaster()->MoveWaypoint();
}
}
};
AddInstanceEvent(BOTANICA_TRIGGER_BLOODWARDER_PROTECTOR_01, posCheckTrigger01, successEvent01);
AddInstanceEvent(BOTANICA_TRIGGER_BLOODWARDER_PROTECTOR_02, posCheckTrigger02, successEvent02);
AddInstanceEvent(BOTANICA_TRIGGER_BLOODWARDER_PROTECTOR_03, posCheckTrigger03, successEvent03);
AddInstanceEvent(BOTANICA_TRIGGER_BLOODWARDER_PROTECTOR_04, posCheckTrigger04, successEvent04);
AddInstanceEvent(BOTANICA_TRIGGER_BLOODWARDER_PROTECTOR_05, posCheckTrigger05, successEvent05);
}

void instance_botanica::AddInstanceEvent(uint32 id, std::function<bool(Unit const*)> check, std::function<void()> successEvent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const std::string THIRD_BLOODWARDER_STRING = "BLOODWARDER_PROTECTOR_GROUP_03";
const std::string FOURTH_BLOODWARDER_STRING = "BLOODWARDER_PROTECTOR_GROUP_04";
const std::string FIFTH_BLOODWARDER_STRING = "BLOODWARDER_PROTECTOR_GROUP_05";
const std::string SIX_BLOODWARDER_STRING = "BLOODWARDER_PROTECTOR_GROUP_06";
const std::string SEVEN_BLOODWARDER_STRING = "BLOODWARDER_PROTECTOR_GROUP_07";

class instance_botanica : public ScriptedInstance, public TimerManager
{
Expand Down

0 comments on commit da4e32f

Please sign in to comment.