9
3

TrainerRagnhildStonefist.lua 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. --[[
  2. Script Name : SpawnScripts/FrostfangSea/TrainerRagnhildStonefist.lua
  3. Script Purpose : Trainer Ragnhild Stonefist <Combat Trainer>
  4. Script Author : theFoof
  5. Script Date : 2013.5.3
  6. Script Notes :
  7. --]]
  8. local StoneCombat = 2
  9. function spawn(NPC)
  10. end
  11. function respawn(NPC)
  12. spawn(NPC)
  13. end
  14. function InRange(NPC, Spawn)
  15. end
  16. function LeaveRange(NPC, Spawn)
  17. end
  18. function hailed(NPC, Spawn)
  19. FaceTarget(NPC, Spawn)
  20. conversation = CreateConversation()
  21. if HasQuest(Spawn, StoneCombat) and GetQuestStep(Spawn, StoneCombat) == 1 then
  22. first_chat(NPC, Spawn)
  23. SetStepComplete(Spawn, StoneCombat, 1)
  24. elseif GetQuestStep(Spawn, StoneCombat) == 2 then
  25. AddConversationOption(conversation, "Not yet, but I will soon.")
  26. StartConversation(conversation, "So, did you defeat the sparring partner like I asked?")
  27. elseif GetQuestStep(Spawn, StoneCombat) == 3 then
  28. AddConversationOption(conversation, "I was victorious!", "complete_step3")
  29. AddConversationOption(conversation, "Not yet, but I will soon.")
  30. StartConversation(conversation, NPC, Spawn, "So, did you defeat the sparring partner like I asked?")
  31. else
  32. first_chat(NPC, Spawn)
  33. end
  34. end
  35. function complete_step3(NPC, Spawn)
  36. SetStepComplete(Spawn, StoneCombat, 3)
  37. FaceTarget(NPC, Spawn)
  38. conversation = CreateConversation()
  39. AddConversationOption(conversation, "I'll report back to Yasha Redblade.")
  40. StartConversation(conversation, NPC, Spawn, "Great work! You've Proven your worth and are ready for greater challenges. If you want futher instruction later, just come see me. But right now you must report back to Yasha so that you can defend Pilgrims' Landing.")
  41. end
  42. function first_chat(NPC, Spawn)
  43. conversation = CreateConversation()
  44. PlayFlavor(NPC, "voiceover/english/voice_emotes/greetings/greetings_1_1009.mp3", "", "", 0, 0, Spawn)
  45. AddConversationOption(conversation, "Teach me the basics of combat.", "basic_chat")
  46. AddConversationOption(conversation, "Teach me more advanced aspects of combat.", "adv_chat")
  47. AddConversationOption(conversation, "I'll come back later.")
  48. StartConversation(conversation, NPC, Spawn, "Hello there, " .. GetName(Spawn) .. ". I'm here to teach folks the finer points of combat. I don't like to get into a fight, but if I do, I prefer to win. Know what I mean?")
  49. end
  50. function adv_chat(NPC, Spawn)
  51. FaceTarget(NPC, Spawn)
  52. conversation = CreateConversation()
  53. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  54. AddConversationOption(conversation, "Tell me about selecting the right opponent.", "adv_1_1")
  55. AddConversationOption(conversation, "Teach me about knowing my surroundings.", "adv_1_3_1")
  56. AddConversationOption(conversation, "Tell me about using my abilities.", "adv_2_1")
  57. AddConversationOption(conversation, "Teach me the basics of combat.", "basic_chat")
  58. AddConversationOption(conversation, "I'll come back later.")
  59. StartConversation(conversation, NPC, Spawn, "There are many advanced combat techniques that you will learn over time. There's no substitute for experience, " .. GetName(Spawn) .. "! I'd be happy to discuss a few of these advanced aspects, such as selecting the right opponent, knowing your surroundings, and using your abilities.")
  60. end
  61. function adv_1_1(NPC, Spawn)
  62. FaceTarget(NPC, Spawn)
  63. conversation = CreateConversation()
  64. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  65. AddConversationOption(conversation, "How do I tell if an opponent is too weak or too strong for me?", "adv_1_2")
  66. StartConversation(conversation, NPC, Spawn, "Picking the right fight is crucial to victory. A weak opponent won't provide worthwhile rewards, while an overly powerful foe will result in your defeat. You need to keep your resources in mind as well as choosing the right target.")
  67. end
  68. function adv_1_2(NPC, Spawn)
  69. FaceTarget(NPC, Spawn)
  70. conversation = CreateConversation()
  71. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  72. AddConversationOption(conversation, "What resources should I be keeping an eye on?", "adv_1_3")
  73. StartConversation(conversation, NPC, Spawn, "Targeting an opponent will show you detailed information on its overall potency. Generally speaking, you'll find the best results from fighting opponents with blue, white, or yellow names.")
  74. end
  75. function adv_1_3(NPC, Spawn)
  76. FaceTarget(NPC, Spawn)
  77. conversation = CreateConversation()
  78. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  79. AddConversationOption(conversation, "Teach me about knowing my surroundings.", "adv_1_3_1")
  80. AddConversationOption(conversation, "Tell me about using my abilities.", "adv_2_1")
  81. AddConversationOption(conversation, "Teach me the basics of combat.", "basic_chat")
  82. AddConversationOption(conversation, "I'll come back later.")
  83. StartConversation(conversation, NPC, Spawn, "Starting a fight when you are low on health or power is a very bad idea. Your choice of targets also depends on whether you're alone or grouped with other players. Forming a group allows you to take on tougher and more rewarding challenges than you could face alone.")
  84. end
  85. function adv_1_3_1(NPC, Spawn)
  86. FaceTarget(NPC, Spawn)
  87. conversation = CreateConversation()
  88. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  89. AddConversationOption(conversation, "Anything else I should watch out for?", "adv_1_3_1_2")
  90. StartConversation(conversation, NPC, Spawn, "Keeping your surroundings in mind is crucial to victory. Fighting in areas with lots of aggressive creatures is a bad idea, because they won't hesitate to gang up on you.")
  91. end
  92. function adv_1_3_1_2(NPC, Spawn)
  93. FaceTarget(NPC, Spawn)
  94. conversation = CreateConversation()
  95. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  96. AddConversationOption(conversation, "Any other tips?", "adv_1_3_1_3")
  97. StartConversation(conversation, NPC, Spawn, "Staying too long on the exact spot where you just defeated a foe can be dangerous. Another enemy is likely to show up there soon after, which can be an unpleasant surprise if you're already in another battle.")
  98. end
  99. function adv_1_3_1_3(NPC, Spawn)
  100. FaceTarget(NPC, Spawn)
  101. conversation = CreateConversation()
  102. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  103. AddConversationOption(conversation, "Tell me about selecting the right opponent.", "adv_1_1")
  104. AddConversationOption(conversation, "Tell me about using my abilities.", "adv_2_1")
  105. AddConversationOption(conversation, "Teach me the basics of combat.", "basic_chat")
  106. AddConversationOption(conversation, "I'll come back later.")
  107. StartConversation(conversation, NPC, Spawn, "You should be aware of what's going on around you. Using your mouse wheel to scroll out into third person and holding down the left mouse button allows you to move the camera around your character. It's a good idea to do this when fighting in dangerous areas to make sure nothing sneaks up on you.")
  108. end
  109. function adv_2_1(NPC, Spawn)
  110. FaceTarget(NPC, Spawn)
  111. conversation = CreateConversation()
  112. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  113. AddConversationOption(conversation, "What do you mean?", "adv_2_2")
  114. StartConversation(conversation, NPC, Spawn, "Successful fighting isn't about turning on your auto-attack and walking away from battle. Your odds of victory are much better if you are well-prepared and are active during combat. You should use every spell or combat art that has a positive effect on your chances to win.")
  115. end
  116. function adv_2_2(NPC, Spawn)
  117. FaceTarget(NPC, Spawn)
  118. conversation = CreateConversation()
  119. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  120. AddConversationOption(conversation, "What about during battle?", "adv_2_3")
  121. StartConversation(conversation, NPC, Spawn, "Before you begin fighting, make sure you and your allies have activated all beneficial spells, also known as 'buffs,' so that you're operating at peak efficiency. Buffs can add health or power, increase your rate of regeneration, enhance your physical attributes, make you attack faster or do more damage, and more.")
  122. end
  123. function adv_2_3(NPC, Spawn)
  124. FaceTarget(NPC, Spawn)
  125. conversation = CreateConversation()
  126. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  127. AddConversationOption(conversation, "What else should I know about spells and arts?", "adv_2_4")
  128. StartConversation(conversation, NPC, Spawn, "Whether you're a front-lines melee type or someone attacking from a distance with weapons or spells, you should be using abilities that damage your foes effectively and efficiently. Right click on your spells and arts and select 'Examine' to see details on their effects.")
  129. end
  130. function adv_2_4(NPC, Spawn)
  131. FaceTarget(NPC, Spawn)
  132. conversation = CreateConversation()
  133. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  134. AddConversationOption(conversation, "Tell me about selecting the right opponent.", "adv_1_1")
  135. AddConversationOption(conversation, "Teach me about knowing my surroundings.", "adv_1_3_1")
  136. AddConversationOption(conversation, "Teach me the basics of combat.", "basic_chat")
  137. AddConversationOption(conversation, "I'll come back later.")
  138. StartConversation(conversation, NPC, Spawn, "Using your highest-level versions of spells and arts will be more effective than using older versions. In addition, you should be upgrading your abilities to higher ranks to make them more effective. For more details on spells and combat arts, talk to Trainer Yasna V'Vath.")
  139. end
  140. function basic_chat(NPC, Spawn)
  141. FaceTarget(NPC, Spawn)
  142. conversation = CreateConversation()
  143. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  144. AddConversationOption(conversation, "Tell me how to begin a fight.", "bsc_1_1")
  145. AddConversationOption(conversation, "Tell me about melee combat.", "bsc_2_1")
  146. AddConversationOption(conversation, "Tell me about ranged combat.", "bsc_3_1")
  147. AddConversationOption(conversation, "What kind of rewards can I earn in battle?", "bsc_4_1")
  148. AddConversationOption(conversation, "Teach me more advanced aspects of combat.", "adv_chat")
  149. AddConversationOption(conversation, "I'll come back later.")
  150. StartConversation(conversation, NPC, Spawn, "There are many different elements that go into successful combat. I can teach you a few of the basics, such as how to begin a fight, the difference between melee and ranged combat, and earning rewards for victory.")
  151. end
  152. function bsc_1_1(NPC, Spawn)
  153. FaceTarget(NPC, Spawn)
  154. conversation = CreateConversation()
  155. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  156. AddConversationOption(conversation, "How do I begin the battle?", "bsc_1_2")
  157. StartConversation(conversation, NPC, Spawn, "Starting combat is easy. Just use your mouse pointer to left-click on an opponent. Its name will appear in the Target window in the upper left of your screen. You can also use the Tab key to cycle through nearby targets or the F8 key to select your closest enemy.")
  158. end
  159. function bsc_1_2(NPC, Spawn)
  160. FaceTarget(NPC, Spawn)
  161. conversation = CreateConversation()
  162. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  163. AddConversationOption(conversation, "So I can fight anyone or anything I want?", "bsc_1_3")
  164. StartConversation(conversation, NPC, Spawn, "If you're close enough to your foe and want to start hitting it with your weapon, either click your Melee Attack button on your hotbar or press the ~ key. Or you can begin by using one of your spells or combat arts to get the enemy's attention. Remember, you must be close enough to actually hit them.")
  165. end
  166. function bsc_1_3(NPC, Spawn)
  167. FaceTarget(NPC, Spawn)
  168. conversation = CreateConversation()
  169. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  170. AddConversationOption(conversation, "Tell me about melee combat.", "bsc_2_1")
  171. AddConversationOption(conversation, "Tell me about ranged combat.", "bsc_3_1")
  172. AddConversationOption(conversation, "What kind of rewards can I earn in battle?", "bsc_4_1")
  173. AddConversationOption(conversation, "Teach me more advanced aspects of combat.", "adv_chat")
  174. AddConversationOption(conversation, "I'll come back later.")
  175. StartConversation(conversation, NPC, Spawn, "You can fight most non-player characters and creatures that you find outside your city, whether outdoors or in dungeons. Many non-player characters in the cities are there to help you or give quests, so you can't attack some of them. If you try, you'll get a message telling you that they aren't valid targets.")
  176. end
  177. function bsc_2_1(NPC, Spawn)
  178. FaceTarget(NPC, Spawn)
  179. conversation = CreateConversation()
  180. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  181. AddConversationOption(conversation, "What classes specialize in melee combat?", "bsc_2_2")
  182. StartConversation(conversation, NPC, Spawn, "Melee combat means a toe-to-toe, physical confrontation. It is a combination of auto-attack damage that happens automatically when you press the Melee Attack button on your hotbar or the ~ key and spells or combat arts that you use in close proximity to your foe.")
  183. end
  184. function bsc_2_2(NPC, Spawn)
  185. FaceTarget(NPC, Spawn)
  186. conversation = CreateConversation()
  187. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  188. AddConversationOption(conversation, "Tell me how to begin a fight.", "bsc_1_1")
  189. AddConversationOption(conversation, "Tell me about ranged combat.", "bsc_3_1")
  190. AddConversationOption(conversation, "What kind of rewards can I earn in battle?", "bsc_4_1")
  191. AddConversationOption(conversation, "Teach me more advanced aspects of combat.", "adv_chat")
  192. AddConversationOption(conversation, "I'll come back later.")
  193. StartConversation(conversation, NPC, Spawn, "Sturdy fighters such as Guardians, Berserkers, Bruisers, and Shadowknights stand at the front lines of battle facing the enemy. Crafty scouts such as Brigands, Assassins, Troubadors, and Dirges generally stay close to their foes as well, but prefer to launch attacks from the back or side where they are less likely to be counterattacked.")
  194. end
  195. function bsc_3_1(NPC, Spawn)
  196. FaceTarget(NPC, Spawn)
  197. conversation = CreateConversation()
  198. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  199. AddConversationOption(conversation, "How do I launch a ranged attack?", "bsc_3_2")
  200. StartConversation(conversation, NPC, Spawn, "Ranged combat means that you put some distance between yourself and the enemy. This can be done with weapons such as bows or throwing daggers, or with spells and arts that can be cast from a distance.")
  201. end
  202. function bsc_3_2(NPC, Spawn)
  203. FaceTarget(NPC, Spawn)
  204. conversation = CreateConversation()
  205. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  206. AddConversationOption(conversation, "What classes specialize in ranged combat?", "bsc_3_3")
  207. StartConversation(conversation, NPC, Spawn, "If you have a ranged weapon and ammunition, you can initiate ranged combat by using the Ranged Attack button on the Abilities tab of your Knowledge Book. You can drag this key to your hotbar if you like. Remember, you must have a ranged weapon in the Ranged slot of your inventory window and the correct type of ammunition in the Ammo slot.")
  208. end
  209. function bsc_3_3(NPC, Spawn)
  210. FaceTarget(NPC, Spawn)
  211. conversation = CreateConversation()
  212. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  213. AddConversationOption(conversation, "How do I tell if I can use spells or arts from a distance?", "bsc_3_4")
  214. StartConversation(conversation, NPC, Spawn, "While most classes have the ability to attack from a distance, scout classes such as Brigands, Troubadors, Dirges, and Assassins specialize in ranged physical attacks. Mages, priests, and Shadowknights have spells that do damage to their foes from a distance.")
  215. end
  216. function bsc_3_4(NPC, Spawn)
  217. FaceTarget(NPC, Spawn)
  218. conversation = CreateConversation()
  219. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  220. AddConversationOption(conversation, "Tell me how to begin a fight.", "bsc_1_1")
  221. AddConversationOption(conversation, "Tell me about melee combat.", "bsc_2_1")
  222. AddConversationOption(conversation, "What kind of rewards can I earn in battle?", "bsc_4_1")
  223. AddConversationOption(conversation, "Teach me more advanced aspects of combat.", "adv_chat")
  224. AddConversationOption(conversation, "I'll come back later.")
  225. StartConversation(conversation, NPC, Spawn, "You can right-click on a spell or art's icon and select 'Examine' to see what its range of effect is. In addition, if you target something and the icon for one of your spells or arts turns a dark red, that means the opponent is out of range of that ability.")
  226. end
  227. function bsc_4_1(NPC, Spawn)
  228. FaceTarget(NPC, Spawn)
  229. conversation = CreateConversation()
  230. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  231. AddConversationOption(conversation, "What do you mean by 'a worthy opponent'?", "bsc_4_2")
  232. StartConversation(conversation, NPC, Spawn, "Victory in battle can be very rewarding. Successful combat against a worthy opponent awards you experience (XP) to help you advance your level, as well as the chance at coin, usable items, and other valuables.")
  233. end
  234. function bsc_4_2(NPC, Spawn)
  235. FaceTarget(NPC, Spawn)
  236. conversation = CreateConversation()
  237. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  238. AddConversationOption(conversation, "Are certain types of targets more rewarding than others?")
  239. StartConversation(conversation, NPC, Spawn, "You don't earn rewards for defeating foes that are too far below your level. If your target has a grey name, it means it is very weak and won't provide any benefit for beating it.")
  240. end
  241. function bsc_4_3(NPC, Spawn)
  242. FaceTarget(NPC, Spawn)
  243. conversation = CreateConversation()
  244. PlayFlavor(NPC, "", "", "", 0, 0, Spawn)
  245. AddConversationOption(conversation, "Tell me how to begin a fight.", "bsc_1_1")
  246. AddConversationOption(conversation, "Tell me about melee combat.", "bsc_2_1")
  247. AddConversationOption(conversation, "Tell me about ranged combat.", "bsc_3_1")
  248. AddConversationOption(conversation, "Teach me more advanced aspects of combat.", "adv_chat")
  249. AddConversationOption(conversation, "I'll come back later.")
  250. StartConversation(conversation, NPC, Spawn, "The tougher a foe, the better its chances to provide a valuable reward. Though defeating enemies alone provides nice rewards, defeating heroic enemies that require a group is even more rewarding. The very best items come from banding together multiple groups to defeat epic opponents.")
  251. end