1. defineleri tanımladıgın yere ekle
  2. #define ENABLE_SUPER_METIN_EVENT
  3. char_state ve arat :
  4. void CHARACTER::__StateIdle_Stone()
  5. {
  6. biraz aşağısında
  7. if (iPercent <= 10 && GetMaxSP() < 10)
  8. {
  9. SetMaxSP(10);
  10. SendMovePacket(FUNC_ATTACK, 0, GetX(), GetY(), 0);
  11. CHARACTER_MANAGER::instance().SelectStone(this);
  12. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 500, GetY() - 500, GetX() + 500, GetY() + 500);
  13. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  14. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1500, GetY() - 1500, GetX() + 1500, GetY() + 1500);
  15. altına ekle
  16. #ifdef ENABLE_SUPER_METIN_EVENT
  17. if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1)
  18. {
  19. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 500, GetY() - 500, GetX() + 500, GetY() + 500);
  20. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  21. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1500, GetY() - 1500, GetX() + 1500, GetY() + 1500);
  22. }
  23. #endif
  24. arat
  25. else if (iPercent <= 20 && GetMaxSP() < 9)
  26. {
  27. SetMaxSP(9);
  28. SendMovePacket(FUNC_ATTACK, 0, GetX(), GetY(), 0);
  29. CHARACTER_MANAGER::instance().SelectStone(this);
  30. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 500, GetY() - 500, GetX() + 500, GetY() + 500);
  31. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  32. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1500, GetY() - 1500, GetX() + 1500, GetY() + 1500);
  33. altına ekle
  34. #ifdef ENABLE_SUPER_METIN_EVENT
  35. if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1)
  36. {
  37. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 500, GetY() - 500, GetX() + 500, GetY() + 500);
  38. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  39. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1500, GetY() - 1500, GetX() + 1500, GetY() + 1500);
  40. }
  41. #endif
  42. arat
  43. else if (iPercent <= 30 && GetMaxSP() < 8)
  44. {
  45. SetMaxSP(8);
  46. SendMovePacket(FUNC_ATTACK, 0, GetX(), GetY(), 0);
  47. CHARACTER_MANAGER::instance().SelectStone(this);
  48. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 500, GetY() - 500, GetX() + 500, GetY() + 500);
  49. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  50. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  51. altına ekle
  52. #ifdef ENABLE_SUPER_METIN_EVENT
  53. if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1)
  54. {
  55. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 500, GetY() - 500, GetX() + 500, GetY() + 500);
  56. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  57. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  58. }
  59. #endif
  60. arat
  61. else if (iPercent <= 40 && GetMaxSP() < 7)
  62. {
  63. SetMaxSP(7);
  64. SendMovePacket(FUNC_ATTACK, 0, GetX(), GetY(), 0);
  65. CHARACTER_MANAGER::instance().SelectStone(this);
  66. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  67. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  68. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  69. altına ekle
  70. #ifdef ENABLE_SUPER_METIN_EVENT
  71. if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1)
  72. {
  73. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  74. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  75. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  76. }
  77. #endif
  78. arat
  79. else if (iPercent <= 50 && GetMaxSP() < 6)
  80. {
  81. SetMaxSP(6);
  82. SendMovePacket(FUNC_ATTACK, 0, GetX(), GetY(), 0);
  83. CHARACTER_MANAGER::instance().SelectStone(this);
  84. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  85. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  86. altına ekle
  87. #ifdef ENABLE_SUPER_METIN_EVENT
  88. if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1)
  89. {
  90. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  91. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  92. }
  93. #endif
  94. arat
  95. else if (iPercent <= 60 && GetMaxSP() < 5)
  96. {
  97. SetMaxSP(5);
  98. SendMovePacket(FUNC_ATTACK, 0, GetX(), GetY(), 0);
  99. CHARACTER_MANAGER::instance().SelectStone(this);
  100. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  101. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 500, GetY() - 500, GetX() + 500, GetY() + 500);
  102. altına ekle
  103. #ifdef ENABLE_SUPER_METIN_EVENT
  104. if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1)
  105. {
  106. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  107. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 500, GetY() - 500, GetX() + 500, GetY() + 500);
  108. }
  109. #endif
  110. arat
  111. else if (iPercent <= 70 && GetMaxSP() < 4)
  112. {
  113. SetMaxSP(4);
  114. SendMovePacket(FUNC_ATTACK, 0, GetX(), GetY(), 0);
  115. CHARACTER_MANAGER::instance().SelectStone(this);
  116. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 500, GetY() - 500, GetX() + 500, GetY() + 500);
  117. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  118. altına ekle
  119. #ifdef ENABLE_SUPER_METIN_EVENT
  120. if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1)
  121. {
  122. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 500, GetY() - 500, GetX() + 500, GetY() + 500);
  123. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  124. }
  125. #endif
  126. arat
  127. else if (iPercent <= 80 && GetMaxSP() < 3)
  128. {
  129. SetMaxSP(3);
  130. SendMovePacket(FUNC_ATTACK, 0, GetX(), GetY(), 0);
  131. CHARACTER_MANAGER::instance().SelectStone(this);
  132. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  133. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  134. altına ekle
  135. #ifdef ENABLE_SUPER_METIN_EVENT
  136. if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1)
  137. {
  138. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  139. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  140. }
  141. #endif
  142. arat
  143. else if (iPercent <= 90 && GetMaxSP() < 2)
  144. {
  145. SetMaxSP(2);
  146. SendMovePacket(FUNC_ATTACK, 0, GetX(), GetY(), 0);
  147. CHARACTER_MANAGER::instance().SelectStone(this);
  148. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 500, GetY() - 500, GetX() + 500, GetY() + 500);
  149. altına ekle
  150. #ifdef ENABLE_SUPER_METIN_EVENT
  151. if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1)
  152. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 500, GetY() - 500, GetX() + 500, GetY() + 500);
  153. #endif
  154. arat
  155. else if (iPercent <= 99 && GetMaxSP() < 1)
  156. {
  157. SetMaxSP(1);
  158. SendMovePacket(FUNC_ATTACK, 0, GetX(), GetY(), 0);
  159. CHARACTER_MANAGER::instance().SelectStone(this);
  160. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  161. altına ekle
  162. #ifdef ENABLE_SUPER_METIN_EVENT
  163. if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1)
  164. CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
  165. #endif
  166. item_manager.cpp
  167. bool ITEM_MANAGER::CreateDropItem içinde
  168. arat
  169. // Common Drop Items
  170. std::vector<CItemDropInfo>::iterator it = g_vec_pkCommonDropItem[bRank].begin();
  171. while (it != g_vec_pkCommonDropItem[bRank].end())
  172. {
  173. const CItemDropInfo& c_rInfo = *(it++);
  174. if (iLevel < c_rInfo.m_iLevelStart || iLevel > c_rInfo.m_iLevelEnd)
  175. continue;
  176. altına ekle
  177. #ifdef ENABLE_SUPER_METIN_EVENT
  178. if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1 && pkChr->IsStone())
  179. {
  180. for (int x = 0; x < 2; ++x)
  181. {
  182. int iPercent = (c_rInfo.m_iPercent * iDeltaPercent) / 100;
  183. sys_log(2, "CreateDropItem %d ~ %d %d(%d)", c_rInfo.m_iLevelStart, c_rInfo.m_iLevelEnd, c_rInfo.m_dwVnum, iPercent, c_rInfo.m_iPercent);
  184. if (iPercent >= number(1, iRandRange))
  185. {
  186. TItemTable* table = GetTable(c_rInfo.m_dwVnum);
  187. if (!table)
  188. continue;
  189. item = nullptr;
  190. if (table->bType == ITEM_POLYMORPH)
  191. {
  192. if (c_rInfo.m_dwVnum == pkChr->GetPolymorphItemVnum())
  193. {
  194. item = CreateItem(c_rInfo.m_dwVnum, 1, 0, true);
  195. if (item)
  196. item->SetSocket(0, pkChr->GetRaceNum());
  197. }
  198. }
  199. else
  200. item = CreateItem(c_rInfo.m_dwVnum, 1, 0, true);
  201. if (item) vec_item.push_back(item);
  202. }
  203. }
  204. }
  205. else
  206. #endif
  207. arat
  208. // Drop Item Group
  209. {
  210. auto it = m_map_pkDropItemGroup.find(pkChr->GetRaceNum());
  211. if (it != m_map_pkDropItemGroup.end())
  212. {
  213. decltype(it->second->GetVector()) v = it->second->GetVector();
  214. for (DWORD i = 0; i < v.size(); ++i)
  215. {
  216. int iPercent = (v[i].dwPct * iDeltaPercent) / 100;
  217. altına ekle
  218. #ifdef ENABLE_SUPER_METIN_EVENT
  219. if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1 && pkChr->IsStone())
  220. {
  221. for (int x = 0; x < 2; ++x)
  222. {
  223. if (iPercent >= number(1, iRandRange))
  224. {
  225. item = CreateItem(v[i].dwVnum, v[i].iCount, 0, true);
  226. if (item)
  227. {
  228. if (item->GetType() == ITEM_POLYMORPH)
  229. {
  230. if (item->GetVnum() == pkChr->GetPolymorphItemVnum())
  231. {
  232. item->SetSocket(0, pkChr->GetRaceNum());
  233. }
  234. }
  235. vec_item.push_back(item);
  236. }
  237. }
  238. }
  239. }
  240. else
  241. #endif
  242. arat
  243. // MobDropItem Group
  244. {
  245. auto it = m_map_pkMobItemGroup.find(pkChr->GetRaceNum());
  246. if (it != m_map_pkMobItemGroup.end())
  247. {
  248. CMobItemGroup* pGroup = it->second;
  249. // MOB_DROP_ITEM_BUG_FIX
  250. // 20050805.myevan.MobDropItem ¿¡ ¾ÆÀÌÅÛÀÌ ¾øÀ» °æ¿ì CMobItemGroup::GetOne() Á¢±Ù½Ã ¹®Á¦ ¹ß»ı ¼öÁ¤
  251. if (pGroup && !pGroup->IsEmpty())
  252. {
  253. altına ekle
  254. #ifdef ENABLE_SUPER_METIN_EVENT
  255. if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1 && pkChr->IsStone())
  256. {
  257. for (int x = 0; x < 2; ++x)
  258. {
  259. int iPercent = 40000 * iDeltaPercent / pGroup->GetKillPerDrop();
  260. if (iPercent >= number(1, iRandRange))
  261. {
  262. const CMobItemGroup::SMobItemGroupInfo& info = pGroup->GetOne();
  263. item = CreateItem(info.dwItemVnum, info.iCount, 0, true, info.iRarePct);
  264. if (item) vec_item.push_back(item);
  265. }
  266. }
  267. }
  268. else
  269. #endif
  270. arat
  271. // Level Item Group
  272. {
  273. auto it = m_map_pkLevelItemGroup.find(pkChr->GetRaceNum());
  274. if (it != m_map_pkLevelItemGroup.end())
  275. {
  276. if (it->second->GetLevelLimit() <= (DWORD)iLevel)
  277. {
  278. decltype(it->second->GetVector()) v = it->second->GetVector();
  279. for (DWORD i = 0; i < v.size(); i++)
  280. {
  281. altına ekle
  282. #ifdef ENABLE_SUPER_METIN_EVENT
  283. if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1 && pkChr->IsStone())
  284. {
  285. for (int x = 0; x < 2; ++x)
  286. {
  287. if (v[i].dwPct >= (DWORD)number(1, 1000000/*iRandRange*/))
  288. {
  289. DWORD dwVnum = v[i].dwVNum;
  290. item = CreateItem(dwVnum, v[i].iCount, 0, true);
  291. if (item) vec_item.push_back(item);
  292. }
  293. }
  294. }
  295. else
  296. #endif
  297. arat
  298. // BuyerTheitGloves Item Group
  299. {
  300. if (pkKiller->GetPremiumRemainSeconds(PREMIUM_ITEM) > 0 ||
  301. pkKiller->IsEquipUniqueGroup(UNIQUE_GROUP_DOUBLE_ITEM))
  302. {
  303. auto it = m_map_pkGloveItemGroup.find(pkChr->GetRaceNum());
  304. if (it != m_map_pkGloveItemGroup.end())
  305. {
  306. decltype(it->second->GetVector()) v = it->second->GetVector();
  307. for (DWORD i = 0; i < v.size(); ++i)
  308. {
  309. altına ekle
  310. #ifdef ENABLE_SUPER_METIN_EVENT
  311. if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1 && pkChr->IsStone())
  312. {
  313. for (int x = 0; x < 2; ++x)
  314. {
  315. int iPercent = (v[i].dwPct * iDeltaPercent) / 100;
  316. if (iPercent >= number(1, iRandRange))
  317. {
  318. DWORD dwVnum = v[i].dwVnum;
  319. item = CreateItem(dwVnum, v[i].iCount, 0, true);
  320. if (item) vec_item.push_back(item);
  321. }
  322. }
  323. }
  324. else
  325. #endif
  326. arat
  327. if (pkChr->GetMobDropItemVnum())
  328. {
  329. auto it = m_map_dwEtcItemDropProb.find(pkChr->GetMobDropItemVnum());
  330. if (it != m_map_dwEtcItemDropProb.end())
  331. {
  332. altına ekle
  333. #ifdef ENABLE_SUPER_METIN_EVENT
  334. if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1 && pkChr->IsStone())
  335. {
  336. for (int x = 0; x < 2; ++x)
  337. {
  338. int iPercent = (it->second * iDeltaPercent) / 100;
  339. if (iPercent >= number(1, iRandRange))
  340. {
  341. item = CreateItem(pkChr->GetMobDropItemVnum(), 1, 0, true);
  342. if (item) vec_item.push_back(item);
  343. }
  344. }
  345. }
  346. else
  347. #endif
  348. arat
  349. if (pkChr->IsStone())
  350. {
  351. if (pkChr->GetDropMetinStoneVnum())
  352. {
  353. altına ekle
  354. #ifdef ENABLE_SUPER_METIN_EVENT
  355. if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1 && pkChr->IsStone())
  356. {
  357. for (int x = 0; x < 2; ++x)
  358. {
  359. int iPercent = (pkChr->GetDropMetinStonePct() * iDeltaPercent) * 400;
  360. if (iPercent >= number(1, iRandRange))
  361. {
  362. item = CreateItem(pkChr->GetDropMetinStoneVnum(), 1, 0, true);
  363. if (item) vec_item.push_back(item);
  364. }
  365. }
  366. }
  367. else
  368. #endif
  369. questmanager.cpp acılır
  370. kendi event mantıgınıza göre uyarlayın
  371. örnek 1 :
  372. #ifdef ENABLE_SUPER_METIN_EVENT
  373. else if (name == "super_metin_event")
  374. {
  375. CGameEventsManager::instance().SetActivateEvent(EVENT_SUPER_METIN, value != 0 ? true : false);
  376. }
  377. #endif
  378. örnek 2 :
  379. #ifdef ENABLE_SUPER_METIN_EVENT
  380. // else if (name == "super_metin_event")
  381. // {
  382. // CGameEventsManager::instance().SetActivateEvent(EVENT_SUPER_METIN, value != 0 ? true : false);
  383. // }
  384. else if (name == "super_metin_event")
  385. {
  386. const DESC_MANAGER::DESC_SET & c_ref_set = DESC_MANAGER::instance().GetClientSet();
  387. for (itertype(c_ref_set) it = c_ref_set.begin(); it != c_ref_set.end(); ++it)
  388. {
  389. LPCHARACTER ch = (*it)->GetCharacter();
  390. if (!ch)
  391. continue;
  392. if (value)
  393. {
  394. ch->ChatPacket(CHAT_TYPE_COMMAND, "EnableEventIcon %d", 5);
  395. }
  396. else
  397. {
  398. ch->ChatPacket(CHAT_TYPE_COMMAND, "EnableEventIcon %d", 0);
  399. }
  400. }
  401. }
  402. #endif