Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char_battle.cpp:
- Under this:
- bool CHARACTER::Damage(LPCHARACTER pAttacker, int dam, EDamageType type) // returns true if dead
- {
- insert this:
- if (pAttacker && pAttacker->IsPC() && !IsDead())
- {
- pAttacker->SetQuestNPCID(GetVID());
- quest::CQuestManager::instance().Hit(pAttacker->GetPlayerID(), IsPC() ? GetPlayerID() : GetRaceNum(), IsPC());
- }
- questmanager.cpp:
- under this:
- m_mapEventName.insert(TEventNameMap::value_type("item_informer", QUEST_ITEM_INFORMER_EVENT));
- insert this:
- m_mapEventName.insert(TEventNameMap::value_type("hit", QUEST_HIT_EVENT));
- before this:
- bool CQuestManager::ServerTimer(unsigned int npc, unsigned int arg)
- {
- insert this:
- void CQuestManager::Hit(unsigned int pc, unsigned int npc, bool isPC)
- {
- PC * pPC;
- //sys_log(0, "CQuestManager::HIT QUEST_HIT_EVENT (pc=%d, npc=%d, isPC=%s)", pc, npc, isPC? "Y": "N");
- if ((pPC = GetPC(pc)))
- {
- if (!CheckQuestLoaded(pPC))
- return;
- if (npc > 0 && !isPC)
- m_mapNPC[npc].OnHit(*pPC);
- m_mapNPC[QUEST_NO_NPC].OnHit(*pPC);
- }
- else
- sys_err("QUEST: no such pc id : %d", pc);
- }
- questnpc.cpp:
- before this:
- bool NPC::OnPartyKill(PC & pc)
- {
- insert this:
- bool NPC::OnHit(PC & pc)
- {
- if (m_vnum)
- return HandleEvent(pc, QUEST_HIT_EVENT);
- else
- return HandleReceiveAllEvent(pc, QUEST_HIT_EVENT);
- }
- questnpc.h:
- after this:
- bool OnKill(PC& pc);
- insert this:
- bool OnHit(PC& pc);
- questmanager.h:
- after this:
- void Kill(unsigned int pc, unsigned int npc, unsigned int pc2 = 0);
- insert this:
- void Hit(unsigned int pc, unsigned int npc, bool isPC = false);
- quest.h
- after this:
- QUEST_ITEM_INFORMER_EVENT,
- insert this:
- QUEST_HIT_EVENT,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement