Kết quả 461 đến 470 của 497
Chủ đề: Học Hỏi Source zTeam HoanMaster
-
19-08-16, 11:54 AM #461
- Ngày tham gia
- Jul 2012
- Đang ở
- https://t.me*********
- Bài viết
- 976
- Thanks
- 520
- Thanked 470 Times in 280 Posts
Ðề: Học Hỏi Source zTeam HoanMaster
Anh em chú ý ngôn từ kẻo ăn thẻ thì lại kêu.
Khách viếng thăm hãy cùng YouTobe xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!
-
04-09-16, 08:06 PM #462
Ðề: Học Hỏi Source zTeam HoanMaster
Top pic này lập ra để chia sẽ và học hỏi.
Nhưng chia sẽ chả thấy đâu, hỏi mõi cả mồm chẳng ai chỉ.
Code danh hiệu check Lv: Mình lấy được từ Scoure của Trọng chia sẽ cho anh em sau này còn biết.
interface.cpp
PHP Code:pLoadImage("Custom\\RankHornor\\tanbinhhoangkim.tga", 32600, GL_LINEAR, GL_CLAMP, 1, 0);
pLoadImage("Custom\\RankHornor\\hasihoangkim.tga", 32601, GL_LINEAR, GL_CLAMP, 1, 0);
pLoadImage("Custom\\RankHornor\\trunguyhoangkim.tga", 32602, GL_LINEAR, GL_CLAMP, 1, 0);
pLoadImage("Custom\\RankHornor\\thuongtahoangkim.tga", 32603, GL_LINEAR, GL_CLAMP, 1, 0);
pLoadImage("Custom\\RankHornor\\caothutuyetdinh.tga", 32604, GL_LINEAR, GL_CLAMP, 1, 0);
pLoadImage("Custom\\RankHornor\\daituonghoangkim.tga", 32605, GL_LINEAR, GL_CLAMP, 1, 0);
pLoadImage("Custom\\RankHornor\\nguyensoaihoangkim.tga", 32606, GL_LINEAR, GL_CLAMP, 1, 0);
pLoadImage("Custom\\RankHornor\\chienthanvosong.tga", 32607, GL_LINEAR, GL_CLAMP, 1, 0);
pLoadImage("Custom\\RankHornor\\khongaidonoi.tga", 32608, GL_LINEAR, GL_CLAMP, 1, 0);
pLoadImage("Custom\\RankHornor\\devuongquyennang.tga", 32609, GL_LINEAR, GL_CLAMP, 1, 0);
PHP Code:#include "stdafx.h"
#include "Import.h"
#include "User.h"
#include "TMemory.h"
#include "TDebugLog.h"
#include "Interface.h"
#include "Protocol.h"
#include "TrayMode.h"
#include "ConnectEx.h"
#include "VisualFix.h"
#include "array.h"
// ----------------------------------------------------------------------------------------------
struct sMonsterBar
{
DWORD GetTime;
int aIndex;
int Life;
int MaxLife;
short Level;
int ViewID;
};
array<sMonsterBar> MonsterBar;
struct sPlayerBar : sMonsterBar
{
int SD;
int MaxSD;
short Reset;
short GReset;
short ExpProc;
bool ChatShowed;
};
array<sPlayerBar> PlayerBar;
bool lifebar = true;
bool RankHornor;
bool AgiBugFix;
bool AgiBugWizard;
bool AgiBugKnight;
bool AgiBugElf;
bool AgiBugGladiator;
bool AgiBugLord;
bool AgiBugSummon;
bool AgiBugMonk;
User gObjUser;
DWORD LastTime = 0;
// ----------------------------------------------------------------------------------------------
void User::Load()
{
ZeroMemory(&this->lpPlayer, sizeof(this->lpPlayer));
ZeroMemory(&this->lpViewPlayer, sizeof(this->lpViewPlayer));
ZeroMemory(&this->lpViewTarget, sizeof(this->lpViewTarget));
ZeroMemory(this->m_BattleZoneList, sizeof(this->m_BattleZoneList));
ZeroMemory(this->m_ResetItemCheck, sizeof(this->m_ResetItemCheck));
// ----
this->m_TargetUpdateTick = 0;
this->m_TargetType = false;
this->m_CursorX = -1;
this->m_CursorY = -1;
this->m_MapNumber = -1;
this->m_MasterLevel = 0;
this->m_MasterPoint = 0;
this->m_MasterExp = 0;
this->m_MasterNextExp = 0;
this->m_Reset = 0;
this->m_GrandReset = 0;
#ifdef __NOVUS__
this->m_TargetLifePercent = 0.0f;
this->m_CraftLevel = 0;
this->m_CraftStage = 0;
this->m_CraftQuest = 0;
ZeroMemory(this->m_CraftItemCheck, sizeof(this->m_CraftItemCheck));
#endif
// ----
//SetOp((LPVOID)oIsBattleServer_Call1, (LPVOID)this->IsBattleServer, ASM::CALL);
//SetOp((LPVOID)oIsBattleServer_Call2, (LPVOID)this->IsBattleServer, ASM::CALL);
// ----
SetOp((LPVOID)0x0047FE31, (LPVOID)this->IsBattleZone, ASM::CALL);
SetOp((LPVOID)0x0059890D, (LPVOID)this->IsBattleZone, ASM::CALL);
SetOp((LPVOID)0x0059A399, (LPVOID)this->IsBattleZone, ASM::CALL);
SetOp((LPVOID)0x0059A93C, (LPVOID)this->IsBattleZone, ASM::CALL);
SetOp((LPVOID)0x0059B13B, (LPVOID)this->IsBattleZone, ASM::CALL);
SetOp((LPVOID)0x005A4261, (LPVOID)this->IsBattleZone, ASM::CALL);
SetOp((LPVOID)0x005A4D52, (LPVOID)this->IsBattleZone, ASM::CALL);
SetOp((LPVOID)0x005B6117, (LPVOID)this->IsBattleZone, ASM::CALL);
SetOp((LPVOID)0x0065A6CE, (LPVOID)this->IsBattleZone, ASM::CALL);
SetOp((LPVOID)0x00727837, (LPVOID)this->IsBattleZone, ASM::CALL);
SetOp((LPVOID)0x007860A1, (LPVOID)this->IsBattleZone, ASM::CALL);
SetOp((LPVOID)0x007D31AA, (LPVOID)this->IsBattleZone, ASM::CALL);
SetOp((LPVOID)0x007D39BD, (LPVOID)this->IsBattleZone, ASM::CALL);
// ----
SetOp((LPVOID)0x0077F9A9, (LPVOID)this->IsMasterClass, ASM::CALL);
SetOp((LPVOID)0x0064A85F, (LPVOID)this->IsMasterClass, ASM::CALL);
SetOp((LPVOID)0x0064AC02, (LPVOID)this->IsMasterClass, ASM::CALL);
SetOp((LPVOID)0x0063DDF2, (LPVOID)this->IsMasterClass, ASM::CALL);
SetOp((LPVOID)0x0063DF89, (LPVOID)this->IsMasterClass, ASM::CALL);
SetOp((LPVOID)0x0063EA4C, (LPVOID)this->IsMasterClass, ASM::CALL);
SetOp((LPVOID)0x0064A79A, (LPVOID)this->IsMasterClass, ASM::CALL);
SetOp((LPVOID)0x0064AB3D, (LPVOID)this->IsMasterClass, ASM::CALL);
SetOp((LPVOID)0x008105CB, (LPVOID)this->IsMasterClass, ASM::CALL);
SetOp((LPVOID)0x0081064B, (LPVOID)this->IsMasterClass, ASM::CALL);
// ----
SetOp((LPVOID)0x005B96E8, (LPVOID)this->DrawSome, ASM::CALL);
//---Code danh hieu check Lv
RankHornor = GetPrivateProfileIntA("MainConfig", "Main_RankHornor", 1, ".\\Config.ini");
if (RankHornor == TRUE)
WritePrivateProfileStringA("MainConfig", "Main_RankHornor", "1", ".\\Config.ini");
else
WritePrivateProfileStringA("MainConfig", "Main_RankHornor", "0", ".\\Config.ini");
AgiBugFix = GetPrivateProfileIntA("MainConfig", "Main_AgiBugFix", 1, ".\\Config.ini");
if (AgiBugFix == TRUE) {
AgiBugWizard = TRUE;
AgiBugKnight = TRUE;
AgiBugElf = TRUE;
AgiBugGladiator = TRUE;
AgiBugLord = TRUE;
AgiBugSummon = TRUE;
AgiBugMonk = TRUE;
WritePrivateProfileStringA("MainConfig", "Main_AgiBugFix", "1", ".\\Config.ini");
}
else
WritePrivateProfileStringA("MainConfig", "Main_AgiBugFix", "0", ".\\Config.ini");
// ----End code danh hieu check Lv
#ifdef __NOVUS__
SetOp((LPVOID)0x00588511, (LPVOID)this->SetEventEffect, ASM::CALL);
#endif
}
// ----------------------------------------------------------------------------------------------
void User::Refresh()
{
this->lpPlayer = &*(ObjectCharacter*)oUserObjectStruct;
this->lpViewPlayer = &*(ObjectPreview*)oUserPreviewStruct;
this->GetTarget();
// ----
this->m_CursorX = pCursorX;
this->m_CursorY = pCursorY;
this->m_MapNumber = pMapNumber;
this->m_MasterLevel = pMasterLevel;
this->m_MasterPoint = pMasterPoint;
this->m_MasterExp = pMasterExp;
this->m_MasterNextExp = pMasterNextExp;
// ----
if ((gObjUser.lpPlayer->Class & 7) == DarkWizard)
{
if (AgiBugWizard == TRUE)
SetByte((PVOID)(0x00556C32 + 6), 2);
else
SetByte((PVOID)(0x00556C32 + 6), 15);
}
else if ((gObjUser.lpPlayer->Class & 7) == DarkKnight)
{
if (AgiBugKnight == TRUE)
SetByte((PVOID)(0x00556C32 + 6), 2);
else
SetByte((PVOID)(0x00556C32 + 6), 15);
}
else if ((gObjUser.lpPlayer->Class & 7) == Elf)
{
if (AgiBugElf == TRUE)
SetByte((PVOID)(0x00556C32 + 6), 2);
else
SetByte((PVOID)(0x00556C32 + 6), 15);
}
else if ((gObjUser.lpPlayer->Class & 7) == MagicGladiator)
{
if (AgiBugGladiator == TRUE)
SetByte((PVOID)(0x00556C32 + 6), 2);
else
SetByte((PVOID)(0x00556C32 + 6), 15);
}
else if ((gObjUser.lpPlayer->Class & 7) == DarkLord)
{
if (AgiBugLord == TRUE)
SetByte((PVOID)(0x00556C32 + 6), 2);
else
SetByte((PVOID)(0x00556C32 + 6), 15);
}
else if ((gObjUser.lpPlayer->Class & 7) == Summoner)
{
if (AgiBugSummon == TRUE)
SetByte((PVOID)(0x00556C32 + 6), 2);
else
SetByte((PVOID)(0x00556C32 + 6), 15);
}
else if ((gObjUser.lpPlayer->Class & 7) == Monk)
{
if (AgiBugMonk == TRUE)
SetByte((PVOID)(0x00556C32 + 6), 2);
else
SetByte((PVOID)(0x00556C32 + 6), 15);
}
// ----
if( gTrayMode.InTray )
{
if( !this->lpViewPlayer->m_Model.Unknown4 && gConnectEx.m_ConnectState == 0 )
{
gTrayMode.ShowMessage(NIIF_WARNING, "MU Online", "Your character has been killed");
}
}
}
// ----------------------------------------------------------------------------------------------
bool User::GetTarget()
{
if( pViewNPCTargetID != -1 )
{
this->lpViewTarget = &*(ObjectPreview*)pGetPreviewStruct(pPreviewThis(), pViewNPCTargetID);
this->m_TargetType = 1;
return true;
}
else if( pViewAttackTargetID != -1 )
{
this->lpViewTarget = &*(ObjectPreview*)pGetPreviewStruct(pPreviewThis(), pViewAttackTargetID);
this->m_TargetType = 2;
return true;
}
// ----
if( this->lpViewTarget != 0 )
{
ZeroMemory(&this->lpViewTarget, sizeof(this->lpViewTarget));
}
// ----
this->m_TargetType = 0;
return false;
}
// ----------------------------------------------------------------------------------------------
int User::GetActiveSkill()
{
return this->lpPlayer->pMagicList[this->lpViewPlayer->ActiveMagic];
}
// ----------------------------------------------------------------------------------------------
void User::UpdateCharInfo(CHAR_UPDATEINFO * aRecv)
{
this->lpPlayer->Strength = aRecv->Strength;
this->lpPlayer->Dexterity = aRecv->Dexterity;
this->lpPlayer->Vitality = aRecv->Vitality;
this->lpPlayer->Energy = aRecv->Energy;
this->lpPlayer->Leadership = aRecv->Leadership;
this->lpPlayer->LevelPoint = aRecv->LevelUpPoint;
gVisualFix.UpPoint = aRecv->LevelUpPoint;
this->lpPlayer->Level = aRecv->Level;
this->lpPlayer->Experience = aRecv->Experience;
this->lpPlayer->NextExperience = aRecv->NextExperience;
this->lpPlayer->Life = aRecv->Life;
this->lpPlayer->MaxLife = aRecv->MaxLife;
this->lpPlayer->Shield = aRecv->Shield;
this->lpPlayer->MaxShield = aRecv->MaxShield;
this->lpPlayer->Resets = aRecv->Resets; /* Object.h 258 */
gObjUser.m_Reset = aRecv->Resets;
}
// ----------------------------------------------------------------------------------------------
void User::SetBattleMapData(PMSG_BATTLE_LIST * aRecv)
{
/*
SetByte((PVOID)pMaxBattleZoneCount, MAX_BATTLE_LIST);
// ----
for( int i = 0; i < MAX_BATTLE_LIST; i++ )
{
SetByte((PVOID)((oBattleMapStart + 7 * i) + 3), aRecv->BattleMapList[i]);
}
// ----
for( int i = 0; i < MAX_BATTLE_LIST; i++ )
{
this->m_BattleZoneList[i] = aRecv->BattleZoneList[i];
}*/
}
// ----------------------------------------------------------------------------------------------
bool User::IsBattleZone(int MapNumber)
{
/*
if( gObjUser.IsBattleServer() )
{
for( int i = 0; i < MAX_BATTLE_LIST; i++ )
{
if( gObjUser.m_BattleZoneList[i] == MapNumber )
{
return true;
}
}
}
*/
// ----
return false;
}
// ----------------------------------------------------------------------------------------------
void User::SetTargetData(PMSG_TARGETDATA_ANS * aRecv)
{
if (aRecv->isMonster)
{
sMonsterBar *tempBar = NULL;
for (int i = 0; i < MonsterBar.size(); ++i)
{
if (MonsterBar[i].aIndex == aRecv->aIndex)
{
tempBar = &MonsterBar[i];
break;
}
}
if (tempBar == NULL)
{
sMonsterBar Temp;
int ID = MonsterBar.add(Temp);
tempBar = &MonsterBar[ID];
tempBar->aIndex = aRecv->aIndex;
}
PMSG_TARGET_MONSTER_DATA *pRecv = (PMSG_TARGET_MONSTER_DATA*)aRecv;
tempBar->Level = pRecv->Level;
tempBar->Life = pRecv->Life;
tempBar->MaxLife = pRecv->MaxLife;
if (tempBar->Life > tempBar->MaxLife)
tempBar->Life = tempBar->MaxLife;
tempBar->ViewID = -1;
tempBar->GetTime = GetTickCount();
}
else
{
sPlayerBar *tempBar = NULL;
for (int i = 0; i < PlayerBar.size(); ++i)
{
if (PlayerBar[i].aIndex == aRecv->aIndex)
{
tempBar = &PlayerBar[i];
break;
}
}
if (tempBar == NULL)
{
sPlayerBar Temp;
int ID = PlayerBar.add(Temp);
tempBar = &PlayerBar[ID];
tempBar->aIndex = aRecv->aIndex;
}
PMSG_TARGET_PLAYER_DATA *pRecv = (PMSG_TARGET_PLAYER_DATA*)aRecv;
tempBar->Level = pRecv->Level;
tempBar->Reset = pRecv->Resets;
tempBar->GReset = pRecv->GReset;
tempBar->ExpProc = pRecv->ExpProc;
if (tempBar->ExpProc > 100)
tempBar->ExpProc = 100;
if (tempBar->ExpProc < 0)
tempBar->ExpProc = 0;
tempBar->Life = pRecv->Life;
tempBar->MaxLife = pRecv->MaxLife;
tempBar->SD = pRecv->SD;
tempBar->MaxSD = pRecv->MaxSD;
if (tempBar->Life > tempBar->MaxLife)
tempBar->Life = tempBar->MaxLife;
if (tempBar->SD > tempBar->MaxSD)
tempBar->SD = tempBar->MaxSD;
tempBar->ViewID = -1;
tempBar->ChatShowed = false;
tempBar->GetTime = GetTickCount();
}
}
// ----------------------------------------------------------------------------------------------
void User::SetEventEffect(int PreviewStruct)
{
//SetByte((PVOID)(0x004EFF0D + 2), 3); //Min event effect number
// ----
lpViewObj lpPreview = &*(ObjectPreview*)PreviewStruct;
// ----
if( lpPreview->CtlCode == 32 )
{
if( *(DWORD*)(PreviewStruct + 672) && lpPreview->Unknown23 != 5 )
{
pInitEventStatus(PreviewStruct);
}
// ----
lpPreview->Unknown23 = 5;
}
// ----
if( *(DWORD*)(PreviewStruct + 672) != 0 || !lpPreview->Unknown23 )
{
return;
}
// ----
switch(lpPreview->Unknown23)
{
case 5: //-> GM
{
if( pEventEffectThis(668) )
{
DWORD ModelID = 349;
// ----
if( !strncmp(lpPreview->Name, "[GM]", 4) )
{
ModelID = 406;
}
else if( !strncmp(lpPreview->Name, "[EM]", 4) )
{
ModelID = 407;
}
else if( !strcmp(lpPreview->Name, "Admin") )
{
ModelID = 408;
}
// ----
*(LPVOID*)(PreviewStruct + 672) = pAddEventEffect(pEventEffectThis(668), ModelID, 20, 1, 70.0, -5.0, 0.0, 0.0, 0.0, 45.0);
}
}
break;
// --
case 6:
{
if( pEventEffectThis(668) )
{
*(LPVOID*)(PreviewStruct + 672) = pAddEventEffect2(pEventEffectThis(668), 32241, 0, 20, 120.0, 0.0, 0.0);
}
}
break;
// --
case 7:
{
if( pEventEffectThis(668) )
{
*(LPVOID*)(PreviewStruct + 672) = pAddEventEffect2(pEventEffectThis(668), 32241, 1, 20, 120.0, 0.0, 0.0);
}
}
break;
// --
case 8:
{
if( pEventEffectThis(668) )
{
*(LPVOID*)(PreviewStruct + 672) = pAddEventEffect2(pEventEffectThis(668), 32241, 2, 20, 120.0, 0.0, 0.0);
}
}
break;
// --
case 9:
{
if( pEventEffectThis(668) )
{
*(LPVOID*)(PreviewStruct + 672) = pAddEventEffect2(pEventEffectThis(668), 32241, 3, 20, 120.0, 0.0, 0.0);
}
}
break;
// --
case 10:
{
if( pEventEffectThis(668) )
{
*(LPVOID*)(PreviewStruct + 672) = pAddEventEffect2(pEventEffectThis(668), 32241, 4, 20, 120.0, 0.0, 0.0);
}
}
break;
// --
case 11:
{
if( pEventEffectThis(668) )
{
*(LPVOID*)(PreviewStruct + 672) = pAddEventEffect2(pEventEffectThis(668), 32241, 5, 20, 120.0, 0.0, 0.0);
}
}
break;
// --
case 12:
{
if( pEventEffectThis(668) )
{
*(LPVOID*)(PreviewStruct + 672) = pAddEventEffect2(pEventEffectThis(668), 32241, 6, 20, 120.0, 0.0, 0.0);
}
}
break;
// --
case 13:
{
if( pEventEffectThis(668) )
{
*(LPVOID*)(PreviewStruct + 672) = pAddEventEffect2(pEventEffectThis(668), 32241, 7, 20, 120.0, 0.0, 0.0);
}
}
break;
// --
default:
{
lpPreview->Unknown23 = 0;
}
break;
}
}
// ----------------------------------------------------------------------------------------------
bool User::IsMasterClass(BYTE Class)
{
gObjUser.Refresh();
// ----
if( pIsMaster(Class) && gObjUser.lpPlayer->Level >= 400 )
{
return true;
}
// ----
return false;
}
char* User::ParsingHP(DWORD Num)
{
char Text[50];
if (Num >= 10000000000)
sprintf(Text, "%ldkkk", Num / 1000000000);
else if (Num >= 10000000)
sprintf(Text, "%ldkk", Num / 1000000);
else if (Num >= 10000)
sprintf(Text, "%ldk", Num / 1000);
else
sprintf(Text, "%ld", Num);
return strdup(Text);
}
// ----------------------------------------------------------------------------------------------
void User::DrawSome()
{
//if (!lifebar) return;
VAngle Angle;
int PosX, PosY;
int XPos, YPos;
bool MonsterTarget = false;
bool PlayerTarget = false;
// let's have fun with comments :DDD
// first of all we check all Viewport and if server send monster/player HP it insert ViewPortID to our structure
for (int ViewPortID = 0; ViewPortID < 120; ViewPortID++)
{
lpViewObj lpObj = (ObjectPreview*)pGetPreviewStruct(pPreviewThis(), ViewPortID);
// check if it exist and it is player or monster
if (!lpObj || (lpObj->m_Model.ObjectType != emMonster && lpObj->m_Model.ObjectType != emPlayer) || !lpObj->m_Model.Unknown4)
{
// check if we have same ViewportID monster in our array and delete it
for (int i = 0; i < MonsterBar.size(); i++)
{
if (ViewPortID == MonsterBar[i].ViewID)
{
MonsterBar.remove_index_fast(i);
break;
}
}
// check if we have same ViewportID Player in our array and delete it
for (int i = 0; i < PlayerBar.size(); i++)
{
if (ViewPortID == PlayerBar[i].ViewID)
{
PlayerBar.remove_index_fast(i);
break;
}
}
continue;
}
if (lpObj->m_Model.ObjectType == emMonster)
{
// goes throw all monsterbars (that server send to us)
for (int i = 0; i < MonsterBar.size(); ++i)
{
// check if it needs to be deleted by life decrees or lifetime (too old)
if (MonsterBar[i].Life <= 0 || GetTickCount() - MonsterBar[i].GetTime > 10000)
{
MonsterBar.remove_index_fast(i--); // i--, so we could parse new item by same index in array
continue;
}
// if monster exist in array, add ViewID so we could render it later
if (MonsterBar[i].aIndex == lpObj->aIndex)
{
MonsterBar[i].ViewID = ViewPortID;
// if monster is targeted by user, make it latest in array (so it would be rendered latest and on the top of all)
if (gObjUser.m_TargetType > 0 && gObjUser.lpViewTarget != NULL && gObjUser.lpViewTarget->aIndex == lpObj->aIndex)
{
MonsterBar.make_latest(i);
MonsterTarget = true;
}
break;
}
}
}
else
{
// goes throw all playerbars (that server send to us)
for (int i = 0; i < PlayerBar.size(); ++i)
{
// check if it needs to be deleted by life decrees or lifetime (too old)
if (PlayerBar[i].Life <= 0 || GetTickCount() - PlayerBar[i].GetTime > 10000)
{
PlayerBar.remove_index_fast(i--); // i--, so we could parse new item by same index in array
continue;
}
// check if it is our player with hpbar
if (PlayerBar[i].aIndex == lpObj->aIndex)
{
PlayerBar[i].ViewID = ViewPortID;
// check player for chat window and player target
for (int j = 0; j < 120; j++)
{
// search throw all structure of chat messages (or something)
BYTE *pChatMember = (BYTE*)(pChatStructure + 700 * j);
char TName[10];
strncpy(TName, (char*)pChatMember, 10);
// if it's not our player, goes next
if (strcmp(TName, lpObj->Name))
continue;
// Check if guys is chating
if (*(DWORD*)(pChatMember + 660) > 0)
{
PlayerBar[i].ChatShowed = true;
break; // break to prevent targeting
}
else
{
PlayerBar[i].ChatShowed = false;
}
// if player target him, make it latest so we could render it on top later
if (*(DWORD*)(pChatMember + 144) > 0)
{
PlayerTarget = true;
PlayerBar.make_latest(i);
}
break;
}
break;
}
}
}
}
//-->Code danh hieu check Lv
if (RankHornor == TRUE)
{
// taking it's structure
lpViewObj lpObjVP = gObjUser.lpViewPlayer;
// to prevent that player doesn't exist
//if (lpObjVP && lpObjVP->m_Model.ObjectType != emMonster && lpObjVP->m_Model.ObjectType == emPlayer)
if (lpObjVP && lpObjVP->m_Model.ObjectType == emPlayer && lpObjVP->m_Model.ObjectType != emMonster)
{
// taking it's coordinates
Angle.X = lpObjVP->m_Model.VecPosX;
Angle.Y = lpObjVP->m_Model.VecPosY;
Angle.Z = lpObjVP->m_Model.VecPosZ + lpObjVP->m_Model.Unknown216.Z + 100.0;
pGetPosFromAngle(&Angle, &PosX, &PosY);
short pLevel = gObjUser.lpPlayer->Level;
if (pLevel >= 900)
pDrawGUI(32609, (float)PosX-48, (float)PosY - 0, 96, 12);
else if (pLevel >= 800)
pDrawGUI(32608, (float)PosX-38, (float)PosY - 0, 77, 12);
else if (pLevel >= 700)
pDrawGUI(32607, (float)PosX-48, (float)PosY - 0, 96, 16);
else if (pLevel >= 600)
pDrawGUI(32606, (float)PosX-56, (float)PosY - 0, 115, 16);
else if (pLevel >= 500)
pDrawGUI(32605, (float)PosX-52, (float)PosY - 0, 106, 16);
else if (pLevel >= 400)
pDrawGUI(32604, (float)PosX-46, (float)PosY - 0, 92, 12);
else if (pLevel >= 300)
pDrawGUI(32603, (float)PosX-52, (float)PosY - 0, 107, 16);
else if (pLevel >= 200)
pDrawGUI(32602, (float)PosX-50, (float)PosY + 0, 100, 18);
else if (pLevel >= 100)
pDrawGUI(32601, (float)PosX-40, (float)PosY + 0, 81, 16);
else
pDrawGUI(32600, (float)PosX-50, (float)PosY + 0, 99, 16);
}
}
//-->End Code danh hieu check Lv
// Render time !!!
// Take real line height for using it later
float lineHeight = 10.0f * (pWinHeightReal - 0.6f);
// monsters, so players would be always on top
for (int i = 0; i < MonsterBar.size(); ++i)
{
// check if it's not an error
if (MonsterBar[i].ViewID == -1)
continue;
// taking it's structure
lpViewObj lpObj = (ObjectPreview*)pGetPreviewStruct(pPreviewThis(), MonsterBar[i].ViewID);
// to prevent that player doesn't exist
if (!lpObj || (lpObj->m_Model.ObjectType != emMonster && lpObj->m_Model.ObjectType != emPlayer) || !lpObj->m_Model.Unknown4)
{
MonsterBar.remove_index(i--); // i--, so we could parse new item by same index in array
continue;
}
// taking it's coordinates
Angle.X = lpObj->m_Model.VecPosX;
Angle.Y = lpObj->m_Model.VecPosY;
Angle.Z = lpObj->m_Model.VecPosZ + lpObj->m_Model.Unknown216.Z + 100.0;
pGetPosFromAngle(&Angle, &PosX, &PosY);
// calculating some width and pos shit
float BarWidth = 78.1f * (MonsterBar[i].Life / (MonsterBar[i].MaxLife * 1.0f));
PosX -= 40;
// taking this bool for more easier way to use it
bool MouseOver = MonsterTarget && (i == MonsterBar.size() - 1);
// For blend fix
pSetBlend(true);
// making needed color (if it is targeting, make it fully visible, others = 100/255 blank)
DWORD Color = Color4f(255, 255, 255, 100);
//if (MouseOver)
// Color = Color4f(255, 255, 255, 255);
if (MouseOver)
{
Color = Color4f(255, 255, 255, 255);
glColor4f(0.0f, 0.0f, 0.0f, 0.40f);
pDrawBarForm((float)PosX, (float)PosY - 10, 80, 15, 0.0, 0);
// draw first line - Name
pDrawColorText(lpObj->Name, PosX, PosY - 9, 80, 1, Color, 9, 3);
// render this background and life meter
pDrawColorButton(32514, (float)PosX, (float)PosY + 1, 80, 5.0, 0, 0, Color);
pDrawColorButton(32513, (float)PosX + 1, (float)PosY + 2, BarWidth, 3.0, 0, 0, Color);
} else { }
pGLSwitchBlend();
}
// the sweetest part about players :DD
for (int i = 0; i < PlayerBar.size(); ++i)
{
// check if it's not an error or chat showed
if (PlayerBar[i].ViewID == -1 || PlayerBar[i].ChatShowed)
continue;
// taking it's structure
lpViewObj lpObj = (ObjectPreview*)pGetPreviewStruct(pPreviewThis(), PlayerBar[i].ViewID);
// to prevent that player doesn't exist
if (!lpObj || (lpObj->m_Model.ObjectType != emMonster && lpObj->m_Model.ObjectType != emPlayer) || !lpObj->m_Model.Unknown4)
{
PlayerBar.remove_index(i--); // i--, so we could parse new item by same index in array
continue;
}
// taking it's coordinates
Angle.X = lpObj->m_Model.VecPosX;
Angle.Y = lpObj->m_Model.VecPosY;
Angle.Z = lpObj->m_Model.VecPosZ + lpObj->m_Model.Unknown216.Z + 100.0;
pGetPosFromAngle(&Angle, &PosX, &PosY);
short pLevel = PlayerBar[i].Level;
// calculating some width and pos shit
float LifeBarWidth = 78.1f * (PlayerBar[i].Life / (PlayerBar[i].MaxLife * 1.0f));
PosX -= 40;
PosY += lineHeight; // taking 1 line down (with resolution fix problem) not to be collision with nickname
XPos = PosX;
YPos = PosY - 24;
// taking this bool for more easier way to use it
bool MouseOver = PlayerTarget && (i == PlayerBar.size() - 1);
// For blend fix
pSetBlend(true);
// making needed color (if it is targeting, make it fully visible, others = 150/255 blank)
DWORD Color = Color4f(255, 255, 255, 150);
if (MouseOver)
Color = Color4f(255, 255, 255, 255);
// goes throw partylist
if (pPartyMemberCount > 0)
{
// temp variable for preverting double sd bar
bool isShowed = false;
for (int PartySlot = 0; PartySlot < pPartyMemberCount; PartySlot++)
{
PartyList PartyMember = *(PartyList*)((char*)&pPartyListStruct + sizeof(PartyList)* PartySlot);
lpViewObj lpPartyObj = &*(ObjectPreview*)pGetPreviewStruct(pPreviewThis(), PartyMember.ViewportID);
// if it's not our partyman, goes to next
if (!lpPartyObj || PartyMember.ViewportID != PlayerBar[i].ViewID)
continue;
// if that guy is our target
if (MouseOver)
{
//-->Code danh hieu check Lv
if (RankHornor == TRUE)
{
if (pLevel >= 900)
pDrawGUI(32609, (float)XPos-(96-80)/2, (float)YPos - 0, 96, 12);// -48
else if (pLevel >= 800)
pDrawGUI(32608, (float)XPos-(77-80)/2, (float)YPos - 0, 77, 12);// -38
else if (pLevel >= 700)
pDrawGUI(32607, (float)XPos-(96-80)/2, (float)YPos - 0, 96, 16);// -48
else if (pLevel >= 600)
pDrawGUI(32606, (float)XPos-(115-80)/2, (float)YPos - 0, 115, 16);// -56
else if (pLevel >= 500)
pDrawGUI(32605, (float)XPos-(106-80)/2, (float)YPos - 0, 106, 16);// -52
else if (pLevel >= 400)
pDrawGUI(32604, (float)XPos-(92-80)/2, (float)YPos - 0, 92, 12);// -46
else if (pLevel >= 300)
pDrawGUI(32603, (float)XPos-(107-80)/2, (float)YPos - 0, 107, 16);// -52
else if (pLevel >= 200)
pDrawGUI(32602, (float)XPos-(100-80)/2, (float)YPos + 0, 100, 18);// -50
else if (pLevel >= 100)
pDrawGUI(32601, (float)XPos-(81-80)/2, (float)YPos + 0, 81, 16);// -40
else
pDrawGUI(32600, (float)XPos-(99-80)/2, (float)YPos + 0, 99, 16);// -50
}
//-->End Code danh hieu check Lv
glColor3f(1.0, 1.0, 1.0);
// draw background and some extra info
glColor4f(0.0f, 0.5f, 0.0f, 0.65f);
pDrawBarForm((float)PosX, (float)PosY - 10, 80, 15, 0.0, 0);
char Text[50];
sprintf(Text, "HP %s, Rs %d", ParsingHP(PlayerBar[i].MaxLife), PlayerBar[i].Reset);
pDrawColorText(Text, PosX, PosY - 9, 80, 1, eWhite, 9, 3);
// Shows expbar insteed of SD
// doesn't use Color, cos it's target and shows fully visible
glColor3f(0.39f, 0.66f, 1.0f);
float ExpBarWidth = 78.1f * PlayerBar[i].ExpProc / 100.0f;
pDrawGUI(32514, (float)PosX, (float)PosY + 1, 80, 5.0);
pDrawGUI(32515, (float)PosX + 1, (float)PosY + 2, ExpBarWidth, 3.0);
}
else
{
// if it's not our target but in party
// shows sd with some info
// with 190/255 blank visible
Color = Color4f(255, 255, 255, 190);
// draw background and extra stuff
glColor4f(0.0f, 0.5f, 0.0f, 0.45f);
pDrawBarForm((float)PosX, (float)PosY - 10, 80, 15, 0.0, 0);
//pDrawColorText(lpObj->Name, PosX, PosY - 14, 80, 1, Color, 9, 3);
char Text[50];
sprintf(Text, "%s - Lv %d", lpObj->Name, PlayerBar[i].Level);
pDrawColorText(Text, PosX, PosY - 9, 80, 1, Color, 9, 3);
float SDBarWidth = 78.1f * (PlayerBar[i].SD / (PlayerBar[i].MaxSD * 1.0f));
pDrawColorButton(32514, (float)PosX, (float)PosY + 1, 80, 5.0, 0, 0, Color);
pDrawColorButton(32515, (float)PosX + 1, (float)PosY + 2, SDBarWidth, 3.0, 0, 0, Color);
}
// if we get's here, so we showed up all that we want
isShowed = true;
break;
}
// and we just leave from this player to next
if (isShowed)
continue;
}
// if we get's here, so this is not partyman
// and we just shows sd, and if targeting - some extra info
if (MouseOver)
{
if (RankHornor == TRUE)
{
if (pLevel >= 900)
pDrawGUI(32609, (float)XPos-(96-80)/2, (float)YPos - 0, 96, 12);// -48
else if (pLevel >= 800)
pDrawGUI(32608, (float)XPos-(77-80)/2, (float)YPos - 0, 77, 12);// -38
else if (pLevel >= 700)
pDrawGUI(32607, (float)XPos-(96-80)/2, (float)YPos - 0, 96, 16);// -48
else if (pLevel >= 600)
pDrawGUI(32606, (float)XPos-(115-80)/2, (float)YPos - 0, 115, 16);// -56
else if (pLevel >= 500)
pDrawGUI(32605, (float)XPos-(106-80)/2, (float)YPos - 0, 106, 16);// -52
else if (pLevel >= 400)
pDrawGUI(32604, (float)XPos-(92-80)/2, (float)YPos - 0, 92, 12);// -46
else if (pLevel >= 300)
pDrawGUI(32603, (float)XPos-(107-80)/2, (float)YPos - 0, 107, 16);// -52
else if (pLevel >= 200)
pDrawGUI(32602, (float)XPos-(100-80)/2, (float)YPos + 0, 100, 18);// -50
else if (pLevel >= 100)
pDrawGUI(32601, (float)XPos-(81-80)/2, (float)YPos + 0, 81, 16);// -40
else
pDrawGUI(32600, (float)XPos-(99-80)/2, (float)YPos + 0, 99, 16);// -50
}
// draw background and name
glColor4f(0.0f, 0.0f, 0.0f, 0.58f);
pDrawBarForm((float)PosX, (float)PosY - 9, 80, 21, 0.0, 0);
//pDrawColorText(lpObj->Name, PosX, PosY - 9, 80, 1, Color, 9, 3);
char Text[50];
sprintf(Text, "Lv %d, Rs %d", PlayerBar[i].Level, PlayerBar[i].Reset);
pDrawColorText(Text, PosX, PosY - 8, 80, 1, Color, 9, 3);
// render this background and life meter
pDrawColorButton(32514, (float)PosX, (float)PosY + 3, 80, 4.0, 0, 0, Color);
pDrawColorButton(32514, (float)PosX, (float)PosY + 7, 80, 4.0, 0, 0, Color);
float SDBarWidth = 78.1f * (PlayerBar[i].SD / (PlayerBar[i].MaxSD * 1.0f));
pDrawColorButton(32513, (float)PosX + 1, (float)PosY + 4, LifeBarWidth, 3.0, 0, 0, Color);
pDrawColorButton(32515, (float)PosX + 1, (float)PosY + 8, SDBarWidth, 3.0, 0, 0, Color);
} else { }
pGLSwitchBlend(); // for blend objects
}
pGLSwitchBlend(); // for blend objects
glColor3f(1.0, 1.0, 1.0);
}
Khách viếng thăm hãy cùng nampinn xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!
-
04-09-16, 08:58 PM #463
- Ngày tham gia
- Jul 2015
- Bài viết
- 190
- Thanks
- 44
- Thanked 21 Times in 16 Posts
Ðề: Học Hỏi Source zTeam HoanMaster
Khách viếng thăm hãy cùng viethung91 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!
-
04-09-16, 09:12 PM #464
Ðề: Học Hỏi Source zTeam HoanMaster
Đoạn này à cậu?
PHP Code:(pLevel >= 100)
PHP Code:(pResets >= 100)
Thay như vậy rồi mà không được?
1>User.cpp(858): error C2065: 'pResets' : undeclared identifier
1>User.cpp(852): error C2065: 'pResets' : undeclared identifier
1>User.cpp(854): error C2065: 'pResets' : undeclared identifier
1>User.cpp(856): error C2065: 'pResets' : undeclared identifier
1>User.cpp(858): error C2065: 'pResets' : undeclared identifier
1>User.cpp(923): error C2065: 'pResets' : undeclared identifier
1>User.cpp(925): error C2065: 'pResets' : undeclared identifier
1>User.cpp(927): error C2065: 'pResets' : undeclared identifier
1>User.cpp(929): error C2065: 'pResets' : undeclared identifier
1>User.cpp(931): error C2065: 'pResets' : undeclared identifierLần sửa cuối bởi nampinn, ngày 04-09-16 lúc 09:37 PM.
Khách viếng thăm hãy cùng nampinn xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!
-
04-09-16, 09:47 PM #465
- Ngày tham gia
- Mar 2013
- Bài viết
- 217
- Thanks
- 81
- Thanked 27 Times in 14 Posts
Ðề: Topic Phân Tích Học Hỏi Source zTeam Và Source HoanMaster Share
Khách viếng thăm hãy cùng khainqps01237 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!
-
05-09-16, 12:38 AM #466
Ðề: Học Hỏi Source zTeam HoanMaster
tải source của ikennylee về có nhiều cái để vọc hơn đó
Server SCF Full Customs Wing, HP, SD, Antihack, Post Item, Fix Bug.......
Skype: hoangtu_eck94
-
05-09-16, 07:34 AM #467
Ðề: Học Hỏi Source zTeam HoanMaster
Khách viếng thăm hãy cùng nampinn xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!
-
05-09-16, 08:37 AM #468
- Ngày tham gia
- Mar 2013
- Bài viết
- 217
- Thanks
- 81
- Thanked 27 Times in 14 Posts
Ðề: Học Hỏi Source zTeam HoanMaster
Khách viếng thăm hãy cùng khainqps01237 xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!
-
05-09-16, 11:21 AM #469
-
05-09-16, 11:22 AM #470
- Ngày tham gia
- Jul 2015
- Bài viết
- 175
- Thanks
- 40
- Thanked 10 Times in 10 Posts
Ðề: Học Hỏi Source zTeam HoanMaster
Khách viếng thăm hãy cùng blockcc xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!
Các Chủ đề tương tự
-
[MU] zTeam source load hình ảnh
Bởi herovn1994 trong diễn đàn Hỏi Đáp/ Yêu CầuTrả lời: 9Bài viết cuối: 10-02-16, 06:24 AM -
[MU] Hỏi về source zteam
Bởi herovn1994 trong diễn đàn Hỏi Đáp/ Yêu CầuTrả lời: 14Bài viết cuối: 18-12-15, 06:22 PM