Advertisement
Guest User

Untitled

a guest
May 1st, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //ZGame.cpp
  2. case MC_BOSSHP:
  3.     {
  4.         int BossHP;
  5.         MUID BossUID;
  6.         pCommand->GetParameter(&BossHP, 0, MPT_INT);
  7.         pCommand->GetParameter(&BossUID, 1, MPT_UID);
  8.  
  9.         ZCharacter* pBoss = ZGetCharacterManager()->Find(ZGetGameInterface()->GetGameClient()->GetMatchStageSetting()->GetMasterUID());
  10.  
  11.         if (pBoss == NULL)
  12.         {
  13.             mlog("Boss não encontrado.");
  14.             break;
  15.         }
  16.  
  17.         try
  18.         {
  19.             pBoss->GetStatus().CheckCrc();
  20.             pBoss->GetStatus().Ref().nBossHP = pBoss->GetHP();
  21.             pBoss->GetStatus().MakeCrc();
  22.         }
  23.         catch (...)
  24.         {
  25.             mlog("Exceção imprevista");
  26.         }
  27.     }
  28.     break;
  29.  
  30. //MMatchServer_OnCommand.cpp
  31. case MC_BOSSHP:
  32.         {
  33.             int BossHP;
  34.             MUID BossUID;
  35.  
  36.             MCommand* pCmd = CreateCommand(MC_BOSSHP, MUID(0, 0));
  37.             MMatchObject* pObj = GetObjectA(pCommand->GetSenderUID());
  38.  
  39.             pCmd->AddParameter(new MCmdParamInt(BossHP));
  40.             pCmd->AddParameter(new MCmdParamUID(BossUID));
  41.  
  42.             RouteToBattle(pObj->GetStageUID(), pCmd);
  43.         }
  44.         break;
  45.  
  46.  
  47.  
  48. #define MC_BOSSHP                                   602003
  49.  
  50. C(MC_BOSSHP, "boss.hp", "boss hp information", MCDT_PEER2PEER)
  51.         P(MPT_INT, "BossHP");
  52.         P(MPT_UID, "BossUID");
  53.  
  54.  
  55. //ZCharacter.h
  56.  
  57. int         nBossHP;
  58.  
  59. nBossHP(0),
  60.  
  61.  
  62.  
  63. //ZCombatInterface
  64.  
  65. ZCharacter* pBoss = ZGetCharacterManager()->Find(ZGetGameInterface()->GetGameClient()->GetMatchStageSetting()->GetMasterUID());
  66.  
  67.                 int hp = pBoss->GetStatus().Ref().nBossHP;
  68.  
  69.                 if (!pBoss->IsDie())
  70.                 {
  71.                     float Width = 90.f, HeightMod = 85.f;
  72.                     HpApBarRelative(pDC, Width / 400.f, (HeightMod + 487.f) / 600.f, hp, hp, MCOLOR(0xFFFF0000), 10);
  73.  
  74.                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement