Advertisement
expired6978

Untitled

Aug 11th, 2012
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.50 KB | None | 0 0
  1. Scriptname DLC1PlayerVampireScript extends ReferenceAlias conditional
  2.  
  3. Float Property BatsCooldown Auto
  4. message Property DLC1BatsWaitMessage Auto
  5. globalvariable Property DLC1BatsCount Auto
  6. message Property DLC1BatsReadyMessage Auto
  7. spell Property CurrentEquippedPower Auto
  8. spell Property DLC1VampireBats Auto
  9. race Property VampireLordRace Auto
  10. spell Property DLC1Mistform Auto
  11. Int Property BatsOutdoorMaxUses Auto
  12. Int Property BatsIndoorMaxUses Auto
  13.  
  14.  
  15. {Function that returns the current state}
  16. String Function GetState()
  17. return ::State
  18. EndFunction
  19.  
  20. {Function that switches this object to the specified state}
  21. Function GotoState(String newState)
  22. onEndState()
  23. ::State = newState
  24. onBeginState()
  25. EndFunction
  26.  
  27. Function OnSpellCast(Form akSpellCast)
  28. debug.Trace("VAMPIRE BATS: Spell detected", 0)
  29. if (akSpellCast == (DLC1VampireBats as Form))
  30. if (DLC1BatsCount.value == (0 as Float))
  31. debug.Trace(("VAMPIRE BATS: Registering single update " + (BatsCooldown as String)), 0)
  32. RegisterForSingleUpdateGameTime(BatsCooldown)
  33. endif
  34. DLC1BatsCount.value = (DLC1BatsCount.value + (1 as Float))
  35. debug.Trace(("VAMPIRE BATS: Bats count = " + (DLC1BatsCount.value as String)), 0)
  36. if ((game.GetPlayer().IsInInterior() == false) as Bool) && ((DLC1BatsCount.value >= (BatsOutdoorMaxUses as Float)) as Bool)
  37. DLC1BatsWaitMessage.Show(0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000)
  38. GetActorRef()
  39. GetActorRef().RemoveSpell(DLC1VampireBats)
  40. endif
  41. if ((game.GetPlayer().IsInInterior() == true) as Bool) && ((DLC1BatsCount.value >= (BatsIndoorMaxUses as Float)) as Bool)
  42. DLC1BatsWaitMessage.Show(0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000)
  43. GetActorRef()
  44. GetActorRef().RemoveSpell(DLC1VampireBats)
  45. endif
  46. endif
  47. EndFunction
  48.  
  49. Function OnUpdateGameTime()
  50. UnRegisterforUpdateGameTime()
  51. debug.Trace("VAMPIRE BATS: Bats available again", 0)
  52. if ((game.GetPlayer().IsInInterior() == false) as Bool)
  53. if (((DLC1BatsCount.value >= (BatsOutdoorMaxUses as Float)) as Bool) as Bool) if ((game.GetPlayer().IsInInterior() == true) as Bool)
  54. if (((DLC1BatsCount.value >= (BatsIndoorMaxUses as Float)) as Bool) as Bool)
  55. DLC1BatsReadyMessage.Show(0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000)
  56. GetActorRef()
  57. GetActorRef().AddSpell(DLC1VampireBats, false)
  58. GetActorRef()
  59. if (GetActorRef().GetEquippedSpell(2) == None)
  60. debug.Trace("VAMPIRE BATS: Nothing else equipped, equip bats", 0)
  61. GetActorRef()
  62. GetActorRef().EquipSpell(DLC1VampireBats, 2)
  63. endif
  64. endif
  65. DLC1BatsCount.value = (0 as Float)
  66. EndFunction
  67.  
  68. Function OnRaceSwitchComplete()
  69. if (GetActorReference() == game.GetPlayer())
  70. game.GetPlayer().GetActorBase()
  71. game.GetPlayer().GetActorBase().SetInvulnerable(false)
  72. game.GetPlayer().SetGhost(false)
  73. endif
  74. GetActorReference()
  75. if (GetActorReference().GetRace() == VampireLordRace)
  76. debug.Trace("VAMPIRE: Getting notification that race swap TO vampire is complete.", 0)
  77. (GetOwningQuest() as dlc1playervampirechangescript).StartTracking()
  78. endif
  79. debug.Trace("VAMPIRE: Getting notification that race swap FROM vampire is complete.", 0)
  80. (GetOwningQuest() as dlc1playervampirechangescript).Shutdown()
  81. EndFunction
  82.  
  83. Function OnPlayerLoadGame()
  84. (GetOwningQuest() as dlc1playervampirechangescript).HandlePlayerLoadGame()
  85. EndFunction
  86.  
  87. Function OnInit()
  88. DLC1BatsCount.value = (0 as Float)
  89. EndFunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement