9
3

pirateskull.lua 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. --[[
  2. Script Name : pirate skull
  3. Script Purpose : Governs behavior for Guurok Event on Queen's Colony
  4. Script Author : ????
  5. Script Date : 17/05/2020
  6. Script Notes : Fixed typos, improved readability 05/28
  7. --]]
  8. function examined(Item, Player)
  9. conversation = CreateConversation()
  10. AddConversationOption(conversation, "Place the skull on ground.", "PlaceSkull")
  11. AddConversationOption(conversation, "Place it back in your bag.", "CloseItemConversation")
  12. StartDialogConversation(conversation, 2, Item, Player, "This skull must have some use.")
  13. end
  14. function PlaceSkull(Item, Player)
  15. zone = GetZone(Player)
  16. Guurok = GetSpawnByLocationID(zone, 433001)
  17. local distancecheck = GetDistance(Guurok, Player)
  18. if distancecheck > 8 then
  19. RemoveItem(Player, 10399)
  20. SendMessage(Player, "The skull crumbles to dust on the ground.", "yellow")
  21. CloseItemConversation(Item, Player)
  22. elseif distancecheck < 8 then
  23. FeedGuurok(Item, Player)
  24. SendMessage(Player, "The Guurok snatches the skull as you place it on the ground.", "yellow")
  25. FaceTarget(NPC, Player)
  26. PlayFlavor(Guurok, "", "", "attack", 0, 0)
  27. CloseItemConversation(Item, Player)
  28. RemoveItem(Player, 10399)
  29. end
  30. end
  31. function FeedGuurok(Item, Player)
  32. zone = GetZone(Player)
  33. Guurok = GetSpawnByLocationID(zone, 433001)
  34. if GetTempVariable(Guurok, "FeedCounter") == "0" then
  35. SpawnSet(Guurok, "size", "100")
  36. SetTempVariable(Guurok, "FeedCounter", 1)
  37. elseif GetTempVariable(Guurok, "FeedCounter") == "1" then
  38. SpawnSet(Guurok, "size", "105")
  39. SetTempVariable(Guurok, "FeedCounter", 2)
  40. elseif GetTempVariable(Guurok, "FeedCounter") == "2" then
  41. SetTempVariable(Guurok, "FeedCounter", 3)
  42. SpawnSet(Guurok, "size", "110")
  43. elseif GetTempVariable(Guurok, "FeedCounter") == "3" then
  44. SetTempVariable(Guurok, "FeedCounter", 4)
  45. SpawnSet(Guurok, "size", "115")
  46. elseif GetTempVariable(Guurok, "FeedCounter") == "4" then
  47. SetTempVariable(Guurok, "FeedCounter", 5)
  48. SpawnSet(Guurok, "size", "120")
  49. elseif GetTempVariable(Guurok, "FeedCounter") == "5" then
  50. SetTempVariable(Guurok, "FeedCounter", 6)
  51. SpawnSet(Guurok, "size", "125")
  52. elseif GetTempVariable(Guurok, "FeedCounter") == "6" then
  53. SetTempVariable(Guurok, "FeedCounter", 666)
  54. SpawnSet(Guurok, "size", "130")
  55. SpawnSet(Guurok, "visual_state", "3632")
  56. SpawnSet(Guurok, "show_level", "1")
  57. SpawnSet(Guurok, "attackable", "1")
  58. SpawnSet(Guurok, "faction", "1")
  59. end
  60. end