Jump to content

Cataclismo

Premium
  • Posts

    232
  • Joined

  • Last visited

  • Days Won

    7
  • Feedback

    0%

Posts posted by Cataclismo

  1. In char_battle.cpp find this:

    void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead)
    

    and after

    ClearAffect(true);
    

    add this code:

        if (IsPC() && GetMapIndex() == YOUR_MAPINDEX && pkKiller->IsPC())
    	{
    		PIXEL_POSITION pos;
    		pos.x = GetX();
    		pos.y = GetY();
    
    		for (WORD i = 0; i < INVENTORY_MAX_NUM; ++i)
    		{
    			LPITEM item = GetInventoryItem(i);
    			if (item)
    			{
    				switch (item->GetVnum())
    				{
    					case 1:
    					case 2:
    					case 3:
    					case 4:
    					case 5:
    						{
    							SyncQuickslot(QUICKSLOT_TYPE_ITEM, i, 255);
    							item->RemoveFromCharacter();
    							item->AddToGround(GetMapIndex(), pos, true);
    							item->StartDestroyEvent();
    						}
    						break;
    				}
    			}
    		}
    	}
    

    Replace YOUR_MAPINDEX with the mapindex where you want items to drop. In switch replace the numbers with your items code.

    Also, the items will be dropped only if the killer is another player.

    • Love 2
  2. 1) First part, Client Binary. UserInterface folder:

     

    In InstanceBase.cpp add

    const char * CInstanceBase::GetLevelString()
    {
       char * str = new char[3];
       sprintf(str,"%d",m_dwLevel);
       return str;
    }
    
    in InstanceBase.h add

     

    const char * GetLevelString();
    
    Next in PythonNetworkStreamPhaseGame.cpp add in

     

    if (pCharacterInstance)
    {
       ...
    }
    
    CPythonExchange::Instance().SetTargetLevel(pCharacterInstance->GetLevelString());
    
    Open PythonExchange.cpp and add

    void CPythonExchange::SetTargetLevel(const char *name)
    {
       strncpy(m_victim.level, name, 3);
    }
    char * CPythonExchange::GetLevelFromTarget()
    {
       return m_victim.level;
    }
    
    In PythonExchange.h  inside

    typedef struct trade
    {
       ...
    }
    after

    char   name[CHARACTER_NAME_MAX_LEN + 1]; 
    
    add:

    char   level[3];
    
    elsewhere in PythonExchange.h after:

    void SetElkMode(bool value); 
    
    add this:

    void      SetTargetLevel(const char *name);
    char      *GetLevelFromTarget();
    
    In PythonExchangeModule.cpp after:

    {"isTrading",         exchangeisTrading,           METH_VARARGS},
    
    put:

    {"GetLevelFromTarget",          exchangeGetLevelFromTarget,         METH_VARARGS},
    
    After:

    PyObject * exchangeGetElkMode(PyObject * poTarget, PyObject * poArgs)
    {
       return Py_BuildValue("b", CPythonExchange::Instance().GetElkMode());
    }
    
    add:

    PyObject * exchangeGetLevelFromTarget(PyObject * poTarget, PyObject * poArgs)
    {
        return Py_BuildValue("s", CPythonExchange::Instance().GetLevelFromTarget());
    }
    
    Binary part is ready.

    2) Python part now.

     

    Decrypt root with EterNexus or anything else you want and in:

     

    uiexchange.py, find this:

    def OpenDialog(self):
    
    and replace all what's in there and put this:

    def OpenDialog(self):
       self.TitleName.SetText(localeInfo.EXCHANGE_TITLE % (exchange.GetNameFromTarget() + " " + "(" + (exchange.GetLevelFromTarget() + ")"))) 
       self.AcceptButton.Enable()
       self.AcceptButton.SetUp()
       self.Show()
    3) Ready. Now you have level in trade. An example:

     

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

     

     

    Consider using [ code ] tag next time.

    Care to Python tabulation.

    Nice tutorial, anyway.

  3. There are suposed to be spaced blocked I am saying about this

    d2a7decf476c8dd9fe2d2482ec5c6ec0.png

    The item 18009 is suposed to allow only 6 but you can use the bloched too.

     

    That does my function. Allows any belt to be moved anywhere because I though that this is what you want. Revert to the original code if you want them blocked.

    • Love 1
  4.  

     

    You did it wrong. Replace whole function with mine.

    Replace

    static bool IsAvailableCell(WORD cell, int beltGrade /*int beltLevel*/)
    {
    	//const TGradeUnit beltGrade = GetBeltGradeByRefineLevel(beltLevel);		
    	const TGradeUnit* ruleTable = GetAvailableRuleTableByGrade();
    
    	return ruleTable[cell] <= beltGrade;
    }
    

    with

    static bool IsAvailableCell(WORD cell, int beltGrade /*int beltLevel*/)
    {
    	return true;
    }
    

    Ok now it works but how i block the spaces he cant use I make a picture too see.

    5b7d8f80a8616fb30ae363949bc75aa1.png

     

     

    My function allow the belts to be moved anywhere. The player can put any belt anywhere and at any level. There's no limit. You wanted to make with limits? Explain exactly what you want.

    • Love 1
  5. You did it wrong. Replace whole function with mine.

    Replace

    static bool IsAvailableCell(WORD cell, int beltGrade /*int beltLevel*/)
    {
    	//const TGradeUnit beltGrade = GetBeltGradeByRefineLevel(beltLevel);		
    	const TGradeUnit* ruleTable = GetAvailableRuleTableByGrade();
    
    	return ruleTable[cell] <= beltGrade;
    }
    

    with

    static bool IsAvailableCell(WORD cell, int beltGrade /*int beltLevel*/)
    {
    	return true;
    }
    
    • Love 1
  6. edit;

    In belt_inventory_helper.h find

    static bool IsAvailableCell(WORD cell, int beltGrade /*int beltLevel*/)
    

    and edit the function like this:

    	static bool IsAvailableCell(WORD cell, int beltGrade /*int beltLevel*/)
    	{	
    		return true;
    	}
    

    I think this will solve your problem.

    • Love 1
  7. thanks

    So the car can only have values ​​1 and 0 , we understand Yes I saw that in some file is found and return false return true ... Can you explain to that?

     

    You could better read a book.

    There's two types of return:

    int add(int a, int 
    {
    	return a + b;
    }
    

    The above return an int value, as specified in the declaration. You CAN'T return other types.

    void test(int a, int 
    {
    	int c = a + b;
    	return;
    	int d = c + a;
    }
    

    The above return will not return anything and will stop the execution of function. That means that

    	int d = c + a;
    

    will not be executed. It will stop at return;

    Note: Returning a value also stops the function execution.

     

    Returning true or false is the same thing, but the declaration of your function is of type bool:

    bool function(int val)
    {
    	if (val == 2)
    		return false;
    	else
    		return true;
    }
    

    or simplier

    bool function(int val)
    {
    	return (val == 2);
    }
    
    • Love 1
  8.  

    Right click TorrentPatch project, go to Properties and here click on Build Events and delete everything that you find in Command Line.

     

    Thanks worked i have a last error i think

     

    screen: https://metin2.download/picture/6K7X9V569oc0eIOF4VQVloQ6tguMjtdi/.png

     

     

    On TorrentPatch project, in Patch folder you will find TorrentPatch.cpp. Go to line 234 and make a print screen with the code around that line.

  9.  

    0413 00:21:02685 :: 
    introLogin.py(line:566) introLogin.LoginWindow.__LoadScript (introLogin.c:11073)
    ui.py(line:2792) ui.PythonScriptLoader.LoadScriptFile (ui.c:67759)
    
    LoginWindow.__LoadScript.LoadObject - <type 'exceptions.KeyError'>:'window'
    
    0413 00:21:02685 :: ============================================================================================================
    0413 00:21:02685 :: Abort!!!!
    
    

    some error im sure about this introLogin.py(line:566) look at what you have there you should at least know what is the reason if the bug (btw the smallest error might cz the client to crush so be carefull)

     

    introLogin.py

    	def __LoadScript(self, fileName):
    		import dbg
    		try:
    			pyScrLoader = ui.PythonScriptLoader()
    			pyScrLoader.LoadScriptFile(self, fileName)
    		except:
    			import exception
    			exception.Abort("LoginWindow.__LoadScript.LoadObject")
    

    ui.py

    	def LoadScriptFile(self, window, FileName):
    
    		Body = self.ScriptDictionary["window"]
    		self.CheckKeyList("window", Body, self.BODY_KEY_LIST)
    
    		window.ClearDictionary()
    		self.InsertFunction = window.InsertChild
    
  10. 0413 00:21:02685 :: 
    introLogin.py(line:566) introLogin.LoginWindow.__LoadScript (introLogin.c:11073)
    ui.py(line:2792) ui.PythonScriptLoader.LoadScriptFile (ui.c:67759)
    
    LoginWindow.__LoadScript.LoadObject - <type 'exceptions.KeyError'>:'window'
    
    0413 00:21:02685 :: ============================================================================================================
    0413 00:21:02685 :: Abort!!!!
    
    
  11.  

    I am building my game file using -g flag, but when I am trying to run the game using gdb I get the message: no debugging symbols found.

    Also, if I am trying to use game.core it says that this file does not exists.

    I am building the game under 32-bit machine and running it on a 64-bit machine. I don't have -s flag.

    You need to read the core as i386 (x86). You can use:

    set gnutarget i386-marcel-freebsd
    file game
    core game.core
    [...]
    

     

    I've tried under the same machine where I compiled the core and I got same messages.

  12. I am building my game file using -g flag, but when I am trying to run the game using gdb I get the message: no debugging symbols found.

    Also, if I am trying to use game.core it says that this file does not exists.

    I am building the game under 32-bit machine and running it on a 64-bit machine. I don't have -s flag.

  13.  

    Type in the console

    find /usr -name '*.cnf'
    

    U will see location of mysql config files

    Copy my-small.cnf to /var/db/mysql  

     

    Add to it 

    slow_query_log = ON
    slow_query_log_file = "/location/slow_query.log
    

    and next restart mysql

     

    Istny, atm this is my "my.cnf" what you think about? Could we improve it for a better performance with Metin2 and MariaDB 10?

     

    PS: I use the large instead of the small

    PS2: I will can apply this file only tomorrow after run the SMART test.

     

    http://pastebin.com/iJyLrRzf

     

     

    Hm... one of my friends have this issue too with mysql and the cause is the website. It has about 10kkk items on the database (or more) and about half million characters and when the ranking is loading (the web page) mysql server start using a lot of CPU and RAM.

    Or maybe you're DDoS'ed. I don't know for sure. Change your MySQL port and see what happens. Also, change your website for a while with a simple one or another site which you know is good.

    • Metin2 Dev 1
    • Dislove 1
  14. Oh, wow. I tought maybe my quests are the problems, but I think that's the reason for my server crash...

    Thank you, Think.

     

    Not going to get into how its performed for obvious reasons.

     

    std::out_of_range? :D

  15.  

    Please help me.

     
    exchange.cpp:429: error: expected unqualified-id before 'for'
    exchange.cpp:429: error: expected constructor, destructor, or type conversion before '<' token
    exchange.cpp:429: error: expected unqualified-id before '++' token
     
    429=  for (i = 0; i < EXCHANGE_ITEM_MAX_NUM; ++i)

     

     

    What is that "429="? Remove it o.O

  16. 
    extern void BroadcastNotice(const char * c_pszBuf, bool IsBig = true);
    

    Why aren't you setting IsBig to true ??

     

     

    Because if you do that then all notices will be sent as big, even the notices sent with /n. We need the default value to be false, and only when we send notices with /b to tell the function that we want a big one.

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