summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhemagx <ibrahem.h.basyone@gmail.com>2016-09-11 16:56:53 +0200
committerhemagx <ibrahem.h.basyone@gmail.com>2016-09-11 16:56:53 +0200
commitb0850ec37591b1316b1692ad9a3ed4940ad19f7c (patch)
tree7b6bf06e3c256f5a1eb577a807d19b9d01cca397
parent2e50931a0efd4620ff45b0d43d7ef336f077d27d (diff)
parentb437c7382e6d0ca1339427ddbc3e20ca3c6cdf57 (diff)
downloadhercules-b0850ec37591b1316b1692ad9a3ed4940ad19f7c.tar.gz
hercules-b0850ec37591b1316b1692ad9a3ed4940ad19f7c.tar.bz2
hercules-b0850ec37591b1316b1692ad9a3ed4940ad19f7c.tar.xz
hercules-b0850ec37591b1316b1692ad9a3ed4940ad19f7c.zip
Merge pull request #1423 from Ridley8819/nightmare
Closes #1423 as merged
-rw-r--r--npc/mapflag/nobranch.txt10
-rw-r--r--npc/mapflag/nomemo.txt8
-rw-r--r--npc/re/instances/OldGlastHeim.txt85
-rw-r--r--npc/re/quests/quests_aldebaran.txt59
-rw-r--r--npc/re/quests/quests_glastheim.txt104
-rw-r--r--npc/re/scripts.conf1
-rw-r--r--src/map/script.c23
7 files changed, 152 insertions, 138 deletions
diff --git a/npc/mapflag/nobranch.txt b/npc/mapflag/nobranch.txt
index 6e584a7c3..60db05cf5 100644
--- a/npc/mapflag/nobranch.txt
+++ b/npc/mapflag/nobranch.txt
@@ -9,7 +9,7 @@
//= This file is part of Hercules.
//= http://herc.ws - http://github.com/HerculesWS/Hercules
//=
-//= Copyright (C) 2012-2015 Hercules Dev Team
+//= Copyright (C) 2012-2016 Hercules Dev Team
//= Copyright (C) rAthena Dev Team
//= Copyright (C) eAthena Dev Team
//= Copyright (C) L0ne_W0lf
@@ -31,7 +31,7 @@
//=========================================================================
//= Mapflag: Disable Dead Branch use.
//================= Current Version =======================================
-//= 1.8
+//= 1.8.1
//================= Description ===========================================
//= Disables the following items:
//= Dead Branch (604), Bloody Branch (12103),
@@ -405,6 +405,12 @@ ecl_in04 mapflag nobranch
1@ecl mapflag nobranch
ecl_hub01 mapflag nobranch
+// Episode 14.3 ===========
+c_tower2_ mapflag nobranch
+c_tower3_ mapflag nobranch
+gl_chyard_ mapflag nobranch
+gl_cas02_ mapflag nobranch
+
// Ghost Palace ===========
1@spa mapflag nobranch
diff --git a/npc/mapflag/nomemo.txt b/npc/mapflag/nomemo.txt
index d958694f9..d93552429 100644
--- a/npc/mapflag/nomemo.txt
+++ b/npc/mapflag/nomemo.txt
@@ -9,7 +9,7 @@
//= This file is part of Hercules.
//= http://herc.ws - http://github.com/HerculesWS/Hercules
//=
-//= Copyright (C) 2012-2015 Hercules Dev Team
+//= Copyright (C) 2012-2016 Hercules Dev Team
//= Copyright (C) Epoque
//= Copyright (C) eAthena Dev Team
//= Copyright (C) Gepard
@@ -33,7 +33,7 @@
//=========================================================================
//= Mapflag: Disable Warp Portal memory.
//================= Current Version =======================================
-//= 1.8b
+//= 1.8.2
//================= Description ===========================================
//= Prevents players from using /memo on a map.
//= Also disables marriage warp skills.
@@ -783,6 +783,10 @@ ecl_tdun04 mapflag nomemo
ecl_hub01 mapflag nomemo
moc_prydn1 mapflag nomemo
moc_prydn2 mapflag nomemo
+c_tower2_ mapflag nomemo
+c_tower3_ mapflag nomemo
+gl_chyard_ mapflag nomemo
+gl_cas02_ mapflag nomemo
//Orc's Memory ===================
1@orcs mapflag nomemo
diff --git a/npc/re/instances/OldGlastHeim.txt b/npc/re/instances/OldGlastHeim.txt
index 3bef4589d..0b7bb7e6e 100644
--- a/npc/re/instances/OldGlastHeim.txt
+++ b/npc/re/instances/OldGlastHeim.txt
@@ -2754,88 +2754,3 @@ glast_01,192,273,3 script Khalitzburg Knight#1a 4_F_KHALITZBURG,{
close;
}
}
-
-// Glast Heim Nightmare Mode :: nightmare_gh
-//============================================================
-glast_01,195,273,4 script Hugin's Follower#n_gh 2_F_MAGICMASTER,{
- mes("[Hugin's Follower]");
- mes("I can't move between time and dimension like a master Hugin but I can pretend to move.");
- next;
- mes("[Hugin's Follower]");
- mes("What about this Glast Heim is born with powerful dark force?");
- next;
- if (select("I don't care", "That is interesting, please tell me more") == 1) {
- mes("[Hugin's Follower]");
- mes("Well~ If you are not interested in it, never mind.");
- close;
- }
- mes("[Hugin's Follower]");
- mes("As learning ability from Hugin, I just find out the path to Old Glast Heim of more powerful dark force.");
- next;
- mes("[Hugin's Follower]");
- mes("How is it? Do you want to explore there?");
- next;
- if (select("No, I want to stop it", "I really want to do that!") == 1) {
- mes("[Hugin's Follower]");
- mes("Well~ If you are not interested in it, never mind.");
- close;
- }
- mes("[Hugin's Follower]");
- mes("Sure that is not free~ I have to get something little bit. Hoho...");
- next;
- mes("[Hugin's Follower]");
- mes("I can send you just two place. How is it? Do you want to try?");
- next;
- switch (select("Cancel", "Monastery Cemetery (Lv100~130) - 5000z", "Corridor of 2nd floor (Over Lv140) - 10000z")) {
- case 1:
- mes("[Hugin's Follower]");
- mes("Alright, please come back whenever you change mind. I think you will have lots of thing to talk with me...");
- close;
- case 2:
- if (Zeny < 5000) {
- mes("[Hugin's Follower]");
- mes("Please make sure you already have all of the money.");
- close;
- }
- Zeny = Zeny-5000;
- warp "gl_chyard_", 148, 144;
- end;
- case 3:
- if (Zeny < 10000) {
- mes("[Hugin's Follower]");
- mes("Please make sure you already have all of the money.");
- close;
- }
- Zeny = Zeny-10000;
- warp "gl_cas02_", 104, 31;
- end;
- }
-}
-
-gl_chyard_,148,149,4 script Hugin's Follower#n_gh1 2_F_MAGICMASTER,{
- mes("[Hugin's Follower]");
- mes("You want to break?");
- mes("Ok, let's get out of here.?");
- next;
- if (select("Ah, wrong click... I mean I was not talk to you", "Please let me out from here") == 1) {
- mes("[Hugin's Follower]");
- mes("Alright just tell me whenever you want to leave.");
- close;
- }
- warp "glast_01", 210, 269;
- end;
-}
-
-gl_cas02_,104,36,4 script Hugin's Follower#n_gh2 2_F_MAGICMASTER,{
- mes("[Hugin's Follower]");
- mes("You want to break?");
- mes("Ok, let's get out of here.?");
- next;
- if (select("Ah, wrong click... I mean I was not talk to you", "Please let me out from here") == 1) {
- mes("[Hugin's Follower]");
- mes("Alright just tell me whenever you want to leave.");
- close;
- }
- warp "glast_01", 210, 269;
- end;
-}
diff --git a/npc/re/quests/quests_aldebaran.txt b/npc/re/quests/quests_aldebaran.txt
index 017421258..336ddb1c7 100644
--- a/npc/re/quests/quests_aldebaran.txt
+++ b/npc/re/quests/quests_aldebaran.txt
@@ -11,6 +11,7 @@
//=
//= Copyright (C) 2016 Hercules Dev Team
//= Copyright (C) 2016 Ridley
+//= Copyright (C) 2016 Aleos
//=
//= Hercules is free software: you can redistribute it and/or modify
//= it under the terms of the GNU General Public License as published by
@@ -29,7 +30,7 @@
//================= Description ===========================================
//= NPCs related to Aldebaran Clock Tower (Nightmare)
//================= Current Version =======================================
-//= 1.0
+//= 1.1
//=========================================================================
c_tower1,232,222,5 script Belljamin Button#ct 4_M_RUSMAN2,{
mes("[Belljamin Button]");
@@ -43,43 +44,21 @@ c_tower1,232,222,5 script Belljamin Button#ct 4_M_RUSMAN2,{
mes("[Belljamin Button]");
mes("I'm begging you not to ask more about it. It might put your life in danger.");
next;
- switch (select("Don't ask", "Go to 2nd floor of warped tower", "Go to 3rd floor of warped tower")) {
+ .@menu = select("Don't ask", "Go to 2nd floor of warped tower", "Go to 3rd floor of warped tower");
+ switch (.@menu) {
case 1:
- mes("[Belljamin Button]");
- mes("Phew...You've made good choice. The place is so brutal so you should probably get back to a safe area.");
- close;
- case 2:
- mes("[Belljamin Button]");
- mes("Be careful with your choice.");
- next;
- mes("[Belljamin Button]");
- mes("I need ^0000FF10,000z^000000 to let you in. It's a pretty dangerous place to be.");
- next;
- switch (select("Quit", "Pay 10,000z", "Why do you need money?")) {
- case 1:
- mes("[Belljamin Button]");
- mes("Phew...You've made good choice. The place is so brutal so you should probably get back to a safe area.");
- close;
- case 2:
- if (Zeny < 10000) {
- mes("[Belljamin Button]");
- mes("Really? You don't have money and asked me to take you there?");
- close;
- }
- Zeny -= 10000;
- mes("[Belljamin Button]");
- mes("I'm not sure how you'll keep track of time in there but be as careful as you can.");
- close2;
- warp "c_tower2_", 268, 26;
- end;
- case 3:
- mes("[Belljamin Button]");
- mes("I am here all day for the safety of adventurers. I always alert them about the danger. That's why I need some pay.");
- emotion e_swt;
- close;
- }
break;
+ case 2:
case 3:
+ if (.@menu == 2) {
+ .@map$ = "c_tower2_";
+ .@x = 268;
+ .@y = 26;
+ } else {
+ .@map$ = "c_tower3_";
+ .@x = 65;
+ .@y = 147;
+ }
mes("[Belljamin Button]");
mes("Be careful with your choice.");
next;
@@ -88,9 +67,7 @@ c_tower1,232,222,5 script Belljamin Button#ct 4_M_RUSMAN2,{
next;
switch (select("Quit", "Pay 10,000z", "Why do you need money?")) {
case 1:
- mes("[Belljamin Button]");
- mes("Phew...You've made good choice. The place is so brutal so you should probably get back to a safe area.");
- close;
+ break;
case 2:
if (Zeny < 10000) {
mes("[Belljamin Button]");
@@ -101,7 +78,7 @@ c_tower1,232,222,5 script Belljamin Button#ct 4_M_RUSMAN2,{
mes("[Belljamin Button]");
mes("I'm not sure how you'll keep track of time in there but be as careful as you can.");
close2;
- warp "c_tower3_", 65, 147;
+ warp .@map$, .@x, .@y;
end;
break;
case 3:
@@ -110,7 +87,11 @@ c_tower1,232,222,5 script Belljamin Button#ct 4_M_RUSMAN2,{
emotion e_swt;
close;
}
+ break;
}
+ mes("[Belljamin Button]");
+ mes("Phew...You've made good choice. The place is so brutal so you should probably get back to a safe area.");
+ close;
}
c_tower2_,274,26,3 script Belljamin Button#nct1 4_M_RUSCHILD,{
diff --git a/npc/re/quests/quests_glastheim.txt b/npc/re/quests/quests_glastheim.txt
new file mode 100644
index 000000000..cc6f2dc9d
--- /dev/null
+++ b/npc/re/quests/quests_glastheim.txt
@@ -0,0 +1,104 @@
+//================= Hercules Script =======================================
+//= _ _ _
+//= | | | | | |
+//= | |_| | ___ _ __ ___ _ _| | ___ ___
+//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __|
+//= | | | | __/ | | (__| |_| | | __/\__ \
+//= \_| |_/\___|_| \___|\__,_|_|\___||___/
+//================= License ===============================================
+//= This file is part of Hercules.
+//= http://herc.ws - http://github.com/HerculesWS/Hercules
+//=
+//= Copyright (C) 2016 Hercules Dev Team
+//= Copyright (C) 2016 Ridley
+//=
+//= Hercules is free software: you can redistribute it and/or modify
+//= it under the terms of the GNU General Public License as published by
+//= the Free Software Foundation, either version 3 of the License, or
+//= (at your option) any later version.
+//=
+//= This program is distributed in the hope that it will be useful,
+//= but WITHOUT ANY WARRANTY; without even the implied warranty of
+//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+//= GNU General Public License for more details.
+//=
+//= You should have received a copy of the GNU General Public License
+//= along with this program. If not, see <http://www.gnu.org/licenses/>.
+//=========================================================================
+//= Nightmare Glastheim Dungeon
+//================= Description ===========================================
+//= NPCs related to Glastheim (Nightmare)
+//================= Current Version =======================================
+//= 1.0
+//=========================================================================
+glast_01,195,273,4 script Hugin's Follower#n_gh 2_F_MAGICMASTER,{
+ mes("[Hugin's Follower]");
+ mes("I can't move between time and dimension like a master Hugin but I can pretend to move.");
+ next;
+ mes("[Hugin's Follower]");
+ mes("What about this Glast Heim is born with powerful dark force?");
+ next;
+ if (select("I don't care", "That is interesting, please tell me more") != 1) {
+ mes("[Hugin's Follower]");
+ mes("As learning ability from Hugin, I just find out the path to Old Glast Heim of more powerful dark force.");
+ next;
+ mes("[Hugin's Follower]");
+ mes("How is it? Do you want to explore there?");
+ next;
+ if (select("No, I want to stop it", "I really want to do that!") != 1) {
+ mes("[Hugin's Follower]");
+ mes("Sure that is not free~ I have to get something little bit. Hoho...");
+ next;
+ mes("[Hugin's Follower]");
+ mes("I can send you just two place. How is it? Do you want to try?");
+ next;
+ .@menu = select("Cancel", "Monastery Cemetery (Lv100~130) - 5000z", "Corridor of 2nd floor (Over Lv140) - 10000z");
+ switch (.@menu) {
+ case 1:
+ mes("[Hugin's Follower]");
+ mes("Alright, please come back whenever you change mind. I think you will have lots of thing to talk with me...");
+ close;
+ case 2:
+ case 3:
+ if (.@menu == 2) {
+ .@map$ = "gl_chyard_";
+ .@x = 148;
+ .@y = 144;
+ .@zeny = 5000;
+ } else {
+ .@map$ = "gl_cas02_";
+ .@x = 104;
+ .@y = 31;
+ .@zeny = 10000;
+ }
+ if (Zeny < .@zeny) {
+ mes("[Hugin's Follower]");
+ mes("What, did you ask me without money?");
+ close;
+ }
+ Zeny -= .@zeny;
+ warp .@map$, .@x, .@y;
+ end;
+ }
+ }
+ }
+ mes("[Hugin's Follower]");
+ mes("Well~ If you are not interested in it, never mind.");
+ close;
+}
+
+gl_chyard_,148,149,4 script Hugin's Follower#n_gh1 2_F_MAGICMASTER,{
+ mes("[Hugin's Follower]");
+ mes("You want to break?");
+ mes("Ok, let's get out of here.?");
+ next;
+ if (select("Ah, wrong click... I mean I was not talk to you", "Please let me out from here") == 1) {
+ mes("[Hugin's Follower]");
+ mes("Alright just tell me whenever you want to leave.");
+ close;
+ }
+ warp "glast_01", 210, 269;
+ end;
+}
+
+gl_cas02_,104,36,4 duplicate(Hugin's Follower#n_gh1) Hugin's Follower#n_gh2 2_F_MAGICMASTER
diff --git a/npc/re/scripts.conf b/npc/re/scripts.conf
index 8529e7b31..1504e0416 100644
--- a/npc/re/scripts.conf
+++ b/npc/re/scripts.conf
@@ -169,6 +169,7 @@
"npc/re/quests/quests_dewata.txt",
"npc/re/quests/quests_dicastes.txt",
"npc/re/quests/quests_eclage.txt",
+"npc/re/quests/quests_glastheim.txt",
"npc/re/quests/quests_izlude.txt",
"npc/re/quests/quests_lighthalzen.txt",
"npc/re/quests/quests_malangdo.txt",
diff --git a/src/map/script.c b/src/map/script.c
index 7db3736e3..2633c1e5f 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -2970,17 +2970,18 @@ const void *get_val2(struct script_state *st, int64 uid, struct reg_db *ref)
**/
void script_array_ensure_zero(struct script_state *st, struct map_session_data *sd, int64 uid, struct reg_db *ref) {
const char *name = script->get_str(script_getvarid(uid));
- // is here st can be null pointer and st->rid is wrong?
- struct reg_db *src;
+ struct reg_db *src = NULL;
bool insert = false;
- nullpo_retv(st);
- src = script->array_src(st, sd ? sd : st->rid ? map->id2sd(st->rid) : NULL, name, ref);
-
- if (sd && !st) {
- /* when sd comes, st isn't available */
+ if (st == NULL) {
+ // Special case with no st available, only sd
+ nullpo_retv(sd);
+ src = script->array_src(NULL, sd, name, ref);
insert = true;
} else {
+ if (sd == NULL && st->rid != 0)
+ sd = map->id2sd(st->rid); // Retrieve the missing sd
+ src = script->array_src(st, sd, name, ref);
if( is_string_variable(name) ) {
const char *str = script->get_val2(st, uid, ref);
if (str != NULL && *str != '\0')
@@ -3121,10 +3122,12 @@ struct reg_db *script_array_src(struct script_state *st, struct map_session_data
src = &mapreg->regs;
break;
case '.':/* npc/script */
- if( ref )
+ if (ref != NULL) {
src = ref;
- else
+ } else {
+ nullpo_retr(NULL, st);
src = (name[1] == '@') ? &st->stack->scope : &st->script->local;
+ }
break;
case '\'':/* instance */
nullpo_retr(NULL, st);
@@ -9490,7 +9493,7 @@ BUILDIN(guildskill) {
skill_id = ( script_isstringtype(st,2) ? skill->name2id(script_getstr(st,2)) : script_getnum(st,2) );
level = script_getnum(st,3);
- if (skill_id < GD_SKILLBASE || skill_id > GD_MAX)
+ if (skill_id < GD_SKILLBASE || skill_id >= GD_MAX)
return true; // not guild skill
id = skill_id - GD_SKILLBASE;