diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-12-22 15:38:30 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-12-22 15:38:30 +0000 |
commit | 5f2901fbbb6d4f7deafa6f1a6638ca7f1d4dce87 (patch) | |
tree | e7a97e0f0c6fe330ceaafd5e74af71c04e8c27cf | |
parent | a65e4681cd29db1d0936523cc8ff5646dc7dca5b (diff) | |
download | hercules-5f2901fbbb6d4f7deafa6f1a6638ca7f1d4dce87.tar.gz hercules-5f2901fbbb6d4f7deafa6f1a6638ca7f1d4dce87.tar.bz2 hercules-5f2901fbbb6d4f7deafa6f1a6638ca7f1d4dce87.tar.xz hercules-5f2901fbbb6d4f7deafa6f1a6638ca7f1d4dce87.zip |
- Simplified the global function "getJobName"
- Simplified function agitcheck so it isn't crash prone. Now it takes no arguments, and will return whether WoE is on or not.
- Updated bundled scripts as required for this change.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9559 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog-Trunk.txt | 2 | ||||
-rw-r--r-- | npc/Changelog.txt | 4 | ||||
-rw-r--r-- | npc/custom/WoE_Setter.txt | 6 | ||||
-rw-r--r-- | npc/custom/eAAC_Scripts/kafraExpress/ke_warp_woe.txt | 2 | ||||
-rw-r--r-- | npc/guild/gldfunc_manager.txt | 2 | ||||
-rw-r--r-- | npc/other/Global_Functions.txt | 164 | ||||
-rw-r--r-- | src/map/guild.c | 4 | ||||
-rw-r--r-- | src/map/script.c | 21 |
8 files changed, 18 insertions, 187 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 222ae80a9..775b833e8 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,8 @@ 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. 2006/12/22 + * Simplified function agitcheck so it isn't crash prone. Now it takes no + arguments, and will return whether WoE is on or not. * Now when you specify a max level beyond what the exp table has, the last entry of the exp table will be duplicated to fill in the remaining levels. [Skotlex] diff --git a/npc/Changelog.txt b/npc/Changelog.txt index 380b4b97b..a97eed75b 100644 --- a/npc/Changelog.txt +++ b/npc/Changelog.txt @@ -33,6 +33,10 @@ KarLaeda Date Added ====== + +2006/12/22 + * Corrected scripts to use the new format of agitcheck + * Simplified the global function "getJobName" [Skotlex] 2006/12/19 * Now root functions calls can have parenthesis (will take any parenthesis after the function as the start of the argument list). diff --git a/npc/custom/WoE_Setter.txt b/npc/custom/WoE_Setter.txt index 8a842dec7..9fafa0233 100644 --- a/npc/custom/WoE_Setter.txt +++ b/npc/custom/WoE_Setter.txt @@ -120,7 +120,7 @@ L_Reset: mes "Are you sure?"; next; menu "No, what was I thinking",L_No,"Yes I really want to do it",-; - if(agitcheck(0)==1) goto L_WoEOn; + if(agitcheck()) goto L_WoEOn; deletearray $sday[0],200; deletearray $eday[0],200; deletearray $woetime[0],200; @@ -173,14 +173,14 @@ L_StartLoop: // Stop WoE L_End: - if(agitcheck(0)==0) end; + if(!agitcheck()) end; Announce "The War Of Emperium is over!",8; AgitEnd; end; // Start WoE L_Start: - if(agitcheck(0)==1) end; + if(agitcheck()) end; Announce "The War Of Emperium has begun!",8; AgitStart; end; diff --git a/npc/custom/eAAC_Scripts/kafraExpress/ke_warp_woe.txt b/npc/custom/eAAC_Scripts/kafraExpress/ke_warp_woe.txt index 2adce07a0..f9aefbb49 100644 --- a/npc/custom/eAAC_Scripts/kafraExpress/ke_warp_woe.txt +++ b/npc/custom/eAAC_Scripts/kafraExpress/ke_warp_woe.txt @@ -25,7 +25,7 @@ function script F_keWarpWOE { callfunc "F_keIntro", e_srt, "Sorry, these warps are only available to people who belong to a Guild."; return; } - if ($@kewg_checkAgit && agitcheck(0) == 0) { + if ($@kewg_checkAgit && !agitcheck()) { callfunc "F_keIntro", e_srt, "Sorry, these warps are only enabled during the Guild Wars."; return; } diff --git a/npc/guild/gldfunc_manager.txt b/npc/guild/gldfunc_manager.txt index d42f37ed7..619291df8 100644 --- a/npc/guild/gldfunc_manager.txt +++ b/npc/guild/gldfunc_manager.txt @@ -231,7 +231,7 @@ function script F_GldManager { //set @SGuardian,strmobinfo(4,1287) + (@Defence*2000); //uncomment the following line to disable guardians Installation during WoE - //if(agitcheck(0) != 0) goto L_CantGuard; + //if(agitcheck()) goto L_CantGuard; mes "Would you like to install a guardian? Guardians will protect the guild base from enemies."; mes "Please choose a guardian."; next; diff --git a/npc/other/Global_Functions.txt b/npc/other/Global_Functions.txt index d8a8f4d93..757ae4aa6 100644 --- a/npc/other/Global_Functions.txt +++ b/npc/other/Global_Functions.txt @@ -282,167 +282,7 @@ function script F_ItemName { ////////////////////////////////////////////////////////////////////////////////// function script getJobName { - switch(getarg(0)){ - case Job_Novice: - return "Novice"; - case Job_Swordman: - return "Swordman"; - case Job_Mage: - return "Magician"; - case Job_Archer: - return "Archer"; - case Job_Acolyte: - return "Acolyte"; - case Job_Merchant: - return "Merchant"; - case Job_Thief: - return "Thief"; - case Job_Knight: - case Job_Knight2: - return "Knight"; - case Job_Priest: - return "Priest"; - case Job_Wizard: - return "Wizard"; - case Job_Blacksmith: - return "Blacksmith"; - case Job_Hunter: - return "Hunter"; - case Job_Assassin: - return "Assassin"; - case Job_Crusader: - case Job_Crusader2: - return "Crusader"; - case Job_Monk: - return "Monk"; - case Job_Sage: - return "Sage"; - case Job_Rogue: - return "Rogue"; - case Job_Alchem: - return "Alchemist"; - case Job_Bard: - return "Bard"; - case Job_Dancer: - return "Dancer"; - case Job_SuperNovice: - return "Super Novice"; - case Job_Gunslinger: - return "Gunsligner"; - case Job_Ninja: - return "Ninja"; - case Job_Xmas: - return "Xmas"; - case Job_Novice_High: - return "Novice High"; - case Job_Swordman_High: - return "Swordman High"; - case Job_Mage_High: - return "Magician High"; - case Job_Archer_High: - return "Archer High"; - case Job_Acolyte_High: - return "Acolyte High"; - case Job_Merchant_High: - return "Merchant High"; - case Job_Thief_High: - return "Thief High"; - case Job_Lord_Knight: - case Job_Lord_Knight2: - return "Lord Knight"; - case Job_High_Priest: - return "High Priest"; - case Job_High_Wizard: - return "High Wizard"; - case Job_Whitesmith: - return "Whitesmith"; - case Job_Sniper: - return "Sniper"; - case Job_Assassin_Cross: - return "Assassin Cross"; - case Job_Paladin: - case Job_Paladin2: - return "Paladin"; - case Job_Champion: - return "Champion"; - case Job_Professor: - return "Professor"; - case Job_Stalker: - return "Stalker"; - case Job_Creator: - return "Creator"; - case Job_Clown: - return "Clown"; - case Job_Gypsy: - return "Gypsy"; - case Job_Baby: - return "Baby"; - case Job_Baby_Swordman: - return "Baby Swordman"; - case Job_Baby_Mage: - return "Baby Magician"; - case Job_Baby_Archer: - return "Baby Archer"; - case Job_Baby_Acolyte: - return "Baby Acolyte"; - case Job_Baby_Merchant: - return "Baby Merchant"; - case Job_Baby_Thief: - return "Baby Thief"; - case Job_Baby_Knight: - case Job_Baby_Knight2: - return "Baby Knight"; - case Job_Baby_Priest: - return "Baby Priest"; - case Job_Baby_Wizard: - return "Baby Wizard"; - case Job_Baby_Blacksmith: - return "Baby Blacksmith"; - case Job_Baby_Hunter: - return "Baby Hunter"; - case Job_Baby_Assassin: - return "Baby Assassin"; - case Job_Baby_Crusader: - case Job_Baby_Crusader2: - return "Baby Crusader"; - case Job_Baby_Monk: - return "Baby Monk"; - case Job_Baby_Sage: - return "Baby Sage"; - case Job_Baby_Rogue: - return "Baby Rogue"; - case Job_Baby_Alchem: - return "Baby Alchemist"; - case Job_Baby_Bard: - return "Baby Bard"; - case Job_Baby_Dancer: - return "Baby Dancer"; - case Job_Super_Baby: - return "Super Baby"; - case Job_Taekwon: - if(Sex == 0) - return "Taekwon Girl"; - else - return "Taekwon Boy"; - case Job_Star_Gladiator: - case Job_Star_Gladiator2: - return "Star Gladiator"; - case Job_Soul_Linker: - return "Soul Linker"; - case Job_Ninja: - return "Ninja"; - case Job_Gunslinger: - return "Gunslinger"; - case Job_Xmas: - return "Christmas"; - case Option_Wedding: - if(Sex == 0) - return "Bride"; - else - return "Bridegroom"; - default: - return "omghaxor"; - } + return jobname(getarg(0)); } ////////////////////////////////////////////////////////////////////////////////// @@ -483,4 +323,4 @@ function script F_Load2Skills { } set ADV_QSK2,0; //Clear var return; -}
\ No newline at end of file +} diff --git a/src/map/guild.c b/src/map/guild.c index a5db3664a..60643eede 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -1898,8 +1898,7 @@ int guild_agit_break(struct mob_data *md) { // Run One NPC_Event[OnAgitBreak] char *evname; - nullpo_retr(0, md); - + if(!agit_flag) return 0; // Agit already End evname=(char *)aMallocA((strlen(md->npc_event) + 1)*sizeof(char)); strcpy(evname,md->npc_event); @@ -1908,7 +1907,6 @@ int guild_agit_break(struct mob_data *md) // But Script will be stop, so nothing... // Maybe will be changed in the futher.. // int c = npc_event_do(evname); - if(!agit_flag) return 0; // Agit already End add_timer(gettick()+battle_config.gvg_eliminate_time,guild_gvg_eliminate_timer,md->bl.m,(int)evname); return 0; } diff --git a/src/map/script.c b/src/map/script.c index 8357c094d..919c22917 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -3806,7 +3806,7 @@ struct script_function buildin_func[] = { {buildin_maprespawnguildid,"maprespawnguildid","sii"}, {buildin_agitstart,"agitstart",""}, // <Agit> {buildin_agitend,"agitend",""}, - {buildin_agitcheck,"agitcheck","i"}, // <Agitcheck> + {buildin_agitcheck,"agitcheck",""}, // <Agitcheck> {buildin_flagemblem,"flagemblem","i"}, // Flag Emblem {buildin_getcastlename,"getcastlename","s"}, {buildin_getcastledata,"getcastledata","si*"}, @@ -8790,28 +8790,15 @@ int buildin_agitend(struct script_state *st) return 0; } /*========================================== - * agitcheck 1; // choice script - * if(@agit_flag == 1) goto agit; - * if(agitcheck(0) == 1) goto agit; + * Returns whether woe is on or off. // choice script *------------------------------------------ */ int buildin_agitcheck(struct script_state *st) { - struct map_session_data *sd; - int cond; - - cond=conv_num(st,& (st->stack->stack_data[st->start+2])); - - if(cond == 0) { - if (agit_flag==1) push_val(st->stack,C_INT,1); - if (agit_flag==0) push_val(st->stack,C_INT,0); - } else { - sd=script_rid2sd(st); - if (agit_flag==1) pc_setreg(sd,add_str("@agit_flag"),1); - if (agit_flag==0) pc_setreg(sd,add_str("@agit_flag"),0); - } + push_val(st->stack,C_INT,agit_flag); return 0; } + int buildin_flagemblem(struct script_state *st) { int g_id=conv_num(st,& (st->stack->stack_data[st->start+2])); |