Share Pastebin
Guest
Public paste!

Sarcophage_boss

By: a guest | Mar 21st, 2010 | Syntax: Lua | Size: 4.90 KB | Hits: 58 | Expires: Never
Copy text to clipboard
  1.  
  2.  
  3. -- -----------------------------------------------------------
  4. -- --------------------------LOCALS---------------------------
  5. -- -----------------------------------------------------------
  6.  
  7. local NPC_Company_Faction = 18 -- Faction des NPC, à Changer --
  8. local Boss_Sarcophage = 1 -- ID --
  9. local Warrior_Sarcophage = 1 -- ID --
  10. local Rogue_Sarcophage = 1 -- ID --
  11. local Mage_Sarcophage = 1 -- ID --
  12. local Priest_Sarcophage = 1 -- ID --
  13. local SARCOPHAGE_ENTRY = 1 -- ID du sarcophage --
  14. local GO_ENTRY = 5555 -- ID de la lumière, à changer --
  15. local Head1_ENTRY = 1 -- ID de la tête 1 --
  16. local Head2_ENTRY = 1 -- ID de la tête 2 --
  17. local Head3_Entry = 1 -- ID de la tête 3 --
  18. local PosX = 100 -- Position centrale, à changer --
  19. local PosY = 150 -- Position centrale, à changer --
  20. local PosZ = 300 -- Position centrale, à changer --
  21. local PosO = 1.8 -- Orientation des NPC, à changer --
  22. local Head_1_IsActivate = 0
  23. local Head_2_IsActivate = 0
  24. local Head_3_IsActivate = 0
  25. local Light_Unit
  26. local Sarcophage_Unit
  27. local NPC_Company_Number = 0
  28.  
  29. -- -----------------------------------------------------------
  30. -- ---------------------------EVENT---------------------------
  31. -- -----------------------------------------------------------
  32.  
  33.         -- Têtes --
  34.  
  35. function Head_1_OnActivate(unit, event, player)
  36.         local Head_1_IsActivate = 1
  37.                 if Head_2_IsActivate == 1 then
  38.                         if Head_3_IsActivate == 1 then
  39.                                 unit:RegisterEvent("Light_Sarcophage_Appear", 3000, 0)
  40.                         end
  41.                 end
  42. end
  43.  
  44. function Head_2_OnActivate(unit, event, player)
  45.         local Head_2_IsActivate = 1
  46.                 if Head_1_IsActivate == 1 then
  47.                         if Head_3_IsActivate == 1 then
  48.                                 unit:RegisterEvent("Light_Sarcophage_Appear", 3000, 0)
  49.                         end
  50.                 end
  51. end
  52.  
  53. function Head_3_OnActivate(unit, event, player)
  54.         local Head_3_IsActivate = 1
  55.                 if Head_2_IsActivate == 1 then
  56.                         if Head_1_IsActivate == 1 then
  57.                                 unit:RegisterEvent("Light_Sarcophage_Appear", 3000, 0)
  58.                         end
  59.                 end
  60. end
  61.  
  62.         -- Lumière --
  63.  
  64. function Light_Sarcophage_Appear(unit, event, player)
  65.         unit:SpawnGameObject(GO_ENTRY,PosX,PosY,PosZ,7200000)
  66.         unit:RegisterEvent("NPC_Company_Appear", 3000, 0)
  67. end
  68.  
  69. function Light_Sarcophage_OnSpawn(unit, event, player)
  70.         unit = Light_Unit
  71. end
  72.  
  73.         -- Adds --
  74.  
  75. function NPC_Company_Appear(unit, event, player)
  76.         unit:SpawnCreature(Warrior_Sarcophage, PosX +1.5, PosY, PosZ, PosO, Faction, 7200000)
  77.         unit:SpawnCreature(Rogue_Sarcophage, PosX, PosY -1.5, PosZ, PosO, Faction, 7200000)
  78.         unit:SpawnCreature(Rogue_Sarcophage, PosX, PosY +1.5, PosZ, PosO, Faction, 7200000)
  79.         unit:SpawnCreature(Mage_Sarcophage, PosX -1.5, PosY -1.5, PosZ, PosO, Faction, 7200000)
  80.         unit:SpawnCreature(Mage_Sarcophage, PosX -1.5, PosY +1.5, PosZ, PosO, Faction, 7200000)
  81.         unit:SpawnCreature(Priest_Sarcophage, PosX -1.5, PosY, PosZ, PosO, Faction, 7200000)
  82.         local NPC_Company_Number = 6
  83. end
  84.  
  85. function Warrior_Sarcophage_OnDeath(unit, event, player)
  86.         NPC_Company_Number = NPC_Company_Number -1
  87.                 if NPC_Company_Number = 0 then
  88.                         unit:SpawnGameObject(SARCOPHAGE_ENTRY,PosX,PosY,PosZ,7200000)
  89.                         Light_Unit:SetPosition(0,0,-5000,0)
  90.                 end
  91. end
  92. function Rogue_Sarcophage_OnDeath(unit, event, player)
  93.         NPC_Company_Number = NPC_Company_Number -1
  94.                 if NPC_Company_Number = 0 then
  95.                         unit:SpawnGameObject(SARCOPHAGE_ENTRY,PosX,PosY,PosZ,7200000)
  96.                         Light_Unit:SetPosition(0,0,-5000,0)
  97.                 end
  98. end
  99. function Mage_Sarcophage_OnDeath(unit, event, player)
  100.         NPC_Company_Number = NPC_Company_Number -1
  101.                 if NPC_Company_Number = 0 then
  102.                         unit:SpawnGameObject(SARCOPHAGE_ENTRY,PosX,PosY,PosZ,7200000)
  103.                         Light_Unit:SetPosition(0,0,-5000,0)
  104.                 end
  105. end
  106. function Priest_Sarcophage_OnDeath(unit, event, player)
  107.         NPC_Company_Number = NPC_Company_Number -1
  108.                 if NPC_Company_Number = 0 then
  109.                         unit:SpawnGameObject(SARCOPHAGE_ENTRY,PosX,PosY,PosZ,7200000)
  110.                         Light_Unit:SetPosition(0,0,-5000,0)
  111.                 end
  112. end
  113.  
  114.         -- Sarcophage --
  115.        
  116. function Sarcophage_OnSpawn(unit, event, player)
  117.         unit = Sarcophage_Unit
  118. end
  119. function Sarcophage_OnActivate(unit, event, player)
  120.         if NPC_Company_Number = 0 then
  121.                 Sarcophage_Unit:SpawnCreature(Boss_Sarcophage, PosX -1.5, PosY, PosZ, PosO, Faction, 7200000)
  122.                 Sarcophage_Unit:SetPosition(0,0,-5000,0)
  123.         end
  124. end
  125.  
  126. -- -----------------------------------------------------------
  127. -- --------------------MOBS SCRIPTS---------------------------
  128. -- -----------------------------------------------------------
  129.  
  130.  
  131.  
  132.  
  133. -- -----------------------------------------------------------
  134. -- ----------------------REGISTRERS---------------------------
  135. -- -----------------------------------------------------------
  136.  
  137. RegisterGameObjectEvent(SARCOPHAGE_ENTRY, 2, "Sarcophage_OnSpawn")
  138. RegisterGameObjectEvent(SARCOPHAGE_ENTRY, 4, "Sarcophage_OnActivate")
  139. RegisterGameObjectEvent(Head1_ENTRY, 4, "Head_1_OnActivate")
  140. RegisterGameObjectEvent(Head2_ENTRY, 4, "Head_2_OnActivate")
  141. RegisterGameObjectEvent(Head3_ENTRY, 4, "Head_3_OnActivate")
  142. RegisterGameObjectEvent(GO_ENTRY, 2, "Light_Sarcophage_OnSpawn")