From 50e31d2860fe8f754d186a35ac1b4b61f653af5a Mon Sep 17 00:00:00 2001 From: skotlex Date: Mon, 27 Mar 2006 14:54:40 +0000 Subject: - Pet catching now uses the menuskill variables to prevent item usage from disrupting the catch process. - Added Safetywall to the list not blocked by Dispell. - Added some include limits.h required by window compiles. - Corrected Wedding rings being trade-able. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5772 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 6 ++++++ db/item_trade.txt | 8 ++++---- src/map/atcommand.c | 1 + src/map/charcommand.c | 1 + src/map/clif.c | 11 ++++++++--- src/map/pc.c | 3 ++- src/map/pet.c | 22 ++++++++++++++-------- src/map/skill.c | 1 + src/map/status.c | 2 +- 9 files changed, 38 insertions(+), 17 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 9e0f1d9dd..16a32d195 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -5,6 +5,12 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EV GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS +2006/03/27 + * Pet catching now uses the menuskill variables to prevent item usage from + disrupting the catch process. [Skotlex] + * Added Safetywall to the list not blocked by Dispell. [Skotlex] + * Added some include limits.h required by window compiles. [Skotlex] + * Corrected Wedding rings being trade-able. [Skotlex] 2006/03/26 * GCC on Cygwin still complaining, resorted to including limits.h in malloc.h [Lance] * Refixed the fix with a constant list for Win32 users - limits.h (imported from MSVC) [Lance] diff --git a/db/item_trade.txt b/db/item_trade.txt index 099fc1f8b..3d0a4802c 100644 --- a/db/item_trade.txt +++ b/db/item_trade.txt @@ -4,7 +4,7 @@ //Trading mask values: //1:Item can't be drop //2:Item can't be traded (nor vended) -//4:Item can only be traded with wedded partner +//4:Wedded partner can override restriction 2. //8:Item can't be sold to npcs //16:Item can't be placed in the cart //32:Item can't be placed in the storage @@ -12,8 +12,8 @@ //Example: //1161,67,50 //Balmung: No drop, No trade, No Guild Store (1+2+64 =67), //only GMs of GM-level 50 and up can override the setting. -2634,109,100 -2635,109,100 +2634,111,100 +2635,111,100 2644,99,100 //Novice Red Potion 569,8,100 @@ -25,4 +25,4 @@ //7475,123,100 //7476,123,100 //Leather Pouch (part of Cooking Quest) -7432,123,100 \ No newline at end of file +7432,123,100 diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 9d4bbe155..8cde99aa2 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -6,6 +6,7 @@ #include #include #include +#include #include "../common/socket.h" #include "../common/timer.h" diff --git a/src/map/charcommand.c b/src/map/charcommand.c index 27e92029a..940e51876 100644 --- a/src/map/charcommand.c +++ b/src/map/charcommand.c @@ -6,6 +6,7 @@ #include #include #include +#include #include "../common/socket.h" #include "../common/timer.h" diff --git a/src/map/clif.c b/src/map/clif.c index 1e7f6baa9..45142ae29 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9,6 +9,7 @@ #include #include #include +#include #ifdef __WIN32 #define __USE_W32_SOCKETS #include @@ -6863,7 +6864,11 @@ int clif_catch_process(struct map_session_data *sd) WFIFOHEAD(fd,packet_len_table[0x19e]); WFIFOW(fd,0)=0x19e; WFIFOSET(fd,packet_len_table[0x19e]); - + sd->menuskill_id = SA_TAMINGMONSTER; + if (sd->ud.skillid == SA_TAMINGMONSTER) + sd->menuskill_lv = 0; //Free catch + else + sd->menuskill_lv = sd->itemid; //Consume catch return 0; } @@ -6915,7 +6920,7 @@ int clif_sendegg(struct map_session_data *sd) WFIFOSET(fd,WFIFOW(fd,2)); sd->menuskill_id = SA_TAMINGMONSTER; - sd->menuskill_lv = n; + sd->menuskill_lv = -1; return 0; } @@ -10955,7 +10960,7 @@ void clif_parse_CatchPet(int fd, struct map_session_data *sd) { void clif_parse_SelectEgg(int fd, struct map_session_data *sd) { RFIFOHEAD(fd); - if (sd->menuskill_id != SA_TAMINGMONSTER) + if (sd->menuskill_id != SA_TAMINGMONSTER || sd->menuskill_lv != -1) return; pet_select_egg(sd,RFIFOW(fd,2)-2); sd->menuskill_lv = sd->menuskill_id = 0; diff --git a/src/map/pc.c b/src/map/pc.c index 95aab502f..f51d86ecc 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -1474,7 +1474,8 @@ int pc_bonus(struct map_session_data *sd,int type,int val) case SP_INFINITE_ENDURE: if(sd->state.lr_flag != 2) { sd->special_state.infinite_endure = 1; - sc_start(&sd->bl, SC_ENDURE,100,1,0); + if (sd->sc.data[SC_ENDURE].timer == -1) + sc_start(&sd->bl, SC_ENDURE,100,1,0); } break; case SP_INTRAVISION: // Maya Purple Card effect allowing to see Hiding/Cloaking people [DracoRPG] diff --git a/src/map/pet.c b/src/map/pet.c index ed7309808..1a8e2d557 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -591,20 +591,26 @@ int pet_catch_process2(struct map_session_data *sd,int target_id) return 1; } - if (sd->itemid > 0) + if (sd->menuskill_id != SA_TAMINGMONSTER) + { //Exploit? + clif_pet_rulet(sd,0); + sd->catch_target_class = -1; + return 1; + } + + if (sd->menuskill_lv > 0) { //Consume the pet lure [Skotlex] - if ((i = sd->itemindex) == -1 || - sd->status.inventory[i].nameid != sd->itemid || - !sd->inventory_data[i]->flag.delay_consume || - sd->status.inventory[i].amount < 1 - ) - { //Something went wrong, items moved or they tried an exploit. + i=pc_search_inventory(sd,sd->menuskill_lv); + if (i < 0) + { //they tried an exploit? clif_pet_rulet(sd,0); sd->catch_target_class = -1; return 1; } //Delete the item - sd->itemid = sd->itemindex = -1; + if (sd->itemid == sd->menuskill_lv) + sd->itemid = sd->itemindex = -1; + sd->menuskill_id = sd->menuskill_lv = 0; pc_delitem(sd,i,1,0); } diff --git a/src/map/skill.c b/src/map/skill.c index 3d8aa3544..992ed9ea1 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -4616,6 +4616,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in || i==SC_CP_WEAPON || i==SC_CP_SHIELD || i==SC_CP_ARMOR || i==SC_CP_HELM || i==SC_COMBO || i==SC_DANCING || i==SC_GUILDAURA || i==SC_EDP || i==SC_AUTOBERSERK || i==SC_CARTBOOST || i==SC_MELTDOWN || i==SC_MOONLIT + || i==SC_SAFETYWALL ) continue; if(i==SC_BERSERK) tsc->data[i].val4=1; //Mark a dispelled berserk to avoid setting hp to 100. diff --git a/src/map/status.c b/src/map/status.c index 48534e67b..172287bce 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -5191,7 +5191,7 @@ int status_change_timer(int tid, unsigned int tick, int id, int data) if(sc->data[type].timer != tid) { if(battle_config.error_log) - ShowError("status_change_timer: Mismatch for type %d: %d != %d\n",type,tid,sc->data[type].timer); + ShowError("status_change_timer: Mismatch for type %d: %d != %d (bl id %d)\n",type,tid,sc->data[type].timer, bl->id); return 0; } -- cgit v1.2.3-70-g09d2