Jump to content

Chargeable spell script help


hecks567

Recommended Posts

been trying to rack my brain over this script for the last 2 weeks trying to make a simple charge spell

 

for referance check out charge spell mod. http://www.nexusmods.com/skyrim/mods/43597/?http://www.nexusmods.com/skyrim/mods/43597/?

heres the oringal script

 

 

scriptName Withe01ChargeSpellQuest extends Quest

;--------------------------------------------------------------------------------
;ver 2.00
;更新内容
;MCMである程度魔法を自由に選択できるようにした。
;LVごとに別属性の魔法をセットすることも可能になった。
;同じ魔法でもチャージレベルが上がると補正がかかって威力が上がる。
;一部の魔法はLV3専用。
;詳細
;LV1 : 選択肢は少ない。属性ごとに違うが概ね普通の飛び道具。
;LV2 : 幅広く選べるが一部の高性能な魔法は選べない。
;LV3 : 選択肢が最も多い。同じ魔法でもダメージ補正がかかりLV2よりも高威力になる。
;マイセット機能追加。
;MCMで3種類のスペルセットを登録でき、それをトグルボタン入力で切り替えられる。
;--------------------------------------------------------------------------------
;GunBladeQuestを参考に作成したスクリプト。
;キー入力を検知して魔法を発動する。
;MCMでのキー登録機能,ダメージ調整機能,スペルセット機能がある。
;チャージボタンを押し続けると魔法をチャージし、離すと発動する。
;チャージ時間によって放つ魔法が変化する。
;擬似ズーム機能有。ズーム中は時間減速効果(=perk「冷静沈着」相当)を付与。
;泳ぎ状態ではチャージ&発動不可。チャージ中に泳ぎ状態になったら強制的にキャンセルされる。
;騎乗状態でも使用可能だがモーションはとらない。…発動しないようにしてもよかったんだけど深刻なバグもないようなのでとりあえず現状維持。そもそも騎乗しないし…。
;一部の魔法は左手に魔法を装備しているとモーションが変わる。
;両手に魔法を装備していると通常のattackモーションがとれないバグ(?)対策。
;性能的には若干出が早くなる代わりにモーション中の移動と方向転換ができなくなる。
;----- Properties_ChargeShot ---------------------------------------------------------------------------
GlobalVariable Property ButtonVarFire auto ; 別スクリプトで登録したキー
GlobalVariable Property ButtonVarCancel auto ; 別スクリプトで登録したキー
GlobalVariable Property ButtonVarZoom auto ; 別スクリプトで登録したキー
GlobalVariable Property ButtonVarToggle auto ; 別スクリプトで登録したキー
GlobalVariable Property ChargeSpellMySetVar auto ; 使用するマイセットのID
GlobalVariable Property ChargeLV1aVar auto ; 別スクリプトで登録したLV1魔法のID,マイセットa
GlobalVariable Property ChargeLV2aVar auto ; 別スクリプトで登録したLV2魔法のID,マイセットa
GlobalVariable Property ChargeLV3aVar auto ; 別スクリプトで登録したLV3魔法のID,マイセットa
GlobalVariable Property AttributeAVar auto ; チャージ時に発生するサウンドとエフェクトを指定する,マイセットa
GlobalVariable Property ChargeLV1bVar auto ; 別スクリプトで登録したLV1魔法のID,マイセットb
GlobalVariable Property ChargeLV2bVar auto ; 別スクリプトで登録したLV2魔法のID,マイセットb
GlobalVariable Property ChargeLV3bVar auto ; 別スクリプトで登録したLV3魔法のID,マイセットb
GlobalVariable Property AttributeBVar auto ; チャージ時に発生するサウンドとエフェクトを指定する,マイセットb
GlobalVariable Property ChargeLV1cVar auto ; 別スクリプトで登録したLV1魔法のID,マイセットc
GlobalVariable Property ChargeLV2cVar auto ; 別スクリプトで登録したLV2魔法のID,マイセットc
GlobalVariable Property ChargeLV3cVar auto ; 別スクリプトで登録したLV3魔法のID,マイセットc
GlobalVariable Property AttributeCVar auto ; チャージ時に発生するサウンドとエフェクトを指定する,マイセットc
; 1 = 火
; 2 = 氷
; 3 = 雷
; 4 = 太陽
; 5 = 血
; 6 = 月光
; 7 = 風
Int ButtonFire ; グローバル変数をInt型に修正したもの
Int ButtonCancel ; グローバル変数をInt型に修正したもの
Int ButtonZoom ; グローバル変数をInt型に修正したもの
Int ButtonToggle ; グローバル変数をInt型に修正したもの
Int ChargeSpellMySet ; グローバル変数をInt型に修正したもの,マイセット判別用
Int ChargeLV1 ; グローバル変数をInt型に修正したもの,LV1魔法設定用
Int ChargeLV2 ; グローバル変数をInt型に修正したもの,LV2魔法設定用
Int ChargeLV3 ; グローバル変数をInt型に修正したもの,LV3魔法設定用
Int Attribute ; グローバル変数をInt型に修正したもの,属性検出用
Int ButtonTweenMenu ; 取得したボタンをInt型に修正したもの
Int index = 0 ; 魔法段階チェック用
Int CountFire = 0 ; チャージ段階チェック用。
int FirstPerson = 0 ; 1人称視点チェック用
int ZoomCheck = 0 ; ズーム中か否かチェック用
float FOVnow ; FOVチェック用。
EffectShader property EffectFire auto ; AlchArmorFireFX ; 魔法詠唱中にかかるエフェクト
EffectShader property EffectFrost auto ; AlchArmorFrostFX ; 魔法詠唱中にかかるエフェクト
EffectShader property EffectShock auto ; AlchArmorShockFX ; 魔法詠唱中にかかるエフェクト
EffectShader property EffectSunLight auto ; ** ; 魔法詠唱中にかかるエフェクト
EffectShader property EffectBlood auto ; ** ; 魔法詠唱中にかかるエフェクト
EffectShader property EffectMoonLight auto ; AlchArmorMagickaFX ; 魔法詠唱中にかかるエフェクト
EffectShader property EffectWind auto ; DismayShout01FXS ; 魔法詠唱中にかかるエフェクト
Int property CostCharge auto ; 4 ; チャージ時の消費マギカ
Armor property ChargeSpellBook auto ; ; チャージスペルを使うために必要な防具
Perk property PerkSlowAsZoom auto ; ; ズーム時に付与するパーク。時間減速効果。
Perk Property ChargeLV2Perk Auto ; チャージレベルによるダメージ補正用。
Perk Property ChargeLV3Perk Auto ; チャージレベルによるダメージ補正用。
;----- Sound ---------------------------------------------------------------------------
SoundCategory property AudioCategoryNPCKillMove auto ; キルムーブ効果音
sound property SoundChargeFire1 auto ; ; チャージLV1
sound property SoundChargeFire2 auto ; ; チャージLV2
sound property SoundChargeFire3 auto ; ; チャージLV3==チャージ最終段階到達音
sound property SoundChargeFrost1 auto ; ; チャージLV1
sound property SoundChargeFrost2 auto ; ; チャージLV2
sound property SoundChargeFrost3 auto ; ; チャージLV3==チャージ最終段階到達音
sound property SoundChargeShock1 auto ; ; チャージLV1
sound property SoundChargeShock2 auto ; ; チャージLV2
sound property SoundChargeShock3 auto ; ; チャージLV3==チャージ最終段階到達音
sound property SoundChargeSunLight1 auto ; ; チャージLV1
sound property SoundChargeSunLight2 auto ; ; チャージLV2
sound property SoundChargeSunLight3 auto ; ; チャージLV3==チャージ最終段階到達音
sound property SoundChargeBlood1 auto ; ; チャージLV1
sound property SoundChargeBlood2 auto ; ; チャージLV2
sound property SoundChargeBlood3 auto ; ; チャージLV3==チャージ最終段階到達音
sound property SoundChargeMoonLight1 auto ; ; チャージLV1
sound property SoundChargeMoonLight2 auto ; ; チャージLV2
sound property SoundChargeMoonLight3 auto ; ; チャージLV3==チャージ最終段階到達音
sound property SoundChargeWind1 auto ; ; チャージLV1
sound property SoundChargeWind2 auto ; ; チャージLV2
sound property SoundChargeWind3 auto ; ; チャージLV3==チャージ最終段階到達音
sound property SoundChargeCancel auto ; ; チャージキャンセル時の効果音
sound property SoundChargeToggle auto ; ; スペルセット切り替え時の効果音
sound property SoundCastFire1 auto ; ; 炎魔法1の発射音
sound property SoundCastFire2 auto ; ; 炎魔法2の発射音
sound property SoundCastFire3 auto ; ; 炎魔法3の発射音
sound property SoundCastFire4 auto ; ; 炎魔法4の発射音
sound property SoundCastFire5 auto ; ; 炎魔法5の発射音
sound property SoundCastFire5b auto ; ; 炎魔法5の発射音その2
sound property SoundCastFire6 auto ; ; 炎魔法6の発射音
sound property SoundCastFrost1 auto ; ; 氷魔法1の発射音
sound property SoundCastFrost2 auto ; ; 氷魔法2の発射音
sound property SoundCastFrost3 auto ; ; 氷魔法3の発射音
sound property SoundCastFrost4 auto ; ; 氷魔法4の発射音
sound property SoundCastFrost5 auto ; ; 氷魔法5の発射音
sound property SoundCastShock1 auto ; ; 雷魔法1の発射音
sound property SoundCastShock2 auto ; ; 雷魔法2の発射音
sound property SoundCastShock3 auto ; ; 雷魔法3の発射音
sound property SoundCastShock4 auto ; ; 雷魔法4の発射音
sound property SoundCastShock5 auto ; ; 雷魔法5の発射音
sound property SoundCastShock6 auto ; ; 雷魔法6の発射音
sound property SoundCastSunlight1 auto ; ; 太陽魔法1の発射音
sound property SoundCastSunlight2 auto ; ; 太陽魔法2の発射音
sound property SoundCastSunlight3 auto ; ; 太陽魔法3の発射音
sound property SoundCastSunlight4 auto ; ; 太陽魔法4の発射音
sound property SoundCastSunlight5 auto ; ; 太陽魔法5の発射音
sound property SoundCastBlood1 auto ; ; 血魔法1の発射音
sound property SoundCastBlood2 auto ; ; 血魔法2の発射音
sound property SoundCastBlood3 auto ; ; 血魔法3の発射音
sound property SoundCastBlood4 auto ; ; 血魔法4の発射音
sound property SoundCastBlood5 auto ; ; 血魔法5の発射音
sound property SoundCastMoonLight1 auto ; ; 月光魔法1の発射音
sound property SoundCastMoonLight2 auto ; ; 月光魔法2の発射音
sound property SoundCastMoonLight3 auto ; ; 月光魔法3の発射音
sound property SoundCastMoonLight4 auto ; ; 月光魔法4の発射音
sound property SoundCastMoonLight5 auto ; ; 月光魔法5の発射音
sound property SoundCastMoonLight6 auto ; ; 月光魔法6の発射音
sound property SoundCastWind1 auto ; ; 風魔法1の発射音
sound property SoundCastWind2 auto ; ; 風魔法2の発射音
sound property SoundCastWind3 auto ; ; 風魔法3の発射音
sound property SoundCastWind4 auto ; ; 風魔法4の発射音
sound property SoundCastOther1 auto ; ; その他魔法1の発射音
sound property SoundCastOther2 auto ; ; その他魔法2の発射音
sound property SoundCastOther3 auto ; ; その他魔法3の発射音
;----- Spell ---------------------------------------------------------------------------
spell property ChargeSpellFire1 auto ; 炎魔法1 ; Fire Bolt
spell property ChargeSpellFire2 auto ; 炎魔法2 ; Fire Ball
spell property ChargeSpellFire3 auto ; 炎魔法3 ; Hell Fire
spell property ChargeSpellFire4 auto ; 炎魔法4 ; Blaze
spell property ChargeSpellFire5 auto ; 炎魔法5 ; Genocide Crash
spell property ChargeSpellFire6 auto ; 炎魔法6 ; Fire Rune
spell property ChargeSpellFrost1 auto ; 氷魔法1 ; Ice Spike
spell property ChargeSpellFrost2 auto ; 氷魔法2 ; Stinger
spell property ChargeSpellFrost3 auto ; 氷魔法3 ; Ice Blast
spell property ChargeSpellFrost4 auto ; 氷魔法4 ; Ice Storm
spell property ChargeSpellFrost5 auto ; 氷魔法5 ; Frost Rune
spell property ChargeSpellShock1 auto ; 雷魔法1 ; Lightning Bolt
spell property ChargeSpellShock2 auto ; 雷魔法2 ; Chain Lightning
spell property ChargeSpellShock3 auto ; 雷魔法3 ; Sprite
spell property ChargeSpellShock4 auto ; 雷魔法4 ; Lightning Spear
spell property ChargeSpellShock5 auto ; 雷魔法5 ; JINRAI
spell property ChargeSpellShock6 auto ; 雷魔法6 ; Shock Rune
spell property ChargeSpellSunlight1 auto ; 太陽魔法1 ; Sunlight Bolt
spell property ChargeSpellSunlight2 auto ; 太陽魔法2 ; Sunlight Cannnon
spell property ChargeSpellSunlight3 auto ; 太陽魔法3 ; Punishement
spell property ChargeSpellSunlight4 auto ; 太陽魔法4 ; Sunlight Cross
spell property ChargeSpellSunlight5 auto ; 太陽魔法5 ; Shining
spell property ChargeSpellBlood1 auto ; 血魔法1 ; Bloody Claw
spell property ChargeSpellBlood2a auto ; 血魔法2a ; Bloody Dance
spell property ChargeSpellBlood2b auto ; 血魔法2b ; Bloody Dance
spell property ChargeSpellBlood2c auto ; 血魔法2c ; Bloody Dance
spell property ChargeSpellBlood3a auto ; 血魔法3a ; Bloody Rondo
spell property ChargeSpellBlood3b auto ; 血魔法3b ; Bloody Rondo
spell property ChargeSpellBlood3c auto ; 血魔法3c ; Bloody Rondo
spell property ChargeSpellBlood4 auto ; 血魔法4 ; Bloody Cross
spell property ChargeSpellBlood5 auto ; 血魔法5 ; Scream
spell property ChargeSpellMoonLight1 auto ; 月光魔法1 ; Blade Wave
spell property ChargeSpellMoonLight2a auto ; 月光魔法2a ; SAMURAI
spell property ChargeSpellMoonLight2b auto ; 月光魔法2b ; SAMURAI
spell property ChargeSpellMoonLight2c auto ; 月光魔法2c ; SAMURAI
spell property ChargeSpellMoonLight3a auto ; 月光魔法3a ; SAMURAI2
spell property ChargeSpellMoonLight3b auto ; 月光魔法3b ; SAMURAI2
spell property ChargeSpellMoonLight3c auto ; 月光魔法3c ; SAMURAI2
spell property ChargeSpellMoonLight4 auto ; 月光魔法4 ; Blade Wave(Exp)
spell property ChargeSpellMoonLight5 auto ; 月光魔法5 ; Blade Wave(Big)
spell property ChargeSpellMoonLight6 auto ; 月光魔法6 ; Assault Armor
spell property ChargeSpellWind1 auto ; 風魔法1 ; Wind Fist
spell property ChargeSpellWind2 auto ; 風魔法2 ; Wind Claw
spell property ChargeSpellWind3 auto ; 風魔法3 ; Down Burst
spell property ChargeSpellWind4 auto ; 風魔法4 ; IDATEN
spell property ChargeSpellOther1 auto ; その他魔法1 ; War Cry LV1
spell property ChargeSpellOther2 auto ; その他魔法2 ; War Cry LV2
spell property ChargeSpellOther3 auto ; その他魔法3 ; War Cry LV3
;--------------------------------------------------------------------------------
;Functions_ChargeShot
;--------------------------------------------------------------------------------
function OnUpdate()
actor PlayerActor = game.getplayer()
ButtonFire = ButtonVarFire.GetValueInt()
ButtonCancel = ButtonVarCancel.GetValueInt()
ButtonZoom = ButtonVarZoom.GetValueInt()
ButtonToggle = ButtonVarToggle.GetValueInt()
ButtonTweenMenu = Input.GetMappedKey("Tween Menu", 0) ; 0でキーボード指定
ChargeSpellMySet = ChargeSpellMySetVar.GetValueInt()
If ChargeSpellMySet == 0
ChargeLV1 = ChargeLV1aVar.GetValueInt()
ChargeLV2 = ChargeLV2aVar.GetValueInt()
ChargeLV3 = ChargeLV3aVar.GetValueInt()
Attribute = AttributeAVar.GetValueInt()
ElseIf ChargeSpellMySet == 1
ChargeLV1 = ChargeLV1bVar.GetValueInt()
ChargeLV2 = ChargeLV2bVar.GetValueInt()
ChargeLV3 = ChargeLV3bVar.GetValueInt()
Attribute = AttributeBVar.GetValueInt()
ElseIf ChargeSpellMySet >= 2
ChargeLV1 = ChargeLV1cVar.GetValueInt()
ChargeLV2 = ChargeLV2cVar.GetValueInt()
ChargeLV3 = ChargeLV3cVar.GetValueInt()
Attribute = AttributeCVar.GetValueInt()
EndIf
if PlayerActor.isweapondrawn() ; 抜刀している。
If PlayerActor.IsSwimming() ; 泳いでいる
;泳ぎ状態になったらチャージ強制キャンセル。
EffectFire.Stop(PlayerActor)
EffectFrost.Stop(PlayerActor)
EffectShock.Stop(PlayerActor)
EffectSunlight.Stop(PlayerActor)
EffectBlood.Stop(PlayerActor)
EffectMoonlight.Stop(PlayerActor)
EffectWind.Stop(PlayerActor)
If ZoomCheck == 1 ; ズームしている。
PlayerActor.RemovePerk(PerkSlowAsZoom)
Utility.SetINIFloat("fDefaultWorldFOV:Display", FOVnow) ; FOVを元に戻す。ズームの解除。
Input.TapKey(ButtonTweenMenu)
Utility.WaitMenuMode(0.0003)
Input.TapKey(ButtonTweenMenu)
UI.SetNumber("TweenMenu", "_root.TweenMenu_mc._alpha", 1.00)
ZoomCheck = 0
EndIf
PlayerActor.RestoreAv("magicka", CostCharge * CountFire)
index = 0
CountFire = 0
;--------------------------------------------------------------------------------
;Charging
;--------------------------------------------------------------------------------
Else ; 泳いでいない
If PlayerActor.isequipped(ChargeSpellBook) ; 特定の防具を装備している。
If input.IsKeyPressed(ButtonFire) ; 詠唱ボタン検出。
If !input.IsKeyPressed(ButtonCancel) ; キャンセルボタン検出。
index = 0
if index == 0
If CountFire < 12
index = 1
If CountFire == 0 ; チャージLV1。
if (PlayerActor.GetActorValue("magicka") >= 16) ; 必要なマギカが残っている。
If Attribute == 1
EffectFire.Play(PlayerActor)
SoundChargeFire1.play(PlayerActor)
ElseIf Attribute == 2
EffectFrost.Play(PlayerActor)
SoundChargeFrost1.play(PlayerActor)
ElseIf Attribute == 3
EffectShock.Play(PlayerActor)
SoundChargeShock1.play(PlayerActor)
ElseIf Attribute == 4
EffectSunlight.Play(PlayerActor)
SoundChargeSunlight1.play(PlayerActor)
ElseIf Attribute == 5
EffectBlood.Play(PlayerActor)
SoundChargeBlood1.play(PlayerActor)
ElseIf Attribute == 6
EffectMoonlight.Play(PlayerActor)
SoundChargeMoonlight1.play(PlayerActor)
ElseIf Attribute == 7
EffectWind.Play(PlayerActor)
SoundChargeWind1.play(PlayerActor)
EndIf
PlayerActor.damageAv("magicka", 16) ; チャージ開始時にマギカを16消費する。
utility.Wait(0.02000)
CountFire += 1
EndIf
Else ; CountFire != 0
if (PlayerActor.GetActorValue("magicka") >= CostCharge) ; 必要なマギカが残っている。
If CountFire == 5 ; チャージLV2。
If Attribute == 1
SoundChargeFire2.play(PlayerActor)
ElseIf Attribute == 2
SoundChargeFrost2.play(PlayerActor)
ElseIf Attribute == 3
SoundChargeShock2.play(PlayerActor)
ElseIf Attribute == 4
SoundChargeSunlight2.play(PlayerActor)
ElseIf Attribute == 5
SoundChargeBlood2.play(PlayerActor)
ElseIf Attribute == 6
SoundChargeMoonlight2.play(PlayerActor)
ElseIf Attribute == 7
SoundChargeWind2.play(PlayerActor)
EndIf
ElseIf CountFire == 11 ; チャージLV3。
If Attribute == 1
SoundChargeFire3.play(PlayerActor)
ElseIf Attribute == 2
SoundChargeFrost3.play(PlayerActor)
ElseIf Attribute == 3
SoundChargeShock3.play(PlayerActor)
ElseIf Attribute == 4
SoundChargeSunlight3.play(PlayerActor)
ElseIf Attribute == 5
SoundChargeBlood3.play(PlayerActor)
ElseIf Attribute == 6
SoundChargeMoonlight3.play(PlayerActor)
ElseIf Attribute == 7
SoundChargeWind3.play(PlayerActor)
EndIf
endif
PlayerActor.damageAv("magicka", CostCharge)
utility.Wait(0.02000)
CountFire += 1
EndIf
EndIf
utility.Wait(0.02000)
index = 2
Else ; CountFire >= 12
;チャージLV3待機中。
index = 1
utility.Wait(0.02000)
index = 2
endIf ; CountFire
;------ Zoom --------------------------------------------------------------------------
If input.IsKeyPressed(ButtonZoom) ; ズームボタン検出。
If CountFire > 0 ; チャージショット発動中。
If ZoomCheck == 0 ; ズームしていない。
Utility.WaitMenuMode(0.0625)
FOVnow = Utility.GetINIFloat("fDefaultWorldFOV:Display") ; 現在のFOVを取得。
Utility.SetINIFloat("fDefaultWorldFOV:Display", 12) ; FOVを変更。ズームする。
Input.TapKey(ButtonTweenMenu)
Utility.WaitMenuMode(0.0003)
Input.TapKey(ButtonTweenMenu)
UI.SetNumber("TweenMenu", "_root.TweenMenu_mc._alpha", 0.00)
PlayerActor.AddPerk(PerkSlowAsZoom)
ZoomCheck = 1
EndIf
EndIf
Else ; ズームボタン検出なし。
If ZoomCheck == 1 ; ズームしている。
PlayerActor.RemovePerk(PerkSlowAsZoom)
Utility.SetINIFloat("fDefaultWorldFOV:Display", FOVnow) ; FOVを元に戻す。ズームの解除。
Input.TapKey(ButtonTweenMenu)
Utility.WaitMenuMode(0.0003)
Input.TapKey(ButtonTweenMenu)
UI.SetNumber("TweenMenu", "_root.TweenMenu_mc._alpha", 1.00)
ZoomCheck = 0
EndIf
EndIf
EndIf ; index
;------ Cancel --------------------------------------------------------------------------
Else ; キャンセルボタン検出。
If CountFire > 0 ; チャージショット発動中。
EffectFire.Stop(PlayerActor)
EffectFrost.Stop(PlayerActor)
EffectShock.Stop(PlayerActor)
EffectSunlight.Stop(PlayerActor)
EffectBlood.Stop(PlayerActor)
EffectMoonlight.Stop(PlayerActor)
EffectWind.Stop(PlayerActor)
SoundChargeCancel.play(PlayerActor)
If ZoomCheck == 1 ; ズームしていてズームボタンが押されていない。
PlayerActor.RemovePerk(PerkSlowAsZoom)
Utility.SetINIFloat("fDefaultWorldFOV:Display", FOVnow) ; FOVを元に戻す。ズームの解除。
Input.TapKey(ButtonTweenMenu)
Utility.WaitMenuMode(0.0003)
Input.TapKey(ButtonTweenMenu)
UI.SetNumber("TweenMenu", "_root.TweenMenu_mc._alpha", 1.00)
ZoomCheck = 0
EndIf
PlayerActor.RestoreAv("magicka", CostCharge * CountFire)
utility.Wait(0.60000)
index = 0
CountFire = 0
EndIf
EndIf ; キャンセルボタン検出。
;------ Cast --------------------------------------------------------------------------
Else ; チャージボタン検出なし。
If !input.IsKeyPressed(ButtonCancel) ; キャンセルボタン検出なし。
if index != 0
If CountFire != 0 ; attackが連射されるバグ対策
EffectFire.Stop(PlayerActor)
EffectFrost.Stop(PlayerActor)
EffectShock.Stop(PlayerActor)
EffectSunlight.Stop(PlayerActor)
EffectBlood.Stop(PlayerActor)
EffectMoonlight.Stop(PlayerActor)
EffectWind.Stop(PlayerActor)
AudioCategoryNPCKillMove.Mute() ; キルムーブの効果音を一時的に鳴らないようにする
debug.sendAnimationEvent(PlayerActor, "blockstop")
debug.sendAnimationEvent(PlayerActor, "attackstop")
utility.Wait(0.0003)
;------ Charge LV1 --------------------------------------------------------------------------
If CountFire < 6 ; チャージ第1段階。
ChargeSpellCast(ChargeLV1, PlayerActor)
If ZoomCheck == 1 ; ズームしている。
PlayerActor.RemovePerk(PerkSlowAsZoom)
Utility.SetINIFloat("fDefaultWorldFOV:Display", FOVnow) ; FOVを元に戻す。ズームの解除。
Input.TapKey(ButtonTweenMenu)
Utility.WaitMenuMode(0.0003)
Input.TapKey(ButtonTweenMenu)
UI.SetNumber("TweenMenu", "_root.TweenMenu_mc._alpha", 1.00)
ZoomCheck = 0
EndIf
utility.Wait(0.30000)
AudioCategoryNPCKillMove.UnMute()
index = 0
CountFire = 0
;------ Charge LV2 --------------------------------------------------------------------------
Else ; CountFire6以上。チャージ第2段階以上。
If CountFire < 12 ; CountFire6-11。チャージ第2段階。
PlayerActor.AddPerk(ChargeLV2Perk)
ChargeSpellCast(ChargeLV2, PlayerActor)
If ZoomCheck == 1 ; ズームしている。
PlayerActor.RemovePerk(PerkSlowAsZoom)
Utility.SetINIFloat("fDefaultWorldFOV:Display", FOVnow) ; FOVを元に戻す。ズームの解除。
Input.TapKey(ButtonTweenMenu)
Utility.WaitMenuMode(0.0003)
Input.TapKey(ButtonTweenMenu)
UI.SetNumber("TweenMenu", "_root.TweenMenu_mc._alpha", 1.00)
ZoomCheck = 0
EndIf
utility.Wait(0.45000)
PlayerActor.RemovePerk(ChargeLV2Perk)
AudioCategoryNPCKillMove.UnMute()
index = 0
CountFire = 0
;------ Charge LV3 --------------------------------------------------------------------------
Else ; CountFire12以上。チャージ第3段階。
PlayerActor.AddPerk(ChargeLV3Perk)
ChargeSpellCast(ChargeLV3, PlayerActor)
If ZoomCheck == 1 ; ズームしている。
PlayerActor.RemovePerk(PerkSlowAsZoom)
Utility.SetINIFloat("fDefaultWorldFOV:Display", FOVnow) ; FOVを元に戻す。ズームの解除。
Input.TapKey(ButtonTweenMenu)
Utility.WaitMenuMode(0.0003)
Input.TapKey(ButtonTweenMenu)
UI.SetNumber("TweenMenu", "_root.TweenMenu_mc._alpha", 1.00)
ZoomCheck = 0
EndIf
utility.Wait(0.60000)
PlayerActor.RemovePerk(ChargeLV3Perk)
AudioCategoryNPCKillMove.UnMute()
index = 0
CountFire = 0
endIf ; CountFire = 12
endIf ; CountFire = 6
Else
Index = 0
CountFire = 0
endIf ; CountFire != 0
;------ Spell-Set Toggle --------------------------------------------------------------------------
Else ; index == 0
If CountFire == 0 ; チャージしていない
If input.IsKeyPressed(ButtonToggle) ; トグルボタン検出
If ChargeSpellMySet == 0 ; スペルセットAのとき
SoundChargeToggle.play(PlayerActor)
ChargeSpellMySetVar.SetValue(1)
debug.notification("Spell-Set B selected.")
utility.Wait(0.60000)
ElseIf ChargeSpellMySet == 1 ; スペルセットBのとき
SoundChargeToggle.play(PlayerActor)
ChargeSpellMySetVar.SetValue(2)
debug.notification("Spell-Set C selected.")
utility.Wait(0.60000)
ElseIf ChargeSpellMySet == 2 ; スペルセットCのとき
SoundChargeToggle.play(PlayerActor)
ChargeSpellMySetVar.SetValue(0)
debug.notification("Spell-Set A selected.")
utility.Wait(0.60000)
EndIf
EndIf
EndIf
endIf ; index != 0
endIf ; キャンセルボタン検出。
endIf ; チャージショットボタン検出。
Else ; 専用防具を装備していない
utility.Wait(0.02000)
endIf ; 専用防具装備検出
EndIf ; 泳ぎ状態検出
endIf ; 抜刀状態検出
self.RegisterForSingleUpdate(0.00100000)
endFunction
;--------------------------------------------------------------------------------
;Initialize
;--------------------------------------------------------------------------------
function OnInit()
actor PlayerActor = game.getplayer()
ButtonFire = ButtonVarFire.GetValueInt()
ButtonCancel = ButtonVarCancel.GetValueInt()
ButtonZoom = ButtonVarZoom.GetValueInt()
ButtonToggle = ButtonVarToggle.GetValueInt()
ButtonTweenMenu = Input.GetMappedKey("Tween Menu", 0) ; 0でキーボード指定
ChargeSpellMySet = ChargeSpellMySetVar.GetValueInt()
If ChargeSpellMySet == 0
ChargeLV1 = ChargeLV1aVar.GetValueInt()
ChargeLV2 = ChargeLV2aVar.GetValueInt()
ChargeLV3 = ChargeLV3aVar.GetValueInt()
Attribute = AttributeAVar.GetValueInt()
ElseIf ChargeSpellMySet == 1
ChargeLV1 = ChargeLV1bVar.GetValueInt()
ChargeLV2 = ChargeLV2bVar.GetValueInt()
ChargeLV3 = ChargeLV3bVar.GetValueInt()
Attribute = AttributeBVar.GetValueInt()
ElseIf ChargeSpellMySet <= 2
ChargeLV1 = ChargeLV1cVar.GetValueInt()
ChargeLV2 = ChargeLV2cVar.GetValueInt()
ChargeLV3 = ChargeLV3cVar.GetValueInt()
Attribute = AttributeCVar.GetValueInt()
EndIf
self.RegisterForSingleUpdate(0.00100000)
endFunction
;--------------------------------------------------------------------------------
;Charge Spell Cast
;--------------------------------------------------------------------------------
Function ChargeSpellCast(int SpellNumber, Actor PlayerActor)
;===== Fire ===========================================================================
;----- FireBolt -----
If SpellNumber == 1
if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。
debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")
utility.Wait(0.3000)
Else
debug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")
utility.Wait(0.1000)
EndIf
SoundCastFire1.play(PlayerActor)
ChargeSpellFire1.Cast(PlayerActor, none)
utility.Wait(0.2500)
debug.sendAnimationEvent(PlayerActor, "PairedStop")
;----- FireBall -----
ElseIf SpellNumber == 2
if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。
debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")
utility.Wait(0.3000)
Else
debug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")
utility.Wait(0.1000)
EndIf
SoundCastFire2.play(PlayerActor)
ChargeSpellFire2.Cast(PlayerActor, none)
utility.Wait(0.2500)
debug.sendAnimationEvent(PlayerActor, "PairedStop")
;----- Hell Fire -----
ElseIf SpellNumber == 3
debug.sendAnimationEvent(PlayerActor, "attackPowerStartDualWield")
utility.Wait(0.5000)
SoundCastFire3.play(PlayerActor)
ChargeSpellFire3.Cast(PlayerActor, none)
utility.Wait(0.3000)
SoundCastFire3.play(PlayerActor)
ChargeSpellFire3.Cast(PlayerActor, none)
utility.Wait(0.3000)
SoundCastFire3.play(PlayerActor)
ChargeSpellFire3.Cast(PlayerActor, none)
;----- Blaze -----
ElseIf SpellNumber == 4
debug.sendAnimationEvent(PlayerActor, "shoutStart")
SoundCastFire4.play(PlayerActor)
utility.Wait(0.3000)
debug.sendAnimationEvent(PlayerActor, "MT_BreathExhaleShort")
utility.Wait(0.3000)
ChargeSpellFire4.Cast(PlayerActor, none)
debug.sendAnimationEvent(PlayerActor, "StaggerStart")
debug.sendAnimationEvent(PlayerActor, "StaggerPlayer")
utility.Wait(1.00000)
debug.sendAnimationEvent(PlayerActor, "StaggerStop")
;----- Genocide Crash -----
ElseIf SpellNumber == 5
debug.sendAnimationEvent(PlayerActor, "shoutStart")
SoundCastFire5.play(PlayerActor)
utility.Wait(1.300)
debug.sendAnimationEvent(PlayerActor, "MT_BreathExhaleShort")
utility.Wait(0.2000)
SoundCastFire5b.play(PlayerActor)
ChargeSpellFire5.Cast(PlayerActor, none)
debug.sendAnimationEvent(PlayerActor, "StaggerStart")
debug.sendAnimationEvent(PlayerActor, "StaggerPlayer")
utility.Wait(1.0000)
debug.sendAnimationEvent(PlayerActor, "StaggerStop")
;----- Fire Rune -----
ElseIf SpellNumber == 6
if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。
debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")
utility.Wait(0.3000)
Else
debug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")
utility.Wait(0.1000)
EndIf
SoundCastFire6.play(PlayerActor)
ChargeSpellFire6.Cast(PlayerActor, none)
utility.Wait(0.2500)
debug.sendAnimationEvent(PlayerActor, "PairedStop")
;===== Frost ===========================================================================
;----- Ice Spike -----
ElseIf SpellNumber == 11
if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。
debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")
utility.Wait(0.3000)
Else
debug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")
utility.Wait(0.1000)
EndIf
SoundCastFrost1.play(PlayerActor)
ChargeSpellFrost1.Cast(PlayerActor, none)
utility.Wait(0.2500)
debug.sendAnimationEvent(PlayerActor, "PairedStop")
;----- Stinger -----
ElseIf SpellNumber == 12
if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。
debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")
utility.Wait(0.3000)
Else
debug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")
utility.Wait(0.1000)
EndIf
SoundCastFrost2.play(PlayerActor)
ChargeSpellFrost2.Cast(PlayerActor, none)
utility.Wait(0.2500)
debug.sendAnimationEvent(PlayerActor, "PairedStop")
;----- Ice Blast -----
ElseIf SpellNumber == 13
if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。
debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")
utility.Wait(0.3000)
Else
debug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")
utility.Wait(0.1000)
EndIf
SoundCastFrost3.play(PlayerActor)
ChargeSpellFrost3.Cast(PlayerActor, none)
utility.Wait(0.2500)
debug.sendAnimationEvent(PlayerActor, "PairedStop")
;----- Ice Storm -----
ElseIf SpellNumber == 14
if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。
debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")
utility.Wait(0.3000)
Else
debug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")
utility.Wait(0.1000)
EndIf
SoundCastFrost4.play(PlayerActor)
ChargeSpellFrost4.Cast(PlayerActor, none)
utility.Wait(0.2500)
debug.sendAnimationEvent(PlayerActor, "PairedStop")
;----- Frost Rune -----
ElseIf SpellNumber == 15
if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。
debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")
utility.Wait(0.3000)
Else
debug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")
utility.Wait(0.1000)
EndIf
SoundCastFrost5.play(PlayerActor)
ChargeSpellFrost5.Cast(PlayerActor, none)
utility.Wait(0.2500)
debug.sendAnimationEvent(PlayerActor, "PairedStop")
;===== Shock ===========================================================================
;----- Lightning Bolt -----
ElseIf SpellNumber == 21
if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。
debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")
utility.Wait(0.3500)
Else
debug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")
utility.Wait(0.1000)
EndIf
SoundCastShock1.play(PlayerActor)
ChargeSpellShock1.Cast(PlayerActor, none)
utility.Wait(0.2500)
debug.sendAnimationEvent(PlayerActor, "PairedStop")
;----- Chain Lightning -----
ElseIf SpellNumber == 22
if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。
debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")
utility.Wait(0.3500)
Else
debug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")
utility.Wait(0.1000)
EndIf
SoundCastShock2.play(PlayerActor)
ChargeSpellShock2.Cast(PlayerActor, none)
utility.Wait(0.2500)
debug.sendAnimationEvent(PlayerActor, "PairedStop")
;----- Sprite -----
ElseIf SpellNumber == 23
if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。
debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")
utility.Wait(0.3500)
Else
debug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")
utility.Wait(0.1000)
EndIf
SoundCastShock3.play(PlayerActor)
ChargeSpellShock3.Cast(PlayerActor, none)
utility.Wait(0.2500)
debug.sendAnimationEvent(PlayerActor, "PairedStop")
;----- Lightning Spear -----
ElseIf SpellNumber == 24
if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。
debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")
utility.Wait(0.3500)
Else
debug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")
utility.Wait(0.1000)
EndIf
SoundCastShock4.play(PlayerActor)
ChargeSpellShock4.Cast(PlayerActor, none)
utility.Wait(0.2500)
debug.sendAnimationEvent(PlayerActor, "PairedStop")
;----- JINRAI -----
ElseIf SpellNumber == 25
debug.sendAnimationEvent(PlayerActor, "ShoutStart")
utility.Wait(0.1000)
SoundCastShock5.play(PlayerActor)
ChargeSpellShock5.Cast(PlayerActor, none)
debug.sendAnimationEvent(PlayerActor, "ShoutSprintLongestStart")
;----- Shock Rune -----
ElseIf SpellNumber == 26
if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。
debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")
utility.Wait(0.3000)
Else
debug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")
utility.Wait(0.1000)
EndIf
SoundCastShock6.play(PlayerActor)
ChargeSpellShock6.Cast(PlayerActor, none)
utility.Wait(0.2500)
debug.sendAnimationEvent(PlayerActor, "PairedStop")
;===== Sunlight ===========================================================================
;----- Sunlight Bolt -----
ElseIf SpellNumber == 31
if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。
debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")
utility.Wait(0.3000)
Else
debug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")
utility.Wait(0.1000)
EndIf
SoundCastSunlight1.play(PlayerActor)
ChargeSpellSunlight1.Cast(PlayerActor, none)
utility.Wait(0.2500)
debug.sendAnimationEvent(PlayerActor, "PairedStop")
;----- Sunlight Cannon -----
ElseIf SpellNumber == 32
if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。
debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")
utility.Wait(0.3000)
Else
debug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")
utility.Wait(0.1000)
EndIf
SoundCastSunlight2.play(PlayerActor)
ChargeSpellSunlight2.Cast(PlayerActor, none)
utility.Wait(0.2500)
debug.sendAnimationEvent(PlayerActor, "PairedStop")
;----- Punishment -----
ElseIf SpellNumber == 33
debug.sendAnimationEvent(PlayerActor, "attackPowerStartDualWield")
utility.Wait(0.5000)
SoundCastSunlight3.play(PlayerActor)
ChargeSpellSunlight3.Cast(PlayerActor, none)
utility.Wait(0.3000)
SoundCastSunlight3.play(PlayerActor)
ChargeSpellSunlight3.Cast(PlayerActor, none)
utility.Wait(0.3000)
SoundCastSunlight3.play(PlayerActor)
ChargeSpellSunlight3.Cast(PlayerActor, none)
;----- Sunlight Cross -----
ElseIf SpellNumber == 34
if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。
debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")
utility.Wait(0.3000)
Else
debug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")
utility.Wait(0.1000)
EndIf
SoundCastSunlight4.play(PlayerActor)
ChargeSpellSunlight4.Cast(PlayerActor, none)
utility.Wait(0.2500)
debug.sendAnimationEvent(PlayerActor, "PairedStop")
;----- Shining -----
ElseIf SpellNumber == 35
debug.sendAnimationEvent(PlayerActor, "shoutStart")
SoundCastSunlight5.play(PlayerActor)
utility.Wait(0.3000)
debug.sendAnimationEvent(PlayerActor, "MT_BreathExhaleShort")
utility.Wait(0.3000)
ChargeSpellSunlight5.Cast(PlayerActor, none)
debug.sendAnimationEvent(PlayerActor, "StaggerStart")
debug.sendAnimationEvent(PlayerActor, "StaggerPlayer")
utility.Wait(1.00000)
debug.sendAnimationEvent(PlayerActor, "StaggerStop")
;===== Blood ===========================================================================
;----- Bloody Claw -----
ElseIf SpellNumber == 41
if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。
debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")
utility.Wait(0.3000)
Else
debug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")
utility.Wait(0.1000)
EndIf
SoundCastBlood1.play(PlayerActor)
ChargeSpellBlood1.Cast(PlayerActor, none)
utility.Wait(0.2500)
debug.sendAnimationEvent(PlayerActor, "PairedStop")
;----- Bloody Dance -----
ElseIf SpellNumber == 42
debug.sendAnimationEvent(PlayerActor, "attackPowerStartDualWield")
utility.Wait(0.5000)
SoundCastBlood2.play(PlayerActor)
ChargeSpellBlood2a.Cast(PlayerActor, none)
utility.Wait(0.3000)
SoundCastBlood2.play(PlayerActor)
ChargeSpellBlood2b.Cast(PlayerActor, none)
utility.Wait(0.3000)
SoundCastBlood2.play(PlayerActor)
ChargeSpellBlood2c.Cast(PlayerActor, none)
;----- Bloody Rondo -----
ElseIf SpellNumber == 43
debug.sendAnimationEvent(PlayerActor, "pa_KillMoveG")
utility.Wait(0.6500)
SoundCastBlood3.play(PlayerActor)
ChargeSpellBlood3a.Cast(PlayerActor, none)
utility.Wait(0.3000)
SoundCastBlood3.play(PlayerActor)
ChargeSpellBlood3b.Cast(PlayerActor, none)
utility.Wait(0.3000)
SoundCastBlood3.play(PlayerActor)
ChargeSpellBlood3a.Cast(PlayerActor, none)
utility.Wait(0.3000)
SoundCastBlood3.play(PlayerActor)
ChargeSpellBlood3b.Cast(PlayerActor, none)
utility.Wait(0.3000)
SoundCastBlood3.play(PlayerActor)
ChargeSpellBlood3a.Cast(PlayerActor, none)
utility.Wait(0.6000)
SoundCastBlood3.play(PlayerActor)
ChargeSpellBlood3c.Cast(PlayerActor, none)
utility.Wait(0.7500)
debug.sendAnimationEvent(PlayerActor, "PairedStop")
;----- Bloody Cross -----
ElseIf SpellNumber == 44
if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。
debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")
utility.Wait(0.3000)
Else
debug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")
utility.Wait(0.1000)
EndIf
SoundCastBlood4.play(PlayerActor)
ChargeSpellBlood4.Cast(PlayerActor, none)
utility.Wait(0.2500)
debug.sendAnimationEvent(PlayerActor, "PairedStop")
;----- Bloody Scream -----
ElseIf SpellNumber == 45
debug.sendAnimationEvent(PlayerActor, "shoutStart")
SoundCastBlood5.play(PlayerActor)
utility.Wait(0.3000)
debug.sendAnimationEvent(PlayerActor, "MT_BreathExhaleShort")
utility.Wait(0.3000)
ChargeSpellBlood5.Cast(PlayerActor, none)
debug.sendAnimationEvent(PlayerActor, "StaggerStart")
debug.sendAnimationEvent(PlayerActor, "StaggerPlayer")
utility.Wait(1.00000)
debug.sendAnimationEvent(PlayerActor, "StaggerStop")
;===== Moonlight ===========================================================================
;----- Blade Wave -----
ElseIf SpellNumber == 51
if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。
debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")
utility.Wait(0.3000)
Else
debug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")
utility.Wait(0.1000)
EndIf
SoundCastMoonlight1.play(PlayerActor)
ChargeSpellMoonlight1.Cast(PlayerActor, none)
utility.Wait(0.2500)
debug.sendAnimationEvent(PlayerActor, "PairedStop")
;----- SAMURAI -----
ElseIf SpellNumber == 52
debug.sendAnimationEvent(PlayerActor, "attackPowerStartDualWield")
utility.Wait(0.5000)
SoundCastMoonLight2.play(PlayerActor)
ChargeSpellMoonLight2a.Cast(PlayerActor, none)
utility.Wait(0.3000)
SoundCastMoonLight2.play(PlayerActor)
ChargeSpellMoonLight2b.Cast(PlayerActor, none)
utility.Wait(0.3000)
SoundCastMoonLight2.play(PlayerActor)
ChargeSpellMoonLight2c.Cast(PlayerActor, none)
;----- SAMURAI2 -----
ElseIf SpellNumber == 53
debug.sendAnimationEvent(PlayerActor, "pa_KillMoveG")
utility.Wait(0.6500)
SoundCastMoonLight3.play(PlayerActor)
ChargeSpellMoonLight3a.Cast(PlayerActor, none)
utility.Wait(0.3000)
SoundCastMoonLight3.play(PlayerActor)
ChargeSpellMoonLight3b.Cast(PlayerActor, none)
utility.Wait(0.3000)
SoundCastMoonLight3.play(PlayerActor)
ChargeSpellMoonLight3a.Cast(PlayerActor, none)
utility.Wait(0.3000)
SoundCastMoonLight3.play(PlayerActor)
ChargeSpellMoonLight3b.Cast(PlayerActor, none)
utility.Wait(0.3000)
SoundCastMoonLight3.play(PlayerActor)
ChargeSpellMoonLight3a.Cast(PlayerActor, none)
utility.Wait(0.6000)
SoundCastMoonLight3.play(PlayerActor)
ChargeSpellMoonLight3c.Cast(PlayerActor, none)
utility.Wait(0.7500)
debug.sendAnimationEvent(PlayerActor, "PairedStop")
;----- Blade Wave(Exp) -----
ElseIf SpellNumber == 54
if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。
debug.sendAnimationEvent(PlayerActor, "AttackStart")
utility.Wait(0.5000)
Else
debug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")
utility.Wait(0.1000)
EndIf
SoundCastMoonLight4.play(PlayerActor)
ChargeSpellMoonLight4.Cast(PlayerActor, none)
utility.Wait(0.3000)
debug.sendAnimationEvent(PlayerActor, "PairedStop")
;----- Blade Wave(Big) -----
ElseIf SpellNumber == 55
if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。
debug.sendAnimationEvent(PlayerActor, "AttackStart")
utility.Wait(0.5000)
Else
debug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")
utility.Wait(0.1000)
EndIf
SoundCastMoonLight5.play(PlayerActor)
ChargeSpellMoonLight5.Cast(PlayerActor, none)
utility.Wait(0.3000)
debug.sendAnimationEvent(PlayerActor, "PairedStop")
;----- Assault Armor -----
ElseIf SpellNumber == 56
debug.sendAnimationEvent(PlayerActor, "shoutStart")
SoundCastMoonLight6.play(PlayerActor)
utility.Wait(0.3000)
debug.sendAnimationEvent(PlayerActor, "MT_BreathExhaleShort")
utility.Wait(0.3000)
ChargeSpellMoonLight6.Cast(PlayerActor, none)
debug.sendAnimationEvent(PlayerActor, "StaggerStart")
debug.sendAnimationEvent(PlayerActor, "StaggerPlayer")
utility.Wait(1.00000)
debug.sendAnimationEvent(PlayerActor, "StaggerStop")
;===== Wind ===========================================================================
;----- Wind Fist -----
ElseIf SpellNumber == 61
if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。
debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")
utility.Wait(0.3000)
Else
debug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")
utility.Wait(0.1000)
EndIf
SoundCastWind1.play(PlayerActor)
ChargeSpellWind1.Cast(PlayerActor, none)
utility.Wait(0.2500)
debug.sendAnimationEvent(PlayerActor, "PairedStop")
;----- Wind Claw -----
ElseIf SpellNumber == 62
if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。
debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")
utility.Wait(0.3000)
Else
debug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")
utility.Wait(0.1000)
EndIf
SoundCastWind2.play(PlayerActor)
ChargeSpellWind2.Cast(PlayerActor, none)
utility.Wait(0.2500)
debug.sendAnimationEvent(PlayerActor, "PairedStop")
;----- Down Burst -----
ElseIf SpellNumber == 63
debug.sendAnimationEvent(PlayerActor, "shoutStart")
SoundCastWind3.play(PlayerActor)
utility.Wait(0.3000)
debug.sendAnimationEvent(PlayerActor, "MT_BreathExhaleShort")
utility.Wait(0.3000)
ChargeSpellWind3.Cast(PlayerActor, none)
debug.sendAnimationEvent(PlayerActor, "StaggerStart")
debug.sendAnimationEvent(PlayerActor, "StaggerPlayer")
utility.Wait(1.00000)
debug.sendAnimationEvent(PlayerActor, "StaggerStop")
;----- IDATEN -----
ElseIf SpellNumber == 64
debug.sendAnimationEvent(PlayerActor, "ShoutStart")
utility.Wait(0.1000)
SoundCastWind4.play(PlayerActor)
ChargeSpellWind4.Cast(PlayerActor, none)
debug.sendAnimationEvent(PlayerActor, "ShoutSprintLongestStart")
;===== Other ===========================================================================
;----- War Cry LV1 -----
ElseIf SpellNumber == 71
debug.sendAnimationEvent(PlayerActor, "shoutStart")
SoundCastOther1.play(PlayerActor)
game.ShakeCamera(PlayerActor, 0.400000, 0.400000)
utility.Wait(0.3000)
debug.sendAnimationEvent(PlayerActor, "MT_BreathExhaleShort")
utility.Wait(0.3000)
ChargeSpellOther1.Cast(PlayerActor, none)
utility.Wait(0.60000)
;----- War Cry LV2 -----
ElseIf SpellNumber == 72
debug.sendAnimationEvent(PlayerActor, "shoutStart")
SoundCastOther2.play(PlayerActor)
game.ShakeCamera(PlayerActor, 0.400000, 0.400000)
utility.Wait(0.3000)
debug.sendAnimationEvent(PlayerActor, "MT_BreathExhaleShort")
utility.Wait(0.3000)
ChargeSpellOther2.Cast(PlayerActor, none)
utility.Wait(0.60000)
;----- War Cry LV3 -----
ElseIf SpellNumber == 73
debug.sendAnimationEvent(PlayerActor, "shoutStart")
SoundCastOther3.play(PlayerActor)
game.ShakeCamera(PlayerActor, 0.400000, 0.400000)
utility.Wait(0.3000)
debug.sendAnimationEvent(PlayerActor, "MT_BreathExhaleShort")
utility.Wait(0.3000)
ChargeSpellOther3.Cast(PlayerActor, none)
utility.Wait(0.60000)
EndIf
EndFunction

 

 

 

now im trying to make a script that once i press the hot key lets say hotkey X
soo once i press and hold X i go into a chant state with the animation of holding a bow preparing to fire
upon releasing the x key i cast one of 3 spells depending on how long i charged the X key. i know the above script has everything i need but the charge spell mod uses skse and mcm to set options, i bareley understand papyrus let alone mcm or skse code. i just want a simple sript that allows for the game to resgister my holding key then casts spell accordingly. looked everywhere and downloaded a ton of mods to look at scripts, to no avail. need help
Link to comment
Share on other sites

It will require SKSE no matter what. You can avoid using MCM if necessary.

 

Something "simple" to start with. There is room for improvement I'm sure. I've not tested compilation or function.

 

 

ScriptName SomeScript Extends ReferenceAlias

GlobalVariable Property Hotkey Auto
Float Property TimeToPassForSpellOne Auto
Float Property TimeToPassForSpellTwo Auto
Float Property TimeToPassForSpellThree Auto

Float StartTime
Float CurrentTime
Int CurrentHK

Event OnInit()
	;initial hot key registration
	CurrentHK = Hotkey.GetValueInt()
	RegisterForKey(CurrentHK)
EndEvent

Event OnKeyDown(Int KeyCode)
	;process the following when the hotkey is pressed
	If KeyCode == CurrentHK
		StartTime = Utility.GetCurrentGameTime()
		While Input.IsKeyPressed(KeyCode)
			;do nothing
		EndWhile
		CurrentTime = Utility.GetCurrentGameTime()
		Float TimePassed = (CurrentTime - StartTime)
		If TimePassed >= TimeToPassForSpellThree
			;do third spell stuff
		ElseIf TimePassed >= TimeToPassForSpellTwo
			;do second spell stuff
		ElseIf TimePassed >= TimeToPassForSpellOne
			;do first spell stuff
		EndIf
	EndIf
	;process this if the hotkey was changed in the console -- requires user to press the old key so that the new key can be used.
	If CurrentHK != Hotkey.GetValueInt()
		UnregisterForKey(CurrentHK)
		CurrentHK = Hotkey.GetValueInt()
		RegisterForKey(CurrentHK)
	EndIf
EndEvent

 

 

Of course you will need to create all the necessary forms for this to work. And it is designed to run on a player alias. You'll also need to add in whatever spells and effects you want to have take place.

Link to comment
Share on other sites

i could kiss you implementing it now stay tuned

 

*Edit* so added it for my needs heres the script

 

 

GlobalVariable Property Hotkey Auto
Float Property TimeToPassForSpellOne Auto
Float Property TimeToPassForSpellTwo Auto
Float Property TimeToPassForSpellThree Auto
spell property ChargeSpellFire1 auto ;
spell property ChargeSpellFire2 auto ;
spell property ChargeSpellFire3 auto ;
sound property SoundCastFire1 auto ; ;
sound property SoundCastFire2 auto ; ;
sound property SoundCastFire3 auto ; ;
Float StartTime
Float CurrentTime
Int CurrentHK
EffectShader property EffectFire auto ; AlchArmorFireFX ;
Armor property ChargeSpellBook auto
sound property SoundChargeFire1 auto ; ;
sound property SoundChargeFire2 auto ; ;
sound property SoundChargeFire3 auto ; ;
Event OnInit()
;initial hot key registration
CurrentHK = Hotkey.GetValueInt()
RegisterForKey(CurrentHK)
EndEvent
Event OnKeyDown(Int KeyCode)
;process the following when the hotkey is pressed
If KeyCode == CurrentHK
StartTime = Utility.GetCurrentGameTime()
While Input.IsKeyPressed(KeyCode)
EffectFire.Stop(PlayerActor) ;do nothing
EndWhile
CurrentTime = Utility.GetCurrentGameTime()
Float TimePassed = (CurrentTime - StartTime)
If TimePassed >= TimeToPassForSpellThree
If PlayerActor.isequipped(ChargeSpellBook)
SoundChargeFire3.play(PlayerActor);do third spell stuff
ChargeSpellFire3.Cast(PlayerActor, none)
EffectFire.Stop(PlayerActor)
ElseIf TimePassed >= TimeToPassForSpellTwo
If PlayerActor.isequipped(ChargeSpellBook)
SoundChargeFire2.play(PlayerActor);do second spell stuff
ChargeSpellFire.Cast(PlayerActor, none)
EffectFire.Stop(PlayerActor)
ElseIf TimePassed >= TimeToPassForSpellOne
If PlayerActor.isequipped(ChargeSpellBook)
EffectFire.Play(PlayerActor)
SoundChargeFire1.play(PlayerActor) ;do first spell stuff
ChargeSpellFire1.Cast(PlayerActor, none)
EffectFire.Stop(PlayerActor)
EndIf
EndIf
;process this if the hotkey was changed in the console -- requires user to press the old key so that the new key can be used.
If CurrentHK != Hotkey.GetValueInt()
UnregisterForKey(CurrentHK)
CurrentHK = Hotkey.GetValueInt()
RegisterForKey(CurrentHK)
EndIf
EndEvent

 

 

sadly it won't complie heres the error

 

 

C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\HexChargeAliasScript.psc(74,0): mismatched input 'EndEvent' expecting ENDIF

No output generated for HexChargeAliasScript, compilation failed.

 

 

now in the the above script there's only 2 "EndEvent" instances tried changing them to endif no joy sadly, perhaps its my lack of knowledge regarding syntax, i don't know tho. looking at the script i cant spot where mismatched input is coming from.

 

*edit* bah i'm not cut out for this. just noticed ive added 2 new if statements. yet didnt use endif was to excited about your script. some sleep and clear head to wonders. my apoligises

Edited by hecks567
Link to comment
Share on other sites

At least you found the error and how to correct it. The compiler will tell you at what line it believes the problem to be at. You can either pay attention to the number that changes at the bottom of the CK window as you go through the script's lines. Or you can use an external program like Notepad++ that will show line numbers.

 

Not all problems will be on the indicated line. Sometimes it is because something was forgotten on the line above. You'll get the hang of it as you make mistakes and correct them.

Link to comment
Share on other sites

thanks yeah i thought thouse numbers were line and letter number kinda like longitude and lattitude. i got a working script and testing at the moment heres what i got

 

 

Scriptname test01charge extends ReferenceAlias

GlobalVariable Property Hotkey Auto
Float Property TimeToPassForSpellOne Auto ; 1 :
Float Property TimeToPassForSpellTwo Auto ; 3 ;
Float Property TimeToPassForSpellThree Auto ; 5 ;
spell property ChargeSpellFire1 auto
spell property ChargeSpellFire2 auto
spell property ChargeSpellFire3 auto
idle property CrossbowAttackStart auto ; CrossbowAttackStart ;
sound property SoundCastFire1 auto
sound property SoundCastFire2 auto
sound property SoundCastFire3 auto
Float StartTime
Float CurrentTime
EffectShader property EffectFire auto ; AlchArmorFireFX ;
sound property SoundChargeFire1 auto
sound property SoundChargeFire2 auto
sound property SoundChargeFire3 auto
actor PlayerActor
Event OnInit()
;initial hot key registration
RegisterForKey(45)
EndEvent
Event OnKeyDown(Int KeyCode)
;process the following when the hotkey is pressed
If KeyCode == 45
StartTime = Utility.GetCurrentGameTime()
While Input.IsKeyPressed(KeyCode)
game.getPlayer().PlayIdle(CrossbowAttackStart)
EffectFire.Play(game.getPlayer())
EndWhile
CurrentTime = Utility.GetCurrentGameTime()
Float TimePassed = (CurrentTime - StartTime)
If TimePassed >= TimeToPassForSpellThree
game.ShakeCamera(game.getPlayer(), 0.400000, 0.400000)
utility.Wait(0.80000)
SoundChargeFire3.play(game.getPlayer())
utility.Wait(0.20000)
ChargeSpellFire3.Cast(game.getPlayer())
EffectFire.Stop(game.getPlayer())
game.getPlayer().damageAv("stamina", 15)
utility.Wait(0.80000)
debug.sendAnimationEvent(game.getPlayer(), "attackStop")
ElseIf TimePassed >= TimeToPassForSpellTwo
game.getPlayer().PlayIdle(CrossbowAttackStart)
SoundChargeFire2.play(game.getPlayer())
ChargeSpellFire2.Cast(game.getPlayer())
EffectFire.Stop(game.getPlayer())
game.getPlayer().damageAv("stamina", 10)
utility.Wait(0.80000)
debug.sendAnimationEvent(game.getPlayer(), "attackStop")
ElseIf TimePassed >= TimeToPassForSpellOne
game.getPlayer().PlayIdle(CrossbowAttackStart)
EffectFire.Play(game.getPlayer())
SoundChargeFire1.play(game.getPlayer())
ChargeSpellFire1.cast(game.getPlayer())
game.getPlayer().damageAv("stamina", 5)
EffectFire.Stop(game.getPlayer())
utility.Wait(0.80000)
debug.sendAnimationEvent(game.getPlayer(), "attackStop")
EndIf
EndIf
EndEvent

 

 

after reinstalling skse like ten times and copying skse pex files the same amount i couldnt get my CK to compile any scripts with (PlayerActor). theres still a reference actor PlayerActor as im trying to use that type of reference to the player. i even had trouble registering for key to compile so i specified the hotkey to make sure.once compiled your charge effect worked perfectly. most of the complie errors stem from my dodgey CK that doesnt appear to like to Compile skse code/lanuage or my utter lack of scripting knowledge. i have no inherant scripting understanding i look at other scripts and mimic, i know its poor but most my scripts are for personal use.

thanks again you been a great help

 

ps. just as i finish this, i find this on the the nexus BitterSweet

Edited by hecks567
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...