ReturnValue [B][COLOR="red"]Spell::CreateIllusion[/COLOR][/B](Creature* creature, const Outfit_t outfit, int32_t time)
{
ConditionOutfit* outfitCondition = new ConditionOutfit(CONDITIONID_COMBAT, CONDITION_OUTFIT, time, false, 0);
if(!outfitCondition)
return RET_NOTPOSSIBLE;
outfitCondition->addOutfit(outfit);
creature->addCondition(outfitCondition);
return RET_NOERROR;
}
int32_t LuaScriptInterface::luaSetMonsterOutfit(lua_State* L)
{
[COLOR="green"]//doSetMonsterOutfit(cid, name, time)[/COLOR]
int32_t time = (int32_t)popNumber[COLOR="navy"]([/COLOR]L[COLOR="navy"]);[/COLOR]
std::string name [COLOR="navy"]=[/COLOR] popString(L);
ScriptEnviroment[COLOR="navy"]*[/COLOR] env = getEnv[COLOR="navy"]();[/COLOR]
[COLOR="blue"]if[/COLOR][COLOR="navy"]([/COLOR]Creature[COLOR="navy"]*[/COLOR] creature = env->getCreatureByUID(popNumber(L)))
lua_pushboolean(L, [B][COLOR="red"]Spell[COLOR="navy"]::[/COLOR]CreateIllusion[/COLOR][/B](creature, name, time) == RET_NOERROR);
[COLOR="blue"]else[/COLOR]
{
errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND));
lua_pushboolean(L, [COLOR="blue"]false[/COLOR]);
}
[COLOR="blue"]return[/COLOR] [COLOR="darkorange"]1[/COLOR];
}