Advertisement
veaseomat

holocron does everything

Sep 9th, 2022
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.88 KB | None | 0 0
  1. local ObjectManager = require("managers.object.object_manager")
  2.  
  3. USEDHOLOCRON = "used_holocron"
  4. HOLOCRONCOOLDOWNTIME = 1000 -- 1 sec
  5.  
  6. VillageJediManagerHolocron = ScreenPlay:new {}
  7.  
  8. -- Check if the player can use the holocron.
  9. -- @param pPlayer pointer to the creature object of the player who tries to use the holocron.
  10. -- @return true if the player can use the holocron.
  11. function VillageJediManagerHolocron.canUseHolocron(pPlayer)
  12. local pGhost = CreatureObject(pPlayer):getPlayerObject()
  13.  
  14. if (pGhost == nil) then
  15. return false
  16. end
  17.  
  18. return CreatureObject(pPlayer):checkCooldownRecovery(USEDHOLOCRON)
  19. end
  20.  
  21. -- Checks if the player can replenish the force or not.
  22. -- @param pPlayer pointer to the creature object of the player who should be checked.
  23. -- @return true if the player can replenish the force.
  24. function VillageJediManagerHolocron.canReplenishForce(pPlayer)
  25. local pGhost = CreatureObject(pPlayer):getPlayerObject()
  26.  
  27. if (pGhost == nil) then
  28. return false
  29. end
  30.  
  31. return PlayerObject(pGhost):getForcePower() < PlayerObject(pGhost):getForcePowerMax()
  32. end
  33.  
  34. -- Use the holocron on the player.
  35. -- @param pSceneObject pointer to the scene object of the holocron.
  36. -- @param pPlayer pointer to the creature object of the player who is using the holocron.
  37. function VillageJediManagerHolocron.useTheHolocron(pSceneObject, pPlayer)
  38. local pGhost = CreatureObject(pPlayer):getPlayerObject()
  39.  
  40. if (pGhost == nil) then
  41. return
  42. end
  43.  
  44.  
  45. if CreatureObject(pPlayer):hasSkill("force_title_jedi_rank_02") and not CreatureObject(pPlayer):hasSkill("force_title_jedi_rank_03") and not CreatureObject(pPlayer):villageKnightPrereqsMet("") then
  46. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  47. sui.setTitle("JEDI PADAWAN")
  48. sui.setPrompt("You are not yet ready to continue your path padawan. use /findmytrainer to locate your jedi skill trainer.")
  49. sui.sendTo(pPlayer)
  50.  
  51. return
  52. end
  53.  
  54. if CreatureObject(pPlayer):hasSkill("force_rank_dark_master") then
  55. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  56. sui.setTitle("JEDI MASTER")
  57. sui.setPrompt("You sense a disturbance in the force... a dark figure is hunting you, stay alert.")
  58. sui.sendTo(pPlayer)
  59.  
  60. FsIntro:startStepDelay(pPlayer, 3)
  61. end
  62.  
  63. if CreatureObject(pPlayer):hasSkill("force_rank_light_master") then
  64. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  65. sui.setTitle("JEDI MASTER")
  66. sui.setPrompt("You sense a disturbance in the force... a dark figure is hunting you, stay alert.")
  67. sui.sendTo(pPlayer)
  68.  
  69. FsIntro:startStepDelay(pPlayer, 3)
  70. --addSkillPoints(pPlayer, 200)
  71. -- PlayerObject(pGhost):addSkillPoints(2)
  72. end
  73.  
  74. if not CreatureObject(pPlayer):hasSkill("force_title_jedi_rank_02") then
  75.  
  76. PlayerObject(pGhost):setJediState(2)
  77.  
  78. awardSkill(pPlayer, "force_title_jedi_rank_02")
  79.  
  80. CreatureObject(pPlayer):sendSystemMessage("You begin to feel attuned with the power of the Force, your Jedi skills have been unlocked.")
  81.  
  82. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  83. sui.setTitle("JEDI UNLOCK")
  84. sui.setPrompt("You begin to feel attuned with the power of the Force, your Jedi skills have been unlocked. Use /findmytrainer to locate your jedi skill trainer. All of your non jedi skills have been REMOVED. May the Force be with you... Jedi")
  85. sui.sendTo(pPlayer)
  86.  
  87. local pInventory = SceneObject(pPlayer):getSlottedObject("inventory")
  88.  
  89. if (pInventory == nil or SceneObject(pInventory):isContainerFullRecursive()) then
  90. CreatureObject(pPlayer):sendSystemMessage("@jedi_spam:inventory_full_jedi_robe")
  91. else
  92. giveItem(pInventory, "object/tangible/wearables/robe/robe_jedi_padawan.iff", -1)
  93. end
  94.  
  95. -- CreatureObject(pPlayer):playEffect("clienteffect/trap_electric_01.cef", "")
  96. -- CreatureObject(pPlayer):playMusicMessage("sound/music_become_jedi.snd")
  97. --
  98. -- SceneObject(pSceneObject):destroyObjectFromWorld()
  99. -- SceneObject(pSceneObject):destroyObjectFromDatabase()
  100. -- return --was used to prevent 1mil xp to unlock
  101.  
  102.  
  103. end
  104.  
  105. if not CreatureObject(pPlayer):hasSkill("force_title_jedi_rank_03") and CreatureObject(pPlayer):villageKnightPrereqsMet("") then
  106. if CreatureObject(pPlayer):hasSkill("force_rank_light_novice") or CreatureObject(pPlayer):hasSkill("force_rank_dark_novice") then
  107. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  108. sui.setTitle("Surrender FRS Box")
  109. sui.setPrompt("You already have a FRS novice box, you must surrender it before you can choose a side.")
  110. sui.sendTo(pPlayer)
  111. return
  112. end
  113. else
  114.  
  115. KnightTrials:sendCouncilChoiceSui(pPlayer)
  116.  
  117. end
  118.  
  119. if CreatureObject(pPlayer):hasSkill("force_title_jedi_rank_03") and not (CreatureObject(pPlayer):hasSkill("force_rank_light_novice") or CreatureObject(pPlayer):hasSkill("force_rank_dark_novice"))then
  120. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  121. sui.setTitle("Surrender Knight Box")
  122. sui.setPrompt("You already have the Jedi Knight Force progression box, you must surrender it before you can choose a side.")
  123. sui.sendTo(pPlayer)
  124. return
  125. end
  126.  
  127. if CreatureObject(pPlayer):hasSkill("force_title_jedi_rank_03") then
  128.  
  129. -- if PlayerObject(pGhost):getVisibility() > 0 then
  130. -- FsIntro:startStepDelay(pPlayer, 3)
  131. -- end
  132.  
  133. if CreatureObject(pPlayer):hasSkill("force_rank_light_rank_10") and not CreatureObject(pPlayer):hasSkill("force_rank_light_master") then
  134. awardSkill(pPlayer, "force_rank_light_master")
  135. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  136. sui.setTitle("FORCE RANKING SYSTEM")
  137. sui.setPrompt("You have been awarded with enough skill points to learn everything in the game. To learn non jedi skills you have to surrender all jedi skills.")
  138. sui.sendTo(pPlayer)
  139. end
  140. if CreatureObject(pPlayer):hasSkill("force_rank_light_rank_09") and not CreatureObject(pPlayer):hasSkill("force_rank_light_rank_10") then
  141. awardSkill(pPlayer, "force_rank_light_rank_10")
  142. local pInventory = SceneObject(pPlayer):getSlottedObject("inventory")
  143.  
  144. if (pInventory == nil or SceneObject(pInventory):isContainerFullRecursive()) then
  145. CreatureObject(pPlayer):sendSystemMessage("@jedi_spam:inventory_full_jedi_robe")
  146. else
  147. giveItem(pInventory, "object/tangible/wearables/robe/robe_jedi_light_s05.iff", -1)
  148. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  149. sui.setTitle("Jedi Knight")
  150. sui.setPrompt("You have been given a new robe befitting your rank.")
  151. sui.sendTo(pPlayer)
  152. end
  153. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  154. sui.setTitle("FORCE RANKING SYSTEM")
  155. sui.setPrompt("You have been awarded with 20 skill points. You now have enough skill points to learn all Jedi skills.")
  156. sui.sendTo(pPlayer)
  157. end
  158. if CreatureObject(pPlayer):hasSkill("force_rank_light_rank_08") and not CreatureObject(pPlayer):hasSkill("force_rank_light_rank_09") then
  159. awardSkill(pPlayer, "force_rank_light_rank_09")
  160. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  161. sui.setTitle("FORCE RANKING SYSTEM")
  162. sui.setPrompt("You have been awarded with 20 skill points.")
  163. sui.sendTo(pPlayer)
  164. end
  165. if CreatureObject(pPlayer):hasSkill("force_rank_light_rank_07") and not CreatureObject(pPlayer):hasSkill("force_rank_light_rank_08") then
  166. awardSkill(pPlayer, "force_rank_light_rank_08")
  167. local pInventory = SceneObject(pPlayer):getSlottedObject("inventory")
  168.  
  169. if (pInventory == nil or SceneObject(pInventory):isContainerFullRecursive()) then
  170. CreatureObject(pPlayer):sendSystemMessage("@jedi_spam:inventory_full_jedi_robe")
  171. else
  172. giveItem(pInventory, "object/tangible/wearables/robe/robe_jedi_light_s04.iff", -1)
  173. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  174. sui.setTitle("Jedi Knight")
  175. sui.setPrompt("You have been given a new robe befitting your rank.")
  176. sui.sendTo(pPlayer)
  177. end
  178. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  179. sui.setTitle("FORCE RANKING SYSTEM")
  180. sui.setPrompt("You have been awarded with 20 skill points.")
  181. sui.sendTo(pPlayer)
  182. end
  183. if CreatureObject(pPlayer):hasSkill("force_rank_light_rank_06") and not CreatureObject(pPlayer):hasSkill("force_rank_light_rank_07") then
  184. awardSkill(pPlayer, "force_rank_light_rank_07")
  185. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  186. sui.setTitle("FORCE RANKING SYSTEM")
  187. sui.setPrompt("You have been awarded with 20 skill points.")
  188. sui.sendTo(pPlayer)
  189. end
  190. if CreatureObject(pPlayer):hasSkill("force_rank_light_rank_05") and not CreatureObject(pPlayer):hasSkill("force_rank_light_rank_06") then
  191. awardSkill(pPlayer, "force_rank_light_rank_06")
  192. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  193. sui.setTitle("FORCE RANKING SYSTEM")
  194. sui.setPrompt("You have been awarded with 20 skill points.")
  195. sui.sendTo(pPlayer)
  196. end
  197. if CreatureObject(pPlayer):hasSkill("force_rank_light_rank_04") and not CreatureObject(pPlayer):hasSkill("force_rank_light_rank_05") then
  198. awardSkill(pPlayer, "force_rank_light_rank_05")
  199. local pInventory = SceneObject(pPlayer):getSlottedObject("inventory")
  200.  
  201. if (pInventory == nil or SceneObject(pInventory):isContainerFullRecursive()) then
  202. CreatureObject(pPlayer):sendSystemMessage("@jedi_spam:inventory_full_jedi_robe")
  203. else
  204. giveItem(pInventory, "object/tangible/wearables/robe/robe_jedi_light_s03.iff", -1)
  205. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  206. sui.setTitle("Jedi Knight")
  207. sui.setPrompt("You have been given a new robe befitting your rank.")
  208. sui.sendTo(pPlayer)
  209. end
  210. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  211. sui.setTitle("FORCE RANKING SYSTEM")
  212. sui.setPrompt("You have been awarded with 20 skill points.")
  213. sui.sendTo(pPlayer)
  214. end
  215. if CreatureObject(pPlayer):hasSkill("force_rank_light_rank_03") and not CreatureObject(pPlayer):hasSkill("force_rank_light_rank_04") then
  216. awardSkill(pPlayer, "force_rank_light_rank_04")
  217. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  218. sui.setTitle("FORCE RANKING SYSTEM")
  219. sui.setPrompt("You have been awarded with 20 skill points.")
  220. sui.sendTo(pPlayer)
  221. end
  222. if CreatureObject(pPlayer):hasSkill("force_rank_light_rank_02") and not CreatureObject(pPlayer):hasSkill("force_rank_light_rank_03") then
  223. awardSkill(pPlayer, "force_rank_light_rank_03")
  224. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  225. sui.setTitle("FORCE RANKING SYSTEM")
  226. sui.setPrompt("You have been awarded with 20 skill points.")
  227. sui.sendTo(pPlayer)
  228. end
  229. if CreatureObject(pPlayer):hasSkill("force_rank_light_rank_01") and not CreatureObject(pPlayer):hasSkill("force_rank_light_rank_02") then
  230. awardSkill(pPlayer, "force_rank_light_rank_02")
  231. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  232. sui.setTitle("FORCE RANKING SYSTEM")
  233. sui.setPrompt("You have been awarded with 20 skill points.")
  234. sui.sendTo(pPlayer)
  235. end
  236. if CreatureObject(pPlayer):hasSkill("force_rank_light_novice") and not CreatureObject(pPlayer):hasSkill("force_rank_light_rank_01") then
  237. awardSkill(pPlayer, "force_rank_light_rank_01")
  238. local pInventory = SceneObject(pPlayer):getSlottedObject("inventory")
  239.  
  240. if (pInventory == nil or SceneObject(pInventory):isContainerFullRecursive()) then
  241. CreatureObject(pPlayer):sendSystemMessage("@jedi_spam:inventory_full_jedi_robe")
  242. else
  243. giveItem(pInventory, "object/tangible/wearables/robe/robe_jedi_light_s02.iff", -1)
  244. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  245. sui.setTitle("Jedi Knight")
  246. sui.setPrompt("You have been given a new robe befitting your rank.")
  247. sui.sendTo(pPlayer)
  248. end
  249. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  250. sui.setTitle("FORCE RANKING SYSTEM")
  251. sui.setPrompt("You have been awarded with 20 skill points.")
  252. sui.sendTo(pPlayer)
  253. end
  254.  
  255. if CreatureObject(pPlayer):hasSkill("force_rank_dark_rank_10") and not CreatureObject(pPlayer):hasSkill("force_rank_dark_master") then
  256. awardSkill(pPlayer, "force_rank_dark_master")
  257. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  258. sui.setTitle("FORCE RANKING SYSTEM")
  259. sui.setPrompt("You have been awarded with enough skill points to learn everything in the game. To learn non jedi skills you have to surrender all jedi skills.")
  260. sui.sendTo(pPlayer)
  261. end
  262. if CreatureObject(pPlayer):hasSkill("force_rank_dark_rank_09") and not CreatureObject(pPlayer):hasSkill("force_rank_dark_rank_10") then
  263. awardSkill(pPlayer, "force_rank_dark_rank_10")
  264. local pInventory = SceneObject(pPlayer):getSlottedObject("inventory")
  265.  
  266. if (pInventory == nil or SceneObject(pInventory):isContainerFullRecursive()) then
  267. CreatureObject(pPlayer):sendSystemMessage("@jedi_spam:inventory_full_jedi_robe")
  268. else
  269. giveItem(pInventory, "object/tangible/wearables/robe/robe_jedi_dark_s05.iff", -1)
  270. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  271. sui.setTitle("Jedi Knight")
  272. sui.setPrompt("You have been given a new robe befitting your rank.")
  273. sui.sendTo(pPlayer)
  274. end
  275. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  276. sui.setTitle("FORCE RANKING SYSTEM")
  277. sui.setPrompt("You have been awarded with 20 skill points. You now have enough skill points to learn all Jedi skills.")
  278. sui.sendTo(pPlayer)
  279. end
  280. if CreatureObject(pPlayer):hasSkill("force_rank_dark_rank_08") and not CreatureObject(pPlayer):hasSkill("force_rank_dark_rank_09") then
  281. awardSkill(pPlayer, "force_rank_dark_rank_09")
  282. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  283. sui.setTitle("FORCE RANKING SYSTEM")
  284. sui.setPrompt("You have been awarded with 20 skill points.")
  285. sui.sendTo(pPlayer)
  286. end
  287. if CreatureObject(pPlayer):hasSkill("force_rank_dark_rank_07") and not CreatureObject(pPlayer):hasSkill("force_rank_dark_rank_08") then
  288. awardSkill(pPlayer, "force_rank_dark_rank_08")
  289. local pInventory = SceneObject(pPlayer):getSlottedObject("inventory")
  290.  
  291. if (pInventory == nil or SceneObject(pInventory):isContainerFullRecursive()) then
  292. CreatureObject(pPlayer):sendSystemMessage("@jedi_spam:inventory_full_jedi_robe")
  293. else
  294. giveItem(pInventory, "object/tangible/wearables/robe/robe_jedi_dark_s04.iff", -1)
  295. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  296. sui.setTitle("Jedi Knight")
  297. sui.setPrompt("You have been given a new robe befitting your rank.")
  298. sui.sendTo(pPlayer)
  299. end
  300. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  301. sui.setTitle("FORCE RANKING SYSTEM")
  302. sui.setPrompt("You have been awarded with 20 skill points.")
  303. sui.sendTo(pPlayer)
  304. end
  305. if CreatureObject(pPlayer):hasSkill("force_rank_dark_rank_06") and not CreatureObject(pPlayer):hasSkill("force_rank_dark_rank_07") then
  306. awardSkill(pPlayer, "force_rank_dark_rank_07")
  307. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  308. sui.setTitle("FORCE RANKING SYSTEM")
  309. sui.setPrompt("You have been awarded with 20 skill points.")
  310. sui.sendTo(pPlayer)
  311. end
  312. if CreatureObject(pPlayer):hasSkill("force_rank_dark_rank_05") and not CreatureObject(pPlayer):hasSkill("force_rank_dark_rank_06") then
  313. awardSkill(pPlayer, "force_rank_dark_rank_06")
  314. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  315. sui.setTitle("FORCE RANKING SYSTEM")
  316. sui.setPrompt("You have been awarded with 20 skill points.")
  317. sui.sendTo(pPlayer)
  318. end
  319. if CreatureObject(pPlayer):hasSkill("force_rank_dark_rank_04") and not CreatureObject(pPlayer):hasSkill("force_rank_dark_rank_05") then
  320. awardSkill(pPlayer, "force_rank_dark_rank_05")
  321. local pInventory = SceneObject(pPlayer):getSlottedObject("inventory")
  322.  
  323. if (pInventory == nil or SceneObject(pInventory):isContainerFullRecursive()) then
  324. CreatureObject(pPlayer):sendSystemMessage("@jedi_spam:inventory_full_jedi_robe")
  325. else
  326. giveItem(pInventory, "object/tangible/wearables/robe/robe_jedi_dark_s03.iff", -1)
  327. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  328. sui.setTitle("Jedi Knight")
  329. sui.setPrompt("You have been given a new robe befitting your rank.")
  330. sui.sendTo(pPlayer)
  331. end
  332. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  333. sui.setTitle("FORCE RANKING SYSTEM")
  334. sui.setPrompt("You have been awarded with 20 skill points.")
  335. sui.sendTo(pPlayer)
  336. end
  337. if CreatureObject(pPlayer):hasSkill("force_rank_dark_rank_03") and not CreatureObject(pPlayer):hasSkill("force_rank_dark_rank_04") then
  338. awardSkill(pPlayer, "force_rank_dark_rank_04")
  339. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  340. sui.setTitle("FORCE RANKING SYSTEM")
  341. sui.setPrompt("You have been awarded with 20 skill points.")
  342. sui.sendTo(pPlayer)
  343. end
  344. if CreatureObject(pPlayer):hasSkill("force_rank_dark_rank_02") and not CreatureObject(pPlayer):hasSkill("force_rank_dark_rank_03") then
  345. awardSkill(pPlayer, "force_rank_dark_rank_03")
  346. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  347. sui.setTitle("FORCE RANKING SYSTEM")
  348. sui.setPrompt("You have been awarded with 20 skill points.")
  349. sui.sendTo(pPlayer)
  350. end
  351. if CreatureObject(pPlayer):hasSkill("force_rank_dark_rank_01") and not CreatureObject(pPlayer):hasSkill("force_rank_dark_rank_02") then
  352. awardSkill(pPlayer, "force_rank_dark_rank_02")
  353. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  354. sui.setTitle("FORCE RANKING SYSTEM")
  355. sui.setPrompt("You have been awarded with 20 skill points.")
  356. sui.sendTo(pPlayer)
  357. end
  358. if CreatureObject(pPlayer):hasSkill("force_rank_dark_novice") and not CreatureObject(pPlayer):hasSkill("force_rank_dark_rank_01") then
  359. awardSkill(pPlayer, "force_rank_dark_rank_01")
  360. local pInventory = SceneObject(pPlayer):getSlottedObject("inventory")
  361.  
  362. if (pInventory == nil or SceneObject(pInventory):isContainerFullRecursive()) then
  363. CreatureObject(pPlayer):sendSystemMessage("@jedi_spam:inventory_full_jedi_robe")
  364. else
  365. giveItem(pInventory, "object/tangible/wearables/robe/robe_jedi_dark_s02.iff", -1)
  366. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  367. sui.setTitle("Jedi Knight")
  368. sui.setPrompt("You have been given a new robe befitting your rank.")
  369. sui.sendTo(pPlayer)
  370. end
  371. local sui = SuiMessageBox.new("JediTrials", "emptyCallback") -- No callback
  372. sui.setTitle("FORCE RANKING SYSTEM")
  373. sui.setPrompt("You have been awarded with 20 skill points.")
  374. sui.sendTo(pPlayer)
  375. end
  376. end
  377.  
  378. CreatureObject(pPlayer):playEffect("clienteffect/trap_electric_01.cef", "")
  379. CreatureObject(pPlayer):playMusicMessage("sound/music_become_jedi.snd")
  380.  
  381. SceneObject(pSceneObject):destroyObjectFromWorld()
  382. SceneObject(pSceneObject):destroyObjectFromDatabase()
  383.  
  384. CreatureObject(pPlayer):sendSystemMessage("The Holocron hums quietly and begins to glow! You have absorbed the ancient knowledge within the holocron.")
  385. --CreatureObject(pPlayer):awardExperience("jedi_general", 1000000, true) --no xp anymore
  386.  
  387. CreatureObject(pPlayer):addCooldown(USEDHOLOCRON, HOLOCRONCOOLDOWNTIME)
  388.  
  389.  
  390. end
  391.  
  392. -- Send message to the player that he cannot replenish the force.
  393. -- @param pPlayer pointer to the creature object of the player that tries to use the holocron.
  394. function VillageJediManagerHolocron.cannotReplenishForce(pPlayer)
  395. -- You are already at your maximum Force power.
  396. CreatureObject(pPlayer):sendSystemMessage("@jedi_spam:holocron_force_max")
  397. end
  398.  
  399. -- Send message to the player that he cannot use the holocron.
  400. -- @param pPlayer pointer to the creature object of the player that tries to use the holocron.
  401. function VillageJediManagerHolocron.cannotUseHolocron(pPlayer)
  402. -- The holocron hums briefly, but otherwise does nothing.
  403. CreatureObject(pPlayer):sendSystemMessage("@jedi_spam:holocron_no_effect")
  404. end
  405.  
  406. -- Handling of the useHolocron event.
  407. -- @param pSceneObject pointer to the holocron object.
  408. -- @param pPlayer pointer to the creature object that used the holocron.
  409. function VillageJediManagerHolocron.useHolocron(pSceneObject, pPlayer)
  410. if VillageJediManagerHolocron.canUseHolocron(pPlayer) then
  411. VillageJediManagerHolocron.useTheHolocron(pSceneObject, pPlayer)
  412. else
  413. CreatureObject(pPlayer):sendSystemMessage("Stop spamming the holocron!")
  414. end
  415.  
  416. end
  417.  
  418. return VillageJediManagerHolocron
  419.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement