Skip to content
Permalink
Browse files
* INF2_NO_NEARNPC (skill_db.txt updates):
-- Added a new option info for skill's 'inf2', INF2_NO_NEARNPC, that used for checking if the skill is castable if caster/ground/target is near with NPC (by specified range option)
-- Corrected Shadow Chaser skills, SC_CHAOSPANIC and SC_MAELSTROM, that cannot be placed near warp portal (according to iRO Skill Balance Patch)
-- Added 'db/skill_nonearnpc_db.txt' for more option of INF2_NO_NEARNPC (additional range beside splash area, unit range, or layout range calculaiton and type of NPC)
* Follow up 5e6626e
  • Loading branch information
cydh committed Sep 26, 2013
1 parent 99ea656 commit 659cc5757490aa705ae3ee5f8284044d665f62e8
Showing with 467 additions and 371 deletions.
  1. +21 −18 db/pre-re/skill_db.txt
  2. +13 −13 db/pre-re/skill_unit_db.txt
  3. +3 −2 db/re/skill_db.txt
  4. +13 −13 db/re/skill_unit_db.txt
  5. +24 −0 db/skill_nonearnpc_db.txt
  6. +6 −6 src/map/clif.c
  7. +1 −1 src/map/elemental.c
  8. +15 −2 src/map/npc.c
  9. +1 −0 src/map/npc.h
  10. +188 −142 src/map/skill.c
  11. +8 −4 src/map/skill.h
  12. +174 −170 src/map/unit.c
@@ -23,27 +23,30 @@
// 10 Cast interrupted when hit?
// 11 defense-reduction rate during cast.
// 12 inf2 (skill information 2):
// 0x0001- quest skill
// 0x0002- npc skill
// 0x0004- wedding skill
// 0x0008- spirit skill
// 0x0010- guild skill
// 0x0020- song/dance
// 0x0040- ensemble skill
// 0x0080- trap
// 0x0100- skill that damages/targets yourself
// 0x0200- cannot be casted on self (if inf = 4, auto-select target skill)
// 0x0400- usable only on party-members (and enemies if skill is offensive)
// 0x0800- usable only on guild-mates (and enemies if skill is offensive)
// 0x1000- disable usage on enemies (for non-offensive skills).
// 0x2000- free
// 0x4000- chorus skill
// 0x00001- quest skill
// 0x00002- npc skill
// 0x00004- wedding skill
// 0x00008- spirit skill
// 0x00010- guild skill
// 0x00020- song/dance
// 0x00040- ensemble skill
// 0x00080- trap
// 0x00100- skill that damages/targets yourself
// 0x00200- cannot be casted on self (if inf = 4, auto-select target skill)
// 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
// 0x04000- chorus skill
// 0x08000- spell that ignore bg reduction
// 0x10000- spell that ignore gvg reduction
// 0x20000- makes 'self'/'place' skill cannot be casted/placed when near NPC (see 'db/skill_nonearnpc_db.txt' for more options)
// 13 maxcount: max amount of skill instances to place on the ground when
// player_land_skill_limit/monster_land_skill_limit is enabled. For skills
// that attack using a path, this is the path length to be used.
// 14 attack type (none, weapon, magic, misc)
// 15 Blowcount (amount of tiles skill knockbacks)
// 16 inf3 (skill option)
// 16 inf3 (skill information 3):
// 0x0001- skill ignores land protector (e.g. arrow shower)
// 0x0002- spell that doesn't end camouflage
// 0x0004- usable skills while hiding
@@ -1036,8 +1039,8 @@
2298,3,6,1,0,0x1,0,5,1,yes,0,0,0,weapon,0,0x20, SC_STRIPACCESSARY,Strip Accessory //CHECK Is weapon attack type needed?
2299,7,6,2,0,0x1,0,3,1,yes,0,0,3,none,0,0x0, SC_MANHOLE,Man Hole
2300,7,6,2,0,0x1,0,3,1,yes,0,0,1,none,0,0x0, SC_DIMENSIONDOOR,Dimension Door
2301,7,6,2,0,0x1,0,3,1,yes,0,0,0,none,0,0x0, SC_CHAOSPANIC,Chaos Panic
2302,7,6,2,0,0x1,0,3,1,yes,0,0,0,none,0,0x0, SC_MAELSTROM,Maelstrom
2301,7,6,2,0,0x1,0,3,1,yes,0,0x20000,0,none,0,0x0, SC_CHAOSPANIC,Chaos Panic
2302,7,6,2,0,0x1,0,3,1,yes,0,0x20000,0,none,0,0x0, SC_MAELSTROM,Maelstrom
2303,7,6,2,0,0x1,0,3,1,yes,0,0,0,none,0,0x0, SC_BLOODYLUST,Bloody Lust
2304,0,6,4,-1,0,0,3,1,no,0,0,0,weapon,0,0x0, SC_FEINTBOMB,Feint Bomb

@@ -3,19 +3,19 @@
// layout = -1:special, 0:1*1, 1:3*3, 2:5*5, up to 5:11*11
// target = friend (party +guildmates +neutral players) / party / guild
// ally (party +guildmates) / all / enemy
// flag 0x001(UF_DEFNOTENEMY) If 'defunit_not_enemy' is set, the target is changed to 'friend'
// 0x002(UF_NOREITERRATION) Spell cannot be stacked
// 0x004(UF_NOFOOTSET) Spell cannot be cast near/on targets
// 0x008(UF_NOOVERLAP) Spell effects do not overlap
// 0x010(UF_PATHCHECK) Only cells with a shootable path will be placed
// 0x020(UF_NOPC) Spell cannot affect players.
// 0x040(UF_NOMOB) Spell cannot affect mobs.
// 0x080(UF_SKILL) Spell CAN affect skills.
// 0x100(UF_DANCE) Dance skill
// 0x200(UF_ENSEMBLE) Ensemble skill
// 0x400(UF_SONG) Song skill
// 0x800(UF_DUALMODE) Spell has effects both at an interval and when you step in/out
// 0x2000(UF_RANGEDSINGLEUNIT) Layout hack, use layout range propriety but only display center.
// flag 0x0001(UF_DEFNOTENEMY) If 'defunit_not_enemy' is set, the target is changed to 'friend'
// 0x0002(UF_NOREITERRATION) Spell cannot be stacked
// 0x0004(UF_NOFOOTSET) Spell cannot be cast near/on targets
// 0x0008(UF_NOOVERLAP) Spell effects do not overlap
// 0x0010(UF_PATHCHECK) Only cells with a shootable path will be placed
// 0x0020(UF_NOPC) Spell cannot affect players.
// 0x0040(UF_NOMOB) Spell cannot affect mobs.
// 0x0080(UF_SKILL) Spell CAN affect skills.
// 0x0100(UF_DANCE) Dance skill
// 0x0200(UF_ENSEMBLE) Ensemble skill
// 0x0400(UF_SONG) Song skill
// 0x0800(UF_DUALMODE) Spell has effects both at an interval and when you step in/out
// 0x2000(UF_RANGEDSINGLEUNIT) Layout hack, use layout range propriety but only display center.
// Example: 0x006 = 0x002+0x004 -> Cannot be stacked nor cast near targets
//
// Notes:
@@ -40,6 +40,7 @@
// 0x04000- chorus skill
// 0x08000- spell that ignore bg reduction
// 0x10000- spell that ignore gvg reduction
// 0x20000- makes 'self'/'place' skill cannot be casted/placed when near NPC (see 'db/skill_nonearnpc_db.txt' for more options)
// 13 maxcount: max amount of skill instances to place on the ground when
// player_land_skill_limit/monster_land_skill_limit is enabled. For skills
// that attack using a path, this is the path length to be used.
@@ -1049,8 +1050,8 @@
2298,3,6,1,0,0x1,0,5,1,yes,0,0,0,weapon,0,0x20, SC_STRIPACCESSARY,Strip Accessory //CHECK Is weapon attack type needed?
2299,7,6,2,0,0x1,0,3,1,yes,0,0,3,none,0,0x0, SC_MANHOLE,Man Hole
2300,7,6,2,0,0x1,0,3,1,yes,0,0,1,none,0,0x0, SC_DIMENSIONDOOR,Dimension Door
2301,7,6,2,0,0x1,0,3,1,yes,0,0,0,none,0,0x0, SC_CHAOSPANIC,Chaos Panic
2302,7,6,2,0,0x1,0,3,1,yes,0,0,0,none,0,0x0, SC_MAELSTROM,Maelstrom
2301,7,6,2,0,0x1,0,3,1,yes,0,0x20000,0,none,0,0x0, SC_CHAOSPANIC,Chaos Panic
2302,7,6,2,0,0x1,0,3,1,yes,0,0x20000,0,none,0,0x0, SC_MAELSTROM,Maelstrom
2303,7,6,2,0,0x1,3,3,1,yes,0,0,1,none,0,0x0, SC_BLOODYLUST,Bloody Lust
2304,0,6,4,-1,0,0,3,1,no,0,0,0,weapon,0,0x0, SC_FEINTBOMB,Feint Bomb

@@ -3,19 +3,19 @@
// layout = -1:special, 0:1*1, 1:3*3, 2:5*5, up to 5:11*11
// target = friend (party +guildmates +neutral players) / party / guild
// ally (party +guildmates) / all / enemy
// flag 0x001(UF_DEFNOTENEMY) If 'defunit_not_enemy' is set, the target is changed to 'friend'
// 0x002(UF_NOREITERRATION) Spell cannot be stacked
// 0x004(UF_NOFOOTSET) Spell cannot be cast near/on targets
// 0x008(UF_NOOVERLAP) Spell effects do not overlap
// 0x010(UF_PATHCHECK) Only cells with a shootable path will be placed
// 0x020(UF_NOPC) Spell cannot affect players.
// 0x040(UF_NOMOB) Spell cannot affect mobs.
// 0x080(UF_SKILL) Spell CAN affect skills.
// 0x100(UF_DANCE) Dance skill
// 0x200(UF_ENSEMBLE) Ensemble skill
// 0x400(UF_SONG) Song skill
// 0x800(UF_DUALMODE) Spell has effects both at an interval and when you step in/out
// 0x2000(UF_RANGEDSINGLEUNIT) Layout hack, use layout range propriety but only display center.
// flag 0x0001(UF_DEFNOTENEMY) If 'defunit_not_enemy' is set, the target is changed to 'friend'
// 0x0002(UF_NOREITERRATION) Spell cannot be stacked
// 0x0004(UF_NOFOOTSET) Spell cannot be cast near/on targets
// 0x0008(UF_NOOVERLAP) Spell effects do not overlap
// 0x0010(UF_PATHCHECK) Only cells with a shootable path will be placed
// 0x0020(UF_NOPC) Spell cannot affect players.
// 0x0040(UF_NOMOB) Spell cannot affect mobs.
// 0x0080(UF_SKILL) Spell CAN affect skills.
// 0x0100(UF_DANCE) Dance skill
// 0x0200(UF_ENSEMBLE) Ensemble skill
// 0x0400(UF_SONG) Song skill
// 0x0800(UF_DUALMODE) Spell has effects both at an interval and when you step in/out
// 0x2000(UF_RANGEDSINGLEUNIT) Layout hack, use layout range propriety but only display center.
// Example: 0x006 = 0x002+0x004 -> Cannot be stacked nor cast near targets
//
// Notes:
@@ -0,0 +1,24 @@
// Database of Additional Range and NPC Type that used by INF2_NO_NEARNPC
// <skill_name>,<additional_range>{,<npc_type>}
// ====================================================
// additional_range: If this value is 0, splash range value will be used from skill_db,
// or if it is 0, range+layout's range from skill_unit_db. Otherwise, the range
// will be added.
// npc_type (bitmask): 1 = warp portal, 2 = shop NPC, 4 = normal NPC script, 8 = tomb
// ====================================================
// Example:
//MG_SAFETYWALL,2
// MG_SAFETYWALL can't be placed if the ground's target is near from NPC by 2 cells
// (MG_SAFETYWALL doesn't have splash, layout range, and range value, so must add the
// 'additional_range', or it will be pointless)
//
//GS_DESPERADO,2
// GS_DESPERADO can't be casted if the caster is standing near from NPC within range
// 5 cells. (Why? GS_DESPERADO has 3 cells of splash range +2 'additional_range' here)
//
//SC_CHAOSPANIC,0,1
// SC_CHAOSPANIC can't be placed on the ground that near the warp portal with range 2
// cells. (Because SC_CHAOSPANIC doens't have splash range, it uses layout range)

SC_CHAOSPANIC,0,1
SC_MAELSTROM,0,1
@@ -10783,7 +10783,7 @@ static void clif_parse_UseSkillToId_homun(struct homun_data *hd, struct map_sess

if( !hd )
return;
if( skillnotok_hom(skill_id, hd) )
if( skill_isNotOk_hom(skill_id, hd) )
return;
if( hd->bl.id != target_id && skill_get_inf(skill_id)&INF_SELF_SKILL )
target_id = hd->bl.id;
@@ -10806,7 +10806,7 @@ static void clif_parse_UseSkillToPos_homun(struct homun_data *hd, struct map_ses
int lv;
if( !hd )
return;
if( skillnotok_hom(skill_id, hd) )
if( skill_isNotOk_hom(skill_id, hd) )
return;
if( hd->ud.skilltimer != INVALID_TIMER ) {
if( skill_id != SA_CASTCANCEL && skill_id != SO_SPELLFIST ) return;
@@ -10828,7 +10828,7 @@ static void clif_parse_UseSkillToId_mercenary(struct mercenary_data *md, struct

if( !md )
return;
if( skillnotok_mercenary(skill_id, md) )
if( skill_isNotOk_mercenary(skill_id, md) )
return;
if( md->bl.id != target_id && skill_get_inf(skill_id)&INF_SELF_SKILL )
target_id = md->bl.id;
@@ -10851,7 +10851,7 @@ static void clif_parse_UseSkillToPos_mercenary(struct mercenary_data *md, struct
int lv;
if( !md )
return;
if( skillnotok_mercenary(skill_id, md) )
if( skill_isNotOk_mercenary(skill_id, md) )
return;
if( md->ud.skilltimer != INVALID_TIMER )
return;
@@ -10920,7 +10920,7 @@ void clif_parse_UseSkillToId(int fd, struct map_session_data *sd)
if( pc_issit(sd) )
return;

if( skillnotok(skill_id, sd) )
if( skill_isNotOk(skill_id, sd) )
return;

if( sd->bl.id != target_id && tmp&INF_SELF_SKILL )
@@ -11002,7 +11002,7 @@ static void clif_parse_UseSkillToPosSub(int fd, struct map_session_data *sd, uin
//Whether skill fails or not is irrelevant, the char ain't idle. [Skotlex]
sd->idletime = last_tick;

if( skillnotok(skill_id, sd) )
if( skill_isNotOk(skill_id, sd) )
return;
if( skillmoreinfo != -1 ) {
if( pc_issit(sd) ) {
@@ -562,7 +562,7 @@ int elemental_skillnotok(uint16 skill_id, struct elemental_data *ed) {
if (idx == 0)
return 1; // invalid skill id

return skillnotok(skill_id, ed->master);
return skill_isNotOk(skill_id,ed->master);
}

struct skill_condition elemental_skill_get_requirements(uint16 skill_id, uint16 skill_lv){
@@ -118,8 +118,21 @@ struct view_data* npc_get_viewdata(int class_)
return NULL;
}

static int npc_isnear_sub(struct block_list* bl, va_list args) {
int npc_isnear_sub(struct block_list* bl, va_list args) {
struct npc_data *nd = (struct npc_data*)bl;
int skill_id = va_arg(args, int);
uint16 idx = -1;

//Check the NPC type if is used by INF2_NO_NEARNPC or UF_NONEARNPC [Cydh]
if (skill_id && (idx = skill_get_index(skill_id)) && skill_db[idx].unit_nonearnpc_type) {
while (1) {
if (skill_db[idx].unit_nonearnpc_type&1 && nd->subtype == WARP) break;
if (skill_db[idx].unit_nonearnpc_type&2 && nd->subtype == SHOP) break;
if (skill_db[idx].unit_nonearnpc_type&4 && nd->subtype == SCRIPT) break;
if (skill_db[idx].unit_nonearnpc_type&8 && nd->subtype == TOMB) break;
return 0;
}
}

if( nd->sc.option & (OPTION_HIDE|OPTION_INVISIBLE) )
return 0;
@@ -130,7 +143,7 @@ static int npc_isnear_sub(struct block_list* bl, va_list args) {
bool npc_isnear(struct block_list * bl) {

if( battle_config.min_npc_vendchat_distance > 0 &&
map_foreachinrange(npc_isnear_sub,bl, battle_config.min_npc_vendchat_distance, BL_NPC) )
map_foreachinrange(npc_isnear_sub,bl, battle_config.min_npc_vendchat_distance, BL_NPC, 0) )
return true;

return false;
@@ -136,6 +136,7 @@ int npc_enable(const char* name, int flag);
void npc_setdisplayname(struct npc_data* nd, const char* newname);
void npc_setclass(struct npc_data* nd, short class_);
struct npc_data* npc_name2id(const char* name);
int npc_isnear_sub(struct block_list* bl, va_list args);
bool npc_isnear(struct block_list * bl);

int npc_get_new_npc_id(void);

0 comments on commit 659cc57

Please sign in to comment.