PDA

View Full Version : TrinityCore 3.3.5 [SunwellCore] Blackwing Lair



Render1982
10-02-2016, 10:03 PM
Hey guys, I am creating a Vanilla in WOTLK type of server and using SunwellCore is great with all the instances scripted and working. However, BWL is available and works and is clearable except Razorgore. You would click on the orb and the spell Destory Egg doesn't work. I've tried using official TC script and spent over ~72 hours attempting to do this and I would like to seek some insight if anyone know if it works. Also the spell that the mind control is using is the wrong spell in both TC and SWC. I tried using the official spellid from MangosZero but it seems that the spell has a script itself needs editing possibly.

Any help or guides in the right direction would be phenomenal!

-Render

UPDATE:
Eggs now properly despawn but still wrong spell and razegore doesn't change phases.

Render1982
10-04-2016, 09:20 PM
I think I got it somewhat fixed haven't tested.

blackwing_lair.h


enum BWLMisc
{
EGGS_NEEDED = 15,

// Razorgore Egg Event
ACTION_PHASE_TWO = 1,
DATA_EGG_EVENT
};

#endif


instance_blackwing_lair.cpp (This EggCount is completely seperate from boss_razorgore.cpp I've tried :^^])


void SetData(uint32 type, uint32 data)
{
if (type == DATA_EGG_EVENT)
{
switch (data)
{
case IN_PROGRESS:
_events.ScheduleEvent(EVENT_RAZOR_SPAWN, 45 * IN_MILLISECONDS);
EggEvent = data;
EggCount = 0;
break;
case NOT_STARTED:
_events.CancelEvent(EVENT_RAZOR_SPAWN);
EggEvent = data;
EggCount = 0;
break;
case SPECIAL:
if (++EggCount == EGGS_NEEDED)
{
if (Creature* razor = instance->GetCreature(RazorgoreTheUntamedGUID))
{
SetData(DATA_EGG_EVENT, DONE);
razor->RemoveAurasDueToSpell(42013); // MindControl
DoRemoveAurasDueToSpellOnPlayers(42013);
}
_events.ScheduleEvent(EVENT_RAZOR_PHASE_TWO, IN_MILLISECONDS);
_events.CancelEvent(EVENT_RAZOR_SPAWN);
}
if (EggEvent == NOT_STARTED)
SetData(DATA_EGG_EVENT, IN_PROGRESS);
break;
}
}
}


boss_razorgore.cpp


class spell_egg_event : public SpellScriptLoader
{
public:
spell_egg_event() : SpellScriptLoader("spell_egg_event") { }

class spell_egg_eventSpellScript : public SpellScript
{
PrepareSpellScript(spell_egg_eventSpellScript);
uint8 EggCount = 0;

void HandleOnHit()
{
if (InstanceScript* instance = GetCaster()->GetInstanceScript())
instance->SetData(DATA_EGG_EVENT, SPECIAL);

if (InstanceScript* instance = GetCaster()->GetInstanceScript()) {
if (GameObject* egg = GetCaster()->FindNearestGameObject(GO_EGG, 100))
{
egg->SetLootState(GO_READY);
egg->UseDoorOrButton(10 * IN_MILLISECONDS);
EggCount++;
}

if (EggCount == EGGS_NEEDED) // If all the eggs are gone then activate phase 2.
{
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_MINDCONTROL );
}
}
}

void Register()
{
OnHit += SpellHitFn(spell_egg_eventSpellScript::HandleOnHit );
}
};

SpellScript* GetSpellScript() const
{
return new spell_egg_eventSpellScript();
}
};

Render1982
10-19-2016, 12:11 PM
Fixed marked as solved