summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-24 02:41:32 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-24 02:41:32 +0000
commite061189cdeb39b3efb0fd3a9e6f299379671fb2f (patch)
treea00b8b11e068c2beec5112f17a167cd5652d919d /src/map/pc.c
parent2d740c0b724383ea09540509d7069d02b74db096 (diff)
downloadhercules-e061189cdeb39b3efb0fd3a9e6f299379671fb2f.tar.gz
hercules-e061189cdeb39b3efb0fd3a9e6f299379671fb2f.tar.bz2
hercules-e061189cdeb39b3efb0fd3a9e6f299379671fb2f.tar.xz
hercules-e061189cdeb39b3efb0fd3a9e6f299379671fb2f.zip
* [Optimized]:
- Setting of variables with defined scope in some frequently executed script events. * [Added]: - Missing script_require_trigger flags for some power hungry events. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7325 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index ee163433f..030c174bc 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -826,12 +826,18 @@ int pc_reg_received(struct map_session_data *sd)
sd->state.event_kill_pc = pc_readglobalreg(sd, script_config.kill_pc_event_name);
sd->state.event_kill_mob = pc_readglobalreg(sd, script_config.kill_mob_event_name);
sd->state.event_disconnect = pc_readglobalreg(sd, script_config.logout_event_name);
+ sd->state.event_baselvup = pc_readglobalreg(sd, script_config.baselvup_event_name);
+ sd->state.event_joblvup = pc_readglobalreg(sd, script_config.joblvup_event_name);
+ sd->state.event_loadmap = pc_readglobalreg(sd, script_config.loadmap_event_name);
// if script triggers are not required
} else {
sd->state.event_death = 1;
sd->state.event_kill_pc = 1;
sd->state.event_disconnect = 1;
sd->state.event_kill_mob = 1;
+ sd->state.event_baselvup = 1;
+ sd->state.event_joblvup = 1;
+ sd->state.event_loadmap = 1;
}
npc_script_event(sd, NPCE_LOGIN);
@@ -3917,7 +3923,8 @@ int pc_checkbaselevelup(struct map_session_data *sd)
}
clif_misceffect(&sd->bl,0);
//LORDALFA - LVLUPEVENT
- npc_script_event(sd, NPCE_BASELVUP);
+ if(sd->state.event_baselvup)
+ npc_script_event(sd, NPCE_BASELVUP);
return 1;
}
@@ -3948,7 +3955,8 @@ int pc_checkjoblevelup(struct map_session_data *sd)
if (pc_checkskill(sd, SG_DEVIL) && !pc_nextjobexp(sd))
clif_status_change(&sd->bl,SI_DEVIL, 1); //Permanent blind effect from SG_DEVIL.
- npc_script_event(sd, NPCE_JOBLVUP);
+ if(sd->state.event_joblvup)
+ npc_script_event(sd, NPCE_JOBLVUP);
return 1;
}
@@ -4700,8 +4708,10 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
case BL_PC:
{
struct map_session_data *ssd = (struct map_session_data *)src;
- if (sd->state.event_death)
+ if (sd->state.event_death){
pc_setglobalreg(sd,"killerrid",(ssd->status.account_id));
+ npc_script_event(sd,NPCE_DIE);
+ }
if (ssd->state.event_kill_pc) {
pc_setglobalreg(ssd, "killedrid", sd->bl.id);
npc_script_event(ssd, NPCE_KILLPC);
@@ -4736,9 +4746,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
}
break;
}
-
- if (sd->state.event_death)
- npc_script_event(sd,NPCE_DIE);
+
// PK/Karma system code (not enabled yet) [celest]
/*