This guide is focus on how to make custom jewels for any Mu Online version.
I'll make an example of Mu Online Season 12.
1. Explain Custom Jewels:
- Jewel of Dark Bless (14, 500): upgrade your item to Lv6
- Jewel of Dark Soul (14, 501): upgrade your item to Lv9
- Jewel of Dark Life (14, 502): upgrade your item to +28 op
- Jewel of Excess (14, 503): randomly change your excellent options
- Jewel of Luck (14, 504): add luck to your item
- Jewel of Science (14, 505): add skill to your item
- Jewel of Kundun (14, 506): upgrade your item to Lv15
- Jewel of Kondar (14, 507): upgrade your item to Full Option (FO)
- Jewel of Wisdom (14, 508): add extra socket to your socket item
2. Prepare:
- Mu Server Source Code: you must have source code to make this feature.
- Understand how item work. For season 12, you can read this guide: http://forum.ragezone.com/f196/guide-explain-item-hexcode-season-1175952/ . For other versions, it'll be different, you need to find guide of your version.
3. Let's begin:
- Step 1: create CustomJewel.h & CustomJewel.cpp
CustomJewel.h
CustomJewel.cpp
- Step 2: add to protocol.cpp
In protocol.cpp, include your CustomJewel.h
Find function CGUseItemRecv and add your logic:
That's logic of making Custom Jewels. These example above is Jewel of Dark Bless and Jewel of Luck. For other custom jewels, you need to code by yourself.
Have a nice day.
I'll make an example of Mu Online Season 12.
1. Explain Custom Jewels:
- Jewel of Dark Bless (14, 500): upgrade your item to Lv6
- Jewel of Dark Soul (14, 501): upgrade your item to Lv9
- Jewel of Dark Life (14, 502): upgrade your item to +28 op
- Jewel of Excess (14, 503): randomly change your excellent options
- Jewel of Luck (14, 504): add luck to your item
- Jewel of Science (14, 505): add skill to your item
- Jewel of Kundun (14, 506): upgrade your item to Lv15
- Jewel of Kondar (14, 507): upgrade your item to Full Option (FO)
- Jewel of Wisdom (14, 508): add extra socket to your socket item
2. Prepare:
- Mu Server Source Code: you must have source code to make this feature.
- Understand how item work. For season 12, you can read this guide: http://forum.ragezone.com/f196/guide-explain-item-hexcode-season-1175952/ . For other versions, it'll be different, you need to find guide of your version.
3. Let's begin:
- Step 1: create CustomJewel.h & CustomJewel.cpp
CustomJewel.h
Code:
#include "zzzitem.h"
#include "user.h"
class CustomJewel
{
public:
CustomJewel(void);
virtual ~CustomJewel(void);
bool IsCustomJewel(int itemId);
bool ProcessCustomJewel(LPOBJ lpObj, int JewelPos, int TargetPos);
bool InsertJewelOfDarkBless(LPOBJ lpObj, int JewelPos, int TargetPos);
bool InsertJewelOfLuck(LPOBJ lpObj, int JewelPos, int TargetPos);
private:
}
extern CustomJewel gCustomJewelSystem;
CustomJewel.cpp
Code:
#include "StdAfx.h"
#include "CustomJewel.h"
CustomJewel gCustomJewelSystem;
CustomJewel::CustomJewel(void)
{
}
CustomJewel::~CustomJewel(void)
{
}
bool CustomJewel::IsCustomJewel(int itemId)
{
if (itemId >= ITEMGET(14, 500) && itemId <= ITEMGET(14, 508))
{
return true;
}
return false;
}
bool CustomJewel::ProcessCustomJewel(LPOBJ lpObj, int JewelPos, int TargetPos)
{
if (JewelPos < 0 || JewelPos > MAIN_INVENTORY_SIZE - 1)
{
return false;
}
if (TargetPos < 0 || TargetPos > MAIN_INVENTORY_SIZE - 1)
{
return false;
}
if (!lpObj->pInventory[JewelPos].IsItem() || !lpObj->pInventory[TargetPos].IsItem())
{
return false;
}
int JewelCode = lpObj->pInventory[JewelPos].m_Type;
int TargetCode = lpObj->pInventory[TargetPos].m_Type;
switch (JewelCode)
{
case ITEMGET(14, 500):
return this->InsertJewelOfDarkBless(lpObj, JewelPos, TargetPos);
case ITEMGET(14, 504):
return this->InsertJewelOfLuck(lpObj, JewelPos, TargetPos);
default:
return false;
}
}
bool CustomJewel::InsertJewelOfDarkBless(LPOBJ lpObj, int JewelPos, int TargetPos)
{
if (lpObj->pInventory[TargetPos].m_Level < 6)
{
lpObj->pInventory[TargetPos].m_Level = 6;
gObjInventoryItemSet(lpObj->m_Index, JewelPos, -1);
lpObj->pInventory[JewelPos].Clear();
GSProtocol.GCInventoryItemOneSend(lpObj->m_Index, TargetPos);
GSProtocol.GCInventoryItemDeleteSend(lpObj->m_Index, JewelPos, 1);
MsgOutput(lpObj->m_Index, "Use Jewel of Dark Bless successful. Your item was upgraded to Lv6");
return true;
}
else
{
MsgOutput(lpObj->m_Index, "Can not use Jewel of Dark Bless. Your item is higher than Lv6");
return false;
}
}
bool CustomJewel::InsertJewelOfLuck(LPOBJ lpObj, int JewelPos, int TargetPos)
{
if (lpObj->pInventory[TargetPos].m_Option2 == 0)
{
lpObj->pInventory[TargetPos].m_Option2 = 1;
gObjInventoryItemSet(lpObj->m_Index, JewelPos, -1);
lpObj->pInventory[JewelPos].Clear();
GSProtocol.GCInventoryItemOneSend(lpObj->m_Index, TargetPos);
GSProtocol.GCInventoryItemDeleteSend(lpObj->m_Index, JewelPos, 1);
MsgOutput(lpObj->m_Index, "Use Jewel of Luck successful. Your item was added Luck option");
return true; }
else
{
MsgOutput(lpObj->m_Index, "Can not use Jewel of Luck. Your item already has Luck option");
return false;
}
}
- Step 2: add to protocol.cpp
In protocol.cpp, include your CustomJewel.h
Code:
#include "CustomJewel.h"
Find function CGUseItemRecv and add your logic:
Code:
void GameProtocol::CGUseItemRecv(PMSG_USEITEM* lpMsg, int aIndex)
{
....
if (....)
{
....
}
else if (....)
{
....
}
[COLOR=#ff0000]else if (gCustomJewelSystem.IsCustomJewel(citem->m_Type))
{
gCustomJewelSystem.ProcessCustomJewel(&gObj[aIndex], lpMsg->inventoryPos, lpMsg->invenrotyTarget);
}[/COLOR]
....
}
That's logic of making Custom Jewels. These example above is Jewel of Dark Bless and Jewel of Luck. For other custom jewels, you need to code by yourself.
Have a nice day.
Last edited: