LUA Script menu

User Tag List

Thread: LUA Script

Results 1 to 5 of 5
  1. #1
    Grimton1337's Avatar Private
    Reputation
    2
    Join Date
    Dec 2012
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    LUA Script

    Code:
    function Knight_OnCombat(Unit, event)
    Unit:SendChatMessage(14, 0, "You dare challenge me? I am your worst NIGHTMARE!")
    Unit:EquipWeapons(40343, 0, 0)
    end
    
    RegisterUnitEvent(141001, 1, "Knight_OnCombat")
    
    function Knight_Phase1Checker(Unit, event)
    if(Unit:GetHealthPct() <= 85) then
    Unit:RemoveEvents()
    Unit:SendChatMessage(14, 0, "Do you want to see a true Cataclysm!? So be it!")
    Unit:RegisterEvent("Ghoulzzzz", 30000, 0)
    Unit:RegisterEvent("Quakemoar", 45000, 0)
    Unit:RegisterEvent("DrainLifeZor", 23000, 0)
    end
    end
    
    function Ghoulzzzz(Unit, event)
    local player = Unit:GetRandomPlayer(0)
    local x, y, z = player:GetX(), player:GetY(), player:GetZ()
    Unit:CastSpellAoF(x, y, z, 67761)
    Unit:SendChatMessage(42, 0, "The Black Knight begins to summon his minions!")
    Unit:SendChatMessage(14, 0, "Rise, my minions and obey your master's call! Destroy our enemies!")
    end
    
    function Quakemoar(Unit, event)
    local targets = Unit:GetInRangePlayers()
    Unit:FullCastSpellOnTarget(72262, targets)
    Unit:SendChatMessage(42, 0, "The Black Knight begins to cast Quake")
    Unit:SendChatMessage(14, 0, "You will all bow before your beloved master!")
    end
    
    function DrainLifeZor(Unit, event)
    local victim = Unit:GetRandomPlayer(0)
    Unit:FullCastSpellOnTarget(38817, victim)
    local Choice = math.random(1, 2)
    if(Choice == 1) then
    Unit:SendChatMessage(14, 0, "Your life is so full of energy!")
    end
    if(Choice == 2) then
    Unit:SendChatMessage(14, 0, "How long can you resist?")
    end
    end
    
    function Knight_Phase2Checker(Unit, event)
    if(Unit:GetHealthPct() <= 50) then
    Unit:RemoveEvents()
    Unit:RegisterEvent("ShadowBoltVolleyz", 30000, 0)
    Unit:RegisterEvent("FrostNovaz", 30000, 0)
    end
    end
    
    function ShadowBoltVolleyz(Unit, event)
    local targets = Unit:GetInRangePlayers()
    Unit:FullCastSpellOnTarget(36736, targets)
    end
    
    function FrostNovaz(Unit, event)
    local targets = Unit:GetInRangePlayers()
    local Choice = math.random(1, 2)
    Unit:FullCastSpellOnTarget(32365, targets)
    Unit:SendChatMessage(42, 0, "The Black Knight froze you and teleported to the Center of the Area. The Black Knight begins to cast Shadow Bolt Volley")
    if(Choice == 1) then
    Unit:SendChatMessage(14, 0, "Now, you will all die before me!")
    end
    if(Choice == 2) then
    Unit:SendChatMessage(14, 0, "Die, mortals! DIE!")
    end
    end
    
    function Knight_Phase3Checker(Unit, event)
    if(Unit:GetHealthPct() <= 25) then
    Unit:RemoveEvents()
    Unit:SendChatMessage(14, 0, "No, I shall not be defeated by mortals! Minions, aid me!")
    Unit:RegisterEvent("Summon_Advanced_Minions", 1000, 1)
    Unit:RegisterEvent("Healzzzzzzzzzzzzzzz", 2000, 5)
    end
    end
    
    function Summon_Advanced_Minions(Unit, event)
    local player = GetClosestPlayer()
    local x, y, z = player:GetX(), player:GetY(), player:GetZ()
    Unit:SpawnCreature(14385, x, y, z, math.random(1, 5), 14, 0, 0, 0, 0, 4, 1)
    Unit:SpawnCreature(14385, x, y, z, math.random(1, 5), 14, 0, 0, 0, 0, 4, 1)
    Unit:SpawnCreature(14385, x, y, z, math.random(1, 5), 14, 0, 0, 0, 0, 4, 1)
    end
    
    function Healzzzzzzzzzzzzzzz(Unit, event)
    Unit:FullCastSpell(66104)
    end
    
    function Knight_FinalPhaseChecker(Unit, player, event)
    if(Unit:GetHealthPct() < 11) then
    Unit:RemoveEvents()
    Unit:SetFaction(35)
    player:StopPlayerAttack()
    Unit:Emote(1, 0)
    Unit:SendChatMessage(12, 0, "I... I've killed so many that I've lost count... I can't come back from this. I'm a monster! But, I am still somewhere inside, more than that...")
    Unit:EventChat(12, 0, "Better... Than that.", 10000)
    Unit:RegisterEvent("Suicidezzzzzzzzzzzzzzz", 3000, 1)
    end
    end
    
    function Suicidezzzzzzzzzzzzzzz(Unit, event)
    Unit:CastSpell(5)
    Unit:CastSpell(59084)
    end
    Hey XD

    Well, I tried my script, and it doesn't seem to work. When his HP % reaches 85 he doesn't do a crap. Same for the other ones... Help?

    LUA Script
  2. #2
    Meiya Stormsinger's Avatar Contributor

    Reputation
    163
    Join Date
    Mar 2009
    Posts
    196
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Grimton1337 View Post
    Code:
    function Knight_OnCombat(Unit, event)
    Unit:SendChatMessage(14, 0, "You dare challenge me? I am your worst NIGHTMARE!")
    Unit:EquipWeapons(40343, 0, 0)
    Unit:RegisterEvent("Knight_Phase1Checker", 0, 0) --This wasn't added, it needs to check for the event to happend... You need to do this with all the functions, or well register them wherever you want him to use them.
    end
    
    RegisterUnitEvent(141001, 1, "Knight_OnCombat")
    
    function Knight_Phase1Checker(Unit, event)
    if(Unit:GetHealthPct() <= 85) then
    Unit:RemoveEvents()
    Unit:SendChatMessage(14, 0, "Do you want to see a true Cataclysm!? So be it!")
    Unit:RegisterEvent("Ghoulzzzz", 30000, 0)
    Unit:RegisterEvent("Quakemoar", 45000, 0)
    Unit:RegisterEvent("DrainLifeZor", 23000, 0)
    end
    end
    
    function Ghoulzzzz(Unit, event)
    local player = Unit:GetRandomPlayer(0)
    local x, y, z = player:GetX(), player:GetY(), player:GetZ()
    Unit:CastSpellAoF(x, y, z, 67761)
    Unit:SendChatMessage(42, 0, "The Black Knight begins to summon his minions!")
    Unit:SendChatMessage(14, 0, "Rise, my minions and obey your master's call! Destroy our enemies!")
    end
    
    function Quakemoar(Unit, event)
    local targets = Unit:GetInRangePlayers()
    Unit:FullCastSpellOnTarget(72262, targets)
    Unit:SendChatMessage(42, 0, "The Black Knight begins to cast Quake")
    Unit:SendChatMessage(14, 0, "You will all bow before your beloved master!")
    end
    
    function DrainLifeZor(Unit, event)
    local victim = Unit:GetRandomPlayer(0)
    Unit:FullCastSpellOnTarget(38817, victim)
    local Choice = math.random(1, 2)
    if(Choice == 1) then
    Unit:SendChatMessage(14, 0, "Your life is so full of energy!")
    end
    if(Choice == 2) then
    Unit:SendChatMessage(14, 0, "How long can you resist?")
    end
    end
    
    function Knight_Phase2Checker(Unit, event)
    if(Unit:GetHealthPct() <= 50) then
    Unit:RemoveEvents()
    Unit:RegisterEvent("ShadowBoltVolleyz", 30000, 0)
    Unit:RegisterEvent("FrostNovaz", 30000, 0)
    end
    end
    
    function ShadowBoltVolleyz(Unit, event)
    local targets = Unit:GetInRangePlayers()
    Unit:FullCastSpellOnTarget(36736, targets)
    end
    
    function FrostNovaz(Unit, event)
    local targets = Unit:GetInRangePlayers()
    local Choice = math.random(1, 2)
    Unit:FullCastSpellOnTarget(32365, targets)
    Unit:SendChatMessage(42, 0, "The Black Knight froze you and teleported to the Center of the Area. The Black Knight begins to cast Shadow Bolt Volley")
    if(Choice == 1) then
    Unit:SendChatMessage(14, 0, "Now, you will all die before me!")
    end
    if(Choice == 2) then
    Unit:SendChatMessage(14, 0, "Die, mortals! DIE!")
    end
    end
    
    function Knight_Phase3Checker(Unit, event)
    if(Unit:GetHealthPct() <= 25) then
    Unit:RemoveEvents()
    Unit:SendChatMessage(14, 0, "No, I shall not be defeated by mortals! Minions, aid me!")
    Unit:RegisterEvent("Summon_Advanced_Minions", 1000, 1)
    Unit:RegisterEvent("Healzzzzzzzzzzzzzzz", 2000, 5)
    end
    end
    
    function Summon_Advanced_Minions(Unit, event)
    local player = GetClosestPlayer()
    local x, y, z = player:GetX(), player:GetY(), player:GetZ()
    Unit:SpawnCreature(14385, x, y, z, math.random(1, 5), 14, 0, 0, 0, 0, 4, 1)
    Unit:SpawnCreature(14385, x, y, z, math.random(1, 5), 14, 0, 0, 0, 0, 4, 1)
    Unit:SpawnCreature(14385, x, y, z, math.random(1, 5), 14, 0, 0, 0, 0, 4, 1)
    end
    
    function Healzzzzzzzzzzzzzzz(Unit, event)
    Unit:FullCastSpell(66104)
    end
    
    function Knight_FinalPhaseChecker(Unit, player, event)
    if(Unit:GetHealthPct() < 11) then
    Unit:RemoveEvents()
    Unit:SetFaction(35)
    player:StopPlayerAttack()
    Unit:Emote(1, 0)
    Unit:SendChatMessage(12, 0, "I... I've killed so many that I've lost count... I can't come back from this. I'm a monster! But, I am still somewhere inside, more than that...")
    Unit:EventChat(12, 0, "Better... Than that.", 10000)
    Unit:RegisterEvent("Suicidezzzzzzzzzzzzzzz", 3000, 1)
    end
    end
    
    function Suicidezzzzzzzzzzzzzzz(Unit, event)
    Unit:CastSpell(5)
    Unit:CastSpell(59084)
    end
    Hey XD

    Well, I tried my script, and it doesn't seem to work. When his HP % reaches 85 he doesn't do a crap. Same for the other ones... Help?
    Notice my edit to the script, it's marked in red.

  3. #3
    Grimton1337's Avatar Private
    Reputation
    2
    Join Date
    Dec 2012
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It didn't do any good. I copied everything that you gave me and here is the result:


  4. #4
    Meiya Stormsinger's Avatar Contributor

    Reputation
    163
    Join Date
    Mar 2009
    Posts
    196
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ugh, add my skype: rooawr

  5. #5
    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)
    This should work:

    Code:
    function Knight_OnCombat(Unit, event)
    	Unit:SendChatMessage(14, 0, "You dare challenge me? I am your worst NIGHTMARE!")
    	Unit:EquipWeapons(40343, 0, 0)
    	Unit:RegisterEvent("Knight_Phase1Checker", 1000, 0)
    end
    
    RegisterUnitEvent(141001, 1, "Knight_OnCombat")
    
    function Knight_Phase1Checker(Unit, event)
    	if(Unit:GetHealthPct() <= 85) then
    		Unit:RemoveEvents()
    		Unit:SendChatMessage(14, 0, "Do you want to see a true Cataclysm!? So be it!")
    		Unit:RegisterEvent("Ghoulzzzz", 30000, 0)
    		Unit:RegisterEvent("Quakemoar", 45000, 0)
    		Unit:RegisterEvent("DrainLifeZor", 23000, 0)
    		Unit:RegisterEvent("Knight_Phase2Checker", 1000, 0)
    	end
    end
    
    function Ghoulzzzz(Unit, event)
    	local player = Unit:GetRandomPlayer(0)
    	if player then
    		local x, y, z = player:GetX(), player:GetY(), player:GetZ()
    		Unit:CastSpellAoF(x, y, z, 67761)
    		Unit:SendChatMessage(42, 0, "The Black Knight begins to summon his minions!")
    		Unit:SendChatMessage(14, 0, "Rise, my minions and obey your master's call! Destroy our enemies!")
    	end
    end
    
    function Quakemoar(Unit, event)
    	local targets = Unit:GetInRangePlayers()
    	for _,v in pairs(targets) do
    		Unit:FullCastSpellOnTarget(72262, v)
    		Unit:SendChatMessage(42, 0, "The Black Knight begins to cast Quake")
    		Unit:SendChatMessage(14, 0, "You will all bow before your beloved master!")
    	end
    end
    
    function DrainLifeZor(Unit, event)
    	local victim = Unit:GetRandomPlayer(0)
    	if victim then
    		Unit:FullCastSpellOnTarget(38817, victim)
    		local Choice = math.random(1, 2)
    		if(Choice == 1) then
    			Unit:SendChatMessage(14, 0, "Your life is so full of energy!")
    		end
    		if(Choice == 2) then
    			Unit:SendChatMessage(14, 0, "How long can you resist?")
    		end
    	end
    end
    
    function Knight_Phase2Checker(Unit, event)
    	if(Unit:GetHealthPct() <= 50) then
    		Unit:RemoveEvents()
    		Unit:RegisterEvent("ShadowBoltVolleyz", 30000, 0)
    		Unit:RegisterEvent("FrostNovaz", 30000, 0)
    		Unit:RegisterEvent("Knight_Phase3Checker", 1000, 0)
    	end
    end
    
    function ShadowBoltVolleyz(Unit, event)
    	local targets = Unit:GetInRangePlayers()
    	for _,v in pairs(targets) do
    		Unit:FullCastSpellOnTarget(36736, v)
    	end
    end
    
    function FrostNovaz(Unit, event)
    	local targets = Unit:GetInRangePlayers()
    	local Choice = math.random(1, 2)
    	for _,v in pairs(targets) do
    		Unit:FullCastSpellOnTarget(32365, v)
    	end
    	Unit:SendChatMessage(42, 0, "The Black Knight froze you and teleported to the Center of the Area. The Black Knight begins to cast Shadow Bolt Volley")
    	if(Choice == 1) then
    		Unit:SendChatMessage(14, 0, "Now, you will all die before me!")
    	end
    	if(Choice == 2) then
    		Unit:SendChatMessage(14, 0, "Die, mortals! DIE!")
    	end
    end
    
    function Knight_Phase3Checker(Unit, event)
    	if(Unit:GetHealthPct() <= 25) then
    		Unit:RemoveEvents()
    		Unit:SendChatMessage(14, 0, "No, I shall not be defeated by mortals! Minions, aid me!")
    		Unit:RegisterEvent("Summon_Advanced_Minions", 1000, 1)
    		Unit:RegisterEvent("Healzzzzzzzzzzzzzzz", 2000, 5)
    		Unit:RegisterEvent("Knight_FinalPhaseChecker", 1000, 0)
    	end
    end
    
    function Summon_Advanced_Minions(Unit, event)
    	local player = GetClosestPlayer()
    	if player then
    		local x, y, z = player:GetX(), player:GetY(), player:GetZ()
    		Unit:SpawnCreature(14385, x, y, z, math.random(1, 5), 14, 0, 0, 0, 0, 4, 1)
    		Unit:SpawnCreature(14385, x, y, z, math.random(1, 5), 14, 0, 0, 0, 0, 4, 1)
    		Unit:SpawnCreature(14385, x, y, z, math.random(1, 5), 14, 0, 0, 0, 0, 4, 1)
    	end
    end
    
    function Healzzzzzzzzzzzzzzz(Unit, event)
    	Unit:FullCastSpell(66104)
    end
    
    function Knight_FinalPhaseChecker(Unit, player, event)
    	if(Unit:GetHealthPct() < 11) then
    		Unit:RemoveEvents()
    		Unit:SetFaction(35)
    		player:StopPlayerAttack()
    		Unit:Emote(1, 0)
    		Unit:SendChatMessage(12, 0, "I... I've killed so many that I've lost count... I can't come back from this. I'm a monster! But, I am still somewhere inside, more than that...")
    		Unit:EventChat(12, 0, "Better... Than that.", 10000)
    		Unit:RegisterEvent("Suicidezzzzzzzzzzzzzzz", 3000, 1)
    	end
    end
    
    function Suicidezzzzzzzzzzzzzzz(Unit, event)
    	Unit:CastSpell(59084)
    	Unit:Kill(Unit)
    end

Similar Threads

  1. [Guide] Lua Scripting Guide is here [Updating]
    By Illidan1 in forum WoW EMU Guides & Tutorials
    Replies: 93
    Last Post: 11-04-2008, 06:56 PM
  2. [GUIDE] How to activate LUA scripts
    By ~SaiLyn~ in forum WoW EMU Guides & Tutorials
    Replies: 3
    Last Post: 12-25-2007, 11:52 AM
  3. Lua Scripts!
    By danis in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 12-15-2007, 03:16 PM
  4. How To LUA Script
    By Skuxta in forum WoW EMU Guides & Tutorials
    Replies: 1
    Last Post: 12-13-2007, 04:24 AM
  5. New LUA Scripts
    By 777devil777 in forum World of Warcraft Emulator Servers
    Replies: 8
    Last Post: 11-26-2007, 05:58 PM
All times are GMT -5. The time now is 05:17 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