[script] No dowgrade at +15, +16, and if you wouldn't like to lose

03/22/2014 17:01 Sicarium#1
go to TMapSrv -> CSHandler.cpp, look for this one

Code:
if(pPlayer->ProtectTutorial() || CalcProb(pPlayer, pNpc, PROB_ITEMGUARD, 0))
				{
					BYTE bLevelGuard = 11;
					BYTE bDownProb = 0;
					BYTE bDownGrade = 0;

					if(pItem->m_bLevel <= bLevelGuard)
						bDownProb = 0;
					else
						bDownProb = rand() % 100;
next change it with this

Code:
if(pPlayer->ProtectTutorial() || CalcProb(pPlayer, pNpc, PROB_ITEMGUARD, 0))
				{
					BYTE bLevelGuard = 11;
					BYTE bLevelGuard2 = 15;
					BYTE bLevelGuard3 = 16;
					BYTE bDownProb = 0;
					BYTE bDownGrade = 0;

					if (pItem->m_bLevel <= bLevelGuard || pItem->m_bLevel >= bLevelGuard2  && pItem->m_bLevel <= bLevelGuard3)
						bDownProb = 0;
					else
						bDownProb = rand() % 100;


Now i comment all this lines

Code:
			if(pPlayer->ProtectTutorial() || CalcProb(pPlayer, pNpc, PROB_ITEMGUARD, 0))
				{
					BYTE bLevelGuard = 11; // Limit for don't get downgrade
					BYTE bLevelGuard2 = 15; // Limit for don't get downgrade
					BYTE bLevelGuard3 = 16; // Limit for don't get downgrade
					BYTE bDownProb = 0;
					BYTE bDownGrade = 0;


//if level upgrade is <= 11 or 15 and 16 set downprob to 0 else get random value % 100

	if (pItem->m_bLevel <= bLevelGuard || pItem->m_bLevel >= bLevelGuard2  && pItem->m_bLevel <= bLevelGuard3)
						bDownProb = 0;
					else
						bDownProb = rand() % 100;

					if(bDownProb < 20)//if 20 dont get downgrade
						bDownGrade = 0;
					else if(bDownProb < 55)//if < 55 get -1 downgrade
						bDownGrade = 1;
					else
						bDownGrade = 2;//if < 55 get -1 downgrade

if you would like don't lose the item when you haven't the tinture, change this


Code:
else{
					delete pItem; 
					pInven->m_mapTITEM.erase(bTargetItemID);
					pPlayer->SendCS_DELITEM_ACK(bTargetInven, bTargetItemID);
					pPlayer->SendCS_ITEMUPGRADE_ACK(ITEMUPGRADE_FAIL, 0, 0, 0);
				}
with this one

Code:
else{					pPlayer->SendCS_ITEMUPGRADE_ACK(ITEMUPGRADE_FAIL, 0, 0, 0);
				}
03/22/2014 17:13 TinLevin#2
Sicarium you have skype ? i have need for fix 4.3 contact my tin.levin
03/22/2014 17:31 Sicarium#3
what about?.
03/22/2014 17:59 TinLevin#4
Fix Servicies 4.3
03/24/2014 02:23 Sicarium#5
ok contact me
03/24/2014 03:31 RedSwag#6
Good job scarium... i think someone will use it happily ;)