SHARE
TWEET

Untitled

a guest Jun 18th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Search for:
  2. PyObject * nonplayerLoadNonPlayerData(PyObject * poSelf, PyObject * poArgs)
  3.  
  4. // Add (Under & Whole function):
  5. #ifdef ENABLE_SEND_TARGET_INFO
  6. PyObject * nonplayerGetMonsterMaxHP(PyObject * poSelf, PyObject * poArgs)
  7. {
  8.     int race;
  9.     if (!PyTuple_GetInteger(poArgs, 0, &race))
  10.         return Py_BuildException();
  11.  
  12.     CPythonNonPlayer& rkNonPlayer=CPythonNonPlayer::Instance();
  13.  
  14.     return Py_BuildValue("i", rkNonPlayer.GetMonsterMaxHP(race));
  15. }
  16.  
  17. PyObject * nonplayerGetRaceNumByVID(PyObject * poSelf, PyObject * poArgs)
  18. {
  19.     int iVirtualID;
  20.     if (!PyTuple_GetInteger(poArgs, 0, &iVirtualID))
  21.         return Py_BuildException();
  22.  
  23.     CInstanceBase * pInstance = CPythonCharacterManager::Instance().GetInstancePtr(iVirtualID);
  24.  
  25.     if (!pInstance)
  26.         return Py_BuildValue("i", -1);
  27.  
  28.     const CPythonNonPlayer::TMobTable * pMobTable = CPythonNonPlayer::Instance().GetTable(pInstance->GetVirtualNumber());
  29.  
  30.     if (!pMobTable)
  31.         return Py_BuildValue("i", -1);
  32.  
  33.     return Py_BuildValue("i", pMobTable->dwVnum);
  34. }
  35.  
  36. PyObject * nonplayerGetMonsterRaceFlag(PyObject * poSelf, PyObject * poArgs)
  37. {
  38.     int race;
  39.     if (!PyTuple_GetInteger(poArgs, 0, &race))
  40.         return Py_BuildException();
  41.  
  42.     CPythonNonPlayer& rkNonPlayer=CPythonNonPlayer::Instance();
  43.  
  44.     return Py_BuildValue("i", rkNonPlayer.GetMonsterRaceFlag(race));
  45. }
  46.  
  47. PyObject * nonplayerGetMonsterLevel(PyObject * poSelf, PyObject * poArgs)
  48. {
  49.     int race;
  50.     if (!PyTuple_GetInteger(poArgs, 0, &race))
  51.         return Py_BuildException();
  52.  
  53.     CPythonNonPlayer& rkNonPlayer=CPythonNonPlayer::Instance();
  54.  
  55.     return Py_BuildValue("i", rkNonPlayer.GetMonsterLevel(race));
  56. }
  57.  
  58. PyObject * nonplayerGetMonsterDamage(PyObject * poSelf, PyObject * poArgs)
  59. {
  60.     int race;
  61.     if (!PyTuple_GetInteger(poArgs, 0, &race))
  62.         return Py_BuildException();
  63.  
  64.     CPythonNonPlayer& rkNonPlayer=CPythonNonPlayer::Instance();
  65.  
  66.     DWORD dmg1 = rkNonPlayer.GetMonsterDamage1(race);
  67.     DWORD dmg2 = rkNonPlayer.GetMonsterDamage2(race);
  68.  
  69.     return Py_BuildValue("ii", dmg1,dmg2);
  70. }
  71.  
  72. PyObject * nonplayerGetMonsterExp(PyObject * poSelf, PyObject * poArgs)
  73. {
  74.     int race;
  75.     if (!PyTuple_GetInteger(poArgs, 0, &race))
  76.         return Py_BuildException();
  77.  
  78.     CPythonNonPlayer& rkNonPlayer=CPythonNonPlayer::Instance();
  79.  
  80.     return Py_BuildValue("i", rkNonPlayer.GetMonsterExp(race));
  81. }
  82.  
  83. PyObject * nonplayerGetMonsterDamageMultiply(PyObject * poSelf, PyObject * poArgs)
  84. {
  85.     int race;
  86.     if (!PyTuple_GetInteger(poArgs, 0, &race))
  87.         return Py_BuildException();
  88.  
  89.     CPythonNonPlayer& rkNonPlayer=CPythonNonPlayer::Instance();
  90.  
  91.     return Py_BuildValue("f", rkNonPlayer.GetMonsterDamageMultiply(race));
  92. }
  93.  
  94. PyObject * nonplayerGetMonsterST(PyObject * poSelf, PyObject * poArgs)
  95. {
  96.     int race;
  97.     if (!PyTuple_GetInteger(poArgs, 0, &race))
  98.         return Py_BuildException();
  99.  
  100.     CPythonNonPlayer& rkNonPlayer=CPythonNonPlayer::Instance();
  101.  
  102.     return Py_BuildValue("i", rkNonPlayer.GetMonsterST(race));
  103. }
  104.  
  105. PyObject * nonplayerGetMonsterDX(PyObject * poSelf, PyObject * poArgs)
  106. {
  107.     int race;
  108.     if (!PyTuple_GetInteger(poArgs, 0, &race))
  109.         return Py_BuildException();
  110.  
  111.     CPythonNonPlayer& rkNonPlayer=CPythonNonPlayer::Instance();
  112.  
  113.     return Py_BuildValue("i", rkNonPlayer.GetMonsterDX(race));
  114. }
  115.  
  116. PyObject * nonplayerIsMonsterStone(PyObject * poSelf, PyObject * poArgs)
  117. {
  118.     int race;
  119.     if (!PyTuple_GetInteger(poArgs, 0, &race))
  120.         return Py_BuildException();
  121.  
  122.     CPythonNonPlayer& rkNonPlayer = CPythonNonPlayer::Instance();
  123.  
  124.     return Py_BuildValue("i", rkNonPlayer.IsMonsterStone(race) ? 1 : 0);
  125. }
  126. #endif
  127.  
  128. // Search for:
  129.         { "GetMonsterName",             nonplayerGetMonsterName,            METH_VARARGS },
  130.  
  131. // Add (Under):
  132. #ifdef ENABLE_SEND_TARGET_INFO
  133.         // TARGET_INFO
  134.         { "GetRaceNumByVID",            nonplayerGetRaceNumByVID,           METH_VARARGS },
  135.         { "GetMonsterMaxHP",            nonplayerGetMonsterMaxHP,           METH_VARARGS },
  136.         { "GetMonsterRaceFlag",         nonplayerGetMonsterRaceFlag,        METH_VARARGS },
  137.         { "GetMonsterLevel",            nonplayerGetMonsterLevel,           METH_VARARGS },
  138.         { "GetMonsterDamage",           nonplayerGetMonsterDamage,          METH_VARARGS },
  139.         { "GetMonsterExp",              nonplayerGetMonsterExp,             METH_VARARGS },
  140.         { "GetMonsterDamageMultiply",   nonplayerGetMonsterDamageMultiply,  METH_VARARGS },
  141.         { "GetMonsterST",               nonplayerGetMonsterST,              METH_VARARGS },
  142.         { "GetMonsterDX",               nonplayerGetMonsterDX,              METH_VARARGS },
  143.         { "IsMonsterStone",             nonplayerIsMonsterStone,            METH_VARARGS },
  144. #endif
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top