exori gran spell

mmheo

Member
Joined
Sep 14, 2017
Messages
90
Reaction score
1
how i can make spell like exori gran but effect will be weapotype like this
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_WEAPONTYPE)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)

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

function onGetPlayerMinMaxValues(cid, level, skill, attack, factor)
    local dmg_level_min = (level*0.2)
    local dmg_level_max = (level*0.3)
    
    local min = -(((skill * 0.035) * attack)+dmg_level_min)
    local max = -(((skill * 0.055) * attack)+dmg_level_max)

    return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetPlayerMinMaxValues")
function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end
0.4
 

Mustafa1337

Î Àm ŁĕğẹňĎ
Joined
Mar 4, 2017
Messages
313
Reaction score
79
Try this

Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_WEAPONTYPE)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)

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

function onGetPlayerMinMaxValues(cid, level, skill, attack, factor)
    local dmg_level_min = (level*0.2)
    local dmg_level_max = (level*0.3)
    
    local min = -(((skill * 0.035) * attack)+dmg_level_min)
    local max = -(((skill * 0.055) * attack)+dmg_level_max)

    return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetPlayerMinMaxValues")
function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end
 

Apollos

Dude who does stuff
Joined
Apr 22, 2009
Messages
722
Reaction score
441
Location
United States
how i can make spell like exori gran but effect will be weapotype like this
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_WEAPONTYPE)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)

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

function onGetPlayerMinMaxValues(cid, level, skill, attack, factor)
    local dmg_level_min = (level*0.2)
    local dmg_level_max = (level*0.3)
   
    local min = -(((skill * 0.035) * attack)+dmg_level_min)
    local max = -(((skill * 0.055) * attack)+dmg_level_max)

    return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetPlayerMinMaxValues")
function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end
0.4
You can try this:
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)

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

function onTargetTile(cid, position)
    doSendDistanceShoot(getCreaturePosition(cid), position, CONST_ANI_WEAPONTYPE)
    return true
end

function onGetPlayerMinMaxValues(cid, level, skill, attack, factor)
    local dmg_level_min = (level*0.2)
    local dmg_level_max = (level*0.3)
    
    local min = -(((skill * 0.035) * attack)+dmg_level_min)
    local max = -(((skill * 0.055) * attack)+dmg_level_max)

    return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetPlayerMinMaxValues")

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

Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_WEAPONTYPE)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)

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

function onGetPlayerMinMaxValues(cid, level, skill, attack, factor)
    local dmg_level_min = (level*0.2)
    local dmg_level_max = (level*0.3)
   
    local min = -(((skill * 0.035) * attack)+dmg_level_min)
    local max = -(((skill * 0.055) * attack)+dmg_level_max)

    return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetPlayerMinMaxValues")
function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end
There is no CONST_ME_WEAPONTYPE.
CONST_ANI_WEAPONTYPE is only for distance shots.
 

Mustafa1337

Î Àm ŁĕğẹňĎ
Joined
Mar 4, 2017
Messages
313
Reaction score
79
You can try this:
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)

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

function onTargetTile(cid, position)
    doSendDistanceShoot(getCreaturePosition(cid), position, CONST_ANI_WEAPONTYPE)
    return true
end

function onGetPlayerMinMaxValues(cid, level, skill, attack, factor)
    local dmg_level_min = (level*0.2)
    local dmg_level_max = (level*0.3)
   
    local min = -(((skill * 0.035) * attack)+dmg_level_min)
    local max = -(((skill * 0.055) * attack)+dmg_level_max)

    return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetPlayerMinMaxValues")

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

There is no CONST_ME_WEAPONTYPE.
CONST_ANI_WEAPONTYPE is only for distance shots.
Ah sorry, didn't notice what I am writing.
btw your edit not working, I am trying now on tfs 0.4
 

Apollos

Dude who does stuff
Joined
Apr 22, 2009
Messages
722
Reaction score
441
Location
United States
Ah sorry, didn't notice what I am writing.
btw your edit not working, I am trying now on tfs 0.4
Probably has something to do with CONST_ANI_WEAPONTYPE not working. You can try this:
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)

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

function onTargetTile(cid, position)
    local weapon_type, effect = getItemWeaponType(getPlayerWeapon(cid).uid), CONST_ANI_ARROW
    if weapon_type == WEAPON_SWORD then
        effect = CONST_ANI_WHIRLWINDSWORD
    elseif weapon_type == WEAPON_CLUB then
        effect = CONST_ANI_WHIRLWINDCLUB
    elseif weapon_type == WEAPON_AXE then
        effect = CONST_ANI_WHIRLWINDAXE
    end

    doSendDistanceShoot(getCreaturePosition(cid), position, effect)
    return true
end

function onGetPlayerMinMaxValues(cid, level, skill, attack, factor)
    local dmg_level_min = (level*0.2)
    local dmg_level_max = (level*0.3)
    
    local min = -(((skill * 0.035) * attack)+dmg_level_min)
    local max = -(((skill * 0.055) * attack)+dmg_level_max)

    return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetPlayerMinMaxValues")

function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end
It's hard for me to tell because I don't have 0.4 set up to test. If this script doesn't work try changing CONST_ANI_WEAPONTYPE in my first solution with something like CONST_ANI_ARROW and see if it even sends that effect.
 

Mustafa1337

Î Àm ŁĕğẹňĎ
Joined
Mar 4, 2017
Messages
313
Reaction score
79
Probably has something to do with CONST_ANI_WEAPONTYPE not working. You can try this:
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)

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

function onTargetTile(cid, position)
    local weapon_type, effect = getItemWeaponType(getPlayerWeapon(cid).uid), CONST_ANI_ARROW
    if weapon_type == WEAPON_SWORD then
        effect = CONST_ANI_WHIRLWINDSWORD
    elseif weapon_type == WEAPON_CLUB then
        effect = CONST_ANI_WHIRLWINDCLUB
    elseif weapon_type == WEAPON_AXE then
        effect = CONST_ANI_WHIRLWINDAXE
    end

    doSendDistanceShoot(getCreaturePosition(cid), position, effect)
    return true
end

function onGetPlayerMinMaxValues(cid, level, skill, attack, factor)
    local dmg_level_min = (level*0.2)
    local dmg_level_max = (level*0.3)
   
    local min = -(((skill * 0.035) * attack)+dmg_level_min)
    local max = -(((skill * 0.055) * attack)+dmg_level_max)

    return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetPlayerMinMaxValues")

function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end
It's hard for me to tell because I don't have 0.4 set up to test. If this script doesn't work try changing CONST_ANI_WEAPONTYPE in my first solution with something like CONST_ANI_ARROW and see if it even sends that effect.
Still not working
35365
 

Mustafa1337

Î Àm ŁĕğẹňĎ
Joined
Mar 4, 2017
Messages
313
Reaction score
79
What? It's definitely working there. You do realize he said he wanted a spell like exori gran? Which is not an on target spell it's an AoE.
Maybe, I thought he was aiming for something different all the time because he used
Lua:
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_WEAPONTYPE)
I thought he wanted area spell which hit on target, but if not then your first reply works properly.
 
Top