Jump to content
For maintenance and updates, the community will be offline on 31 December 2022 ×
!-->

Removing Arrow requirement in Bow use


Recommended Posts

Something I forgot or if you have a problem, feel free to ask for help by writing a comment.

add in service.h in a suitable place

#define OK_KALDIRMA


char_battle.cpp Açılır

//Find function

int CHARACTER::GetArrowAndBow

//REPLACE ENTIRE FUNCTION

#ifdef OK_KALDIRMA
int CHARACTER::GetBow(LPITEM* ppkBow)
#else
int CHARACTER::GetArrowAndBow(LPITEM* ppkBow, LPITEM* ppkArrow, int iArrowCount)
#endif
{
    LPITEM pkBow;

    if (!(pkBow = GetWear(WEAR_WEAPON)) || pkBow->GetProto()->bSubType != WEAPON_BOW)
    {
        return 0;
    }

#ifdef OK_KALDIRMA
    *ppkBow = pkBow;

    return 1;
#else
    LPITEM pkArrow;

    if (!(pkArrow = GetWear(WEAR_ARROW)) || pkArrow->GetType() != ITEM_WEAPON ||
        pkArrow->GetProto()->bSubType != WEAPON_ARROW)
    {
        return 0;
    }

    iArrowCount = MIN(iArrowCount, pkArrow->GetCount());

    *ppkBow = pkBow;
    *ppkArrow = pkArrow;

    return iArrowCount;
#endif
}

// SEARCH

LPITEM pkBow, pkArrow;

// REPLACE

#ifdef OK_KALDIRMA
        LPITEM pkBow;
#else
        LPITEM pkBow, pkArrow;
#endif

// SEARCH

if (0 == m_me->GetArrowAndBow(&pkBow, &pkArrow))

// REPLACE

#ifdef OK_KALDIRMA
                if (0 == m_me->GetBow(&pkBow))
#else
                if (0 == m_me->GetArrowAndBow(&pkBow, &pkArrow))
#endif

// SEARCH

iDam = CalcArrowDamage(m_me, pkVictim, pkBow, pkArrow)

// REPLACE

#ifdef OK_KALDIRMA
                iDam = CalcArrowDamage(m_me, pkVictim, pkBow);
#else
                iDam = CalcArrowDamage(m_me, pkVictim, pkBow, pkArrow);
                m_me->UseArrow(pkArrow, 1);
#endif

// SEARCH

if (iUseArrow == m_me->GetArrowAndBow(&pkBow, &pkArrow, iUseArrow))

// REPLACE

#ifdef OK_KALDIRMA
                if (iUseArrow == m_me->GetBow(&pkBow))
#else
                if (iUseArrow == m_me->GetArrowAndBow(&pkBow, &pkArrow, iUseArrow))
#endif

// SEARCH

m_me->UseArrow(pkArrow, iUseArrow);

// REPLACE

#ifndef OK_KALDIRMA
                    m_me->UseArrow(pkArrow, iUseArrow);
#endif

// SEARCH

if (iUseArrow == m_me->GetArrowAndBow(&pkBow, &pkArrow, iUseArrow))

// REPLACE

#ifdef OK_KALDIRMA
            if (iUseArrow == m_me->GetBow(&pkBow))
#else
            if (iUseArrow == m_me->GetArrowAndBow(&pkBow, &pkArrow, iUseArrow))
#endif

// SEARCH

m_me->UseArrow(pkArrow, iUseArrow);

// REPLACE

#ifndef OK_KALDIRMA
                m_me->UseArrow(pkArrow, iUseArrow);
#endif

// SEARCH

if (iUseArrow == m_me->GetArrowAndBow(&pkBow, &pkArrow, iUseArrow))

// REPLACE

#ifdef OK_KALDIRMA
            if (iUseArrow == m_me->GetBow(&pkBow))
#else
            if (iUseArrow == m_me->GetArrowAndBow(&pkBow, &pkArrow, iUseArrow))
#endif

// SEARCH

m_me->UseArrow(pkArrow, iUseArrow);

// REPLACE

#ifndef OK_KALDIRMA
                m_me->UseArrow(pkArrow, iUseArrow);
#endif

// SEARCH

if (iUseArrow == m_me->GetArrowAndBow(&pkBow, &pkArrow, iUseArrow))

// REPLACE

#ifdef OK_KALDIRMA
            if (iUseArrow == m_me->GetBow(&pkBow))
#else
            if (iUseArrow == m_me->GetArrowAndBow(&pkBow, &pkArrow, iUseArrow))
#endif

// SEARCH

m_me->UseArrow(pkArrow, iUseArrow);

// REPLACE

#ifndef OK_KALDIRMA
                m_me->UseArrow(pkArrow, iUseArrow);
#endif

// SEARCH

if (iUseArrow == m_me->GetArrowAndBow(&pkBow, &pkArrow, iUseArrow))

// REPLACE

#ifdef OK_KALDIRMA
            if (iUseArrow == m_me->GetBow(&pkBow))
#else
            if (iUseArrow == m_me->GetArrowAndBow(&pkBow, &pkArrow, iUseArrow))
#endif

// SEARCH

m_me->UseArrow(pkArrow, iUseArrow);

// REPLACE

#ifndef OK_KALDIRMA
                m_me->UseArrow(pkArrow, iUseArrow);
#endif



char.h Açılır

// FIND

GetArrowAndBow

// REPLACE

#ifdef OK_KALDIRMA
    int                    GetBow(LPITEM* ppkBow);
#else
    int                    GetArrowAndBow(LPITEM* ppkBow, LPITEM* ppkArrow, int iArrowCount = 1);
#endif


char_skill.cpp Açılır

// FIND

            LPITEM pkBow, pkArrow;

            if (1 == m_pkChr->GetArrowAndBow(&pkBow, &pkArrow, 1))
                m_pkSk->SetPointVar("atk", CalcArrowDamage(m_pkChr, pkChrVictim, pkBow, pkArrow, true));
               
// REPLACE

#ifdef OK_KALDIRMA
            LPITEM pkBow;

            if (1 == m_pkChr->GetBow(&pkBow))
                m_pkSk->SetPointVar("atk", CalcArrowDamage(m_pkChr, pkChrVictim, pkBow, true));
#else
            LPITEM pkBow, pkArrow;

            if (1 == m_pkChr->GetArrowAndBow(&pkBow, &pkArrow, 1))
                m_pkSk->SetPointVar("atk", CalcArrowDamage(m_pkChr, pkChrVictim, pkBow, pkArrow, true));
#endif

// FIND

        LPITEM pkBow, pkArrow;

        if (1 == GetArrowAndBow(&pkBow, &pkArrow, 1))
        {
            pkSk->SetPointVar("atk", CalcArrowDamage(this, this, pkBow, pkArrow, true));
        }
       
// REPLACE

#ifdef OK_KALDIRMA
        LPITEM pkBow;

        if (1 == GetBow(&pkBow))
            pkSk->SetPointVar("atk", CalcArrowDamage(this, this, pkBow, true));
#else
        LPITEM pkBow, pkArrow;

        if (1 == GetArrowAndBow(&pkBow, &pkArrow, 1))
        {
            pkSk->SetPointVar("atk", CalcArrowDamage(this, this, pkBow, pkArrow, true));
        }
#endif

// FIND

        LPITEM pkBow, pkArrow;

        if (1 == GetArrowAndBow(&pkBow, &pkArrow, 1))
        {
            pkSk->SetPointVar("atk", CalcArrowDamage(this, pkVictim, pkBow, pkArrow, true));
        }
       
// REPLACE

#ifdef OK_KALDIRMA
        LPITEM pkBow;

        if (1 == GetBow(&pkBow))
            pkSk->SetPointVar("atk", CalcArrowDamage(this, pkVictim, pkBow, true));
#else
        LPITEM pkBow, pkArrow;

        if (1 == GetArrowAndBow(&pkBow, &pkArrow, 1))
        {
            pkSk->SetPointVar("atk", CalcArrowDamage(this, pkVictim, pkBow, pkArrow, true));
        }
#endif

// FIND

        LPITEM pkBow, pkArrow;

        if (1 == GetArrowAndBow(&pkBow, &pkArrow, 1))
        {
            pkSk->SetPointVar("atk", CalcArrowDamage(this, pkVictim, pkBow, pkArrow, true));
        }
       
// REPLACE

#ifdef OK_KALDIRMA
        LPITEM pkBow;
        if (1 == GetBow(&pkBow))
            pkSk->SetPointVar("atk", CalcArrowDamage(this, pkVictim, pkBow, true));
#else
        LPITEM pkBow, pkArrow;

        if (1 == GetArrowAndBow(&pkBow, &pkArrow, 1))
        {
            pkSk->SetPointVar("atk", CalcArrowDamage(this, pkVictim, pkBow, pkArrow, true));
        }
#endif



battle.h Açılır


// FIND

extern int    CalcArrowDamage

// REPLACE

#ifdef OK_KALDIRMA
extern int    CalcArrowDamage(LPCHARACTER pkAttacker, LPCHARACTER pkVictim, LPITEM pkBow, bool bIgnoreDefense = false);
#else
extern int    CalcArrowDamage(LPCHARACTER pkAttacker, LPCHARACTER pkVictim, LPITEM pkBow, LPITEM pkArrow, bool bIgnoreDefense = false);
#endif


battle.cpp Açılır

// FIND FUNCTION

int CalcArrowDamage

// REPLACE

#ifdef OK_KALDIRMA
int CalcArrowDamage(LPCHARACTER pkAttacker, LPCHARACTER pkVictim, LPITEM pkBow, bool bIgnoreDefense)
#else
int CalcArrowDamage(LPCHARACTER pkAttacker, LPCHARACTER pkVictim, LPITEM pkBow, LPITEM pkArrow, bool bIgnoreDefense)
#endif

// FIND IN THE FUNCTION

if (!pkArrow)
        return 0;
       
// REPLACE

#ifndef OK_KALDIRMA
    if (!pkArrow)
        return 0;
#endif

// FIND IN THE FUNCTION

iDam = number(pkBow->GetValue(3), pkBow->GetValue(4)) * 2 + pkArrow->GetValue(3);

// REPLACE

#ifdef OK_KALDIRMA
    iDam = number(pkBow->GetValue(3), pkBow->GetValue(4)) * 2;
#else
    iDam = number(pkBow->GetValue(3), pkBow->GetValue(4)) * 2 + pkArrow->GetValue(3);
#endif

locale_inc.h Açılır müsait bir yere eklenir

#define OK_KALDIRMA


PythonPlayerSkill.cpp Açılır

// FIND FUNCTION

bool CPythonPlayer::__HasEnoughArrow()

// ENTIRE FUNCTION IS REPLACED

bool CPythonPlayer::__HasEnoughArrow()
{
#ifdef OK_KALDIRMA
    return true;
#else
    CItemData* pItemData;
    if (CItemManager::Instance().GetItemDataPointer(GetItemIndex(TItemPos(INVENTORY, c_Equipment_Arrow)), &pItemData))
        if (CItemData::ITEM_TYPE_WEAPON == pItemData->GetType())
            if (CItemData::WEAPON_ARROW == pItemData->GetSubType())
            {
                return true;
            }

    PyCallClassMemberFunc(m_ppyGameWindow, "OnCannotShotError", Py_BuildValue("(is)", GetMainCharacterIndex(), "EMPTY_ARROW"));
    return false;
#endif
}

 

  • Facepalm 3
  • Love 1
  • Good 1
  • Lmao 1
  • Sad 1

From nothing To something To everything...One Day At A Time Netflix GIF by It Gets Better Project

Link to comment
Share on other sites



!-->
×
×
  • 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.