Jump to content
  • 0

Set Enchant Rune "Cards" Directly Into 4th Slot


Celsius

Question


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  64
  • Reputation:   2
  • Joined:  11/14/11
  • Last Seen:  

Hi!!

 

I wish to ask anybody a custom mod to help me to set the "Cards" (Orbs/Runes/anyway you call them) from the Armor Enchant System Directly into 4th Slot reggardless if the item had it or dont.

 

In Short... The Enchat System NPC but in a the form of a card.

 

Obviously, There should be only 1 enchat per armor/weapon, Cant be removed and if it is posible, made able to set into Produced items (if this option can be toggleable should be perfect) and also if another enchat is already set the game tell you that you cant had more than one enchant. (Cause the 4th slot is already Occupied).

 

 

I see a mod like the one i ask in youtube, but that mod is no longer available and also with that you can set all 4 slot with enchants.

 

I dont had the link of video at hand but i search for it again and place it here.

 

Thanks in advance to anyone who can help me with this or can give me a clue to do it.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

there is no source mod required for this. in your enchanted script , just change the location of the "rune" into the 4th slot using the getitem2

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  64
  • Reputation:   2
  • Joined:  11/14/11
  • Last Seen:  

Yeah, i know i can use it via script, in fact i had my own hidden enchant npc.

But i want to do this (video) :

Http://www.youtube.co/watch?v=9q9kbYot3FA

I already try using an old mod i had to get some card restricted to 1 or 2.

But i cant set it directly into 4th slot like video. In fact right now i made crap my emulator :P

You think its possible Emistry?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

i see .... 

 

i think you can try edit this part.

src/map/pc.c#L3819

 

add another check for item id ...and change the index of the card to be compound to 3 ...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  64
  • Reputation:   2
  • Joined:  11/14/11
  • Last Seen:  

I already edit it and add the check of the id's with out problem. But to compound to specific slot is what i get fail.

In fact, i know only a little of src edition(really only the base of c++).

Also, i cant be able to do this:
When i "use" an orb, it check that i dont had one if it already compounded, but it go to normal slots and also i can still adding another one instead of get it restricted.

 

Edit:

I get it to work... but not in the way i want at all.

 

I get it compounded in the "4th" slot... but only after you relog. Meanwhile, you can equip up to 4 and get the 4 bonus.

 

Also, if you relog, the item only had the 4th slot occupied and get the bonus, but if you equip any normal card it lose the effect of the "Rune" and only give you the effect of the card.

 

Also, the check i set seem to work... but it let me set the "rune" :S

 

This is how i set it... {remember... i only know the basic... really only the basic of c++... already star learning it 2 days ago xDD)

 

/*==========================================
 * Append a card to an item ?
 *------------------------------------------*/
int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip)
{
int i;
int nameid,runeid;
int cards[300]={4700,4701,4702,4703,4704,4705,4706,4707,4708,4709,4710,4711,4712,4713,4714,4715,4716,4717,4718,4719,4720,4721,4722,4723,4724,4725,4726,4727,4728,4729,4730,4731,4732,4733,4734,4735,4736,4737,4738,4739,4740,4741,4742,4743,4744,4745,4746,4747,4748,4749,4750,4751,4752,4753,4754,4755,4756,4757,4758,4759,4760,4761,4762,4763,4764,4765,4766,4767,4768,4769,4770,4771,4772,4773,4774,4775,4776,4777,4778,4779,4780,4781,4782,4783,4784,4785,4786,4787,4788,4789,4790,4791,4792,4793,4794,4795,4796,4797,4798,4799,4800,4801,4802,4803,4804,4805,4806,4807,4808,4809,4810,4811,4812,4813,4814,4815,4816,4817,4818,4819,4820,4821,4822,4823,4824,4825,4826,4827,4828,4829,4830,4831,4832,4833,4834,4835,4836,4837,4838,4839,4840,4841,4842,4843,4844,4845,4846,4847,4848,4849,4850,4851,4852,4853,4854,4855,4856,4857,4858,4859,4860,4861,4862};//insertar id de runas enchant

nullpo_ret(sd);

    if( idx_equip < 0 || idx_equip >= MAX_INVENTORY || sd->inventory_data[idx_equip] == NULL )
        return 0; //Invalid item index.
    if( idx_card < 0 || idx_card >= MAX_INVENTORY || sd->inventory_data[idx_card] == NULL )
        return 0; //Invalid card index.
    if( sd->status.inventory[idx_equip].nameid <= 0 || sd->status.inventory[idx_equip].amount < 1 )
        return 0; // target item missing
    if( sd->status.inventory[idx_card].nameid <= 0 || sd->status.inventory[idx_card].amount < 1 )
        return 0; // target card missing
    if( sd->inventory_data[idx_equip]->type != IT_WEAPON && sd->inventory_data[idx_equip]->type != IT_ARMOR )
        return 0; // only weapons and armor are allowed
    if( sd->inventory_data[idx_card]->type != IT_CARD )
        return 0; // must be a card
    if( sd->status.inventory[idx_equip].identify == 0 )
        return 0; // target must be identified
    if( itemdb_isspecial(sd->status.inventory[idx_equip].card[0]) )
        return 0; // card slots reserved for other purposes
    if( (sd->inventory_data[idx_equip]->equip & sd->inventory_data[idx_card]->equip) == 0 )
        return 0; // card cannot be compounded on this item type
    if( sd->inventory_data[idx_equip]->type == IT_WEAPON && sd->inventory_data[idx_card]->equip == EQP_SHIELD )
        return 0; // attempted to place shield card on left-hand weapon.
    if( sd->status.inventory[idx_equip].equip != 0 )
        return 0; // item must be unequipped

    ARR_FIND( 0, sd->inventory_data[idx_equip]->slot, i, sd->status.inventory[idx_equip].card[i] == 0 );
        if( i == sd->inventory_data[idx_equip]->slot )
            return 0; // no free slots

// remember the card id to insert
    if(sd->status.inventory[idx_card].nameid > 4700 && sd->status.inventory[idx_card].nameid < 4862){
        runeid = sd->status.inventory[idx_card].nameid;
    }else{
        nameid = sd->status.inventory[idx_card].nameid;
    }

if( pc_delitem(sd,idx_card,1,1,0,LOG_TYPE_OTHER) == 1 )
{// failed
    clif_insert_card(sd,idx_equip,idx_card,1);
    return 0;
}
else
{// success
    if(runeid){
        log_pick_pc(sd, LOG_TYPE_OTHER, -1, &sd->status.inventory[idx_equip]);
        sd->status.inventory[idx_equip].card[3] = nameid;
        log_pick_pc(sd, LOG_TYPE_OTHER, 1, &sd->status.inventory[idx_equip]);
        clif_insert_card(sd,idx_equip,idx_card,0);
        return 0;
    }
    else
    {
        log_pick_pc(sd, LOG_TYPE_OTHER, -1, &sd->status.inventory[idx_equip]);
        sd->status.inventory[idx_equip].card[i] = nameid;
        log_pick_pc(sd, LOG_TYPE_OTHER, 1, &sd->status.inventory[idx_equip]);
        clif_insert_card(sd,idx_equip,idx_card,0);    
        return 0;
    }

}

}
Edited by Celsius
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...