/* EQ2Emulator: Everquest II Server Emulator Copyright (C) 2007 EQ2EMulator Development Team (http://www.eq2emulator.net) This file is part of EQ2Emulator. EQ2Emulator is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. EQ2Emulator is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with EQ2Emulator. If not, see . */ #ifndef __HEROICOP_H__ #define __HEROICOP_H__ #include #include #include "../../common/types.h" using namespace std; struct HeroicOPStarter { int32 id; int8 start_class; int16 starter_icon; int16 abilities[6]; }; struct HeroicOPWheel { int8 order; int16 shift_icon; float chance; int16 abilities[6]; int32 spell_id; }; class HeroicOP { public: HeroicOP(); ~HeroicOP(); /// Sets the complete flag for this Heroic OP /// The value to set the complete flag to, 1 = failed 2 = finished void SetComplete(int8 val) { m_complete = val; } /// Sets the current stage of the starter chain or the wheel chain is at /// The stage to set this Heroic OP to void SetStage(int8 val) { m_currentStage = val; } /// Sets the wheel for this Heroic OP /// The wheel we are setting the Heroic OP to void SetWheel(HeroicOPWheel* val); /// Sets the start time for the wheel /// Value to set the start time to void SetStartTime(int32 val) { m_startTime = val; } /// Sets the total time to complete the wheel /// Value to set the total time to void SetTotalTime(float val) { m_totalTime = val; } /// Sets the target of this HO /// The ID of the spawn void SetTarget(int32 val); /// Gets the complete flag for this Heroic OP /// 0 = not complete, 1 = complete, 2+= failed int8 GetComplete() { return m_complete; } /// Gets the wheel for this heroic op HeroicOPWheel* GetWheel() { return m_wheel; } /// Gets a pointer to the list of starter chains vector* GetStarterChains() { return &starters; } /// Gets the current stage the HO is on int8 GetStage() { return m_currentStage; } /// Gets the start time for the wheel int32 GetStartTime() { return m_startTime; } /// Gets the total time players have to complete the wheel float GetTotalTime() { return m_totalTime; } /// Gets the ID of this HO's target int32 GetTarget() { return m_target; } /// bool HasShifted() { return m_shifted; } /// Checks to see if the given icon will advance the Heroic OP /// The icon that is trying to advance the Heroic OP /// True if the icon advanced the HO bool UpdateHeroicOP(int16 icon); /// Reset the stage to 0 void ResetStage() { m_currentStage = 0; } /// Adds a starter chain to the Heroic OP /// The starter chain to add void AddStarterChain(HeroicOPStarter* starter); /// Attempts to shift the wheel bool ShiftWheel(); int8 countered[6]; private: int8 m_complete; int8 m_currentStage; int32 m_startTime; float m_totalTime; int32 m_target; bool m_shifted; HeroicOPWheel* m_wheel; vector starters; }; class MasterHeroicOPList { public: MasterHeroicOPList(); ~MasterHeroicOPList(); /// Adds the starter chain to the list /// Class id for the starter chain /// Starter chain to add void AddStarter(int8 start_class, HeroicOPStarter* starter); /// Add the wheel chain to the list /// Id of the starter this wheel belongs to /// Wheel to add void AddWheel(int32 starter_id, HeroicOPWheel* wheel); /// Creates a new HO /// Class ID starting the HO HeroicOP* GetHeroicOP(int8 class_id); /// Gets a random wheel from the given starter /// The starter to determine what wheels to choose from HeroicOPWheel* GetWheel(HeroicOPStarter* starter); private: // map > > map > > m_hoList; }; #endif