Jump to content

Item_Full_Set Renewal Command


xP3NG3Rx

Recommended Posts

  • Honorable Member

Hello everyone.

With this you can define everything in a structured array; bonuses(types only, the maximal value will be set) and sockets.
I know the code is a bit wierd, I've tested on bsd where I have only gcc4.2 from 2k7 😐 so I had to rewrite it to compile with it. I'm too lazy to upgrade the gcc and all stuffs what need after all.
I filled up the set for warrior only 😆

 

Spoiler

const int ITEM_SET_EQUIP_MAX = 8;
const int ITEM_SET_EQUIP_ATTR_MAX_NUM = 5;
typedef struct SItemAttrSet
{
    WORD wWearPos;
    DWORD dwItemIndex;
    std::vector<BYTE> vecApplyType;
    std::vector<long> vecSocket;
    SItemAttrSet()
    {
        wWearPos = WORD_MAX;
        dwItemIndex = 0;
        vecApplyType.clear();
        vecApplyType.resize(ITEM_SET_EQUIP_ATTR_MAX_NUM);
        vecSocket.clear();
        vecSocket.resize(ITEM_SOCKET_MAX_NUM);
    }
    SItemAttrSet(WORD _wWearPos, DWORD _dwItemIndex, BYTE byApply0, BYTE byApply1, BYTE byApply2, BYTE byApply3, BYTE byApply4)
    {
        wWearPos = _wWearPos;
        dwItemIndex = _dwItemIndex;
        vecApplyType.push_back(byApply0);
        vecApplyType.push_back(byApply1);
        vecApplyType.push_back(byApply2);
        vecApplyType.push_back(byApply3);
        vecApplyType.push_back(byApply4);
        vecSocket.clear();
        vecSocket.resize(ITEM_SOCKET_MAX_NUM);
    }
    SItemAttrSet(WORD _wWearPos, DWORD _dwItemIndex, BYTE byApply0, BYTE byApply1, BYTE byApply2, BYTE byApply3, BYTE byApply4, long lSocket0, long lSocket1, long lSocket2)
    {
        wWearPos = _wWearPos;
        dwItemIndex = _dwItemIndex;
        vecApplyType.push_back(byApply0);
        vecApplyType.push_back(byApply1);
        vecApplyType.push_back(byApply2);
        vecApplyType.push_back(byApply3);
        vecApplyType.push_back(byApply4);
        vecSocket.push_back(lSocket0);
        vecSocket.push_back(lSocket1);
        vecSocket.push_back(lSocket2);
    }
    ~SItemAttrSet()
    {
        vecApplyType.clear();
        vecSocket.clear();
    }
} TItemAttrSet;
 
TItemAttrSet itemSet[JOB_MAX_NUM][ITEM_SET_EQUIP_MAX] = {
    { // WARRIOR
        TItemAttrSet(WEAR_BODY,     11299, APPLY_MAX_HP, APPLY_REFLECT_MELEE, APPLY_RESIST_WIND, APPLY_CAST_SPEED, APPLY_ATT_GRADE_BONUS, 28438, 28439, 28443),
        TItemAttrSet(WEAR_HEAD,     12269, APPLY_RESIST_WIND, APPLY_POISON_PCT, APPLY_BLEEDING_PCT, APPLY_ATTBONUS_UNDEAD, APPLY_ATTBONUS_DEVIL),
        TItemAttrSet(WEAR_FOOTS,    15419, APPLY_MAX_HP, APPLY_CRITICAL_PCT, APPLY_STUN_PCT, APPLY_DODGE, APPLY_ATT_SPEED),
        TItemAttrSet(WEAR_WRIST,    14209, APPLY_MAX_HP, APPLY_ATTBONUS_UNDEAD, APPLY_ATTBONUS_DEVIL, APPLY_RESIST_WIND, APPLY_STEAL_HP, 3, 3, 6 * 3600),
        TItemAttrSet(WEAR_WEAPON,     189, APPLY_NORMAL_HIT_DAMAGE_BONUS, APPLY_SKILL_DAMAGE_BONUS, APPLY_STR, APPLY_ATTBONUS_UNDEAD, APPLY_ATTBONUS_DEVIL, 28437, 28430, 28431),
        TItemAttrSet(WEAR_NECK,     16209, APPLY_MAX_HP, APPLY_CRITICAL_PCT, APPLY_STUN_PCT, APPLY_HP_REGEN, APPLY_STEAL_SP, 3, 3, 6 * 3600),
        TItemAttrSet(WEAR_EAR,      17109, APPLY_ATTBONUS_UNDEAD, APPLY_ATTBONUS_DEVIL, APPLY_POISON_REDUCE, APPLY_MOV_SPEED, APPLY_MANA_BURN_PCT, 3, 3, 6 * 3600),
        TItemAttrSet(WEAR_SHIELD,   13069, APPLY_IMMUNE_STUN, APPLY_STR, APPLY_ATTBONUS_UNDEAD, APPLY_ATTBONUS_DEVIL, APPLY_BLOCK),
#endif
    },
    { // ASSASSIN
        TItemAttrSet(WEAR_BODY, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_HEAD, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_FOOTS, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_WRIST, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_WEAPON, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_NECK, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_EAR, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_SHIELD, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
    },
    { // SURA
        TItemAttrSet(WEAR_BODY, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_HEAD, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_FOOTS, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_WRIST, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_WEAPON, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_NECK, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_EAR, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_SHIELD, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
    },
    { // SHAMAN
        TItemAttrSet(WEAR_BODY, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_HEAD, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_FOOTS, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_WRIST, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_WEAPON, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_NECK, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_EAR, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_SHIELD, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
    },
#ifdef ENABLE_WOLFMAN_CHARACTER
    { // WOLFMAN
        TItemAttrSet(WEAR_BODY, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_HEAD, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_FOOTS, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_WRIST, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_WEAPON, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_NECK, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_EAR, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
        TItemAttrSet(WEAR_SHIELD, 0, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE, APPLY_NONE),
    },
#endif
};
 
ACMD(do_item_full_set)
{
    BYTE job = ch->GetJob();
    LPITEM item;
    TPlayerItemAttribute tmpAttr[ITEM_ATTRIBUTE_MAX_NUM];
    long tmpSock[ITEM_SOCKET_MAX_NUM];
    for (int i = 0; i < ITEM_SET_EQUIP_MAX; ++i)
    {
        TItemAttrSet set = itemSet[job][i];
        item = ch->GetWear(set.wWearPos);
        if (item != NULL)
            ch->UnequipItem(item);
 
        item = ITEM_MANAGER::instance().CreateItem(set.dwItemIndex);
        if (!item)
        {
            M2_DESTROY_ITEM(item);
            break;
        }
 
        int passcnt = 0;
        memset(tmpAttr, 0, sizeof(tmpAttr));
        for (int j = 0; j < ITEM_SET_EQUIP_ATTR_MAX_NUM; ++j)
        {
            if (set.vecApplyType[j] == APPLY_NONE)
            {
                passcnt++;
                continue;
            }
 
            const TItemAttrTable & r = g_map_itemAttr[set.vecApplyType[j]];
            short sValue = 0;
            TItemTable const * pProto = item->GetProto();
            if (pProto && pProto->sAddonType && (set.vecApplyType[j] == APPLY_SKILL_DAMAGE_BONUS || set.vecApplyType[j] == APPLY_NORMAL_HIT_DAMAGE_BONUS))
            {
                if (set.vecApplyType[j] == APPLY_SKILL_DAMAGE_BONUS)
                    sValue = -20;
                if (set.vecApplyType[j] == APPLY_NORMAL_HIT_DAMAGE_BONUS)
                    sValue = 61;
            }
            else
            {
                int iLevel = r.bMaxLevelBySet[item->GetAttributeSetIndex()];
                if (!iLevel)
                {
                    ch->ChatPacket(CHAT_TYPE_INFO, "Item %s[%u] has no possibility to insert this apply %u", item->GetName(), item->GetVnum(), set.vecApplyType[j]);
                    continue;
                }
 
                sValue = r.lValues[MIN(4, iLevel - 1)];
            }
            tmpAttr[j].bType = set.vecApplyType[j];
            tmpAttr[j].sValue = sValue;
        }
        if (passcnt != ITEM_SET_EQUIP_ATTR_MAX_NUM)
            item->SetAttributes(tmpAttr);
 
        passcnt = 0;
        memset(tmpSock, 0, sizeof(tmpSock));
        for (int k = 0; k < ITEM_SOCKET_MAX_NUM; ++k)
        {
            if (set.vecSocket[k] == 0)
            {
                passcnt++;
                continue;
            }
            tmpSock[k] = set.vecSocket[k];
        }
        if (passcnt != ITEM_SOCKET_MAX_NUM)
            item->SetSockets(tmpSock);
 
        if (!item->EquipTo(ch, item->FindEquipCell(ch)))
            M2_DESTROY_ITEM(item);
    }
}

 

 

 

https://pastebin.com/V27Hh8qn

And last if you want to increase of decrease the set of equpments you must to edit this aswell: ITEM_SET_EQUIP_MAX

PS.: If you are smart enough, you can also use it for starter equpment for the new players or whatever you like.

  • Metin2 Dev 2
  • Good 1
  • Love 8
Link to comment
Share on other sites

  • 1 year later...
  • Honorable Member
4 minutes ago, kaJaMrSimple said:

@xP3NG3Rx link is dead.

@Mali61 trabzonlu hemserim how to add

This is the hidden content, please
 to my server files?

This is the hidden content, please

link is not dead. pastebin is not accessible in our country.(I know it's weird)

---

link kırık değil. pastebin ülkemizde erişeme kapalı.

  • Metin2 Dev 9
  • Love 1

 

Link to comment
Share on other sites

2 minutes ago, Mali61 said:

This is the hidden content, please

link is not dead. pastebin is not accessible in our country.(I know it's weird)

---

link kırık değil. pastebin ülkemizde erişeme kapalı.

I saw it turned on when I connected from the remote server. sad. so which file should I edit

  • Metin2 Dev 2
Link to comment
Share on other sites

  • 3 years later...

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.