WalkingBad 0 Posted June 1, 2014 can I request this kind of mapflag? I don't know if this is a mapflag hmmm.. for example im in aldebaran when I go to prontera my movespeed will increase and when I leave the map my movespeed will back to normal.. TIA Guys... Quote Share this post Link to post Share on other sites
0 Hakuren 0 Posted June 3, 2014 same problem bro Quote Share this post Link to post Share on other sites
0 quesoph 105 Posted June 3, 2014 Index: clif.c===================================================================--- clif.c (revision 14843)+++ clif.c (working copy)@@ -8674,6 +8674,12 @@ if(map[sd->bl.m].flag.loadevent) // Lance npc_script_event(sd, NPCE_LOADMAP);+ if ( map[sd->bl.m].movespeed )+ sd->battle_status.speed = map[sd->bl.m].movespeed;+ else+ sd->battle_status.speed = status_calc_speed( &sd->bl, &sd->sc, sd->base_status.speed );+ clif_updatestatus(sd,SP_SPEED);+ if (pc_checkskill(sd, SG_DEVIL) && !pc_nextjobexp(sd)) clif_status_load(&sd->bl, SI_DEVIL, 1); //blindness [Komurka]@@ -15403,3 +15409,139 @@ add_timer_func_list(clif_delayquit, "clif_delayquit"); return 0;}++static unsigned short status_calc_speed(struct block_list *bl, struct status_change *sc, int speed)+{+ TBL_PC* sd = BL_CAST(BL_PC, bl);+ int speed_rate;++ if( sc == NULL )+ return cap_value(speed,10,USHRT_MAX);++ if( sd && sd->ud.skilltimer != INVALID_TIMER && pc_checkskill(sd,SA_FREECAST) > 0 )+ {+ speed_rate = 175 - 5 * pc_checkskill(sd,SA_FREECAST);+ }+ else+ {+ speed_rate = 100;++ //GetMoveHasteValue2()+ {+ int val = 0;++ if( sc->data[SC_FUSION] )+ val = 25;+ else+ if( sd && pc_isriding(sd) )+ val = 25;++ speed_rate -= val;+ }++ //GetMoveSlowValue()+ {+ int val = 0;++ if( sd && sc->data[SC_HIDING] && pc_checkskill(sd,RG_TUNNELDRIVE) > 0 )+ val = 120 - 6 * pc_checkskill(sd,RG_TUNNELDRIVE);+ else+ if( sd && sc->data[SC_CHASEWALK] && sc->data[SC_CHASEWALK]->val3 < 0 )+ val = sc->data[SC_CHASEWALK]->val3;+ else+ {+ // Longing for Freedom cancels song/dance penalty+ if( sc->data[SC_LONGING] )+ val = max( val, 50 - 10 * sc->data[SC_LONGING]->val1 );+ else+ if( sd && sc->data[SC_DANCING] )+ val = max( val, 500 - (40 + 10 * (sc->data[SC_SPIRIT] &&sc->data[SC_SPIRIT]->val2 == SL_BARDDANCER)) *pc_checkskill(sd,(sd->status.sex?BA_MUSICALLESSON:DC_DANCINGLESSON)));++ if( sc->data[SC_DECREASEAGI] )+ val = max( val, 25 );+ if( sc->data[SC_QUAGMIRE] )+ val = max( val, 50 );+ if( sc->data[SC_DONTFORGETME] )+ val = max( val, sc->data[SC_DONTFORGETME]->val3 );+ if( sc->data[SC_CURSE] )+ val = max( val, 300 );+ if( sc->data[SC_CHASEWALK] )+ val = max( val, sc->data[SC_CHASEWALK]->val3 );+ if( sc->data[SC_WEDDING] )+ val = max( val, 100 );+ if( sc->data[SC_JOINTBEAT] && sc->data[SC_JOINTBEAT]->val2&(BREAK_ANKLE|BREAK_KNEE) )+ val = max( val, (sc->data[SC_JOINTBEAT]->val2&BREAK_ANKLE? 50 : 0) + (sc->data[SC_JOINTBEAT]->val2&BREAK_KNEE ? 30 :0) );+ if( sc->data[SC_CLOAKING] && (sc->data[SC_CLOAKING]->val4&1) == 0 )+ val = max( val, sc->data[SC_CLOAKING]->val1 < 3 ? 300 : 30 - 3 * sc->data[SC_CLOAKING]->val1 );+ if( sc->data[SC_GOSPEL] && sc->data[SC_GOSPEL]->val4 == BCT_ENEMY )+ val = max( val, 75 );+ if( sc->data[SC_SLOWDOWN] ) // Slow Potion+ val = max( val, 100 );+ if( sc->data[SC_GATLINGFEVER] )+ val = max( val, 100 );+ if( sc->data[SC_SUITON] )+ val = max( val, sc->data[SC_SUITON]->val3 );+ if( sc->data[SC_SWOO] )+ val = max( val, 300 );++ if( sd && sd->speed_rate + sd->speed_add_rate > 0 ) // permanent item-based speedup+ val = max( val, sd->speed_rate + sd->speed_add_rate );+ }++ speed_rate += val;+ }++ //GetMoveHasteValue1()+ {+ int val = 0;++ if( sc->data[SC_SPEEDUP1] ) //FIXME: used both by NPC_AGIUP and Speed Potion script+ val = max( val, 50 );+ if( sc->data[SC_INCREASEAGI] )+ val = max( val, 25 );+ if( sc->data[SC_WINDWALK] )+ val = max( val, 2 * sc->data[SC_WINDWALK]->val1 );+ if( sc->data[SC_CARTBOOST] )+ val = max( val, 20 );+ if( sd && (sd->class_&MAPID_UPPERMASK) == MAPID_ASSASSIN && pc_checkskill(sd,TF_MISS) > 0 )+ val = max( val, 1 * pc_checkskill(sd,TF_MISS) );+ if( sc->data[SC_CLOAKING] && (sc->data[SC_CLOAKING]->val4&1) == 1 )+ val = max( val, sc->data[SC_CLOAKING]->val1 >= 10 ? 25 : 3 * sc->data[SC_CLOAKING]->val1 - 3 );+ if( sc->data[SC_BERSERK] )+ val = max( val, 25 );+ if( sc->data[SC_RUN] )+ val = max( val, 55 );+ if( sc->data[SC_AVOID] )+ val = max( val, 10 * sc->data[SC_AVOID]->val1 );+ if( sc->data[SC_INVINCIBLE] && !sc->data[SC_INVINCIBLEOFF] )+ val = max( val, 75 );++ //FIXME: official items use a single bonus for this [ultramage]+ if( sc->data[SC_SPEEDUP0] ) // temporary item-based speedup+ val = max( val, 25 );+ if( sd && sd->speed_rate + sd->speed_add_rate < 0 ) // permanent item-based speedup+ val = max( val, -(sd->speed_rate + sd->speed_add_rate) );++ speed_rate -= val;+ }++ if( speed_rate < 40 )+ speed_rate = 40;+ }++ //GetSpeed()+ {+ if( sd && pc_iscarton(sd) )+ speed += speed * (50 - 5 * pc_checkskill(sd,MC_PUSHCART)) / 100;+ if( speed_rate != 100 )+ speed = speed * speed_rate / 100;+ if( sc->data[SC_STEELBODY] )+ speed = 200;+ if( sc->data[SC_DEFENDER] )+ speed = max(speed, 200);+ if( sc->data[SC_WALKSPEED] && sc->data[SC_WALKSPEED]->val1 > 0 ) // ChangeSpeed+ speed = speed * 100 / sc->data[SC_WALKSPEED]->val1;+ }++ return (short)cap_value(speed,10,USHRT_MAX);+}Index: clif.h===================================================================--- clif.h (revision 14843)+++ clif.h (working copy)@@ -625,4 +625,6 @@void clif_open_search_store_info(struct map_session_data* sd);void clif_search_store_info_click_ack(struct map_session_data* sd, short x, short y);+static unsigned short status_calc_speed(struct block_list *,struct status_change *,int);+#endif /* _CLIF_H_ */Index: map.c===================================================================--- map.c (revision 14843)+++ map.c (working copy)@@ -2801,6 +2801,7 @@ // additional mapflag data map[i].zone = 0; // restricted mapflag zone map[i].nocommand = 0; // nocommand mapflag level+ map[i].movespeed = 0; // movespeed mapflag level map[i].bexp = 100; // per map base exp multiplicator map[i].jexp = 100; // per map job exp multiplicator memset(map[i].drop_list, 0, sizeof(map[i].drop_list)); // pvp nightmare drop listIndex: map.h===================================================================--- map.h (revision 14843)+++ map.h (working copy)@@ -500,6 +500,7 @@ int jexp; // map experience multiplicator int bexp; // map experience multiplicator int nocommand; //Blocks @/# commands for non-gms. [Skotlex]+ int movespeed; // Instance Variables int instance_id; int instance_src_map;Index: npc.c===================================================================--- npc.c (revision 14843)+++ npc.c (working copy)@@ -3115,6 +3115,21 @@ map[m].flag.partylock=state; else if (!strcmpi(w3,"guildlock")) map[m].flag.guildlock=state;+ else if (!strcmpi(w3,"movespeed")) {+ if (state) {+ if ( sscanf(w4, "%d", &state) == 1 ) {+ if ( state < 50 )+ map[m].movespeed = 50;+ else if ( state > 1000 )+ map[m].movespeed = 1000;+ else+ map[m].movespeed = state;+ }+ else+ map[m].movespeed = 150;+ } else+ map[m].movespeed = 0;+ } else ShowError("npc_parse_mapflag: unrecognized mapflag '%s' (file '%s',line '%d').n", w3, filepath, strline(buffer,start-buffer));Index: pc.c===================================================================--- pc.c (revision 14843)+++ pc.c (working copy)@@ -6025,6 +6025,7 @@ nullpo_ret(sd); switch(type) {+ case SP_SPEED: val = sd->battle_status.speed; break; case SP_SKILLPOINT: val = sd->status.skill_point; break; case SP_STATUSPOINT: val = sd->status.status_point; break; case SP_ZENY: val = sd->status.zeny; break;Index: script.c===================================================================--- script.c (revision 14843)+++ script.c (working copy)@@ -348,7 +348,8 @@ MF_ALLOWKS, MF_MONSTER_NOTELEPORT, MF_PVP_NOCALCRANK, //50- MF_BATTLEGROUND+ MF_BATTLEGROUND,+ MF_MOVESPEED};const char* script_op2name(int op)@@ -9627,6 +9628,7 @@ case MF_MONSTER_NOTELEPORT: script_pushint(st,map[m].flag.monster_noteleport); break; case MF_PVP_NOCALCRANK: script_pushint(st,map[m].flag.pvp_nocalcrank); break; case MF_BATTLEGROUND: script_pushint(st,map[m].flag.battleground); break;+ case MF_MOVESPEED: script_pushint(st,map[m].movespeed); break; } }@@ -9696,6 +9698,7 @@ case MF_MONSTER_NOTELEPORT: map[m].flag.monster_noteleport=1; break; case MF_PVP_NOCALCRANK: map[m].flag.pvp_nocalcrank=1; break; case MF_BATTLEGROUND: map[m].flag.battleground = (!val || atoi(val) < 0 || atoi(val) > 2) ? 1 : atoi(val); break;+ case MF_MOVESPEED: map[m].movespeed = (!val)? 150: (atoi(val) < 50)? 50: (atoi(val) > 1000)? 1000: atoi(val); break; } }@@ -9762,6 +9765,7 @@ case MF_MONSTER_NOTELEPORT: map[m].flag.monster_noteleport=0; break; case MF_PVP_NOCALCRANK: map[m].flag.pvp_nocalcrank=0; break; case MF_BATTLEGROUND: map[m].flag.battleground=0; break;+ case MF_MOVESPEED: map[m].movespeed=0; break; } }Index: status.c===================================================================--- status.c (revision 14843)+++ status.c (working copy)@@ -3886,6 +3886,10 @@ speed = speed * 100 / sc->data[SC_WALKSPEED]->val1; }+ if ( bl->type == BL_PC )+ if ( map[sd->bl.m].movespeed )+ speed = map[sd->bl.m].movespeed;+ return (short)cap_value(speed,10,USHRT_MAX);} prontera mapflag movespeed 50 This is an old modification by AnnieRuru 1 WalkingBad reacted to this Quote Share this post Link to post Share on other sites
0 Hakuren 0 Posted June 3, 2014 Index: clif.c===================================================================--- clif.c (revision 14843)+++ clif.c (working copy)@@ -8674,6 +8674,12 @@ if(map[sd->bl.m].flag.loadevent) // Lance npc_script_event(sd, NPCE_LOADMAP);+ if ( map[sd->bl.m].movespeed )+ sd->battle_status.speed = map[sd->bl.m].movespeed;+ else+ sd->battle_status.speed = status_calc_speed( &sd->bl, &sd->sc, sd->base_status.speed );+ clif_updatestatus(sd,SP_SPEED);+ if (pc_checkskill(sd, SG_DEVIL) && !pc_nextjobexp(sd)) clif_status_load(&sd->bl, SI_DEVIL, 1); //blindness [Komurka]@@ -15403,3 +15409,139 @@ add_timer_func_list(clif_delayquit, "clif_delayquit"); return 0;}++static unsigned short status_calc_speed(struct block_list *bl, struct status_change *sc, int speed)+{+ TBL_PC* sd = BL_CAST(BL_PC, bl);+ int speed_rate;++ if( sc == NULL )+ return cap_value(speed,10,USHRT_MAX);++ if( sd && sd->ud.skilltimer != INVALID_TIMER && pc_checkskill(sd,SA_FREECAST) > 0 )+ {+ speed_rate = 175 - 5 * pc_checkskill(sd,SA_FREECAST);+ }+ else+ {+ speed_rate = 100;++ //GetMoveHasteValue2()+ {+ int val = 0;++ if( sc->data[SC_FUSION] )+ val = 25;+ else+ if( sd && pc_isriding(sd) )+ val = 25;++ speed_rate -= val;+ }++ //GetMoveSlowValue()+ {+ int val = 0;++ if( sd && sc->data[SC_HIDING] && pc_checkskill(sd,RG_TUNNELDRIVE) > 0 )+ val = 120 - 6 * pc_checkskill(sd,RG_TUNNELDRIVE);+ else+ if( sd && sc->data[SC_CHASEWALK] && sc->data[SC_CHASEWALK]->val3 < 0 )+ val = sc->data[SC_CHASEWALK]->val3;+ else+ {+ // Longing for Freedom cancels song/dance penalty+ if( sc->data[SC_LONGING] )+ val = max( val, 50 - 10 * sc->data[SC_LONGING]->val1 );+ else+ if( sd && sc->data[SC_DANCING] )+ val = max( val, 500 - (40 + 10 * (sc->data[SC_SPIRIT] &&sc->data[SC_SPIRIT]->val2 == SL_BARDDANCER)) *pc_checkskill(sd,(sd->status.sex?BA_MUSICALLESSON:DC_DANCINGLESSON)));++ if( sc->data[SC_DECREASEAGI] )+ val = max( val, 25 );+ if( sc->data[SC_QUAGMIRE] )+ val = max( val, 50 );+ if( sc->data[SC_DONTFORGETME] )+ val = max( val, sc->data[SC_DONTFORGETME]->val3 );+ if( sc->data[SC_CURSE] )+ val = max( val, 300 );+ if( sc->data[SC_CHASEWALK] )+ val = max( val, sc->data[SC_CHASEWALK]->val3 );+ if( sc->data[SC_WEDDING] )+ val = max( val, 100 );+ if( sc->data[SC_JOINTBEAT] && sc->data[SC_JOINTBEAT]->val2&(BREAK_ANKLE|BREAK_KNEE) )+ val = max( val, (sc->data[SC_JOINTBEAT]->val2&BREAK_ANKLE? 50 : 0) + (sc->data[SC_JOINTBEAT]->val2&BREAK_KNEE ? 30 :0) );+ if( sc->data[SC_CLOAKING] && (sc->data[SC_CLOAKING]->val4&1) == 0 )+ val = max( val, sc->data[SC_CLOAKING]->val1 < 3 ? 300 : 30 - 3 * sc->data[SC_CLOAKING]->val1 );+ if( sc->data[SC_GOSPEL] && sc->data[SC_GOSPEL]->val4 == BCT_ENEMY )+ val = max( val, 75 );+ if( sc->data[SC_SLOWDOWN] ) // Slow Potion+ val = max( val, 100 );+ if( sc->data[SC_GATLINGFEVER] )+ val = max( val, 100 );+ if( sc->data[SC_SUITON] )+ val = max( val, sc->data[SC_SUITON]->val3 );+ if( sc->data[SC_SWOO] )+ val = max( val, 300 );++ if( sd && sd->speed_rate + sd->speed_add_rate > 0 ) // permanent item-based speedup+ val = max( val, sd->speed_rate + sd->speed_add_rate );+ }++ speed_rate += val;+ }++ //GetMoveHasteValue1()+ {+ int val = 0;++ if( sc->data[SC_SPEEDUP1] ) //FIXME: used both by NPC_AGIUP and Speed Potion script+ val = max( val, 50 );+ if( sc->data[SC_INCREASEAGI] )+ val = max( val, 25 );+ if( sc->data[SC_WINDWALK] )+ val = max( val, 2 * sc->data[SC_WINDWALK]->val1 );+ if( sc->data[SC_CARTBOOST] )+ val = max( val, 20 );+ if( sd && (sd->class_&MAPID_UPPERMASK) == MAPID_ASSASSIN && pc_checkskill(sd,TF_MISS) > 0 )+ val = max( val, 1 * pc_checkskill(sd,TF_MISS) );+ if( sc->data[SC_CLOAKING] && (sc->data[SC_CLOAKING]->val4&1) == 1 )+ val = max( val, sc->data[SC_CLOAKING]->val1 >= 10 ? 25 : 3 * sc->data[SC_CLOAKING]->val1 - 3 );+ if( sc->data[SC_BERSERK] )+ val = max( val, 25 );+ if( sc->data[SC_RUN] )+ val = max( val, 55 );+ if( sc->data[SC_AVOID] )+ val = max( val, 10 * sc->data[SC_AVOID]->val1 );+ if( sc->data[SC_INVINCIBLE] && !sc->data[SC_INVINCIBLEOFF] )+ val = max( val, 75 );++ //FIXME: official items use a single bonus for this [ultramage]+ if( sc->data[SC_SPEEDUP0] ) // temporary item-based speedup+ val = max( val, 25 );+ if( sd && sd->speed_rate + sd->speed_add_rate < 0 ) // permanent item-based speedup+ val = max( val, -(sd->speed_rate + sd->speed_add_rate) );++ speed_rate -= val;+ }++ if( speed_rate < 40 )+ speed_rate = 40;+ }++ //GetSpeed()+ {+ if( sd && pc_iscarton(sd) )+ speed += speed * (50 - 5 * pc_checkskill(sd,MC_PUSHCART)) / 100;+ if( speed_rate != 100 )+ speed = speed * speed_rate / 100;+ if( sc->data[SC_STEELBODY] )+ speed = 200;+ if( sc->data[SC_DEFENDER] )+ speed = max(speed, 200);+ if( sc->data[SC_WALKSPEED] && sc->data[SC_WALKSPEED]->val1 > 0 ) // ChangeSpeed+ speed = speed * 100 / sc->data[SC_WALKSPEED]->val1;+ }++ return (short)cap_value(speed,10,USHRT_MAX);+}Index: clif.h===================================================================--- clif.h (revision 14843)+++ clif.h (working copy)@@ -625,4 +625,6 @@void clif_open_search_store_info(struct map_session_data* sd);void clif_search_store_info_click_ack(struct map_session_data* sd, short x, short y);+static unsigned short status_calc_speed(struct block_list *,struct status_change *,int);+#endif /* _CLIF_H_ */Index: map.c===================================================================--- map.c (revision 14843)+++ map.c (working copy)@@ -2801,6 +2801,7 @@ // additional mapflag data map[i].zone = 0; // restricted mapflag zone map[i].nocommand = 0; // nocommand mapflag level+ map[i].movespeed = 0; // movespeed mapflag level map[i].bexp = 100; // per map base exp multiplicator map[i].jexp = 100; // per map job exp multiplicator memset(map[i].drop_list, 0, sizeof(map[i].drop_list)); // pvp nightmare drop listIndex: map.h===================================================================--- map.h (revision 14843)+++ map.h (working copy)@@ -500,6 +500,7 @@ int jexp; // map experience multiplicator int bexp; // map experience multiplicator int nocommand; //Blocks @/# commands for non-gms. [Skotlex]+ int movespeed; // Instance Variables int instance_id; int instance_src_map;Index: npc.c===================================================================--- npc.c (revision 14843)+++ npc.c (working copy)@@ -3115,6 +3115,21 @@ map[m].flag.partylock=state; else if (!strcmpi(w3,"guildlock")) map[m].flag.guildlock=state;+ else if (!strcmpi(w3,"movespeed")) {+ if (state) {+ if ( sscanf(w4, "%d", &state) == 1 ) {+ if ( state < 50 )+ map[m].movespeed = 50;+ else if ( state > 1000 )+ map[m].movespeed = 1000;+ else+ map[m].movespeed = state;+ }+ else+ map[m].movespeed = 150;+ } else+ map[m].movespeed = 0;+ } else ShowError("npc_parse_mapflag: unrecognized mapflag '%s' (file '%s',line '%d').n", w3, filepath, strline(buffer,start-buffer));Index: pc.c===================================================================--- pc.c (revision 14843)+++ pc.c (working copy)@@ -6025,6 +6025,7 @@ nullpo_ret(sd); switch(type) {+ case SP_SPEED: val = sd->battle_status.speed; break; case SP_SKILLPOINT: val = sd->status.skill_point; break; case SP_STATUSPOINT: val = sd->status.status_point; break; case SP_ZENY: val = sd->status.zeny; break;Index: script.c===================================================================--- script.c (revision 14843)+++ script.c (working copy)@@ -348,7 +348,8 @@ MF_ALLOWKS, MF_MONSTER_NOTELEPORT, MF_PVP_NOCALCRANK, //50- MF_BATTLEGROUND+ MF_BATTLEGROUND,+ MF_MOVESPEED};const char* script_op2name(int op)@@ -9627,6 +9628,7 @@ case MF_MONSTER_NOTELEPORT: script_pushint(st,map[m].flag.monster_noteleport); break; case MF_PVP_NOCALCRANK: script_pushint(st,map[m].flag.pvp_nocalcrank); break; case MF_BATTLEGROUND: script_pushint(st,map[m].flag.battleground); break;+ case MF_MOVESPEED: script_pushint(st,map[m].movespeed); break; } }@@ -9696,6 +9698,7 @@ case MF_MONSTER_NOTELEPORT: map[m].flag.monster_noteleport=1; break; case MF_PVP_NOCALCRANK: map[m].flag.pvp_nocalcrank=1; break; case MF_BATTLEGROUND: map[m].flag.battleground = (!val || atoi(val) < 0 || atoi(val) > 2) ? 1 : atoi(val); break;+ case MF_MOVESPEED: map[m].movespeed = (!val)? 150: (atoi(val) < 50)? 50: (atoi(val) > 1000)? 1000: atoi(val); break; } }@@ -9762,6 +9765,7 @@ case MF_MONSTER_NOTELEPORT: map[m].flag.monster_noteleport=0; break; case MF_PVP_NOCALCRANK: map[m].flag.pvp_nocalcrank=0; break; case MF_BATTLEGROUND: map[m].flag.battleground=0; break;+ case MF_MOVESPEED: map[m].movespeed=0; break; } }Index: status.c===================================================================--- status.c (revision 14843)+++ status.c (working copy)@@ -3886,6 +3886,10 @@ speed = speed * 100 / sc->data[SC_WALKSPEED]->val1; }+ if ( bl->type == BL_PC )+ if ( map[sd->bl.m].movespeed )+ speed = map[sd->bl.m].movespeed;+ return (short)cap_value(speed,10,USHRT_MAX);} prontera mapflag movespeed 50 This is an old modification by AnnieRuru thank you it works Quote Share this post Link to post Share on other sites
0 quesoph 105 Posted June 3, 2014 (edited) here @edit updated map.patch Edited June 3, 2014 by quesoph 1 Tsuuu reacted to this Quote Share this post Link to post Share on other sites
0 quesoph 105 Posted June 3, 2014 I forgot something. i updated it. http://herc.ws/board/topic/5834-request-movespeed-mapflag/#entry36956 Quote Share this post Link to post Share on other sites
can I request this kind of mapflag? I don't know if this is a mapflag
hmmm.. for example im in aldebaran when I go to prontera my movespeed will increase and when I leave the map my movespeed will back to normal.. TIA Guys...
Share this post
Link to post
Share on other sites