Jump to content
  • 0

Devo and Defender Bug


ScarrFace

Question


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  66
  • Reputation:   0
  • Joined:  10/23/19
  • Last Seen:  

1. i will cast devo to my party member and defender on

2. enemy player hit my pt member - " works fine "

3. but when i cast my devo skill again to my pt member the defender reduce damage gone but the icon defender skill and the effect of slow still there

 

anyone can help me to fix this? Thank you!

Edited by ScarrFace
Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  66
  • Reputation:   0
  • Joined:  10/23/19
  • Last Seen:  

bump. anyone i need help to solve this problem. ?

On 3/2/2020 at 5:42 PM, Eros said:

I also encounter this error.

i hope one of the dev or moderator solve this problem. still bug exist in latest git

bump

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  76
  • Topics Per Day:  0.02
  • Content Count:  202
  • Reputation:   2
  • Joined:  07/09/12
  • Last Seen:  

I also encounter this error.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   1
  • Joined:  10/30/13
  • Last Seen:  

up having the same issue

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  114
  • Reputation:   4
  • Joined:  08/28/14
  • Last Seen:  

up for this help

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   3
  • Joined:  01/11/14
  • Last Seen:  

Does the fix for this already released?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  403
  • Reputation:   249
  • Joined:  07/04/19
  • Last Seen:  

20 hours ago, budek said:

Does the fix for this already released?

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  155
  • Topics Per Day:  0.03
  • Content Count:  535
  • Reputation:   23
  • Joined:  11/19/11
  • Last Seen:  

If I know the fix, I will help the dev here.

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

  • 0

  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   0
  • Joined:  03/26/16
  • Last Seen:  

Hello everyone,

I'm currently working on a custom fix for an issue with the Devotion skill and its interaction with Defender on my private server. After numerous tests, I've run into a roadblock that I can't seem to resolve.

The problem is that on the first cast of Devotion while Defender is active, the party member receiving Devotion does not inherit the Defender buff. For the buff to apply, I need to deactivate and reactivate Defender after casting Devotion. This behavior is inconsistent and problematic during gameplay, particularly when the party member is dispelled by Clown or Professor. Even if I recast Devotion immediately, Defender is not inherited until I toggle it off and on again.

Here are the key tests I've performed:

  1. Initial Devotion with Defender Active: The party member does not receive the Defender buff on the first cast.
  2. Toggling Defender Off and On: After manually toggling Defender, the party member successfully inherits the buff.
  3. Post-Dispel Scenario: If the party member is dispelled, reapplying Devotion alone does not reinstate Defender; I need to recast Defender first.

I have tried integrating various code adjustments, including forced status updates and reapplications, but the issue persists.

If anyone has encountered a similar problem or has suggestions on how to ensure Defender properly inherits on the first Devotion cast, I would greatly appreciate the assistance.

Thanks in advance for your help!

 

This is my status.cpp BEFORE:

		case SC_DEVOTION:
		{
			struct block_list *d_bl;
			struct status_change *d_sc;

			if( (d_bl = map_id2bl(val1)) && (d_sc = status_get_sc(d_bl)) && d_sc->count ) { // Inherits Status From Source
				const enum sc_type types[] = { SC_AUTOGUARD, SC_DEFENDER, SC_REFLECTSHIELD, SC_ENDURE };
				int i = (map_flag_gvg2(bl->m) || map_getmapflag(bl->m, MF_BATTLEGROUND))?2:3;
				while( i >= 0 ) {
					enum sc_type type2 = types[i];
					if( d_sc->data[type2] )
						status_change_start(d_bl, bl, type2, 10000, d_sc->data[type2]->val1, 0, 0, (type2 == SC_REFLECTSHIELD ? 1 : 0), skill_get_time(status_sc2skill(type2),d_sc->data[type2]->val1), (type2 == SC_DEFENDER) ? SCSTART_NOAVOID : SCSTART_NOAVOID|SCSTART_NOICON);
					i--;
				}
			}
			break;
		}

 

 

And this is my status.cpp AFTER:

		case SC_DEVOTION:
		{
		    struct block_list *d_bl;
		    struct status_change *d_sc;

		    // Get the devotion target (party member) and their status change structure
		    if ((d_bl = map_id2bl(val1)) && (d_sc = status_get_sc(d_bl)) && d_sc->count) {
		        struct status_change *src_sc = status_get_sc(bl); // Paladin's status changes
		        if (src_sc) {
		            // Check if Paladin has Defender active
		            if (src_sc->data[SC_DEFENDER]) {
		                // Get the level of Paladin's Defender
		                int defender_level = src_sc->data[SC_DEFENDER]->val1;

		                // Check if the devoted target already has Defender
		                if (!d_sc->data[SC_DEFENDER]) {
		                    // Apply Defender to the devotion target on the first cast
		                    status_change_start(
		                        d_bl, bl, SC_DEFENDER, 10000, defender_level, 0, 0, 0,
		                        skill_get_time(status_sc2skill(SC_DEFENDER), defender_level),
		                        SCSTART_NOAVOID
		                    );
		                } else {
		                    // If target already has Defender, update the timer and level
		                    struct status_change_entry *sce = d_sc->data[SC_DEFENDER];
		                    if (sce->timer != INVALID_TIMER) {
		                        // If the timer is active, update the Defender level and reset the timer
		                        delete_timer(sce->timer, status_change_timer);
		                    }
		                    sce->val1 = defender_level;  // Update Defender level
		                    sce->timer = add_timer(
		                        gettick() + skill_get_time(status_sc2skill(SC_DEFENDER), defender_level),
		                        status_change_timer,
		                        d_bl->id, SC_DEFENDER
		                    );
		                }
		            }

		            // Check and apply other buffs (Autoguard, Reflectshield, Endure)
		            const enum sc_type types[] = { SC_AUTOGUARD, SC_REFLECTSHIELD, SC_ENDURE };
		            int i = 0;

		            while (i < sizeof(types)/sizeof(types[0])) {
		                enum sc_type type = types[i];

		                if (src_sc->data[type]) {
		                    struct status_change_entry *sce = src_sc->data[type];
		                    int level = sce->val1;  // Get the level of the buff

		                    // Check if the target already has the status
		                    if (!d_sc->data[type]) {
		                        // Apply the status to the target (1st time cast)
		                        status_change_start(
		                            d_bl, bl, type, 10000, level, 0, 0, (type == SC_REFLECTSHIELD ? 1 : 0),
		                            skill_get_time(status_sc2skill(type), level),
		                            SCSTART_NOAVOID
		                        );
		                    } else {
		                        // Update the status on target (for all buffs except Defender)
		                        struct status_change_entry *target_sce = d_sc->data[type];
		                        target_sce->val1 = level;
		                        if (target_sce->timer != INVALID_TIMER) {
		                            delete_timer(target_sce->timer, status_change_timer);
		                        }
		                        target_sce->timer = add_timer(
		                            gettick() + skill_get_time(status_sc2skill(type), level),
		                            status_change_timer,
		                            d_bl->id, type
		                        );
		                    }
		                }
		                i++;
		            }
		        }
		    }
		    break;
		}

 

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
Answer this question...

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