Jump to content

xTryhard

Premium
  • Posts

    52
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by xTryhard

  1. 1 hour ago, santa12 said:

    hello is it safe to do cooldown for 1 second using questflag? or maybe there are better solutions for such short cooldowns than questflag what do you think, how would you do a cooldown for 1 second or less questflag or no?

    give some examples and explain why

    cooldowns should run on the server directly and not via database you can save the time in database and load it back when you relog but dont send everytime a query while the player is on the same core questflags are just integers in database but another question why do you want to use a cooldown for 1 second ?

  2. 55 minutes ago, redscoutyt2 said:

    Hi guys!
    I was trying to get values from mysql in quest, but I wasn't very successful with it, so I came here to get some help.

    I created a ,,petLevel" column in player.player table and I'd like to get the value in quest, of course the petLevel is different for each person, so I want to get the person petLevel who clicks on a pet.
    I tried something like this:
    local petLevel = mysql_direct_query("SELECT petLevel FROM player.player WHERE name = "..pc.get_name().." LIMIT 1;")
    But it says it's: 4294967295, the value in mysql is 4

    I can't solve it, I tried a lot of method but it doesn't want to work for me.

    Thanks for the help!

    i dont know how to do this in Lua but in C++ it would look like this :

     

        char Query[512];
    	snprintf(Query, sizeof(Query), "SELECT * FROM player.horse WHERE PID = %d", GetPlayerID());
    	std::unique_ptr<SQLMsg> msg(DBManager::instance().DirectQuery(Query));
    
    	if (msg->Get()->uiNumRows == 0)
    	{
    		return;
    	}
    	else
    	{
    		MYSQL_ROW row = mysql_fetch_row(msg->Get()->pSQLResult);
    		str_to_number(MyHorse.Level,		row[1]);
    		return;
    	}

     

  3. 7 minutes ago, avertusss said:

    But if i use str_to_number i can''t compare it with other select bcs number doens't have . so ip won't be 192.168.0.1 but 19216801 or idk how.

     

    I want use that checked ip in other mysql query like this

    std::unique_ptr<SQLMsg> pkMsg(DBManager::instance().DirectQuery("SELECT player.name as '0' FROM player WHERE player.last_play > NOW()-600 and player.IP='whatshouldiwritethere????"));

     

    what do you want to do exactly?

  4. 30 minutes ago, avertusss said:

    Hi. I want to make function which check ip of inserted player name. I have

    ACMD(do_checkplayer)
    {
    	char arg1[256];
    	one_argument(argument, arg1, sizeof(arg1));
    	
    	if (!*arg1 || strlen(arg1) < 3)
    	{
    		ch->ChatPacket(CHAT_TYPE_INFO, "Enter player name");
    		return;
    	}
    	
    	char ip[256];
    	
    	std::unique_ptr<SQLMsg> pkMsg2(DBManager::instance().DirectQuery("SELECT IP from player where name = '%s'", arg1));
    	SQLResult * pRes2 = pkMsg2->Get();
    
    	if (pRes2->uiNumRows > 0)
    	{
    		MYSQL_ROW row;
    		while ((row = mysql_fetch_row(pRes2->pSQLResult)) != NULL)
    		{
    			sql_IP = row[0];
    		}
    		ip = sql_IP;
    	}
    	
    	ch->ChatPacket(CHAT_TYPE_INFO, "%s", ip);
    }

    I don't know how to exactly return that ip into variable and use it everywhere in that function. Can someone help me? 

    char szQuery[50]; // << the length of your string
    snprintf(szQuery, sizeof(szQuery), "SELECT IP FROM player.player WHERE name = '%s'", arg1);
    std::unique_ptr<SQLMsg> msg(DBManager::instance().DirectQuery(szQuery));
    
    MYSQL_RES* Result = msg->Get()->pSQLResult;
    MYSQL_ROW row = mysql_fetch_row(Result);
    std::string IP = row[0];

    if you select a string you can just create one if you use an integer you have to use this function :
     

    str_to_number(IP, row[0]);

     

  5. 15 hours ago, Sunset said:

    SYSERR: Apr  3 09:52:18 :: Analyze: Handshake phase does not handle packet 21 (fd 20)
    SYSERR: Apr  3 09:52:18 :: Process: UNKNOWN HEADER: 49, LAST HEADER: 21(4), REMAIN BYTES: 20, fd: 20

    I have that error in the serverside

    1 º I check for the packets nr 49. sv side and clientside and I dont have that header
    2º I tried to check the packet 21 ("HEADER_GC_ITEM_SET = 21,") and  see if it had the wrong structure but it has the same structure in all the functions that is called.

    What can I look for?

    your header and packet struct has to be 100% synced clientside and serverside 
    make sure when you send a packet to the client use return true at the end of the function in client source also make sure your header is not over 255 because the client will cast it back to unsigned char 

  6. 2 hours ago, Areșș said:

    @ TMP4at first, i didn't took seriously the comment from @ xTryhardbut after you explained i started wondering and you are right.

    When i saw how this problem occurs, i started thinking the cause may be configs, ports, and things like that, but in fact there is not.

    Last night I started thinking about systems i have added and reviewed everything, i cleaned some junk and removed some unused systems, bit with no result.

    Then, I noticed in the multilangiage i have from owsap there is something wrong but because of my fault when I tried addapting the notice_all function and i failed doing it correctly.

    So I tested in the game and indeed after a quest triggers notice_all, instantly SHOUT, WHISPERZ ADD FRIENDS everything breaks between cores and channels.

    In my case the problem is notice_all addaption, after a while I find it and thank you for help, now it's time to fix it's i am not sure though for the rest of the people who have this issue what can be the problem in theyr case but i hope what I said gives you a little help at least in the direction where you have to search for your problem.

     

    in your case you have to send the message from the client to your current Server (core) where you in this Server has to send the message to each other Game Server (core) and each Server has to send the message back to each client so its along way maybe the p2p packets are working but there is a issue when the server is trying to send it back to each client 

    you can test this very simple if your p2p packet is working

    goto :

    input_p2p.cpp

    void CInputP2P::Shout(const char * c_pData)

    now when you send a message every server will recieve this packet here to check if this is working use a debug print 
    for example :
     

    std::cout << "My Packet is Working! \n";

    now when you send a message check the debug console if this message is shown you have a server-client problem

  7. 23 minutes ago, redpein said:

    Hi.. I cannot refine stones with blessed parchment (25040, 25041) ..

    I can refine it with blacksmith, but i need to make it with blessed parchment aswell..

    Any solution ? Thanks

     

    make sure your server item_proto is synced with your client item_proto if this dont help take a look in uiinventory.py

  8. 12 minutes ago, bambykek said:

    Hello, sorry i'm bad english

    Tell me how I can remove the flicker of the item when I use blessing scroll
    I will be grateful

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

    this happen because the client-server-client communication is slow
    go to 
     

    PythonNetworkStreamPhaseGame.cpp
    void CPythonNetworkStream::GamePhase()
    
    and remove this
    
    if(dwRecvCount++ >= MAX_RECV_COUNT-1 && GetRecvBufferSize() < SAFE_RECV_BUFSIZE && m_strPhase == "Game")
    	break;

    you can also rewrite the refine function and resize the packet

    • Good 1
  9. 5 hours ago, revengertmt said:

    Someone can tell me how to implement this in martysama source?

    #include <vector>
    #include <array>
    #include "../../common/length.h"
    #include "item_manager.h"
    using namespace std;
    enum 
    { 
    	MAX_ATTR = ITEM_MANAGER::MAX_NORM_ATTR_NUM + ITEM_MANAGER::MAX_RARE_ATTR_NUM, 
    	COMMON_ITEMS = JOB_MAX_NUM,
    };
    struct GiveBasicWeapon
    {
    	DWORD	dwVnum, count;
    	bool	equip;
    	array<auto, ITEM_SOCKET_MAX_NUM> sockets;
    	array<auto, MAX_ATTR> attr_types;
    	array<auto, MAX_ATTR> attr_vals;
    };
    vector<GiveBasicWeapon> Give_Items[JOB_MAX_NUM];
    
    auto PrepareItems()
    {
    	Give_Items[COMMON_ITEMS] {
    		{11200, 1},
    		{27989, 1},
    		{50053, 1},
    		{40002, 1},
    		{27003, 200},
    		{27006, 200},
    		{70038, 1},
    		{13009, 1, true, {}, {APPLY_CON, APPLY_BLOCK, APPLY_REFLECT_MELEE, APPLY_IMMUNE_STUN, APPLY_STR}, {12, 15, 10, 1, 12}},
    		{14009, 1, true, {}, {APPLY_MAX_HP, APPLY_MAX_SP, APPLY_PENETRATE_PCT, APPLY_STEAL_HP, APPLY_MANA_BURN_PCT}, {2000, 80, 10, 10, 10}},
    		{15009, 1, true, {}, {APPLY_MAX_HP, APPLY_MAX_SP, APPLY_MOV_SPEED, APPLY_ATT_SPEED, APPLY_CRITICAL_PCT}, {2000, 80, 8, 8, 10}},
    		{16009, 1, true, {}, {APPLY_MAX_HP, APPLY_HP_REGEN, APPLY_CRITICAL_PCT, APPLY_PENETRATE_PCT, APPLY_STEAL_HP}, {2000, 30, 10, 10, 10}},
    		{17009, 1, true, {}, {APPLY_MOV_SPEED, APPLY_ATTBONUS_ANIMAL, APPLY_POISON_REDUCE, APPLY_ATTBONUS_DEVIL, APPLY_ATTBONUS_UNDEAD}, {20, 20, 5, 20, 20}},
    		{39036, 1, true},
    		{76037, 1, true}
    	}
    	Give_Items[JOB_WARRIOR] {
    		{11209, 1, true, {28442, 0, 0}, {APPLY_MAX_HP, APPLY_CAST_SPEED, APPLY_STEAL_HP, APPLY_REFLECT_MELEE, APPLY_ATT_GRADE_BONUS}, {2000, 20, 10, 10, 50}},
    		{19, 	1, true, {28430, 0, 0}, {APPLY_STR, APPLY_CRITICAL_PCT, APPLY_PENETRATE_PCT, APPLY_ATTBONUS_ANIMAL, APPLY_STUN_PCT}, {12, 10, 10, 20, 8}},
    		{12209, 1, true, {}, 			{APPLY_ATT_SPEED, APPLY_HP_REGEN, APPLY_ATTBONUS_ANIMAL, APPLY_DODGE, APPLY_STEAL_HP}, {8, 30, 20, 15, 10}},
    	}
    	Give_Items[JOB_ASSASSIN] {
    		{11409, 1, true, {28442, 0, 0}, {APPLY_MAX_HP, APPLY_CAST_SPEED, APPLY_STEAL_HP, APPLY_REFLECT_MELEE, APPLY_ATT_GRADE_BONUS}, {2000, 20, 10, 10, 50}},
    		{1009, 	1, true, {28430, 0, 0}, {APPLY_STR, APPLY_CRITICAL_PCT, APPLY_PENETRATE_PCT, APPLY_ATTBONUS_ANIMAL, APPLY_STUN_PCT}, {12, 10, 10, 20, 8}},
    		{12349, 1, true, {},			{APPLY_ATT_SPEED, APPLY_HP_REGEN, APPLY_ATTBONUS_ANIMAL, APPLY_DODGE, APPLY_STEAL_HP}, {8, 30, 20, 15, 10}},
    	}
    	Give_Items[JOB_SURA] {
    		{11609, 1, true, {28442, 0, 0}, {APPLY_MAX_HP, APPLY_CAST_SPEED, APPLY_STEAL_HP, APPLY_REFLECT_MELEE, APPLY_ATT_GRADE_BONUS}, {2000, 20, 10, 10, 50}},
    		{19, 	1, true, {28430, 0, 0}, {APPLY_STR, APPLY_CRITICAL_PCT, APPLY_PENETRATE_PCT, APPLY_ATTBONUS_ANIMAL, APPLY_STUN_PCT}, {12, 10, 10, 20, 8}},
    		{12489, 1, true, {}, 			{APPLY_ATT_SPEED, APPLY_HP_REGEN, APPLY_ATTBONUS_ANIMAL, APPLY_DODGE, APPLY_STEAL_HP}, {8, 30, 20, 15, 10}},
    	}
    	Give_Items[JOB_SHAMAN] {
    		{11809, 1, true, {28442, 0, 0}, {APPLY_MAX_HP, APPLY_CAST_SPEED, APPLY_STEAL_HP, APPLY_REFLECT_MELEE, APPLY_ATT_GRADE_BONUS}, {2000, 20, 10, 10, 50}},
    		{5009, 	1, true, {28430, 0, 0}, {APPLY_STR, APPLY_CRITICAL_PCT, APPLY_PENETRATE_PCT, APPLY_ATTBONUS_ANIMAL, APPLY_STUN_PCT}, {12, 10, 10, 20, 8}},
    		{12629, 1, true, {}, 			{APPLY_ATT_SPEED, APPLY_HP_REGEN, APPLY_ATTBONUS_ANIMAL, APPLY_DODGE, APPLY_STEAL_HP}, {8, 30, 20, 15, 10}},
    	}
    #ifdef ENABLE_WOLFMAN_CHARACTER
    	Give_Items[JOB_WOLFMAN] {
    		{21009, 1, true, {28442, 0, 0}, {APPLY_MAX_HP, APPLY_CAST_SPEED, APPLY_STEAL_HP, APPLY_REFLECT_MELEE, APPLY_ATT_GRADE_BONUS}, {2000, 20, 10, 10, 50}},
    		{6009, 	1, true, {28430, 0, 0}, {APPLY_STR, APPLY_CRITICAL_PCT, APPLY_PENETRATE_PCT, APPLY_ATTBONUS_ANIMAL, APPLY_STUN_PCT}, {12, 10, 10, 20, 8}},
    		{21509, 1, true, {}, 			{APPLY_ATT_SPEED, APPLY_HP_REGEN, APPLY_ATTBONUS_ANIMAL, APPLY_DODGE, APPLY_STEAL_HP}, {8, 30, 20, 15, 10}},
    	}
    #endif	
    }
    void GiveBasicWeapon(LPCHARACTER ch)
    {
    	PrepareItems();
    	auto GetHorse = [&ch]()
    	{
    		ch->SetHorseLevel(21);
    		ch->StartRiding();
    	};
    	auto MakeFNotice = [](LPCHARACTER ch)
    	{
    		array<auto, JOB_MAX_NUM> JobNames {"Warrior", "Assassin", "Sura", "Shaman", "Lycan"};
    		array<auto, EMPIRE_MAX_NUM> EmpireNames {"전제국","신수국","천조국","진노국"};
    		array<auto, 256> buf;
    		snprintf(buf,sizeof(buf), "New player %s, job: %s, empire: %s", ch->GetName(), JobNames[ch->GetJob()], LC_TEXT(EmpireNames[ch->GetEmpire()]));
    		SendNotice(buf);
    	};
    	for (auto subdata : {ch->GetJob(), COMMON_ITEMS}) {
    		for (auto data : Give_Items[subdata]) {
    			auto item = ch->AutoGiveItem(data.dwVnum, data.count);
    			if (item) {
    				for (auto i = 0; i < MAX_ATTR; i++)
    					item->SetForceAttribute(i, data.attr_types[i], data.attr_vals[i]);
    				for (auto c = 0; c < ITEM_SOCKET_MAX_NUM; c++)
    					item->SetSocket(c, data.sockets[c]);
    				if (data.equip)
    					ch->EquipItem(item);
    			}
    		}
    	}
    	MakeFNotice(ch);
    	GetHorse();
    }

    i have try solo but......this is the error

    compiling char.cpp
    compiling event.cpp
    compiling event_queue.cpp
    compiling exchange.cpp
    compiling file_loader.cpp
    compiling fishing.cpp
    compiling gm.cpp
    In file included from char.cpp:61:
    GiveBasicWeapon.h:15:2: error: non-static data member declared with placeholder 'auto'
       15 |  array<auto, ITEM_SOCKET_MAX_NUM> sockets;
          |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    GiveBasicWeapon.h:16:2: error: non-static data member declared with placeholder 'auto'
       16 |  array<auto, MAX_ATTR> attr_types;
          |  ^~~~~~~~~~~~~~~~~~~~~
    GiveBasicWeapon.h:17:2: error: non-static data member declared with placeholder 'auto'
       17 |  array<auto, MAX_ATTR> attr_vals;
          |  ^~~~~~~~~~~~~~~~~~~~~
    GiveBasicWeapon.h: In function 'auto PrepareItems()':
    GiveBasicWeapon.h:23:26: error: expected ';' before '{' token
       23 |  Give_Items[COMMON_ITEMS] {
          |                          ^~
          |                          ;
    GiveBasicWeapon.h:23:25: warning: statement has no effect [-Wunused-value]
       23 |  Give_Items[COMMON_ITEMS] {
          |  ~~~~~~~~~~~~~~~~~~~~~~~^
    In file included from char.cpp:61:
    GiveBasicWeapon.h:39:25: error: expected ';' before '{' token
       39 |  Give_Items[JOB_WARRIOR] {
          |                         ^~
          |                         ;
    GiveBasicWeapon.h:39:24: warning: statement has no effect [-Wunused-value]
       39 |  Give_Items[JOB_WARRIOR] {
          |  ~~~~~~~~~~~~~~~~~~~~~~^
    GiveBasicWeapon.h:44:26: error: expected ';' before '{' token
       44 |  Give_Items[JOB_ASSASSIN] {
          |                          ^~
          |                          ;
    GiveBasicWeapon.h:44:25: warning: statement has no effect [-Wunused-value]
       44 |  Give_Items[JOB_ASSASSIN] {
          |  ~~~~~~~~~~~~~~~~~~~~~~~^
    GiveBasicWeapon.h:49:22: error: expected ';' before '{' token
       49 |  Give_Items[JOB_SURA] {
          |                      ^~
          |                      ;
    GiveBasicWeapon.h:49:21: warning: statement has no effect [-Wunused-value]
       49 |  Give_Items[JOB_SURA] {
          |  ~~~~~~~~~~~~~~~~~~~^
    GiveBasicWeapon.h:54:24: error: expected ';' before '{' token
       54 |  Give_Items[JOB_SHAMAN] {
          |                        ^~
          |                        ;
    GiveBasicWeapon.h:54:23: warning: statement has no effect [-Wunused-value]
       54 |  Give_Items[JOB_SHAMAN] {
          |  ~~~~~~~~~~~~~~~~~~~~~^
    GiveBasicWeapon.h: In lambda function:
    GiveBasicWeapon.h:77:86: error: direct-list-initialization of 'auto' requires exactly one element [-fpermissive]
       77 |   array<auto, JOB_MAX_NUM> JobNames {"Warrior", "Assassin", "Sura", "Shaman", "Lycan"};
          |                                                                                      ^
    GiveBasicWeapon.h:77:86: note: for deduction to 'std::initializer_list', use copy-list-initialization (i.e. add '=' before the '{')
    GiveBasicWeapon.h:77:86: error: unable to deduce 'std::array<std::initializer_list<auto>, 4>' from '{"Warrior", "Assassin", "Sura", "Shaman", "Lycan"}'
    GiveBasicWeapon.h:77:86: note:   couldn't deduce template parameter 'auto'
    GiveBasicWeapon.h:78:91: error: direct-list-initialization of 'auto' requires exactly one element [-fpermissive]
       78 |   array<auto, EMPIRE_MAX_NUM> EmpireNames {"전제국","신수국","천조국","진노국"};
          |                                                                               ^
    GiveBasicWeapon.h:78:91: note: for deduction to 'std::initializer_list', use copy-list-initialization (i.e. add '=' before the '{')
    GiveBasicWeapon.h:78:91: error: unable to deduce 'std::array<std::initializer_list<auto>, 4>' from '{"\37777777754\37777777640\37777777604\37777777754\37777777640\37777777634\37777777752\37777777665\37777777655", "\37777777754\37777777613\37777777640\37777777754\37777777610\37777777630\37777777752\37777777665\37777777655", "\37777777754\37777777662\37777777634\37777777754\37777777641\37777777660\37777777752\37777777665\37777777655", "\37777777754\37777777647\37777777604\37777777753\37777777605\37777777670\37777777752\37777777665\37777777655"}'
    GiveBasicWeapon.h:78:91: note:   couldn't deduce template parameter 'auto'
    GiveBasicWeapon.h:79:3: error: declaration of 'std::array<auto, 256> buf' has no initializer
       79 |   array<auto, 256> buf;
          |   ^~~~~~~~~~~~~~~~
    GiveBasicWeapon.h: In function 'void GiveBasicWeapon(LPCHARACTER)':
    GiveBasicWeapon.h:83:49: error: unable to deduce 'std::initializer_list<auto>&&' from '{ch->CHARACTER::GetJob(), COMMON_ITEMS}'
       83 |  for (auto subdata : {ch->GetJob(), COMMON_ITEMS}) {
          |                                                 ^
    GiveBasicWeapon.h:83:49: note:   deduced conflicting types for parameter 'auto' ('unsigned char' and '<unnamed enum>')
    compiling guild.cpp
    compiling guild_manager.cpp
    compiling guild_war.cpp
    gmake: *** [Makefile:184: .obj/char.o] Error 1
    gmake: *** Waiting for unfinished jobs....

     

    goto 
     

    input.h
    
    #add in private section
    
    void GiveStarterSet(LPCHARACTER Player);

    now goto 

     

    input_login.cpp
    
    #search for
    
    void CInputLogin::Entergame(LPDESC d, const char * data)

    add at the bottom from the function :

     

    if(ch != NULL)
    		GiveStarterSet(ch);

    define the function:

     

    void CInputLogin::GiveStarterSet(LPCHARACTER Player)
    {
    	if (Player != NULL)
    	{
    		if(Player->GetQuestFlag("give_starter_set.source") == 0)
    		{
    			Player->SetQuestFlag("give_starter_set.source", 1);
    
    			BYTE CharClass = Player->GetJob();
    			bool Warrior	= CharClass == 0;
    			bool Ninja		= CharClass == 1;
    			bool Sura		= CharClass == 2;
    			bool Schami		= CharClass == 3;
    			if (Warrior)
    				Player->EquipWarrior();
    			
    			if (Sura)
    				Player->EquipSura();
    			
    			if (Ninja)
    				Player->EquipNinja();
    			
    			if (Schami)
    				Player->EquipShaman();
    		}
    	}
    }

    goto 
     

    char.h
    
    add the functions in public section ;
    
    void EquipWarrior();
    void EquipSura();
    void EquipShaman();
    void EquipNinja();
    

    goto char.cpp

     

    now add all 4 functions and add your ID in the vector array
    
    void CHARACTER::EquipWarrior()
    {
    	std::vector<DWORD>WarriorStuff
    	{
    		10,
    	};
    
    	for (BYTE i = 0; i < WarriorStuff.size(); ++i)
    	{
    		LPITEM item = ITEM_MANAGER::instance().CreateItem(WarriorStuff[i]);
    		if (item != NULL)
    		{
    			bool Success = item->EquipTo(this, item->FindEquipCell(this));
    
    			if (!Success)
    				M2_DESTROY_ITEM(item);
    		}
    	}
    }

    you are done

    you can now add everything you need in the new character functions 

    • Love 1
  10. 16 minutes ago, Reached said:

    Can you try like this

    				else if (item->GetVnum() == 71351)
    				{
    					if ((item2->GetType() == ITEM_WEAPON) && item2->HasAttr(72))
    					{
    						int16_t idx = item2->FindAttribute(72);
    						int32_t value = item2->GetAttributeValue(idx)+1;
    						if ((150 > item2->GetAttributeValue(idx)) && (item2->GetAttributeValue(idx) >= 50))
    						{
    							item2->SetForceAttribute(idx, 72, value);
    						}
    						else
    						{
    							ChatPacket(CHAT_TYPE_INFO, "You can only use this item which is between 80-200 avg.");
    							return false;
    						}
    					}
    					else
    					{
    						ChatPacket(CHAT_TYPE_INFO, "You can only use this item on weapons with average damage.");
    						return false;
    					}
    				}

     

    Uhm no, I don't want to get the value 32767. I just want to increase an attribute type 150 by increasing value and this code does that. if you gonna do ++value, you'll increase by 1, and equals value to value+1. But you don't set it trough the weapon. You just declare a value by variable and you'll just increase value by 1.

    ofc you set the weapon. in your code you use this

     

    item2->SetForceAttribute(idx, 72, value);

    as third parameter you use value.

    anyway this is the correct if statement :

     

    if (item2->GetAttributeValue(idx) >= 80 && item2->GetAttributeValue(idx) <= 200)
    	{
    		item2->SetForceAttribute(idx, 72, value);
    	}

     

  11. if you want just to increase a value from a bonus you dont have to change anything in item_proto 
    the bonus value is signed 16 bit that means you can have max. 32767  without change anything
     

    item2->SetForceAttribute(idx, 72, 32767);

    this function will do it

    also if you want to increase a value by 1 use the ++ increment operator instead of using +1  
     

    int32_t value = item2->GetAttributeValue(idx);
    ++value;


     

  12. 18 hours ago, HueHue said:

    Ok that's great but could you or someone help me to write the code for this as I have never done something like this before.
    All i know is that i need to use this command in game.py

    onPressKeyDict[app.DIK_TAB]	= lambda : self?????

    So basically what I want to have is when i press Tab key an item 50053 is being used.
    Thank you in advance.

    you have to know C++ to do this there is no magic button for the pc to know what you think

  13. 2 hours ago, HueHue said:

    Hi.

    Is there a way to assign an item or a quest to a button on the keyboard?

    For example I have an item 50053 and I want to use it by pressing TAB key on my keyboard.

    Or I have a quest and I want to open the quest by pressing ~ key on my keyboard.

    yes you can do this go to game.py create a function with your key send this to the server check if you have this item id in your inventory and if you have it do what you want and send it back to the client

  14. 4 hours ago, EnneGi said:

    Really thanks, i solved, items were really in the inventory, i spawned some item in admin account and then all items reappear (magic?)

     

    For OP, i have found another bug, don't know if anyone has the same. Skill points not setting correctly, the abilities stay with 0 points.

    Someone know a fix for this? Thanks

    it is always the same you ( client ) want something from the server so for example you press a button now you send a packet to the server he looks what you want and after that he will validate your packet if everything is good you get a callback from the server with the data you want if something is wrong he will not send you anything ( anti cheat )

    the best way to debug something is to start at the beginning from the road look what will happen when you press on the button and check everything the way to the server and back to the client

    use printf in source to see if you get what you expect or not
     

  15. 2 hours ago, EnneGi said:

    Did you edit something about socket count server side?

    Cause with the client TMP4 provided i can't see items in my inventory, even if i have them.

    In logs i had an error like "Invalid Socket Count 3, set to maximum"

    when you add an item to your inventory with AddToCharacter print the index out and look if you really have the item or not if your console says you have it check if the update packet is sending to the client and check if python update correctly

  16. 1 hour ago, Petrezselyem said:

    That's the point. If you put full def, damage is 0. Thanks for help.

    go to 
     

    input_main.cpp
    void CInputMain::Attack(LPCHARACTER ch, const BYTE header, const char* data)

    this is the location where the damage packet starts you have to check from there until you find your problem

    • Love 1
  17. 3 hours ago, Petrezselyem said:

    Hi. 

    Where can I set to my game to have a max % of possible defense against warrior, ninja... etc?
    I think players can bonus their equipment to have over 100% defense against, for example a shaman, but I want to
    fix this value to 75%.
    So even if someone has 8x5 (from 6-7) + 18 (from DS) + 20 (from shield) + lvl 90-accesories (like Ruby Neklace...etc) + 10 (from bio quests) + 8 (from belt) ... etc, the game only count to 75% and doesn't give players higher defense over 75%. 

    Summary: Even If your defense bonus is equal to 108 for example, the game does not let it over 75%.

    I hope somebody coould help.

    char_battle.cpp but if you have more than 100% defense you get 0 damage

  18. 2 minutes ago, ahmedmohamed said:

     this work
    title subImage
    version 1.0
    image "tabchar.tga"
    left 0
    top 0
    right 253
    bottom 37

     

     

    but this no

     

    title subImage
    version 1.0
    if localeInfo.IsARABIC():
        image "tabchararab.tga"
    else:
        image "tabchar.tga"
    left 0
    top 0
    right 253
    bottom 37

    create 2 sub files:
    a default one and the new one and use this:
    if localeInfo.IsARABIC():
        image "tabchararab.tga"
    else:
        image "tabchar.tga"

    inside python and not inside the sub file

    • Love 1
  19. 35 minutes ago, ahmedmohamed said:

    title subImage
    version 1.0
    if localeInfo.IsARABIC():
        image "tabchararab.tga"
    else:
        image "tabchar.tga"
    left 0
    top 0
    right 253
    bottom 37
     

    why this code not work

    https://metin2.download/picture/LzFG8VPNzgeU7xf11B1YuE2rKW15uQU9/.png

    0308 16:37:14916 :: ui:4288: RuntimeWarning: tp_compare didn't return -1 or -2 for exception
    
    0308 16:37:14916 :: 
    uiCharacter.py(line:811) __LoadWindow
    uiCharacter.py(line:302) __LoadScript
    ui.py(line:4281) LoadScriptFile
    ui.py(line:4497) LoadChildren
    ui.py(line:4497) LoadChildren
    ui.py(line:4497) LoadChildren
    ui.py(line:4288) LoadChildren
    
    CharacterWindow.__LoadWindow - <type 'exceptions.RuntimeError'>:Failed to load image (filename: d:/ymir work/ui/game/windows/char_tab_01.sub)
    
    0308 16:37:14916 :: ============================================================================================================
    0308 16:37:14916 :: Abort!!!!
    
    

     

     

    bug flag

     

    flag work en  but ae now work

    https://metin2.download/picture/wqVQrT4IbYKGERh5TirBw2qwAPbLKYgs/.png

     

     

    make sure your file name use small characters if you name it Image.TGA it will not work because python and C++ is case sensitive

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