summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-08-21 20:38:32 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-08-21 20:38:32 +0000
commit7d4cef5d03815911547efb37dce1c5ee9d5b05fa (patch)
tree3bb0b0e6b6d24146a0fa32008b99fd9d80cc55b3 /src/map/skill.c
parent824839bf6bfad8f389a14a1339fdf42d619514c4 (diff)
downloadhercules-7d4cef5d03815911547efb37dce1c5ee9d5b05fa.tar.gz
hercules-7d4cef5d03815911547efb37dce1c5ee9d5b05fa.tar.bz2
hercules-7d4cef5d03815911547efb37dce1c5ee9d5b05fa.tar.xz
hercules-7d4cef5d03815911547efb37dce1c5ee9d5b05fa.zip
- Big update to Basilica, implementing official behavior.
* Basilica caster cannot walk. * On Basilica area, only caster can use Basilica again to stop it. * On Basilica no one can use skills. (Previous bug on eA because you can use support skills on it, also caster). * Only Pressure can bypass Basilica protection. * Any enemy of the caster bounce 2 cells back from basilica, except Boss type. (Bugreport 2099). * Any monster can target you on basilica and try to attack you, also with skills, but damage is reduced to 0, except Boss. Notes: - Basilica Cell stuff is not used anymore... is it required? - Still need to add a check previous to cast basilica because if there are mobs, items, npcs, walls, skills around the caster (7x7 i think) the skill should fail. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13106 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c60
1 files changed, 43 insertions, 17 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 44e720834..064ceb849 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1284,8 +1284,13 @@ int skill_blown(struct block_list* src, struct block_list* target, int count, in
}
break;
case BL_PC:
- if(src != target && ((TBL_PC*)target)->special_state.no_knockback)
+ {
+ struct map_session_data *sd = BL_CAST(BL_PC, target);
+ if( sd->sc.data[SC_BASILICA] && sd->sc.data[SC_BASILICA]->val4 == sd->bl.id )
+ return 0; // Basilica caster can't be knocked-back
+ if( src != target && sd->special_state.no_knockback )
return 0;
+ }
break;
case BL_SKILL:
su = (struct skill_unit *)target;
@@ -5753,10 +5758,15 @@ int skill_castend_pos2(struct block_list* src, int x, int y, int skillid, int sk
flag|=1;
break;
case HP_BASILICA:
- skill_clear_unitgroup(src);
- if (skill_unitsetting(src,skillid,skilllv,x,y,0))
- sc_start(src,type,100,skilllv,skill_get_time(skillid,skilllv));
- flag|=1;
+ if( sc->data[SC_BASILICA] )
+ status_change_end(src, SC_BASILICA, -1); // Cancel Basilica
+ else
+ { // Create Basilica. Start SC on caster. Unit timer start SC on others.
+ skill_clear_unitgroup(src);
+ if( skill_unitsetting(src,skillid,skilllv,x,y,0) )
+ sc_start4(src,type,100,skilllv,0,0,src->id,skill_get_time(skillid,skilllv));
+ flag|=1;
+ }
break;
case CG_HERMODE:
skill_clear_unitgroup(src);
@@ -6028,6 +6038,7 @@ int skill_castend_map (struct map_session_data *sd, short skill_num, const char
sd->sc.data[SC_STEELBODY] ||
sd->sc.data[SC_DANCING] ||
sd->sc.data[SC_BERSERK] ||
+ sd->sc.data[SC_BASILICA] ||
sd->sc.data[SC_MARIONETTE]
)) {
skill_failed(sd);
@@ -6110,13 +6121,6 @@ int skill_castend_map (struct map_session_data *sd, short skill_num, const char
return 0;
}
- // This makes Warp Portal fail if the cell is not empty
- //if(skill_check_unit_range2(&sd->bl,wx,wy,skill_num,lv) > 0) {
- // clif_skill_fail(sd,0,0,0);
- // skill_failed(sd);
- // return 0;
- //}
-
if((group=skill_unitsetting(&sd->bl,skill_num,lv,wx,wy,0))==NULL) {
skill_failed(sd);
return 0;
@@ -6255,9 +6259,8 @@ struct skill_unit_group* skill_unitsetting (struct block_list *src, short skilli
status = status_get_status_data(src);
sc = status_get_sc(src); // for traps, firewall and fogwall - celest
- switch(skillid)
+ switch( skillid )
{
-
case MG_SAFETYWALL:
val2=skilllv+1;
break;
@@ -6281,6 +6284,9 @@ struct skill_unit_group* skill_unitsetting (struct block_list *src, short skilli
val3 = group->val3; //as well as the mapindex to warp to.
}
break;
+ case HP_BASILICA:
+ val1 = src->id; // Store caster id.
+ break;
case PR_SANCTUARY:
case NPC_EVILLAND:
@@ -7129,6 +7135,17 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
}
}
break;
+
+ case UNT_BASILICA:
+ if( battle_check_target(&src->bl, bl, BCT_ENEMY) > 0 && !(status_get_mode(bl)&MD_BOSS) )
+ { // knock-back any enemy except Boss
+ skill_blown(&src->bl, bl, 2, unit_getdir(bl), 0);
+ clif_fixpos(bl);
+ }
+
+ if( sg->src_id != bl->id && battle_check_target(&src->bl, bl, BCT_ENEMY) <= 0 )
+ status_change_start(bl, type, 100, src->bl.id, 0, 0, 0, sg->interval + 100, 0);
+ break;
case UNT_GRAVITATION:
skill_attack(skill_get_type(sg->skill_id),ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick,0);
@@ -7192,6 +7209,11 @@ int skill_unit_onout (struct skill_unit *src, struct block_list *bl, unsigned in
status_change_end(bl,type,-1);
break;
+ case UNT_BASILICA:
+ if( sce && sce->val1 == src->val1 )
+ status_change_end(bl,type,-1);
+ break;
+
case UNT_HERMODE: //Clear Hermode if the owner moved.
if (sce && sce->val3 == BCT_SELF && sce->val4 == sg->group_id)
status_change_end(bl,type,-1);
@@ -8362,7 +8384,9 @@ int skill_delayfix (struct block_list *bl, int skill_id, int skill_lv)
{
int delaynodex = skill_get_delaynodex(skill_id, skill_lv);
int time = skill_get_delay(skill_id, skill_lv);
-
+ struct map_session_data *sd = BL_CAST(BL_PC, bl);
+ struct status_change *sc = status_get_sc(bl);
+
nullpo_retr(0, bl);
if (skill_id == SA_ABRACADABRA)
@@ -8384,6 +8408,10 @@ int skill_delayfix (struct block_list *bl, int skill_id, int skill_lv)
case CH_CHAINCRUSH:
time -= 4*status_get_agi(bl) - 2*status_get_dex(bl);
break;
+ case HP_BASILICA:
+ if( sc && !sc->data[SC_BASILICA] )
+ time = 0; // There is no Delay on Basilica creation, only on cancel
+ break;
default:
if (battle_config.delay_dependon_dex && !(delaynodex&1))
{ // if skill delay is allowed to be reduced by dex
@@ -8405,8 +8433,6 @@ int skill_delayfix (struct block_list *bl, int skill_id, int skill_lv)
if (!(delaynodex&2))
{
- struct status_change *sc;
- sc= status_get_sc(bl);
if (sc && sc->count) {
if (sc->data[SC_POEMBRAGI])
time -= time * sc->data[SC_POEMBRAGI]->val3 / 100;