Add this line to your commands.conf:
Code: Select all
commands_ini[#] = { ["name"] = "mobskill", ["path"] = "scripts/commands", ["permission"] = "1", ["parameters"] = "iii" };
Make mobskill.lua in scripts/commands/ with the following code:
Code: Select all
-----------------------------------
-- [Command name]: mobskill
-- [Author ]: Troak
-- [Description ]: Forces mob to use mobskill (with option to adjust mob damage)
-----------------------------------
-----------------------------------
-- Action
-----------------------------------
function onTrigger(player,mobid,mobskillid,dmg)
if(mobid ~= nil and mobskillid ~= nil) then
local mob = GetMobByID(mobid);
if(mob ~= nil) then
if(dmg ~= nil) then
mob:setDamage(dmg);
mob:useMobAbility(mobskillid);
else
mob:useMobAbility(mobskillid);
end
end
end
end;
For example: @mobskill 17408018 696 (will cause Fafnir to Spike Flail)
The mobskillid is taken from mob_skill.sql
The dmg parameter is optional. When used, it set's the mob's main weapon damage to the number you specify. Leave it blank if you don't wish to use it. The damage change carries over beyond just the skill usage.
The command is scripted so that your server shouldn't crash if you accidentally leave out parameters.