How to Kill an NPC in Lua menu

Shout-Out

User Tag List

Results 1 to 4 of 4
  1. #1
    controlsx2's Avatar Member
    Reputation
    16
    Join Date
    Jun 2007
    Posts
    223
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to Kill an NPC in Lua

    I have a Boss NPC, that spawns ads, at 25% HP he summons a larger add which cannot die. When the Boss hits <18% HP he turns Friendly and eventually after a small speech walks away. But i want him to kill the Large Add thats spawned when he becomes friendly.

    Ive tried Having him Cast Death Touch on the Add and using :Kill() command

    What else can i do?

    here is my script

    Code:
    function BossThree_f(Unit, Event)
    if Unit:GetHealthPct() <= 12 then
    Unit:RemoveEvents()
    Unit:CastSpellOnTarget(5,Unit:GetRandomFriend())
    Unit:CastSpellOnTarget(05,Unit:GetRandomFriend())
    Unit:CastSpellOnTarget(5,Unit:GetRandomFriend())
    Unit:SetCombatCapable(1)
    Unit:SetFaction(35)
    Unit:SetHealthPct(99)
    Unit:SendChatMessage(10, 0, "The Curse is Broken, Hadronixx Lifts His Fangs and Slams them into the Neck of His Mate")
    Unit:Kill(mate)
    Unit:CastSpellOnTarget(5,mate)
    Unit:SendChatMessage(14, 0, "STOP PLEASE!")
    Unit:RegisterEvent("Boss_TalkStart4", 3200, 0)
    end
    end
    Last edited by controlsx2; 06-21-2009 at 08:37 PM.

    How to Kill an NPC in Lua
  2. #2
    xnerdx's Avatar Member
    Reputation
    2
    Join Date
    Nov 2008
    Posts
    20
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would have to say your script would have to be written in C++ because the LUA Engines don't support any commands like that

  3. #3
    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 xnerdx View Post
    I would have to say your script would have to be written in C++ because the LUA Engines don't support any commands like that
    *facepalm*

    Anyway,


    Code:
    
    function BossThree_f(Unit, Event)
    if Unit:GetHealthPct() <= 12 then
    Unit:RemoveEvents()
    Unit:CastSpellOnTarget(5,Unit:GetRandomFriend())
    Unit:CastSpellOnTarget(05,Unit:GetRandomFriend())
    Unit:CastSpellOnTarget(5,Unit:GetRandomFriend())
    Unit:SetCombatCapable(1)
    Unit:SetFaction(35)
    Unit:SetHealthPct(99)
    mate:SetHealthPct(1)
    Unit:SendChatMessage(10, 0, "The Curse is Broken, Hadronixx Lifts His Fangs and Slams them into the Neck of His Mate")
    Unit:FullCastSpellOnTarget(11, mate)
    Unit:CastSpellOnTarget(5,mate)
    Unit:SendChatMessage(14, 0, "STOP PLEASE!")
    Unit:RegisterEvent("Boss_TalkStart4", 3200, 0)
    end
    end


    Death touch does not work when a npc casts it for some reason, don't ask me why.
    Last edited by stoneharry; 06-21-2009 at 04:44 AM.

  4. #4
    controlsx2's Avatar Member
    Reputation
    16
    Join Date
    Jun 2007
    Posts
    223
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by stoneharry View Post
    *facepalm*

    Anyway,


    Code:
    
    function BossThree_f(Unit, Event)
    if Unit:GetHealthPct() <= 12 then
    Unit:RemoveEvents()
    Unit:CastSpellOnTarget(5,Unit:GetRandomFriend())
    Unit:CastSpellOnTarget(05,Unit:GetRandomFriend())
    Unit:CastSpellOnTarget(5,Unit:GetRandomFriend())
    Unit:SetCombatCapable(1)
    Unit:SetFaction(35)
    Unit:SetHealthPct(99)
    mate:SetHealthPct(1)
    Unit:SendChatMessage(10, 0, "The Curse is Broken, Hadronixx Lifts His Fangs and Slams them into the Neck of His Mate")
    Unit:FullCastSpellOnTarget(11, mate)
    Unit:CastSpellOnTarget(5,mate)
    Unit:SendChatMessage(14, 0, "STOP PLEASE!")
    Unit:RegisterEvent("Boss_TalkStart4", 3200, 0)
    end
    end


    Death touch does not work when a npc casts it for some reason, don't ask me why.
    It worked! Thx your teh awesomeness xD +Rep

Similar Threads

  1. [Guide] How to make a NPC cast spells. NO LUA!
    By Power of Illuminati in forum WoW EMU Guides & Tutorials
    Replies: 52
    Last Post: 05-06-2011, 07:13 AM
  2. [Tutorial] [Lua][Noob Friendly] How to make Teleporter NPC w/ diff menu's
    By Asbonia in forum WoW EMU Guides & Tutorials
    Replies: 5
    Last Post: 09-09-2010, 06:11 PM
  3. [LUA] Boss - How to kill himself?
    By Kaidos in forum WoW EMU Questions & Requests
    Replies: 10
    Last Post: 02-28-2009, 12:37 PM
  4. [Help] How to make an NPC Talk with Lua
    By Silentnvd in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 07-26-2008, 08:08 PM
  5. How to kill warriors as a rogue.
    By volcom in forum World of Warcraft Guides
    Replies: 24
    Last Post: 10-16-2006, 02:54 AM
All times are GMT -5. The time now is 12:18 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