Jump to content

[Help] Take Function In Quest Is Not Working


birender
 Share

Recommended Posts

Hi everyone,I can speak only English here.Hope anyone can translate this.Well I have problem with quests mainly with take function.For example i attached a quest That is when stones.quest with say "20093.take begin " the quest runs successfully and it is there in Object folder Share->Locale->Germany->Quest->Object->20093->take->pietre.startBut NPC 20093 is not accepting any item .take is not working.. No syserr in client or Server side.. NPC not talking when i drag any weapon or armor with socket stones..It happens for deviltower.quest ancient seal 20073 not accept 50084 key (.take function not working.)and many quest with .take Find me a solution for this.. Thanks in Advance

stones.quest

stones.quest

Link to comment
Share on other sites

Hello.

 

I tested your quest here and works liked a charm :/

 

Can you confirm if you have this in your game source or if its different?

 

quest.h

 

QUEST_ITEM_TAKE_EVENT,

 

questmanager.h

 

bool TakeItem(unsigned int pc, unsigned int npc, LPITEM item);

 

questnpc.cpp

 

bool NPC::OnTakeItem(PC& pc)

{

return HandleEvent(pc, QUEST_ITEM_TAKE_EVENT);

}

 

questnpc.h

 

bool OnTakeItem(PC& pc);

 

questmanager.cpp

m_mapEventName.insert(TEventNameMap::value_type("take", QUEST_ITEM_TAKE_EVENT));



bool CQuestManager::TakeItem(unsigned int pc, unsigned int npc, LPITEM item)
{
	//m_CurrentNPCRace = npc;
	PC* pPC;

	if ((pPC = GetPC(pc)))
	{
		if (!CheckQuestLoaded(pPC))
		{
			LPCHARACTER ch = CHARACTER_MANAGER::instance().FindByPID(pc);
			if (ch)
			{
				ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Äù½ºÆ®¸¦ ·ÎµåÇÏ´Â ÁßÀÔ´Ï´Ù. Àá½Ã¸¸ ±â´Ù·Á ÁֽʽÿÀ."));
			}
			return false;
		}
		// call script
		SetCurrentItem(item);
		return m_mapNPC[npc].OnTakeItem(*pPC);
	}
	else
	{
		//cout << "no such pc id : " << pc;
		sys_err("QUEST USE_ITEM_EVENT no such pc id : %d", pc);
		return false;
	}
}

Link to comment
Share on other sites

Thanks dude for reply

and here is it

everything is same and its there

 

questmanager.cpp

m_mapEventName.insert(TEventNameMap::value_type("take", QUEST_ITEM_TAKE_EVENT));

bool CQuestManager::TakeItem(unsigned int pc, unsigned int npc, LPITEM item) {
PC* pPC;


if ((pPC = GetPC(pc))) {
if (!CheckQuestLoaded(pPC)) {
LPCHARACTER ch = CHARACTER_MANAGER::instance().FindByPID(pc);
if (ch) {
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("퀘스트를 로드하는 중입니다. 잠시만 기다려 주십시오."));
}
return false;
}
SetCurrentItem(item);
return m_mapNPC[npc].OnTakeItem(*pPC);
} else {
sys_err("QUEST USE_ITEM_EVENT no such pc id : %d", pc);
return false;
}
}

questmanager.h

 

 

bool TakeItem(unsigned int pc, unsigned int npc, LPITEM item);

 

 

 

quest.h

QUEST_ITEM_TAKE_EVENT,

 

 

questnpc.cpp

bool NPC::OnTakeItem(PC& pc) {
return HandleEvent(pc, QUEST_ITEM_TAKE_EVENT);
}

 

questnpc.h

 

 

 

bool OnTakeItem(PC& pc);

 

 

as i pasted here

 

Anything wrong with quest functions?

 

can u give me your skype so I can add you and show directly :)

Link to comment
Share on other sites

Well the thing is my source dont have test_server..

Even though i added in my Config its not generating any txt (dev_log.txt or something)

when i drag the item to npc

 

and i just want to say fisher man when i drag fishing pole he is able to take it..

 

 

when 9009.take with item.vnum >= 27400 and item.vnum < 27590 and item.get_socket(0)!= item.get_value(2) begin

say_title("Fisherman:")

say("")

say("The level of this Fishing Rod is too low.")

say("")

say("I cannot upgrade it yet.")

say("")

end

This is working

and he says this message

 

But

When i drag 50084-Unlock key at 20073-Ancient seal at 5th floor of Demon Tower its not working no error

 

 

 

 

when devil_stone5.take with item.vnum == 50084 begin

npc.purge()

item.remove()

d.setf("stone_count", d.getf("stone_count") - 1)

if d.getf("stone_count") <= 0 then

d.clear_regen()

d.kill_all()

nothing works

 

and also that stone remove quest... i dont know what is weird in it...

Link to comment
Share on other sites

ye its there in quest npc

 

questnpc.txt

 

 

 

493 heukpung_gupae

1092 devil_stone6

20073 devil_stone5

504 orangkae_jangsu

635 jinunggwi_janggun

1091 devil_stone3

1302 greenfrog_general

2004 jipgae_geomi

2104 jeongal_ingan

8015 devil_stone1

 

its not with quest npc

check that stones.quest it has only 20093.take its normal vnum it must work right? its not :S

Link to comment
Share on other sites

I successfully started game in test server mode and gave the NPC socketed sword so that he can remove the stone but he didn't accept the sword and there is no file generated "DEV_LOG.log" or DEV_LOG.txt

 

syerr is empty and on syslog I get this message

 

SpawnMob: cannot create monster at non-exist sectree 768897 x 707111 (map 251)

CHARACTER COUNT vid 28679 pid 1

 

I dont think the above error is related to my question.

Any good idea you have to deal with this issue

Link to comment
Share on other sites

This is the query for insert statement

 

INSERT INTO `new_player`.`mob_proto` VALUES ('20073', '???', 'Ancient Seal', '5', '1', '0', '1', '', 'NOMOVE', '0', '', 'STUN,SLOW,CURSE,TERROR', '0', '', '2', '0', '0', '0', '0', '0', '0', '120', '3', '1', '0', '0', '10', '4', '100', '100', '0', '2000', '150', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', NULL, '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0');

 

INSERT INTO `new_player`.`mob_proto` VALUES ('20093', '??? ??', 'Koe-Pung', '5', '1', '0', '1', '', 'NOMOVE', '0', '', 'STUN,SLOW,CURSE,TERROR', '0', '', '1', '0', '0', '0', '0', '0', '0', '120', '3', '1', '0', '0', '10', '4', '100', '100', '0', '2000', '150', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', NULL, '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0');

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...