From b0119631a48c57dc2728596927db17bb9e0fd5d3 Mon Sep 17 00:00:00 2001 From: Aleos Date: Sun, 22 Dec 2019 10:27:43 -0500 Subject: [PATCH] Allow NPC view data modifications (#4385) * Fixes #4289. * Updated script commands setunitdata and getunitdata to support the modification of NPC view data. * Converted mob_avail database to YAML. Thanks to @Lemongrass3110, @4144, @exneval, @Balferian, @cahya1992 and @teededung! Co-authored-by: Lemongrass3110 --- db/import-tmpl/mob_avail.txt | 16 -- db/import-tmpl/mob_avail.yml | 123 +++++++++++++ db/mob_avail.txt | 44 ----- doc/mob_avail.txt | 108 +++++++++++ doc/script_commands.txt | 20 +- doc/yaml/db/mob_avail.yml | 22 +++ src/map/clif.cpp | 35 ++-- src/map/map-server.vcxproj | 2 +- src/map/mob.cpp | 343 ++++++++++++++++++++++++++++++----- src/map/mob.hpp | 12 ++ src/map/npc.cpp | 24 +-- src/map/npc.hpp | 4 +- src/map/script.cpp | 43 ++++- src/map/script.hpp | 18 +- src/map/script_constants.hpp | 27 ++- src/map/status.cpp | 23 ++- src/map/unit.cpp | 20 ++ src/map/unit.hpp | 3 +- src/tool/csv2yaml.cpp | 244 ++++++++++++++++++++++++- 19 files changed, 971 insertions(+), 160 deletions(-) delete mode 100644 db/import-tmpl/mob_avail.txt create mode 100644 db/import-tmpl/mob_avail.yml delete mode 100644 db/mob_avail.txt create mode 100644 doc/mob_avail.txt create mode 100644 doc/yaml/db/mob_avail.yml diff --git a/db/import-tmpl/mob_avail.txt b/db/import-tmpl/mob_avail.txt deleted file mode 100644 index 414d7a3518..0000000000 --- a/db/import-tmpl/mob_avail.txt +++ /dev/null @@ -1,16 +0,0 @@ -// Mob Availability and Alias Database -// -// Structure of Database: -// MobID,SpriteID{,Equipment} -// -// 01. MobID Mob ID to change. -// 02. SpriteID Mob ID which will be sent to the client instead of MobID. -// If 0, the mob becomes unavailable for use. -// 03. Equipment Item ID of pet equipment (must be available for pet counterpart, or this will cause problems). -// -// To disguise a mob as a player: -// MobID,SpriteID,Sex,Hair_Style,Hair_Color,Weapon,Shield,Head_Top,Head_Middle,Head_Bottom,Option,Dye_Color -// -// SpriteID is a job class value. -// Weapon and Shield uses Item ID, while Head uses View ID. - diff --git a/db/import-tmpl/mob_avail.yml b/db/import-tmpl/mob_avail.yml new file mode 100644 index 0000000000..cd1ea0c11a --- /dev/null +++ b/db/import-tmpl/mob_avail.yml @@ -0,0 +1,123 @@ +# This file is a part of rAthena. +# Copyright(C) 2019 rAthena Development Team +# https://rathena.org - https://github.com/rathena +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +########################################################################### +# Mob Availability and Alias Database +########################################################################### +# +# Mob Availability and Alias Settings +# +########################################################################### +# - Mob Mob to adjust. +# Sprite Sprite which will be sent to the client instead of Mob. +# Sex Sex (if Sprite is a player). (Default: Female) +# HairStyle Hair Style ID (if Sprite is a player). (Default: 0) +# HairColor Hair Color ID (if Sprite is a player). (Default: 0) +# ClothColor Cloth Color ID (if Sprite is a player). (Default: 0) +# Weapon Item name of weapon (if Sprite is a player). (Default: 0) +# Shield Item name of shield (if Sprite is a player). (Default: 0) +# HeadTop Item name of headgear (if Sprite is a player). (Default: 0) +# HeadMid Item name of headgear (if Sprite is a player). (Default: 0) +# HeadLow Item name of headgear (if Sprite is a player). (Default: 0) +# PetEquip Item name of pet equipment (if Mob is a valid pet). (Default: 0) +# Options: Set an option for an object. (Optional) +#