Suppose that I have this snippet:
Code:
when kill with npc.is_pc() begin syschat(npc.get_vid()) end
1. When I kill a character the npc.is_pc() function returns false
2. When that character kills me and after I kill it again the npc.is_pc() returns true and the script runs
questmanager.cpp
Code:
void CQuestManager::Kill(unsigned int pc, unsigned int npc)
{
//m_CurrentNPCRace = npc;
PC * pPC;
sys_log(0, "CQuestManager::Kill QUEST_KILL_EVENT (pc=%d, npc=%d)", pc, npc);
if ((pPC = GetPC(pc)))
{
if (!CheckQuestLoaded(pPC))
return;
/* [hyo] �� kill�� �ߺ� ī���� �̽� ������ ��������
quest script�� when 171.kill begin ... ���� �ڵ�� ���Ͽ� ��ũ��Ʈ�� ó���Ǿ�����
�ٷ� return���� �ʰ� �ٸ� �˻絵 �����ϵ��� ������. (2011/07/21)
*/
// call script
if(npc > 0)
{
m_mapNPC[npc].OnKill(*pPC);
}
LPCHARACTER ch = GetCurrentCharacterPtr();
LPPARTY pParty = ch->GetParty();
LPCHARACTER leader = pParty ? pParty->GetLeaderCharacter() : ch;
if (leader)
{
m_pCurrentPartyMember = ch;
if (m_mapNPC[npc].OnPartyKill(*GetPC(leader->GetPlayerID())))
return;
pPC = GetPC(pc);
}
if (m_mapNPC[QUEST_NO_NPC].OnKill(*pPC))
return;
if (leader)
{
m_pCurrentPartyMember = ch;
m_mapNPC[QUEST_NO_NPC].OnPartyKill(*GetPC(leader->GetPlayerID()));
}
}
else
sys_err("QUEST: no such pc id : %d", pc);
}
Code:
quest::CQuestManager::instance().Kill(pkKiller->GetPlayerID(), quest::QUEST_NO_NPC);
Code:
quest::CQuestManager::instance().Kill(pkAttacker->GetPlayerID(), GetRaceNum());
Code:
Jul 22 19:56:49.534963 :: CQuestManager::Kill QUEST_KILL_EVENT (pc=70120, npc=0)
Does anyone experienced it before?
----------------------------------------------------------------------------------------------------
[SOLVED][C++][Source]
Adding these lines fixed my problem:
char_battle.cpp Reward function after pkAttacker->SetQuestNPCID(GetVID()); line:
Code:
SetQuestNPCID(pkAttacker->GetVID());
Code:
SetQuestNPCID(pkKiller->GetVID());







