Jump to content

Keitenai @resist command ( checking resistance values )


Keitenai

Recommended Posts


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  98
  • Reputation:   74
  • Joined:  12/04/14
  • Last Seen:  

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!

@resist_image1.PNG.b640bb648d5e42a4e09d8996184ccb7a.PNG

@resist_image2.PNG.b19d9c2abcca148af6ef426d81f4d5d8.PNG

@resist_image3.PNG.5702b707bd49efc16a3db2937e4ab2a4.PNG

@resist_image4.PNG.a5e1c2ff05725cd582ba1cccd15d3792.PNG

@resist_image5.PNG.0aad431e4a67943cbde8c803b022c50c.PNG

Compatible with:  rAthena 97b5f3b ( as of July 31, 2022 )

Download : keitenai_@resist_command_V2.diff

Edited by Keitenai
  • Upvote 9
  • Love 4
  • MVP 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  99
  • Topics Per Day:  0.02
  • Content Count:  623
  • Reputation:   94
  • Joined:  05/11/12
  • Last Seen:  

Does this also check the resistances provided by consumables or equipment only?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  98
  • Reputation:   74
  • Joined:  12/04/14
  • Last Seen:  

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"

  • MVP 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  91
  • Topics Per Day:  0.02
  • Content Count:  325
  • Reputation:   34
  • Joined:  06/01/13
  • Last Seen:  

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 by Santafe
  • Upvote 1
Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  1
  • Reputation:   0
  • Joined:  10/13/12
  • Last Seen:  

Hi ;)

It works with Hercules?

Link to comment
Share on other sites

  • 2 years later...

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  91
  • Reputation:   17
  • Joined:  11/24/14
  • Last Seen:  

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

  • MVP 1
  • Like 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  171
  • Reputation:   68
  • Joined:  10/25/20
  • Last Seen:  

Thanks, working perfectly!

Edited by cook1e
Link to comment
Share on other sites

  • 2 months later...

  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  36
  • Reputation:   0
  • Joined:  07/04/13
  • Last Seen:  

Thanks for this, I was able to use this code to improve the existing @stats command! ?

Link to comment
Share on other sites

  • 2 months later...

  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  28
  • Reputation:   2
  • Joined:  01/06/14
  • Last Seen:  

hi is it posible to add demihuman resist like from thara card and magic resistance like from gtb card?

and how?

Edited by PaqnaN
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.01
  • Content Count:  148
  • Reputation:   21
  • Joined:  11/12/18
  • Last Seen:  

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 by Emistry
Codebox
  • Upvote 1
  • Love 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  28
  • Reputation:   2
  • Joined:  01/06/14
  • Last Seen:  

@Forshaken thank you

Link to comment
Share on other sites

  • 2 months later...

  • Group:  Members
  • Topic Count:  56
  • Topics Per Day:  0.01
  • Content Count:  224
  • Reputation:   4
  • Joined:  02/09/12
  • Last Seen:  

any update to latest git

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  100
  • Reputation:   16
  • Joined:  07/28/12
  • Last Seen:  

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),

 

  • Upvote 1
Link to comment
Share on other sites

  • 1 year later...

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  98
  • Reputation:   74
  • Joined:  12/04/14
  • Last Seen:  

I've uploaded a new and highly improved updated patch. ?

Enjoy guys!

  • Love 2
  • MVP 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   2
  • Joined:  08/02/17
  • Last Seen:  

23 hours ago, Keitenai said:

I've uploaded a new and highly improved updated patch. ?

Enjoy guys!

Thank you for this @Keitenai ❤️

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  150
  • Reputation:   70
  • Joined:  04/10/12
  • Last Seen:  

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 ?

 

LnEnLgs.jpeg

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  98
  • Reputation:   74
  • Joined:  12/04/14
  • Last Seen:  

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 ?

 

LnEnLgs.jpeg

 

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 ?

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  150
  • Reputation:   70
  • Joined:  04/10/12
  • Last Seen:  

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 ♥

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.03
  • Content Count:  640
  • Reputation:   82
  • Joined:  04/07/14
  • Last Seen:  

Thanks for this mate! Keep up the good work!

Link to comment
Share on other sites

  • 1 year later...

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.01
  • Content Count:  14
  • Reputation:   0
  • Joined:  12/02/22
  • Last Seen:  

Can i have the v1 diff? not using latest rathena 😞

Link to comment
Share on other sites

  • 3 months later...

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  14
  • Reputation:   0
  • Joined:  05/02/18
  • Last Seen:  

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!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...