I have an old script, NOT too old though, but old, and it has an error.
I really don't know what's wrong with it. It's an action script.
------------------------------------------------------------------------------------------------------------------------------------
Unlike the other script I posted, this one seems very critical, it seems so critical that it won't even let me copy the error.
So, I made a picture of it:
Here is molotov.lua:
I literally pretty much copy and pasted this from spells/scripts/firebomb.lua.
I have a green flask and if I right-click->use with-> click anywhere, it would make a 3x3 field of fire.
Also, I am hoping if it's possible, can you have a shoottype of an itemID (if I use the flask from a distance, the shot type would be green flask.
Pretty much like a molotov cocktail.
Thanks!
ofcourse REP++
e.mC
[13:25:36.958] [Error - Action Interface]
[13:25:36.959] data/actions/scripts/crossbow power 5.luanUse
[13:25:36.960] Description:
[13:25:36.961] (luaAddEvent) Callback parameter should be a function.
Lua:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 10000)
local combatpara = createCombatObject()
setCombatParam(combatpara, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combatpara, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
local conditionpara = createConditionObject(CONDITION_PARALYZE)
setConditionParam(conditionpara, CONDITION_PARAM_TICKS, 3000)
setConditionFormula(conditionpara, -0.9, 0, -0.9, 0)
setCombatCondition(combatpara, conditionpara)
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, true)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_INFERNALBOLT)
function onGetFormulaValues(cid, level, skill, attack, factor)
return -(((skill + 100) / 3) + (level / 5)), -((skill + 100) + (level / 5))
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerMana(cid) >= 20 then
if not hasCondition(cid, CONDITION_EXHAUST) then
if getCreatureTarget(cid) > 0 then
if getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == 2543 then
for i = 1, 2 do
addEvent(doAddCondition(cid, exhaust), 0, cid)
addEvent(doRemoveItem(getPlayerSlotItem(cid, CONST_SLOT_AMMO).uid, 2), 0, cid)
addEvent(doPlayerAddSkillTry(cid, SKILL_DISTANCE, 10) , 0, cid)
addEvent(doCreatureAddMana(cid, -20), 0, cid)
addEvent(doCombat, 100, cid, combat, numberToVariant(getCreatureTarget(cid)))
addEvent(doSendMagicEffect, 100, getThingPos(getCreatureTarget(cid)), CONST_ME_MORTAREA)
addEvent(doCombat, 200, cid, combat, numberToVariant(getCreatureTarget(cid)))
addEvent(doSendMagicEffect, 200, getThingPos(getCreatureTarget(cid)), CONST_ME_MORTAREA)
addEvent(doCombat, 300, cid, combat, numberToVariant(getCreatureTarget(cid)))
addEvent(doSendMagicEffect, 300, getThingPos(getCreatureTarget(cid)), CONST_ME_MORTAREA)
addEvent(doCombat, 400, cid, combat, numberToVariant(getCreatureTarget(cid)))
addEvent(doSendMagicEffect, 400, getThingPos(getCreatureTarget(cid)), CONST_ME_MORTAREA)
addEvent(doCombat, 500, cid, combat, numberToVariant(getCreatureTarget(cid)))
addEvent(doSendMagicEffect, 500, getThingPos(getCreatureTarget(cid)), CONST_ME_MORTAREA)
addEvent(doCombat, 600, cid, combat, numberToVariant(getCreatureTarget(cid)))
addEvent(doSendMagicEffect, 600, getThingPos(getCreatureTarget(cid)), CONST_ME_MORTAREA)
addEvent(doCombat, 700, cid, combat, numberToVariant(getCreatureTarget(cid)))
addEvent(doSendMagicEffect, 700, getThingPos(getCreatureTarget(cid)), CONST_ME_MORTAREA)
addEvent(doCombat, 800, cid, combat, numberToVariant(getCreatureTarget(cid)))
addEvent(doSendMagicEffect, 800, getThingPos(getCreatureTarget(cid)), CONST_ME_MORTAREA)
addEvent(doCombat, 900, cid, combat, numberToVariant(getCreatureTarget(cid)))
addEvent(doSendMagicEffect, 900, getThingPos(getCreatureTarget(cid)), CONST_ME_MORTAREA)
addEvent(doCombat, 1000, cid, combat, numberToVariant(getCreatureTarget(cid)))
addEvent(doSendMagicEffect, 1000, getThingPos(getCreatureTarget(cid)), CONST_ME_MORTAREA)
break
end
return true
else
return doPlayerSendCancel(cid, 'You don\'t have any ammunition.')
end
else
return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUCANONLYUSEITONCREATURES)
end
else
return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
end
else
return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHMANA)
end
end
I really don't know what's wrong with it. It's an action script.
------------------------------------------------------------------------------------------------------------------------------------
Unlike the other script I posted, this one seems very critical, it seems so critical that it won't even let me copy the error.
So, I made a picture of it:
![2cf6st1.png](/proxy.php?image=http%3A%2F%2Fi55.tinypic.com%2F2cf6st1.png&hash=1872f5ed347c26630a5d791324406bbb)
Here is molotov.lua:
Lua:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 2000)
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1492)
local area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat, area)
function onUse(cid, item, fromPosition, itemEx, toPosition)
doCombat(cid, combat, var)
end
I literally pretty much copy and pasted this from spells/scripts/firebomb.lua.
I have a green flask and if I right-click->use with-> click anywhere, it would make a 3x3 field of fire.
Also, I am hoping if it's possible, can you have a shoottype of an itemID (if I use the flask from a distance, the shot type would be green flask.
Pretty much like a molotov cocktail.
Thanks!
ofcourse REP++
e.mC