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

Invisibility check

Darad

New Member
Joined
Jun 23, 2009
Messages
119
Reaction score
1
Hi guys,

wondering if there's a way to depend spells on invisibility. Checked the lua function list and couldn't find such a thing.

Lua:
local distanceCombat = createCombatObject()
setCombatParam(distanceCombat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(distanceCombat, COMBAT_PARAM_EFFECT, CONST_ME_HOLYAREA)
setCombatParam(distanceCombat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_HOLY)

function onGetFormulaValues(cid, level, weaponAttack)
	local attack = weaponAttack
	
	local min = attack* 4
	local max = attack* 5
	
	return min, max
end
setCombatCallback(distanceCombat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")


function onCastSpell(cid, var)
	return doCombat(cid, distanceCombat, var)
end
 
Doesn't seem to work.

Lua:
if(isPlayerGhost(cid)) then
	return doCombat(cid, distanceCombat, var)
end

Stealth function
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local condition = createConditionObject(CONDITION_INVISIBLE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 15000)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end
 
Last edited:
Lua:
	getCreatureCondition(cid, CONDITION_INVISIBLE)

If you add this in a script it looks like:

Lua:
	if getCreatureCondition(cid, CONDITION_INVISIBLE)== FALSE  then
(You can change "FALSE" to "TRUE")

Regards,
Shawak
 
Also would like to know how I can cancel the invisibility after using the spell.

setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_INVISIBLE)

Just doesn't seem to work.
 
Set Invisible:
Lua:
local invisible = createConditionObject(CONDITION_INVISIBLE,24*60*60*1000) -- time, here is 24 houres xd
setCombatCondition(combat, invisible)

Remove Invisible:
Lua:
	doRemoveCondition(cid, CONDITION_INVISIBLE)

Check Invisible:
Lua:
	getCreatureCondition(cid, CONDITION_INVISIBLE)

Regards,
Shawak
 
Back
Top Bottom