Stolao Posted January 30, 2015 Posted January 30, 2015 I'm trying to adjust a characters fame from in game, i can access and view fame though readparam(59) however i cannot seem to set it.can anyone assist me? Quote
Jey Posted April 24, 2015 Posted April 24, 2015 (edited) script_commands.txt While these behave as variables, do not always expect to just set them - it is not certain whether this will work for all of them. Whenever there is a command or a function to set something, it's usually preferable to use that instead. The notable exception is Zeny, which you can and often will address directly - setting it will make the character own this number of Zeny. If you already tested it, there seems to be no script driven solution.So you should look for an example of raising fame in the src. Example for pharmacy_10 in src/map/skill.c: case 10: fame += battle_config.fame_pharmacy_10; // Success to prepare 10 Condensed Potions in a row //[...] if (fame) pc_addfame(sd,fame); The needed function is pc_addfame. Now you can simply create a script function like this:Add to src/custom/script.inc: /// Increases fame of the attached character /// /// addfame <fame points>; BUILDIN_FUNC(addfame) { int fame; struct map_session_data *sd = script_rid2sd(st); nullpo_retr(1, sd); //Player must be attached fame = script_getnum(st,2); if( fame < 0 ) { ShowError("addfame: Fame must be positive. (Fame=%d).\n", fame); return 1; } pc_addfame(sd,fame); return SCRIPT_CMD_SUCCESS; } Add to src/custom/script_def.inc: BUILDIN_DEF(addfame,"i"), Keep in mind that every job will get the fame points. Even if it's a High Wizard. Edited April 24, 2015 by Jey Quote
Stolao Posted April 24, 2015 Author Posted April 24, 2015 was going to re-post this question but noticed its still active sooooo necro-bump but seriously how the hell can i change this Ive tried an SQL query and tried changing it though set and such i can load it with readparam(59) but setting seems to elude me any thoughts? Quote
Stolao Posted May 7, 2015 Author Posted May 7, 2015 script_commands.txt While these behave as variables, do not always expect to just set them - it is not certain whether this will work for all of them. Whenever there is a command or a function to set something, it's usually preferable to use that instead. The notable exception is Zeny, which you can and often will address directly - setting it will make the character own this number of Zeny. If you already tested it, there seems to be no script driven solution.So you should look for an example of raising fame in the src. Example for pharmacy_10 in src/map/skill.c: case 10: fame += battle_config.fame_pharmacy_10; // Success to prepare 10 Condensed Potions in a row //[...] if (fame) pc_addfame(sd,fame); The needed function is pc_addfame. Now you can simply create a script function like this:Add to src/custom/script.inc: /// Increases fame of the attached character /// /// addfame <fame points>; BUILDIN_FUNC(addfame) { int fame; struct map_session_data *sd = script_rid2sd(st); nullpo_retr(1, sd); //Player must be attached fame = script_getnum(st,2); if( fame < 0 ) { ShowError("addfame: Fame must be positive. (Fame=%d).\n", fame); return 1; } pc_addfame(sd,fame); return SCRIPT_CMD_SUCCESS; } Add to src/custom/script_def.inc: BUILDIN_DEF(addfame,"i"), Keep in mind that every job will get the fame points. Even if it's a High Wizard. ty I removed the negative check for more functionality Quote
Question
Stolao
I'm trying to adjust a characters fame from in game, i can access and view fame though readparam(59) however i cannot seem to set it.
can anyone assist me?
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.