12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- # castSpell
- ! Used to cast a spell. Use as a function. Returns 1 OR 0 for Success or Failure.
- !
- ! ARGS[0] is the spell being cast
- ! Valid Spells are
- ! teleport
- !teleport
- spellMana['teleport'] = 1000
- spellTime['teleport'] = 20
- spellWill['teleport'] = 20
- spellDiff['teleport'] = 20
- !glamour
- spellMana['glamour'] = 500
- spellTime['glamour'] = 1
- spellWill['glamour'] = 15
- spellDiff['glamour'] = 30
- spellSuccess = 0
- if spellKnown[$ARGS[0]] = 1:
- !Make a Skill Check to see if the Spell succeeds
- spellRoll = pcs_splcstng - spellDiff[$ARGS[0]] - (pcs_horny/5) + rand(1,100)
- if spellRoll > 50:
- !Critical Success
- spellSuccess = 2
- splcstng_exp += rand(1,spellDiff[$ARGS[0]]) + rand(0,5)
- elseif spellRoll > 10:
- !Success
- spellSuccess = 1
- splcstng_exp += rand(1,spellDiff[$ARGS[0]])
- elseif spellRoll > -20:
- !Failure
- spellSuccess = 0
- splcstng_exp += rand(1,spellDiff[$ARGS[0]]) / 2
- else:
- !Critical Failure
- spellSuccess = -1
- splcstng_exp += rand(1,spellDiff[$ARGS[0]]) / 2
- end
- killvar 'spellRoll'
- !Incur the costs of casting the spell
- if spellSuccess = 2:
- manaCost = spellMana[$ARGS[0]] / 2
- elseif spellSuccess = -1:
- manaCost = spellMana[$ARGS[0]] * 2
- else:
- manaCost = spellMana[$ARGS[0]]
- end
- pcs_manna -= manaCost
- !pcs_willpwr -= spellWill[$ARGS[0]]
- arouseVal = manaCost / 50
- gs 'arousal', 'voyeur', arouseVal
- minut -= arouseVal
- killvar 'arouseVal'
- killvar 'manaCost'
- end
- minut += spellTime[$ARGS[0]]
- gs 'stat'
- result = spellSuccess
- --- castSpell ---------------------------------
|