From eb0a137041d3a5ee6385762b8374e98b3867d5a0 Mon Sep 17 00:00:00 2001 From: skotlex Date: Fri, 23 Feb 2007 18:41:56 +0000 Subject: - Minor cleanups - Adjusted menu-based skills so you can't reuse the same skill until you've dealt with the menu. - Adjust autospells so that removing an autospell works when the script of the card that removes the autospell is triggered before the script that adds the spell. - The "requested name of gm-hidden char" warning will not be displayed when the object in question is an NPC (since you can use Intravision to do this). - Corrected the header format for invisible npcs. - Venom Knife no longer takes into accounts cards or EDP. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9905 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 10 ++++++++++ doc/script_commands.txt | 2 +- src/login/login.c | 2 +- src/map/battle.c | 6 +++++- src/map/clif.c | 20 ++++++++++++++++---- src/map/pc.c | 14 +++++++++++--- src/map/script.c | 7 ++----- src/map/skill.c | 3 --- src/map/unit.c | 1 + 9 files changed, 47 insertions(+), 18 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 4359a4f30..264f14763 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -3,6 +3,16 @@ 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. +2007/02/24 + * Adjusted menu-based skills so you can't reuse the same skill until you've + dealt with the menu. + * Adjust autospells so that removing an autospell works when the script of + the card that removes the autospell is triggered before the script that + adds the spell. + * The "requested name of gm-hidden char" warning will not be displayed when + the object in question is an NPC (since you can use Intravision to do + this). + * Venom Knife no longer takes into accounts cards or EDP. 2007/02/23 * Guild expulsion now will fail when the character to be kicked is in a guild castle (rather than checking for the character doing the expulsion) diff --git a/doc/script_commands.txt b/doc/script_commands.txt index a6492b975..a4e67e79d 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -329,7 +329,7 @@ moment - if you need that, try it and tell us of the results. ** Define a 'floating' NPC object. --%TAB%script%TAB%-1,{} +-%TAB%script%TAB%%TAB%-1,{} This will define an NPC object not triggerable by normal means. This would normally mean it's pointless since it can't do anything, but there are diff --git a/src/login/login.c b/src/login/login.c index 5a6ed4829..839e3f2e5 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -3031,7 +3031,7 @@ int parse_admin(int fd) { int lan_subnetcheck(long *p) { int i; - unsigned char *sbn, *msk, *src = (unsigned char *)p; + unsigned char *sbn, *msk/*, *src = (unsigned char *)p*/; for(i=0; idata[SC_EDP].timer != -1 && skill_num != ASC_BREAKER && - skill_num != ASC_METEORASSAULT) + skill_num != ASC_METEORASSAULT && + skill_num != AS_VENOMKNIFE) ATK_ADDRATE(sc->data[SC_EDP].val3); } diff --git a/src/map/clif.c b/src/map/clif.c index 198b7de79..0eaab5ce3 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -8489,8 +8489,10 @@ void clif_parse_GetCharNameRequest(int fd, struct map_session_data *sd) { if (!bl) return; sc = status_get_sc(bl); - if (sc && sc->option&OPTION_INVISIBLE && !disguised(bl) && pc_isGM(sd) < battle_config.hack_info_GM_level) - { + if (sc && sc->option&OPTION_INVISIBLE && !disguised(bl) && + bl->type != BL_NPC && //Skip hidden NPCs which can be seen using Maya Purple + pc_isGM(sd) < battle_config.hack_info_GM_level + ) { //GM characters (with client side GM enabled are able to see invisible stuff) [Lance] //Asked name of invisible player, this shouldn't be possible! //Possible bot? Thanks to veider and qspirit @@ -9703,14 +9705,17 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd) { if(target_id<0 && -target_id == sd->bl.id) // for disguises [Valaris] target_id = sd->bl.id; - + + if(sd->menuskill_id) + return; //Can't use skills while a menu is open. + if (sd->skillitem == skillnum) { if (skilllv != sd->skillitemlv) skilllv = sd->skillitemlv; unit_skilluse_id(&sd->bl, target_id, skillnum, skilllv); return; } - + sd->skillitem = sd->skillitemlv = 0; if (skillnum == MO_EXTREMITYFIST) { if ((sd->sc.data[SC_COMBO].timer == -1 || @@ -9801,7 +9806,11 @@ void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, int skilll if(sd->sc.option&(OPTION_WEDDING|OPTION_XMAS)) return; + if(sd->menuskill_id) + return; //Can't use skills while a menu is open. + pc_delinvincibletimer(sd); + if (sd->skillitem == skillnum) { if (skilllv != sd->skillitemlv) skilllv = sd->skillitemlv; @@ -9864,6 +9873,9 @@ void clif_parse_UseSkillMap(int fd,struct map_session_data *sd) if(sd->sc.option&(OPTION_WEDDING|OPTION_XMAS)) return; + if(sd->menuskill_id && sd->menuskill_id != RFIFOW(fd,2)) + return; //Can't use skills while a menu is open. + pc_delinvincibletimer(sd); skill_castend_map(sd,RFIFOW(fd,2),(char*)RFIFOP(fd,4)); diff --git a/src/map/pc.c b/src/map/pc.c index 88b7fde40..1dd9fa7f3 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -1193,7 +1193,7 @@ static int pc_bonus_autospell_del(struct s_autospell *spell, int max, short id, if (i<0) return 0; //Nothing to substract from. j = i; - for(; i>=0 && rate > 0; i--) + for(; i>=0 && rate>0; i--) { if (spell[i].id != id || spell[i].lv != lv) continue; if (rate >= spell[i].rate) { @@ -1207,6 +1207,13 @@ static int pc_bonus_autospell_del(struct s_autospell *spell, int max, short id, rate = 0; } } + if (rate > 0 && ++j < max) + { //Tag this as "pending" autospell to remove. + spell[j].id = id; + spell[j].lv = lv; + spell[j].rate = -rate; + spell[j].card_id = 0; + } return rate; } @@ -1216,12 +1223,13 @@ static int pc_bonus_autospell(struct s_autospell *spell, int max, short id, shor pc_bonus_autospell_del(spell, max, id, lv, -rate, card_id); for (i = 0; i < max && spell[i].id; i++) { - if (spell[i].card_id == card_id && + if ((spell[i].card_id == card_id || !spell[i].card_id) && spell[i].id == id && spell[i].lv == lv) { - if (!battle_config.autospell_stacking) + if (!battle_config.autospell_stacking && spell[i].rate > 0) return 0; rate += spell[i].rate; + if (rate < 0) card_id = 0; //Reduced from debted autospell. break; } } diff --git a/src/map/script.c b/src/map/script.c index c8d1ef2a8..e3341d546 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -12936,16 +12936,13 @@ BUILDIN_FUNC(getvariableofnpc) st->state = END; return 1; } - else if( nd == NULL || nd->bl.subtype != SCRIPT || nd->u.scr.script == NULL ) + if( nd == NULL || nd->bl.subtype != SCRIPT || nd->u.scr.script == NULL ) {// NPC not found or has no script ShowError("script: getvariableofnpc: can't find npc %s\n", npc_name); st->state = END; return 1; } - else - {// push variable reference - push_val2(st->stack, C_NAME, num, &nd->u.scr.script->script_vars ); - } + push_val2(st->stack, C_NAME, num, &nd->u.scr.script->script_vars ); } return 0; } diff --git a/src/map/skill.c b/src/map/skill.c index e70aa222e..8a46abe2a 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -851,9 +851,6 @@ int skillnotok (int skillid, struct map_session_data *sd) if (battle_config.gm_skilluncond && pc_isGM(sd) >= battle_config.gm_skilluncond) return 0; // gm's can do anything damn thing they want - if(sd->menuskill_id && skillid != sd->menuskill_id) - return 1; //Can't use skills while a menu is open. - // Check skill restrictions [Celest] if(!map_flag_vs(m) && skill_get_nocast (skillid) & 1) return 1; diff --git a/src/map/unit.c b/src/map/unit.c index 79dcd3a80..984867cfe 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -809,6 +809,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, int skill_num, int //Target_id checking. if(skillnotok(skill_num, sd)) // [MouseJstr] return 0; + switch(skill_num) { //Check for skills that auto-select target case MO_CHAINCOMBO: -- cgit v1.2.3-70-g09d2