Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 27 additions & 25 deletions scripts/monsters/cobra.script
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
// - Also added a few more HP
// - Figure doesnt attack unless attacked first, so midas well be a bit meaner
{
const SOUND_PAIN monsters/spider/spiderhiss.wav
const SND_STRUCK4 SOUND_PAIN
const SND_STRUCK5 SOUND_PAIN
setvar SOUND_ATTACK1 monsters/spider/spiderhiss.wav
setvar SOUND_ATTACK2 monsters/spider/spiderhiss.wav
const SOUND_DEATH monsters/troll/trolldeath.wav
setvar SOUND_WALK monsters/troll/trollidle.wav
const SOUND_ALERT monsters/gsnake_idle1.wav
const SOUND_IDLE monsters/gsnake_idle1.wav
const SOUND_ATTACK bullchicken/bc_bite2.wav
const SOUND_STRUCK debris/flesh3.wav
const SOUND_PAIN1 agrunt/ag_attack3.wav
const SOUND_PAIN2 agrunt/ag_idle2.wav
const SOUND_DEATH agrunt/ag_die2.wav
setvar ATTACK_HITCHANCE 95%
setvar ANIM_RUN walk
setvar ANIM_IDLE idle1
Expand Down Expand Up @@ -43,32 +43,34 @@
setmoveanim idle1
playanim once idle1
hearingsensitivity 5
callevent npcatk_suspend_ai
}

{ attack1

dodamage ENTITY_ENEMY ATTACK_RANGE ATTACK1_DAMAGE 75%

if( $rand(1,3) == 1 ) applyeffect ent_lastseen effects/dot_poison 15 $get(ent_me,id) DMG_POISON
if( $rand(1,3) == 1 ) applyeffect ent_lastseen effects/dot_poison 15 $get(ent_me,id) DMG_POISON

playsound 0 10 SOUND_ATTACK
}

{ game_heardsound
if SUSPEND_AI
if $get(ent_lastheard,isplayer)
setmovedest $get(ent_lastheard,id) 9999
if ( $rand(1,10) == 1 ) playanim once idle3
else playanim once idle1
{ game_struck

playrandomsound 0 10 SOUND_PAIN1 SOUND_PAIN2 SOUND_STRUCK SOUND_STRUCK SOUND_ATTACK
}

{ game_struck
{ npcatk_targetvalidate

if $get(PARAM1,isalive)
if $get(PARAM1,relationship,ent_me) equals enemy

if !DID_ALERT
playsound 0 10 SOUND_ALERT
setvard DID_ALERT 1
}

{ idle_sounds

if ( SUSPEND_AI )
{
callevent npcatk_resume_ai
setmoveanim ANIM_RUN
roam 1
}
volume 5
playrandomsound 2 SOUND_PAIN SOUND_PAIN SOUND_STRUCK2 SOUND_STRUCK1 SOUND_STRUCK3
playsound 0 10 SOUND_IDLE
callevent $randf(5,10) idle_sounds
}