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

Conditions - Spell in progress

Captain Orhotek

New Member
Joined
May 20, 2009
Messages
118
Reaction score
1
I was wondering if people could tell me how to get certain conditions to work in the follow code...maybe I am doing it wrong.

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local condition = createConditionObject(CONDITION_DRUNK)
setConditionParam(condition, CONDITION_PARAM_TICKS, 200000)
setCombatCondition(combat, condition)

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

The code above makes the person using it drunk (spell is set to be used on self) and I am wanting it to make the person cursed. Maybe I have the exact words wrong for this but I have tried CURSED and CURSE and neither are working. I am using DRUNK as an example because it is working. Also if anyone could help me on how I can turn this spell into an attack spell where it does a 2x2 range from you that would help me. I tried it before and ended up crashing my server so I figured I did something wrong...
 
Could use it as a rune

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)

local condition = createConditionObject(CONDITION_DRUNK)
setConditionParam(condition, CONDITION_PARAM_TICKS, 20000)
setCombatCondition(combat, condition)

local area = createCombatArea( { {1, 1, 1}, {1, 3, 1}, {1, 1, 1} } )
setCombatArea(combat, area)

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end
 
I actually have this as a rune but I am wanting it to be a area of effect spell. I have updated the code a little into the following and everything is working as far as I can tell. The area is working 1x1 and the dmg is working but the conditions are not. It still poisons and but the poison does the initial dmg that is based off the formula (as far as I can tell as its doing around 250dmg) but it goes to one dmg every six seconds after that. I am not sure how to change it from that. Also if you could answer the initial question about the condition terms that would be helpful too.

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_POISONAREA)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.5, -30, -1.1, 0)

local condition = createConditionObject(CONDITION_POISON)
setConditionParam(condition, CONDITION_PARAM_DELAYED, TRUE)
setConditionParam(condition, CONDITION_PARAM_MINVALUE, 20)
setConditionParam(condition, CONDITION_PARAM_MAXVALUE, 70)
setConditionParam(condition, CONDITION_PARAM_STARTVALUE, 5)
setConditionParam(condition, CONDITION_PARAM_TICKINTERVAL, 6000)
setConditionParam(condition, CONDITION_PARAM_FORCEUPDATE, TRUE)
setCombatCondition(combat, condition)

local area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat, area)

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

As you can see the start value is 5 so all it is doing is starting at 5 then doing 5,5,4,4,4,3,3,3,2...etc

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_POISONDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_POISONAREA)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.5, -30, -1.1, 0)

local condition = createConditionObject(CONDITION_POISON)
setConditionParam(condition, CONDITION_PARAM_DELAYED, TRUE)
setConditionParam(condition, CONDITION_PARAM_STARTVALUE, 50)
setConditionParam(condition, CONDITION_PARAM_MINVALUE, 20)
setConditionParam(condition, CONDITION_PARAM_MAXVALUE, 70)
setConditionParam(condition, CONDITION_PARAM_TICKINTERVAL, 6000)
setConditionParam(condition, CONDITION_PARAM_FORCEUPDATE, TRUE)
setCombatCondition(combat, condition)

local area = createCombatArea( { {1, 1, 1}, {1, 2, 1}, {1, 1, 1} } )
setCombatArea(combat, area)

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

Only thing different above is the combat area it was annoying me that the poison was in the area I was in so I changed it.
 
Last edited:
Back
Top