9
3

widgetwidgetgigglingorcx1.lua 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. --[[
  2. Script Name : SpawnScripts/Commonlands/widgetwidgetgigglingorcx1.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.05.25 08:05:37
  5. Script Purpose :
  6. :
  7. --]]
  8. local TheGigglingOrc = 5238
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 5, "InRange")
  11. end
  12. function InRange(NPC, Spawn)
  13. if not HasQuest(Spawn, TheGigglingOrc) and not HasCompletedQuest(Spawn, TheGigglingOrc) then
  14. SpawnSet(NPC, "display_hand_icon", 1)
  15. SpawnSet(NPC, "show_command_icon", 1)
  16. AddPrimaryEntityCommand(Spawn, NPC, "Examine", 3, "", "", 100, "")
  17. end
  18. end
  19. function casted_on(NPC, Spawn, SpellName)
  20. if SpellName == 'Examine' then
  21. local con = CreateConversation()
  22. AddConversationOption(con, "Read the poster", "option1")
  23. AddConversationOption(con, "Ignore the poster")
  24. StartDialogConversation(con, 1, NPC, Spawn, "You have found a parchment under this stone. It seems to be a wanted poster with a crudely hand drawn picture of a smiling orc.")
  25. end
  26. end
  27. function option1(NPC, Spawn)
  28. OfferQuest(NPC, Spawn, TheGigglingOrc)
  29. local con = CreateConversation()
  30. AddConversationOption(con, "I will wipe the smile off that Orc's face!")
  31. StartDialogConversation(con, 1, NPC, Spawn, "There are a few words crudely written on the poster. After studying the poster for some time you make out... ''Orc giggling too much. Want orc dead or not smiling no more.''")
  32. AddTimer(NPC, 150, "remove_access", 1, Spawn)
  33. end
  34. function remove_access(NPC, Spawn)
  35. if HasQuest(Spawn, TheGigglingOrc) then
  36. SpawnSet(NPC, "display_hand_icon", 0)
  37. SpawnSet(NPC, "show_command_icon", 0)
  38. RemovePrimaryEntityCommand(Spawn, NPC, "Examine", 3)
  39. end
  40. end
  41. function respawn(NPC)
  42. spawn(NPC)
  43. end