Jump to content

Fix Target Info System


Intel

Recommended Posts

  • Premium
On 6/13/2023 at 1:40 PM, anton96 said:

Should this be placed under :?

#ifdef __SEND_TARGET_INFO__
bool ITEM_MANAGER::CreateDropItemVector(LPCHARACTER pkChr, LPCHARACTER pkKiller, std::vector<LPITEM> & vec_item)
{
	if (pkChr->IsPolymorphed() || pkChr->IsPC())
	{
		return false;
	}

	int iLevel = pkKiller->GetLevel();

	BYTE bRank = pkChr->GetMobRank();
	LPITEM item = NULL;

	std::vector<CItemDropInfo>::iterator it = g_vec_pkCommonDropItem[bRank].begin();

Or does it go under :?

bool ITEM_MANAGER::CreateDropItem(LPCHARACTER pkChr, LPCHARACTER pkKiller, std::vector<LPITEM> & vec_item)
{
	int iLevel = pkKiller->GetLevel();

	int iDeltaPercent, iRandRange;
	if (!GetDropPct(pkChr, pkKiller, iDeltaPercent, iRandRange))
		return false;

	BYTE bRank = pkChr->GetMobRank();
	LPITEM item = NULL;

	// Common Drop Items
std::vector<CItemDropInfo>::iterator it = g_vec_pkCommonDropItem[bRank].begin();

I've gotten a bit confused as to what should calculate drop rate should replace...

I just had used the level to show drop from common drop items with the level difference chosen in common_drop_item.txt. You posted two different functions. The first one is the target info, the second one is where the items are actually dropped (that you should not touch).

Let's say I set an item from level 75 to 99, a player level 74 won't see the item in the info drop list:

	while (it != g_vec_pkCommonDropItem[bRank].end())
	{
		const CItemDropInfo & c_rInfo = *(it++);
		
      		//LEVEL CHECK
		if(iLevel < c_rInfo.m_iLevelStart || iLevel > c_rInfo.m_iLevelEnd)
			continue;

		TItemTable * table = GetTable(c_rInfo.m_dwVnum);

		if(!table)
			continue;

		int rarity = CalculateDropRarityCommonDropItem((c_rInfo.m_iPercent * iDeltaPercent) / 100, iRandRange);
		if(rarity){
			vec_item.emplace_back(c_rInfo.m_dwVnum, 1, rarity);
		}
	}

 

Edited by Intel
Link to comment
Share on other sites

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.