summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-01 16:34:21 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-01 16:34:21 +0000
commit446724fb64fc64557ef4a2c63659359d7b6fb89f (patch)
tree4bbc801ba2603099dc475bb351b9df82cd20b19c
parenta73973dde466fa25c118fca4da9acb7db2ee1666 (diff)
downloadhercules-446724fb64fc64557ef4a2c63659359d7b6fb89f.tar.gz
hercules-446724fb64fc64557ef4a2c63659359d7b6fb89f.tar.bz2
hercules-446724fb64fc64557ef4a2c63659359d7b6fb89f.tar.xz
hercules-446724fb64fc64557ef4a2c63659359d7b6fb89f.zip
Removed code that queues OnAgitEliminate after the Emperium is broken, this is now done properly by the gvg script instead (partially deals with bugreport:342).
If you have any extra castles, update your scripts accordingly. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11630 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt4
-rw-r--r--npc/Changelog.txt3
-rw-r--r--npc/guild/aldeg/aldeg_ev_agit.txt5
-rw-r--r--npc/guild/gefg/gefg_ev_agit.txt5
-rw-r--r--npc/guild/gldfunc_ev_agit.txt2
-rw-r--r--npc/guild/payg/payg_ev_agit.txt5
-rw-r--r--npc/guild/prtg/prtg_ev_agit.txt5
-rw-r--r--src/map/guild.c39
-rw-r--r--src/map/guild.h1
-rw-r--r--src/map/mob.c10
10 files changed, 29 insertions, 50 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 80a1156c9..07cdfcd1a 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -3,6 +3,10 @@ Date Added
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
+2007/11/01
+ * Removed code that queues OnAgitEliminate after the Emperium is broken,
+ this is now done properly by the gvg script instead [ultramage]
+ - if you have any extra castles, update your scripts accordingly
2007/10/31
* Added names to the SC_ and SI_ enums, now they can be used to properly
indicate where such values are to be used (replaces usage of 'int')
diff --git a/npc/Changelog.txt b/npc/Changelog.txt
index daffb0979..5ff1c8590 100644
--- a/npc/Changelog.txt
+++ b/npc/Changelog.txt
@@ -1,5 +1,8 @@
Date Added
======
+2007/11/01
+ * Added timers to trigger OnAgitEliminate after Emperium is broken
+ (this was previously done from inside the source code) [ultramage]
2007/10/31
* Rev. 11628 Fixed reward option in Arena giving potato. [L0ne_W0lf]
* Rev. 11626 Added Turbo Track point exchanger to arena. [L0ne_W0lf]
diff --git a/npc/guild/aldeg/aldeg_ev_agit.txt b/npc/guild/aldeg/aldeg_ev_agit.txt
index db92875c5..41db26690 100644
--- a/npc/guild/aldeg/aldeg_ev_agit.txt
+++ b/npc/guild/aldeg/aldeg_ev_agit.txt
@@ -28,6 +28,7 @@ OnAgitStart:
end;
OnAgitBreak:
callfunc "F_AgitBreak","aldeg_cas01","A01";
+ addtimer getbattleflag("gvg_eliminate_time"), "Agit_A01::OnAgitEliminate";
end;
OnGuildBreak:
callfunc "F_GuildBreak","aldeg_cas01","A01";
@@ -54,6 +55,7 @@ OnAgitStart:
end;
OnAgitBreak:
callfunc "F_AgitBreak","aldeg_cas02","A02";
+ addtimer getbattleflag("gvg_eliminate_time"), "Agit_A02::OnAgitEliminate";
end;
OnGuildBreak:
callfunc "F_GuildBreak","aldeg_cas02","A02";
@@ -80,6 +82,7 @@ OnAgitStart:
end;
OnAgitBreak:
callfunc "F_AgitBreak","aldeg_cas03","A03";
+ addtimer getbattleflag("gvg_eliminate_time"), "Agit_A03::OnAgitEliminate";
end;
OnGuildBreak:
callfunc "F_GuildBreak","aldeg_cas03","A03";
@@ -106,6 +109,7 @@ OnAgitStart:
end;
OnAgitBreak:
callfunc "F_AgitBreak","aldeg_cas04","A04";
+ addtimer getbattleflag("gvg_eliminate_time"), "Agit_A04::OnAgitEliminate";
end;
OnGuildBreak:
callfunc "F_GuildBreak","aldeg_cas04","A04";
@@ -132,6 +136,7 @@ OnAgitStart:
end;
OnAgitBreak:
callfunc "F_AgitBreak","aldeg_cas05","A05";
+ addtimer getbattleflag("gvg_eliminate_time"), "Agit_A05::OnAgitEliminate";
end;
OnGuildBreak:
callfunc "F_GuildBreak","aldeg_cas05","A05";
diff --git a/npc/guild/gefg/gefg_ev_agit.txt b/npc/guild/gefg/gefg_ev_agit.txt
index 628b50c5d..2a33f298b 100644
--- a/npc/guild/gefg/gefg_ev_agit.txt
+++ b/npc/guild/gefg/gefg_ev_agit.txt
@@ -28,6 +28,7 @@ OnAgitStart:
end;
OnAgitBreak:
callfunc "F_AgitBreak","gefg_cas01","G01";
+ addtimer getbattleflag("gvg_eliminate_time"), "Agit_G01::OnAgitEliminate";
end;
OnGuildBreak:
callfunc "F_GuildBreak","gefg_cas01","G01";
@@ -54,6 +55,7 @@ OnAgitStart:
end;
OnAgitBreak:
callfunc "F_AgitBreak","gefg_cas02","G02";
+ addtimer getbattleflag("gvg_eliminate_time"), "Agit_G02::OnAgitEliminate";
end;
OnGuildBreak:
callfunc "F_GuildBreak","gefg_cas02","G02";
@@ -80,6 +82,7 @@ OnAgitStart:
end;
OnAgitBreak:
callfunc "F_AgitBreak","gefg_cas03","G03";
+ addtimer getbattleflag("gvg_eliminate_time"), "Agit_G03::OnAgitEliminate";
end;
OnGuildBreak:
callfunc "F_GuildBreak","gefg_cas03","G03";
@@ -106,6 +109,7 @@ OnAgitStart:
end;
OnAgitBreak:
callfunc "F_AgitBreak","gefg_cas04","G04";
+ addtimer getbattleflag("gvg_eliminate_time"), "Agit_G04::OnAgitEliminate";
end;
OnGuildBreak:
callfunc "F_GuildBreak","gefg_cas04","G04";
@@ -132,6 +136,7 @@ OnAgitStart:
end;
OnAgitBreak:
callfunc "F_AgitBreak","gefg_cas05","G05";
+ addtimer getbattleflag("gvg_eliminate_time"), "Agit_G05::OnAgitEliminate";
end;
OnGuildBreak:
callfunc "F_GuildBreak","gefg_cas05","G05";
diff --git a/npc/guild/gldfunc_ev_agit.txt b/npc/guild/gldfunc_ev_agit.txt
index b2e391c19..0bd85b66f 100644
--- a/npc/guild/gldfunc_ev_agit.txt
+++ b/npc/guild/gldfunc_ev_agit.txt
@@ -157,7 +157,7 @@ function script F_AgitBreak {
disablenpc "Kafra Staff#"+.@castle$;
- for( set .@i, 4; .@i < 25; set .@i, .@i+1 )
+ for( set .@i, 4; .@i <= 25; set .@i, .@i+1 )
SetCastleData .@map$, .@i, 0;
return;
diff --git a/npc/guild/payg/payg_ev_agit.txt b/npc/guild/payg/payg_ev_agit.txt
index 485e31252..9caf96b3f 100644
--- a/npc/guild/payg/payg_ev_agit.txt
+++ b/npc/guild/payg/payg_ev_agit.txt
@@ -28,6 +28,7 @@ OnAgitStart:
end;
OnAgitBreak:
callfunc "F_AgitBreak","payg_cas01","Py01";
+ addtimer getbattleflag("gvg_eliminate_time"), "Agit_Py01::OnAgitEliminate";
end;
OnGuildBreak:
callfunc "F_GuildBreak","payg_cas01","Py01";
@@ -54,6 +55,7 @@ OnAgitStart:
end;
OnAgitBreak:
callfunc "F_AgitBreak","payg_cas02","Py02";
+ addtimer getbattleflag("gvg_eliminate_time"), "Agit_Py02::OnAgitEliminate";
end;
OnGuildBreak:
callfunc "F_GuildBreak","payg_cas02","Py02";
@@ -80,6 +82,7 @@ OnAgitStart:
end;
OnAgitBreak:
callfunc "F_AgitBreak","payg_cas03","Py03";
+ addtimer getbattleflag("gvg_eliminate_time"), "Agit_Py03::OnAgitEliminate";
end;
OnGuildBreak:
callfunc "F_GuildBreak","payg_cas03","Py03";
@@ -106,6 +109,7 @@ OnAgitStart:
end;
OnAgitBreak:
callfunc "F_AgitBreak","payg_cas04","Py04";
+ addtimer getbattleflag("gvg_eliminate_time"), "Agit_Py04::OnAgitEliminate";
end;
OnGuildBreak:
callfunc "F_GuildBreak","payg_cas04","Py04";
@@ -132,6 +136,7 @@ OnAgitStart:
end;
OnAgitBreak:
callfunc "F_AgitBreak","payg_cas05","Py05";
+ addtimer getbattleflag("gvg_eliminate_time"), "Agit_Py05::OnAgitEliminate";
end;
OnGuildBreak:
callfunc "F_GuildBreak","payg_cas05","Py05";
diff --git a/npc/guild/prtg/prtg_ev_agit.txt b/npc/guild/prtg/prtg_ev_agit.txt
index d38557039..22523f17c 100644
--- a/npc/guild/prtg/prtg_ev_agit.txt
+++ b/npc/guild/prtg/prtg_ev_agit.txt
@@ -28,6 +28,7 @@ OnAgitStart:
end;
OnAgitBreak:
callfunc "F_AgitBreak","prtg_cas01","Pt01";
+ addtimer getbattleflag("gvg_eliminate_time"), "Agit_Pt01::OnAgitEliminate";
end;
OnGuildBreak:
callfunc "F_GuildBreak","prtg_cas01","Pt01";
@@ -54,6 +55,7 @@ OnAgitStart:
end;
OnAgitBreak:
callfunc "F_AgitBreak","prtg_cas02","Pt02";
+ addtimer getbattleflag("gvg_eliminate_time"), "Agit_Pt02::OnAgitEliminate";
end;
OnGuildBreak:
callfunc "F_GuildBreak","prtg_cas02","Pt02";
@@ -80,6 +82,7 @@ OnAgitStart:
end;
OnAgitBreak:
callfunc "F_AgitBreak","prtg_cas03","Pt03";
+ addtimer getbattleflag("gvg_eliminate_time"), "Agit_Pt03::OnAgitEliminate";
end;
OnGuildBreak:
callfunc "F_GuildBreak","prtg_cas03","Pt03";
@@ -106,6 +109,7 @@ OnAgitStart:
end;
OnAgitBreak:
callfunc "F_AgitBreak","prtg_cas04","Pt04";
+ addtimer getbattleflag("gvg_eliminate_time"), "Agit_Pt04::OnAgitEliminate";
end;
OnGuildBreak:
callfunc "F_GuildBreak","prtg_cas04","Pt04";
@@ -132,6 +136,7 @@ OnAgitStart:
end;
OnAgitBreak:
callfunc "F_AgitBreak","prtg_cas05","Pt05";
+ addtimer getbattleflag("gvg_eliminate_time"), "Agit_Pt05::OnAgitEliminate";
end;
OnGuildBreak:
callfunc "F_GuildBreak","prtg_cas05","Pt05";
diff --git a/src/map/guild.c b/src/map/guild.c
index 12577a8fd..c2738dc91 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -66,7 +66,6 @@ struct{
int guild_save_timer = -1;
int guild_payexp_timer(int tid,unsigned int tick,int id,int data);
-int guild_gvg_eliminate_timer(int tid,unsigned int tick,int id,int data);
int guild_save_sub(int tid,unsigned int tick,int id,int data);
static int guild_send_xy_timer(int tid,unsigned int tick,int id,int data);
@@ -216,7 +215,6 @@ void do_init_guild(void)
guild_read_guildskill_tree_db(); //guild skill tree [Komurka]
- add_timer_func_list(guild_gvg_eliminate_timer,"guild_gvg_eliminate_timer");
add_timer_func_list(guild_payexp_timer,"guild_payexp_timer");
add_timer_func_list(guild_save_sub, "guild_save_sub");
add_timer_func_list(guild_send_xy_timer, "guild_send_xy_timer");
@@ -1882,27 +1880,6 @@ int guild_agit_end(void)
return 0;
}
-int guild_gvg_eliminate_timer(int tid,unsigned int tick,int id,int data)
-{ // Run One NPC_Event[OnAgitEliminate]
- char *name = (char*)data;
- size_t len = (name) ? strlen(name) : 0;
- // the rest is dangerous, but let it crash,
- // if this happens, it's ruined anyway
- int c=0;
-
- if(agit_flag) // Agit not already End
- {
- char *evname=(char*)aMalloc( (len + 10) * sizeof(char));
- memcpy(evname,name,len - 5);
- strcpy(evname + len - 5,"Eliminate");
- c = npc_event_do(evname);
- ShowStatus("NPC_Event:[%s] Run (%d) Events.\n",evname,c);
- aFree(evname); // [Lance] Should fix this
- }
- if(name) aFree(name);
- return 0;
-}
-
static int Ghp[MAX_GUILDCASTLE][MAX_GUARDIANS]; // so save only if HP are changed // experimental code [Yor]
static int Gid[MAX_GUILDCASTLE];
int guild_save_sub(int tid,unsigned int tick,int id,int data)
@@ -1928,22 +1905,6 @@ int guild_save_sub(int tid,unsigned int tick,int id,int data)
return 0;
}
-int guild_agit_break(struct mob_data *md)
-{ // Run One NPC_Event[OnAgitBreak]
- char* evname;
-
- if(!agit_flag) return 0; // Agit already End
-
- evname = aStrdup(md->npc_event);
-// Now By User to Run [OnAgitBreak] NPC Event...
-// It's a little impossible to null point with player disconnect in this!
-// But Script will be stop, so nothing...
-// Maybe will be changed in the futher..
-// int c = npc_event_do(evname);
- add_timer(gettick()+battle_config.gvg_eliminate_time,guild_gvg_eliminate_timer,md->bl.m,(int)evname);
- return 0;
-}
-
// How many castles does this guild have?
int guild_checkcastles(struct guild *g)
{
diff --git a/src/map/guild.h b/src/map/guild.h
index b7b5f2ac4..61c9e1778 100644
--- a/src/map/guild.h
+++ b/src/map/guild.h
@@ -89,7 +89,6 @@ int guild_castlealldataload(int len,struct guild_castle *gc);
int guild_agit_start(void);
int guild_agit_end(void);
-int guild_agit_break(struct mob_data *md);
void do_final_guild(void);
diff --git a/src/map/mob.c b/src/map/mob.c
index d202fd41a..88fad163f 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2189,14 +2189,6 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
//Emperium destroyed by script. Discard mvp character. [Skotlex]
mvp_sd = NULL;
-
- // <Agit> NPC Event [OnAgitBreak]
- if(md->npc_event[0] && strcmp(((md->npc_event)+strlen(md->npc_event)-13),"::OnAgitBreak") == 0) {
- ShowNotice("MOB.C: Run NPC_Event[OnAgitBreak].\n");
- if (agit_flag == 1) //Call to Run NPC_Event[OnAgitBreak]
- guild_agit_break(md);
- }
-
if(src && src->type == BL_MOB){
struct mob_data *smd = (struct mob_data *)src;
if(smd->nd)
@@ -2317,7 +2309,7 @@ int mob_guardian_guildchange(struct block_list *bl,va_list ap)
return 0;
}
- md->guardian_data->guild_id = md->guardian_data->castle->guild_id;
+ md->guardian_data->guild_id = g->guild_id;
md->guardian_data->emblem_id = g->emblem_id;
md->guardian_data->guardup_lv = guild_checkskill(g,GD_GUARDUP);
memcpy(md->guardian_data->guild_name, g->name, NAME_LENGTH);