Custom GM command @mobskill for...testing purposes...
Posted: Wed Aug 07, 2013 7:53 pm
This command allows you to force a mob to use a mob skill of your choosing. Only works on mobs that are engaged with someone (apparently works if mob is dead as well and causes it to go through death code again).
Add this line to your commands.conf:
Replace # with the next number after your latest command. Change permission to whatever permission number you'd like of course.
Make mobskill.lua in scripts/commands/ with the following code:
Format of command is as follows: @mobskill mobid mobskillid dmg
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.
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.