Help,can't figure out how to do that if the inventory is a certain item he needs to add the option character.
here is an example code.
Protocol
PHP Code:
case 0x26:
CGUseItemRecv((PMSG_USEITEM *)aRecv, aIndex);
CustomJewels.CGUseItemRecv((PMSG_USEITEM*)aRecv,aIndex);
break;
PHP Code:
bool CGUseItemRecv(PMSG_USEITEM* lpMsg, int aIndex){ if(aIndex > OBJECT_MAX)
return true;
OBJECTSTRUCT *gObj = (OBJECTSTRUCT*)OBJECT_POINTER(aIndex);
if(gObj->pInventory[lpMsg->inventoryPos].m_Type == ITEMGET(14,120)) //Talisman Of Damage {
gObj->m_AttackDamageMin += 10;// 10%
gObj->m_AttackDamageMax += 10;// 10%
}
if(gObj->pInventory[lpMsg->inventoryPos].m_Type == ITEMGET(14,121)) //Talisman Of Defence {
gObj->m_Defense += 10; // 10%
gObj->m_MagicDefense += 10; // 10%
}
if(gObj->pInventory[lpMsg->inventoryPos].m_Type == ITEMGET(14,122)) //Talisman Of Double {
gObj->SetOpDoubleDamage += 3; //3%
}
if(gObj->pInventory[lpMsg->inventoryPos].m_Type == ITEMGET(14,123)) //Talisman Of Exellent {
gObj->m_ExcelentDamage += 100; // 5%
}
if(gObj->pInventory[lpMsg->inventoryPos].m_Type == ITEMGET(14,124)) //Talisman Of Critical {
gObj->m_CriticalDamage += 5; // 5%
}
if(gObj->pInventory[lpMsg->inventoryPos].m_Type == ITEMGET(14,126)) //Talisman Of Ignore {
gObj->SetOpIgnoreDefense += 3; // 3%
}
if(gObj->pInventory[lpMsg->inventoryPos].m_Type == ITEMGET(14,127)) //Talisman Of Reflect {
gObj->SetOpReflectionDamage += 5; // 5%
}
return false;
}