WidgetRedbladeSignalFireSwitch.lua 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. --[[
  2. Script Name : SpawnScriptsFrostfangSeaWidgetRedbladeSignalFireSwitch.lua
  3. Script Purpose : for the spawn "redblade_x4_signal_fire_switch"
  4. Script Author : theFoof
  5. Script Date : 2013.5.6
  6. Script Notes :
  7. --]]
  8. local FlameOn = 5
  9. function spawn(NPC)
  10. SetRequiredQuest(NPC, FlameOn, 1)
  11. SetPlayerProximityFunction(NPC, 15, "InRange")
  12. end
  13. function respawn(NPC)
  14. spawn(NPC)
  15. end
  16. function casted_on(Target, Caster, SpellName)
  17. if GetQuestStep(Caster, FlameOn) == 1 and SpellName == "Light Signal Fire" then
  18. AddSpawnAccess(GetSpawn(Target, 4701733), Caster)
  19. SetStepComplete(Caster, FlameOn, 1)
  20. local zone = GetZone(Target)
  21. local orc1 = SpawnByLocationID(zone, 1032806)
  22. local orc2 = SpawnByLocationID(zone, 1032810)
  23. SetTempVariable(orc1, "other_orc", orc2)
  24. SetTempVariable(orc2, "other_orc", orc1)
  25. Attack(orc1, Caster)
  26. Attack(orc2, Caster)
  27. SetRequiredQuest(Target, FlameOn, 5)
  28. end
  29. end
  30. function InRange(NPC, Player)
  31. if GetQuestStep(Player, FlameOn) == 2 then
  32. local zone = GetZone(Player)
  33. local orc1 = SpawnByLocationID(zone, 1032806)
  34. local orc2 = SpawnByLocationID(zone, 1032810)
  35. SetTempVariable(orc1, "other_orc", orc2)
  36. SetTempVariable(orc2, "other_orc", orc1)
  37. Attack(orc1, Player)
  38. Attack(orc2, Player)
  39. end
  40. end