Gidz Cross Posted June 1, 2022 Posted June 1, 2022 Can any make a mod that will ignore Token of Siegfried on a specific maps? A mapflag would be nice. Quote
2 cook1e Posted June 1, 2022 Posted June 1, 2022 Try this. 1. go to src/map/map.hpp and find MF_MAX above add this MF_NOTOKEN, 2. go to src/map/script_constant.hpp and find export_constant(MF_SKILL_DURATION); below add this export_constant(MF_NOTOKEN); 3. go to src/map/pc.cpp and find bool pc_revive_item(struct map_session_data *sd) { nullpo_retr(false, sd); if (!pc_isdead(sd) || sd->respawn_tid != INVALID_TIMER) return false; if (sd->sc.data[SC_HELLPOWER]) // Cannot resurrect while under the effect of SC_HELLPOWER. return false; int16 item_position = itemdb_group_item_exists_pc(sd, IG_TOKEN_OF_SIEGFRIED); uint8 hp = 100, sp = 100; if (item_position < 0) { if (sd->sc.data[SC_LIGHT_OF_REGENE]) { hp = sd->sc.data[SC_LIGHT_OF_REGENE]->val2; sp = 0; } else return false; } if (!status_revive(&sd->bl, hp, sp)) return false; if (item_position < 0) status_change_end(&sd->bl, SC_LIGHT_OF_REGENE, INVALID_TIMER); else pc_delitem(sd, item_position, 1, 0, 1, LOG_TYPE_CONSUME); clif_skill_nodamage(&sd->bl, &sd->bl, ALL_RESURRECTION, 4, 1); return true; } and change to bool pc_revive_item(struct map_session_data *sd) { nullpo_retr(false, sd); int16 m = 0; struct map_data *mapdata = map_getmapdata(m); if (!pc_isdead(sd) || sd->respawn_tid != INVALID_TIMER) return false; if (sd->sc.data[SC_HELLPOWER]) // Cannot resurrect while under the effect of SC_HELLPOWER. return false; if(map_getmapflag(sd->bl.m, MF_NOTOKEN)) return false; int16 item_position = itemdb_group_item_exists_pc(sd, IG_TOKEN_OF_SIEGFRIED); uint8 hp = 100, sp = 100; if (item_position < 0) { if (sd->sc.data[SC_LIGHT_OF_REGENE]) { hp = sd->sc.data[SC_LIGHT_OF_REGENE]->val2; sp = 0; } else return false; } if (!status_revive(&sd->bl, hp, sp)) return false; if (item_position < 0) status_change_end(&sd->bl, SC_LIGHT_OF_REGENE, INVALID_TIMER); else pc_delitem(sd, item_position, 1, 0, 1, LOG_TYPE_CONSUME); clif_skill_nodamage(&sd->bl, &sd->bl, ALL_RESURRECTION, 4, 1); return true; } Not tested, let me know if it works. 1 1 Quote
0 Gidz Cross Posted June 1, 2022 Author Posted June 1, 2022 On 6/2/2022 at 2:09 AM, cook1e said: Try this. 1. go to src/map/map.hpp and find MF_MAX above add this MF_NOTOKEN, 2. go to src/map/script_constant.hpp and find export_constant(MF_SKILL_DURATION); below add this export_constant(MF_NOTOKEN); 3. go to src/map/pc.cpp and find bool pc_revive_item(struct map_session_data *sd) { nullpo_retr(false, sd); if (!pc_isdead(sd) || sd->respawn_tid != INVALID_TIMER) return false; if (sd->sc.data[SC_HELLPOWER]) // Cannot resurrect while under the effect of SC_HELLPOWER. return false; int16 item_position = itemdb_group_item_exists_pc(sd, IG_TOKEN_OF_SIEGFRIED); uint8 hp = 100, sp = 100; if (item_position < 0) { if (sd->sc.data[SC_LIGHT_OF_REGENE]) { hp = sd->sc.data[SC_LIGHT_OF_REGENE]->val2; sp = 0; } else return false; } if (!status_revive(&sd->bl, hp, sp)) return false; if (item_position < 0) status_change_end(&sd->bl, SC_LIGHT_OF_REGENE, INVALID_TIMER); else pc_delitem(sd, item_position, 1, 0, 1, LOG_TYPE_CONSUME); clif_skill_nodamage(&sd->bl, &sd->bl, ALL_RESURRECTION, 4, 1); return true; } and change to bool pc_revive_item(struct map_session_data *sd) { nullpo_retr(false, sd); int16 m = 0; struct map_data *mapdata = map_getmapdata(m); if (!pc_isdead(sd) || sd->respawn_tid != INVALID_TIMER) return false; if (sd->sc.data[SC_HELLPOWER]) // Cannot resurrect while under the effect of SC_HELLPOWER. return false; if(map_getmapflag(sd->bl.m, MF_NOTOKEN)) return false; int16 item_position = itemdb_group_item_exists_pc(sd, IG_TOKEN_OF_SIEGFRIED); uint8 hp = 100, sp = 100; if (item_position < 0) { if (sd->sc.data[SC_LIGHT_OF_REGENE]) { hp = sd->sc.data[SC_LIGHT_OF_REGENE]->val2; sp = 0; } else return false; } if (!status_revive(&sd->bl, hp, sp)) return false; if (item_position < 0) status_change_end(&sd->bl, SC_LIGHT_OF_REGENE, INVALID_TIMER); else pc_delitem(sd, item_position, 1, 0, 1, LOG_TYPE_CONSUME); clif_skill_nodamage(&sd->bl, &sd->bl, ALL_RESURRECTION, 4, 1); return true; } Not tested, let me know if it works. Works like charm. Thanks @cook1e! Heya @cook1e Ive discovered that i cannot use token of siegfried anywhere. I have set my prontera with mapflag. Im trying to use token of siegfried in other maps but it doesnt work anymore. Hehe! Quote
0 cook1e Posted June 20, 2022 Posted June 20, 2022 On 6/1/2022 at 3:19 PM, Gidz Cross said: Works like charm. Thanks @cook1e! Heya @cook1e Ive discovered that i cannot use token of siegfried anywhere. I have set my prontera with mapflag. Im trying to use token of siegfried in other maps but it doesnt work anymore. Hehe! I enabled the mapflag only in prontera and i can't use the token, but i can anywhere else. Everything is working as intended Quote
0 Gidz Cross Posted June 21, 2022 Author Posted June 21, 2022 (edited) 21 hours ago, cook1e said: I enabled the mapflag only in prontera and i can't use the token, but i can anywhere else. Everything is working as intended I have reverted back to once it was. Will try to rediff this mod again. But last time i checked. It doesnt work anywhere else when i have this diff. *EDIT yep. Still the same. If you have this diff. You cannot use token of siegfried anywhere else. *EDIT AGAIN It seems by putting { } fixes the problem. if(map_getmapflag(sd->bl.m, MF_NOTOKEN)) { return false; } Edited June 21, 2022 by Gidz Cross Solved Quote
Question
Gidz Cross
Can any make a mod that will ignore Token of Siegfried on a specific maps? A mapflag would be nice.
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.