Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of Hercules Ultimate Storage System (HUSS) #1763

Closed
wants to merge 12 commits into from
4 changes: 3 additions & 1 deletion Hercules.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@
A56CC652185642B4009EB79C /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0800;
LastUpgradeCheck = 0830;
ORGANIZATIONNAME = herc.ws;
};
buildConfigurationList = A56CC655185642B4009EB79C /* Build configuration list for PBXProject "Hercules" */;
Expand Down Expand Up @@ -1506,6 +1506,7 @@
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CONFIGURATION_BUILD_DIR = "$(PROJECT_DIR)";
COPY_PHASE_STRIP = NO;
Expand Down Expand Up @@ -1597,6 +1598,7 @@
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CONFIGURATION_BUILD_DIR = "$(PROJECT_DIR)";
COPY_PHASE_STRIP = YES;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Hercules.xcodeproj/xcshareddata/xcschemes/db2sql.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Hercules.xcodeproj/xcshareddata/xcschemes/sample.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
1 change: 0 additions & 1 deletion conf/groups.conf
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ groups: (
jail: true
jailfor: true
mute: true
storagelist: true
cartlist: true
itemlist: true
stats: true
Expand Down
52 changes: 52 additions & 0 deletions conf/map/storage.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
//================= Hercules Database ==========================================
//= _ _ _
//= | | | | | |
//= | |_| | ___ _ __ ___ _ _| | ___ ___
//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
//= | | | | __/ | | (__| |_| | | __/\__ \
//= \_| |_/\___|_| \___|\__,_|_|\___||___/
//================= License ====================================================
//= This file is part of Hercules.
//= http://herc.ws - http://github.com/HerculesWS/Hercules
//=
//= Copyright (C) 2014-2017 Hercules Dev Team
//= Copyright (C) 2017 Smokexyz
//=
//= 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/>.
//==============================================================================
//= Storage Configuration
//==============================================================================
//= @Format Notes:
//= - There can be an unlimited amount of storages and limits.
//= - All setting names are case-sensitive and must be keyed accurately.
//= - It is not recommended to set the maximum storage capacity over 1000 items.

storage_conf: (
/******************************************************************************
********************************* Entry structure *****************************
*******************************************************************************
{
Id: (int) (required|unique) Unique Identifier
Name: (string) (required) Name of the storage sent to the client.
Capacity: (int) (required) Maximum capacity of the storage.
}
*******************************************************************************/
{
// DO NOT EDIT THIS ENTRY!
// This is the default (official) storage for an account.
Id: 1
Name: "Storage"
Capacity: 600
},
)
9 changes: 6 additions & 3 deletions conf/messages.conf
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
24: Job level raised.
25: Job level lowered.
26: [%d] seconds left until you can use
27: Storage has been not loaded yet.
27: Storage '%s' has not been loaded yet.
28: No player found.
29: 1 player found.
30: %d players found.
Expand All @@ -74,7 +74,10 @@
46: %s recalled!
47: Base level can't go any higher.
48: Any work in progress (NPC dialog, manufacturing ...) quit and try again.
//49-52 FREE
49: Please specify a storage name. (usage: @storeall <storage name/ID>).
50: Please specify a storage name. (usage: @clearstorage <storage name/ID>).
51: Invalid storage name or ID
52: Please specify a storage name. (usage: @storage <storage name/ID>).
53: '%s' stats:
54: No player found in map '%s'.
55: 1 player found in map '%s'.
Expand Down Expand Up @@ -684,7 +687,7 @@
918: Please enter a speed value (usage: @speed <%d-%d>).

// @storage
919: Storage opened.
919: Storage #%d opened.

// @guildstorage
920: Guild storage opened.
Expand Down
9 changes: 9 additions & 0 deletions db/constants.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3872,4 +3872,13 @@ constants_db: {
UDT_STATADD: 54
UDT_ROBE: 55
UDT_BODY2: 56

comment__: "Storage Types"
STORAGE_TYPE_MAIN: 1

comment__: "Storage Access Types"
STORAGE_ACCESS_VIEW: 0x0
STORAGE_ACCESS_GET: 0x1
STORAGE_ACCESS_PUT: 0x2
STORAGE_ACCESS_ALL: 0x3
}
12 changes: 10 additions & 2 deletions doc/script_commands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5625,7 +5625,9 @@ has no gear, script will be terminated with an error.
//=====================================
---------------------------------------

*openstorage()
*openstorage(<storage_id>{, <storage_mode>})

Default Storage Access Mode: STORAGE_ACCESS_ALL

This will open character's Kafra storage window on the client connected to
the invoking character. It can be used from any kind of NPC or item
Expand All @@ -5637,9 +5639,15 @@ storage window, to avoid any disruption when both windows overlap.

mes("I will now open your stash for you");
close2();
openstorage();
openstorage(1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you forgot to use openstorage(STORAGE_TYPE_MAIN) with the new constant for storage type.

end;

Storage Modes:
STORAGE_ACCESS_VIEW // View storage only
STORAGE_ACCESS_GET // Allow getting items from storage.
STORAGE_ACCESS_PUT // Allow putting items to storage.
STORAGE_ACCESS_ALL // Allow all actions.

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

*openmail()
Expand Down
2 changes: 1 addition & 1 deletion npc/custom/etc/quest_warper.txt
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ L_Storage:
}
mes "Close this window and I will open your storage.";
close2;
openstorage;
openstorage(STORAGE_TYPE_MAIN);
end;

L_StorageJBlow:
Expand Down
2 changes: 1 addition & 1 deletion npc/kafras/functions_kafras.txt
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ function script F_KafStor {
}
callfunc("F_CheckKafCode"); //check your storage password, if set
close2;
openstorage;
openstorage(STORAGE_TYPE_MAIN);
cutin "", 255;
end;
}
Expand Down
2 changes: 1 addition & 1 deletion npc/kafras/kafras.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ aldeba_in,96,181,4 script Kafra Service 4_F_KAFRA5,{
mes "Thank you for your patronage.";
callfunc("F_CheckKafCode"); //check your storage password, if set
close2;
openstorage;
openstorage(STORAGE_TYPE_MAIN);
break;
case 3:
mes "[Kafra Leilah]";
Expand Down
2 changes: 1 addition & 1 deletion npc/other/CashShop_Functions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function script F_CashStore {
mes "Welcome to the Kafra Corporation.";
mes "Here, let me open your Storage for you.";
close2;
openstorage;
openstorage(STORAGE_TYPE_MAIN);
cutin "",255;
return;
}
Expand Down
6 changes: 3 additions & 3 deletions npc/quests/quests_13_1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7678,7 +7678,7 @@ function Catwarp;
mes "Your storage will";
mes "be opened shortly.";
close2;
openstorage;
openstorage(STORAGE_TYPE_MAIN);
end;
}
else {
Expand Down Expand Up @@ -7725,7 +7725,7 @@ function Catwarp;
mes "Your storage will";
mes "be opened shortly.";
close2;
openstorage;
openstorage(STORAGE_TYPE_MAIN);
end;
}
else {
Expand Down Expand Up @@ -7847,7 +7847,7 @@ function Catwarp;
mes "Your storage will";
mes "be opened shortly.";
close2;
openstorage;
openstorage(STORAGE_TYPE_MAIN);
end;
}
else {
Expand Down
6 changes: 3 additions & 3 deletions npc/quests/quests_13_2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ spl_fild02,25,211,4 script Cat Hand Agent#spl 4_M_BOSSCAT,{
mes "Thank you.";
mes "Your storage will be opened shortly.";
close2;
openstorage;
openstorage(STORAGE_TYPE_MAIN);
end;
}
else {
Expand Down Expand Up @@ -156,7 +156,7 @@ spl_fild02,25,211,4 script Cat Hand Agent#spl 4_M_BOSSCAT,{
mes "Thank you.";
mes "Your storage will be opened shortly.";
close2;
openstorage;
openstorage(STORAGE_TYPE_MAIN);
end;
}
else {
Expand Down Expand Up @@ -277,7 +277,7 @@ spl_fild02,25,211,4 script Cat Hand Agent#spl 4_M_BOSSCAT,{
mes "Thank you.";
mes "Your storage will be opened shortly.";
close2;
openstorage;
openstorage(STORAGE_TYPE_MAIN);
end;
}
else {
Expand Down
2 changes: 1 addition & 1 deletion npc/re/cities/mora.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ mora,48,128,0 script Drawer#mora_warehouse HIDDEN_NPC,{
close;
}
Zeny -= 100;
openstorage;
openstorage(STORAGE_TYPE_MAIN);
close;
case 2:
mes "- You gave up using the warehouse. -";
Expand Down
2 changes: 1 addition & 1 deletion npc/re/jobs/novice/academy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5393,7 +5393,7 @@ iz_ac01,95,46,5 script Kafra Guide Trainer#ac 4_F_KAFRA1,{
mes("Thanks for using~!");
close2();
cutin("", 255);
openstorage;
openstorage(STORAGE_TYPE_MAIN);
end;
} else {
mes("[Kafra Guide Trainer]");
Expand Down
2 changes: 1 addition & 1 deletion npc/re/other/dimensional_gap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ dali,112,95,4 script Logistics Manager 4_M_MERCAT2,{
mes("You need at least 200 zeny to use the Storage.");
} else {
Zeny -= 200;
openstorage();
openstorage(STORAGE_TYPE_MAIN);
}
close();
}
Expand Down
2 changes: 1 addition & 1 deletion npc/re/quests/eden/eden_service.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
}
Zeny -= 500;
close2;
openstorage;
openstorage(STORAGE_TYPE_MAIN);
end;
}
mes "I don't have enough zeny.";
Expand Down
2 changes: 1 addition & 1 deletion npc/re/quests/quests_dicastes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ dic_in01,254,119,0 script Item Storage#01 CLEAR_NPC,{
}
Zeny -= 500;
close2;
openstorage;
openstorage(STORAGE_TYPE_MAIN);
end;
}

Expand Down
2 changes: 1 addition & 1 deletion npc/re/quests/quests_malangdo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ malangdo,184,139,4 script Storekeeper#mal 4_CAT_ADV2,{
mes "[Storekeeper]";
mes "Thank you.";
close2;
openstorage;
openstorage(STORAGE_TYPE_MAIN);
end;
}

Expand Down
2 changes: 1 addition & 1 deletion npc/woe-fe/agit_main.txt
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ OnRecvCastle:
mes "the Kafra Service.";
close2;
cutin "",255;
openstorage;
openstorage(STORAGE_TYPE_MAIN);
end;
case 2:
mes "[Kafra Employee]";
Expand Down
2 changes: 1 addition & 1 deletion npc/woe-se/agit_main_se.txt
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ OnInit:
mes "have at least Novice Skill";
mes "Lv.6 to use the Storage.";
}
else openstorage;
else openstorage(STORAGE_TYPE_MAIN);
break;
case 2:
mes "[Kafra Employee]";
Expand Down
Loading