ImNotMakdoon (04-07-2016)
Follow this tutorial for the core code: https://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;
Next go to your xml's (preferably dat20.xml because it contains the xmls that are "core")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;
add this example skin
Ok lets break it downCode:<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>
Open dat36.xml and look for the skin you wish to use and find the code that looks like that ^^Code:<AnimatedTexture> <File>playerskins</File> <Index>28</Index> </AnimatedTexture>
so for example in dat36.xml Gentleman skin looks like this
NextCode:<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>
that is just simply the class that the skin is used for.Code:<PlayerClassType>782</PlayerClassType>
Any questions post them
Last edited by Transferred; 04-07-2016 at 03:03 PM.
ImNotMakdoon (04-07-2016)
U forgot about adding "UnlockSkin" in descriptors.cs
Transferred (04-07-2016)
BlackRayquaza (04-07-2016)