• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Creating Spell Effects (Wont go behind character/Condition not found)

Extrodus

|| Blazera.net ||
Joined
Dec 22, 2008
Messages
2,691
Solutions
7
Reaction score
549
Location
Canada
So I searched the forums up and down but with no luck I have to come back to the support board.

Im trying to make haste shoot energy strikes from behind the character. Right now the effects go infront of the player and anyone in the effects that happen get hasted aswell. How can I make it so the effects happen behind the player, and other players dont get effected from the effects?

Also if I add selftarget="1" the spell stops hasting the player and the direction stops working.

Code:
  <instant name="Haste Test" words="utani test" lvl="14" mana="60" prem="1" aggressive="0" direction="1" exhaustion="1000" needlearn="0" event="script" value="support/hastetest.lua">
     <vocation id="1"/>
     <vocation id="2"/>
     <vocation id="3"/>
     <vocation id="4"/>
     <vocation id="5"/>
     <vocation id="6"/>
     <vocation id="7"/>
     <vocation id="8"/>
   </instant>

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_SOUND_GREEN)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

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

local area = createCombatArea(AREA_BEAM5, AREADIAGONAL_BEAM5)
setCombatArea(combat, area)

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

Thanks in advance for anyone who helps me with this.

Also, this is the utamo vita script I changed but same effect.. anyone in the effect area gets mana shield as well so I can't use it either.

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

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

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

function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
 
Last edited:
Also trying to make utamo vita show in effects all around the character, but players standing in the wave gets magic shield aswell. What do I change the condition to so it wont effect other players when a user casts it for himself.

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

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

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

function onCastSpell(cid, var)
   return doCombat(cid, combat, var)
end
 
Last edited:
Bumpsikins, anyone know how to direct a spell effect behind the person? This is tireless trying to figure it out, it wont change.
 
Right now the effects go infront of the player and anyone in the effects that happen get hasted aswell. How can I make it so the effects happen behind the player, and other players dont get effected from the effects?

Code:
  <instant name="Haste Test" words="utani test" lvl="14" mana="60" prem="1" aggressive="0" direction="1" exhaustion="1000" needlearn="0" event="script" value="support/hastetest.lua">
     <vocation id="1"/>
     <vocation id="2"/>
     <vocation id="3"/>
     <vocation id="4"/>
     <vocation id="5"/>
     <vocation id="6"/>
     <vocation id="7"/>
     <vocation id="8"/>
   </instant>

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_SOUND_GREEN)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

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

local area = createCombatArea(AREA_BEAM5, AREADIAGONAL_BEAM5)
setCombatArea(combat, area)

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

@Ninja, do you know anything about this?
 
Last edited:
@Wiw3K - Could you be so kind as to post an example, you dont have to make the script for me just show me how I would set effects "standard layout" so I can edit it to my needs. Would be much appreciated!
 
Like this?
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_SOUND_GREEN)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_HASTE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 33000)
setConditionFormula(condition, 0.3, -24, 0.3, -24)

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

function onCastSpell(cid, var)
     doAddCondition(cid, condition)
     doCombat(cid, combat, var)
     return true
end
 
@Limos - Do you know how long I've been waiting for this! It works, thank you so much! What's your paypal, I'm sending you a few bucks. <3

Oh by the way, apparently I am like super newb with spells or they are really hard to edit even if you know the basics + have a layout to work from..

I am trying to make it a distance effect now that shoots diagonally behind the character to give kind of a "push" effect. But I think I am sadly walking myself directly into "fails". Take a look below.

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

local condition = createConditionObject(CONDITION_HASTE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 33000)
setConditionFormula(condition, 0.3, -24, 0.3, -24)

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

function onCastSpell(cid, var)
  doAddCondition(cid, condition)
  doCombat(cid, combat, var)
  return true
end

Btw; if you dont have time to help with this just send your paypal email; what you've given me so far I can work from and it's much appreciated.
 
Code:
local acombat = createCombatObject()

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGYBALL)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_HASTE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 33000)
setConditionFormula(condition, 0.3, -24, 0.3, -24)

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

function onTargetTile(cid, pos)
     doCombat(cid, combat, positionToVariant(pos))
end

setCombatCallback(acombat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")

function onCastSpell(cid, var)
     doAddCondition(cid, condition)
     doCombat(cid, acombat, var)
     return true
end
 
@Limos - You're amazing, whats your paypal email though so I can reward you! I've been waiting like 5 days for this, to see the visual effects working makes me outrageously happy!
 
Back
Top