9
3

wallaxewidget.lua 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. --[[
  2. Script Name : SpawnScripts/Commonlands/wallaxewidget.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.05.25 07:05:09
  5. Script Purpose :
  6. :
  7. --]]
  8. local GrumsInspiringAxe = 5235
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 5, "InRange")
  11. end
  12. function InRange(NPC, Spawn)
  13. if not HasQuest(Spawn, GrumsInspiringAxe) and not HasCompletedQuest(Spawn, GrumsInspiringAxe) then
  14. SpawnSet(NPC, "display_hand_icon", 1)
  15. SpawnSet(NPC, "show_command_icon", 1)
  16. AddPrimaryEntityCommand(Spawn, NPC, "Examine", 4)
  17. end
  18. end
  19. function casted_on(NPC, Spawn, SpellName)
  20. if SpellName == 'Examine' then
  21. local con = CreateConversation()
  22. AddConversationOption(con, "Inspect axe. ", "option1")
  23. AddConversationOption(con, "Ignore the axe.")
  24. StartDialogConversation(con, 1, NPC, Spawn, "Upon the wall you see a shiny axe.")
  25. end
  26. end
  27. function option1(NPC, Spawn)
  28. OfferQuest(NPC, Spawn, GrumsInspiringAxe)
  29. local con = CreateConversation()
  30. AddConversationOption(con, "I shall slay some giants!")
  31. AddConversationOption(con, "exit")
  32. StartDialogConversation(con, 1, NPC, Spawn, "To your astonishment, the name Grum is engraved on the pommel of the axe. Grum the Giant Slayer is sung of in many a tavern in Freeport, he might possibly be famous all over Norrath! Being a giant slayer could be a lucrative and glorious profession!")
  33. AddTimer(NPC, 150, "remove_access", 1, Spawn)
  34. end
  35. function remove_access(NPC, Spawn)
  36. if HasQuest(Spawn, GrumsInspiringAxe) then
  37. SpawnSet(NPC, "display_hand_icon", 0)
  38. SpawnSet(NPC, "show_command_icon", 0)
  39. RemovePrimaryEntityCommand(Spawn, NPC, "Examine", 4)
  40. end
  41. end
  42. function respawn(NPC)
  43. spawn(NPC)
  44. end