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

Unlimited Spells

Rexanilator

New Member
Joined
Oct 3, 2009
Messages
297
Reaction score
2
I am wondering if it is possible for example to make a spell that would be basically turned on with the spell command and would stay on until the spell command is said again or the player logs off the server or changes characters.

For example, the command for great light which is "fiat lux" on my server...we could adjust the code of CONDITION_PARAM_TICKS to on when player says "fiat lux" and then off when they say "fiat lux" (or log out or change characters as mentioned above).

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_LIGHT)
setConditionParam(condition, CONDITION_PARAM_LIGHT_LEVEL, 8)
setConditionParam(condition, CONDITION_PARAM_LIGHT_COLOR, 215)
[B][COLOR="red"]setConditionParam(condition, CONDITION_PARAM_TICKS, (11 * 60 + 35) * 1000)[/COLOR][/B]
setCombatCondition(combat, condition)

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

This would be an awesome ability and I will be grateful for the assistance on this coding.
 
Yeah - the timing wasn't really the issue...

I really needed some assistance on the being able to "turn it off" by using the same command.

Can you share me what I need to put in talk actions?
 
Lua:
local stor = 123456;
local condition = createConditionObject(CONDITION_LIGHT)
setConditionParam(condition, CONDITION_PARAM_LIGHT_LEVEL, 8)
setConditionParam(condition, CONDITION_PARAM_LIGHT_COLOR, 215)
setConditionParam(condition, CONDITION_PARAM_TICKS, (11 * 60 + 35) * 1000)
setConditionParam(condition, CONDITION_SUBID, 41)

onSay(cid)
if(getPlayerStorageValue(cid,stor) < 1) then
doAddCondition(cid,condition)
setPlayerStorageValue(cid,stor,1)
else
doRemovecondition(cid,CONDITION_LIGHT,41)
setPlayerDtorageValue(cid,stor,0)
end
end

THIS DOESN'T WORK. It's just example.
 
honestly - not sure what that is...you meaning to change the spell script...the spell works fine and lasts forever - I just needed the talkaction to shut it off.
 
to make it infinite use Ticks = -1. if u want to turn it off then use talkactions.

No need to use talk action.

Example : (haste spell)

If you have haste : cast spell --> haste is gone.
If you dont have haste : cast spell --> you gane haste.
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

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

function onCastSpell(cid, var)
   return getCreatureCondition(cid, CONDITION_HASTE) and doRemoveCondition(cid,CONDITION_HASTE) and doSendMagicEffect(getThingPos(cid),CONST_ME_MAGIC_GREEN) or doCombat(cid, combat, var)
end
 
Last edited:
Back
Top