From db231e817c5f6d6783b07d91e1d8b0d1243829dd Mon Sep 17 00:00:00 2001 From: skotlex Date: Sun, 17 Feb 2008 22:36:02 +0000 Subject: - Updated Eye of Hellion to use the new format of the input command. - corrected login_fd/char_fd being uninitialized in the char servers. - Changed a bit around how status_base_atk works to avoid overflows. - Added a check to prevent using consume-delay items when you cannot use skills, since that opens an exploit if the item also has non-skill-casting components to its script. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12214 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 5 +++++ npc/Changelog.txt | 2 ++ npc/quests/eye_of_hellion.txt | 7 ++++--- src/char/char.c | 2 +- src/char_sql/char.c | 2 +- src/map/atcommand.c | 2 +- src/map/pc.c | 7 +++++++ src/map/status.c | 15 +++++++++++---- 8 files changed, 32 insertions(+), 10 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 62d4ad2ee..b81fb12b5 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -3,6 +3,11 @@ Date Added AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. +2008/02/17 + * corrected login_fd/char_fd being uninitialized in the char servers. + * Added a check to prevent using consume-delay items when you cannot use + skills, since that opens an exploit if the item also has non-skill-casting + components to its script. [Skotlex] 2008/02/14 * Removed/replaced all calls to map_getallusers (followup to r12195) * Trashed @whozeny (from r269) [ultramage] diff --git a/npc/Changelog.txt b/npc/Changelog.txt index e199adcc2..723a7548d 100644 --- a/npc/Changelog.txt +++ b/npc/Changelog.txt @@ -1,5 +1,7 @@ Date Added ====== +2008/02/17 + * Updated Eye of Hellion to use the new format of the input command. [Skotlex] 2008/02/13 * Corrected a "donpcevent" missing a ":" in Cooking Quest. (bugreport:962) [Samuray22] * Corrected a Typo error in quest_prontera.txt. (bugreport:950) diff --git a/npc/quests/eye_of_hellion.txt b/npc/quests/eye_of_hellion.txt index 0cf1062ee..a2b3c2a17 100644 --- a/npc/quests/eye_of_hellion.txt +++ b/npc/quests/eye_of_hellion.txt @@ -3,7 +3,7 @@ //===== By: ================================================== //= MasterOfMuppets //===== Current Version: ===================================== -//= 1.4 +//= 1.5 //===== Compatible With: ===================================== //= eAthena SVN 3422+(Requires jA Script System) //===== Description: ========================================= @@ -16,6 +16,7 @@ //= 1.2 Fixed experience gains to match upcoming rate adjustments. [SinSloth] //= 1.3 Corrected NPC names to fall within proper restrictions. [L0ne_W0lf] //= 1.4 Moved Enoz from the wizard quest skill to here. [L0ne_W0lf] +//= 1.5 Updated input calls to allow the high-value code to be entered [Skotlex] //============================================================ geffen,110,200,3 script Sage Welshyun 754,2,2,{ @@ -897,7 +898,7 @@ s_Insert: mes "Ah, right, the numbers"; mes "that Veggie Lady gave me!"; next; - input @temp; + input @temp,0,99999999; if(@temp != 16754213)goto s_FailInp; s_CorrectInput: mes "^3151FFThe machine responds to"; @@ -931,7 +932,7 @@ s_Input2: mes "if I can enter the"; mes "right number this time..."; next; - input @temp; + input @temp,0,99999999; if(@temp == 16754213)goto s_CorrectInput; s_FailInp: diff --git a/src/char/char.c b/src/char/char.c index d853a72ba..ae0c8593e 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -64,7 +64,7 @@ struct mmo_map_server { unsigned short map[MAX_MAP_PER_SERVER]; } server[MAX_MAP_SERVERS]; -int login_fd, char_fd; +int login_fd=-1, char_fd=-1; char userid[24]; char passwd[24]; char server_name[20]; diff --git a/src/char_sql/char.c b/src/char_sql/char.c index 7839c1b96..c3fcde1e1 100644 --- a/src/char_sql/char.c +++ b/src/char_sql/char.c @@ -84,7 +84,7 @@ struct mmo_map_server { unsigned short map[MAX_MAP_PER_SERVER]; } server[MAX_MAP_SERVERS]; -int login_fd, char_fd; +int login_fd=-1, char_fd=-1; char userid[24]; char passwd[24]; char server_name[20]; diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 0faa040ef..8da0f1265 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -5182,7 +5182,7 @@ int atcommand_disguise(const int fd, struct map_session_data* sd, const char* co *------------------------------------------*/ int atcommand_disguiseall(const int fd, struct map_session_data* sd, const char* command, const char* message) { - int mob_id=0, i=0; + int mob_id=0; struct map_session_data *pl_sd; struct s_mapiterator* iter; nullpo_retr(-1, sd); diff --git a/src/map/pc.c b/src/map/pc.c index 218e40e24..99fcb0ace 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -3087,6 +3087,13 @@ int pc_useitem(struct map_session_data *sd,int n) )) return 0; + //Since most delay-consume items involve using a "skill-type" target cursor, + //perform a skill-use check before going through. [Skotlex] + //resurrection was picked as testing skill, as a non-offensive, generic skill, it will do. + if (sd->inventory_data[n]->flag.delay_consume && + !status_check_skilluse(&sd->bl, &sd->bl, ALL_RESURRECTION, 0)) + return 0; + sd->itemid = sd->status.inventory[n].nameid; sd->itemindex = n; if(sd->catch_target_class != -1) //Abort pet catching. diff --git a/src/map/status.c b/src/map/status.c index 015ce1ddf..d4836919f 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -1226,7 +1226,7 @@ int status_base_amotion_pc(struct map_session_data* sd, struct status_data* stat return amotion; } -static int status_base_atk(struct block_list *bl, struct status_data *status) +static unsigned short status_base_atk(struct block_list *bl, struct status_data *status) { int flag = 0, str, dex, dstr; @@ -1259,7 +1259,7 @@ static int status_base_atk(struct block_list *bl, struct status_data *status) str += dstr*dstr; if (bl->type == BL_PC) str+= dex/5 + status->luk/5; - return str; + return cap_value(str, 0, USHRT_MAX); } #define status_base_matk_max(status) (status->int_+(status->int_/5)*(status->int_/5)) @@ -1293,7 +1293,11 @@ void status_calc_misc(struct block_list *bl, struct status_data *status, int lev else status->flee2 = 0; - status->batk += status_base_atk(bl, status); + if (status->batk) { + int temp = status->batk + status_base_atk(bl, status); + status->batk = cap_value(temp, 0, USHRT_MAX); + } else + status->batk = status_base_atk(bl, status); if (status->cri) switch (bl->type) { case BL_MOB: @@ -3004,7 +3008,10 @@ void status_calc_bl(struct block_list *bl, unsigned long flag) status->batk = status_base_atk(bl,status); temp = b_status->batk - status_base_atk(bl,b_status); if (temp) - status->batk += temp; + { + temp += status->batk; + status->batk = cap_value(temp, 0, USHRT_MAX); + } status->batk = status_calc_batk(bl, sc, status->batk); } -- cgit v1.2.3-70-g09d2