Jump to content
  • Instance MC Saving


    Arkadus
    • Status: In Progress
      Main Category: Script (Eluna / SD3)
      Sub-Category: sd2
      Version: 0.20 Milestone: 20 Priority: Normal
      Implemented Version: 0.20

    Instance MC Saving

    Instance MC .cpp

    void instance_molten_core::OnCreatureCreate(Creature* pCreature)
    {
    switch (pCreature->GetEntry())
    {
    case NPC_LUCIFRON:
    if (m_auiEncounter[TYPE_GARR] == DONE)
    {
    pCreature->Despawn();
    break;
    }
    case NPC_MAGMADAR:
    if (m_auiEncounter[TYPE_MAGMADAR] == DONE)
    {
    pCreature->Despawn();
    break;
    }
    case NPC_GEHENNAS:
    if (m_auiEncounter[TYPE_GEHENNAS] == DONE)
    {
    pCreature->Despawn();
    break;
    }
    case NPC_GARR:
    if (m_auiEncounter[TYPE_GARR] == DONE)
    {
    pCreature->Despawn();
    break;
    }
    case NPC_SHAZZRAH:
    if (m_auiEncounter[TYPE_SHAZZRAH] == DONE)
    {
    pCreature->Despawn();
    break;
    }
    case NPC_GEDDON:
    if (m_auiEncounter[TYPE_GEDDON] == DONE)
    {
    pCreature->Despawn();
    break;
    }
    case NPC_GOLEMAGG:
    if (m_auiEncounter[TYPE_GOLEMAGG] == DONE)
    {
    pCreature->Despawn();
    break;
    }
    case NPC_SULFURON:
    if (m_auiEncounter[TYPE_SULFURON] == DONE)
    {
    pCreature->Despawn();
    break;
    }
    case NPC_MAJORDOMO:
    if (m_auiEncounter[TYPE_MAJORDOMO] == DONE)
    {
    pCreature->Despawn();
    break;
    }
    case TYPE_RAGNAROS:
    if (m_auiEncounter[TYPE_RAGNAROS] == DONE)
    {
    pCreature->Despawn();
    break;
    }
    m_mNpcEntryGuidStore[pCreature->GetEntry()] = pCreature->GetObjectGuid();
    break;
    }
    }


    Instance MC .h header

    enum
    {
    MAX_ENCOUNTER = 10,

    TYPE_LUCIFRON = 0,
    TYPE_MAGMADAR = 1,
    TYPE_GEHENNAS = 2,
    TYPE_GARR = 3,
    TYPE_SHAZZRAH = 4,
    TYPE_GEDDON = 5,
    TYPE_GOLEMAGG = 6,
    TYPE_SULFURON = 7,
    TYPE_MAJORDOMO = 8,
    TYPE_RAGNAROS = 9,

    NPC_LUCIFRON = 12118,
    NPC_MAGMADAR = 11982,
    NPC_GEHENNAS = 12259,
    NPC_GARR = 12057,
    NPC_SHAZZRAH = 12264,
    NPC_GEDDON = 12056,
    NPC_GOLEMAGG = 11988,
    NPC_SULFURON = 12098,
    NPC_MAJORDOMO = 12018,
    NPC_RAGNAROS = 11502,

    // Adds
    // Used for respawn in case of wipe
    NPC_FLAMEWAKER_PROTECTOR = 12119, // Lucifron
    NPC_FLAMEWAKER = 11661, // Gehennas
    NPC_FIRESWORN = 12099, // Garr
    NPC_CORE_RAGER = 11672, // Golemagg
    NPC_FLAMEWAKER_PRIEST = 11662, // Sulfuron
    NPC_FLAMEWAKER_HEALER = 11663, // Majordomo
    NPC_FLAMEWAKER_ELITE = 11664, // Majordomo

    GO_LAVA_STEAM = 178107,
    GO_LAVA_SPLASH = 178108,
    GO_CACHE_OF_THE_FIRE_LORD = 179703,
    GO_RUNE_KRESS = 176956, // Magmadar
    GO_RUNE_MOHN = 176957, // Gehennas
    GO_RUNE_BLAZ = 176955, // Garr
    GO_RUNE_MAZJ = 176953, // Shazzah
    GO_RUNE_ZETH = 176952, // Geddon
    GO_RUNE_THERI = 176954, // Golemagg
    GO_RUNE_KORO = 176951, // Sulfuron

    MAX_MOLTEN_RUNES = 7,
    MAX_MAJORDOMO_ADDS = 8,
    FACTION_MAJORDOMO_FRIENDLY = 1080,
    SAY_MAJORDOMO_SPAWN = -1409004,
    };

    struct sRuneEncounters
    {
    uint32 m_uiRuneEntry, m_uiType;
    };

    static const sRuneEncounters m_aMoltenCoreRunes[MAX_MOLTEN_RUNES] =
    {
    {GO_RUNE_KRESS, TYPE_MAGMADAR},
    {GO_RUNE_MOHN, TYPE_GEHENNAS},
    {GO_RUNE_BLAZ, TYPE_GARR},
    {GO_RUNE_MAZJ, TYPE_SHAZZRAH},
    {GO_RUNE_ZETH, TYPE_GEDDON},
    {GO_RUNE_THERI, TYPE_GOLEMAGG},
    {GO_RUNE_KORO, TYPE_SULFURON}
    };

    struct sSpawnLocation
    {
    uint32 m_uiEntry;
    float m_fX, m_fY, m_fZ, m_fO;
    };

    static sSpawnLocation m_aMajordomoLocations[2] =
    {
    {NPC_MAJORDOMO, 758.089f, -1176.71f, -118.640f, 3.12414f}, // Summon fight position
    {NPC_MAJORDOMO, 847.103f, -816.153f, -229.775f, 4.344f} // Summon and teleport location (near Ragnaros)
    };

    class instance_molten_core : public ScriptedInstance
    {
    public:
    instance_molten_core(Map* pMap);
    ~instance_molten_core() {}

    void Initialize() override;
    bool IsEncounterInProgress() const override;

    void OnCreatureCreate(Creature* pCreature) override;
    void OnObjectCreate(GameObject* pGo) override;
    void OnPlayerEnter(Player* pPlayer) override;

    void SetData(uint32 uiType, uint32 uiData) override;
    uint32 GetData(uint32 uiType) const override;

    const char* Save() const override { return m_strInstData.c_str(); }
    void Load(const char* chrIn) override;

    protected:
    void DoSpawnMajordomoIfCan(bool bByPlayerEnter);

    std::string m_strInstData;
    uint32 m_auiEncounter[MAX_ENCOUNTER];
    };

    #endif


    User Feedback

    Recommended Comments

    There is an error here aswell where it says;


    switch (pCreature->GetEntry())
    {
    case NPC_LUCIFRON:
    if (m_auiEncounter[TYPE_GARR] == DONE)
    {
    pCreature->Despawn();
    break;
    }


    Should actually be;


    switch (pCreature->GetEntry())
    {
    case NPC_LUCIFRON:
    if (m_auiEncounter[TYPE_LUCIFRON] == DONE)
    {
    pCreature->Despawn();
    break;
    }

    Link to comment
    Share on other sites



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use