npc.qsrc 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # npc
  2. if $ARGS[0] = 'age':
  3. currnpc_year = mid(npc_dob[$ARGS[1]], 1, 4)
  4. currnpc_month = mid(npc_dob[$ARGS[1]], 5, 2)
  5. currnpc_day = mid(npc_dob[$ARGS[1]], 7, 2)
  6. currnpc_age = year - currnpc_year
  7. if currnpc_month < month:
  8. currnpc_age -= 1
  9. elseif currnpc_month = month and currnpc_day < day:
  10. currnpc_age -= 1
  11. end
  12. RESULT = currnpc_age
  13. killvar 'currnpc_year'
  14. killvar 'currnpc_month'
  15. killvar 'currnpc_day'
  16. killvar 'currnpc_age'
  17. end
  18. if $ARGS[0] = 'intro':
  19. !! this procedure is designed for introduction of any npc either with standard or with custom description
  20. !! $ARGS[1] is ID number of npc... required parameter
  21. !! $ARGS[2] is an image path
  22. !! $ARGS[3] is a color name of the title e.g. 'red'
  23. !! $ARGS[4] is $npc_notes replacement
  24. !! $ARGS[5] is an additional text
  25. !! ARGS[6] sets image path to video output - 0 = off - 1 = on
  26. !! Format: gs 'npc' 'intro', ARGS[1], $ARGS[2], $ARGS[3], $ARGS[4], $ARGS[5]
  27. !! Example: gs 'npc' 'intro', 'A23', '', '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.
  28. !! Credit goes to rachels for coming up with the concept and initial code!!!
  29. *clear
  30. $static_num = $ARGS[1]
  31. if npc_rel[$static_num] < 20: $npc_cur_rel = 'You don''t get along at all with <<$npc_firstname[$static_num]>>.'
  32. 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]>>.'
  33. 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]>>.'
  34. 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]>>.'
  35. if npc_rel[$static_num] >= 80: $npc_cur_rel = 'You have a great relationship with <<$npc_firstname[$static_num]>>.'
  36. if $ARGS[2] = '':
  37. $image_path = $npc_pic[$static_num]
  38. else
  39. $image_path = $ARGS[2]
  40. end
  41. if $ARGS[3] = '':
  42. $titlecolor ='maroon'
  43. else
  44. $titlecolor = $ARGS[3]
  45. end
  46. if $ARGS[4] = '':
  47. $description = $npc_notes[$static_num]
  48. else
  49. $description = $ARGS[4]
  50. end
  51. $apendix = $ARGS[5]
  52. '<center><b><font color = <<$titlecolor>>><<$npc_firstname[$static_num]>> <<$npc_lastname[$static_num]>></font></b></center>' & *nl
  53. if $image_path ! '':
  54. if ARGS[6] = 0:
  55. '<center><img <<$set_imgh>> src="<<$image_path>>"></center>' & *nl
  56. else
  57. '<center><video autoplay loop src="<<$image_path>>"></video></center>' & *nl
  58. end
  59. end
  60. if $description ! '' and $description ! ' ': $description + $npc_cur_rel
  61. if $apendix ! '' and $apendix ! ' ':$apendix
  62. killvar '$npc_cur_rel'
  63. killvar '$apendix'
  64. killvar '$description'
  65. killvar '$image_path'
  66. end
  67. --- npc ---------------------------------