alekeg.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. --[[
  2. Script Name : SpawnScripts/Antonica/alekeg.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.09.01 06:09:40
  5. Script Purpose :
  6. :
  7. --]]
  8. local RunningOutOfBeer = 5352
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 10, "InRange", Spawn)
  11. end
  12. function InRange(NPC, Spawn)
  13. if HasQuest(Spawn, RunningOutOfBeer) then
  14. if GetQuestStep(Spawn, RunningOutOfBeer) == 1 then
  15. SetAccessToEntityCommand(Spawn,NPC,"Grab a beer", 1)
  16. SpawnSet(NPC, "show_command_icon", 1)
  17. SpawnSet(NPC, "display_hand_icon", 1)
  18. elseif QuestStepIsComplete(Spawn, RunningOutOfBeer, 1) then
  19. SetAccessToEntityCommand(Spawn,NPC,"Grab a beer", 0)
  20. SpawnSet(NPC, "show_command_icon", 0)
  21. SpawnSet(NPC, "display_hand_icon", 0)
  22. end
  23. elseif not HasQuest(Spawn, RunningOutOfBeer) then
  24. SetAccessToEntityCommand(Spawn,NPC,"Grab a beer", 0)
  25. SpawnSet(NPC, "show_command_icon", 0)
  26. SpawnSet(NPC, "display_hand_icon", 0)
  27. end
  28. end
  29. function casted_on(NPC, Spawn, SpellName)
  30. if SpellName == 'Grab a beer' then
  31. if not QuestStepIsComplete(Spawn, RunningOutOfBeer, 1) then
  32. SetStepComplete(Spawn, RunningOutOfBeer, 1)
  33. end
  34. SetAccessToEntityCommand(Spawn,NPC,"Grab a beer", 0)
  35. SpawnSet(NPC, "show_command_icon", 0)
  36. SpawnSet(NPC, "display_hand_icon", 0)
  37. end
  38. end
  39. function respawn(NPC)
  40. spawn(NPC)
  41. end