Jump to content

ValkyrieCK

Members
  • Posts

    12
  • Joined

  • Last visited

Everything posted by ValkyrieCK

  1. About the client exe, may I know the patch diff which you used to make this tutorial? Thank you very much!
  2. wow It's a really awesome release! Thank you very much
  3. I found another issue From old -[space]shop[space]premiumship[space]-1,501:100,502:100 To new -[tab]shop[tab]premiumshop[tab]-1,501:100,502:100
  4. //===== Hercules Script ====================================================== //= ??Quest for Zodiac Headgeards //===== By: ================================================================== //= Ridley //===== Current Version: ===================================================== //= 1.0 //===== Description: ========================================================= //= Rotates each month. January (Capricorn) to December (Sagittarius) //= Counts and displays required items and how much you miss //= Player can choose to make diadem or crown //============================================================================ //prontera,155,181,5 script Zodiac#hats 4_F_PINKWOMAN,{ amatsu,113,105,5 script Zodiac#hats 4_F_PINKWOMAN,{ mes "[Zodiac of the Month]"; mes "Hello there, I am in charge of the Zodiac items. Please select which Zodiac item you are interested in."; if (select("Zodiac Diadem", "Zodiac Crown") == 1) { function Zodiac; setarray .Zodiac$[0], "Capricon_Diadem", "Aquarius_Diadem", "Pisces_Diadem", "Aries_Diadem", "Taurus_Diadem", "Gemini_Diadem", "Cancer_Diadem", "Leo_Diadem", "Virgo_Diadem", "Libra_Diadem", "Scorpio_Diadem", "Sagittarius_Diadem"; } else { function Zodiac; setarray .Zodiac$[0], "Capricon_Crown", "Aquarius_Crown", "Pisces_Crown", "Aries_Crown", "Taurus_Crown", "Gemini_Crown", "Cancer_Crown", "Leo_Crown", "Virgo_Crown", "Libra_Crown", "Scorpio_Crown", "Sagittarius_Crown"; } next; mes "[Zodiac of the Month]"; mes "Would you like to make 1 ^FF0000" + getitemname (.Zodiac$[gettime(6) -1]) + "^000000 for the %dth Month of this year ?"; next; if (select("Yes", "No") == 2) close; switch (gettime(6)) { // (Item,Amount, Item,Amount,..); case 1: callfunc "Zodiac", 7511, 300, 2256, 1, "Goat_Card", 1, 7107, 100, 7106, 100; break; case 2: callfunc "Zodiac", 7511, 300, "Aqua_Elemental_Card", 1, "Crystalized_Teardrop", 100, "Water_Of_Darkness", 20, "Holy_Water", 50; break; case 3: callfunc "Zodiac", 7511, 300, "Lip_Of_Ancient_Fish", 100, "Fisherman's_Dagger", 1, "Sword_Fish_Card", 1, "Water_Of_Darkness", 50; break; case 4: callfunc "Zodiac", 7511, 300, 2256, 1, "Book_Of_Blazing_Sun_", 1, 7107, 100, 7106, 100; break; case 5: callfunc "Zodiac", 7511, 300, "Nose_Ring", 100, "Hammer_Of_Blacksmith", 10, "Majoruros_Card", 1, "Minorous_Card", 1; break; case 6: callfunc "Zodiac",7511,300, "Twinhorn_Helm",100, "Book_Of_Gust_Of_Wind_",1, "Rough_Wind",15, "Windhawk",1; break; case 7: callfunc "Zodiac",7511,300, 960,100, 991,50, 943,100, 4049,1; break; case 8: callfunc "Zodiac",7511,300, "Tiger_Footskin",1, "Horn_Of_Hilsrion",100, "Hilsrion_Card",1, "Horn_Of_Hilthrion",1; break; case 9: callfunc "Zodiac",7511,300, "Skirt_Of_Virgin",1, "Kiss_Of_Angel",1, "Angel's_Arrival",1, "Angel's_Warmth",1, "Angel's_Safeguard",1, "Angel's_Protection",1, "Angelic_Chain",1; break; case 10: callfunc "Zodiac",7511,300, "Whip_Of_Balance",1, "Prohibition_Red_Candle",1, "Red_Feather",50, "Injustice_Card",1; break; case 11: callfunc "Zodiac",7511,300, "Scorpion_Card",1, "Scorpion's_Tail",100, "Scropion's_Nipper",100; break; case 12: callfunc "Zodiac",7511,300, "Piece_Of_Darkness",50, "Veteran_Axe",1, "Burning_Bow",1, "Burning_Heart",100; break; } mes "[Zodiac of the Month]"; mes "Awesome! Here you go. You gained ^FF0000" + getitemname (.Zodiac$[gettime(6) -1]) + "^000000 for this month!"; getitem .Zodiac$[gettime(DT_MONTH) - 1], 1; close; function Zodiac { } } function script Zodiac { mes "[ ^0000FF Required Items ^000000 ]"; mes "^FFFFFF________________________________^000000"; for (.@i = 0; getarg(.@i, 0); .@i+=2) { mes ((countitem(getarg(.@i)) < getarg(.@i + 1))?"^FF0000":"^0000FF")+"[ " + countitem(getarg(.@i)) + " / " + getarg(.@i + 1) + " ] ^0000FF" + getitemname(getarg(.@i)) + "^000000"; if (countitem(getarg(.@i)) < getarg(.@i + 1)) .@j++; } mes "^FFFFFF________________________________^000000"; if (.@j) { mes "[ ^FF0000Await completion for " + .@j + " Items^000000 ]"; close; } next; if (select("^FF0000Continue^000000", "Cancel") == 2) close; for(.@i = 0; getarg(.@i,0); .@i+=2) { delitem getarg(.@i), getarg(.@i + 1); } return; } Try this one.
  5. For the new version, you can find the commend in packets.hpp #ifndef PACKETVER /// Do NOT edit this line! To set your client version, please do this instead: /// In Windows: Add this line in your src\custom\defines_pre.hpp file: #define PACKETVER YYYYMMDD /// In Linux: The same as above or run the following command: ./configure --enable-packetver=YYYYMMDD #define PACKETVER 20151104 #endif And it requires you to add a line for clarifying the client version in src\custom\defines_pre.hpp. For example // Copyright (c) rAthena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder #ifndef _CONFIG_CUSTOM_DEFINES_PRE_HPP_ #define _CONFIG_CUSTOM_DEFINES_PRE_HPP_ /** * rAthena configuration file (http://rathena.org) * For detailed guidance on these check http://rathena.org/wiki/SRC/config/ **/ #define PACKETVER 20180605 // <----------------- declear the client version here #endif // _CONFIG_CUSTOM_DEFINES_PRE_HPP_ And it seems that we don't need to modify the packet_ver_db in the new version.
  6. Original Post: 

     

    [UPDATED Charm Tutorial]

    To add an item which can apply an item bonus effect while in inventory.

     

    Step 1: Create new itemtype @ mmo.hpp

    enum item_types {
      IT_HEALING = 0,
      IT_UNKNOWN, //1
      IT_USABLE,  //2
      IT_ETC,     //3
      IT_ARMOR,   //4
      IT_WEAPON,  //5
      IT_CARD,    //6
      IT_PETEGG,  //7
      IT_PETARMOR,//8
      IT_UNKNOWN2,//9
      IT_AMMO,    //10
      IT_DELAYCONSUME,//11
      IT_SHADOWGEAR,  //12
      IT_CHARM, //13 <<-------------  new itemtype. In this case, we are going to use "integer 13" to represent this itemtype
      IT_CASH = 18,
      IT_MAX
    };

    Step 2: Placement for "Charm" item, we are going to place this item at your inventory -> etc. @ clif.cpp

    static inline int itemtype(unsigned short nameid) {
      struct item_data* id = itemdb_search(nameid);
      int type = id->type;
      if( type == IT_SHADOWGEAR ) {
        if( id->equip&EQP_SHADOW_WEAPON )
          return IT_WEAPON;
        else
          return IT_ARMOR;
      }
      
      // ===============================================================
      // If the itemtype is IT_CHARM, we will place the item to ETC tab.
      // ===============================================================
      return ( type == IT_PETEGG ) ? IT_ARMOR : (type == IT_CHARM) ? IT_ETC : type;
    }

    Step 3: Handle the stackable or not,  you can customize your code here btw. @ itemdb.cpp

    bool itemdb_isstackable2(struct item_data *id) {
      nullpo_ret(id);
      switch(id->type) {
        case IT_WEAPON:
        case IT_ARMOR:
        case IT_PETEGG:
        case IT_PETARMOR:
        case IT_SHADOWGEAR:
        case IT_CHARM: // <<--------- If you don't want it stackable place the itemtype here.
          return false;
        default: // <<--------------- By default, it will stackable if you don't add itemtype above.
          return true;
      }
    }

    (Optional Step): Able to equip this item or not. @ itemdb.cpp

    bool itemdb_isequip2(struct item_data *id) {
      nullpo_ret(id);
      switch (id->type) {
        case IT_WEAPON:
        case IT_ARMOR:
        case IT_AMMO:
        case IT_SHADOWGEAR:
        case IT_CHARM: // <<------------------ If you want to able to equip, place an itemtype here.
          return true;
        default: // <<------------------------ By default, it will not able to equip.
          return false;
      }
    }

    Step 4: Add itemdb type name for "Charm" item. @ itemdb.cpp

    const char* itemdb_typename(enum item_types type) {
      switch(type) {
          case IT_HEALING:        return "Potion/Food";
          case IT_USABLE:         return "Usable";
          case IT_ETC:            return "Etc.";
          case IT_WEAPON:         return "Weapon";
          case IT_ARMOR:          return "Armor";
          case IT_CARD:           return "Card";
          case IT_PETEGG:         return "Pet Egg";
          case IT_PETARMOR:       return "Pet Accessory";
          case IT_AMMO:           return "Arrow/Ammunition";
          case IT_DELAYCONSUME:   return "Delay-Consume Usable";
          case IT_SHADOWGEAR:     return "Shadow Equipment";
          case IT_CASH:           return "Cash Usable";
          case IT_CHARM:          return "Charms"; // <<--------------------- Add itemdb type name here.
        }
      return "Unknown Type";
    }

    Step 5: Accept the "IT_CHARM" itemtype go through the itemdb parse function @ itemdb.cpp

    static bool itemdb_parse_dbrow(char** str, const char* source, int line, int scriptopt) {
      // many codes....
      id->type = atoi(str[3]);
      
      // ================================================================================================================
      // Exclude the IT_CHARM from the exception
      // It depends on which ID you set in the mmo.hpp. In this case, we use ID = 13, which is less than IT_CASH (18).
      // Therefore, from 14 to 17 are invalid value from itemdb. And it will cause an error when doing parse from itemdb.
      // ================================================================================================================
      if( id->type < 0 || id->type == IT_UNKNOWN || id->type == IT_UNKNOWN2 || ( id->type > IT_CHARM && id->type < IT_CASH ) || id->type >= IT_MAX )
      { // catch invalid item types
        ShowWarning("itemdb_parse_dbrow: Invalid item type %d for item %hu. IT_ETC will be used.\n", id->type, nameid);
        id->type = IT_ETC;
      }
      // many codes....
    }

    Step 6: Set "CHARM" item to auto equip. @ pc.cpp

    char pc_additem(struct map_session_data *sd,struct item *item,int amount,e_log_pick_type log_type) {
      // [many codes...]
      
      clif_updatestatus(sd,SP_WEIGHT);
      
      //Auto-equip
      if(id->flag.autoequip)
        pc_equipitem(sd, i, id->equip);
      
      // ==========================================================================================
      // If the itemtype is CHARM, then we will call the status_calc_pc for updating player status.
      // ==========================================================================================
      if (id->type == IT_CHARM)
        status_calc_pc(sd, SCO_NONE);
      
      // [many codes...]
    }

    Step 7: Handle drop item @ pc.cpp

    char pc_delitem(struct map_session_data *sd,int n,int amount,int type, short reason, e_log_pick_type log_type) {
      // =====================================
      // add tempoary int for storing itemtype
      // =====================================
      int mem = -1;
      nullpo_retr(1, sd);
      if(n < 0 || sd->inventory.u.items_inventory[n].nameid == 0 || amount <= 0 || sd->inventory.u.items_inventory[n].amount<amount || sd->inventory_data[n] == NULL)
        return 1;
      
      log_pick_pc(sd, log_type, -amount, &sd->inventory.u.items_inventory[n]);
      
      sd->inventory.u.items_inventory[n].amount -= amount;
      sd->weight -= sd->inventory_data[n]->weight*amount ;
      if( sd->inventory.u.items_inventory[n].amount <= 0 ){
        if(sd->inventory.u.items_inventory[n].equip)
          pc_unequipitem(sd,n,2|(!(type&4) ? 1 : 0));
        memset(&sd->inventory.u.items_inventory[n],0,sizeof(sd->inventory.u.items_inventory[0]));
        
        // ===========================
        // store the itemtype to `mem`
        // ===========================
        mem = sd->inventory_data[n]->type;
    
        sd->inventory_data[n] = NULL;
      }
      if(!(type&1))
        clif_delitem(sd,n,amount,reason);
      if(!(type&2))
        clif_updatestatus(sd,SP_WEIGHT);
      
      // ===============================================
      // If is CHARM item, then update the player status
      // ===============================================
      if (mem == IT_CHARM)
        status_calc_pc(sd, SCO_NONE);
    
    	return 0;
    }

    Step 8: Handle the status calc function @ status.cpp

    int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
      // [many codes...]
      // Autobonus
      pc_delautobonus(sd,sd->autobonus,ARRAYLENGTH(sd->autobonus),true);
      pc_delautobonus(sd,sd->autobonus2,ARRAYLENGTH(sd->autobonus2),true);
      pc_delautobonus(sd,sd->autobonus3,ARRAYLENGTH(sd->autobonus3),true);
      
      // ================================
      // Calculate CHARM item effect here
      // ================================
      // Loop the whole inventory
      for ( i=0; i < MAX_INVENTORY; i++ ) {
        // If the item is not IT_CHARM, then skip it.
        if ( !sd->inventory_data[i] || sd->inventory_data[i]->type != IT_CHARM )
          continue;
        // Check the CHARM item level limitation and job limitation (you can customize the condition here)
        if ( sd->inventory_data[i]->script && sd->inventory_data[i]->elv <= sd->status.base_level && sd->inventory_data[i]->class_upper ) {
          // If player match the condition, then run the item bonus script.
          run_script( sd->inventory_data[i]->script, 0, sd->bl.id, 0 );
          if ( !calculating ) //Abort, run_script retriggered this. [Skotlex]
            return 1;
        }
      }
      // [many codes...]
    }

    Step 9: Recompile your server

    Step 10: Add CHARM item to itemdb.txt. For example:

    // all + 100 charm item
    701,Ora_Ora,Ora Ora,13,10,,100,,10,,0,0xFFFFFFFF,63,2,16,,0,1,0,{ bonus bAllStats,100; },{},{}

     

    Have fun!!!!

  7. I fixed it. It seems that the source code is changed a lot. for checking item type, use: int itemetype = sd->inventory_data[itemIndex]->type; btw, map server down when drop item is caused by accessing the null value in my case... how stupid am I?
  8. You can use the following code for item type checking: // pc.c - pc_additem function if (id->type == IT_CHARM) Currently, I can add the item and apply the effect successfully. However, if I drop the item, it makes the map server down... Can someone help me? There are no any error logs in the map server window.
  9. Connection speed is much faster!!! Thanks for all developers!
  10. 1. Your server was due in 4 days. (When the abuse happened) -> That does not the main reason you can say that I abuse 2. You were online during this whole thing, and amazingly, hopped on to LiveChat instantly after your server got suspended. -> I am living in Asia, I got the email which said my server is suspended and the email said I need to con't tact you asap. That's why I find you immediately. Here is the email that the system sent to me: Translate the date from chinese to english -> 2017/3/10 5:59 PM (I believe that you won't sleep or AFK @ PM 5:59) Chat log here (Started from 6:00 PM): 3. You weren't as insistent about your denial on the issue (though of course you did deny it, just not at a level I expected). -> no comment that is your feeling. I said I did not know why and I don't know the reason that made the issue happened. That's why I found you. Finally, I got the access log. Thx @Conflicts it helps me a lot to avoid the same issue happen again. And that is what I want to find you and not to argue with you. At least I know why cause the server do something I didn't know and what I need to notice when I launch the server next time.
  11. All of Ragnarok server hosting service providers are the reseller. If you have no idea how to configure the server. For example, install MySQL, git and no experience on the command line. Those providers could save your time. But you must have to take your risk, they might not active all the time which mean if your server is down and you are hard to find them to fix it. For my opinion, I won't use Ragnarok server hosting service again. I tried to use Rag**Hos*ing for prototyping before. And they suspended my server with unreasonable reason. I tried to get the logs for more information but they didn't provide it to me. Currently, I am using AWS for my server. All the things are built with my hand. Btw, on this sides, you will need to spend a lot of time for doing research on how to install blah blah blah. XDD UPDATE(12/3/2017): Rag**Hos*ing has been sent the access log to me for references.
  12. Try ordering it again and when you get to shipping click 'Update Shipping' after inputting your address. We can ship internationally. Regards, ~Azura Skyy Yeah! It's fine now. Thx
  13. sosad, it seems that it cannot ship to Hong Kong
  14. I would like to change the consumption of skill point. I did some research on "Adding new skill" from rAthena Wiki. Here is the link. And hope to find some possible way to modify what I want. But there is mentioned dev can modify the skill status (damage calc, cast time or skill tree etc.). Anyone can help me figure it out?
  15. @secretdataz I'm new to using rAthena. What is the packet_key_ver for this launcher version that I need to change in packet_db.txt?
×
×
  • Create New...