Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. int affect_add_new(lua_State * L){
  2. if (!lua_isnumber(L, 1) || !lua_isnumber(L, 2) || !lua_isnumber(L, 3))
  3. {
  4. sys_err("invalid argument");
  5. return 0;
  6. }
  7. CQuestManager & q = CQuestManager::instance();
  8. LPCHARACTER ch = q.GetCurrentCharacterPtr();
  9. int lp = lua_tonumber(L, 1);
  10. int bonus = lua_tonumber(L, 2);
  11. if (bonus >= MAX_APPLY_NUM || bonus < 1)
  12. {
  13. sys_err("apply is out of range : %d", bonus);
  14. return 0;
  15. }
  16. int value = lua_tonumber(L, 3);
  17. ch->AddAffect(lp, aApplyInfo[bonus].bPointType, value, 0, 91536000, 0, false);
  18. return 0;
  19. }
  20.  
  21. int affect_remove_new(lua_State * L)
  22. {
  23. if (!lua_isnumber(L, 1))
  24. {
  25. sys_err("invalid argument");
  26. return 0;
  27. }
  28.  
  29. CQuestManager & q = CQuestManager::instance();
  30. LPCHARACTER ch = q.GetCurrentCharacterPtr();
  31. int lp = lua_tonumber(L, 1);
  32.  
  33. ch->RemoveAffect(lp);
  34.  
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement