Skip to content
Merged
Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
fabfaf5
Add incomplete packet CA_ACK_MOBILE_OTP.
4144 Nov 15, 2018
602ea2b
Add packet AC_REQ_MOBILE_OTP
4144 Nov 15, 2018
6bf44bf
Add support for int32 item id fields in zero client 20181114.
4144 Nov 15, 2018
8546268
Add incomplete packet CA_OTP_CODE.
4144 Nov 15, 2018
87d4d4f
Change max packet version in travis to 2018-12-12.
4144 Nov 15, 2018
6988272
Rename defines PACKET_ID_* to HEADER_*
4144 Nov 15, 2018
175de7f
Rename structs packet_* into PACKET_*
4144 Nov 15, 2018
5964302
Update HPM.
4144 Nov 15, 2018
6343c26
Move packets struct in login server into separate files for AC and CA…
4144 Nov 15, 2018
619dcd4
Increase default value for MAX_PACKET_LOGIN_DB to 0xad0
4144 Nov 15, 2018
af9e75a
Add validation for buffer size in char_mmo_char_tobuf.
4144 Nov 15, 2018
172734f
Fix some visual studio warnings.
4144 Nov 15, 2018
7c87e5c
Fix packet ZC_CLANINFO.
4144 Nov 19, 2018
c301b64
Update packet len table up to 2018-12-12
4144 Nov 21, 2018
1ebdcdb
Update keys up to 2018-12-12
4144 Nov 21, 2018
0d8f2fb
Update shuffle packets up to 2018-12-12
4144 Nov 21, 2018
b5c5728
Update messages up to 2018-12-12
4144 Nov 21, 2018
30cf149
Add support for 4 bytes item id fields in main clients.
4144 Nov 21, 2018
1f7f901
Update packet AC_LOGIN_OTP.
4144 Nov 24, 2018
c76f8de
Add packet ZC_ENCHANT_EQUIPMENT
4144 Nov 24, 2018
2d33d76
Add script command for insert cards into equipped items.
4144 Nov 24, 2018
15f51b3
Add some missing checks for inventory index variable.
4144 Nov 24, 2018
a3b6618
Add missing enum values into roulette generate ack packet.
4144 Nov 26, 2018
cde8cf6
Use enum OPEN_ROULETTE_ACK in roulette open ack packet.
4144 Nov 26, 2018
d9c56ea
Fix packet ZC_PROPERTY_HOMUN for old clients.
4144 Nov 26, 2018
5c29241
Add packet ZC_SERVICE_MESSAGE_COLOR
4144 Nov 27, 2018
eaeebdc
Add script command servicemessage.
4144 Nov 27, 2018
b014306
Update packet ZC_AUTOSPELLLIST
4144 Nov 28, 2018
8303cb0
Update HPM
4144 Nov 28, 2018
63f57fa
Remove typedef from clr_type.
4144 Nov 28, 2018
9a454fc
Fix issue with chars list if number of chars is 3*N chars.
4144 Nov 30, 2018
14b5d30
Update HPM
4144 Nov 28, 2018
22c267c
Add packet CZ_START_USE_SKILL
4144 Dec 1, 2018
d50e10c
Add packet CZ_STOP_USE_SKILL
4144 Dec 1, 2018
57090ac
Add missing result values for packet ZC_PC_PURCHASE_RESULT
4144 Dec 5, 2018
8e1e7ee
Add ifdefs for packet limits defines in lclif.p.h
4144 Dec 5, 2018
c34b4fb
Add packt ZC_INVENTORY_EXPANSION_INFO
4144 Dec 13, 2018
aee153a
Add packet ZC_ACK_INVENTORY_EXPAND
4144 Dec 13, 2018
52fab52
Add packet ZC_ACK_INVENTORY_EXPAND_RESULT
4144 Dec 13, 2018
60a0381
Add packet CZ_INVENTORY_EXPAND
4144 Dec 13, 2018
392c598
Add packet CZ_INVENTORY_EXPAND_CONFIRMED
4144 Dec 13, 2018
1a26402
Add packet CZ_INVENTORY_EXPAND_REJECTED
4144 Dec 13, 2018
bc68262
Add inventory size field into db and using it in server.
4144 Dec 13, 2018
d17b517
Add script command expandInventoryAck
4144 Dec 14, 2018
16f3fe4
Add script command expandInventoryResult.
4144 Dec 14, 2018
c79927b
Add script command expandInventory
4144 Dec 14, 2018
ec05dcc
Add script command getInventorySize.
4144 Dec 14, 2018
2c8e11b
Add additional checks into CZ_INVENTORY_EXPAND and CZ_INVENTORY_EXPAN…
4144 Dec 14, 2018
4194f0a
Add script and item for inventory expansion.
4144 Dec 14, 2018
59eb8ed
Add packet CZ_REQ_REMAINTIME (with empty handler)
4144 Dec 14, 2018
6f3eb86
Update HPM.
4144 Dec 14, 2018
95c8d07
Improve packet ZC_NPC_MARKET_OPEN
4144 Dec 15, 2018
08d9a2d
Update HPM.
4144 Dec 15, 2018
a0f8fc8
Update packet ZC_CAMERA_INFO to new format.
4144 Dec 16, 2018
912bbff
Add packet CZ_CAMERA_INFO
4144 Dec 16, 2018
46521f3
Add aliases for at command camerainfo: setcamera and viewpointvalue.
4144 Dec 16, 2018
69c9054
Fix and update packet CZ_PARTY_CONFIG.
4144 Dec 16, 2018
ad608a2
Add missing values into enum cz_ui_types
4144 Dec 16, 2018
4b2e868
Update HPM.
4144 Dec 16, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ matrix:
- compiler: false
include:
- compiler: gcc
env: LDFLAGS="-fuse-ld=gold" CONFIGURE_FLAGS="--enable-debug CC=gcc-6 --disable-manager --enable-Werror --enable-packetver=20181031 --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=20181212 --enable-packetver-re --enable-buildbot" HPM="1"
addons:
apt:
sources:
Expand All @@ -50,7 +50,7 @@ matrix:
- libxml-sax-perl
- libxml-parser-perl
- compiler: clang
env: CONFIGURE_FLAGS="--enable-debug CC=clang-5.0 --enable-Werror --enable-packetver=20181031 --enable-packetver-re --enable-buildbot"
env: CONFIGURE_FLAGS="--enable-debug CC=clang-5.0 --enable-Werror --enable-packetver=20181212 --enable-packetver-re --enable-buildbot"
addons:
apt:
sources:
Expand All @@ -68,7 +68,7 @@ matrix:
packages:
- clang-5.0
- compiler: clang
env: CONFIGURE_FLAGS="--enable-debug CC=clang-4.0 --enable-Werror --enable-packetver=20181031 --enable-packetver-re --enable-buildbot"
env: CONFIGURE_FLAGS="--enable-debug CC=clang-4.0 --enable-Werror --enable-packetver=20181212 --enable-packetver-re --enable-buildbot"
addons:
apt:
sources:
Expand All @@ -90,11 +90,11 @@ matrix:
- compiler: clang
env: CONFIGURE_FLAGS="--enable-debug --disable-renewal --enable-Werror --enable-buildbot"
- compiler: gcc
env: CONFIGURE_FLAGS="--enable-debug --enable-Werror --enable-packetver=20181031 --enable-packetver-re --enable-buildbot"
env: CONFIGURE_FLAGS="--enable-debug --enable-Werror --enable-packetver=20181212 --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=20181031 --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=20181212 --enable-packetver-re --enable-buildbot"
addons:
apt:
sources:
Expand All @@ -110,7 +110,7 @@ matrix:
packages:
- 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=20181031 --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=20181212 --enable-packetver-re --enable-buildbot"
addons:
apt:
sources:
Expand Down
3 changes: 3 additions & 0 deletions db/constants.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4045,4 +4045,7 @@ constants_db: {
ACH_PET_CREATE: 43
ACH_ACHIEVE: 44
ACH_ACHIEVEMENT_RANK: 45

comment__: "inventory expansion"
INVENTORY_INCREASE_STEP: 10
}
5 changes: 5 additions & 0 deletions db/pre-re/item_db.conf
Original file line number Diff line number Diff line change
Expand Up @@ -96533,6 +96533,11 @@ item_db: (
AegisName: "GH_Cursed_Gemstone"
Name: "GH_Cursed_Gemstone"
},
{
Id: 25793
AegisName: "Inventory_Extension_Coupon"
Name: "Inventory_Extension_Coupon"
},
{
Id: 26007
AegisName: "Spectral_Spear_IL"
Expand Down
5 changes: 5 additions & 0 deletions db/re/item_db.conf
Original file line number Diff line number Diff line change
Expand Up @@ -152332,6 +152332,11 @@ item_db: (
AegisName: "GH_Cursed_Gemstone"
Name: "GH_Cursed_Gemstone"
},
{
Id: 25793
AegisName: "Inventory_Extension_Coupon"
Name: "Inventory_Extension_Coupon"
},
{
Id: 26007
AegisName: "Spectral_Spear_IL"
Expand Down
77 changes: 77 additions & 0 deletions doc/script_commands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10237,3 +10237,80 @@ Update already opened preview window with item from
Works for 20181017 RE and main clients or newer.

---------------------------------------

*enchantitem(<equip_pos>, <card_slot>, <card_id>);

Insert card into equipped item in EQI_* slot.
card_slot - can be 0 to 3.
card_id - any card item id.

returns true if all parameters correct
false in other case.
Works for 20160831 main, 20151118 RE, any zero version

---------------------------------------

*servicemessage("<message>", <color>{, <account_id>})
*servicemessage("<message>", <color>{, <player_name>})

That command will send a service message to the chat window of the character
specified by account ID or name, or to connected to npc player.
It will not be seen by anyone else.

Works for 20170830 RE and main and for any zero clients

---------------------------------------

*expandInventoryAck(<result>{, <itemId>})

Send initial inventory expansion result.
Normally this function should be called from script label
inventory_expansion::OnInventoryExpandRequest.

Valid result statuses:
EXPAND_INVENTORY_ASK_CONFIRMATION - force client to ask player about inventory expansion
EXPAND_INVENTORY_FAILED - other failed reason
EXPAND_INVENTORY_OTHER_WORK - failed because player busy with other work
EXPAND_INVENTORY_MISSING_ITEM - failed because missing item
EXPAND_INVENTORY_MAX_SIZE - failed because inventory size already maximum

ItemId make sense only if result is EXPAND_INVENTORY_ASK_CONFIRMATION
Works for 20181212 zero clients

---------------------------------------

*expandInventoryResult(<result>)

Send final inventory expansion result.
Normally this function should be called from script label
inventory_expansion::OnInventoryExpandConfirmed.

Valid result values:
EXPAND_INVENTORY_RESULT_SUCCESS - success message
EXPAND_INVENTORY_RESULT_FAILED - other failed reason
EXPAND_INVENTORY_RESULT_OTHER_WORK - failed because player busy with other work
EXPAND_INVENTORY_RESULT_MISSING_ITEM - failed because missing item
EXPAND_INVENTORY_RESULT_MAX_SIZE - failed because inventory size already maximum

Works for 20181212 zero clients

---------------------------------------

*expandInventory(<value>)

Adjust player inventory to given value.
Maximum inventory size is MAX_INVENTORY.
Minimum inventory size is FIXED_INVENTORY_SIZE.
For supported clients it send inventory change packet. For old clients,
this change is silent.
Current max inventory size can be read by function getInventorySize().

---------------------------------------

*getInventorySize()

Return current player max inventory size.
This value always smaller or equal to MAX_INVENTORY.
Size can be changed by group of functions expandInventory*

---------------------------------------
63 changes: 63 additions & 0 deletions npc/other/inventory_expansion.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
//================= Hercules Script =======================================
//= _ _ _
//= | | | | | |
//= | |_| | ___ _ __ ___ _ _| | ___ ___
//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
//= | | | | __/ | | (__| |_| | | __/\__ \
//= \_| |_/\___|_| \___|\__,_|_|\___||___/
//================= License ===============================================
//= This file is part of Hercules.
//= http://herc.ws - http://github.com/HerculesWS/Hercules
//=
//= Copyright (C) 2018 Hercules Dev Team
//= Copyright (C) 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
//= 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/>.
//=========================================================================
//= Inventory expansion
//=========================================================================

- script inventory_expansion FAKE_NPC,{
end;

OnInvExpandRequest:
if (countitem(Inventory_Extension_Coupon) < 1) {
expandInventoryAck(EXPAND_INV_MISSING_ITEM);
end;
}
if (getInventorySize() + INVENTORY_INCREASE_STEP > MAX_INVENTORY) {
expandInventoryAck(EXPAND_INV_MAX_SIZE);
end;
}
expandInventoryAck(EXPAND_INV_ASK_CONFIRMATION, Inventory_Extension_Coupon);
end;

OnInvExpandConfirmed:
if (countitem(Inventory_Extension_Coupon) < 1) {
expandInventoryResult(EXPAND_INV_RESULT_MISSING_ITEM);
end;
}
if (getInventorySize() + INVENTORY_INCREASE_STEP > MAX_INVENTORY) {
expandInventoryResult(EXPAND_INV_RESULT_MAX_SIZE);
end;
}
delitem(Inventory_Extension_Coupon, 1);
if (expandInventory(INVENTORY_INCREASE_STEP) == true) {
expandInventoryResult(EXPAND_INV_RESULT_SUCCESS);
}
end;

OnInvExpandRejected:
end;
}
1 change: 1 addition & 0 deletions npc/scripts.conf
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@
"npc/other/turbo_track.txt",
"npc/other/item_merge.txt",
"npc/other/private_airship.txt",
"npc/other/inventory_expansion.txt",

//================= Quests ================================================
// - Quests-Tutorials for basic classes (1st class quests) ------
Expand Down
2 changes: 2 additions & 0 deletions sql-files/main.sql
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ CREATE TABLE IF NOT EXISTS `char` (
`attendance_count` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
`attendance_timer` BIGINT(20) NULL DEFAULT '0',
`title_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
`inventory_size` INT(11) UNSIGNED NOT NULL DEFAULT '100',
PRIMARY KEY (`char_id`),
UNIQUE KEY `name_key` (`name`),
KEY `account_id` (`account_id`),
Expand Down Expand Up @@ -922,6 +923,7 @@ INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1528026381); -- 2018-06-0
INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1528180320); -- 2018-06-05--12-02.sql
INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1532403228); -- 2018-07-24--03-23.sql
INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1535865732); -- 2018-09-01--05-22.sql
INSERT IGNORE INTO `sql_updates` (`timestamp`) VALUES (1544738447); -- 2018-12-14--01-02.sql

--
-- Table structure for table `storage`
Expand Down
24 changes: 24 additions & 0 deletions sql-files/upgrades/2018-12-14--01-02.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#1544738447

-- This file is part of Hercules.
-- http://herc.ws - http://github.com/HerculesWS/Hercules
--
-- Copyright (C) 2018 Hercules Dev Team
-- Copyright (C) 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
-- 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/>.

ALTER TABLE `char` ADD `inventory_size` INT(11) UNSIGNED NOT NULL DEFAULT '100';

INSERT INTO `sql_updates` (`timestamp`, `ignored`) VALUES (1544738447, 'No');
1 change: 1 addition & 0 deletions sql-files/upgrades/index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@
2018-06-05--12-02.sql
2018-07-24--03-23.sql
2018-09-01--05-22.sql
2018-12-14--01-02.sql
2 changes: 1 addition & 1 deletion src/char/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ CHAR_C = char.c HPMchar.c loginif.c mapif.c geoip.c inter.c int_achievement.c in
CHAR_OBJ = $(addprefix obj_sql/, $(patsubst %.c,%.o,$(CHAR_C)))
CHAR_H = char.h HPMchar.h loginif.h mapif.h geoip.h inter.h int_achievement.h int_auction.h int_clan.h int_elemental.h \
int_guild.h int_homun.h int_mail.h int_mercenary.h int_party.h int_pet.h \
int_quest.h int_rodex.h int_storage.h pincode.h
int_quest.h int_rodex.h int_storage.h pincode.h packets_hc_struct.h
CHAR_PH =

HAVE_MYSQL=@HAVE_MYSQL@
Expand Down
Loading