Jump to content
  • 0
Sign in to follow this  
Ragnar Lothbrok

Can anyone help me on this script commands!

Question

I want to implement this script commands on my server can anyone help me to make it compatible

 

 

 

BUILDIN(successenchant)
{
int i = -1, j, num, enchant, ep;
char chat_announce[256];
TBL_PC *sd;

num = script_getnum(st,2); // Equip Slot
enchant = script_getnum(st,3); // Equip Enchant
sd = script_rid2sd(st);
if( sd == NULL || !itemdb_isenchant(enchant) )
return 0;
if( num > 0 && num <= ARRAYLENGTH(equip) )
i = pc_checkequip(sd, equip[num - 1]);
if( i < 0 )
return 0;
if( !sd->inventory_data || sd->inventory_data->slot >= MAX_SLOTS )
return 0; // Cannot enchant an item with 4 slots. Enchant uses last slot.

ep = sd->status.inventory.equip;
log_pick_pc(sd, LOG_TYPE_SCRIPT, -1, &sd->status.inventory);

// By Official Info: Item will lose cards, refine and previus enchants.
for( j = 0; j < MAX_SLOTS; j++ )
sd->status.inventory.card[j] = 0;
sd->status.inventory.refine = 0;
// --------------------------------------------------------------------

pc_unequipitem(sd,i,2);
clif_delitem(sd,i,1,3);
sd->status.inventory.card[MAX_SLOTS - 1] = enchant;
log_pick_pc(sd, LOG_TYPE_SCRIPT, 1, &sd->status.inventory);

clif_additem(sd,i,1,0);
pc_equipitem(sd,i,ep);
clif_misceffect(&sd->bl,3);

if( battle_config.channel_announces&8 && server_channel[CHN_VENDING] )
{
sprintf(chat_announce, msg_txt(892), server_channel[CHN_VENDING]->name, sd->status.name, sd->inventory_data->jname, sd->inventory_data->slot, itemdb_search(enchant)->jname);
clif_channel_message(server_channel[CHN_VENDING], chat_announce, 26);
}

return 0;
}

BUILDIN(failedenchant)
{
int i = -1, num;
TBL_PC *sd;

num = script_getnum(st,2);
sd = script_rid2sd(st);
if( sd == NULL )
return 0;
if( num > 0 && num <= ARRAYLENGTH(equip) )
i = pc_checkequip(sd, equip[num - 1]);
if( i >= 0 )
{
pc_unequipitem(sd,i,3);
pc_delitem(sd,i,1,0,2,LOG_TYPE_SCRIPT);
clif_misceffect(&sd->bl,2);
}

return 0;
}

 

 

 

BUILDIN_DEF(successenchant,"ii"),
BUILDIN_DEF(failedenchant,"i"),

 

 

 

 

Edited by P r o p e r t i e s

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

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...
Sign in to follow this  

×
×
  • Create New...

Important Information

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