summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-21 19:55:35 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-21 19:55:35 +0000
commit67b2fe3dac066c0d917fcd208b59895d62788d1f (patch)
treec44cdf5f185d7fad1d8a65a306ec117e353b21e5
parent90796b261595dd03227e6000978a600178f0c4ff (diff)
downloadhercules-67b2fe3dac066c0d917fcd208b59895d62788d1f.tar.gz
hercules-67b2fe3dac066c0d917fcd208b59895d62788d1f.tar.bz2
hercules-67b2fe3dac066c0d917fcd208b59895d62788d1f.tar.xz
hercules-67b2fe3dac066c0d917fcd208b59895d62788d1f.zip
- SC_CLOAKING's val4 now holds whether cloaking ends or not on attack.
- Implemented NPC_INVISIBLE, it starts SC_CLOAKING with val4 set to 1, skill duration is 30 secs. - Moved uncloaking on attack from attack_timer_sub to battle_calc_weapon_attack. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6223 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt4
-rw-r--r--db/Changelog.txt1
-rw-r--r--db/skill_cast_db.txt2
-rw-r--r--src/map/battle.c3
-rw-r--r--src/map/skill.c7
-rw-r--r--src/map/status.c11
-rw-r--r--src/map/unit.c25
7 files changed, 29 insertions, 24 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index d05267680..31c01afc2 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,10 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/04/21
+ * SC_CLOAKING's val4 now holds whether cloaking ends or not on attack.
+ [Skotlex]
+ * Implemented NPC_INVISIBLE, it starts SC_CLOAKING with val4 set to 1.
+ [Skotlex]
* Updated the HP/SP leech structures to have race-data attached to them.
[Skotlex]
* Merged all leeching code to new battle_drain function. [Skotlex]
diff --git a/db/Changelog.txt b/db/Changelog.txt
index 6eb95eb99..7879da929 100644
--- a/db/Changelog.txt
+++ b/db/Changelog.txt
@@ -27,6 +27,7 @@
=========================
04/21
+ * Set NPC_INVISIBLE's duration to 30 secs. [Skotlex]
* Finally implemented Dragon Egg thanks to Tharis [Playtester]
* Fixed some mob skills that where missing an [Enter]... (Windows format... AGAIN!) [Poki#3]
...why co we have uncommented Attack skills under an iddle state? Oo
diff --git a/db/skill_cast_db.txt b/db/skill_cast_db.txt
index 31bfdbaac..d473ef66a 100644
--- a/db/skill_cast_db.txt
+++ b/db/skill_cast_db.txt
@@ -514,6 +514,8 @@
349,0,0,0,60000:120000:180000:240000:300000,0
//-- NPC_AGIUP
350,0,0,0,60000:120000:180000:240000:300000,0
+//-- NPC_INVISIBLE
+353,0,0,0,30000,0
//-- NPC_RUN
354,0,0:500:1000:1500:2000:2500,0,0,0
//==========================================
diff --git a/src/map/battle.c b/src/map/battle.c
index a519e3a65..1136ec989 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3119,6 +3119,9 @@ int battle_weapon_attack( struct block_list *src,struct block_list *target,
return 0;
}
+ if (sc && sc->data[SC_CLOAKING].timer != -1 && !sc->data[SC_CLOAKING].val4)
+ status_change_end(src,SC_CLOAKING,-1);
+
//Check for counter attacks that block your attack. [Skotlex]
if(tsc)
{
diff --git a/src/map/skill.c b/src/map/skill.c
index ee9f34a07..77705973a 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -4998,8 +4998,13 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
sc_start(bl,SC_INCAGI,100,skilllv*10,skill_get_time(skillid, skilllv)));
break;
- case NPC_SIEGEMODE:
case NPC_INVISIBLE:
+ //val4 passed as 1 is for "infinite cloak".
+ clif_skill_nodamage(src,bl,skillid,skilllv,
+ sc_start4(bl,type,100,skilllv,0,0,1,skill_get_time(skillid,skilllv)));
+ break;
+
+ case NPC_SIEGEMODE:
// not sure what it does
clif_skill_nodamage(src,bl,skillid,skilllv,1);
break;
diff --git a/src/map/status.c b/src/map/status.c
index 14498f490..a4e47a97f 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -206,6 +206,7 @@ void initChangeTables(void) {
set_sc(NPC_STOP, SC_STOP, SI_BLANK);
set_sc(NPC_BREAKWEAPON, SC_BROKENWEAPON, SI_BROKENWEAPON);
set_sc(NPC_BREAKARMOR, SC_BROKENARMOR, SI_BROKENARMOR);
+ set_sc(NPC_INVISIBLE, SC_CLOAKING, SI_CLOAKING);
set_sc(LK_AURABLADE, SC_AURABLADE, SI_AURABLADE);
set_sc(LK_PARRYING, SC_PARRYING, SI_PARRYING);
set_sc(LK_CONCENTRATION, SC_CONCENTRATION, SI_CONCENTRATION);
@@ -4178,11 +4179,17 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
case SC_CLOAKING: /* クロ?キング */
if (flag&4)
break;
- if(bl->type != BL_PC)
- tick = 5000*val1;
calc_flag = 1; // [Celest]
val2 = tick;
val3 = type==SC_CLOAKING ? 130-val1*3 : 135-val1*5;
+ if (!val4)
+ { //val4 signals eternal cloaking (not cancelled on attack) [Skotlex]
+ //Standard cloaking.
+ if (bl->type == BL_PC)
+ val4 = battle_config.pc_cloak_check_type&2?1:0;
+ else
+ val4 = battle_config.monster_cloak_check_type&2?1:0;
+ }
break;
case SC_SIGHT: /* サイト/ルアフ */
case SC_RUWACH:
diff --git a/src/map/unit.c b/src/map/unit.c
index 8b60d4ef5..ba33bc8d2 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -901,13 +901,8 @@ int unit_skilluse_id2(struct block_list *src, int target_id, int skill_num, int
ud->skillid = skill_num;
ud->skilllv = skill_lv;
- if(
- (sd && !(battle_config.pc_cloak_check_type&2) ) ||
- (src->type == BL_MOB && !(battle_config.monster_cloak_check_type&2) )
- ) {
- if( sc && sc->data[SC_CLOAKING].timer != -1 && skill_num != AS_CLOAKING)
- status_change_end(src,SC_CLOAKING,-1);
- }
+ if(sc && sc->data[SC_CLOAKING].timer != -1 && !sc->data[SC_CLOAKING].val4 && skill_num != AS_CLOAKING)
+ status_change_end(src,SC_CLOAKING,-1);
if(casttime > 0) {
ud->skilltimer = add_timer( tick+casttime, skill_castend_id, src->id, 0 );
@@ -1010,12 +1005,8 @@ int unit_skilluse_pos2( struct block_list *src, int skill_x, int skill_y, int sk
ud->skilly = skill_y;
ud->skilltarget = 0;
- if((sd && !(battle_config.pc_cloak_check_type&2)) ||
- (src->type==BL_MOB && !(battle_config.monster_cloak_check_type&2))
- ) {
- if (sc && sc->data[SC_CLOAKING].timer != -1)
- status_change_end(src,SC_CLOAKING,-1);
- }
+ if (sc && sc->data[SC_CLOAKING].timer != -1 && !sc->data[SC_CLOAKING].val4)
+ status_change_end(src,SC_CLOAKING,-1);
if(casttime > 0) {
ud->skilltimer = add_timer( tick+casttime, skill_castend_pos, src->id, 0 );
@@ -1283,14 +1274,6 @@ static int unit_attack_timer_sub(struct block_list* src, int tid, unsigned int t
map_freeblock_lock();
ud->attacktarget_lv = battle_weapon_attack(src,target,tick,0);
- if(
- (sd && !(battle_config.pc_cloak_check_type&2)) ||
- (!sd && !(battle_config.monster_cloak_check_type&2))
- ) {
- struct status_change *sc = status_get_sc(src);
- if (sc && sc->count && sc->data[SC_CLOAKING].timer != -1)
- status_change_end(src,SC_CLOAKING,-1);
- }
if(sd && sd->status.pet_id > 0 && sd->pd && sd->petDB && battle_config.pet_attack_support)
pet_target_check(sd,target,0);