2017-06-14 22:24:09 -04:00
|
|
|
require ("global")
|
|
|
|
require ("utils")
|
|
|
|
|
2016-03-12 02:54:03 -05:00
|
|
|
--[[
|
|
|
|
|
|
|
|
AttackWeaponSkill Script
|
|
|
|
|
|
|
|
Finds the correct weaponskill subscript to fire when a weaponskill actor is activated.
|
|
|
|
|
|
|
|
--]]
|
|
|
|
|
2017-06-14 22:24:09 -04:00
|
|
|
function onEventStarted(player, command, triggerName, arg1, arg2, arg3, arg4, targetActor, arg5, arg6, arg7, arg8)
|
|
|
|
|
|
|
|
--Are they in active mode?
|
2016-06-15 03:41:23 +01:00
|
|
|
if (player:GetState() != 2) then
|
2017-06-14 22:24:09 -04:00
|
|
|
player:SendGameMessage(GetWorldMaster(), 32503, 0x20);
|
|
|
|
player:endEvent();
|
|
|
|
return;
|
2016-03-12 02:54:03 -05:00
|
|
|
end
|
|
|
|
|
2017-08-26 04:08:26 +01:00
|
|
|
if not player.aiContainer.IsEngaged() then
|
|
|
|
player.Engage(targetActor);
|
|
|
|
end;
|
|
|
|
player.WeaponSkill(command.actorId, targetActor);
|
|
|
|
player:endEvent();
|
2017-08-30 00:14:14 +01:00
|
|
|
end;
|