summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-28 20:44:44 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-28 20:44:44 +0000
commitdd9f935197123a63faa902fcfdf166a99f7080b7 (patch)
tree019c5a6ba0812f7001b58267d72fe5c2cbfeebf3 /src/map
parentd70d0a66866d8c41cf6a8c9df266c0d7ea29c3dc (diff)
downloadhercules-dd9f935197123a63faa902fcfdf166a99f7080b7.tar.gz
hercules-dd9f935197123a63faa902fcfdf166a99f7080b7.tar.bz2
hercules-dd9f935197123a63faa902fcfdf166a99f7080b7.tar.xz
hercules-dd9f935197123a63faa902fcfdf166a99f7080b7.zip
- Restructured CG_MOONLIT so that it is a ground effect like the other Encores.
- Modified SC_DANCING so that val1 can contain both skill id and skill lv, removed SC_MOONLIT git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8526 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/map.c21
-rw-r--r--src/map/map.h4
-rw-r--r--src/map/pc.c3
-rw-r--r--src/map/skill.c75
-rw-r--r--src/map/skill.h2
-rw-r--r--src/map/status.c27
-rw-r--r--src/map/status.h2
-rw-r--r--src/map/unit.c8
8 files changed, 37 insertions, 105 deletions
diff --git a/src/map/map.c b/src/map/map.c
index 81e62b875..584415ef5 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -520,13 +520,8 @@ int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick) {
if (sc->count) {
if (sc->data[SC_CLOAKING].timer != -1)
skill_check_cloaking(bl, sc);
- if (sc->data[SC_DANCING].timer != -1) {
- //Cancel Moonlight Petals if moved from casting position. [Skotlex]
- if (sc->data[SC_DANCING].val1 == CG_MOONLIT)
- skill_stop_dancing(bl);
- else
- skill_unit_move_unit_group((struct skill_unit_group *)sc->data[SC_DANCING].val2, bl->m, x1-x0, y1-y0);
- }
+ if (sc->data[SC_DANCING].timer != -1)
+ skill_unit_move_unit_group((struct skill_unit_group *)sc->data[SC_DANCING].val2, bl->m, x1-x0, y1-y0);
if (sc->data[SC_WARM].timer != -1)
skill_unit_move_unit_group((struct skill_unit_group *)sc->data[SC_WARM].val4, bl->m, x1-x0, y1-y0);
}
@@ -2221,13 +2216,13 @@ int map_getcellp(struct map_data* m,int x,int y,cell_t cellchk)
if (type3 >= battle_config.cell_stack_limit) return 0;
#endif
case CELL_CHKREACH:
- return (type!=1 && type!=5 && !(type2&(CELL_MOONLIT|CELL_ICEWALL)));
+ return (type!=1 && type!=5 && !(type2&CELL_ICEWALL));
case CELL_CHKNOPASS:
#ifdef CELL_NOSTACK
if (type3 >= battle_config.cell_stack_limit) return 1;
#endif
case CELL_CHKNOREACH:
- return (type==1 || type==5 || type2&(CELL_MOONLIT|CELL_ICEWALL));
+ return (type==1 || type==5 || type2&CELL_ICEWALL);
case CELL_CHKSTACK:
#ifdef CELL_NOSTACK
return (type3 >= battle_config.cell_stack_limit);
@@ -2254,8 +2249,6 @@ int map_getcellp(struct map_data* m,int x,int y,cell_t cellchk)
return (type2&CELL_BASILICA);
case CELL_CHKLANDPROTECTOR:
return (type2&CELL_LANDPROTECTOR);
- case CELL_CHKMOONLIT:
- return (type2&CELL_MOONLIT);
case CELL_CHKREGEN:
return (type2&CELL_REGEN);
case CELL_CHKICEWALL:
@@ -2307,12 +2300,6 @@ void map_setcell(int m,int x,int y,int cell)
case CELL_CLRSAFETYWALL:
map[m].cell[j] &= ~CELL_SAFETYWALL;
break;
- case CELL_SETMOONLIT:
- map[m].cell[j] |= CELL_MOONLIT;
- break;
- case CELL_CLRMOONLIT:
- map[m].cell[j] &= ~CELL_MOONLIT;
- break;
case CELL_SETLANDPROTECTOR:
map[m].cell[j] |= CELL_LANDPROTECTOR;
break;
diff --git a/src/map/map.h b/src/map/map.h
index 59c77594e..1680efb7c 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -1215,7 +1215,6 @@ enum {
#define CELL_SAFETYWALL 0x8
#define CELL_LANDPROTECTOR 0x10
#define CELL_BASILICA 0x20
-#define CELL_MOONLIT 0x40
#define CELL_ICEWALL 0x80
/*
* map_getcell()で使用されるフラグ
@@ -1236,7 +1235,6 @@ typedef enum {
CELL_CHKSAFETYWALL,
CELL_CHKBASILICA, // バジリカ(セルタイプ0x40フラグ)
CELL_CHKLANDPROTECTOR,
- CELL_CHKMOONLIT,
CELL_CHKICEWALL,
CELL_CHKSTACK,
} cell_t;
@@ -1253,8 +1251,6 @@ enum {
CELL_CLRPNEUMA,
CELL_SETSAFETYWALL,
CELL_CLRSAFETYWALL,
- CELL_SETMOONLIT,
- CELL_CLRMOONLIT,
CELL_SETICEWALL,
CELL_CLRICEWALL,
};
diff --git a/src/map/pc.c b/src/map/pc.c
index 781d434f8..42b8a0ed1 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -3323,11 +3323,10 @@ int pc_setpos(struct map_session_data *sd,unsigned short mapindex,int x,int y,in
x=y=0;
if((x==0 && y==0) ||
(map_getcell(m, x, y, CELL_CHKNOPASS) &&
- !map_getcell(m, x, y, CELL_CHKICEWALL) &&
#ifdef CELL_NOSTACK
!map_getcell(m, x, y, CELL_CHKSTACK) &&
#endif
- !map_getcell(m, x, y, CELL_CHKMOONLIT))
+ !map_getcell(m, x, y, CELL_CHKICEWALL))
){ //It is allowed on top of Moonlight/icewall tiles to prevent force-warping 'cheats' [Skotlex]
if(x||y) {
if(battle_config.error_log)
diff --git a/src/map/skill.c b/src/map/skill.c
index 90d996361..3357d8aa6 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -726,7 +726,6 @@ struct skill_unit_group_tickset *skill_unitgrouptickset_search(struct block_list
static int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int tick);
static int skill_unit_onleft(int skill_id, struct block_list *bl,unsigned int tick);
int skill_unit_effect(struct block_list *bl,va_list ap);
-static void skill_moonlit(struct block_list* src, struct block_list* partner, int skilllv);
int enchant_eff[5] = { 10, 14, 17, 19, 20 };
int deluge_eff[5] = { 5, 9, 12, 14, 15 };
@@ -3749,15 +3748,6 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
if (tsc && tsc->data[SC_NEN].timer != -1)
status_change_end(bl,SC_NEN,-1);
break;
- case CG_MOONLIT:
- clif_skill_nodamage(src,bl,skillid,skilllv,1);
- if (sd && battle_config.player_skill_partner_check &&
- (!battle_config.gm_skilluncond || pc_isGM(sd) < battle_config.gm_skilluncond)) {
- skill_check_pc_partner(sd, skillid, &skilllv, 1, 1);
- } else
- skill_moonlit(bl, NULL, skilllv); //The knockback must be invoked before starting the effect which places down the map cells. [Skotlex]
-
- break;
/* Was modified to only affect targetted char. [Skotlex]
case HP_ASSUMPTIO:
if (flag&1)
@@ -4662,7 +4652,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
|| i==SC_STRIPWEAPON || i==SC_STRIPSHIELD || i==SC_STRIPARMOR || i==SC_STRIPHELM
|| i==SC_CP_WEAPON || i==SC_CP_SHIELD || i==SC_CP_ARMOR || i==SC_CP_HELM
|| i==SC_COMBO || i==SC_DANCING || i==SC_GUILDAURA || i==SC_EDP
- || i==SC_AUTOBERSERK || i==SC_CARTBOOST || i==SC_MELTDOWN || i==SC_MOONLIT
+ || i==SC_AUTOBERSERK || i==SC_CARTBOOST || i==SC_MELTDOWN
|| i==SC_SAFETYWALL || i==SC_SMA || i==SC_SPEEDUP0
)
continue;
@@ -5211,7 +5201,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
case CG_LONGINGFREEDOM:
{
if (tsc && tsc->data[SC_LONGING].timer == -1 && tsc->data[SC_DANCING].timer != -1 && tsc->data[SC_DANCING].val4
- && tsc->data[SC_DANCING].val1 != CG_MOONLIT) //Can't use Longing for Freedom while under Moonlight Petals. [Skotlex]
+ && (tsc->data[SC_DANCING].val1&0xFFFF) != CG_MOONLIT) //Can't use Longing for Freedom while under Moonlight Petals. [Skotlex]
{
clif_skill_nodamage(src,bl,skillid,skilllv,
sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
@@ -6040,6 +6030,7 @@ int skill_castend_pos2 (struct block_list *src, int x, int y, int skillid, int s
case DC_DONTFORGETME:
case DC_FORTUNEKISS:
case DC_SERVICEFORYOU:
+ case CG_MOONLIT:
case GS_DESPERADO:
case NJ_KAENSIN:
case NJ_BAKUENRYU:
@@ -6066,7 +6057,7 @@ int skill_castend_pos2 (struct block_list *src, int x, int y, int skillid, int s
skill_clear_unitgroup(src);
sg = skill_unitsetting(src,skillid,skilllv,x,y,0);
sc_start4(src,SC_DANCING,100,
- skillid,0,0,sg->group_id,skill_get_time(skillid,skilllv));
+ skillid,0,skilllv,sg->group_id,skill_get_time(skillid,skilllv));
flag|=1;
break;
case RG_CLEANER: // [Valaris]
@@ -6927,7 +6918,12 @@ int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, unsigned
if(src->limit + sg->tick > tick + 700)
src->limit = DIFF_TICK(tick+700,sg->tick);
break;
- }
+ case UNT_MOONLIT:
+ //Knockback out of area if affected char isn't in Moonlit effect
+ if (!sc || sc->data[SC_DANCING].timer==-1 || (sc->data[SC_DANCING].val1&0xFFFF) != CG_MOONLIT)
+ skill_blown(ss, bl, skill_get_blewcount(sg->skill_id,sg->skill_lv));
+ break;
+ }
return skillid;
}
@@ -7393,7 +7389,8 @@ static int skill_unit_onleft (int skill_id, struct block_list *bl, unsigned int
case BD_ROKISWEIL:
case BD_INTOABYSS:
case BD_SIEGFRIED:
- if(sc && sc->data[SC_DANCING].timer != -1 && sc->data[SC_DANCING].val1 == skill_id)
+ if(sc && sc->data[SC_DANCING].timer != -1 &&
+ (sc->data[SC_DANCING].val1&0xFFFF) == skill_id)
{ //Check if you just stepped out of your ensemble skill to cancel dancing. [Skotlex]
//We don't check for SC_LONGING because someone could always have knocked you back and out of the song/dance.
//FIXME: This code is not perfect, it doesn't checks for the real ensemble's owner,
@@ -7595,41 +7592,6 @@ int skill_unit_ondamaged (struct skill_unit *src, struct block_list *bl, int dam
return damage;
}
-static int skill_moonlit_sub(struct block_list *bl, va_list ap) {
- struct block_list *src = va_arg(ap, struct block_list*);
- struct block_list *partner = va_arg(ap, struct block_list*);
- int blowcount = va_arg(ap, int);
- if (bl == src || bl == partner)
- return 0;
- skill_blown(src, bl, blowcount);
- return 1;
-}
-
-/*==========================================
- * Starts the moonlit effect by first knocking back all other characters in the vecinity.
- * partner may be null, but src cannot be.
- *------------------------------------------
- */
-static void skill_moonlit (struct block_list* src, struct block_list* partner, int skilllv)
-{
- int range = skill_get_splash(CG_MOONLIT, skilllv);
- int blowcount = range+1, time = skill_get_time(CG_MOONLIT,skilllv);
-
- map_foreachinrange(skill_moonlit_sub,src,
- range, BL_CHAR,src,partner,blowcount);
- if(partner)
- map_foreachinrange(skill_moonlit_sub,partner,
- range, BL_CHAR,src,partner,blowcount);
-
- sc_start4(src,SC_DANCING,100,CG_MOONLIT,0,0,partner?partner->id:BCT_SELF,time+1000);
- sc_start4(src,SkillStatusChangeTable(CG_MOONLIT),100,skilllv,0,0,0,time);
-
- if (partner) {
- sc_start4(partner,SC_DANCING,100,CG_MOONLIT,0,0,src->id,time+1000);
- sc_start4(partner,SkillStatusChangeTable(CG_MOONLIT),100,skilllv,0,0,0,time);
- }
-
-}
/*==========================================
*
*------------------------------------------
@@ -7721,20 +7683,11 @@ int skill_check_pc_partner (struct map_session_data *sd, int skill_id, int* skil
status_charge(&tsd->bl, 0, 10);
}
return c;
- case CG_MOONLIT:
- if (c > 0 && (tsd = map_id2sd(p_sd[0])) != NULL)
- {
- clif_skill_nodamage(&tsd->bl, &sd->bl, skill_id, *skill_lv, 1);
- skill_moonlit(&sd->bl, &tsd->bl, *skill_lv);
- tsd->skillid_dance = skill_id;
- tsd->skilllv_dance = *skill_lv;
- }
- return c;
default: //Warning: Assuming Ensemble skills here (for speed)
if (c > 0 && (tsd = map_id2sd(p_sd[0])) != NULL)
{
sd->sc.data[SC_DANCING].val4= tsd->bl.id;
- sc_start4(&tsd->bl,SC_DANCING,100,skill_id,sd->sc.data[SC_DANCING].val2,0,sd->bl.id,skill_get_time(skill_id,*skill_lv)+1000);
+ sc_start4(&tsd->bl,SC_DANCING,100,skill_id,sd->sc.data[SC_DANCING].val2,*skill_lv,sd->bl.id,skill_get_time(skill_id,*skill_lv)+1000);
clif_skill_nodamage(&tsd->bl, &sd->bl, skill_id, *skill_lv, 1);
tsd->skillid_dance = skill_id;
tsd->skilllv_dance = *skill_lv;
@@ -9743,7 +9696,7 @@ struct skill_unit_group *skill_initunitgroup (struct block_list *src, int count,
sd->skillid_dance=skillid;
sd->skilllv_dance=skilllv;
}
- sc_start4(src,SC_DANCING,100,skillid,(int)group,0,(i&UF_ENSEMBLE?BCT_SELF:0),skill_get_time(skillid,skilllv)+1000);
+ sc_start4(src,SC_DANCING,100,skillid,(int)group,skilllv,(i&UF_ENSEMBLE?BCT_SELF:0),skill_get_time(skillid,skilllv)+1000);
if (sd && i&UF_ENSEMBLE &&
battle_config.player_skill_partner_check &&
(!battle_config.gm_skilluncond || pc_isGM(sd) < battle_config.gm_skilluncond)
diff --git a/src/map/skill.h b/src/map/skill.h
index 90622b9ba..1c2e1aab7 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -938,7 +938,7 @@ enum {
UNT_CALLFAMILY,
UNT_GOSPEL,
UNT_BASILICA,
- //0xb5
+ UNT_MOONLIT,//0xb5 //I HOPE this one doesn't shows any effects
UNT_FOGWALL = 0xb6,
UNT_SPIDERWEB,
UNT_GRAVITATION,
diff --git a/src/map/status.c b/src/map/status.c
index 853790383..27bce71ce 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -302,7 +302,7 @@ void initChangeTables(void) {
set_sc(ST_CHASEWALK, SC_CHASEWALK, SI_BLANK, SCB_SPEED);
set_sc(ST_REJECTSWORD, SC_REJECTSWORD, SI_REJECTSWORD, SCB_NONE);
add_sc(ST_REJECTSWORD, SC_AUTOCOUNTER);
- set_sc(CG_MOONLIT, SC_MOONLIT, SI_MOONLIT, SCB_NONE);
+// set_sc(CG_MOONLIT, SC_MOONLIT, SI_MOONLIT, SCB_NONE);
set_sc(CG_MARIONETTE, SC_MARIONETTE, SI_MARIONETTE, SCB_STR|SCB_AGI|SCB_VIT|SCB_INT|SCB_DEX|SCB_LUK);
set_sc(CG_MARIONETTE, SC_MARIONETTE2, SI_MARIONETTE2, SCB_STR|SCB_AGI|SCB_VIT|SCB_INT|SCB_DEX|SCB_LUK);
add_sc(LK_SPIRALPIERCE, SC_STOP);
@@ -1007,7 +1007,7 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, int
if (skill_num != BD_ADAPTATION && skill_num != CG_LONGINGFREEDOM
&& skill_num != BA_MUSICALSTRIKE && skill_num != DC_THROWARROW)
return 0;
- if (sc->data[SC_DANCING].val1 == CG_HERMODE && skill_num == BD_ADAPTATION)
+ if ((sc->data[SC_DANCING].val1&0xFFFF) == CG_HERMODE && skill_num == BD_ADAPTATION)
return 0; //Can't amp out of Wand of Hermode :/ [Skotlex]
}
@@ -4943,14 +4943,14 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
case SC_SPEARQUICKEN:
val2 = 200+10*val1;
break;
- case SC_MOONLIT:
- val2 = bl->id;
- skill_setmapcell(bl,CG_MOONLIT, val1, CELL_SETMOONLIT);
- break;
case SC_DANCING:
- //val1 : Skill which is being danced.
+ //val1 : Skill ID + LV
//val2 : Skill Group of the Dance.
+ //val3 : Brings the skilllv (merged into val1 here)
//val4 : Partner
+ if (val1 == CG_MOONLIT)
+ clif_status_change(bl,SI_MOONLIT,1);
+ val1|= (val3<<16);
val3 = 0; //Tick duration/Speed penalty.
if (sd) { //Store walk speed change in lower part of val3
val3 = 500-40*pc_checkskill(sd,(sd->status.sex?BA_MUSICALLESSON:DC_DANCINGLESSON));
@@ -6005,9 +6005,8 @@ int status_change_end( struct block_list* bl , int type,int tid )
}
}
}
- //Only dance that doesn't has ground tiles... [Skotlex]
- if(sc->data[type].val1 == CG_MOONLIT)
- status_change_end(bl, SC_MOONLIT, -1);
+ if ((sc->data[type].val1&0xFFFF) == CG_MOONLIT)
+ clif_status_change(bl,SI_MOONLIT,0);
if (sc->data[SC_LONGING].timer!=-1)
status_change_end(bl,SC_LONGING,-1);
@@ -6105,9 +6104,6 @@ int status_change_end( struct block_list* bl , int type,int tid )
case SC_BASILICA: //Clear the skill area. [Skotlex]
skill_clear_unitgroup(bl);
break;
- case SC_MOONLIT: //Clear the unit effect. [Skotlex]
- skill_setmapcell(bl,CG_MOONLIT, sc->data[SC_MOONLIT].val1, CELL_CLRMOONLIT);
- break;
case SC_TRICKDEAD:
if (vd) vd->dead_sit = 0;
break;
@@ -6529,7 +6525,7 @@ int status_change_timer(int tid, unsigned int tick, int id, int data)
break;
sc->data[type].val3&= 0xFFFF; //Remove counter
sc->data[type].val3|=(counter<<16);//Reset it.
- switch(sc->data[type].val1){
+ switch(sc->data[type].val1&0xFFFF){
case BD_RICHMANKIM:
case BD_DRUMBATTLEFIELD:
case BD_RINGNIBELUNGEN:
@@ -6557,7 +6553,8 @@ int status_change_timer(int tid, unsigned int tick, int id, int data)
s=6;
break;
case CG_MOONLIT:
- sp= 4*sc->data[SC_MOONLIT].val1; //Moonlit's cost is 4sp*skill_lv [Skotlex]
+ //Moonlit's cost is 4sp*skill_lv [Skotlex]
+ sp= 4*(sc->data[type].val1>>16);
//Upkeep is also every 10 secs.
case DC_DONTFORGETME:
s=10;
diff --git a/src/map/status.h b/src/map/status.h
index fb6847804..cd45da6d4 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -136,7 +136,7 @@ enum {
SC_REJECTSWORD,
SC_MARIONETTE,
SC_MARIONETTE2,
- SC_MOONLIT,
+ SC_UNUSED, //Unused (was SC_MOONLIT)
SC_JOINTBEAT,
SC_MINDBREAKER, //130
SC_MEMORIZE,
diff --git a/src/map/unit.c b/src/map/unit.c
index 13959e5cd..8e34eca45 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -668,11 +668,11 @@ int unit_can_move(struct block_list *bl)
|| sc->data[SC_BLADESTOP].timer !=-1
|| sc->data[SC_BLADESTOP_WAIT].timer !=-1
|| sc->data[SC_SPIDERWEB].timer !=-1
- || (sc->data[SC_DANCING].timer !=-1 && (
- (sc->data[SC_DANCING].val4 && sc->data[SC_LONGING].timer == -1) ||
- sc->data[SC_DANCING].val1 == CG_HERMODE //cannot move while Hermod is active.
+ || (sc->data[SC_DANCING].timer !=-1 && sc->data[SC_DANCING].val4 && (
+ sc->data[SC_LONGING].timer == -1 ||
+ (sc->data[SC_DANCING].val1&0xFFFF) == CG_MOONLIT ||
+ (sc->data[SC_DANCING].val1&0xFFFF) == CG_HERMODE
))
- || sc->data[SC_MOONLIT].timer != -1
|| (sc->data[SC_GOSPEL].timer !=-1 && sc->data[SC_GOSPEL].val4 == BCT_SELF) // cannot move while gospel is in effect
|| sc->data[SC_STOP].timer != -1
|| sc->data[SC_CLOSECONFINE].timer != -1