mirabell Posted April 1, 2017 Group: Members Topic Count: 41 Topics Per Day: 0.01 Content Count: 197 Reputation: 19 Joined: 11/20/11 Last Seen: February 28 Share Posted April 1, 2017 I'm trying this but i don't see any difference in SP or HP recovery if(BaseLevel<=50) { bonus bMaxHPrate,100; bMaxSPrate,100;} Basically im trying to make a item that will recover lower levels hp and sp quickly till max level 50. I tried this and I tested the sp and hp recovery and it was the same no difference so maybe i did something wrong ?. Thank you Quote Link to comment Share on other sites More sharing options...
0 Bringer Posted April 1, 2017 Group: Members Topic Count: 162 Topics Per Day: 0.04 Content Count: 748 Reputation: 47 Joined: 03/12/14 Last Seen: April 16 Share Posted April 1, 2017 47 minutes ago, mirabell said: I'm trying this but i don't see any difference in SP or HP recovery if(BaseLevel<=50) { bonus bMaxHPrate,100; bMaxSPrate,100;} Basically im trying to make a item that will recover lower levels hp and sp quickly till max level 50. I tried this and I tested the sp and hp recovery and it was the same no difference so maybe i did something wrong ?. Thank you Description Maximum SP + 15% SP Recovery + 3% Item Script { bonus bMaxSPrate,15; bonus bSPrecovRate,3; },{},{} Quote Link to comment Share on other sites More sharing options...
0 Technoken Posted April 1, 2017 Group: Members Topic Count: 27 Topics Per Day: 0.01 Content Count: 505 Reputation: 127 Joined: 04/04/16 Last Seen: April 13 Share Posted April 1, 2017 bonus bMaxHPrate,100; bMaxSPrate,100; will increase the max HP and SP Try to look at https://github.com/rathena/rathena/blob/master/doc/item_bonus.txt#L152 You could use these bonuses depending of what you really want to achieve bonus bHPrecovRate,n; Natural HP recovery ratio + n% bonus bSPrecovRate,n; Natural SP recovery ratio + n% bonus2 bHPRegenRate,n,t; Gain n HP every t milliseconds bonus2 bSPRegenRate,n,t; Gain n SP every t milliseconds bonus2 bRegenPercentHP,n,t; Gain n% of max HP every t milliseconds bonus2 bRegenPercentSP,n,t; Gain n% of max SP every t milliseconds Quote Link to comment Share on other sites More sharing options...
0 mirabell Posted April 2, 2017 Group: Members Topic Count: 41 Topics Per Day: 0.01 Content Count: 197 Reputation: 19 Joined: 11/20/11 Last Seen: February 28 Author Share Posted April 2, 2017 (edited) what im trying to do is make a item that when you sit it regens your hp and sp fast but if you stand it stops i tried this: if ( Sitting == 1 ){ bonus2 bSPRegenRate,50,500; bonus2 bHPRegenRate,50,500; }; But it doesn't work unless equipped while sitting and when standing it doesnt detect it. I also tried to do it in call function function script sit_regen { if ( Sitting == 1 ){ bonus2 bSPRegenRate,50,500; bonus2 bHPRegenRate,50,500; } else { end; } return; } but didnt work either Edited April 2, 2017 by mirabell Quote Link to comment Share on other sites More sharing options...
0 Technoken Posted April 3, 2017 Group: Members Topic Count: 27 Topics Per Day: 0.01 Content Count: 505 Reputation: 127 Joined: 04/04/16 Last Seen: April 13 Share Posted April 3, 2017 IDK if there's a script that could check if character is sitting. Anyways try to add this to your source script.c /*========================================== * isSitting {<char_id>} * Checks if attached character is sitting *------------------------------------------*/ BUILDIN_FUNC(isSitting) { TBL_PC *sd; if (!script_charid2sd(2,sd)) return SCRIPT_CMD_FAILURE; if( pc_issit(sd) ) script_pushint(st,1); else script_pushint(st,0); return SCRIPT_CMD_SUCCESS; } BUILDIN_DEF(isSitting,"?"), Then try this item bonus if ( isSitting ){ bonus2 bSPRegenRate,50,500; bonus2 bHPRegenRate,50,500; }; Didn't test it though. Let me know if it's working or no. Quote Link to comment Share on other sites More sharing options...
0 mirabell Posted April 4, 2017 Group: Members Topic Count: 41 Topics Per Day: 0.01 Content Count: 197 Reputation: 19 Joined: 11/20/11 Last Seen: February 28 Author Share Posted April 4, 2017 ok thanks ill try it today Quote Link to comment Share on other sites More sharing options...
0 mirabell Posted April 4, 2017 Group: Members Topic Count: 41 Topics Per Day: 0.01 Content Count: 197 Reputation: 19 Joined: 11/20/11 Last Seen: February 28 Author Share Posted April 4, 2017 On 4/3/2017 at 1:52 AM, Technoken said: IDK if there's a script that could check if character is sitting. Anyways try to add this to your source script.c /*========================================== * isSitting {<char_id>} * Checks if attached character is sitting *------------------------------------------*/ BUILDIN_FUNC(isSitting) { TBL_PC *sd; if (!script_charid2sd(2,sd)) return SCRIPT_CMD_FAILURE; if( pc_issit(sd) ) script_pushint(st,1); else script_pushint(st,0); return SCRIPT_CMD_SUCCESS; } BUILDIN_DEF(isSitting,"?"), Then try this item bonus if ( isSitting ){ bonus2 bSPRegenRate,50,500; bonus2 bHPRegenRate,50,500; }; Didn't test it though. Let me know if it's working or no. It compiled with no error BUT mapserver errored when loading it to a item [Error]: script error on item_db2_re line 72 need '(' * 72 : if ( isSitting ')'{ bonus2 bSPRegenRate,50,500; bonus2 bHPRegenRate,50,500; }; Quote Link to comment Share on other sites More sharing options...
0 Technoken Posted April 4, 2017 Group: Members Topic Count: 27 Topics Per Day: 0.01 Content Count: 505 Reputation: 127 Joined: 04/04/16 Last Seen: April 13 Share Posted April 4, 2017 2 hours ago, mirabell said: It compiled with no error BUT mapserver errored when loading it to a item [Error]: script error on item_db2_re line 72 need '(' * 72 : if ( isSitting ')'{ bonus2 bSPRegenRate,50,500; bonus2 bHPRegenRate,50,500; }; Sorry it should be like this. if ( isSitting() ) { bonus2 bSPRegenRate,50,500; bonus2 bHPRegenRate,50,500; }; Quote Link to comment Share on other sites More sharing options...
0 mirabell Posted April 4, 2017 Group: Members Topic Count: 41 Topics Per Day: 0.01 Content Count: 197 Reputation: 19 Joined: 11/20/11 Last Seen: February 28 Author Share Posted April 4, 2017 (edited) 4 minutes ago, Technoken said: Sorry it should be like this. if ( isSitting() ) { bonus2 bSPRegenRate,50,500; bonus2 bHPRegenRate,50,500; }; thats odd i edit my post and said that i figure out it was if ( isSitting() ) { bonus2 bSPRegenRate,50,500; bonus2 bHPRegenRate,50,500; }; but i still have the same issue as when i did it with a call function. when the player equip the item it has no effect, but if you equip the item while sitting down it works BUT if you stand up the effect continues no matter if you sit or stand. I guess it didnt save Edited April 4, 2017 by mirabell forgot to add Quote Link to comment Share on other sites More sharing options...
0 Technoken Posted April 4, 2017 Group: Members Topic Count: 27 Topics Per Day: 0.01 Content Count: 505 Reputation: 127 Joined: 04/04/16 Last Seen: April 13 Share Posted April 4, 2017 Maybe try to use OnPCStatCalcEvent. Idk if OnPCStatCalcEvent is triggered when the player sits. Just try it. Like OnPCStatCalcEvent: if( isSitting ) { if( getequipisequiped(EQI_HEAD_TOP) ) if( getequipid(EQI_HEAD_TOP) == <ITEM ID> ) callfunc <function here>; } end; Quote Link to comment Share on other sites More sharing options...
0 mirabell Posted April 4, 2017 Group: Members Topic Count: 41 Topics Per Day: 0.01 Content Count: 197 Reputation: 19 Joined: 11/20/11 Last Seen: February 28 Author Share Posted April 4, 2017 (edited) 13 minutes ago, Technoken said: Maybe try to use OnPCStatCalcEvent. Idk if OnPCStatCalcEvent is triggered when the player sits. Just try it. Like OnPCStatCalcEvent: if( isSitting ) { if( getequipisequiped(EQI_HEAD_TOP) ) if( getequipid(EQI_HEAD_TOP) == <ITEM ID> ) callfunc <function here>; } end; didnt work, tho from what i am starting to understand, item_db script seems to only be checked once when equipped and only updates when an event happens like level up or job changes. I think that maybe issitting need to be able to refresh item db like leveling up, job change or anyways that itemdb script is checked and updated. Cause it seem to only do the effect when already sitting down and wont update at all afterward. Edited April 4, 2017 by mirabell Quote Link to comment Share on other sites More sharing options...
0 Technoken Posted April 4, 2017 Group: Members Topic Count: 27 Topics Per Day: 0.01 Content Count: 505 Reputation: 127 Joined: 04/04/16 Last Seen: April 13 Share Posted April 4, 2017 Maybe someone here can help you. I think it needs another src mod to make it work.. Quote Link to comment Share on other sites More sharing options...
0 mirabell Posted April 4, 2017 Group: Members Topic Count: 41 Topics Per Day: 0.01 Content Count: 197 Reputation: 19 Joined: 11/20/11 Last Seen: February 28 Author Share Posted April 4, 2017 thanks for trying to help me Quote Link to comment Share on other sites More sharing options...
Question
mirabell
I'm trying this but i don't see any difference in SP or HP recovery
if(BaseLevel<=50) { bonus bMaxHPrate,100; bMaxSPrate,100;}
Basically im trying to make a item that will recover lower levels hp and sp quickly till max level 50. I tried this and I tested the sp and hp recovery and it was the same no difference so maybe i did something wrong ?. Thank you
Link to comment
Share on other sites
12 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.