1
0

npc_intro 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # npc_intro
  2. ! this procedure is designed for introduction of any npc either with standard or with custom description
  3. ! ARGS[0] is ID number of npc ... required parameter
  4. ! $ARGS[1] is an image path
  5. ! $ARGS[2] is a color name of the title e.g. 'red'
  6. ! $ARGS[3] is $npc_notes replacement
  7. ! $ARGS[4] is an additional text
  8. ! Format: gs npc_intro, ARGS[0], $ARGS[1], $ARGS[2], $ARGS[3], $ARGS[4]
  9. ! Example: gs npc_intro, 23, '', 'green', '', 'Optional text here' <=== This would display Albina''s picture using the path in # npcstatic1 with her name above it in green text followed by her default description and finally, your relationship level.
  10. !Credit goes to rachels for coming up with the concept and initial code!!!
  11. *clear
  12. numnpc = args[0]
  13. $static_num = 'A<<numnpc>>'
  14. if npc_rel[$static_num] < 20: $npc_cur_rel = 'You don''t get along at all with <<$npc_firstname[$static_num]>>.'
  15. if npc_rel[$static_num] >= 20 and $npc_rel[$static_num] < 40: $npc_cur_rel = 'You don''t get along very well with <<$npc_firstname[$static_num]>>.'
  16. if npc_rel[$static_num] >= 40 and $npc_rel[$static_num] < 60: $npc_cur_rel = 'You have a normal relationship with <<$npc_firstname[$static_num]>>.'
  17. if npc_rel[$static_num] >= 60 and $npc_rel[$static_num] < 80: $npc_cur_rel = 'You have a good relationship with <<$npc_firstname[$static_num]>>.'
  18. if npc_rel[$static_num] >= 80: $npc_cur_rel = 'You have a great relationship with <<$npc_firstname[$static_num]>>.'
  19. if $ARGS[1] = '':
  20. $image_path = $npc_pic[$static_num]
  21. else
  22. $image_path = $args[1]
  23. end
  24. if $args[2] = '':
  25. $titlecolor ='maroon'
  26. else
  27. $titlecolor = $args[2]
  28. end
  29. if $args[3] = '':
  30. $description = $npc_notes[$static_num]
  31. else
  32. $description = $args[3]
  33. end
  34. $apendix = $args[4]
  35. '<center><b><font color = <<$titlecolor>>><<$npc_firstname[$static_num]>> <<$npc_lastname[$static_num]>></font></b></center>' & *nl
  36. if $image_path ! '':'<center><img <<$set_imgh>> src="<<$image_path>>"></center>' & *nl
  37. if $description ! '' and $description ! ' ': $description + $npc_cur_rel
  38. if $apendix ! '' and $apendix ! ' ':$apendix
  39. killvar '$npc_cur_rel'
  40. killvar '$apendix'
  41. killvar '$description'
  42. killvar 'numnpc'
  43. killvar '$static_num'
  44. killvar '$image_path'
  45. --- npc_intro ---------------------------------