Keitenai Posted December 1, 2017 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 : keitenai_@resist_command_V2.diff Edited July 31, 2022 by Keitenai 9 4 1 Quote
Kakaroto Posted December 1, 2017 Posted December 1, 2017 Does this also check the resistances provided by consumables or equipment only? Quote
Keitenai Posted December 1, 2017 Author 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
Santafe Posted December 2, 2017 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
JinYuichi Posted October 20, 2020 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 1 Quote
cook1e Posted October 26, 2020 Posted October 26, 2020 (edited) Thanks, working perfectly! Edited October 27, 2020 by cook1e Quote
behelit Posted January 5, 2021 Posted January 5, 2021 Thanks for this, I was able to use this code to improve the existing @stats command! Quote
PaqnaN Posted April 2, 2021 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
Forshaken Posted April 2, 2021 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
Angeluz Posted June 4, 2021 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
Keitenai Posted July 31, 2022 Author Posted July 31, 2022 I've uploaded a new and highly improved updated patch. Enjoy guys! 2 1 Quote
walter307 Posted August 1, 2022 Posted August 1, 2022 23 hours ago, Keitenai said: I've uploaded a new and highly improved updated patch. Enjoy guys! Thank you for this @Keitenai Quote
Sapito Sucio Posted August 2, 2022 Posted August 2, 2022 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
Keitenai Posted August 2, 2022 Author Posted August 2, 2022 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
Sapito Sucio Posted August 2, 2022 Posted August 2, 2022 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
Gidz Cross Posted August 2, 2022 Posted August 2, 2022 Thanks for this mate! Keep up the good work! Quote
xeijvro Posted November 28, 2023 Posted November 28, 2023 Can i have the v1 diff? not using latest rathena Quote
aspd197 Posted March 1, 2024 Posted March 1, 2024 On 12/1/2017 at 7:45 PM, Keitenai said: 2. Patch the diff to your rAthena I don't understand about this part. All I know is patching client using WARP tool (I don't know if it's the same thing or not). Already read this https://github.com/rathena/rathena/wiki/diff but I still don't understand (sorry). Should I simply copy the codes & paste it to atcommand.cpp ? or is there any related post that I can read about this? thanks in advance! Quote
dantoki Posted 14 hours ago Posted 14 hours ago @Keitenai does this handle like the asprika item resist to all but for short weapons Quote
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.