VithLTar.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. --[[
  2. Script Name : SpawnScripts/SourceEvil/VithLTar.lua
  3. Script Purpose : Make Vith attackable and spawns adds
  4. Script Author : Jabantiz , Edited Lemmeron fixed Vith not being attack-able and pet not dying
  5. Script Date : 9/10/2016 , 17/8/2020
  6. Script Notes : BeginAttack() is called from a timer function set in eviltotem.lua
  7. --]]
  8. local Priest1ID = 433225
  9. local Priest2ID = 433226
  10. local PetID = 2540008
  11. local VithID = 2540005
  12. function spawn(NPC)
  13. end
  14. function respawn(NPC)
  15. spawn(NPC)
  16. end
  17. function BeginAttack(NPC, Spawn)
  18. local zone = GetZone(NPC)
  19. local Priest1 = SpawnByLocationID(zone, Priest1ID)
  20. local Priest2 = SpawnByLocationID(zone, Priest2ID)
  21. SpawnSet(NPC, "targetable", 1)
  22. SpawnSet(NPC, "visual_state", 0)
  23. PlayFlavor(NPC, "", "Now rot like your friends!", "", 1689589577, 4560189)
  24. if Priest1 ~= nil then
  25. Attack(Priest1, Spawn)
  26. end
  27. if Priest2 ~= nil then
  28. Attack(Priest2, Spawn)
  29. end
  30. SpawnSet(NPC, "faction", 1)
  31. SpawnSet(NPC, "show_level", 1)
  32. SpawnSet(NPC, "attackable", 1)
  33. Attack(NPC, Spawn)
  34. local Pet = GetSpawn(NPC, PetID)
  35. if Pet ~= nil then
  36. SpawnSet(Pet, "faction", 1)
  37. SpawnSet(Pet, "attackable", 1)
  38. Attack(Pet, Spawn)
  39. end
  40. end
  41. function death(NPC, Spawn)
  42. local Vithb = GetSpawn(NPC, VithID)
  43. local Petb = GetSpawn(Spawn, PetID)
  44. if Petb ~= nil then
  45. KillSpawn(Petb, Spawn)
  46. end
  47. end