MarkSmartRemark
Lua-Noob in Training :D
- Joined
- Jan 27, 2010
- Messages
- 139
- Reaction score
- 3
Ok, i have 2 scripts... I wanted to know if somebody could please change one of the following scripts... This first one, works fine. What it does, it charges up, and then deals a final blow in an Area UE... Like Divine Caldera. What i want it to do, is instead of an area hit, i want it to simply hit the target like exori san. So instead of area single target hit. ![Big Grin :D :D](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
OR
If somebody can modify this script that cykotitan made but it only works for tfs 0.2 and im using the latest tfs... so if someone can port this script to the latest tfs id appreciate it!
Thanks! Ill Rep!
PHP:
local arr = {}
arr[1] = {
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
{0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0},
{1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1},
{0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0},
{0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}
}
arr[2] = {
{0, 0, 0, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 0, 1, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 1, 0, 0},
{0, 1, 0, 0, 0, 0, 0, 1, 0},
{1, 0, 0, 0, 2, 0, 0, 0, 1},
{0, 1, 0, 0, 0, 0, 0, 1, 0},
{0, 0, 1, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 1, 0, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 0, 0, 0}
}
arr[3] = {
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 1, 0, 1, 0, 0},
{0, 1, 0, 0, 0, 1, 0},
{1, 0, 0, 2, 0, 0, 1},
{0, 1, 0, 0, 0, 1, 0},
{0, 0, 1, 0, 1, 0, 0},
{0, 0, 0, 1, 0, 0, 0}
}
arr[4] = {
{0, 0, 1, 0, 0},
{0, 1, 0, 1, 0},
{1, 0, 2, 0, 1},
{0, 1, 0, 1, 0},
{0, 0, 1, 0, 0}
}
arr[5] = {
{0, 1, 0},
{1, 2, 1},
{0, 1, 0}
}
arr[6] = {
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}
}
local formulas = {
[6] = {COMBAT_FORMULA_LEVELMAGIC, -2.0, -200, -3.2, -400}
}
local function onTileComb(cid, pos)
if(isCreature(cid) == TRUE) then
doSendDistanceShoot(pos, getThingPos(cid), CONST_ANI_SMALLHOLY)
end
end
local combats = {}
for i, v in pairs(arr) do
combats[i] = createCombatObject()
setCombatParam(combats[i], COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
if(i < #arr) then
_G["callback" .. i] = onTileComb --Mwahaha
setCombatCallback(combats[i], CALLBACK_PARAM_TARGETTILE, "callback" .. i)
else
setCombatParam(combats[i], COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE)
end
if(formulas[i] ~= nil) then
setCombatFormula(combats[i], unpack(formulas[i]))
end
setCombatArea(combats[i], createCombatArea(v))
end
local isCharging = {}
local function eventFunc(p)
local cid = p.cid
local n = p.n or 1
if(isCreature(cid) == FALSE) then
isCharging[cid] = false
return LUA_ERROR
end
if(isCharging[cid] and n == 1) then
if(isPlayer(cid) == TRUE) then
doPlayerSendCancel(cid, "You are already charging it.")
end
return LUA_ERROR
end
isCharging[cid] = (n < #combats)
local pos = getThingPos(cid)
if(getTilePzInfo(pos) ~= FALSE) then
isCharging[cid] = false
return LUA_ERROR
end
local var = positionToVariant(pos)
if(doCombat(cid, combats[n], var) == LUA_ERROR) then
isCharging[cid] = false
return LUA_ERROR
end
if(isCharging[cid]) then
addEvent(eventFunc, 1000-n*100, {cid=cid, n=n+1})
end
return LUA_NO_ERROR
end
function onCastSpell(cid, var)
return eventFunc({cid=cid})
end
OR
If somebody can modify this script that cykotitan made but it only works for tfs 0.2 and im using the latest tfs... so if someone can port this script to the latest tfs id appreciate it!
PHP:
local config = {
spellRange = 4,-- should be same as in spells.xml
formulaType = "levelmagic", -- "static" or "levelmagic"
formula = {10, 25}, -- min, max ..
distanceEffect = CONST_ANI_SMALLICE, -- distance effect, used both while charging and for final blast
areaEffect = CONST_ME_ICEDAMAGE, -- area effect of the final blast
initalInterval = 500, -- delay between sending combats at first
intervalReduction = 2000 -- how much faster (in ms) should the next combat be sent
}
local arr, combats, isCharging = {
[1] = {
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
{0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0},
{1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1},
{0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0},
{0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}
},
[2] = {
{0, 0, 0, 0, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 0, 1, 0, 0, 0},
{0, 0, 1, 0, 0, 0, 1, 0, 0},
{0, 1, 0, 0, 0, 0, 0, 1, 0},
{1, 0, 0, 0, 2, 0, 0, 0, 1},
{0, 1, 0, 0, 0, 0, 0, 1, 0},
{0, 0, 1, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 1, 0, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 0, 0, 0, 0}
},
[3] = {
{0, 0, 0, 1, 0, 0, 0},
{0, 0, 1, 0, 1, 0, 0},
{0, 1, 0, 0, 0, 1, 0},
{1, 0, 0, 2, 0, 0, 1},
{0, 1, 0, 0, 0, 1, 0},
{0, 0, 1, 0, 1, 0, 0},
{0, 0, 0, 1, 0, 0, 0}
},
[4] = {
{0, 0, 1, 0, 0},
{0, 1, 0, 1, 0},
{1, 0, 2, 0, 1},
{0, 1, 0, 1, 0},
{0, 0, 1, 0, 0}
},
[5] = {
{0, 1, 0},
{1, 2, 1},
{0, 1, 0}
},
[6] = {
{3},
}
}, {}, {}
local formulas = {
[6] = {config.formulaType == "static" and COMBAT_FORMULA_DAMAGE or config.formulaType == "levelmagic" and COMBAT_FORMULA_LEVELMAGIC, -(math.abs(config.formula[1])), 0, -(math.abs(config.formula[2])), 0}
}
local function onTileComb(cid, pos)
return isCreature(cid) == TRUE and doSendDistanceShoot(pos, getThingPos(cid), config.distanceEffect)
end
for i, v in pairs(arr) do
combats[i] = createCombatObject()
setCombatParam(combats[i], COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
if(i < #arr) then
_G["callback" .. i] = onTileComb --Mwahaha
setCombatCallback(combats[i], CALLBACK_PARAM_TARGETTILE, "callback" .. i)
else
setCombatParam(combats[i], COMBAT_PARAM_EFFECT, config.areaEffect)
setCombatParam(combats[i], COMBAT_PARAM_DISTANCEEFFECT, config.distanceEffect)
end
if(formulas[i]) then
setCombatFormula(combats[i], unpack(formulas[i]))
end
setCombatArea(combats[i], createCombatArea(v))
end
local function eventFunc(p)
local cid, target, n = p.cid, p.target, p.n or 1
if(isCreature(cid) == FALSE) then
isCharging[cid] = false
return true
end
if(isCharging[cid] and n == 1) then
if(isPlayer(cid) == TRUE) then
doPlayerSendCancel(cid, "You are already charging it.")
end
return true
end
isCharging[cid] = (n < #combats)
local pos = getThingPos(cid)
if(getTilePzInfo(pos) ~= FALSE or isCreature(target) == FALSE or getDistanceBetween(pos, getThingPos(target)) > config.spellRange) then
isCharging[cid] = false
return true
end
if(doCombat(cid, combats[n], numberToVariant(isCharging[cid] and cid or target)) == TRUE) then
isCharging[cid] = false
return true
end
if(isCharging[cid]) then
addEvent(eventFunc, config.initalInterval - n * config.intervalReduction, {cid=cid, target=target, n=n+1})
end
return false
end
function onCastSpell(cid, var)
return eventFunc({cid=cid, target=var.number})
end
Thanks! Ill Rep!