Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include "constants.h"
- #include "char.h"
- #include "item.h"
- #include "item_manager.h"
- #include "mob_manager.h"
- #include <algorithm>
- struct SBossDataManager
- {
- unsigned short mobVnum;
- unsigned short type;
- unsigned short itemVnum;
- unsigned short itemCount;
- bool isNotice;
- };
- #define BOSS_LIST_MAX_NUM 10
- SBossDataManager sObjects[BOSS_LIST_MAX_NUM] =
- {
- { 591, 1, 27001, 10, true },
- { 691, 1, 70003, 35, false },
- { 792, 1, 70005, 25, true },
- { 1304, 1, 80014, 50, true },
- { 1901, 1, 80015, 100, true },
- { 2091, 1, 80016, 45, false },
- { 2191, 1, 71123, 200, true },
- { 2206, 1, 71129, 200, true },
- { 2306, 1, 50011, 100, false },
- { 5161, 1, 71107, 100, true }
- // Customizable
- };
- void OnKillBoss(LPCHARACTER ch, LPCHARACTER pkVictim)
- {
- if (!ch || !pkVictim || !ch->IsPC() || ch->IsGM() || pkVictim->IsPC())
- return;
- const CMob * pkMob;
- unsigned short mobVnum, itemVnum, itemCount;
- for (int i = 0; i < BOSS_LIST_MAX_NUM; i++)
- {
- mobVnum = sObjects[i].mobVnum;
- itemVnum = sObjects[i].itemVnum;
- itemCount = sObjects[i].itemCount;
- if (!CMobManager::instance().Get(vnum))
- return;
- if (mobVnum == pkVictim->GetMobTable().dwVnum)
- {
- if (sObjects[i].isNotice)
- SendNoticeNew("[Boss-Kill Notice]: %s has slain %s on channel %d.", ch->GetName(), pkVictim->GetMobTable().szLocaleName, g_bChannel);
- if (!ITEM_MANAGER::instance().GetTable(itemVnum))
- return;
- ch->AutoGiveItem(itemVnum, itemCount);
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement