Im not sure if that would work with COAS. I have yet to come across an item that increases the players stats that does not leave once the item is sold or no longer in the player's inventory.
below is the code for the jaguar image that increases the players heavy weapons skill by 10
Code:// itmname_indian12 {Èäîë Ìîðõàõòóëàêà} (+1 ôåõòîâàÃÂèå). skillN = skillN + SetCharacterSkillByItem(_refCharacter, skillName, SKILL_F_HEAVY, "indian12", 1)
Of course, once the jag is sold, the bonus is lost.
Additionally you'll need to add a check so that you can't do it again with the same book.
This could be done like this:Code:// -- IN A FUNCTION THAT IS RUN WHEN THE BOOK IS EQUIPPED -- // if(!CheckAttribute(pchar, "book_fencing") // If the player has NOT read the fencing book yet { pchar.skill.fencing = pchar.skill.fencing + 1; // Increase the player's fencing skill TakeItemFromCharacter(pchar, "book_fencing"); // Remove the book from the player's inventory pchar.book_fencing = true; // Mark the player as having read the book }
This of course would be ideal. I am just concerned that the code doesnt translate that easily from one game to the next. I will give it a shot once i get to coding.
(This brings up an interesting point...that 1=10 2=20 3=30. Therefor, the books would increase skill levels by 10 20 or 30. If the player had all the books for a skill, that would mean that the player would have a total of 70 points in that skill. That seems a bit high...I wonder if i could use non whole numbers...something to test later once i get to the coding portion)
Could this learning from books be implemented over a period of game time...not just buy the book & skill up instantly.Maybe a couple of game weeks to learn then pass the book onto an appropriate crew member.....that's more realistic.
This too is an excellent point. I think this would definetly require editing the source code. This may be a bit too much realism for the rest of the players.
In the meantime, I am going for a nap...2 hours from now and i start my nightshift
I will also be going to sleep shortly. Once I'm conscious and functional again I'll start experimenting with this (once I've finished reinstalling everything). I'll see what, if anything, I can make work going on what I know. I'm not expecting any results, but this whole idea has me intrigued.