MarkSmartRemark
Lua-Noob in Training :D
- Joined
- Jan 27, 2010
- Messages
- 139
- Reaction score
- 3
Hey guys,
Heres a spell i did using @Limos teleport spell that she gave to some guy.
It's based off of Heroic Leap from world of warcraft. It Teleports the player forward (configurable) and does base damage to a small area around him from where he teleported.
It's pretty much done except for one part loll.. I need the damage "area" to hit the place hes teleported to and not the place he teleported from. I tried everything but cant get it to work.. if someone can help id appreciate it! ill repost on spells once its done.
Idk, maybe its possible with doAreaCombatHealth or somethin? not sure..
Heres the script
Heres a spell i did using @Limos teleport spell that she gave to some guy.
It's based off of Heroic Leap from world of warcraft. It Teleports the player forward (configurable) and does base damage to a small area around him from where he teleported.
It's pretty much done except for one part loll.. I need the damage "area" to hit the place hes teleported to and not the place he teleported from. I tried everything but cant get it to work.. if someone can help id appreciate it! ill repost on spells once its done.
Idk, maybe its possible with doAreaCombatHealth or somethin? not sure..
Heres the script
Code:
-- >>Script by Tabz!<< --
--{Credits:Limos teleport}
--.::.CONFIG.::.--
local min_base = 1 --- Min Base Damage
local max_base = 5 --- Max Base Damage
local skill_scale = 50 --- skill % scale
local leap_range = 5 --- How far leap will jump
local cooldown = 45 --- Cooldown time for this spell (Exhaustion)? [seconds]
local cd_storage = 206 --- Cooldown StorageID
--.::.CONFIG.::.--
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_GROUNDSHAKER)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EXPLOSION)
function getSpellDamage(cid, skill, att, attackStrength)
local min = (min_base + (getPlayerSkillLevel(cid, SKILL_SWORD)*(skill_scale/100)))
local max = (max_base + (getPlayerSkillLevel(cid, SKILL_SWORD)*(skill_scale/100)))
return -min, -max
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "getSpellDamage")
local area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat, area)
function onCastSpell(cid, var)
if exhaustion.check(cid, cd_storage) then
doPlayerSendCancel(cid, "Your Heroic Leap has "..exhaustion.get(cid, cd_storage).." seconds on cooldown.")
return false
end
function isWalkable(pos)
pos.stackpos = 0
local tile = getThingfromPos(pos, false)
if tile ~= 0 and not hasProperty(tile.uid, CONST_PROP_BLOCKSOLID) and not isCreature(getTopCreature(pos).uid) then
return true
end
end
local pos = getClosestFreeTile(cid, getPosByDir(getCreaturePosition(cid), getCreatureLookDirection(cid), leap_range), false, false)
if(not pos or isInArray({pos.x, pos.y}, 0)) or (getTilePzInfo(pos)) or not isWalkable(pos) then
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
return false
end
local cpos = getCreaturePosition(cid)
if(doTeleportThing(cid, pos, true)) then
doSendMagicEffect(cpos, CONST_ME_BLOCKHIT)
doSendDistanceShoot(cpos, pos, CONST_ANI_EXPLOSION)
doSendMagicEffect(pos, CONST_ME_TELEPORT)
doCombat(cid, combat, var)
end
exhaustion.set(cid, cd_storage, cooldown)
return true
end