Jump to content

Keitenai @resist command ( checking resistance values )


Recommended Posts

Posted (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!

@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
Posted
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
Posted (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 by Santafe
  • Upvote 1
  • 1 month later...
  • 2 years later...
  • 2 months later...
  • 2 months later...
Posted (edited)

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

and how?

Edited by PaqnaN
Posted (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 by Emistry
Codebox
  • Upvote 1
  • Love 1
  • 2 months later...
Posted
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
  • 1 year later...
Posted

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

Posted
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 ?

 

Posted
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 ♥

  • 1 year later...
  • 3 months later...
Posted
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!

  • 1 year later...

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...