* Added 'max_eventtimer_length' to script_athena.conf
* Removed PCLoginEvent requiring 'PCLoginEvent' for the player to be set to 1 first to be activated git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@945 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
c94c71d282
commit
5055b2da21
@ -1,5 +1,10 @@
|
|||||||
Date Added
|
Date Added
|
||||||
01/10
|
01/10
|
||||||
|
* Added 'max_eventtimer_length' (default is 32) to script_athena.conf. [celest]
|
||||||
|
Some event timers with names longer than 24 could cause the server to close
|
||||||
|
itself, change this if you need support for even longer names
|
||||||
|
* Removed PCLoginEvent requiring 'PCLoginEvent' for the player to be set to 1
|
||||||
|
first to be activated. [celest]
|
||||||
* Added Shinomori and orn's fix for the skill tree to only check the first
|
* Added Shinomori and orn's fix for the skill tree to only check the first
|
||||||
required skill in the DB and skipping the rest [celest]
|
required skill in the DB and skipping the rest [celest]
|
||||||
* Modified 'wedding' script command to work with "OnTimer" scripts even without
|
* Modified 'wedding' script command to work with "OnTimer" scripts even without
|
||||||
|
@ -11,4 +11,6 @@ warn_cmd_mismatch_paramnum: yes
|
|||||||
|
|
||||||
check_cmdcount: 8192
|
check_cmdcount: 8192
|
||||||
|
|
||||||
check_gotocount: 512
|
check_gotocount: 512
|
||||||
|
|
||||||
|
max_eventtimer_length: 32
|
@ -147,7 +147,6 @@ struct map_session_data {
|
|||||||
unsigned event_death : 1;
|
unsigned event_death : 1;
|
||||||
unsigned event_kill : 1;
|
unsigned event_kill : 1;
|
||||||
unsigned event_disconnect : 1;
|
unsigned event_disconnect : 1;
|
||||||
unsigned event_onconnect : 1;
|
|
||||||
} state;
|
} state;
|
||||||
struct {
|
struct {
|
||||||
unsigned killer : 1;
|
unsigned killer : 1;
|
||||||
|
13
src/map/pc.c
13
src/map/pc.c
@ -876,8 +876,7 @@ int pc_authok(int id, int login_id2, time_t connect_until_time, struct mmo_chars
|
|||||||
sd->state.event_death = pc_readglobalreg(sd,"PCDieEvent");
|
sd->state.event_death = pc_readglobalreg(sd,"PCDieEvent");
|
||||||
sd->state.event_kill = pc_readglobalreg(sd,"PCKillEvent");
|
sd->state.event_kill = pc_readglobalreg(sd,"PCKillEvent");
|
||||||
sd->state.event_disconnect = pc_readglobalreg(sd,"PCLogoffEvent");
|
sd->state.event_disconnect = pc_readglobalreg(sd,"PCLogoffEvent");
|
||||||
sd->state.event_onconnect = pc_readglobalreg(sd,"PCLoginEvent");
|
|
||||||
|
|
||||||
if (night_flag == 1 && !map[sd->bl.m].flag.indoors) {
|
if (night_flag == 1 && !map[sd->bl.m].flag.indoors) {
|
||||||
char tmpstr[1024];
|
char tmpstr[1024];
|
||||||
strcpy(tmpstr, msg_txt(500)); // Actually, it's the night...
|
strcpy(tmpstr, msg_txt(500)); // Actually, it's the night...
|
||||||
@ -898,7 +897,7 @@ int pc_authok(int id, int login_id2, time_t connect_until_time, struct mmo_chars
|
|||||||
sprintf(tmp_output,"Character '"CL_WHITE"%s"CL_RESET"' logged in. (Account ID: '"CL_WHITE"%d"CL_RESET"').\n", sd->status.name, sd->status.account_id);
|
sprintf(tmp_output,"Character '"CL_WHITE"%s"CL_RESET"' logged in. (Account ID: '"CL_WHITE"%d"CL_RESET"').\n", sd->status.name, sd->status.account_id);
|
||||||
ShowInfo(tmp_output);
|
ShowInfo(tmp_output);
|
||||||
|
|
||||||
if (sd->state.event_onconnect) {
|
{
|
||||||
struct npc_data *npc;
|
struct npc_data *npc;
|
||||||
//printf("pc: OnPCLogin event done. (%d events)\n", npc_event_doall("OnPCLogin") );
|
//printf("pc: OnPCLogin event done. (%d events)\n", npc_event_doall("OnPCLogin") );
|
||||||
if ((npc = npc_name2id("PCLoginEvent"))) {
|
if ((npc = npc_name2id("PCLoginEvent"))) {
|
||||||
@ -6581,8 +6580,6 @@ int pc_setglobalreg(struct map_session_data *sd,char *reg,int val)
|
|||||||
sd->state.event_kill = val;
|
sd->state.event_kill = val;
|
||||||
} else if(strcmp(reg,"PCLogoutEvent") == 0){
|
} else if(strcmp(reg,"PCLogoutEvent") == 0){
|
||||||
sd->state.event_disconnect = val;
|
sd->state.event_disconnect = val;
|
||||||
} else if(strcmp(reg,"PCLoginEvent") == 0){
|
|
||||||
sd->state.event_onconnect = val;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(val==0){
|
if(val==0){
|
||||||
@ -6794,14 +6791,14 @@ int pc_addeventtimer(struct map_session_data *sd,int tick,const char *name)
|
|||||||
|
|
||||||
nullpo_retr(0, sd);
|
nullpo_retr(0, sd);
|
||||||
|
|
||||||
Assert(strlen(name) < 24);
|
Assert(strlen(name) < script_config.max_eventtimer_len);
|
||||||
|
|
||||||
for(i=0;i<MAX_EVENTTIMER;i++)
|
for(i=0;i<MAX_EVENTTIMER;i++)
|
||||||
if( sd->eventtimer[i]==-1 )
|
if( sd->eventtimer[i]==-1 )
|
||||||
break;
|
break;
|
||||||
if(i<MAX_EVENTTIMER){
|
if(i<MAX_EVENTTIMER){
|
||||||
char *evname=(char *)aCalloc(24,sizeof(char));
|
char *evname=(char *)aCalloc(script_config.max_eventtimer_len,sizeof(char));
|
||||||
memcpy(evname,name,24);
|
memcpy(evname,name,script_config.max_eventtimer_len);
|
||||||
sd->eventtimer[i]=add_timer(gettick()+tick,
|
sd->eventtimer[i]=add_timer(gettick()+tick,
|
||||||
pc_eventtimer,sd->bl.id,(int)evname);
|
pc_eventtimer,sd->bl.id,(int)evname);
|
||||||
sd->eventcount++;
|
sd->eventcount++;
|
||||||
|
@ -78,14 +78,8 @@ struct dbt* script_get_userfunc_db(){ if(!userfunc_db) userfunc_db=strdb_init(50
|
|||||||
int scriptlabel_final(void *k,void *d,va_list ap){ return 0; }
|
int scriptlabel_final(void *k,void *d,va_list ap){ return 0; }
|
||||||
static char pos[11][100] = {"頭","体","左手","右手","ローブ","靴","アクセサリー1","アクセサリー2","頭2","頭3","装着していない"};
|
static char pos[11][100] = {"頭","体","左手","右手","ローブ","靴","アクセサリー1","アクセサリー2","頭2","頭3","装着していない"};
|
||||||
|
|
||||||
static struct Script_Config {
|
struct Script_Config script_config;
|
||||||
int warn_func_no_comma;
|
|
||||||
int warn_cmd_no_comma;
|
|
||||||
int warn_func_mismatch_paramnum;
|
|
||||||
int warn_cmd_mismatch_paramnum;
|
|
||||||
int check_cmdcount;
|
|
||||||
int check_gotocount;
|
|
||||||
} script_config;
|
|
||||||
static int parse_cmd_if=0;
|
static int parse_cmd_if=0;
|
||||||
static int parse_cmd;
|
static int parse_cmd;
|
||||||
|
|
||||||
@ -7210,6 +7204,7 @@ int script_config_read(char *cfgName)
|
|||||||
script_config.warn_cmd_mismatch_paramnum=1;
|
script_config.warn_cmd_mismatch_paramnum=1;
|
||||||
script_config.check_cmdcount=8192;
|
script_config.check_cmdcount=8192;
|
||||||
script_config.check_gotocount=512;
|
script_config.check_gotocount=512;
|
||||||
|
script_config.max_eventtimer_len=32;
|
||||||
|
|
||||||
fp=fopen(cfgName,"r");
|
fp=fopen(cfgName,"r");
|
||||||
if(fp==NULL){
|
if(fp==NULL){
|
||||||
@ -7243,6 +7238,9 @@ int script_config_read(char *cfgName)
|
|||||||
else if(strcmpi(w1,"check_gotocount")==0) {
|
else if(strcmpi(w1,"check_gotocount")==0) {
|
||||||
script_config.check_gotocount = battle_config_switch(w2);
|
script_config.check_gotocount = battle_config_switch(w2);
|
||||||
}
|
}
|
||||||
|
else if(strcmpi(w1,"max_eventtimer_length")==0) {
|
||||||
|
script_config.max_eventtimer_len = battle_config_switch(w2);
|
||||||
|
}
|
||||||
else if(strcmpi(w1,"import")==0){
|
else if(strcmpi(w1,"import")==0){
|
||||||
script_config_read(w2);
|
script_config_read(w2);
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,16 @@
|
|||||||
#ifndef _SCRIPT_H_
|
#ifndef _SCRIPT_H_
|
||||||
#define _SCRIPT_H_
|
#define _SCRIPT_H_
|
||||||
|
|
||||||
|
extern struct Script_Config {
|
||||||
|
int warn_func_no_comma;
|
||||||
|
int warn_cmd_no_comma;
|
||||||
|
int warn_func_mismatch_paramnum;
|
||||||
|
int warn_cmd_mismatch_paramnum;
|
||||||
|
int check_cmdcount;
|
||||||
|
int check_gotocount;
|
||||||
|
int max_eventtimer_len;
|
||||||
|
} script_config;
|
||||||
|
|
||||||
struct script_data {
|
struct script_data {
|
||||||
int type;
|
int type;
|
||||||
union {
|
union {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user