commands.lua 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. --[[
  2. Script Name : Spells/commands.lua
  3. Script Purpose : Process game "commands" that use a cast bar
  4. Script Author : Everyone
  5. Script Date : Anytime
  6. Script Notes : Use spells_data to link to the specific command(s)
  7. --]]
  8. function cast(Caster, Target, Type)
  9. -- JA: commenting out other functions since revamp of database renders the IDs/Spawns invalid (2013/08/18)
  10. if Type == "ThrowSnowball" then
  11. ThrowSnowball(Caster, Target)
  12. end
  13. --[[
  14. if Type == "Examine" then
  15. Examine(Caster, Target)
  16. elseif Type == "Grab Soil" then
  17. GrabSoil(Caster, Target)
  18. elseif Type == "Plant Seeds" then
  19. PlantSeeds(Caster, Target)
  20. elseif Type == "Burn Tent" then
  21. BurnTent(Caster, Target)
  22. elseif Type == "Destroy Totem" then
  23. DestroyTotem(Caster, Target)
  24. elseif Type == "Smack Hive" then
  25. SmackHive(Caster, Target)
  26. elseif Type == "Help Down" then
  27. HelpDown(Caster, Target)
  28. elseif Type == "Read Gravestone" then
  29. ReadGravestone(Caster, Target)
  30. elseif Type == "ClimbTheBench" then
  31. ClimbTheBench(Caster, Target)
  32. elseif Type == "PullYourselfThroughTheFoliage" then
  33. PullYourselfThroughTheFoliage(Caster, Target)
  34. elseif Type == "InspectBox" then
  35. InspectBox(Caster, Target)
  36. elseif Type == "ThrowSnowball" then
  37. ThrowSnowball(Caster, Target)
  38. end
  39. --]]
  40. end
  41. function GrabSoil(Caster, Target)
  42. if HasQuest(Caster, 60) and not QuestStepIsComplete(Caster, 60, 3) then
  43. -- Mana-Enriched Soil
  44. SummonItem(Caster, 6463)
  45. end
  46. end
  47. function PlantSeeds(Caster, Target)
  48. end
  49. function BurnTent(Caster, Target)
  50. BurnSpawn = GetSpawn(Target, 2780218)
  51. SpawnSet(BurnSpawn, "visual_state", "6866")
  52. SpawnSet(Target, "show_command_icon", "0")
  53. KillSpawn(Target, Caster, 0) -- kill the tent to get journal update
  54. KillSpawn(BurnSpawn, Caster, 0) -- kill the cube to put out the "tent/'s fire"
  55. end
  56. function DestroyTotem(Caster, Target)
  57. SpawnSet(Target, "destroy_totem", "0")
  58. SpawnSet(Target, "show_command_icon", "0")
  59. KillSpawn(Target, Caster)
  60. end
  61. function SmackHive(Caster, Target)
  62. SpawnSet(Target, "show_command_icon", 0)
  63. -- 20% chance to spawn a Queen bee
  64. -- 80% chance to spawn a soldier bee
  65. choice = math.random(1, 100)
  66. if choice <= 20 then
  67. -- spawn a Queen bee
  68. SpawnMob(GetZone(Target), 2780092, false, GetX(Target), GetY(Target), GetZ(Target))
  69. else
  70. -- spawn a soldier bee
  71. SpawnMob(GetZone(Target), 2780088, false, GetX(Target), GetY(Target), GetZ(Target))
  72. end
  73. AddTimer(Target, 60000, "enable_command_icon_beeHive")
  74. end
  75. function HelpDown(Caster, Target)
  76. SpawnSet(Target, "show_command_icon", 0)
  77. SpawnMob(GetZone(Caster), 2530232, false, 268.05, -5.08, -10.95, 101.63)
  78. Despawn(Target)
  79. newHalfling = GetSpawn(Caster, 2530232)
  80. --temporary. the poor halfling will climb back into the tree when the Moraks respawn
  81. AddTimer(newHalfling, 30000, "ClimbTree")
  82. end
  83. function Examine(Caster, Target)
  84. end
  85. function ReadGravestone(Caster, Target)
  86. SpawnMob(GetZone(Caster), 1960199, false, 967.581, -17.0745, -821.035, 159.344)
  87. UlinirBush = GetSpawn(Caster, 1960199)
  88. Ilaen = GetSpawn(Caster, 1960126)
  89. PlayFlavor(Ilaen, "voiceover/english/tutorial_revamp/ilaen_lilac/qey_adv02_ruins_revamp/qst_woodelf_ilaen_lilac_ulinir_d84a1bb.mp3", "You are wise to know Ulinir is worth your time. Speak with me if you wish to use your wisdom for a greater good.", "", 1864539566, 4233668295, Caster)
  90. AddTimer(UlinirBush, 30000, "DespawnBush")
  91. end
  92. function ClimbTheBench(Caster, Target)
  93. SetPosition(Caster, 761.79, -20.38, 314.48)
  94. end
  95. function PullYourselfThroughTheFoliage(Caster, Target)
  96. SetPosition(Caster, 743.47, -20.35, 306.85)
  97. end
  98. function InspectBox(Caster, Target)
  99. SetStepComplete(Caster, 142, 3)
  100. end
  101. function ThrowSnowball(Caster, Target)
  102. SpawnSet(Caster, "visual_state", "1224")
  103. end