KNpcTemplate.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:3k
源码类别:

模拟服务器

开发平台:

C/C++

  1. #ifndef _KNPCTEMPLATE_H
  2. #define _KNPCTEMPLATE_H
  3. #ifdef _SERVER
  4. class KItemDropRateNode
  5. {
  6. public:
  7. KItemDropRate * m_pItemDropRate;
  8. char m_szFileName[200];
  9. KItemDropRateNode()
  10. {
  11. m_pItemDropRate = NULL;
  12. }
  13. ~KItemDropRateNode()
  14. {
  15. // if (m_pItemDropRate)
  16. // delete m_pItemDropRate;
  17. // m_pItemDropRate = NULL;
  18. }
  19. };
  20. #endif
  21. #ifdef _SERVER
  22. typedef BinSTree<KItemDropRateNode> KItemDropRateTree;
  23. extern KItemDropRateTree g_ItemDropRateBinTree;
  24. #endif
  25. #include "KCore.h"
  26. #include "KNpc.h"
  27. class KNpcTemplate
  28. {
  29. public:
  30. private:
  31. public:
  32. char Name[32];
  33. DWORD m_Kind;
  34. int m_Camp;
  35. int m_Series;
  36. int m_HeadImage;
  37. int m_bClientOnly;
  38. int m_CorpseSettingIdx;
  39. int m_DeathFrame;
  40. int m_WalkFrame;
  41. int m_StandFrame;
  42. int m_StandFrame1;
  43. int m_RunFrame;
  44. int m_HurtFrame;
  45. int m_WalkSpeed;
  46. int m_AttackFrame;
  47. int m_CastFrame;
  48. int m_RunSpeed;
  49. int m_LifeMax;
  50. #ifdef _SERVER
  51. DWORD m_dwLevelSettingScript;
  52. int m_Treasure;
  53. int m_AiMode;
  54. int m_AiParam[MAX_AI_PARAM - 1];
  55. int m_FireResistMax;
  56. int m_ColdResistMax;
  57. int m_LightResistMax;
  58. int m_PoisonResistMax;
  59. int m_PhysicsResistMax;
  60. int m_ActiveRadius;
  61. int m_VisionRadius;
  62. BYTE m_AIMAXTime;
  63. int m_HitRecover;
  64. int m_ReviveFrame;
  65. int m_Experience;
  66. int m_LifeReplenish;
  67. int m_AttackRating;
  68. int m_Defend;
  69. KMagicAttrib m_PhysicsDamage;
  70. int m_RedLum;
  71. int m_GreenLum;
  72. int m_BlueLum;
  73. int m_FireResist;
  74. int m_ColdResist;
  75. int m_LightResist;
  76. int m_PoisonResist;
  77. int m_PhysicsResist;
  78. KSkillList m_SkillList;
  79. KItemDropRate *m_pItemDropRate;
  80. char m_szDropRateFile[150];
  81. #endif
  82. #ifndef _SERVER
  83. int m_ArmorType;
  84. int m_HelmType;
  85. int m_WeaponType;
  86. int m_HorseType;
  87. int m_bRideHorse;
  88. char ActionScript[32];
  89. char m_szLevelSettingScript[100];
  90. #endif
  91. int m_NpcSettingIdx;
  92. int m_nSkillID[4];
  93. int m_nSkillLevel[4];
  94. BOOL m_bHaveLoadedFromTemplate;
  95. int m_nStature;
  96. int m_nLevel;
  97. public:
  98. void InitNpcBaseData(int nNpcTemplateId);
  99. void InitNpcLevelData(KTabFile * pKindFile, int nNpcTemplateId, KLuaScript * pLevelScript, int nLevel);
  100. static int GetNpcLevelDataFromScript(KLuaScript * pScript, char * szDataName, int nLevel, char * szParam);
  101. static int GetNpcLevelDataFromScript(KLuaScript * pScript, char * szDataName, int nLevel, double nParam1, double nParam2, double nParam3);
  102. static int SkillString2Id(char * szSkillString);
  103. KNpcTemplate(){ m_bHaveLoadedFromTemplate = FALSE;};
  104. };
  105. extern KNpcTemplate * g_pNpcTemplate[MAX_NPCSTYLE][MAX_NPC_LEVEL]; //0,0为起点
  106. #endif