need help adding weapons to Lorkhan Heart Script
Posted: Wed Aug 19, 2009 4:21 am
I'm attempting to make a mod where the players the ability to switch between a short, long, spear, and ax version of keening. I've got the switch scripts down but now i'm having trouble with giving the individual weapons the ability to act as the normal keening. As the script currently is, the heart of lorkhan is destroyed after one one sunder strike, without hitting it with keening. I'm still new to scripting so i don't totally understand how to fix it, so any help would be appreciated.
here is what the script looks like now.
Keening_axe/lsword/spear are the new IDs for the keening weapons.
here is what the script looks like now.
begin LorkhanHeart
short sunderHit
;were hit by Sunder THIS FRAME
short keeningHit
short keening_axeHit
short keening_lswordHit
short keening_spearHit
;were hit by Keening THIS FRAME
short countHits
;number of times you hit with Keening
short countSays
;make sure you don't Say over and over
short doOnce
;teleport Dagoth Ur once
if ( menumode == 1 )
return
endif
if ( HeartDestroyed == 1 )
if ( doOnce == 2 )
return
endif
if ( CellChanged == 1 )
Disable
Set doOnce to 2
endif
if ( CellChanged == 0 )
if ( GetSoundPlaying "endrumble" == 0 )
;play rumbling sound after heart is dead, until player leaves
PlayLoopSound3D "endrumble"
endif
endif
if ( GetSoundPlaying "heart" == 1 )
StopSound "heart"
endif
if ( GetSoundPlaying "heartSunder" == 1 )
StopSound "heartSunder"
endif
return
endif
if ( sunderHit == 0 )
;test if you hit with Sunder until you hit with Sunder
Set sunderHit to HitOnMe Sunder
endif
;test if you hit with Keening every frame, also make heart immortal
Set keeningHit to HitOnMe Keening
Set keening_AxeHit to HitOnMe Keening_axe
Set keening_lswordHit to HitOnMe Keening_lsword
Set keening_spearHit to HitOnMe Keening_spear
SetHealth 5000
if ( doOnce == 0 )
if ( GetDistance Player < 500 )
"dagoth_ur_2"->PositionCell -40 2590 -180 320 "Akulakhan's Chamber"
"dagoth_ur_2"->StartCombat Player
Set doOnce to 1
endif
endif
if ( sunderHit == 1 )
;play correct sounds before & after sunder
;return if you've never hit with Sunder
if ( HeartDestroyed == 0 )
if ( CellChanged == 0 )
if ( GetSoundPlaying "heartSunder" == 0 )
PlayLoopSound3D "heartsunder"
endif
endif
endif
else
if ( CellChanged == 0 )
if ( GetSoundPlaying "heart" == 0 )
PlayLoopSound3D, "heart"
endif
endif
return
endif
if ( keeningHit == 0 )
elseif ( keening_axeHit == 0 )
elseif ( keening_lswordHit == 0 )
elseif ( keening_spearHit == 0 )
;only process rest of script when hit with keening
return
endif
;if player hit with Keening THIS FRAME, do all this stuff...
Set countHits to ( countHits + 1 )
if ( countHits == 0 )
if ( countSays != 0 )
Set countSays to 0
endif
return
endif
if ( countHits == 1 )
if ( countSays == 0 )
Say "vo\misc\Hit Heart 1.wav" "What are you doing?"
"dagoth_ur_2"->SetFight 100
"dagoth_ur_2"->StartCombat Player
Set countSays to 1
endif
PlayGroup Idle2
endif
if ( countHits == 2 )
if ( countSays == 1 )
Say "vo\misc\Hit Heart 2.wav" "WHAT ARE YOU DOING?!"
Set countSays to 2
endif
PlayGroup Idle3
endif
if ( countHits == 3 )
if ( countSays == 2 )
Say "vo\misc\Hit Heart 3.wav" "FOOL!"
Set countSays to 3
endif
PlayGroup Idle4
endif
if ( countHits == 4 )
if ( countSays == 3 )
Say "vo\misc\Hit Heart 4.wav" "STOP!"
Set countSays to 4
endif
PlayGroup Idle5
endif
if ( countHits > 4 )
if ( countSays == 4 )
Say "vo\misc\Hit Heart 6.wav" "This is the end. The bitter, bitter end."
Set countSays to 5
endif
if ( GetSoundPlaying "heart" == 1 )
StopSound "heart"
endif
if ( GetSoundPlaying "heartSunder" == 1 )
StopSound "heartSunder"
endif
PlayGroup Death1
set HeartDestroyed to 1
endif
End
short sunderHit
;were hit by Sunder THIS FRAME
short keeningHit
short keening_axeHit
short keening_lswordHit
short keening_spearHit
;were hit by Keening THIS FRAME
short countHits
;number of times you hit with Keening
short countSays
;make sure you don't Say over and over
short doOnce
;teleport Dagoth Ur once
if ( menumode == 1 )
return
endif
if ( HeartDestroyed == 1 )
if ( doOnce == 2 )
return
endif
if ( CellChanged == 1 )
Disable
Set doOnce to 2
endif
if ( CellChanged == 0 )
if ( GetSoundPlaying "endrumble" == 0 )
;play rumbling sound after heart is dead, until player leaves
PlayLoopSound3D "endrumble"
endif
endif
if ( GetSoundPlaying "heart" == 1 )
StopSound "heart"
endif
if ( GetSoundPlaying "heartSunder" == 1 )
StopSound "heartSunder"
endif
return
endif
if ( sunderHit == 0 )
;test if you hit with Sunder until you hit with Sunder
Set sunderHit to HitOnMe Sunder
endif
;test if you hit with Keening every frame, also make heart immortal
Set keeningHit to HitOnMe Keening
Set keening_AxeHit to HitOnMe Keening_axe
Set keening_lswordHit to HitOnMe Keening_lsword
Set keening_spearHit to HitOnMe Keening_spear
SetHealth 5000
if ( doOnce == 0 )
if ( GetDistance Player < 500 )
"dagoth_ur_2"->PositionCell -40 2590 -180 320 "Akulakhan's Chamber"
"dagoth_ur_2"->StartCombat Player
Set doOnce to 1
endif
endif
if ( sunderHit == 1 )
;play correct sounds before & after sunder
;return if you've never hit with Sunder
if ( HeartDestroyed == 0 )
if ( CellChanged == 0 )
if ( GetSoundPlaying "heartSunder" == 0 )
PlayLoopSound3D "heartsunder"
endif
endif
endif
else
if ( CellChanged == 0 )
if ( GetSoundPlaying "heart" == 0 )
PlayLoopSound3D, "heart"
endif
endif
return
endif
if ( keeningHit == 0 )
elseif ( keening_axeHit == 0 )
elseif ( keening_lswordHit == 0 )
elseif ( keening_spearHit == 0 )
;only process rest of script when hit with keening
return
endif
;if player hit with Keening THIS FRAME, do all this stuff...
Set countHits to ( countHits + 1 )
if ( countHits == 0 )
if ( countSays != 0 )
Set countSays to 0
endif
return
endif
if ( countHits == 1 )
if ( countSays == 0 )
Say "vo\misc\Hit Heart 1.wav" "What are you doing?"
"dagoth_ur_2"->SetFight 100
"dagoth_ur_2"->StartCombat Player
Set countSays to 1
endif
PlayGroup Idle2
endif
if ( countHits == 2 )
if ( countSays == 1 )
Say "vo\misc\Hit Heart 2.wav" "WHAT ARE YOU DOING?!"
Set countSays to 2
endif
PlayGroup Idle3
endif
if ( countHits == 3 )
if ( countSays == 2 )
Say "vo\misc\Hit Heart 3.wav" "FOOL!"
Set countSays to 3
endif
PlayGroup Idle4
endif
if ( countHits == 4 )
if ( countSays == 3 )
Say "vo\misc\Hit Heart 4.wav" "STOP!"
Set countSays to 4
endif
PlayGroup Idle5
endif
if ( countHits > 4 )
if ( countSays == 4 )
Say "vo\misc\Hit Heart 6.wav" "This is the end. The bitter, bitter end."
Set countSays to 5
endif
if ( GetSoundPlaying "heart" == 1 )
StopSound "heart"
endif
if ( GetSoundPlaying "heartSunder" == 1 )
StopSound "heartSunder"
endif
PlayGroup Death1
set HeartDestroyed to 1
endif
End
Keening_axe/lsword/spear are the new IDs for the keening weapons.