- defineleri tanımladıgın yere ekle
- #define ENABLE_SUPER_METIN_EVENT
- char_state aç ve arat :
- void CHARACTER::__StateIdle_Stone()
- {
- biraz aşağısında
- if (iPercent <= 10 && GetMaxSP() < 10)
- {
- SetMaxSP(10);
- SendMovePacket(FUNC_ATTACK, 0, GetX(), GetY(), 0);
- CHARACTER_MANAGER::instance().SelectStone(this);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 500, GetY() - 500, GetX() + 500, GetY() + 500);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1500, GetY() - 1500, GetX() + 1500, GetY() + 1500);
- altına ekle
- #ifdef ENABLE_SUPER_METIN_EVENT
- if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1)
- {
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 500, GetY() - 500, GetX() + 500, GetY() + 500);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1500, GetY() - 1500, GetX() + 1500, GetY() + 1500);
- }
- #endif
- arat
- else if (iPercent <= 20 && GetMaxSP() < 9)
- {
- SetMaxSP(9);
- SendMovePacket(FUNC_ATTACK, 0, GetX(), GetY(), 0);
- CHARACTER_MANAGER::instance().SelectStone(this);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 500, GetY() - 500, GetX() + 500, GetY() + 500);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1500, GetY() - 1500, GetX() + 1500, GetY() + 1500);
- altına ekle
- #ifdef ENABLE_SUPER_METIN_EVENT
- if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1)
- {
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 500, GetY() - 500, GetX() + 500, GetY() + 500);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1500, GetY() - 1500, GetX() + 1500, GetY() + 1500);
- }
- #endif
- arat
- else if (iPercent <= 30 && GetMaxSP() < 8)
- {
- SetMaxSP(8);
- SendMovePacket(FUNC_ATTACK, 0, GetX(), GetY(), 0);
- CHARACTER_MANAGER::instance().SelectStone(this);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 500, GetY() - 500, GetX() + 500, GetY() + 500);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- altına ekle
- #ifdef ENABLE_SUPER_METIN_EVENT
- if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1)
- {
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 500, GetY() - 500, GetX() + 500, GetY() + 500);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- }
- #endif
- arat
- else if (iPercent <= 40 && GetMaxSP() < 7)
- {
- SetMaxSP(7);
- SendMovePacket(FUNC_ATTACK, 0, GetX(), GetY(), 0);
- CHARACTER_MANAGER::instance().SelectStone(this);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- altına ekle
- #ifdef ENABLE_SUPER_METIN_EVENT
- if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1)
- {
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- }
- #endif
- arat
- else if (iPercent <= 50 && GetMaxSP() < 6)
- {
- SetMaxSP(6);
- SendMovePacket(FUNC_ATTACK, 0, GetX(), GetY(), 0);
- CHARACTER_MANAGER::instance().SelectStone(this);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- altına ekle
- #ifdef ENABLE_SUPER_METIN_EVENT
- if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1)
- {
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- }
- #endif
- arat
- else if (iPercent <= 60 && GetMaxSP() < 5)
- {
- SetMaxSP(5);
- SendMovePacket(FUNC_ATTACK, 0, GetX(), GetY(), 0);
- CHARACTER_MANAGER::instance().SelectStone(this);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 500, GetY() - 500, GetX() + 500, GetY() + 500);
- altına ekle
- #ifdef ENABLE_SUPER_METIN_EVENT
- if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1)
- {
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 500, GetY() - 500, GetX() + 500, GetY() + 500);
- }
- #endif
- arat
- else if (iPercent <= 70 && GetMaxSP() < 4)
- {
- SetMaxSP(4);
- SendMovePacket(FUNC_ATTACK, 0, GetX(), GetY(), 0);
- CHARACTER_MANAGER::instance().SelectStone(this);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 500, GetY() - 500, GetX() + 500, GetY() + 500);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- altına ekle
- #ifdef ENABLE_SUPER_METIN_EVENT
- if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1)
- {
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 500, GetY() - 500, GetX() + 500, GetY() + 500);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- }
- #endif
- arat
- else if (iPercent <= 80 && GetMaxSP() < 3)
- {
- SetMaxSP(3);
- SendMovePacket(FUNC_ATTACK, 0, GetX(), GetY(), 0);
- CHARACTER_MANAGER::instance().SelectStone(this);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- altına ekle
- #ifdef ENABLE_SUPER_METIN_EVENT
- if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1)
- {
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- }
- #endif
- arat
- else if (iPercent <= 90 && GetMaxSP() < 2)
- {
- SetMaxSP(2);
- SendMovePacket(FUNC_ATTACK, 0, GetX(), GetY(), 0);
- CHARACTER_MANAGER::instance().SelectStone(this);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 500, GetY() - 500, GetX() + 500, GetY() + 500);
- altına ekle
- #ifdef ENABLE_SUPER_METIN_EVENT
- if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1)
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 500, GetY() - 500, GetX() + 500, GetY() + 500);
- #endif
- arat
- else if (iPercent <= 99 && GetMaxSP() < 1)
- {
- SetMaxSP(1);
- SendMovePacket(FUNC_ATTACK, 0, GetX(), GetY(), 0);
- CHARACTER_MANAGER::instance().SelectStone(this);
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- altına ekle
- #ifdef ENABLE_SUPER_METIN_EVENT
- if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1)
- CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, GetMapIndex(), GetX() - 1000, GetY() - 1000, GetX() + 1000, GetY() + 1000);
- #endif
- item_manager.cpp aç
- bool ITEM_MANAGER::CreateDropItem içinde
- arat
- // Common Drop Items
- std::vector<CItemDropInfo>::iterator it = g_vec_pkCommonDropItem[bRank].begin();
- while (it != g_vec_pkCommonDropItem[bRank].end())
- {
- const CItemDropInfo& c_rInfo = *(it++);
- if (iLevel < c_rInfo.m_iLevelStart || iLevel > c_rInfo.m_iLevelEnd)
- continue;
- altına ekle
- #ifdef ENABLE_SUPER_METIN_EVENT
- if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1 && pkChr->IsStone())
- {
- for (int x = 0; x < 2; ++x)
- {
- int iPercent = (c_rInfo.m_iPercent * iDeltaPercent) / 100;
- 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);
- if (iPercent >= number(1, iRandRange))
- {
- TItemTable* table = GetTable(c_rInfo.m_dwVnum);
- if (!table)
- continue;
- item = nullptr;
- if (table->bType == ITEM_POLYMORPH)
- {
- if (c_rInfo.m_dwVnum == pkChr->GetPolymorphItemVnum())
- {
- item = CreateItem(c_rInfo.m_dwVnum, 1, 0, true);
- if (item)
- item->SetSocket(0, pkChr->GetRaceNum());
- }
- }
- else
- item = CreateItem(c_rInfo.m_dwVnum, 1, 0, true);
- if (item) vec_item.push_back(item);
- }
- }
- }
- else
- #endif
- arat
- // Drop Item Group
- {
- auto it = m_map_pkDropItemGroup.find(pkChr->GetRaceNum());
- if (it != m_map_pkDropItemGroup.end())
- {
- decltype(it->second->GetVector()) v = it->second->GetVector();
- for (DWORD i = 0; i < v.size(); ++i)
- {
- int iPercent = (v[i].dwPct * iDeltaPercent) / 100;
- altına ekle
- #ifdef ENABLE_SUPER_METIN_EVENT
- if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1 && pkChr->IsStone())
- {
- for (int x = 0; x < 2; ++x)
- {
- if (iPercent >= number(1, iRandRange))
- {
- item = CreateItem(v[i].dwVnum, v[i].iCount, 0, true);
- if (item)
- {
- if (item->GetType() == ITEM_POLYMORPH)
- {
- if (item->GetVnum() == pkChr->GetPolymorphItemVnum())
- {
- item->SetSocket(0, pkChr->GetRaceNum());
- }
- }
- vec_item.push_back(item);
- }
- }
- }
- }
- else
- #endif
- arat
- // MobDropItem Group
- {
- auto it = m_map_pkMobItemGroup.find(pkChr->GetRaceNum());
- if (it != m_map_pkMobItemGroup.end())
- {
- CMobItemGroup* pGroup = it->second;
- // MOB_DROP_ITEM_BUG_FIX
- // 20050805.myevan.MobDropItem ¿¡ ¾ÆÀÌÅÛÀÌ ¾øÀ» °æ¿ì CMobItemGroup::GetOne() Á¢±Ù½Ã ¹®Á¦ ¹ß»ı ¼öÁ¤
- if (pGroup && !pGroup->IsEmpty())
- {
- altına ekle
- #ifdef ENABLE_SUPER_METIN_EVENT
- if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1 && pkChr->IsStone())
- {
- for (int x = 0; x < 2; ++x)
- {
- int iPercent = 40000 * iDeltaPercent / pGroup->GetKillPerDrop();
- if (iPercent >= number(1, iRandRange))
- {
- const CMobItemGroup::SMobItemGroupInfo& info = pGroup->GetOne();
- item = CreateItem(info.dwItemVnum, info.iCount, 0, true, info.iRarePct);
- if (item) vec_item.push_back(item);
- }
- }
- }
- else
- #endif
- arat
- // Level Item Group
- {
- auto it = m_map_pkLevelItemGroup.find(pkChr->GetRaceNum());
- if (it != m_map_pkLevelItemGroup.end())
- {
- if (it->second->GetLevelLimit() <= (DWORD)iLevel)
- {
- decltype(it->second->GetVector()) v = it->second->GetVector();
- for (DWORD i = 0; i < v.size(); i++)
- {
- altına ekle
- #ifdef ENABLE_SUPER_METIN_EVENT
- if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1 && pkChr->IsStone())
- {
- for (int x = 0; x < 2; ++x)
- {
- if (v[i].dwPct >= (DWORD)number(1, 1000000/*iRandRange*/))
- {
- DWORD dwVnum = v[i].dwVNum;
- item = CreateItem(dwVnum, v[i].iCount, 0, true);
- if (item) vec_item.push_back(item);
- }
- }
- }
- else
- #endif
- arat
- // BuyerTheitGloves Item Group
- {
- if (pkKiller->GetPremiumRemainSeconds(PREMIUM_ITEM) > 0 ||
- pkKiller->IsEquipUniqueGroup(UNIQUE_GROUP_DOUBLE_ITEM))
- {
- auto it = m_map_pkGloveItemGroup.find(pkChr->GetRaceNum());
- if (it != m_map_pkGloveItemGroup.end())
- {
- decltype(it->second->GetVector()) v = it->second->GetVector();
- for (DWORD i = 0; i < v.size(); ++i)
- {
- altına ekle
- #ifdef ENABLE_SUPER_METIN_EVENT
- if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1 && pkChr->IsStone())
- {
- for (int x = 0; x < 2; ++x)
- {
- int iPercent = (v[i].dwPct * iDeltaPercent) / 100;
- if (iPercent >= number(1, iRandRange))
- {
- DWORD dwVnum = v[i].dwVnum;
- item = CreateItem(dwVnum, v[i].iCount, 0, true);
- if (item) vec_item.push_back(item);
- }
- }
- }
- else
- #endif
- arat
- if (pkChr->GetMobDropItemVnum())
- {
- auto it = m_map_dwEtcItemDropProb.find(pkChr->GetMobDropItemVnum());
- if (it != m_map_dwEtcItemDropProb.end())
- {
- altına ekle
- #ifdef ENABLE_SUPER_METIN_EVENT
- if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1 && pkChr->IsStone())
- {
- for (int x = 0; x < 2; ++x)
- {
- int iPercent = (it->second * iDeltaPercent) / 100;
- if (iPercent >= number(1, iRandRange))
- {
- item = CreateItem(pkChr->GetMobDropItemVnum(), 1, 0, true);
- if (item) vec_item.push_back(item);
- }
- }
- }
- else
- #endif
- arat
- if (pkChr->IsStone())
- {
- if (pkChr->GetDropMetinStoneVnum())
- {
- altına ekle
- #ifdef ENABLE_SUPER_METIN_EVENT
- if (quest::CQuestManager::Instance().GetEventFlag("super_metin_event") == 1 && pkChr->IsStone())
- {
- for (int x = 0; x < 2; ++x)
- {
- int iPercent = (pkChr->GetDropMetinStonePct() * iDeltaPercent) * 400;
- if (iPercent >= number(1, iRandRange))
- {
- item = CreateItem(pkChr->GetDropMetinStoneVnum(), 1, 0, true);
- if (item) vec_item.push_back(item);
- }
- }
- }
- else
- #endif
- questmanager.cpp acılır
- kendi event mantıgınıza göre uyarlayın
- örnek 1 :
- #ifdef ENABLE_SUPER_METIN_EVENT
- else if (name == "super_metin_event")
- {
- CGameEventsManager::instance().SetActivateEvent(EVENT_SUPER_METIN, value != 0 ? true : false);
- }
- #endif
- örnek 2 :
- #ifdef ENABLE_SUPER_METIN_EVENT
- // else if (name == "super_metin_event")
- // {
- // CGameEventsManager::instance().SetActivateEvent(EVENT_SUPER_METIN, value != 0 ? true : false);
- // }
- else if (name == "super_metin_event")
- {
- const DESC_MANAGER::DESC_SET & c_ref_set = DESC_MANAGER::instance().GetClientSet();
- for (itertype(c_ref_set) it = c_ref_set.begin(); it != c_ref_set.end(); ++it)
- {
- LPCHARACTER ch = (*it)->GetCharacter();
- if (!ch)
- continue;
- if (value)
- {
- ch->ChatPacket(CHAT_TYPE_COMMAND, "EnableEventIcon %d", 5);
- }
- else
- {
- ch->ChatPacket(CHAT_TYPE_COMMAND, "EnableEventIcon %d", 0);
- }
- }
- }
- #endif