• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

I need condition to spells

raezil

Member
Joined
Apr 17, 2012
Messages
57
Reaction score
17
Welcome, i need condition who add us +1 looktype.
Example, when we have looktype =1 , when we use spells, we have looktype =2 for 3secounds.
 
You can do it in two ways, first, using combat with condition:
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)

local condition = createConditionObject(CONDITION_OUTFIT)
setConditionParam(condition, CONDITION_PARAM_TICKS, 3000)    -- time in ms
addOutfitCondition(condition, 0, 106, 0, 0, 0, 0)    -- addons, id, headcolor, bodycolor, armscolor, feetcolor
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end

Second option, without combat, integrated in onCastSpell code (more options allowed):
Code:
function onCastSpell(cid, var)
    local o = getCreatureOutfit(cid)
    local targetWho = cid
    local time = 10 -- time in seconds
    if o.lookType == 120 then
        doSetCreatureOutfit(targetWho, {lookType = o.lookType + 1, lookHead = o.lookHead, lookBody = o.lookBody, lookLegs = o.lookLegs, lookFeet = o.lookFeet, lookAddons = o.lookAddons}, time * 1000)
    end
    return true
end
 
Back
Top