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

TFS 0.X 3 sqm in front utamo

newby

Active Member
Joined
Jun 11, 2016
Messages
183
Reaction score
43
how to create a spell who atk 3 sqm in front of player and add utamo vita in who is in there?
 
Solution
Add this to your data/spells/spells.xmland change whatever you want.
XML:
        <instant name="yourspellname" words="yourspellname" lvl="1" mana="1" prem="0" aggressive="0" exhaustion="1000" needlearn="0" direction="1" event="script" value="yourspellname.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>
create a Lua file in data/spells/scripts and add this to it
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition =...
Add this to your data/spells/spells.xmland change whatever you want.
XML:
        <instant name="yourspellname" words="yourspellname" lvl="1" mana="1" prem="0" aggressive="0" exhaustion="1000" needlearn="0" direction="1" event="script" value="yourspellname.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>
create a Lua file in data/spells/scripts and add this to it
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

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

local area = createCombatArea(AREA_BEAM3, AREADIAGONAL_BEAM3)
setCombatArea(combat, area)

function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end
then add this to data/spells/lib/spells.lua
Lua:
AREADIAGONAL_BEAM3 = {
    {0, 0, 1, 0, 0, 0},
    {0, 0, 0, 1, 0, 0},
    {0, 0, 0, 0, 1, 0},
    {0, 0, 0, 0, 0, 3}
}

AREA_BEAM3 = {
    {1},
    {1},
    {1},
    {3}
}
 
Solution
Add this to your data/spells/spells.xmland change whatever you want.
XML:
        <instant name="yourspellname" words="yourspellname" lvl="1" mana="1" prem="0" aggressive="0" exhaustion="1000" needlearn="0" direction="1" event="script" value="yourspellname.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>
create a Lua file in data/spells/scripts and add this to it
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

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

local area = createCombatArea(AREA_BEAM3, AREADIAGONAL_BEAM3)
setCombatArea(combat, area)

function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end
then add this to data/spells/lib/spells.lua
Lua:
AREADIAGONAL_BEAM3 = {
    {0, 0, 1, 0, 0, 0},
    {0, 0, 0, 1, 0, 0},
    {0, 0, 0, 0, 1, 0},
    {0, 0, 0, 0, 0, 3}
}

AREA_BEAM3 = {
    {1},
    {1},
    {1},
    {3}
}

two problems:
it always going to south, dosen't matter where i'm looking
it is using the spell in who use too, it is doing effect in player sqm too
 
Add this to your data/spells/spells.xmland change whatever you want.
XML:
        <instant name="yourspellname" words="yourspellname" lvl="1" mana="1" prem="0" aggressive="0" exhaustion="1000" needlearn="0" direction="1" event="script" value="yourspellname.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>
create a Lua file in data/spells/scripts and add this to it
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

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

local area = createCombatArea(AREA_BEAM3, AREADIAGONAL_BEAM3)
setCombatArea(combat, area)

function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end
then add this to data/spells/lib/spells.lua
Lua:
AREADIAGONAL_BEAM3 = {
    {0, 0, 1, 0, 0, 0},
    {0, 0, 0, 1, 0, 0},
    {0, 0, 0, 0, 1, 0},
    {0, 0, 0, 0, 0, 3}
}

AREA_BEAM3 = {
    {1},
    {1},
    {1},
    {3}
}

what if i want to make a shot in 3 sqm in front?
only in 3 sqm (not in 1,2,3)?

I tried but it is make effect on 1,3



Code:
AREADIAGONAL_1SHOT3SQMFRONT = {
    {0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 0, 3}
}

AREA_1SHOT3SQMFRONT = {
    {0},
    {1},
    {0},
    {3}
}
 
Back
Top