Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int32_t LuaInterface::luaDoChallengePlayer(lua_State* L)
- {
- //doChallengePlayer(cid, target)
- ScriptEnviroment* env = getEnv();
- uint32_t targetCid = popNumber(L);
- Creature* creature = env->getCreatureByUID(popNumber(L));
- if(!creature)
- {
- errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND));
- lua_pushboolean(L, false);
- return 1;
- }
- Creature* target = env->getCreatureByUID(targetCid);
- if(!target)
- {
- errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND));
- lua_pushboolean(L, false);
- return 1;
- }
- target->challengeplayer(creature);
- lua_pushboolean(L, true);
- return 1;
- }
Add Comment
Please, Sign In to add comment