9
3

VithLTar.lua 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. -- SetPlayerProximityFunction(NPC, 5, "InRange")
  14. end
  15. function respawn(NPC)
  16. spawn(NPC)
  17. end
  18. function BeginAttack(NPC, Spawn)
  19. local zone = GetZone(NPC)
  20. local Priest1 = SpawnByLocationID(zone, Priest1ID)
  21. local Priest2 = SpawnByLocationID(zone, Priest2ID)
  22. SpawnSet(NPC, "targetable", 1)
  23. SpawnSet(NPC, "visual_state", 0)
  24. PlayFlavor(NPC, "", "Now rot like your friends!", "", 1689589577, 4560189)
  25. if Priest1 ~= nil then
  26. Attack(Priest1, Spawn)
  27. end
  28. if Priest2 ~= nil then
  29. Attack(Priest2, Spawn)
  30. end
  31. SpawnSet(NPC, "faction", 1)
  32. SpawnSet(NPC, "show_level", 1)
  33. SpawnSet(NPC, "attackable", 1)
  34. Attack(NPC, Spawn)
  35. local Pet = GetSpawn(NPC, PetID)
  36. if Pet ~= nil then
  37. SpawnSet(Pet, "faction", 1)
  38. SpawnSet(Pet, "attackable", 1)
  39. Attack(Pet, Spawn)
  40. end
  41. end
  42. function death(NPC, Spawn)
  43. local Vithb = GetSpawn(NPC, VithID)
  44. local Petb = GetSpawn(Spawn, PetID)
  45. if Petb ~= nil then
  46. KillSpawn(Petb, Spawn)
  47. end
  48. end
  49. --function InRange(NPC)
  50. -- Say(NPC, "Remember any of these? Maybe they were your friends."
  51. --end