Jump to content

Subtype weapon costume


Recommended Posts

Hello friends , i have two problems at weapon costume with subtype .. 

( SOLVE ) When i equip the weapon at costume, i lost my weapon atack value from hand .. see the picture.The problem are VISUAL ( CLIENT ) because the damage is working fine. 

Spoiler

1213_042441.jpg

Spoiler

1213_042445.jpg

Spoiler

1213_042452.jpg

 

The subtype is 15 , i`m try to test with another subtype from hair and is working . I change in protoreader.cpp the value , but the problem still be there . 

Spoiler

static string arSub28[] = { "COSTUME_BODY", "COSTUME_HAIR", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "NONE", "COSTUME_WEAPON_SWORD", "COSTUME_WEAPON_DAGGER", "COSTUME_WEAPON_BOW", "COSTUME_WEAPON_TWO_HANDED", "COSTUME_WEAPON_BELL", "COSTUME_WEAPON_FAN", "COSTUME_WEAPON_CLAW" };
    

 

( SOLVE ) i can`t atack with skill in mob , "i can't use this weapon" 

1213_231202.jpg

 

New problem ... 

 

The ninja with bow , don`t do damage .. and the arrows don`t use ..

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

PythonNetworkStreamPhaseGameActor.cpp

Spoiler

void __SetWeaponPower(IAbstractPlayer& rkPlayer, DWORD dwWeaponID)
{
    DWORD minPower=0;
    DWORD maxPower=0;
    DWORD minMagicPower=0;
    DWORD maxMagicPower=0;
    DWORD addPower=0;
#ifdef ENABLE_COSTUME_WEAPON
    //DMG RESET BUG FIX
    dwWeaponID = rkPlayer.GetItemIndex(TItemPos(INVENTORY, c_Equipment_Weapon));
#endif
    CItemData* pkWeapon;
    
    if (CItemManager::Instance().GetItemDataPointer(dwWeaponID, &pkWeapon))
    {
        if (pkWeapon->GetType()==CItemData::ITEM_TYPE_WEAPON)
        {
            minPower=pkWeapon->GetValue(3);
            maxPower=pkWeapon->GetValue(4);
            minMagicPower=pkWeapon->GetValue(1);
            maxMagicPower=pkWeapon->GetValue(2);
            addPower=pkWeapon->GetValue(5);
        }
    }
#ifdef ENABLE_COSTUME_WEAPON
    DWORD dwItemIndex = rkPlayer.GetItemIndex(TItemPos(INVENTORY, c_Costume_Slot_Weapon));

    CItemData* pkCostumeWeapon;
    if (CItemManager::Instance().GetItemDataPointer(dwItemIndex, &pkCostumeWeapon))
    {
        if (pkCostumeWeapon->GetType() == CItemData::ITEM_TYPE_COSTUME && pkCostumeWeapon->GetWeaponType() == CItemData::COSTUME_WEAPON_SWORD ||
            pkCostumeWeapon->GetWeaponType() == CItemData::COSTUME_WEAPON_DAGGER || pkCostumeWeapon->GetWeaponType() == CItemData::COSTUME_WEAPON_BOW ||
            pkCostumeWeapon->GetWeaponType() == CItemData::COSTUME_WEAPON_TWO_HANDED || pkCostumeWeapon->GetWeaponType() == CItemData::COSTUME_WEAPON_BELL ||
            pkCostumeWeapon->GetWeaponType() == CItemData::COSTUME_WEAPON_FAN || pkCostumeWeapon->GetWeaponType() == CItemData::COSTUME_WEAPON_CLAW)
        {
            minPower += pkCostumeWeapon->GetValue(3);
            maxPower += pkCostumeWeapon->GetValue(4);
            minMagicPower += pkCostumeWeapon->GetValue(1);
            maxMagicPower += pkCostumeWeapon->GetValue(2);
            addPower += pkCostumeWeapon->GetValue(5);
        }
    }
#endif

    rkPlayer.SetWeaponPower(minPower, maxPower, minMagicPower, maxMagicPower, addPower);
}
 

 

  • Love 1
Link to comment
Share on other sites

35 minutes ago, DarkAng3l said:

PythonNetworkStreamPhaseGameActor.cpp

  Reveal hidden contents

void __SetWeaponPower(IAbstractPlayer& rkPlayer, DWORD dwWeaponID)
{
    DWORD minPower=0;
    DWORD maxPower=0;
    DWORD minMagicPower=0;
    DWORD maxMagicPower=0;
    DWORD addPower=0;
#ifdef ENABLE_COSTUME_WEAPON
    //DMG RESET BUG FIX
    dwWeaponID = rkPlayer.GetItemIndex(TItemPos(INVENTORY, c_Equipment_Weapon));
#endif
    CItemData* pkWeapon;
    
    if (CItemManager::Instance().GetItemDataPointer(dwWeaponID, &pkWeapon))
    {
        if (pkWeapon->GetType()==CItemData::ITEM_TYPE_WEAPON)
        {
            minPower=pkWeapon->GetValue(3);
            maxPower=pkWeapon->GetValue(4);
            minMagicPower=pkWeapon->GetValue(1);
            maxMagicPower=pkWeapon->GetValue(2);
            addPower=pkWeapon->GetValue(5);
        }
    }
#ifdef ENABLE_COSTUME_WEAPON
    DWORD dwItemIndex = rkPlayer.GetItemIndex(TItemPos(INVENTORY, c_Costume_Slot_Weapon));

    CItemData* pkCostumeWeapon;
    if (CItemManager::Instance().GetItemDataPointer(dwItemIndex, &pkCostumeWeapon))
    {
        if (pkCostumeWeapon->GetType() == CItemData::ITEM_TYPE_COSTUME && pkCostumeWeapon->GetWeaponType() == CItemData::COSTUME_WEAPON_SWORD ||
            pkCostumeWeapon->GetWeaponType() == CItemData::COSTUME_WEAPON_DAGGER || pkCostumeWeapon->GetWeaponType() == CItemData::COSTUME_WEAPON_BOW ||
            pkCostumeWeapon->GetWeaponType() == CItemData::COSTUME_WEAPON_TWO_HANDED || pkCostumeWeapon->GetWeaponType() == CItemData::COSTUME_WEAPON_BELL ||
            pkCostumeWeapon->GetWeaponType() == CItemData::COSTUME_WEAPON_FAN || pkCostumeWeapon->GetWeaponType() == CItemData::COSTUME_WEAPON_CLAW)
        {
            minPower += pkCostumeWeapon->GetValue(3);
            maxPower += pkCostumeWeapon->GetValue(4);
            minMagicPower += pkCostumeWeapon->GetValue(1);
            maxMagicPower += pkCostumeWeapon->GetValue(2);
            addPower += pkCostumeWeapon->GetValue(5);
        }
    }
#endif

    rkPlayer.SetWeaponPower(minPower, maxPower, minMagicPower, maxMagicPower, addPower);
}
 

 

THX MAN !! NOW THE VISUAL DAMAGE IS WORKING !!

the last problem is " i can`t atack with skill in mob , "i can't use this weapon" 

1213_231202.jpg

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

I rewrite function GetWeaponType in InstanceBase.cpp, because I had same problem.

Spoiler

DWORD CInstanceBase::GetWeaponType()
{
    DWORD dwWeapon = GetPart(CRaceData::PART_WEAPON);
    CItemData * pItemData;
    if (!CItemManager::Instance().GetItemDataPointer(dwWeapon, &pItemData))
        return CItemData::WEAPON_NONE;
#ifdef ENABLE_COSTUME_WEAPON
    if (pItemData->GetType() == CItemData::ITEM_TYPE_COSTUME)
    {
        if (pItemData->GetSubType() == CItemData::COSTUME_WEAPON_SWORD)
            return CItemData::WEAPON_SWORD;
        else if (pItemData->GetSubType() == CItemData::COSTUME_WEAPON_DAGGER)
            return CItemData::WEAPON_DAGGER;
        else if (pItemData->GetSubType() == CItemData::COSTUME_WEAPON_BOW)
            return CItemData::WEAPON_BOW;
        else if (pItemData->GetSubType() == CItemData::COSTUME_WEAPON_TWO_HANDED)
            return CItemData::WEAPON_TWO_HANDED;
        else if (pItemData->GetSubType() == CItemData::COSTUME_WEAPON_BELL)
            return CItemData::WEAPON_BELL;
        else if (pItemData->GetSubType() == CItemData::COSTUME_WEAPON_FAN)
            return CItemData::WEAPON_FAN;
        else if (pItemData->GetSubType() == CItemData::COSTUME_WEAPON_CLAW)
            return CItemData::WEAPON_CLAW;
        else
            return pItemData->GetWeaponType();
    }
#endif
    return pItemData->GetWeaponType();
}

 

  • Love 1
Link to comment
Share on other sites

Just now, DarkAng3l said:

I rewrite function GetWeaponType in InstanceBase.cpp, because I had same problem.

  Hide contents

DWORD CInstanceBase::GetWeaponType()
{
    DWORD dwWeapon = GetPart(CRaceData::PART_WEAPON);
    CItemData * pItemData;
    if (!CItemManager::Instance().GetItemDataPointer(dwWeapon, &pItemData))
        return CItemData::WEAPON_NONE;
#ifdef ENABLE_COSTUME_WEAPON
    if (pItemData->GetType() == CItemData::ITEM_TYPE_COSTUME)
    {
        if (pItemData->GetSubType() == CItemData::COSTUME_WEAPON_SWORD)
            return CItemData::WEAPON_SWORD;
        else if (pItemData->GetSubType() == CItemData::COSTUME_WEAPON_DAGGER)
            return CItemData::WEAPON_DAGGER;
        else if (pItemData->GetSubType() == CItemData::COSTUME_WEAPON_BOW)
            return CItemData::WEAPON_BOW;
        else if (pItemData->GetSubType() == CItemData::COSTUME_WEAPON_TWO_HANDED)
            return CItemData::WEAPON_TWO_HANDED;
        else if (pItemData->GetSubType() == CItemData::COSTUME_WEAPON_BELL)
            return CItemData::WEAPON_BELL;
        else if (pItemData->GetSubType() == CItemData::COSTUME_WEAPON_FAN)
            return CItemData::WEAPON_FAN;
        else if (pItemData->GetSubType() == CItemData::COSTUME_WEAPON_CLAW)
            return CItemData::WEAPON_CLAW;
        else
            return pItemData->GetWeaponType();
    }
#endif
    return pItemData->GetWeaponType();
}

 

MAN !!! YOU ARE THE GOD. THX !! SOLVE ALL !! DANKEEEE xD

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 4

      Feeding game source to LLM

    2. 0

      Quest 6/7 Problem

    3. 5

      Effect weapons

    4. 0

      [C++] Fix Core Downer Using Negative Number in GM Codes

    5. 3

      Crystal Metinstone

    6. 4

      Feeding game source to LLM

    7. 113

      Ulthar SF V2 (TMP4 Base)

    8. 4

      Feeding game source to LLM

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.