Hello & Welcome to our community. Is this your first visit? Register
Follow us on
Follow us on Facebook Follow us on Twitter Watch us on YouTube


MMOCoin

Likes Likes:  0
Results 1 to 5 of 5
  1. #1
    Contributor
    runiker's Avatar
    Join Date
    Jul 2008
    Posts
    170
    Post Thanks / Like
    Rep Power
    18
    Reputation
    113

    [release]{lua} capture the town


    Register to remove this ad
    Here is my lua script it might look like a boss script at first look but its not this script was made by me when i wanted to make a new type of an event this event is called capture the town. In this event a group of players must go to the opposing factions town and get all there npc below 10% health after they do this they npc will then turn there faction (horde = 2 ally = 1). I myself use this on things i would put inside a city like vendors bankers stable masters quest givers and much more that npc can be. This is a great end game pvp event and im releasing my first script for it (the one i use now is more advanced and contains bosses) hope this will help out your server. (its up to you to make the npc but dont forget to make the npc respawn timer set to 0)

    Code:
      
    
    function Gruntworker_die1 (pUnit, event)
             pUnit:RemoveEvents()
          local race=player:GetPlayerRace()
         if race==1 or race==3 or race==4 or race==7 or race==11 then
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760001,x,y,z,1,0)
        pUnit:SendChatMessage(14, 0, "The Ally have taken a unit!")
            else
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760000,x,y,z,2,0)
        pUnit:SendChatMessage(14, 0, "The Horde have taken a unit!")
    end
             pUnit:RemoveEvents()
    end
    
    function Gruntworker_die2 (pUnit, event)
             pUnit:RemoveEvents()
          local race=player:GetPlayerRace()
         if race==1 or race==3 or race==4 or race==7 or race==11 then
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760003,x,y,z,1,0)
        pUnit:SendChatMessage(14, 0, "The Ally have taken a unit!")
            else
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760002,x,y,z,2,0)
        pUnit:SendChatMessage(14, 0, "The Horde have taken a unit!")
    end
             pUnit:RemoveEvents()
    end
    
    function Gruntworker_die3 (pUnit, event)
             pUnit:RemoveEvents()
          local race=player:GetPlayerRace()
         if race==1 or race==3 or race==4 or race==7 or race==11 then
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760005,x,y,z,1,0)
        pUnit:SendChatMessage(14, 0, "The Ally have taken a unit!")
            else
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760004,x,y,z,2,0)
        pUnit:SendChatMessage(14, 0, "The Horde have taken a unit!")
    end
             pUnit:RemoveEvents()
    end
    
    function Gruntworker_die4 (pUnit, event)
             pUnit:RemoveEvents()
          local race=player:GetPlayerRace()
         if race==1 or race==3 or race==4 or race==7 or race==11 then
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760007,x,y,z,1,0)
        pUnit:SendChatMessage(14, 0, "The Ally have taken a unit!")
            else
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760006,x,y,z,2,0)
        pUnit:SendChatMessage(14, 0, "The Horde have taken a unit!")
    end
             pUnit:RemoveEvents()
    end
    
    function Gruntworker_die5 (pUnit, event)
             pUnit:RemoveEvents()
          local race=player:GetPlayerRace()
         if race==1 or race==3 or race==4 or race==7 or race==11 then
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760009,x,y,z,1,0)
        pUnit:SendChatMessage(14, 0, "The Ally have taken a unit!")
            else
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760008,x,y,z,2,0)
        pUnit:SendChatMessage(14, 0, "The Horde have taken a unit!")
    end
             pUnit:RemoveEvents()
    end
    
    function Gruntworker_die6 (pUnit, event)
             pUnit:RemoveEvents()
          local race=player:GetPlayerRace()
         if race==1 or race==3 or race==4 or race==7 or race==11 then
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760011,x,y,z,1,0)
        pUnit:SendChatMessage(14, 0, "The Ally have taken a unit!")
            else
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760010,x,y,z,2,0)
        pUnit:SendChatMessage(14, 0, "The Horde have taken a unit!")
    end
             pUnit:RemoveEvents()
    end
    
    function Gruntworker_die7 (pUnit, event)
             pUnit:RemoveEvents()
          local race=player:GetPlayerRace()
         if race==1 or race==3 or race==4 or race==7 or race==11 then
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760013,x,y,z,1,0)
        pUnit:SendChatMessage(14, 0, "The Ally have taken a unit!")
            else
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760012,x,y,z,2,0)
        pUnit:SendChatMessage(14, 0, "The Horde have taken a unit!")
    end
             pUnit:RemoveEvents()
    end
    
    function Gruntworker_die8 (pUnit, event)
             pUnit:RemoveEvents()
          local race=player:GetPlayerRace()
         if race==1 or race==3 or race==4 or race==7 or race==11 then
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760015,x,y,z,1,0)
        pUnit:SendChatMessage(14, 0, "The Ally have taken a unit!")
            else
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760014,x,y,z,2,0)
        pUnit:SendChatMessage(14, 0, "The Horde have taken a unit!")
    end
             pUnit:RemoveEvents()
    end
    
    function Gruntworker_die9 (pUnit, event)
             pUnit:RemoveEvents()
          local race=player:GetPlayerRace()
         if race==1 or race==3 or race==4 or race==7 or race==11 then
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760017,x,y,z,1,0)
        pUnit:SendChatMessage(14, 0, "The Ally have taken a unit!")
            else
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760016,x,y,z,2,0)
        pUnit:SendChatMessage(14, 0, "The Horde have taken a unit!")
    end
             pUnit:RemoveEvents()
    end
    
    function Gruntworker_die10 (pUnit, event)
             pUnit:RemoveEvents()
          local race=player:GetPlayerRace()
         if race==1 or race==3 or race==4 or race==7 or race==11 then
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760019,x,y,z,1,0)
        pUnit:SendChatMessage(14, 0, "The Ally have taken a unit!")
            else
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760018,x,y,z,2,0)
        pUnit:SendChatMessage(14, 0, "The Horde have taken a unit!")
    end
             pUnit:RemoveEvents()
    end
    
    function Gruntworker_die11 (pUnit, event)
             pUnit:RemoveEvents()
          local race=player:GetPlayerRace()
         if race==1 or race==3 or race==4 or race==7 or race==11 then
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760021,x,y,z,1,0)
        pUnit:SendChatMessage(14, 0, "The Ally have taken a unit!")
            else
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760020,x,y,z,2,0)
        pUnit:SendChatMessage(14, 0, "The Horde have taken a unit!")
    end
             pUnit:RemoveEvents()
    end
    
    function Gruntworker_die12 (pUnit, event)
             pUnit:RemoveEvents()
          local race=player:GetPlayerRace()
         if race==1 or race==3 or race==4 or race==7 or race==11 then
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760023,x,y,z,1,0)
        pUnit:SendChatMessage(14, 0, "The Ally have taken a unit!")
            else
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760022,x,y,z,2,0)
        pUnit:SendChatMessage(14, 0, "The Horde have taken a unit!")
    end
             pUnit:RemoveEvents()
    end
    
    function Gruntworker_die13 (pUnit, event)
             pUnit:RemoveEvents()
          local race=player:GetPlayerRace()
         if race==1 or race==3 or race==4 or race==7 or race==11 then
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760025,x,y,z,1,0)
        pUnit:SendChatMessage(14, 0, "The Ally have taken a unit!")
            else
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760024,x,y,z,2,0)
        pUnit:SendChatMessage(14, 0, "The Horde have taken a unit!")
    end
             pUnit:RemoveEvents()
    end
    
    function Gruntworker_die14 (pUnit, event)
             pUnit:RemoveEvents()
          local race=player:GetPlayerRace()
         if race==1 or race==3 or race==4 or race==7 or race==11 then
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760027,x,y,z,1,0)
        pUnit:SendChatMessage(14, 0, "The Ally have taken a unit!")
            else
            pUnit:RegisterEvent("getcords", 15000, 0)
        pUnit:SpawnCreature(7760026,x,y,z,2,0)
        pUnit:SendChatMessage(14, 0, "The Horde have taken a unit!")
    end
             pUnit:RemoveEvents()
    end
    
    function Gruntworker_LeaveCombat (pUnit, event)
             pUnit:RemoveEvents()
    end
    
    function getcords (pUnit, event)
            x = pUnit:GetSpawnX();
            y = pUnit:GetSpawnY();
            z = pUnit:GetSpawnZ();
            o = pUnit:GetSpawnO();
    end
    
    --Hordeids
    RegisterUnitEvent(7760000, 4, "Gruntworker_die1")
    RegisterUnitEvent(7760000, 2, "Gruntworker_LeaveCombat")
    RegisterUnitEvent(7760002, 4, "Gruntworker_die2")
    RegisterUnitEvent(7760002, 2, "Gruntworker_LeaveCombat")
    RegisterUnitEvent(7760004, 4, "Gruntworker_die3")
    RegisterUnitEvent(7760004, 2, "Gruntworker_LeaveCombat")
    RegisterUnitEvent(7760006, 4, "Gruntworker_die4")
    RegisterUnitEvent(7760006, 2, "Gruntworker_LeaveCombat")
    RegisterUnitEvent(7760008, 4, "Gruntworker_die5")
    RegisterUnitEvent(7760008, 2, "Gruntworker_LeaveCombat")
    RegisterUnitEvent(7760010, 4, "Gruntworker_die6")
    RegisterUnitEvent(7760010, 2, "Gruntworker_LeaveCombat")
    RegisterUnitEvent(7760012, 4, "Gruntworker_die7")
    RegisterUnitEvent(7760012, 2, "Gruntworker_LeaveCombat")
    RegisterUnitEvent(7760014, 4, "Gruntworker_die8")
    RegisterUnitEvent(7760014, 2, "Gruntworker_LeaveCombat")
    RegisterUnitEvent(7760016, 4, "Gruntworker_die9")
    RegisterUnitEvent(7760016, 2, "Gruntworker_LeaveCombat")
    RegisterUnitEvent(7760018, 4, "Gruntworker_die10")
    RegisterUnitEvent(7760018, 2, "Gruntworker_LeaveCombat")
    RegisterUnitEvent(7760020, 4, "Gruntworker_die11")
    RegisterUnitEvent(7760020, 2, "Gruntworker_LeaveCombat")
    RegisterUnitEvent(7760022, 4, "Gruntworker_die12")
    RegisterUnitEvent(7760022, 2, "Gruntworker_LeaveCombat")
    RegisterUnitEvent(7760024, 4, "Gruntworker_die13")
    RegisterUnitEvent(7760024, 2, "Gruntworker_LeaveCombat")
    RegisterUnitEvent(7760026, 4, "Gruntworker_die14")
    RegisterUnitEvent(7760026, 2, "Gruntworker_LeaveCombat")
    --Allyids
    RegisterUnitEvent(7760003, 4, "Gruntworker_die1")
    RegisterUnitEvent(7760003, 2, "Gruntworker_LeaveCombat")
    RegisterUnitEvent(7760001, 4, "Gruntworker_die2")
    RegisterUnitEvent(7760001, 2, "Gruntworker_LeaveCombat")
    RegisterUnitEvent(7760005, 4, "Gruntworker_die3")
    RegisterUnitEvent(7760005, 2, "Gruntworker_LeaveCombat")
    RegisterUnitEvent(7760007, 4, "Gruntworker_die4")
    RegisterUnitEvent(7760007, 2, "Gruntworker_LeaveCombat")
    RegisterUnitEvent(7760009, 4, "Gruntworker_die5")
    RegisterUnitEvent(7760009, 2, "Gruntworker_LeaveCombat")
    RegisterUnitEvent(7760011, 4, "Gruntworker_die6")
    RegisterUnitEvent(7760011, 2, "Gruntworker_LeaveCombat")
    RegisterUnitEvent(7760013, 4, "Gruntworker_die7")
    RegisterUnitEvent(7760013, 2, "Gruntworker_LeaveCombat")
    RegisterUnitEvent(7760015, 4, "Gruntworker_die8")
    RegisterUnitEvent(7760015, 2, "Gruntworker_LeaveCombat")
    RegisterUnitEvent(7760017, 4, "Gruntworker_die9")
    RegisterUnitEvent(7760017, 2, "Gruntworker_LeaveCombat")
    RegisterUnitEvent(7760019, 4, "Gruntworker_die10")
    RegisterUnitEvent(7760019, 2, "Gruntworker_LeaveCombat")
    RegisterUnitEvent(7760021, 4, "Gruntworker_die11")
    RegisterUnitEvent(7760021, 2, "Gruntworker_LeaveCombat")
    RegisterUnitEvent(7760023, 4, "Gruntworker_die12")
    RegisterUnitEvent(7760023, 2, "Gruntworker_LeaveCombat")
    RegisterUnitEvent(7760025, 4, "Gruntworker_die13")
    RegisterUnitEvent(7760025, 2, "Gruntworker_LeaveCombat")
    RegisterUnitEvent(7760027, 4, "Gruntworker_die14")
    RegisterUnitEvent(7760027, 2, "Gruntworker_LeaveCombat")





    › See More: [release]{lua} capture the town
    Last edited by runiker; 12-02-09 at 01:52 PM.



  2. Related Threads - Scroll Down after related threads if you are only interested to view replies for above post/thread

  3. #2
    Scout
    stoneharry's Avatar
    Join Date
    Feb 2009
    Posts
    16
    Post Thanks / Like
    Rep Power
    16
    Reputation
    10
    Would still keep attacking the players even though there the npc is now the same faction Still +Rep for the effert

  4. #3
    Contributor
    runiker's Avatar
    Join Date
    Jul 2008
    Posts
    170
    Post Thanks / Like
    Rep Power
    18
    Reputation
    113
    Alright i will change it around thanks for letting me know so i can change it so it will work.

  5. #4
    Contributor
    runiker's Avatar
    Join Date
    Jul 2008
    Posts
    170
    Post Thanks / Like
    Rep Power
    18
    Reputation
    113
    This code is a bit longer does the same thing and it should work now :P

  6. #5
    Grunt
    Zaronz's Avatar
    Join Date
    Jan 2009
    Location
    Norway
    Posts
    37
    Post Thanks / Like
    Rep Power
    16
    Reputation
    50

    Register to remove this ad
    Looks good, finally something unique that's not some simple boss fight :P


 

 

Visitors found this page by searching for:

player:removeevents()

SEO Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -5. The time now is 06:59 PM.
Powered by vBulletin® Copyright ©2000-2024, Jelsoft Enterprises Ltd.
See More links by ForumSetup.net. Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
vBulletin Licensed to: MMOPro.org