Decarding Bug

Kuroyama

New member
Messages
128
Points
0
After decarding the shoes with eddga card, the endure status is still on.

How to get rid of this?

image.png

image.png

 
are there any modification on eddga card script? check if it has
OnUnequipScript: <" sc_end SC_ENDURE; "> 
image.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

 
additional info.

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

 image.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;
}


 

 
Last edited by a moderator:
1 hour ago, Dduwsmitt said:
additional info.

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

 View attachment 6656

 

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 == 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;
}



 









Update: 



 





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





 





still not triggering the OnUnequipScript.


 
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

 
Back
Top