• 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!

Limit spell by outfit

Exiled Pain

Fervid Learner
Joined
Jan 8, 2008
Messages
552
Reaction score
4
Sup, I would like to know if there is a way to limit spells by outfit.

Description: Lets say you have a wizard outfit on, and only then you can make a specific spell, if you are not wearing the outfit you couldn't perform the spell.

Better if directly by a spell command but if not, maybe by a talkaction, I don't really mind as long as it works with normal,custom and wave spells (all):p

Thanks in advance
 
Sup, I would like to know if there is a way to limit spells by outfit.

Description: Lets say you have a wizard outfit on, and only then you can make a specific spell, if you are not wearing the outfit you couldn't perform the spell.

Better if directly by a spell command but if not, maybe by a talkaction, I don't really mind as long as it works with normal,custom and wave spells (all):p

Thanks in advance

Yep mate, it is possible!

Here is an example with the "utani hur" spell being limited only to "Warrior" and "Barbarian" outfits, so if you dont have that outfit you cant cast it until you put it on:

Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local condition = createConditionObject(CONDITION_HASTE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 33000)
setConditionFormula(condition, 0.3, -24, 0.3, -24)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)

	local outfits = {
	
		134,		-- Warrior
		143		-- Barbarian
		
	}
	
	if isInArray(outfits, getCreatureOutfit(cid).lookType) then		-- Make sure you have the .lookType there, otherwise you will have to take into consideration the colors and such!
		return doCombat(cid, combat, var)
	else
		doPlayerSendCancel(cid, "You dont have the required outfit to cast this spell.")
		doSendMagicEffect(getCreaturePosition(cid), 2)
	return FALSE
	end
	
end

So you can do it like that for any other spell and it will work the same. You can remove/add outfits to the "outfits" list to fit your needs.

Regards.
 
Back
Top