chaosnight

Rednightwow Forums
 
HomeHome  FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  Log in  

Share | 
 

 anuthar lua script

Go down 
AuthorMessage
sharrior
GM
GM
avatar

Posts : 78
Join date : 2008-09-25
Age : 22
Location : Norway

PostSubject: anuthar lua script   Fri Nov 06, 2009 7:26 pm

Not that advanced, Im kinda rusty and not quiet sure that this'll work as intended.


Code:

local NPCNAME = Karnazur



function NPCNAME_OnEnterCombat (pUnit, Event)
   pUnit:SetFaction(7)
   pUnit:SetMovementType(fly)
   pUnit:SendChatMessage (12, 0, "Im Going to pwn you!")
   pUnit:RegisterEvent("NPCNAME_talk", 100000000, 1)
   pUnit:RegisterEvent("NPCNAME_Spell", 1000000, 10)
   pUnit:RegisterEvent("NPCNAME_CheckA", 20000, 10)
   pUnit:RegisterEvent("NPCNAME_CheckB", 35000, 10)
   pUnit:RegisterEvent("NPCNAME_CheckC", 40000, 10)
   pUnit:RegisterEvent("NPCNAME_CheckD", 40000, 10)
   pUnit:RegisterEvent("NPCNAME_CheckE", 60000, 10)
   pUnit:RegisterEvent("NPCNAME_Spell2", 600000, 5)
end




function NPCNAME_talk(pUnit, Event)
   Choice = math.random (1, 10)
      if choice == 1 then
         pUnit:SendChatMessage( 12, 0, "My my...you killed my father,I thought he were stronger than me too")
         pUnit:SendChatMessage(14, 0, "YOU GIVE ME NO CHOICE THEN OTHER THAN TO DESTROY YOU AND AVENGE MY FATHER!")
         pUnit:SetScale(5)
         pUnit:SetModel(19327)
         pUnit:CastSpell(49222)
      end


      if choice == 2 then
         pUnit:SendChatMessage(12, 0, "So my father failed following the way to immortality")
         pUnit:SetModel(18237)
         pUnit:SetScale(5)
         pUnit:SendChatMessage(14, 0, "Im GOING TO CRUSH YOU!")
      end

      if choice == 3 then
         pUnit:SendChatMessage(14, 0, "I AM THE GOD OVER IMMORTALITY!!!!")
         pUnit:CastSpellOnTarget(25, pUnit:GetClosestPlayer(0))
         pUnit:SendChatMessage(14, 0, "KNEEL! KNEEL!!!")
      end


      if choice == 4 then
         pUnit:SendChatMessage(12, 0, "Last time I were killing someone were for...")
         pUnit:CastSpellOntarget(5, pUnit:GetMaintank())
         pUnit:CastSpellOnTarget(25, pUnit:GetRandomPlayer())
         pUnit:SendChatMessage(14, 0, "ONE THOUZAND YEARS BECAUSE OF HUMAN BEINGS!!")
      end



      if choice == 5 then
         pUnit:SendChatMessage(12, 0, "You're unlucky today")
         pUnit:CastSpellOnTarget(25, pUnit:GetMainTank())
         pUnit:SendChatMessage(14, 0, "Time for you to see my full power!")
         pUnit:RegisterEvent("NPCNAME_FullPower", 600000, 1)
      end



      if choice == 6 then
         pUnit:SendChatMessage(12, 0, "I have defeated Illidan on my own...")
         pUnit:CastSpellOnTarget(5, pUnit:GetRandomPlayer())
         pUnit:SendChatMessage(14, 0, "SO WHY SHOULD I LOSE TO YOU!?")
      end


      if choice == 7 then
         pUnit:SendChatMessage(12, 0, "I cant say that my fater were the best father in the world but...")
         pUnit:CastSpellOntarget(11632, pUnit:GetRandomPlayer(3))
         pUnit:SendChatMessage(14, 0, "HE WERE MY FATHER,AND THATS WHY IM GOING TO AVENGE HIM!")
      end

      if choice == 8 then
         pUnit:SendChatMessage(12, 0, "I am the destroyer,the king over all kings and wizards...")
         pUnit:CastSpellOnTarget(17523, pUnit:GetMainTank())
         pUnit:SendChatMessage(14, 0, "I AM THE MAKER OF ALLIANCE AND HORDE...")
         pUnit:CastSpellOnTarget(5, pUnit:GetRandomPlayer())
         pUnit:SendChatMessage(14, 0, "AND YOU DARE CHALLENGE ME!?")
      end


      if choice == 9 then
         pUnit:SendChatMessage(12, 0, "The truth about god is...")
         pUnit:CastSpellOnTarget(17328, pUnit:GetClosestPlayer(1))
         pUnit:SendChatMessage(14, 0, "THERE IS NON OTHER THAN ME!")
      end


      if choice == 10 then
         pUnit:SendChatMessage(12, 0, "If you think im going to go easy on you just because im old then you are...")
         pUnit:CastSpellOnTarget(127523, pUnit:GetMainTank())
         pUnit:SendChatMessage(14, 0, "THEN YOUR DEADLY WRONG!")
      end
end




function NPCNAME_Spell (pUnit, Event)
   pUnit:CastSpellOnTarget(11661, pUnit:GetRandomPlayer(4))
   pUnit:RegisterEvent("NPCNAME_CheckA", 20000, 10)
end



function NPCNAME_CheckA (pUnit, Event)
   if pUnit:GetHealthPct()  < 80 then
      pUnit:SendChatMessage (14, 0, "TIME FOR...REVENGE!")
      pUnit:SetScale(3)
      pUnit:CastSpellOnTarget(5, pUnit:GetMainTank())
   end
end


function NPCNAME_CheckB(pUnit, Event)
   if pUnit:GetHealthPct() < 50 then
      pUnit:SendChatMessage (14, 0, "YOU KILLED MY FATHER! LIKE IM GOING TO LET YOU GO!!")
      pUnit:SetModel(18238)
      pUnit:CastSpellOnTarget(5, pUnit:GetClosestPlayer(0))
      pUnit:CastSpellOnTarget(25, pUnit:GetRandomPlayer(2))
   end
end

function NPCNAME_CheckC(pUnit, Event)
   if pUnit:GetHealthPct() < 40 then
      pUnit:SendChatMessage (14, 0, "SO YOU THINK YOU GOT ME NOW!?")
      pUnit:CastSpell(48063)
      pUnit:CastSpell(48063)
   end
end


function NPCNAME_CheckD(pUnit, Event)
   if pUnit:GetHealthPct() < 25 then
      pUnit:SendChatMessage (12, 0, "Im going to avenge my father and master!")
      pUnit:SetModel(29832)
   end
end


function NPCNAME_CheckE(pUnit, Event)
   if pUnit:GetHealthPct() < 20 then
      pUnit:SendChatMessage(14, 0, "IM ANGRY NOW!")
      pUnit:SetModel(10832)
      pUnit:SetScale(5)
   end
end

function NPCNAME_FullPower( pUnit, Event)
   if pUnit:GetHealthPct() < 60 then
      pUnit:CastSpellOnTarget(60646, pUnit:GetMainTank())
      pUnit:CastSpell(40647)
      pUnit:CastSpellOnTarget(60646, pUnit:GetRandomPlayer(4))
   end
   
   if pUnit:MainTank () == (Warrior) then
      pUnit:SendChatMessage(12, 0, "My wrath is something that cant be controled!")
      pUnit:CastSpell(59550)
   end
   
   if pUnit:MainTank () == (Paladin) then
      pUnit:SendChatMessage(12, 0, "Your god cant smite the already smited!")
      pUnit:CastSpellOnTarget(59172, pUnit:GetMainTank())
      pUnit:CastSpellOnTarget(24820, pUnit:GetRandomPlayer(3))
      pUnit:CastSpellOnTarget(27831, pUnit:GetRandomPlayer(4))
   end
   
   if pUnit:MainTank() == (Rogue) then
      pUnit:CastSpell(5)
   end
   
end
   

function NPCNAME_Spell2(pUnit, Event)

   if pUnit:GetHealthPct() < 10 then
      choice = math.random(1, 2)
         if choice == 1 then
            pUnit:SendChatMessage(14, 0, "IM THE GOD OF EVERYTHING!")
            pUnit:CastSpellOnTarget(16033, pUnit:GetRandomPlayer(0))
            pUnit:CastSpellOnTarget(20629, pUnit:GetMainTank())
         end
 
         if choice == 2 then
            pUnit:SendChatMessage(14, 0, "I CAN MANIPULATE BOTH LIGHT AND DARKNESS!")
            pUnit:CastSpellOnTarget(27174, pUnit:GetMainTank())
            pUnit:CastSpellOnTarget(17926, pUnit:GetRandomPlayer(0))
            pUnit:CastSpell(49222)
            pUnit:CastSpell(31662)
         end
   end
end


function NPCNAME_OnKilledTarget (pUnit, Event)
      pUnit:SendChatMessage(12, 0, "THAT WAS ONE!")
end

function NPCNAME_OnLeaveCombat (pUnit, Event)
      pUnit:SendChatMessage(14, 0, "Im GOING TO FIND YOU WHEREVER YOU HIDE!")
      pUnit:RemoveEvents()
end


function NPCNAME_OnDied (pUnit, Event)
      pUnit:SendChatMessage(12, 0, "Thank you...for releasing... me from my... master's shadow")
      pUnit:RemoveEvents()
end




RegisterUnitEvent(183729, 1, "NPCNAME_OnEnterCombat")
RegisterUnitEvent(183729, 2, "NPCNAME_OnKilledTarget")
RegisterUnitEvent(183729, 3, "NPCNAME_OnLeaveCombat")
RegisterUnitEvent(183729, 4, "NPCNAME_OnDied")
Back to top Go down
View user profile
 
anuthar lua script
Back to top 
Page 1 of 1
 Similar topics
-
» Chess Script
» Another Cinderella Story Movie Script
» Firefox 4 - Mybrute stuff
» JavaScript Chess
» Adventure Comix: The Movie Script!

Permissions in this forum:You cannot reply to topics in this forum
chaosnight :: Rednight server forums :: Coding-
Jump to: