Keeper's Chest Rewrite

Yo guys, i decided to change the way the keepers bosses of ulduar spawn their chests after defeat (by using spells, not me->summongameobject function).

On thorim, mimiron, and hodir, i didn’t found any problems, however, freya is giving me a kind of headache…

By far, these are the changes i’ve made:

[CODE]diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_freya.cpp

index bf99a58…2fff854 100644

— a/src/server/scripts/Northrend/Ulduar/ulduar/boss_freya.cpp

+++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_freya.cpp

@@ -218,6 +218,11 @@ enum FreyaEvents

 EVENT_FLUX                                   = 17,

};

+#define SPELL_FREYA_CHEST_0_ELDER RAID_MODE(62950,62952)

+#define SPELL_FREYA_CHEST_1_ELDER RAID_MODE(62953,62954)

+#define SPELL_FREYA_CHEST_2_ELDER RAID_MODE(62955,62956)

+#define SPELL_FREYA_CHEST_3_ELDER RAID_MODE(62957,62958)

#define WAVE_TIME 60000 // Normal wave is one minute

#define TIME_DIFFERENCE 10000 // If difference between waveTime and WAVE_TIME is bigger then TIME_DIFFERENCE, schedule EVENT_WAVE in 10 seconds

#define DATA_GETTING_BACK_TO_NATURE 1

@@ -334,6 +339,8 @@ class boss_freya : public CreatureScript

             if (damage >= me->GetHealth() && instance)

             {

                 damage = 0;
  •   			EnterEvadeMode();
    
  •   			CAST_AI(boss_freya::boss_freyaAI,me->AI())->SummonChest();
    
                   DoScriptText(SAY_DEATH, me);
    
                   me->SetReactState(REACT_PASSIVE);
    
                   _JustDied();
    

@@ -685,6 +692,30 @@ class boss_freya : public CreatureScript

             else

                 events.RescheduleEvent(EVENT_WAVE, TIME_DIFFERENCE);

         }
  •   	uint32 GetElderCount()
    
  •   	{
    
  •   		return elderCount;
    
  •   	}
    
  •   	void SummonChest()
    
  •   	{
    
  •   		if (CAST_AI(boss_freya::boss_freyaAI,me->AI())->GetElderCount() == 0)
    
  •   		{
    
  •   			DoCast(me, SPELL_FREYA_CHEST_0_ELDER, true);
    
  •   		}
    
  •   		if (CAST_AI(boss_freya::boss_freyaAI,me->AI())->GetElderCount() == 1)
    
  •   		{
    
  •   			DoCast(me, SPELL_FREYA_CHEST_1_ELDER, true);
    
  •   		}
    
  •   		if (CAST_AI(boss_freya::boss_freyaAI,me->AI())->GetElderCount() == 2)
    
  •   		{
    
  •   			DoCast(me, SPELL_FREYA_CHEST_2_ELDER, true);
    
  •   		}
    
  •   		if (CAST_AI(boss_freya::boss_freyaAI,me->AI())->GetElderCount() == 3)
    
  •   		{
    
  •   			DoCast(me, SPELL_FREYA_CHEST_3_ELDER, true);
    
  •   		}
    
  •   	}
    
       };
    
    
       CreatureAI* GetAI(Creature* creature) const
    

diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/instance_ulduar.cpp

index c1b9128…f476890 100644

— a/src/server/scripts/Northrend/Ulduar/ulduar/instance_ulduar.cpp

+++ b/src/server/scripts/Northrend/Ulduar/ulduar/instance_ulduar.cpp

@@ -547,10 +547,16 @@ public:

             case GO_HODIR_IN_DOOR_STONE:

                 uiHodirEntranceDoorGUID = go->GetGUID();

                 break;
  •            case GO_FREYA_CHEST_HERO:
    
  •            case GO_FREYA_CHEST:
    
  •                uiFreyaChestGUID = go->GetGUID();
    
  •                break;
    
  •   	   case GO_FREYA_CHEST_0_ELDER_10:
    
  •           case GO_FREYA_CHEST_1_ELDER_10:
    
  •          case GO_FREYA_CHEST_2_ELDER_10:
    
  •   	   case GO_FREYA_CHEST_3_ELDER_10:
    
  •   	   case GO_FREYA_CHEST_0_ELDER_25:
    
  •   	   case GO_FREYA_CHEST_1_ELDER_25:
    
  •   	   case GO_FREYA_CHEST_2_ELDER_25:
    
  •   	   case GO_FREYA_CHEST_3_ELDER_25:
    
  •               uiFreyaChestGUID = go->GetGUID();
    
  •               break;
    
               case GO_LEVIATHAN_DOOR:
    
                   AddDoor(go, true);
    
                   break;
    

@@ -796,11 +809,11 @@ public:

                 if (GameObject* obj = instance->GetGameObject(uiThorimDoorGUID))

                     obj->SetGoState(state == IN_PROGRESS ? GO_STATE_READY : GO_STATE_ACTIVE);

                 break;
  •            case TYPE_FREYA:
    
  •                if (state == DONE)
    
  •                    if (GameObject* go = instance->GetGameObject(uiFreyaChestGUID))
    
  •                        go->SetRespawnTime(go->GetRespawnDelay());
    
  •                break;
    
  •   		case TYPE_FREYA:
    
  •               if (state == DONE)
    
  •                   if (GameObject* go = instance->GetGameObject(uiFreyaChestGUID))
    
  •                       go->SetRespawnTime(604800);
    
  •               break;
    
               case TYPE_ALGALON:
    
                   if (state == IN_PROGRESS)
    
                   {
    

diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/ulduar.h b/src/server/scripts/Northrend/Ulduar/ulduar/ulduar.h

index fbc8de9…0521512 100644

— a/src/server/scripts/Northrend/Ulduar/ulduar/ulduar.h

+++ b/src/server/scripts/Northrend/Ulduar/ulduar/ulduar.h

@@ -186,10 +186,14 @@ enum UlduarGameObjects

 GO_HODIR_IN_DOOR_STONE      = 194442,

 GO_HODIR_OUT_DOOR_ICE       = 194441,

 GO_HODIR_OUT_DOOR_STONE     = 194634,
  • GO_FREYA_CHEST = 194324,

  • GO_FREYA_CHEST_HERO = 194325,

  • GO_FREYA_CHEST_HARD = 194327,

  • GO_FREYA_CHEST_HERO_HARD = 194331,

  • GO_FREYA_CHEST_0_ELDER_10 = 194324,

  • GO_FREYA_CHEST_1_ELDER_10 = 194325,

  • GO_FREYA_CHEST_2_ELDER_10 = 194326,

  • GO_FREYA_CHEST_3_ELDER_10 = 194327,

  • GO_FREYA_CHEST_0_ELDER_25 = 194328,

  • GO_FREYA_CHEST_1_ELDER_25 = 194329,

  • GO_FREYA_CHEST_2_ELDER_25 = 194330,

  • GO_FREYA_CHEST_3_ELDER_25 = 194331,

    GO_LEVIATHAN_DOOR = 194905,

    GO_LEVIATHAN_GATE = 194630,

    GO_XT002_DOOR = 194631,

[/CODE]

The problem is, freya is summoning the 194324 chest at all times on 10M raid (didnt test the 25M one, but i bet its working the same way, summoning the 194328 chest) even with the 3 elders up aiding her.

Any help is appreciated /emoticons/default_tongue.png

PS: yes, i’ve added the missing GO’s templates for the chests on DB /emoticons/default_tongue.png

Welcome to one well known without fix for now bug.

Hard to believe since i’ve made the other three keepers summon their chests fine by using the correct spell only using their boolean “hard-mode” variables.

Besides, i think i’ll keep trying /emoticons/default_angry.png

^^ https://github.com/TrinityCore/TrinityCore/issues/1731 https://github.com/TrinityCore/TrinityCore/issues/1618

Those issues you linked are about summoning spells not triggering cooldowns on looted gobs, i dont have this kind of problem since to solve them you just need to set the delay on the gob on instance_script after the boss is dead /emoticons/default_laugh.png

My problem lies on hooking the value of the eldercount variable and use it as a parameter for the spellcast of the chest /emoticons/default_mellow.png

Solved /emoticons/default_tongue.png

If your solution is Blizz-like, hopefully you’ll be kind enough to share it with devs so it can included in the core…

https://github.com/Locknes/ChaosCore/commits/master/src/server/scripts/Northrend/Ulduar/ulduar/boss_freya.cpp

The three last commits is what i’ve made, however i dont think the devs will pull that to the core.