diff options
author | Dastgir Pojee <dastgirp@gmail.com> | 2016-10-02 20:37:54 +0530 |
---|---|---|
committer | hemagx <ibrahem.h.basyone@gmail.com> | 2016-10-22 02:21:48 +0200 |
commit | 473ba564829a6d0153e320d1f302754442648ec7 (patch) | |
tree | 17b2470fcff090af25e854a4df0160b1f89eaa38 /src | |
parent | 7c72c942d52915cb7c5c9692bd927772ad34bcca (diff) | |
download | hercules-473ba564829a6d0153e320d1f302754442648ec7.tar.gz hercules-473ba564829a6d0153e320d1f302754442648ec7.tar.bz2 hercules-473ba564829a6d0153e320d1f302754442648ec7.tar.xz hercules-473ba564829a6d0153e320d1f302754442648ec7.zip |
Implemented SU_BASIC_SKILL Skill of Summoner
Added Function for Basic Skills check.
Diffstat (limited to 'src')
-rw-r--r-- | src/map/clif.c | 12 | ||||
-rw-r--r-- | src/map/pc.c | 18 | ||||
-rw-r--r-- | src/map/pc.h | 1 |
3 files changed, 24 insertions, 7 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index b92c3185f..ecd95135b 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -10055,7 +10055,7 @@ void clif_parse_Emotion(int fd, struct map_session_data *sd) { int emoticon = RFIFOB(fd,packet_db[RFIFOW(fd,0)].pos[0]); - if (battle_config.basic_skill_check == 0 || pc->checkskill(sd, NV_BASIC) >= 2) { + if (battle_config.basic_skill_check == 0 || pc->check_basicskill(sd, 2)) { if (emoticon == E_MUTE) {// prevent use of the mute emote [Valaris] clif->skill_fail(sd, 1, USESKILL_FAIL_LEVEL, 1); return; @@ -10155,7 +10155,7 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type, } break; case 0x02: // sitdown - if (battle_config.basic_skill_check && pc->checkskill(sd, NV_BASIC) < 3) { + if (battle_config.basic_skill_check && !pc->check_basicskill(sd, 3)) { clif->skill_fail(sd, 1, USESKILL_FAIL_LEVEL, 2); break; } @@ -10760,7 +10760,7 @@ void clif_parse_CreateChatRoom(int fd, struct map_session_data* sd) if (pc_ismuted(&sd->sc, MANNER_NOROOM)) return; - if(battle_config.basic_skill_check && pc->checkskill(sd,NV_BASIC) < 4) { + if(battle_config.basic_skill_check && !pc->check_basicskill(sd, 4)) { clif->skill_fail(sd,1,USESKILL_FAIL_LEVEL,3); return; } @@ -10877,7 +10877,7 @@ void clif_parse_TradeRequest(int fd,struct map_session_data *sd) { return; } - if( battle_config.basic_skill_check && pc->checkskill(sd,NV_BASIC) < 1) { + if( battle_config.basic_skill_check && !pc->check_basicskill(sd, 1)) { clif->skill_fail(sd,1,USESKILL_FAIL_LEVEL,0); return; } @@ -11923,7 +11923,7 @@ void clif_parse_CreateParty(int fd, struct map_session_data *sd) clif->message(fd, msg_fd(fd,227)); // Party modification is disabled in this map. return; } - if( battle_config.basic_skill_check && pc->checkskill(sd,NV_BASIC) < 7 ) { + if (battle_config.basic_skill_check && !pc->check_basicskill(sd, 7)) { clif->skill_fail(sd,1,USESKILL_FAIL_LEVEL,4); return; } @@ -11945,7 +11945,7 @@ void clif_parse_CreateParty2(int fd, struct map_session_data *sd) clif->message(fd, msg_fd(fd,227)); // Party modification is disabled in this map. return; } - if( battle_config.basic_skill_check && pc->checkskill(sd,NV_BASIC) < 7 ) { + if (battle_config.basic_skill_check && !pc->check_basicskill(sd, 7)) { clif->skill_fail(sd,1,USESKILL_FAIL_LEVEL,4); return; } diff --git a/src/map/pc.c b/src/map/pc.c index b6f2d375d..a0d9d5812 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -7428,7 +7428,9 @@ int pc_resetskill(struct map_session_data* sd, int flag) } // do not reset basic skill - if( skill_id == NV_BASIC && (sd->class_&(MAPID_BASEMASK|JOBL_2)) != MAPID_NOVICE ) + if (skill_id == NV_BASIC && (sd->class_&(MAPID_BASEMASK|JOBL_2)) != MAPID_NOVICE) + continue; + if (skill_id == SU_BASIC_SKILL && (sd->class_&MAPID_BASEMASK) != MAPID_SUMMONER) continue; if( sd->status.skill[i].flag == SKILL_FLAG_PERM_GRANTED ) @@ -11669,6 +11671,18 @@ int pc_have_magnifier(struct map_session_data *sd) } /** + * Checks if player have basic skills learned. + * @param sd Player Data + * @param level Required Level of Novice Skill + * @return bool true, if requirement is satisfied + */ +bool pc_check_basicskill(struct map_session_data *sd, int level) { + if (pc->checkskill(sd, NV_BASIC) >= level || pc->checkskill(sd, SU_BASIC_SKILL)) + return true; + return false; +} + +/** * Verifies a chat message, searching for atcommands, checking if the sender * character can chat, and updating the idle timer. * @@ -12124,4 +12138,6 @@ void pc_defaults(void) { pc->update_idle_time = pc_update_idle_time; pc->have_magnifier = pc_have_magnifier; + + pc->check_basicskill = pc_check_basicskill; } diff --git a/src/map/pc.h b/src/map/pc.h index fd446813f..2d6ca48a0 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -1094,6 +1094,7 @@ END_ZEROED_BLOCK; /* End */ bool (*process_chat_message) (struct map_session_data *sd, const char *message); void (*check_supernovice_call) (struct map_session_data *sd, const char *message); + bool (*check_basicskill) (struct map_session_data *sd, int level); }; #ifdef HERCULES_CORE |