1. typedef enum RESET_EFST_TYPE {
  2. RESET_EFST_DEAD = 0x0,
  3. RESET_EFST_DISPEL = 0x1, // sage dispel, also used by LG_INSPIRATION
  4. RESET_EFST_PRETEND_DEAD = 0x2, // used by gospel
  5. RESET_EFST_TAROT = 0x3, // resets same as RESET_EFST_PRETEND_DEAD - except for EFST_TRICKDEAD
  6. RESET_EFST_ALL = 0x4, // from clearbuff npc command
  7. RESET_EFST_DEBUFF = 0x5, // from EFST_REFRESH
  8. RESET_EFST_CLEARANCE = 0x6,
  9. RESET_EFST_GC_NEWPOISON = 0x7, // ESTATE::IsGC_Poison seems to be a stub ? also related to LG_INSPIRATION?
  10. RESET_EFST_WANDERERandMINSTREL_OVERLAPDENY = 0x8, // unused ???
  11. RESET_MADOGEAR = 0x9,
  12. RESET_EFST_WANDERERandMINSTREL_OVERLAPDENY_GROUP_NONE = 0xa, // unused ???
  13. RESET_EFST_WANDERERandMINSTREL_OVERLAPDENY_GROUP_A = 0xb,
  14. RESET_EFST_WANDERERandMINSTREL_OVERLAPDENY_GROUP_B = 0xc,
  15. } RESET_EFST_TYPE;
  16. void CActor::ResetAllEffective(int resetType)
  17. {
  18. // m_effectiveList type is std::map<int, EFFECTIVE_INFO>
  19. // EFFECTIVE_INFO is just time, val1-3, and some other stuff that's not relevant
  20. for (auto it = m_effectiveList.begin(); it != m_effectiveList.end(); ++it)
  21. {
  22. ESTATE* stateInfo;
  23. int efst = it->first;
  24. EFFECTIVE_INFO info = it->second;
  25. int efst_time = info->time;
  26. bool removed = false;
  27. if (!info->val)
  28. continue;
  29. if ( (efst == EFST_PROVOKE || efst == EFST_PROVOKE_MDEF) && efst_time != 9999)
  30. {
  31. ResetEffective(efst, 0);
  32. continue;
  33. }
  34. stateInfo = EStatestateInfoMgr::GetPtr(stateInfo, EStatestateInfoMgr::m_cpSelf, efst);
  35. if (stateInfo == nullptr)
  36. continue;
  37. switch (resetType)
  38. {
  39. case RESET_EFST_DEAD:
  40. removed = stateInfo->m_isResetDead;
  41. break;
  42. case RESET_EFST_DISPEL:
  43. removed = stateInfo->m_isResetDispel;
  44. break;
  45. case RESET_EFST_TAROT:
  46. if (efst == EFST_TRICKDEAD)
  47. continue;
  48. // fallthrough
  49. case RESET_EFST_PRETEND_DEAD:
  50. removed = stateInfo->IsResetPretendDead();
  51. break;
  52. case RESET_EFST_ALL:
  53. removed = true;
  54. break;
  55. case RESET_EFST_DEBUFF:
  56. removed = stateInfo->m_isDeBuff;
  57. break;
  58. case RESET_EFST_CLEARANCE:
  59. removed = stateInfo->m_isResetCLEARANCE;
  60. break;
  61. case RESET_EFST_GC_NEWPOISON:
  62. removed = stateInfo->IsGC_POISON()
  63. break;
  64. case RESET_MADOGEAR:
  65. removed = stateInfo->m_isResetMADOGEAR;
  66. break;
  67. case RESET_EFST_WANDERERandMINSTREL_OVERLAPDENY_GROUP_A:
  68. case RESET_EFST_WANDERERandMINSTREL_OVERLAPDENY_GROUP_B:
  69. removed = (resetType == stateInfo->IsWANDERERandMINSTRELoverlapDeny());
  70. continue;
  71. }
  72. if (removed)
  73. ResetEffective(efst, 0);
  74. }
  75. if (resetType == RESET_EFST_CLEARANCE && GetType() == PC_TYPE)
  76. {
  77. if (m_pcSkill.m_spiritsTime.size() > 0)
  78. m_pcSkill.ResetSpirits(m_pcSkill);
  79. ResetMilleniumShield(m_pcSkill);
  80. }
  81. }
  82. void ESTATE_REFRESH::SetComplete(CActor *in_cpActor, const int in_Time, const int in_Val1, const int in_Val2, const int in_Val3)
  83. {
  84. in_cpActor->ResetHandicapState(in_cpActor, BODY_STUN);
  85. in_cpActor->ResetHandicapState(in_cpActor, BODY_SLEEP);
  86. in_cpActor->ResetHandicapState(in_cpActor, HEALTH_CURSE);
  87. in_cpActor->ResetHandicapState(in_cpActor, BODY_STONECURSE);
  88. in_cpActor->ResetHandicapState(in_cpActor, HEALTH_POISON);
  89. in_cpActor->ResetHandicapState(in_cpActor, HEALTH_BLIND);
  90. in_cpActor->ResetHandicapState(in_cpActor, HEALTH_SILENCE);
  91. in_cpActor->ResetHandicapState(in_cpActor, HEALTH_BLOODING);
  92. in_cpActor->ResetHandicapState(in_cpActor, HEALTH_CONFUSION);
  93. in_cpActor->ResetHandicapState(in_cpActor, BODY_FREEZING);
  94. in_cpActor->ResetHandicapState(in_cpActor, HANDICAPSTATE_DEEPSLEEP);
  95. in_cpActor->ResetHandicapState(in_cpActor, BODY_BURNNING);
  96. in_cpActor->ResetHandicapState(in_cpActor, HANDICAPSTATE_FROSTMISTY);
  97. in_cpActor->ResetHandicapState(in_cpActor, HANDICAPSTATE_COLD);
  98. in_cpActor->ResetEffective(EFST_TOXIN, 0);
  99. in_cpActor->ResetEffective(EFST_PARALYSE, 0);
  100. in_cpActor->ResetEffective(EFST_VENOMBLEED, 0);
  101. in_cpActor->ResetEffective(EFST_MAGICMUSHROOM, 0);
  102. in_cpActor->ResetEffective(EFST_DEATHHURT, 0);
  103. in_cpActor->ResetEffective(EFST_PYREXIA, 0);
  104. in_cpActor->ResetEffective(EFST_OBLIVIONCURSE, 0);
  105. in_cpActor->ResetEffective(EFST_MARSHOFABYSS, 0);
  106. in_cpActor->ResetEffective(EFST_MANDRAGORA, 0);
  107. in_cpActor->ResetAllEffective(RESET_EFST_DEBUFF);
  108. }