Keitenai Posted December 1, 2017 Share Posted December 1, 2017 (edited) File Name: [email protected] File Submitter: keitenai File Submitted: 1 Dec 2017 File Category: Src Modification Content Author: keitenai Updated: 31 July 2022 Information: @ resist will check the current values of resistance from each Element / Race / Size / Class. Thanks to @Santafe for the idea of this command. 1. Download the Diff file. 2. Patch the diff to your rAthena 3. Recompile your server. 4. RUN THE SERVER! Compatible with: rAthena 97b5f3b ( as of July 31, 2022 ) Download : [email protected]_command_V2.diff Edited July 31 by Keitenai 8 3 1 Quote Link to comment Share on other sites More sharing options...
Kakaroto Posted December 1, 2017 Share Posted December 1, 2017 Does this also check the resistances provided by consumables or equipment only? Quote Link to comment Share on other sites More sharing options...
Keitenai Posted December 1, 2017 Author Share Posted December 1, 2017 Just now, Kakaroto said: Does this also check the resistances provided by consumables or equipment only? it does check resistance from consumable like "Undead Elemental Scroll" 1 Quote Link to comment Share on other sites More sharing options...
Santafe Posted December 2, 2017 Share Posted December 2, 2017 (edited) On 12/1/2017 at 9:05 PM, Keitenai said: it does check resistance from consumable like "Undead Elemental Scroll" Made it work for my 2013 client, heres the src edit i did to ur src diff : /*========================================= * Check values of resistance to elements * [ Keitenai ] *-----------------------------------------*/ ACMD_FUNC(resist) { char output[CHAT_SIZE_MAX]; int i; struct { const char* format; int value; } output_table[] = { { " [ %d ] Neutral resist", 0 }, { " [ %d ] Water resist", 0 }, { " [ %d ] Earth resist", 0 }, { " [ %d ] Fire resist", 0 }, { " [ %d ] Wind resist", 0 }, { " [ %d ] Poison resist", 0 }, { " [ %d ] Holy resist", 0 }, { " [ %d ] Dark resist", 0 }, { " [ %d ] Ghost resist", 0 }, { " [ %d ] Undead resist", 0 }, { NULL, 0 } }; memset(output, '\0', sizeof(output)); clif_displaymessage(sd->fd, "========= Resistance Values ========="); output_table[0].value = sd->subele[ELE_NEUTRAL]; output_table[1].value = sd->subele[ELE_WATER]; output_table[2].value = sd->subele[ELE_EARTH]; output_table[3].value = sd->subele[ELE_FIRE]; output_table[4].value = sd->subele[ELE_WIND]; output_table[5].value = sd->subele[ELE_POISON]; output_table[6].value = sd->subele[ELE_HOLY]; output_table[7].value = sd->subele[ELE_DARK]; output_table[8].value = sd->subele[ELE_GHOST]; output_table[9].value = sd->subele[ELE_UNDEAD]; for (i = 0; output_table[i].format != NULL; i++) { sprintf(output, output_table[i].format, output_table[i].value); clif_displaymessage(fd, output); } return 0; } Note: ELE_ALL isnt required, tested on :Nydhrogg's garb; it auto assigns +7 to all the eles besides that, subele(ELE_ALL) isnt present in the 2013 version Edited December 2, 2017 by Santafe 1 Quote Link to comment Share on other sites More sharing options...
lifh Posted January 18, 2018 Share Posted January 18, 2018 Hi It works with Hercules? Quote Link to comment Share on other sites More sharing options...
JinYuichi Posted October 20, 2020 Share Posted October 20, 2020 I made some small modifications, to make it work with the new rathena, credits to the owner of the Keitenai code.. Date compatible: rAthena Oct 19, 2020 @resist.diff 1 Quote Link to comment Share on other sites More sharing options...
cook1e Posted October 26, 2020 Share Posted October 26, 2020 (edited) Thanks, working perfectly! Edited October 27, 2020 by cook1e Quote Link to comment Share on other sites More sharing options...
behelit Posted January 5, 2021 Share Posted January 5, 2021 Thanks for this, I was able to use this code to improve the existing @stats command! Quote Link to comment Share on other sites More sharing options...
PaqnaN Posted April 2, 2021 Share Posted April 2, 2021 (edited) hi is it posible to add demihuman resist like from thara card and magic resistance like from gtb card? and how? Edited April 2, 2021 by PaqnaN Quote Link to comment Share on other sites More sharing options...
Forshaken Posted April 2, 2021 Share Posted April 2, 2021 (edited) On 4/2/2021 at 9:55 PM, PaqnaN said: hi is it posible to add demihuman resist like from thara card and magic resistance like from gtb card? and how? yes. ACMD_FUNC(resist) { char output[CHAT_SIZE_MAX]; int i; struct { const char* format; int value; } output_table[] = { { " [ %d ] Neutral Resist", 0 }, { " [ %d ] Water Resist", 0 }, { " [ %d ] Earth Resist", 0 }, { " [ %d ] Fire Resist", 0 }, { " [ %d ] Wind Resist", 0 }, { " [ %d ] Poison Resist", 0 }, { " [ %d ] Holy Resist", 0 }, { " [ %d ] Dark Resist", 0 }, { " [ %d ] Ghost Resist", 0 }, { " [ %d ] Undead Resist", 0 }, ++ { " [ %d ] Long Range Resistance", 0 }, ++ { " [ %d ] Magic Resistance", 0 }, ++ { " [ %d ] Demi-Human Resist", 0 }, { NULL, 0 } }; memset(output, '\0', sizeof(output)); clif_displaymessage(sd->fd, "========= Resistance Values (in percentage) ========="); output_table[0].value = (sd->indexed_bonus.subele[ELE_NEUTRAL] + sd->indexed_bonus.subele_script[ELE_NEUTRAL] + sd->indexed_bonus.subele[ELE_ALL] + sd->indexed_bonus.subele_script[ELE_ALL]); output_table[1].value = (sd->indexed_bonus.subele[ELE_WATER] + sd->indexed_bonus.subele_script[ELE_WATER] + sd->indexed_bonus.subele[ELE_ALL] + sd->indexed_bonus.subele_script[ELE_ALL]); output_table[2].value = (sd->indexed_bonus.subele[ELE_EARTH] + sd->indexed_bonus.subele_script[ELE_EARTH] + sd->indexed_bonus.subele[ELE_ALL] + sd->indexed_bonus.subele_script[ELE_ALL]); output_table[3].value = (sd->indexed_bonus.subele[ELE_FIRE] + sd->indexed_bonus.subele_script[ELE_FIRE] + sd->indexed_bonus.subele[ELE_ALL] + sd->indexed_bonus.subele_script[ELE_ALL]); output_table[4].value = (sd->indexed_bonus.subele[ELE_WIND] + sd->indexed_bonus.subele_script[ELE_WIND]) + sd->indexed_bonus.subele[ELE_ALL] + sd->indexed_bonus.subele_script[ELE_ALL]; output_table[5].value = (sd->indexed_bonus.subele[ELE_POISON] + sd->indexed_bonus.subele_script[ELE_POISON] + sd->indexed_bonus.subele[ELE_ALL] + sd->indexed_bonus.subele_script[ELE_ALL]); output_table[6].value = (sd->indexed_bonus.subele[ELE_HOLY] + sd->indexed_bonus.subele_script[ELE_HOLY] + sd->indexed_bonus.subele[ELE_ALL] + sd->indexed_bonus.subele_script[ELE_ALL]); output_table[7].value = (sd->indexed_bonus.subele[ELE_DARK] + sd->indexed_bonus.subele_script[ELE_DARK] + sd->indexed_bonus.subele[ELE_ALL] + sd->indexed_bonus.subele_script[ELE_ALL]); output_table[8].value = (sd->indexed_bonus.subele[ELE_GHOST] + sd->indexed_bonus.subele_script[ELE_GHOST] + sd->indexed_bonus.subele[ELE_ALL] + sd->indexed_bonus.subele_script[ELE_ALL]); output_table[9].value = (sd->indexed_bonus.subele[ELE_UNDEAD] + sd->indexed_bonus.subele_script[ELE_UNDEAD] + sd->indexed_bonus.subele[ELE_ALL] + sd->indexed_bonus.subele_script[ELE_ALL]); ++ output_table[10].value = (sd->bonus.long_attack_def_rate); ++ output_table[11].value = (sd->special_state.no_magic_damage + sd->bonus.magic_def_rate); ++ output_table[12].value = (sd->subrace[RC_DEMIHUMAN]); for (i = 0; output_table.format != NULL; i++) { sprintf(output, output_table.format, output_table.value); clif_displaymessage(fd, output); } return 0; } Edited April 10, 2021 by Emistry Codebox 1 1 Quote Link to comment Share on other sites More sharing options...
PaqnaN Posted April 3, 2021 Share Posted April 3, 2021 @Forshaken thank you Quote Link to comment Share on other sites More sharing options...
simplexjay2 Posted June 3, 2021 Share Posted June 3, 2021 any update to latest git Quote Link to comment Share on other sites More sharing options...
Angeluz Posted June 4, 2021 Share Posted June 4, 2021 On 6/3/2021 at 3:56 PM, simplexjay2 said: any update to latest git I use this /*========================================= * Check values of resistance to elements * [ Keitenai ] * Adjustments by [ DietmarRuiz ] *-----------------------------------------*/ ACMD_FUNC(resist) { char output[CHAT_SIZE_MAX]; int i; struct { const char* format; int value; } output_table[] = { { " [ %d ] Neutral resist", 0 }, { " [ %d ] Water resist", 0 }, { " [ %d ] Earth resist", 0 }, { " [ %d ] Fire resist", 0 }, { " [ %d ] Wind resist", 0 }, { " [ %d ] Poison resist", 0 }, { " [ %d ] Holy resist", 0 }, { " [ %d ] Dark resist", 0 }, { " [ %d ] Ghost resist", 0 }, { " [ %d ] Undead resist", 0 }, // { " [ %d ] Resist to all", 0 }, { " [ %d ] Long Range Resistance", 0 }, { " [ %d ] Magic Resistance", 0 }, { " [ %d ] Demi-Human Resist", 0 }, { NULL, 0 } }; memset(output, '\0', sizeof(output)); clif_displaymessage(sd->fd, "========= Resistance Values ========="); output_table[0].value = (sd->indexed_bonus.subele[ELE_NEUTRAL] + sd->indexed_bonus.subele_script[ELE_NEUTRAL] + sd->indexed_bonus.subele[ELE_ALL] + sd->indexed_bonus.subele_script[ELE_ALL]); output_table[1].value = (sd->indexed_bonus.subele[ELE_WATER] + sd->indexed_bonus.subele_script[ELE_WATER] + sd->indexed_bonus.subele[ELE_ALL] + sd->indexed_bonus.subele_script[ELE_ALL]); output_table[2].value = (sd->indexed_bonus.subele[ELE_EARTH] + sd->indexed_bonus.subele_script[ELE_EARTH] + sd->indexed_bonus.subele[ELE_ALL] + sd->indexed_bonus.subele_script[ELE_ALL]); output_table[3].value = (sd->indexed_bonus.subele[ELE_FIRE] + sd->indexed_bonus.subele_script[ELE_FIRE] + sd->indexed_bonus.subele[ELE_ALL] + sd->indexed_bonus.subele_script[ELE_ALL]); output_table[4].value = (sd->indexed_bonus.subele[ELE_WIND] + sd->indexed_bonus.subele_script[ELE_WIND]) + sd->indexed_bonus.subele[ELE_ALL] + sd->indexed_bonus.subele_script[ELE_ALL]; output_table[5].value = (sd->indexed_bonus.subele[ELE_POISON] + sd->indexed_bonus.subele_script[ELE_POISON] + sd->indexed_bonus.subele[ELE_ALL] + sd->indexed_bonus.subele_script[ELE_ALL]); output_table[6].value = (sd->indexed_bonus.subele[ELE_HOLY] + sd->indexed_bonus.subele_script[ELE_HOLY] + sd->indexed_bonus.subele[ELE_ALL] + sd->indexed_bonus.subele_script[ELE_ALL]); output_table[7].value = (sd->indexed_bonus.subele[ELE_DARK] + sd->indexed_bonus.subele_script[ELE_DARK] + sd->indexed_bonus.subele[ELE_ALL] + sd->indexed_bonus.subele_script[ELE_ALL]); output_table[8].value = (sd->indexed_bonus.subele[ELE_GHOST] + sd->indexed_bonus.subele_script[ELE_GHOST] + sd->indexed_bonus.subele[ELE_ALL] + sd->indexed_bonus.subele_script[ELE_ALL]); output_table[9].value = (sd->indexed_bonus.subele[ELE_UNDEAD] + sd->indexed_bonus.subele_script[ELE_UNDEAD] + sd->indexed_bonus.subele[ELE_ALL] + sd->indexed_bonus.subele_script[ELE_ALL]); // output_table[10].value = (sd->subele[ELE_ALL] + sd->subele_script[ELE_ALL]); output_table[10].value = (sd->bonus.long_attack_def_rate); output_table[11].value = (sd->special_state.no_magic_damage + sd->bonus.magic_def_rate); output_table[12].value = (sd->indexed_bonus.subrace[RC_PLAYER_HUMAN]); for (i = 0; output_table[i].format != NULL; i++) { sprintf(output, output_table[i].format, output_table[i].value); clif_displaymessage(fd, output); } return 0; } ACMD_DEF(resist), 1 Quote Link to comment Share on other sites More sharing options...
Keitenai Posted July 31 Author Share Posted July 31 I've uploaded a new and highly improved updated patch. Enjoy guys! 1 1 Quote Link to comment Share on other sites More sharing options...
walter307 Posted August 1 Share Posted August 1 23 hours ago, Keitenai said: I've uploaded a new and highly improved updated patch. Enjoy guys! Thank you for this @Keitenai Quote Link to comment Share on other sites More sharing options...
sapitosucio Posted August 2 Share Posted August 2 Simple but amazing concept, I have always been troubled with keeping up with resistences I've got by items or cards. I actually went trough the diff file and pasted all the code on the /src/custom folder I learnt about with your Delay System and it works all gucci I did some testing and I just noticed one thing. The Strong Shield [1] gives you endure-like effect but every source of dmg I receive is amplified 20%, I put a Thara Frog Card on it, which as we all know, it give us 30% resistance against demi-human, in theory I should have 10% demi-human resistence, after the -20% of resistance the Strong Shield takes away from me. But the command is returning me off values. or not ? Quote Link to comment Share on other sites More sharing options...
Keitenai Posted August 2 Author Share Posted August 2 14 minutes ago, sapitosucio said: Simple but amazing concept, I have always been troubled with keeping up with resistences I've got by items or cards. I actually went trough the diff file and pasted all the code on the /src/custom folder I learnt about with your Delay System and it works all gucci I did some testing and I just noticed one thing. The Strong Shield [1] gives you endure-like effect but every source of dmg I receive is amplified 20%, I put a Thara Frog Card on it, which as we all know, it give us 30% resistance against demi-human, in theory I should have 10% demi-human resistence, after the -20% of resistance the Strong Shield takes away from me. But the command is returning me off values. or not ? Strong Shield gives -20 from Elements while thara frog card gives +30 resistance from Race These are 2 different types, and you can see that very clearly using @resist Quote Link to comment Share on other sites More sharing options...
sapitosucio Posted August 2 Share Posted August 2 6 minutes ago, Keitenai said: Strong Shield gives -20 from Elements while thara frog card gives +30 resistance from Race These are 2 different types, and you can see that very clearly using @resist Now I feel dumb, you're so right XD, Thank you Keinetai ♥ Quote Link to comment Share on other sites More sharing options...
Gidz Cross Posted August 2 Share Posted August 2 Thanks for this mate! Keep up the good work! Quote Link to comment Share on other sites More sharing options...