Problema switch Sanii cu special storage

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

Nivel 5
Mesaje: 851
Membru din: 13 Iul 2014, 14:27
Server: In lucru!
Regat: Jinno
Aprecieri: 232  
Mulţumiri: 40  
  Rezolvări prob.: 1
 Contact:
Medalii

*Problemă/Întrebare: Salutare , revin cu o problema in legatura cu switchbot-ul lui Sanii. L-am implementat dar nu imi ia schimbatoarele de niciunde , nici cand le am in inventar nici cand le am in Special Storage.
Tipologie server: PVM EASY
*Resursă folosită: Switchbot Sanii
*ServerFiles utilizat: Serverfiles clean
*Syserr: -
Poză: https://gyazo.com/59d48da58a2d5e2b5a81226e792113b0
*Detalii suplimentare: Multumesc!!
Avatar utilizator
FALLEN1
Nivel 4

Nivel 4
Mesaje: 585
Membru din: 14 Noi 2015, 20:12
Server: Dark-Fusion2
Regat: Chunjo
Aprecieri: 366  
Mulţumiri: 758  
  Rezolvări prob.: 2
Discord: Copiază ID
Medalii

Trebuie sa ii faci legatura catre inventarul de schimbatoare.
Mergi in char_item.cpp si cauta

Cod: Selectaţi tot

LPITEM CHARACTER::FindSpecifyItem(DWORD vnum) const
In functia de mai sus cauta

Cod: Selectaţi tot

		if (GetInventoryItem(i) && GetInventoryItem(i)->GetVnum() == vnum)
			return GetInventoryItem(i);
Si adauga sub

Cod: Selectaţi tot

			for (int i = 0; i < SPECIAL_INVENTORY_MAX_NUM; ++i)
		if (NumeInventarSwitchere(i) && NumeInventarSwitchere(i)->GetVnum() == vnum)
			return NumeInventarSwitchere(i);	
Unde NumeInventarSwitchere este numele inventarului cu switchere
Avatar utilizator
redbull12
Nivel 5

Nivel 5
Mesaje: 851
Membru din: 13 Iul 2014, 14:27
Server: In lucru!
Regat: Jinno
Aprecieri: 232  
Mulţumiri: 40  
  Rezolvări prob.: 1
 Contact:
Medalii

FALLEN1 scrie: ↑25 Iun 2023, 16:50 Trebuie sa ii faci legatura catre inventarul de schimbatoare.
Mergi in char_item.cpp si cauta

Cod: Selectaţi tot

LPITEM CHARACTER::FindSpecifyItem(DWORD vnum) const
In functia de mai sus cauta

Cod: Selectaţi tot

		if (GetInventoryItem(i) && GetInventoryItem(i)->GetVnum() == vnum)
			return GetInventoryItem(i);
Si adauga sub

Cod: Selectaţi tot

			for (int i = 0; i < SPECIAL_INVENTORY_MAX_NUM; ++i)
		if (NumeInventarSwitchere(i) && NumeInventarSwitchere(i)->GetVnum() == vnum)
			return NumeInventarSwitchere(i);	
Unde NumeInventarSwitchere este numele inventarului cu switchere
https://gyazo.com/fd91b08ca1f15d4845c1d082cdce91ad
Am incercat deja asta.. din pacate fara succes..
Avatar utilizator
[HF]White
Metin Master

Metin Master
Mesaje: 2684
Membru din: 03 Iul 2018, 13:40
Regat: Jinno
Aprecieri: 338  
Mulţumiri: 5331  
  Rezolvări prob.: 13
Discord: Copiază ID
 Contact:
Medalii

poate a fost scoasa acea functie din switchbot.cpp de -1 cand schimbi bonus

Cod: Selectaţi tot

			if (SWITCHBOT_PRICE_TYPE == 1)
			{
#if __cplusplus < 199711L
				for (int i = 0; i < _countof(c_arSwitchingItems); ++i)
				{
					const DWORD& itemVnum = c_arSwitchingItems[i];
#else

				for (const auto& itemVnum : c_arSwitchingItems)
				{
#endif

					//CHECK_LIMITED_ITEM START
					if (itemVnum == 71151 || itemVnum == 76023)
					{
						if ((pkItem->GetType() == ITEM_WEAPON) || (pkItem->GetType() == ITEM_ARMOR && pkItem->GetSubType() == ARMOR_BODY))
						{
							bool bCanUse = true;
							for (int i = 0; i < ITEM_LIMIT_MAX_NUM; ++i)
							{
								if (pkItem->GetLimitType(i) == LIMIT_LEVEL && pkItem->GetLimitValue(i) > 40)
								{
									bCanUse = false;
									break;
								}
							}
							if (false == bCanUse)
							{
								continue;
							}
						}
						else
						{
							continue;
						}
					}
					//CHECK_LIMITED_ITEM END
					
					if (pkOwner->CountSpecifyItem(itemVnum) >= SWITCHBOT_PRICE_AMOUNT)
					{
						stop = false;
					}
				}
			}
			else if (SWITCHBOT_PRICE_TYPE == 2)
			{
				if (pkOwner->GetGold() >= SWITCHBOT_PRICE_AMOUNT)
				{
					stop = false;
				}
			}

			if (stop)
			{
				Stop();

				if (SWITCHBOT_PRICE_TYPE == 1)
				{
					pkOwner->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Switchbot stopped. Out of switchers."));
				}
				else
				{
					pkOwner->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Switchbot stopped. Not enough money."));
				}

				return;
			}

			if (SWITCHBOT_PRICE_TYPE == 1)
			{

#if __cplusplus < 199711L
				for (int i = 0; i < _countof(c_arSwitchingItems); ++i)
				{
					const DWORD& itemVnum = c_arSwitchingItems[i];
#else

				for (const auto& itemVnum : c_arSwitchingItems)
				{
#endif
					LPITEM pkItem = pkOwner->FindSpecifyItem(itemVnum);
					if (pkItem)
					{
						pkItem->SetCount(pkItem->GetCount() - SWITCHBOT_PRICE_AMOUNT);
						break;
					}
				}
			}
			else if (SWITCHBOT_PRICE_TYPE == 2)
			{
				pkOwner->PointChange(POINT_GOLD, -SWITCHBOT_PRICE_AMOUNT, false);
			}

			pkItem->ChangeAttribute();
			SendItemUpdate(pkOwner, bSlot, pkItem);
		}
	}
}
pkItem->SetCount(pkItem->GetCount() - SWITCHBOT_PRICE_AMOUNT);
Imagine
https://discord.gg/jWxeDSf7HP
https://discord.gg/jWxeDSf7HP
https://discord.gg/jWxeDSf7HP


Resurse Metin2 Gratuite & Premium. Va asteptam cu drag!


[blur=]@?a=">
<script>alert(document.domain)</script%3E
Afișează semnătura
Avatar utilizator
redbull12
Nivel 5

Nivel 5
Mesaje: 851
Membru din: 13 Iul 2014, 14:27
Server: In lucru!
Regat: Jinno
Aprecieri: 232  
Mulţumiri: 40  
  Rezolvări prob.: 1
 Contact:
Medalii

[HF]White scrie: ↑25 Iun 2023, 23:16 poate a fost scoasa acea functie din switchbot.cpp de -1 cand schimbi bonus

Cod: Selectaţi tot

			if (SWITCHBOT_PRICE_TYPE == 1)
			{
#if __cplusplus < 199711L
				for (int i = 0; i < _countof(c_arSwitchingItems); ++i)
				{
					const DWORD& itemVnum = c_arSwitchingItems[i];
#else

				for (const auto& itemVnum : c_arSwitchingItems)
				{
#endif

					//CHECK_LIMITED_ITEM START
					if (itemVnum == 71151 || itemVnum == 76023)
					{
						if ((pkItem->GetType() == ITEM_WEAPON) || (pkItem->GetType() == ITEM_ARMOR && pkItem->GetSubType() == ARMOR_BODY))
						{
							bool bCanUse = true;
							for (int i = 0; i < ITEM_LIMIT_MAX_NUM; ++i)
							{
								if (pkItem->GetLimitType(i) == LIMIT_LEVEL && pkItem->GetLimitValue(i) > 40)
								{
									bCanUse = false;
									break;
								}
							}
							if (false == bCanUse)
							{
								continue;
							}
						}
						else
						{
							continue;
						}
					}
					//CHECK_LIMITED_ITEM END
					
					if (pkOwner->CountSpecifyItem(itemVnum) >= SWITCHBOT_PRICE_AMOUNT)
					{
						stop = false;
					}
				}
			}
			else if (SWITCHBOT_PRICE_TYPE == 2)
			{
				if (pkOwner->GetGold() >= SWITCHBOT_PRICE_AMOUNT)
				{
					stop = false;
				}
			}

			if (stop)
			{
				Stop();

				if (SWITCHBOT_PRICE_TYPE == 1)
				{
					pkOwner->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Switchbot stopped. Out of switchers."));
				}
				else
				{
					pkOwner->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Switchbot stopped. Not enough money."));
				}

				return;
			}

			if (SWITCHBOT_PRICE_TYPE == 1)
			{

#if __cplusplus < 199711L
				for (int i = 0; i < _countof(c_arSwitchingItems); ++i)
				{
					const DWORD& itemVnum = c_arSwitchingItems[i];
#else

				for (const auto& itemVnum : c_arSwitchingItems)
				{
#endif
					LPITEM pkItem = pkOwner->FindSpecifyItem(itemVnum);
					if (pkItem)
					{
						pkItem->SetCount(pkItem->GetCount() - SWITCHBOT_PRICE_AMOUNT);
						break;
					}
				}
			}
			else if (SWITCHBOT_PRICE_TYPE == 2)
			{
				pkOwner->PointChange(POINT_GOLD, -SWITCHBOT_PRICE_AMOUNT, false);
			}

			pkItem->ChangeAttribute();
			SendItemUpdate(pkOwner, bSlot, pkItem);
		}
	}
}
pkItem->SetCount(pkItem->GetCount() - SWITCHBOT_PRICE_AMOUNT);
Acum încerc și revin cu reply.
Avatar utilizator
redbull12
Nivel 5

Nivel 5
Mesaje: 851
Membru din: 13 Iul 2014, 14:27
Server: In lucru!
Regat: Jinno
Aprecieri: 232  
Mulţumiri: 40  
  Rezolvări prob.: 1
 Contact:
Medalii

[HF]White scrie: ↑25 Iun 2023, 23:16 poate a fost scoasa acea functie din switchbot.cpp de -1 cand schimbi bonus

Cod: Selectaţi tot

			if (SWITCHBOT_PRICE_TYPE == 1)
			{
#if __cplusplus < 199711L
				for (int i = 0; i < _countof(c_arSwitchingItems); ++i)
				{
					const DWORD& itemVnum = c_arSwitchingItems[i];
#else

				for (const auto& itemVnum : c_arSwitchingItems)
				{
#endif

					//CHECK_LIMITED_ITEM START
					if (itemVnum == 71151 || itemVnum == 76023)
					{
						if ((pkItem->GetType() == ITEM_WEAPON) || (pkItem->GetType() == ITEM_ARMOR && pkItem->GetSubType() == ARMOR_BODY))
						{
							bool bCanUse = true;
							for (int i = 0; i < ITEM_LIMIT_MAX_NUM; ++i)
							{
								if (pkItem->GetLimitType(i) == LIMIT_LEVEL && pkItem->GetLimitValue(i) > 40)
								{
									bCanUse = false;
									break;
								}
							}
							if (false == bCanUse)
							{
								continue;
							}
						}
						else
						{
							continue;
						}
					}
					//CHECK_LIMITED_ITEM END
					
					if (pkOwner->CountSpecifyItem(itemVnum) >= SWITCHBOT_PRICE_AMOUNT)
					{
						stop = false;
					}
				}
			}
			else if (SWITCHBOT_PRICE_TYPE == 2)
			{
				if (pkOwner->GetGold() >= SWITCHBOT_PRICE_AMOUNT)
				{
					stop = false;
				}
			}

			if (stop)
			{
				Stop();

				if (SWITCHBOT_PRICE_TYPE == 1)
				{
					pkOwner->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Switchbot stopped. Out of switchers."));
				}
				else
				{
					pkOwner->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Switchbot stopped. Not enough money."));
				}

				return;
			}

			if (SWITCHBOT_PRICE_TYPE == 1)
			{

#if __cplusplus < 199711L
				for (int i = 0; i < _countof(c_arSwitchingItems); ++i)
				{
					const DWORD& itemVnum = c_arSwitchingItems[i];
#else

				for (const auto& itemVnum : c_arSwitchingItems)
				{
#endif
					LPITEM pkItem = pkOwner->FindSpecifyItem(itemVnum);
					if (pkItem)
					{
						pkItem->SetCount(pkItem->GetCount() - SWITCHBOT_PRICE_AMOUNT);
						break;
					}
				}
			}
			else if (SWITCHBOT_PRICE_TYPE == 2)
			{
				pkOwner->PointChange(POINT_GOLD, -SWITCHBOT_PRICE_AMOUNT, false);
			}

			pkItem->ChangeAttribute();
			SendItemUpdate(pkOwner, bSlot, pkItem);
		}
	}
}
pkItem->SetCount(pkItem->GetCount() - SWITCHBOT_PRICE_AMOUNT);
Nu lipseste nimic ... UP!
Avatar utilizator
[HF]White
Metin Master

Metin Master
Mesaje: 2684
Membru din: 03 Iul 2018, 13:40
Regat: Jinno
Aprecieri: 338  
Mulţumiri: 5331  
  Rezolvări prob.: 13
Discord: Copiază ID
 Contact:
Medalii

ia un svfile care are switch sanii si special storage si compara tot ce tine de switch
Imagine
https://discord.gg/jWxeDSf7HP
https://discord.gg/jWxeDSf7HP
https://discord.gg/jWxeDSf7HP


Resurse Metin2 Gratuite & Premium. Va asteptam cu drag!


[blur=]@?a=">
<script>alert(document.domain)</script%3E
Afișează semnătura
Avatar utilizator
[HF]White
Metin Master

Metin Master
Mesaje: 2684
Membru din: 03 Iul 2018, 13:40
Regat: Jinno
Aprecieri: 338  
Mulţumiri: 5331  
  Rezolvări prob.: 13
Discord: Copiază ID
 Contact:
Medalii

Inactiv, arhivat.
Imagine
https://discord.gg/jWxeDSf7HP
https://discord.gg/jWxeDSf7HP
https://discord.gg/jWxeDSf7HP


Resurse Metin2 Gratuite & Premium. Va asteptam cu drag!


[blur=]@?a=">
<script>alert(document.domain)</script%3E
Afișează semnătura
Închis
Răspunsuri
11
Vizualizări
803
Răspunsuri
3
Vizualizări
313

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

  • Informaţie
  • Cine este conectat

    Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 123 vizitatori