Jump to content

xP3NG3Rx

Honorable Member
  • Posts

    839
  • Joined

  • Days Won

    393
  • Feedback

    100%

Posts posted by xP3NG3Rx

  1. You have to add a button which set the new distibution mode(2) for party and extend the switch with a new case.

    party.h

    enum EPartyExpDistributionModes
    {
    	PARTY_EXP_DISTRIBUTION_NON_PARITY,
    	PARTY_EXP_DISTRIBUTION_PARITY,
    	PARTY_EXP_DISTRIBUTION_EQUAL,
    	PARTY_EXP_DISTRIBUTION_MAX_NUM
    };

    char_battle.cpp

    	struct FPartyDistributor
    	{
    		int		total;
    		LPCHARACTER	c;
    		int		x, y;
    		DWORD		_iExp;
    		int		m_iMode;
    		int		m_iMemberCount;
    
    		FPartyDistributor(LPCHARACTER center, int member_count, int total, DWORD iExp, int iMode)
    			: total(total), c(center), x(center->GetX()), y(center->GetY()), _iExp(iExp), m_iMode(iMode), m_iMemberCount(member_count)
    			{
    				if (m_iMemberCount == 0)
    					m_iMemberCount = 1;
    			};
    
    		void operator () (LPCHARACTER ch)
    		{
    			if (DISTANCE_APPROX(ch->GetX() - x, ch->GetY() - y) <= PARTY_DEFAULT_RANGE)
    			{
    				DWORD iExp2 = 0;
    
    				switch (m_iMode)
    				{
    					case PARTY_EXP_DISTRIBUTION_NON_PARITY:
    						iExp2 = (DWORD) (_iExp * (float) __GetPartyExpNP(ch->GetLevel()) / total);
    						break;
    
    					case PARTY_EXP_DISTRIBUTION_PARITY:
    						iExp2 = _iExp / m_iMemberCount;
    						break;
    
    					case PARTY_EXP_DISTRIBUTION_EQUAL:
    						iExp2 = _iExp;
    						break;
    
    					default:
    						sys_err("Unknown party exp distribution mode %d", m_iMode);
    						return;
    				}
    
    				GiveExp(c, ch, iExp2);
    			}
    		}
    	};

     

     

    • Love 5
  2. do
    	local isFast = true
    	local __say = say
    	function _G.say(str, ...)
    		if table.getn(arg) > 0 then
    			if isFast then
    				raw_script("[DELAY value;1]"..string.format(str, unpack(arg)).."[/DELAY][ENTER]")
    			else
    				__say(string.format(str, unpack(arg)))
    			end
    		else
    			if isFast then
    				raw_script("[DELAY value;1]"..str.."[/DELAY][ENTER]")
    			else
    				__say(str)
    			end
    		end
    	end
    
    	-- string.tolower function fix for hungarian keyboard
    	os.setlocale("fr_FR.ISO8859-1","ctype")
    end

     

  3. When I saw it I said LOL! :mellow:

    	if (CPythonChat::WHISPER_TYPE_CHAT == whisperPacket.bType || CPythonChat::WHISPER_TYPE_GM == whisperPacket.bType)
    	{
    #ifdef ENABLE_WHISPER_FLASHING
    		FLASHWINFO flashInfo;
    		flashInfo.cbSize = sizeof(flashInfo);
    		flashInfo.hwnd = CPythonApplication::Instance().GetWindowHandle();
    		flashInfo.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG;
    		flashInfo.uCount = 0;
    		flashInfo.dwTimeout = 0;
    		FlashWindowEx(&flashInfo);
    #endif
    		_snprintf(line, sizeof(line), "%s : %s", whisperPacket.szNameFrom, buf);
    		PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "OnRecvWhisper", Py_BuildValue("(iss)", (int) whisperPacket.bType, whisperPacket.szNameFrom, line));
    	}

    10€ for nothing xD

    • Love 2
  4. Hmm...
    Mouse? MouseButtonLeftUp? Maybe game.py? Ohh!

    itemDropQuestionDialog -> acceptevent -> __SendDropItemPacket -> m2net.SendItemDropPacketNew -> HEADER_CG_ITEM_DROP2 -> input_main.cpp -> ItemDrop2 -> ch->DropItem -> char_item.cpp -> CHARACTER::DropItem -> Magic -> If (expr) return;

  5. Hello everyone.

     

    If you play or played on gameforge servers you should to know that what is this.

    When you are opening more than one clients the icon of the applications (on the windows taskbar) are groupped like 

    Spoiler

    22222510437e6a16.jpg.98c6885f4e30f36b3b9

    With this little modification you can do like this(as on gameforge clients work):

    Spoiler

    222225043d75ec60.jpg.6c3e3b53a128595b9d1

     

     

    Open the EterLib\MSWindow.cpp and paste this under the #include <windowsx.h> line:

    #define DISABLE_TASKBAR_GROUPING
    #ifdef DISABLE_TASKBAR_GROUPING
    #include <Shobjidl.h>
    #endif

    Then scroll down to the CMSWindow::Create function and search this code:

    	if (!m_hWnd)
    		return false;

    Paste the following code below of that:

    #ifdef DISABLE_TASKBAR_GROUPING
    	OSVERSIONINFO v;
    	v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
    	GetVersionEx(&v);
    	if (v.dwMajorVersion == 6 && v.dwMinorVersion >= 1 || v.dwMajorVersion > 6)
    	{
    		WCHAR myAppID[128];
    		swprintf(myAppID, sizeof(myAppID) / sizeof(myAppID[0]), L"MyMetin2AppID%u", GetCurrentProcessId());
    		HRESULT hr = SetCurrentProcessExplicitAppUserModelID(myAppID);
    		if (!SUCCEEDED(hr))
    			return false;
    	}
    #endif

     

    The if-statement checks your windows version and if passed, the ungrouping will run. (6.1 is Win7SP1)

    P3NG3R

    • Love 1
    • Love 19
  6. Omg.

    Just add this enum into RaceData.h as public inside the CRaceData class:

    		enum ERaces
    		{
    			RACE_WARRIOR_M,
    			RACE_ASSASSIN_W,
    			RACE_SURA_M,
    			RACE_SHAMAN_W,
    			RACE_WARRIOR_W,
    			RACE_ASSASSIN_M,
    			RACE_SURA_W,
    			RACE_SHAMAN_M,
    #ifdef ENABLE_WOLFMAN_CHARACTER
    			RACE_WOLFMAN_M,
    #endif
    			RACE_MAX_NUM,
    		};

    w/ or w/o wolfman macro..

     

  7. Yes but updated now :).

    They changed the whole TItemPos also, by split the inventories into variables by windowtypes.
    I mean:

    Now the Cell of acce is:

    	LOBYTE(v50) = 2;//EQUIPMENT page
    	*(unsigned __int16 *)((char *)&v50 + 1) = 22;//ACCE slotIndex
    	absorbedItemVnum = CPythonPlayer::GetItemMetinSocket(0, (int)&v17, v50, 0);
    in C++:
    	DWORD absorbedItemVnum = CPythonPlayer::instance().GetItemMetinSocket(TItemPos(EQUIPMENT, c_Costume_Slot_Acce), 0);

    But in prior version(and in the public src also) looks like this:

    	LOBYTE(v4) = 1;//INVENTORY page
    	*(_WORD *)((char *)&v4 + 1) = 112;//ACCE slotIndex
    	absorbedItemVnum = CPythonPlayer::GetItemMetinSocket(0, v4, 0);
    in C++:
    	DWORD absorbedItemVnum = CPythonPlayer::instance().GetItemMetinSocket(TItemPos(INVENTORY, c_Costume_Slot_Acce), 0);

     

    This is the new version of IsValidCell for every inventory page:

    char __fastcall TItemPos::IsValidCell(int a1)
    {
    	char result; // al@2
    	
    	switch ( *(_BYTE *)a1 )//wndType
    	{
    	case INVENTORY:
    		result = (unsigned int)*(_WORD *)(a1 + sizeof(BYTE)/*1*/) < 180;
    		break;
    	case EQUIPMENT:
    		result = (unsigned int)*(_WORD *)(a1 + sizeof(BYTE)/*1*/) < 44;
    		break;
    	case BELT_INVENTORY:
    		result = (unsigned int)*(_WORD *)(a1 + sizeof(BYTE)/*1*/) < 16;
    		break;
    	case DRAGON_SOUL_INVENTORY:
    		result = (signed int)*(_WORD *)(a1 + sizeof(BYTE)/*1*/) < 960;
    		break;
    	default:
    		result = 0;
    		break;
    	}
    	return result;
    }

     

    So, they were do like this way:

    typedef struct SPlayerStatus
    {
    	TItemData			aInventoryItem[c_Inventory_Count];//180 = 4*45
    	TItemData			aEquipmentItem[c_Wear_Max + c_DragonSoul_Equip_Slot_Max * DS_DECK_MAX_NUM];//44 = 32 + 2*6
    	TItemData			aDSInventoryItem[c_DragonSoul_Inventory_Count];//960 = 6*5*32
    	TItemData			aBeltInventoryItem[c_Belt_Inventory_Slot_Count];//16 = 4*4
    	TQuickSlot			aQuickSlot[QUICKSLOT_MAX_NUM];
    	TSkillInstance		aSkill[SKILL_MAX_NUM];
    	long long			m_allPoint[POINT_MAX_NUM];
    	long				lQuickPageIndex;
    
    	void SetPoint(UINT ePoint, long long llPoint);
    	long long GetPoint(UINT ePoint);
    } TPlayerStatus;
    TPlayerStatus			m_playerStatus;
    
    
    const TItemData * CPythonPlayer::GetItemData(TItemPos Cell) const
    {
    	if (!Cell.IsValidCell())
    		return NULL;
    
    	switch (Cell.window_type)
    	{
    	case INVENTORY:
    		return &m_playerStatus.aInventoryItem[Cell.cell];
    	case EQUIPMENT:
    		return &m_playerStatus.aEquipmentItem[Cell.cell];
    	case DRAGON_SOUL_INVENTORY:
    		return &m_playerStatus.aDSInventoryItem[Cell.cell];
    	case BELT_INVENTORY:
    		return &m_playerStatus.aBeltInventoryItem[Cell.cell];
    	default:
    		return NULL;
    	}
    }

     

     

    • Love 2
  8. Maybe like this?

    									char tmpBuf[64+1];
    									std::string rTime = LC_TEXT("Your item will be unbinded in ");
    									if (hours > 0)
    									{
    										snprintf(tmpBuf, sizeof(tmpBuf), "%uh", hours);
    										rTime += tmpBuf;
    									}
    
    									if (minutes > 0 && hours > 0)
    										rTime += " ";
    
    									if (minutes > 0)
    									{
    										snprintf(tmpBuf, sizeof(tmpBuf), "%um", minutes);
    										rTime += tmpBuf;
    									}
    
    									if (seconds > 0 && (hours > 0 || minutes > 0))
    										rTime += " ";
    
    									if (seconds > 0)
    									{
    										snprintf(tmpBuf, sizeof(tmpBuf), "%us", seconds);
    										rTime += tmpBuf;
    									}

     

    • Love 1
  9. Khm..

    enum EWindows
    {
    	RESERVED_WINDOW,
    	INVENTORY,				// ±âş» ŔÎşĄĹ丮. (45Ä­ ÂĄ¸®°ˇ 2ĆäŔĚÁö Á¸Ŕç = 90Ä­)
    	EQUIPMENT,
    	SAFEBOX,
    	MALL,
    	DRAGON_SOUL_INVENTORY,
    	BELT_INVENTORY,			// NOTE: W2.1 ąöŔüżˇ »ő·Î Ăß°ˇµÇ´Â ş§Ć® ˝˝·Ô ľĆŔĚĹŰŔĚ Á¦°řÇĎ´Â ş§Ć® ŔÎşĄĹ丮
    #ifdef ENABLE_GUILDRENEWAL_SYSTEM
    	GUILDBANK,
    #endif
    #ifdef ENABLE_ACCE_COSTUME_SYSTEM
    	ACCEREFINE,
    #endif
    	GROUND,					// NOTE: 2013łâ 2żů5ŔĎ ÇöŔç±îÁö unused.. żÖ Ŕִ°ĹÁö???
    #ifdef ENABLE_GROWTH_PET_SYSTEM
    	PET_FEED,
    #endif
    #ifdef ENABLE_CHANGE_LOOK_SYSTEM
    	CHANGELOOK,
    #endif
    
    	WINDOW_TYPE_MAX,
    };
    BYTE c_aSlotTypeToInvenType[SLOT_TYPE_MAX] =
    {
    	RESERVED_WINDOW,		// SLOT_TYPE_NONE
    	INVENTORY,				// SLOT_TYPE_INVENTORY
    	RESERVED_WINDOW,		// SLOT_TYPE_SKILL
    	RESERVED_WINDOW,		// SLOT_TYPE_EMOTION
    	RESERVED_WINDOW,		// SLOT_TYPE_SHOP
    	RESERVED_WINDOW,		// SLOT_TYPE_EXCHANGE_OWNER
    	RESERVED_WINDOW,		// SLOT_TYPE_EXCHANGE_TARGET
    	RESERVED_WINDOW,		// SLOT_TYPE_QUICK_SLOT
    	RESERVED_WINDOW,		// SLOT_TYPE_SAFEBOX	<- SAFEBOX, MALLŔÇ °ćżě Çϵĺ ÄÚµůµÇľîŔÖ´Â LEGACY Äڵ带 ŔŻÁöÇÔ.
    #ifdef ENABLE_GUILDRENEWAL_SYSTEM
    	GUILDBANK,				// SLOT_TYPE_GUILDBANK
    #endif
    #ifdef ENABLE_ACCE_COSTUME_SYSTEM
    	SLOT_TYPE_ACCE,			// ACCEREFINE
    #endif
    	RESERVED_WINDOW,		// SLOT_TYPE_PRIVATE_SHOP
    	RESERVED_WINDOW,		// SLOT_TYPE_MALL		<- SAFEBOX, MALLŔÇ °ćżě Çϵĺ ÄÚµůµÇľîŔÖ´Â LEGACY Äڵ带 ŔŻÁöÇÔ.
    	DRAGON_SOUL_INVENTORY,	// SLOT_TYPE_DRAGON_SOUL_INVENTORY
    #ifdef ENABLE_GROWTH_PET_SYSTEM
    	PET_FEED,				// SLOT_TYPE_PET_FEED_WINDOW
    #endif
    	EQUIPMENT,				// SLOT_TYPE_EQUIPMENT
    	BELT_INVENTORY,			// SLOT_TYPE_BELT_INVENTORY
    #ifdef ENABLE_AUTO_SYSTEM
    	RESERVED_WINDOW,		// SLOT_TYPE_AUTO
    #endif
    #ifdef ENABLE_CHANGE_LOOK_SYSTEM
    	CHANGELOOK,				// SLOT_TYPE_CHANGE_LOOK
    #endif
    };
    BYTE c_aWndTypeToSlotType[WINDOW_TYPE_MAX] =
    {
    	SLOT_TYPE_NONE,
    	SLOT_TYPE_INVENTORY,				// INVENTORY
    	SLOT_TYPE_EQUIPMENT,				// EQUIPMENT
    	SLOT_TYPE_SAFEBOX,					// SAFEBOX
    	SLOT_TYPE_MALL,						// MALL
    	SLOT_TYPE_DRAGON_SOUL_INVENTORY,	// DRAGON_SOUL_INVENTORY
    	SLOT_TYPE_BELT_INVENTORY,			// BELT_INVENTORY
    #ifdef ENABLE_GUILDRENEWAL_SYSTEM
    	SLOT_TYPE_GUILDBANK,				// GUILDBANK
    #endif
    #ifdef ENABLE_ACCE_COSTUME_SYSTEM
    	SLOT_TYPE_ACCE,						// ACCEREFINE
    #endif
    #ifdef ENABLE_GROWTH_PET_SYSTEM
    	SLOT_TYPE_PET_FEED_WINDOW,			// PET_FEED
    #endif
    #ifdef ENABLE_CHANGE_LOOK_SYSTEM
    	SLOT_TYPE_CHANGE_LOOK,				// CHANGELOOK
    #endif
    };

     

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