[PLEVEL 1]
aim

[function is_hp_covered]
// argn = hitzone
doswitch <argn>
  return 0
  return <qval <link.findlayer.layer_helm> ? 1 : 0 >  
  return <qval <link.findlayer.layer_collar> ? 1 : 0 >  
  return <qval (<link.findlayer.layer_shirt> | <link.findlayer.layer_chest> | <link.findlayer.layer_tunic> | <link.findlayer.layer_robe> | <link.findlayer.layer_cape>) ? 1 : 0 >  
  return <qval (<link.findlayer.layer_shirt> | <link.findlayer.layer_chest> | <link.findlayer.layer_tunic> | <link.findlayer.layer_robe>) ? 1 : 0 >  
  return <qval (<link.findlayer.layer_arms> | <link.findlayer.layer_robe> | <link.findlayer.layer_cape>) ? 1 : 0 >  
  return <qval <link.findlayer.layer_gloves> ? 1 : 0 >  
  return <qval (<link.findlayer.LAYER_PANTS> | <link.findlayer.LAYER_SKIRT> | <link.findlayer.LAYER_HALF_APRON> | <link.findlayer.LAYER_ROBE> | <link.findlayer.LAYER_LEGS>) ? 1 : 0 >
  return <qval (<link.findlayer.layer_shoes> | <link.findlayer.layer_legs>) ? 1 : 0 >  
enddo
return 0

[function aim]
if <src.findid.i_aiming_mem>
  return 0
else
  serv.newitem i_aiming_mem
  src.equip <new.uid>
endif

[itemdef i_aiming_mem]
id=i_arrow
type=t_eq_script
name="aiming memory"
weight=0

on=@equip
  timer=10
  src.tag.HITPREFERENCE=
  target "aim at whom?"

on=@targon_char
  if (<src.targ.can> & mt_nonhum)
    src.sysmessage="there's nothing you could aim at"
    remove
    return 1
  else
    timer=10
    link=<src.targ.uid>
    dialog d_hitzone
  endif

on=@targon_ground
  src.sysmessage="there's nothing you could aim at"
  remove
  return 1

on=@targon_item
  src.sysmessage="there's nothing you could aim at"
  remove
  return 1

on=@targon_cancel
  remove
  return 1

on=@timer
  cont.tag.HITPREFERENCE=
  remove
  return 1

[DIALOG d_hitzone]
0,0
page 0
resizepic 0 0 2620 398 299
gumppic 105 0 12                // body
gumppic 213 59 <qval <is_hp_covered 1 > ? 40 : 41 >
gumppic 74 70 <qval <is_hp_covered 2 > ? 40 : 41 >
gumppic 44 109 <qval <is_hp_covered 6 > ? 40 : 41 >
gumppic 227 95 <qval <is_hp_covered 5 > ? 40 : 41 >
gumppic 198 119 <qval <is_hp_covered 4 > ? 40 : 41 >
gumppic 73 155 <qval <is_hp_covered 7 > ? 40 : 41 >
gumppic 217 207 <qval <is_hp_covered 8 > ? 40 : 41 >
Group 0
radio 314 53 208 209 0 1        // Head
radio 48 63 208 209 0 2         // Throat
radio 18 200 208 209 0 3        // Back
radio 301 113 208 209 0 4       // Chest
radio 330 88 208 209 0 5        // Arms
radio 19 102 208 209 0 6        // Hands
radio 48 148 208 209 0 7        // Legs
radio 318 200 208 209 0 8       // Feet
button 80 245 238 239 1 0 100   // Apply
button 231 246 241 242 1 0 0    // Cancel
dtext 111 18 50 Select Preferred Hit Area
dtext 43 200 <qval <is_hp_covered 3 > ? 37 : 5 > Back

[DIALOG d_hitzone button]
ON=0 // Cancel
  src.tag.HITPREFERENCE=

ON=100
  for n 1 8
    if <eval <argchk[<dlocal.n>]>>
      src.tag.HITPREFERENCE=<dlocal.n>
    endif
  endfor

[eof]
