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

模拟服务器

开发平台:

C/C++

  1. /*
  2. int g_CastSkill(TSkillParam * pSkillParam)
  3. {
  4. if (pSkillParam->usSkillID > g_ulSkillCount || pSkillParam->usSkillLevel > MAX_SKILLLEVEL) return FALSE;
  5. if (!g_pSkill[pSkillParam->usSkillID][pSkillParam->usSkillLevel])
  6. {
  7. if (!g_GenSkillData(pSkillParam->usSkillID, pSkillParam->usSkillLevel)) return FALSE;
  8. }
  9. return g_pSkill[pSkillParam->usSkillID][pSkillParam->usSkillLevel]->Cast(pSkillParam);
  10. }
  11. BOOL g_InstanceSkill(eSKillStyle eStyle, unsigned long ulSkillID, unsigned long ulSkillLevel)
  12. {
  13. if (!g_pSkill[ulSkillID][ulSkillLevel])
  14. {
  15. switch(eStyle)
  16. {
  17. case SKILL_SS_Missles: // 子弹类 本技能用于发送子弹类
  18. {
  19. g_pSkill[ulSkillID][ulSkillLevel] = new KMissleSkill;
  20. }break;
  21. case SKILL_SS_Melee:
  22. {
  23. }break;
  24. case SKILL_SS_InitiativeNpcState: // 主动类 本技能用于改变当前Npc的主动状态
  25. case SKILL_SS_PassivityNpcState: // 被动类 本技能用于改变Npc的被动状态
  26. {
  27. g_pSkill[ulSkillID][ulSkillLevel] = new KStateFightSkill;
  28. }break;
  29. default:
  30. g_pSkill[ulSkillID][ulSkillLevel] = new ISkill;
  31. }
  32. }
  33. return TRUE;
  34. }
  35. ISkill * g_GetSkill(unsigned long ulSkillID, unsigned long ulSkillLevel)
  36. {
  37. _ASSERT(usSkillID < g_ulSkillCount || usSkillLevel < MAX_SKILLLEVEL);
  38. if (!g_pSkill[ulSkillID][ulSkillLevel])
  39. {
  40. _ASSERT(ulSkillLevel != 0);
  41. if (!g_InstanceSkill(g_pSkill[ulSkillID][0].GetSkillStyle(), ulSkillID, ulSkillLevel)) return NULL;
  42. g_pSkill[ulSkillID][ulSkillLevel]->SetRowIdInSkillTabFile(g_pSkill[ulSkillID][0]->GetRowIdInSkillTabFile());
  43. *g_pSkill[ulSkillID][ulSkillLevel] = *g_pSkill[ulSkillID][0];
  44. g_pSkill[ulSkillID][ulSkillLevel]->SetSkillLevelData(ulSkillLevel);
  45. }
  46. return g_pSkill[ulSkillID][ulSkillLevel];
  47. }
  48. */