Jump to content
  • 0

Help in source mod


Siberian

Question


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  67
  • Reputation:   0
  • Joined:  02/07/12
  • Last Seen:  

I have a mod that generates a hash for the items, so, to not bug the hash when remove the card, I made a little change. However, I updated the emulator and in the last version, I'm having problems with this change. Could you help me?

ERROR:

script.c: In function âbuildin_successremovecardsâ:
script.c:11136: error: âstruct itemâ has no member named âitem_hashâ
script.c:11136: warning: zero-length printf format string
script.c:11156: error: âstruct itemâ has no member named âitem_hashâ
script.c:11156: error: âstruct itemâ has no member named âitem_hashâ
make[1]: *** [obj_sql/script.o] Error 1

/// 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>;

BUILDIN_FUNC(successremovecards) {

int i=-1,j,c,cardflag=0;

TBL_PC* sd = script_rid2sd(st);

int num = script_getnum(st,2);

if (num > 0 && num <= ARRAYLENGTH(equip))

i=pc_checkequip(sd,equip[num-1]);

if (i < 0 || !sd->inventory_data) {

return 0;

}

if(itemdb_isspecial(sd->status.inventory.card[0]))

return 0;

for( c = sd->inventory_data->slot - 1; c >= 0; --c ) {

if( sd->status.inventory.card[c] && itemdb_type(sd->status.inventory.card[c]) == IT_CARD ) {// extract this card from the item

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;

sprintf(item_tmp.item_hash, ""); <---- Linha 11136

item_tmp.favorite = 0;

if((flag=pc_additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))){

clif_additem(sd,0,0,flag);

map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);

}

}

}

if(cardflag == 1) {

int flag;

struct item item_tmp;

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

item_tmp.nameid = sd->status.inventory.nameid;

item_tmp.identify = 1;

item_tmp.refine = sd->status.inventory.refine;

item_tmp.attribute = sd->status.inventory.attribute;

item_tmp.expire_time = sd->status.inventory.expire_time;

strcpy(item_tmp.item_hash, sd->status.inventory.item_hash); <---- Linha 11156

item_tmp.favorite = 0;

for (j = sd->inventory_data->slot; j < MAX_SLOTS; j++)

item_tmp.card[j]=sd->status.inventory.card[j];

pc_delitem(sd,i,1,0,3,LOG_TYPE_SCRIPT);

if((flag=pc_additem(sd,&item_tmp,1,LOG_TYPE_SCRIPT))){

clif_additem(sd,0,0,flag);

map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);

}

clif_misceffect(&sd->bl,3);

}

return 0;

}

Thanks.

Edited by Siberian
Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  737
  • Reputation:   216
  • Joined:  11/29/11
  • Last Seen:  

in mmo.h the structure named item should have the attibute hash in it.

I suppose the update/checkout you did remove it.

nb : this will only remove the current of compilation displayed but you'll still need the hash manipulation logique, dunno what u did there.

gl

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