Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.24 KB | None | 0 0
  1. void DrawPlayerPercents() {
  2.         UnitAny *pPlayer = D2CLIENT_GetPlayerUnit();
  3.     for(Room1* pRoom = pPlayer->pAct->pRoom1; pRoom; pRoom = pRoom->next)
  4.         {
  5.         for(UnitAny* pUnit = pRoom->pUnitFirst; pUnit; pUnit = pUnit->pListNext)
  6.                     {
  7.         //Draw lines
  8.     POINT Start, End;
  9.     Start.x=GetPlayerCoords().x;
  10.     Start.y=GetPlayerCoords().y;
  11.     POINT StartCalc, EndCalc;
  12.     MapToScreenCoords(Start);
  13.     ScreenToAutomapRelative(&StartCalc,Start.x,Start.y);
  14.         if(pUnit->dwType == UNIT_PLAYER) {
  15.             if(pUnit->dwMode == PLAYER_MODE_WALK_OUTTOWN || pUnit->dwMode == PLAYER_MODE_RUN || pUnit->dwMode == PLAYER_MODE_SEQUENCE) {
  16.     End.x=pUnit->pPath->xTarget;
  17.     End.y=pUnit->pPath->yTarget;
  18.     MapToScreenCoords(End);
  19.     ScreenToAutomapRelative(&EndCalc,End.x,End.y);
  20.     if(GetDistance(Myself->pPath->xPos, Myself->pPath->yPos, pUnit->pPath->xPos, pUnit->pPath->yPos) < 200)
  21.     D2GFX_DrawLine(StartCalc.x,StartCalc.y,EndCalc.x,EndCalc.y,11,0xff);
  22.               }
  23.               }
  24.                         if(pUnit)
  25.                             if(pUnit->dwType == UNIT_PLAYER)
  26.                                 if(pUnit->dwUnitId != Myself->dwUnitId) {
  27.                             RosterUnit *pRoster = FindPartyById(pUnit->dwUnitId);
  28.                             if(!pRoster)
  29.                                 return;
  30.         TextHook(pUnit->pPath->xPos, pUnit->pPath->yPos, 4, true, 4, 5, "%d%%", pRoster->dwPartyLife);
  31.                                 }
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement