enderalse/source/scripts/lycantrophetransformsc.psc

372 lines
10 KiB
Plaintext
Raw Normal View History

Scriptname LycantropheTransformSC extends activemagiceffect
bool isOnInfluanceOfPotion = false
bool nateSeesUs
bool sneakAttack
Actor targetRef
Event OnCrosshairRefChange(ObjectReference ref)
If ref as Actor ;Used to determine if it's none or not.
nateSeesUs = Game.GetPlayer().IsDetectedBy(ref as Actor)
if !nateSeesUs && isSneaking
Game.GetPlayer().SetAV("UnarmedDamage", 1000.1)
sneakAttack=true
elseif isSneaking
Game.GetPlayer().SetAV("UnarmedDamage", 10.1)
sneakAttack=false
endif
EndIf
EndEvent
Event OnUpdate()
if Game.GetPlayer().isInCombat()
detectionImage.Remove()
else
detectionImage.PopTo(detectionImage, 0.25)
endif
if isSneaking
RegisterForSingleUpdate(1)
endif
endEvent
bool isSneaking
Event OnKeyUp(int keyCode, float holdTime)
if keyCode == sneakWerewolfKey
if Game.GetPlayer().GetActorValue("Sneak")!=200
detectionImage.PopTo(detectionImage, 0.25)
RegisterForSingleUpdate(1)
isSneaking=true
;Game.GetPlayer().ForceAV ("SpeedMult", 50 )
Game.GetPlayer().ForceAV("CarryWeight", 10000)
Game.GetPlayer().ForceActorValue("SneakMod", 200)
Game.GetPlayer().ForceActorValue("Sneak", 200)
;Game.GetPlayer().AddPerk(InvisibilityMe )
Game.GetPlayer().StartSneaking()
_00E_EspionageFXS.Play(Game.GetPlayer())
int instanceID = sneakSound.play(Game.GetPlayer()) ; play mySFX sound from my self
Sound.SetInstanceVolume(instanceID, 1)
Game.GetPlayer().AddPerk(_00E_A1_InvisibilityPerk)
Game.GetPlayer().AddSpell(DetectLifeWerewolfVision, false)
Game.GetPlayer().ForceActorValue("Magicka", 20000)
DetectLifeWerewolfVision2.SetBaseCost(0)
DetectLifeWerewolfVision.cast(Game.GetPlayer())
else
detectionImage.Remove()
UnregisterForUpdate()
isSneaking=false
Game.GetPlayer().SetAV("UnarmedDamage", 10.1)
Game.GetPlayer().ForceAV ("SpeedMult", 100 )
Game.GetPlayer().ForceAV("CarryWeight", 10001)
sneakAttack=false
_00E_EspionageFXS.Stop(Game.GetPlayer())
Game.GetPlayer().RemovePerk(_00E_A1_InvisibilityPerk)
Game.GetPlayer().RemoveSpell(DetectLifeWerewolfVision)
Game.GetPlayer().DispelSpell(DetectLifeWerewolfVision)
Game.GetPlayer().ForceActorValue("Magicka", 0)
Game.GetPlayer().ForceActorValue("MagickaRate", 0)
endif
endif
if keyCode == 38
;Debug.Messagebox("Strength : 100\nStamina : 100\nResist : 100")
String hasEffectPanacea1 = "None"
String hasEffectPanacea2 = "None"
if (Game.GetPlayer().hasMagicEffect(panacea1Effect))
panacea1EffectOn.Show()
endif
if (Game.GetPlayer().hasMagicEffect(panacea2Effect))
panacea2EffectOn.Show()
endif
if (Game.GetPlayer().hasMagicEffect(panacea3Effect))
panacea3EffectOn.Show()
endif
if (Game.GetPlayer().hasMagicEffect(panacea4Effect))
panacea4EffectOn.Show()
endif
;_00E_statisticMessage.Show(Game.GetPlayer().GetActorValue("Health"), Game.GetPlayer().GetActorValue("Stamina"), Game.GetPlayer().GetActorValue("UnarmedDamage"), Game.GetPlayer().GetActorValue("DamageResist"))
;else
; Debug.Messagebox(keyCode )
endif
EndEvent
Event OnActorAction(int actionType, Actor akActor, Form source, int slot) ;only for keep up activate life detection
if actionType==0 && akActor==Game.GetPlayer() && sneakAttack
Utility.Wait(0.1)
Game.GetPlayer().SetAV("UnarmedDamage", 10.1)
sneakAttack=false
DetectLifeWerewolfVision.cast(Game.GetPlayer())
endif
endEvent
Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
If trasformedAlready==0 && akAggressor
float ZAngle = akAggressor.GetAngleZ()-Game.GetPlayer().GetAngleZ() ;calculating difference between enemy and player camera angle
if ZAngle < 0
ZAngle = ZAngle * -1
endif
if ZAngle < 50
int rawDamage = ((akSource as Weapon).GetBaseDamage() * 0.5) as Int
Game.GetPlayer().DamageActorValue("Health", rawDamage * 1000 ) ;giving additional dmg for player if difference of angle is < 50
Endif
Endif
EndEvent
int num = 1
Int trasformedAlready
Int sneakWerewolfKey = 46
Int waitForTransformS=4
int waitTimeToEndTransform=2;
Event OnEffectStart(Actor akTarget, Actor akCaster)
;Debug.MessageBox(Game.GetPlayer().GetActorValue("Sneak")+" vs "+Game.GetPlayer().GetActorValue("Magicka")+" vs "+Game.GetPlayer().GetActorValue("MagickaRate")+" vs "+Game.GetPlayer().GetActorValue("Health")+" vs "+Game.GetPlayer().GetActorValue("Stamina")+" vs "+Game.GetPlayer().GetActorValue("UnarmedDamage")+" vs "+Game.GetPlayer().GetActorValue("DamageResist"))
Game.ForceThirdPerson()
isOnInfluanceOfPotion =Game.GetPlayer().HasMagicEffect(bloodPotionInfluance)
ActorBase pActorBase = Game.GetPlayer().GetActorBase()
trasformedAlready=isTransformed.GetValue() as Int
;Game.GetPlayer().AddItem(SuperSecretPotionReference, 200)
Int doesHavePotion = Game.GetPlayer().GetItemCount(SuperSecretPotionReference)
if isOnInfluanceOfPotion || doesHavePotion > 0
if !isOnInfluanceOfPotion && trasformedAlready==0
Game.GetPlayer().RemoveItem(SuperSecretPotionReference, 1)
if !Game.GetPlayer().IsInCombat()
Form EquippedItemRight = Game.GetPlayer().GetEquippedObject(1)
Game.GetPlayer().UnequipItem(EquippedItemRight, false, true)
Game.DisablePlayerControls(true, true, true, false, true, true, true)
Game.GetPlayer().PlayIdle(DrinkPotionForPlayerIdle )
Utility.Wait(2)
Game.GetPlayer().EquipItemEx(EquippedItemRight, 1)
endif
endif
if trasformedAlready==0
Debug.Notification("Transforming to werewolf")
isTransformed.SetValue(1)
AbWerewolf.Cast(akCaster, akCaster)
WerewolfChange.Cast(akCaster, akCaster)
;akCaster.GetActorBase().SetEssential(False)
if( Game.GetPlayer().GetAV("InventoryWeight")<=akTarget.GetAV("CarryWeight"))
akTarget.ForceAV("CarryWeight", 1000)
endif
(playerTransformStorageQuest as playerTransformStorage).checkForEquipedItems()
Game.DisablePlayerControls(true, true, true, false, true, true, true)
int BaseWeaponDmg =Game.GetPlayer().GetEquippedWeapon().GetBaseDamage()
int AR = (Game.GetPlayer().GetWornForm(0x00000004) as Armor).GetArmorRating()
float armorNow=10
Utility.Wait(waitTimeToEndTransform)
akCaster.SetRace(WerewolfBeastRace)
akCaster.UnequipAll()
akCaster.KnockAreaEffect(1, 1024)
akTarget.ModAV("DamageResist", 10)
;akTarget.SetAV("DamageResist", 10)
akTarget.SetAV("UnarmedDamage", 10.1)
bTransformed = True
akCaster.AddShout(_00E_A1_Lycantrophe_Transform)
akCaster.EquipShout(_00E_A1_Lycantrophe_Transform)
Game.EnablePlayerControls(abMovement = true, abFighting = true, abCamSwitch = false, abLooking = true, abSneaking = true, abMenu = true, abActivate = true, abJournalTabs = true)
RegisterForCrosshairRef()
RegisterForActorAction(0)
sneakWerewolfKey = Input.GetMappedKey("Toggle Always Run")
RegisterForKey(sneakWerewolfKey)
RegisterForKey(38)
akCaster.PlaceAtMe(PowerRacialWoodElfCommandAnimalExplosion01)
else
goingBackToHumanShader.Play(Game.GetPlayer())
Game.DisablePlayerControls(true, true, true, false, true, true, true)
akTarget.ModAV("DamageResist", -10)
(playerTransformStorageQuest as playerTransformStorage).equipeItems()
akCaster.PlaceAtMe(PowerRacialWoodElfCommandAnimalExplosion01)
RegisterForAnimationEvent(Game.GetPlayer(), "TransformToHuman")
Game.GetPlayer().PlayIdle(WerewolfTransformBack)
Game.SetInCharGen(true, true, false)
UnRegisterForAnimationEvent(Game.GetPlayer(), "TransformToHuman")
Game.EnablePlayerControls(true, true, true, true, true, true, true)
Race orig_race = (playerTransformStorageQuest as playerTransformStorage).originalRace
Game.GetPlayer().SetRace(orig_race)
Game.GetPlayer().SetAttackActorOnSight(false)
Game.GetPlayer().RemoveFromFaction(PlayerWerewolfFaction)
Game.SetPlayerReportCrime(true)
; alert anyone nearby that they should now know the player is a werewolf
; Game.SendWereWolfTransformation()
Game.SetBeastForm(False)
isTransformed.SetValue(0)
UnregisterforActorAction(0)
UnregisterforCrosshairRef()
UnregisterForAllKeys()
UnregisterForUpdate()
isSneaking=false
goingBackToHumanShader.Stop(Game.GetPlayer())
endif
else
Debug.Notification("You don't have Lycant potion")
endif
;Debug.MessageBox(Game.GetPlayer().GetActorValue("Sneak")+" vs "+Game.GetPlayer().GetActorValue("Magicka")+" vs "+Game.GetPlayer().GetActorValue("MagickaRate")+" vs "+Game.GetPlayer().GetActorValue("Health")+" vs "+Game.GetPlayer().GetActorValue("Stamina")+" vs "+Game.GetPlayer().GetActorValue("UnarmedDamage")+" vs "+Game.GetPlayer().GetActorValue("DamageResist"))
EndEvent
SPELL Property AbWerewolf Auto
SPELL Property WerewolfChange Auto
Explosion Property PowerRacialWoodElfCommandAnimalExplosion01 Auto
Race Property WerewolfBeastRace Auto
Faction Property PlayerWerewolfFaction Auto
bool bTransformed
Race baseRasePlayer
Int tTran=1
Idle Property WerewolfTransformBack Auto
Shout Property _00E_A1_Lycantrophe_Transform Auto
GlobalVariable Property isTransformed Auto
Quest Property playerTransformStorageQuest Auto
Potion Property SuperSecretPotionReference Auto
Idle Property Idle_1stPersonWoozyGetUpFromBed Auto
;Perk Property InvisibilityMe Auto
;Idle Property lycantTransformAnim Auto
EffectShader Property _00E_EspionageFXS Auto
Spell Property PerkShadowWarriorInvisibility Auto
SPELL Property _00E_A2_GhostwalkCloakSP Auto
PERK Property _00E_A1_InvisibilityPerk Auto
SPELL Property DetectLifeWerewolfVision Auto
MagicEffect Property DetectLifeWerewolfVision2 Auto
SPELL Property DetectLife Auto
Idle Property DrinkPotionForPlayerIdle Auto
Sound Property sneakSound Auto
;SPELL Property knockBack Auto
;SPELL Property werewolfAbility Auto
;MagicEffect Property knockBackEffect Auto
;Perk Property perkKnock Auto
EffectShader Property goingBackToHumanShader Auto
;Idle Property werewolfChangeAnimation Auto
MagicEffect Property bloodPotionInfluance Auto
Message Property _00E_statisticMessage Auto
ImageSpaceModifier Property detectionImage Auto
MagicEffect Property panacea1Effect Auto
MagicEffect Property panacea2Effect Auto
MagicEffect Property panacea3Effect Auto
MagicEffect Property panacea4Effect Auto
Message Property panacea1EffectOn Auto
Message Property panacea2EffectOn Auto
Message Property panacea3EffectOn Auto
Message Property panacea4EffectOn Auto
Message Property panacea5EffectOn Auto
MagicEffect Property panacea5Effect Auto