Hi!
I have two questions:
1. I Root a npc on Spawn. Is it possible, that a mob stop move to right or left, if you go right or left? (and could still attack?)
2. Is it possible to deactivate Targeting of the npc's?
Thanks for all help! :wave:
Hi!
I have two questions:
1. I Root a npc on Spawn. Is it possible, that a mob stop move to right or left, if you go right or left? (and could still attack?)
2. Is it possible to deactivate Targeting of the npc's?
Thanks for all help! :wave:
:SetCombatTargetingCapable() - 1 disables it, 0 enables it. Doesn't remove old target though (so if it has you targetted it will continue to do so regardless of this command)
I'm not sure if it's possible to root the npc's facing (if that's what you mean), at least I don't know the command for it.
Yep, then he shouldn't be able to target anyone.
Ask a Emulator Expert.
Generally, SetCombatCapable(1) will stop the mob from moving. Otherwise i think there is a command, although not sure if it is working.
Unit:StopMovement(xx) xx = duration in miliseconds
Also another way (Not sure if this is working again) but if your on Aspire, in creature_proto you can flag "CanMove" column to '0', which is root.
Another thing you could try is setting your NPC's walkspeed / runspeed to 0?
Hello Xendro,
If I understand your problem correctly you are trying to root 'Mob ABC' to not rotate it's orientation (facing direction), right? This is, for as far as I know, not possible in Lua. You might make him cast a Banish spell on him, which will 'freeze' him. But when you do such a thing, he won't be able to do anything.
Maybe there are additional options to achieve what you intend to make. Could you share your intension for this idea?
I also hereby (yet again?) confirm that :SetCombatTargetingCapable(1) makes the unit unable to target anything. Replacing the 1 to a 0 will undo this effect. To make this unit entirely 'Combat Incapable', simply execute the following function OnSpawn: :SetCombatCapable(1) --> disabling all the combat capabilities.
Kindest Regards,
Claiver
Last edited by Claiver; 06-03-2009 at 02:48 PM.
A lot of the emulation experts don't actually know an awefull lot about emulation
Anyway back on topic - As dynashock said to stop it attacking you do that, to stop it moving pUnit:StopMovement(1000) is 1 secon
To make the npc so it is not attackable by the players do the following:
local UNIT_FLAG_NOT_ATTACKABLE_2 = 0x00000002
local UNIT_NPC_FLAGS = OBJECT_END + 0x028
pUnit:SetFieldFlags(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2)
Thanks for all of your replys and trying to help.
I want to script Kologarn.
I use Aspire at the moment and i made Kologarn and of course his arms non-moveable(dont know if this word exists^^) with the entry in the database 'CanMove'.
Now, some of you maybe know Kologarn. He looks only forward, whatever attacked him, and his arms didnt target anything.(SetCombatTargetingCapable(1) :P)
Code:If I understand your problem correctly you are trying to root 'Mob ABC' to not rotate it's orientation (facing direction), right?
Right Claiver, thanks for the tips.
And Stoneharry, thanks too, You answer another question, before i ask it^^.
Now i know how to make Units not attackable.
+ teh rep all of you!1