From c9cf2228a3613def4a412dc7087a248ead3609cf Mon Sep 17 00:00:00 2001 From: Cydh Ramdh Date: Mon, 3 Feb 2014 01:17:28 +0700 Subject: [PATCH] * Added skill INF2_NO_AUTOSHADOWSPELL for some skills that cannot be auto casted by Auto Shadow Spell as fix of bugreport:8582, http://rathena.org/board/tracker/issue-8582-shadow-chaserauto-shadow-spell-restricted-spells/ * Removed unused const.txt entries as fix of bugreport:8467, http://rathena.org/board/tracker/issue-8467-left-over-constants-from-mob-controller-system/ Signed-off-by: Cydh Ramdh --- db/const.txt | 19 ------------------- db/re/skill_db.txt | 14 +++++++------- src/map/clif.c | 9 +++++++-- src/map/homunculus.c | 5 ++++- src/map/pc.h | 2 +- src/map/skill.c | 24 +++++++++--------------- src/map/skill.h | 2 +- 7 files changed, 29 insertions(+), 46 deletions(-) diff --git a/db/const.txt b/db/const.txt index 705f6c8913..89a249c2b8 100644 --- a/db/const.txt +++ b/db/const.txt @@ -2631,25 +2631,6 @@ MOB_ELEMENT 20 MOB_MODE 21 MOB_MVPEXP 22 -AI_ACTION_TYPE 0 -AI_ACTION_TAR_TYPE 1 -AI_ACTION_TAR 2 -AI_ACTION_SRC 3 -AI_ACTION_TAR_TYPE_PC 1 -AI_ACTION_TAR_TYPE_MOB 2 -AI_ACTION_TAR_TYPE_PET 4 -AI_ACTION_TAR_TYPE_HOMUN 8 -AI_ACTION_TAR_TYPE_ITEM 16 -AI_ACTION_TYPE_NPCCLICK 256 -AI_ACTION_TYPE_ATTACK 128 -AI_ACTION_TYPE_DETECT 64 -AI_ACTION_TYPE_DEAD 32 -AI_ACTION_TYPE_ASSIST 16 -AI_ACTION_TYPE_KILL 8 -AI_ACTION_TYPE_UNLOCK 4 -AI_ACTION_TYPE_WALKACK 2 -AI_ACTION_TYPE_WARPACK 1 - ALL_CLIENT 0 ALL_SAMEMAP 1 AREA 2 diff --git a/db/re/skill_db.txt b/db/re/skill_db.txt index ab717c87b9..705db31637 100644 --- a/db/re/skill_db.txt +++ b/db/re/skill_db.txt @@ -36,7 +36,7 @@ // 0x00400- usable only on party-members (and enemies if skill is offensive) // 0x00800- usable only on guild-mates (and enemies if skill is offensive) // 0x01000- disable usage on enemies (for non-offensive skills). -// 0x02000- free +// 0x02000- skill cannot be auto casted by Auto Shadow Spell // 0x04000- chorus skill // 0x08000- spell that ignore bg reduction // 0x10000- spell that ignore gvg reduction @@ -96,7 +96,7 @@ // Acolyte 22,0,0,0,0,0,0,10,0,no,0,0,0,weapon,0,0x0, AL_DP,Divine Protection 23,0,0,0,0,0,0,10,0,no,0,0,0,weapon,0,0x0, AL_DEMONBANE,Demon Bane -24,0,6,4,6,0x3,2,1,1,yes,0,0,0,magic,0,0x20, AL_RUWACH,Ruwach +24,0,6,4,6,0x3,2,1,1,yes,0,0x2000,0,magic,0,0x20, AL_RUWACH,Ruwach 25,9,6,2,0,0x1,0,1,1,yes,0,0,0,magic,0,0x20, AL_PNEUMA,Pneuma 26,0,6,4,0,0x1,0,2,1,yes,0,0,0,magic,0,0x60, AL_TELEPORT,Teleport 27,9,6,2,0,0x1,0,4,1,yes,0,0,3,magic,0,0x20, AL_WARP,Warp Portal @@ -136,7 +136,7 @@ 52,-2,6,1,5,0,0,10,1,no,0,0,0,weapon,0,0x0, TF_POISON,Envenom 53,9,6,16,5,0x1,0,1,1,no,0,0,0,weapon,0,0x0, TF_DETOXIFY,Detoxify // -54,9,6,16,6,0x1,0,4,1,yes,0,0,0,magic,0,0x20, ALL_RESURRECTION,Resurrection +54,9,6,16,6,0x1,0,4,1,yes,0,0x2000,0,magic,0,0x20, ALL_RESURRECTION,Resurrection //**** // Knight @@ -165,9 +165,9 @@ 74,0,6,4,0,0x3,-1,5,1,yes,0,0,0,magic,0,0x20, PR_MAGNIFICAT,Magnificat 75,0,6,4,0,0x3,-1,5,1,yes,0,0,0,magic,0,0x0, PR_GLORIA,Gloria 76,5,6,1,0,0x1,0,10,0,yes,0,0,0,magic,0,0x20, PR_LEXDIVINA,Lex Divina -77,5,6,1,6,0x28,0,10,1,yes,0,0,0,magic,0,0x20, PR_TURNUNDEAD,Turn Undead +77,5,6,1,6,0x28,0,10,1,yes,0,0x2000,0,magic,0,0x20, PR_TURNUNDEAD,Turn Undead 78,9,6,1,0,0x1,0,1,0,yes,0,0,0,magic,0,0x20, PR_LEXAETERNA,Lex Aeterna -79,9,8,2,6,0,0,10,1:2:3:4:5:6:7:8:9:10,yes,0,0,0,magic,0,0x20, PR_MAGNUS,Magnus Exorcismus +79,9,8,2,6,0,0,10,1:2:3:4:5:6:7:8:9:10,yes,0,0x2000,0,magic,0,0x20, PR_MAGNUS,Magnus Exorcismus //**** // Wizard @@ -258,7 +258,7 @@ 153,1,6,1,-1,0x2,1,1,1,no,0,0x1,0,weapon,2,0x0, MC_CARTREVOLUTION,Cart Revolution 154,0,6,4,0,0x1,0,1,1,no,0,0x1,0,none,0,0x0, MC_CHANGECART,Change Cart 155,0,6,4,0,0x1,0,1,1,no,0,0x1,0,weapon,0,0x0, MC_LOUD,Crazy Uproar -156,9,6,1,6,0,0,1,1,yes,0,0x1,0,magic,0,0x20, AL_HOLYLIGHT,Holy Light +156,9,6,1,6,0,0,1,1,yes,0,0x2001,0,magic,0,0x20, AL_HOLYLIGHT,Holy Light 157,0,6,4,0,0x1,0,1,1,yes,0,0x1,0,magic,0,0x20, MG_ENERGYCOAT,Energy Coat //**** @@ -368,7 +368,7 @@ 251,3:5:7:9:11,6,1,0,0,0,5,1,no,0,0,0,weapon,0,0x0, CR_SHIELDBOOMERANG,Shield Boomerang 252,0,6,4,0,0,0,10,1,no,0,0,0,weapon,0,0x0, CR_REFLECTSHIELD,Shield Reflect 253,-2,8,1,6,0,0,10,-2,no,0,0,0,weapon,0,0x0, CR_HOLYCROSS,Holy Cross -254,5,6,4,6,0x48,0,10,1,no,33,0x100,0,magic,0,0x0, CR_GRANDCROSS,Grand Cross +254,5,6,4,6,0x48,0,10,1,no,33,0x2100,0,magic,0,0x0, CR_GRANDCROSS,Grand Cross 255,7:8:9:10:11,6,16,0,0x1,0,5,1,yes,0,0x600,0,none,0,0x0, CR_DEVOTION,Sacrifice 256,9,6,16,0,0x1,0,5,1,yes,0,0x200,0,none,0,0x0, CR_PROVIDENCE,Resistant Souls 257,0,6,4,0,0x1,0,5,1,no,0,0,0,weapon,0,0x0, CR_DEFENDER,Defending Aura diff --git a/src/map/clif.c b/src/map/clif.c index cb65f85e06..4edb0ab735 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -16669,10 +16669,15 @@ int clif_autoshadowspell_list(struct map_session_data *sd) { WFIFOHEAD(fd, 2 * 6 + 4); WFIFOW(fd,0) = 0x442; + //- Only list the skill that 'imitated' and Magic skill + //- Cannot autocasted 3rd and extended skills + //- Some holy skills cannot be autocasted, marked as INF2_NO_AUTOSHADOWSPELL [Cydh] + //! NOTE: Maybe later can get rid of 'sd->status.skill[i].id < GS_GLITTERING' since there is INF2_NO_AUTOSHADOWSPELL for( i = 0, c = 0; i < MAX_SKILL; i++ ) if( sd->status.skill[i].flag == SKILL_FLAG_PLAGIARIZED && sd->status.skill[i].id > 0 && - sd->status.skill[i].id < GS_GLITTERING && skill_get_type(sd->status.skill[i].id) == BF_MAGIC ) - { // Can't auto cast both Extended class and 3rd class skills. + sd->status.skill[i].id < GS_GLITTERING && skill_get_type(sd->status.skill[i].id) == BF_MAGIC && + !(skill_get_inf2(sd->status.skill[i].id)&INF2_NO_AUTOSHADOWSPELL)) + { WFIFOW(fd,8+c*2) = sd->status.skill[i].id; c++; } diff --git a/src/map/homunculus.c b/src/map/homunculus.c index 72c87a4ec5..ec03ee05d3 100644 --- a/src/map/homunculus.c +++ b/src/map/homunculus.c @@ -1219,7 +1219,10 @@ static bool read_homunculusdb_sub(char* str[], int columns, int current) int read_homunculusdb(void) { int i; - const char *filename[]={DBPATH"homunculus_db.txt",DBIMPORT"/homunculus_db.txt"}; + const char *filename[] = { + DBPATH"homunculus_db.txt", + DBIMPORT"/homunculus_db.txt", + }; memset(homunculus_db,0,sizeof(homunculus_db)); for(i = 0; icloneskill_idx >= 0 && tsd->status.skill[tsd->cloneskill_idx].flag == SKILL_FLAG_PLAGIARIZED) { - clif_deleteskill(tsd,tsd->status.skill[tsd->cloneskill_idx].id); tsd->status.skill[tsd->cloneskill_idx].id = 0; tsd->status.skill[tsd->cloneskill_idx].lv = 0; tsd->status.skill[tsd->cloneskill_idx].flag = SKILL_FLAG_PERMANENT; + clif_deleteskill(tsd,tsd->status.skill[tsd->cloneskill_idx].id); } lv = min(skill_lv,pc_checkskill(tsd,RG_PLAGIARISM)); //Copied level never be > player's RG_PLAGIARISM level @@ -2571,10 +2571,10 @@ static void skill_do_copy(struct block_list* src,struct block_list *bl, uint16 s //Skill level copied depends on Reproduce skill that used lv = (tsc) ? tsc->data[SC__REPRODUCE]->val1 : 1; if( tsd->reproduceskill_idx >= 0 && tsd->status.skill[tsd->reproduceskill_idx].flag == SKILL_FLAG_PLAGIARIZED ) { - clif_deleteskill(tsd,tsd->status.skill[tsd->reproduceskill_idx].id); tsd->status.skill[tsd->reproduceskill_idx].id = 0; tsd->status.skill[tsd->reproduceskill_idx].lv = 0; tsd->status.skill[tsd->reproduceskill_idx].flag = SKILL_FLAG_PERMANENT; + clif_deleteskill(tsd,tsd->status.skill[tsd->reproduceskill_idx].id); } //Level dependent and limitation. @@ -18899,7 +18899,7 @@ static bool skill_parse_row_requiredb(char* split[], int columns, int current) } static bool skill_parse_row_castdb(char* split[], int columns, int current) -{// skill_id,CastingTime,AfterCastActDelay,AfterCastWalkDelay,Duration1,Duration2 +{// skill_id,CastingTime,AfterCastActDelay,AfterCastWalkDelay,Duration1,Duration2,Cooldown{,Fixedcast} uint16 skill_id = atoi(split[0]); uint16 idx = skill_get_index(skill_id); if( !idx ) // invalid skill id @@ -19261,22 +19261,16 @@ static void skill_readdb(void) { sv_readdb(dbsubpath2, "skill_db.txt" , ',', 18, 18, MAX_SKILL_DB, skill_parse_row_skilldb, i); sv_readdb(dbsubpath2, "skill_require_db.txt" , ',', 34, 34, MAX_SKILL_DB, skill_parse_row_requiredb, i); -#ifdef RENEWAL_CAST - sv_readdb(dbsubpath2, "skill_cast_db.txt" , ',', 8, 8, MAX_SKILL_DB, skill_parse_row_castdb, i); -#else - sv_readdb(dbsubpath2, "skill_cast_db.txt" , ',', 7, 7, MAX_SKILL_DB, skill_parse_row_castdb, i); -#endif + sv_readdb(dbsubpath2, "skill_cast_db.txt" , ',', 7, 8, MAX_SKILL_DB, skill_parse_row_castdb, i); sv_readdb(dbsubpath2, "skill_castnodex_db.txt", ',', 2, 3, MAX_SKILL_DB, skill_parse_row_castnodexdb, i); sv_readdb(dbsubpath2, "skill_unit_db.txt" , ',', 8, 8, MAX_SKILL_DB, skill_parse_row_unitdb, i); sv_readdb(dbsubpath2, "skill_nocast_db.txt" , ',', 2, 2, MAX_SKILL_DB, skill_parse_row_nocastdb, i); - sv_readdb(dbsubpath1, "produce_db.txt" , ',', 4, 4+2*MAX_PRODUCE_RESOURCE, MAX_SKILL_PRODUCE_DB, skill_parse_row_producedb, i); - sv_readdb(dbsubpath1, "create_arrow_db.txt" , ',', 1+2, 1+2*MAX_ARROW_RESOURCE, MAX_SKILL_ARROW_DB, skill_parse_row_createarrowdb, i); - sv_readdb(dbsubpath1, "abra_db.txt" , ',', 3, 3, MAX_SKILL_ABRA_DB, skill_parse_row_abradb, i); - //Warlock - sv_readdb(dbsubpath1, "spellbook_db.txt" , ',', 3, 3, MAX_SKILL_SPELLBOOK_DB, skill_parse_row_spellbookdb, i); - //Guillotine Cross - sv_readdb(dbsubpath1, "magicmushroom_db.txt" , ',', 1, 1, MAX_SKILL_MAGICMUSHROOM_DB, skill_parse_row_magicmushroomdb, i); + sv_readdb(dbsubpath1, "produce_db.txt" , ',', 4, 4+2*MAX_PRODUCE_RESOURCE, MAX_SKILL_PRODUCE_DB, skill_parse_row_producedb, i); + sv_readdb(dbsubpath1, "create_arrow_db.txt" , ',', 1+2, 1+2*MAX_ARROW_RESOURCE, MAX_SKILL_ARROW_DB, skill_parse_row_createarrowdb, i); + sv_readdb(dbsubpath1, "abra_db.txt" , ',', 3, 3, MAX_SKILL_ABRA_DB, skill_parse_row_abradb, i); + sv_readdb(dbsubpath1, "spellbook_db.txt" , ',', 3, 3, MAX_SKILL_SPELLBOOK_DB, skill_parse_row_spellbookdb, i); //Warlock + sv_readdb(dbsubpath1, "magicmushroom_db.txt" , ',', 1, 1, MAX_SKILL_MAGICMUSHROOM_DB, skill_parse_row_magicmushroomdb, i); //Guillotine Cross sv_readdb(dbsubpath1, "skill_copyable_db.txt" , ',', 2, 4, MAX_SKILL_DB, skill_parse_row_copyabledb, i); sv_readdb(dbsubpath1, "skill_improvise_db.txt" , ',', 2, 2, MAX_SKILL_IMPROVISE_DB, skill_parse_row_improvisedb, i); sv_readdb(dbsubpath1, "skill_changematerial_db.txt" , ',', 4, 4+2*5, MAX_SKILL_PRODUCE_DB, skill_parse_row_changematerialdb, i); diff --git a/src/map/skill.h b/src/map/skill.h index b7cf234de1..9f2dadddbf 100644 --- a/src/map/skill.h +++ b/src/map/skill.h @@ -65,7 +65,7 @@ enum e_skill_inf2 { INF2_PARTY_ONLY = 0x00400, INF2_GUILD_ONLY = 0x00800, INF2_NO_ENEMY = 0x01000, - //INF2_ = 0x02000, // free + INF2_NO_AUTOSHADOWSPELL = 0x02000, // Skill that cannot be auto casted by Auto Shadow Spell INF2_CHORUS_SKILL = 0x04000, // Chorus skill INF2_NO_BG_DMG = 0x08000, // spell that ignore bg reduction INF2_NO_GVG_DMG = 0x10000, // spell that ignore gvg reduction