[Lua]How does the kill command work ? or how can i make an npc do suicide. menu

User Tag List

Results 1 to 7 of 7
  1. #1
    Wheeze201's Avatar Active Member
    Reputation
    51
    Join Date
    Apr 2007
    Posts
    660
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Lua]How does the kill command work ? or how can i make an npc do suicide.

    I tried using the suicide spell!

    Code:
    function ziggramsummoner_OnCombat(pUnit, event)
    pUnit:FullCastSpell(59910)
    pUnit:RegisterEvent("summonziggram", 1600, 1)
    pUnit:SendChatMessage(12, 0, "I will never let it happen!!!")
    end
    
    function summonziggram(pUnit, event)
    pUnit:kill(10)
    pUnit:SpawnCreature(2000, -226.3834, 2303.4848, 94.6767, 5.82, 14, 999999999, 0, 0, 0)
    end
    
    RegisterUnitEvent(10, 1, "ziggramsummoner_OnCombat")

    Thats what it looks like.

    [Lua]How does the kill command work ? or how can i make an npc do suicide.
  2. #2
    Ground Zero's Avatar ★ Elder ★
    Reputation
    1132
    Join Date
    Aug 2008
    Posts
    3,504
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Easiest way is to make the NPC Faction 14 then cast Suicide Or Death Touch on itself Spell 8 and spell 5.

    Edit: or my personal Favourite. Consume Soul (41080)
    Example

    Code:
    function SendChatMessage(Unit, Event)
        Unit:SendChatMessage(12, 0, "I will never let it happen!!!")
        Unit:SetFaction(14)
        Unit:CastSpell(41080)
    Last edited by Ground Zero; 08-18-2009 at 02:15 PM.

  3. #3
    Wheeze201's Avatar Active Member
    Reputation
    51
    Join Date
    Apr 2007
    Posts
    660
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried Consume soul and Suicide and he casts it sure but doesn't die.

    Is there a command to modify an NPC's HP ?
    I know there is.. just forgot.

  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)
    To my knowledge Kill() works like CASTER:Kill(TARGET).

    Thus making a NPC commit suicide would be pUnit:Kill(pUnit).

    It's been a while though since I last used it though, so I'm not sure.

  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)
    Code:
    function goingtodie(pUnit, Event)
    pUnit:SetHealthPct(1)
    pUnit:RegisterEvent("Ikillmyself", 1000, 1)
    end
    
    function Ikillmyself(pUnit, Event)
     pUnit:CastSpell(11)
     pUnit:CastSpell(11)
     pUnit:CastSpell(11)
     pUnit:CastSpell(11)
     pUnit:CastSpell(11)
    end

    i dont know how much help ypur npc has, but i think it should work...It sets the health to 1 % and then cast frostbolt of ages on hisself xD

  6. #6
    Wheeze201's Avatar Active Member
    Reputation
    51
    Join Date
    Apr 2007
    Posts
    660
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Righto I will try that Xendro.

  7. #7
    Wheeze201's Avatar Active Member
    Reputation
    51
    Join Date
    Apr 2007
    Posts
    660
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Xendro View Post
    Code:
    function goingtodie(pUnit, Event)
    pUnit:SetHealthPct(1)
    pUnit:RegisterEvent("Ikillmyself", 1000, 1)
    end
    
    function Ikillmyself(pUnit, Event)
     pUnit:CastSpell(11)
     pUnit:CastSpell(11)
     pUnit:CastSpell(11)
     pUnit:CastSpell(11)
     pUnit:CastSpell(11)
    end

    i dont know how much help ypur npc has, but i think it should work...It sets the health to 1 % and then cast frostbolt of ages on hisself xD
    That worked. +rep x3

Similar Threads

  1. How does the AFK timer work?
    By Greenfire833 in forum Diablo 3 General
    Replies: 2
    Last Post: 04-24-2014, 04:52 PM
  2. [Mangos]how can i make a NPC in MangosZero?
    By Fantapower in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 04-17-2010, 03:40 PM
  3. 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
  4. What websites does the Beerstud scam work with
    By asbest0s in forum WoW Scams Help
    Replies: 2
    Last Post: 06-04-2008, 06:53 PM
  5. How can I make my server work with a static ip?
    By freezer1012 in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 12-01-2007, 11:57 PM
All times are GMT -5. The time now is 11:42 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search