Jump to content
  • 0
Kuroyama

Decarding Bug

Question

10 answers to this question

Recommended Posts

  • 0
Just now, astralprojection said:

are there any modification on eddga card script? check if it has
OnUnequipScript: <" sc_end SC_ENDURE; "> 

image.png.45149fdd87566d119d0ba7b9cf17c31e.png

Here, it has sc_end. What happening only is when you decard the certain shoes with eddga, after successfully decarding, the endure is still there

Share this post


Link to post
Share on other sites
  • 0

additional info.

After successfully removing the card, the script command 'successremovecards' fails to re-equip the item.

 image.png.022b4206447699fe8a2a738c4d8443d6.png

 

it seems pc->equipitem(sd, i, sd->status.inventory.equip); is not working properly.

pc->unequipitem(sd, i, PCUNEQUIPITEM_FORCE); does not recalculate stats so we rely on the 
pc->equipitem(sd, i, sd->status.inventory.equip); to recalculate the stats thus not triggering the OnUnequipScript.

 

i dont know how to fix it tho. :(

/// Removes all cards from the item found in the specified equipment slot of the invoking character,
/// and give them to the character. If any cards were removed in this manner, it will also show a success effect.
/// successremovecards(<slot>);
static BUILDIN(successremovecards)
{
	int i = -1, c, cardflag = 0;

	struct map_session_data *sd = script->rid2sd(st);
	int num = script_getnum(st, 2);

	if (sd == NULL)
		return true;

	if (num > 0 && num <= ARRAYLENGTH(script->equip))
		i = pc->checkequip(sd,script->equip[num - 1]);

	if (i < 0 || sd->inventory_data[i] == NULL)
		return true;

	if (itemdb_isspecial(sd->status.inventory[i].card[0]))
		return true;

	for (c = sd->inventory_data[i]->slot - 1; c >= 0; --c) {
		if (sd->status.inventory[i].card[c] > 0 && itemdb_type(sd->status.inventory[i].card[c]) == IT_CARD) {
			int flag;
			struct item item_tmp;

			memset(&item_tmp, 0, sizeof(item_tmp));

			cardflag = 1;
			item_tmp.nameid = sd->status.inventory[i].card[c];
			item_tmp.identify = 1;
			sd->status.inventory[i].card[c] = 0;

			if ((flag = pc->additem(sd, &item_tmp, 1, LOG_TYPE_SCRIPT))) {
				clif->additem(sd, 0, 0, flag);
				map->addflooritem(&sd->bl, &item_tmp, 1, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0, false);
			}
		}
	}

	if (cardflag == 1) {
		pc->unequipitem(sd, i, PCUNEQUIPITEM_FORCE);
		clif->delitem(sd, i, 1, DELITEM_MATERIALCHANGE);
		clif->additem(sd, i, 1, 0);
		pc->equipitem(sd, i, sd->status.inventory[i].equip); //THIS LINE HERE FAILS TO WORK
		clif->misceffect(&sd->bl,3);
	}
	return true;
}

 

Edited by Dduwsmitt

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, Dduwsmitt said:

additional info.

After successfully removing the card, the script command 'successremovecards' fails to re-equip the item.

 image.png.022b4206447699fe8a2a738c4d8443d6.png

 

it seems pc->equipitem(sd, i, sd->status.inventory.equip); is not working properly.

pc->unequipitem(sd, i, PCUNEQUIPITEM_FORCE); does not recalculate stats so we rely on the 
pc->equipitem(sd, i, sd->status.inventory.equip); to recalculate the stats thus not triggering the OnUnequipScript.

 

i dont know how to fix it tho. :(

/// Removes all cards from the item found in the specified equipment slot of the invoking character, /// and give them to the character. If any cards were removed in this manner, it will also show a success effect. /// successremovecards(<slot>); static BUILDIN(successremovecards) { int i = -1, c, cardflag = 0; struct map_session_data *sd = script->rid2sd(st); int num = script_getnum(st, 2); if (sd == NULL) return true; if (num > 0 && num <= ARRAYLENGTH(script->equip)) i = pc->checkequip(sd,script->equip[num - 1]); if (i < 0 || sd->inventory_data == NULL) return true; if (itemdb_isspecial(sd->status.inventory.card[0])) return true; for (c = sd->inventory_data->slot - 1; c >= 0; --c) { if (sd->status.inventory.card[c] > 0 && itemdb_type(sd->status.inventory.card[c]) == IT_CARD) { int flag; struct item item_tmp; memset(&item_tmp, 0, sizeof(item_tmp)); cardflag = 1; item_tmp.nameid = sd->status.inventory.card[c]; item_tmp.identify = 1; sd->status.inventory.card[c] = 0; if ((flag = pc->additem(sd, &item_tmp, 1, LOG_TYPE_SCRIPT))) { clif->additem(sd, 0, 0, flag); map->addflooritem(&sd->bl, &item_tmp, 1, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0, false); } } } if (cardflag == 1) { pc->unequipitem(sd, i, PCUNEQUIPITEM_FORCE); clif->delitem(sd, i, 1, DELITEM_MATERIALCHANGE); clif->additem(sd, i, 1, 0); pc->equipitem(sd, i, sd->status.inventory.equip); //THIS LINE HERE FAILS TO WORK clif->misceffect(&sd->bl,3); } return true; }

/// Removes all cards from the item found in the specified equipment slot of the invoking character,
/// and give them to the character. If any cards were removed in this manner, it will also show a success effect.
/// successremovecards(<slot>);
static BUILDIN(successremovecards)
{
	int i = -1, c, cardflag = 0;

	struct map_session_data *sd = script->rid2sd(st);
	int num = script_getnum(st, 2);

	if (sd == NULL)
		return true;

	if (num > 0 && num <= ARRAYLENGTH(script->equip))
		i = pc->checkequip(sd,script->equip[num - 1]);

	if (i < 0 || sd->inventory_data[i] == NULL)
		return true;

	if (itemdb_isspecial(sd->status.inventory[i].card[0]))
		return true;

	for (c = sd->inventory_data[i]->slot - 1; c >= 0; --c) {
		if (sd->status.inventory[i].card[c] > 0 && itemdb_type(sd->status.inventory[i].card[c]) == IT_CARD) {
			int flag;
			struct item item_tmp;

			memset(&item_tmp, 0, sizeof(item_tmp));

			cardflag = 1;
			item_tmp.nameid = sd->status.inventory[i].card[c];
			item_tmp.identify = 1;
			sd->status.inventory[i].card[c] = 0;

			if ((flag = pc->additem(sd, &item_tmp, 1, LOG_TYPE_SCRIPT))) {
				clif->additem(sd, 0, 0, flag);
				map->addflooritem(&sd->bl, &item_tmp, 1, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0, false);
			}
		}
	}

	if (cardflag == 1) {
		pc->unequipitem(sd, i, PCUNEQUIPITEM_FORCE);
		clif->delitem(sd, i, 1, DELITEM_MATERIALCHANGE);
		clif->additem(sd, i, 1, 0);
		pc->equipitem(sd, i, sd->status.inventory[i].equip); //THIS LINE HERE FAILS TO WORK
		clif->misceffect(&sd->bl,3);
	}
	return true;
}

 

Update: 

 

i changed pc->unequipitem(sd, i, PCUNEQUIPITEM_FORCE); to pc->unequipitem(sd, i, PCUNEQUIPITEM_RECALC);

 

still not triggering the OnUnequipScript.

Share this post


Link to post
Share on other sites
  • 0

I'm relaunching the subject because it doesn't seem to be very advanced here or on Github. Has anyone found the solution to this problem? On low rate servers where the eddga card is at 0.01% it is not yet too disturbing that the card will remain rare but on a high rate server, it will have a lot of problem and could even participate in what the whole server glitch this stuff

Share this post


Link to post
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.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

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