//doCreatureSetGuildEmblem(cid, emblem)
lua_register(m_luaState, "doCreatureSetGuildEmblem", LuaInterface::luaDoCreatureSetGuildEmblem);
There is no need for a addevent Zothion or a source edit. The emblem should dissapear once the player relogs and has no need for an addevent to remove it or to keep it. Tho if you want the manashield to last for however long your ticks are which is 2000 seconds then you need an addevent to remove it. Im positive that the player will re-enable his manashield and thus leaving the addevent to remove it redundant.
My recommendation for you
@jestem pro is to make the manashield last forever, and allow the player to disable the mana shield using utamo vis and then set the emblem to be 0, problem solved. no need to overdo it. Simply change the ticks to be 5 hours (1800000) instead of 200000
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
local condition = createConditionObject(CONDITION_MANASHIELD)
setConditionParam(condition, CONDITION_PARAM_TICKS, 200000)
setCombatCondition(combat, condition)
function onCastSpell(cid, var)
doCreatureSetGuildEmblem(cid, 3)
return doCombat(cid, combat, var)
end
If you dont have utamo vis, simply copy-paste magic shield and name it disable magic shield and set the ticks to be 0. The new magic shield spell will override the current one and disable it. Remember to edit the guildemblem to be 0 on the new spell