viewing paste Unknown #5630 | Diff

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
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 );
Viewed 1196 times, submitted by lighta.