Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CHARACTER::InfoTimeDungeon()
- {
- // vezi timpul in timp real
- ChatPacket(CHAT_TYPE_COMMAND, "DungeonTime %d",GetTimeState("system_dungeon.timer"));
- }
- int CHARACTER::GetTimeState(const std::string& state) const
- {
- quest::CQuestManager& q = quest::CQuestManager::instance();
- quest::PC* pPC = q.GetPC(GetPlayerID());
- return pPC->GetFlag(state);
- }
- EVENTFUNC(check_time_dungeon_event)
- {
- char_event_info* info = dynamic_cast<char_event_info*>( event->info );
- if ( info == NULL )
- {
- sys_err( "check_time_dungeon_event> <Factor> Null pointer" );
- return 0;
- }
- LPCHARACTER ch = info->ch;
- if (NULL == ch || ch->IsNPC())
- return 0;
- if (ch->GetTimeState("system_dungeon.timer") - init_dungeonTime() <= 0)
- {
- ch->SetGayaState("system_dungeon.timer", init_dungeonTime() + (60*60*5));
- ch->InfoTimeDungeon();
- }
- return PASSES_PER_SEC(2);
- }
- void CHARACTER::StartCheckTimeMarket()
- {
- if (DungeonUpdateTime)
- return;
- char_event_info* info = AllocEventInfo<char_event_info>();
- info->ch = this;
- DungeonUpdateTime = event_create(check_time_dungeon_event, info, PASSES_PER_SEC(5)); // Update time
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement