hecks567 Posted April 21, 2014 Share Posted April 21, 2014 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 Quote 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,マイセットaGlobalVariable Property ChargeLV2aVar auto ; 別スクリプトで登録したLV2魔法のID,マイセットaGlobalVariable Property ChargeLV3aVar auto ; 別スクリプトで登録したLV3魔法のID,マイセットaGlobalVariable Property AttributeAVar auto ; チャージ時に発生するサウンドとエフェクトを指定する,マイセットa GlobalVariable Property ChargeLV1bVar auto ; 別スクリプトで登録したLV1魔法のID,マイセットbGlobalVariable Property ChargeLV2bVar auto ; 別スクリプトで登録したLV2魔法のID,マイセットbGlobalVariable Property ChargeLV3bVar auto ; 別スクリプトで登録したLV3魔法のID,マイセットbGlobalVariable Property AttributeBVar auto ; チャージ時に発生するサウンドとエフェクトを指定する,マイセットb GlobalVariable Property ChargeLV1cVar auto ; 別スクリプトで登録したLV1魔法のID,マイセットcGlobalVariable Property ChargeLV2cVar auto ; 別スクリプトで登録したLV2魔法のID,マイセットcGlobalVariable Property ChargeLV3cVar auto ; 別スクリプトで登録したLV3魔法のID,マイセットcGlobalVariable 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 ; ; チャージLV1sound property SoundChargeFire2 auto ; ; チャージLV2sound property SoundChargeFire3 auto ; ; チャージLV3==チャージ最終段階到達音sound property SoundChargeFrost1 auto ; ; チャージLV1sound property SoundChargeFrost2 auto ; ; チャージLV2sound property SoundChargeFrost3 auto ; ; チャージLV3==チャージ最終段階到達音sound property SoundChargeShock1 auto ; ; チャージLV1sound property SoundChargeShock2 auto ; ; チャージLV2sound property SoundChargeShock3 auto ; ; チャージLV3==チャージ最終段階到達音sound property SoundChargeSunLight1 auto ; ; チャージLV1sound property SoundChargeSunLight2 auto ; ; チャージLV2sound property SoundChargeSunLight3 auto ; ; チャージLV3==チャージ最終段階到達音sound property SoundChargeBlood1 auto ; ; チャージLV1sound property SoundChargeBlood2 auto ; ; チャージLV2sound property SoundChargeBlood3 auto ; ; チャージLV3==チャージ最終段階到達音sound property SoundChargeMoonLight1 auto ; ; チャージLV1sound property SoundChargeMoonLight2 auto ; ; チャージLV2sound property SoundChargeMoonLight3 auto ; ; チャージLV3==チャージ最終段階到達音sound property SoundChargeWind1 auto ; ; チャージLV1sound property SoundChargeWind2 auto ; ; チャージLV2sound 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の発射音その2sound 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 Boltspell property ChargeSpellFire2 auto ; 炎魔法2 ; Fire Ballspell property ChargeSpellFire3 auto ; 炎魔法3 ; Hell Firespell property ChargeSpellFire4 auto ; 炎魔法4 ; Blazespell property ChargeSpellFire5 auto ; 炎魔法5 ; Genocide Crashspell property ChargeSpellFire6 auto ; 炎魔法6 ; Fire Rune spell property ChargeSpellFrost1 auto ; 氷魔法1 ; Ice Spikespell property ChargeSpellFrost2 auto ; 氷魔法2 ; Stingerspell property ChargeSpellFrost3 auto ; 氷魔法3 ; Ice Blastspell property ChargeSpellFrost4 auto ; 氷魔法4 ; Ice Stormspell property ChargeSpellFrost5 auto ; 氷魔法5 ; Frost Rune spell property ChargeSpellShock1 auto ; 雷魔法1 ; Lightning Boltspell property ChargeSpellShock2 auto ; 雷魔法2 ; Chain Lightningspell property ChargeSpellShock3 auto ; 雷魔法3 ; Spritespell property ChargeSpellShock4 auto ; 雷魔法4 ; Lightning Spearspell property ChargeSpellShock5 auto ; 雷魔法5 ; JINRAIspell property ChargeSpellShock6 auto ; 雷魔法6 ; Shock Rune spell property ChargeSpellSunlight1 auto ; 太陽魔法1 ; Sunlight Boltspell property ChargeSpellSunlight2 auto ; 太陽魔法2 ; Sunlight Cannnonspell property ChargeSpellSunlight3 auto ; 太陽魔法3 ; Punishementspell property ChargeSpellSunlight4 auto ; 太陽魔法4 ; Sunlight Crossspell property ChargeSpellSunlight5 auto ; 太陽魔法5 ; Shining spell property ChargeSpellBlood1 auto ; 血魔法1 ; Bloody Clawspell property ChargeSpellBlood2a auto ; 血魔法2a ; Bloody Dancespell property ChargeSpellBlood2b auto ; 血魔法2b ; Bloody Dancespell property ChargeSpellBlood2c auto ; 血魔法2c ; Bloody Dancespell property ChargeSpellBlood3a auto ; 血魔法3a ; Bloody Rondospell property ChargeSpellBlood3b auto ; 血魔法3b ; Bloody Rondospell property ChargeSpellBlood3c auto ; 血魔法3c ; Bloody Rondospell property ChargeSpellBlood4 auto ; 血魔法4 ; Bloody Crossspell property ChargeSpellBlood5 auto ; 血魔法5 ; Scream spell property ChargeSpellMoonLight1 auto ; 月光魔法1 ; Blade Wavespell property ChargeSpellMoonLight2a auto ; 月光魔法2a ; SAMURAIspell property ChargeSpellMoonLight2b auto ; 月光魔法2b ; SAMURAIspell property ChargeSpellMoonLight2c auto ; 月光魔法2c ; SAMURAIspell property ChargeSpellMoonLight3a auto ; 月光魔法3a ; SAMURAI2spell property ChargeSpellMoonLight3b auto ; 月光魔法3b ; SAMURAI2spell property ChargeSpellMoonLight3c auto ; 月光魔法3c ; SAMURAI2spell 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 Fistspell property ChargeSpellWind2 auto ; 風魔法2 ; Wind Clawspell property ChargeSpellWind3 auto ; 風魔法3 ; Down Burstspell property ChargeSpellWind4 auto ; 風魔法4 ; IDATEN spell property ChargeSpellOther1 auto ; その他魔法1 ; War Cry LV1spell property ChargeSpellOther2 auto ; その他魔法2 ; War Cry LV2spell 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 == 0ChargeLV1 = ChargeLV1aVar.GetValueInt()ChargeLV2 = ChargeLV2aVar.GetValueInt()ChargeLV3 = ChargeLV3aVar.GetValueInt()Attribute = AttributeAVar.GetValueInt()ElseIf ChargeSpellMySet == 1ChargeLV1 = ChargeLV1bVar.GetValueInt()ChargeLV2 = ChargeLV2bVar.GetValueInt()ChargeLV3 = ChargeLV3bVar.GetValueInt()Attribute = AttributeBVar.GetValueInt()ElseIf ChargeSpellMySet >= 2ChargeLV1 = 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 = 0EndIf PlayerActor.RestoreAv("magicka", CostCharge * CountFire)index = 0CountFire = 0;--------------------------------------------------------------------------------;Charging;--------------------------------------------------------------------------------Else ; 泳いでいないIf PlayerActor.isequipped(ChargeSpellBook) ; 特定の防具を装備している。If input.IsKeyPressed(ButtonFire) ; 詠唱ボタン検出。If !input.IsKeyPressed(ButtonCancel) ; キャンセルボタン検出。index = 0if index == 0If CountFire < 12index = 1If CountFire == 0 ; チャージLV1。if (PlayerActor.GetActorValue("magicka") >= 16) ; 必要なマギカが残っている。If Attribute == 1EffectFire.Play(PlayerActor)SoundChargeFire1.play(PlayerActor)ElseIf Attribute == 2EffectFrost.Play(PlayerActor)SoundChargeFrost1.play(PlayerActor)ElseIf Attribute == 3EffectShock.Play(PlayerActor)SoundChargeShock1.play(PlayerActor)ElseIf Attribute == 4EffectSunlight.Play(PlayerActor)SoundChargeSunlight1.play(PlayerActor)ElseIf Attribute == 5EffectBlood.Play(PlayerActor)SoundChargeBlood1.play(PlayerActor)ElseIf Attribute == 6EffectMoonlight.Play(PlayerActor)SoundChargeMoonlight1.play(PlayerActor)ElseIf Attribute == 7EffectWind.Play(PlayerActor)SoundChargeWind1.play(PlayerActor)EndIfPlayerActor.damageAv("magicka", 16) ; チャージ開始時にマギカを16消費する。utility.Wait(0.02000)CountFire += 1EndIfElse ; CountFire != 0if (PlayerActor.GetActorValue("magicka") >= CostCharge) ; 必要なマギカが残っている。If CountFire == 5 ; チャージLV2。If Attribute == 1SoundChargeFire2.play(PlayerActor)ElseIf Attribute == 2SoundChargeFrost2.play(PlayerActor)ElseIf Attribute == 3SoundChargeShock2.play(PlayerActor)ElseIf Attribute == 4SoundChargeSunlight2.play(PlayerActor)ElseIf Attribute == 5SoundChargeBlood2.play(PlayerActor)ElseIf Attribute == 6SoundChargeMoonlight2.play(PlayerActor)ElseIf Attribute == 7SoundChargeWind2.play(PlayerActor)EndIfElseIf CountFire == 11 ; チャージLV3。If Attribute == 1SoundChargeFire3.play(PlayerActor)ElseIf Attribute == 2SoundChargeFrost3.play(PlayerActor)ElseIf Attribute == 3SoundChargeShock3.play(PlayerActor)ElseIf Attribute == 4SoundChargeSunlight3.play(PlayerActor)ElseIf Attribute == 5SoundChargeBlood3.play(PlayerActor)ElseIf Attribute == 6SoundChargeMoonlight3.play(PlayerActor)ElseIf Attribute == 7SoundChargeWind3.play(PlayerActor)EndIfendifPlayerActor.damageAv("magicka", CostCharge)utility.Wait(0.02000)CountFire += 1EndIfEndIfutility.Wait(0.02000)index = 2 Else ; CountFire >= 12;チャージLV3待機中。index = 1utility.Wait(0.02000)index = 2endIf ; 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 = 1EndIfEndIf 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 = 0EndIfEndIfEndIf ; 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 = 0EndIf PlayerActor.RestoreAv("magicka", CostCharge * CountFire)utility.Wait(0.60000)index = 0CountFire = 0EndIfEndIf ; キャンセルボタン検出。 ;------ Cast --------------------------------------------------------------------------Else ; チャージボタン検出なし。If !input.IsKeyPressed(ButtonCancel) ; キャンセルボタン検出なし。if index != 0If 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 = 0EndIfutility.Wait(0.30000)AudioCategoryNPCKillMove.UnMute()index = 0CountFire = 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 = 0EndIfutility.Wait(0.45000)PlayerActor.RemovePerk(ChargeLV2Perk)AudioCategoryNPCKillMove.UnMute()index = 0CountFire = 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 = 0EndIfutility.Wait(0.60000)PlayerActor.RemovePerk(ChargeLV3Perk)AudioCategoryNPCKillMove.UnMute()index = 0CountFire = 0endIf ; CountFire = 12endIf ; CountFire = 6ElseIndex = 0CountFire = 0endIf ; CountFire != 0;------ Spell-Set Toggle --------------------------------------------------------------------------Else ; index == 0If 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)EndIfEndIfEndIfendIf ; index != 0endIf ; キャンセルボタン検出。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 == 0ChargeLV1 = ChargeLV1aVar.GetValueInt()ChargeLV2 = ChargeLV2aVar.GetValueInt()ChargeLV3 = ChargeLV3aVar.GetValueInt()Attribute = AttributeAVar.GetValueInt()ElseIf ChargeSpellMySet == 1ChargeLV1 = ChargeLV1bVar.GetValueInt()ChargeLV2 = ChargeLV2bVar.GetValueInt()ChargeLV3 = ChargeLV3bVar.GetValueInt()Attribute = AttributeBVar.GetValueInt()ElseIf ChargeSpellMySet <= 2ChargeLV1 = 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 == 1if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")utility.Wait(0.3000)Elsedebug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")utility.Wait(0.1000)EndIfSoundCastFire1.play(PlayerActor)ChargeSpellFire1.Cast(PlayerActor, none)utility.Wait(0.2500)debug.sendAnimationEvent(PlayerActor, "PairedStop") ;----- FireBall -----ElseIf SpellNumber == 2if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")utility.Wait(0.3000)Elsedebug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")utility.Wait(0.1000)EndIfSoundCastFire2.play(PlayerActor)ChargeSpellFire2.Cast(PlayerActor, none)utility.Wait(0.2500)debug.sendAnimationEvent(PlayerActor, "PairedStop") ;----- Hell Fire -----ElseIf SpellNumber == 3debug.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 == 4debug.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 == 5debug.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 == 6if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")utility.Wait(0.3000)Elsedebug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")utility.Wait(0.1000)EndIfSoundCastFire6.play(PlayerActor)ChargeSpellFire6.Cast(PlayerActor, none)utility.Wait(0.2500)debug.sendAnimationEvent(PlayerActor, "PairedStop") ;===== Frost ===========================================================================;----- Ice Spike -----ElseIf SpellNumber == 11if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")utility.Wait(0.3000)Elsedebug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")utility.Wait(0.1000)EndIfSoundCastFrost1.play(PlayerActor)ChargeSpellFrost1.Cast(PlayerActor, none)utility.Wait(0.2500)debug.sendAnimationEvent(PlayerActor, "PairedStop") ;----- Stinger -----ElseIf SpellNumber == 12if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")utility.Wait(0.3000)Elsedebug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")utility.Wait(0.1000)EndIfSoundCastFrost2.play(PlayerActor)ChargeSpellFrost2.Cast(PlayerActor, none)utility.Wait(0.2500)debug.sendAnimationEvent(PlayerActor, "PairedStop") ;----- Ice Blast -----ElseIf SpellNumber == 13if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")utility.Wait(0.3000)Elsedebug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")utility.Wait(0.1000)EndIfSoundCastFrost3.play(PlayerActor)ChargeSpellFrost3.Cast(PlayerActor, none)utility.Wait(0.2500)debug.sendAnimationEvent(PlayerActor, "PairedStop") ;----- Ice Storm -----ElseIf SpellNumber == 14if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")utility.Wait(0.3000)Elsedebug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")utility.Wait(0.1000)EndIfSoundCastFrost4.play(PlayerActor)ChargeSpellFrost4.Cast(PlayerActor, none)utility.Wait(0.2500)debug.sendAnimationEvent(PlayerActor, "PairedStop") ;----- Frost Rune -----ElseIf SpellNumber == 15if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")utility.Wait(0.3000)Elsedebug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")utility.Wait(0.1000)EndIfSoundCastFrost5.play(PlayerActor)ChargeSpellFrost5.Cast(PlayerActor, none)utility.Wait(0.2500)debug.sendAnimationEvent(PlayerActor, "PairedStop") ;===== Shock ===========================================================================;----- Lightning Bolt -----ElseIf SpellNumber == 21if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")utility.Wait(0.3500)Elsedebug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")utility.Wait(0.1000)EndIfSoundCastShock1.play(PlayerActor)ChargeSpellShock1.Cast(PlayerActor, none)utility.Wait(0.2500)debug.sendAnimationEvent(PlayerActor, "PairedStop") ;----- Chain Lightning -----ElseIf SpellNumber == 22if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")utility.Wait(0.3500)Elsedebug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")utility.Wait(0.1000)EndIfSoundCastShock2.play(PlayerActor)ChargeSpellShock2.Cast(PlayerActor, none)utility.Wait(0.2500)debug.sendAnimationEvent(PlayerActor, "PairedStop") ;----- Sprite -----ElseIf SpellNumber == 23if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")utility.Wait(0.3500)Elsedebug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")utility.Wait(0.1000)EndIfSoundCastShock3.play(PlayerActor)ChargeSpellShock3.Cast(PlayerActor, none)utility.Wait(0.2500)debug.sendAnimationEvent(PlayerActor, "PairedStop") ;----- Lightning Spear -----ElseIf SpellNumber == 24if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")utility.Wait(0.3500)Elsedebug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")utility.Wait(0.1000)EndIfSoundCastShock4.play(PlayerActor)ChargeSpellShock4.Cast(PlayerActor, none)utility.Wait(0.2500)debug.sendAnimationEvent(PlayerActor, "PairedStop") ;----- JINRAI -----ElseIf SpellNumber == 25debug.sendAnimationEvent(PlayerActor, "ShoutStart")utility.Wait(0.1000)SoundCastShock5.play(PlayerActor)ChargeSpellShock5.Cast(PlayerActor, none)debug.sendAnimationEvent(PlayerActor, "ShoutSprintLongestStart") ;----- Shock Rune -----ElseIf SpellNumber == 26if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")utility.Wait(0.3000)Elsedebug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")utility.Wait(0.1000)EndIfSoundCastShock6.play(PlayerActor)ChargeSpellShock6.Cast(PlayerActor, none)utility.Wait(0.2500)debug.sendAnimationEvent(PlayerActor, "PairedStop") ;===== Sunlight ===========================================================================;----- Sunlight Bolt -----ElseIf SpellNumber == 31if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")utility.Wait(0.3000)Elsedebug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")utility.Wait(0.1000)EndIfSoundCastSunlight1.play(PlayerActor)ChargeSpellSunlight1.Cast(PlayerActor, none)utility.Wait(0.2500)debug.sendAnimationEvent(PlayerActor, "PairedStop") ;----- Sunlight Cannon -----ElseIf SpellNumber == 32if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")utility.Wait(0.3000)Elsedebug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")utility.Wait(0.1000)EndIfSoundCastSunlight2.play(PlayerActor)ChargeSpellSunlight2.Cast(PlayerActor, none)utility.Wait(0.2500)debug.sendAnimationEvent(PlayerActor, "PairedStop") ;----- Punishment -----ElseIf SpellNumber == 33debug.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 == 34if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")utility.Wait(0.3000)Elsedebug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")utility.Wait(0.1000)EndIfSoundCastSunlight4.play(PlayerActor)ChargeSpellSunlight4.Cast(PlayerActor, none)utility.Wait(0.2500)debug.sendAnimationEvent(PlayerActor, "PairedStop") ;----- Shining -----ElseIf SpellNumber == 35debug.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 == 41if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")utility.Wait(0.3000)Elsedebug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")utility.Wait(0.1000)EndIfSoundCastBlood1.play(PlayerActor)ChargeSpellBlood1.Cast(PlayerActor, none)utility.Wait(0.2500)debug.sendAnimationEvent(PlayerActor, "PairedStop") ;----- Bloody Dance -----ElseIf SpellNumber == 42debug.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 == 43debug.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 == 44if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")utility.Wait(0.3000)Elsedebug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")utility.Wait(0.1000)EndIfSoundCastBlood4.play(PlayerActor)ChargeSpellBlood4.Cast(PlayerActor, none)utility.Wait(0.2500)debug.sendAnimationEvent(PlayerActor, "PairedStop") ;----- Bloody Scream -----ElseIf SpellNumber == 45debug.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 == 51if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")utility.Wait(0.3000)Elsedebug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")utility.Wait(0.1000)EndIfSoundCastMoonlight1.play(PlayerActor)ChargeSpellMoonlight1.Cast(PlayerActor, none)utility.Wait(0.2500)debug.sendAnimationEvent(PlayerActor, "PairedStop") ;----- SAMURAI -----ElseIf SpellNumber == 52debug.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 == 53debug.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 == 54if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。debug.sendAnimationEvent(PlayerActor, "AttackStart")utility.Wait(0.5000)Elsedebug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")utility.Wait(0.1000)EndIfSoundCastMoonLight4.play(PlayerActor)ChargeSpellMoonLight4.Cast(PlayerActor, none)utility.Wait(0.3000)debug.sendAnimationEvent(PlayerActor, "PairedStop") ;----- Blade Wave(Big) -----ElseIf SpellNumber == 55if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。debug.sendAnimationEvent(PlayerActor, "AttackStart")utility.Wait(0.5000)Elsedebug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")utility.Wait(0.1000)EndIfSoundCastMoonLight5.play(PlayerActor)ChargeSpellMoonLight5.Cast(PlayerActor, none)utility.Wait(0.3000)debug.sendAnimationEvent(PlayerActor, "PairedStop") ;----- Assault Armor -----ElseIf SpellNumber == 56debug.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 == 61if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")utility.Wait(0.3000)Elsedebug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")utility.Wait(0.1000)EndIfSoundCastWind1.play(PlayerActor)ChargeSpellWind1.Cast(PlayerActor, none)utility.Wait(0.2500)debug.sendAnimationEvent(PlayerActor, "PairedStop") ;----- Wind Claw -----ElseIf SpellNumber == 62if PlayerActor.GetEquippedItemType(0) != 9 ; 左手に魔法を装備していない。debug.sendAnimationEvent(PlayerActor, "attackstartlefthand")utility.Wait(0.3000)Elsedebug.sendAnimationEvent(PlayerActor, "pa_KillMoveShortC")utility.Wait(0.1000)EndIfSoundCastWind2.play(PlayerActor)ChargeSpellWind2.Cast(PlayerActor, none)utility.Wait(0.2500)debug.sendAnimationEvent(PlayerActor, "PairedStop") ;----- Down Burst -----ElseIf SpellNumber == 63debug.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 == 64debug.sendAnimationEvent(PlayerActor, "ShoutStart")utility.Wait(0.1000)SoundCastWind4.play(PlayerActor)ChargeSpellWind4.Cast(PlayerActor, none)debug.sendAnimationEvent(PlayerActor, "ShoutSprintLongestStart") ;===== Other ===========================================================================;----- War Cry LV1 -----ElseIf SpellNumber == 71debug.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 == 72debug.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 == 73debug.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 More sharing options...
IsharaMeradin Posted April 21, 2014 Share Posted April 21, 2014 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. Reveal hidden contents 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 More sharing options...
hecks567 Posted April 24, 2014 Author Share Posted April 24, 2014 (edited) i could kiss you implementing it now stay tuned *Edit* so added it for my needs heres the script Quote GlobalVariable Property Hotkey AutoFloat Property TimeToPassForSpellOne AutoFloat Property TimeToPassForSpellTwo AutoFloat 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 StartTimeFloat CurrentTimeInt 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 registrationCurrentHK = Hotkey.GetValueInt()RegisterForKey(CurrentHK)EndEvent Event OnKeyDown(Int KeyCode);process the following when the hotkey is pressedIf KeyCode == CurrentHKStartTime = Utility.GetCurrentGameTime()While Input.IsKeyPressed(KeyCode)EffectFire.Stop(PlayerActor) ;do nothingEndWhileCurrentTime = Utility.GetCurrentGameTime()Float TimePassed = (CurrentTime - StartTime)If TimePassed >= TimeToPassForSpellThreeIf PlayerActor.isequipped(ChargeSpellBook)SoundChargeFire3.play(PlayerActor);do third spell stuffChargeSpellFire3.Cast(PlayerActor, none)EffectFire.Stop(PlayerActor) ElseIf TimePassed >= TimeToPassForSpellTwoIf PlayerActor.isequipped(ChargeSpellBook)SoundChargeFire2.play(PlayerActor);do second spell stuffChargeSpellFire.Cast(PlayerActor, none)EffectFire.Stop(PlayerActor) ElseIf TimePassed >= TimeToPassForSpellOneIf PlayerActor.isequipped(ChargeSpellBook)EffectFire.Play(PlayerActor)SoundChargeFire1.play(PlayerActor) ;do first spell stuffChargeSpellFire1.Cast(PlayerActor, none)EffectFire.Stop(PlayerActor) EndIfEndIf;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)EndIfEndEvent sadly it won't complie heres the error Quote C:\Program Files\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\HexChargeAliasScript.psc(74,0): mismatched input 'EndEvent' expecting ENDIFNo 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 April 25, 2014 by hecks567 Link to comment Share on other sites More sharing options...
hecks567 Posted April 25, 2014 Author Share Posted April 25, 2014 found that add 3 new if instances. remarkably what a fresh nights sleep will bring. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted April 25, 2014 Share Posted April 25, 2014 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 More sharing options...
hecks567 Posted April 28, 2014 Author Share Posted April 28, 2014 (edited) 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 Quote Scriptname test01charge extends ReferenceAlias GlobalVariable Property Hotkey AutoFloat Property TimeToPassForSpellOne Auto ; 1 :Float Property TimeToPassForSpellTwo Auto ; 3 ;Float Property TimeToPassForSpellThree Auto ; 5 ; spell property ChargeSpellFire1 autospell property ChargeSpellFire2 autospell property ChargeSpellFire3 autoidle property CrossbowAttackStart auto ; CrossbowAttackStart ;sound property SoundCastFire1 auto sound property SoundCastFire2 auto sound property SoundCastFire3 auto Float StartTimeFloat 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 registrationRegisterForKey(45)EndEvent Event OnKeyDown(Int KeyCode);process the following when the hotkey is pressedIf KeyCode == 45StartTime = Utility.GetCurrentGameTime()While Input.IsKeyPressed(KeyCode) game.getPlayer().PlayIdle(CrossbowAttackStart)EffectFire.Play(game.getPlayer())EndWhileCurrentTime = 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 >= TimeToPassForSpellOnegame.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")EndIfEndIf 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 April 28, 2014 by hecks567 Link to comment Share on other sites More sharing options...
Recommended Posts