[Lua Question] Npc not moving and target question menu

User Tag List

Results 1 to 10 of 10
  1. #1
    Kaidos's Avatar Contributor
    Reputation
    148
    Join Date
    Jun 2008
    Posts
    324
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Lua Question] Npc not moving and target question

    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:

    [Lua Question] Npc not moving and target question
  2. #2
    Dynashock's Avatar Contributor

    Reputation
    176
    Join Date
    Nov 2007
    Posts
    203
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    :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.

  3. #3
    Kaidos's Avatar Contributor
    Reputation
    148
    Join Date
    Jun 2008
    Posts
    324
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Dynashock View Post
    :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)...
    So, :SetCombatTargetingCapable(1) should i do at spawn, so he dont target players?^^
    Last edited by Kaidos; 06-03-2009 at 12:25 PM.

  4. #4
    Dynashock's Avatar Contributor

    Reputation
    176
    Join Date
    Nov 2007
    Posts
    203
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep, then he shouldn't be able to target anyone.

  5. #5
    Kaidos's Avatar Contributor
    Reputation
    148
    Join Date
    Jun 2008
    Posts
    324
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Dynashock View Post
    Yep, then he shouldn't be able to target anyone.
    Thanks, +rep

    Now to the 2. Question:

    Does anyone know how to root the mob, that he dont move with the attacking player?

  6. #6
    Glorianglorre's Avatar Active Member
    Reputation
    40
    Join Date
    Feb 2009
    Posts
    340
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ask a Emulator Expert.

  7. #7
    Vision1000's Avatar Member
    Reputation
    104
    Join Date
    Jun 2008
    Posts
    122
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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?

  8. #8
    Claiver's Avatar Member
    Reputation
    138
    Join Date
    Mar 2009
    Posts
    217
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  9. #9
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Glorianglorre View Post
    Ask a Emulator Expert.

    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)

  10. #10
    Kaidos's Avatar Contributor
    Reputation
    148
    Join Date
    Jun 2008
    Posts
    324
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

Similar Threads

  1. [Lua] Make mobs with sound. And a trigger question.
    By sammiboy in forum WoW EMU Questions & Requests
    Replies: 5
    Last Post: 09-26-2008, 09:04 AM
  2. [Lua Question] Flying npc
    By bill45 in forum World of Warcraft Emulator Servers
    Replies: 15
    Last Post: 06-03-2008, 06:35 PM
  3. Creatures are not moving and map ain't exploring...
    By BigFatLord in forum World of Warcraft Emulator Servers
    Replies: 15
    Last Post: 03-24-2008, 05:14 PM
  4. [Question] Have a npc do commands and sell item sets
    By Rednexx in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 11-20-2007, 03:15 AM
All times are GMT -5. The time now is 04:03 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search