Advertisement
Guest User

Untitled

a guest
Oct 16th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. void __stdcall SkillIconDelayDraw2(CellContext *context, int x, int y, int dwl, int nTransLvl, BYTE Color)
  2. {
  3. D2GFX_DrawCellContextEx(context, x, y, dwl, nTransLvl, Color); //#10019
  4.  
  5. UnitAny *pUnit = *D2CLIENT_PlayerUnit;
  6. Skill *pSkill = NULL;
  7. D2ASSERT(pSkill, "!pSkill");
  8. D2ASSERT(pUnit, "!pUnit");
  9.  
  10. if (D2COMMON_GetLeftSkill(pUnit))
  11. {
  12. pSkill = D2COMMON_GetLeftSkill(pUnit);
  13. LABEL_1:
  14. goto LABEL_2;
  15. }
  16.  
  17. if (D2COMMON_GetRightSkill(pUnit))
  18. {
  19. pSkill = D2COMMON_GetRightSkill(pUnit);
  20. goto LABEL_1;
  21. }
  22.  
  23. LABEL_2:
  24. if (pUnit->dwType == UNIT_TYPE_PLAYER && pSkill)
  25. {
  26. DWORD GameFrame = *D2CLIENT_gdwClientGameFrame;
  27. DWORD dwEndFrame = pUnit->pSkillDelays[pSkill->pSkillsTxt->wSkillId];
  28.  
  29. if (dwEndFrame > GameFrame)
  30. {
  31. BYTE iRes = CalcPercent(dwEndFrame - GameFrame, dwMaxFrame, 0);
  32. D2GFX_DrawRectangle(x, y - 48, x + (iRes >> 1) - 2, y, 0, 2);
  33. wchar_t text[256];
  34. _snwprintf(text, sizeof(text), L"%d", ((dwEndFrame - GameFrame) / 25) + 1);
  35. D2WIN_DrawText(text, x, y, COL_ORANGE, 0);
  36. }
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement