- 0
Sign in to follow this
Followers
0
Can anyone help me on this script commands!
Asked by
Ragnar Lothbrok
-
Recently Browsing 0 members
No registered users viewing this page.
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;
}
Share this post
Link to post
Share on other sites