Jump to content

M4karov

Members
  • Posts

    149
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by M4karov

  1. Usted necesita utilizar client 2017 para poder usar ese sistema.
  2. Parabéns pelo guia, nem sonhava que isso era possível.
  3. Because I greatly enjoy the Fairy Tail guild master.
  4. I am also looking for a guide to add custom class. But I find no updated guide with the current emulator.
  5. What version of gcc / g ++? To compile the emulator it is necessary to have it installed in version 5 or higher.
  6. Are you using which version of the emulator? And what is your operating system?
  7. @whodhell // Copyright (c) rAthena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder #ifndef _CONFIG_PACKETS_H_ #define _CONFIG_PACKETS_H_ /** * rAthena configuration file (http://rathena.org) * For detailed guidance on these check http://rathena.org/wiki/SRC/config/ **/ #ifndef PACKETVER #define PACKETVER 20120410 #endif #ifndef PACKETVER_RE /// From this point on only kRO RE clients are supported #if PACKETVER > 20151104 #define PACKETVER_RE #endif #endif #if PACKETVER >= 20110817 /// Comment to disable the official packet obfuscation support. /// This requires PACKETVER 2011-08-17 or newer. #ifndef PACKET_OBFUSCATION //#define PACKET_OBFUSCATION // Define these inside src/custom/defines_pre.h or src/custom/defines_post.h //#define PACKET_OBFUSCATION_KEY1 <key1> //#define PACKET_OBFUSCATION_KEY2 <key2> //#define PACKET_OBFUSCATION_KEY3 <key3> /// Comment this to disable warnings for missing client side encryption //#define PACKET_OBFUSCATION_WARN #endif #else #if defined(PACKET_OBFUSCATION) #error You enabled packet obfuscation for a version which is too old. Minimum supported client is 2011-08-17. #endif #endif #ifndef DUMP_UNKNOWN_PACKET //#define DUMP_UNKNOWN_PACKET #endif #ifndef DUMP_INVALID_PACKET //#define DUMP_INVALID_PACKET #endif /** * No settings past this point **/ /// Check if the specified packetversion supports the pincode system #define PACKETVER_SUPPORTS_PINCODE PACKETVER >= 20110309 /// Check if the client needs delete_date as remaining time and not the actual delete_date (actually it was tested for clients since 2013) #define PACKETVER_CHAR_DELETEDATE (PACKETVER > 20130000 && PACKETVER <= 20141022) || PACKETVER >= 20150513 /// Check if the specified packetvresion supports the cashshop sale system #define PACKETVER_SUPPORTS_SALES PACKETVER >= 20131223 #endif // _CONFIG_PACKETS_H_
  8. The configuration that was previously in mmo.h is now there in this file. Do not forget to disable the obfuscation packet.
  9. To define the client used go to the file: src/config/packets.h #ifndef PACKETVER #define PACKETVER 20151104 #endif
  10. I would like help from someone who understands modifications to the source code, to update this code for the current emulator. doc/script_commands.txt | 49 ++++++++++++++++++++++++++---- src/map/clif.c | 6 ++++ src/map/pc.c | 9 ++++-- src/map/pc.h | 15 ++++++++++ src/map/script.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++++ src/map/status.c | 4 +++ 6 files changed, 155 insertions(+), 7 deletions(-) diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 218bb48..24e64ec 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -5859,12 +5859,11 @@ Examples: --------------------------------------- -*pcblockmove <id>,<option>; +*pcblockmove <account ID>,<option>; -Prevents the given ID from moving when the option != 0, and 0 enables the -ID to move again. The ID can either be the GID of a monster/NPC or account -ID of a character, and will run for the attached player if zero is -supplied. +Prevents the player from moving when the option > 0, and 0 enables the +player to move again. The player has to be the account ID of a character, +and will run for the attached player if zero is supplied. Examples: @@ -5874,6 +5873,46 @@ Examples: // Enables the current char to move again. pcblockmove getcharid(3),0; +--------------------------------------- + +*pcblock <type>,<option>{,<account ID>}; + +Prevents the player from doing the following actions when the <option> is +true(1), and false(0) will return the player to original state. If there is +no account ID given, the script will run for the attached player. + +The <type> listed are :- + BLOCK_MOVE 1 + BLOCK_ATTACK 2 + BLOCK_SKILL 4 + BLOCK_USEITEM 8 + BLOCK_CHAT 16 + BLOCK_IMMUNE 32 + BLOCK_SITSTAND 64 + +Examples: + +// Make the current attached player invulnerable, same as @monsterignore + pcblock BLOCK_IMMUNE, true; + +// Prevents the current char from attacking and using skills + pcblock BLOCK_ATTACK|BLOCK_SKILL, true, getcharid(3); + +--------------------------------------- + +*checkpcblock({<account ID>}) + +This command will return the options of the current attached player used by +'pcblock' command. Additionally, you may insert account ID within the bracket +to check on another player. + +Examples: + + if ( checkpcblock() & BLOCK_IMMUNE ) + mes "You are invulnerable !"; + + if ( checkpcblock() & (BLOCK_ATTACK|BLOCK_SKILL) ) + mes "You are unable to attack and use any skills."; --------------------------------------- //===================================== diff --git a/src/map/clif.c b/src/map/clif.c index 80703fa..6584b58 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9963,6 +9963,9 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type, return; } + if( sd->state.blockedsitstand ) // *pcblock script command + return; + if (sd->ud.skilltimer != INVALID_TIMER || (sd->sc.opt1 && sd->sc.opt1 != OPT1_BURNING )) break; @@ -9987,6 +9990,9 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type, return; } + if( sd->state.blockedsitstand ) // *pcblock script command + return; + if( battle_config.idletime_criteria & BCIDLE_SIT ) sd->idletime = sockt->last_tick; diff --git a/src/map/pc.c b/src/map/pc.c index 4d4f415..f198fa3 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -4894,6 +4894,9 @@ int pc_useitem(struct map_session_data *sd,int n) { if( sd->status.inventory[n].nameid <= 0 || sd->status.inventory[n].amount <= 0 ) return 0; + if( sd->state.blockeduseitem ) // *pcblock script command + return 0; + if( !pc->isUseitem(sd,n) ) return 0; @@ -8890,7 +8893,8 @@ bool pc_can_attack( struct map_session_data *sd, int target_id ) { (sd->sc.data[SC_SIREN] && sd->sc.data[SC_SIREN]->val2 == target_id) || sd->sc.data[SC_BLADESTOP] || sd->sc.data[SC_DEEP_SLEEP] || - sd->sc.data[SC_FALLENEMPIRE] ) + sd->sc.data[SC_FALLENEMPIRE] || + sd->state.blockedattack ) return false; return true; @@ -8906,7 +8910,8 @@ bool pc_can_talk( struct map_session_data *sd ) { if( sd->sc.data[SC_BERSERK] || (sd->sc.data[SC_DEEP_SLEEP] && sd->sc.data[SC_DEEP_SLEEP]->val2) || - (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT) ) + (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT) || + sd->state.blockedchat ) return false; return true; diff --git a/src/map/pc.h b/src/map/pc.h index 2c8b24a..8227ca1 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -172,6 +172,11 @@ struct map_session_data { unsigned int size :2; // for tiny/large types unsigned int night :1; //Holds whether or not the player currently has the SI_NIGHT effect on. [Skotlex] unsigned int blockedmove :1; + unsigned int blockedattack :1; + unsigned int blockedskill :1; + unsigned int blockeduseitem :1; + unsigned int blockedchat :1; + unsigned int blockedsitstand :1; unsigned int using_fake_npc :1; unsigned int rewarp :1; //Signals that a player should warp as soon as he is done loading a map. [Skotlex] unsigned int killer : 1; @@ -757,6 +762,16 @@ struct autotrade_vending { struct hplugin_data_store *hdata; ///< HPM Plugin Data Store }; +enum pc_block_action { + PCBLOCK_MOVE = 0x1, + PCBLOCK_ATTACK = 0x2, + PCBLOCK_SKILL = 0x4, + PCBLOCK_USEITEM = 0x8, + PCBLOCK_CHAT = 0x10, + PCBLOCK_IMMUNE = 0x20, + PCBLOCK_SITSTAND = 0x40, +}; + /*===================================== * Interface : pc.h * Generated by HerculesInterfaceMaker diff --git a/src/map/script.c b/src/map/script.c index 54d8d33..b93eeaa 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -16300,6 +16300,74 @@ BUILDIN(pcblockmove) { return true; } +BUILDIN(pcblock) { + int type, flag; + TBL_PC *sd = NULL; + + type = script_getnum(st,2); + flag = script_getnum(st,3); + if ( script_hasdata(st,4) ) + sd = map->id2sd(script_getnum(st,4)); + else + sd = script->rid2sd(st); + + if ( !sd ) + return true; + + if ( !type ) { + ShowError("buildin_pcblock: Invalid type.\n"); + return false; + } + + if ( type & PCBLOCK_MOVE ) + sd->state.blockedmove = flag > 0; + if ( type & PCBLOCK_ATTACK ) + sd->state.blockedattack = flag > 0; + if ( type & PCBLOCK_SKILL ) + sd->state.blockedskill = flag > 0; + if ( type & PCBLOCK_USEITEM ) + sd->state.blockeduseitem = flag > 0; + if ( type & PCBLOCK_CHAT ) + sd->state.blockedchat = flag > 0; + if ( type & PCBLOCK_IMMUNE ) + sd->state.monster_ignore = flag > 0; + if ( type & PCBLOCK_SITSTAND ) + sd->state.blockedsitstand = flag > 0; + + return true; +} + +BUILDIN(checkpcblock) { + int val = 0; + TBL_PC *sd = NULL; + + if ( script_hasdata(st,2) ) + sd = map->id2sd(script_getnum(st,2)); + else + sd = script->rid2sd(st); + + if ( !sd ) + return true; + + if ( sd->state.blockedmove ) + val |= PCBLOCK_MOVE; + if ( sd->state.blockedattack ) + val |= PCBLOCK_ATTACK; + if ( sd->state.blockedskill ) + val |= PCBLOCK_SKILL; + if ( sd->state.blockeduseitem ) + val |= PCBLOCK_USEITEM; + if ( sd->state.blockedchat ) + val |= PCBLOCK_CHAT; + if ( sd->state.monster_ignore ) + val |= PCBLOCK_IMMUNE; + if ( sd->state.blockedsitstand ) + val |= PCBLOCK_SITSTAND; + + script_pushint(st,val); + return true; +} + BUILDIN(pcfollow) { int id, targetid; TBL_PC *sd = NULL; @@ -20234,6 +20302,8 @@ void script_parse_builtin(void) { BUILDIN_DEF(pcfollow,"ii"), BUILDIN_DEF(pcstopfollow,"i"), BUILDIN_DEF(pcblockmove,"ii"), + BUILDIN_DEF(pcblock,"ii?"), + BUILDIN_DEF(checkpcblock,"?"), // <--- [zBuffer] List of player cont commands // [zBuffer] List of mob control commands ---> BUILDIN_DEF(unitwalk,"ii?"), @@ -20509,6 +20579,15 @@ void script_hardcoded_constants(void) { script->set_constant("BG_AREA_WOS",BG_AREA_WOS,false); script->set_constant("BG_QUEUE",BG_QUEUE,false); + /* pc_block_action */ + script->set_constant("BLOCK_MOVE",PCBLOCK_MOVE,false); + script->set_constant("BLOCK_ATTACK",PCBLOCK_ATTACK,false); + script->set_constant("BLOCK_SKILL",PCBLOCK_SKILL,false); + script->set_constant("BLOCK_USEITEM",PCBLOCK_USEITEM,false); + script->set_constant("BLOCK_CHAT",PCBLOCK_CHAT,false); + script->set_constant("BLOCK_IMMUNE",PCBLOCK_IMMUNE,false); + script->set_constant("BLOCK_SITSTAND",PCBLOCK_SITSTAND,false); + /* Renewal */ #ifdef RENEWAL script->set_constant("RENEWAL", 1, false); diff --git a/src/map/status.c b/src/map/status.c index 1a07f74..bf6e23b 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -1600,6 +1600,10 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, uin if( skill_id ) { + if ( src && src->type == BL_PC ) // *pcblock script command + if ( ((TBL_PC*)src)->state.blockedskill ) + return 0; + if( src && !(src->type == BL_PC && ((TBL_PC*)src)->skillitem)) { // Items that cast skills using 'itemskill' will not be handled by map_zone_db. int i;
  11. Thanks for answering. I'm going to study about these commands.
  12. Hello guys. I'm trying to modify the Weapon Refine ability to refine armor. I tried the following modification but it did not work. Modification: diff --git a/src/map/clif.c b/src/map/clif.c index af7eb0e..2804043 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -6711,7 +6711,7 @@ void clif_item_refine_list(struct map_session_data *sd) fd=sd->fd; - refine_item[0] = -1; + refine_item[0] = pc_search_inventory(sd,ITEMID_ELUNIUM); refine_item[1] = pc_search_inventory(sd,ITEMID_PHRACON); refine_item[2] = pc_search_inventory(sd,ITEMID_EMVERETARCON); refine_item[3] = refine_item[4] = pc_search_inventory(sd,ITEMID_ORIDECON); @@ -6722,7 +6722,7 @@ void clif_item_refine_list(struct map_session_data *sd) unsigned char wlv; if(sd->inventory.u.items_inventory[i].nameid > 0 && sd->inventory.u.items_inventory[i].refine < skill_lv && sd->inventory.u.items_inventory[i].identify && (wlv = itemdb_wlv(sd->inventory.u.items_inventory[i].nameid)) >=1 && - refine_item[wlv] != -1 && !(sd->inventory.u.items_inventory[i].equip&EQP_ARMS)){ + refine_item[wlv] != -1){ WFIFOW(fd,c*13+ 4)=i+2; WFIFOW(fd,c*13+ 6) = sd->inventory.u.items_inventory[i].nameid; WFIFOB(fd,c*13+ 8) = sd->inventory.u.items_inventory[i].refine; diff --git a/src/map/itemdb.h b/src/map/itemdb.h index a95236f..dd0e665 100644 --- a/src/map/itemdb.h +++ b/src/map/itemdb.h @@ -62,6 +62,7 @@ enum item_itemid ITEMID_ORIDECON_STONE = 756, ITEMID_ALCOHOL = 970, ITEMID_ORIDECON = 984, + ITEMID_ELUNIUM = 985, ITEMID_ANVIL = 986, ITEMID_ORIDECON_ANVIL = 987, ITEMID_GOLDEN_ANVIL = 988, diff --git a/src/map/skill.c b/src/map/skill.c index fbc15d4..3ec44f5 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -16739,9 +16739,9 @@ void skill_weaponrefine(struct map_session_data *sd, int idx) struct item_data *ditem = sd->inventory_data[idx]; item = &sd->inventory.u.items_inventory[idx]; - if(item->nameid > 0 && ditem->type == IT_WEAPON) { + if(item->nameid > 0) { int i = 0, per; - unsigned short material[5] = { 0, ITEMID_PHRACON, ITEMID_EMVERETARCON, ITEMID_ORIDECON, ITEMID_ORIDECON }; + unsigned short material[5] = { ITEMID_ELUNIUM, ITEMID_PHRACON, ITEMID_EMVERETARCON, ITEMID_ORIDECON, ITEMID_ORIDECON }; if( ditem->flag.no_refine ) { // if the item isn't refinable clif_skill_fail(sd,sd->menuskill_id,USESKILL_FAIL_LEVEL,0); return;
  13. https://github.com/rathena/rathena/wiki/Install-on-Centos#install-prerequisites
  14. Exactly. The library is nothing more than an npc with functions for its systems.
  15. The above system requires that the item be equipped to work. What I need is to refine without being equipped. http://prntscr.com/gatseg Thanks for the tip, but I can not buy a script at the moment, so I want help to learn how to create the system I need. I appreciate the work of our friend, but at the moment I can not acquire his system.
  16. I did not understand your doubt. Could you clarify it better?
  17. Hello everyone, I hope everyone is well. I have a small question, is there a possibility of refining equipment without it being equipped? Should I only have it in my inventory?
  18. Thanks to our friend @Secrets we now have the option on Nemo to disable Doram when it comes to preparing the client. https://github.com/secretdataz/NEMO/commit/10e9c99b39ea2920b908c027fd5ab736bdaf6bd5
  19. Sleep2 only works on the player. Swap for sleep. -- sleep2 1000; ++ sleep 1000;
  20. Sorry. - script kickmap_vip -1,{ OnInit: .map$ = "prontera"; .interval = 5; setmapflag .map$, mf_loadevent; end; OnPCLoadMapEvent: if (strcharinfo(3) == .map$) { if (!vip_status(VIP_STATUS_ACTIVE) ) { warp "SavePoint",0,0; } else { addtimer (.interval * 1000), strnpcinfo(0)+"::OnPCLoadMapEvent"; } } end; }
  21. - script kickmap_vip -1,{ OnInit: .Time = 5; while( 1 ){ if (strcharinfo (3) == "vip_room" &&! Vip_status (1) && getgmlevel () == 0) { warp "SavePoint", 0,0; } sleep ( .Time * 60000 ); } end; }
  22. I minded this one: ALTER TABLE `vendings` ADD COLUMN `extended_vending_item` smallint(5) unsigned NOT NULL DEFAULT '0' AFTER `sit`;
×
×
  • Create New...