diff options
-rw-r--r-- | AUTHORS | 3 | ||||
-rw-r--r-- | db/const.txt | 2 | ||||
-rw-r--r-- | db/re/item_db.conf | 24 | ||||
-rw-r--r-- | db/sc_config.txt | 2 | ||||
-rw-r--r-- | npc/custom/quests/hunting_missions.txt | 6 | ||||
-rw-r--r-- | sql-files/item_db_re.sql | 2 | ||||
-rw-r--r-- | sql-files/main.sql | 42 | ||||
-rw-r--r-- | src/common/HPMi.h | 5 | ||||
-rw-r--r-- | src/common/mmo.h | 4 | ||||
-rw-r--r-- | src/map/HPMmap.c | 29 | ||||
-rw-r--r-- | src/map/HPMmap.h | 2 | ||||
-rw-r--r-- | src/map/chrif.c | 3 | ||||
-rw-r--r-- | src/map/clif.c | 8 | ||||
-rw-r--r-- | src/map/map.c | 1 | ||||
-rw-r--r-- | src/map/mapreg_sql.c | 4 | ||||
-rw-r--r-- | src/map/pc.c | 13 | ||||
-rw-r--r-- | src/map/pc_groups.c | 13 | ||||
-rw-r--r-- | src/map/pc_groups.h | 13 | ||||
-rw-r--r-- | src/map/status.c | 8 | ||||
-rw-r--r-- | src/map/status.h | 3 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc | 4 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.HookingPoints.inc | 1 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Hooks.inc | 26 |
23 files changed, 146 insertions, 72 deletions
@@ -48,6 +48,7 @@ CIA-2 CLOWNISIUS code codemaster +Cookie css25 Curax Cydh @@ -270,4 +271,4 @@ ZoDIaC 胡 胡蝶蘭 過去の人i1 -釈尊
\ No newline at end of file +釈尊 diff --git a/db/const.txt b/db/const.txt index ab14afca2..9a590ac50 100644 --- a/db/const.txt +++ b/db/const.txt @@ -1258,6 +1258,8 @@ SC_MTF_CRIDAMAGE 570 SC_MOONSTAR 571 SC_SUPER_STAR 572 SC_OKTOBERFEST 573 +SC_STRANGELIGHTS 574 +SC_DECORATION_OF_MUSIC 575 e_gasp 0 e_what 1 diff --git a/db/re/item_db.conf b/db/re/item_db.conf index 6c6e429b4..229deb776 100644 --- a/db/re/item_db.conf +++ b/db/re/item_db.conf @@ -96593,6 +96593,18 @@ item_db: ( View: 879 }, { + Id: 18741 + AegisName: "C_WillOWisp_Accessory" + Name: "Will O Wisp" + Type: 5 + Buy: 20 + Loc: 1024 + Refine: false + View: 880 + OnEquipScript: <" sc_start SC_STRANGELIGHTS,-1,0; "> + OnUnequipScript: <" sc_end SC_STRANGELIGHTS; "> +}, +{ Id: 18742 AegisName: "C_MoonStar_Accessory" Name: "Moon and Stars" @@ -98285,4 +98297,16 @@ item_db: ( Upper: 63 Script: <" itemskill RK_LUXANIMA,1; "> }, +{ + Id: 19871 + AegisName: "C_DecorationOfMusic_Accessory" + Name: "Decoration of Music" + Type: 5 + Buy: 20 + Loc: 2048 + Refine: false + View: 1074 + OnEquipScript: <" sc_start SC_DECORATION_OF_MUSIC,-1,0; "> + OnUnequipScript: <" sc_end SC_DECORATION_OF_MUSIC; "> +}, ) diff --git a/db/sc_config.txt b/db/sc_config.txt index 682fd060c..5d276f036 100644 --- a/db/sc_config.txt +++ b/db/sc_config.txt @@ -423,6 +423,8 @@ SC_INCHIT, 77 SC_PUSH_CART, 205 SC_MOONSTAR, 207 SC_SUPER_STAR, 207 +SC_STRANGELIGHTS, 207 +SC_DECORATION_OF_MUSIC, 207 //Cant Clear SC_ALL_RIDING, 128
\ No newline at end of file diff --git a/npc/custom/quests/hunting_missions.txt b/npc/custom/quests/hunting_missions.txt index 5c3c6a469..8da51a1c0 100644 --- a/npc/custom/quests/hunting_missions.txt +++ b/npc/custom/quests/hunting_missions.txt @@ -126,7 +126,7 @@ function Chk; function Cm; case 6: mes "[Hunting Missions]"; mes "The top hunters are:"; - query_sql("SELECT char_id AS id, (SELECT `name` FROM `char` WHERE char_id = id),`value` FROM `global_reg_value` WHERE str = 'Mission_Total' ORDER BY CAST(`value` AS SIGNED) DESC LIMIT 5",.@id,.@name$,.@val); + query_sql("SELECT char_id AS id, (SELECT `name` FROM `char` WHERE char_id = id),`value` FROM `char_reg_num_db` WHERE `key` = 'Mission_Total' ORDER BY CAST(`value` AS SIGNED) DESC LIMIT 5",.@id,.@name$,.@val); for(set .@i,0; .@i<5; set .@i,.@i+1) mes " [Rank "+(.@i+1)+"] "+((.@name$[.@i] == "")?"^777777none":"^0055FF"+.@name$[.@i]+"^000000 : ^FF0000"+.@val[.@i]+" pt.")+"^000000"; close; @@ -181,8 +181,8 @@ Mission_Status: set #Mission_Count,0; if (.Delay) set #Mission_Delay, gettimetick(2)+(.Delay*3600); set Mission_Total, Mission_Total+1; - if (Mission_Total == 1) query_sql("INSERT INTO `global_reg_value` (`char_id`,`str`,`value`,`type`,`account_id`) VALUES ("+getcharid(0)+",'Mission_Total','1',3,0)"); - else query_sql("UPDATE `global_reg_value` SET `value` = "+Mission_Total+" WHERE char_id = "+getcharid(0)+" AND `str` = 'Mission_Total'"); + if (Mission_Total == 1) query_sql("INSERT INTO `char_reg_num_db` (`char_id`,`key`,`index`,`value`) VALUES ("+getcharid(0)+",'Mission_Total','0',1)"); + else query_sql("UPDATE `char_reg_num_db` SET `value` = "+Mission_Total+" WHERE `char_id` = "+getcharid(0)+" AND `key` = 'Mission_Total'"); close; Mission_Info: diff --git a/sql-files/item_db_re.sql b/sql-files/item_db_re.sql index 82ea04c67..58362472a 100644 --- a/sql-files/item_db_re.sql +++ b/sql-files/item_db_re.sql @@ -8019,6 +8019,7 @@ REPLACE INTO `item_db_re` VALUES ('18730','Cryptura_Academy_Hat','Criatura Hat', REPLACE INTO `item_db_re` VALUES ('18737','Fortier_Mask','Fortier Masque','5','20','10','200','0','0','0','0','0','4294967295','63','2','512','0','10',NULL,'0','876','0','bonus bUnbreakableHelm,0;','',''); REPLACE INTO `item_db_re` VALUES ('18739','Carnation_Hairband','Carnation Hairband','5','20','10','100','0','0','0','0','0','4294967295','63','2','256','0','0',NULL,'1','878','0','bonus bLuk,1;','',''); REPLACE INTO `item_db_re` VALUES ('18740','Hair_Of_The_Strong','RMSC2012 Special Costume','5','20','10','0','0','0','0','0','0','4294967295','63','2','1024','0','0',NULL,'0','879','0','','',''); +REPLACE INTO `item_db_re` VALUES ('18741','C_WillOWisp_Accessory','Will O Wisp','5','20','10','0','0','0','0','0','0','4294967295','63','2','1024','0','0',NULL,'0','880','0','','sc_start SC_STRANGELIGHTS,-1,0;','sc_end SC_STRANGELIGHTS;'); REPLACE INTO `item_db_re` VALUES ('18742','C_MoonStar_Accessory','Moon and Stars','5','20','10','0','0','0','0','0','0','4294967295','63','2','2048','0','0',NULL,'0','881','0','','sc_start SC_MOONSTAR,-1,0;','sc_end SC_MOONSTAR;'); REPLACE INTO `item_db_re` VALUES ('18743','Spirit_Of_Chung_E','Spirit Of Chung E','5','20','10','0','0','0','0','0','0','4294967295','63','2','1024','0','0',NULL,'0','882','0','','',''); REPLACE INTO `item_db_re` VALUES ('18744','C_World_Star','Twilight','5','20','10','0','0','0','0','0','0','4294967295','63','2','2048','0','0',NULL,'0','883','0','','sc_start SC_SUPER_STAR,-1,0;','sc_end SC_SUPER_STAR;'); @@ -8142,3 +8143,4 @@ REPLACE INTO `item_db_re` VALUES ('21004','Alca_Bringer_','Alca Bringer','4','20 REPLACE INTO `item_db_re` VALUES ('21005','Metal_Two_Hand_Sword','Metal Two-Handed Sword','4','20','10','0','95','0','0','1','1','16514','63','2','34','3','0',NULL,'1','3','0','','',''); REPLACE INTO `item_db_re` VALUES ('22514','Candy_Holder','Candy Holder','11','20','10','10','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','','',''); REPLACE INTO `item_db_re` VALUES ('22540','Runstone_Luxanima','Lux Anima Rune','11','2','1','100','0','0','0','0','0','4294967295','63','2','0','0','0',NULL,'0','0','0','itemskill RK_LUXANIMA,1;','',''); +REPLACE INTO `item_db_re` VALUES ('19871','C_DecorationOfMusic_Accessory','Decoration of Music','5','20','10','0','0','0','0','0','0','4294967295','63','2','2048','0','0',NULL,'0','1074','0','','sc_start SC_DECORATION_OF_MUSIC,-1,0;','sc_end SC_DECORATION_OF_MUSIC;'); diff --git a/sql-files/main.sql b/sql-files/main.sql index 398bdcfe4..4a91aeef8 100644 --- a/sql-files/main.sql +++ b/sql-files/main.sql @@ -639,26 +639,28 @@ CREATE TABLE IF NOT EXISTS `sql_updates` ( ) ENGINE=MyISAM; -- Existent updates to enter -INSERT INTO `sql_updates` (`timestamp`) VALUES (1360858500); -INSERT INTO `sql_updates` (`timestamp`) VALUES (1360951560); -INSERT INTO `sql_updates` (`timestamp`) VALUES (1362445531); -INSERT INTO `sql_updates` (`timestamp`) VALUES (1362528000); -INSERT INTO `sql_updates` (`timestamp`) VALUES (1362794218); -INSERT INTO `sql_updates` (`timestamp`) VALUES (1364409316); -INSERT INTO `sql_updates` (`timestamp`) VALUES (1366075474); -INSERT INTO `sql_updates` (`timestamp`) VALUES (1366078541); -INSERT INTO `sql_updates` (`timestamp`) VALUES (1381354728); -INSERT INTO `sql_updates` (`timestamp`) VALUES (1381423003); -INSERT INTO `sql_updates` (`timestamp`) VALUES (1382892428); -INSERT INTO `sql_updates` (`timestamp`) VALUES (1383162785); -INSERT INTO `sql_updates` (`timestamp`) VALUES (1383167577); -INSERT INTO `sql_updates` (`timestamp`) VALUES (1383205740); -INSERT INTO `sql_updates` (`timestamp`) VALUES (1383955424); -INSERT INTO `sql_updates` (`timestamp`) VALUES (1384545461); -INSERT INTO `sql_updates` (`timestamp`) VALUES (1384588175); -INSERT INTO `sql_updates` (`timestamp`) VALUES (1387844126); -INSERT INTO `sql_updates` (`timestamp`) VALUES (1388854043); -INSERT INTO `sql_updates` (`timestamp`) VALUES (1389028967); +INSERT INTO `sql_updates` (`timestamp`) VALUES (1360858500); -- 2013-02-14--16-15.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1360951560); -- 2013-02-15--18-06.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1362445531); -- 2013-03-05--01-05.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1362528000); -- 2013-03-06--00-00.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1362794218); -- 2013-03-09--01-56.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1364409316); -- 2013-03-27--18-35.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1366075474); -- 2013-04-16--01-24.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1366078541); -- 2013-04-16--02-15.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1381354728); -- 2013-10-09--21-38.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1381423003); -- 2013-10-10--16-36.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1382892428); -- 2013-10-27--16-47.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1383162785); -- 2013-10-30--19-53.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1383167577); -- 2013-10-30--21-12.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1383205740); -- 2013-10-31--07-49.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1383955424); -- 2013-11-09--00-03.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1384473995); -- 2013-11-15--00-06.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1384545461); -- 2013-11-15--19-57.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1384588175); -- 2013-11-16--07-49.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1384763034); -- 2013-11-18--08-23.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1387844126); -- 2013-12-24--00-15.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1388854043); -- 2014-01-04--16-47.sql +INSERT INTO `sql_updates` (`timestamp`) VALUES (1389028967); -- 2014-01-06--17-22.sql -- -- Table structure for table `sstatus` diff --git a/src/common/HPMi.h b/src/common/HPMi.h index 742132cde..78a3a9ab5 100644 --- a/src/common/HPMi.h +++ b/src/common/HPMi.h @@ -138,6 +138,9 @@ enum HPluginConfType { /* HPMi->addBattleConf */ #define addBattleConf(bcname,funcname) HPMi->addConf(HPMi->pid,HPCT_BATTLE,bcname,funcname) +/* HPMi->addPCGPermission */ +#define addGroupPermission(pcgname,maskptr) HPMi->addPCGPermission(HPMi->pid,pcgname,&maskptr) + /* Hercules Plugin Mananger Include Interface */ HPExport struct HPMi_interface { /* */ @@ -161,6 +164,8 @@ HPExport struct HPMi_interface { bool (*addArg) (unsigned int pluginID, char *name, bool has_param,void (*func) (char *param),void (*help) (void)); /* battle-config recv param */ bool (*addConf) (unsigned int pluginID, enum HPluginConfType type, char *name, void (*func) (const char *val)); + /* pc group permission */ + void (*addPCGPermission) (unsigned int pluginID, char *name, unsigned int *mask); } HPMi_s; #ifndef _HPM_H_ HPExport struct HPMi_interface *HPMi; diff --git a/src/common/mmo.h b/src/common/mmo.h index cb1e52311..7350de443 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -52,8 +52,8 @@ #endif // PACKETVER #ifndef DISABLE_PACKETVER_RE -// Comment the following line if your client is NOT ragexeRE (required because of conflicting packets in ragexe vs ragexeRE). -#define PACKETVER_RE + //Uncomment the following line if your client is ragexeRE instead of ragexe (required because of conflicting packets in ragexe vs ragexeRE). + //#define PACKETVER_RE #endif // DISABLE_PACKETVER_RE // Client support for experimental RagexeRE UI present in 2012-04-10 and 2012-04-18 diff --git a/src/map/HPMmap.c b/src/map/HPMmap.c index 8d7c74ef2..9c09a7ad1 100644 --- a/src/map/HPMmap.c +++ b/src/map/HPMmap.c @@ -65,8 +65,9 @@ void HPM_map_grabHPData(struct HPDataOperationStorage *ret, enum HPluginDataType } void HPM_map_plugin_load_sub(struct hplugin *plugin) { - plugin->hpi->addCommand = HPM->import_symbol("addCommand",plugin->idx); - plugin->hpi->addScript = HPM->import_symbol("addScript",plugin->idx); + plugin->hpi->addCommand = HPM->import_symbol("addCommand",plugin->idx); + plugin->hpi->addScript = HPM->import_symbol("addScript",plugin->idx); + plugin->hpi->addPCGPermission = HPM->import_symbol("addGroupPermission",plugin->idx); } bool HPM_map_add_atcommand(char *name, AtCommandFunc func) { @@ -98,6 +99,30 @@ void HPM_map_atcommands(void) { } void HPM_map_do_final(void) { + unsigned char i; + if( atcommand_list ) aFree(atcommand_list); + /** + * why is pcg->HPM being cleared here? because PCG's do_final is not final, + * is used on reload, and would thus cause plugin-provided permissions to go away + **/ + for( i = 0; i < pcg->HPMpermissions_count; i++ ) { + aFree(pcg->HPMpermissions[i].name); + } + if( pcg->HPMpermissions ) + aFree(pcg->HPMpermissions); +} + +/** + * Adds a new group permission to the HPM-provided list + **/ +void HPM_map_add_group_permission(unsigned int pluginID, char *name, unsigned int *mask) { + unsigned char index = pcg->HPMpermissions_count; + + RECREATE(pcg->HPMpermissions, struct pc_groups_new_permission, ++pcg->HPMpermissions_count); + + pcg->HPMpermissions[index].pID = pluginID; + pcg->HPMpermissions[index].name = aStrdup(name); + pcg->HPMpermissions[index].mask = mask; } diff --git a/src/map/HPMmap.h b/src/map/HPMmap.h index f5fe70276..f86f02eb9 100644 --- a/src/map/HPMmap.h +++ b/src/map/HPMmap.h @@ -20,4 +20,6 @@ void HPM_map_plugin_load_sub(struct hplugin *plugin); void HPM_map_do_final(void); +void HPM_map_add_group_permission(unsigned int pluginID, char *name, unsigned int *mask); + #endif /* _HPM_MAP_ */ diff --git a/src/map/chrif.c b/src/map/chrif.c index bcc1da935..0a3fb0ad2 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -1337,6 +1337,9 @@ void chrif_skillid2idx(int fd) { if( fd == 0 ) fd = chrif->fd; + if( !session_isValid(fd) ) + return; + WFIFOHEAD(fd,4 + (MAX_SKILL * 4)); WFIFOW(fd,0) = 0x2b0b; for(i = 0; i < MAX_SKILL; i++) { diff --git a/src/map/clif.c b/src/map/clif.c index 1bb68b212..7157914df 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -5492,10 +5492,10 @@ void clif_status_change_notick(struct block_list *bl,int type,int flag,int tick, nullpo_retv(bl); - if (!(status->type2relevant_bl_types(type)&bl->type)) // only send status changes that actually matter to the client + if (type == SI_BLANK) //It shows nothing on the client... return; - if (type == SI_BLANK) //It shows nothing on the client... + if (!(status->type2relevant_bl_types(type)&bl->type)) // only send status changes that actually matter to the client return; sd = BL_CAST(BL_PC, bl); @@ -9197,6 +9197,8 @@ void clif_parse_WantToConnection(int fd, struct map_session_data* sd) { chrif->authreq(sd,false); } void clif_hercules_chsys_mjoin(struct map_session_data *sd) { + if( sd->state.autotrade || sd->state.standalone ) + return; if( !map->list[sd->bl.m].channel ) { if (map->list[sd->bl.m].flag.chsysnolocalaj || (map->list[sd->bl.m].instance_id >= 0 && instance->list[map->list[sd->bl.m].instance_id].owner_type != IOT_NONE) ) @@ -13347,8 +13349,6 @@ void clif_parse_CatchPet(int fd, struct map_session_data *sd) void clif_parse_SelectEgg(int fd, struct map_session_data *sd) { if (sd->menuskill_id != SA_TAMINGMONSTER || sd->menuskill_val != -1) { - //Forged packet, disconnect them [Kevin] - clif->authfail_fd(fd, 0); return; } pet->select_egg(sd,RFIFOW(fd,2)-2); diff --git a/src/map/map.c b/src/map/map.c index 68a675a37..5344d11bf 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -5379,6 +5379,7 @@ void map_hp_symbols(void) { /* specific */ HPM->share(atcommand->create,"addCommand"); HPM->share(script->addScript,"addScript"); + HPM->share(HPM_map_add_group_permission,"addGroupPermission"); } void map_load_defaults(void) { diff --git a/src/map/mapreg_sql.c b/src/map/mapreg_sql.c index c2a35f930..3cf92454d 100644 --- a/src/map/mapreg_sql.c +++ b/src/map/mapreg_sql.c @@ -173,13 +173,13 @@ void script_load_mapreg(void) { ShowWarning("load_mapreg: duplicate! '%s' => '%s' skipping...\n",varname,value); continue; } - script->set_reg(NULL,NULL,reference_uid(s, i), varname, (void*)value, NULL); + mapreg->setregstr(reference_uid(s, i),value); } else { if( i64db_exists(mapreg->db, reference_uid(s, i)) ) { ShowWarning("load_mapreg: duplicate! '%s' => '%s' skipping...\n",varname,value); continue; } - script->set_reg(NULL,NULL,reference_uid(s, i), varname, (void*)__64BPTRSIZE(atoi(value)), NULL); + mapreg->setreg(reference_uid(s, i),atoi(value)); } } diff --git a/src/map/pc.c b/src/map/pc.c index 0a1a474ad..cc2566a6e 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -10435,7 +10435,7 @@ void pc_autotrade_prepare(struct map_session_data *sd) { **/ void pc_autotrade_populate(struct map_session_data *sd) { struct autotrade_vending *data; - int i, j, cursor = 0; + int i, j, k, cursor = 0; if( !(data = idb_get(pc->at_db,sd->status.char_id)) ) return; @@ -10444,7 +10444,16 @@ void pc_autotrade_populate(struct map_session_data *sd) { if( !data->vending[i].amount ) continue; - ARR_FIND(0, MAX_CART, j, !memcmp((char*)(&data->list[i]) + sizeof(data->list[0].id), (char*)(&sd->status.cart[j]) + sizeof(data->list[0].id), sizeof(struct item) - sizeof(data->list[0].id))); + for(j = 0; j < MAX_CART; j++) { + if( !memcmp((char*)(&data->list[i]) + sizeof(data->list[0].id), (char*)(&sd->status.cart[j]) + sizeof(data->list[0].id), sizeof(struct item) - sizeof(data->list[0].id)) ) { + if( cursor ) { + ARR_FIND(0, cursor, k, sd->vending[k].index == j); + if( k != cursor ) + continue; + } + break; + } + } if( j != MAX_CART ) { sd->vending[cursor].index = j; diff --git a/src/map/pc_groups.c b/src/map/pc_groups.c index 59dd951c7..4ddb95c9b 100644 --- a/src/map/pc_groups.c +++ b/src/map/pc_groups.c @@ -423,10 +423,17 @@ void do_init_pc_groups(void) { for(i = 0; i < len; i++) { unsigned int p; - if( ( p = pcg->add_permission(pc_g_defaults[i].name) ) != pc_g_defaults[i].permission ) + if( ( p = pc_groups_add_permission(pc_g_defaults[i].name) ) != pc_g_defaults[i].permission ) ShowError("do_init_pc_groups: %s error : %d != %d\n",pc_g_defaults[i].name,p,pc_g_defaults[i].permission); } + /** + * Handle plugin-provided permissions + **/ + for(i = 0; i < pcg->HPMpermissions_count; i++) { + *pcg->HPMpermissions[i].mask = pc_groups_add_permission(pcg->HPMpermissions[i].name); + } + pcg->db = idb_alloc(DB_OPT_RELEASE_DATA); pcg->name_db = stridb_alloc(DB_OPT_DUP_KEY, 0); @@ -502,6 +509,9 @@ void pc_groups_defaults(void) { pcg->permissions = NULL; pcg->permission_count = 0; /* */ + pcg->HPMpermissions = NULL; + pcg->HPMpermissions_count = 0; + /* */ pcg->init = do_init_pc_groups; pcg->final = do_final_pc_groups; pcg->reload = pc_groups_reload; @@ -514,5 +524,4 @@ void pc_groups_defaults(void) { pcg->get_name = pc_group_get_name; pcg->get_level = pc_group_get_level; pcg->get_idx = pc_group_get_idx; - pcg->add_permission = pc_groups_add_permission; } diff --git a/src/map/pc_groups.h b/src/map/pc_groups.h index 943fb7fa5..3396512ea 100644 --- a/src/map/pc_groups.h +++ b/src/map/pc_groups.h @@ -49,12 +49,19 @@ struct GroupSettings { config_setting_t *root; // groups.[] }; +typedef struct GroupSettings GroupSettings; + struct pc_groups_permission_table { char *name; unsigned int permission; }; -typedef struct GroupSettings GroupSettings; +/* used by plugins to list permissions */ +struct pc_groups_new_permission { + unsigned int pID;/* plugin identity (for the future unload during runtime support) */ + char *name;/* aStrdup' of the permission name */ + unsigned int *mask;/* pointer to the plugin val that will store the value of the mask */ +}; struct pc_groups_interface { /* */ @@ -64,6 +71,9 @@ struct pc_groups_interface { struct pc_groups_permission_table *permissions; unsigned char permission_count; /* */ + struct pc_groups_new_permission *HPMpermissions; + unsigned char HPMpermissions_count; + /* */ void (*init) (void); void (*final) (void); void (*reload) (void); @@ -76,7 +86,6 @@ struct pc_groups_interface { const char* (*get_name) (GroupSettings *group); int (*get_level) (GroupSettings *group); int (*get_idx) (GroupSettings *group); - unsigned int (*add_permission) (const char *name); }; struct pc_groups_interface *pcg; diff --git a/src/map/status.c b/src/map/status.c index 1f7d81ccf..e89f8d331 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -96,7 +96,7 @@ int status_type2relevant_bl_types(int type) { if( type < 0 || type >= SI_MAX ) { ShowError("status_type2relevant_bl_types: Unsupported type %d\n", type); - return SI_BLANK; + return BL_NUL; } return status->RelevantBLTypes[type]; @@ -908,6 +908,8 @@ void initChangeTables(void) { status->IconChangeTable[SC_MONSTER_TRANSFORM] = SI_MONSTER_TRANSFORM; status->IconChangeTable[SC_MOONSTAR] = SI_MOONSTAR; status->IconChangeTable[SC_SUPER_STAR] = SI_SUPER_STAR; + status->IconChangeTable[SC_STRANGELIGHTS] = SI_STRANGELIGHTS; + status->IconChangeTable[SC_DECORATION_OF_MUSIC] = SI_DECORATION_OF_MUSIC; //Other SC which are not necessarily associated to skills. status->ChangeFlagTable[SC_ATTHASTE_POTION1] = SCB_ASPD; @@ -999,6 +1001,8 @@ void initChangeTables(void) { status->ChangeFlagTable[SC_MOONSTAR] |= SCB_NONE; status->ChangeFlagTable[SC_SUPER_STAR] |= SCB_NONE; + status->ChangeFlagTable[SC_STRANGELIGHTS] |= SCB_NONE; + status->ChangeFlagTable[SC_DECORATION_OF_MUSIC] |= SCB_NONE; /* status->DisplayType Table [Ind/Hercules] */ status->DisplayType[SC_ALL_RIDING] = true; @@ -1026,6 +1030,8 @@ void initChangeTables(void) { status->DisplayType[SC_MONSTER_TRANSFORM] = true; status->DisplayType[SC_MOONSTAR] = true; status->DisplayType[SC_SUPER_STAR] = true; + status->DisplayType[SC_STRANGELIGHTS] = true; + status->DisplayType[SC_DECORATION_OF_MUSIC] = true; #ifdef RENEWAL_EDP // renewal EDP increases your weapon atk diff --git a/src/map/status.h b/src/map/status.h index 44cc3b0a1..f319b1506 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -697,6 +697,8 @@ typedef enum sc_type { SC_SUPER_STAR, SC_OKTOBERFEST, + SC_STRANGELIGHTS, + SC_DECORATION_OF_MUSIC, SC_MAX, //Automatically updated max, used in for's to check we are within bounds. } sc_type; @@ -1458,6 +1460,7 @@ enum si_type { SI_PACKING_ENVELOPE10 = 775, SI_GLASTHEIM_TRANS = 776, SI_HEAT_BARREL_AFTER = 778, + SI_DECORATION_OF_MUSIC = 779, SI_MAX, }; // JOINTBEAT stackable ailments diff --git a/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc index 7f26bd208..bef0cec69 100644 --- a/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc @@ -3495,8 +3495,6 @@ struct { struct HPMHookPoint *HP_pcg_get_level_post; struct HPMHookPoint *HP_pcg_get_idx_pre; struct HPMHookPoint *HP_pcg_get_idx_post; - struct HPMHookPoint *HP_pcg_add_permission_pre; - struct HPMHookPoint *HP_pcg_add_permission_post; struct HPMHookPoint *HP_pc_init_pre; struct HPMHookPoint *HP_pc_init_post; struct HPMHookPoint *HP_pc_final_pre; @@ -8518,8 +8516,6 @@ struct { int HP_pcg_get_level_post; int HP_pcg_get_idx_pre; int HP_pcg_get_idx_post; - int HP_pcg_add_permission_pre; - int HP_pcg_add_permission_post; int HP_pc_init_pre; int HP_pc_init_post; int HP_pc_final_pre; diff --git a/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc index e6f593187..42e6593a1 100644 --- a/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc @@ -1777,7 +1777,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(pcg->get_name, HP_pcg_get_name) }, { HP_POP(pcg->get_level, HP_pcg_get_level) }, { HP_POP(pcg->get_idx, HP_pcg_get_idx) }, - { HP_POP(pcg->add_permission, HP_pcg_add_permission) }, /* pc */ { HP_POP(pc->init, HP_pc_init) }, { HP_POP(pc->final, HP_pc_final) }, diff --git a/src/plugins/HPMHooking/HPMHooking.Hooks.inc b/src/plugins/HPMHooking/HPMHooking.Hooks.inc index 2e4b62835..64194362c 100644 --- a/src/plugins/HPMHooking/HPMHooking.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking.Hooks.inc @@ -45007,32 +45007,6 @@ int HP_pcg_get_idx(GroupSettings *group) { } return retVal___; } -unsigned int HP_pcg_add_permission(const char *name) { - int hIndex = 0; - unsigned int retVal___ = 0; - if( HPMHooks.count.HP_pcg_add_permission_pre ) { - unsigned int (*preHookFunc) (const char *name); - for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_add_permission_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_pcg_add_permission_pre[hIndex].func; - retVal___ = preHookFunc(name); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.pcg.add_permission(name); - } - if( HPMHooks.count.HP_pcg_add_permission_post ) { - unsigned int (*postHookFunc) (unsigned int retVal___, const char *name); - for(hIndex = 0; hIndex < HPMHooks.count.HP_pcg_add_permission_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_pcg_add_permission_post[hIndex].func; - retVal___ = postHookFunc(retVal___, name); - } - } - return retVal___; -} /* pc */ void HP_pc_init(bool minimal) { int hIndex = 0; |