Source GS 96.40T ACTeaM Inventory PlusItem :)

daniellk

Honrado XPZ
9 de Outubro de 2013
62
9
0
EU FUTUCANO NOS FORUM OLHA Q EU ACHEI 

 

Well friends, today more developed this nifty command in and decided to post for you, the command is with the values ​​for item 97d, but can be changed to any version changed from 32 to 512.

//===================================
//-- Video System 

//===================================
 


//===================================
//--Definitions GS 97D
//===================================



 

#define GCItemListSend ((void(*)(int aIndex)) 0x00411010) 
#define gObjInventoryDeleteItem ((void(*)(int,int)) 0x00402383)
#define GCInventoryItemDeleteSend ((void(*)(int,int,unsigned char)) 0x0040201D)





//===================================
//-- GetInventoryItemCount
//===================================



 

int GetInventoryItemCount(int aIndex, int Type, int Level)
{
OBJECTSTRUCT *gObj = (OBJECTSTRUCT*)OBJECT_POINTER(aIndex);


int count = 0;
for(unsigned i = 12; i < 76; i++)
{
if(gObj->pInventory.m_Type == Type)

{


if(Level != -1)


{


if(!gObj->pInventory
.m_Level == Level)

{


continue;


}


}


count++;


}


}


return count;


}




//===================================
//-- gObjDeleteItemsCount
//===================================



 


int gObjDeleteItemsCount(int gObjId, short Type, short Level, int Count)


{


int count = 0;


for(int i = 12; i < 76; i++)


{


OBJECTSTRUCT *gObj = (OBJECTSTRUCT*)OBJECT_POINTER(gObjId);


if(gObj->pInventory
.m_Type == Type && gObj->pInventory.m_Level == Level)

{


gObjInventoryDeleteItem(gObjId, i);


GCInventoryItemDeleteSend(gObjId, i, 1);


count++;




if(Count == count)


break;


}


}


return count;


}




//===================================
//-- PlusItem Command By Mr.Haziel 23/06/2013
//===================================
QUOTE]
void PlusItemCommand(int aIndex,char *ChatMSG)
{
OBJECTSTRUCT *lpObj = (OBJECTSTRUCT*)OBJECT_POINTER(aIndex);

if(lpObj->pTransaction == 1)
{
MsgOutput(aIndex,"%s Feche o Trade Para Usar o Comando!",lpObj->Name); 
return;
}
if(lpObj->m_IfState.use == 1 && lpObj->m_IfState.type == 7 )
{
MsgOutput(aIndex,"%s Feche o ChaosBox Para Usar o Comando!",lpObj->Name); 
return;
}
if(lpObj->WarehouseSave >= 1 )
{
MsgOutput(aIndex,"%s Feche o Baú Para Usar o Comando!",lpObj->Name); 
return;
}

BYTE PlusCode = {0};
BYTE Buff = {0};

sscanf(ChatMSG,"%d",&PlusCode);

//-- Jewel's
INT Bless_ID = 0x1CD; // Item jewel of Bless 
INT Soul_ID = 0x1CE; // Item jewel of Soul
INT Chaos_ID = 0x18F; // Item jewel of Chaos

//-- Inventory Item Count 
INT Bless = GetInventoryItemCount(aIndex,Bless_ID,0); 
INT Soul = GetInventoryItemCount(aIndex,Soul_ID ,0); 
INT Chaos = GetInventoryItemCount(aIndex,Chaos_ID,0); 


switch(PlusCode)
{
case 12:
if(Bless >= 3 && Soul >= 3 && Chaos >= 1)
{
for(int i = 12; i < 76; i++)
{
OBJECTSTRUCT *ItObj = (OBJECTSTRUCT*)OBJECT_POINTER(aIndex);
if(ItObj->pInventory.m_Level == 11) 
{
Buff++; 
if(Buff == 1) /* FIX MAX BUFFER OVER */
{
ItObj->pInventory.m_Level += 1;
GCItemListSend(aIndex);
gObjDeleteItemsCount(aIndex,Bless_ID, 0, 3);
gObjDeleteItemsCount(aIndex,Soul_ID, 0, 3);
gObjDeleteItemsCount(aIndex,Chaos_ID, 0, 1);
MsgOutput(aIndex,"Parabéns Item +12 Mixado com Sucesso !!");
break;
}
}
}
}
else
{
MsgOutput(aIndex,"Itens Incorretos para Combinação !!");
}
break;
case 13:
if(Bless >= 4 && Soul >= 4 && Chaos >= 1)
{
for(int i = 12; i < 76; i++)
{
OBJECTSTRUCT *ItObj = (OBJECTSTRUCT*)OBJECT_POINTER(aIndex);
if(ItObj->pInventory.m_Level == 12) 
{
Buff++;
if(Buff == 1) /* FIX MAX BUFFER OVER */
{
ItObj->pInventory.m_Level += 1;
GCItemListSend(aIndex);
gObjDeleteItemsCount(aIndex,Bless_ID, 0, 4);
gObjDeleteItemsCount(aIndex,Soul_ID, 0, 4);
gObjDeleteItemsCount(aIndex,Chaos_ID, 0, 1);
MsgOutput(aIndex,"Parabéns Item +13 Mixado com Sucesso !!");
break;
}
}
}
}
else
{
MsgOutput(aIndex,"Itens Incorretos para Combinação!!");
}
break;
case 14:
if(Bless >= 5 && Soul >= 5 && Chaos >= 1)
{
for(int i = 12; i < 76; i++)
{
OBJECTSTRUCT *ItObj = (OBJECTSTRUCT*)OBJECT_POINTER(aIndex);
if(ItObj->pInventory.m_Level == 13) 
{
Buff++;
if(Buff == 1) /* FIX MAX BUFFER OVER */
{
ItObj->pInventory.m_Level += 1;
GCItemListSend(aIndex);
gObjDeleteItemsCount(aIndex,Bless_ID, 0, 5);
gObjDeleteItemsCount(aIndex,Soul_ID, 0, 5);
gObjDeleteItemsCount(aIndex,Chaos_ID, 0, 1);
MsgOutput(aIndex,"Parabéns Item +14 Mixado com Sucesso !!");
break;
}
}
}
}
else
{
MsgOutput(aIndex,"Itens Incorretos para Combinação!!");
}
break;
case 15:
if(Bless >= 6 && Soul >= 6 && Chaos >= 1)
{
for(int i = 12; i < 76; i++)
{
OBJECTSTRUCT *ItObj = (OBJECTSTRUCT*)OBJECT_POINTER(aIndex);
if(ItObj->pInventory.m_Level == 14) 
{
Buff++;
if(Buff == 1) /* FIX MAX BUFFER OVER */
{
ItObj->pInventory.m_Level += 1;
GCItemListSend(aIndex);
gObjDeleteItemsCount(aIndex,Bless_ID, 0, 6);
gObjDeleteItemsCount(aIndex,Soul_ID, 0, 6);
gObjDeleteItemsCount(aIndex,Chaos_ID, 0, 1);
MsgOutput(aIndex,"Parabéns Item +15 Mixado com Sucesso !!");
break;
}
}
}
}
else
{
MsgOutput(aIndex,"Itens Incorretos para Combinação!!");
}
break;

}


Note: The code can be improved only include the portion of the fault of the mix, now just play!

Credits: Mr.Haziel Developer