Advertisement
Guest User

Untitled

a guest
Jun 27th, 2020
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.66 KB | None | 0 0
  1. ALL CREDITS TO ONESHOT FROM XTIBIA https://www.xtibia.com/forum/topic/190356-op%C3%A7%C3%A3o-manager-no-vocationsxml/
  2. Em vocations.h, procure por:
  3.  
  4.  
  5.  
  6. bool attackable, needPremium;
  7.  
  8.  
  9. Substitua:
  10.  
  11.  
  12.  
  13. bool attackable, needPremium, manager;
  14.  
  15.  
  16. Procure por:
  17.  
  18.  
  19.  
  20. bool isPremiumNeeded() const {return needPremium;}
  21. void setNeedPremium(bool v) {needPremium = v;}
  22.  
  23.  
  24. Adicione logo abaixo:
  25.  
  26.  
  27.  
  28. bool isManagerOption() const {return manager;}
  29. void setAsManagerOption(bool v) {manager = v;}
  30.  
  31.  
  32. Agora em vocations.cpp, procure por:
  33.  
  34.  
  35.  
  36. if(readXMLString(p, "needpremium", strValue))
  37. voc->setNeedPremium(booleanString(strValue));
  38.  
  39.  
  40. Logo abaixo adicione:
  41.  
  42.  
  43.  
  44. if(readXMLString(p, "accountmanager", strValue) || readXMLString(p, "manager", strValue))
  45. voc->setAsManagerOption(booleanString(strValue));
  46.  
  47.  
  48. Procure por:
  49.  
  50.  
  51.  
  52. needPremium = false;
  53.  
  54.  
  55. Adicione logo abaixo:
  56.  
  57.  
  58.  
  59. manager = true;
  60.  
  61.  
  62. E finalmente em player.cpp, procure por:
  63.  
  64.  
  65.  
  66. if(it->first == it->second->getFromVocation() && it->first != 0)
  67.  
  68.  
  69. Substitua por:
  70.  
  71.  
  72.  
  73. if(it->first == it->second->getFromVocation() && it->first != 0 && it->second->isManagerOption() == true)
  74.  
  75.  
  76. Logo abaixo, procure por:
  77.  
  78.  
  79.  
  80. if(checkText(text, tmp) && it != Vocations::getInstance()->getLastVocation() && it->first == it->second->getFromVocation() && it->first != 0)
  81.  
  82.  
  83. Substitua por:
  84.  
  85.  
  86.  
  87. if(checkText(text, tmp) && it != Vocations::getInstance()->getLastVocation() && it->first == it->second->getFromVocation() && it->first != 0 && it->second->isManagerOption() == true)
  88.  
  89.  
  90. Compile e teste.
  91.  
  92. on vocations.xml you need to add manager="0" to disable a vocation or manager="1" to enable it
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement