[TUTORIAL] Consumable Skins
Follow this tutorial for the core code: http://www.mpgh.net/forum/showthread.php?t=907879
and to make skins actually consumable you need to do this.
in db>descriptors.cs
add "UnlockSkin" under ClearConditionEffectSelf,
like this:

Wserver>Realm>Entities>Player>
and open player.useitem.cs
find case activate.unlockportals
add this under break;
Code:
case ActivateEffects.UnlockSkin:
if (item.SkinType != 0 || item.SkinType != Skins)
{
if (item.PlayerClassType == client.Character.ObjectType)
{
Skins = item.SkinType;
SendInfo("Successfully changed skin!");
SaveToCharacter();
}
else
{
SendError("Wrong Class!");
success = false;
}
SaveToCharacter();
}
else
{
success = false;
SendError("Invalid skin type.");
SaveToCharacter();
}
break;
Next go to your xml's (preferably dat20.xml because it contains the xmls that are "core")
add this example skin
Code:
<Object id="Gentleman Skin" ext="true">
<Class>Equipment</Class>
<Item/>
<AnimatedTexture>
<File>playerskins</File>
<Index>28</Index>
</AnimatedTexture>
<SlotType>10</SlotType>
<Description>Gentleman Skin.</Description>
<SkinType>0x035c</SkinType>
<Activate>UnlockSkin</Activate>
<Consumable />
<PlayerClassType>782</PlayerClassType>
<BagType>1</BagType>
<DisplayId>Gentleman</DisplayId>
</Object>
Ok lets break it down
Code:
<AnimatedTexture>
<File>playerskins</File>
<Index>28</Index>
</AnimatedTexture>
Open dat36.xml and look for the skin you wish to use and find the code that looks like that ^^
so for example in dat36.xml Gentleman skin looks like this
Code:
<Object type="0x035c" id="Gentleman">
<Skin/>
<Class>Skin</Class>
<AnimatedTexture>
<File>playerskins</File>
<Index>28</Index>
</AnimatedTexture>
<PlayerClassType>782</PlayerClassType>
<UnlockLevel>0</UnlockLevel>
<DisplayId>Gentleman</DisplayId>
</Object>
Next
Code:
<PlayerClassType>782</PlayerClassType>
that is just simply the class that the skin is used for.
Any questions post them
Credits
Snuffleupagus for the core skin code (client + server)
Transferred for making them work
Travoos for showing me the cool gif program