Implements MF_NOPETCAPTURE (#6618)

* Fixes #6556.
* Implements the nopetcapture mapflag which is used to stop pet-type monsters from being caught.
Thanks to @RagnaWay and @Lemongras3110!
This commit is contained in:
Aleos 2022-02-16 12:51:25 -05:00 committed by GitHub
parent c454443a0b
commit 84248255b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 74 additions and 45 deletions

View File

@ -695,7 +695,7 @@
666: Pets are not allowed in Guild Wars.
667: You're not dead.
668: Your actual memo positions are:
//669 free
669: You can't catch any pet on this map.
670: You can't leave battleground guilds.
671: Friend already exists.
672: Name not found in list.

View File

@ -642,7 +642,7 @@
666: 公會戰不允許有寵物
667: 你沒死亡
668: 你實際儲存點是:
//669 free
669: You can't catch any pet on this map.
670: 你無法離開戰場公會
671: 這朋友已存在
672: 該名稱不在清單內

View File

@ -654,7 +654,7 @@
666: Pets non-autorisés lors d'une guerre entre guilde.
667: Vous n'êtes pas mort(e).
668: Votre position memo actuelle est:
//669 free
669: You can't catch any pet on this map.
670: Vous ne pouvez pas quitter votre guilde.
671: Cette personne est déjà dans votre liste d'ami.
672: Nom introuvable dans la liste.

View File

@ -573,6 +573,7 @@
659: Todes Zeitpunkt : ^EE0000%s^000000
660: Besiegt von
661: [^EE0000%s^000000]
669: You can't catch any pet on this map.
681: Rune Knight T
682: Warlock T

View File

@ -688,7 +688,7 @@
666: Peliharaan tidak diperbolehkan di Guild Wars.
667: Kamu tidak mati.
668: Posisi memomu saat ini adalah:
//669 kosong
669: You can't catch any pet on this map.
670: Kamu tidak dapat meninggalkan guild battleground.
671: Teman sudah ada.
672: Nama tidak ditemukan di daftar.

View File

@ -699,7 +699,7 @@
666: Bichinhos de estimação não são permitidos na Guerra de Clãs.
667: Você não está morto.
668: Seu ponto de retorno atual é:
//669 livre
669: You can't catch any pet on this map.
670: Você não pode deixar os campos de batalha em uma guerra.
671: Amigo já existente.
672: Nome não encontrado na lista.

View File

@ -654,7 +654,7 @@
666: Питомцы запрещены во время Войны за Империум.
667: Вы не мертвы.
668: Ваши текущие точки сохранения:
//669 НЕ ИСПОЛЬЗУЕТСЯ
669: You can't catch any pet on this map.
670: Вы не можете покинуть БГ.
671: Друг уже добавлен.
672: Имя не найдено в списке.

View File

@ -689,7 +689,7 @@
666: Las mascotas están prohibidas en la guerra de clanes.
667: No estás muerto.
668: Tus puntos de memorización actuales son los siguientes:
//669 vacío
669: You can't catch any pet on this map.
670: No puedes abandonar un clan especial de battleground.
671: Ese jugador ya es amigo tuyo.
672: No se ha encontrado el nombre que has introducido.

View File

@ -648,7 +648,7 @@
666: <20><>µ<EFBFBD>לא<D79C><D790>י<EFBFBD>§ה<C2A7>טה´י<D799><C2B6><EFBFBD><EFBFBD>÷<EFBFBD>¹<EFBFBD>­<EFBFBD>µד<C2B5>י¹<D799>א¢י<C2A2>ד¹¾<C2B9>י¹·<C2B9>ט Guild Wars.
667: ¤<>³ה<C2B3>טה´יµ<D799><C2B5>.
668: µ<>ב<EFBFBD>¹ט§·<C2A7>ט¤<D798>³ה´י÷<D799>¹·<C2B9><C2B7>ה<EFBFBD>י<EFBFBD><D799>´<EFBFBD>§¹<C2A7>י:
//669 free
669: You can't catch any pet on this map.
670: ¤<>³ה<C2B3>ט<EFBFBD><D798><EFBFBD><EFBFBD><EFBFBD><EFBFBD><C2B6><EFBFBD>¨<EFBFBD><C2A8> Guild ה´יד¹¢³<C2A2><C2B3><EFBFBD><EFBFBD>טד¹ battleground.
671: א¾<D790>ט<EFBFBD>¹·<C2B9>ט<EFBFBD><D798><EFBFBD><EFBFBD><EFBFBD>טב<D798>י<EFBFBD>.
672: ה<>ט¾÷×<C3B7>ט<EFBFBD>ד¹<D793><C2B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.

View File

@ -235,6 +235,50 @@ player who has group level below it.
---------------------------------------
*nomapchannelautojoin
Stops players from automatically joining the #map channel on a map.
This only applies if map channels are enabled and 'map_local_channel_autojoin' is true
in '/conf/channels.conf'.
---------------------------------------
*notomb
Disables MVP tombs from appearing on a map.
---------------------------------------
*nocostume
Disables costume sprites on a map.
This only disables the sprites and not the effect of the items.
If a player logs out on a nocostume map the costume sprites will also not be shown in the
character server.
---------------------------------------
*norenewaldroppenalty
Disable renewal drop rate penalty due to level difference on a map.
---------------------------------------
*norenewalexppenalty
Disable renewal experience penalty due to level difference on a map.
---------------------------------------
*nopetcapture
Disable the ability to capture pets on a map.
---------------------------------------
=====================
| 2. Battle-related |
=====================
@ -403,46 +447,9 @@ atcommand is enabled on all maps by default.
---------------------------------------
*nomapchannelautojoin
Stops players from automatically joining the #map channel on a map.
This only applies if map channels are enabled and 'map_local_channel_autojoin' is true
in '/conf/channels.conf'.
---------------------------------------
*notomb
Disables MVP tombs from appearing on a map.
---------------------------------------
*nocostume
Disables costume sprites on a map.
This only disables the sprites and not the effect of the items.
If a player logs out on a nocostume map the costume sprites will also not be shown in the
character server.
---------------------------------------
*hidemobhpbar
Hides monster's HP bar on a map.
Ignores config value of 'monster_hp_bars_info'.
---------------------------------------
*norenewaldroppenalty
Disable renewal drop rate penalty due to level difference on a map.
---------------------------------------
*norenewalexppenalty
Disable renewal experience penalty due to level difference on a map.
---------------------------------------

View File

@ -647,6 +647,7 @@ enum e_mapflag : int16 {
MF_NORODEX,
MF_NORENEWALEXPPENALTY,
MF_NORENEWALDROPPENALTY,
MF_NOPETCAPTURE,
MF_MAX
};

View File

@ -5843,6 +5843,11 @@ int pc_useitem(struct map_session_data *sd,int n)
return 0;/* regardless, effect is not run */
}
if (pet_db_search(id->nameid, PET_CATCH) != nullptr && map_getmapflag(sd->bl.m, MF_NOPETCAPTURE)) {
clif_displaymessage(sd->fd, msg_txt(sd, 669)); // You can't catch any pet on this map.
return 0;
}
sd->itemid = item.nameid;
sd->itemindex = n;
if(sd->catch_target_class != PET_CATCH_FAIL) //Abort pet catching.

View File

@ -1219,6 +1219,11 @@ int pet_catch_process1(struct map_session_data *sd,int target_class)
{
nullpo_ret(sd);
if (map_getmapflag(sd->bl.m, MF_NOPETCAPTURE)) {
clif_displaymessage(sd->fd, msg_txt(sd, 669)); // You can't catch any pet on this map.
return 0;
}
sd->catch_target_class = target_class;
clif_catch_process(sd);
@ -1248,6 +1253,15 @@ int pet_catch_process2(struct map_session_data* sd, int target_id)
return 1;
}
if (map_getmapflag(sd->bl.m, MF_NOPETCAPTURE)) {
clif_pet_roulette(sd, 0);
sd->catch_target_class = PET_CATCH_FAIL;
sd->itemid = 0;
sd->itemindex = -1;
clif_displaymessage(sd->fd, msg_txt(sd, 669)); // You can't catch any pet on this map.
return 1;
}
//FIXME: delete taming item here, if this was an item-invoked capture and the item was flagged as delay-consume [ultramage]
std::shared_ptr<s_pet_db> pet = pet_db.find(md->mob_id);

View File

@ -533,6 +533,7 @@
export_constant(MF_NORODEX);
export_constant(MF_NORENEWALDROPPENALTY);
export_constant(MF_NORENEWALEXPPENALTY);
export_constant(MF_NOPETCAPTURE);
/* setcell types */
export_constant(CELL_WALKABLE);