candles.lua 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. --[[
  2. Script Name : SpawnScripts/SummonersTest/candles.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.11.12 01:11:50
  5. Script Purpose :
  6. :
  7. --]]
  8. function casted_on(NPC, Spawn, SpellName)
  9. if SpellName == 'Light the candles' then
  10. local con = CreateConversation()
  11. AddConversationOption(con, "Begin the test. Use the ring once it is ready.", "offer")
  12. AddConversationOption(con, "Leave them alone.","CloseConversation")
  13. StartDialogConversation(con, 1, NPC, Spawn, "This circle has been laid before you to control summoning. To begin the Summoner's Test you must light the candles and reach into a \"hole\" in the fabric of reality to summon your first creature.")
  14. end
  15. end
  16. function offer(NPC, Spawn)
  17. CloseConversation(NPC, Spawn)
  18. SpawnSet(NPC, "show_command_icon", 0)
  19. SpawnSet(NPC, "display_hand_icon", 0)
  20. SpawnSet(NPC,"model_type",5961)
  21. AddTimer(NPC,MakeRandomInt(1500,2500),"Light1",1,Spawn)
  22. AddTimer(NPC,MakeRandomInt(2500,4500),"Light2",1,Spawn)
  23. AddTimer(NPC,6000,"Ring",1,Spawn)
  24. end
  25. function Light1(NPC, Spawn)
  26. local zone = GetZone(Spawn)
  27. local candle1 = GetSpawnByLocationID(zone,133780562)
  28. local candle2 = GetSpawnByLocationID(zone,133780563)
  29. local candle3 = GetSpawnByLocationID(zone,133780564)
  30. local candle4 = GetSpawnByLocationID(zone,133780565)
  31. local candle5 = GetSpawnByLocationID(zone,133780566)
  32. local candle6 = GetSpawnByLocationID(zone,133780568)
  33. local candle7 = GetSpawnByLocationID(zone,133780569)
  34. SpawnSet(candle1,"model_type",5961)
  35. SpawnSet(candle2,"model_type",5961)
  36. SpawnSet(candle3,"model_type",5961)
  37. SpawnSet(candle4,"model_type",5961)
  38. SpawnSet(candle5,"model_type",5961)
  39. SpawnSet(candle6,"model_type",5961)
  40. SpawnSet(candle7,"model_type",5961)
  41. end
  42. function Light2(NPC, Spawn)
  43. local zone = GetZone(Spawn)
  44. local candle8 = GetSpawnByLocationID(zone,133780570)
  45. local candle9 = GetSpawnByLocationID(zone,133780571)
  46. local candle10 = GetSpawnByLocationID(zone,133780572)
  47. local candle11 = GetSpawnByLocationID(zone,133780573)
  48. local candle12 = GetSpawnByLocationID(zone,133780574)
  49. local candle13 = GetSpawnByLocationID(zone,133780575)
  50. SpawnSet(candle8,"model_type",5961)
  51. SpawnSet(candle9,"model_type",5961)
  52. SpawnSet(candle10,"model_type",5961)
  53. SpawnSet(candle11,"model_type",5961)
  54. SpawnSet(candle12,"model_type",5961)
  55. SpawnSet(candle13,"model_type",5961)
  56. SpawnSet(candle14,"model_type",5961)
  57. SpawnSet(candle15,"model_type",5961)
  58. local Ringlight = SpawnByLocationID(zone,133780625)
  59. end
  60. function Ring(NPC, Spawn)
  61. local zone = GetZone(Spawn)
  62. local SummonRing = GetSpawnByLocationID(zone,133780576)
  63. SpawnSet(SummonRing,"visual_state",1574)
  64. SpawnSet(SummonRing, "show_command_icon", 1)
  65. SpawnSet(SummonRing, "display_hand_icon", 1)
  66. end
  67. function respawn(NPC)
  68. spawn(NPC)
  69. end