- Updated battle_switch to use strncmpi instead of strcmpi, it makes it so using "yessir" will match "yes", this is actually needed because if you set a config setting to "yes " (notice the trailing space), then the map config engine fails to read it right, and will set the config setting to 0 (no).
- Added function pc_resethate to more easily handle Angel trigger - Made feel_var and hate_var static variables to pc.c to simplify things and avoid errors due to redundancy. - Updated the show_mob_info setting to add another space to the separating pipes, so that each field is separated by " | " instead of " |". git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@8721 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
ebc1f2bc02
commit
34683f252f
@ -4,6 +4,14 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
|
|||||||
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
|
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
|
||||||
|
|
||||||
2006/09/12
|
2006/09/12
|
||||||
|
* Updated battle_switch to use strncmpi instead of strcmpi, it makes it so
|
||||||
|
using "yessir" will match "yes", this is actually needed because if you set
|
||||||
|
a config setting to "yes " (notice the trailing space), then the map config
|
||||||
|
engine fails to read it right, and will set the config setting to 0 (no).
|
||||||
|
[Skotlex]
|
||||||
|
* Some corrections to hate_mob cleanup when triggering the Angel stuff. [Skotlex]
|
||||||
|
* Updated the show_mob_info setting to add another space to the separating
|
||||||
|
pipes, so that each field is separated by " | " instead of " |". [Skotlex]
|
||||||
* Homunculus intimacy will go back to 500 on evolution. [Skotlex]
|
* Homunculus intimacy will go back to 500 on evolution. [Skotlex]
|
||||||
* Baphomet splash damage will now hit nearby enemies regardless of flee
|
* Baphomet splash damage will now hit nearby enemies regardless of flee
|
||||||
(but the initial attack still has to connect for the splash to trigger)
|
(but the initial attack still has to connect for the splash to trigger)
|
||||||
|
@ -3429,10 +3429,18 @@ int battle_check_range(struct block_list *src,struct block_list *bl,int range)
|
|||||||
*------------------------------------------
|
*------------------------------------------
|
||||||
*/
|
*/
|
||||||
int battle_config_switch(const char *str) {
|
int battle_config_switch(const char *str) {
|
||||||
if (strcmpi(str, "on") == 0 || strcmpi(str, "yes") == 0 || strcmpi(str, "oui") == 0 || strcmpi(str, "ja") == 0 || strcmpi(str, "si") == 0)
|
if(strncmpi(str, "on",2) == 0 ||
|
||||||
|
strncmpi(str, "yes",3) == 0 ||
|
||||||
|
strncmpi(str, "oui",3) == 0 ||
|
||||||
|
strncmpi(str, "ja",2) == 0 ||
|
||||||
|
strncmpi(str, "si",2) == 0)
|
||||||
return 1;
|
return 1;
|
||||||
if (strcmpi(str, "off") == 0 || strcmpi(str, "no") == 0 || strcmpi(str, "non") == 0 || strcmpi(str, "nein") == 0)
|
if(strncmpi(str, "off",3) == 0 ||
|
||||||
|
strncmpi(str, "no",2) == 0 ||
|
||||||
|
strncmpi(str, "non",3) == 0 ||
|
||||||
|
strncmpi(str, "nein",4) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return atoi(str);
|
return atoi(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7865,7 +7865,7 @@ int clif_charnameack (int fd, struct block_list *bl)
|
|||||||
//Even thought mobhp ain't a name, we send it as one so the client
|
//Even thought mobhp ain't a name, we send it as one so the client
|
||||||
//can parse it. [Skotlex]
|
//can parse it. [Skotlex]
|
||||||
if (str_p != mobhp) {
|
if (str_p != mobhp) {
|
||||||
*(str_p-2) = '\0'; //Remove trailing space + pipe.
|
*(str_p-3) = '\0'; //Remove trailing space + pipe.
|
||||||
memcpy(WBUFP(buf,30), mobhp, NAME_LENGTH);
|
memcpy(WBUFP(buf,30), mobhp, NAME_LENGTH);
|
||||||
WBUFB(buf,54) = 0;
|
WBUFB(buf,54) = 0;
|
||||||
memcpy(WBUFP(buf,78), mobhp, NAME_LENGTH);
|
memcpy(WBUFP(buf,78), mobhp, NAME_LENGTH);
|
||||||
|
19
src/map/pc.c
19
src/map/pc.c
@ -66,6 +66,9 @@ static int GM_num = 0;
|
|||||||
#define MOTD_LINE_SIZE 128
|
#define MOTD_LINE_SIZE 128
|
||||||
char motd_text[MOTD_LINE_SIZE][256]; // Message of the day buffer [Valaris]
|
char motd_text[MOTD_LINE_SIZE][256]; // Message of the day buffer [Valaris]
|
||||||
|
|
||||||
|
static const char feel_var[3][NAME_LENGTH] = {"PC_FEEL_SUN","PC_FEEL_MOON","PC_FEEL_STAR"};
|
||||||
|
static const char hate_var[3][NAME_LENGTH] = {"PC_HATE_MOB_SUN","PC_HATE_MOB_MOON","PC_HATE_MOB_STAR"};
|
||||||
|
|
||||||
int pc_isGM(struct map_session_data *sd) {
|
int pc_isGM(struct map_session_data *sd) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -796,8 +799,6 @@ int pc_set_hate_mob(struct map_session_data *sd, int pos, struct block_list *bl)
|
|||||||
int pc_reg_received(struct map_session_data *sd)
|
int pc_reg_received(struct map_session_data *sd)
|
||||||
{
|
{
|
||||||
int i,j;
|
int i,j;
|
||||||
const char feel_var[3][NAME_LENGTH] = {"PC_FEEL_SUN","PC_FEEL_MOON","PC_FEEL_STAR"};
|
|
||||||
const char hate_var[3][NAME_LENGTH] = {"PC_HATE_MOB_SUN","PC_HATE_MOB_MOON","PC_HATE_MOB_STAR"};
|
|
||||||
|
|
||||||
sd->change_level = pc_readglobalreg(sd,"jobchange_level");
|
sd->change_level = pc_readglobalreg(sd,"jobchange_level");
|
||||||
sd->die_counter = pc_readglobalreg(sd,"PC_DIE_COUNTER");
|
sd->die_counter = pc_readglobalreg(sd,"PC_DIE_COUNTER");
|
||||||
@ -4732,7 +4733,6 @@ int pc_resetskill(struct map_session_data* sd, int flag)
|
|||||||
int pc_resetfeel(struct map_session_data* sd)
|
int pc_resetfeel(struct map_session_data* sd)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char feel_var[3][NAME_LENGTH] = {"PC_FEEL_SUN","PC_FEEL_MOON","PC_FEEL_STAR"};
|
|
||||||
nullpo_retr(0, sd);
|
nullpo_retr(0, sd);
|
||||||
|
|
||||||
for (i=0; i<3; i++)
|
for (i=0; i<3; i++)
|
||||||
@ -4745,6 +4745,19 @@ int pc_resetfeel(struct map_session_data* sd)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int pc_resethate(struct map_session_data* sd)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
nullpo_retr(0, sd);
|
||||||
|
|
||||||
|
for (i=0; i<3; i++)
|
||||||
|
{
|
||||||
|
sd->hate_mob[i] = -1;
|
||||||
|
pc_setglobalreg(sd,hate_var[i],0);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int pc_respawn(int tid,unsigned int tick,int id,int data)
|
static int pc_respawn(int tid,unsigned int tick,int id,int data)
|
||||||
{
|
{
|
||||||
struct map_session_data *sd = map_id2sd(id);
|
struct map_session_data *sd = map_id2sd(id);
|
||||||
|
@ -196,6 +196,7 @@ int pc_resetlvl(struct map_session_data*,int type);
|
|||||||
int pc_resetstate(struct map_session_data*);
|
int pc_resetstate(struct map_session_data*);
|
||||||
int pc_resetskill(struct map_session_data*, int);
|
int pc_resetskill(struct map_session_data*, int);
|
||||||
int pc_resetfeel(struct map_session_data*);
|
int pc_resetfeel(struct map_session_data*);
|
||||||
|
int pc_resethate(struct map_session_data*);
|
||||||
int pc_equipitem(struct map_session_data*,int,int);
|
int pc_equipitem(struct map_session_data*,int,int);
|
||||||
int pc_unequipitem(struct map_session_data*,int,int);
|
int pc_unequipitem(struct map_session_data*,int,int);
|
||||||
int pc_checkitem(struct map_session_data*);
|
int pc_checkitem(struct map_session_data*);
|
||||||
|
@ -7022,10 +7022,7 @@ static int status_natural_heal(DBKey key,void * data,va_list app)
|
|||||||
(sd->class_&MAPID_UPPERMASK) == MAPID_STAR_GLADIATOR &&
|
(sd->class_&MAPID_UPPERMASK) == MAPID_STAR_GLADIATOR &&
|
||||||
rand()%10000 < battle_config.sg_angel_skill_ratio
|
rand()%10000 < battle_config.sg_angel_skill_ratio
|
||||||
) { //Angel of the Sun/Moon/Star
|
) { //Angel of the Sun/Moon/Star
|
||||||
malloc_set(sd->hate_mob, 0, sizeof(sd->hate_mob));
|
pc_resethate(sd);
|
||||||
pc_setglobalreg(sd,"PC_HATE_MOB_STAR", 0);
|
|
||||||
pc_setglobalreg(sd,"PC_HATE_MOB_SUN", 0);
|
|
||||||
pc_setglobalreg(sd,"PC_HATE_MOB_MOON", 0);
|
|
||||||
pc_resetfeel(sd);
|
pc_resetfeel(sd);
|
||||||
//TODO: Figure out how to make the client-side msg show up.
|
//TODO: Figure out how to make the client-side msg show up.
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user