Jump to content
Keitenai

Keitenai @resist command ( checking resistance values )

Recommended Posts

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 : [email protected]_command_V2.diff

Edited by Keitenai
  • Upvote 8
  • Love 3
  • MVP 1
Link to comment
Share on other sites

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

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

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

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

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

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

Enjoy guys!

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

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

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

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

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...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.