Lord Ganja
New member
Can anyone help me modify this successenchant src.
This source works like this: 'successenchant <equip location>,<enchant orb id>;'
I need to work like this one: 'successenchant <equip location>,<card slot>,<enchant orb id>;'
I'm bad at src mod so I can't do it on my own. Help please. Thanks in advance!
This source works like this: 'successenchant <equip location>,<enchant orb id>;'
I need to work like this one: 'successenchant <equip location>,<card slot>,<enchant orb id>;'
I'm bad at src mod so I can't do it on my own. Help please. Thanks in advance!
Code:
BUILDIN(successenchant){ int i = -1, j, 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(script->equip) ) i = pc->checkequip(sd, script->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; logs->pick_pc(sd, LOG_TYPE_SCRIPT, -1, &sd->status.inventory[i],sd->inventory_data[i]); // By Official Info: Item will lose cards, refine and previus enchants. for( j = 0; j < MAX_SLOTS; j++ ) sd->status.inventory[i].card[j] = 0; sd->status.inventory[i].refine = 0; // -------------------------------------------------------------------- pc->unequipitem(sd,i,2); clif->delitem(sd,i,1,3); sd->status.inventory[i].card[MAX_SLOTS - 1] = enchant; logs->pick_pc(sd, LOG_TYPE_SCRIPT, 1, &sd->status.inventory[i],sd->inventory_data[i]); clif->additem(sd,i,1,0); pc->equipitem(sd,i,ep); clif->misceffect(&sd->bl,3); return 0;}