Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/14/22 in Posts

  1. The simplest way to do that is via a status effect. You give the status when the player uses @pk, and when the status runs out, it removes the pk mode. int atcommand_pkmode( const int fd, struct map_session_data *sd, const char *command, const char *message ) { nullpo_retr(-1, sd); if (!sd->state.pk_mode) { sd->state.pk_mode = 1; sc_start(&sd->bl, &sd->bl, SC_PK_DISABLE, 100, 0, 60 * 60 * 10000); clif_displaymessage(sd->fd, "You are now no longer in PK mode."); } else { sd->state.pk_mode = 0; status_change_end(&sd->bl, SC_PK_DISABLE); clif_displaymessage(sd->fd, "Returned to normal state."); } return 0; } And define the SC_PK_DISABLE status: diff --git a/db/re/status.yml b/db/re/status.yml index 96693fdce..40693394c 100644 --- a/db/re/status.yml +++ b/db/re/status.yml @@ -8166,3 +8166,9 @@ Body: NoClearbuff: true End: Sub_Weaponproperty: true + - Status: Pk_Disable + #Icon: EFST_PK_DISABLE + Flags: + NoDispell: true + NoBanishingBuster: true + NoClearance: true diff --git a/src/map/script_constants.hpp b/src/map/script_constants.hpp index 25ce19a67..ddbd1c466 100644 --- a/src/map/script_constants.hpp +++ b/src/map/script_constants.hpp @@ -1844,6 +1844,7 @@ export_constant(SC_M_LIFEPOTION); export_constant(SC_S_MANAPOTION); export_constant(SC_SUB_WEAPONPROPERTY); + export_constant(SC_PK_DISABLE); #ifdef RENEWAL export_constant(SC_EXTREMITYFIST2); diff --git a/src/map/status.cpp b/src/map/status.cpp index 42005bdae..4b6f462fb 100644 --- a/src/map/status.cpp +++ b/src/map/status.cpp @@ -13351,6 +13351,11 @@ int status_change_end(struct block_list* bl, enum sc_type type, int tid) pc_delabyssball( *sd, sd->abyssball ); } break; + case SC_PK_DISABLE: + if (sd) { + sd->state.pk_mode = 0; + } + break; } // Reset the options as needed diff --git a/src/map/status.hpp b/src/map/status.hpp index f103cd018..f2b79e058 100644 --- a/src/map/status.hpp +++ b/src/map/status.hpp @@ -1230,7 +1230,7 @@ enum sc_type : int16 { SC_S_MANAPOTION, SC_SUB_WEAPONPROPERTY, - + SC_PK_DISABLE, #ifdef RENEWAL SC_EXTREMITYFIST2, //! NOTE: This SC should be right before SC_MAX, so it doesn't disturb if RENEWAL is disabled #endif (Also... shouldn't this message "You are now no longer in PK mode." be "You are now in PK mode." instead?)
    1 point
  2. Update! Character name and Character Image with selected Hair Style and Hair Color are now showing on created character slot. Name has been trimmed and hidden for longer names, shown on tooltip once hovered.
    1 point
  3. for if (sex == 1) { announce "In 'Novice Vs. Zombie', " + strcharinfo (0) + " has won! Let's congratulate him!",0; } else { announce "In 'Novice Vs. Zombie'" + strcharinfo (0) + " has won! Let's congratulate her!",0; }; why not use announce "In 'Novice Vs. Zombie'" + strcharinfo (0) + " has won! Let's congratulate "+((sex == 1)?"him":"her")+"!",0;
    1 point
  4. a simple trick.... mes "[Lost Souls]"; mes "Farewell, young adventurer. I wish you good luck."; set #ET_Points,#ET_Points + 1; <---------------------------------------------------------- close2; warp "alberta",223,36; end; then find a dynamic npc script in the script release section setup it to use the point to buy items.... in this case..both Euphy / My script support Custom Variable as Currency...
    1 point
×
×
  • Create New...