int32_t LuaInterface::luaGetInFightTicks(lua_State* L)
{
ScriptEnviroment* env = getEnv();
Creature* creature = env->getCreatureByUID(popNumber(L));
Condition* condition = creature->getCondition(CONDITION_INFIGHT, (ConditionId_t)CONDITION_INFIGHT);
if(creature)
{
condition->getEndTime();
lua_pushnumber(L, true);
}else{
errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND));
lua_pushnumber(L, false);
}
return 1;
}
function onSay(cid, words, param, channel)
if not hasCondition(cid, CONDITION_INFIGHT) then
return doPlayerSendCancel(cid, "You Don't Have Pz") and doSendMagicEffect(getThingPos(cid), 2)
end
doPlayerSendTextMessage(cid,27, "You Have To Wait "..getInFightTicks(cid).." Second For Pz.")
return true
end
int32_t LuaScriptInterface::luaGetInFightTicks(lua_State* L)
{
ScriptEnvironment* env = getScriptEnv();
Creature* creature = env->getCreatureByUID(popNumber(L));
Condition* condition = creature->getCondition(CONDITION_INFIGHT, (ConditionId_t)CONDITION_INFIGHT);
if(creature)
{
condition->getEndTime();
pushBoolean(L, true);
}else{
reportErrorFunc(getErrorDesc(LUA_ERROR_CREATURE_NOT_FOUND));
pushBoolean(L, false);
}
return 1;
}
int32_t LuaScriptInterface::luaGetInFightTicks(lua_State* L)
{
Creature* creature = g_game.getCreatureByID(cid);
Condition* condition = creature->getCondition(CONDITION_INFIGHT, (ConditionId_t)CONDITION_INFIGHT);
if(creature)
{
condition->getEndTime();
pushNumber(L, true);
}else{
reportErrorFunc(getErrorDesc(LUA_ERROR_CREATURE_NOT_FOUND));
pushNumber(L, false);
}
return 1;
}
int32_t LuaScriptInterface::luaGetInFightTicks(lua_State* L)
{
uint32_t cid = popNumber(L);
Creature* creature = g_game.getCreatureByID(cid);
Condition* condition = creature->getCondition(CONDITION_INFIGHT, (ConditionId_t)CONDITION_INFIGHT);
if(creature)
{
condition->getEndTime();
pushNumber(L, true);
}else{
reportErrorFunc(getErrorDesc(LUA_ERROR_CREATURE_NOT_FOUND));
pushNumber(L, false);
}
return 1;
}
function onSay(cid, words, param, channel)
if not getCreatureCondition(cid, CONDITION_INFIGHT) then -- before is hasCondition.
return doPlayerSendCancel(cid, "You Don't Have Pz") and doSendMagicEffect(getThingPos(cid), 2)
end
doPlayerSendTextMessage(cid,27, "You Have To Wait "..getInFightTicks(cid).." Second For Pz.")
return true
end
" .. (math.floor(Player(cid):getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT):getEndTime() / 1000) - os.time()) .. "