[CODE] Adding Dyes.

#1
Add entries to your item.cfgs like this:

Code: Select all

Item = xxxx ArmorDye(Indigo) 11 0 32 [color=red]1[/color] 0 0 0 0 0 1 0 6 58 -100 1 -1 0 0 0 0 0 -1 42 0
The number in red is the number of the colour.

Add a case to the _bDepleteDestTypeItemUseEffect method:

Code: Select all

case DEF_ITEMEFFECTTYPE_ARMORDYE:
if ((sDestItemID >= 0) && (sDestItemID < DEF_MAXITEMS)) {
   if (m_pClientList[iClientH]->m_pItemList[sDestItemID] != NULL) {
      if ((m_pClientList[iClientH]->m_pItemList[sDestItemID]->m_cCategory == 6) ||         (m_pClientList[iClientH]->m_pItemList[sDestItemID]->m_cCategory == 5)){ 
               
         m_pClientList[iClientH]->m_pItemList[sDestItemID]->m_cItemColor = m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sItemEffectValue1;
         SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_ITEMCOLORCHANGE, sDestItemID, m_pClientList[iClientH]->m_pItemList[sDestItemID]->m_cItemColor, NULL, NULL);
         return TRUE;
      }
      else {
         SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_ITEMCOLORCHANGE, sDestItemID, -1, NULL, NULL);
         return FALSE;
      }
   }
}   
break;
Add #define DEF_ITEMEFFECTTYPE_ARMORDYE [Last Number example; 32]

Note: m_cCategory 6 is armour and m_cCategory 5 is shields.

Guide from Vamp.

I added on from: http://www.helbreath.info/forum/viewtop ... =64&t=3906

Also thanks to LifeX for helping me understand this code.

________________
You're gonna kill me!
Beginner.
-RileyShadez

Who is online

Users browsing this forum: No registered users and 1 guest

cron