Follow up e0c8e01
Move skill_get_cooldown_ into pc_get_skillcooldown and add a short src_doc description to promote his usage (and avoid duplicate code) Fix few cppcheck issues (variable scope optimisation mostly)
This commit is contained in:
parent
26aad11908
commit
51f26d43d2
@ -150,7 +150,6 @@ bool mapif_homunculus_save(struct s_homunculus* hd)
|
|||||||
// Load an homunculus
|
// Load an homunculus
|
||||||
bool mapif_homunculus_load(int homun_id, struct s_homunculus* hd)
|
bool mapif_homunculus_load(int homun_id, struct s_homunculus* hd)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
char* data;
|
char* data;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
@ -198,7 +197,7 @@ bool mapif_homunculus_load(int homun_id, struct s_homunculus* hd)
|
|||||||
Sql_GetData(sql_handle, 21, &data, NULL); hd->vaporize = atoi(data);
|
Sql_GetData(sql_handle, 21, &data, NULL); hd->vaporize = atoi(data);
|
||||||
Sql_FreeResult(sql_handle);
|
Sql_FreeResult(sql_handle);
|
||||||
|
|
||||||
hd->intimacy = cap_value(hd->intimacy, 0, 100000);
|
hd->intimacy = min(hd->intimacy,100000);
|
||||||
hd->hunger = cap_value(hd->hunger, 0, 100);
|
hd->hunger = cap_value(hd->hunger, 0, 100);
|
||||||
|
|
||||||
// Load Homunculus Skill
|
// Load Homunculus Skill
|
||||||
@ -209,6 +208,7 @@ bool mapif_homunculus_load(int homun_id, struct s_homunculus* hd)
|
|||||||
}
|
}
|
||||||
while( SQL_SUCCESS == Sql_NextRow(sql_handle) )
|
while( SQL_SUCCESS == Sql_NextRow(sql_handle) )
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
// id
|
// id
|
||||||
Sql_GetData(sql_handle, 0, &data, NULL);
|
Sql_GetData(sql_handle, 0, &data, NULL);
|
||||||
i = atoi(data);
|
i = atoi(data);
|
||||||
|
@ -63,7 +63,6 @@ static int int_party_check_lv(struct party_data *p) {
|
|||||||
static void int_party_calc_state(struct party_data *p)
|
static void int_party_calc_state(struct party_data *p)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
unsigned int lv;
|
|
||||||
p->min_lv = UINT_MAX;
|
p->min_lv = UINT_MAX;
|
||||||
p->max_lv = 0;
|
p->max_lv = 0;
|
||||||
p->party.count =
|
p->party.count =
|
||||||
@ -93,7 +92,7 @@ static void int_party_calc_state(struct party_data *p)
|
|||||||
}
|
}
|
||||||
//max/min levels.
|
//max/min levels.
|
||||||
for(i=0;i<MAX_PARTY;i++){
|
for(i=0;i<MAX_PARTY;i++){
|
||||||
lv=p->party.member[i].lv;
|
unsigned int lv=p->party.member[i].lv;
|
||||||
if (!lv) continue;
|
if (!lv) continue;
|
||||||
if(p->party.member[i].online &&
|
if(p->party.member[i].online &&
|
||||||
//On families, the kid is not counted towards exp share rules.
|
//On families, the kid is not counted towards exp share rules.
|
||||||
|
@ -475,7 +475,6 @@ static void db_rebalance_erase(DBNode node, DBNode *root)
|
|||||||
DBNode y = node;
|
DBNode y = node;
|
||||||
DBNode x = NULL;
|
DBNode x = NULL;
|
||||||
DBNode x_parent = NULL;
|
DBNode x_parent = NULL;
|
||||||
DBNode w;
|
|
||||||
|
|
||||||
DB_COUNTSTAT(db_rebalance_erase);
|
DB_COUNTSTAT(db_rebalance_erase);
|
||||||
// Select where to change the tree
|
// Select where to change the tree
|
||||||
@ -543,6 +542,7 @@ static void db_rebalance_erase(DBNode node, DBNode *root)
|
|||||||
// Restore the RED-BLACK properties
|
// Restore the RED-BLACK properties
|
||||||
if (y->color != RED) {
|
if (y->color != RED) {
|
||||||
while (x != *root && (x == NULL || x->color == BLACK)) {
|
while (x != *root && (x == NULL || x->color == BLACK)) {
|
||||||
|
DBNode w;
|
||||||
if (x == x_parent->left) {
|
if (x == x_parent->left) {
|
||||||
w = x_parent->right;
|
w = x_parent->right;
|
||||||
if (w->color == RED) {
|
if (w->color == RED) {
|
||||||
@ -1414,7 +1414,6 @@ static bool db_obj_exists(DBMap* self, DBKey key)
|
|||||||
{
|
{
|
||||||
DBMap_impl* db = (DBMap_impl*)self;
|
DBMap_impl* db = (DBMap_impl*)self;
|
||||||
DBNode node;
|
DBNode node;
|
||||||
int c;
|
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
DB_COUNTSTAT(db_exists);
|
DB_COUNTSTAT(db_exists);
|
||||||
@ -1436,7 +1435,7 @@ static bool db_obj_exists(DBMap* self, DBKey key)
|
|||||||
db_free_lock(db);
|
db_free_lock(db);
|
||||||
node = db->ht[db->hash(key, db->maxlen)%HASH_SIZE];
|
node = db->ht[db->hash(key, db->maxlen)%HASH_SIZE];
|
||||||
while (node) {
|
while (node) {
|
||||||
c = db->cmp(key, node->key, db->maxlen);
|
int c = db->cmp(key, node->key, db->maxlen);
|
||||||
if (c == 0) {
|
if (c == 0) {
|
||||||
if (!(node->deleted)) {
|
if (!(node->deleted)) {
|
||||||
db->cache = node;
|
db->cache = node;
|
||||||
@ -1465,7 +1464,6 @@ static DBData* db_obj_get(DBMap* self, DBKey key)
|
|||||||
{
|
{
|
||||||
DBMap_impl* db = (DBMap_impl*)self;
|
DBMap_impl* db = (DBMap_impl*)self;
|
||||||
DBNode node;
|
DBNode node;
|
||||||
int c;
|
|
||||||
DBData *data = NULL;
|
DBData *data = NULL;
|
||||||
|
|
||||||
DB_COUNTSTAT(db_get);
|
DB_COUNTSTAT(db_get);
|
||||||
@ -1488,7 +1486,7 @@ static DBData* db_obj_get(DBMap* self, DBKey key)
|
|||||||
db_free_lock(db);
|
db_free_lock(db);
|
||||||
node = db->ht[db->hash(key, db->maxlen)%HASH_SIZE];
|
node = db->ht[db->hash(key, db->maxlen)%HASH_SIZE];
|
||||||
while (node) {
|
while (node) {
|
||||||
c = db->cmp(key, node->key, db->maxlen);
|
int c = db->cmp(key, node->key, db->maxlen);
|
||||||
if (c == 0) {
|
if (c == 0) {
|
||||||
if (!(node->deleted)) {
|
if (!(node->deleted)) {
|
||||||
data = &node->data;
|
data = &node->data;
|
||||||
@ -1856,7 +1854,7 @@ static int db_obj_remove(DBMap* self, DBKey key, DBData *out_data)
|
|||||||
DBMap_impl* db = (DBMap_impl*)self;
|
DBMap_impl* db = (DBMap_impl*)self;
|
||||||
DBNode node;
|
DBNode node;
|
||||||
unsigned int hash;
|
unsigned int hash;
|
||||||
int c = 0, retval = 0;
|
int retval = 0;
|
||||||
|
|
||||||
DB_COUNTSTAT(db_remove);
|
DB_COUNTSTAT(db_remove);
|
||||||
if (db == NULL) return 0; // nullpo candidate
|
if (db == NULL) return 0; // nullpo candidate
|
||||||
@ -1874,7 +1872,7 @@ static int db_obj_remove(DBMap* self, DBKey key, DBData *out_data)
|
|||||||
db_free_lock(db);
|
db_free_lock(db);
|
||||||
hash = db->hash(key, db->maxlen)%HASH_SIZE;
|
hash = db->hash(key, db->maxlen)%HASH_SIZE;
|
||||||
for(node = db->ht[hash]; node; ){
|
for(node = db->ht[hash]; node; ){
|
||||||
c = db->cmp(key, node->key, db->maxlen);
|
int c = db->cmp(key, node->key, db->maxlen);
|
||||||
if (c == 0) {
|
if (c == 0) {
|
||||||
if (!(node->deleted)) {
|
if (!(node->deleted)) {
|
||||||
if (db->cache == node)
|
if (db->cache == node)
|
||||||
|
@ -1842,12 +1842,11 @@ int login_config_read(const char* cfgName)
|
|||||||
|
|
||||||
if (sscanf(w2, "%3d, %32s", &group, md5) == 2) {
|
if (sscanf(w2, "%3d, %32s", &group, md5) == 2) {
|
||||||
struct client_hash_node *nnode;
|
struct client_hash_node *nnode;
|
||||||
int i;
|
|
||||||
CREATE(nnode, struct client_hash_node, 1);
|
CREATE(nnode, struct client_hash_node, 1);
|
||||||
|
|
||||||
if (strcmpi(md5, "disabled") == 0) {
|
if (strcmpi(md5, "disabled") == 0) {
|
||||||
nnode->hash[0] = '\0';
|
nnode->hash[0] = '\0';
|
||||||
} else {
|
} else {
|
||||||
|
int i;
|
||||||
for (i = 0; i < 32; i += 2) {
|
for (i = 0; i < 32; i += 2) {
|
||||||
char buf[3];
|
char buf[3];
|
||||||
unsigned int byte;
|
unsigned int byte;
|
||||||
@ -1859,10 +1858,8 @@ int login_config_read(const char* cfgName)
|
|||||||
nnode->hash[i / 2] = (uint8)(byte & 0xFF);
|
nnode->hash[i / 2] = (uint8)(byte & 0xFF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nnode->group_id = group;
|
nnode->group_id = group;
|
||||||
nnode->next = login_config.client_hash_nodes;
|
nnode->next = login_config.client_hash_nodes;
|
||||||
|
|
||||||
login_config.client_hash_nodes = nnode;
|
login_config.client_hash_nodes = nnode;
|
||||||
}
|
}
|
||||||
} else if(strcmpi(w1, "chars_per_account") == 0) { //maxchars per account [Sirius]
|
} else if(strcmpi(w1, "chars_per_account") == 0) { //maxchars per account [Sirius]
|
||||||
|
@ -143,9 +143,7 @@ static const char* atcommand_help_string(const char* command)
|
|||||||
*------------------------------------------*/
|
*------------------------------------------*/
|
||||||
ACMD_FUNC(send)
|
ACMD_FUNC(send)
|
||||||
{
|
{
|
||||||
int len=0,off,end,type;
|
int len=0,type;
|
||||||
long num;
|
|
||||||
|
|
||||||
// read message type as hex number (without the 0x)
|
// read message type as hex number (without the 0x)
|
||||||
if(!message || !*message ||
|
if(!message || !*message ||
|
||||||
!((sscanf(message, "len %x", &type)==1 && (len=1))
|
!((sscanf(message, "len %x", &type)==1 && (len=1))
|
||||||
@ -187,9 +185,9 @@ ACMD_FUNC(send)
|
|||||||
}\
|
}\
|
||||||
}
|
}
|
||||||
//define GET_VALUE
|
//define GET_VALUE
|
||||||
|
|
||||||
if (type > 0 && type < MAX_PACKET_DB) {
|
if (type > 0 && type < MAX_PACKET_DB) {
|
||||||
|
int off,end;
|
||||||
|
long num;
|
||||||
if(len)
|
if(len)
|
||||||
{// show packet length
|
{// show packet length
|
||||||
sprintf(atcmd_output, msg_txt(sd,904), type, packet_db[sd->packet_ver][type].len); // Packet 0x%x length: %d
|
sprintf(atcmd_output, msg_txt(sd,904), type, packet_db[sd->packet_ver][type].len); // Packet 0x%x length: %d
|
||||||
@ -404,7 +402,7 @@ static void warp_get_suggestions(struct map_session_data* sd, const char *name)
|
|||||||
// if no maps found, search by edit distance
|
// if no maps found, search by edit distance
|
||||||
if (!count) {
|
if (!count) {
|
||||||
unsigned int distance[MAX_MAP_PER_SERVER][2];
|
unsigned int distance[MAX_MAP_PER_SERVER][2];
|
||||||
int j, min;
|
int j;
|
||||||
|
|
||||||
// calculate Levenshtein distance for all maps
|
// calculate Levenshtein distance for all maps
|
||||||
for (i = 0; i < MAX_MAP_PER_SERVER; i++) {
|
for (i = 0; i < MAX_MAP_PER_SERVER; i++) {
|
||||||
@ -419,7 +417,7 @@ static void warp_get_suggestions(struct map_session_data* sd, const char *name)
|
|||||||
// selection sort elements as needed
|
// selection sort elements as needed
|
||||||
count = min(MAX_SUGGESTIONS, 5); // results past 5 aren't worth showing
|
count = min(MAX_SUGGESTIONS, 5); // results past 5 aren't worth showing
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
min = i;
|
int min = i;
|
||||||
for (j = i+1; j < MAX_MAP_PER_SERVER; j++) {
|
for (j = i+1; j < MAX_MAP_PER_SERVER; j++) {
|
||||||
if (distance[j][0] < distance[min][0])
|
if (distance[j][0] < distance[min][0])
|
||||||
min = j;
|
min = j;
|
||||||
@ -617,8 +615,7 @@ ACMD_FUNC(jump)
|
|||||||
*------------------------------------------*/
|
*------------------------------------------*/
|
||||||
ACMD_FUNC(who) {
|
ACMD_FUNC(who) {
|
||||||
struct map_session_data *pl_sd = NULL;
|
struct map_session_data *pl_sd = NULL;
|
||||||
struct s_mapiterator *iter = NULL;
|
struct s_mapiterator *iter = NULL;
|
||||||
char map_name[MAP_NAME_LENGTH_EXT] = "";
|
|
||||||
char player_name[NAME_LENGTH] = "";
|
char player_name[NAME_LENGTH] = "";
|
||||||
int count = 0;
|
int count = 0;
|
||||||
int level = 0;
|
int level = 0;
|
||||||
@ -634,6 +631,7 @@ ACMD_FUNC(who) {
|
|||||||
nullpo_retr(-1, sd);
|
nullpo_retr(-1, sd);
|
||||||
|
|
||||||
if (strstr(command, "map") != NULL) {
|
if (strstr(command, "map") != NULL) {
|
||||||
|
char map_name[MAP_NAME_LENGTH_EXT] = "";
|
||||||
if (sscanf(message, "%15s %23s", map_name, player_name) < 1 || (map_id = map_mapname2mapid(map_name)) < 0)
|
if (sscanf(message, "%15s %23s", map_name, player_name) < 1 || (map_id = map_mapname2mapid(map_name)) < 0)
|
||||||
map_id = sd->bl.m;
|
map_id = sd->bl.m;
|
||||||
} else {
|
} else {
|
||||||
@ -721,7 +719,7 @@ ACMD_FUNC(whogm)
|
|||||||
struct map_session_data* pl_sd;
|
struct map_session_data* pl_sd;
|
||||||
struct s_mapiterator* iter;
|
struct s_mapiterator* iter;
|
||||||
int j, count;
|
int j, count;
|
||||||
int pl_level, level;
|
int level;
|
||||||
char match_text[CHAT_SIZE_MAX];
|
char match_text[CHAT_SIZE_MAX];
|
||||||
char player_name[NAME_LENGTH];
|
char player_name[NAME_LENGTH];
|
||||||
struct guild *g;
|
struct guild *g;
|
||||||
@ -744,7 +742,7 @@ ACMD_FUNC(whogm)
|
|||||||
iter = mapit_getallusers();
|
iter = mapit_getallusers();
|
||||||
for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
|
for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) )
|
||||||
{
|
{
|
||||||
pl_level = pc_get_group_level(pl_sd);
|
int pl_level = pc_get_group_level(pl_sd);
|
||||||
if (!pl_level)
|
if (!pl_level)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -2009,7 +2007,7 @@ ACMD_FUNC(monster)
|
|||||||
int mob_id;
|
int mob_id;
|
||||||
int number = 0;
|
int number = 0;
|
||||||
int count;
|
int count;
|
||||||
int i, k, range;
|
int i, range;
|
||||||
short mx, my;
|
short mx, my;
|
||||||
unsigned int size;
|
unsigned int size;
|
||||||
nullpo_retr(-1, sd);
|
nullpo_retr(-1, sd);
|
||||||
@ -2075,9 +2073,13 @@ ACMD_FUNC(monster)
|
|||||||
count = 0;
|
count = 0;
|
||||||
range = (int)sqrt((float)number) +2; // calculation of an odd number (+ 4 area around)
|
range = (int)sqrt((float)number) +2; // calculation of an odd number (+ 4 area around)
|
||||||
for (i = 0; i < number; i++) {
|
for (i = 0; i < number; i++) {
|
||||||
|
int k;
|
||||||
map_search_freecell(&sd->bl, 0, &mx, &my, range, range, 0);
|
map_search_freecell(&sd->bl, 0, &mx, &my, range, range, 0);
|
||||||
k = mob_once_spawn(sd, sd->bl.m, mx, my, name, mob_id, 1, eventname, size, AI_NONE);
|
k = mob_once_spawn(sd, sd->bl.m, mx, my, name, mob_id, 1, eventname, size, AI_NONE);
|
||||||
count += (k != 0) ? 1 : 0;
|
if(k) {
|
||||||
|
//mapreg_setreg(reference_uid(add_str("$@mobid"), i),k); //retain created mobid in array uncomment if needed
|
||||||
|
count ++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count != 0)
|
if (count != 0)
|
||||||
@ -2145,7 +2147,7 @@ ACMD_FUNC(killmonster)
|
|||||||
*------------------------------------------*/
|
*------------------------------------------*/
|
||||||
ACMD_FUNC(refine)
|
ACMD_FUNC(refine)
|
||||||
{
|
{
|
||||||
int i,j, position = 0, refine = 0, current_position, final_refine;
|
int j, position = 0, refine = 0, current_position, final_refine;
|
||||||
int count;
|
int count;
|
||||||
nullpo_retr(-1, sd);
|
nullpo_retr(-1, sd);
|
||||||
|
|
||||||
@ -2180,6 +2182,7 @@ ACMD_FUNC(refine)
|
|||||||
|
|
||||||
count = 0;
|
count = 0;
|
||||||
for (j = 0; j < EQI_MAX; j++) {
|
for (j = 0; j < EQI_MAX; j++) {
|
||||||
|
int i;
|
||||||
if ((i = sd->equip_index[j]) < 0)
|
if ((i = sd->equip_index[j]) < 0)
|
||||||
continue;
|
continue;
|
||||||
if(j == EQI_AMMO) continue;
|
if(j == EQI_AMMO) continue;
|
||||||
@ -3837,7 +3840,6 @@ ACMD_FUNC(partysharelvl) {
|
|||||||
ACMD_FUNC(mapinfo) {
|
ACMD_FUNC(mapinfo) {
|
||||||
struct map_session_data* pl_sd;
|
struct map_session_data* pl_sd;
|
||||||
struct s_mapiterator* iter;
|
struct s_mapiterator* iter;
|
||||||
struct npc_data *nd = NULL;
|
|
||||||
struct chat_data *cd = NULL;
|
struct chat_data *cd = NULL;
|
||||||
char direction[12];
|
char direction[12];
|
||||||
int i, m_id, chat_num = 0, list = 0, vend_num = 0;
|
int i, m_id, chat_num = 0, list = 0, vend_num = 0;
|
||||||
@ -4087,7 +4089,7 @@ ACMD_FUNC(mapinfo) {
|
|||||||
clif_displaymessage(fd, msg_txt(sd,482)); // ----- NPCs in Map -----
|
clif_displaymessage(fd, msg_txt(sd,482)); // ----- NPCs in Map -----
|
||||||
for (i = 0; i < map[m_id].npc_num;)
|
for (i = 0; i < map[m_id].npc_num;)
|
||||||
{
|
{
|
||||||
nd = map[m_id].npc[i];
|
struct npc_data *nd = map[m_id].npc[i];
|
||||||
switch(nd->ud.dir) {
|
switch(nd->ud.dir) {
|
||||||
case 0: strcpy(direction, msg_txt(sd,491)); break; // North
|
case 0: strcpy(direction, msg_txt(sd,491)); break; // North
|
||||||
case 1: strcpy(direction, msg_txt(sd,492)); break; // North West
|
case 1: strcpy(direction, msg_txt(sd,492)); break; // North West
|
||||||
@ -4526,7 +4528,6 @@ char* txt_time(unsigned int duration)
|
|||||||
ACMD_FUNC(servertime)
|
ACMD_FUNC(servertime)
|
||||||
{
|
{
|
||||||
const struct TimerData * timer_data;
|
const struct TimerData * timer_data;
|
||||||
const struct TimerData * timer_data2;
|
|
||||||
time_t time_server; // variable for number of seconds (used with time() function)
|
time_t time_server; // variable for number of seconds (used with time() function)
|
||||||
struct tm *datetime; // variable for time in structure ->tm_mday, ->tm_sec, ...
|
struct tm *datetime; // variable for time in structure ->tm_mday, ->tm_sec, ...
|
||||||
char temp[CHAT_SIZE_MAX];
|
char temp[CHAT_SIZE_MAX];
|
||||||
@ -4562,6 +4563,7 @@ ACMD_FUNC(servertime)
|
|||||||
} else
|
} else
|
||||||
clif_displaymessage(fd, msg_txt(sd,232)); // Game time: The game is in permanent night.
|
clif_displaymessage(fd, msg_txt(sd,232)); // Game time: The game is in permanent night.
|
||||||
else {
|
else {
|
||||||
|
const struct TimerData * timer_data2;
|
||||||
if (night_flag == 0) {
|
if (night_flag == 0) {
|
||||||
timer_data = get_timer(night_timer_tid);
|
timer_data = get_timer(night_timer_tid);
|
||||||
timer_data2 = get_timer(day_timer_tid);
|
timer_data2 = get_timer(day_timer_tid);
|
||||||
@ -4882,7 +4884,7 @@ ACMD_FUNC(disguiseguild)
|
|||||||
{
|
{
|
||||||
int id = 0, i;
|
int id = 0, i;
|
||||||
char monster[NAME_LENGTH], guild[NAME_LENGTH];
|
char monster[NAME_LENGTH], guild[NAME_LENGTH];
|
||||||
struct map_session_data *pl_sd;
|
|
||||||
struct guild *g;
|
struct guild *g;
|
||||||
|
|
||||||
memset(monster, '\0', sizeof(monster));
|
memset(monster, '\0', sizeof(monster));
|
||||||
@ -4914,9 +4916,11 @@ ACMD_FUNC(disguiseguild)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for( i = 0; i < g->max_member; i++ )
|
for( i = 0; i < g->max_member; i++ ){
|
||||||
|
struct map_session_data *pl_sd;
|
||||||
if( (pl_sd = g->member[i].sd) && !pc_isriding(pl_sd) )
|
if( (pl_sd = g->member[i].sd) && !pc_isriding(pl_sd) )
|
||||||
pc_disguise(pl_sd, id);
|
pc_disguise(pl_sd, id);
|
||||||
|
}
|
||||||
|
|
||||||
clif_displaymessage(fd, msg_txt(sd,122)); // Disguise applied.
|
clif_displaymessage(fd, msg_txt(sd,122)); // Disguise applied.
|
||||||
return 0;
|
return 0;
|
||||||
@ -4966,7 +4970,6 @@ ACMD_FUNC(undisguiseall)
|
|||||||
ACMD_FUNC(undisguiseguild)
|
ACMD_FUNC(undisguiseguild)
|
||||||
{
|
{
|
||||||
char guild_name[NAME_LENGTH];
|
char guild_name[NAME_LENGTH];
|
||||||
struct map_session_data *pl_sd;
|
|
||||||
struct guild *g;
|
struct guild *g;
|
||||||
int i;
|
int i;
|
||||||
nullpo_retr(-1, sd);
|
nullpo_retr(-1, sd);
|
||||||
@ -4983,9 +4986,11 @@ ACMD_FUNC(undisguiseguild)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(i = 0; i < g->max_member; i++)
|
for(i = 0; i < g->max_member; i++){
|
||||||
|
struct map_session_data *pl_sd;
|
||||||
if( (pl_sd = g->member[i].sd) && pl_sd->disguise )
|
if( (pl_sd = g->member[i].sd) && pl_sd->disguise )
|
||||||
pc_disguise(pl_sd, 0);
|
pc_disguise(pl_sd, 0);
|
||||||
|
}
|
||||||
|
|
||||||
clif_displaymessage(fd, msg_txt(sd,124)); // Undisguise applied.
|
clif_displaymessage(fd, msg_txt(sd,124)); // Undisguise applied.
|
||||||
|
|
||||||
@ -5450,7 +5455,7 @@ ACMD_FUNC(clearcart)
|
|||||||
#define MAX_SKILLID_PARTIAL_RESULTS 5
|
#define MAX_SKILLID_PARTIAL_RESULTS 5
|
||||||
#define MAX_SKILLID_PARTIAL_RESULTS_LEN 74 // "skill " (6) + "%d:" (up to 5) + "%s" (up to 30) + " (%s)" (up to 33)
|
#define MAX_SKILLID_PARTIAL_RESULTS_LEN 74 // "skill " (6) + "%d:" (up to 5) + "%s" (up to 30) + " (%s)" (up to 33)
|
||||||
ACMD_FUNC(skillid) {
|
ACMD_FUNC(skillid) {
|
||||||
int skillen, idx, i, found = 0;
|
int skillen, i, found = 0;
|
||||||
DBIterator* iter;
|
DBIterator* iter;
|
||||||
DBKey key;
|
DBKey key;
|
||||||
DBData *data;
|
DBData *data;
|
||||||
@ -5468,7 +5473,7 @@ ACMD_FUNC(skillid) {
|
|||||||
iter = db_iterator(skilldb_name2id);
|
iter = db_iterator(skilldb_name2id);
|
||||||
|
|
||||||
for( data = iter->first(iter,&key); iter->exists(iter); data = iter->next(iter,&key) ) {
|
for( data = iter->first(iter,&key); iter->exists(iter); data = iter->next(iter,&key) ) {
|
||||||
idx = skill_get_index(db_data2i(data));
|
int idx = skill_get_index(db_data2i(data));
|
||||||
if (strnicmp(key.str, message, skillen) == 0 || strnicmp(skill_db[idx].desc, message, skillen) == 0) {
|
if (strnicmp(key.str, message, skillen) == 0 || strnicmp(skill_db[idx].desc, message, skillen) == 0) {
|
||||||
sprintf(atcmd_output, msg_txt(sd,1164), db_data2i(data), skill_db[idx].desc, key.str); // skill %d: %s (%s)
|
sprintf(atcmd_output, msg_txt(sd,1164), db_data2i(data), skill_db[idx].desc, key.str); // skill %d: %s (%s)
|
||||||
clif_displaymessage(fd, atcmd_output);
|
clif_displaymessage(fd, atcmd_output);
|
||||||
@ -6921,8 +6926,7 @@ ACMD_FUNC(mobinfo)
|
|||||||
struct item_data *item_data;
|
struct item_data *item_data;
|
||||||
struct mob_db *mob, *mob_array[MAX_SEARCH];
|
struct mob_db *mob, *mob_array[MAX_SEARCH];
|
||||||
int count;
|
int count;
|
||||||
int i, j, k;
|
int i, k;
|
||||||
unsigned int base_exp, job_exp;
|
|
||||||
|
|
||||||
memset(atcmd_output, '\0', sizeof(atcmd_output));
|
memset(atcmd_output, '\0', sizeof(atcmd_output));
|
||||||
memset(atcmd_output2, '\0', sizeof(atcmd_output2));
|
memset(atcmd_output2, '\0', sizeof(atcmd_output2));
|
||||||
@ -6951,6 +6955,7 @@ ACMD_FUNC(mobinfo)
|
|||||||
count = MAX_SEARCH;
|
count = MAX_SEARCH;
|
||||||
}
|
}
|
||||||
for (k = 0; k < count; k++) {
|
for (k = 0; k < count; k++) {
|
||||||
|
unsigned int j,base_exp,job_exp;
|
||||||
mob = mob_array[k];
|
mob = mob_array[k];
|
||||||
base_exp = mob->base_exp;
|
base_exp = mob->base_exp;
|
||||||
job_exp = mob->job_exp;
|
job_exp = mob->job_exp;
|
||||||
@ -6962,11 +6967,11 @@ ACMD_FUNC(mobinfo)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef VIP_ENABLE
|
#ifdef VIP_ENABLE
|
||||||
// Display EXP rate increase for VIP.
|
// Display EXP rate increase for VIP.
|
||||||
if (pc_isvip(sd) && (battle_config.vip_base_exp_increase || battle_config.vip_job_exp_increase)) {
|
if (pc_isvip(sd) && (battle_config.vip_base_exp_increase || battle_config.vip_job_exp_increase)) {
|
||||||
base_exp += battle_config.vip_base_exp_increase;
|
base_exp += battle_config.vip_base_exp_increase;
|
||||||
job_exp += battle_config.vip_job_exp_increase;
|
job_exp += battle_config.vip_job_exp_increase;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// stats
|
// stats
|
||||||
if (mob->mexp)
|
if (mob->mexp)
|
||||||
@ -7444,7 +7449,7 @@ ACMD_FUNC(homshuffle)
|
|||||||
*------------------------------------------*/
|
*------------------------------------------*/
|
||||||
ACMD_FUNC(iteminfo)
|
ACMD_FUNC(iteminfo)
|
||||||
{
|
{
|
||||||
struct item_data *item_data, *item_array[MAX_SEARCH];
|
struct item_data *item_array[MAX_SEARCH];
|
||||||
int i, count = 1;
|
int i, count = 1;
|
||||||
|
|
||||||
if (!message || !*message) {
|
if (!message || !*message) {
|
||||||
@ -7465,7 +7470,7 @@ ACMD_FUNC(iteminfo)
|
|||||||
count = MAX_SEARCH;
|
count = MAX_SEARCH;
|
||||||
}
|
}
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
item_data = item_array[i];
|
struct item_data * item_data = item_array[i];
|
||||||
sprintf(atcmd_output, msg_txt(sd,1277), // Item: '%s'/'%s'[%d] (%d) Type: %s | Extra Effect: %s
|
sprintf(atcmd_output, msg_txt(sd,1277), // Item: '%s'/'%s'[%d] (%d) Type: %s | Extra Effect: %s
|
||||||
item_data->name,item_data->jname,item_data->slot,item_data->nameid,
|
item_data->name,item_data->jname,item_data->slot,item_data->nameid,
|
||||||
(item_data->type != IT_AMMO) ? itemdb_typename((enum item_types)item_data->type) : itemdb_typename_ammo((enum e_item_ammo)item_data->look),
|
(item_data->type != IT_AMMO) ? itemdb_typename((enum item_types)item_data->type) : itemdb_typename_ammo((enum e_item_ammo)item_data->look),
|
||||||
@ -7548,7 +7553,7 @@ ACMD_FUNC(whodrops)
|
|||||||
|
|
||||||
ACMD_FUNC(whereis)
|
ACMD_FUNC(whereis)
|
||||||
{
|
{
|
||||||
struct mob_db *mob, *mob_array[MAX_SEARCH];
|
struct mob_db *mob_array[MAX_SEARCH];
|
||||||
int count;
|
int count;
|
||||||
int i, j, k;
|
int i, j, k;
|
||||||
|
|
||||||
@ -7576,7 +7581,7 @@ ACMD_FUNC(whereis)
|
|||||||
count = MAX_SEARCH;
|
count = MAX_SEARCH;
|
||||||
}
|
}
|
||||||
for (k = 0; k < count; k++) {
|
for (k = 0; k < count; k++) {
|
||||||
mob = mob_array[k];
|
struct mob_db *mob = mob_array[k];
|
||||||
snprintf(atcmd_output, sizeof atcmd_output, msg_txt(sd,1289), mob->jname); // %s spawns in:
|
snprintf(atcmd_output, sizeof atcmd_output, msg_txt(sd,1289), mob->jname); // %s spawns in:
|
||||||
clif_displaymessage(fd, atcmd_output);
|
clif_displaymessage(fd, atcmd_output);
|
||||||
|
|
||||||
@ -9230,8 +9235,6 @@ ACMD_FUNC(channel) {
|
|||||||
|
|
||||||
ACMD_FUNC(fontcolor)
|
ACMD_FUNC(fontcolor)
|
||||||
{
|
{
|
||||||
unsigned char k;
|
|
||||||
|
|
||||||
if( !message || !*message ) {
|
if( !message || !*message ) {
|
||||||
channel_display_list(sd,"colors");
|
channel_display_list(sd,"colors");
|
||||||
return -1;
|
return -1;
|
||||||
@ -9240,6 +9243,7 @@ ACMD_FUNC(fontcolor)
|
|||||||
if( strcmpi(message,"Normal") == 0 ) {
|
if( strcmpi(message,"Normal") == 0 ) {
|
||||||
sd->fontcolor = 0;
|
sd->fontcolor = 0;
|
||||||
} else {
|
} else {
|
||||||
|
unsigned char k;
|
||||||
ARR_FIND(0,Channel_Config.colors_count,k,( strcmpi(message,Channel_Config.colors_name[k]) == 0 ));
|
ARR_FIND(0,Channel_Config.colors_count,k,( strcmpi(message,Channel_Config.colors_name[k]) == 0 ));
|
||||||
if( k == Channel_Config.colors_count ) {
|
if( k == Channel_Config.colors_count ) {
|
||||||
sprintf(atcmd_output, msg_txt(sd,1411), message);// Unknown color '%s'.
|
sprintf(atcmd_output, msg_txt(sd,1411), message);// Unknown color '%s'.
|
||||||
@ -9804,7 +9808,7 @@ static void atcommand_get_suggestions(struct map_session_data* sd, const char *n
|
|||||||
bool is_atcommand(const int fd, struct map_session_data* sd, const char* message, int type)
|
bool is_atcommand(const int fd, struct map_session_data* sd, const char* message, int type)
|
||||||
{
|
{
|
||||||
char charname[NAME_LENGTH], params[100];
|
char charname[NAME_LENGTH], params[100];
|
||||||
char charname2[NAME_LENGTH], params2[100];
|
char charname2[NAME_LENGTH];
|
||||||
char command[100];
|
char command[100];
|
||||||
char output[CHAT_SIZE_MAX];
|
char output[CHAT_SIZE_MAX];
|
||||||
|
|
||||||
@ -9848,6 +9852,7 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message
|
|||||||
if (*message == charcommand_symbol) {
|
if (*message == charcommand_symbol) {
|
||||||
do {
|
do {
|
||||||
int x, y, z;
|
int x, y, z;
|
||||||
|
char params2[100];
|
||||||
|
|
||||||
//Checks to see if #command has a name or a name + parameters.
|
//Checks to see if #command has a name or a name + parameters.
|
||||||
x = sscanf(message, "%99s \"%23[^\"]\" %99[^\n]", command, charname, params);
|
x = sscanf(message, "%99s \"%23[^\"]\" %99[^\n]", command, charname, params);
|
||||||
|
@ -3847,9 +3847,10 @@ struct Damage battle_attack_sc_bonus(struct Damage wd, struct block_list *src, u
|
|||||||
{
|
{
|
||||||
struct map_session_data *sd = BL_CAST(BL_PC, src);
|
struct map_session_data *sd = BL_CAST(BL_PC, src);
|
||||||
struct status_change *sc = status_get_sc(src);
|
struct status_change *sc = status_get_sc(src);
|
||||||
int chorusbonus = 0, type;
|
int chorusbonus = 0;
|
||||||
|
|
||||||
if( sd ) {
|
if( sd ) {
|
||||||
|
int type;
|
||||||
// Minstrel/Wanderer number check for chorus skills.
|
// Minstrel/Wanderer number check for chorus skills.
|
||||||
// Bonus remains 0 unless 3 or more Minstrels/Wanderers are in the party.
|
// Bonus remains 0 unless 3 or more Minstrels/Wanderers are in the party.
|
||||||
if( sd->status.party_id ) {
|
if( sd->status.party_id ) {
|
||||||
|
@ -1500,7 +1500,7 @@ int clif_homskillinfoblock(struct map_session_data *sd)
|
|||||||
{ //[orn]
|
{ //[orn]
|
||||||
struct homun_data *hd;
|
struct homun_data *hd;
|
||||||
int fd = sd->fd;
|
int fd = sd->fd;
|
||||||
int i,j,len=4,id;
|
int i,j,len=4;
|
||||||
WFIFOHEAD(fd, 4+37*MAX_HOMUNSKILL);
|
WFIFOHEAD(fd, 4+37*MAX_HOMUNSKILL);
|
||||||
|
|
||||||
hd = sd->hd;
|
hd = sd->hd;
|
||||||
@ -1509,7 +1509,8 @@ int clif_homskillinfoblock(struct map_session_data *sd)
|
|||||||
|
|
||||||
WFIFOW(fd,0)=0x235;
|
WFIFOW(fd,0)=0x235;
|
||||||
for ( i = 0; i < MAX_HOMUNSKILL; i++){
|
for ( i = 0; i < MAX_HOMUNSKILL; i++){
|
||||||
if( (id = hd->homunculus.hskill[i].id) != 0 ){
|
int id = hd->homunculus.hskill[i].id;
|
||||||
|
if( id != 0 ){
|
||||||
int combo = (hd->homunculus.hskill[i].flag)&SKILL_FLAG_TMP_COMBO;
|
int combo = (hd->homunculus.hskill[i].flag)&SKILL_FLAG_TMP_COMBO;
|
||||||
j = id - HM_SKILLBASE;
|
j = id - HM_SKILLBASE;
|
||||||
WFIFOW(fd,len ) = id;
|
WFIFOW(fd,len ) = id;
|
||||||
|
26
src/map/pc.c
26
src/map/pc.c
@ -5160,6 +5160,32 @@ int pc_memo(struct map_session_data* sd, int pos)
|
|||||||
//
|
//
|
||||||
// Skills
|
// Skills
|
||||||
//
|
//
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the skill current cooldown for player.
|
||||||
|
* (get the db base cooldown for skill + player specific cooldown)
|
||||||
|
* @param sd : player pointer
|
||||||
|
* @param id : skill id
|
||||||
|
* @param lv : skill lv
|
||||||
|
* @return player skill cooldown
|
||||||
|
*/
|
||||||
|
int pc_get_skillcooldown(struct map_session_data *sd, int id, int lv) {
|
||||||
|
int i, cooldown=0;
|
||||||
|
int idx = skill_get_index (id);
|
||||||
|
int cooldownlen = ARRAYLENGTH(sd->skillcooldown);
|
||||||
|
|
||||||
|
if (!idx) return 0;
|
||||||
|
if (skill_db[idx].cooldown[lv - 1])
|
||||||
|
cooldown = skill_db[idx].cooldown[lv - 1];
|
||||||
|
|
||||||
|
ARR_FIND(0, cooldownlen, i, sd->skillcooldown[i].id == id);
|
||||||
|
if(i<cooldownlen){
|
||||||
|
cooldown += sd->skillcooldown[i].val;
|
||||||
|
cooldown = max(0,cooldown);
|
||||||
|
}
|
||||||
|
return cooldown;
|
||||||
|
}
|
||||||
|
|
||||||
/*==========================================
|
/*==========================================
|
||||||
* Return player sd skill_lv learned for given skill
|
* Return player sd skill_lv learned for given skill
|
||||||
*------------------------------------------*/
|
*------------------------------------------*/
|
||||||
|
@ -826,6 +826,7 @@ int pc_isequip(struct map_session_data *sd,int n);
|
|||||||
int pc_equippoint(struct map_session_data *sd,int n);
|
int pc_equippoint(struct map_session_data *sd,int n);
|
||||||
int pc_setinventorydata(struct map_session_data *sd);
|
int pc_setinventorydata(struct map_session_data *sd);
|
||||||
|
|
||||||
|
int pc_get_skillcooldown(struct map_session_data *sd, int id, int lv);
|
||||||
int pc_checkskill(struct map_session_data *sd,uint16 skill_id);
|
int pc_checkskill(struct map_session_data *sd,uint16 skill_id);
|
||||||
short pc_checkequip(struct map_session_data *sd,int pos);
|
short pc_checkequip(struct map_session_data *sd,int pos);
|
||||||
bool pc_checkequip2(struct map_session_data *sd,int nameid,int min, int max);
|
bool pc_checkequip2(struct map_session_data *sd,int nameid,int min, int max);
|
||||||
|
@ -9151,7 +9151,7 @@ BUILDIN_FUNC(monster)
|
|||||||
|
|
||||||
for(i=0; i<amount; i++){ //not optimised
|
for(i=0; i<amount; i++){ //not optimised
|
||||||
int mobid = mob_once_spawn(sd, m, x, y, str, class_, 1, event, size, ai);
|
int mobid = mob_once_spawn(sd, m, x, y, str, class_, 1, event, size, ai);
|
||||||
mapreg_setreg(reference_uid(add_str("$@mobid"), i),mobid);
|
if(mobid) mapreg_setreg(reference_uid(add_str("$@mobid"), i),mobid);
|
||||||
}
|
}
|
||||||
return SCRIPT_CMD_SUCCESS;
|
return SCRIPT_CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -250,28 +250,6 @@ int skill_tree_get_max(uint16 skill_id, int b_class)
|
|||||||
else
|
else
|
||||||
return skill_get_max(skill_id);
|
return skill_get_max(skill_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int skill_get_cooldown_(struct map_session_data *sd, int id, int lv) {
|
|
||||||
int i, cooldown;
|
|
||||||
int idx = skill_get_index (id);
|
|
||||||
if (!idx) return 0;
|
|
||||||
|
|
||||||
cooldown = 0;
|
|
||||||
if (skill_db[idx].cooldown[lv - 1])
|
|
||||||
cooldown = skill_db[idx].cooldown[lv - 1];
|
|
||||||
|
|
||||||
for (i = 0; i < ARRAYLENGTH(sd->skillcooldown) && sd->skillcooldown[i].id; i++) {
|
|
||||||
if (sd->skillcooldown[i].id == id) {
|
|
||||||
cooldown += sd->skillcooldown[i].val;
|
|
||||||
if (cooldown < 0)
|
|
||||||
cooldown = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return cooldown;
|
|
||||||
}
|
|
||||||
|
|
||||||
int skill_frostjoke_scream(struct block_list *bl,va_list ap);
|
int skill_frostjoke_scream(struct block_list *bl,va_list ap);
|
||||||
int skill_check_target_c_marker(struct block_list *bl,va_list ap);
|
int skill_check_target_c_marker(struct block_list *bl,va_list ap);
|
||||||
int skill_attack_area(struct block_list *bl,va_list ap);
|
int skill_attack_area(struct block_list *bl,va_list ap);
|
||||||
@ -3634,18 +3612,17 @@ static int skill_timerskill(int tid, unsigned int tick, int id, intptr_t data)
|
|||||||
* Warlock
|
* Warlock
|
||||||
**/
|
**/
|
||||||
case WL_CHAINLIGHTNING_ATK: {
|
case WL_CHAINLIGHTNING_ATK: {
|
||||||
struct block_list *nbl = NULL; // Next Target of Chain
|
|
||||||
skill_attack(BF_MAGIC,src,src,target,skl->skill_id,skl->skill_lv,tick,skl->flag); // Hit a Lightning on the current Target
|
skill_attack(BF_MAGIC,src,src,target,skl->skill_id,skl->skill_lv,tick,skl->flag); // Hit a Lightning on the current Target
|
||||||
skill_toggle_magicpower(src, skl->skill_id); // only the first hit will be amplify
|
skill_toggle_magicpower(src, skl->skill_id); // only the first hit will be amplify
|
||||||
if( skl->type < (4 + skl->skill_lv - 1) && skl->x < 3 )
|
if( skl->type < (4 + skl->skill_lv - 1) && skl->x < 3 )
|
||||||
{ // Remaining Chains Hit
|
{ // Remaining Chains Hit
|
||||||
|
struct block_list *nbl = NULL; // Next Target of Chain
|
||||||
nbl = battle_getenemyarea(src, target->x, target->y, (skl->type>2)?2:3, // After 2 bounces, it will bounce to other targets in 7x7 range.
|
nbl = battle_getenemyarea(src, target->x, target->y, (skl->type>2)?2:3, // After 2 bounces, it will bounce to other targets in 7x7 range.
|
||||||
BL_CHAR|BL_SKILL, target->id); // Search for a new Target around current one...
|
BL_CHAR|BL_SKILL, target->id); // Search for a new Target around current one...
|
||||||
if( nbl == NULL )
|
if( nbl == NULL )
|
||||||
skl->x++;
|
skl->x++;
|
||||||
else
|
else
|
||||||
skl->x = 0;
|
skl->x = 0;
|
||||||
|
|
||||||
skill_addtimerskill(src, tick + 651, (nbl?nbl:target)->id, skl->x, 0, WL_CHAINLIGHTNING_ATK, skl->skill_lv, skl->type + 1, skl->flag);
|
skill_addtimerskill(src, tick + 651, (nbl?nbl:target)->id, skl->x, 0, WL_CHAINLIGHTNING_ATK, skl->skill_lv, skl->type + 1, skl->flag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4946,13 +4923,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
|
|||||||
sd->ud.canact_tick = tick + skill_delayfix(src, skill_id, skill_lv);
|
sd->ud.canact_tick = tick + skill_delayfix(src, skill_id, skill_lv);
|
||||||
clif_status_change(src, SI_ACTIONDELAY, 1, skill_delayfix(src, skill_id, skill_lv), 0, 0, 0);
|
clif_status_change(src, SI_ACTIONDELAY, 1, skill_delayfix(src, skill_id, skill_lv), 0, 0, 0);
|
||||||
|
|
||||||
cooldown = skill_get_cooldown(skill_id, skill_lv);
|
cooldown = pc_get_skillcooldown(sd,skill_id, skill_lv);
|
||||||
for (i = 0; i < ARRAYLENGTH(sd->skillcooldown) && sd->skillcooldown[i].id; i++) {
|
|
||||||
if( sd->skillcooldown[i].id == skill_id ) {
|
|
||||||
cooldown += sd->skillcooldown[i].val;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if( cooldown )
|
if( cooldown )
|
||||||
skill_blockpc_start(sd, skill_id, cooldown);
|
skill_blockpc_start(sd, skill_id, cooldown);
|
||||||
}
|
}
|
||||||
@ -10345,7 +10316,7 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr_t data)
|
|||||||
if( !sd || sd->skillitem != ud->skill_id || skill_get_delay(ud->skill_id,ud->skill_lv) )
|
if( !sd || sd->skillitem != ud->skill_id || skill_get_delay(ud->skill_id,ud->skill_lv) )
|
||||||
ud->canact_tick = tick + skill_delayfix(src, ud->skill_id, ud->skill_lv); //Tests show wings don't overwrite the delay but skill scrolls do. [Inkfish]
|
ud->canact_tick = tick + skill_delayfix(src, ud->skill_id, ud->skill_lv); //Tests show wings don't overwrite the delay but skill scrolls do. [Inkfish]
|
||||||
if (sd) { //Cooldown application
|
if (sd) { //Cooldown application
|
||||||
int cooldown = skill_get_cooldown_(sd,ud->skill_id, ud->skill_lv); // Increases/Decreases cooldown of a skill by item/card bonuses.
|
int cooldown = pc_get_skillcooldown(sd,ud->skill_id, ud->skill_lv); // Increases/Decreases cooldown of a skill by item/card bonuses.
|
||||||
if(cooldown) skill_blockpc_start(sd, ud->skill_id, cooldown);
|
if(cooldown) skill_blockpc_start(sd, ud->skill_id, cooldown);
|
||||||
}
|
}
|
||||||
if( battle_config.display_status_timers && sd )
|
if( battle_config.display_status_timers && sd )
|
||||||
@ -10571,7 +10542,7 @@ int skill_castend_pos(int tid, unsigned int tick, int id, intptr_t data)
|
|||||||
if( !sd || sd->skillitem != ud->skill_id || skill_get_delay(ud->skill_id,ud->skill_lv) )
|
if( !sd || sd->skillitem != ud->skill_id || skill_get_delay(ud->skill_id,ud->skill_lv) )
|
||||||
ud->canact_tick = tick + skill_delayfix(src, ud->skill_id, ud->skill_lv);
|
ud->canact_tick = tick + skill_delayfix(src, ud->skill_id, ud->skill_lv);
|
||||||
if (sd) { //Cooldown application
|
if (sd) { //Cooldown application
|
||||||
int cooldown = skill_get_cooldown_(sd,ud->skill_id, ud->skill_lv);
|
int cooldown = pc_get_skillcooldown(sd,ud->skill_id, ud->skill_lv);
|
||||||
if(cooldown) skill_blockpc_start(sd, ud->skill_id, cooldown);
|
if(cooldown) skill_blockpc_start(sd, ud->skill_id, cooldown);
|
||||||
}
|
}
|
||||||
if( battle_config.display_status_timers && sd )
|
if( battle_config.display_status_timers && sd )
|
||||||
@ -15590,7 +15561,7 @@ void skill_weaponrefine (struct map_session_data *sd, int idx)
|
|||||||
|
|
||||||
if(item->nameid > 0 && ditem->type == IT_WEAPON)
|
if(item->nameid > 0 && ditem->type == IT_WEAPON)
|
||||||
{
|
{
|
||||||
int i = 0, ep = 0, per;
|
int i = 0, per;
|
||||||
int material[5] = { 0, ITEMID_PHRACON, ITEMID_EMVERETARCON, ITEMID_ORIDECON, ITEMID_ORIDECON, };
|
int material[5] = { 0, ITEMID_PHRACON, ITEMID_EMVERETARCON, ITEMID_ORIDECON, ITEMID_ORIDECON, };
|
||||||
if( ditem->flag.no_refine ) { // if the item isn't refinable
|
if( ditem->flag.no_refine ) { // if the item isn't refinable
|
||||||
clif_skill_fail(sd,sd->menuskill_id,USESKILL_FAIL_LEVEL,0);
|
clif_skill_fail(sd,sd->menuskill_id,USESKILL_FAIL_LEVEL,0);
|
||||||
@ -15612,6 +15583,7 @@ void skill_weaponrefine (struct map_session_data *sd, int idx)
|
|||||||
|
|
||||||
pc_delitem(sd, i, 1, 0, 0, LOG_TYPE_OTHER);
|
pc_delitem(sd, i, 1, 0, 0, LOG_TYPE_OTHER);
|
||||||
if (per > rnd() % 100) {
|
if (per > rnd() % 100) {
|
||||||
|
int ep=0;
|
||||||
log_pick_pc(sd, LOG_TYPE_OTHER, -1, item);
|
log_pick_pc(sd, LOG_TYPE_OTHER, -1, item);
|
||||||
item->refine++;
|
item->refine++;
|
||||||
log_pick_pc(sd, LOG_TYPE_OTHER, 1, item);
|
log_pick_pc(sd, LOG_TYPE_OTHER, 1, item);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user