Implemented the /call command (#7225)
Fixes #7139. Thanks to @idk-whoami
This commit is contained in:
parent
9be64f55dc
commit
6cb5b5bac6
@ -283,6 +283,7 @@ CREATE TABLE IF NOT EXISTS `char` (
|
|||||||
`show_equip` tinyint(3) unsigned NOT NULL default '0',
|
`show_equip` tinyint(3) unsigned NOT NULL default '0',
|
||||||
`inventory_slots` smallint(6) NOT NULL default '100',
|
`inventory_slots` smallint(6) NOT NULL default '100',
|
||||||
`body_direction` tinyint(1) unsigned NOT NULL default '0',
|
`body_direction` tinyint(1) unsigned NOT NULL default '0',
|
||||||
|
`disable_call` tinyint(3) unsigned NOT NULL default '0',
|
||||||
PRIMARY KEY (`char_id`),
|
PRIMARY KEY (`char_id`),
|
||||||
UNIQUE KEY `name_key` (`name`),
|
UNIQUE KEY `name_key` (`name`),
|
||||||
KEY `account_id` (`account_id`),
|
KEY `account_id` (`account_id`),
|
||||||
|
3
sql-files/upgrades/upgrade_20220831.sql
Normal file
3
sql-files/upgrades/upgrade_20220831.sql
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
ALTER TABLE `char`
|
||||||
|
ADD COLUMN `disable_call` tinyint unsigned NOT NULL default '0'
|
||||||
|
;
|
@ -347,20 +347,20 @@ int char_mmo_char_tosql(uint32 char_id, struct mmo_charstatus* p){
|
|||||||
(p->mother != cp->mother) || (p->child != cp->child) ||
|
(p->mother != cp->mother) || (p->child != cp->child) ||
|
||||||
(p->karma != cp->karma) || (p->manner != cp->manner) ||
|
(p->karma != cp->karma) || (p->manner != cp->manner) ||
|
||||||
(p->fame != cp->fame) || (p->inventory_slots != cp->inventory_slots) ||
|
(p->fame != cp->fame) || (p->inventory_slots != cp->inventory_slots) ||
|
||||||
(p->body_direction != cp->body_direction)
|
(p->body_direction != cp->body_direction) || (p->disable_call != cp->disable_call)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if( SQL_ERROR == Sql_Query(sql_handle, "UPDATE `%s` SET `class`='%d',"
|
if( SQL_ERROR == Sql_Query(sql_handle, "UPDATE `%s` SET `class`='%d',"
|
||||||
"`hair`='%d', `hair_color`='%d', `clothes_color`='%d', `body`='%d',"
|
"`hair`='%d', `hair_color`='%d', `clothes_color`='%d', `body`='%d',"
|
||||||
"`partner_id`='%u', `father`='%u', `mother`='%u', `child`='%u',"
|
"`partner_id`='%u', `father`='%u', `mother`='%u', `child`='%u',"
|
||||||
"`karma`='%d',`manner`='%d', `fame`='%d', `inventory_slots`='%hu',"
|
"`karma`='%d',`manner`='%d', `fame`='%d', `inventory_slots`='%hu',"
|
||||||
"`body_direction`='%d'"
|
"`body_direction`='%d',`disable_call`='%d'"
|
||||||
" WHERE `account_id`='%d' AND `char_id` = '%d'",
|
" WHERE `account_id`='%d' AND `char_id` = '%d'",
|
||||||
schema_config.char_db, p->class_,
|
schema_config.char_db, p->class_,
|
||||||
p->hair, p->hair_color, p->clothes_color, p->body,
|
p->hair, p->hair_color, p->clothes_color, p->body,
|
||||||
p->partner_id, p->father, p->mother, p->child,
|
p->partner_id, p->father, p->mother, p->child,
|
||||||
p->karma, p->manner, p->fame, p->inventory_slots,
|
p->karma, p->manner, p->fame, p->inventory_slots,
|
||||||
p->body_direction,
|
p->body_direction, p->disable_call,
|
||||||
p->account_id, p->char_id) )
|
p->account_id, p->char_id) )
|
||||||
{
|
{
|
||||||
Sql_ShowDebug(sql_handle);
|
Sql_ShowDebug(sql_handle);
|
||||||
@ -939,7 +939,7 @@ int char_mmo_chars_fromsql(struct char_session_data* sd, uint8* buf, uint8* coun
|
|||||||
"`robe`,`moves`,`unban_time`,`font`,`uniqueitem_counter`,`sex`,`hotkey_rowshift`,`title_id`,`show_equip`,"
|
"`robe`,`moves`,`unban_time`,`font`,`uniqueitem_counter`,`sex`,`hotkey_rowshift`,`title_id`,`show_equip`,"
|
||||||
"`hotkey_rowshift2`,"
|
"`hotkey_rowshift2`,"
|
||||||
"`max_ap`,`ap`,`trait_point`,`pow`,`sta`,`wis`,`spl`,`con`,`crt`,"
|
"`max_ap`,`ap`,`trait_point`,`pow`,`sta`,`wis`,`spl`,`con`,`crt`,"
|
||||||
"`inventory_slots`,`body_direction`"
|
"`inventory_slots`,`body_direction`,`disable_call`"
|
||||||
" FROM `%s` WHERE `account_id`='%d' AND `char_num` < '%d'", schema_config.char_db, sd->account_id, MAX_CHARS)
|
" FROM `%s` WHERE `account_id`='%d' AND `char_num` < '%d'", schema_config.char_db, sd->account_id, MAX_CHARS)
|
||||||
|| SQL_ERROR == SqlStmt_Execute(stmt)
|
|| SQL_ERROR == SqlStmt_Execute(stmt)
|
||||||
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 0, SQLDT_INT, &p.char_id, 0, NULL, NULL)
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 0, SQLDT_INT, &p.char_id, 0, NULL, NULL)
|
||||||
@ -999,6 +999,7 @@ int char_mmo_chars_fromsql(struct char_session_data* sd, uint8* buf, uint8* coun
|
|||||||
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 54, SQLDT_SHORT, &p.crt, 0, NULL, NULL)
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 54, SQLDT_SHORT, &p.crt, 0, NULL, NULL)
|
||||||
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 55, SQLDT_UINT16, &p.inventory_slots, 0, NULL, NULL)
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 55, SQLDT_UINT16, &p.inventory_slots, 0, NULL, NULL)
|
||||||
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 56, SQLDT_UINT8, &p.body_direction, 0, NULL, NULL)
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 56, SQLDT_UINT8, &p.body_direction, 0, NULL, NULL)
|
||||||
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 57, SQLDT_UINT16, &p.disable_call, 0, NULL, NULL)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
SqlStmt_ShowDebug(stmt);
|
SqlStmt_ShowDebug(stmt);
|
||||||
@ -1068,7 +1069,7 @@ int char_mmo_char_fromsql(uint32 char_id, struct mmo_charstatus* p, bool load_ev
|
|||||||
"`save_map`,`save_x`,`save_y`,`partner_id`,`father`,`mother`,`child`,`fame`,`rename`,`delete_date`,`robe`, `moves`,"
|
"`save_map`,`save_x`,`save_y`,`partner_id`,`father`,`mother`,`child`,`fame`,`rename`,`delete_date`,`robe`, `moves`,"
|
||||||
"`unban_time`,`font`,`uniqueitem_counter`,`sex`,`hotkey_rowshift`,`clan_id`,`title_id`,`show_equip`,`hotkey_rowshift2`,"
|
"`unban_time`,`font`,`uniqueitem_counter`,`sex`,`hotkey_rowshift`,`clan_id`,`title_id`,`show_equip`,`hotkey_rowshift2`,"
|
||||||
"`max_ap`,`ap`,`trait_point`,`pow`,`sta`,`wis`,`spl`,`con`,`crt`,"
|
"`max_ap`,`ap`,`trait_point`,`pow`,`sta`,`wis`,`spl`,`con`,`crt`,"
|
||||||
"`inventory_slots`,`body_direction`"
|
"`inventory_slots`,`body_direction`,`disable_call`"
|
||||||
" FROM `%s` WHERE `char_id`=? LIMIT 1", schema_config.char_db)
|
" FROM `%s` WHERE `char_id`=? LIMIT 1", schema_config.char_db)
|
||||||
|| SQL_ERROR == SqlStmt_BindParam(stmt, 0, SQLDT_INT, &char_id, 0)
|
|| SQL_ERROR == SqlStmt_BindParam(stmt, 0, SQLDT_INT, &char_id, 0)
|
||||||
|| SQL_ERROR == SqlStmt_Execute(stmt)
|
|| SQL_ERROR == SqlStmt_Execute(stmt)
|
||||||
@ -1146,6 +1147,7 @@ int char_mmo_char_fromsql(uint32 char_id, struct mmo_charstatus* p, bool load_ev
|
|||||||
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 71, SQLDT_SHORT, &p->crt, 0, NULL, NULL)
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 71, SQLDT_SHORT, &p->crt, 0, NULL, NULL)
|
||||||
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 72, SQLDT_UINT16, &p->inventory_slots, 0, NULL, NULL)
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 72, SQLDT_UINT16, &p->inventory_slots, 0, NULL, NULL)
|
||||||
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 73, SQLDT_UINT8, &p->body_direction, 0, NULL, NULL)
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 73, SQLDT_UINT8, &p->body_direction, 0, NULL, NULL)
|
||||||
|
|| SQL_ERROR == SqlStmt_BindColumn(stmt, 74, SQLDT_UINT16, &p->disable_call, 0, NULL, NULL)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
SqlStmt_ShowDebug(stmt);
|
SqlStmt_ShowDebug(stmt);
|
||||||
@ -2339,7 +2341,7 @@ bool char_checkdb(void){
|
|||||||
"`moves`,`unban_time`,`font`,`sex`,`hotkey_rowshift`,`clan_id`,`last_login`,`title_id`,`show_equip`,"
|
"`moves`,`unban_time`,`font`,`sex`,`hotkey_rowshift`,`clan_id`,`last_login`,`title_id`,`show_equip`,"
|
||||||
"`hotkey_rowshift2`,"
|
"`hotkey_rowshift2`,"
|
||||||
"`max_ap`,`ap`,`trait_point`,`pow`,`sta`,`wis`,`spl`,`con`,`crt`,"
|
"`max_ap`,`ap`,`trait_point`,`pow`,`sta`,`wis`,`spl`,`con`,`crt`,"
|
||||||
"`inventory_slots`,`body_direction`"
|
"`inventory_slots`,`body_direction`,`disable_call`"
|
||||||
" FROM `%s` LIMIT 1;", schema_config.char_db) ){
|
" FROM `%s` LIMIT 1;", schema_config.char_db) ){
|
||||||
Sql_ShowDebug(sql_handle);
|
Sql_ShowDebug(sql_handle);
|
||||||
return false;
|
return false;
|
||||||
|
@ -590,7 +590,7 @@ struct mmo_charstatus {
|
|||||||
#ifdef HOTKEY_SAVING
|
#ifdef HOTKEY_SAVING
|
||||||
struct hotkey hotkeys[MAX_HOTKEYS_DB];
|
struct hotkey hotkeys[MAX_HOTKEYS_DB];
|
||||||
#endif
|
#endif
|
||||||
bool show_equip,allow_party;
|
bool show_equip,allow_party, disable_call;
|
||||||
short rename;
|
short rename;
|
||||||
|
|
||||||
time_t delete_date;
|
time_t delete_date;
|
||||||
|
@ -11081,6 +11081,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
|
|||||||
clif_equipcheckbox(sd);
|
clif_equipcheckbox(sd);
|
||||||
#endif
|
#endif
|
||||||
clif_pet_autofeed_status(sd,false);
|
clif_pet_autofeed_status(sd,false);
|
||||||
|
clif_configuration( sd, CONFIG_CALL, sd->status.disable_call );
|
||||||
#if PACKETVER >= 20170920
|
#if PACKETVER >= 20170920
|
||||||
if( battle_config.homunculus_autofeed_always ){
|
if( battle_config.homunculus_autofeed_always ){
|
||||||
// Always send ON or OFF
|
// Always send ON or OFF
|
||||||
@ -17560,6 +17561,9 @@ void clif_parse_configuration( int fd, struct map_session_data* sd ){
|
|||||||
case CONFIG_OPEN_EQUIPMENT_WINDOW:
|
case CONFIG_OPEN_EQUIPMENT_WINDOW:
|
||||||
sd->status.show_equip = flag;
|
sd->status.show_equip = flag;
|
||||||
break;
|
break;
|
||||||
|
case CONFIG_CALL:
|
||||||
|
sd->status.disable_call = flag;
|
||||||
|
break;
|
||||||
case CONFIG_PET_AUTOFEED:
|
case CONFIG_PET_AUTOFEED:
|
||||||
// Player can not click this if he does not have a pet
|
// Player can not click this if he does not have a pet
|
||||||
if( sd->pd == nullptr || !battle_config.feature_pet_autofeed || !sd->pd->get_pet_db()->allow_autofeed ){
|
if( sd->pd == nullptr || !battle_config.feature_pet_autofeed || !sd->pd->get_pet_db()->allow_autofeed ){
|
||||||
|
@ -594,8 +594,8 @@ enum class e_pet_evolution_result : uint32 {
|
|||||||
|
|
||||||
enum e_config_type : uint32 {
|
enum e_config_type : uint32 {
|
||||||
CONFIG_OPEN_EQUIPMENT_WINDOW = 0,
|
CONFIG_OPEN_EQUIPMENT_WINDOW = 0,
|
||||||
// Unknown
|
CONFIG_CALL,
|
||||||
CONFIG_PET_AUTOFEED = 2,
|
CONFIG_PET_AUTOFEED,
|
||||||
CONFIG_HOMUNCULUS_AUTOFEED
|
CONFIG_HOMUNCULUS_AUTOFEED
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -12212,6 +12212,12 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
|
|||||||
if (pl_sd == nullptr || pl_sd == sd || pl_sd->status.party_id != p->party.party_id || pc_isdead(pl_sd) ||
|
if (pl_sd == nullptr || pl_sd == sd || pl_sd->status.party_id != p->party.party_id || pc_isdead(pl_sd) ||
|
||||||
sd->bl.m != pl_sd->bl.m)
|
sd->bl.m != pl_sd->bl.m)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// Respect /call configuration
|
||||||
|
if( pl_sd->status.disable_call ){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(map_getmapflag(sd->bl.m, MF_NOTELEPORT) || map_getmapflag(sd->bl.m, MF_PVP) || map_getmapflag(sd->bl.m, MF_BATTLEGROUND) || map_flag_gvg2(sd->bl.m))) {
|
if (!(map_getmapflag(sd->bl.m, MF_NOTELEPORT) || map_getmapflag(sd->bl.m, MF_PVP) || map_getmapflag(sd->bl.m, MF_BATTLEGROUND) || map_flag_gvg2(sd->bl.m))) {
|
||||||
pc_setpos(pl_sd, map_id2index(sd->bl.m), sd->bl.x, sd->bl.y, CLR_TELEPORT);
|
pc_setpos(pl_sd, map_id2index(sd->bl.m), sd->bl.x, sd->bl.y, CLR_TELEPORT);
|
||||||
count++;
|
count++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user