• 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 Spell - createitem

Swiff

Member
Joined
Apr 6, 2009
Messages
366
Reaction score
12
Location
Sweden
Hello, I'm doing some custom spells and now I've hit a wall.

I'm trying to use this:
HTML:
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1988)

In a wave spell.

I'm also confused why when I use such a spell/rune item on the ground/myself, the item will spawn on the ground, but when I use the spell on a monster it will not, why?

Here's example of a firewave that i want to make a little custom by creating items on the areas that are hit:

HTML:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)
setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 1.2, 2)

local area = createCombatArea(AREA_WAVE4, AREADIAGONAL_WAVE4)
setCombatArea(combat, area)

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

Here's an example on my rune that I can shoot on myself to spawn and item, but not on a monster to spawn an item (the damage and all other effects plays when used on monster);
l
HTML:
ocal combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_HOLY)
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1988)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1.5, -15, -2.5, -25)

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

I need support with why the item won't spawn on a monster, and I guess request on howto make area spell items (I remember I did this somehow with 8.0 xml server, but it has a different setup when reading spells)

Using TFS 3.6pl1
 
Last edited:
LUA:
 allowfaruse="1" charges="1" lvl="100" maglv="5" exhaustion="2000" needtarget="1" blocktype="solid" event="script" value="attack/tess.lua"/>
/\ The rune.
LUA:
 words="tresa mortos" lvl="12" mana="25" prem="1" range="5" casterTargetOrDirection="1" blockwalls="1" exhaustion="1500" needlearn="0" event="script" value="attack/estestos.lua">
/\ the instant spell

Don't really know why it's possible to use on myself and spawn the item but not on a monster. As for the instant spell... No clue
 
rune
Code:
 allowfaruse="1" charges="1" lvl="100" maglv="5" exhaustion="2000" blocktype="solid" event="script" value="attack/tess.lua"/>

as for the instant spell nothing inside that lua is creating an item
 
this is the instant spell that is not spawning the item when targeted on monsters, but when shooting it out in the blue (in front of yourself) it spawns
LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREWORK_YELLOW)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_HOLY)
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 2148)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1)

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

Thank you for the help on the rune, it works as intended now! :)
However the instant spell is still a mystery
 
Back
Top