Making an NPC unattackable druing the fight menu

User Tag List

Results 1 to 7 of 7
  1. #1
    Deathbringer123's Avatar Master Sergeant
    Reputation
    25
    Join Date
    Oct 2010
    Posts
    121
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Making an NPC unattackable druing the fight

    Heya

    Well i am scripting a Lua Boss and at say 10% i want him to stop attacking and make him unattackable (SetFlags(2)) but i tryed just doing the mod flags druing the fight and he continues to attack so how would i go about Stoping him attacking? to give a rough idea:

    At 10% Stops attacking and Players Can not deal damage
    some Talking etc
    Then at the end i would change his flags back to 1 and he would kill himself

    The Green bit is the bit i cant do ...

    Any Help is Greatly apreciated!

    Thanks
    Death!

    Making an NPC unattackable druing the fight
  2. #2
    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)
    SetCombatCapable(1)
    Root()

    To change the flags, you have to call the actual UINT32 values, and I can never get this specific one to work.

    Just cast a spell that makes him invulnerable, and then remove that aura when you want to continue.

  3. #3
    Harambeqt's Avatar Elite User CoreCoins Purchaser
    Reputation
    333
    Join Date
    Mar 2010
    Posts
    1,206
    Thanks G/R
    9/29
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    make the boss cast shadowprison (Used by illidan) 1 Min stun.
    Support the #1 WoW Emulator:
    http://arcemu.org/
    https://github.com/arcemu/arcemu
    - - -

  4. #4
    Deathbringer123's Avatar Master Sergeant
    Reputation
    25
    Join Date
    Oct 2010
    Posts
    121
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank You Both !

  5. #5
    92eatos's Avatar Contributor
    Reputation
    104
    Join Date
    Aug 2009
    Posts
    220
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    _unit->SetUInt64Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
    _unit->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, 35);
    _unit->GetAIInterface()->disable_melee = true;
    _unit->GetAIInterface()->SetAllowedToEnterCombat(false);


    That will work fine

  6. #6
    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 92eatos View Post
    _unit->SetUInt64Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
    _unit->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, 35);
    _unit->GetAIInterface()->disable_melee = true;
    _unit->GetAIInterface()->SetAllowedToEnterCombat(false);


    That will work fine
    It won't actually. It will make him untargetable, and friendly, but players will continue to hit him with auto attack.

    Bit of a hack'y fix don't ya' think?

    Also I believe he was happy with the solutions given already, 3 days ago.

  7. #7
    SpellEffects's Avatar Sergeant
    Reputation
    64
    Join Date
    Apr 2011
    Posts
    69
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by stoneharry View Post
    It won't actually. It will make him untargetable, and friendly, but players will continue to hit him with auto attack.

    Bit of a hack'y fix don't ya' think?

    Also I believe he was happy with the solutions given already, 3 days ago.
    Indeed, and 92eatos, why give him a C++ solution when he asked for a solution in Lua?
    uint32 = -1;
    I guess some people just find it hard to input their question into a field and press enter.

    Check out my blog here on the forums

Similar Threads

  1. How to make an NPC walk backwards (as in with the backwards animation)?
    By Jameswow123 in forum World of Warcraft General
    Replies: 1
    Last Post: 03-07-2011, 04:00 PM
  2. [Database] How do I make an npc fire a bow without the bow disappearing?
    By Jameswow123 in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 01-28-2011, 04:50 AM
  3. [Lua]How does the kill command work ? or how can i make an npc do suicide.
    By Wheeze201 in forum WoW EMU Questions & Requests
    Replies: 6
    Last Post: 08-18-2009, 06:50 PM
  4. How do I make an NPC Hover in the Air?
    By BlackChaosAngel in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 09-20-2008, 02:51 PM
  5. How to make custom npc's In the easy way!
    By Synthio in forum WoW EMU Guides & Tutorials
    Replies: 15
    Last Post: 05-23-2008, 08:36 AM
All times are GMT -5. The time now is 08:28 PM. 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