summaryrefslogtreecommitdiff
path: root/src/map/atcommand.cpp
diff options
context:
space:
mode:
authorwushin <pasekei@gmail.com>2015-04-01 01:27:04 -0500
committerwushin <pasekei@gmail.com>2015-04-04 00:27:07 -0500
commit15e4ba4a14d912f70b0862bd1f0af9339dcbc6c0 (patch)
tree428a9ecfeeafe8101057ab6fff6f4b311db8476b /src/map/atcommand.cpp
parent6f4699ff0c6400a2adc5e4008b2e289737f4a303 (diff)
downloadtmwa-15e4ba4a14d912f70b0862bd1f0af9339dcbc6c0.tar.gz
tmwa-15e4ba4a14d912f70b0862bd1f0af9339dcbc6c0.tar.bz2
tmwa-15e4ba4a14d912f70b0862bd1f0af9339dcbc6c0.tar.xz
tmwa-15e4ba4a14d912f70b0862bd1f0af9339dcbc6c0.zip
Remove killer/killable
Death Clears default pvp Add Player Togglable PvP Flag Add Timer to PvP Flag (Anti-Spam) Add getpvpflag builtin
Diffstat (limited to 'src/map/atcommand.cpp')
-rw-r--r--src/map/atcommand.cpp93
1 files changed, 11 insertions, 82 deletions
diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp
index cd51b70..2a5791e 100644
--- a/src/map/atcommand.cpp
+++ b/src/map/atcommand.cpp
@@ -4030,81 +4030,19 @@ ATCE atcommand_character_storage_list(Session *s, dumb_ptr<map_session_data> sd,
}
static
-ATCE atcommand_killer(Session *s, dumb_ptr<map_session_data> sd,
+ATCE atcommand_pvp(Session *s, dumb_ptr<map_session_data> sd,
ZString)
{
- sd->special_state.killer = !sd->special_state.killer;
-
- if (sd->special_state.killer)
- clif_displaymessage(s, "You be a killa..."_s);
- else
- clif_displaymessage(s, "You gonna be own3d..."_s);
-
- return ATCE::OKAY;
-}
-
-static
-ATCE atcommand_charkiller(Session *s, dumb_ptr<map_session_data>,
- ZString message)
-{
- CharName character;
-
- if (!asplit(message, &character))
- return ATCE::USAGE;
-
- dumb_ptr<map_session_data> pl_sd = map_nick2sd(character);
- if (pl_sd == nullptr)
- return ATCE::EXIST;
-
- pl_sd->special_state.killer = !pl_sd->special_state.killer;
-
- if (pl_sd->special_state.killer)
- {
- clif_displaymessage(s, "The player is now a killer"_s);
- clif_displaymessage(pl_sd->sess, "You are now a killer"_s);
- }
- else
- {
- clif_displaymessage(s, "The player is no longer a killer"_s);
- clif_displaymessage(pl_sd->sess, "You are no longer a killer"_s);
- }
-
- return ATCE::OKAY;
-}
-
-static
-ATCE atcommand_killable(Session *s, dumb_ptr<map_session_data> sd,
- ZString)
-{
- sd->special_state.killable = !sd->special_state.killable;
-
- if (sd->special_state.killable)
- clif_displaymessage(s, "You gonna be own3d..."_s);
- else
- clif_displaymessage(s, "You be a killa..."_s);
-
- return ATCE::OKAY;
-}
-
-static
-ATCE atcommand_charkillable(Session *s, dumb_ptr<map_session_data>,
- ZString message)
-{
- CharName character;
-
- if (!asplit(message, &character))
- return ATCE::USAGE;
-
- dumb_ptr<map_session_data> pl_sd = map_nick2sd(character);
- if (pl_sd == nullptr)
- return ATCE::EXIST;
+ if (sd->pvp_timer)
+ return ATCE::OKAY;
- pl_sd->special_state.killable = !pl_sd->special_state.killable;
+ sd->state.pvpon = !sd->state.pvpon;
+ pc_setpvptimer(sd, battle_config.player_pvp_time);
- if (pl_sd->special_state.killable)
- clif_displaymessage(s, "The player is now killable"_s);
+ if (sd->state.pvpon)
+ clif_displaymessage(s, "##3PvP : ##BOn"_s);
else
- clif_displaymessage(s, "The player is no longer killable"_s);
+ clif_displaymessage(s, "##3PvP : ##BOff"_s);
return ATCE::OKAY;
}
@@ -5236,21 +5174,12 @@ Map<XString, AtCommandInfo> atcommand_info =
{"addwarp"_s, {"<mapname> <x> <y>"_s,
80, atcommand_addwarp,
"Create a new permanent warp"_s}},
- {"killer"_s, {""_s,
- 60, atcommand_killer,
- "Toggle whether you are a killer"_s}},
- {"charkiller"_s, {"<charname>"_s,
- 60, atcommand_charkiller,
- "Toggle whether a player is a killer"_s}},
+ {"pvp"_s, {""_s,
+ 0, atcommand_pvp,
+ "Toggle your pvp flag"_s}},
{"npcmove"_s, {"<x> <y> <npc-name>"_s,
80, atcommand_npcmove,
"Force an NPC to move on the map"_s}},
- {"killable"_s, {""_s,
- 60, atcommand_killable,
- "Toggle whether you are killable"_s}},
- {"charkillable"_s, {"<charname>"_s,
- 60, atcommand_charkillable,
- "Toggle whether a player is killable"_s}},
{"chareffect"_s, {"<type> <target>"_s,
40, atcommand_chareffect,
"Apply effect type with arg 0 to a player"_s}},