diff options
47 files changed, 918 insertions, 331 deletions
diff --git a/.travis.yml b/.travis.yml index a9bea834d..bd1798ca6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,7 @@ install: before_script: - uname -a + - ulimit -c unlimited -S - ./tools/ci/travis.sh createdb ragnarok root - ./tools/ci/travis.sh importdb ragnarok root - ./tools/ci/travis.sh adduser ragnarok travis travis root @@ -38,25 +39,27 @@ matrix: - compiler: false include: - compiler: gcc - env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug CC=gcc-6 --disable-manager --enable-Werror --enable-packetver=20190123 --enable-packetver-re --enable-buildbot" HPM="1" + env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug CC=gcc-6 --disable-manager --enable-Werror --enable-packetver=20190306 --enable-packetver-re --enable-buildbot" HPM="1" addons: apt: sources: - ubuntu-toolchain-r-test packages: + - gdb - gcc-6 - doxygen - libxml-simple-perl - libxml-sax-perl - libxml-parser-perl - compiler: clang - env: CONFIGURE_FLAGS="--enable-debug CC=clang-5.0 --enable-Werror --enable-packetver=20190123 --enable-packetver-re --enable-buildbot" + env: CONFIGURE_FLAGS="--enable-debug CC=clang-5.0 --enable-Werror --enable-packetver=20190306 --enable-packetver-re --enable-buildbot" addons: apt: sources: - llvm-toolchain-trusty-5.0 - ubuntu-toolchain-r-test packages: + - gdb - clang-5.0 - compiler: clang env: CONFIGURE_FLAGS="--enable-debug CC=clang-5.0 --disable-renewal --enable-Werror --enable-buildbot" @@ -66,15 +69,17 @@ matrix: - llvm-toolchain-trusty-5.0 - ubuntu-toolchain-r-test packages: + - gdb - clang-5.0 - compiler: clang - env: CONFIGURE_FLAGS="--enable-debug CC=clang-4.0 --enable-Werror --enable-packetver=20190123 --enable-packetver-re --enable-buildbot" + env: CONFIGURE_FLAGS="--enable-debug CC=clang-4.0 --enable-Werror --enable-packetver=20190306 --enable-packetver-re --enable-buildbot" addons: apt: sources: - llvm-toolchain-trusty-4.0 - ubuntu-toolchain-r-test packages: + - gdb - clang-4.0 - compiler: clang env: CONFIGURE_FLAGS="--enable-debug CC=clang-4.0 --enable-Werror --enable-packetver=20130724 --enable-packetver-re --enable-buildbot" @@ -84,6 +89,7 @@ matrix: - llvm-toolchain-trusty-4.0 - ubuntu-toolchain-r-test packages: + - gdb - clang-4.0 - compiler: clang env: CONFIGURE_FLAGS="--enable-debug CC=clang-4.0 --disable-renewal --enable-Werror --enable-buildbot" @@ -93,22 +99,24 @@ matrix: - llvm-toolchain-trusty-4.0 - ubuntu-toolchain-r-test packages: + - gdb - clang-4.0 - compiler: clang env: CONFIGURE_FLAGS="--enable-debug --enable-Werror --enable-buildbot" - compiler: clang env: CONFIGURE_FLAGS="--enable-debug --disable-renewal --enable-Werror --enable-buildbot" - compiler: gcc - env: CONFIGURE_FLAGS="--enable-debug --enable-Werror --enable-packetver=20190123 --enable-packetver-re --enable-buildbot" + env: CONFIGURE_FLAGS="--enable-debug --enable-Werror --enable-packetver=20190306 --enable-packetver-re --enable-buildbot" - compiler: gcc env: CONFIGURE_FLAGS="--enable-debug --disable-renewal --enable-Werror --enable-buildbot" - compiler: gcc - env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug --enable-sanitize=full CC=gcc-5 --disable-manager --enable-Werror --enable-packetver=20190123 --enable-packetver-re --enable-buildbot" + env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug --enable-sanitize=full CC=gcc-5 --disable-manager --enable-Werror --enable-packetver=20190306 --enable-packetver-re --enable-buildbot" addons: apt: sources: - ubuntu-toolchain-r-test packages: + - gdb - gcc-5 - compiler: gcc env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug --enable-sanitize=full CC=gcc-5 --disable-manager --disable-renewal --enable-Werror --enable-buildbot" @@ -117,14 +125,16 @@ matrix: sources: - ubuntu-toolchain-r-test packages: + - gdb - gcc-5 - compiler: gcc - env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug --enable-sanitize=full CC=gcc-6 --disable-manager --enable-Werror --enable-packetver=20190123 --enable-packetver-re --enable-buildbot" + env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug --enable-sanitize=full CC=gcc-6 --disable-manager --enable-Werror --enable-packetver=20190306 --enable-packetver-re --enable-buildbot" addons: apt: sources: - ubuntu-toolchain-r-test packages: + - gdb - gcc-6 - compiler: gcc env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug --enable-sanitize=full CC=gcc-6 --disable-manager --disable-renewal --enable-Werror --enable-buildbot" @@ -133,7 +143,44 @@ matrix: sources: - ubuntu-toolchain-r-test packages: + - gdb - gcc-6 + - compiler: gcc + env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug CC=gcc-7 --disable-manager --enable-Werror --enable-packetver=20190306 --enable-packetver-re --enable-buildbot" + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - gdb + - gcc-7 + - compiler: gcc + env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug --enable-sanitize=full CC=gcc-7 --disable-manager --disable-renewal --enable-Werror --enable-buildbot" + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - gdb + - gcc-7 + - compiler: gcc + env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug --enable-sanitize=full CC=gcc-8 --disable-manager --enable-Werror --enable-packetver=20190306 --enable-packetver-re --enable-buildbot" + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - gdb + - gcc-8 + - compiler: gcc + env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug --enable-sanitize=full CC=gcc-8 --disable-manager --disable-renewal --enable-Werror --enable-buildbot" + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - gdb + - gcc-8 notifications: email: false diff --git a/conf/map/battle/skill.conf b/conf/map/battle/skill.conf index 64bba68b5..da8d1906d 100644 --- a/conf/map/battle/skill.conf +++ b/conf/map/battle/skill.conf @@ -330,3 +330,8 @@ bowling_bash_area: 0 // punch a hole into SG it will for example create a "suck in" effect. // If you disable this setting, the knockback direction will be completely random (eAthena style). stormgust_knockback: true + +// Magic Rod's animation behavior (Note 1) +// 0 : (official) Magic Rod's animation occurs every time it is used. +// 1 : Magic Rod's animation would not occur unless a spell was absorbed. (old behavior) +magicrod_type: 0 diff --git a/db/constants.conf b/db/constants.conf index 598bc89c4..2e379cb14 100644 --- a/db/constants.conf +++ b/db/constants.conf @@ -3853,8 +3853,14 @@ constants_db: { UDT_MAXSP: 6 UDT_MASTERAID: 7 UDT_MASTERCID: 8 - UDT_MAPIDXY: 9 - UDT_WALKTOXY: 10 + UDT_MAPIDXY: { + Value: 9 + Deprecated: true // for setunitdata use *unitwarp, for getunitdata use *getmapxy + } + UDT_WALKTOXY: { + Value: 10 + Deprecated: true // use *unitwalk + } UDT_SPEED: 11 UDT_MODE: 12 UDT_AI: 13 diff --git a/doc/constants.md b/doc/constants.md index 8b3acbfdf..9225ce924 100644 --- a/doc/constants.md +++ b/doc/constants.md @@ -3773,8 +3773,8 @@ - `UDT_MAXSP`: 6 - `UDT_MASTERAID`: 7 - `UDT_MASTERCID`: 8 -- `UDT_MAPIDXY`: 9 -- `UDT_WALKTOXY`: 10 +- `UDT_MAPIDXY`: 9 **(DEPRECATED)** +- `UDT_WALKTOXY`: 10 **(DEPRECATED)** - `UDT_SPEED`: 11 - `UDT_MODE`: 12 - `UDT_AI`: 13 @@ -3991,6 +3991,8 @@ - `MAX_REFINE`: 20 - `MAX_MENU_OPTIONS`: 255 - `MAX_MENU_LENGTH`: 2048 +- `MOB_CLONE_START`: 4001 +- `MOB_CLONE_END`: 5000 ### status options @@ -4280,6 +4282,18 @@ - `ITEMINFO_VIEWSPRITE`: 16 - `ITEMINFO_TRADE`: 17 +### getmercinfo options + +- `MERCINFO_ID,`: 0 +- `MERCINFO_CLASS`: 1 +- `MERCINFO_NAME`: 2 +- `MERCINFO_FAITH`: 3 +- `MERCINFO_CALLS`: 4 +- `MERCINFO_KILLCOUNT`: 5 +- `MERCINFO_LIFETIME`: 6 +- `MERCINFO_LEVEL`: 7 +- `MERCINFO_GID`: 8 + ### monster skill states - `MSS_ANY`: -1 diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 63aa94315..19f189f81 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -266,8 +266,8 @@ direction across Y. Walking into that area will trigger the NPC. If no 'OnTouch:' special label is present in the NPC code, the execution will start from the beginning of the script, otherwise, it will start from the 'OnTouch:' label. Monsters can also trigger the NPC, though the label -'OnTouchNPC:' is used in this case. If player left area npc will called -if present label 'OnUnTouch'. +'OnTouchNPC:' is used in this case, and using mobattached() will return +monster GID. If player left the area will trigger the label 'OnUnTouch'. The code part is the script code that will execute whenever the NPC is triggered. It may contain commands and function calls, descriptions of @@ -718,6 +718,8 @@ MAX_CHAT_USERS - Maximum Chat users MAX_REFINE - Maximum Refine level MAX_MENU_OPTIONS - Maximum NPC menu options MAX_MENU_LENGTH - Maximum NPC menu string length +MOB_CLONE_START - Clone ID start from this range +MOB_CLONE_END - Clone ID end with this range Send targets and status options are also hard-coded and can be found in 'doc/constants.md'. @@ -6332,7 +6334,7 @@ Examples: setpcblock(PCBLOCK_ATTACK|PCBLOCK_SKILL, true); // Re-enables attack, skills and item use - setpcblock(PCBLOCK_ATTACK|PCBLOCK_SKILL|PCBLOCK_ITEM, false); + setpcblock(PCBLOCK_ATTACK|PCBLOCK_SKILL|PCBLOCK_USEITEM, false); // checkpcblock related checks if ((checkpcblock() & PCBLOCK_IMMUNE) != 0) @@ -6505,6 +6507,14 @@ other number for this parameter won't be recognized. --------------------------------------- +*killmonstergid(<GID>); + +This command will kill the specific monster GID. The difference between +this command and 'unitkill', is this command does not trigger monster's +event label. + +--------------------------------------- + *strmobinfo(<type>, <monster id>) This function will return information about a monster record in the @@ -6593,6 +6603,17 @@ will run as if by donpcevent(). --------------------------------------- +*mobattached() + +This command will return RID of the monster running from 'OnTouchNPC:' label. + + +// Kill any monster entering npc's trigger area +OnTouchNPC: + killmonstergid mobattached(); + +--------------------------------------- + *homevolution() This command will try to evolve the current player's homunculus. @@ -9616,6 +9637,11 @@ is run when they relog. <On Death Event> refers to an NPC label that attaches to the character and is run when they die. Can be "" for empty. +If "-" is supplied for <mapname>, this will remove the 1 second automatic +respawn on the battleground map. This allows for better manipulation of +<On Death Event>. The player will have to be warped to desired location +at the end of <On Death Event>. + Unlike the prior command, the latter will attach a GROUP in a waiting room to the battleground, and sets the array $@arenamembers[0] where 0 holds the IDs of the first group, and 1 holds the IDs of the second. @@ -9747,6 +9773,8 @@ mapflag%TAB%<map_name>%TAB%battleground%TAB%2 This command will create a new BG Team. When player dies, they will be respawned map_name,X,Y as mentioned. +If "-" is supplied for the map name, this will remove the 1 second automatic +respawn on the battleground map. Command will return -1 if BG Creation is failed, else it will return the BG ID(Also known as TeamID). @@ -9836,17 +9864,18 @@ If char id is given, the information of that character is retrieved instead. Type specifies what information to retrieve and can be one of the following: - 0 - Database ID - 1 - Class - 2 - Name - 3 - Faith value for this mercenary's guild, if any - 4 - Calls value for this mercenary's guild, if any - 5 - Kill count - 6 - Remaining life time in msec - 7 - Level + MERCINFO_ID - Mercenary Database ID + MERCINFO_CLASS - Mercenary Class + MERCINFO_NAME - Mercenary Name + MERCINFO_FAITH - Mercenary faith value for this mercenary's guild, if any + MERCINFO_CALLS - Mercenary calls value for this mercenary's guild, if any + MERCINFO_KILLCOUNT - Mercenary kill count + MERCINFO_LIFETIME - Mercenary remaining life time in mili-second + MERCINFO_LEVEL - Mercenary Level + MERCINFO_GID - Mercenary Game ID -If the character does not have a mercenary, the command returns "" -for name and 0 for all other types. +If the character does not have a mercenary, the command returns "" for MERCINFO_NAME +and 0 for all other types. --------------------------------------- //===================================== @@ -10033,131 +10062,127 @@ Returns the amount of still-available <Item_ID> in the shop (on a NST_MARKET tra --------------------------------------- -*setunitdata(<GUID>, <DataType>, <Val1> {,<Val2>,<Val3>}) +*setunitdata(<GID>, <DataType>, <Val>) Sets or alters the data in real-time for game objects of the following types - NPCs, Pets, Monsters, Homunuculus', Mercenaries, Elementals. Applicable Data Types (available as constants) - Data Types Description (parameter type) - UDT_SIZE: Unit Size (int) - UDT_LEVEL: Level (int) - UDT_HP: Current HP (int) - UDT_MAXHP: Max HP (int) - UDT_SP: SP (int) - UDT_MAXSP: MAX SP (int) - UDT_MASTERAID: Master Account ID (for Summons) (int) - UDT_MASTERCID: Master Char ID (for Summons) (int) - UDT_MAPIDXY: Warp a Unit to a map. (Val1 = (string) MapName, Val2 = (int) x, Val3 = (int) y) - UDT_WALKTOXY: Make a unit walk to certain co-ordinates. (Val1 = (int) x, Val2 = (int) y) - UDT_SPEED: Unit Speed. (int) - UDT_MODE: Mode (Mobs only) (int) + UDT_SIZE: Unit Size + UDT_LEVEL: Level + UDT_HP: Current HP + UDT_MAXHP: Max HP + UDT_SP: SP + UDT_MAXSP: MAX SP + UDT_MASTERAID: Master Account ID (for Summons) + UDT_MASTERCID: Master Char ID (for Summons) + UDT_SPEED: Unit Speed. + UDT_MODE: Mode (Mobs only) UDT_AI: Unit AI Type (see doc/constants.md for Unit AI Types) UDT_SCOPTION: Status Options. (see doc/constants.md for Unit Option Types) UDT_SEX: Gender of the unit. (see doc/constants.md for Genders) - UDT_CLASS: Class of the unit. (Monster ID) (int) - UDT_HAIRSTYLE: Hair Style ID. (int) - UDT_HAIRCOLOR: Hair Color ID. (int) - UDT_HEADBOTTOM: Headgear Bottom Sprite ID. (int) - UDT_HEADMIDDLE: Headgear Middle Sprite ID. (int) - UDT_HEADTOP: Headgear Top Sprite ID. (int) - UDT_CLOTHCOLOR: Cloth Color ID. (int) - UDT_SHIELD: Shield Sprite ID. (int) - UDT_WEAPON: Weapon Sprite ID. (int) - UDT_LOOKDIR: Face direction. (int) - UDT_CANMOVETICK: Stop a unit from move for n seconds. (int) - UDT_STR: Unit STR. (int) - UDT_AGI: Unit AGI. (int) - UDT_VIT: Unit VIT. (int) - UDT_INT: Unit INT. (int) - UDT_DEX: Unit DEX. (int) - UDT_LUK: Unit LUK. (int) - UDT_ATKRANGE: Attack range of a unit. (int) - UDT_ATKMIN: Min Atk of a unit. (int) - UDT_ATKMAX: Max Atk of a unit. (int) - UDT_MATKMIN: Min MATK of a unit. (int) - UDT_MATKMAX: Max MATK of a unit. (int) - UDT_DEF: DEF. (int) - UDT_MDEF: MDEF. (int) - UDT_HIT: HIT. (int) - UDT_FLEE: FLEE. (int) - UDT_PDODGE: Perfect Dodge. (int) - UDT_CRIT: Critical Rate. (int) - UDT_RACE: Race. (Eg. string constants RC_DemiHuman or Integer 7). - UDT_ELETYPE: Element. (Eg. string constants Ele_Neutral or Integer 0). - UDT_ELELEVEL: Element Level (int). - UDT_AMOTION: AMotion Rate (int). - UDT_ADELAY: ADelay Rate (int). - UDT_DMOTION: DMotion Rate (int). - UDT_HUNGER: Hunger Rate (int) - for summons. - UDT_INTIMACY: Intimacy Rate (int) - for summons. - UDT_LIFETIME: LifeTime (int) - for summons. - UDT_MERC_KILLCOUNT: Kill count for mercenaries (int). - UDT_STATADD: Status Points (int) - for NPCs. + UDT_CLASS: Class of the unit. (Monster ID) + UDT_HAIRSTYLE: Hair Style ID. + UDT_HAIRCOLOR: Hair Color ID. + UDT_HEADBOTTOM: Headgear Bottom Sprite ID. + UDT_HEADMIDDLE: Headgear Middle Sprite ID. + UDT_HEADTOP: Headgear Top Sprite ID. + UDT_CLOTHCOLOR: Cloth Color ID. + UDT_SHIELD: Shield Sprite ID. + UDT_WEAPON: Weapon Sprite ID. + UDT_LOOKDIR: Face direction. + UDT_CANMOVETICK: Stop a unit from move for n seconds. + UDT_STR: Unit STR. + UDT_AGI: Unit AGI. + UDT_VIT: Unit VIT. + UDT_INT: Unit INT. + UDT_DEX: Unit DEX. + UDT_LUK: Unit LUK. + UDT_ATKRANGE: Attack range of a unit. + UDT_ATKMIN: Min Atk of a unit. + UDT_ATKMAX: Max Atk of a unit. + UDT_MATKMIN: Min MATK of a unit. + UDT_MATKMAX: Max MATK of a unit. + UDT_DEF: DEF. + UDT_MDEF: MDEF. + UDT_HIT: HIT. + UDT_FLEE: FLEE. + UDT_PDODGE: Perfect Dodge. + UDT_CRIT: Critical Rate. + UDT_RACE: Race. (Eg. constants RC_DemiHuman or Integer 7). + UDT_ELETYPE: Element. (Eg. constants Ele_Neutral or Integer 0). + UDT_ELELEVEL: Element Level. + UDT_AMOTION: AMotion Rate. + UDT_ADELAY: ADelay Rate. + UDT_DMOTION: DMotion Rate. + UDT_HUNGER: Hunger Rate - for summons. + UDT_INTIMACY: Intimacy Rate - for summons. + UDT_LIFETIME: LifeTime - for summons. + UDT_MERC_KILLCOUNT: Kill count for mercenaries + UDT_STATADD: Status Points - for NPCs. returns 0 if value could not be set, 1 if successful. --------------------------------------- -*getunitdata (<GUID>,<DataType>{,<Variable>}) +*getunitdata (<GID>,<DataType>) -Retrieves real-time data of a game object. For data with multiple return values, -an array variable may be passed to store the data in. +Retrieves real-time data of a game object. Applicable Data types (available as constants) - Data Types Description (return type) - UDT_SIZE: Unit Size (int) - UDT_LEVEL: Level (int) - UDT_HP: Current HP (int) - UDT_MAXHP: Max HP (int) - UDT_SP: SP (int) - UDT_MAXSP: MAX SP (int) - UDT_MASTERAID: Master Account ID (for Summons) (int) - UDT_MASTERCID: Master Char ID (for Summons) (int) - UDT_MAPIDXY: Warp a Unit to a map. (Val1 = (string) MapName, Val2 = (int) x, Val3 = (int) y) - UDT_SPEED: Unit Speed. (int) - UDT_MODE: Mode (Mobs only) (int) + UDT_SIZE: Unit Size + UDT_LEVEL: Level + UDT_HP: Current HP + UDT_MAXHP: Max HP + UDT_SP: SP + UDT_MAXSP: MAX SP + UDT_MASTERAID: Master Account ID (for Summons) + UDT_MASTERCID: Master Char ID (for Summons) + UDT_SPEED: Unit Speed. + UDT_MODE: Mode (Mobs only) UDT_AI: Unit AI Type (see doc/constants.md for Unit AI Types) UDT_SCOPTION: Status Options. (see doc/constants.md for Unit Option Types) UDT_SEX: Gender of the unit. (see doc/constants.md for Genders) - UDT_CLASS: Class of the unit. (Monster ID) (int) - UDT_HAIRSTYLE: Hair Style ID. (int) - UDT_HAIRCOLOR: Hair Color ID. (int) - UDT_HEADBOTTOM: Headgear Bottom Sprite ID. (int) - UDT_HEADMIDDLE: Headgear Middle Sprite ID. (int) - UDT_HEADTOP: Headgear Top Sprite ID. (int) - UDT_CLOTHCOLOR: Cloth Color ID. (int) - UDT_SHIELD: Shield Sprite ID. (int) - UDT_WEAPON: Weapon Sprite ID. (int) - UDT_LOOKDIR: Face direction. (int) - UDT_CANMOVETICK: Stop a unit from move for n seconds. (int) - UDT_STR: Unit STR. (int) - UDT_AGI: Unit AGI. (int) - UDT_VIT: Unit VIT. (int) - UDT_INT: Unit INT. (int) - UDT_DEX: Unit DEX. (int) - UDT_LUK: Unit LUK. (int) - UDT_ATKRANGE: Attack range of a unit. (int) - UDT_ATKMIN: Min Atk of a unit. (int) - UDT_ATKMAX: Max Atk of a unit. (int) - UDT_MATKMIN: Min MATK of a unit. (int) - UDT_MATKMAX: Max MATK of a unit. (int) - UDT_DEF: DEF. (int) - UDT_MDEF: MDEF. (int) - UDT_HIT: HIT. (int) - UDT_FLEE: FLEE. (int) - UDT_PDODGE: Perfect Dodge. (int) - UDT_CRIT: Critical Rate. (int) - UDT_RACE: Race. (Eg. string constants RC_DemiHuman or Integer 7). - UDT_ELETYPE: Element. (Eg. string constants Ele_Neutral or Integer 0). - UDT_ELELEVEL: Element Level (int). - UDT_AMOTION: AMotion Rate (int). - UDT_ADELAY: ADelay Rate (int). - UDT_DMOTION: DMotion Rate (int). - UDT_HUNGER: Hunger Rate (int) - for summons. - UDT_INTIMACY: Intimacy Rate (int) - for summons. - UDT_LIFETIME: LifeTime (int) - for summons. - UDT_MERC_KILLCOUNT: Kill count for mercenaries (int). + UDT_CLASS: Class of the unit. (Monster ID) + UDT_HAIRSTYLE: Hair Style ID. + UDT_HAIRCOLOR: Hair Color ID. + UDT_HEADBOTTOM: Headgear Bottom Sprite ID. + UDT_HEADMIDDLE: Headgear Middle Sprite ID. + UDT_HEADTOP: Headgear Top Sprite ID. + UDT_CLOTHCOLOR: Cloth Color ID. + UDT_SHIELD: Shield Sprite ID. + UDT_WEAPON: Weapon Sprite ID. + UDT_LOOKDIR: Face direction. + UDT_CANMOVETICK: Stop a unit from move for n seconds. + UDT_STR: Unit STR. + UDT_AGI: Unit AGI. + UDT_VIT: Unit VIT. + UDT_INT: Unit INT. + UDT_DEX: Unit DEX. + UDT_LUK: Unit LUK. + UDT_ATKRANGE: Attack range of a unit. + UDT_ATKMIN: Min Atk of a unit. + UDT_ATKMAX: Max Atk of a unit. + UDT_MATKMIN: Min MATK of a unit. + UDT_MATKMAX: Max MATK of a unit. + UDT_DEF: DEF. + UDT_MDEF: MDEF. + UDT_HIT: HIT. + UDT_FLEE: FLEE. + UDT_PDODGE: Perfect Dodge. + UDT_CRIT: Critical Rate. + UDT_RACE: Race. (Eg. constants RC_DemiHuman or Integer 7). + UDT_ELETYPE: Element. (Eg. constants Ele_Neutral or Integer 0). + UDT_ELELEVEL: Element Level. + UDT_AMOTION: AMotion Rate. + UDT_ADELAY: ADelay Rate. + UDT_DMOTION: DMotion Rate. + UDT_HUNGER: Hunger Rate - for summons. + UDT_INTIMACY: Intimacy Rate - for summons. + UDT_LIFETIME: LifeTime - for summons. + UDT_MERC_KILLCOUNT: Kill count for mercenaries. returns -1 if value could not be retrieved. diff --git a/npc/other/Global_Functions.txt b/npc/other/Global_Functions.txt index 904ed7165..86332e931 100644 --- a/npc/other/Global_Functions.txt +++ b/npc/other/Global_Functions.txt @@ -446,32 +446,24 @@ function script F_MesColor { function script F_GetTradeRestriction { .@trade = getiteminfo(getarg(0), ITEMINFO_TRADE); - if (.@trade == 0) { + if (.@trade == 0) return "None"; - } .@trade$ = ""; - if (.@trade & ITR_NODROP) { + if (.@trade & ITR_NODROP) .@trade$ += "NoDrop|"; - } - if (.@trade & ITR_NOTRADE) { + if (.@trade & ITR_NOTRADE) .@trade$ += "NoTrade|"; - } - if (.@trade & ITR_PARTNEROVERRIDE) { + if (.@trade & ITR_PARTNEROVERRIDE) .@trade$ += "PartnerOverride|"; - } - if (.@trade & ITR_NOSELLTONPC) { + if (.@trade & ITR_NOSELLTONPC) .@trade$ += "NoSellToNpc|"; - } - if (.@trade & ITR_NOSTORAGE) { + if (.@trade & ITR_NOSTORAGE) .@trade$ += "NoStorage|"; - } - if (.@trade & ITR_NOGSTORAGE) { + if (.@trade & ITR_NOGSTORAGE) .@trade$ += "NoGuildStorage|"; - } - if (.@trade & ITR_NOMAIL) { + if (.@trade & ITR_NOMAIL) .@trade$ += "NoMail|"; - } - if (.@trade & ITR_NOAUCTION) { + if (.@trade & ITR_NOAUCTION) .@trade$ += "NoAuction|"; - } + return .@trade$; } diff --git a/npc/quests/quests_rachel.txt b/npc/quests/quests_rachel.txt index 43e4beadb..1cc002d80 100644 --- a/npc/quests/quests_rachel.txt +++ b/npc/quests/quests_rachel.txt @@ -3210,7 +3210,7 @@ OnTouch: OnTouchNPC: emotion e_an; - //emotion e_gg,1; //Emote on monster - unsupported + unitemote mobattached(), e_gg; end; OnMyMobDead: diff --git a/npc/re/jobs/3-1/archbishop.txt b/npc/re/jobs/3-1/archbishop.txt index e59492ce5..e37087857 100644 --- a/npc/re/jobs/3-1/archbishop.txt +++ b/npc/re/jobs/3-1/archbishop.txt @@ -779,7 +779,7 @@ job3_arch01,29,34,3 script Valkyrie#arch 4_F_VALKYRIE2,{ warp "odin_tem02",282,263; end; } - if (getmercinfo(1)) { + if (getmercinfo(MERCINFO_CLASS)) { mes "[Valkyrie]"; mes "If you want to talk with me, you have to ^3131FFcancel all contracts^000000 with any mercenaries you have."; close; @@ -1006,7 +1006,7 @@ OnTouch: if (countitem(ValkyrieA_Scroll)) { delitem ValkyrieA_Scroll,1; // fall through - } else if (getmercinfo(1) == 2037) { + } else if (getmercinfo(MERCINFO_CLASS) == VALKYRIE_A) { if (strnpcinfo(NPC_NAME) == "#arch_1_10") viewpoint 1,113,327,1,0xFF9900; .@randht = rand(1,10); @@ -1038,7 +1038,7 @@ OnTouch: if (countitem(ValkyrieA_Scroll)) { delitem ValkyrieA_Scroll,1; // fall through - } else if (getmercinfo(1) == 2037) { + } else if (getmercinfo(MERCINFO_CLASS) == VALKYRIE_A) { mapannounce "job3_arch02","Valkyrie's Nightmare: An incompetent illusion of Valkyrie came here with the assistance of humans. You wanna have that nightmare?",bc_map,"0xFF0000"; donpcevent "mob#arch_1::OnKill"; end; @@ -1113,7 +1113,7 @@ OnKill: } job3_arch02,113,327,5 script Valkyrie#arch_01 4_F_VALKYRIE2,{ - if (getmercinfo(1)) { + if (getmercinfo(MERCINFO_CLASS)) { mes "[Valkyrie]"; mes "If you want to talk with me, you have to ^3131FFcancel all contracts^000000 with any mercenaries you have."; close; @@ -1355,7 +1355,7 @@ OnTouch: if (countitem(ValkyrieB_Scroll)) { delitem ValkyrieB_Scroll,1; // fall through - } else if (getmercinfo(1) == 2038) { + } else if (getmercinfo(MERCINFO_CLASS) == VALKYRIE_B) { .@randht = rand(1,10); if (.@randht < 8) mapannounce "job3_arch02","Whispering of an impersonation: I can feel the devil's spirits. Can you hear? The sound of gathering in crowds.",bc_map,"0xFFCE00"; @@ -1400,7 +1400,7 @@ OnTouch: if (countitem(ValkyrieB_Scroll)) { delitem ValkyrieB_Scroll,1; // fall through - } else if (getmercinfo(1) == 2038) { + } else if (getmercinfo(MERCINFO_CLASS) == VALKYRIE_B) { mapannounce "job3_arch02","A shout of devil: You are so childish. I invite you a party of devil. I'll make you have a fun!",bc_map,"0xFF0000"; end; } diff --git a/npc/re/jobs/3-1/ranger.txt b/npc/re/jobs/3-1/ranger.txt index 41e5b476f..166a1d42e 100644 --- a/npc/re/jobs/3-1/ranger.txt +++ b/npc/re/jobs/3-1/ranger.txt @@ -613,7 +613,7 @@ tur_dun01,91,169,3 script Test Instructor#jr02 4_M_JOB_HUNTER,{ mes "Don't hang around here doing nothing. This is my area!"; close; L_Start: - if (getmercinfo(1)) { + if (getmercinfo(MERCINFO_CLASS)) { mes "[Test Instructor, Teardrop]"; mes "Stop!"; next; @@ -1491,7 +1491,7 @@ job3_rang02,251,49,3 script Test Supervisor#jr_13 4_M_JOB_HUNTER,{ setquest 8261; close; } - if (getmercinfo(1) == 2034) { + if (getmercinfo(MERCINFO_CLASS) == M_DESERT_WOLF_B) { erasequest 8261; mes "Good! Then I'll start the test right now!"; next; diff --git a/npc/re/quests/eden/eden_tutorial.txt b/npc/re/quests/eden/eden_tutorial.txt index 902db7945..188bc514a 100644 --- a/npc/re/quests/eden/eden_tutorial.txt +++ b/npc/re/quests/eden/eden_tutorial.txt @@ -228,7 +228,7 @@ moc_para01,34,178,3 script Tutorial Instructor 4_M_KHMAN,{ close; } } else if (questprogress(9167) == 1) { - if (!getmercinfo(1)) { + if (!getmercinfo(MERCINFO_CLASS)) { mes "[Tutorial Instructor]"; mes "You haven't gotten a mercenary yet."; next; diff --git a/src/common/packets/packets2019_len_main.h b/src/common/packets/packets2019_len_main.h index f7ad59577..3b46c26cb 100644 --- a/src/common/packets/packets2019_len_main.h +++ b/src/common/packets/packets2019_len_main.h @@ -2,8 +2,8 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2019 Hercules Dev Team - * Copyright (C) 2019 Andrei Karas (4144) + * Copyright (C) 2018-2019 Hercules Dev Team + * Copyright (C) 2018-2019 Andrei Karas (4144) * * Hercules is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -3994,13 +3994,13 @@ packetLen(0x0a95, 4) packetLen(0x0a96, 61) // ZC_ADD_EXCHANGE_ITEM4 // Packet: 0x0a97 -packetLen(0x0a97, 8) // CZ_ALT_EQUIPMENT_EQUIP +packetLen(0x0a97, 8) // CZ_ALT_EQUIPMENT_ADD // Packet: 0x0a98 packetLen(0x0a98, 10) // ZC_ALT_EQUIPMENT_EQUIP // Packet: 0x0a99 -packetLen(0x0a99, 4) +packetLen(0x0a99, 4) // CZ_ALT_EQUIPMENT_REMOVE // Packet: 0x0a9a packetLen(0x0a9a, 10) // ZC_ALT_EQUIPMENT_REMOVE @@ -4009,10 +4009,10 @@ packetLen(0x0a9a, 10) // ZC_ALT_EQUIPMENT_REMOVE packetLen(0x0a9b, -1) // ZC_ALT_EQUIPMENT_ITEMS // Packet: 0x0a9c -packetLen(0x0a9c, 2) +packetLen(0x0a9c, 2) // CZ_ALT_EQUIPMENT_SWITCH // Packet: 0x0a9d -packetLen(0x0a9d, 4) +packetLen(0x0a9d, 4) // ZC_ALT_EQUIPMENT_SWITCH_ACK // Packet: 0x0a9e packetLen(0x0a9e, 2) @@ -4168,7 +4168,7 @@ packetLen(0x0acf, 68) // CA_LOGIN_OTP packetLen(0x0ad0, 11) // CA_OTP_CODE // Packet: 0x0ad1 -packetLen(0x0ad1, -1) +packetLen(0x0ad1, -1) // AC_LOGIN_OTP // Packet: 0x0ad2 packetLen(0x0ad2, 30) @@ -4375,7 +4375,53 @@ packetLen(0x0b18, 4) // ZC_INVENTORY_EXPANSION_INFO packetLen(0x0b19, 2) // CZ_INVENTORY_EXPAND_REJECTED // Packet: 0x0b1a -packetLen(0x0b1a, 29) +packetLen(0x0b1a, 29) // ZC_USESKILL_ACK3 + +// Packet: 0x0b1b +#if PACKETVER >= 20190213 +packetLen(0x0b1b, 2) +#endif + +// Packet: 0x0b1c +#if PACKETVER >= 20190227 +packetLen(0x0b1c, 2) +#endif + +// Packet: 0x0b1d +#if PACKETVER >= 20190227 +packetLen(0x0b1d, 2) +#endif + +// Packet: 0x0b1e +#if PACKETVER >= 20190227 +packetLen(0x0b1e, 10) +#endif + +// Packet: 0x0b1f +#if PACKETVER >= 20190306 +packetLen(0x0b1f, 10) +#endif + +// Packet: 0x0b21 +#if PACKETVER >= 20190306 +// removed +#elif PACKETVER >= 20190227 +packetLen(0x0b21, 10) +#endif + +// Packet: 0x0b22 +#if PACKETVER >= 20190306 +// removed +#elif PACKETVER >= 20190227 +packetLen(0x0b22, 6) +#endif + +// Packet: 0x0b23 +#if PACKETVER >= 20190306 +// removed +#elif PACKETVER >= 20190227 +packetLen(0x0b23, 10) +#endif #endif /* COMMON_PACKETS2019_LEN_MAIN_H */ diff --git a/src/common/packets/packets2019_len_re.h b/src/common/packets/packets2019_len_re.h index 134102bac..6614fa8fd 100644 --- a/src/common/packets/packets2019_len_re.h +++ b/src/common/packets/packets2019_len_re.h @@ -2,8 +2,8 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2019 Hercules Dev Team - * Copyright (C) 2019 Andrei Karas (4144) + * Copyright (C) 2018-2019 Hercules Dev Team + * Copyright (C) 2018-2019 Andrei Karas (4144) * * Hercules is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -4000,13 +4000,13 @@ packetLen(0x0a95, 4) packetLen(0x0a96, 61) // ZC_ADD_EXCHANGE_ITEM4 // Packet: 0x0a97 -packetLen(0x0a97, 8) // CZ_ALT_EQUIPMENT_EQUIP +packetLen(0x0a97, 8) // CZ_ALT_EQUIPMENT_ADD // Packet: 0x0a98 packetLen(0x0a98, 10) // ZC_ALT_EQUIPMENT_EQUIP // Packet: 0x0a99 -packetLen(0x0a99, 4) +packetLen(0x0a99, 4) // CZ_ALT_EQUIPMENT_REMOVE // Packet: 0x0a9a packetLen(0x0a9a, 10) // ZC_ALT_EQUIPMENT_REMOVE @@ -4015,10 +4015,10 @@ packetLen(0x0a9a, 10) // ZC_ALT_EQUIPMENT_REMOVE packetLen(0x0a9b, -1) // ZC_ALT_EQUIPMENT_ITEMS // Packet: 0x0a9c -packetLen(0x0a9c, 2) +packetLen(0x0a9c, 2) // CZ_ALT_EQUIPMENT_SWITCH // Packet: 0x0a9d -packetLen(0x0a9d, 4) +packetLen(0x0a9d, 4) // ZC_ALT_EQUIPMENT_SWITCH_ACK // Packet: 0x0a9e packetLen(0x0a9e, 2) @@ -4174,7 +4174,7 @@ packetLen(0x0acf, 68) // CA_LOGIN_OTP packetLen(0x0ad0, 11) // CA_OTP_CODE // Packet: 0x0ad1 -packetLen(0x0ad1, -1) +packetLen(0x0ad1, -1) // AC_LOGIN_OTP // Packet: 0x0ad2 packetLen(0x0ad2, 30) @@ -4381,7 +4381,53 @@ packetLen(0x0b18, 4) // ZC_INVENTORY_EXPANSION_INFO packetLen(0x0b19, 2) // CZ_INVENTORY_EXPAND_REJECTED // Packet: 0x0b1a -packetLen(0x0b1a, 29) +packetLen(0x0b1a, 29) // ZC_USESKILL_ACK3 + +// Packet: 0x0b1b +#if PACKETVER >= 20190213 +packetLen(0x0b1b, 2) +#endif + +// Packet: 0x0b1c +#if PACKETVER >= 20190220 +packetLen(0x0b1c, 2) +#endif + +// Packet: 0x0b1d +#if PACKETVER >= 20190220 +packetLen(0x0b1d, 2) +#endif + +// Packet: 0x0b1e +#if PACKETVER >= 20190227 +packetLen(0x0b1e, 10) +#endif + +// Packet: 0x0b1f +#if PACKETVER >= 20190306 +packetLen(0x0b1f, 10) +#endif + +// Packet: 0x0b21 +#if PACKETVER >= 20190306 +// removed +#elif PACKETVER >= 20190227 +packetLen(0x0b21, 10) +#endif + +// Packet: 0x0b22 +#if PACKETVER >= 20190306 +// removed +#elif PACKETVER >= 20190227 +packetLen(0x0b22, 6) +#endif + +// Packet: 0x0b23 +#if PACKETVER >= 20190306 +// removed +#elif PACKETVER >= 20190227 +packetLen(0x0b23, 10) +#endif #endif /* COMMON_PACKETS2019_LEN_RE_H */ diff --git a/src/common/packets/packets2019_len_zero.h b/src/common/packets/packets2019_len_zero.h index 08e83f59f..8ddbdcc18 100644 --- a/src/common/packets/packets2019_len_zero.h +++ b/src/common/packets/packets2019_len_zero.h @@ -4168,7 +4168,7 @@ packetLen(0x0acf, 68) // CA_LOGIN_OTP packetLen(0x0ad0, 11) // CA_OTP_CODE // Packet: 0x0ad1 -packetLen(0x0ad1, -1) +packetLen(0x0ad1, -1) // AC_LOGIN_OTP // Packet: 0x0ad2 packetLen(0x0ad2, 30) @@ -4375,12 +4375,22 @@ packetLen(0x0b18, 4) // ZC_INVENTORY_EXPANSION_INFO packetLen(0x0b19, 2) // CZ_INVENTORY_EXPAND_REJECTED // Packet: 0x0b1a -packetLen(0x0b1a, 29) +packetLen(0x0b1a, 29) // ZC_USESKILL_ACK3 // Packet: 0x0b1b #if PACKETVER >= 20190130 packetLen(0x0b1b, 2) #endif +// Packet: 0x0b1c +#if PACKETVER >= 20190220 +packetLen(0x0b1c, 2) +#endif + +// Packet: 0x0b1d +#if PACKETVER >= 20190220 +packetLen(0x0b1d, 2) +#endif + #endif /* COMMON_PACKETS2019_LEN_ZERO_H */ diff --git a/src/common/socket.c b/src/common/socket.c index 95d8bf578..faf57f412 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -79,8 +79,6 @@ static struct socket_interface sockt_s; struct socket_interface *sockt; -static const char *SOCKET_CONF_FILENAME = "conf/common/socket.conf"; - #ifdef SEND_SHORTLIST // Add a fd to the shortlist so that it'll be recognized as a fd that needs // sending done on it. @@ -462,7 +460,7 @@ static int recv_to_fifo(int fd) socket_data_ci += len; } #endif // SHOW_SERVER_STATS - return 0; + return (int)len; } static int send_from_fifo(int fd) @@ -648,7 +646,7 @@ static int make_listen_bind(uint32 ip, uint16 port) if(sockt->fd_max <= fd) sockt->fd_max = fd + 1; - create_session(fd, connect_client, null_send, null_parse); + create_session(fd, sockt->connect_client, null_send, null_parse); sockt->session[fd]->client_addr = 0; // just listens sockt->session[fd]->rdata_tick = 0; // disable timeouts on this socket return fd; @@ -1505,7 +1503,7 @@ static bool socket_config_read(const char *filename, bool imported) // import should overwrite any previous configuration, so it should be called last if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) { - if (strcmp(import, filename) == 0 || strcmp(import, SOCKET_CONF_FILENAME) == 0) { + if (strcmp(import, filename) == 0 || strcmp(import, sockt->SOCKET_CONF_FILENAME) == 0) { ShowWarning("socket_config_read: Loop detected! Skipping 'import'...\n"); } else { if (!socket_config_read(import, true)) @@ -1714,7 +1712,7 @@ static void socket_init(void) // Get initial local ips sockt->naddr_ = sockt->getips(sockt->addr_,16); - socket_config_read(SOCKET_CONF_FILENAME, false); + socket_config_read(sockt->SOCKET_CONF_FILENAME, false); #ifndef SOCKET_EPOLL // Select based Event Dispatcher: @@ -2143,6 +2141,8 @@ void socket_defaults(void) { sockt = &sockt_s; + sockt->SOCKET_CONF_FILENAME = "conf/common/socket.conf"; + sockt->fd_max = 0; /* */ sockt->stall_time = 60; @@ -2177,6 +2177,7 @@ void socket_defaults(void) /* */ sockt->flush = flush_fifo; sockt->flush_fifos = flush_fifos; + sockt->connect_client = connect_client; sockt->set_nonblocking = set_nonblocking; sockt->set_defaultparse = set_defaultparse; sockt->host2ip = host2ip; diff --git a/src/common/socket.h b/src/common/socket.h index 5e4251989..193b22645 100644 --- a/src/common/socket.h +++ b/src/common/socket.h @@ -178,6 +178,7 @@ struct socket_interface { time_t stall_time; time_t last_tick; + const char *SOCKET_CONF_FILENAME; /* */ uint32 addr_[16]; // ip addresses of local host (host byte order) int naddr_; // # of ip addresses @@ -212,6 +213,7 @@ struct socket_interface { /* */ void (*flush) (int fd); void (*flush_fifos) (void); + int (*connect_client) (int listen_fd); void (*set_nonblocking) (int fd, unsigned long yes); void (*set_defaultparse) (ParseFunc defaultparse); /* hostname/ip conversion functions */ diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 87be6ab1b..a9f63fe13 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -10716,6 +10716,9 @@ void atcommand_defaults(void) { atcommand = &atcommand_s; + atcommand->atcmd_output = &atcmd_output; + atcommand->atcmd_player_name = &atcmd_player_name; + atcommand->db = NULL; atcommand->alias_db = NULL; diff --git a/src/map/atcommand.h b/src/map/atcommand.h index 3bbbefa20..1783e5dc6 100644 --- a/src/map/atcommand.h +++ b/src/map/atcommand.h @@ -21,9 +21,11 @@ #ifndef MAP_ATCOMMAND_H #define MAP_ATCOMMAND_H +#include "map/mapdefines.h" #include "map/pc_groups.h" #include "common/hercules.h" #include "common/db.h" +#include "common/mmo.h" #include <stdarg.h> @@ -90,6 +92,8 @@ struct atcmd_binding_data { * Interface **/ struct atcommand_interface { + char (*atcmd_output)[CHAT_SIZE_MAX]; + char (*atcmd_player_name)[NAME_LENGTH]; unsigned char at_symbol; unsigned char char_symbol; /* atcommand binding */ diff --git a/src/map/battle.c b/src/map/battle.c index 6fa46a7c7..1b7bf909e 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -7413,6 +7413,7 @@ static const struct battle_data { { "min_item_buy_price", &battle_config.min_item_buy_price, 1, 0, INT_MAX, }, { "min_item_sell_price", &battle_config.min_item_sell_price, 0, 0, INT_MAX, }, { "display_fake_hp_when_dead", &battle_config.display_fake_hp_when_dead, 1, 0, 1, }, + { "magicrod_type", &battle_config.magicrod_type, 0, 0, 1, }, }; static bool battle_set_value_sub(int index, int value) diff --git a/src/map/battle.h b/src/map/battle.h index d2fd92450..c797e665a 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -576,6 +576,8 @@ struct Battle_Config { int min_item_sell_price; int display_fake_hp_when_dead; + + int magicrod_type; }; /* criteria for battle_config.idletime_critera */ diff --git a/src/map/clif.c b/src/map/clif.c index 86b130e88..4c8d2df9c 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -5432,7 +5432,7 @@ static void clif_useskill(struct block_list *bl, int src_id, int dst_id, int dst #if PACKETVER_MAIN_NUM >= 20091124 || PACKETVER_RE_NUM >= 20091124 || defined(PACKETVER_ZERO) p.disposable = 0; #endif -#if PACKETVER_ZERO_NUM >= 20190130 +#if PACKETVER_MAIN_NUM >= 20181212 || PACKETVER_RE_NUM >= 20181212 || PACKETVER_ZERO_NUM >= 20190130 p.unknown = 0; #endif @@ -18580,6 +18580,7 @@ static void clif_search_store_info_ack(struct map_session_data *sd) /// 2 = "You cannot search anymore." (0x706) /// 3 = "You cannot search yet." (0x708) /// 4 = "No sale (purchase) information available." (0x705) +/// 362 = silent error static void clif_search_store_info_failed(struct map_session_data *sd, unsigned char reason) { #if PACKETVER >= 20100601 diff --git a/src/map/clif.h b/src/map/clif.h index a7573b56e..e1fe07dd8 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -412,20 +412,22 @@ enum CASH_SHOP_BUY_RESULT { }; enum BATTLEGROUNDS_QUEUE_ACK { - BGQA_SUCCESS = 1, - BGQA_FAIL_QUEUING_FINISHED, - BGQA_FAIL_BGNAME_INVALID, - BGQA_FAIL_TYPE_INVALID, - BGQA_FAIL_PPL_OVERAMOUNT, - BGQA_FAIL_LEVEL_INCORRECT, - BGQA_DUPLICATE_REQUEST, - BGQA_PLEASE_RELOGIN, - BGQA_NOT_PARTY_GUILD_LEADER, - BGQA_FAIL_CLASS_INVALID, + BGQA_SUCCESS = 1, + BGQA_FAIL_QUEUING_FINISHED = 2, + BGQA_FAIL_BGNAME_INVALID = 3, + BGQA_FAIL_TYPE_INVALID = 4, + BGQA_FAIL_PPL_OVERAMOUNT = 5, + BGQA_FAIL_LEVEL_INCORRECT = 6, + BGQA_DUPLICATE_REQUEST = 7, + BGQA_PLEASE_RELOGIN = 8, + BGQA_NOT_PARTY_GUILD_LEADER = 9, + BGQA_FAIL_CLASS_INVALID = 10, /* not official way to respond (gotta find packet?) */ - BGQA_FAIL_DESERTER, - BGQA_FAIL_COOLDOWN, - BGQA_FAIL_TEAM_COUNT, + BGQA_FAIL_DESERTER = 11, + BGQA_FAIL_COOLDOWN = 12, + BGQA_FAIL_TEAM_COUNT = 13, + // official continue + BGQA_FAIL_TEAM_IN_BG_ALREADY = 15 }; enum BATTLEGROUNDS_QUEUE_NOTICE_DELETED { diff --git a/src/map/intif.c b/src/map/intif.c index 8028d4474..86bf07bce 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -1507,7 +1507,7 @@ static void intif_parse_GuildMemberWithdraw(int fd) // ACK guild member basic info static void intif_parse_GuildMemberInfoShort(int fd) { - guild->recv_memberinfoshort(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),RFIFOW(fd,15),RFIFOL(fd,17),RFIFOL(fd,19)); + guild->recv_memberinfoshort(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),RFIFOW(fd,15),RFIFOL(fd,17),RFIFOL(fd,21)); } // ACK guild break diff --git a/src/map/map.h b/src/map/map.h index ace2a35a1..1f70680e8 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -45,42 +45,6 @@ enum E_MAPSERVER_ST { MAPSERVER_ST_LAST }; -#define MAX_NPC_PER_MAP 512 -#define AREA_SIZE (battle->bc->area_size) -#define CHAT_AREA_SIZE (battle->bc->chat_area_size) -#define DEAD_AREA_SIZE (battle->bc->dead_area_size) -#define DAMAGELOG_SIZE 30 -#define LOOTITEM_SIZE 10 -#define MAX_MOBSKILL 50 -#define MAX_MOB_LIST_PER_MAP 100 -#define MAX_EVENTQUEUE 2 -#define MAX_EVENTTIMER 32 -#define NATURAL_HEAL_INTERVAL 500 -#define MIN_FLOORITEM 2 -#define MAX_FLOORITEM START_ACCOUNT_NUM -#define MAX_IGNORE_LIST 20 // official is 14 -#define MAX_VENDING 12 -#define MAX_MAP_SIZE (512*512) // Wasn't there something like this already? Can't find it.. [Shinryo] - -#define BLOCK_SIZE 8 -#define block_free_max 1048576 -#define BL_LIST_MAX 1048576 - -// The following system marks a different job ID system used by the map server, -// which makes a lot more sense than the normal one. [Skotlex] -// These marks the "level" of the job. -#define JOBL_2_1 0x0100 -#define JOBL_2_2 0x0200 -#define JOBL_2 0x0300 // JOBL_2_1 | JOBL_2_2 -#define JOBL_UPPER 0x1000 -#define JOBL_BABY 0x2000 -#define JOBL_THIRD 0x4000 - -// For filtering and quick checking. -#define MAPID_BASEMASK 0x00ff -#define MAPID_UPPERMASK 0x0fff -#define MAPID_THIRDMASK (JOBL_THIRD|MAPID_UPPERMASK) - //First Jobs //Note the oddity of the novice: //Super Novices are considered the 2-1 version of the novice! Novices are considered a first class type. @@ -344,36 +308,6 @@ enum { STATIC_ASSERT(((MAPID_1_1_MAX - 1) | MAPID_BASEMASK) == MAPID_BASEMASK, "First class map IDs do not fit into MAPID_BASEMASK"); -// Max size for inputs to Graffiti, Talkie Box and Vending text prompts -#define MESSAGE_SIZE (79 + 1) -// String length you can write in the 'talking box' -#define CHATBOX_SIZE (70 + 1) -// Chatroom-related string sizes -#define CHATROOM_TITLE_SIZE (36 + 1) -#define CHATROOM_PASS_SIZE (8 + 1) -// Max allowed chat text length -#define CHAT_SIZE_MAX (255 + 1) -// 24 for npc name + 24 for label + 2 for a "::" and 1 for EOS -#define EVENT_NAME_LENGTH ( NAME_LENGTH * 2 + 3 ) -#define DEFAULT_AUTOSAVE_INTERVAL (5*60*1000) -// Specifies maps where players may hit each other -#define map_flag_vs(m) ( \ - map->list[m].flag.pvp \ - || map->list[m].flag.gvg_dungeon \ - || map->list[m].flag.gvg \ - || ((map->agit_flag || map->agit2_flag) && map->list[m].flag.gvg_castle) \ - || map->list[m].flag.battleground \ - || map->list[m].flag.cvc \ - ) -// Specifies maps that have special GvG/WoE restrictions -#define map_flag_gvg(m) (map->list[m].flag.gvg || ((map->agit_flag || map->agit2_flag) && map->list[m].flag.gvg_castle)) -// Specifies if the map is tagged as GvG/WoE (regardless of map->agit_flag status) -#define map_flag_gvg2(m) (map->list[m].flag.gvg || map->list[m].flag.gvg_castle) -// No Kill Steal Protection -#define map_flag_ks(m) (map->list[m].flag.town || map->list[m].flag.pvp || map->list[m].flag.gvg || map->list[m].flag.battleground) -// No ViewID -#define map_no_view(m, view) (map->list[m].flag.noviewid & (view)) - //This stackable implementation does not means a BL can be more than one type at a time, but it's // meant to make it easier to check for multiple types at a time on invocations such as map_foreach* calls [Skotlex] enum bl_type { @@ -392,9 +326,6 @@ enum bl_type { BL_ALL = 0xFFF, }; -// For common mapforeach calls. Since pets cannot be affected, they aren't included here yet. -#define BL_CHAR (BL_PC|BL_MOB|BL_HOM|BL_MER|BL_ELEM) - enum npc_subtype { WARP, SHOP, SCRIPT, CASHSHOP, TOMB }; /** @@ -748,16 +679,6 @@ enum map_zone_merge_type { MZMT_NEVERMERGE, ///< Cannot merge with any zones. }; -#define MAP_ZONE_NAME_LENGTH 60 -#define MAP_ZONE_ALL_NAME "All" -#define MAP_ZONE_NORMAL_NAME "Normal" -#define MAP_ZONE_PVP_NAME "PvP" -#define MAP_ZONE_GVG_NAME "GvG" -#define MAP_ZONE_BG_NAME "Battlegrounds" -#define MAP_ZONE_CVC_NAME "CvC" -#define MAP_ZONE_PK_NAME "PK Mode" -#define MAP_ZONE_MAPFLAG_LENGTH 65 - struct map_zone_data { char name[MAP_ZONE_NAME_LENGTH];/* 20'd */ enum map_zone_merge_type merge_type; diff --git a/src/map/mapdefines.h b/src/map/mapdefines.h new file mode 100644 index 000000000..df9e9bccb --- /dev/null +++ b/src/map/mapdefines.h @@ -0,0 +1,103 @@ +/** + * This file is part of Hercules. + * http://herc.ws - http://github.com/HerculesWS/Hercules + * + * Copyright (C) 2012-2018 Hercules Dev Team + * Copyright (C) Athena Dev Teams + * + * Hercules 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 <http://www.gnu.org/licenses/>. + */ +#ifndef MAP_MAPDEFINES_H +#define MAP_MAPDEFINES_H + +#define MAX_NPC_PER_MAP 512 +#define AREA_SIZE (battle->bc->area_size) +#define CHAT_AREA_SIZE (battle->bc->chat_area_size) +#define DEAD_AREA_SIZE (battle->bc->dead_area_size) +#define DAMAGELOG_SIZE 30 +#define LOOTITEM_SIZE 10 +#define MAX_MOBSKILL 50 +#define MAX_MOB_LIST_PER_MAP 100 +#define MAX_EVENTQUEUE 2 +#define MAX_EVENTTIMER 32 +#define NATURAL_HEAL_INTERVAL 500 +#define MIN_FLOORITEM 2 +#define MAX_FLOORITEM START_ACCOUNT_NUM +#define MAX_IGNORE_LIST 20 // official is 14 +#define MAX_VENDING 12 +#define MAX_MAP_SIZE (512*512) // Wasn't there something like this already? Can't find it.. [Shinryo] + +#define BLOCK_SIZE 8 +#define block_free_max 1048576 +#define BL_LIST_MAX 1048576 + +// The following system marks a different job ID system used by the map server, +// which makes a lot more sense than the normal one. [Skotlex] +// These marks the "level" of the job. +#define JOBL_2_1 0x0100 +#define JOBL_2_2 0x0200 +#define JOBL_2 0x0300 // JOBL_2_1 | JOBL_2_2 +#define JOBL_UPPER 0x1000 +#define JOBL_BABY 0x2000 +#define JOBL_THIRD 0x4000 + +// For filtering and quick checking. +#define MAPID_BASEMASK 0x00ff +#define MAPID_UPPERMASK 0x0fff +#define MAPID_THIRDMASK (JOBL_THIRD|MAPID_UPPERMASK) + +// Max size for inputs to Graffiti, Talkie Box and Vending text prompts +#define MESSAGE_SIZE (79 + 1) +// String length you can write in the 'talking box' +#define CHATBOX_SIZE (70 + 1) +// Chatroom-related string sizes +#define CHATROOM_TITLE_SIZE (36 + 1) +#define CHATROOM_PASS_SIZE (8 + 1) +// Max allowed chat text length +#define CHAT_SIZE_MAX (255 + 1) +// 24 for npc name + 24 for label + 2 for a "::" and 1 for EOS +#define EVENT_NAME_LENGTH ( NAME_LENGTH * 2 + 3 ) +#define DEFAULT_AUTOSAVE_INTERVAL (5*60*1000) +// Specifies maps where players may hit each other +#define map_flag_vs(m) ( \ + map->list[m].flag.pvp \ + || map->list[m].flag.gvg_dungeon \ + || map->list[m].flag.gvg \ + || ((map->agit_flag || map->agit2_flag) && map->list[m].flag.gvg_castle) \ + || map->list[m].flag.battleground \ + || map->list[m].flag.cvc \ + ) +// Specifies maps that have special GvG/WoE restrictions +#define map_flag_gvg(m) (map->list[m].flag.gvg || ((map->agit_flag || map->agit2_flag) && map->list[m].flag.gvg_castle)) +// Specifies if the map is tagged as GvG/WoE (regardless of map->agit_flag status) +#define map_flag_gvg2(m) (map->list[m].flag.gvg || map->list[m].flag.gvg_castle) +// No Kill Steal Protection +#define map_flag_ks(m) (map->list[m].flag.town || map->list[m].flag.pvp || map->list[m].flag.gvg || map->list[m].flag.battleground) +// No ViewID +#define map_no_view(m, view) (map->list[m].flag.noviewid & (view)) + +// For common mapforeach calls. Since pets cannot be affected, they aren't included here yet. +#define BL_CHAR (BL_PC|BL_MOB|BL_HOM|BL_MER|BL_ELEM) + +#define MAP_ZONE_NAME_LENGTH 60 +#define MAP_ZONE_ALL_NAME "All" +#define MAP_ZONE_NORMAL_NAME "Normal" +#define MAP_ZONE_PVP_NAME "PvP" +#define MAP_ZONE_GVG_NAME "GvG" +#define MAP_ZONE_BG_NAME "Battlegrounds" +#define MAP_ZONE_CVC_NAME "CvC" +#define MAP_ZONE_PK_NAME "PK Mode" +#define MAP_ZONE_MAPFLAG_LENGTH 65 + +#endif /* MAP_MAPDEFINES_H */ diff --git a/src/map/messages_main.h b/src/map/messages_main.h index 1ce77451e..f8129c2ca 100644 --- a/src/map/messages_main.h +++ b/src/map/messages_main.h @@ -24,7 +24,7 @@ /* This file is autogenerated, please do not commit manual changes -Latest version: 20190109 +Latest version: 20190306 */ enum clif_messages { @@ -20260,9 +20260,11 @@ http://member.gnjoy.com/user/pay/chargelist.asp 한 번에 구입 가능한 아이템의 가짓수는 8개입니다. */ MSG_ID_CF0 = 0xcf0, -/*20170920 to latest +/*20170920 to 20190228 http://gift.zhaouc.com/#/index http://gift.zhaouc.com/ +20190306 to latest +http://gift.zhaouc.com/ */ MSG_ID_CF1 = 0xcf1, #endif @@ -21466,6 +21468,59 @@ TITLE */ MSG_ID_DF8 = 0xdf8, #endif +#if PACKETVER >= 20190213 +/*20190213 to latest +맵 이름 표기 +*/ + MSG_ID_DF9 = 0xdf9, +/*20190213 to latest +시스템 메세지 : 현재 노점보기 기능이 %s 상태입니다. (/노점보기) +*/ + MSG_ID_DFA = 0xdfa, +/*20190213 to latest +수직 동기 +*/ + MSG_ID_DFB = 0xdfb, +/*20190213 to latest +자료 +*/ + MSG_ID_DFC = 0xdfc, +/*20190213 to 20190228 +http://rodata.zhaouc.com/renwu.html#container +20190306 to latest +http://rodata.zhaouc.com/renwu.html +*/ + MSG_ID_DFD = 0xdfd, +/*20190213 to latest +작위 +*/ + MSG_ID_DFE = 0xdfe, +/*20190213 to latest +프레임 제한 +*/ + MSG_ID_DFF = 0xdff, +#endif +#if PACKETVER >= 20190227 +/*20190227 to latest +%d개를 초과할 경우 더 이상 설치 할 수 없습니다. +*/ + MSG_ID_E00 = 0xe00, +/*20190227 to latest +목적지 +*/ + MSG_ID_E01 = 0xe01, +#endif +#if PACKETVER >= 20190306 +/*20190306 to latest +잠시 후 다시 시도해주세요. +Please try again in a moment. +*/ + MSG_ID_E02 = 0xe02, +/*20190306 to latest +등록할 수 없는 파일입니다. +*/ + MSG_ID_E03 = 0xe03, +#endif }; #endif /* MAP_MESSAGES_MAIN_H */ diff --git a/src/map/messages_re.h b/src/map/messages_re.h index af66a8464..d4b86c619 100644 --- a/src/map/messages_re.h +++ b/src/map/messages_re.h @@ -24,7 +24,7 @@ /* This file is autogenerated, please do not commit manual changes -Latest version: 20190109 +Latest version: 20190306 */ enum clif_messages { @@ -19739,9 +19739,11 @@ http://member.gnjoy.com/user/pay/chargelist.asp 한 번에 구입 가능한 아이템의 가짓수는 8개입니다. */ MSG_ID_CF0 = 0xcf0, -/*20170920 to latest +/*20170920 to 20190228 http://gift.zhaouc.com/#/index http://gift.zhaouc.com/ +20190306 to latest +http://gift.zhaouc.com/ */ MSG_ID_CF1 = 0xcf1, #endif @@ -20945,6 +20947,59 @@ TITLE */ MSG_ID_DF8 = 0xdf8, #endif +#if PACKETVER >= 20190213 +/*20190213 to latest +맵 이름 표기 +*/ + MSG_ID_DF9 = 0xdf9, +/*20190213 to latest +시스템 메세지 : 현재 노점보기 기능이 %s 상태입니다. (/노점보기) +*/ + MSG_ID_DFA = 0xdfa, +/*20190213 to latest +수직 동기 +*/ + MSG_ID_DFB = 0xdfb, +/*20190213 to latest +자료 +*/ + MSG_ID_DFC = 0xdfc, +/*20190213 to 20190228 +http://rodata.zhaouc.com/renwu.html#container +20190306 to latest +http://rodata.zhaouc.com/renwu.html +*/ + MSG_ID_DFD = 0xdfd, +/*20190213 to latest +작위 +*/ + MSG_ID_DFE = 0xdfe, +/*20190213 to latest +프레임 제한 +*/ + MSG_ID_DFF = 0xdff, +#endif +#if PACKETVER >= 20190220 +/*20190220 to latest +%d개를 초과할 경우 더 이상 설치 할 수 없습니다. +*/ + MSG_ID_E00 = 0xe00, +/*20190220 to latest +목적지 +*/ + MSG_ID_E01 = 0xe01, +#endif +#if PACKETVER >= 20190306 +/*20190306 to latest +잠시 후 다시 시도해주세요. +Please try again in a moment. +*/ + MSG_ID_E02 = 0xe02, +/*20190306 to latest +등록할 수 없는 파일입니다. +*/ + MSG_ID_E03 = 0xe03, +#endif }; #endif /* MAP_MESSAGES_RE_H */ diff --git a/src/map/messages_zero.h b/src/map/messages_zero.h index 0b679a2c1..0119a9540 100644 --- a/src/map/messages_zero.h +++ b/src/map/messages_zero.h @@ -24,7 +24,7 @@ /* This file is autogenerated, please do not commit manual changes -Latest version: 20190130 +Latest version: 20190220 */ enum clif_messages { @@ -17555,6 +17555,42 @@ TITLE */ MSG_ID_DF9 = 0xdf9, #endif +#if PACKETVER >= 20190213 +/*20190213 to latest +시스템 메세지 : 현재 노점보기 기능이 %s 상태입니다. (/노점보기) +*/ + MSG_ID_DFA = 0xdfa, +/*20190213 to latest +수직 동기 +*/ + MSG_ID_DFB = 0xdfb, +/*20190213 to latest +자료 +*/ + MSG_ID_DFC = 0xdfc, +/*20190213 to latest +http://rodata.zhaouc.com/renwu.html#container +*/ + MSG_ID_DFD = 0xdfd, +/*20190213 to latest +작위 +*/ + MSG_ID_DFE = 0xdfe, +/*20190213 to latest +프레임 제한 +*/ + MSG_ID_DFF = 0xdff, +#endif +#if PACKETVER >= 20190220 +/*20190220 to latest +%d개를 초과할 경우 더 이상 설치 할 수 없습니다. +*/ + MSG_ID_E00 = 0xe00, +/*20190220 to latest +목적지 +*/ + MSG_ID_E01 = 0xe01, +#endif }; #endif /* MAP_MESSAGES_ZERO_H */ diff --git a/src/map/packets_keys_main.h b/src/map/packets_keys_main.h index 017e1d45a..1795e46c2 100644 --- a/src/map/packets_keys_main.h +++ b/src/map/packets_keys_main.h @@ -37,7 +37,7 @@ packetKeys(0x49357d72,0x22c370a1,0x5f836591); #endif -// 2010-11-23aRagexeRE, 2010-11-24aRagexeRE, 2010-11-24bRagexeRE, 2010-11-25aRagexeRE, 2010-11-26aRagexeRE, 2010-11-30aRagexeRE, 2010-12-07aRagexeRE, 2010-12-14aRagexeRE, 2010-12-21aRagexeRE, 2010-12-23aRagexeRE, 2010-12-28aRagexeRE, 2011-01-04aRagexeRE, 2011-01-05aRagexeRE, 2011-01-11aRagexeRE, 2011-01-18aRagexeRE, 2011-01-25aRagexeRE, 2011-01-26aRagexeRE, 2011-01-26bRagexeRE, 2011-01-31aRagexeRE, 2011-01-31bRagexeRE, 2011-01-31cRagexeRE, 2011-02-08aRagexeRE, 2011-02-15aRagexeRE, 2011-02-22aRagexeRE, 2011-02-23aRagexeRE, 2011-02-23bRagexeRE, 2011-02-24aRagexeRE, 2011-02-25aRagexeRE, 2011-02-28aRagexeRE, 2011-03-08aRagexeRE, 2011-03-09aRagexeRE, 2011-03-09bRagexeRE, 2011-03-09cRagexeRE, 2011-03-09dRagexeRE, 2011-03-15aRagexeRE, 2011-03-22aRagexeRE, 2011-03-29aRagexeRE, 2011-03-30aRagexeRE, 2011-03-30cRagexeRE, 2011-04-05aRagexeRE, 2011-04-12aRagexeRE, 2011-04-19aRagexeRE, 2011-04-20aRagexeRE, 2011-04-26aRagexeRE, 2011-04-27aRagexeRE, 2011-05-03aRagexeRE, 2011-05-11aRagexeRE, 2011-05-17bRagexeRE, 2011-05-24aRagexeRE, 2011-05-26aRagexeRE, 2011-05-31aRagexeRE, 2011-06-07aRagexeRE, 2011-06-08aRagexeRE, 2011-06-08bRagexeRE, 2011-06-08cRagexeRE, 2011-06-09aRagexeRE, 2011-06-14bRagexeRE, 2011-06-22aRagexeRE, 2011-06-28aRagexeRE, 2011-07-06aRagexeRE, 2011-07-13aRagexeRE, 2011-07-13bRagexeRE, 2011-07-13cRagexeRE, 2011-07-19aRagexeRE, 2011-07-26aRagexeRE, 2011-08-03aRagexeRE, 2011-08-03bRagexeRE, 2011-08-10aRagexeRE, 2013-12-23aRagexeRE, 2014-05-08aRagexe, 2014-05-08aRagexeRE, 2014-06-11eRagexe, 2015-02-25hRagexe, 2018-03-15aRagexe, 2018-03-21aRagexe, 2018-03-21aRagexeRE, 2018-03-28bRagexe, 2018-03-28bRagexeRE, 2018-04-04bRagexe, 2018-04-04cRagexeRE, 2018-04-18aRagexe, 2018-04-18bRagexeRE, 2018-04-25cRagexe, 2018-04-25cRagexeRE, 2018-05-02bRagexe, 2018-05-02bRagexeRE, 2018-05-02dRagexeRE, 2018-05-09aRagexe, 2018-05-16cRagexe, 2018-05-16cRagexeRE, 2018-05-23aRagexe, 2018-05-23aRagexeRE, 2018-05-30aRagexe, 2018-05-30bRagexeRE, 2018-05-30cRagexeRE, 2018-06-05bRagexe, 2018-06-05bRagexeRE, 2018-06-12aRagexeRE, 2018-06-12bRagexeRE, 2018-06-20cRagexe, 2018-06-20dRagexeRE, 2018-06-20eRagexe, 2018-06-20eRagexeRE, 2018-06-21aRagexe, 2018-06-21aRagexeRE, 2018-07-04aRagexe, 2018-07-04aRagexeRE, 2018-07-11aRagexeRE, 2018-07-18bRagexe, 2018-07-18bRagexeRE, 2018-07-18bRagexeRE1, 2018-07-18cRagexe, 2018-07-18cRagexeRE, 2018-08-01cRagexe, 2018-08-01cRagexeRE, 2018-08-08bRagexe, 2018-08-08bRagexeRE, 2018-08-22cRagexe, 2018-08-22cRagexeRE, 2018-08-29aRagexe, 2018-08-29aRagexeRE, 2018-08-29bRagexeRE, 2018-08-31aRagexe, 2018-09-12dRagexe, 2018-09-12dRagexeRE, 2018-09-19aRagexe, 2018-09-19aRagexeRE, 2018-10-02aRagexe, 2018-10-02aRagexeRE, 2018-10-02bRagexe, 2018-10-02bRagexeRE, 2018-10-17_02aRagexe, 2018-10-17_02aRagexeRE, 2018-10-17_03aRagexe, 2018-10-17_03aRagexeRE, 2018-10-17bRagexe, 2018-10-17bRagexeRE, 2018-10-24bRagexe, 2018-10-31aRagexe, 2018-10-31bRagexe, 2018-10-31cRagexeRE, 2018-11-07aRagexe, 2018-11-07aRagexeRE, 2018-11-14cRagexe, 2018-11-14cRagexeRE, 2018-11-14dRagexe, 2018-11-14dRagexeRE, 2018-11-21bRagexe, 2018-11-21cRagexeRE, 2018-11-28aRagexe, 2018-11-28aRagexeRE, 2018-11-28bRagexe, 2018-11-28cRagexe, 2018-12-05aRagexe, 2018-12-05bRagexeRE, 2018-12-12aRagexe, 2018-12-12aRagexeRE, 2018-12-12bRagexe, 2018-12-12bRagexeRE, 2018-12-19bRagexe, 2018-12-19bRagexeRE, 2018-12-26aRagexe, 2018-12-26aRagexeRE, 2019-01-09aRagexe, 2019-01-09bRagexeRE, 2019-01-16bRagexe, 2019-01-16bRagexeRE, 2019-01-16cRagexe, 2019-01-16cRagexeRE, 2019-01-23dRagexe, 2019-01-23dRagexeRE +// 2010-11-23aRagexeRE, 2010-11-24aRagexeRE, 2010-11-24bRagexeRE, 2010-11-25aRagexeRE, 2010-11-26aRagexeRE, 2010-11-30aRagexeRE, 2010-12-07aRagexeRE, 2010-12-14aRagexeRE, 2010-12-21aRagexeRE, 2010-12-23aRagexeRE, 2010-12-28aRagexeRE, 2011-01-04aRagexeRE, 2011-01-05aRagexeRE, 2011-01-11aRagexeRE, 2011-01-18aRagexeRE, 2011-01-25aRagexeRE, 2011-01-26aRagexeRE, 2011-01-26bRagexeRE, 2011-01-31aRagexeRE, 2011-01-31bRagexeRE, 2011-01-31cRagexeRE, 2011-02-08aRagexeRE, 2011-02-15aRagexeRE, 2011-02-22aRagexeRE, 2011-02-23aRagexeRE, 2011-02-23bRagexeRE, 2011-02-24aRagexeRE, 2011-02-25aRagexeRE, 2011-02-28aRagexeRE, 2011-03-08aRagexeRE, 2011-03-09aRagexeRE, 2011-03-09bRagexeRE, 2011-03-09cRagexeRE, 2011-03-09dRagexeRE, 2011-03-15aRagexeRE, 2011-03-22aRagexeRE, 2011-03-29aRagexeRE, 2011-03-30aRagexeRE, 2011-03-30cRagexeRE, 2011-04-05aRagexeRE, 2011-04-12aRagexeRE, 2011-04-19aRagexeRE, 2011-04-20aRagexeRE, 2011-04-26aRagexeRE, 2011-04-27aRagexeRE, 2011-05-03aRagexeRE, 2011-05-11aRagexeRE, 2011-05-17bRagexeRE, 2011-05-24aRagexeRE, 2011-05-26aRagexeRE, 2011-05-31aRagexeRE, 2011-06-07aRagexeRE, 2011-06-08aRagexeRE, 2011-06-08bRagexeRE, 2011-06-08cRagexeRE, 2011-06-09aRagexeRE, 2011-06-14bRagexeRE, 2011-06-22aRagexeRE, 2011-06-28aRagexeRE, 2011-07-06aRagexeRE, 2011-07-13aRagexeRE, 2011-07-13bRagexeRE, 2011-07-13cRagexeRE, 2011-07-19aRagexeRE, 2011-07-26aRagexeRE, 2011-08-03aRagexeRE, 2011-08-03bRagexeRE, 2011-08-10aRagexeRE, 2013-12-23aRagexeRE, 2014-05-08aRagexe, 2014-05-08aRagexeRE, 2014-06-11eRagexe, 2015-02-25hRagexe, 2018-03-15aRagexe, 2018-03-21aRagexe, 2018-03-21aRagexeRE, 2018-03-28bRagexe, 2018-03-28bRagexeRE, 2018-04-04bRagexe, 2018-04-04cRagexeRE, 2018-04-18aRagexe, 2018-04-18bRagexeRE, 2018-04-25cRagexe, 2018-04-25cRagexeRE, 2018-05-02bRagexe, 2018-05-02bRagexeRE, 2018-05-02dRagexeRE, 2018-05-09aRagexe, 2018-05-16cRagexe, 2018-05-16cRagexeRE, 2018-05-23aRagexe, 2018-05-23aRagexeRE, 2018-05-30aRagexe, 2018-05-30bRagexeRE, 2018-05-30cRagexeRE, 2018-06-05bRagexe, 2018-06-05bRagexeRE, 2018-06-12aRagexeRE, 2018-06-12bRagexeRE, 2018-06-20cRagexe, 2018-06-20dRagexeRE, 2018-06-20eRagexe, 2018-06-20eRagexeRE, 2018-06-21aRagexe, 2018-06-21aRagexeRE, 2018-07-04aRagexe, 2018-07-04aRagexeRE, 2018-07-11aRagexeRE, 2018-07-18bRagexe, 2018-07-18bRagexeRE, 2018-07-18bRagexeRE1, 2018-07-18cRagexe, 2018-07-18cRagexeRE, 2018-08-01cRagexe, 2018-08-01cRagexeRE, 2018-08-08bRagexe, 2018-08-08bRagexeRE, 2018-08-22cRagexe, 2018-08-22cRagexeRE, 2018-08-29aRagexe, 2018-08-29aRagexeRE, 2018-08-29bRagexeRE, 2018-08-31aRagexe, 2018-09-12dRagexe, 2018-09-12dRagexeRE, 2018-09-19aRagexe, 2018-09-19aRagexeRE, 2018-10-02aRagexe, 2018-10-02aRagexeRE, 2018-10-02bRagexe, 2018-10-02bRagexeRE, 2018-10-17_02aRagexe, 2018-10-17_02aRagexeRE, 2018-10-17_03aRagexe, 2018-10-17_03aRagexeRE, 2018-10-17bRagexe, 2018-10-17bRagexeRE, 2018-10-24bRagexe, 2018-10-31aRagexe, 2018-10-31bRagexe, 2018-10-31cRagexeRE, 2018-11-07aRagexe, 2018-11-07aRagexeRE, 2018-11-14cRagexe, 2018-11-14cRagexeRE, 2018-11-14dRagexe, 2018-11-14dRagexeRE, 2018-11-21bRagexe, 2018-11-21cRagexeRE, 2018-11-28aRagexe, 2018-11-28aRagexeRE, 2018-11-28bRagexe, 2018-11-28cRagexe, 2018-12-05aRagexe, 2018-12-05bRagexeRE, 2018-12-12aRagexe, 2018-12-12aRagexeRE, 2018-12-12bRagexe, 2018-12-12bRagexeRE, 2018-12-19bRagexe, 2018-12-19bRagexeRE, 2018-12-26aRagexe, 2018-12-26aRagexeRE, 2019-01-09aRagexe, 2019-01-09bRagexeRE, 2019-01-16bRagexe, 2019-01-16bRagexeRE, 2019-01-16cRagexe, 2019-01-16cRagexeRE, 2019-01-23dRagexe, 2019-01-23dRagexeRE, 2019-02-13IRagexeRE, 2019-02-13bRagexe, 2019-02-13eRagexe, 2019-02-20aRagexeRE, 2019-02-27aRagexe, 2019-02-27bRagexeRE, 2019-02-28aRagexe, 2019-02-28aRagexeRE, 2019-03-06bRagexe, 2019-03-06bRagexeRE, 2019-03-06cRagexe, 2019-03-06cRagexeRE #if PACKETVER == 20101123 || \ PACKETVER == 20101124 || \ PACKETVER == 20101125 || \ @@ -135,7 +135,12 @@ PACKETVER == 20181226 || \ PACKETVER == 20190109 || \ PACKETVER == 20190116 || \ - PACKETVER >= 20190123 + PACKETVER == 20190123 || \ + PACKETVER == 20190213 || \ + PACKETVER == 20190220 || \ + PACKETVER == 20190227 || \ + PACKETVER == 20190228 || \ + PACKETVER >= 20190306 packetKeys(0x00000000,0x00000000,0x00000000); #endif diff --git a/src/map/packets_keys_zero.h b/src/map/packets_keys_zero.h index 10b52ae5b..7388c2756 100644 --- a/src/map/packets_keys_zero.h +++ b/src/map/packets_keys_zero.h @@ -30,7 +30,7 @@ /* This file is autogenerated, please do not commit manual changes */ -// 2017-10-18aRagexe_zero, 2017-10-19aRagexe_zero, 2017-10-23aRagexe_zero, 2017-10-23bRagexe_zero, 2017-10-23cRagexe_zero, 2017-10-24aRagexe_2_zero, 2017-10-24aRagexe_zero, 2017-10-25bRagexe_zero, 2017-10-27aRagexe_zero, 2017-10-27bRagexe_zero, 2017-10-30aRagexe_zero, 2017-10-31aRagexe_zero, 2017-11-09aRagexe_zero, 2017-11-13aRagexe_zero, 2017-11-13bRagexe_zero, 2018-03-15aRagexe_zero, 2018-03-21aRagexe_zero, 2018-03-21bRagexe_zero, 2018-03-28_1aRagexe_zero, 2018-03-28cRagexe_zero, 2018-04-11aRagexe_zero, 2018-04-25_3aRagexe_zero, 2018-05-09_3aRagexe_zero, 2018-05-23aRagexe_zero, 2018-06-05bRagexe_zero, 2018-06-05cRagexe_zero, 2018-06-27aRagexe_zero, 2018-07-03aRagexe_zero, 2018-07-11_2aRagexe_zero, 2018-07-25_2aRagexe_zero, 2018-08-01aRagexe_zero, 2018-08-08_2aRagexe_zero, 2018-08-22aRagexe_zero, 2018-08-29aRagexe_zero, 2018-09-05aRagexe_zero, 2018-09-12aRagexe_zero, 2018-09-19aRagexe_zero, 2018-09-28aRagexe_zero, 2018-10-10_2aRagexe_zero, 2018-10-24_2aRagexe_zero, 2018-11-14aRagexe_zero, 2018-11-20aRagexe_zero, 2018-11-28aRagexe_zero, 2018-12-12aRagexe_zero, 2018-12-19aRagexe_zero, 2018-12-26_2aRagexe_zero, 2019-01-16_2aRagexe_zero, 2019-01-17_1aRagexe_zero, 2019-01-30_2aRagexe_zero +// 2017-10-18aRagexe_zero, 2017-10-19aRagexe_zero, 2017-10-23aRagexe_zero, 2017-10-23bRagexe_zero, 2017-10-23cRagexe_zero, 2017-10-24aRagexe_2_zero, 2017-10-24aRagexe_zero, 2017-10-25bRagexe_zero, 2017-10-27aRagexe_zero, 2017-10-27bRagexe_zero, 2017-10-30aRagexe_zero, 2017-10-31aRagexe_zero, 2017-11-09aRagexe_zero, 2017-11-13aRagexe_zero, 2017-11-13bRagexe_zero, 2018-03-15aRagexe_zero, 2018-03-21aRagexe_zero, 2018-03-21bRagexe_zero, 2018-03-28_1aRagexe_zero, 2018-03-28cRagexe_zero, 2018-04-11aRagexe_zero, 2018-04-25_3aRagexe_zero, 2018-05-09_3aRagexe_zero, 2018-05-23aRagexe_zero, 2018-06-05bRagexe_zero, 2018-06-05cRagexe_zero, 2018-06-27aRagexe_zero, 2018-07-03aRagexe_zero, 2018-07-11_2aRagexe_zero, 2018-07-25_2aRagexe_zero, 2018-08-01aRagexe_zero, 2018-08-08_2aRagexe_zero, 2018-08-22aRagexe_zero, 2018-08-29aRagexe_zero, 2018-09-05aRagexe_zero, 2018-09-12aRagexe_zero, 2018-09-19aRagexe_zero, 2018-09-28aRagexe_zero, 2018-10-10_2aRagexe_zero, 2018-10-24_2aRagexe_zero, 2018-11-14aRagexe_zero, 2018-11-20aRagexe_zero, 2018-11-28aRagexe_zero, 2018-12-12aRagexe_zero, 2018-12-19aRagexe_zero, 2018-12-26_2aRagexe_zero, 2019-01-16_2aRagexe_zero, 2019-01-17_1aRagexe_zero, 2019-01-30_2aRagexe_zero, 2019-02-13aRagexe_zero, 2019-02-20aRagexe_zero, 2019-02-27aRagexe_zero #if PACKETVER == 20171018 || \ PACKETVER == 20171019 || \ PACKETVER == 20171023 || \ @@ -71,7 +71,10 @@ PACKETVER == 20181226 || \ PACKETVER == 20190116 || \ PACKETVER == 20190117 || \ - PACKETVER >= 20190130 + PACKETVER == 20190130 || \ + PACKETVER == 20190213 || \ + PACKETVER == 20190220 || \ + PACKETVER >= 20190227 packetKeys(0x00000000,0x00000000,0x00000000); #endif diff --git a/src/map/packets_shuffle_main.h b/src/map/packets_shuffle_main.h index eb6870da0..7af5c579d 100644 --- a/src/map/packets_shuffle_main.h +++ b/src/map/packets_shuffle_main.h @@ -9727,7 +9727,7 @@ packet(0x0967,clif->pSolveCharName,2); // CZ_REQNAME_BYGID // 6 #endif -// 2018-11-21bRagexe, 2018-11-28aRagexe, 2018-11-28bRagexe, 2018-11-28cRagexe, 2018-12-05aRagexe, 2018-12-12aRagexe, 2018-12-12bRagexe, 2018-12-19bRagexe, 2018-12-26aRagexe, 2019-01-09aRagexe, 2019-01-16bRagexe, 2019-01-16cRagexe, 2019-01-23dRagexe +// 2018-11-21bRagexe, 2018-11-28aRagexe, 2018-11-28bRagexe, 2018-11-28cRagexe, 2018-12-05aRagexe, 2018-12-12aRagexe, 2018-12-12bRagexe, 2018-12-19bRagexe, 2018-12-26aRagexe, 2019-01-09aRagexe, 2019-01-16bRagexe, 2019-01-16cRagexe, 2019-01-23dRagexe, 2019-02-13bRagexe, 2019-02-13eRagexe, 2019-02-27aRagexe, 2019-02-28aRagexe, 2019-03-06bRagexe, 2019-03-06cRagexe #if PACKETVER == 20181121 || \ PACKETVER == 20181128 || \ PACKETVER == 20181205 || \ @@ -9736,7 +9736,11 @@ PACKETVER == 20181226 || \ PACKETVER == 20190109 || \ PACKETVER == 20190116 || \ - PACKETVER >= 20190123 + PACKETVER == 20190123 || \ + PACKETVER == 20190213 || \ + PACKETVER == 20190227 || \ + PACKETVER == 20190228 || \ + PACKETVER >= 20190306 packet(0x0202,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS // 26 packet(0x022d,clif->pHomMenu,2,4); // CZ_COMMAND_MER // 5 packet(0x023b,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD // 36 diff --git a/src/map/packets_shuffle_re.h b/src/map/packets_shuffle_re.h index 8d6131560..8aee76bc7 100644 --- a/src/map/packets_shuffle_re.h +++ b/src/map/packets_shuffle_re.h @@ -9663,7 +9663,7 @@ packet(0x083c,clif->pSearchStoreInfoListItemClick,2,6,10); // CZ_SSILIST_ITEM_CLICK // 12 #endif -// 2018-07-04aRagexeRE, 2018-07-11aRagexeRE, 2018-07-18bRagexeRE, 2018-07-18bRagexeRE1, 2018-07-18cRagexeRE, 2018-08-01cRagexeRE, 2018-08-08bRagexeRE, 2018-08-22cRagexeRE, 2018-08-29aRagexeRE, 2018-08-29bRagexeRE, 2018-09-12dRagexeRE, 2018-09-19aRagexeRE, 2018-10-02aRagexeRE, 2018-10-02bRagexeRE, 2018-10-17_02aRagexeRE, 2018-10-17_03aRagexeRE, 2018-10-17bRagexeRE, 2018-10-31cRagexeRE, 2018-11-07aRagexeRE, 2018-11-14cRagexeRE, 2018-11-14dRagexeRE, 2018-11-21cRagexeRE, 2018-11-28aRagexeRE, 2018-12-05bRagexeRE, 2018-12-12aRagexeRE, 2018-12-12bRagexeRE, 2018-12-19bRagexeRE, 2018-12-26aRagexeRE, 2019-01-09bRagexeRE, 2019-01-16bRagexeRE, 2019-01-16cRagexeRE, 2019-01-23dRagexeRE +// 2018-07-04aRagexeRE, 2018-07-11aRagexeRE, 2018-07-18bRagexeRE, 2018-07-18bRagexeRE1, 2018-07-18cRagexeRE, 2018-08-01cRagexeRE, 2018-08-08bRagexeRE, 2018-08-22cRagexeRE, 2018-08-29aRagexeRE, 2018-08-29bRagexeRE, 2018-09-12dRagexeRE, 2018-09-19aRagexeRE, 2018-10-02aRagexeRE, 2018-10-02bRagexeRE, 2018-10-17_02aRagexeRE, 2018-10-17_03aRagexeRE, 2018-10-17bRagexeRE, 2018-10-31cRagexeRE, 2018-11-07aRagexeRE, 2018-11-14cRagexeRE, 2018-11-14dRagexeRE, 2018-11-21cRagexeRE, 2018-11-28aRagexeRE, 2018-12-05bRagexeRE, 2018-12-12aRagexeRE, 2018-12-12bRagexeRE, 2018-12-19bRagexeRE, 2018-12-26aRagexeRE, 2019-01-09bRagexeRE, 2019-01-16bRagexeRE, 2019-01-16cRagexeRE, 2019-01-23dRagexeRE, 2019-02-13IRagexeRE, 2019-02-20aRagexeRE, 2019-02-27bRagexeRE, 2019-02-28aRagexeRE, 2019-03-06bRagexeRE, 2019-03-06cRagexeRE #if PACKETVER == 20180704 || \ PACKETVER == 20180711 || \ PACKETVER == 20180718 || \ @@ -9686,7 +9686,12 @@ PACKETVER == 20181226 || \ PACKETVER == 20190109 || \ PACKETVER == 20190116 || \ - PACKETVER >= 20190123 + PACKETVER == 20190123 || \ + PACKETVER == 20190213 || \ + PACKETVER == 20190220 || \ + PACKETVER == 20190227 || \ + PACKETVER == 20190228 || \ + PACKETVER >= 20190306 packet(0x0202,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS // 26 packet(0x022d,clif->pHomMenu,2,4); // CZ_COMMAND_MER // 5 packet(0x023b,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD // 36 diff --git a/src/map/packets_shuffle_zero.h b/src/map/packets_shuffle_zero.h index 4e1a78c3e..3e83ae299 100644 --- a/src/map/packets_shuffle_zero.h +++ b/src/map/packets_shuffle_zero.h @@ -742,7 +742,7 @@ packet(0x0968,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD // 36 #endif -// 2018-11-14aRagexe_zero, 2018-11-20aRagexe_zero, 2018-11-28aRagexe_zero, 2018-12-12aRagexe_zero, 2018-12-19aRagexe_zero, 2018-12-26_2aRagexe_zero, 2019-01-16_2aRagexe_zero, 2019-01-17_1aRagexe_zero, 2019-01-30_2aRagexe_zero +// 2018-11-14aRagexe_zero, 2018-11-20aRagexe_zero, 2018-11-28aRagexe_zero, 2018-12-12aRagexe_zero, 2018-12-19aRagexe_zero, 2018-12-26_2aRagexe_zero, 2019-01-16_2aRagexe_zero, 2019-01-17_1aRagexe_zero, 2019-01-30_2aRagexe_zero, 2019-02-13aRagexe_zero, 2019-02-20aRagexe_zero, 2019-02-27aRagexe_zero #if PACKETVER == 20181114 || \ PACKETVER == 20181120 || \ PACKETVER == 20181128 || \ @@ -751,7 +751,10 @@ PACKETVER == 20181226 || \ PACKETVER == 20190116 || \ PACKETVER == 20190117 || \ - PACKETVER >= 20190130 + PACKETVER == 20190130 || \ + PACKETVER == 20190213 || \ + PACKETVER == 20190220 || \ + PACKETVER >= 20190227 packet(0x0202,clif->pFriendsListAdd,2); // CZ_ADD_FRIENDS // 26 packet(0x022d,clif->pHomMenu,2,4); // CZ_COMMAND_MER // 5 packet(0x023b,clif->pStoragePassword,0); // CZ_ACK_STORE_PASSWORD // 36 diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 2339935ec..42b11b718 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -3111,7 +3111,7 @@ struct PACKET_CZ_NPC_BARTER_PURCHASE { DEFINE_PACKET_HEADER(CZ_NPC_BARTER_PURCHASE, 0x0b0f); #endif -#if PACKETVER_ZERO_NUM >= 20190130 +#if PACKETVER_MAIN_NUM >= 20181212 || PACKETVER_RE_NUM >= 20181212 || PACKETVER_ZERO_NUM >= 20190130 struct PACKET_ZC_USESKILL_ACK { int16 packetType; uint32 srcId; diff --git a/src/map/script.c b/src/map/script.c index 51d7ebe3b..bba559df8 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -11095,6 +11095,21 @@ static BUILDIN(killmonsterall) return true; } +static BUILDIN(killmonstergid) +{ + int mobgid = script_getnum(st, 2); + struct mob_data *md = map->id2md(mobgid); + + if (md == NULL) { + ShowWarning("buildin_killmonstergid: Error in finding monster GID '%d' or the target is not a monster.\n", mobgid); + return false; + } + + md->state.npc_killmonster = 1; + status_kill(&md->bl); + return true; +} + /*========================================== * Creates a clone of a player. * clone map, x, y, event, char_id, master_id, mode, flag, duration @@ -11730,6 +11745,18 @@ static BUILDIN(playerattached) } /*========================================== + * Used by OnTouchNPC: label to return monster GID + *------------------------------------------*/ +static BUILDIN(mobattached) +{ + if (st->rid == 0 || map->id2md(st->rid) == NULL) + script_pushint(st, 0); + else + script_pushint(st, st->rid); + return true; +} + +/*========================================== *------------------------------------------*/ static BUILDIN(announce) { @@ -15613,20 +15640,15 @@ static BUILDIN(gethominfo) return true; } -/// Retrieves information about character's mercenary -/// getmercinfo <type>[,<char id>]; +/* + * Retrieves information about character's mercenary + * getmercinfo <type>{, <char id> }; + */ static BUILDIN(getmercinfo) { - int type; - struct map_session_data* sd; - struct mercenary_data* md; - - type = script_getnum(st,2); - - if (script_hasdata(st,3)) { - int char_id = script_getnum(st,3); - - if ((sd = script->charid2sd(st, char_id)) == NULL) { + struct map_session_data *sd; + if (script_hasdata(st, 3)) { + if ((sd = script->charid2sd(st, script_getnum(st, 3))) == NULL) { script_pushnil(st); return true; } @@ -15635,27 +15657,48 @@ static BUILDIN(getmercinfo) return true; } - md = ( sd->status.mer_id && sd->md ) ? sd->md : NULL; + struct mercenary_data *md = (sd->status.mer_id && sd->md)? sd->md : NULL; + int type = script_getnum(st, 2); + if (md == NULL) { + if (type == MERCINFO_NAME) + script_pushconststr(st, ""); + else + script_pushint(st, 0); + return true; + } - switch( type ) - { - case 0: script_pushint(st,md ? md->mercenary.mercenary_id : 0); break; - case 1: script_pushint(st,md ? md->mercenary.class_ : 0); break; - case 2: - if( md ) - script_pushstrcopy(st,md->db->name); - else - script_pushconststr(st,""); - break; - case 3: script_pushint(st,md ? mercenary->get_faith(md) : 0); break; - case 4: script_pushint(st,md ? mercenary->get_calls(md) : 0); break; - case 5: script_pushint(st,md ? md->mercenary.kill_count : 0); break; - case 6: script_pushint(st,md ? mercenary->get_lifetime(md) : 0); break; - case 7: script_pushint(st,md ? md->db->lv : 0); break; - default: - ShowError("buildin_getmercinfo: Invalid type %d (char_id=%d).\n", type, sd->status.char_id); - script_pushnil(st); - return false; + switch (type) { + case MERCINFO_ID: + script_pushint(st, md->mercenary.mercenary_id); + break; + case MERCINFO_CLASS: + script_pushint(st, md->mercenary.class_); + break; + case MERCINFO_NAME: + script_pushstrcopy(st, md->db->name); + break; + case MERCINFO_FAITH: + script_pushint(st, mercenary->get_faith(md)); + break; + case MERCINFO_CALLS: + script_pushint(st, mercenary->get_calls(md)); + break; + case MERCINFO_KILLCOUNT: + script_pushint(st, md->mercenary.kill_count); + break; + case MERCINFO_LIFETIME: + script_pushint(st, mercenary->get_lifetime(md)); + break; + case MERCINFO_LEVEL: + script_pushint(st, md->db->lv); + break; + case MERCINFO_GID: + script_pushint(st, md->bl.id); + break; + default: + ShowError("buildin_getmercinfo: Invalid type %d (char_id=%d).\n", type, sd->status.char_id); + script_pushnil(st); + return false; } return true; @@ -18636,6 +18679,10 @@ static BUILDIN(getunittype) * @param4 Value#2 Optional int value to be passed for certain data types. * @param5 Value#3 Optional int value to be passed for certain data types. * @return 1 on success, 0 on failure. + + Note: Please make this script command only modify ONE INTEGER value. + If need to modify string type data, or having multiple arguments, please + introduce a new script command. */ static BUILDIN(setunitdata) { @@ -18661,7 +18708,7 @@ static BUILDIN(setunitdata) return false; } - /* Mandatory Argument 3 */ + /* Mandatory Argument 3. Subject to deprecate. */ if (type == UDT_MAPIDXY) { if (!script_isstringtype(st, 4)) { ShowError("buildin_setunitdata: Invalid data type for argument #3.\n"); @@ -19753,6 +19800,10 @@ static BUILDIN(setunitdata) * @param2 DataType Type of Data to be set for the unit. * @param3 Variable array reference to store data into. (used for UDT_MAPIDXY) * @return 0 on failure, <value> on success + + Note: Please make this script command only return ONE INTEGER value. + If the unit data having multiple arguments, or need to return in array, + please introduce a new script command. */ static BUILDIN(getunitdata) { @@ -19780,7 +19831,7 @@ static BUILDIN(getunitdata) return false; } - /* Argument checks */ + /* Argument checks. Subject to deprecate */ if (type == UDT_MAPIDXY) { if (data == NULL || !data_isreference(data)) { ShowWarning("buildin_getunitdata: Error in argument 3. Please provide a reference variable to store values in.\n"); @@ -23687,7 +23738,7 @@ static BUILDIN(bg_create_team) if( strcmp(map_name,"-") != 0 ) { map_index = script->mapindexname2id(st,map_name); if( map_index == 0 ) { // Invalid Map - script_pushint(st,0); + script_pushint(st, -1); return true; } } @@ -25338,6 +25389,7 @@ static void script_parse_builtin(void) BUILDIN_DEF(areamonster,"siiiisii???"), BUILDIN_DEF(killmonster,"ss?"), BUILDIN_DEF(killmonsterall,"s?"), + BUILDIN_DEF(killmonstergid, "i"), BUILDIN_DEF(clone,"siisi????"), BUILDIN_DEF(doevent,"s"), BUILDIN_DEF(donpcevent,"s"), @@ -25354,6 +25406,7 @@ static void script_parse_builtin(void) BUILDIN_DEF(attachnpctimer,"?"), // attached the player id to the npc timer [Celest] BUILDIN_DEF(detachnpctimer,"?"), // detached the player id from the npc timer [Celest] BUILDIN_DEF(playerattached,""), // returns id of the current attached player. [Skotlex] + BUILDIN_DEF(mobattached, ""), BUILDIN_DEF(announce,"si?????"), BUILDIN_DEF(mapannounce,"ssi?????"), BUILDIN_DEF(areaannounce,"siiiisi?????"), @@ -25845,6 +25898,8 @@ static void script_hardcoded_constants(void) script->set_constant("MAX_REFINE",MAX_REFINE,false, false); script->set_constant("MAX_MENU_OPTIONS", MAX_MENU_OPTIONS, false, false); script->set_constant("MAX_MENU_LENGTH", MAX_MENU_LENGTH, false, false); + script->set_constant("MOB_CLONE_START", MOB_CLONE_START, false, false); + script->set_constant("MOB_CLONE_END", MOB_CLONE_END, false, false); script->constdb_comment("status options"); script->set_constant("Option_Nothing",OPTION_NOTHING,false, false); @@ -26116,6 +26171,17 @@ static void script_hardcoded_constants(void) script->set_constant("ITEMINFO_VIEWSPRITE", ITEMINFO_VIEWSPRITE, false, false); script->set_constant("ITEMINFO_TRADE", ITEMINFO_TRADE, false, false); + script->constdb_comment("getmercinfo options"); + script->set_constant("MERCINFO_ID,", MERCINFO_ID, false, false); + script->set_constant("MERCINFO_CLASS", MERCINFO_CLASS, false, false); + script->set_constant("MERCINFO_NAME", MERCINFO_NAME, false, false); + script->set_constant("MERCINFO_FAITH", MERCINFO_FAITH, false, false); + script->set_constant("MERCINFO_CALLS", MERCINFO_CALLS, false, false); + script->set_constant("MERCINFO_KILLCOUNT", MERCINFO_KILLCOUNT, false, false); + script->set_constant("MERCINFO_LIFETIME", MERCINFO_LIFETIME, false, false); + script->set_constant("MERCINFO_LEVEL", MERCINFO_LEVEL, false, false); + script->set_constant("MERCINFO_GID", MERCINFO_GID, false, false); + script->constdb_comment("monster skill states"); script->set_constant("MSS_ANY", MSS_ANY, false, false); script->set_constant("MSS_IDLE", MSS_IDLE, false, false); diff --git a/src/map/script.h b/src/map/script.h index 549ad3284..54c5aad2a 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -461,6 +461,23 @@ enum script_iteminfo_types { }; /** + * Mercenary Info types. + */ +enum script_mercinfo_types { + MERCINFO_ID = 0, + MERCINFO_CLASS, + MERCINFO_NAME, + MERCINFO_FAITH, + MERCINFO_CALLS, + MERCINFO_KILLCOUNT, + MERCINFO_LIFETIME, + MERCINFO_LEVEL, + MERCINFO_GID, + + MERCINFO_MAX +}; + +/** * Player blocking actions related flags. */ enum pcblock_action_flag { diff --git a/src/map/skill.c b/src/map/skill.c index 069db55df..633a73d67 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -2892,14 +2892,16 @@ static int skill_attack(int attack_type, struct block_list *src, struct block_li } #endif /* MAGIC_REFLECTION_TYPE */ } - if(sc && sc->data[SC_MAGICROD] && src == dsrc) { - int sp = skill->get_sp(skill_id,skill_lv); + if (sc && sc->data[SC_MAGICROD] && src == dsrc) { + int sp = skill->get_sp(skill_id, skill_lv); dmg.damage = dmg.damage2 = 0; dmg.dmg_lv = ATK_MISS; //This will prevent skill additional effect from taking effect. [Skotlex] sp = sp * sc->data[SC_MAGICROD]->val2 / 100; - if(skill_id == WZ_WATERBALL && skill_lv > 1) - sp = sp/((skill_lv|1)*(skill_lv|1)); //Estimate SP cost of a single water-ball + if (skill_id == WZ_WATERBALL && skill_lv > 1) + sp = sp / ((skill_lv | 1) * (skill_lv | 1)); //Estimate SP cost of a single water-ball status->heal(bl, 0, sp, STATUS_HEAL_SHOWEFFECT); + if (battle->bc->magicrod_type == 1) + clif->skill_nodamage(bl, bl, SA_MAGICROD, sc->data[SC_MAGICROD]->val1, 1); // Animation used here in eAthena [Wolfie] } } @@ -7881,8 +7883,9 @@ static int skill_castend_nodamage_id(struct block_list *src, struct block_list * } break; case SA_MAGICROD: - clif->skill_nodamage(src,src,SA_MAGICROD,skill_lv,1); - sc_start(src,bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)); + if (battle->bc->magicrod_type == 0) + clif->skill_nodamage(src, src, SA_MAGICROD, skill_lv, 1); // Animation used here in official [Wolfie] + sc_start(src, bl, type, 100, skill_lv, skill->get_time(skill_id, skill_lv)); break; case SA_AUTOSPELL: clif->skill_nodamage(src,bl,skill_id,skill_lv,1); diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 7cc5ef2b1..c764d0290 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -7538,6 +7538,8 @@ typedef void (*HPMHOOK_pre_sockt_flush) (int *fd); typedef void (*HPMHOOK_post_sockt_flush) (int fd); typedef void (*HPMHOOK_pre_sockt_flush_fifos) (void); typedef void (*HPMHOOK_post_sockt_flush_fifos) (void); +typedef int (*HPMHOOK_pre_sockt_connect_client) (int *listen_fd); +typedef int (*HPMHOOK_post_sockt_connect_client) (int retVal___, int listen_fd); typedef void (*HPMHOOK_pre_sockt_set_nonblocking) (int *fd, unsigned long *yes); typedef void (*HPMHOOK_post_sockt_set_nonblocking) (int fd, unsigned long yes); typedef void (*HPMHOOK_pre_sockt_set_defaultparse) (ParseFunc *defaultparse); diff --git a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc index a8b4860f3..dbabf8ed4 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc @@ -1422,6 +1422,8 @@ struct { struct HPMHookPoint *HP_sockt_flush_post; struct HPMHookPoint *HP_sockt_flush_fifos_pre; struct HPMHookPoint *HP_sockt_flush_fifos_post; + struct HPMHookPoint *HP_sockt_connect_client_pre; + struct HPMHookPoint *HP_sockt_connect_client_post; struct HPMHookPoint *HP_sockt_set_nonblocking_pre; struct HPMHookPoint *HP_sockt_set_nonblocking_post; struct HPMHookPoint *HP_sockt_set_defaultparse_pre; @@ -3059,6 +3061,8 @@ struct { int HP_sockt_flush_post; int HP_sockt_flush_fifos_pre; int HP_sockt_flush_fifos_post; + int HP_sockt_connect_client_pre; + int HP_sockt_connect_client_post; int HP_sockt_set_nonblocking_pre; int HP_sockt_set_nonblocking_post; int HP_sockt_set_defaultparse_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc index 56c5bcfb7..f666ad1fd 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc @@ -758,6 +758,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(sockt->session_is_active, HP_sockt_session_is_active) }, { HP_POP(sockt->flush, HP_sockt_flush) }, { HP_POP(sockt->flush_fifos, HP_sockt_flush_fifos) }, + { HP_POP(sockt->connect_client, HP_sockt_connect_client) }, { HP_POP(sockt->set_nonblocking, HP_sockt_set_nonblocking) }, { HP_POP(sockt->set_defaultparse, HP_sockt_set_defaultparse) }, { HP_POP(sockt->host2ip, HP_sockt_host2ip) }, diff --git a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc index 0bd61ba15..edffe7c11 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc @@ -18686,6 +18686,33 @@ void HP_sockt_flush_fifos(void) { } return; } +int HP_sockt_connect_client(int listen_fd) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_sockt_connect_client_pre > 0) { + int (*preHookFunc) (int *listen_fd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_connect_client_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_sockt_connect_client_pre[hIndex].func; + retVal___ = preHookFunc(&listen_fd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.sockt.connect_client(listen_fd); + } + if (HPMHooks.count.HP_sockt_connect_client_post > 0) { + int (*postHookFunc) (int retVal___, int listen_fd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_connect_client_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_sockt_connect_client_post[hIndex].func; + retVal___ = postHookFunc(retVal___, listen_fd); + } + } + return retVal___; +} void HP_sockt_set_nonblocking(int fd, unsigned long yes) { int hIndex = 0; if (HPMHooks.count.HP_sockt_set_nonblocking_pre > 0) { diff --git a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc index 7293e8fc4..ba0fe05c2 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc @@ -584,6 +584,8 @@ struct { struct HPMHookPoint *HP_sockt_flush_post; struct HPMHookPoint *HP_sockt_flush_fifos_pre; struct HPMHookPoint *HP_sockt_flush_fifos_post; + struct HPMHookPoint *HP_sockt_connect_client_pre; + struct HPMHookPoint *HP_sockt_connect_client_post; struct HPMHookPoint *HP_sockt_set_nonblocking_pre; struct HPMHookPoint *HP_sockt_set_nonblocking_post; struct HPMHookPoint *HP_sockt_set_defaultparse_pre; @@ -1383,6 +1385,8 @@ struct { int HP_sockt_flush_post; int HP_sockt_flush_fifos_pre; int HP_sockt_flush_fifos_post; + int HP_sockt_connect_client_pre; + int HP_sockt_connect_client_post; int HP_sockt_set_nonblocking_pre; int HP_sockt_set_nonblocking_post; int HP_sockt_set_defaultparse_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc index 825e049b1..1e3548621 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.HookingPoints.inc @@ -326,6 +326,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(sockt->session_is_active, HP_sockt_session_is_active) }, { HP_POP(sockt->flush, HP_sockt_flush) }, { HP_POP(sockt->flush_fifos, HP_sockt_flush_fifos) }, + { HP_POP(sockt->connect_client, HP_sockt_connect_client) }, { HP_POP(sockt->set_nonblocking, HP_sockt_set_nonblocking) }, { HP_POP(sockt->set_defaultparse, HP_sockt_set_defaultparse) }, { HP_POP(sockt->host2ip, HP_sockt_host2ip) }, diff --git a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc index 044ee2df2..080fb75ff 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc @@ -7495,6 +7495,33 @@ void HP_sockt_flush_fifos(void) { } return; } +int HP_sockt_connect_client(int listen_fd) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_sockt_connect_client_pre > 0) { + int (*preHookFunc) (int *listen_fd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_connect_client_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_sockt_connect_client_pre[hIndex].func; + retVal___ = preHookFunc(&listen_fd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.sockt.connect_client(listen_fd); + } + if (HPMHooks.count.HP_sockt_connect_client_post > 0) { + int (*postHookFunc) (int retVal___, int listen_fd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_connect_client_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_sockt_connect_client_post[hIndex].func; + retVal___ = postHookFunc(retVal___, listen_fd); + } + } + return retVal___; +} void HP_sockt_set_nonblocking(int fd, unsigned long yes) { int hIndex = 0; if (HPMHooks.count.HP_sockt_set_nonblocking_pre > 0) { diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index b323d77e6..70604ff9e 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -6042,6 +6042,8 @@ struct { struct HPMHookPoint *HP_sockt_flush_post; struct HPMHookPoint *HP_sockt_flush_fifos_pre; struct HPMHookPoint *HP_sockt_flush_fifos_post; + struct HPMHookPoint *HP_sockt_connect_client_pre; + struct HPMHookPoint *HP_sockt_connect_client_post; struct HPMHookPoint *HP_sockt_set_nonblocking_pre; struct HPMHookPoint *HP_sockt_set_nonblocking_post; struct HPMHookPoint *HP_sockt_set_defaultparse_pre; @@ -12711,6 +12713,8 @@ struct { int HP_sockt_flush_post; int HP_sockt_flush_fifos_pre; int HP_sockt_flush_fifos_post; + int HP_sockt_connect_client_pre; + int HP_sockt_connect_client_post; int HP_sockt_set_nonblocking_pre; int HP_sockt_set_nonblocking_post; int HP_sockt_set_defaultparse_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 3c09aba59..f081fd520 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -3089,6 +3089,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(sockt->session_is_active, HP_sockt_session_is_active) }, { HP_POP(sockt->flush, HP_sockt_flush) }, { HP_POP(sockt->flush_fifos, HP_sockt_flush_fifos) }, + { HP_POP(sockt->connect_client, HP_sockt_connect_client) }, { HP_POP(sockt->set_nonblocking, HP_sockt_set_nonblocking) }, { HP_POP(sockt->set_defaultparse, HP_sockt_set_defaultparse) }, { HP_POP(sockt->host2ip, HP_sockt_host2ip) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 8242b9797..d18b4f360 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -80816,6 +80816,33 @@ void HP_sockt_flush_fifos(void) { } return; } +int HP_sockt_connect_client(int listen_fd) { + int hIndex = 0; + int retVal___ = 0; + if (HPMHooks.count.HP_sockt_connect_client_pre > 0) { + int (*preHookFunc) (int *listen_fd); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_connect_client_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_sockt_connect_client_pre[hIndex].func; + retVal___ = preHookFunc(&listen_fd); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.sockt.connect_client(listen_fd); + } + if (HPMHooks.count.HP_sockt_connect_client_post > 0) { + int (*postHookFunc) (int retVal___, int listen_fd); + for (hIndex = 0; hIndex < HPMHooks.count.HP_sockt_connect_client_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_sockt_connect_client_post[hIndex].func; + retVal___ = postHookFunc(retVal___, listen_fd); + } + } + return retVal___; +} void HP_sockt_set_nonblocking(int fd, unsigned long yes) { int hIndex = 0; if (HPMHooks.count.HP_sockt_set_nonblocking_pre > 0) { diff --git a/tools/ci/travis.sh b/tools/ci/travis.sh index fa7d5be93..22f523bdf 100755 --- a/tools/ci/travis.sh +++ b/tools/ci/travis.sh @@ -47,7 +47,8 @@ function aborterror { function run_server { echo "Running: $1 --run-once $2" - $1 --run-once $2 2>runlog.txt + rm -rf core* || true + CRASH_PLEASE=1 $1 --run-once $2 2>runlog.txt export errcode=$? export teststr=$(head -c 10000 runlog.txt) if [[ -n "${teststr}" ]]; then @@ -59,12 +60,17 @@ function run_server { fi if [ ${errcode} -ne 0 ]; then echo "server $1 terminated with exit code ${errcode}" + COREFILE=$(find . -maxdepth 1 -name "core*" | head -n 1) + if [[ -f "$COREFILE" ]]; then + gdb -c "$COREFILE" $1 -ex "thread apply all bt" -ex "set pagination 0" -batch + fi aborterror "Test failed" fi } function run_test { echo "Running: test_$1" + sysctl -w kernel.core_pattern=core || true ./test_$1 2>runlog.txt export errcode=$? export teststr=$(head -c 10000 runlog.txt) |