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

Mighty Smash - Spell

  • Thread starter Thread starter Deleted member 49793
  • Start date Start date
D

Deleted member 49793

Guest
Hey i had this idea for a spell but not sure how to go around coding it, im sure its like a 5 minute code but anyways its basicly a spell that like exori hur (targets a monster)
However to use it you need to be next to the creature, So not facing it or anything but you have to be beside it.

Basicly it'll deal damage to that creature like exori hurs damage just you must be beside it.

If you know any kool animation to add to this that would be awesome otherwise i can search for one :) but since its like a hammer smash something like that would be kool :D

Rep ++ for help!
Thanks so much!
~Mosit
 
good, this is what needs to be modified
LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, true)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_WEAPONTYPE)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)

function onGetFormulaValues(cid, level, skill, attack, factor)
    local skillTotal, levelTotal = skill + attack, level / 5
    return -(skillTotal / 3 + levelTotal), -(skillTotal + levelTotal)
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end
cyko knows about this
 
You could find the distance between you and your target using..
Code:
getDistanceBetween(fromPosition, toPosition)
or you could get a list of creatures around you using..
Code:
getSpectators(centerPos, rangex, rangey[, multifloor = false])
 
this should be it you can add your animation :p
LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, true)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_WEAPONTYPE)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)
 
function onGetFormulaValues(cid, level, skill, attack, factor)
    local skillTotal, levelTotal = skill + attack, level / 5
    return -(skillTotal / 3 + levelTotal), -(skillTotal + levelTotal)
end
 
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onCastSpell(cid, var)
	if getDistanceBetween(getThingPos(cid), getThingPos(getCreatureTarget(cid))) ~= 1 then
		return doPlayerSendCancel(cid,"You must get close to your target.") and false
	else
		 doCombat(cid, combat, var)
	end
	return true
end
 
Back
Top