Skip to content

Instantly share code, notes, and snippets.

@dalvorsn
Created September 11, 2015 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dalvorsn/181968ae477debd90d2d to your computer and use it in GitHub Desktop.
Save dalvorsn/181968ae477debd90d2d to your computer and use it in GitHub Desktop.
int32_t LuaScriptInterface::luaGetCreatureName(lua_State* L) {
//getCreatureName(cid)
ScriptEnviroment* env = getEnv();
if(Creature* creature = env->getCreatureByUID(popNumber(L))) {
if(Monster* monster = creature->getMonster())
lua_pushstring(L, monster->getMonsterType()->name.c_str() );
else
lua_pushstring(L, creature->getName().c_str());
} else {
errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND));
lua_pushboolean(L, false);
}
return 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment