summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorEmistry <Equinox1991@gmail.com>2016-08-13 00:47:41 +0800
committerEmistry <Equinox1991@gmail.com>2016-08-13 00:47:41 +0800
commitb3df179f705b0a4fe99b0d6e81878251692843f1 (patch)
tree14f1b7ae76183cca9c29960f3c1f4c6db98f6815 /src/map/atcommand.c
parent11f49f71ba681d2d4190e4d2f329d6722273a8d8 (diff)
downloadhercules-b3df179f705b0a4fe99b0d6e81878251692843f1.tar.gz
hercules-b3df179f705b0a4fe99b0d6e81878251692843f1.tar.bz2
hercules-b3df179f705b0a4fe99b0d6e81878251692843f1.tar.xz
hercules-b3df179f705b0a4fe99b0d6e81878251692843f1.zip
Added atcommand config
Based on @Lemongrass3110's commit https://github.com/rathena/rathena/commit/9157318ee9939728b8d332a5668c13d4ad0a6f8b: Added a configuration to enable the atcommands baselevel and joblevel to trigger their respective npc events. This will help you guys with testing your custom scripts that are listening to OnPCBaseLvUpEvent or OnPCJobLvUpEvent. For safety reasons we only trigger the events on level increase.
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index de79ae0c4..8d4aa317f 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -1398,6 +1398,7 @@ ACMD(baselevelup)
sd->status.base_level -= level;
clif->message(fd, msg_fd(fd,22)); // Base level lowered.
status_calc_pc(sd, SCO_FORCE);
+ level *= -1;
}
sd->status.base_exp = 0;
clif->updatestatus(sd, SP_STATUSPOINT);
@@ -1407,7 +1408,9 @@ ACMD(baselevelup)
pc->baselevelchanged(sd);
if(sd->status.party_id)
party->send_levelup(sd);
- npc->script_event(sd, NPCE_BASELVUP); // Trigger OnPCBaseLvUpEvent
+
+ if (level > 0 && battle_config.atcommand_levelup_events)
+ npc->script_event(sd, NPCE_BASELVUP); // Trigger OnPCBaseLvUpEvent
return true;
}
@@ -1450,6 +1453,7 @@ ACMD(joblevelup)
else
sd->status.skill_point -= level;
clif->message(fd, msg_fd(fd,25)); // Job level lowered.
+ level *= -1;
}
sd->status.job_exp = 0;
clif->updatestatus(sd, SP_JOBLEVEL);
@@ -1457,7 +1461,9 @@ ACMD(joblevelup)
clif->updatestatus(sd, SP_NEXTJOBEXP);
clif->updatestatus(sd, SP_SKILLPOINT);
status_calc_pc(sd, SCO_FORCE);
- npc->script_event(sd, NPCE_JOBLVUP); // Trigger OnPCJobLvUpEvent
+
+ if (level > 0 && battle_config.atcommand_levelup_events)
+ npc->script_event(sd, NPCE_JOBLVUP); // Trigger OnPCJobLvUpEvent
return true;
}