Jump to content

Den

Inactive Member
  • Posts

    110
  • Joined

  • Last visited

  • Days Won

    5
  • Feedback

    0%

Posts posted by Den

  1. I had some problems with this trigger because it happens for every single player on map and it didn't work good for me. Some contitions were executed more than one time. If someone wants here is how to trigger it only for the first player on the dungeon's character list:

    In struct FWarpToPosition remove

    quest::CQuestManager::instance().Jump(ch->GetPlayerID());

    Then after

    	if (!pMap)
    	{
    		sys_err("cannot find map by index %d", lFromMapIndex);
    		return;
    	}

    in void CDungeon::JumpAll(long lFromMapIndex, int x, int y) dungeon.cpp add

    	if (!m_set_pkCharacter.empty())
    	{
    		itertype(m_set_pkCharacter) it = m_set_pkCharacter.begin();
    		LPCHARACTER ch = *it;
    		quest::CQuestManager::instance().Jump(ch->GetPlayerID());
    	}

    Then do the same for void CDungeon::JumpParty(LPPARTY pParty, long lFromMapIndex, int x, int y) if you want to.

    I also made a function that takes current dungeon as argument instead of player but in this case you can't use pc functions in when jump trigger(e.g. pc.get_map_index()) and you have to use only dungeon functions (e.g. d.get_map_index()) so for it wouldn't be good for begginers.

  2. 7 minutes ago, Nero said:

    Nothing happens.

    My textureset isn't empty. I tried with v24 too, with release and with debug (both of them).
    AuMUOOq.png

    OBJYKe8.png


    But my problem is not that my textures aren't visible, this is just happening at 5th tab. When I select the first tab, second (with textures), third (with objects) or fourth (with enviornment) it's all ok, the textures and shadows are ok. But when I select the 5th one, my textures and shadows dissapear. 

    I had this problem before. You must have d:/ymir work/special folder to get it working.

    DVZ9d7U.png

    • Metin2 Dev 1
    • Love 1
  3. 1 hour ago, charparodar said:

    Which is the best method?

    I thought when I removed the mask of emotions this would be removed too...

    Is the quest the best option? If they reset the skills will it remove those too?

    For players it almost doesn't matter I think. You can use whatever you want, I'm just saying that some of these methods are just not good looking in code. If I were you I wouldn't do this in quest.

  4. There are lots of ways to enable that.

    1. Setting language skills to max in quest in which you select your job.

    2. Searching for ConvertEmpireText() in server source and commenting it.

    3. Searching for conditions with UNIQUE_GROUP_RING_OF_LANGUAGE and SKILL_LANGUAGE1 and changing them.

    4. bool CHARACTER::IsEquipUniqueGroup(DWORD dwGroupVnum) const

    On the beggining add:

    	if (dwGroupVnum == UNIQUE_GROUP_RING_OF_LANGUAGE)
    		return true;

     

    Maybe 4th method looks kinda shitty but should do the job.

  5. Didn't test but find in char_battle.cpp:

    else if (1 == number(1, iGold10DropPct))
    	{
    		//
    		// µ· ĆřĹş˝Ä µĺ·Ó
    		//
    		for (int i = 0; i < 10; ++i)
    		{
    			int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);
    			iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
    			iGold *= iGoldMultipler;
    
    			if (iGold == 0)
    			{
    				continue;
    			}
    
    			// NOTE: µ· ĆřĹşŔş Á¦ 3ŔÇ ĽŐ Ăł¸®¸¦ ÇĎÁö ľĘŔ˝
    			if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))
    			{
    				pos.x = GetX() + (number(-7, 7) * 20);
    				pos.y = GetY() + (number(-7, 7) * 20);
    
    				item->AddToGround(GetMapIndex(), pos);
    				item->StartDestroyEvent();
    
    				iTotalGold += iGold; // Total gold
    			}
    		}
    	}

    Try to remove whole else if and check if it's working (save it somewhere maybe in case it wouldn't work).

    @EDIT:

    I didn't notice you also want to remove it from bosses. I have no time right now to adjust it but you can try it on your own. You have everything around this else if I gave you higher.

    @EDIT2:

    char_battle.cpp on the beggining add

    #include "../../common/service.h"

    common/service.h on the end add

    #define DISABLE_YANG_BOMB

    char_battle.cpp change in Reward()

    	if (GetMobRank() >= MOB_RANK_BOSS && !IsStone() && GetMobTable().dwGoldMax != 0)
    	{
    		if (1 == number(1, iGold10DropPct))
    			iGoldMultipler *= 10; // 1% Č®·ü·Î µ· 10ąč
    
    		int iSplitCount = number(25, 35);
    
    		for (int i = 0; i < iSplitCount; ++i)
    		{
    			int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax) / iSplitCount;
    			if (test_server)
    				sys_log(0, "iGold %d", iGold);
    			iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
    			iGold *= iGoldMultipler;
    
    			if (iGold == 0)
    			{
    				continue ;
    			}
    
    			if (test_server)
    			{
    				sys_log(0, "Drop Moeny MobGoldAmountRate %d %d", CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker), iGoldMultipler);
    				sys_log(0, "Drop Money gold %d GoldMin %d GoldMax %d", iGold, GetMobTable().dwGoldMax, GetMobTable().dwGoldMax);
    			}
    
    			// NOTE: µ· ĆřĹşŔş Á¦ 3ŔÇ ĽŐ Ăł¸®¸¦ ÇĎÁö ľĘŔ
    #ifdef DISABLE_YANG_BOMB
    			pkAttacker->GiveGold(iGold / iSplitCount);
    			iTotalGold += iGold;
    #else
    			if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))
    			{
    				pos.x = GetX() + ((number(-14, 14) + number(-14, 14)) * 23);
    				pos.y = GetY() + ((number(-14, 14) + number(-14, 14)) * 23);
    
    				item->AddToGround(GetMapIndex(), pos);
    				item->StartDestroyEvent();
    
    				iTotalGold += iGold; // Total gold
    			}
    #endif
    		}
    	}
    	// 1% Č®·ü·Î µ·Ŕ» 10°ł ¶łľî ¶ß¸°´Ů. (10ąč µĺ·ÓŔÓ
    #ifndef DISABLE_YANG_BOMB
    	else if (1 == number(1, iGold10DropPct))
    	{
    		//
    		// µ· ĆřĹş˝Ä µĺ·Ó
    		//
    		for (int i = 0; i < 10; ++i)
    		{
    			int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);
    			iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
    			iGold *= iGoldMultipler;
    
    			if (iGold == 0)
    			{
    				continue;
    			}
    
    			// NOTE: µ· ĆřĹşŔş Á¦ 3ŔÇ ĽŐ Ăł¸®¸¦ ÇĎÁö ľĘŔ˝
    			if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))
    			{
    				pos.x = GetX() + (number(-7, 7) * 20);
    				pos.y = GetY() + (number(-7, 7) * 20);
    
    				item->AddToGround(GetMapIndex(), pos);
    				item->StartDestroyEvent();
    
    				iTotalGold += iGold; // Total gold
    			}
    		}
    	}
    #endif
    	else
    	{
    		//
    		// ŔĎąÝŔűŔÎ ąć˝ÄŔÇ µ· µĺ·Ó
    		//
    		int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);
    		iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
    		iGold *= iGoldMultipler;
    
    		int iSplitCount;
    
    		if (iGold >= 3 && !LC_IsYMIR()) 
    			iSplitCount = number(1, 3);
    		else if (GetMobRank() >= MOB_RANK_BOSS)
    		{
    			iSplitCount = number(3, 10);
    
    			if ((iGold / iSplitCount) == 0)
    				iSplitCount = 1;
    		}
    		else
    			iSplitCount = 1;
    
    		if (iGold != 0)
    		{
    			iTotalGold += iGold; // Total gold
    
    			for (int i = 0; i < iSplitCount; ++i)
    			{
    				if (isAutoLoot)
    				{
    					pkAttacker->GiveGold(iGold / iSplitCount);
    				}
    				else if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold / iSplitCount)))
    				{
    					pos.x = GetX() + (number(-7, 7) * 20);
    					pos.y = GetY() + (number(-7, 7) * 20);
    
    					item->AddToGround(GetMapIndex(), pos);
    					item->StartDestroyEvent();
    				}
    			}
    		}
    	}

    Didn't test. Yang will be added to character's inventory after killing a boss instead of droping on the ground. Let me know if you want it in another way.

    • Love 5
  6. Hello everyone.

     

    One day I was curious how does normal hit bonus and skill bonus are added to item, so I made a simple simulation as console application from source functions.

     

    Spoiler
    
    #include <iostream>
    #include <stdlib.h>
    #include <time.h>
    #include <ctime>
    #include <cstdlib>
    #include <windows.h>
    
    #define FLT_EPSILON     1.192092896e-07F 
    #define RAND_MAX 0x7fff
    
    using namespace std;
    
    int number(int from, int to)
    {
    	if (from > to)
    	{
    		int tmp = from;
    
    		from = to;
    		to = tmp;
    	}
    
    	int returnValue = 0;
    
    	if ((to - from + 1) != 0)
    	{
    		returnValue = ((rand() % (to - from + 1)) + from);
    	}
    
    	return returnValue;
    }
    
    int MINMAX(int min, int value, int max)
    {
    	register int tv;
    
    	tv = (min > value ? min : value);
    	return (max < tv) ? max : tv;
    }
    
    double uniform_random(double a, double b)
    {
    	return rand() / (RAND_MAX + 1.f) * (b - a) + a;
    }
    
    float gauss_random(float avg, float sigma)
    {
    	static bool haveNextGaussian = false;
    	static float nextGaussian = 0.0f;
    
    	if (haveNextGaussian)
    	{
    		haveNextGaussian = false;
    		return nextGaussian * sigma + avg;
    	}
    	else
    	{
    		double v1, v2, s;
    		do {
    			//v1 = 2 * nextDouble() - 1;   // between -1.0 and 1.0
    			//v2 = 2 * nextDouble() - 1;   // between -1.0 and 1.0
    			v1 = uniform_random(-1.f, 1.f);
    			v2 = uniform_random(-1.f, 1.f);
    			s = v1 * v1 + v2 * v2;
    		} while (s >= 1.f || fabs(s) < FLT_EPSILON);
    		double multiplier = sqrtf(-2 * logf(s) / s);
    		nextGaussian = v2 * multiplier;
    		haveNextGaussian = true;
    		return v1 * multiplier * sigma + avg;
    	}
    }
    
    int main()
    {
    	int iSkillBonus, iNormalHitBonus;
    	unsigned long long counter = 0;
    	srand(time(NULL));
    	for (;;)
    	{
    		iSkillBonus = MINMAX(-30, (int)(gauss_random(0, 5) + 0.5f), 30);
    		if (abs(iSkillBonus) <= 20)
    			iNormalHitBonus = -2 * iSkillBonus + abs(number(-8, 8) + number(-8, 8)) + number(1, 4);
    		else
    			iNormalHitBonus = -2 * iSkillBonus + number(1, 5);
    	
    		counter += 1;
    		if (iNormalHitBonus >= 55) ////if normal hit bonus is 55 or higher, the loop will stop
    			break;
    	
    		Sleep(1); //how long you will wait between draws
    	
    
    		//you can delete this if you want to make it faster
    		cout << "normal hit bonus: " << iNormalHitBonus << endl;
    		cout << "skill bonus: " << iSkillBonus << endl;
    		//
    
    	}
    
    	cout << "you've used " << counter << " changes" << endl;
    
    	system("pause");
    	return 0;
    }

     

    Code: https://pastebin.com/xBqCQM9w

     

    Change whatever you want then compile and test. Maybe this will help someone who wants to adjust this.

     

    • Metin2 Dev 2
    • Love 1
  7. 7 minutes ago, netmarlis said:

    Try on uiinventory.py:

    	def SelectItemSlot(self, itemSlotIndex):
    		chat.AppendChat(chat.CHAT_TYPE_INFO, "select item slot")
    		if constInfo.GET_ITEM_DROP_QUESTION_DIALOG_STATUS() == 1:
    			return
    
    		itemSlotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(itemSlotIndex)
    		chat.AppendChat(chat.CHAT_TYPE_INFO, "select item slot %d" % itemSlotIndex)

    Add chat.AppendChat(chat.CHAT_TYPE_INFO, "select item slot %d" % itemSlotIndex) then try click and show chat. Does slot even highlight when over with item?

    VANCNDD.png

  8. 4 minutes ago, netmarlis said:

    game syserlog : 

     

    Jun  9 03:15:00.913284 :: vivoxy: USE_ITEM Keten Kemer +9 (inven 1, cell: 2)
    Jun  9 03:15:02.72945 :: vivoxy: USE_ITEM Runik Kemer +9 (inven 1, cell: 2)
    Jun  9 03:15:02.833393 :: vivoxy: USE_ITEM Keten Kemer +0 (inven 1, cell: 0)
    Jun  9 03:15:03.511677 :: vivoxy: USE_ITEM Runik Kemer +9 (inven 1, cell: 0)
    Jun  9 03:15:04.273109 :: vivoxy: USE_ITEM Keten Kemer +0 (inven 1, cell: 0)

     

     

     

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

    But after you click on empty belt slot game chat is showing nothing?

  9. 52 minutes ago, netmarlis said:

    In uiinventory.py, function def SelectEmptySlot(self, selectedSlotPos), on the top write like this:

    	def SelectEmptySlot(self, selectedSlotPos):
    		chat.AppendChat(chat.CHAT_TYPE_INFO, "select empty slot %d" % selectedSlotPos)
    		if constInfo.GET_ITEM_DROP_QUESTION_DIALOG_STATUS() == 1:
    			return
    
    		

    Then click on belt slot in game and show what you've got on chat.

  10. 4 minutes ago, netmarlis said:

     

     

    uiinventory.py : https://metin2.download/picture/hBbOEO7WFF8whWNCXq6pQMB1O2MSKfW4/.png 

    inventorywindow.py : https://metin2.download/picture/uti2NCJFS6zp78TtviGrmine3v3Bb7cX/.png

     

    syserr.txt error : 

     

    0609 01:01:07877 :: 
    networkModule.py(line:200) SetSelectCharacterPhase
    system.py(line:134) __pack_import
    system.py(line:110) _process_result
    introSelect.py(line:18) <module>
    system.py(line:134) __pack_import

    networkModule.SetSelectCharacterPhase - <type 'exceptions.IndentationError'>:unindent does not match any outer indentation level (uiInventory.py, line 751)

    0609 01:01:07877 :: ============================================================================================================
    0609 01:01:07878 :: Abort!!!!


     

     

    Tabulations and spaces are really important in python. You must be using them properly like that:

    https://metin2.download/picture/2h45kxpGABk8OMqn482Rl0XicMcEVKqL/.png

  11. 5 minutes ago, netmarlis said:

    Hm... Check in your binary source if item.EQUIPMENT_BELT equals WEAR_BELT + 180 on server source side.

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