Jump to content

kolamajszu

Inactive Member
  • Posts

    17
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by kolamajszu

  1. On 1/29/2016 at 4:22 PM, ds_aim said:

    Okay, follow my tutorial.

     

    1.  Open novaline source.

    2. Make a folder to desktop. Example:  "src_vs2013" .

    3. Drag from novaline Client and Exter folder to "src_vs2013" .

    4. Copy in extern/include/Python27/22 stuffs.

    5. Recompile cryptopp with vs2013 toolset.

    6. Move library in extern/lib (New Cryptopp)

    7. Open .sln from "src_vs2013"   he will update all solutions.

    8. Select Distribute/Build

     

     

    It was hard? Fuck. IT WAS HAAAAAAAAAAAARD ? EHHHH ?

    You don't need include_stuff and lib_stuff shit.  You know only copy/paste ?

     

    Just do what i said.

    Useless

  2. On 11/19/2020 at 11:19 AM, xP3NG3Rx said:

    But after every warp your setting of shadows always will be SHADOW_ALL doesn't matter what is your setting in config if I'm not wrong. For the proper functional solution you need to set the value in the uiSystemOption.py file the value from systemSetting to the background.

     

    def __Load(self):

    wwa67pn.png

     

    PS.: Of course in your file you need to set the position of the slider from the config file first and by that you need to set the value into the background class. The picture above is the latest modification what they made.

    @xP3NG3Rx Can you release the new system options from GF? Shadow level change(árnyék állítás) please!! And other

  3. On 3/10/2015 at 7:54 PM, xP3NG3Rx said:

    Hello everyone,
     
    It is a nice day to release my modifications to sell items from dragon soul inventory too :)
    So let's go.
     
    Serverside:
    1) Open input_main.cpp
    2.1) Search(CTRL+F) this:

    
    
    case SHOP_SUBHEADER_CG_SELL2:

    2.2) Replace that whole case with this:

    
    
    		case SHOP_SUBHEADER_CG_SELL2:
    			{
    				if (uiBytes < sizeof(WORD) + sizeof(BYTE) + sizeof(BYTE))
    					return -1;
    
    				const WORD wPos = *reinterpret_cast<const WORD*>(c_pData);
    				const BYTE bCount = *(c_pData + sizeof(WORD));
    				const BYTE bType = *(c_pData + sizeof(WORD) + sizeof(BYTE));
    
    				sys_log(0, "INPUT: %s SHOP: SELL2", ch->GetName());
    
    				CShopManager::instance().Sell(ch, wPos, bCount, bType);
    				return sizeof(WORD) + sizeof(BYTE) + sizeof(BYTE);
    			}
    

     
    3) Save and close it, now open shop_manager.h
    3.1) And replace this:

    
    
    void		Sell(LPCHARACTER ch, BYTE bCell, BYTE bCount = 0);

    3.2) With this:

    
    
    void		Sell(LPCHARACTER ch, WORD wCell, BYTE bCount = 0, BYTE bType = 0);

     
    4) Save it and close it.
    4.1) Next step; open shop_manager.cpp and search this function:

    
    
    void CShopManager::Sell(LPCHARACTER ch, BYTE bCell, BYTE bCount)

    4.2) Replace the parameters/arguments only with this:

    
    
    LPCHARACTER ch, WORD wCell, BYTE bCount, BYTE bType

    4.3) Search this line:

    
    
    LPITEM item = ch->GetInventoryItem(bCell);

    4.4) And replace it with this:

    
    
    LPITEM item = ch->GetItem(TItemPos(bType, wCell));

    4.5-Choosable) I added a log function too into the antiflag_sell check against hackers :D
    4.5.1) Replace this:

    
    
    	if (IS_SET(item->GetAntiFlag(), ITEM_ANTIFLAG_SELL))
    		return;
    

    4.5.2) With this(as I said, this is choosable, not important change):

    
    
    	if (IS_SET(item->GetAntiFlag(), ITEM_ANTIFLAG_SELL))
    	{
    		// In clientside the sell is blocked by python if a player arrive here he's a hacker, maybe.
    		ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't sell this item."));
    		sys_err("[HACKER] Force sell-script used by name [%u]%s.", ch->GetPlayerID(), ch->GetName());
    		return;
    	}
    

     
    5) Save and close the file, now you are ready to build your game.
     

    Clientside-BIN:
    1) Open PythonNetworkStream.h
    1.1) Search this:

    
    
    bool SendShopSellPacketNew(BYTE bySlot, BYTE byCount);

    1.2) Replace it with this:

    
    
    bool SendShopSellPacketNew(WORD wSlot, BYTE byCount, BYTE byType);

     
    2) Save it, close it. Open PythonNetworkStreamPhaseGameItem.cpp
    2.1) Search this function:

    
    
    bool CPythonNetworkStream::SendShopSellPacketNew(BYTE bySlot, BYTE byCount)

    2.2) Replace the whole function with this:

    
    
    bool CPythonNetworkStream::SendShopSellPacketNew(WORD wSlot, BYTE byCount, BYTE byType)
    {
    	if (!__CanActMainInstance())
    		return true;
    
    	TPacketCGShop PacketShop;
    	PacketShop.header = HEADER_CG_SHOP;
    	PacketShop.subheader = SHOP_SUBHEADER_CG_SELL2;
    
    	if (!Send(sizeof(TPacketCGShop), &PacketShop))
    	{
    		Tracef("SendShopSellPacket Errorn");
    		return false;
    	}
    	if (!Send(sizeof(WORD), &wSlot))
    	{
    		Tracef("SendShopAddSellPacket Errorn");
    		return false;
    	}
    	if (!Send(sizeof(BYTE), &byCount))
    	{
    		Tracef("SendShopAddSellPacket Errorn");
    		return false;
    	}
    	if (!Send(sizeof(BYTE), &byType))
    	{
    		Tracef("SendShopAddSellPacket Errorn");
    		return false;
    	}
    
    	Tracef(" SendShopSellPacketNew(wSlot=%d, byCount=%d, byType=%d)n", wSlot, byCount, byType);
    
    	return SendSequence();
    }
    

     
    3) Save and close. Open PythonNetworkStreamModule.cpp
    3.1) Search this function:

    
    
    PyObject* netSendShopSellPacketNew(PyObject* poSelf, PyObject* poArgs)

    3.2) And replace it with this:

    
    
    PyObject* netSendShopSellPacketNew(PyObject* poSelf, PyObject* poArgs)
    {
    	int iSlotNumber;
    	if (!PyTuple_GetInteger(poArgs, 0, &iSlotNumber))
    		return Py_BuildException();
    	int iCount;
    	if (!PyTuple_GetInteger(poArgs, 1, &iCount))
    		return Py_BuildException();
    	int iType;
    	if (!PyTuple_GetInteger(poArgs, 2, &iType))
    		return Py_BuildException();
    
    	CPythonNetworkStream& rkNetStream=CPythonNetworkStream::Instance();
    	rkNetStream.SendShopSellPacketNew(iSlotNumber, iCount, iType);
    	return Py_BuildNone();
    }
    

     
    4) Save, close and build :D
     

    Clientside-Python:
    Here you have to do it by yourself.
    The new function of the m2net/net module are called by 3 files

    • uiInventory.py
    • uiDragonSoul.py
    • uiShop.py

    You have to edit these files if your files are not containing these updates, but thanks to [sA]Con for the newer root package from his release ^^

    This is the hidden content, please
    the "new" root package which is containing every changes for this and for wolfman.
    I do not recomment to replace or overwrite your files with those files!
    Use a comparer tool like Notepad++ Compare plugin to check the differences at "sell" keyword.
     
    Tested and works, but if you found bug/mistake/error please write into this thread a detailed post.
    So not like this:

     
     
    ps.: I hope you understand everything, and sorry for my poor english:3

    ps2: In the official bin this message " SendShopSellPacketNew(bySlot=%d, byCount=%d, byType=%d)" can be found, but I renamed the variable too, hehe :-D.

    With Regards
    P3NG3R

     

    Clientside-Python:
    Here you have to do it by yourself.
    The new function of the m2net/net module are called by 3 files

    uiInventory.py

    uiDragonSoul.py

    uiShop.py

     

    It has a tutorial for this files? Because i don't want to change the files randomly. Please anybody help me :(

  4.  

    On 5/11/2019 at 4:07 PM, VegaS™ said:

    Good idea, but the python part is a bit too much, 200 lines for 5-6 functions.

    Can be like:

      Reveal hidden contents
    
    
    for i in xrange(1, GRAPHIC_LEVEL_MAX_NUM + 1):
    	self.effectLevelButtonList.append(GetObject("effect_level%d" % i))
    	self.privateShopLevelButtonList.append(GetObject("privateShop_level%d" % i))
    	self.dropItemLevelButtonList.append(GetObject("dropItem_level%d" % i))

    _____________________________________________________________

    Can be like:

      Reveal hidden contents
    
    
    for i in xrange(GRAPHIC_LEVEL_MAX_NUM):
    	self.effectLevelButtonList[i].SAFE_SetEvent(self.__OnClickEffectLevelButton, i)
    	self.privateShopLevelButtonList[i].SAFE_SetEvent(self.__OnClickPrivateShopLevelButton, i)
    	self.dropItemLevelButtonList[i].SAFE_SetEvent(self.__OnClickDropItemLevelButton, i)
    	
    for i in xrange(2):
    	self.petStatusButtonList[i].SAFE_SetEvent(self.__OnClickPetStatusButton, bool(i))
    	self.npcNameStatusButtonList[i].SAFE_SetEvent(self.__OnClickNpcNameStatusButton, bool(i))
    
    # Effect
    def __OnClickEffectLevelButton(self, index):
    	self.__ClickRadioButton(self.effectLevelButtonList, index)
    	self.effectLevel=index
    
    # PrivateShop
    def __OnClickPrivateShopLevelButton(self, index):
    	self.__ClickRadioButton(self.privateShopLevelButtonList, index)
    	self.privateShopLevel=index
    
    # DropItem
    def __OnClickDropItemLevelButton(self, index):
    	self.__ClickRadioButton(self.dropItemLevelButtonList, index)
    	self.dropItemLevel=index
    
    # PetStatus
    def __OnClickPetStatusButton(self, flag):
    	systemSetting.SetPetStatusFlag(flag)
    	self.RefreshPetStatus()
    
    # NpcNameStatus
    def __OnClickNpcNameStatusButton(self, flag):
    	systemSetting.SetNpcNameStatusFlag(flag)
    	self.RefreshNpcNameStatus()

     

    Btw, for rest you can take a look how they're rended and do something like:

    Here you can hide the 'terrain', 'object', 'cloud', 'water', 'tree', and you can disable the effects and more too if you take a look inside of GameLib.

    Over 1.5 year ago i extended a bit my release but didn't had enough time to post it, i'll update the repository with the new code when i'll have time to finish it.

    That feature allow you to hide specific effects, tree, bulding by property crc or name (not finished) and write them into files like:

    graphic_mask/building.txt

    
    general_obj_stone14
    ob-b1-005-woodbarrel
    landmark_statuestone
    B_general_obj_40
    general_obj_jar_yellow01

    graphic_mask/effect.txt

    
    8182371290
    1003918098
    volcano_greatsmoke.mse
    warpgate01
    fall_7
    fire_general_obj_charcoal.mse
    • PythonGraphicMask.cpp
      Reveal hidden contents
    
    
    /*********************************************************************
    * title_name		: Graphic Mask
    * date_created		: 2018.04.21
    * filename			: PythonGraphicMask.cpp
    * author			: VegaS
    * version_actual	: Version 1.0
    */
    
    #include "stdafx.h"
    #ifdef ENABLE_GRAPHIC_MASK
    #include "PythonGraphicMask.h"
    #include "PythonSystem.h"
    #include "../gamelib/MapOutDoor.h"
    #include "../gamelib/MapType.h"
    
    CPythonGraphicMask::CPythonGraphicMask()
    {
    	Initialize(PROPERTY_TYPE_NONE, "graphic_mask/default.txt");
    	Initialize(PROPERTY_TYPE_TREE, "graphic_mask/tree.txt");
    	Initialize(PROPERTY_TYPE_BUILDING, "graphic_mask/building.txt");
    	Initialize(PROPERTY_TYPE_EFFECT, "graphic_mask/effect.txt");
    }
    
    CPythonGraphicMask::~CPythonGraphicMask()
    {
    	Destroy();
    }
    
    void CPythonGraphicMask::Initialize(const BYTE bPropertyType, const char * c_pszFileName)
    {
    	m_vecMaskObjectCRC[bPropertyType].clear();
    
    	FILE * fp = fopen(c_pszFileName, "r");
    	if (!fp)
    	{
    		Tracef("Can't open file %s.", c_pszFileName);
    		return;
    	}
    	
    	Tracef("-------------------- START PARSING --------------------");
    	Tracef("Read with successfully %s!", c_pszFileName);
    
    	char line[256];
    	while (fgets(line, sizeof(line) - 1, fp))
    	{
    		const auto dwCRC = strtoul(line, NULL, 0);
    		m_vecMaskObjectCRC[bPropertyType].push_back(dwCRC);
    	}
    	
    	TraceError("-------------------- END PARSING --------------------");
    }
    
    void CPythonGraphicMask::Destroy()
    {
    	for (size_t i = 0; i < PROPERTY_TYPE_MAX_NUM; ++i)
    		m_vecMaskObjectCRC[i].clear();
    }
    
    bool CPythonGraphicMask::IsEnabled(const BYTE bPropertyType) const
    {
    	if (bPropertyType >= PROPERTY_TYPE_MAX_NUM)
    		return false;
    	
    	switch (bPropertyType)
    	{
    		case prt::PROPERTY_TYPE_TREE:
    			bPropertyType = CMapOutdoor::PART_TREE;
    			break;
    		case prt::PROPERTY_TYPE_BUILDING:
    			bPropertyType = CMapOutdoor::PART_OBJECT;
    			break;
    			
    		case prt::PROPERTY_TYPE_EFFECT:
    			bPropertyType = CMapOutdoor::PART_EFFECT;
    			break;
    	}
    	
    	const CPythonSystem & rkSystem = CPythonSystem::Instance();
    	return rkSystem.GetGraphicMaskPart(bPropertyType);
    }
    
    bool CPythonGraphicMask::GetObjectByCRC(const BYTE bPropertyType, const DWORD dwCRC) const
    {
    	if (bPropertyType >= PROPERTY_TYPE_MAX_NUM)
    		return false;
    
    	return std::find(m_vecMaskObjectCRC[bPropertyType].begin(), m_vecMaskObjectCRC[bPropertyType].end(), dwCRC) != m_vecMaskObjectCRC[bPropertyType].end());;
    }
    #endif

     

    • PythonGraphicMask.h
      Reveal hidden contents
    
    
    #pragma once
    class CPythonGraphicMask : public CSingleton<CPythonGraphicMask>
    {
    	public:
    		CPythonGraphicMask();
    		virtual ~CPythonGraphicMask();
    	
    		void	Initialize(const BYTE bPropertyType, const char * c_pszFileName);
    		void	Destroy();
    		
    		bool	IsEnabled(const BYTE bPropertyType) const;
    		bool	GetObjectByCRC(const BYTE bPropertyType, const DWORD dwCRC) const;
    		
    		enum 
    		{
    			PROPERTY_TYPE_NONE,
    			PROPERTY_TYPE_TREE,
    			PROPERTY_TYPE_BUILDING,
    			PROPERTY_TYPE_EFFECT,
    			PROPERTY_TYPE_MAX_NUM,
    		};
    
    	protected:
    		std::vector<DWORD> m_vecMaskObjectCRC[PROPERTY_TYPE_MAX_NUM];
    };

     

     

     

     

     

    This release have bugs?

    • Metin2 Dev 1
×
×
  • 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.