Jump to content

5 seconds to use item 22010 return


Recommended Posts

I did not test it!!!!!!

 

Open char.h and search:

DWORD            GetLastMoveTime() const        { return m_dwLastMoveTime; }

Add under:

DWORD            GetLastItemUseTime() const {return m_dwLastItemUseTime;}

Search:

DWORD            m_dwLastMoveTime;

Add under:

DWORD            m_dwLastItemUseTime;

Open char.cpp file and search:

m_dwPlayStartTime = m_dwLastMoveTime = get_dword_time();

Add under:

m_dwLastItemUseTime = 0;

Open char_item.cpp file and search:

        if (item->GetVnum() != 70302)
        {
            PIXEL_POSITION posWarp;

            int x = 0;
            int y = 0;

            double nDist = 0;
            const double nDistant = 5000.0;
            //±ÍČŻ±âľďşÎ 
            if (item->GetVnum() == 22010)
            {
                x = item->GetSocket(0) - GetX();
                y = item->GetSocket(1) - GetY();
            }
            //±ÍČŻşÎ
            else if (item->GetVnum() == 22000) 
            {
                SECTREE_MANAGER::instance().GetRecallPositionByEmpire(GetMapIndex(), GetEmpire(), posWarp);

                if (item->GetSocket(0) == 0)
                {
                    x = posWarp.x - GetX();
                    y = posWarp.y - GetY();
                }
                else
                {
                    x = item->GetSocket(0) - GetX();
                    y = item->GetSocket(1) - GetY();
                }
            }

Add under:

            int CalcLastItemUseSec = (get_dword_time() - GetLastItemUseTime()) / 1000 + 0.5; 

            if (CalcLastItemUseSec < 5)
            {
                ChatPacket(CHAT_TYPE_INFO, LC_TEXT("WAIT_5_SEC_TO_USE"));
                return false;
            }

 

  • Love 2
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



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