本文整理汇总了C++中Npc::setCreatureFocus方法的典型用法代码示例。如果您正苦于以下问题:C++ Npc::setCreatureFocus方法的具体用法?C++ Npc::setCreatureFocus怎么用?C++ Npc::setCreatureFocus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Npc
的用法示例。
在下文中一共展示了Npc::setCreatureFocus方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: luaSetNpcFocus
int NpcScriptInterface::luaSetNpcFocus(lua_State* L)
{
//doNpcSetCreatureFocus(cid)
Npc* npc = getScriptEnv()->getNpc();
if (npc) {
npc->setCreatureFocus(getCreature(L, -1));
}
return 0;
}
示例2: luaSetNpcFocus
int32_t NpcScriptInterface::luaSetNpcFocus(lua_State* L)
{
//doNpcSetCreatureFocus(cid)
Npc* npc = getScriptEnv()->getNpc();
if (npc) {
npc->setCreatureFocus(g_game.getCreatureByID(popNumber(L)));
}
return 0;
}
示例3: luaNpcSetFocus
int NpcScriptInterface::luaNpcSetFocus(lua_State* L)
{
// npc:setFocus(creature)
Creature* creature = getCreature(L, 2);
Npc* npc = getUserdata<Npc>(L, 1);
if (npc) {
npc->setCreatureFocus(creature);
pushBoolean(L, true);
} else {
lua_pushnil(L);
}
return 1;
}
示例4: luaSetNpcFocus
int32_t NpcScriptInterface::luaSetNpcFocus(lua_State* L)
{
//doNpcSetCreatureFocus(cid)
uint32_t cid = popNumber(L);
ScriptEnvironment* env = getScriptEnv();
Npc* npc = env->getNpc();
if (npc) {
npc->setCreatureFocus(g_game.getCreatureByID(cid));
}
return 0;
}
示例5: luaSetNpcFocus
int NpcScriptInterface::luaSetNpcFocus(lua_State *L)
{
//doNpcSetCreatureFocus(cid)
uint32_t cid = popNumber(L);
ScriptEnviroment* env = getScriptEnv();
Npc* npc = env->getNpc();
if(npc){
Creature* creature = env->getCreatureByUID(cid);
npc->setCreatureFocus(creature);
}
return 0;
}
示例6: luaSetNpcFocus
int NpcScriptInterface::luaSetNpcFocus(lua_State* L)
{
//setNpcFocus(cid)
uint32_t cid = popNumber(L);
ScriptEnviroment* env = getScriptEnv();
Npc* npc = env->getNpc();
if (npc) {
Creature* creature = env->getCreatureByUID(cid);
if (creature) {
npc->setCreatureFocus(creature);
}
else {
npc->focusCreature = 0;
npc->setWalkDelay(std::time(unsigned(NULL)) + 5);
}
}
return 1;
}