beehive.lua 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. --[[
  2. Script Name : SpawnScripts/Baubbleshire/beehive.lua
  3. Script Purpose : beehive
  4. Script Author : Scatman
  5. Script Date : 2009.09.27
  6. Script Notes :
  7. --]]
  8. -- Quest ID's
  9. local PAYING_OFF_A_SWEET_DEBT = 326 -- was 73
  10. function spawn(NPC)
  11. SetRequiredQuest(NPC, PAYING_OFF_A_SWEET_DEBT, 1)
  12. end
  13. function respawn(NPC)
  14. spawn(NPC)
  15. end
  16. function hailed(NPC, Spawn)
  17. end
  18. function casted_on(Target, Caster, SpellName)
  19. if HasQuest(Caster, PAYING_OFF_A_SWEET_DEBT) and GetQuestStep(Caster, PAYING_OFF_A_SWEET_DEBT) == 1 and SpellName == "Collect Honey" then
  20. AddStepProgress(Caster, PAYING_OFF_A_SWEET_DEBT, 1, 1)
  21. if math.random(0, 100) <= 50 then
  22. local bee = SpawnMob(GetZone(Target), 2380067, false, GetX(Caster), GetY(Caster), GetZ(Caster))
  23. AddHate(Caster, bee, 100)
  24. end
  25. SpawnSet(Target, "show_command_icon", 0)
  26. SpawnSet(NPC, "show_hand_icon", 0)
  27. AddTimer(Target, 60000, "MakeTargetable")
  28. end
  29. end
  30. function MakeTargetable(NPC)
  31. SpawnSet(NPC, "show_command_icon", 1)
  32. SpawnSet(NPC, "show_hand_icon", 1)
  33. end