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

Lua 'Poison' like spell?

cake

Banned User
Joined
Jul 24, 2010
Messages
838
Reaction score
58
Location
good or bad,
Hiya,

I was wondering if it was possible to make a poison-looking spell.
As we know, once you step on a poison field, you take damage over time. Same with fire, energy etc.

I want to make a spell (creature only, I know how to do this :p) which will trigger a random poison damage between 1-30, every 0.30 seconds (30 seconds duration). It will stack with other poison-type damage, such as a poison field. (Also note that the poison-condition will show up in status panel). It will not stack itself, meaning if the spell is casted twice on the player, the damage will be the same, the duration will just be 'back' to 30 seconds.

Is this possible?
 
I would do that (if my skills were enough) with changing poison field rune into spell (if it's possible and I think it is), changing the dmg, limiting poison field on the ground time to 0.1s (if it's possible) just to inflict poison debuff to the victim and not to show the poison gas cloud on the ground. You can change the duration of poison field and dmg it does and ticks in items.xml - poison field is id 1496.
 
Other, working solution:

Poisonspell.lua in data/spells/scripts/attack
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_GREEN_RINGS)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POISON)

local condition = createConditionObject(CONDITION_POISON)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 15, 2000, -15)
setCombatCondition(combat, condition)

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

in data/spells/spells.xml
XML:
</instant>
		<instant name="Poison spell" words="exori pox" lvl="12" mana="20" prem="1" range="5" casterTargetOrDirection="1" blockwalls="1" exhaustion="2000" needlearn="0" event="script" value="attack/poisonspell.lua">
		<vocation id="1"/>
		<vocation id="2"/>
	</instant>
 
Try:
Code:
local combats, conditions = {}, {}

for i = 1, 30 do
	combats[i] = createCombatObject()
	setCombatParam(combats[i], COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)

	conditions[i] = createConditionObject(CONDITION_POISON)
	setConditionParam(conditions[i], CONDITION_PARAM_STARTVALUE, i)
	setConditionParam(conditions[i], CONDITION_PARAM_TICKINTERVAL, 300)
	setConditionParam(condition, CONDITION_PARAM_TICKS, 30 * 1000)

	setCombatCondition(combats[i], conditions[i])
end

function onCastSpell(cid, var)
	return doCombat(cid, combats[math.random(#combats)], var)
end

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

local conditions = {}

for i = 1, 30 do
	conditions[i] = createConditionObject(CONDITION_POISON)
	setConditionParam(conditions[i], CONDITION_PARAM_STARTVALUE, i)
	setConditionParam(conditions[i], CONDITION_PARAM_TICKINTERVAL, 300)
	setConditionParam(condition, CONDITION_PARAM_TICKS, 30 * 1000)
end

function onCastSpell(cid, var)
	local target = variantToNumber(var)
	if(isPlayer(target)) then
		return doAddCondition(target, conditions[math.random(#conditions)]), doCombat(cid, combat, var)
	else
		return false
	end
end

Not sure tho :(.
 
None of them work :/

Lycefur: Your spell only shows the animation on the player casting it. :p

chojrak: It gives me tons of errors, (tried both):

[07/09/2010 17:22:50] [Error - Spell Interface]
[07/09/2010 17:22:51] data/spells/scripts/attack/curse of hera.lua
[07/09/2010 17:22:51] Description:
[07/09/2010 17:22:51] (luaSetConditionParam) Condition not found

[07/09/2010 17:22:51] [Error - Spell Interface]
[07/09/2010 17:22:51] data/spells/scripts/attack/curse of hera.lua
[07/09/2010 17:22:51] Description:
[07/09/2010 17:22:51] (luaSetConditionParam) Condition not found


x10
 
Code:
	setConditionParam(condition, CONDITION_PARAM_TICKS, 30 * 1000)
to
Code:
	setConditionParam(conditions[B][COLOR="red"][i][/COLOR][/B], CONDITION_PARAM_TICKS, 30 * 1000)
 
Last edited:
Thanks cykotitan^^ I'll try it out in 2 mins =D

[07/09/2010 17:39:42] [Error - Spell Interface]
[07/09/2010 17:39:42] data/spells/scripts/attack/curse of hera.lua
[07/09/2010 17:39:42] Description:
[07/09/2010 17:39:42] data/spells/scripts/attack/curse of hera.lua:10: attempt to index global 'condition' (a nil value)
[07/09/2010 17:39:42] [Warning - Event::loadScript] Cannot load script (data/spells/scripts/attack/curse of hera.lua)

:/
 
Last edited by a moderator:
conditions* ...

facepalm.jpg
 
Back
Top