Index: src/map/skill.c
===================================================================
--- src/map/skill.c (revision 17246)
+++ src/map/skill.c (working copy)
@@ -12175,6 +12175,19 @@
}
break;
}
+
+ case UNT_DISSONANCE:
+ {
+ short i;
+ for(i = BA_WHISTLE; i <= DC_SERVICEFORYOU; i++){
+ if(skill_get_inf2(i)&(INF2_SONG_DANCE)){
+ type = status_skill2sc(i);
+ sce = (sc && type != -1)?sc->data[type]:NULL;
+ if(sce)
+ return i;
+ }
+ }
+ }
}
return sg->skill_id;
}
@@ -12182,7 +12195,7 @@
/*==========================================
* Triggered when a char steps out of a skill group (entirely) [Skotlex]
*------------------------------------------*/
-static int skill_unit_onleft (uint16 skill_id, struct block_list *bl, unsigned int tick)
+int skill_unit_onleft (uint16 skill_id, struct block_list *bl, unsigned int tick)
{
struct status_change *sc;
struct status_change_entry *sce;
@@ -12248,6 +12261,22 @@
}
break;
+ case BA_DISSONANCE:
+ {
+ short i;
+ for(i = BA_WHISTLE; i <= DC_SERVICEFORYOU; i++){
+ if(skill_get_inf2(i)&(INF2_SONG_DANCE)){
+ type = status_skill2sc(i);
+ sce = (sc && type != -1)?sc->data[type]:NULL;
+ if(sce && !sce->val4){ //We don't want dissonance updating this anymore
+ delete_timer(sce->timer, status_change_timer);
+ sce->val4 = 1; //Store the fact that this is a "reduced" duration effect.
+ sce->timer = add_timer(tick+skill_get_time2(i,1), status_change_timer, bl->id, type);
+ }
+ }
+ }
+ }
+ break;
case BA_POEMBRAGI:
case BA_WHISTLE:
case BA_ASSASSINCROSS:
@@ -12297,6 +12326,7 @@
* flag values:
* flag&1: Invoke onplace function (otherwise invoke onout)
* flag&4: Invoke a onleft call (the unit might be scheduled for deletion)
+ * flag&8 recursive
*------------------------------------------*/
static int skill_unit_effect (struct block_list* bl, va_list ap)
{
@@ -12305,7 +12335,7 @@
unsigned int tick = va_arg(ap,unsigned int);
unsigned int flag = va_arg(ap,unsigned int);
uint16 skill_id;
- bool dissonance;
+ bool dissonance = false;
bool isTarget = false;
if( (!unit->alive && !(flag&4)) || bl->prev == NULL )
@@ -12313,12 +12343,16 @@
nullpo_ret(group);
- dissonance = skill_dance_switch(unit, 0);
+ if(!(flag&8)){
+ dissonance = skill_dance_switch(unit, 0);
+ //Target-type check.
+ isTarget = group->bl_flag & bl->type && battle_check_target( &unit->bl, bl, group->target_flag ) > 0;
+ }
+ else isTarget = true;
//Necessary in case the group is deleted after calling on_place/on_out [Skotlex]
skill_id = group->skill_id;
- //Target-type check.
- isTarget = group->bl_flag & bl->type && battle_check_target( &unit->bl, bl, group->target_flag ) > 0;
+
if( isTarget ){
if( flag&1 )
skill_unit_onplace(unit,bl,tick);
@@ -12331,8 +12365,12 @@
skill_unit_onleft(skill_id, bl, tick);//Ensemble check to terminate it.
}
- if( dissonance )
+ if( dissonance ) {
skill_dance_switch(unit, 1);
+ //we placed a dissonance, let's update (call on left by recursive)
+ map_foreachincell(skill_unit_effect,unit->bl.m,unit->bl.x,unit->bl.y,group->bl_flag,&unit->bl,gettick(),4|8);
+// map_foreachincell(skill_unit_onleft,unit->bl.m,unit->bl.x,unit->bl.y,BL_CHAR,skill_id,bl,tick);
+ }
return 0;
}
@@ -15662,7 +15700,7 @@
{
struct map_session_data *sd = NULL;
if(group->val1) {
- sd = map_charid2sd(group->val1);
+ sd = map_charid2sd(group->val1);
group->val1 = 0;
if (sd && !map[sd->bl.m].flag.nowarp)
pc_setpos(sd,map_id2index(unit->bl.m),unit->bl.x,unit->bl.y,CLR_TELEPORT);
@@ -15786,7 +15824,7 @@
}
}
- if( dissonance ) skill_dance_switch(unit, 1);
+ if( dissonance ) skill_dance_switch(unit, 1);
return 0;
}
@@ -15837,7 +15875,10 @@
if( unit->group->interval != -1 && !(skill_get_unit_flag(skill_id)&UF_DUALMODE) && skill_id != BD_LULLABY ) //Lullaby is the exception, bugreport:411
{ //Non-dualmode unit skills with a timer don't trigger when walking, so just return
- if( dissonance ) skill_dance_switch(unit, 1);
+ if( dissonance ) {
+ skill_dance_switch(unit, 1);
+ skill_unit_onleft(skill_unit_onout(unit,target,tick),target,tick); //we placed a dissonance, let's update
+ }
return 0;
}
Index: src/map/status.c
===================================================================
--- src/map/status.c (revision 17246)
+++ src/map/status.c (working copy)
@@ -338,8 +338,8 @@
add_sc( BA_FROSTJOKER , SC_FREEZE );
set_sc( BA_WHISTLE , SC_WHISTLE , SI_BLANK , SCB_FLEE|SCB_FLEE2 );
set_sc( BA_ASSASSINCROSS , SC_ASSNCROS , SI_BLANK , SCB_ASPD );
- add_sc( BA_POEMBRAGI , SC_POEMBRAGI );
- set_sc( BA_APPLEIDUN , SC_APPLEIDUN , SI_BLANK , SCB_MAXHP );
+ set_sc( BA_POEMBRAGI , SC_POEMBRAGI ,SI_FIREWEAPON ,SCB_NONE);
+ set_sc( BA_APPLEIDUN , SC_APPLEIDUN , SI_WATERWEAPON , SCB_MAXHP );
add_sc( DC_SCREAM , SC_STUN );
set_sc( DC_HUMMING , SC_HUMMING , SI_BLANK , SCB_HIT );
set_sc( DC_DONTFORGETME , SC_DONTFORGETME , SI_BLANK , SCB_SPEED|SCB_ASPD );