From 15e4ba4a14d912f70b0862bd1f0af9339dcbc6c0 Mon Sep 17 00:00:00 2001 From: wushin Date: Wed, 1 Apr 2015 01:27:04 -0500 Subject: Remove killer/killable Death Clears default pvp Add Player Togglable PvP Flag Add Timer to PvP Flag (Anti-Spam) Add getpvpflag builtin --- src/map/atcommand.cpp | 93 ++++++--------------------------------------------- 1 file changed, 11 insertions(+), 82 deletions(-) (limited to 'src/map/atcommand.cpp') 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 sd, } static -ATCE atcommand_killer(Session *s, dumb_ptr sd, +ATCE atcommand_pvp(Session *s, dumb_ptr 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, - ZString message) -{ - CharName character; - - if (!asplit(message, &character)) - return ATCE::USAGE; - - dumb_ptr 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 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, - ZString message) -{ - CharName character; - - if (!asplit(message, &character)) - return ATCE::USAGE; - - dumb_ptr 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 atcommand_info = {"addwarp"_s, {" "_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, {""_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, {" "_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, {""_s, - 60, atcommand_charkillable, - "Toggle whether a player is killable"_s}}, {"chareffect"_s, {" "_s, 40, atcommand_chareffect, "Apply effect type with arg 0 to a player"_s}}, -- cgit v1.2.3-70-g09d2