Jump to content

[search]Quest teleport map1 when you die


Recommended Posts

  • Premium

Die

File quest.h

Look for:

	QUEST_EVENT_COUNT

Add before:

QUEST_DIE_EVENT,

 

File questmanager.h

Look for:

void		Kill (unsigned int pc, unsigned int npc);

Add after:

void		Die (unsigned int pc, unsigned int npc);

 

File questnpc.h

Look for:

bool	OnPartyKill (PC &pc);

Add after:

bool	OnDie (PC &pc);

 

File char_battle.cpp

Inside the function

void CHARACTER::Dead (LPCHARACTER pkKiller, bool bImmediateDead)

Look for:

m_dwKillerPID = 0;

Add after:

	if (IsPC()) {
		if (pkKiller) {
			SetQuestNPCID (pkKiller->GetVID());
		}
		quest::CQuestManager::instance().Die (GetPlayerID(), (pkKiller) ? pkKiller->GetRaceNum() : quest::QUEST_NO_NPC);
	}

 

File questmanager.cpp

Look for:

m_mapEventName.insert (TEventNameMap::value_type ("item_informer", QUEST_ITEM_INFORMER_EVENT));

Add after:

m_mapEventName.insert (TEventNameMap::value_type ("die", QUEST_DIE_EVENT));

 

Look for:

bool CQuestManager::ServerTimer (unsigned int npc, unsigned int arg)

Add before:

	void CQuestManager::Die (unsigned int pc, unsigned int npc)
	{
		PC *pPC;
		sys_log (0, "CQuestManager::Kill QUEST_DIE_EVENT (pc=%d, npc=%d)", pc, npc);
		if ((pPC = GetPC (pc))) {
			if (!CheckQuestLoaded (pPC)) {
				return;
			}
			m_mapNPC[QUEST_NO_NPC].OnDie (*pPC);
		}
		else {
			sys_err ("QUEST: no such pc id : %d", pc);
		}
	}

 

File questnpc.cpp

Look for:

bool NPC::OnLevelUp (PC &pc)

Add before:

	bool NPC::OnDie (PC &pc)
	{
		return HandleReceiveAllEvent (pc, QUEST_DIE_EVENT);
	}

 

You can use

warp_to_village()

instead of

go_home()

like written above. Just replace it in the quest.

  • Love 1
Link to comment
Share on other sites

  • 4 weeks later...
  • 2 years later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.