anIcemaneCub.lua 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. --[[
  2. Script Name : SpawnScripts/FrostfangSea/anIcemaneCub.lua
  3. Script Purpose : for the spawn "an icemane cub"
  4. Script Author : theFoof
  5. Script Date : 2013.05.25
  6. Script Notes :
  7. --]]
  8. require"SpawnScripts/Generic/tiny_movement_loop"
  9. function spawn(NPC)
  10. ChooseMovement(NPC)
  11. end
  12. function respawn(NPC)
  13. spawn(NPC)
  14. end
  15. local IcemanesCometh = 18
  16. function casted_on(NPC, Caster, SpellName)
  17. if SpellName == "Leash" then
  18. if GetQuestStep(Caster, IcemanesCometh) == 1 then
  19. if GetTempVariable(Caster, "cub1") == nil then
  20. SetTempVariable(Caster, "cub1", NPC)
  21. AddTimer(NPC, 600000, "depop")
  22. SpawnSet(NPC, "attackable", "0")
  23. SpawnSet(NPC, "show_level", "0")
  24. SetFollowTarget(NPC, Caster)
  25. SetSpeed(NPC, 9)
  26. ToggleFollow(NPC)
  27. elseif GetTempVariable(Caster, "cub2") == nil then
  28. SetTempVariable(Caster, "cub2", NPC)
  29. AddTimer(NPC, 600000, "depop")
  30. SpawnSet(NPC, "attackable", "0")
  31. SpawnSet(NPC, "show_level", "0")
  32. SetFollowTarget(NPC, Caster)
  33. SetSpeed(NPC, 9)
  34. ToggleFollow(NPC)
  35. elseif GetTempVariable(Caster, "cub3") == nil then
  36. SetTempVariable(Caster, "cub3", NPC)
  37. AddTimer(NPC, 600000, "depop")
  38. SpawnSet(NPC, "attackable", "0")
  39. SpawnSet(NPC, "show_level", "0")
  40. SetFollowTarget(NPC, Caster)
  41. SetSpeed(NPC, 9)
  42. ToggleFollow(NPC)
  43. elseif GetTempVariable(Caster, "cub4") == nil then
  44. SetTempVariable(Caster, "cub4", NPC)
  45. AddTimer(NPC, 600000, "depop")
  46. SpawnSet(NPC, "attackable", "0")
  47. SpawnSet(NPC, "show_level", "0")
  48. SetFollowTarget(NPC, Caster)
  49. SetSpeed(NPC, 9)
  50. ToggleFollow(NPC)
  51. end
  52. end
  53. end
  54. end
  55. function hailed(NPC, Spawn)
  56. FaceTarget(NPC, Spawn)
  57. end
  58. function depop(NPC, Spawn)
  59. if NPC ~= nil then
  60. Despawn(NPC)
  61. end
  62. end