please help to understand

Results 1 to 4 of 4
  1. #1
    Proficient Member pravednik is offline
    MemberRank
    Feb 2014 Join Date
    179Posts

    sad please help to understand

    Hi all ! Guys please help to understand what's wrong I'm trying to add a HP Bar to the server zTeam season 6. It is displayed but the problem is that when I kill a monster the strip is reduced and in the other is not only the one I hit. What could be the problem ?
    Here's the code:
    //SetOp((LPVOID)0x005B96E8, (LPVOID)this->DrawPartyHP, ASM::CALL);
    SetOp((LPVOID)0x005B96E8, (LPVOID)this->DrawSome, ASM::CALL);
    // ----------------------------------------------------------------------------------------------
    void User::DrawPartyHP()
    {
    char LifeDisplay[20];
    VAngle Angle;
    int PosX, PosY, LifeProgress;
    for( int PartySlot = 0; PartySlot < 10; PartySlot++ )
    {

    PartyList PartyMember = *(PartyList*)((char*)&pPartyListStruct + 10 * PartySlot);
    lpViewObj lpPartyObj = &*(ObjectPreview*)pGetPreviewStruct(pPreviewThis(), PartyMember.ViewportID);

    lpViewObj lpObj = gObjUser.lpViewTarget;
    // ----
    if( !lpObj || lpObj->m_Model.ObjectType != emMonster || !lpObj->m_Model.Unknown4 )
    {
    return;
    }
    // ----
    float LifeBarWidth = 65.0f;
    // ----
    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);
    PosX -= (int)floor(LifeBarWidth / (double)2.0);
    // ----
    if( gObjUser.m_TargetLifePercent <= 0.0f )
    {
    return;
    }
    // ----
    float BarWidth = (64.5f / 100.0f) * gObjUser.m_TargetLifePercent;
    pDrawText(pTextThis(), PosX-1, PosY - 9, " ", 67, 0, (LPINT)0, 0);
    pDrawText(pTextThis(), PosX+0.5*(66.95-(4.35*float(strlen( lpObj->Name)))), PosY - 9, lpObj->Name, 0, 0, (LPINT)0, 0);
    pDrawGUI(0x7B3F, (float)PosX - 1.2, (float)PosY - 1.5, 66.95, 6);
    pDrawGUI(0x7B40, (float)PosX, (float)PosY, BarWidth, 3);
    // ----
    pGLSwitch();
    }
    pGLSwitch();
    glColor3f(1.0, 1.0, 1.0);
    }
    // ----------------------------------------------------------------------------------------------
    void User::DrawSome(){
    VAngle Angle;
    int PosX, PosY, LifeProgress;
    // ----
    {
    for( int PartySlot = 0; PartySlot < 75; PartySlot++ )
    {
    lpViewObj lpObj = &*(ObjectPreview*)pGetPreviewStruct(pPreviewThis(), PartySlot);
    DWORD CurrentTick = GetTickCount();
    DWORD Delay = (CurrentTick - gObjUser.m_TargetUpdateTick);
    // ----
    if( !lpObj || lpObj->m_Model.ObjectType != emMonster || !lpObj->m_Model.Unknown4 )
    {
    continue;
    }
    // ----
    PMSG_TARGETDATA_REQ pRequest;
    pRequest.h.set((LPBYTE)&pRequest, 0xFB, 7, sizeof(pRequest));
    pRequest.aIndex = lpObj->aIndex;
    // ----
    if( Delay >= 10 )
    {
    gProtocol.DataSend((LPBYTE)&pRequest, pRequest.h.size);
    }
    // ----
    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;
    // ----
    float BarWidth = (64.5f / 100.0f) *gObjUser.m_TargetLifePercent;
    float LifeBarWidth = 65.0f;
    // ----
    pGetPosFromAngle(&Angle, &PosX, &PosY);
    PosX -= (int)floor(LifeBarWidth / (double)2.0);
    // ----
    if(gObjUser.m_TargetLifePercent <= 0.1f)
    {
    continue;
    }
    // ----
    pDrawColorText(lpObj->Name, PosX -1, PosY - 9, 67, 1, eWhite, 9, 3);
    // ----
    pDrawGUI(0x7B3F, (float)PosX - 1.2, (float)PosY - 1.5, 66.95, 6);
    pDrawGUI(0x7B40, (float)PosX, (float)PosY, BarWidth, 3);
    // ----
    if( (int)(gObjUser.m_TargetLifePercent / 10) > 10 )
    {
    LifeProgress = 10;
    }
    else
    {
    LifeProgress = (int)(gObjUser.m_TargetLifePercent / 10);
    }
    // ----
    pGLSwitch();
    }
    pGLSwitch();
    glColor3f(1.0, 1.0, 1.0);
    }
    }
    Or something else ?
    Thanks in advance for your help.


  2. #2
    Don't be afraid to ask! RevolGaming is offline
    MemberRank
    Jun 2012 Join Date
    1,458Posts

    Re: please help to understand

    I am sure its fixed / recoded in another source, find the latest source on RZ than merge to code with code compare.

  3. #3
    (づ。◕‿‿◕。) Natzugen is offline
    MemberRank
    Jun 2014 Join Date
    ElbelandLocation
    1,858Posts

    Re: please help to understand

    you also need to edit server side

  4. #4
    Alpha Member ianvalls90 is offline
    MemberRank
    Apr 2007 Join Date
    ArgentinaLocation
    1,829Posts

    Re: please help to understand

    Its probably only updating the hp of the mob you hover, it was fixed on some zT source as @ReVol stated. Otherwise rewrite the function server side so it updates all the mobs within FOV (field of view).

    Enviado desde mi SM-G531M mediante Tapatalk



Advertisement