Jump to content

Game Core Help Please


Recommended Posts

1. Core

Spoiler

#0  0x08141872 in DESC::Packet (this=0x47d240ef, c_pvData=0x294fa000, iSize=76)
    at desc.cpp:462
        buf = <optimized out>
        iSize = 76
        c_pvData = 0x294fa000
        this = 0x47d240ef
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
#1  0x082afa21 in COfflineShop::Broadcast (this=0x438f68c0, data=0x294fa000,
    bytes=76) at offline_shop.cpp:507
No locals.
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
#2  0x082b0ad5 in COfflineShop::Buy (this=0x438f68c0, ch=0x4aecb000,
    bPos=16 '\020') at offline_shop.cpp:341
        szQuery = "SELECT pos,id,count,vnum,transmutation,evolution,price,price_cheque,socket0,socket1,socket2,socket3, attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtyp"...
        alSockets = {43200, 0, 0, 0}
        pMsg = {
          _M_t = {<std::_Tuple_impl<0u, _SQLMsg*, std::default_delete<_SQLMsg> >> = {<std::_Tuple_impl<1u, std::default_delete<_SQLMsg> >> = {<std::_Tuple_impl<2u>> = {<No data fields>}, <std::_Head_base<1u, std::default_delete<_SQLMsg>, true>> = {<std::default_delete<_SQLMsg>> = {<No data fields>}, <No data fields>}, <No data fields>}, <std::_Head_base<0u, _SQLMsg*, false>> = {
                _M_head_impl = 0x48f8bb50}, <No data fields>}, <No data fields>}}
---Type <return> to continue, or q <return> to quit---Quit
(gdb)

 

 

2. Core

Spoiler

#0  0x081a9c95 in ITEM_MANAGER::CreateItem (this=0x3cf73000, vnum=1173705728,
    count=692953228, id=0, bTryMagic=false, iRarePct=1020950176, bSkipSave=2,
    lBind=692953088) at item_manager.cpp:338
        i = 0
        __FUNCTION__ = "CreateItem"
        dwMaskVnum = <optimized out>
        item = 0xffff9f68
        bIsNewItem = <optimized out>
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
#1  0x0809c8b5 in CHARACTER::Destroy (this=this@entry=0x3cf73000)
    at char.cpp:668
        party = <optimized out>
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
#2  0x0809c942 in CHARACTER::~CHARACTER (this=0x3cf73000,
    __in_chrg=<optimized out>) at char.cpp:158
No locals.
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
#3  0x0809d01b in CHARACTER::~CHARACTER (this=0x3cf73000,
    __in_chrg=<optimized out>) at char.cpp:159
No locals.
#4  0x080e1578 in CHARACTER_MANAGER::UnregisterRaceNumMap (ch=<optimized out>,
    this=0xffffc074) at char_manager.cpp:1003
        dwVnum = <optimized out>
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
#5  CHARACTER_MANAGER::DestroyCharacter (this=0xffffc074,
    ch=ch@entry=0x3cf73000) at char_manager.cpp:160

 

 

3. Core

Spoiler

#0  DESC::Packet (this=0x4a1fc0f2, c_pvData=c_pvData@entry=0x294fa000,
    iSize=iSize@entry=76) at desc.cpp:437
        iSize = 76
        c_pvData = 0x294fa000
        this = 0x4a1fc0f2
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
#1  0x082aef71 in COfflineShop::Broadcast (this=this@entry=0x48d3f1c0,
    data=0x294fa000, bytes=bytes@entry=76) at offline_shop.cpp:505
        ch = <optimized out>
        it = {<std::tr1::__detail::_Hashtable_iterator_base<std::pair<CHARACTER* const, bool>, false>> = {_M_cur_node = 0x4a2f3160,
            _M_cur_bucket = 0x488773e0}, <No data fields>}
#2  0x082b0025 in COfflineShop::BroadcastUpdateItem (bDestroy=true,
    dwPID=<optimized out>, bPos=<optimized out>, this=<optimized out>)
    at offline_shop.cpp:407
        pack = {header = 47 '/', size = 76, subheader = 2 '\002'}
        pack2 = {pos = 26 '\032', item = {vnum = 0, price = 0,
            price_cheque = 0, witemVnum = 1143537664, count = 0 '\000',
            display_pos = 64 '@', alSockets = {0, 0, 0, 0}, aAttr = {{
                bType = 0 '\000', sValue = 0}, {bType = 0 '\000', sValue = 0},
              {bType = 0 '\000', sValue = 0}, {bType = 0 '\000', sValue = 0}, {
                bType = 0 '\000', sValue = 0}, {bType = 0 '\000', sValue = 0},
              {bType = 0 '\000', sValue = 0}}, transmutation = 682419179,
            evolution = 0, getLimitedCount = 2000686392,
---Type <return> to continue, or q <return> to quit---

 

 

4. Core

Spoiler

#0  0x081a14ad in CItem::GetType (this=<optimized out>) at item.h:78
78                      BYTE            GetType() const         { return m_pProto ? m_pProto->bType : 0;        }
[Current thread is 1 (LWP 100260)]
(gdb) bt full
Python Exception <type 'exceptions.ImportError'> No module named gdb.frames:
#0  0x081a14ad in CItem::GetType (this=<optimized out>) at item.h:78
No locals.
#1  CItem::IsMountItem (this=0x4987cf60) at item.cpp:2896
No locals.
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
#2  CItem::Unequip (this=this@entry=0x4987cf60) at item.cpp:1390
        dwImmuneFlag = <optimized out>
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
#3  0x081a17f8 in CItem::RemoveFromCharacter (this=this@entry=0x4987cf60)
    at item.cpp:433
        pOwner = <optimized out>
        __FUNCTION__ = "RemoveFromCharacter"
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
#4  0x080beab2 in CHARACTER::ClearItem (this=this@entry=0x497b9000)
    at char_item.cpp:597
        i = 88
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
#5  0x0809bbd5 in CHARACTER::Destroy (this=this@entry=0x497b9000)
    at char.cpp:668
        party = <optimized out>
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
#6  0x0809bc62 in CHARACTER::~CHARACTER (this=0x497b9000,
    __in_chrg=<optimized out>) at char.cpp:158
No locals.
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
#7  0x0809c33b in CHARACTER::~CHARACTER (this=0x497b9000,
    __in_chrg=<optimized out>) at char.cpp:159
No locals.
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
#8  0x080e02b8 in CHARACTER_MANAGER::DestroyCharacter (this=0xffffc074,
---Type <return> to continue, or q <return> to quit---

 

 

5. Core

Spoiler

#0  SECTREE::RemoveEntity (this=0x7a202c79, pkEnt=pkEnt@entry=0x430ed120)
    at sectree.cpp:163
163             ENTITY_SET::iterator it = m_set_entity.find(pkEnt);
[Current thread is 1 (LWP 100617)]
(gdb) bt full
Python Exception <type 'exceptions.ImportError'> No module named gdb.frames:
#0  SECTREE::RemoveEntity (this=0x7a202c79, pkEnt=pkEnt@entry=0x430ed120)
    at sectree.cpp:163
No locals.
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
#1  0x0819dbfc in CItem::RemoveFromGround (this=this@entry=0x430ed120)
    at item.cpp:557
No locals.
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
#2  0x081a8b89 in ITEM_MANAGER::DestroyItem (this=0xffffac24, item=0x430ed120)
    at item_manager.cpp:608
        __FUNCTION__ = "DestroyItem"
        it = <optimized out>
        dwID = 10005515
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
#3  0x080beff3 in CHARACTER::ClearItem (this=this@entry=0x420fc000)
    at char_item.cpp:597
        i = 277
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
#4  0x0809bf45 in CHARACTER::Destroy (this=this@entry=0x420fc000)
    at char.cpp:668
        party = <optimized out>
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
#5  0x0809bfd2 in CHARACTER::~CHARACTER (this=0x420fc000,
    __in_chrg=<optimized out>) at char.cpp:158
No locals.
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing:
#6  0x0809c6ab in CHARACTER::~CHARACTER (this=0x420fc000,
    __in_chrg=<optimized out>) at char.cpp:159
No locals.
---Type <return> to continue, or q <return> to quit---

 

 

Char_İtem 

Spoiler

#ifdef ENABLE_DELETE_ITEMS_SYSTEM
bool CHARACTER::DestroyItem(TItemPos Cell)
{
	LPITEM item = NULL; 

	if (!CanHandleItem())
		return false;

	if (IsDead() || IsStun())
		return false;

	if (!IsValidItemPosition(Cell) || !(item = GetItem(Cell)))
		return false;

	if (true == item->isLocked() || item->IsExchanging())
		return false;

	if (quest::CQuestManager::instance().GetPCForce(GetPlayerID())->IsRunning() == true)
		return false;

	if (item->IsBind() || item->IsUntilBind())
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("RUHA_BAGLI_NESNELER_SILINEMEZ"));
		return false;
	}

	// EXTRA_CHECK
	int iPulse = thecore_pulse();

	if (iPulse		- GetSafeboxLoadTime()		< PASSES_PER_SEC(g_nPortalLimitTime)
		|| iPulse	- GetRefineTime()			< PASSES_PER_SEC(g_nPortalLimitTime)
		|| iPulse	- GetMyShopTime()			< PASSES_PER_SEC(g_nPortalLimitTime))
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Please wait a second."));
		return false; 
	}

	if (GetOfflineShopOwner() || GetExchange() || GetMyShop() || GetShopOwner() || IsOpenSafebox() || IsCubeOpen() || IsAttrTransferOpen())
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("°Å·¡Ã¢,â°í µîÀ» ¿¬ »óÅ¿¡¼­´Â ±ÍȯºÎ,±Íȯ±â¾ïºÎ ¸¦ »ç¿ëÇÒ¼ö ¾ø½À´Ï´Ù."));
		return false;
	}
	// EXTRA_CHECK

	#ifdef ENABLE_NEW_PET_SYSTEM
	if (GetNewPetSystem()->IsActivePet())
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("pett-yolla"));
		return false;
	}
	#endif

	#ifdef ENABLE_SUPPORT_SYSTEM
	if (GetSupportSystem()->IsActiveSupport())
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("saman-yolla"));
		return false;
	}
	#endif

	if (item->GetVnum() >= 71220 && item->GetVnum() <= 71239)
	{
		return false;
	}

#ifdef ENABLE_NEW_PET_SYSTEM
	if (item->GetVnum() >= 55701 && item->GetVnum() <= 55710)
		DBManager::instance().DirectQuery("DELETE FROM new_petsystem WHERE id = %d", item->GetID());
#endif
#ifdef ENABLE_SUPPORT_SYSTEM
	if (item->GetVnum() >= 8383 && item->GetVnum() <= 8384)
		DBManager::instance().DirectQuery("DELETE FROM new_support WHERE id = %d", item->GetID());
#endif
	ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s has been deleted successfully."), item->GetName());
	ITEM_MANAGER::instance().RemoveItem(item);

	return true;
}
#endif

 

 

Item_Manager.cpp

Spoiler

#ifndef DEBUG_ALLOC
void ITEM_MANAGER::DestroyItem(LPITEM item)
#else
void ITEM_MANAGER::DestroyItem(LPITEM item, const char* file, size_t line)
#endif
{
	if (item->GetSectree())
		item->RemoveFromGround();

	if (item->GetOwner())
	{
		if (CHARACTER_MANAGER::instance().Find(item->GetOwner()->GetPlayerID()) != NULL)
		{
			//sys_err("DestroyItem: GetOwner %s %s!!", item->GetName(), item->GetOwner()->GetName());
			item->RemoveFromCharacter();
		}
		else
		{
			sys_err ("WTH! Invalid item owner. owner pointer : %p", item->GetOwner());
		}
	}

	TR1_NS::unordered_set<LPITEM>::iterator it = m_set_pkItemForDelayedSave.find(item);

	if (it != m_set_pkItemForDelayedSave.end())
		m_set_pkItemForDelayedSave.erase(it);

	DWORD dwID = item->GetID();
	sys_log(2, "ITEM_DESTROY %s:%u", item->GetName(), dwID);

	if (!item->GetSkipSave() && dwID)
	{
		DWORD dwOwnerID = item->GetLastOwnerPID();

		db_clientdesc->DBPacketHeader(HEADER_GD_ITEM_DESTROY, 0, sizeof(DWORD) + sizeof(DWORD));
		db_clientdesc->Packet(&dwID, sizeof(DWORD));
		db_clientdesc->Packet(&dwOwnerID, sizeof(DWORD));
	}
	else
	{
		sys_log(2, "ITEM_DESTROY_SKIP %s:%u (skip=%d)", item->GetName(), dwID, item->GetSkipSave());
	}

	if (dwID)
		m_map_pkItemByID.erase(dwID);

	m_VIDMap.erase(item->GetVID());

#ifdef M2_USE_POOL
	pool_.Destroy(item);
#else
#ifndef DEBUG_ALLOC
	M2_DELETE(item);
#else
	M2_DELETE_EX(item, file, line);
#endif
#endif
}

 

 

Item_Manager.cpp (CreateItem)

Spoiler

LPITEM ITEM_MANAGER::CreateItem(DWORD vnum, DWORD count, DWORD id, bool bTryMagic, int iRarePct, bool bSkipSave, long lBind)
{
	if (0 == vnum)
		return NULL;

	DWORD dwMaskVnum = 0;
	if (GetMaskVnum(vnum))
	{
		dwMaskVnum = GetMaskVnum(vnum);
	}

	if (LC_IsKorea() || LC_IsYMIR())
	{
#ifdef ENABLE_WOLFMAN_BOOK_SYSTEM
		if (vnum == 50300 && bTryMagic)
		{
			DWORD dwSkillVnum;
			DWORD dwSkillVnumWolfman;

			do
			{
				dwSkillVnum = number(1, 111);
				CSkillProto * pkSk = CSkillManager::instance().Get(dwSkillVnum);
				if (!pkSk)
					continue;

				dwSkillVnumWolfman = number(170, 175);
				CSkillProto * pkSki = CSkillManager::instance().Get(dwSkillVnumWolfman);
				if (!pkSki)
					continue;

				break;
			} while (1);

			vnum = 50400 + dwSkillVnum;
		}
#else
		if (vnum == 50300 && bTryMagic)
		{
			DWORD dwSkillVnum;

			do
			{
				dwSkillVnum = number(1, 111);
				CSkillProto * pkSk = CSkillManager::instance().Get(dwSkillVnum);
				if (!pkSk)
					continue;

				break;
			} while (1);

			vnum = 50400 + dwSkillVnum;
		}
#endif
	}

	const TItemTable* table = GetTable(vnum);

	if (NULL == table)
		return NULL;

	LPITEM item = NULL;

	//id·Î °Ë»çÇؼ­ Á¸ÀçÇÑ´Ù¸é -- ¸®ÅÏ! 
	if (m_map_pkItemByID.find(id) != m_map_pkItemByID.end())
	{
		item = m_map_pkItemByID[id];
		LPCHARACTER owner = item->GetOwner();
		sys_err("ITEM_ID_DUP: %u %s owner %p", id, item->GetName(), get_pointer(owner));
		return NULL;
	}

	//¾ÆÀÌÅÛ Çϳª ÇÒ´çÇÏ°í
#ifdef M2_USE_POOL
	item = pool_.Construct();
#else
	item = M2_NEW CItem(vnum);
#endif

	bool bIsNewItem = (0 == id);

	//ÃʱâÈ­ ÇÏ°í. Å×ÀÌºí ¼ÂÇÏ°í
	item->Initialize();
	item->SetProto(table);
	item->SetMaskVnum(dwMaskVnum);

	if (item->GetType() == ITEM_ELK) // µ·Àº ID°¡ ÇÊ¿ä¾ø°í ÀúÀåµµ ÇÊ¿ä¾ø´Ù.
		item->SetSkipSave(true);
#ifdef ENABLE_CHEQUE_SYSTEM
	else if (item->GetType() == ITEM_WON)
		item->SetSkipSave(true);
#endif
	// Unique ID¸¦ ¼¼ÆÃÇÏÀÚ
	else if (!bIsNewItem)
	{
		item->SetID(id);
		item->SetSkipSave(true);
	}
	else
	{
		item->SetID(GetNewID());

		if (item->GetType() == ITEM_UNIQUE) // À¯´ÏÅ© ¾ÆÀÌÅÛÀº »ı¼º½Ã¿¡ ¼ÒÄÏ¿¡ ³²Àº½Ã°£À» ±â·ÏÇÑ´Ù.
		{
			if (item->GetValue(2) == 0)
				item->SetSocket(ITEM_SOCKET_UNIQUE_REMAIN_TIME, item->GetValue(0)); // °ÔÀÓ ½Ã°£ À¯´ÏÅ©
			else
			{
				//int globalTime = get_global_time();
				//int lastTime = item->GetValue(0);
				//int endTime = get_global_time() + item->GetValue(0);
				item->SetSocket(ITEM_SOCKET_UNIQUE_REMAIN_TIME, get_global_time() + item->GetValue(0)); // ½Ç½Ã°£ À¯´ÏÅ©
			}
		}
	}


	switch (item->GetVnum())
	{
		case ITEM_AUTO_HP_RECOVERY_S:
		case ITEM_AUTO_HP_RECOVERY_M:
		case ITEM_AUTO_HP_RECOVERY_L:
		case ITEM_AUTO_HP_RECOVERY_X:
		case ITEM_AUTO_SP_RECOVERY_S:
		case ITEM_AUTO_SP_RECOVERY_M:
		case ITEM_AUTO_SP_RECOVERY_L:
		case ITEM_AUTO_SP_RECOVERY_X:
		case REWARD_BOX_ITEM_AUTO_SP_RECOVERY_XS:
		case REWARD_BOX_ITEM_AUTO_SP_RECOVERY_S:
		case REWARD_BOX_ITEM_AUTO_HP_RECOVERY_XS:
		case REWARD_BOX_ITEM_AUTO_HP_RECOVERY_S:
		case FUCKING_BRAZIL_ITEM_AUTO_SP_RECOVERY_S:
		case FUCKING_BRAZIL_ITEM_AUTO_HP_RECOVERY_S:
			if (bIsNewItem)
				item->SetSocket(2, item->GetValue(0), true);
			else
				item->SetSocket(2, item->GetValue(0), false);
			break;
	}

	if (item->GetType() == ITEM_ELK) // µ·Àº ¾Æ¹« 󸮰¡ ÇÊ¿äÇÏÁö ¾ÊÀ½
		;
#ifdef ENABLE_CHEQUE_SYSTEM
	else if (item->GetType() == ITEM_WON)
		;
#endif
	else if (item->IsStackable())  // ÇÕÄ¥ ¼ö ÀÖ´Â ¾ÆÀÌÅÛÀÇ °æ¿ì
	{
		count = MINMAX(1, count, ITEM_MAX_COUNT);

		if (bTryMagic && count <= 1 && IS_SET(item->GetFlag(), ITEM_FLAG_MAKECOUNT))
			count = item->GetValue(1);
	}
	else
		count = 1;

	item->SetVID(++m_dwVIDCount);

	if (bSkipSave == false)
		m_VIDMap.insert(ITEM_VID_MAP::value_type(item->GetVID(), item));

	if (item->GetID() != 0 && bSkipSave == false)
		m_map_pkItemByID.insert(std::map<DWORD, LPITEM>::value_type(item->GetID(), item));

	if (!item->SetCount(count))
		return NULL;

	item->Bind(lBind);
	if (item->IsUntilBind())
		item->StartUnBindingExpireEvent();

	item->SetSkipSave(false);

	if (item->GetType() == ITEM_UNIQUE && item->GetValue(2) != 0)
		item->StartUniqueExpireEvent();

	for (int i=0 ; i < ITEM_LIMIT_MAX_NUM ; i++)
	{
		// ¾ÆÀÌÅÛ »ı¼º ½ÃÁ¡ºÎÅÍ »ç¿ëÇÏÁö ¾Ê¾Æµµ ½Ã°£ÀÌ Â÷°¨µÇ´Â ¹æ½Ä
		if (LIMIT_REAL_TIME == item->GetLimitType(i))
		{
			if (item->GetLimitValue(i))
			{
				item->SetSocket(0, time(0) + item->GetLimitValue(i)); 
			}
			else
			{
				item->SetSocket(0, time(0) + 60*60*24*7); 
			}

			item->StartRealTimeExpireEvent();
		}

		// ±âÁ¸ À¯´ÏÅ© ¾ÆÀÌÅÛó·³ Âø¿ë½Ã¿¡¸¸ »ç¿ë°¡´É ½Ã°£ÀÌ Â÷°¨µÇ´Â ¹æ½Ä
		else if (LIMIT_TIMER_BASED_ON_WEAR == item->GetLimitType(i))
		{
			// ÀÌ¹Ì Âø¿ëÁßÀÎ ¾ÆÀÌÅÛÀ̸é ŸÀ̸Ӹ¦ ½ÃÀÛÇÏ°í, »õ·Î ¸¸µå´Â ¾ÆÀÌÅÛÀº »ç¿ë °¡´É ½Ã°£À» ¼¼ÆÃÇØÁØ´Ù. (
			// ¾ÆÀÌÅÛ¸ô·Î Áö±ŞÇÏ´Â °æ¿ì¿¡´Â ÀÌ ·ÎÁ÷¿¡ µé¾î¿À±â Àü¿¡ Socket0 °ªÀÌ ¼¼ÆÃÀÌ µÇ¾î ÀÖ¾î¾ß ÇÑ´Ù.
			if (true == item->IsEquipped())
			{
				item->StartTimerBasedOnWearExpireEvent();
			}
			else if(0 == id)
			{
				long duration = item->GetSocket(0);
				if (0 == duration)
					duration = item->GetLimitValue(i);

				if (0 == duration)
					duration = 60 * 60 * 10;	// Á¤º¸°¡ ¾Æ¹«°Íµµ ¾øÀ¸¸é µğÆúÆ®·Î 10½Ã°£ ¼¼ÆÃ

				item->SetSocket(0, duration);
			}
		}
	}

#ifdef ENABLE_MINI_GAME_CATCH_KING
	if(item->GetVnum() == 79603 || item->GetVnum() == 79604)
	{
		if(quest::CQuestManager::instance().GetEventFlag("enable_catch_king_event"))
		{
			int iEndTime = quest::CQuestManager::instance().GetEventFlag("catch_king_event_end_day");
	
			if(iEndTime)
			{
				item->SetSocket(0, iEndTime);
			}
		}
	}
#endif

	if(item->GetType() == ITEM_GACHA)
		item->SetSocket(0, item->GetLimitValue(1));

	if (id == 0) // »õ·Î ¸¸µå´Â ¾ÆÀÌÅÛÀÏ ¶§¸¸ ó¸®
	{
		// »õ·ÎÃß°¡µÇ´Â ¾àÃʵéÀÏ°æ¿ì ¼º´ÉÀ» ´Ù¸£°Ôó¸®
		if (ITEM_BLEND==item->GetType())
		{
			if (Blend_Item_find(item->GetVnum()))
			{
				Blend_Item_set_value(item);
				return item;
			}
		}

		if (table->sAddonType)
		{
			item->ApplyAddon(table->sAddonType);
		}

		if (bTryMagic)
		{
			if (iRarePct == -1)
				iRarePct = table->bAlterToMagicItemPct;

			if (number(1, 100) <= iRarePct)
				item->AlterToMagicItem();
		}

		if (table->bGainSocketPct)
			item->AlterToSocketItem(table->bGainSocketPct);

		if (vnum == 50300 || vnum == ITEM_SKILLFORGET_VNUM)
		{
			DWORD dwSkillVnum;
			do
			{
#ifdef ENABLE_WOLFMAN_BOOK_SYSTEM
				if (number(1, 20) == 2)
				{
					dwSkillVnum = number(170, 175);
				}
				else
				{
					dwSkillVnum = number(1, 111);
				}
#else
				dwSkillVnum = number(1, 111);
#endif
				if (NULL != CSkillManager::instance().Get(dwSkillVnum))
					break;
			}
			while (true);
			item->SetSocket(0, dwSkillVnum);
		}
		else if (ITEM_SKILLFORGET2_VNUM == vnum)
		{
			DWORD dwSkillVnum;

			do
			{
				dwSkillVnum = number(112, 119);

				if (NULL != CSkillManager::instance().Get(dwSkillVnum))
					break;
			} while (true);

			item->SetSocket(0, dwSkillVnum);
		}
	}
	else
	{
		// 100% È®·ü·Î ¼Ó¼ºÀÌ ºÙ¾î¾ß Çϴµ¥ ¾È ºÙ¾îÀÖ´Ù¸é »õ·Î ºÙÈù´Ù. ...............
		if (100 == table->bAlterToMagicItemPct && 0 == item->GetAttributeCount())
		{
			item->AlterToMagicItem();
		}
	}

	if (item->GetType() == ITEM_QUEST)
	{
		for (itertype (m_map_pkQuestItemGroup) it = m_map_pkQuestItemGroup.begin(); it != m_map_pkQuestItemGroup.end(); it++)
		{
			if (it->second->m_bType == CSpecialItemGroup::QUEST && it->second->Contains(vnum))
			{
				item->SetSIGVnum(it->first);
			}
		}
	}
	else if (item->GetType() == ITEM_UNIQUE || item->GetSubType() == COSTUME_MOUNT)
	{
		for (itertype(m_map_pkSpecialItemGroup) it = m_map_pkSpecialItemGroup.begin(); it != m_map_pkSpecialItemGroup.end(); it++)
		{
			if (it->second->m_bType == CSpecialItemGroup::SPECIAL && it->second->Contains(vnum))
			{
				item->SetSIGVnum(it->first);
			}
		}
	}

	else if (item->GetType() == ITEM_GACHA) {
		item->SetSocket(0, item->GetLimitValue(1) * count);
	}

	// »õ·Î »ı¼ºµÇ´Â ¿ëÈ¥¼® ó¸®.
	if (item->IsDragonSoul() && 0 == id)
	{
		DSManager::instance().DragonSoulItemInitialize(item);
	}
	return item;
}

 

 

Offlineshop.cpp (BroadcastUpdateItem) // KeN OfflineShop

Spoiler

void COfflineShop::BroadcastUpdateItem(BYTE bPos, DWORD dwPID, bool bDestroy)
{
	TPacketGCShop pack;
	TPacketGCShopUpdateItem pack2;

	TEMP_BUFFER buf;

	pack.header = HEADER_GC_OFFLINE_SHOP;
	pack.subheader = SHOP_SUBHEADER_GC_UPDATE_ITEM;
	pack.size = sizeof(pack) + sizeof(pack2);
	pack2.pos = bPos;

	if (bDestroy)
	{
		pack2.item.vnum = 0;
		pack2.item.count = 0;
		pack2.item.price = 0;
		pack2.item.price_cheque = 0;
		pack2.item.evolution = 0;
		memset(pack2.item.alSockets, 0, sizeof(pack2.item.alSockets));
		memset(pack2.item.aAttr, 0, sizeof(pack2.item.aAttr));
	}
	else
	{
		char szQuery[1024];
		snprintf(szQuery, sizeof(szQuery), "SELECT pos,count,vnum,transmutation,evolution,price,price_cheque,socket0,socket1,socket2,socket3, attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6, applytype0, applyvalue0, applytype1, applyvalue1, applytype2, applyvalue2, applytype3, applyvalue3, applytype4, applyvalue4, applytype5, applyvalue5, applytype6, applyvalue6, applytype7, applyvalue7 FROM %soffline_shop_item WHERE owner_id = %u and pos = %d", get_table_postfix(), dwPID, bPos);
		std::unique_ptr<SQLMsg> pMsg(DBManager::Instance().DirectQuery(szQuery));
		MYSQL_ROW row;
		while (NULL != (row = mysql_fetch_row(pMsg->Get()->pSQLResult)))
		{
			str_to_number(pack2.item.count, row[1]);
			str_to_number(pack2.item.vnum, row[2]);
			str_to_number(pack2.item.transmutation, row[3]);
			str_to_number(pack2.item.evolution, row[4]);
			str_to_number(pack2.item.price, row[5]);
			str_to_number(pack2.item.price_cheque, row[6]);

			// Set Sockets
			for (int i = 0, n = 7; i < ITEM_SOCKET_MAX_NUM; ++i, n++)
				str_to_number(pack2.item.alSockets[i], row[n]);
			// End Of Sockets

			// Set Attributes
			for (int i = 0, iStartAttributeType = 11, iStartAttributeValue = 12; i < ITEM_ATTRIBUTE_MAX_NUM; ++i, iStartAttributeType += 2, iStartAttributeValue += 2)
			{
				str_to_number(pack2.item.aAttr[i].bType, row[iStartAttributeType]);
				str_to_number(pack2.item.aAttr[i].sValue, row[iStartAttributeValue]);
			}
			// End Of Set Attributes
		}
	}

	buf.write(&pack, sizeof(pack));
	buf.write(&pack2, sizeof(pack2));
	Broadcast(buf.read_peek(), buf.size());
}

 

 

@Mali61 @stussy @Johnny69 @.ZeNu @Raylee @VegaS™ @Syriza @CxL'Mufuku @Ken @WLsj24 @xP3NG3Rx

 

Thank you in advance for your help.

Link to comment
Share on other sites

  • Replies 8
  • Created
  • Last Reply

Top Posters In This Topic

    if (count <= 0 || count > item->GetCount())
        count = item->GetCount();

    if (count == item->GetCount())
        ITEM_MANAGER::instance().RemoveItem(item, "ITEM_DELETE");
    else
        item->SetCount(item->GetCount() - count);
 

Good day for everyone :)

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



×
×
  • 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.