I'm currently working on a boss script which is some kind of "council", basically there are 3 separate bosses. I've tried looking at some other scripts where the fight has several bosses but I can't really figure out what I need to know.
So what I got is one script boss_council.cpp which inside of I've initialized the 3 bosses. The basic skeleton for all 3 look like this:
Code:
class boss_the_chancellor : public CreatureScript
{
public:
boss_council_member() : CreatureScript("boss_council_member") { }
struct boss_council_memberAI : public ScriptedAI
{
boss_council_memberAI(Creature* creature) : ScriptedAI(creature)
{
}
void Reset() override
{
}
void JustRespawned() override
{
}
void EnterCombat(Unit* /*who*/) override
{
}
void JustDied(Unit* /*killer*/) override
{
}
void UpdateAI(uint32 diff) override
{
// Return since we have no target
if (!UpdateVictim())
return;
_events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = _events.ExecuteEvent())
{
std::list<Unit*> targets;
switch (eventId)
{
default:
break;
}
}
DoMeleeAttackIfReady();
}
private:
EventMap _events;
};
CreatureAI* GetAI(Creature* creature) const override
{
return new boss_council_memberAI(creature);
}
};
And basically what I'm trying to accomplish is:
- Link the bosses so that if you cast a spell on one of the bosses, all 3 will enter combat with you.
- Link the bosses so that you can't loot them until all 3 are dead
For #1 I tried using me->CallAssistance(); in the EnterCombat hook for all 3 bosses, however it doesn't seem to be working so I need another solution.
Also, like I said before I took a look at some other similar bosses, but they're all instanced ones and I can't figure out how to transfer what I found onto my own bosses, so any help is greatly appreciated.