Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- src/char/char.c | 5 +
- src/char/int_guild.c | 2 +-
- src/common/mmo.h | 16 ++--
- src/config/classes/general.h | 2 +-
- src/config/core.h | 6 +-
- src/config/renewal.h | 5 +-
- src/login/account.h | 1 +
- src/login/account_sql.c | 9 +-
- src/login/login.c | 13 ++-
- src/login/login.h | 2 +
- src/map/Makefile.in | 6 +-
- src/map/atcommand.c | 216 ++++++++++++++++++++++++++++++++++++++++---
- src/map/battle.c | 8 +-
- src/map/battle.h | 2 +
- src/map/buyingstore.c | 6 ++
- src/map/clif.c | 122 +++++++++++++++++++++---
- src/map/clif.h | 2 +
- src/map/mail.c | 6 ++
- src/map/map.c | 29 ++++++
- src/map/mob.c | 4 +-
- src/map/npc.c | 9 ++
- src/map/npc.h | 2 +
- src/map/packets.h | 2 +-
- src/map/party.c | 7 +-
- src/map/pc.c | 67 ++++++++++++--
- src/map/pc.h | 16 ++++
- src/map/script.c | 149 ++++++++++++++++++++++++++++-
- src/map/script.h | 4 +
- src/map/skill.c | 100 ++++++++++++++++++--
- src/map/status.c | 38 ++++++--
- src/map/status.h | 8 ++
- src/map/storage.c | 6 ++
- src/map/trade.c | 10 ++
- src/map/unit.c | 8 ++
- src/plugins/Makefile.in | 2 +-
- 35 files changed, 808 insertions(+), 82 deletions(-)
- diff --git a/src/char/char.c b/src/char/char.c
- index d97cd33..bf0592f 100644
- --- a/src/char/char.c
- +++ b/src/char/char.c
- @@ -2491,6 +2491,11 @@ int char_parse_fromlogin_changesex_reply(int fd)
- }
- SQL->StmtFree(stmt);
- +#if PACKETVER < 20141022
- + if ( SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET sex = 'U' WHERE account_id = %d",char_db,acc) )
- + Sql_ShowDebug(inter->sql_handle);
- +#endif
- +
- // disconnect player if online on char-server
- chr->disconnect_player(acc);
- diff --git a/src/char/int_guild.c b/src/char/int_guild.c
- index 3ba51e1..5e64bac 100644
- --- a/src/char/int_guild.c
- +++ b/src/char/int_guild.c
- @@ -837,7 +837,7 @@ int inter_guild_calcinfo(struct guild *g)
- g->next_exp = nextexp;
- // Set the max number of members, Guild Extension skill - currently adds 6 to max per skill lv.
- - g->max_member = 16 + inter_guild->checkskill(g, GD_EXTENSION) * 6;
- + g->max_member = 16 + inter_guild->checkskill(g, GD_EXTENSION) * 2;
- if(g->max_member > MAX_GUILD)
- {
- ShowError("Guild %d:%s has capacity for too many guild members (%d), max supported is %d\n", g->guild_id, g->name, g->max_member, MAX_GUILD);
- diff --git a/src/common/mmo.h b/src/common/mmo.h
- index 48eba00..852b505 100644
- --- a/src/common/mmo.h
- +++ b/src/common/mmo.h
- @@ -49,7 +49,7 @@
- // 20120307 - 2012-03-07aRagexeRE+ - 0x970
- #ifndef PACKETVER
- - #define PACKETVER 20141022
- + #define PACKETVER 20131223
- #endif // PACKETVER
- //Uncomment the following line if your client is ragexeRE instead of ragexe (required because of conflicting packets in ragexe vs ragexeRE).
- @@ -94,13 +94,13 @@
- #define MAX_INVENTORY 100
- //Max number of characters per account. Note that changing this setting alone is not enough if the client is not hexed to support more characters as well.
- -#define MAX_CHARS 9
- +#define MAX_CHARS 15
- //Number of slots carded equipment can have. Never set to less than 4 as they are also used to keep the data of forged items/equipment. [Skotlex]
- //Note: The client seems unable to receive data for more than 4 slots due to all related packets having a fixed size.
- #define MAX_SLOTS 4
- //Max amount of a single stacked item
- #define MAX_AMOUNT 30000
- -#define MAX_ZENY 1000000000
- +#define MAX_ZENY 2000000000
- //Official Limit: 2.1b ( the var that stores the money doesn't go much higher than this by default )
- #define MAX_BANK_ZENY INT_MAX
- @@ -115,11 +115,11 @@
- #define DEFAULT_WALK_SPEED 150
- #define MIN_WALK_SPEED 20 /* below 20 clips animation */
- #define MAX_WALK_SPEED 1000
- -#define MAX_STORAGE 600
- -#define MAX_GUILD_STORAGE 600
- -#define MAX_PARTY 12
- -#define MAX_GUILD (16+10*6) // Increased max guild members +6 per 1 extension levels [Lupus]
- -#define MAX_GUILDPOSITION 20 // Increased max guild positions to accommodate for all members [Valaris] (removed) [PoW]
- +#define MAX_STORAGE 999
- +#define MAX_GUILD_STORAGE 999
- +#define MAX_PARTY 20
- +#define MAX_GUILD (16+10*2) // Increased max guild members +6 per 1 extension levels [Lupus]
- +#define MAX_GUILDPOSITION 30 // Increased max guild positions to accommodate for all members [Valaris] (removed) [PoW]
- #define MAX_GUILDEXPULSION 32
- #define MAX_GUILDALLIANCE 16
- #define MAX_GUILDSKILL 15 // Increased max guild skills because of new skills [Sara-chan]
- diff --git a/src/config/classes/general.h b/src/config/classes/general.h
- index b75c907..9027582 100644
- --- a/src/config/classes/general.h
- +++ b/src/config/classes/general.h
- @@ -30,7 +30,7 @@
- * when enabled, reflect damage doesn't bypass devotion (and thus damage is passed to crusader)
- * uncomment to enable
- **/
- -//#define DEVOTION_REFLECT_DAMAGE
- +#define DEVOTION_REFLECT_DAMAGE
- /**
- * No settings past this point
- diff --git a/src/config/core.h b/src/config/core.h
- index da9296b..43b4b1f 100644
- --- a/src/config/core.h
- +++ b/src/config/core.h
- @@ -14,7 +14,7 @@
- /// The official walkpath disables users from taking non-clear walk paths,
- /// e.g. if they want to get around an obstacle they have to walk around it,
- /// while with OFFICIAL_WALKPATH disabled if they click to walk around a obstacle the server will do it automatically
- -#define OFFICIAL_WALKPATH
- +//#define OFFICIAL_WALKPATH
- /// leave this line uncommented to enable callfunc checks when processing scripts.
- /// while allowed, the script engine will attempt to match user-defined functions
- @@ -45,7 +45,7 @@
- /// Client-sided range checks are, however, are always circular.
- /// Enabling this changes all checks to circular checks, which is more realistic,
- /// - but is not the official behaviour.
- -//#define CIRCULAR_AREA
- +#define CIRCULAR_AREA
- //This is the distance at which @autoloot works,
- //if the item drops farther from the player than this,
- @@ -66,7 +66,7 @@
- /// Comment to disable autotrade persistency (where autotrading merchants survive server restarts)
- -#define AUTOTRADE_PERSISTENCY
- +//#define AUTOTRADE_PERSISTENCY
- /**
- * No settings past this point
- diff --git a/src/config/renewal.h b/src/config/renewal.h
- index 939ad9b..49da009 100644
- --- a/src/config/renewal.h
- +++ b/src/config/renewal.h
- @@ -13,6 +13,9 @@
- * @INFO: This file holds general-purpose renewal settings, for class-specific ones check /src/config/classes folder
- **/
- +/// Enable achievement system
- +#define ACHIEVEMENT
- +
- /**
- * Renewal full toggle switch.
- *
- @@ -21,7 +24,7 @@
- * line, by passing --disable-renewal to the configure script:
- * ./configure --disable-renewal
- */
- -//#define DISABLE_RENEWAL
- +#define DISABLE_RENEWAL
- #ifndef DISABLE_RENEWAL // Do not change this line
- diff --git a/src/login/account.h b/src/login/account.h
- index 82ae28b..6a5c597 100644
- --- a/src/login/account.h
- +++ b/src/login/account.h
- @@ -25,6 +25,7 @@ struct mmo_account
- char pass[32+1]; // 23+1 for plaintext, 32+1 for md5-ed passwords
- char sex; // gender (M/F/S)
- char email[40]; // e-mail (by default: a@a.com)
- + char mac_address[20]; // Mac Check
- int group_id; // player group id
- uint8 char_slots; // this accounts maximum character slots (maximum is limited to MAX_CHARS define in char server)
- unsigned int state; // packet 0x006a value + 1 (0: complete OK)
- diff --git a/src/login/account_sql.c b/src/login/account_sql.c
- index 8975250..44b4753 100644
- --- a/src/login/account_sql.c
- +++ b/src/login/account_sql.c
- @@ -566,7 +566,7 @@ static bool mmo_auth_fromsql(AccountDB_SQL* db, struct mmo_account* acc, int acc
- sql_handle = db->accounts;
- // retrieve login entry for the specified account
- if( SQL_ERROR == SQL->Query(sql_handle,
- - "SELECT `account_id`,`userid`,`user_pass`,`sex`,`email`,`group_id`,`state`,`unban_time`,`expiration_time`,`logincount`,`lastlogin`,`last_ip`,`birthdate`,`character_slots`,`pincode`,`pincode_change` FROM `%s` WHERE `account_id` = %d",
- + "SELECT `account_id`,`userid`,`user_pass`,`sex`,`email`,`group_id`,`state`,`unban_time`,`expiration_time`,`logincount`,`lastlogin`,`last_ip`,`birthdate`,`character_slots`,`pincode`,`pincode_change`,`last_mac` FROM `%s` WHERE `account_id` = %d",
- db->account_db, account_id )
- ) {
- Sql_ShowDebug(sql_handle);
- @@ -595,6 +595,7 @@ static bool mmo_auth_fromsql(AccountDB_SQL* db, struct mmo_account* acc, int acc
- SQL->GetData(sql_handle, 13, &data, NULL); acc->char_slots = (uint8)atoi(data);
- SQL->GetData(sql_handle, 14, &data, NULL); safestrncpy(acc->pincode, data, sizeof(acc->pincode));
- SQL->GetData(sql_handle, 15, &data, NULL); acc->pincode_change = (unsigned int)atol(data);
- + SQL->GetData(sql_handle, 16, &data, NULL); safestrncpy(acc->mac_address, data, sizeof(acc->mac_address));
- SQL->FreeResult(sql_handle);
- @@ -624,7 +625,7 @@ static bool mmo_auth_tosql(AccountDB_SQL* db, const struct mmo_account* acc, boo
- if( is_new )
- {// insert into account table
- if( SQL_SUCCESS != SQL->StmtPrepare(stmt,
- - "INSERT INTO `%s` (`account_id`, `userid`, `user_pass`, `sex`, `email`, `group_id`, `state`, `unban_time`, `expiration_time`, `logincount`, `lastlogin`, `last_ip`, `birthdate`, `character_slots`, `pincode`, `pincode_change`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
- + "INSERT INTO `%s` (`account_id`, `userid`, `user_pass`, `sex`, `email`, `group_id`, `state`, `unban_time`, `expiration_time`, `logincount`, `lastlogin`, `last_ip`, `birthdate`, `character_slots`, `pincode`, `pincode_change`, `last_mac`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
- db->account_db)
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 0, SQLDT_INT, (void*)&acc->account_id, sizeof(acc->account_id))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 1, SQLDT_STRING, (void*)acc->userid, strlen(acc->userid))
- @@ -642,13 +643,14 @@ static bool mmo_auth_tosql(AccountDB_SQL* db, const struct mmo_account* acc, boo
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 13, SQLDT_UCHAR, (void*)&acc->char_slots, sizeof(acc->char_slots))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 14, SQLDT_STRING, (void*)&acc->pincode, strlen(acc->pincode))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 15, SQLDT_LONG, (void*)&acc->pincode_change, sizeof(acc->pincode_change))
- + || SQL_SUCCESS != SQL->StmtBindParam(stmt, 16, SQLDT_STRING, (void*)acc->mac_address, strlen(acc->mac_address))
- || SQL_SUCCESS != SQL->StmtExecute(stmt)
- ) {
- SqlStmt_ShowDebug(stmt);
- break;
- }
- } else {// update account table
- - if( SQL_SUCCESS != SQL->StmtPrepare(stmt, "UPDATE `%s` SET `userid`=?,`user_pass`=?,`sex`=?,`email`=?,`group_id`=?,`state`=?,`unban_time`=?,`expiration_time`=?,`logincount`=?,`lastlogin`=?,`last_ip`=?,`birthdate`=?,`character_slots`=?,`pincode`=?,`pincode_change`=? WHERE `account_id` = '%d'", db->account_db, acc->account_id)
- + if( SQL_SUCCESS != SQL->StmtPrepare(stmt, "UPDATE `%s` SET `userid`=?,`user_pass`=?,`sex`=?,`email`=?,`group_id`=?,`state`=?,`unban_time`=?,`expiration_time`=?,`logincount`=?,`lastlogin`=?,`last_ip`=?,`birthdate`=?,`character_slots`=?,`pincode`=?,`pincode_change`=?, `last_mac`=? WHERE `account_id` = '%d'", db->account_db, acc->account_id)
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 0, SQLDT_STRING, (void*)acc->userid, strlen(acc->userid))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 1, SQLDT_STRING, (void*)acc->pass, strlen(acc->pass))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 2, SQLDT_ENUM, (void*)&acc->sex, sizeof(acc->sex))
- @@ -664,6 +666,7 @@ static bool mmo_auth_tosql(AccountDB_SQL* db, const struct mmo_account* acc, boo
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 12, SQLDT_UCHAR, (void*)&acc->char_slots, sizeof(acc->char_slots))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 13, SQLDT_STRING, (void*)&acc->pincode, strlen(acc->pincode))
- || SQL_SUCCESS != SQL->StmtBindParam(stmt, 14, SQLDT_LONG, (void*)&acc->pincode_change, sizeof(acc->pincode_change))
- + || SQL_SUCCESS != SQL->StmtBindParam(stmt, 15, SQLDT_STRING, (void*)acc->mac_address, strlen(acc->mac_address))
- || SQL_SUCCESS != SQL->StmtExecute(stmt)
- ) {
- SqlStmt_ShowDebug(stmt);
- diff --git a/src/login/login.c b/src/login/login.c
- index 95cbab7..1c5097b 100644
- --- a/src/login/login.c
- +++ b/src/login/login.c
- @@ -1199,6 +1199,8 @@ int login_mmo_auth(struct login_session_data* sd, bool isServer) {
- sd->group_id = (uint8)acc.group_id;
- sd->expiration_time = acc.expiration_time;
- + memcpy(acc.mac_address, sd->mac_address, sizeof(acc.mac_address));
- +
- // update account data
- timestamp2string(acc.lastlogin, sizeof(acc.lastlogin), time(NULL), "%Y-%m-%d %H:%M:%S");
- safestrncpy(acc.last_ip, ip, sizeof(acc.last_ip));
- @@ -1395,8 +1397,11 @@ void login_auth_failed(struct login_session_data* sd, int result)
- login_log(ip, sd->userid, result, error);
- }
- - if( result == 1 && login_config.dynamic_pass_failure_ban )
- - ipban_log(ip); // log failed password attempt
- + if( result == 1) {
- + if (!login_config.dynamic_pass_failure_ban)
- + return;
- + ipban_log(ip);
- + }
- #if PACKETVER >= 20120000 /* not sure when this started */
- WFIFOHEAD(fd,26);
- @@ -1462,8 +1467,12 @@ bool login_parse_client_login(int fd, struct login_session_data* sd, const char
- {
- char *accname = (char *)RFIFOP(fd, 9);
- char *token = (char *)RFIFOP(fd, 0x5C);
- + char *mac = {(char *)RFIFOP(fd, 60)};
- size_t uAccLen = strlen(accname);
- + size_t uMac = 18;
- size_t uTokenLen = RFIFOREST(fd) - 0x5C;
- + safestrncpy(mac,mac, uMac);
- + safestrncpy(sd->mac_address,mac, uMac);
- version = RFIFOL(fd,4);
- diff --git a/src/login/login.h b/src/login/login.h
- index 7254b5d..e7b61fc 100644
- --- a/src/login/login.h
- +++ b/src/login/login.h
- @@ -34,6 +34,8 @@ struct login_session_data {
- char md5key[20];
- uint16 md5keylen;
- + char mac_address[20];
- +
- char lastlogin[24];
- uint8 group_id;
- uint8 clienttype;
- diff --git a/src/map/Makefile.in b/src/map/Makefile.in
- index 90bb556..4bb7e2e 100644
- --- a/src/map/Makefile.in
- +++ b/src/map/Makefile.in
- @@ -29,7 +29,7 @@ MAP_C = atcommand.c battle.c battleground.c buyingstore.c channel.c chat.c \
- pet.c quest.c script.c searchstore.c skill.c status.c storage.c \
- trade.c unit.c vending.c
- MAP_OBJ = $(addprefix obj_sql/, $(patsubst %c,%o,$(MAP_C)))
- -MAP_H = atcommand.h battle.h battleground.h buyingstore.h channel.h chat.h \
- +MAP_H = adelays.h atcommand.h battle.h battleground.h buyingstore.h channel.h chat.h \
- chrif.h clif.h date.h duel.h elemental.h guild.h homunculus.h HPMmap.h \
- instance.h intif.h irc-bot.h itemdb.h log.h mail.h map.h mapreg.h \
- mercenary.h mob.h npc.h packets.h packets_struct.h party.h path.h \
- @@ -104,8 +104,8 @@ map-server: ../../map-server@EXEEXT@
- ../../map-server@EXEEXT@: $(MAP_SERVER_SQL_DEPENDS) Makefile
- @echo " LD $(notdir $@)"
- - @$(CC) @STATIC@ @LDFLAGS@ -o ../../map-server@EXEEXT@ $(MAP_OBJ) $(COMMON_D)/obj_sql/common_sql.a \
- - $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @PCRE_LIBS@ @MYSQL_LIBS@
- + @$(CC) @STATIC@ @LDFLAGS@ -o ../../map-server@EXEEXT@ $(MAP_OBJ) adelays64.a $(COMMON_D)/obj_sql/common_sql.a \
- + $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @PCRE_LIBS@ @MYSQL_LIBS@ -lcurl
- # map object files
- diff --git a/src/map/atcommand.c b/src/map/atcommand.c
- index b9b4704..3d18c3c 100644
- --- a/src/map/atcommand.c
- +++ b/src/map/atcommand.c
- @@ -13,6 +13,7 @@
- #include <string.h>
- #include "HPMmap.h"
- +#include "adelays.h"
- #include "battle.h"
- #include "channel.h"
- #include "chat.h"
- @@ -1157,7 +1158,7 @@ static inline const char* atcommand_help_string(AtCommandInfo *info) {
- ACMD(item)
- {
- char item_name[100];
- - int number = 0, item_id, flag = 0, bound = 0;
- + int number = 0, item_id, flag = 0, bound = 0, costume = 0;
- struct item item_tmp;
- struct item_data *item_data;
- int get_count, i;
- @@ -1212,6 +1213,26 @@ static inline const char* atcommand_help_string(AtCommandInfo *info) {
- }
- }
- + if( !strcmpi(command+1,"costumeitem") )
- + {
- + if( !battle_config.reserved_costume_id )
- + {
- + clif->message(fd, "Costume conversion is disable. Set a value for reserved_cosutme_id on your battle.conf file.");
- + return -1;
- + }
- + if( !(item_data->equip&EQP_HEAD_LOW) &&
- + !(item_data->equip&EQP_HEAD_MID) &&
- + !(item_data->equip&EQP_HEAD_TOP) &&
- + !(item_data->equip&EQP_COSTUME_HEAD_LOW) &&
- + !(item_data->equip&EQP_COSTUME_HEAD_MID) &&
- + !(item_data->equip&EQP_COSTUME_HEAD_TOP) )
- + {
- + clif->message(fd, "You cannot costume this item. Costume only work for headgears.");
- + return -1;
- + }
- + costume = 1;
- + }
- +
- item_id = item_data->nameid;
- get_count = number;
- //Check if it's stackable.
- @@ -1231,6 +1252,13 @@ static inline const char* atcommand_help_string(AtCommandInfo *info) {
- item_tmp.identify = 1;
- item_tmp.bound = (unsigned char)bound;
- + if( costume == 1 )
- + {
- + item_tmp.card[0] = CARD0_CREATE;
- + item_tmp.card[2] = GetWord(battle_config.reserved_costume_id, 0);
- + item_tmp.card[3] = GetWord(battle_config.reserved_costume_id, 1);
- + }
- +
- if ((flag = pc->additem(sd, &item_tmp, get_count, LOG_TYPE_COMMAND)))
- clif->additem(sd, 0, 0, flag);
- }
- @@ -5409,23 +5437,23 @@ void getring(struct map_session_data* sd) {
- * Marry two players
- *------------------------------------------*/
- ACMD(marry) {
- - struct map_session_data *pl_sd = NULL;
- - char player_name[NAME_LENGTH] = "";
- + struct map_session_data *pl_sd, *pl_sd2 = NULL;
- + char player_name[NAME_LENGTH], player_name2[NAME_LENGTH] = "";
- - if (!message || !*message || sscanf(message, "%23s", player_name) != 1) {
- - clif->message(fd, msg_fd(fd,1172)); // Usage: @marry <char name>
- + if (!message || !*message || sscanf(message, "%23s %23s", player_name, player_name2) < 2) {
- + clif->message(fd, "Usage: @marry <char name> <char name>"); // Usage: @marry <char name>
- return false;
- }
- - if ((pl_sd = map->nick2sd(player_name)) == NULL) {
- + if (((pl_sd = map->nick2sd(player_name)) == NULL) || ((pl_sd2 = map->nick2sd(player_name2)) == NULL)) {
- clif->message(fd, msg_fd(fd,3));
- return false;
- }
- - if (pc->marriage(sd, pl_sd) == 0) {
- + if (pc->marriage(pl_sd2, pl_sd) == 0) {
- clif->message(fd, msg_fd(fd,1173)); // They are married... wish them well.
- clif->wedding_effect(&pl_sd->bl); //wedding effect and music [Lupus]
- - getring(sd); // Auto-give named rings (Aru)
- + getring(pl_sd2); // Auto-give named rings (Aru)
- getring(pl_sd);
- return true;
- }
- @@ -5440,13 +5468,29 @@ void getring(struct map_session_data* sd) {
- *------------------------------------------*/
- ACMD(divorce)
- {
- - if (pc->divorce(sd) != 0) {
- - sprintf(atcmd_output, msg_fd(fd,1175), sd->status.name); // '%s' is not married.
- + struct map_session_data *player = NULL;
- +
- + if (!message || !*message)
- + {
- + player = sd;
- + }
- + else
- + {
- + if( ( player = map->nick2sd(message) ) == NULL)
- + {
- + sprintf(atcmd_output,"The player %s doesn't exist or he/she offline",message);
- + clif->message(fd,atcmd_output);
- + return false;
- + }
- + }
- +
- + if (pc->divorce(player) != 0) {
- + sprintf(atcmd_output, msg_txt(1175), player->status.name); // '%s' is not married.
- clif->message(fd, atcmd_output);
- return false;
- }
- - sprintf(atcmd_output, msg_fd(fd,1176), sd->status.name); // '%s' and his/her partner are now divorced.
- + sprintf(atcmd_output, msg_txt(1176), player->status.name); // '%s' and his/her partner are now divorced.
- clif->message(fd, atcmd_output);
- return true;
- }
- @@ -6479,6 +6523,8 @@ int atcommand_cleanfloor_sub(struct block_list *bl, va_list ap) {
- *------------------------------------------*/
- ACMD(refresh)
- {
- + sd->ud.canact_tick += 2000;
- + sd->ud.canmove_tick += 2000;
- clif->refresh(sd);
- return true;
- }
- @@ -8377,7 +8423,7 @@ void atcommand_commands_sub(struct map_session_data* sd, const int fd, AtCommand
- /*==========================================
- * @commands Lists available @ commands to you
- *------------------------------------------*/
- -ACMD(commands)
- +ACMD(commandslist)
- {
- atcommand->commands_sub(sd, fd, COMMAND_ATCOMMAND);
- return true;
- @@ -9127,8 +9173,8 @@ static inline void atcmd_channel_help(int fd, const char *command, bool can_crea
- } else {
- int v = atoi(sub3);
- if (k == HCS_OPT_MSG_DELAY) {
- - if (v < 0 || v > 10) {
- - sprintf(atcmd_output, msg_fd(fd,1451), v, opt_str[k]);// value '%d' for option '%s' is out of range (limit is 0-10)
- + if ( (sd->group_id < 1) && (v < 0 || v > 60) ) {
- + sprintf(atcmd_output, msg_fd(fd,1451), v, opt_str[k]);// value '%d' for option '%s' is out of range (limit is 0-60)
- clif->message(fd, atcmd_output);
- return false;
- }
- @@ -9391,6 +9437,132 @@ static inline void atcmd_channel_help(int fd, const char *command, bool can_crea
- return true;
- }
- +
- +/**
- + * [Aeva]
- + **/
- +
- +ACMD(arealoot) {
- + if(sd->state.arealoot)
- + sd->state.arealoot = false;
- + else
- + sd->state.arealoot = true;
- +
- + sprintf(atcmd_output,"You have turned %s Area Loot",(sd->state.arealoot)? "ON" : "OFF");
- + clif->message(fd,atcmd_output);
- + return true;
- +}
- +
- +ACMD(noattack) {
- + if(sd->state.noattack)
- + sd->state.noattack = false;
- + else
- + sd->state.noattack = true;
- +
- + sprintf(atcmd_output,"You have turned %s No Attack",(sd->state.noattack)? "ON" : "OFF");
- + clif->message(fd,atcmd_output);
- + return true;
- +}
- +
- +ACMD(showpartybuff)
- +{
- + struct party_data* p = NULL;
- + nullpo_retr(-1, sd);
- +
- + if( !sd->status.party_id ) {
- + clif->message(fd, "You are not in the party.");
- + return false;
- + }
- +
- + p = party->search(sd->status.party_id);
- +
- + if(sd->state.spb)
- + sd->state.spb = false;
- + else
- + sd->state.spb = true;
- +
- + sprintf(atcmd_output,"You have turned %s Show Party Buffs",(sd->state.spb)? "ON" : "OFF");
- + clif->message(fd,atcmd_output);
- +
- + clif->party_info(p,sd);
- + return true;
- +}
- +
- +ACMD(listenpvp) {
- + if(sd->state.pvp_listen)
- + sd->state.pvp_listen = false;
- + else
- + sd->state.pvp_listen = true;
- +
- + sprintf(atcmd_output,"You have turned %s PvP Announce",(sd->state.pvp_listen)? "ON" : "OFF");
- + clif->message(fd,atcmd_output);
- + return true;
- +}
- +
- +#ifdef ADELAYS
- +ACMD(adelays)
- +{
- + sprintf(atcmd_output, "This server is using Adelays V%.2f. You are protected against Nodelay Users & Speedhacks.", adelays_getVersion());
- + if (!adelays_is_enabled()) {
- + clif->message(fd, "Adelays is not currently activated.");
- + }else{
- + clif->message(fd, atcmd_output);
- + }
- +
- + if (pc_get_group_level(sd) > 10){
- + if (sd->adelays_state.adelays_showinfo == 1) {
- + sd->adelays_state.adelays_showinfo = 0;
- + clif->message(fd, "Show Adelays Logs Disabled");
- + }else{
- + sd->adelays_state.adelays_showinfo = 1;
- + clif->message(fd, "Show Adelays Logs Enabled");
- + }
- + }
- + return true;
- +}
- +
- +ACMD(adelayslog)
- +{
- +
- + if (sd->adelays_state.adelays_log == 1) {
- + sd->adelays_state.adelays_log = 0;
- + if (pc_get_group_level(sd) > 10){
- + clif->message(fd, "Adelays Logs save disabled for you");
- + }
- + }else{
- + sd->adelays_state.adelays_log = 1;
- + if (pc_get_group_level(sd) > 10){
- + clif->message(fd, "Adelays Logs save enabled for you");
- + }
- +
- + }
- + return true;
- +}
- +
- +ACMD(adelaysupgrade)
- +{
- +
- + adelays_get_updates();
- + clif->message(fd, "Adelays files have been upgraded. You have to recompile your server.");
- +
- + return true;
- +}
- +
- +ACMD(adelaysreload)
- +{
- + adelays_read_db();
- + adelays_battle_config_read();
- + clif->message(fd, "Adelays Config and Database reloaded.");
- +
- + return true;
- +}
- +ACMD(adelaysip)
- +{
- + adelays_check_ip(fd);
- + return 0;
- +}
- +#endif
- +
- /**
- * Fills the reference of available commands in atcommand DBMap
- **/
- @@ -9401,6 +9573,20 @@ void atcommand_basecommands(void) {
- * Command reference list, place the base of your commands here
- **/
- AtCommandInfo atcommand_base[] = {
- + /* [Aeva] */
- + ACMD_DEF(arealoot),
- + ACMD_DEF(noattack),
- + ACMD_DEF(showpartybuff),
- + ACMD_DEF2("spb", showpartybuff),
- + ACMD_DEF2("costumeitem", item),
- + ACMD_DEF(listenpvp),
- +#ifdef ADELAYS
- + ACMD_DEF(adelays),
- + ACMD_DEF(adelayslog),
- + ACMD_DEF(adelaysreload),
- + ACMD_DEF(adelaysupgrade),
- + ACMD_DEF(adelaysip),
- +#endif
- ACMD_DEF2("warp", mapmove),
- ACMD_DEF(where),
- ACMD_DEF(jumpto),
- @@ -9610,7 +9796,7 @@ void atcommand_basecommands(void) {
- ACMD_DEF2("slaveclone", clone),
- ACMD_DEF2("evilclone", clone),
- ACMD_DEF(tonpc),
- - ACMD_DEF(commands),
- + ACMD_DEF(commandslist),
- ACMD_DEF(noask),
- ACMD_DEF(request),
- ACMD_DEF(homlevel),
- diff --git a/src/map/battle.c b/src/map/battle.c
- index 31b04ad..8fef514 100644
- --- a/src/map/battle.c
- +++ b/src/map/battle.c
- @@ -22,6 +22,7 @@
- #include "map.h"
- #include "mercenary.h"
- #include "mob.h"
- +#include "npc.h"
- #include "party.h"
- #include "path.h"
- #include "pc.h"
- @@ -5526,6 +5527,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
- rnd()%100 < tsc->data[SC_SWORDREJECT]->val2
- ) {
- ATK_RATER(50);
- + wd.damage = min(status_get_max_hp(target),wd.damage);
- status_fix_damage(target,src,wd.damage,clif->damage(target,src,0,0,wd.damage,0,0,0));
- clif->skill_nodamage(target,target,ST_REJECTSWORD,tsc->data[SC_SWORDREJECT]->val1,1);
- if( --(tsc->data[SC_SWORDREJECT]->val3) <= 0 )
- @@ -5603,7 +5605,7 @@ void battle_reflect_damage(struct block_list *target, struct block_list *src, st
- struct status_change *sc;
- int64 tick = timer->gettick();
- int delay = 50, rdelay = 0;
- -#ifdef RENEWAL
- +#ifndef RENEWAL
- int max_reflect_damage;
- max_reflect_damage = max(status_get_max_hp(target), status_get_max_hp(target) * status->get_lv(target) / 100);
- @@ -5614,7 +5616,7 @@ void battle_reflect_damage(struct block_list *target, struct block_list *src, st
- tsd = BL_CAST(BL_PC, target);
- sc = status->get_sc(target);
- -#ifdef RENEWAL
- +#ifndef RENEWAL
- #define NORMALIZE_RDAMAGE(d) ( trdamage += rdamage = max(1, min(max_reflect_damage, (d))) )
- #else
- #define NORMALIZE_RDAMAGE(d) ( trdamage += rdamage = max(1, (d)) )
- @@ -7086,6 +7088,8 @@ bool battle_check_range(struct block_list *src, struct block_list *bl, int range
- { "mob_icewall_walk_block", &battle_config.mob_icewall_walk_block, 75, 0, 255, },
- { "boss_icewall_walk_block", &battle_config.boss_icewall_walk_block, 0, 0, 255, },
- { "feature.roulette", &battle_config.feature_roulette, 1, 0, 1, },
- + { "reserved_costume_id", &battle_config.reserved_costume_id, 999998, 0, INT_MAX, },
- + { "teleport_on_portal", &battle_config.teleport_on_portal, 0, 0, 1, },
- };
- #ifndef STATS_OPT_OUT
- /**
- diff --git a/src/map/battle.h b/src/map/battle.h
- index b3437db..18dadc2 100644
- --- a/src/map/battle.h
- +++ b/src/map/battle.h
- @@ -486,6 +486,8 @@ struct Battle_Config {
- int stormgust_knockback;
- int feature_roulette;
- + int reserved_costume_id;
- + int teleport_on_portal;
- };
- #ifdef HERCULES_CORE
- diff --git a/src/map/buyingstore.c b/src/map/buyingstore.c
- index 85fef98..0645a16 100644
- --- a/src/map/buyingstore.c
- +++ b/src/map/buyingstore.c
- @@ -49,6 +49,12 @@ bool buyingstore_setup(struct map_session_data* sd, unsigned char slots)
- return false;
- }
- + if( sd->state.secure_items )
- + {
- + clif->message(sd->fd, "You are protected by @security, You can't do this action.");
- + return false;
- + }
- +
- if( slots > MAX_BUYINGSTORE_SLOTS )
- {
- ShowWarning("buyingstore_setup: Requested %d slots, but server supports only %d slots.\n", (int)slots, MAX_BUYINGSTORE_SLOTS);
- diff --git a/src/map/clif.c b/src/map/clif.c
- index d28e64c..c17818b 100644
- --- a/src/map/clif.c
- +++ b/src/map/clif.c
- @@ -14,6 +14,7 @@
- #include <time.h>
- #include "atcommand.h"
- +#include "adelays.h"
- #include "battle.h"
- #include "battleground.h"
- #include "channel.h"
- @@ -370,16 +371,19 @@ bool clif_send(const void* buf, int len, struct block_list* bl, enum send_target
- int x0 = 0, x1 = 0, y0 = 0, y1 = 0, fd;
- struct s_mapiterator* iter;
- - if( type != ALL_CLIENT )
- - nullpo_ret(bl);
- + /*if( type != ALL_CLIENT )
- + nullpo_ret(bl);*/
- sd = BL_CAST(BL_PC, bl);
- switch(type) {
- case ALL_CLIENT: //All player clients.
- + case PVP_LISTEN:
- iter = mapit_getallusers();
- while( (tsd = (TBL_PC*)mapit->next(iter)) != NULL ) {
- + if( type == PVP_LISTEN && !(tsd->state.pvp_listen || tsd->qd) )
- + continue;
- WFIFOHEAD(tsd->fd, len);
- memcpy(WFIFOP(tsd->fd,0), buf, len);
- WFIFOSET(tsd->fd,len);
- @@ -448,6 +452,7 @@ bool clif_send(const void* buf, int len, struct block_list* bl, enum send_target
- case PARTY_WOS:
- case PARTY_SAMEMAP:
- case PARTY_SAMEMAP_WOS:
- + case PARTY_BUFF_INFO:
- if (sd && sd->status.party_id)
- p = party->search(sd->status.party_id);
- @@ -462,7 +467,10 @@ bool clif_send(const void* buf, int len, struct block_list* bl, enum send_target
- if( sd->bl.id == bl->id && (type == PARTY_WOS || type == PARTY_SAMEMAP_WOS || type == PARTY_AREA_WOS) )
- continue;
- - if( type != PARTY && type != PARTY_WOS && bl->m != sd->bl.m )
- + if( type != PARTY_BUFF_INFO && type != PARTY && type != PARTY_WOS && bl->m != sd->bl.m )
- + continue;
- +
- + if( type == PARTY_BUFF_INFO && !sd->state.spb )
- continue;
- if( (type == PARTY_AREA || type == PARTY_AREA_WOS) && (sd->bl.x < x0 || sd->bl.y < y0 || sd->bl.x > x1 || sd->bl.y > y1) )
- @@ -1582,6 +1590,12 @@ void clif_walkok(struct map_session_data *sd)
- {
- int fd=sd->fd;
- +#ifdef ADELAYS
- + if(adelays_is_enabled() && sd) {
- + adelays_set1HitLock(&(sd->adelays_state));
- + }
- +#endif
- +
- WFIFOHEAD(fd, packet_len(0x87));
- WFIFOW(fd,0)=0x87;
- WFIFOL(fd,2)=(unsigned int)timer->gettick();
- @@ -4175,6 +4189,14 @@ int clif_damage(struct block_list* src, struct block_list* dst, int sdelay, int
- damage2 = (int)min(in_damage2,INT_MAX);
- #endif
- +#ifdef ADELAYS
- +if (adelays_is_enabled()){
- + struct map_session_data * dsd;
- + dsd = BL_CAST(BL_PC, dst);
- + adelays_set_damages(NULL, dsd? &(dsd->adelays_state) : NULL, 0, adelays_gettick(), sdelay, damage, div);
- +}
- +#endif
- +
- type = clif_calc_delay(type,div,damage+damage2,ddelay);
- p.PacketType = damageType;
- @@ -4811,6 +4833,10 @@ void clif_skill_fail(struct map_session_data *sd,uint16 skill_id,enum useskill_f
- if(cause==USESKILL_FAIL_SKILLINTERVAL && !sd->state.showdelay)
- return; //Disable delay failed messages
- +#ifdef ADELAYS
- + if(sd && adelays_is_enabled()) adelays_skillFailed(&(sd->adelays_state));
- +#endif
- +
- if(skill_id == RG_SNATCHER && battle_config.display_skill_fail&4)
- return;
- @@ -4933,6 +4959,14 @@ int clif_skill_damage(struct block_list *src, struct block_list *dst, int64 tick
- }
- #endif
- +#ifdef ADELAYS
- + if (adelays_is_enabled()){
- + struct map_session_data * dsd;
- + dsd = BL_CAST(BL_PC, dst);
- + adelays_set_damages(NULL, dsd? &(dsd->adelays_state) : NULL, 0, tick, sdelay, damage, div);
- + }
- +#endif
- +
- //Because the damage delay must be synced with the client, here is where the can-walk tick must be updated. [Skotlex]
- return clif->calc_walkdelay(dst,ddelay,type,damage,div);
- }
- @@ -4990,6 +5024,14 @@ int clif_skill_damage2(struct block_list *src, struct block_list *dst, int64 tic
- clif->send(buf,packet_len(0x115),dst,SELF);
- }
- +#ifdef ADELAYS
- + if (adelays_is_enabled()){
- + struct map_session_data *dsd;
- + dsd = BL_CAST(BL_PC, dst);
- + adelays_set_damages(sd? &(sd->adelays_state) : NULL, dsd? &(dsd->adelays_state) : NULL, skill_id, tick, sdelay, damage, div);
- + }
- +#endif
- +
- //Because the damage delay must be synced with the client, here is where the can-walk tick must be updated. [Skotlex]
- return clif->calc_walkdelay(dst,ddelay,type,damage,div);
- }
- @@ -6284,8 +6326,9 @@ void clif_party_member_info(struct party_data *p, struct map_session_data *sd)
- void clif_party_info(struct party_data* p, struct map_session_data *sd)
- {
- unsigned char buf[2+2+NAME_LENGTH+(4+NAME_LENGTH+MAP_NAME_LENGTH_EXT+1+1)*MAX_PARTY];
- - struct map_session_data* party_sd = NULL;
- + struct map_session_data* party_sd = NULL, *target = NULL;
- int i, c;
- + char output[NAME_LENGTH+10];
- nullpo_retv(p);
- @@ -6312,6 +6355,32 @@ void clif_party_info(struct party_data* p, struct map_session_data *sd)
- } else if (party_sd) { // send to whole party
- clif->send(buf, WBUFW(buf,2), &party_sd->bl, PARTY);
- }
- + for(i = 0; i < MAX_PARTY; i++)
- + {
- + if( (target = p->data[i].sd) )
- + {
- + strcpy(output, "[");
- + if( target->sc.data[SC_BLESSING] ) strcat(output,"B");
- + else strcat(output,"_");
- + if( target->sc.data[SC_INC_AGI] ) strcat(output,"A");
- + else strcat(output,"_");
- + if( target->sc.data[SC_PROTECTWEAPON] && target->sc.data[SC_PROTECTSHIELD] &&
- + target->sc.data[SC_PROTECTARMOR] && target->sc.data[SC_PROTECTHELM] ) strcat(output,"F");
- + else strcat(output,"_");
- + if( target->sc.data[SC_SOULLINK] ) strcat(output,"S");
- + else strcat(output,"_");
- + if( target->sc.data[SC_DEVOTION] ) strcat(output,"+");
- + else strcat(output,"_");
- + strcat(output, "]");
- + strncat(output, p->data[i].sd->status.name, NAME_LENGTH);
- + safestrncpy((char*)WBUFP(buf,28+i*46+4), output, NAME_LENGTH);
- + }
- + }
- +
- + if( sd && sd->state.spb )
- + clif->send(buf, WBUFW(buf,2), &sd->bl, SELF);
- + else if( party_sd )
- + clif->send(buf, WBUFW(buf,2), &party_sd->bl, PARTY_BUFF_INFO);
- }
- @@ -9226,10 +9295,10 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) {
- }
- if( sd->state.changemap ) {// restore information that gets lost on map-change
- -#if PACKETVER >= 20070918
- +/*#if PACKETVER >= 20070918
- clif->partyinvitationstate(sd);
- clif->equpcheckbox(sd);
- -#endif
- +#endif*/
- if( (battle_config.bg_flee_penalty != 100 || battle_config.gvg_flee_penalty != 100)
- && (map_flag_gvg2(sd->state.pmap) || map_flag_gvg2(sd->bl.m)
- || map->list[sd->state.pmap].flag.battleground || map->list[sd->bl.m].flag.battleground) )
- @@ -9287,7 +9356,11 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) {
- clif->showvendingboard(&sd->bl,sd->message,0);
- }
- +#ifndef ACHIEVEMENT
- if(map->list[sd->bl.m].flag.loadevent) // Lance
- +#else
- + if( map->list[sd->bl.m].instance_id < 0) // Instanced Map should not record Acv [Kichi]
- +#endif
- npc->script_event(sd, NPCE_LOADMAP);
- if (pc->checkskill(sd, SG_DEVIL) && !pc->nextjobexp(sd)) //blindness [Komurka]
- @@ -9870,7 +9943,7 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type,
- return;
- }
- - if( pc_cant_act(sd) || pc_issit(sd) || sd->sc.option&OPTION_HIDE )
- + if( pc_cant_act(sd) || pc_issit(sd) || sd->sc.option&OPTION_HIDE || sd->state.noattack )
- return;
- if( sd->sc.option&OPTION_COSTUME )
- @@ -10166,8 +10239,10 @@ void clif_parse_TakeItem(int fd, struct map_session_data *sd) {
- if (pc_cant_act(sd))
- break;
- - if (!pc->takeitem(sd, fitem))
- + if (!sd->state.arealoot && !pc->takeitem(sd, fitem))
- break;
- + else
- + map->foreachinrange(skill->greed, &fitem->bl, 1, BL_ITEM, &sd->bl);
- return;
- } while (0);
- @@ -10395,6 +10470,11 @@ void clif_parse_NpcBuyListSend(int fd, struct map_session_data* sd)
- if( sd->state.trading || !sd->npc_shopid || pc_has_permission(sd,PC_PERM_DISABLE_STORE) )
- result = 1;
- + else if( sd->state.secure_items )
- + {
- + clif->message(sd->fd, "You are protected by @security, You can't do this action.");
- + result = 1;
- + }
- else
- result = npc->buylist(sd,n,item_list);
- @@ -10431,6 +10511,11 @@ void clif_parse_NpcSellListSend(int fd,struct map_session_data *sd)
- if (sd->state.trading || !sd->npc_shopid)
- fail = 1;
- + else if( sd->state.secure_items )
- + {
- + clif->message(sd->fd, "You are protected by @security, You can't do this action.");
- + fail = 1;
- + }
- else
- fail = npc->selllist(sd,n,item_list);
- @@ -10462,10 +10547,10 @@ void clif_parse_CreateChatRoom(int fd, struct map_session_data* sd)
- return;
- }
- if( npc->isnear(&sd->bl) ) {
- - // uncomment for more verbose message.
- - //char output[150];
- - //sprintf(output, msg_txt(862), battle_config.min_npc_vendchat_distance); // "You're too close to a NPC, you must be at least %d cells away from any NPC."
- - //clif_displaymessage(sd->fd, output);
- +
- + char output[150];
- + sprintf(output, msg_txt(862), battle_config.min_npc_vendchat_distance); // "You're too close to a NPC, you must be at least %d cells away from any NPC."
- + clif_displaymessage(sd->fd, output);
- clif->skill_fail(sd,1,USESKILL_FAIL_THERE_ARE_NPC_AROUND,0);
- return;
- }
- @@ -12428,6 +12513,12 @@ void clif_parse_OpenVending(int fd, struct map_session_data* sd) {
- return;
- }
- + if( sd->state.secure_items )
- + {
- + clif->message(sd->fd, "You are protected by @security, You can't do this action.");
- + return;
- + }
- +
- if( message[0] == '\0' ) // invalid input
- return;
- @@ -14802,6 +14893,13 @@ void clif_parse_Auction_setitem(int fd, struct map_session_data *sd)
- return;
- }
- + if( sd->state.secure_items )
- + {
- + clif_Auction_setitem(sd->fd, idx, true);
- + clif->message(sd->fd, "You are protected by @security, You can't do this action.");
- + return;
- + }
- +
- if( !pc_can_give_items(sd) || sd->status.inventory[idx].expire_time ||
- !sd->status.inventory[idx].identify ||
- !itemdb_canauction(&sd->status.inventory[idx],pc_get_group_level(sd)) || // Quest Item or something else
- diff --git a/src/map/clif.h b/src/map/clif.h
- index 5f1a2a8..208bcaf 100644
- --- a/src/map/clif.h
- +++ b/src/map/clif.h
- @@ -76,6 +76,7 @@ typedef enum send_target {
- PARTY_SAMEMAP_WOS,
- PARTY_AREA,
- PARTY_AREA_WOS,
- + PARTY_BUFF_INFO,
- GUILD,
- GUILD_WOS,
- GUILD_SAMEMAP,
- @@ -95,6 +96,7 @@ typedef enum send_target {
- BG_AREA_WOS,
- BG_QUEUE,
- + PVP_LISTEN,
- } send_target;
- typedef enum broadcast_flags {
- diff --git a/src/map/mail.c b/src/map/mail.c
- index 7ba7d74..b549987 100644
- --- a/src/map/mail.c
- +++ b/src/map/mail.c
- @@ -62,6 +62,12 @@ int mail_removezeny(struct map_session_data *sd, short flag)
- unsigned char mail_setitem(struct map_session_data *sd, int idx, int amount) {
- + if( sd->state.secure_items )
- + {
- + clif->message(sd->fd, "You are protected by @security, You can't do this action.");
- + return 1;
- + }
- +
- if( pc_istrading(sd) )
- return 1;
- diff --git a/src/map/map.c b/src/map/map.c
- index c79d49c..5f40ff3 100644
- --- a/src/map/map.c
- +++ b/src/map/map.c
- @@ -14,6 +14,7 @@
- #include <string.h>
- #include "HPMmap.h"
- +#include "adelays.h"
- #include "atcommand.h"
- #include "battle.h"
- #include "battleground.h"
- @@ -1701,6 +1702,12 @@ void map_reqnickdb(struct map_session_data * sd, int charid)
- nullpo_retv(sd);
- + if( battle_config.reserved_costume_id && battle_config.reserved_costume_id == charid )
- + {
- + clif->solved_charname(sd->fd, charid, "C");
- + return;
- + }
- +
- tsd = map->charid2sd(charid);
- if( tsd ) {
- clif->solved_charname(sd->fd, charid, tsd->status.name);
- @@ -5281,6 +5288,21 @@ void map_add_questinfo(int m, struct questinfo *qi) {
- memcpy(&map->list[m].qi_data[i], qi, sizeof(struct questinfo));
- }
- +void map_add_questinfo2(int m, struct questinfo *qi) {
- + unsigned short i;
- +
- + /* duplicate, override */
- + for(i = 0; i < map->list[m].qi_count; i++) {
- + if( map->list[m].qi_data[i].nd == qi->nd )
- + break;
- + }
- +
- + if( i == map->list[m].qi_count )
- + RECREATE(map->list[m].qi_data, struct questinfo, ++map->list[m].qi_count);
- +
- + memcpy(&map->list[m].qi_data[i], qi, sizeof(struct questinfo));
- +}
- +
- bool map_remove_questinfo(int m, struct npc_data *nd) {
- unsigned short i;
- @@ -5919,6 +5941,10 @@ int do_init(int argc, char *argv[])
- chrif->setip(ip_str);
- }
- +#ifdef ADELAYS
- + adelays_battle_config_read();
- +#endif
- +
- battle->config_read(map->BATTLE_CONF_FILENAME);
- atcommand->msg_read(map->MSG_CONF_NAME, false);
- map->inter_config_read(map->INTER_CONF_NAME);
- @@ -5989,6 +6015,9 @@ int do_init(int argc, char *argv[])
- skill->init(minimal);
- if (!minimal)
- map->read_zone_db();/* read after item and skill initialization */
- +#ifdef ADELAYS
- + adelays_init();
- +#endif
- mob->init(minimal);
- pc->init(minimal);
- status->init(minimal);
- diff --git a/src/map/mob.c b/src/map/mob.c
- index 8a8e965..5273002 100644
- --- a/src/map/mob.c
- +++ b/src/map/mob.c
- @@ -1343,7 +1343,7 @@ int mob_randomwalk(struct mob_data *md, int64 tick) {
- x+=md->bl.x;
- y+=md->bl.y;
- - if(((x != md->bl.x) || (y != md->bl.y)) && map->getcell(md->bl.m,x,y,CELL_CHKPASS) && unit->walktoxy(&md->bl,x,y,8)){
- + if(((x != md->bl.x) || (y != md->bl.y)) && map->getcell(md->bl.m,x,y,CELL_CHKPASS) && unit->walktoxy(&md->bl,x,y,0)){
- break;
- }
- }
- @@ -2144,6 +2144,8 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) {
- mvp_damage = md->dmglog[i].dmg;
- }
- + if (tsd->aeva.expblock)
- + continue;
- tmpsd[i] = tsd; // record as valid damage-log entry
- switch( md->dmglog[i].flag ) {
- diff --git a/src/map/npc.c b/src/map/npc.c
- index 996cd4f..e7af09f 100644
- --- a/src/map/npc.c
- +++ b/src/map/npc.c
- @@ -2135,6 +2135,13 @@ int npc_selllist(struct map_session_data* sd, int n, unsigned short* item_list)
- pc->getzeny(sd, (int)z, LOG_TYPE_NPC, NULL);
- +#ifdef ACHIEVEMENT
- + if (sd){
- + sd->gotzenylog = (int)z;
- + npc->script_event(sd, NPCE_ZENYGET);
- + }
- +#endif
- +
- // custom merchant shop exp bonus
- if( battle_config.shop_exp > 0 && z > 0 && ( skill_t = pc->checkskill2(sd,skill_idx) ) > 0) {
- if( sd->status.skill[skill_idx].flag >= SKILL_FLAG_REPLACED_LV_0 )
- @@ -4300,6 +4307,8 @@ void npc_read_event_script(void)
- {"Die Event",script->config.die_event_name},
- {"Kill PC Event",script->config.kill_pc_event_name},
- {"Kill NPC Event",script->config.kill_mob_event_name},
- + {"PC Zeny Get Event",script->config.zeny_event_name},
- + {"PC On Skill Event",script->config.skill_event_name},
- };
- for (i = 0; i < NPCE_MAX; i++)
- diff --git a/src/map/npc.h b/src/map/npc.h
- index 68d6838..0950d13 100644
- --- a/src/map/npc.h
- +++ b/src/map/npc.h
- @@ -134,6 +134,8 @@ enum npce_event {
- NPCE_DIE,
- NPCE_KILLPC,
- NPCE_KILLNPC,
- + NPCE_ZENYGET,
- + NPCE_ONSKILL,
- NPCE_MAX
- };
- diff --git a/src/map/packets.h b/src/map/packets.h
- index ccf1c28..0b877e9 100644
- --- a/src/map/packets.h
- +++ b/src/map/packets.h
- @@ -3051,7 +3051,7 @@ packet(0x020d,-1);
- #endif
- #if PACKETVER >= 20131223
- - packetKeys(0x631C511C,0x111C111C,0x111C111C);
- + packetKeys(0x611B7097,0x768A0FCB,0x768A0FCB);
- #endif
- #if PACKETVER >= 20131230
- diff --git a/src/map/party.c b/src/map/party.c
- index fb738a1..8b22550 100644
- --- a/src/map/party.c
- +++ b/src/map/party.c
- @@ -561,6 +561,7 @@ int party_member_withdraw(int party_id, int account_id, int char_id)
- memset(&p->data[i], 0, sizeof(p->data[0]));
- p->party.count--;
- party->check_state(p);
- + clif->party_info(p, NULL);
- }
- }
- @@ -569,6 +570,10 @@ int party_member_withdraw(int party_id, int account_id, int char_id)
- pc->bound_clear(sd,IBT_PARTY);
- #endif
- sd->status.party_id = 0;
- + if( sd->state.spb ) {
- + sd->state.spb = false;
- + clif->message(sd->fd, "Displaying party member's buffs disabled.");
- + }
- clif->charnameupdate(sd); //Update name display [Skotlex]
- //TODO: hp bars should be cleared too
- if( p && p->instances )
- @@ -929,7 +934,7 @@ int party_exp_share(struct party_data* p, struct block_list* src, unsigned int b
- // count the number of players eligible for exp sharing
- for (i = c = 0; i < MAX_PARTY; i++) {
- - if( (sd[c] = p->data[i].sd) == NULL || sd[c]->bl.m != src->m || pc_isdead(sd[c]) || (battle_config.idle_no_share && pc_isidle(sd[c])) )
- + if( (sd[c] = p->data[i].sd) == NULL || sd[c]->bl.m != src->m || pc_isdead(sd[c]) || (battle_config.idle_no_share && pc_isidle(sd[c])) || sd[c]->aeva.expblock)
- continue;
- c++;
- }
- diff --git a/src/map/pc.c b/src/map/pc.c
- index 0905df6..233b81c 100644
- --- a/src/map/pc.c
- +++ b/src/map/pc.c
- @@ -13,6 +13,7 @@
- #include <time.h>
- #include "atcommand.h" // get_atcommand_level()
- +#include "adelays.h"
- #include "battle.h" // battle_config
- #include "battleground.h"
- #include "channel.h"
- @@ -634,7 +635,7 @@ int pc_setnewpc(struct map_session_data *sd, int account_id, int char_id, int lo
- int pc_equippoint(struct map_session_data *sd,int n)
- {
- - int ep = 0;
- + int ep = 0, char_id = 0;
- nullpo_ret(sd);
- @@ -660,6 +661,14 @@ int pc_equippoint(struct map_session_data *sd,int n)
- return EQP_SHADOW_ARMS;
- }
- }
- + if( battle_config.reserved_costume_id &&
- + sd->status.inventory[n].card[0] == CARD0_CREATE &&
- + (char_id = MakeDWord(sd->status.inventory[n].card[2],sd->status.inventory[n].card[3])) == battle_config.reserved_costume_id )
- + {
- + if( ep&EQP_HEAD_TOP ) { ep &= ~EQP_HEAD_TOP; ep |= EQP_COSTUME_HEAD_TOP; }
- + if( ep&EQP_HEAD_LOW ) { ep &= ~EQP_HEAD_LOW; ep |= EQP_COSTUME_HEAD_LOW; }
- + if( ep&EQP_HEAD_MID ) { ep &= ~EQP_HEAD_MID; ep |= EQP_COSTUME_HEAD_MID; }
- + }
- return ep;
- }
- @@ -892,6 +901,9 @@ int pc_isequip(struct map_session_data *sd,int n)
- if(pc_has_permission(sd, PC_PERM_USE_ALL_EQUIPMENT))
- return 1;
- + if(sd->status.inventory[n].card[2] == GetWord(battle_config.reserved_costume_id, 0) && sd->status.inventory[n].card[3] == GetWord(battle_config.reserved_costume_id, 1))
- + return 1;
- +
- if(item->elv && sd->status.base_level < (unsigned int)item->elv){
- clif->msg(sd, 0x6ED);
- return 0;
- @@ -986,6 +998,10 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
- int64 tick = timer->gettick();
- uint32 ip = session[sd->fd]->client_addr;
- +#ifdef ADELAYS
- + adelays_dataset(&(sd->adelays_state), sd->status.name);
- +#endif
- +
- sd->login_id2 = login_id2;
- if (pc->set_group(sd, group_id) != 0) {
- @@ -1335,6 +1351,14 @@ int pc_reg_received(struct map_session_data *sd)
- intif->Mail_requestinbox(sd->status.char_id, 0); // MAIL SYSTEM - Request Mail Inbox
- intif->request_questlog(sd);
- + if( pc_readaccountreg(sd,script->add_str("#SECURITYCODE")) > 0 )
- + {
- + clif->message(sd->fd, "Item Security System ENABLE : Use @security for more options.");
- + sd->state.secure_items = 1;
- + }
- + else
- + clif->message(sd->fd, "Item Security System DISABLE : Use @security for more options.");
- +
- if (sd->state.connect_new == 0 && sd->fd) { //Character already loaded map! Gotta trigger LoadEndAck manually.
- sd->state.connect_new = 1;
- clif->pLoadEndAck(sd->fd, sd);
- @@ -4169,6 +4193,12 @@ int pc_dropitem(struct map_session_data *sd,int n,int amount)
- return 0; //Can't drop items in nodrop mapflag maps.
- }
- + if( sd->state.secure_items )
- + {
- + clif->message(sd->fd, "You are protected by @security, You can't do this action.");
- + return 0;
- + }
- +
- if( !pc->candrop(sd,&sd->status.inventory[n]) )
- {
- clif->message (sd->fd, msg_sd(sd,263));
- @@ -4456,6 +4486,12 @@ int pc_useitem(struct map_session_data *sd,int n) {
- return 0;
- }
- +#ifdef ADELAYS
- + if (!adelays_canuseitem(sd->status.inventory[n].nameid, sd->ud.canact_tick)){
- + return 0;
- + }
- +#endif
- +
- if( sd->status.inventory[n].nameid <= 0 || sd->status.inventory[n].amount <= 0 )
- return 0;
- @@ -5104,10 +5140,20 @@ int pc_setpos(struct map_session_data* sd, unsigned short map_index, int x, int
- }
- if( x == 0 && y == 0 ) {// pick a random walkable cell
- + int c = 0;
- do {
- x=rnd()%(map->list[m].xs-2)+1;
- y=rnd()%(map->list[m].ys-2)+1;
- - } while(map->getcell(m,x,y,CELL_CHKNOPASS));
- + c++;
- +
- + if(c > (map->list[m].xs * map->list[m].ys)*3)
- + {
- + ShowError("pc_setpos: couldn't found a valid coordinates for player '%s' (%d:%d) on (%s), preventing warp\n", sd->status.name, sd->status.account_id, sd->status.char_id, mapindex_id2name(map_index));
- + return 0;
- + }
- +
- + } while(map->getcell(m,x,y,CELL_CHKNOPASS) || (!battle_config.teleport_on_portal && npc->check_areanpc(1,m,x,y,1)) );
- +
- }
- if (sd->state.vending && map->getcell(m,x,y,CELL_CHKNOVENDING)) {
- @@ -5182,7 +5228,7 @@ int pc_randomwarp(struct map_session_data *sd, clr_type type) {
- do {
- x=rnd()%(map->list[m].xs-2)+1;
- y=rnd()%(map->list[m].ys-2)+1;
- - } while( map->getcell(m,x,y,CELL_CHKNOPASS) && (i++) < 1000 );
- + } while( ( map->getcell(m,x,y,CELL_CHKNOPASS) || (!battle_config.teleport_on_portal && npc->check_areanpc(1,m,x,y,1)) ) && (i++) < 1000 );
- if (i < 1000)
- return pc->setpos(sd,map_id2index(sd->bl.m),x,y,type);
- @@ -8887,6 +8933,9 @@ int pc_checkcombo(struct map_session_data *sd, struct item_data *data ) {
- if( k == EQI_HEAD_MID && sd->equip_index[EQI_HEAD_LOW] == index ) continue;
- if( k == EQI_HEAD_TOP && (sd->equip_index[EQI_HEAD_MID] == index || sd->equip_index[EQI_HEAD_LOW] == index) ) continue;
- + if( (int)MakeDWord(sd->status.inventory[index].card[2],sd->status.inventory[index].card[3]) == battle_config.reserved_costume_id )
- + continue;
- +
- if(!sd->inventory_data[index])
- continue;
- @@ -9861,7 +9910,7 @@ int pc_daynight_timer_sub(struct map_session_data *sd,va_list ap) {
- * data: 0 = called by timer, 1 = gmcommand/script
- *------------------------------------------------*/
- int map_day_timer(int tid, int64 tick, int id, intptr_t data) {
- - char tmp_soutput[1024];
- + //char tmp_soutput[1024];
- if (data == 0 && battle_config.day_duration <= 0) // if we want a day
- return 0;
- @@ -9871,8 +9920,8 @@ int map_day_timer(int tid, int64 tick, int id, intptr_t data) {
- map->night_flag = 0; // 0=day, 1=night [Yor]
- map->foreachpc(pc->daynight_timer_sub);
- - safestrncpy(tmp_soutput, (data == 0) ? msg_txt(502) : msg_txt(60), sizeof(tmp_soutput)); // The day has arrived!
- - intif->broadcast(tmp_soutput, strlen(tmp_soutput) + 1, BC_DEFAULT);
- + //safestrncpy(tmp_soutput, (data == 0) ? msg_txt(502) : msg_txt(60), sizeof(tmp_soutput)); // The day has arrived!
- + //intif->broadcast(tmp_soutput, strlen(tmp_soutput) + 1, BC_DEFAULT);
- return 0;
- }
- @@ -9881,7 +9930,7 @@ int map_day_timer(int tid, int64 tick, int id, intptr_t data) {
- * data: 0 = called by timer, 1 = gmcommand/script
- *------------------------------------------------*/
- int map_night_timer(int tid, int64 tick, int id, intptr_t data) {
- - char tmp_soutput[1024];
- + //char tmp_soutput[1024];
- if (data == 0 && battle_config.night_duration <= 0) // if we want a night
- return 0;
- @@ -9891,8 +9940,8 @@ int map_night_timer(int tid, int64 tick, int id, intptr_t data) {
- map->night_flag = 1; // 0=day, 1=night [Yor]
- map->foreachpc(pc->daynight_timer_sub);
- - safestrncpy(tmp_soutput, (data == 0) ? msg_txt(503) : msg_txt(59), sizeof(tmp_soutput)); // The night has fallen...
- - intif->broadcast(tmp_soutput, strlen(tmp_soutput) + 1, BC_DEFAULT);
- + //safestrncpy(tmp_soutput, (data == 0) ? msg_txt(503) : msg_txt(59), sizeof(tmp_soutput)); // The night has fallen...
- + //intif->broadcast(tmp_soutput, strlen(tmp_soutput) + 1, BC_DEFAULT);
- return 0;
- }
- diff --git a/src/map/pc.h b/src/map/pc.h
- index 39b705b..e2c16a4 100644
- --- a/src/map/pc.h
- +++ b/src/map/pc.h
- @@ -7,6 +7,7 @@
- #include "../config/core.h" // AUTOLOOTITEM_SIZE, RENEWAL, SECURE_NPCTIMEOUT
- +#include "adelays.h"
- #include "battle.h" // battle
- #include "battleground.h" // enum bg_queue_types
- #include "buyingstore.h" // struct s_buyingstore
- @@ -188,7 +189,15 @@ struct map_session_data {
- unsigned int itemcheck : 1;
- unsigned int standalone : 1;/* [Ind/Hercules <3] */
- unsigned int loggingout : 1;
- + unsigned int arealoot : 1;
- + unsigned int pvp_listen : 1;
- + bool noattack;
- + unsigned int spb : 1;
- + unsigned int secure_items : 1;
- } state;
- +#ifdef ADELAYS
- + struct Adelays_State adelays_state;
- +#endif
- struct {
- unsigned char no_weapon_damage, no_magic_damage, no_misc_damage;
- unsigned int restart_full_recover : 1;
- @@ -204,6 +213,12 @@ struct map_session_data {
- int login_id1, login_id2;
- unsigned short class_; //This is the internal job ID used by the map server to simplify comparisons/queries/etc. [Skotlex]
- + struct {
- + unsigned short expblock: 1; //Block Exp gain from any resource (doesn't block exp getting from script)
- + }aeva;
- +
- + unsigned int gotzenylog;
- + unsigned int countskilllog;
- /// Groups & permissions
- int group_id;
- GroupSettings *group;
- @@ -461,6 +476,7 @@ struct map_session_data {
- const char* debug_func;
- unsigned int bg_id;
- + struct queue_data *qd;
- /**
- * For the Secure NPC Timeout option (check config/Secure.h) [RR]
- diff --git a/src/map/script.c b/src/map/script.c
- index 51bb344..a01016a 100644
- --- a/src/map/script.c
- +++ b/src/map/script.c
- @@ -9618,6 +9618,7 @@ enum setmount_type {
- TBL_PC* sd;
- int base=0,job=0;
- double bonus;
- + int mul = 1;
- sd = script->rid2sd(st);
- if( sd == NULL )
- @@ -9629,9 +9630,11 @@ enum setmount_type {
- return true;
- // bonus for npc-given exp
- + if (sd->status.base_level >= 90) mul = 3;
- + else if (sd->status.base_level >= 60) mul = 2;
- bonus = battle_config.quest_exp_rate / 100.;
- - base = (int) cap_value(base * bonus, 0, INT_MAX);
- - job = (int) cap_value(job * bonus, 0, INT_MAX);
- + base = (int) cap_value(base * mul * bonus, 0, INT_MAX);
- + job = (int) cap_value(job * mul * bonus, 0, INT_MAX);
- pc->gainexp(sd, &sd->bl, base, job, true);
- @@ -19637,6 +19640,138 @@ void script_hqueue_clear(int idx) {
- return true;
- }
- +/**
- + * [Aeva]
- + **/
- +
- +BUILDIN(costume)
- +{
- + int i = -1, num, ep;
- + TBL_PC *sd;
- +
- + num = script_getnum(st,2);
- + sd = script->rid2sd(st);
- +
- + if( sd == NULL )
- + return 0;
- + if( num > 0 && num <= ARRAYLENGTH(script->equip) )
- + i = pc->checkequip(sd, script->equip[num - 1]);
- + if( i < 0 )
- + return 0;
- + ep = sd->status.inventory[i].equip;
- + if( !(ep&EQP_HEAD_LOW) && !(ep&EQP_HEAD_MID) && !(ep&EQP_HEAD_TOP) )
- + return 0;
- +
- + logs->pick_pc(sd, LOG_TYPE_SCRIPT, -1, &sd->status.inventory[i],sd->inventory_data[i]);
- + pc->unequipitem(sd,i,2);
- + clif->delitem(sd,i,1,3);
- + // --------------------------------------------------------------------
- + sd->status.inventory[i].refine = 0;
- + sd->status.inventory[i].attribute = 0;
- + sd->status.inventory[i].card[0] = CARD0_CREATE;
- + sd->status.inventory[i].card[1] = 0;
- + sd->status.inventory[i].card[2] = GetWord(battle_config.reserved_costume_id, 0);
- + sd->status.inventory[i].card[3] = GetWord(battle_config.reserved_costume_id, 1);
- +
- + if( ep&EQP_HEAD_TOP ) { ep &= ~EQP_HEAD_TOP; ep |= EQP_COSTUME_HEAD_TOP; }
- + if( ep&EQP_HEAD_LOW ) { ep &= ~EQP_HEAD_LOW; ep |= EQP_COSTUME_HEAD_LOW; }
- + if( ep&EQP_HEAD_MID ) { ep &= ~EQP_HEAD_MID; ep |= EQP_COSTUME_HEAD_MID; }
- + // --------------------------------------------------------------------
- + logs->pick_pc(sd, LOG_TYPE_SCRIPT, 1, &sd->status.inventory[i],sd->inventory_data[i]);
- +
- + clif->additem(sd,i,1,0);
- + pc->equipitem(sd,i,ep);
- + clif->misceffect(&sd->bl,3);
- +
- + return true;
- +}
- +
- +/*==========================================
- + * Item Security System
- + *------------------------------------------*/
- +BUILDIN(setsecurity)
- +{
- + struct map_session_data *sd = script_rid2sd(st);
- + int value = script_getnum(st,2);
- + if( sd == NULL )
- + return 0;
- +
- + sd->state.secure_items = (value)?1:0;
- + return 0;
- +}
- +
- +BUILDIN(getsecurity)
- +{
- + struct map_session_data *sd = script_rid2sd(st);
- + if( sd == NULL )
- + return 0;
- +
- + script_pushint(st,sd->state.secure_items);
- + return 0;
- +}
- +
- +BUILDIN(blockexp)
- +{
- + int type;
- + TBL_PC *sd=script->rid2sd(st);
- +
- + if ( sd == NULL) {
- + return true;
- + }
- +
- + type = script_getnum(st,2);
- +
- + switch(type){
- + case 0:
- + sd->aeva.expblock = 0;
- + break;
- + case 1:
- + sd->aeva.expblock = 1;
- + break;
- + }
- + return true;
- +}
- +
- +BUILDIN(getcharinfo) {
- + int num;
- + TBL_PC *sd;
- +
- + num = script_getnum(st,2);
- + if( script_hasdata(st,3) )
- + sd=map->nick2sd(script_getstr(st,3));
- + else
- + sd=script->rid2sd(st);
- +
- + if(sd==NULL) {
- + script_pushint(st,0); //return 0, according docs
- + return true;
- + }
- +
- + switch( num ) {
- + case 0: script_pushint(st,sd->gotzenylog); break;
- + case 1: script_pushint(st,sd->countskilllog); break;
- + default:
- + ShowError("buildin_getcharinfo: invalid parameter (%d).\n", num);
- + script_pushint(st,0);
- + break;
- + }
- +
- + return true;
- +}
- +
- +BUILDIN(pvpannounce)
- +{
- + const char *mes = script_getstr(st,2);
- + const char *fontColor = script_hasdata(st,4) ? script_getstr(st,4) : NULL;
- + int fontType = script_hasdata(st,5) ? script_getnum(st,5) : 0x190; // default fontType (FW_NORMAL)
- + int fontSize = script_hasdata(st,6) ? script_getnum(st,6) : 12; // default fontSize
- + int fontAlign = script_hasdata(st,7) ? script_getnum(st,7) : 0; // default fontAlign
- + int fontY = script_hasdata(st,8) ? script_getnum(st,8) : 0; // default fontY
- +
- + clif->broadcast2(NULL, mes, (int)strlen(mes)+1, strtol(fontColor, (char **)NULL, 0), fontType, fontSize, fontAlign, fontY, PVP_LISTEN);
- + return true;
- +}
- +
- // declarations that were supposed to be exported from npc_chat.c
- #ifdef PCRE_SUPPORT
- BUILDIN(defpattern);
- @@ -19758,6 +19893,14 @@ void script_parse_builtin(void) {
- /* Commands for internal use by the script engine */
- BUILDIN_DEF(__jump_zero,"il"),
- BUILDIN_DEF(__setr,"rv?"),
- +
- + /* [Aeva] */
- + BUILDIN_DEF(costume,"i"),
- + BUILDIN_DEF(setsecurity,"i"),
- + BUILDIN_DEF(getsecurity,""),
- + BUILDIN_DEF(blockexp,"i"),
- + BUILDIN_DEF(getcharinfo,"i?"),
- + BUILDIN_DEF(pvpannounce,"s?????"),
- // NPC interaction
- BUILDIN_DEF(mes,"s*"),
- @@ -20600,6 +20743,8 @@ void script_defaults(void) {
- script->config.ontouch_name = "OnTouch_"; //ontouch_name (runs on first visible char to enter area, picks another char if the first char leaves)
- script->config.ontouch2_name = "OnTouch"; //ontouch2_name (run whenever a char walks into the OnTouch area)
- script->config.onuntouch_name = "OnUnTouch"; //onuntouch_name (run whenever a char walks from the OnTouch area)
- + script->config.zeny_event_name = "OnZenyGet";
- + script->config.skill_event_name = "OnSkill";
- // for ENABLE_CASE_CHECK
- script->calc_hash_ci = calc_hash_ci;
- diff --git a/src/map/script.h b/src/map/script.h
- index 25c4283..ef387eb 100644
- --- a/src/map/script.h
- +++ b/src/map/script.h
- @@ -345,6 +345,10 @@ struct Script_Config {
- const char* ontouch_name;
- const char* ontouch2_name;
- const char* onuntouch_name;
- +
- + const char *zeny_event_name;
- + const char *skill_event_name;
- +
- };
- /**
- diff --git a/src/map/skill.c b/src/map/skill.c
- index a9737f1..f1dbaa4 100644
- --- a/src/map/skill.c
- +++ b/src/map/skill.c
- @@ -14,6 +14,7 @@
- #include <time.h>
- #include "battle.h"
- +#include "adelays.h"
- #include "battleground.h"
- #include "chrif.h"
- #include "clif.h"
- @@ -518,13 +519,19 @@ int skillnotok (uint16 skill_id, struct map_session_data *sd)
- case MC_VENDING:
- case ALL_BUYING_STORE:
- if( npc->isnear(&sd->bl) ) {
- - // uncomment for more verbose message.
- - //char output[150];
- - //sprintf(output, msg_txt(862), battle_config.min_npc_vendchat_distance); // "You're too close to a NPC, you must be at least %d cells away from any NPC."
- - //clif->message(sd->fd, output);
- +
- + char output[150];
- + sprintf(output, msg_txt(862), battle_config.min_npc_vendchat_distance); // "You're too close to a NPC, you must be at least %d cells away from any NPC."
- + clif->message(sd->fd, output);
- clif->skill_fail(sd,skill_id,USESKILL_FAIL_THERE_ARE_NPC_AROUND,0);
- return 1;
- }
- + if( sd->state.secure_items )
- + {
- + clif->message(sd->fd, "You are protected by @security, You can't do this action.");
- + clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
- + return 1;
- + }
- case MC_IDENTIFY:
- return 0; // always allowed
- case WZ_ICEWALL:
- @@ -4834,6 +4841,11 @@ int skill_castend_id(int tid, int64 tick, int id, intptr_t data) {
- struct status_change *sc = NULL;
- int inf,inf2,flag = 0;
- +#ifdef ADELAYS
- + int action;
- + char message[256];
- +#endif
- +
- src = map->id2bl(id);
- if( src == NULL )
- {
- @@ -5047,6 +5059,28 @@ int skill_castend_id(int tid, int64 tick, int id, intptr_t data) {
- if(cooldown)
- skill->blockpc_start(sd, ud->skill_id, cooldown);
- }
- +
- +#ifdef ADELAYS
- + if (adelays_is_enabled() && sd) {
- +
- + // Record the delay.
- + adelays_recordSkillDelay(ud->skill_id, skill->delay_fix(src, ud->skill_id, ud->skill_lv), skill_get_cooldown(ud->skill_id,ud->skill_lv), &(sd->adelays_state), tick, sd->battle_status.amotion, sd->status.class_, sd->status.sex, sd->sc.option&OPTION_RIDING,battle_config.min_skill_delay_limit);
- + action = adelays_process_record(tick, &(ud->canact_tick), &(sd->adelays_state), battle_config.min_skill_delay_limit);
- +
- + // Show the log in game.
- + if (sd->adelays_state.adelays_showinfo == 1) {
- + adelays_get_log_message(message, &(sd->adelays_state));
- + clif->disp_overhead(&sd->bl, message);
- + }
- +
- + if (action == 2)
- + {
- + // Skill was cancelled.
- + break;
- + }
- + }
- +#endif
- +
- if( battle_config.display_status_timers && sd )
- clif->status_change(src, SI_POSTDELAY, 1, skill->delay_fix(src, ud->skill_id, ud->skill_lv), 0, 0, 0);
- if( sd )
- @@ -5118,6 +5152,10 @@ int skill_castend_id(int tid, int64 tick, int id, intptr_t data) {
- return 1;
- } while(0);
- +#ifdef ADELAYS
- + if(sd && adelays_is_enabled()) adelays_skillFailed(&(sd->adelays_state));
- +#endif
- +
- //Skill failed.
- if (ud->skill_id == MO_EXTREMITYFIST && sd && !(sc && sc->data[SC_FOGWALL])) {
- //When Asura fails... (except when it fails from Fog of Wall)
- @@ -5858,7 +5896,6 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
- case NJ_NEN:
- case NPC_DEFENDER:
- case NPC_MAGICMIRROR:
- - case ST_PRESERVE:
- case NPC_INVINCIBLE:
- case NPC_INVINCIBLEOFF:
- case RK_DEATHBOUND:
- @@ -6345,6 +6382,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
- case CR_SHRINK:
- case SG_FUSION:
- case GS_GATLINGFEVER:
- + case ST_PRESERVE:
- if( tsce )
- {
- clif->skill_nodamage(src,bl,skill_id,skill_lv,status_change_end(bl, type, INVALID_TIMER));
- @@ -7014,7 +7052,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
- switch (i) {
- /**
- * bugreport:4888 these songs may only be dispelled if you're not in their song area anymore
- - **/
- +
- case SC_WHISTLE:
- case SC_ASSNCROS:
- case SC_POEMBRAGI:
- @@ -7026,6 +7064,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
- if( tsc->data[i]->val4 ) //val4 = out-of-song-area
- continue;
- break;
- + **/
- case SC_ASSUMPTIO:
- if( bl->type == BL_MOB )
- continue;
- @@ -9859,6 +9898,11 @@ int skill_castend_pos(int tid, int64 tick, int id, intptr_t data)
- struct unit_data *ud = unit->bl2ud(src);
- struct mob_data *md;
- +#ifdef ADELAYS
- + int action;
- + char message[256];
- +#endif
- +
- nullpo_ret(ud);
- sd = BL_CAST(BL_PC , src);
- @@ -9970,6 +10014,28 @@ int skill_castend_pos(int tid, int64 tick, int id, intptr_t data)
- if(cooldown)
- skill->blockpc_start(sd, ud->skill_id, cooldown);
- }
- +
- +#ifdef ADELAYS
- + if (adelays_is_enabled() && sd) {
- +
- + // Record the delay.
- + adelays_recordSkillDelay(ud->skill_id, skill->delay_fix(src, ud->skill_id, ud->skill_lv), skill_get_cooldown(ud->skill_id,ud->skill_lv), &(sd->adelays_state), tick, sd->battle_status.amotion, sd->status.class_, sd->status.sex, sd->sc.option&OPTION_RIDING,battle_config.min_skill_delay_limit);
- + action = adelays_process_record(tick, &(ud->canact_tick), &(sd->adelays_state), battle_config.min_skill_delay_limit);
- +
- + // Show the log in game.
- + if (sd->adelays_state.adelays_showinfo == 1) {
- + adelays_get_log_message(message, &(sd->adelays_state));
- + clif->disp_overhead(&sd->bl, message);
- + }
- +
- + if (action == 2)
- + {
- + // Skill was cancelled.
- + break;
- + }
- + }
- +#endif
- +
- if( battle_config.display_status_timers && sd )
- clif->status_change(src, SI_POSTDELAY, 1, skill->delay_fix(src, ud->skill_id, ud->skill_lv), 0, 0, 0);
- #if 0
- @@ -10001,6 +10067,10 @@ int skill_castend_pos(int tid, int64 tick, int id, intptr_t data)
- return 1;
- } while(0);
- +#ifdef ADELAYS
- + if(adelays_is_enabled() && sd) adelays_skillFailed(&(sd->adelays_state));
- +#endif
- +
- if( !sd || sd->skillitem != ud->skill_id || skill->get_delay(ud->skill_id,ud->skill_lv) )
- ud->canact_tick = tick;
- ud->skill_id = ud->skill_lv = 0;
- @@ -19335,3 +19405,21 @@ void skill_defaults(void) {
- skill->get_requirement_item_unknown = skill_get_requirement_item_unknown;
- skill->get_requirement_unknown = skill_get_requirement_unknown;
- }
- +
- +#ifdef ADELAYS
- +/************************************************************************/
- +/* Compatibility methods: Add at the end of skill.c */
- +/************************************************************************/
- +int64 adelays_gettick(){
- + return timer->gettick();
- +}
- +int adelays_skill_name2id(const char * skillName){
- + return skill->name2id(skillName);
- +}
- +int adelays_skill_get_index(int id){
- + return skill->get_index(id);
- +}
- +const char * adelays_skill_get_name(int id){
- + return skill->get_name(id);
- +}
- +#endif
- \ No newline at end of file
- diff --git a/src/map/status.c b/src/map/status.c
- index 0b40685..48681fc 100644
- --- a/src/map/status.c
- +++ b/src/map/status.c
- @@ -33,6 +33,7 @@
- #include "skill.h"
- #include "unit.h"
- #include "vending.h"
- +#include "party.h"
- #include "../common/cbasetypes.h"
- #include "../common/ers.h"
- #include "../common/malloc.h"
- @@ -914,6 +915,12 @@ void initChangeTables(void) {
- status->IconChangeTable[SC_SUPER_STAR] = SI_SUPER_STAR;
- status->IconChangeTable[SC_STRANGELIGHTS] = SI_STRANGELIGHTS;
- status->IconChangeTable[SC_DECORATION_OF_MUSIC] = SI_DECORATION_OF_MUSIC;
- + status->IconChangeTable[SC_MINDBREAKER] = SI_MINDBREAKER;
- + status->IconChangeTable[SC_SERVICEFORYOU] = SI_SERVICEFORYOU;
- + status->IconChangeTable[SC_DONTFORGETME] = SI_DONTFORGETME;
- + status->IconChangeTable[SC_ASSNCROS] = SI_ASSNCROS;
- + status->IconChangeTable[SC_POEMBRAGI] = SI_POEMBRAGI;
- + status->IconChangeTable[SC_APPLEIDUN] = SI_APPLEIDUN;
- //Other SC which are not necessarily associated to skills.
- status->ChangeFlagTable[SC_ATTHASTE_POTION1] = SCB_ASPD;
- @@ -2303,6 +2310,8 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
- continue;
- if(i == EQI_COSTUME_TOP && (sd->equip_index[EQI_COSTUME_MID] == index || sd->equip_index[EQI_COSTUME_LOW] == index))
- continue;
- + if( (int)MakeDWord(sd->status.inventory[index].card[2],sd->status.inventory[index].card[3]) == battle_config.reserved_costume_id )
- + continue;
- if(!sd->inventory_data[index])
- continue;
- @@ -7596,10 +7605,10 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
- int i;
- for( i = 0; i < 5; i++ ) {
- if( sd->devotion[i] && (tsd = map->id2sd(sd->devotion[i])) )
- - status->change_start(bl, &tsd->bl, type, 10000, val1, val2, val3, val4, tick, SCFLAG_ALL);
- + status->change_start(bl, &tsd->bl, type, 10000, val1, val2, val3, val4, tick, SCFLAG_NOAVOID);
- }
- } else if( bl->type == BL_MER && ((TBL_MER*)bl)->devotion_flag && (tsd = ((TBL_MER*)bl)->master) )
- - status->change_start(bl, &tsd->bl, type, 10000, val1, val2, val3, val4, tick, SCFLAG_ALL);
- + status->change_start(bl, &tsd->bl, type, 10000, val1, val2, val3, val4, tick, SCFLAG_NOAVOID);
- }
- //val4 signals infinite endure (if val4 == 2 it is infinite endure from Berserk)
- if( val4 )
- @@ -7695,10 +7704,10 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
- int i;
- for( i = 0; i < 5; i++ ) {
- if( sd->devotion[i] && (tsd = map->id2sd(sd->devotion[i])) )
- - status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, SCFLAG_ALL);
- + status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, SCFLAG_NOAVOID);
- }
- } else if( bl->type == BL_MER && ((TBL_MER*)bl)->devotion_flag && (tsd = ((TBL_MER*)bl)->master) )
- - status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, SCFLAG_ALL);
- + status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, SCFLAG_NOAVOID);
- }
- break;
- case SC_NOEQUIPWEAPON:
- @@ -7920,8 +7929,8 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
- case SC_RUWACH:
- case SC_WZ_SIGHTBLASTER:
- val3 = skill->get_splash(val2, val1); //Val2 should bring the skill-id.
- - val2 = tick/20;
- - tick_time = 20; // [GodLesZ] tick time
- + val2 = tick/250;
- + tick_time = 10; // [GodLesZ] tick time
- break;
- //Permanent effects.
- @@ -7953,11 +7962,11 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
- if( sd ) {
- for( i = 0; i < 5; i++ ) {
- if( sd->devotion[i] && (tsd = map->id2sd(sd->devotion[i])) )
- - status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, SCFLAG_ALL);
- + status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, SCFLAG_NOAVOID);
- }
- }
- else if( bl->type == BL_MER && ((TBL_MER*)bl)->devotion_flag && (tsd = ((TBL_MER*)bl)->master) )
- - status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, SCFLAG_ALL);
- + status->change_start(bl, &tsd->bl, type, 10000, val1, val2, 0, 0, tick, SCFLAG_NOAVOID);
- }
- }
- break;
- @@ -9673,6 +9682,15 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t
- if( opt_flag&2 && sd && sd->touching_id )
- npc->touchnext_areanpc(sd,false); // run OnTouch_ on next char in range
- + if( sd && sd->status.party_id && (
- + type == SC_BLESSING || type == SC_INC_AGI || type == SC_PROTECTWEAPON || type == SC_PROTECTSHIELD ||
- + type == SC_PROTECTARMOR || type == SC_PROTECTHELM || type == SC_SOULLINK || type == SC_DEVOTION )
- + )
- + {
- + struct party_data *p = party->search(sd->status.party_id);
- + clif->party_info(p, NULL);
- + }
- +
- return 1;
- }
- /*==========================================
- @@ -10615,8 +10633,8 @@ int status_change_timer(int tid, int64 tick, int id, intptr_t data) {
- map->foreachinrange(status->change_timer_sub, bl, sce->val3, BL_CHAR, bl, sce, type, tick);
- if( --(sce->val2)>0 ){
- - sce->val4 += 20; // use for Shadow Form 2 seconds checking.
- - sc_timer_next(20+tick, status->change_timer, bl->id, data);
- + sce->val4 += 250; // use for Shadow Form 2 seconds checking.
- + sc_timer_next(250+tick, status->change_timer, bl->id, data);
- return 0;
- }
- break;
- diff --git a/src/map/status.h b/src/map/status.h
- index c8a7a08..959b4bc 100644
- --- a/src/map/status.h
- +++ b/src/map/status.h
- @@ -1566,6 +1566,14 @@ enum si_type {
- //SI_MTF_RANGEATK2 = 818,
- //SI_MTF_ASPD2 = 819,
- //SI_MTF_MATK2 = 820,
- +
- + // [Aeva]
- + SI_MINDBREAKER = 1001,
- + SI_SERVICEFORYOU = 1002,
- + SI_DONTFORGETME = 1003,
- + SI_ASSNCROS = 1004,
- + SI_POEMBRAGI = 1005,
- + SI_APPLEIDUN = 1006,
- SI_MAX,
- };
- diff --git a/src/map/storage.c b/src/map/storage.c
- index 79a5ad5..891188a 100644
- --- a/src/map/storage.c
- +++ b/src/map/storage.c
- @@ -437,6 +437,12 @@ int guild_storage_additem(struct map_session_data* sd, struct guild_storage* sto
- return 1;
- }
- + if( sd->state.secure_items )
- + {
- + clif->message(sd->fd, "You are protected by @security, You can't do this action.");
- + return 1;
- + }
- +
- if( item_data->bound && item_data->bound != IBT_GUILD && !pc_can_give_bound_items(sd) ) {
- clif->message(sd->fd, msg_sd(sd,294));
- return 1;
- diff --git a/src/map/trade.c b/src/map/trade.c
- index 7417f05..4ff638b 100644
- --- a/src/map/trade.c
- +++ b/src/map/trade.c
- @@ -37,12 +37,22 @@ void trade_traderequest(struct map_session_data *sd, struct map_session_data *ta
- clif->message (sd->fd, msg_sd(sd,272));
- return; //Can't trade in notrade mapflag maps.
- }
- +
- + if( sd->state.secure_items ) {
- + clif->message(sd->fd, "You are protected by @security, You can't do this action.");
- + return;
- + }
- if (target_sd == NULL || sd == target_sd) {
- clif->tradestart(sd, 1); // character does not exist
- return;
- }
- + if( target_sd->state.secure_items ) {
- + clif->message(sd->fd, "You target protected by @security, You can't do this action.");
- + return;
- + }
- +
- if (target_sd->npc_id) {
- //Trade fails if you are using an NPC.
- clif->tradestart(sd, 2);
- diff --git a/src/map/unit.c b/src/map/unit.c
- index 2dba10a..06b08cc 100644
- --- a/src/map/unit.c
- +++ b/src/map/unit.c
- @@ -1608,6 +1608,13 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
- } else
- skill->castend_id(ud->skilltimer,tick,src->id,0);
- +#ifdef ACHIEVEMENT
- + if( sd ){
- + sd->countskilllog ++;
- + npc->script_event(sd, NPCE_ONSKILL);
- + }
- +#endif
- +
- return 1;
- }
- @@ -2505,6 +2512,7 @@ int unit_remove_map(struct block_list *bl, clr_type clrtype, const char* file, i
- }
- case BL_HOM: {
- struct homun_data *hd = (struct homun_data *)bl;
- + ud->canact_tick = ud->canmove_tick; //It appears HOM do reset the can-act tick.
- if( !hd->homunculus.intimacy && !(hd->master && !hd->master->state.active) ) {
- //If logging out, this is deleted on unit->free
- clif->emotion(bl, E_SOB);
- diff --git a/src/plugins/Makefile.in b/src/plugins/Makefile.in
- index 802d101..54d733a 100644
- --- a/src/plugins/Makefile.in
- +++ b/src/plugins/Makefile.in
- @@ -18,7 +18,7 @@
- # #
- # Note: DO NOT include the .c extension!!! #
- -MYPLUGINS =
- +MYPLUGINS = whosell
- # #
- ######### DO NOT EDIT ANYTHING BELOW THIS LINE!!! ##################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement