summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-04-15 13:49:40 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-04-15 13:49:40 +0000
commite6276c539a165616071dc46355a9579d4a7ae647 (patch)
tree7a988dcf949b0149d7b6c674bb2292333ae20e96 /src/map/atcommand.c
parentbbadf310e83b4c8b3c683065f016892cf2b36a8a (diff)
downloadhercules-e6276c539a165616071dc46355a9579d4a7ae647.tar.gz
hercules-e6276c539a165616071dc46355a9579d4a7ae647.tar.bz2
hercules-e6276c539a165616071dc46355a9579d4a7ae647.tar.xz
hercules-e6276c539a165616071dc46355a9579d4a7ae647.zip
* Corrected some invalid syntax in skill_db.txt (wrong usage of commas)
* Renamed BA_FROSTJOKE to BA_FROSTJOKER (aegis server-side name) * Implemented a generic framework for parsing delimited db files (allows specifying min/max column ranges and max number of rows to read) * Corrected a typo in quest_update_objective() * Cleaned up pc.c a bit git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12599 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 3a9f987cb..abb9c61d3 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -5674,8 +5674,8 @@ int atcommand_displayskill(const int fd, struct map_session_data* sd, const char
int atcommand_skilltree(const int fd, struct map_session_data* sd, const char* command, const char* message)
{
struct map_session_data *pl_sd = NULL;
- int skillnum, skillidx = -1;
- int meets = 1, j, c=0;
+ int skillnum;
+ int meets, j, c=0;
char target[NAME_LENGTH], *tbl;
struct skill_tree_entry *ent;
nullpo_retr(-1, sd);
@@ -5696,37 +5696,33 @@ int atcommand_skilltree(const int fd, struct map_session_data* sd, const char* c
tbl = job_name(c);
- sprintf(atcmd_output, "Player is using %s skill tree (%d basic points)",
- tbl, pc_checkskill(pl_sd, 1));
+ sprintf(atcmd_output, "Player is using %s skill tree (%d basic points)", tbl, pc_checkskill(pl_sd, 1));
clif_displaymessage(fd, atcmd_output);
- for (j = 0; skill_tree[c][j].id != 0; j++) {
- if (skill_tree[c][j].id == skillnum) {
- skillidx = j;
- break;
- }
- }
-
- if (skillidx == -1) {
+ ARR_FIND( 0, MAX_SKILL_TREE, j, skill_tree[c][j].id == 0 || skill_tree[c][j].id == skillnum );
+ if( j == MAX_SKILL_TREE || skill_tree[c][j].id == 0 )
+ {
sprintf(atcmd_output, "I do not believe the player can use that skill");
clif_displaymessage(fd, atcmd_output);
return 0;
}
- ent = &skill_tree[c][skillidx];
+ ent = &skill_tree[c][j];
+ meets = 1;
for(j=0;j<5;j++)
+ {
if( ent->need[j].id && pc_checkskill(sd,ent->need[j].id) < ent->need[j].lv)
{
sprintf(atcmd_output, "player requires level %d of skill %s", ent->need[j].lv, skill_db[ent->need[j].id].desc);
clif_displaymessage(fd, atcmd_output);
meets = 0;
}
-
- if (meets == 1) {
- sprintf(atcmd_output, "I believe the player meets all the requirements for that skill");
- clif_displaymessage(fd, atcmd_output);
- }
+ }
+ if (meets == 1) {
+ sprintf(atcmd_output, "I believe the player meets all the requirements for that skill");
+ clif_displaymessage(fd, atcmd_output);
+ }
return 0;
}