9
3

beehive03.lua 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. --[[
  2. Script Name : SpawnScripts/OutpostOverlord/beehive03.lua
  3. Script Author : jakejp
  4. Script Date : 2018.10.08 01:10:18
  5. Script Purpose :
  6. :
  7. --]]
  8. function spawn(NPC)
  9. end
  10. function hailed(NPC, Spawn)
  11. FaceTarget(NPC, Spawn)
  12. end
  13. function respawn(NPC)
  14. end
  15. function casted_on(NPC, Spawn, SpellName)
  16. if SpellName == "smack hive" then
  17. SmackHive(Spawn, NPC)
  18. end
  19. end
  20. function SmackHive(Caster, Target)
  21. SpawnSet(Target, "show_command_icon", 0)
  22. local QueenBee
  23. local SoldierBee
  24. local beehive01 = 2780121
  25. if GetSpawnID(Target) == beehive01 then
  26. Say(Caster, "here")
  27. QueenBee = 401317
  28. SoldierBee = 401351
  29. elseif GetSpawnID(Target) == 2780120 then
  30. QueenBee = 401318
  31. SoldierBee = 401354
  32. elseif GetSpawnID(Target) == 2780122 then
  33. QueenBee = 1585522
  34. SoldierBee = 401358
  35. elseif GetSpawnID(Target) == 2780124 then
  36. QueenBee = 401317
  37. SoldierBee = 401351
  38. end
  39. -- 20% chance to spawn a Queen bee
  40. -- 80% chance to spawn a soldier bee
  41. choice = math.random(1, 100)
  42. if choice <= 20 then
  43. -- spawn a Queen bee
  44. --SpawnMob(GetZone(Target), 2780076, false, GetX(Target), GetY(Target), GetZ(Target))
  45. SpawnByLocationID(GetZone(Target), QueenBee)
  46. else
  47. -- spawn a soldier bee
  48. --SpawnMob(GetZone(Target), 2780078, false, GetX(Target), GetY(Target), GetZ(Target))
  49. SpawnByLocationID(GetZone(Target), SoldierBee)
  50. end
  51. AddTimer(Target, 60000, "enable_command_icon_beeHive")
  52. end
  53. function enable_command_icon_beeHive(NPC, Player)
  54. SpawnSet(NPC, "show_command_icon", 1)
  55. end