9
3

tomelocationexaminebed.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --[[
  2. Script Name : SpawnScripts/FallenGate/tomelocationexaminebed.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.07.09 09:07:18
  5. Script Purpose :
  6. :
  7. --]]
  8. local TheBloodOfTheBearPartOne = 13958
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 10, "InRange", Spawn)
  11. end
  12. function InRange(NPC, Spawn)
  13. if not HasItem(Spawn, TheBloodOfTheBearPartOne) then
  14. SpawnSet(NPC, "show_command_icon", 1)
  15. SpawnSet(NPC, "display_hand_icon", 1)
  16. SetAccessToEntityCommand(Spawn,NPC,"Search Bed", 1)
  17. elseif HasItem(Spawn, TheBloodOfTheBearPartOne) then
  18. SpawnSet(NPC, "show_command_icon", 0)
  19. SpawnSet(NPC, "display_hand_icon", 0)
  20. SetAccessToEntityCommand(Spawn,NPC,"Search Bed", 0)
  21. end
  22. end
  23. function casted_on(NPC, Spawn, SpellName)
  24. if SpellName == 'Search Bed' then
  25. if not HasItem(Spawn, TheBloodOfTheBearPartOne) then
  26. SendMessage(Spawn, "You find an old tattered book.")
  27. SendPopUpMessage(Spawn, "You receive The Blood of The Bear, Part One.", 255, 255, 255)
  28. SummonItem(Spawn, TheBloodOfTheBearPartOne)
  29. elseif HasItem(Spawn, ZatirresFirstZombie) then
  30. SpawnSet(NPC, "show_command_icon", 0)
  31. SpawnSet(NPC, "display_hand_icon", 0)
  32. SetAccessToEntityCommand(Spawn,NPC,"Search Urn", 0)
  33. end
  34. end
  35. end
  36. function respawn(NPC)
  37. spawn(NPC)
  38. end