WidgetRedbladeSignalFireSwitch.luaa 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. SpawnByLocationID(zone, 32806)
  22. SpawnByLocationID(zone, 32810)
  23. Attack(GetSpawnByLocationID(zone, 32806), Caster)
  24. Attack(GetSpawnByLocationID(zone, 32810), Caster)
  25. SetRequiredQuest(Target, FlameOn, 5)
  26. end
  27. end
  28. function InRange(NPC, Player)
  29. if GetQuestStep(Player, FlameOn) == 2 then
  30. local zone = GetZone(Player)
  31. SpawnByLocationID(zone, 32806)
  32. SpawnByLocationID(zone, 32810)
  33. Attack(GetSpawnByLocationID(zone, 32806), Caster)
  34. Attack(GetSpawnByLocationID(zone, 32810), Caster)
  35. end
  36. end