Jump to content

Wiki drop isn't showing any items [HELP]


Go to solution Solved by Amun,

Recommended Posts

Hey, I've added a wiki drop that looks like this

 spacer.png

but after adding everyting correctly im not seeing the slide bar or any items, when I press on monster it shows "doesn't drop anything"

since it's level restricted I tried with different levels of characters and monsters. Doesn't work and yes I do have drop included in common drop/mob drop item item etc.

spacer.png

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

1 hour ago, Amun said:

What about mob_drop_item?

You could've left a link to the system so we can see what's reading and what doesn't.

 

Regards,

Amun

Im sorry, I meant mob drop item, it is filled with drop. There nothing in any sysser or whatsoever.

Im giving you the files now since I forgot bout that sorry.

It is from polish forum so I can either link you the package that was included or separate files if you want.  I can also include screenshots if u don't wanna download anything.

link wiki system: 

This is the hidden content, please

virustotal scan of wiki system : https://www.virustotal.com/gui/url/c977489040f3054aa833d3a32d7f51582a90b8d3c7cd1479b5d88f9896f6b107?nocache=1

Here are the files that are in the system 

Spoiler

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 4
  • Eyes 1
  • Love 1
Link to comment
Share on other sites

  • Contributor
  • Solution

Right, skipping the part where it bloody loads the items whenever you click that button, let's find out if you actually get the items in binary. If you do, then the problem is from python/root.

In UserInterface/PythonNetworkStreamPhaseGame.cpp

Look for:

bool CPythonNetworkStream::RecvTargetInfoPacket()

In that function find

			if (pInstTarget->IsEnemy() || pInstTarget->IsStone())
			{
				PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_AddTargetMonsterDropInfo", 
				Py_BuildValue("(iii)", pInfoTargetPacket.race, pInfoTargetPacket.dwVnum, pInfoTargetPacket.count));
				PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_RefreshTargetMonsterDropInfo", Py_BuildValue("(i)", pInfoTargetPacket.race));
			}

And add a TraceError, like this:

			if (pInstTarget->IsEnemy() || pInstTarget->IsStone())
			{
				TraceError("DROP INFO: item: %d, count: %d", pInfoTargetPacket.dwVnum, pInfoTargetPacket.count);
				PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_AddTargetMonsterDropInfo", 
				Py_BuildValue("(iii)", pInfoTargetPacket.race, pInfoTargetPacket.dwVnum, pInfoTargetPacket.count));
				PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_RefreshTargetMonsterDropInfo", Py_BuildValue("(i)", pInfoTargetPacket.race));
			}

Recompile the binary, click to see the drop of a mob, and then check your syserr to see if it tells you the items.

  • Love 1
Link to comment
Share on other sites

22 minutes ago, Amun said:

Right, skipping the part where it bloody loads the items whenever you click that button, let's find out if you actually get the items in binary. If you do, then the problem is from python/root.

In UserInterface/PythonNetworkStreamPhaseGame.cpp

Look for:

bool CPythonNetworkStream::RecvTargetInfoPacket()

In that function find

			if (pInstTarget->IsEnemy() || pInstTarget->IsStone())
			{
				PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_AddTargetMonsterDropInfo", 
				Py_BuildValue("(iii)", pInfoTargetPacket.race, pInfoTargetPacket.dwVnum, pInfoTargetPacket.count));
				PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_RefreshTargetMonsterDropInfo", Py_BuildValue("(i)", pInfoTargetPacket.race));
			}

And add a TraceError, like this:

			if (pInstTarget->IsEnemy() || pInstTarget->IsStone())
			{
				TraceError("DROP INFO: item: %d, count: %d", pInfoTargetPacket.dwVnum, pInfoTargetPacket.count);
				PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_AddTargetMonsterDropInfo", 
				Py_BuildValue("(iii)", pInfoTargetPacket.race, pInfoTargetPacket.dwVnum, pInfoTargetPacket.count));
				PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_RefreshTargetMonsterDropInfo", Py_BuildValue("(i)", pInfoTargetPacket.race));
			}

Recompile the binary, click to see the drop of a mob, and then check your syserr to see if it tells you the items.

I've replaced the function as you said and now sysser shows the items

so the problem is somewhere in root?
spacer.png

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Contributor
Spoiler
2 minutes ago, Tuckii said:

I've replaced the function as you said and now sysser shows the items

so the problem is somewhere in root?
spacer.png

 

Good, now that we know that you actually receive the items, you can remove that TraceError.

Go to root/uiTarget.py and find

def __LoadInformation_Drops(self, race)

Then, after 

if race in constInfo.MONSTER_INFO_DATA

in the loop add a couple of traces to find out if it's actually loading and reading the items to and from constInfo.

Like this:

			def __LoadInformation_Drops(self, race):
				self.AppendSeperator()

				if race in constInfo.MONSTER_INFO_DATA:
					if len(constInfo.MONSTER_INFO_DATA[race]["items"]) == 0:
						self.AppendTextLine(localeInfo.TARGET_INFO_NO_ITEM_TEXT)
					else:
						itemListBox = ui.ListBoxExNew(32 + 5, self.MAX_ITEM_COUNT)
						itemListBox.SetSize(self.GetWidth() - 15 * 2 - ui.ScrollBar.SCROLLBAR_WIDTH, (32 + 5) * self.MAX_ITEM_COUNT)
						height = 0
						#here
						import dbg
						for curItem in constInfo.MONSTER_INFO_DATA[race]["items"]:
							if curItem.has_key("vnum_list"):
							# here
								dbg.TraceError("race %d, vnum_list: %d" % (race, curItem["vnum_list"]))
								height += self.AppendItem(itemListBox, curItem["vnum_list"], curItem["count"])
							else:
							#here
								dbg.TraceError("race %d, vnum: %d" % (race, curItem["vnum"]))
								height += self.AppendItem(itemListBox, curItem["vnum"], curItem["count"])
						if height < itemListBox.GetHeight():

If it shows the items in syserr, then the problem is from Append, if it doesn't show the items, then the problem is from def BINARY_AddTargetMonsterDropInfo.

You could also add some traces before that, just to know where it breaks.

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 1
Link to comment
Share on other sites

Spoiler
8 minutes ago, Amun said:
  Reveal hidden contents

 

Good, now that we know that you actually receive the items, you can remove that TraceError.

Go to root/uiTarget.py and find

def __LoadInformation_Drops(self, race)

Then, after 

if race in constInfo.MONSTER_INFO_DATA

in the loop add a couple of traces to find out if it's actually loading and reading the items to and from constInfo.

Like this:

			def __LoadInformation_Drops(self, race):
				self.AppendSeperator()

				if race in constInfo.MONSTER_INFO_DATA:
					if len(constInfo.MONSTER_INFO_DATA[race]["items"]) == 0:
						self.AppendTextLine(localeInfo.TARGET_INFO_NO_ITEM_TEXT)
					else:
						itemListBox = ui.ListBoxExNew(32 + 5, self.MAX_ITEM_COUNT)
						itemListBox.SetSize(self.GetWidth() - 15 * 2 - ui.ScrollBar.SCROLLBAR_WIDTH, (32 + 5) * self.MAX_ITEM_COUNT)
						height = 0
						#here
						import dbg
						for curItem in constInfo.MONSTER_INFO_DATA[race]["items"]:
							if curItem.has_key("vnum_list"):
							# here
								dbg.TraceError("race %d, vnum_list: %d" % (race, curItem["vnum_list"]))
								height += self.AppendItem(itemListBox, curItem["vnum_list"], curItem["count"])
							else:
							#here
								dbg.TraceError("race %d, vnum: %d" % (race, curItem["vnum"]))
								height += self.AppendItem(itemListBox, curItem["vnum"], curItem["count"])
						if height < itemListBox.GetHeight():

If it shows the items in syserr, then the problem is from Append, if it doesn't show the items, then the problem is from def BINARY_AddTargetMonsterDropInfo.

You could also add some traces before that, just to know where it breaks.

 

Sysser doesn't show anything so the problem is in def BINARY_AddTargetMonsterDropInfo as you said

so here is the problem? Even tho it's completely new function?

spacer.png

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Contributor
22 minutes ago, Tuckii said:
  Reveal hidden contents

 

Sysser doesn't show anything so the problem is in def BINARY_AddTargetMonsterDropInfo as you said

so here is the problem? Even tho it's completely new function?

spacer.png

Not in binary, in root.

If you look inside game.py, you'll see this

	if app.ENABLE_SEND_TARGET_INFO:
		def BINARY_AddTargetMonsterDropInfo(self, raceNum, itemVnum, itemCount):

This function is called with those arguments from your source through PyCallClassMemberFunc.

To see the items you receive from the source, you can just add a trace:

	if app.ENABLE_SEND_TARGET_INFO:
		def BINARY_AddTargetMonsterDropInfo(self, raceNum, itemVnum, itemCount):
			import dbg
			dbg.TraceError("race num %d, itemVnum %d, itemCount %d" % (raceNum, itemVnum, itemCount))
			if not raceNum in constInfo.MONSTER_INFO_DATA:

However, I don't see why that would be the problem. Also, from what I see, that function is actually building and updating the MONSTER_INFO_DATA dict, so the problem is probably from __LoadInformation_Drops.

Try adding this in uiTarge to see if the dict is still empty when the function is called:

			def __LoadInformation_Drops(self, race):
    			# this
				import dbg
				dbg.TraceError("ConstInfo data: %s" % str(constInfo.MONSTER_INFO_DATA))
				self.AppendSeperator()

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 1
Link to comment
Share on other sites

Spoiler
12 minutes ago, Amun said:

Not in binary, in root.

If you look inside game.py, you'll see this

	if app.ENABLE_SEND_TARGET_INFO:
		def BINARY_AddTargetMonsterDropInfo(self, raceNum, itemVnum, itemCount):

This function is called with those arguments from your source through PyCallClassMemberFunc.

To see the items you receive from the source, you can just add a trace:

	if app.ENABLE_SEND_TARGET_INFO:
		def BINARY_AddTargetMonsterDropInfo(self, raceNum, itemVnum, itemCount):
			import dbg
			dbg.TraceError("race num %d, itemVnum %d, itemCount %d" % (raceNum, itemVnum, itemCount))
			if not raceNum in constInfo.MONSTER_INFO_DATA:

However, I don't see why that would be the problem. Also, from what I see, that function is actually building and updating the MONSTER_INFO_DATA dict, so the problem is probably from __LoadInformation_Drops.

Try adding this in uiTarge to see if the dict is still empty when the function is called:

			def __LoadInformation_Drops(self, race):
    			# this
				import dbg
				dbg.TraceError("ConstInfo data: %s" % str(constInfo.MONSTER_INFO_DATA))
				self.AppendSeperator()

 

 

After applying the tracerror in gamepy there is nothing in sysser however when I applied tracerror under def _LoadInofrmation_Drops

then this is in sysser 

spacer.png

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Contributor
2 minutes ago, Tuckii said:
  Reveal hidden contents

 

After applying the tracerror in gamepy there is nothing in sysser however when I applied tracerror under def _LoadInofrmation_Drops

then this is in sysser 

spacer.png

Wait, so there's no syserr showing from game.py/BINARY_AddTargetMonsterDropInfo when you click to see the drop of a mob? It seems pretty impossible, could you try that again, please?

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 1
Link to comment
Share on other sites

10 minutes ago, Amun said:

Wait, so there's no syserr showing from game.py/BINARY_AddTargetMonsterDropInfo when you click to see the drop of a mob? It seems pretty impossible, could you try that again, please?

So after I replace it with yours it looks like this lmao

spacer.png

and syser

QnI7KHj.png

 

And function in game.py

spacer.png

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

  • Contributor
39 minutes ago, Tuckii said:

So after I replace it with yours it looks like this lmao

spacer.png

and syser

QnI7KHj.png

 

And function in game.py

spacer.png

That's because you added an extra tab to 'curList', just delete that extra tab and the error will go away.

Yeah, so the dict IS actually built and loaded properly. I'll take a look at how it retrieves it and I'll edit this post to let you know.

 

Try replacing it with this:

			def __LoadInformation_Drops(self, race):
				self.AppendSeperator()

				if (race not in constInfo.MONSTER_INFO_DATA) or (len(constInfo.MONSTER_INFO_DATA[race]["items"]) == 0) :
					self.AppendTextLine(localeInfo.TARGET_INFO_NO_ITEM_TEXT)
					return

				itemListBox = ui.ListBoxExNew(32 + 5, self.MAX_ITEM_COUNT)
				itemListBox.SetSize(self.GetWidth() - 15 * 2 - ui.ScrollBar.SCROLLBAR_WIDTH, (32 + 5) * self.MAX_ITEM_COUNT)
				height = 0

				for curItem in constInfo.MONSTER_INFO_DATA[race]["items"]:
					if curItem.has_key("vnum_list"):
						height += self.AppendItem(itemListBox, curItem["vnum_list"], curItem["count"])
					else:
						height += self.AppendItem(itemListBox, curItem["vnum"], curItem["count"])

				if height < itemListBox.GetHeight():
					itemListBox.SetSize(itemListBox.GetWidth(), height)

				self.AppendWindow(itemListBox, 15)
				itemListBox.SetBasePos(0)

				if len(constInfo.MONSTER_INFO_DATA[race]["items"]) > itemListBox.GetViewItemCount():
					itemScrollBar = ui.ScrollBar()
					itemScrollBar.SetParent(self)
					itemScrollBar.SetPosition(itemListBox.GetRight(), itemListBox.GetTop())
					itemScrollBar.SetScrollBarSize(32 * self.MAX_ITEM_COUNT + 5 * (self.MAX_ITEM_COUNT - 1))
					itemScrollBar.SetMiddleBarSize(float(self.MAX_ITEM_COUNT) / float(height / (32 + 5)))
					itemScrollBar.Show()
					itemListBox.SetScrollBar(itemScrollBar)

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 1
Link to comment
Share on other sites

  • 1 year later...

Hi @ Amun . I have the same error. I've followed step by step but still it's not showing any item. Maybe I'm miss something..

Here is my syserr:

Spoiler

0223 09:45:25578 :: DROP INFO: item: 2071, count: 1
0223 09:45:25578 :: DROP INFO: item: 7032, count: 1
0223 09:45:25578 :: DROP INFO: item: 3031, count: 1
0223 09:45:25594 :: DROP INFO: item: 3010, count: 1
0223 09:45:25594 :: DROP INFO: item: 5013, count: 1
0223 09:45:25594 :: DROP INFO: item: 2042, count: 1
0223 09:45:25611 :: DROP INFO: item: 33, count: 1
0223 09:45:25611 :: DROP INFO: item: 5001, count: 1
0223 09:45:25611 :: DROP INFO: item: 2021, count: 1
0223 09:45:25626 :: DROP INFO: item: 3003, count: 1
0223 09:45:25626 :: DROP INFO: item: 3042, count: 1
0223 09:45:25626 :: DROP INFO: item: 16061, count: 1
0223 09:45:25644 :: DROP INFO: item: 2012, count: 1
0223 09:45:25644 :: DROP INFO: item: 7021, count: 1
0223 09:45:25644 :: DROP INFO: item: 11201, count: 1
0223 09:45:25660 :: DROP INFO: item: 7011, count: 1
0223 09:45:25660 :: DROP INFO: item: 21, count: 1
0223 09:45:25660 :: DROP INFO: item: 70104, count: 1
0223 09:45:25676 :: DROP INFO: item: 11801, count: 1
0223 09:45:25676 :: DROP INFO: item: 52, count: 1
0223 09:45:25676 :: DROP INFO: item: 12, count: 1
0223 09:45:25693 :: DROP INFO: item: 17063, count: 1
0223 09:45:25693 :: DROP INFO: item: 15023, count: 1
0223 09:45:25693 :: DROP INFO: item: 11402, count: 1
0223 09:45:25709 :: DROP INFO: item: 4002, count: 1
 

uitarget.py def __LoadInformation_Drops (I've added the one that you post)

def __LoadInformation_Drops(self, race):
    self.AppendSeperator()

    if (race not in constInfo.MONSTER_INFO_DATA) or (len(constInfo.MONSTER_INFO_DATA[race]["items"]) == 0) :
        self.AppendTextLine(localeInfo.TARGET_INFO_NO_ITEM_TEXT)
        return

    itemListBox = ui.ListBoxExNew(32 + 5, self.MAX_ITEM_COUNT)
    itemListBox.SetSize(self.GetWidth() - 15 * 2 - ui.ScrollBar.SCROLLBAR_WIDTH, (32 + 5) * self.MAX_ITEM_COUNT)
    height = 0

    for curItem in constInfo.MONSTER_INFO_DATA[race]["items"]:
        if curItem.has_key("vnum_list"):
            height += self.AppendItem(itemListBox, curItem["vnum_list"], curItem["count"])
        else:
            height += self.AppendItem(itemListBox, curItem["vnum"], curItem["count"])

    if height < itemListBox.GetHeight():
        itemListBox.SetSize(itemListBox.GetWidth(), height)

    self.AppendWindow(itemListBox, 15)
    itemListBox.SetBasePos(0)

    if len(constInfo.MONSTER_INFO_DATA[race]["items"]) > itemListBox.GetViewItemCount():
        itemScrollBar = ui.ScrollBar()
        itemScrollBar.SetParent(self)
        itemScrollBar.SetPosition(itemListBox.GetRight(), itemListBox.GetTop())
        itemScrollBar.SetScrollBarSize(32 * self.MAX_ITEM_COUNT + 5 * (self.MAX_ITEM_COUNT - 1))
        itemScrollBar.SetMiddleBarSize(float(self.MAX_ITEM_COUNT) / float(height / (32 + 5)))
        itemScrollBar.Show()
        itemListBox.SetScrollBar(itemScrollBar)

PythonNetworkStreamPhaseGame.cpp bool

#ifdef ENABLE_SEND_TARGET_INFO
bool CPythonNetworkStream::RecvTargetInfoPacket()
{
	TPacketGCTargetInfo pInfoTargetPacket;

	if (!Recv(sizeof(TPacketGCTargetInfo), &pInfoTargetPacket))
	{
		Tracen("Recv Info Target Packet Error");
		return false;
	}

	CInstanceBase* pInstPlayer = CPythonCharacterManager::Instance().GetMainInstancePtr();
	CInstanceBase* pInstTarget = CPythonCharacterManager::Instance().GetInstancePtr(pInfoTargetPacket.dwVID);
	if (pInstPlayer && pInstTarget)
	{
		if (!pInstTarget->IsDead())
		{
			if (pInstTarget->IsEnemy() || pInstTarget->IsStone())
			{
				TraceError("DROP INFO: item: %d, count: %d", pInfoTargetPacket.dwVnum, pInfoTargetPacket.count);
				PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_AddTargetMonsterDropInfo",
					Py_BuildValue("(iii)", pInfoTargetPacket.race, pInfoTargetPacket.dwVnum, pInfoTargetPacket.count));
				PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_RefreshTargetMonsterDropInfo", Py_BuildValue("(i)", pInfoTargetPacket.race));
			}
			else
				PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "CloseTargetBoard", Py_BuildValue("()"));

			 m_pInstTarget = pInstTarget;
		}
	}
	else
	{
		PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "CloseTargetBoard", Py_BuildValue("()"));
	}

	return true;
}
#endif

game.py with TraceError

if app.ENABLE_SEND_TARGET_INFO:
		def BINARY_AddTargetMonsterDropInfo(self, raceNum, itemVnum, itemCount):
			import dbg
			dbg.TraceError("race num %d, itemVnum %d, itemCount %d" % (raceNum, itemVnum, itemCount))
			if not raceNum in constInfo.MONSTER_INFO_DATA:
				uiTarget.MONSTER_INFO_DATA.update({raceNum : {}})
				uiTarget.MONSTER_INFO_DATA[raceNum].update({"items" : []})
			curList = uiTarget.MONSTER_INFO_DATA[raceNum]["items"]

			isUpgradeable = False
			isMetin = False
			item.SelectItem(itemVnum)
			if item.GetItemType() == item.ITEM_TYPE_WEAPON or item.GetItemType() == item.ITEM_TYPE_ARMOR:
				isUpgradeable = True
			elif item.GetItemType() == item.ITEM_TYPE_METIN:
				isMetin = True

			for curItem in curList:
				if isUpgradeable:
					if curItem.has_key("vnum_list") and curItem["vnum_list"][0] / 10 * 10 == itemVnum / 10 * 10:
						if not (itemVnum in curItem["vnum_list"]):
							curItem["vnum_list"].append(itemVnum)
						return
				elif isMetin:
					if curItem.has_key("vnum_list"):
						baseVnum = curItem["vnum_list"][0]
					if curItem.has_key("vnum_list") and (baseVnum - baseVnum%1000) == (itemVnum - itemVnum%1000):
						if not (itemVnum in curItem["vnum_list"]):
							curItem["vnum_list"].append(itemVnum)
						return
				else:
					if curItem.has_key("vnum") and curItem["vnum"] == itemVnum and curItem["count"] == itemCount:
						return

			if isUpgradeable or isMetin:
				curList.append({"vnum_list":[itemVnum], "count":itemCount})
			else:
				curList.append({"vnum":itemVnum, "count":itemCount})

		def BINARY_RefreshTargetMonsterDropInfo(self, raceNum):
			self.targetBoard.RefreshMonsterInfoBoard()

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 3

      Crystal Metinstone

    2. 3

      Feeding game source to LLM

    3. 113

      Ulthar SF V2 (TMP4 Base)

    4. 3

      Feeding game source to LLM

    5. 0

      Target Information System

    6. 3

      Feeding game source to LLM

    7. 2

      anti exp explanation pls

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.