Clone of UAS2 @ https://github.com/drudgedance/uas2

cMonsterServer.h 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * This file is part of UAS2.
  3. *
  4. * UAS2 is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * UAS2 is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. * You should have received a copy of the GNU General Public License
  14. * along with UASv1; if not, write to the Free Software
  15. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. */
  17. /**
  18. * @file cMonsterServer.h
  19. */
  20. #if !defined(AFX_CMONSTERSERVER_H__84170BF9_CB4B_4559_B900_790678A46F28__INCLUDED_)
  21. #define AFX_CMONSTERSERVER_H__84170BF9_CB4B_4559_B900_790678A46F28__INCLUDED_
  22. #if _MSC_VER > 1000
  23. #pragma once
  24. #endif // _MSC_VER > 1000
  25. #include <algorithm>
  26. #include "math.h"
  27. #include "Shared.h"
  28. #include "Object.h"
  29. class cMonsterServer
  30. {
  31. friend class cMasterServer;
  32. public:
  33. static void Initialize( )
  34. {
  35. UpdateConsole(" Starting Monster Server ... " );
  36. time(&NextActionTime + ACTION_DELAY);
  37. UpdateConsole("success.\r\n\r\n");
  38. }
  39. static void Halt( )
  40. {
  41. UpdateConsole(" Monster Server: shutting down ...\r\n");
  42. }
  43. static void ProcessAction ( DWORD dwMonGUID, DWORD dwEvent, DWORD dwEngaged, DWORD dwTarget = 0x0L );
  44. static void ProcessPetAction ( DWORD dwMonGUID, DWORD dwEvent, DWORD dwEngaged, DWORD dwTarget = 0x0L, DWORD dwOwner = 0x0L );
  45. static void ActionCheck ( );
  46. static bool AddMonster ( DWORD dwGUID );
  47. static bool RemoveMonster ( DWORD dwGUID );
  48. static void Underattack ( DWORD dwGUID );
  49. //Variables
  50. static sMonsters Monster[MAX_MONSTERS];
  51. static time_t longtime;
  52. static time_t NextActionTime;
  53. protected:
  54. static DWORD m_dwStatus;
  55. };
  56. #endif // !defined(AFX_CMONSTERSERVER_H__84170BF9_CB4B_4559_B900_790678A46F28__INCLUDED_)