How to make ''WeponsDye''

All Helbreath Server Source Discussion here.
Windy
Member
Posts: 157
Joined: Tue Nov 18, 2003 8:31 am
Location: wishing I was somewhere else

Post by Windy »

people waste time on little stuff like weapon dyes because its a challenge to add in a simple line of code that will take the unexperienced ones months to figure out ._. use other code for reference if you have to....
<span style='color:blue'>Coding with Evil Intentions....Evil at its Best....</span>
EvilHit
Loyal fan
Posts: 356
Joined: Sun Jan 16, 2005 3:20 am

Post by EvilHit »

here is the code for weapon dye

in game.ccp found case DEF_ITEMEFFECTTYPE_ARMORDYE: or case DEF_ITEMEFFECTTYPE_FARMING:

and add the followin

Code: Select all

case DEF_ITEMEFFECTTYPE_WEAPONDYE:
  if ((sDestItemID >= 0) && (sDestItemID < DEF_MAXITEMS)) {
  	if (m_pClientList[ iClientH ]->m_pItemList[sDestItemID] != NULL) {
    if (m_pClientList[ iClientH ]->m_pItemList[sDestItemID]->m_cCategory == 1) {
    	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;
then in item.h add this

Code: Select all

#define DEF_ITEMEFFECTTYPE_WEAPONDYE 33

B) :P
Psycho
Member
Posts: 116
Joined: Sat Jan 24, 2004 2:56 pm

Post by Psycho »

nice work, ty


YoKo
<img src='http://img145.imageshack.us/img145/3999/firma1an0.jpg' border='0' alt='user posted image' />
Post Reply