Jump to content
  • 0

Enchantment System


Lord Ganja

Question


  • Group:  Members
  • Topic Count:  141
  • Topics Per Day:  0.03
  • Content Count:  444
  • Reputation:   22
  • Joined:  06/18/12
  • Last Seen:  

Hi can anyone help me edit this source of enchantment system.

I need it to select which card slot is to be enchanted..

 

This source functions like this 'successenchant <equip location>,<enchant orb id>;'

I need to be like 'successenchant <equip location>,<card slot>,<enchant orb id>;'

 

script.c

BUILDIN_FUNC(successenchant)
{
	int i = -1, num, enchant, ep;
	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[i] || sd->inventory_data[i]->slot >= MAX_SLOTS )
		return 0; // Cannot enchant an item with 4 slots. Enchant uses last slot.

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

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

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

	return 0;
}

.................................................................
BUILDIN_DEF(successenchant,"ii"),

itemdb.h

#define itemdb_isenchant(i) (i >= 4700 && i <= 4999)

Thanks in advance!

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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