Guest User

Untitled

a guest
Apr 5th, 2015
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.03 KB | None | 0 0
  1. EVENTINFO(TimedPvPEventInfo)
  2. {
  3.     DynamicCharacterPtr eChr;
  4.     DynamicCharacterPtr eVictim;
  5.     BYTE    time_second;
  6.  
  7.     TimedPvPEventInfo()
  8.     : eChr()
  9.     , eVictim()
  10.     , time_second(0)
  11.     {
  12.     }
  13. };
  14.  
  15. EVENTFUNC(timed_event_pvp)
  16. {
  17.     TimedPvPEventInfo * info = dynamic_cast<TimedPvPEventInfo *>( event->info );
  18.    
  19.     if ( info == NULL )
  20.     {
  21.         sys_err( "timed_event_pvp> <Factor> Null pointer" );
  22.         return 0;
  23.     }
  24.  
  25.     LPCHARACTER pvpChr = info->eChr;
  26.     LPCHARACTER pvpVictim = info->eVictim;
  27.  
  28.     if (pvpChr == NULL) {
  29.         return 0;
  30.     }
  31.  
  32.     if (info->time_second <= 0)
  33.     {
  34.         pvpVictim->m_pkTimedEventPvP = NULL;       
  35.         pvpVictim->m_TimeStartPvP = true;
  36.         CPVPManager::instance().Insert(pvpChr, pvpVictim);
  37.  
  38.         return 0;
  39.     }
  40.     else
  41.     {
  42.         pvpChr->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("pojedynek_z_%s_rozpocznie_sie_za_%d_sekund."), pvpVictim->GetName(), info->time_second);
  43.         pvpVictim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("pojedynek_z_%s_rozpocznie_sie_za_%d_sekund."), pvpChr->GetName(), info->time_second);
  44.         --info->time_second;
  45.     }
  46.  
  47.     return PASSES_PER_SEC(1);
  48. }
Advertisement
Add Comment
Please, Sign In to add comment