Adjusting NPC speed does not seem to synch with adjusting player movement speed. Ie., MovementLoop LUA for NPCs, each whole number dramatically increases the speed of the NPC - whereas the /speed {#} command for players seems more finely tuned.
With this info, I'm trying to use a spell script to slow an NPC's movement by using SetSpeed(Target), but I am failing. If this is not supported, you can stop reading and reply "not supported yet" heh. If it should work, continue please
Here's my spell script for handling DD/Snare:
Code: Select all
--[[
Script Name : dd_snare.lua
Script Purpose : Generic damage + Snare effect script
Script Author : John Adams
Script Date : 2008.12.04
--]]
function cast(Caster, Target, DDType, MinDDVal, MaxDDVal, SnareAmount, DispelChance)
-- DD component
if MaxDDVal ~= nil and MinDDVal < MaxDDVal then
SpellDamage(Target, DDType, math.random(MinDDVal, MaxDDVal))
else
SpellDamage(Target, DDType, MinDDVal)
end
-- Snare component
OriginalSpeed = GetSpeed(Target)
newSpeed = OriginalSpeed - (OriginalSpeed * (SnareAmount / 100))
if OriginalSpeed > newSpeed then
SetSpeed(Target, newSpeed)
end
end
function tick(Caster, Target, DDType, MinDDVal, MaxDDVal, SnareAmount, DispelChance)
SetSpeed(Target, newSpeed)
endI've also tried duplicating Snare component calcs in the tick() function itself with no luck.
Any advice?