Jump to content

[SRC MOD] Enchant System Cards al Slot 4


Celsius

Recommended Posts


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

[Guia][sRC] Hidden Enchant System Cards Directo al Slot 4
Realizada por: Celsius
Modificacion para el Hidden Enchant System. Todas las Cartas se colocan directo al slot 4. (Lean las Advertencias)



 

::: INICIOS  :::

Esta modificacion es totalmente custom, NO ES OFICIAL y deberan de usarla bajo su propio Riesgo.

Esto debido a que contiene algunos detalles los cuales no se logran corregir.
No se afecta la jugabilidad del juego, pero si son detalles que no deberian de Ocurrir.

Los Detalles encontrados al Momento:

  •  
  • - La "Carta/Orbe/Runa" Puede ser Cambiada por otra en cualquier momento.
  • - Se Necesita al Menos un Slot Libre para poder ingresarla en el slot 4 (raro, lo se.)
  • - Solo se pueden poner en Equipos con 1, 2 y 3 Slots. Equipos sin slot y con 4 no se coloca.
  • - Si ya tiene todos los slots Ocupados por Cartas, no se puede agregar el Enchant aunque ya tenga uno.

 

 

 

:::: INGRESANDO MODIFICACION ::::

Primeramente, necesitaremos el emulador de su eleccion.

Lo probe en rAthena, Hercules y eAthena y funcionaron sin problemas.

Iremos directamente a la siguiente carpeta de nuestro emulador (en este caso simulare que es rathena):

rathena-->src-->map, dentro de esa carpeta buscaremos el archivo pc.c y lo deberemos de abrir con nuestro editor de texto favorito. Les recomiendo usar Notepad++.


Dentro de pc.c debemos buscar la siguiente funcion:


/*==========================================
 * Append a card to an item ?
 *------------------------------------------*/
int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip)



Y deberemos de reemplazarla por esta ya editada:


/*==========================================
 * Append a card to an item ?
 * Including Hidden Enchant "Cards" to 4th Slot By: S0M4_B3LM0NT & Celsius
 *------------------------------------------*/
int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip)
{
int i;
int nameid;

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

    //check if you try to add a ENCHANT RUNE (By Celsius and S0M4_B3LM0NT)
    if( itemdb_isrune(sd->status.inventory[idx_card].nameid) && sd->inventory_data[idx_equip]->slot > 3 )
        return 0; // Slot Reserved for Enchant Runes

    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

    // remember the card id to insert
    nameid = sd->status.inventory[idx_card].nameid;

    ARR_FIND( 0, sd->inventory_data[idx_equip]->slot, i, sd->status.inventory[idx_equip].card[i] == 0 );
        if( itemdb_isrune(nameid) ){ // If its a Rune, it goes directly into Fourth Slot.
            i = 3;// Enchant Slot - Can overwrite current enchant... Seeking Fix for this (by S0M4_B3LM0NT)
        }else{
            if( i == sd->inventory_data[idx_equip]->slot )
                return 0;// no free slots
        }

    if( pc_delitem(sd,idx_card,1,1,0,LOG_TYPE_OTHER) == 1 )
    {// failed
        clif_insert_card(sd,idx_equip,idx_card,1);
    }
    else
    {// success
        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);
        if( itemdb_isrune(nameid) )
        {
            clif_delitem(sd,idx_equip,1,3);
            clif_additem(sd,idx_equip,1,0);
        }
    }

    return 0;
}





Despues de esto nos dirigimos al archivo itemdb.c y buscamos esto:


///Marks if the card0 given is "special" (non-item id used to mark pets/created items. [Skotlex]
#define itemdb_isspecial(i) (i == CARD0_FORGE || i == CARD0_CREATE || i == CARD0_PET)




Y le editamos a para que quede de la siguiente manera:


///Marks if the card0 given is "special" (non-item id used to mark pets/created items. [Skotlex]
#define itemdb_isspecial(i) (i == CARD0_FORGE || i == CARD0_CREATE || i == CARD0_PET)
#define itemdb_isrune(i) (i >= 4700 && i <= 4999) // Cambiar si Gravity agrega items que no sean del Sistema de Hidden Enchant en las ID's que estan disponibles (O si usas cartas custom en esas ID's) (by S0M4_B3LM0NT & Celsius)



Una vez Realizados los cambios, solo sera cuestion de Recompilar nuestro emulador y listo.

Ahora solo hara falta editar nuestra item_db.txt, ya sea en rathena-->db-->pre-->item_db.txt o en rathena-->db-->re-->item_db.txt.

Dentro de su item_db.txt buscaran la siguiente linea:


4700,Strength1,STR+1,6,20,,10,,,,,,,,,,,,,{ bonus bStr,1; },{},{}

y deberan de editar todas las lineas hasta la 4999 para asignar a que tipo de Enchant lo convertiran.

Se realiza en base a esta lista:

  •  
  • 256 = Upper Headgear
  • 512 = Middle Headgear
  • 001 = Lower Headgear
  • 016 = Armor
  • 002 = Weapon
  • 032 = Shield
  • 004 = Garment
  • 064 = Footgear
  • 008 = Accessory 1
  • 128 = Accessory 2



Un Ejemplo si desean que se pueda equipar en Cualquier headgear, el valor seria 769 (001+256+512) o si lo desean en cualquier Slot seria 1023 (la suma de todos).

Ya que tengan la ubicacion que desean para los enchant, deberan de editar el campo de Loc de cada linea del item. Para Identificarlo rapidamente es el quinto valor hacia atras desde la primeras llaves ({}), quedando de esta manera:


4700,Strength1,STR+1,6,20,,10,,,,,,,,1023,,,,,{ bonus bStr,1; },{},{}
4710,Inteligence1,INT+1,6,20,,10,,,,,,,,769,,,,,{ bonus bInt,1; },{},{}

En estos ejemplos, la de STR+1 se puede colocar en cualquier equipo, mientras que la de INT+1 solo en cualquier Headgear se puede poner.

::::: CLIENT SIDE EDIT :::::

Para Visualizar un poco mas sencillamente el bono que nos da el enchat, deberan de editar el archivo cardprefixnametable.txt que esta dentro de su GRF.

Este Archivo es el que contiene todos los Prefijos y Sufijos que se asignan al equipar una carta.

Solo deberan de agregar las siguientes lineas a su archivo:



//===================================================================
4700#OF STR +1#
4701#OF STR +2#
4702#OF STR +3#
4703#OF STR +4#
4704#OF STR +5#
4705#OF STR +6#
4706#OF STR +7#
4707#OF STR +8#
4708#OF STR +9#
4709#OF STR +10#
4710#OF INT +1#
4711#OF INT +2#
4712#OF INT +3#
4713#OF INT +4#
4714#OF INT +5#
4715#OF INT +6#
4716#OF INT +7#
4717#OF INT +8#
4718#OF INT +9#
4719#OF INT +10#
4720#OF DEX +1#
4721#OF DEX +2#
4722#OF DEX +3#
4723#OF DEX +4#
4724#OF DEX +5#
4725#OF DEX +6#
4726#OF DEX +7#
4727#OF DEX +8#
4728#OF DEX +9#
4729#OF DEX +10#
4730#OF AGI +1#
4731#OF AGI +2#
4732#OF AGI +3#
4733#OF AGI +4#
4734#OF AGI +5#
4735#OF AGI +6#
4736#OF AGI +7#
4737#OF AGI +8#
4738#OF AGI +9#
4739#OF AGI +10#
4740#OF VIT +1#
4741#OF VIT +2#
4742#OF VIT +3#
4743#OF VIT +4#
4744#OF VIT +5#
4745#OF VIT +6#
4746#OF VIT +7#
4747#OF VIT +8#
4748#OF VIT +9#
4749#OF VIT +10#
4750#OF LUK +1#
4751#OF LUK +2#
4752#OF LUK +3#
4753#OF LUK +4#
4754#OF LUK +5#
4755#OF LUK +6#
4756#OF LUK +7#
4757#OF LUK +8#
4758#OF LUK +9#
4759#OF LUK +10#
4760#OF MATK +1%#
4761#OF MATK +2%#
4762#OF FLEE +6#
4763#OF FLEE +12#
4764#OF CRIT +5#
4765#OF CRIT +7#
4766#OF ATK +2%#
4767#OF ATK +3%#
4768#OF STR+1#
4769#OF STR+2#
4770#OF STR+3#
4771#OF INT+1#
4772#OF INT+2#
4773#OF INT+3#
4774#OF VIT+1#
4775#OF VIT+2#
4776#OF VIT+3#
4777#OF AGI+1#
4778#OF AGI+2#
4779#OF AGI+3#
4780#OF DEX+1#
4781#OF DEX+2#
4782#OF DEX+3#
4783#OF LUK+1#
4784#OF LUK+2#
4785#OF LUK+3#
4786#OF MDEF+2#
4787#OF MDEF+4#
4788#OF MDEF+6#
4789#OF MDEF+8#
4790#OF MDEF+10#
4791#OF DEF+3#
4792#OF DEF+6#
4793#OF DEF+9#
4794#OF DEF+12#
4795#OF HP+100#
4796#OF HP+200#
4797#OF HP+300#
4798#OF HP+400#
4799#OF HP+500#
4800#OF SP+50#
4801#OF SP+100#
4802#OF SP+150#
4803#OF HIGHNESS HEAL#
4804#OF COLUCEO HEAL#
4805#OF ARCHBISHOP LV1#
4806#OF MATK +3%#
4807#OF ASPD +1#
4808#OF FIGHT LV4#
4809#OF FIGHT LV3#
4810#OF FIGHT LV2#
4811#OF FIGHT LV1#
4812#OF FORCE LV4#
4813#OF FORCE LV3#
4814#OF FORCE LV2#
4815#OF FORCE LV1#
4816#OF SHARP LV3#
4817#OF SHARP LV2#
4818#OF SHARP LV1#
4819#OF ATK +1%#
4820#OF FIGHT LV5#
4821#OF FIGHT LV6#
4822#OF FIGHT LV7#
4823#OF FIGHT LV8#
4824#OF FIGHT LV9#
4825#OF FIGHT LV10#
4826#OF FORCE LV5#
4827#OF FORCE LV6#
4828#OF FORCE LV7#
4829#OF FORCE LV8#
4830#OF FORCE LV9#
4831#OF FORCE LV10#
4832#OF ARCHER LV1#
4833#OF ARCHER LV2#
4834#OF ARCHER LV3#
4835#OF ARCHER LV4#
4836#OF ARCHER LV5#
4837#OF ARCHER LV6#
4838#OF ARCHER LV7#
4839#OF ARCHER LV8#
4840#OF ARCHER LV9#
4841#OF ARCHER LV10#
4842#OF ASPD +2#
4843#OF SHARP LV4#
4844#OF SHARP LV5#
4846#OF ATK+10 MATK+10#
4847#OF ATK+10 MATK+10#
4848#OF INMUNE LV1#
4849#OF CRESCENT LV1#
4850#OF ARCHBISHOP LV2#
4851#OF ARCHBISHOP LV3#
4852#OF ARCHBISHOP LV4#
4853#OF SPEC STR#
4854#OF SPEC AGI#
4855#OF SPEC VIT#
4856#OF SPEC INT#
4857#OF SPEC DEX#
4858#OF SPEC LUK#
4859#OF FLEE +1#
4860#OF FLEE +3#
4861#OF MAX HP +1%#
4862#OF MAX HP +2%#



Ustedes pueden asignarle la etiqueta que deseen. Estas son solo ejemplos de como yo las tengo colocadas.


::: [Mini FAQ] :::

- Esta modificacion desbalancearia mi servidor?
- Podria hacer, todo depende que "Runas" les permitas a tus Playes Tener

- He visto que al agregar los Enchant Normalmente aparece el bono que da a un lado, porque a mi no?
- No Has seguido la guia al 100. Te hace falta Modificar el archivo de tu GRF, cardpostfixnametable.txt

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  59
  • Reputation:   19
  • Joined:  01/03/13
  • Last Seen:  

Buena guía  Celsius pero este tipo de cosas siempre es más recomendable hacerlo mediante scripts, así solucionas todos los errores o detalles que mencionaste que ocurren tras la modificación por src. Además puedes añadir efectos, sonidos y animaciones, crear una probabilidad de que la runa, gema, etc, se pueda romper o incluso hacer que se pueda tener más de una en un mismo slot y muchas más cosas q se te ocurran.

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:  

Claro, eso es obvio, pero en su madre que nada solo es un mod que hice para una persona y lo he compartido para el que l desee, pro en lo personal pedido hacerlo por script.

P. D. Adicional es mi primer mod que hago desde 0

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
Reply to this topic...

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