Kovitikus

Untitled

Aug 9th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.91 KB | None | 0 0
  1. """MORE GENERIC VERSION - ATTRIBUTE CREATION DOESN'T WORK"""
  2.     # Check if the skillset is not already learned and if not, create it.
  3.     if not char.attributes.get(skillset):
  4.         #Check for general skill points required to learn.
  5.         if not gsp >= sp_cost:
  6.             char.msg('You do not have enough general skill points to learn this skillset.')
  7.             return
  8.         if skillset:
  9.             char.db.skillset = {'total_sp': sp_cost, 'total_ranks': 0}
  10.  
  11. """WORKING VERSION"""
  12.     # Check if the skillset is not already learned and if not, create it.
  13.     if not char.attributes.get(skillset):
  14.         #Check for general skill points required to learn.
  15.         if not gsp >= sp_cost:
  16.             char.msg('You do not have enough general skill points to learn this skillset.')
  17.             return
  18.         if skillset == 'staves':
  19.             char.db.staves = {'total_sp': sp_cost, 'total_ranks': 0}
Add Comment
Please, Sign In to add comment