dock_barrel_correct.lua 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --[[
  2. Script Name : SpawnScripts/Graystone/dock_barrel_correct.lua
  3. Script Purpose : dock_barrel_correct
  4. Script Author : Scatman
  5. Script Date : 2009.10.05
  6. Script Notes :
  7. --]]
  8. local BARBARIAN_MENTOR_QUEST_2 = 290
  9. local DWARF_MENTOR_QUEST_3 = 286
  10. function spawn(NPC)
  11. SetRequiredQuest(NPC, DWARF_MENTOR_QUEST_3, 2)
  12. SetRequiredQuest(NPC, BARBARIAN_MENTOR_QUEST_2, 4)
  13. end
  14. function hailed(NPC, Spawn)
  15. end
  16. function respawn(NPC)
  17. spawn(NPC)
  18. end
  19. function casted_on(Target, Caster, SpellName)
  20. if HasQuest(Caster, BARBARIAN_MENTOR_QUEST_2) and GetQuestStep(Caster, BARBARIAN_MENTOR_QUEST_2) == 4 and SpellName == "inspect" then
  21. AddStepProgress(Caster, BARBARIAN_MENTOR_QUEST_2, 4, 1)
  22. SendMessage(Caster, "This crate is not from shipment CG4QC.")
  23. SpawnSet(Target, "show_command_icon", 0)
  24. AddTimer(Target, 30000, "ResetBarrel")
  25. elseif HasQuest(Caster, DWARF_MENTOR_QUEST_3) and GetQuestStep(Caster, DWARF_MENTOR_QUEST_3) == 2 and SpellName == "inspect" then
  26. conversation = CreateConversation()
  27. AddConversationOption(conversation, "Pick up Mav's package.", "PickupMavsPackage")
  28. StartDialogConversation(conversation, 1, Target, Caster, "There is a package for Mav Boilfist sitting just inside this barrel.")
  29. end
  30. end
  31. function PickupMavsPackage(NPC, Spawn)
  32. SetStepComplete(Spawn, DWARF_MENTOR_QUEST_3, 2)
  33. conversation = CreateConversation()
  34. AddConversationOption(conversation, "Close barrel.", "CloseConversation")
  35. StartDialogConversation(conversation, 1, NPC, Spawn, "You remove Mav's rather heavy package from the barrel. You'll need to clear this with the Shipping Coordinator before you can give it to Mav.")
  36. end
  37. function ResetBarrel(NPC)
  38. SpawnSet(NPC, "show_command_icon", 1)
  39. end