Stolao Posted January 30, 2015 Group: Developer Topic Count: 48 Topics Per Day: 0.01 Content Count: 1443 Reputation: 344 Joined: 10/17/12 Last Seen: Sunday at 01:58 PM Share 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 Link to comment Share on other sites More sharing options...
Jey Posted April 24, 2015 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 249 Reputation: 73 Joined: 10/20/12 Last Seen: August 16, 2018 Share 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 Link to comment Share on other sites More sharing options...
Stolao Posted February 20, 2015 Group: Developer Topic Count: 48 Topics Per Day: 0.01 Content Count: 1443 Reputation: 344 Joined: 10/17/12 Last Seen: Sunday at 01:58 PM Author Share Posted February 20, 2015 quick bump Quote Link to comment Share on other sites More sharing options...
Stolao Posted April 24, 2015 Group: Developer Topic Count: 48 Topics Per Day: 0.01 Content Count: 1443 Reputation: 344 Joined: 10/17/12 Last Seen: Sunday at 01:58 PM Author Share 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 Link to comment Share on other sites More sharing options...
Stolao Posted May 7, 2015 Group: Developer Topic Count: 48 Topics Per Day: 0.01 Content Count: 1443 Reputation: 344 Joined: 10/17/12 Last Seen: Sunday at 01:58 PM Author Share 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 Link to comment Share on other sites More sharing options...
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?
Link to comment
Share on other sites
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.