Jump to content

Costume Weapon Bug


Recommended Posts

Hi Every One  :D

i have a little bug after a add the Official Costume Weapon System :)

The system is perfect  

Only one problem i had . :(

....

When i wear costume weapon the character freeze i cant move or hit or do skill's emotion, but when i ride a horse  it's all fine

there's no Photo to add 

i think the problem is in    void CInstanceBase::RefreshState(DWORD dwMotIndex, bool isLoop) part 

this is my

Instansbase.cpp

Spoiler

void CInstanceBase::RefreshState(DWORD dwMotIndex, bool isLoop)
{
    DWORD dwPartItemID = m_GraphicThingInstance.GetPartItemID(CRaceData::PART_WEAPON);

    BYTE byItemType = 0xff;
    BYTE bySubType = 0xff;

    CItemManager & rkItemMgr = CItemManager::Instance();
    CItemData * pItemData;
    if (rkItemMgr.GetItemDataPointer(dwPartItemID, &pItemData))
    {
        byItemType = pItemData->GetType();
        bySubType = pItemData->GetWeaponType();
    }

    if (IsPoly())
    {
        SetMotionMode(CRaceMotionData::MODE_GENERAL);
    }
    else if (IsWearingDress())
    {
        SetMotionMode(CRaceMotionData::MODE_WEDDING_DRESS);
    }
    else if (IsHoldingPickAxe())
    {
        if (m_kHorse.IsMounting())
        {
            SetMotionMode(CRaceMotionData::MODE_HORSE);
        }
        else
        {
            SetMotionMode(CRaceMotionData::MODE_GENERAL);
        }
    }
    else if (CItemData::ITEM_TYPE_ROD == byItemType)
    {
        if (m_kHorse.IsMounting())
        {
            SetMotionMode(CRaceMotionData::MODE_HORSE);
        }
        else
        {
            SetMotionMode(CRaceMotionData::MODE_FISHING);
        }
    }
#ifdef ENABLE_COSTUME_WEAPON_SYSTEM
    else if (byItemType == CItemData::ITEM_TYPE_COSTUME)
    {
        switch (pItemData->GetValue(3))
        {
            case CItemData::WEAPON_SWORD:
                if (m_kHorse.IsMounting())
                    SetMotionMode(CRaceMotionData::MODE_HORSE_ONEHAND_SWORD);
                else
                    SetMotionMode(CRaceMotionData::MODE_ONEHAND_SWORD);
                break;
            case CItemData::WEAPON_DAGGER:
                if (m_kHorse.IsMounting())
                    SetMotionMode(CRaceMotionData::MODE_HORSE_DUALHAND_SWORD);
                else
                    SetMotionMode(CRaceMotionData::MODE_DUALHAND_SWORD);
                break;
            case CItemData::WEAPON_BOW:
                if (m_kHorse.IsMounting())
                    SetMotionMode(CRaceMotionData::MODE_HORSE_BOW);
                else
#ifdef ENABLE_NEW_ARROW_SYSTEM
                {
                    if (m_awPart[CRaceData::PART_ARROW_TYPE] == CItemData::WEAPON_UNLIMITED_ARROW)
                        SetMotionMode(CRaceMotionData::MODE_BOW_SPECIAL);
                    else
                        SetMotionMode(CRaceMotionData::MODE_BOW);
                }
#else
                    SetMotionMode(CRaceMotionData::MODE_BOW);
#endif
                break;
            case CItemData::WEAPON_TWO_HANDED:
                if (m_kHorse.IsMounting())
                    SetMotionMode(CRaceMotionData::MODE_HORSE_TWOHAND_SWORD);
                else
                    SetMotionMode(CRaceMotionData::MODE_TWOHAND_SWORD);
                break;
            case CItemData::WEAPON_BELL:
                if (m_kHorse.IsMounting())
                    SetMotionMode(CRaceMotionData::MODE_HORSE_BELL);
                else
                    SetMotionMode(CRaceMotionData::MODE_BELL);
                break;
            case CItemData::WEAPON_FAN:
                if (m_kHorse.IsMounting())
                    SetMotionMode(CRaceMotionData::MODE_HORSE_FAN);
                else
                    SetMotionMode(CRaceMotionData::MODE_FAN);
                break;
            case CItemData::WEAPON_CLAW:
                if (m_kHorse.IsMounting())
                    SetMotionMode(CRaceMotionData::MODE_HORSE_CLAW);
                else
                    SetMotionMode(CRaceMotionData::MODE_CLAW);
                break;
            default:
                    if (m_kHorse.IsMounting())
                        SetMotionMode(CRaceMotionData::MODE_HORSE);
                    else
                        SetMotionMode(CRaceMotionData::MODE_GENERAL);
                break;
        }
    }
#endif
    else if (m_kHorse.IsMounting())
    {
        switch (bySubType)
        {
            case CItemData::WEAPON_SWORD:
                SetMotionMode(CRaceMotionData::MODE_HORSE_ONEHAND_SWORD);
                break;

            case CItemData::WEAPON_TWO_HANDED:
                SetMotionMode(CRaceMotionData::MODE_HORSE_TWOHAND_SWORD);
                break;

            case CItemData::WEAPON_DAGGER:
                SetMotionMode(CRaceMotionData::MODE_HORSE_DUALHAND_SWORD);
                break;

            case CItemData::WEAPON_FAN:
                SetMotionMode(CRaceMotionData::MODE_HORSE_FAN);
                break;

            case CItemData::WEAPON_BELL:
                SetMotionMode(CRaceMotionData::MODE_HORSE_BELL);
                break;

            case CItemData::WEAPON_BOW:
#ifdef ENABLE_NEW_ARROW_SYSTEM
                if (m_awPart[CRaceData::PART_ARROW_TYPE] == CItemData::WEAPON_UNLIMITED_ARROW)
                    SetMotionMode(CRaceMotionData::MODE_BOW_SPECIAL);
                else
                    SetMotionMode(CRaceMotionData::MODE_BOW);
#else
                SetMotionMode(CRaceMotionData::MODE_BOW);
#endif
                break;

            case CItemData::WEAPON_CLAW:
                SetMotionMode(CRaceMotionData::MODE_HORSE_CLAW);
                break;

            default:
                SetMotionMode(CRaceMotionData::MODE_HORSE);
                break;
        }
    }
    else
    {
        switch (bySubType)
        {
            case CItemData::WEAPON_SWORD:
                SetMotionMode(CRaceMotionData::MODE_ONEHAND_SWORD);
                break;

            case CItemData::WEAPON_TWO_HANDED:
                SetMotionMode(CRaceMotionData::MODE_TWOHAND_SWORD);
                break;

            case CItemData::WEAPON_DAGGER:
                SetMotionMode(CRaceMotionData::MODE_DUALHAND_SWORD);
                break;

            case CItemData::WEAPON_BOW:
                SetMotionMode(CRaceMotionData::MODE_BOW);
                break;

            case CItemData::WEAPON_FAN:
                SetMotionMode(CRaceMotionData::MODE_FAN);
                break;

            case CItemData::WEAPON_BELL:
                SetMotionMode(CRaceMotionData::MODE_BELL);
                break;

            case CItemData::WEAPON_CLAW:
                SetMotionMode(CRaceMotionData::MODE_CLAW);
                break;

            case CItemData::WEAPON_ARROW:
#ifdef ENABLE_NEW_ARROW_SYSTEM
            case CItemData::WEAPON_UNLIMITED_ARROW:
#endif
            default:
                SetMotionMode(CRaceMotionData::MODE_GENERAL);
                break;
        }
    }

    if (isLoop)
        m_GraphicThingInstance.InterceptLoopMotion(dwMotIndex);
    else
        m_GraphicThingInstance.InterceptOnceMotion(dwMotIndex);

    RefreshActorInstance();
}

 

i think you understand the problem  

thanks in adv :)

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

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.