Jump to content

.ZeNu

Banned
  • Posts

    100
  • Joined

  • Last visited

  • Days Won

    16
  • Feedback

    0%

Posts posted by .ZeNu

  1. Acum 3 ore, Cunoo a spus:

    I dont know what is it for what?

    This is only for lags.. Better edit source for all drop in inventory, like quest..

    This is very horrible.

    Dude, i saw this ideea on Rubinum and Aeldra, and of course, this idea was appreciated by the players.The most important.

    And what you say can't be applied as in the case presented by me in the gif,.You can make all items directly in the inventory with server source, but is not ok from other points of view.

    • Love 2
  2. M2 Download Center

    This is the hidden content, please
    ( Internal )

    Description:

    https://metin2.download/picture/3JAP32qLlLK407s98dxspyC9aE2cewNJ/.gif

     

     

    // 1. PythonPlayerInput.cpp
    // 1.0. Search:
    void CPythonPlayer::PickCloseItem()
    {
    	...
    }
    // 1.0. Add after:
    void CPythonPlayer::PickCloseItemVector()
    {
    	CInstanceBase * pkInstMain = NEW_GetMainActorPtr();
    	if (!pkInstMain)
    		return;
    
    	TPixelPosition kPPosMain;
    	pkInstMain->NEW_GetPixelPosition(&kPPosMain);
    
    	std::vector<DWORD> itemVidList;
    	
    	CPythonItem& rkItem=CPythonItem::Instance();
    	if (!rkItem.GetCloseItemVector(pkInstMain->GetNameString(), kPPosMain, itemVidList))
    		return;
    	
    	if(itemVidList.empty())
    		return;
    	
    	for(int i = 0; i < itemVidList.size(); i++)
    		SendClickItemPacket(itemVidList[i]);
    }
    
    
    // 2. PythonItem.cpp
    // 2.0. Search:
    bool CPythonItem::GetCloseItem (const std::string& myName, const TPixelPosition& c_rPixelPosition, DWORD* pdwItemID, DWORD dwDistance)
    {
    	....
    }
    // 2.0. Add after:
    bool CPythonItem::GetCloseItemVector(const std::string& myName, const TPixelPosition& c_rPixelPosition, std::vector<DWORD>& itemVidList)
    {
    	DWORD dwCloseItemDistance = 1000 * 1000;
    	
    	TGroundItemInstanceMap::iterator i;
    	for (i = m_GroundItemInstanceMap.begin(); i != m_GroundItemInstanceMap.end(); ++i)
    	{
    		TGroundItemInstance * pInstance = i->second;
    
    		DWORD dwxDistance = DWORD(c_rPixelPosition.x - pInstance->v3EndPosition.x);
    		DWORD dwyDistance = DWORD(c_rPixelPosition.y - (-pInstance->v3EndPosition.y));
    		DWORD dwDistance = DWORD(dwxDistance * dwxDistance + dwyDistance * dwyDistance);
    
    		if (dwDistance < dwCloseItemDistance && (pInstance->stOwnership == "" || pInstance->stOwnership == myName))
    		{
    			itemVidList.push_back(i->first);
    		}
    	}
    
    	return true;
    }
    
    
    // 3. PythonItem.h
    // 3.0. Search:
    		bool	GetCloseMoney(const TPixelPosition & c_rPixelPosition, DWORD* dwItemID, DWORD dwDistance=300);
    // 3.0. Adauga sub:
    		bool 	GetCloseItemVector(const std::string& myName, const TPixelPosition& c_rPixelPosition, std::vector<DWORD>& itemVidList);
    		
    		
    // 4. PythonPlayer.cpp
    // 4.0. Search and replace:
    void CPythonPlayer::SendClickItemPacket(DWORD dwIID)
    {
    	if (IsObserverMode())
    		return;
    		
    	const char * c_szOwnerName;
    	if (!CPythonItem::Instance().GetOwnership(dwIID, &c_szOwnerName))
    		return;
    
    	if (strlen(c_szOwnerName) > 0)
    	if (0 != strcmp(c_szOwnerName, GetName()))
    	{
    		CItemData * pItemData;
    		if (!CItemManager::Instance().GetItemDataPointer(CPythonItem::Instance().GetVirtualNumberOfGroundItem(dwIID), &pItemData))
    		{
    			Tracenf("CPythonPlayer::SendClickItemPacket(dwIID=%d) : Non-exist item.", dwIID);
    			return;
    		}
    		
    		if (!IsPartyMemberByName(c_szOwnerName) || pItemData->IsAntiFlag(CItemData::ITEM_ANTIFLAG_DROP | CItemData::ITEM_ANTIFLAG_GIVE))
    		{
    			PyCallClassMemberFunc(m_ppyGameWindow, "OnCannotPickItem", Py_BuildValue("()"));
    			return;
    		}
    	}
    
    	CPythonNetworkStream& rkNetStream=CPythonNetworkStream::Instance();
    	rkNetStream.SendItemPickUpPacket(dwIID);
    }
    
    
    // 5. PythonPlayerModule.cpp
    // 5.0. Search:
    PyObject * playerPickCloseItem(PyObject* poSelf, PyObject* poArgs)
    {
    	CPythonPlayer::Instance().PickCloseItem();
    	return Py_BuildNone();
    }
    // 5.0. Add after:
    PyObject * playerPickCloseItemVector(PyObject* poSelf, PyObject* poArgs)
    {
    	CPythonPlayer::Instance().PickCloseItemVector();
    	return Py_BuildNone();
    }
    
    // 5.1. Search:
    		{ "PickCloseItem",				playerPickCloseItem,				METH_VARARGS },
    // 5.1.Add after::
    		{ "PickCloseItemVector",		playerPickCloseItemVector,			METH_VARARGS },
    		
    		
    		
    // 6. PythonPlayer,h
    // 6.0. Search:
    		void	PickCloseItem();
    // 6.0. Add after:
    		void 	PickCloseItemVector();
    		
    		
    		
    // 7. game.py 
    // 7. Search:
    	player.PickCloseItem()
    // 7. Replace with:
    	player.PickCloseItemVector()
    	
    
    // You can make option for fast pickup or not.

     

    • Metin2 Dev 99
    • Eyes 1
    • Dislove 1
    • Angry 1
    • Cry 2
    • Think 2
    • Confused 3
    • Scream 2
    • Lmao 2
    • Good 38
    • Love 6
    • Love 93
  3. M2 Download Center

    This is the hidden content, please
    ( Internal )

    Auto refine option when you upgrade the item with SCROLL or on NPC.

    I did all checks like example :

    When you have just one scroll in inventory, refine window will be close.

    When the item is already maximum upgrade. (+8 to +9 just in case will be succes) 

    and more ..

     

    Preview:

    https://metin2.download/picture/698k2baWEOV40gk0jFvHl4l031PHq8fP/.gif

     

    Download :

    This is the hidden content, please

     

    • Metin2 Dev 247
    • Facepalm 1
    • Dislove 3
    • Angry 2
    • Not Good 3
    • Smile Tear 1
    • Think 5
    • Confused 3
    • Scream 5
    • Lmao 2
    • Good 74
    • Love 10
    • Love 168
  4. M2 Download Center

    This is the hidden content, please
    ( Internal )

     

    // If you use my special storage, and ofc if you want add "ACMD(do_sort_special_storage);" too. ^
     
    //////////// CMD.CPP ////////////
    Search :
    ACMD(do_stun);
     
    Add after :
    #ifdef ENABLE_SORT_INVENTORY
    ACMD(do_sort_items);
    ACMD(do_sort_special_storage);
    #endif
     
    Search:
        {                   "notice",                               do_notice,                          0,                  POS_DEAD,                       GM_LOW_WIZARD                   },
     
    Add after :
    #ifdef ENABLE_SORT_INVENTORY
        {                   "click_sort_items",                     do_sort_items,                      0,                  POS_DEAD,                       GM_PLAYER                       },
        {                   "click_sort_special_storage",           do_sort_special_storage,            0,                  POS_DEAD,                       GM_PLAYER                       },
    #endif
     
     
    //////////// CMD_GNERAL.CPP ////////////
     
    ADD THIS :
    #ifdef ENABLE_SORT_INVENTORY
    ACMD (do_sort_items)
    {
        if (ch->IsDead() || ch->GetExchange() || ch->IsShop() || ch->IsOpenSafebox() || ch->IsCubeOpen())
        {
            ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't sort your inventory with those windows open."));
            return;
        }
       
        int lastSortInventoryPulse = ch->GetSortInventoryPulse();
        int currentPulse = thecore_pulse();
       
        if (lastSortInventoryPulse > currentPulse) {
            int deltaInSeconds = ((lastSortInventoryPulse / PASSES_PER_SEC(1)) - (currentPulse / PASSES_PER_SEC(1)));
            int minutes = deltaInSeconds / 60;
            int seconds = (deltaInSeconds - (minutes * 60));
            return;
        }
       
        for (int i = 0; i < INVENTORY_MAX_NUM; ++i)
        {
            LPITEM item = ch->GetInventoryItem(i);
           
            if(!item)
                continue;
           
            if(item->isLocked())
                continue;
           
            if(item->GetCount() == g_bItemCountLimit)
                continue;
           
            if (item->IsStackable() && !IS_SET(item->GetAntiFlag(), ITEM_ANTIFLAG_STACK))
            {
                for (int j = i; j < INVENTORY_MAX_NUM; ++j)
                {
                    LPITEM item2 = ch->GetInventoryItem(j);
                   
                    if(!item2)
                        continue;
                   
                    if(item2->isLocked())
                        continue;
       
                    if (item2->GetVnum() == item->GetVnum())
                    {
                        bool bStopSockets = false;
                       
                        for (int k = 0; k < ITEM_SOCKET_MAX_NUM; ++k)
                        {
                            if (item2->GetSocket(k) != item->GetSocket(k))
                            {
                                bStopSockets = true;
                                break;
                            }
                        }
                       
                        if(bStopSockets)
                            continue;
       
                        BYTE bAddCount = MIN(g_bItemCountLimit - item->GetCount(), item2->GetCount());
       
                        item->SetCount(item->GetCount() + bAddCount);
                        item2->SetCount(item2->GetCount() - bAddCount);
                       
                        continue;
                    }
                }
            }
        }
       
        ch->SetNextSortInventoryPulse(thecore_pulse() + PASSES_PER_SEC(60));
    }
     
    ACMD (do_sort_special_storage)
    {
        if (ch->IsDead() || ch->GetExchange() || ch->IsShop() || ch->IsOpenSafebox() || ch->IsCubeOpen())
        {
            ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't sort your inventory with those windows open."));
            return;
        }
       
        int lastSortSpecialStoragePulse = ch->GetSortSpecialStoragePulse();
        int currentPulse = thecore_pulse();
       
        if (lastSortSpecialStoragePulse > currentPulse) {
            int deltaInSeconds = ((lastSortSpecialStoragePulse / PASSES_PER_SEC(1)) - (currentPulse / PASSES_PER_SEC(1)));
            int minutes = deltaInSeconds / 60;
            int seconds = (deltaInSeconds - (minutes * 60));
     
            ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can sort your inventory again in %02d seconds."), seconds);
            return;
        }
       
       
        for (int m = 0; m < 3; m++)
        {
            for (int i = 0; i < SPECIAL_INVENTORY_MAX_NUM; ++i)
            {
                LPITEM item;
               
                switch(m)
                {
                    case 0:
                        item = ch->GetUpgradeInventoryItem(i);
                        break;
                    case 1:
                        item = ch->GetBookInventoryItem(i);
                        break;
                    case 2:
                        item = ch->GetStoneInventoryItem(i);
                        break;
                    default:
                        item = ch->GetUpgradeInventoryItem(i);
                        break;
                }
               
                if(!item)
                    continue;
               
                if(item->isLocked())
                    continue;
               
                if(item->GetCount() == g_bItemCountLimit)
                    continue;
               
                if (item->IsStackable() && !IS_SET(item->GetAntiFlag(), ITEM_ANTIFLAG_STACK))
                {
                    for (int j = i; j < SPECIAL_INVENTORY_MAX_NUM; ++j)
                    {
                       
                        LPITEM item2;
                       
                        switch(m)
                        {
                            case 0:
                                item2 = ch->GetUpgradeInventoryItem(j);
                                break;
                            case 1:
                                item2 = ch->GetBookInventoryItem(j);
                                break;
                            case 2:
                                item2 = ch->GetStoneInventoryItem(j);
                                break;
                            default:
                                item2 = ch->GetUpgradeInventoryItem(j);
                                break;
                        }
               
                        if(!item2)
                            continue;
                       
                        if(item2->isLocked())
                            continue;
           
                        if (item2->GetVnum() == item->GetVnum())
                        {
                            bool bStopSockets = false;
                           
                            for (int k = 0; k < ITEM_SOCKET_MAX_NUM; ++k)
                            {
                                if (item2->GetSocket(k) != item->GetSocket(k))
                                {
                                    bStopSockets = true;
                                    break;
                                }
                            }
                           
                            if(bStopSockets)
                                continue;
           
                            BYTE bAddCount = MIN(g_bItemCountLimit - item->GetCount(), item2->GetCount());
           
                            item->SetCount(item->GetCount() + bAddCount);
                            item2->SetCount(item2->GetCount() - bAddCount);
                           
                            continue;
                        }
                    }
                }
            }
        }
     
        ch->SetNextSortSpecialStoragePulse(thecore_pulse() + PASSES_PER_SEC(60));
    }
    #endif
    //////////// char.cpp ////////////
    Search :
        m_iSyncHackCount = 0;
     
    Add after:
     
    #ifdef ENABLE_SORT_INVENTORY
        m_sortInventoryPulse = 0;
        m_sortSpecialStoragePulse = 0;
    #endif
     
    //////////// char.h ////////////
    Search :
    void            GiveGold(INT iAmount);
     
    Add after :
     
    #ifdef ENABLE_SORT_INVENTORY
            void            SetNextSortInventoryPulse(int pulse) { m_sortInventoryPulse = pulse; }
            int             GetSortInventoryPulse() { return m_sortInventoryPulse; }
           
            void            SetNextSortSpecialStoragePulse(int pulse) { m_sortSpecialStoragePulse = pulse; }
            int             GetSortSpecialStoragePulse() { return m_sortSpecialStoragePulse; }
    #endif
     
    Search :
     
            LPSHOP          m_pkShop;
            LPSHOP          m_pkMyShop;
            std::string     m_stShopSign;
            LPCHARACTER     m_pkChrShopOwner;
     
    Add after :
     
    #ifdef ENABLE_SORT_INVENTORY
            int     m_sortInventoryPulse;
            int     m_sortSpecialStoragePulse;
    #endif
     
    /////// Service.h ////////
     
    Add this :
    #define ENABLE_SORT_INVENTORY

     

    Description :

    https://metin2.download/picture/crvP0X3XlM4WoKb0U11qEUG6QSXIXea9/.gif

    • Metin2 Dev 54
    • Eyes 1
    • Dislove 1
    • Not Good 1
    • Sad 2
    • Think 1
    • Confused 2
    • Good 17
    • Love 6
    • Love 57
  5. https://pastebin.com/eHXxUSt

     

     

    1. 01. Search :
    2. #include "priv_manager.h"
    3.  
    4. 01. Add after :
    5.  
    6. #ifdef ENABLE_MOUNT_COSTUME_SYSTEM
    7. #include "MountSystem.h"
    8. #endif
    9.  
    10.  
    11. 02. Search :
    12.  
    13.     if (g_noticeBattleZone)
    14.     {
    15.                 ...
    16.     }
    17.    
    18. 02. Add after :
    19.  
    20. #ifdef ENABLE_MOUNT_COSTUME_SYSTEM
    21.     if (ch->GetMapIndex() != 113 && CArenaManager::instance().IsArenaMap(ch->GetMapIndex()) == false)
    22.     {
    23.         ch->CheckMount();
    24.     }
    25. #endif

    c

    • Metin2 Dev 8
    • Think 1
    • Good 5
    • Love 2
  6. M2 Download Center

    This is the hidden content, please
    ( Internal )

    Description:
    When you craft a item the bonuses from the old item will be transferred(saved).

     

    ### Cube.cpp
    
    //Search : 
    	this->gold = 0;
    
    //Add after : 
    #ifdef ENABLE_CUBE_RENEWAL
    	this->allowCopyAttr = false;
    #endif
    
    
    //Search:
    		else TOKEN("gold")
    		{
    			cube_data->gold = value1;
    		}
    
    
    //Add after :
    
    #ifdef ENABLE_CUBE_RENEWAL
    		else TOKEN("allow_copy")
    		{
    			cube_data->allowCopyAttr = (value1 == 1 ? true : false);
    		}
    #endif
    
    //Search in : bool Cube_make (LPCHARACTER ch)
    	LPITEM	new_item;
    
    Add after : 
    
    #ifdef ENABLE_CUBE_RENEWAL
    	DWORD copyAttr[ITEM_ATTRIBUTE_MAX_NUM][2];
    #endif
    
    //Search :
    CUBE_VALUE	*reward_value = cube_proto->reward_value();
    
    //Add after:
    #ifdef ENABLE_CUBE_RENEWAL
    	for (int i=0; i<CUBE_MAX_NUM; ++i)
    	{
    		if (NULL==items[i])	continue;
    
    		if (items[i]->GetType() == ITEM_WEAPON || items[i]->GetType() == ITEM_ARMOR)
    		{
    			bool hasElement = false;
    			for (int j = 0; j < cube_proto->item.size(); ++j)
    			{
    				if(cube_proto->item[j].vnum == items[i]->GetVnum())
    				{
    					hasElement = true;
    					break;
    				}
    			}
    			
    			if(hasElement == false)
    				continue;
    			
    			for (int a = 0; a < ITEM_ATTRIBUTE_MAX_NUM; a++)
    			{
    				copyAttr[a][0] = items[i]->GetAttributeType(a);
    				copyAttr[a][1] = items[i]->GetAttributeValue(a);
    			}
    
    			break;
    		}
    		
    		continue;
    	}
    #endif
    
    //Search:
    new_item = ch->AutoGiveItem(reward_value->vnum, reward_value->count);
    
    //Add after:
    
    #ifdef ENABLE_CUBE_RENEWAL
    		if (cube_proto->allowCopyAttr == true && copyAttr != NULL)
    		{
    			new_item->ClearAttribute();
    			
    			for (int a = 0; a < ITEM_ATTRIBUTE_MAX_NUM; a++)
    			{
    				new_item->SetForceAttribute(a, copyAttr[a][0], copyAttr[a][1]);
    			}
    		}
    #endif
    
    
    
    ###cube.h
    
    //Search in : struct CUBE_DATA
    
    	int						percent;
    	unsigned int			gold;
    
    //Add after :
    
    #ifdef ENABLE_CUBE_RENEWAL
    	bool					allowCopyAttr;
    #endif
    
    
    ###service.h
    /Add:
    
    #define ENABLE_CUBE_RENEWAL
    
    
    Example in cube.txt
    section		
    npc	20378	
    item	11299	1
    item	30509	10
    item	30516	10
    item	30514	10
    allow_copy	1
    reward	20000	1
    gold	100000	
    percent	60	
    end

     

    • Metin2 Dev 17
    • Good 6
    • Love 1
    • Love 20
  7. M2 Download Center

    This is the hidden content, please
    ( Internal )

    Description :

    • The mount will follow you.
    • The bonuses is set from item_proto.
       

    https://metin2.download/picture/559sESZ3iBgtGvKZV5fkd22h0KmHibi8/.gif
    https://metin2.download/picture/XSOe492wbEm296xZxCQd5diJ59zmJAl9/.gif

    https://metin2.download/picture/m8KttSHiYiJR5BBdl9MR0j0gyT937oBY/.gif

     

    Code is based on default pet code from Ymir, i don't offer support for extra features, details, anyway easy for use.
    (Sorry for tutorial, not so perfect.)


    Download (Reupload):

    This is the hidden content, please

     

    • Metin2 Dev 299
    • kekw 2
    • Eyes 7
    • Angry 2
    • Sad 2
    • Smile Tear 1
    • Think 2
    • Confused 4
    • Lmao 1
    • Good 114
    • Love 16
    • Love 192
×
×
  • 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.