Guest User

Untitled

a guest
Jun 21st, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. int32_t LuaInterface::luaDoChallengePlayer(lua_State* L)
  2. {
  3. //doChallengePlayer(cid, target)
  4. ScriptEnviroment* env = getEnv();
  5. uint32_t targetCid = popNumber(L);
  6.  
  7. Creature* creature = env->getCreatureByUID(popNumber(L));
  8. if(!creature)
  9. {
  10. errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND));
  11. lua_pushboolean(L, false);
  12. return 1;
  13. }
  14.  
  15. Creature* target = env->getCreatureByUID(targetCid);
  16. if(!target)
  17. {
  18. errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND));
  19. lua_pushboolean(L, false);
  20. return 1;
  21. }
  22.  
  23. target->challengeplayer(creature);
  24. lua_pushboolean(L, true);
  25. return 1;
  26. }
Add Comment
Please, Sign In to add comment