What's new

Weapons MultiShot Wand

buchaLL

bez spiny, luźno
Joined
Aug 2, 2011
Messages
1,013
Reaction score
68
Age
24
Podgl?d:
6s7k5ts.gif



weapons.xml
[xml]<wand id="7958" level="8" mana="15" event="script" value="script_name.lua">
</wand>[/xml]

script_name.lua
[lua]--- Multishot Weapon ---
--- by buchaLL -----

function onUseWeapon(cid, var)
local config = {mindmg = 80, maxdmg =140, effect = 28, dmg = COMBAT_ICEDAMAGE, shots = 10}

local targets_table = {}
local self = getCreatureName(cid)
local target, targets = getCreatureTarget(cid), getSpectators(getThingPos(cid), self.shootrange, self.shootrange)

for i = 1, config.shots do
target = targets
table.insert(targets_table, target)
end

for v = 1, #targets_table do
addEvent(function()
if isCreature(targets_table[v]) and isCreature(targets_table[v]) and isMonster(targets_table[v]) then
doSendDistanceShoot(getThingPos(cid), getThingPos(targets_table[v]), config.effect)
doTargetCombatHealth(cid, targets_table[v], config.dmg, -config.mindmg, -config.maxdmg, 187)
end
end, 1)
end

return true
end [/lua]
 
Top