[Development] Party HP bar (Source)

Page 1 of 2 12 LastLast
Results 1 to 25 of 46
  1. #1
    nullptr -=DarkSim=- is offline
    MemberRank
    Oct 2008 Join Date
    Lost continentLocation
    240Posts

    [Development] Party HP bar (Source)

    Hello all, today i release "decompiled" function of party HP bar draw from client.
    Maybe for someone it interesting for create custom HP bars over targets like ex7+ clients

    All offsets and etc for: 1.04.04 GMO (Season 6 Episode 3)

    Function:
    Code:
    void DrawPartyHP()
    {
    	if( pPartyMemberCount <= 0 )
    	{
    		return;
    	}
    	// ----
    	float LifeBarWidth = 38.0f;
    	char LifeDisplay[20];
    	VAngle Angle;
    	int PosX, PosY, LifeProgress;
    	// ----
    	for( int PartySlot = 0; PartySlot < pPartyMemberCount; PartySlot++ )
    	{
    		PartyList PartyMember	= *(PartyList*)((char*)&pPartyListStruct + sizeof(PartyList) * PartySlot);
    		lpViewObj lpPartyObj	= &*(ObjectPreview*)pGetPreviewStruct(pPreviewThis(), PartyMember.ViewportID);
    		// ----
    		if( !lpPartyObj )
    		{
    			continue;
    		}
    		// ----
    		Angle.X = lpPartyObj->m_Model.VecPosX;
    		Angle.Y = lpPartyObj->m_Model.VecPosY;
    		Angle.Z = lpPartyObj->m_Model.VecPosZ + lpPartyObj->m_Model.Unknown216.Z + 100.0;
    		// ----
    		pGetPosFromAngle(&Angle, &PosX, &PosY);
    		PosX -= (int)floor(LifeBarWidth / (double)2.0);	//T_T
    		// ----
    		if(		pCursorX >= PosX
    			&&	(float)pCursorX <= (float)PosX + LifeBarWidth
    			&&	pCursorY >= PosY - 2 
    			&&	pCursorY < PosY + 6 )
    		{
    			sprintf(LifeDisplay, "HP : %d0%%", PartyMember.LifePercent);
    			pSetTextColor(pTextThis(), 0xFF, 0xE6, 0xD2, 0xFF);
    			pDrawText(pTextThis(), PosX, PosY - 6, LifeDisplay, 0, 0, (LPINT)1, 0);
    		}
    		// ----
    		pSetBlend(true);
    		// ----
    		glColor4f(0.0, 0.0, 0.0, 0.5);
    		pDrawBarForm((float)(PosX + 1), (float)(PosY + 1), LifeBarWidth + 4.0, 5.0, 0.0, 0);
    		pGLSwitchBlend();
    		// ----
    		glColor3f(0.2, 0.0, 0.0);
    		pDrawBarForm((float)PosX, (float)PosY, LifeBarWidth + 4.0, 5.0, 0.0, 0);
    		// ----
    		glColor3f(0.19607843, 0.039215688, 0.0);
    		pDrawBarForm((float)(PosX + 2), (float)(PosY + 2), LifeBarWidth, 1.0, 0.0, 0);
    		//-> Very strange method, maybe will be cool LifePercent / 10? :D
    		if( PartyMember.LifePercent > 10 )	
    		{
    			LifeProgress = 10;
    		}
    		else
    		{
    			LifeProgress = PartyMember.LifePercent;
    		}
    		// ----
    		glColor3f(0.98039216, 0.039215688, 0.0);
    		// ----
    		for( int i = 0; i < LifeProgress; i++ )
            {
    			pDrawBarForm((float)(i * 4 + PosX + 2), (float)(PosY + 2), 3.0, 2.0, 0.0, 0);
            }
    		// ----
    		pGLSwitch();
    	}
    	// ----
    	pGLSwitch();
    	glColor3f(1.0, 1.0, 1.0);
    }
    Structures:
    Code:
    #pragma pack(push, 1)
    struct VAngle
    {
    	float X;
    	float Y;
    	float Z;
    };
    #pragma pack(pop)
    // ----------------------------------------------------------------------------------------------
    
    #pragma pack(push, 1)
    struct ObjectModel_424
    {
    	float Unknown0;
    	float Unknown4;
    	float Unknown8;
    	float Unknown12;
    	float Unknown16;
    	float Unknown20;
    	float Unknown24;
    	float Unknown28;
    	float Unknown32;
    	float Unknown36;
    	float Unknown40;
    	float Unknown44;
    };
    #pragma pack(pop)
    // ----------------------------------------------------------------------------------------------
    
    #pragma pack(push, 1)
    struct ObjectModel	//648?
    {
    BYTE gap00[4];
    /*+4*/		BYTE	Unknown4;
    BYTE gap01[4];
    /*+9*/		BYTE	Unknown9;
    BYTE gap02[5];
    /*+15*/		BYTE	Unknown15;
    BYTE gap03[2];
    /*+18*/		WORD	AnimationID;
    /*+20*/		WORD	Unknown20;
    /*+22*/		BYTE	Unknown22;
    /*+23*/		BYTE	Unknown23;
    /*+24*/		BYTE	ObjectType;
    BYTE gap04[13];
    /*+38*/		WORD	Unknown38;
    BYTE gap05[8];
    /*+48*/		DWORD	Unknown48;
    BYTE gap06[44];
    /*+96*/		float	Scale;
    BYTE gap07[16];
    /*+116*/	float	Unknown116;
    BYTE gap08[20];
    /*+140*/	float	Unknown140;
    /*+144*/	float	Unknown144;
    BYTE gap09[56];
    /*+204*/	VAngle	Unknown204;
    /*+216*/	VAngle	Unknown216;
    BYTE gap10[24];
    /*+252*/	float	VecPosX;
    /*+256*/	float	VecPosY;
    /*+260*/	float	VecPosZ;
    /*+264*/	float	Unknown264;
    /*+268*/	float	Unknown268;
    /*+272*/	float	Unknown272;
    BYTE gap11[148];
    /*+424*/	ObjectModel_424 Unknown424;
    BYTE gap12[176];
    /*+484*/
    };
    #pragma pack(pop)
    // ----------------------------------------------------------------------------------------------
    
    #pragma pack(push, 1)
    typedef struct	//-> InDev (size: 1432)
    {
    BYTE gap01[14];
    /*+14*/		bool	InSafeZone;
    /*+15*/		BYTE	Unknown15;
    /*+16*/		BYTE	Unknown16;
    /*+17*/		BYTE	IsLiveObject;
    /*+18*/		BYTE	Unknown18;
    /*+19*/		BYTE	Class;
    /*+20*/		BYTE	Unknown20;
    /*+21*/		BYTE	CtlCode;	//Bit decomposit (0x10)
    /*+22*/		BYTE	Unknown22;
    /*+23*/		BYTE	Unknown23;
    /*+24*/		BYTE	Unknown24;
    /*+25*/		BYTE	Unknown25;
    /*+26*/		BYTE	Unknown26;
    /*+27*/		BYTE	Unknown27;
    /*+28*/		BYTE	Unknown28;
    /*+29*/		BYTE	Unknown29;
    /*+30*/		BYTE	Unknown30;
    /*+31*/		BYTE	GensInfluence;	//0 - None, 1 - D, 2 - V 
    /*+32*/		BYTE	Unknown32;
    /*+33*/		BYTE	Unknown33;
    /*+34*/		BYTE	Unknown34;
    /*+35*/		BYTE	Unknown35;
    /*+36*/		BYTE	Unknown36;	//Personal Shop
    /*+37*/		BYTE	Unknown37;
    /*+38*/		WORD	Unknown38;
    /*+40*/		BYTE	Unknown40;
    /*+41*/		BYTE	Unknown41;
    /*+42*/		BYTE	Unknown42;
    BYTE gap03[2];
    /*+45*/		BYTE	RespawnPosX;
    /*+46*/		BYTE	RespawnPosY;
    BYTE gap04[3];
    /*+50*/		BYTE	ActiveMagic;
    BYTE gap05[5];
    /*+56*/		char	Name[25];	//need check size
    BYTE gap06[39];
    /*+120*/	BYTE	Unknown120;
    /*+121*/	BYTE	Unknown121;
    BYTE gap07[2];
    /*+124*/	WORD	Unknown124;
    /*+126*/	WORD	aIndex;
    /*+128*/	WORD	Unknown128;
    /*+130*/	WORD	Unknown130;
    /*+132*/	WORD	ID;
    /*+134*/	WORD	Unknown134;
    /*+136*/	//maybe word
    BYTE gap09[36];
    /*+172*/	DWORD	MapPosX;
    /*+176*/	DWORD	MapPosY;
    BYTE gap10[8];
    /*+188*/	float	Unknown188;
    BYTE gap11[76];
    /*+268*/	short	HelmSlot;
    /*+270*/	BYTE	HelmLevel;
    /*+271*/	BYTE	HelmExcellent;
    /*+272*/	BYTE	HelmAncient;
    BYTE gap12[31];
    /*+304*/	short	ArmorSlot;
    /*+306*/	BYTE	ArmorLevel;
    /*+307*/	BYTE	ArmorExcellent;
    /*+308*/	BYTE	ArmorAncient;
    BYTE gap13[31];
    /*+340*/	short	PantsSlot;
    /*+342*/	BYTE	PantsLevel;
    /*+343*/	BYTE	PantsExcellent;
    /*+344*/	BYTE	PantsAncient;
    BYTE gap14[31];
    /*+376*/	short	GlovesSlot;
    /*+378*/	BYTE	GlovesLevel;
    /*+379*/	BYTE	GlovesExcellent;
    /*+380*/	BYTE	GlovesAncient;
    BYTE gap15[31];
    /*+412*/	short	BootsSlot;
    /*+414*/	BYTE	BootsLevel;
    /*+415*/	BYTE	BootsExcellent;
    /*+416*/	BYTE	BootsAncient;
    BYTE gap16[31];
    /*+448*/	short	WeaponFirstSlot;
    /*+450*/	BYTE	WeaponFirstLevel;
    /*+451*/	BYTE	WeaponFirstExcellent;
    /*+452*/	BYTE	WeaponFirstAncient;
    BYTE gap17[31];
    /*+484*/	short	WeaponSecondSlot;
    /*+486*/	BYTE	WeaponSecondLevel;
    /*+487*/	BYTE	WeaponSecondExcellent;
    /*+488*/	BYTE	WeaponSecondAncient;
    BYTE gap18[31];
    /*+520*/	short	WingsSlot;
    /*+522*/	BYTE	WingsLevel;
    /*+523*/	BYTE	WingsExcellent;
    /*+524*/	BYTE	WingsAncient;
    BYTE gap19[31];
    /*+556*/	short	PetSlot;
    /*+558*/	BYTE	PetLevel;
    /*+559*/	BYTE	PetExcellent;
    /*+560*/	BYTE	PetAncient;
    BYTE gap20[111];
    /*+672*/	DWORD	Unknown672;
    /*+676*/	DWORD	Unknown676;
    BYTE gap21[84];
    /*+764*/	DWORD	Unknown764;
    BYTE gap22[8];
    /*+776*/	ObjectModel	m_Model;
    /*+1424*/	BYTE	Unknown1424;	//maybe gens rank
    BYTE gap23[3];
    /*+1428*/	DWORD	Unknown1428;	//-> end
    } ObjectPreview, * lpViewObj;
    #pragma pack(pop)
    // ----------------------------------------------------------------------------------------------
    
    #pragma pack(push, 1)
    struct PartyList //-> Complete (size: 32)
    {
    /*+0*/	char	Name[10];
    /*+10*/	BYTE	Unknown10;
    /*+11*/	BYTE	Unknown11;
    /*+12*/	BYTE	MapNumber;
    /*+13*/	BYTE	PosX;
    /*+14*/	BYTE	PosY;
    BYTE gap01;
    /*+16*/	int		Life;
    /*+20*/	int		MaxLife;
    /*+24*/	BYTE	LifePercent;
    BYTE gap02[3];
    /*+28*/	int		ViewportID;
    }; typedef PartyList * lpPartyList;
    #pragma pack(pop)
    // ----------------------------------------------------------------------------------------------
    Defines:
    Code:
    #define pPartyListStruct		*(PartyList*)0x81CB4E8
    #define pPartyMemberCount		*(DWORD*)0x81F6B6C
    #define pPreviewThis			((LPVOID(*)()) 0x402BC0)
    #define pGetPreviewStruct		((DWORD(__thiscall*)(LPVOID This, int ViewportID)) 0x96A340)
    #define pGetPosFromAngle		((void(__cdecl*)(VAngle * Angle, int * PosX, int * PosY)) 0x635B00)
    #define	pCursorX				*(int*)0x879340C
    #define	pCursorY				*(int*)0x8793410
    #define pTextThis				((LPVOID(*)()) 0x0041FE10)
    #define pSetTextColor			((void(__thiscall*)(LPVOID This, BYTE r, BYTE g, BYTE b, BYTE h)) 0x00420040)
    #define pDrawText				((int(__thiscall*)(LPVOID This, int PosX, int PosY, char * Text, int Arg4, int Arg5, int * Arg6, int Arg7)) 0x00420150)
    #define pDrawBarForm			((void(__cdecl*)(float PosX, float PosY, float Width, float Height, float Arg5, int Arg6)) 0x6378A0)
    #define pSetBlend				((void(__cdecl*)(BYTE Mode)) 0x635FD0)
    #define pGLSwitchBlend			((void(__cdecl*)()) 0x636070)
    #define pGLSwitch				((void(__cdecl*)()) 0x635F50)
    Hook:
    Code:
    SetOp((LPVOID)0x005B96E8, (LPVOID)DrawPartyHP, 0xE8/*ASM::CALL*/);
    a little imagination anddd


    P.S.: for some function need include opengl
    Code:
    #include <gl\GL.h>
    #pragma comment(lib, "Opengl32.lib")
    Last edited by -=DarkSim=-; 07-11-13 at 08:17 AM.


  2. #2
    Member CallOfDuty is offline
    MemberRank
    Oct 2012 Join Date
    65Posts

    re: [Development] Party HP bar (Source)

    need server side ? i add for main1.04d ss6.3 don't work :(

  3. #3
    nullptr -=DarkSim=- is offline
    MemberRank
    Oct 2008 Join Date
    Lost continentLocation
    240Posts

    re: [Development] Party HP bar (Source)

    CallOfDuty
    - it sources of Party HP draw function, not of custom life bar for mobs

  4. #4
    Enthusiast youaremyangel is offline
    MemberRank
    Jan 2013 Join Date
    EuropeLocation
    28Posts

    re: [Development] Party HP bar (Source)

    nice work... dude

  5. #5
    MFS Team Owner diablo71 is offline
    MemberRank
    Jan 2007 Join Date
    BulgariaLocation
    876Posts

    re: [Development] Party HP bar (Source)

    can you make 1 party hp for 4.6 ia?

  6. #6
    Proficient Member VeltonD is offline
    MemberRank
    Feb 2013 Join Date
    193Posts

    re: [Development] Party HP bar (Source)

    WoOOOOW DarkSim Very Nice Custom OO'

    PS: Struct compactive Season 4?

  7. #7
    CAARL, THAT KILLS PEOPLE! SmallHabit is offline
    MemberRank
    Oct 2010 Join Date
    LatviaLocation
    231Posts

    re: [Development] Party HP bar (Source)



    I made something like this. Just added some new graphics and it looks better now. Also edited viewport protocol.

  8. #8
    MFS Team Owner diablo71 is offline
    MemberRank
    Jan 2007 Join Date
    BulgariaLocation
    876Posts

    re: [Development] Party HP bar (Source)

    dont you think if over 2000+ players get to 1 place it will make game slower ? cause this grafics

  9. #9
    CAARL, THAT KILLS PEOPLE! SmallHabit is offline
    MemberRank
    Oct 2010 Join Date
    LatviaLocation
    231Posts

    re: [Development] Party HP bar (Source)

    This only draws on mobs, I already tested with a lot of mobs on the screen, and you know - with or without it doesn't affect fps at all.

  10. #10
    Proficient Member VeltonD is offline
    MemberRank
    Feb 2013 Join Date
    193Posts

    re: [Development] Party HP bar (Source)

    DarkSim you have Offsets pPreviewThis & pGetPreviewStruct for 1.03P/K ?

    My Main 1.03 Vietnã offsets have very differentiates
    s4.pngs6.png
    Last edited by VeltonD; 07-11-13 at 05:15 PM.

  11. #11
    nullptr -=DarkSim=- is offline
    MemberRank
    Oct 2008 Join Date
    Lost continentLocation
    240Posts

    re: [Development] Party HP bar (Source)

    VeltonD
    - In mains < 6.3 preview struct can be get by direct call, like:
    Code:
    #define pViewObjStruct			*(int*)0x7B650F8
    lpViewObj lpPartyObj = *(ObjectPreview*)((char*)&pViewObjStruct + 1304 * ViewportID);
    1304 = sizeof(ViewObjStruct)
    1.03.25 JPN

  12. #12
    Proficient Member VeltonD is offline
    MemberRank
    Feb 2013 Join Date
    193Posts

    re: [Development] Party HP bar (Source)

    DarkSim Thx

    #define pViewObjStruct *(int*)0x7A6C024 // -> 1.03 VTM
    lpViewObj lpPartyObj = *(ObjectPreview*)((char*)&pViewObjStruct + 1236 * ViewportID);

    How would this ViewportID ?
    Last edited by VeltonD; 07-11-13 at 06:09 PM.

  13. #13
    Darkness Member Kiosani is offline
    MemberRank
    Oct 2007 Join Date
    ArgentinaLocation
    1,276Posts

    re: [Development] Party HP bar (Source)

    Nice work -=DarkSim=- well, as usual for you.

  14. #14
    C/C++,PHP,HTML,Java,ASM zasmqniq is offline
    MemberRank
    Jan 2009 Join Date
    BulgariaLocation
    435Posts

    re: [Development] Party HP bar (Source)

    Thanks DarkSim Unique :)!

  15. #15
    NOOB quyen194 is offline
    MemberRank
    Jul 2012 Join Date
    Hoai Duc Phu, HLocation
    200Posts

    sad re: [Development] Party HP bar (Source)

    Nice work ^^
    Last edited by quyen194; 21-11-14 at 04:33 AM.

  16. #16
    Enthusiast youaremyangel is offline
    MemberRank
    Jan 2013 Join Date
    EuropeLocation
    28Posts

    re: [Development] Party HP bar (Source)

    it doesnt work on monster.. because there are different packets. it works only in party

  17. #17
    Proficient Member caothuphutho is offline
    MemberRank
    Dec 2007 Join Date
    0x00000000Location
    150Posts

    re: [Development] Party HP bar (Source)

    youaremyangel
    this is source decompile HpParty, Not custom MonterHP Bar !

  18. #18
    Enthusiast netwhw is offline
    MemberRank
    Sep 2005 Join Date
    27Posts

    re: [Development] Party HP bar (Source)

    DarkSim , would you care to elaborate on pDrawText and SetTextColor to define text color and BGColor ?

  19. #19
    Apprentice maihieptn is offline
    MemberRank
    Dec 2013 Join Date
    7Posts

    re: [Development] Party HP bar (Source)

    main 1.04D Eng hook dll no show HP Bar

    Can you give me share code ?
    thanks !

  20. #20
    Member Jjkkllaa is offline
    MemberRank
    Jan 2013 Join Date
    77Posts

    re: [Development] Party HP bar (Source)

    Please tell me which program used to make this dll file
    Last edited by Jjkkllaa; 08-01-14 at 05:55 AM.

  21. #21
    Member Jjkkllaa is offline
    MemberRank
    Jan 2013 Join Date
    77Posts

    re: [Development] Party HP bar (Source)

    Please tell me which program used to make this dll file

  22. #22
    Valued Member kksky is offline
    MemberRank
    Dec 2011 Join Date
    106Posts

    re: [Development] Party HP bar (Source)

    @-=DarkSim=-You can upload files? I really like this project

  23. #23
    nullptr -=DarkSim=- is offline
    MemberRank
    Oct 2008 Join Date
    Lost continentLocation
    240Posts

    re: [Development] Party HP bar (Source)

    kksky
    - What files? I post source of "decompilition", what need more?

  24. #24
    Valued Member kksky is offline
    MemberRank
    Dec 2011 Join Date
    106Posts

    re: [Development] Party HP bar (Source)

    Quote Originally Posted by -=DarkSim=- View Post
    kksky
    - What files? I post source of "decompilition", what need more?
    @-=DarkSim=- sorry ! I will not C++ programming , so you need the file , you can upload main and DLL do ? Thank you

  25. #25
    Darkness Member Kiosani is offline
    MemberRank
    Oct 2007 Join Date
    ArgentinaLocation
    1,276Posts

    smile re: [Development] Party HP bar (Source)

    Quote Originally Posted by kksky View Post
    @-=DarkSim=- sorry ! I will not C++ programming , so you need the file , you can upload main and DLL do ? Thank you
    -=DarkSim=- will not share the source of your custom bar code life monsters (ex700 style), he only shared decompiled src of the original life bar of the characters in Party (into the game), It makes no sense that you hook one. DLL with this function as this, because it would make any changes. can you understand me?

    PS: Sorry for my very bad English.



Page 1 of 2 12 LastLast

Advertisement