[Special Storage] Move Item

Totalitatea subiectelor care nu respectă regulamentul impus in sectiunea "Probleme şi Întrebări" vor fi stocate aici.
Închis
Avatar utilizator
Redder
Nivel 3

Nivel 3
Mesaje: 326
Membru din: 10 Iun 2017, 12:42
Aprecieri: 119  
Mulţumiri: 8  
Medalii

*Problemă/Întrebare:Am o problema cu functia de mutare a itemelor de Typ = ITEM_COSTUME in Special Storage
Tipologie server:--------------
*Resursă folosită:post662600.html?hilit=special%20storage#p662600
*ServerFiles utilizat:---------
*Syserr:--------------
Poză:
Imagine

*Detalii suplimentare: Sunt de parere ca el citeste din Inventarul normal, va las aici functia IsEmptyItemGrid

Cod: Selectaţi tot

bool CHARACTER::IsEmptyItemGrid(TItemPos Cell, BYTE bSize, int iExceptionCell) const
{
	switch (Cell.window_type)
	{
	case INVENTORY:
		{
			DWORD bCell = Cell.cell;

			// bItemCellÀº 0ÀÌ falseÀÓÀ» ³ªÅ¸³»±â À§ÇØ + 1 ÇØ¼­ ó¸®ÇÑ´Ù.
			// µû¶ó¼­ iExceptionCell¿¡ 1À» ´õÇØ ºñ±³ÇÑ´Ù.
			++iExceptionCell;

			if (Cell.IsBeltInventoryPosition())
			{
				LPITEM beltItem = GetWear(WEAR_BELT);

				if (NULL == beltItem)
					return false;

				if (false == CBeltInventoryHelper::IsAvailableCell(bCell - BELT_INVENTORY_SLOT_START, beltItem->GetValue(0)))
					return false;

				if (m_pointsInstant.bItemGrid[bCell])
				{
					if (m_pointsInstant.bItemGrid[bCell] == iExceptionCell)
						return true;

					return false;
				}

				if (bSize == 1)
					return true;

			}
			else if (bCell >= INVENTORY_MAX_NUM)
				return false;

			if (m_pointsInstant.bItemGrid[bCell])
			{
				if (m_pointsInstant.bItemGrid[bCell] == iExceptionCell)
				{
					if (bSize == 1)
						return true;

					int j = 1;
					BYTE bPage = bCell / (INVENTORY_MAX_NUM / 5);

					do
					{
						BYTE p = bCell + (5 * j);

						if (p >= INVENTORY_MAX_NUM)
							return false;

						if (p / (INVENTORY_MAX_NUM / 5) != bPage)
							return false;

						if (m_pointsInstant.bItemGrid[p])
							if (m_pointsInstant.bItemGrid[p] != iExceptionCell)
								return false;
					}
					while (++j < bSize);

					return true;
				}
				else
					return false;
			}

			// Å©±â°¡ 1À̸é ÇÑÄ­À» Â÷ÁöÇÏ´Â °ÍÀ̹ǷΠ±×³É ¸®ÅÏ
			if (1 == bSize)
				return true;
			else
			{
				int j = 1;
				BYTE bPage = bCell / (INVENTORY_MAX_NUM / 5);

				do
				{
					BYTE p = bCell + (5 * j);

					if (p >= INVENTORY_MAX_NUM)
						return false;

					if (p / (INVENTORY_MAX_NUM / 5) != bPage)
						return false;

					if (m_pointsInstant.bItemGrid[p])
						if (m_pointsInstant.bItemGrid[p] != iExceptionCell)
							return false;
				}
				while (++j < bSize);

				return true;
			}
		}
		break;
	case DRAGON_SOUL_INVENTORY:
		{
			WORD wCell = Cell.cell;
			if (wCell >= DRAGON_SOUL_INVENTORY_MAX_NUM)
				return false;

			// bItemCellÀº 0ÀÌ falseÀÓÀ» ³ªÅ¸³»±â À§ÇØ + 1 ÇØ¼­ ó¸®ÇÑ´Ù.
			// µû¶ó¼­ iExceptionCell¿¡ 1À» ´õÇØ ºñ±³ÇÑ´Ù.
			iExceptionCell++;

			if (m_pointsInstant.wDSItemGrid[wCell])
			{
				if (m_pointsInstant.wDSItemGrid[wCell] == iExceptionCell)
				{
					if (bSize == 1)
						return true;

					int j = 1;

					do
					{
						BYTE p = wCell + (DRAGON_SOUL_BOX_COLUMN_NUM * j);

						if (p >= DRAGON_SOUL_INVENTORY_MAX_NUM)
							return false;

						if (m_pointsInstant.wDSItemGrid[p])
							if (m_pointsInstant.wDSItemGrid[p] != iExceptionCell)
								return false;
					}
					while (++j < bSize);

					return true;
				}
				else
					return false;
			}

			// Å©±â°¡ 1À̸é ÇÑÄ­À» Â÷ÁöÇÏ´Â °ÍÀ̹ǷΠ±×³É ¸®ÅÏ
			if (1 == bSize)
				return true;
			else
			{
				int j = 1;

				do
				{
					BYTE p = wCell + (DRAGON_SOUL_BOX_COLUMN_NUM * j);

					if (p >= DRAGON_SOUL_INVENTORY_MAX_NUM)
						return false;

					if (m_pointsInstant.bItemGrid[p])
						if (m_pointsInstant.wDSItemGrid[p] != iExceptionCell)
							return false;
				}
				while (++j < bSize);

				return true;
			}
		}
#ifdef ENABLE_SPECIAL_STORAGE
		break;
	case UPGRADE_INVENTORY:
	{
		WORD wCell = Cell.cell;
		if (wCell >= SPECIAL_INVENTORY_MAX_NUM)
			return false;

		iExceptionCell++;

		if (m_pointsInstant.wSSUItemGrid[wCell])
		{
			if (m_pointsInstant.wSSUItemGrid[wCell] == iExceptionCell)
			{
				if (bSize == 1)
					return true;

				int j = 1;

				do
				{
					int p = wCell + (5 * j);

					if (p >= SPECIAL_INVENTORY_MAX_NUM)
						return false;

					if (m_pointsInstant.wSSUItemGrid[p])
						if (m_pointsInstant.wSSUItemGrid[p] != iExceptionCell)
							return false;
				} while (++j < bSize);

				return true;
			}
			else
				return false;
		}

		if (1 == bSize)
			return true;
		else
		{
			int j = 1;

			do
			{
				int p = wCell + (5 * j);

				if (p >= SPECIAL_INVENTORY_MAX_NUM)
					return false;

				if (m_pointsInstant.bItemGrid[p]) // old bItemGrid
					if (m_pointsInstant.wSSUItemGrid[p] != iExceptionCell)
						return false;
			} while (++j < bSize);

			return true;
		}
	}
	break;
	case BOOK_INVENTORY:
	{
		WORD wCell = Cell.cell;
		if (wCell >= SPECIAL_INVENTORY_MAX_NUM)
			return false;

		iExceptionCell++;

		if (m_pointsInstant.wSSBItemGrid[wCell])
		{
			if (m_pointsInstant.wSSBItemGrid[wCell] == iExceptionCell)
			{
				if (bSize == 1)
					return true;

				int j = 1;

				do
				{
					int p = wCell + (5 * j);

					if (p >= SPECIAL_INVENTORY_MAX_NUM)
						return false;

					if (m_pointsInstant.wSSBItemGrid[p])
						if (m_pointsInstant.wSSBItemGrid[p] != iExceptionCell)
							return false;
				} while (++j < bSize);

				return true;
			}
			else
				return false;
		}

		if (1 == bSize)
			return true;
		else
		{
			int j = 1;

			do
			{
				int p = wCell + (5 * j);

				if (p >= SPECIAL_INVENTORY_MAX_NUM)
					return false;

				if (m_pointsInstant.bItemGrid[p]) // old bItemGrid
					if (m_pointsInstant.wSSBItemGrid[p] != iExceptionCell)
						return false;
			} while (++j < bSize);

			return true;
		}
	}
	case STONE_INVENTORY:
	{
		WORD wCell = Cell.cell;
		if (wCell >= SPECIAL_INVENTORY_MAX_NUM)
			return false;

		iExceptionCell++;

		if (m_pointsInstant.wSSSItemGrid[wCell])
		{
			if (m_pointsInstant.wSSSItemGrid[wCell] == iExceptionCell)
			{
				if (bSize == 1)
					return true;

				int j = 1;

				do
				{
					int p = wCell + (5 * j);

					if (p >= SPECIAL_INVENTORY_MAX_NUM)
						return false;

					if (m_pointsInstant.wSSSItemGrid[p])
						if (m_pointsInstant.wSSSItemGrid[p] != iExceptionCell)
							return false;
				} while (++j < bSize);

				return true;
			}
			else
				return false;
		}

		if (1 == bSize)
			return true;
		else
		{
			int j = 1;

			do
			{
				int p = wCell + (5 * j);

				if (p >= SPECIAL_INVENTORY_MAX_NUM)
					return false;

				if (m_pointsInstant.bItemGrid[p]) // old bItemGrid
					if (m_pointsInstant.wSSSItemGrid[p] != iExceptionCell)
						return false;
			} while (++j < bSize);

			return true;
		}
	}

	case COSTUME_ARMOR_INVENTORY:
	{
		WORD wCell = Cell.cell;

		++iExceptionCell;

		if (wCell >= SPECIAL_INVENTORY_MAX_NUM)
			return false;

		//iExceptionCell++;

		if (m_pointsInstant.wSCAItemGrid[wCell])
		{
			if (m_pointsInstant.wSCAItemGrid[wCell] == iExceptionCell)
			{
				if (bSize == 1)
					return true;

				int j = 1;
				WORD bPage = wCell / (SPECIAL_INVENTORY_MAX_NUM / 3);

				do
				{
					int p = wCell + (5 * j);

					if (p >= SPECIAL_INVENTORY_MAX_NUM)
						return false;

					if (p / (SPECIAL_INVENTORY_MAX_NUM / 3) != bPage)
						return false;

					if (m_pointsInstant.wSCAItemGrid[p])
						if (m_pointsInstant.wSCAItemGrid[p] != iExceptionCell)
							return false;
				} while (++j < bSize);

				return true;
			}
			else
				return false;
		}

		if (1 == bSize)
			return true;
		else
		{
			int j = 1;
			WORD bPage = wCell / (SPECIAL_INVENTORY_MAX_NUM / 3);

			do
			{
				int p = wCell + (5 * j);

				if (p >= SPECIAL_INVENTORY_MAX_NUM)
					return false;

				if (p / (SPECIAL_INVENTORY_MAX_NUM / 3) != bPage)
					return false;

				if (m_pointsInstant.bItemGrid[p]) // old bItemGrid
					if (m_pointsInstant.wSCAItemGrid[p] != iExceptionCell)
						return false;
			} while (++j < bSize);

			return true;
		}
	}
	case COSTUME_WEAPON_INVENTORY:
	{
		WORD wCell = Cell.cell;

		++iExceptionCell;

		if (wCell >= SPECIAL_INVENTORY_MAX_NUM)
			return false;

		//iExceptionCell++;

		if (m_pointsInstant.wSCWItemGrid[wCell])
		{
			if (m_pointsInstant.wSCWItemGrid[wCell] == iExceptionCell)
			{
				if (bSize == 1)
					return true;

				int j = 1;
				WORD bPage = wCell / (SPECIAL_INVENTORY_MAX_NUM / 3);

				do
				{
					int p = wCell + (5 * j);

					if (p >= SPECIAL_INVENTORY_MAX_NUM)
						return false;

					if (p / (SPECIAL_INVENTORY_MAX_NUM / 3) != bPage)
						return false;

					if (m_pointsInstant.wSCWItemGrid[p])
						if (m_pointsInstant.wSCWItemGrid[p] != iExceptionCell)
							return false;
				} while (++j < bSize);

				return true;
			}
			else
				return false;
		}

		if (1 == bSize)
			return true;
		else
		{
			int j = 1;
			WORD bPage = wCell / (SPECIAL_INVENTORY_MAX_NUM / 3);

			do
			{
				int p = wCell + (5 * j);

				if (p >= SPECIAL_INVENTORY_MAX_NUM)
					return false;

				if (p / (SPECIAL_INVENTORY_MAX_NUM / 3) != bPage)
					return false;

				if (m_pointsInstant.bItemGrid[p]) // old bItemGrid
					if (m_pointsInstant.wSCWItemGrid[p] != iExceptionCell)
						return false;
			} while (++j < bSize);

			return true;
		}
	}
#endif
#ifdef ENABLE_SWITCHBOT
	case SWITCHBOT:
	{
		WORD wCell = Cell.cell;
		if (wCell >= SWITCHBOT_SLOT_COUNT)
		{
			return false;
		}

		if (m_pointsInstant.pSwitchbotItems[wCell])
		{
			return false;
		}

		return true;
	}
#endif
	}
}
Avatar utilizator
[RaKu]
Membru Club

Membru Club
Mesaje: 2137
Membru din: 30 Noi 2016, 21:49
Regat: Jinno
Aprecieri: 202  
Mulţumiri: 424  
Discord: Copiază ID
Medalii

Arhivat. Autorul nu a mai dat niciun semn în ultimele 5 zile.
Închis
Răspunsuri
6
Vizualizări
798
Răspunsuri
1
Vizualizări
279
Răspunsuri
19
Vizualizări
3675

Înapoi la “Arhivă Probleme şi Întrebări”

  • Informaţie
  • Cine este conectat

    Utilizatori ce ce navighează pe acest forum: Semrush [Bot] și 59 vizitatori