#pragma once //_NA_005026_20120527_CHAOS_ZONE_BATTLE_GROUND #include #include #include class Player; class PVPInfo; struct BattleGroundInfo; class BattleGroundTeam; struct StrongpointTrigger { DWORD strongpoint_id; // Æ®¸®°Å ¾ÆÀ̵ð DWORD sealing_player_key; // Æ®¸®°Å ÀÛµ¿ Ç÷¹À̾î Ű DWORD sealing_success_player_key; // °¢ÀÎ ¼º°øÇÑ Ç÷¹À̾î Ű bool is_start_sealing; // °¢ÀÎ ½ÃÀÛ ¿©ºÎ bool is_sealing; // °¢ÀÎ ¼º°ø ¿©ºÎ bool is_conquer; // Á¡·É ¼º°ø¿©ºÎ ChaosZoneTeam conquer_wait_team_key; // Á¡·É ´ë±â¿¡ ¼º°øÇÑ ÆÀ Ű ChaosZoneTeam conquer_team_key; // Á¡·É ¼º°øÇÑ ÆÀ Ű BattleGroundStrongpointState trigger_state; // Æ®¸®°Å »óÅ util::Timer sealing_timer; // °¢ÀÎ ½Ã°£ util::Timer conquer_wait_timer; // Á¡·É´ë±â ½Ã°£ StrongpointTrigger() : strongpoint_id(0), sealing_player_key(0), sealing_success_player_key(0), is_start_sealing(false), is_sealing(false), is_conquer(false), conquer_wait_team_key(kChaosZoneTeamNone), conquer_team_key(kChaosZoneTeamNone), trigger_state(kStrongpointStateNone) { } }; typedef STLX_HASH_MAP STRONGPOINT_TRIGGER_HASH; class BattleGround : public ChaosZone { enum{ kSecond = 1000, }; enum BattleGroundState { kNone = 0, kAllEnterWait, // Ç÷¹À̾ ´Ù µé¾î¿À±æ ±â´Ù¸®´Â »óÅ kPrepareWait, // Áغñ ´ë±â »óÅ kMatch, // ÀüÀå ÁøÇà »óÅ kResult, // °á°ú »óÅ kEnd // Á¾·á »óÅ }; enum { kTeamMax = 3, }; public: BattleGround() : battle_ground_state_(kNone), winner_team_key_(kChaosZoneTeamNone), battle_ground_Info_(NULL), battle_ground_battle_result_(NULL), is_count_message_(false) { } virtual ~BattleGround(){} void Init(GameInstanceDungeon* const instance_dungeon); void Release(); void Update(); //enter void EnterTeam(const ChaosZoneTeam team_key, const BYTE player_count, DWORD* user_key_list); #ifdef _NA_008679_20160202_REWORK_BATTLEGROUND virtual void EnterTeam(MSG_AG_BATTLE_GROUND_ENTER_TEAM_CMD* cmd_msg); VOID SetTeamFalseOption(Player* const player); SLOTCODE GetTeamFalseCostumeCode(Player* const player); ChaosZoneTeam GetPlayerTeamKey(Player* const player); #endif //_NA_008679_20160202_REWORK_BATTLEGROUND bool EnterPlayer(Player* const player); void LeavePlayer(Player* const player); //pvp °ü·Ã void DeadCharacter(Character* const dead_character, Character* const kill_character); eUSER_RELATION_TYPE IsFriendPVP(Player* attacker,Player* target); // °ÅÁ¡ °ü·Ã bool StartSealing(Player* player, WzID collection_id); void CancelSealing(Player* player, WzID collection_id); void SuccessSealing(Player* player, WzID collection_id); bool CanCheckSealing(Player* player, WzID collection_id) const; void BattleGroundPenalty(Player* player); #ifdef _NA_006800_20130703_BATTLE_GROUND_VOTE_SYSTEM bool IsCanVoteByVictoryPoint(); RC::eBATTLE_GROUND_RESULT OnInitiateVote(Player* initiate_player, Player* van_payer); void OnVote(Player* player, bool vote_result); void SendPacketToAll(MSG_BASE_FORWARD* msg, WORD msg_size); #endif //_ NA_006800_20130703_BATTLE_GROUND_VOTE_SYSTEM inline DWORD GetRemainTicks() const {return resurrection_timer_.GetRemainTicks(); } inline BattleGroundBattleResult* GetBattleGroundBattleResult() const { return battle_ground_battle_result_; } inline Player* FindBattleGroundMember(const CHARGUID CharGuid) { PLAYER_HASH::iterator itr = player_hash_.find(CharGuid); if (itr == player_hash_.end()) { return NULL; } return itr->second; } #ifdef _NA_008679_20160202_REWORK_BATTLEGROUND Player* FindBattleGroundMemberByFalseName(TCHAR* _false_name); #endif //_NA_008679_20160202_REWORK_BATTLEGROUND inline BattleGroundTeam* GetTeam(ChaosZoneTeam team) { return _FindTeam(team); } BattleGroundTeam* FindReadyTeam(Player* const player); private: //match void _StartWait(); void _Start(); bool _IsAllPlayerEntered(); void _SentToAllTeamInfo(); void _LoadTrigger(); void _UpdateStrongpoint(); void _IncreaseVictoryPoint(); void _Result(); //team BattleGroundTeam* _CreateTeam(const ChaosZoneTeam team_key); void _DestroyTeamAll(); BattleGroundTeam* _FindTeam(const ChaosZoneTeam team_key); Player* _FindPlayer(const DWORD char_guid); //resurrect RC::eSTATUS_RESULT _ResurrectionAtSafezone(Player* const player); void _AllDeathMemberResurrectionAtSafezone(); bool _IsBattleGroundEnd(); //trigger StrongpointTrigger* _CreateStrongPoint(WzID strongpoint_id); void _DestroyStrongPointAll(); StrongpointTrigger* _FindStrongPoint(WzID strongpoint_id) const; void _SendVictoryPointToAll(); //packet void _SendPacketToAll(MSG_BASE_FORWARD* msg, WORD msg_size); private: PLAYER_HASH player_hash_; // ÀüÀåÀ» ÁøÇàÁßÀÎ ¸â¹ö // BattleGround Info struct { BattleGroundState battle_ground_state_; ChaosZoneTeam winner_team_key_; }; // Time Info struct { util::Timer start_wait_timer_; // ÀüÀåÀÔÀå ´ë±â ½Ã°£ ¹× ÀÔÀå ÈÄ Áغñ½Ã°£. ITimerBase resurrection_timer_; // ºÎȰ ½ºÄÉÁÙ¸µ ITimerBase victory_point_timer_; // ½ÂÁ¡ ½ºÄÉÁÙ¸µ bool is_count_message_; }; BattleGroundTeam* battle_ground_team_[kTeamMax]; // ÀüÀå ³» ÆÀ STRONGPOINT_TRIGGER_HASH strongpoint_trigger_hash_; // ÀüÀå³» °ÅÁ¡ // ÀüÀåÆÄ¼­ const BattleGroundInfo* battle_ground_Info_; // ÀüÅõ°á°úâ BattleGroundBattleResult* battle_ground_battle_result_; };