summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml12
-rw-r--r--db/pre-re/map_zone_db.conf2
-rw-r--r--db/pre-re/skill_db.conf3
-rw-r--r--db/re/map_zone_db.conf2
-rw-r--r--doc/script_commands.txt66
-rw-r--r--npc/other/Global_Functions.txt10
-rw-r--r--npc/other/auction.txt2
-rw-r--r--npc/quests/quests_moscovia.txt125
-rw-r--r--npc/quests/the_sign_quest.txt10
-rw-r--r--npc/re/merchants/shadow_refiner.txt2
-rw-r--r--npc/woe-se/agit_main_se.txt29
-rw-r--r--src/map/clif.c32
-rw-r--r--src/map/clif.h2
-rw-r--r--src/map/mob.c2
-rw-r--r--src/map/packets_struct.h9
-rw-r--r--src/map/script.c418
-rw-r--r--src/map/unit.c2
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc4
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc12
19 files changed, 543 insertions, 201 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 13d140fbc..8a3eb53c5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -180,11 +180,11 @@ re:gcc-4.9:
pre_re:gcc-5:
<<: *branch_exceptions
<<: *prerequisites
- stage: primary
- image: debian:stretch
+ stage: secondary
+ image: debian:unstable
variables:
<<: *base_vars
- INSTALL_PACKAGES: gcc-5 mariadb-client libmariadbclient-dev-compat
+ INSTALL_PACKAGES: gcc-5 mysql-client libmysqlclient-dev
script:
- ./tools/ci/travis.sh build CC=gcc-5 --enable-debug --enable-Werror --enable-buildbot --disable-renewal
- ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql
@@ -192,11 +192,11 @@ pre_re:gcc-5:
re:gcc-5:
<<: *branch_exceptions
<<: *prerequisites
- stage: primary
- image: debian:stretch
+ stage: secondary
+ image: debian:unstable
variables:
<<: *base_vars
- INSTALL_PACKAGES: gcc-5 mariadb-client libmariadbclient-dev-compat
+ INSTALL_PACKAGES: gcc-5 mysql-client libmysqlclient-dev
script:
- ./tools/ci/travis.sh build CC=gcc-5 --enable-debug --enable-Werror --enable-buildbot
- ./tools/ci/travis.sh test ragnarok ragnarok ragnarok mysql
diff --git a/db/pre-re/map_zone_db.conf b/db/pre-re/map_zone_db.conf
index cab00bbb9..a3d465c0a 100644
--- a/db/pre-re/map_zone_db.conf
+++ b/db/pre-re/map_zone_db.conf
@@ -66,7 +66,7 @@ zones: (
//heal: 70
}
skill_damage_cap: {
- //Exemple Below caps firebolt damage in maps within this zone to a maximum 50 damage,
+ //Example Below caps Cold Bolt damage in maps within this zone to a maximum 50 damage,
// (depends on HMAP_ZONE_DAMAGE_CAP_TYPE in src/config/core.h)
// when cast vs players and monsters.
//MG_COLDBOLT: (50,"PLAYER | MONSTER")
diff --git a/db/pre-re/skill_db.conf b/db/pre-re/skill_db.conf
index 95683a9e0..a5c27257f 100644
--- a/db/pre-re/skill_db.conf
+++ b/db/pre-re/skill_db.conf
@@ -14881,11 +14881,10 @@ skill_db: (
Range: -9
Hit: "BDT_MULTIHIT"
SkillType: {
- Self: true
+ Enemy: true
}
SkillInfo: {
Spirit: true
- NoCastSelf: true
}
AttackType: "Weapon"
Element: "Ele_Weapon"
diff --git a/db/re/map_zone_db.conf b/db/re/map_zone_db.conf
index 282a85abb..1dd4315b6 100644
--- a/db/re/map_zone_db.conf
+++ b/db/re/map_zone_db.conf
@@ -66,7 +66,7 @@ zones: (
//heal: 70
}
skill_damage_cap: {
- //Exemple Below caps firebolt damage in maps within this zone to a maximum 50 damage,
+ //Example Below caps Cold Bolt damage in maps within this zone to a maximum 50 damage,
// (depends on HMAP_ZONE_DAMAGE_CAP_TYPE in src/config/core.h)
// when cast vs players and monsters.
//MG_COLDBOLT: (50,"PLAYER | MONSTER")
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index a0e3a783d..7015feec1 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -1409,6 +1409,27 @@ getvariableofnpc() should not be used on them.
---------------------------------------
+*getvariableofpc(<variable>, <account id>{, <default value>})
+
+Returns a reference to a PC variable from the target player.
+If <default value> is passed, it will return this value if the player is
+not found.
+
+Examples:
+
+//This will return the value of @var, note that this can't be used, since
+//the value isn't caught.
+ getvariableofpc(@var, getcharid(CHAR_ID_ACCOUNT, "player"));
+
+//This will set the .@v variable to the value of the player's @var
+//variable.
+ .@v = getvariableofpc(@var, getcharid(CHAR_ID_ACCOUNT, "player"));
+
+//This will set the @var variable of the player to 1.
+ set(getvariableofpc(@var, getcharid(CHAR_ID_ACCOUNT, "player")), 1);
+
+---------------------------------------
+
*goto(<label>)
This command will make the script jump to a label, usually used in
@@ -4507,26 +4528,17 @@ changebase(Class); // Changes player back to default sprite.
---------------------------------------
-*classchange(<view id>, <type>)
+*classchange(<view id>, <type> {, <char id>})
This command is very ancient, it's origins are clouded in mystery.
-It will send a 'display id change' packet to everyone in the immediate
-area of the NPC object, which will supposedly make the NPC look like a
-different sprite, an NPC sprite ID, or a monster ID. This effect is not
-stored anywhere and will not persist (Which is odd, cause it would be
-relatively easy to make it do so) and most importantly, will not work at
-all since this command was broken with the introduction of advanced
-classes. The code is written with the assumption that the lowest sprite
-IDs are the job sprites and the anything beyond them is monster and NPC
-sprites, but since the advanced classes rolled in, they got the ID numbers
-on the other end of the number pool where monster sprites float.
-
-As a result it is currently impossible to call this command with a valid
-view id. It will do nothing whatsoever if the view ID is below 4047.
-Getting it to run will actually just crash the client.
+It will send a 'display id change' packet to player with given char ID
+or to everyone in the immediate area of the NPC object if char ID is 0 or
+not passed, which will make the NPC look like a different sprite, an NPC
+sprite ID, or a monster ID. This effect is not stored anywhere and will
+not persist.
+Note that you can't send a Job sprite ID
-It could be a real gem if it can be gotten to actually do what it's
-supposed to do, but this will only happen in a later Git revision.
+type is not used and should always be 0.
---------------------------------------
@@ -8046,6 +8058,26 @@ Example:
---------------------------------------
+*chr(<int>)
+
+Returns a char from its ASCII value.
+
+Example:
+
+ chr(99); //returns "c"
+
+---------------------------------------
+
+*ord(<chr>)
+
+Returns the ASCII value of char <chr>.
+
+Example:
+
+ ord("c"); //returns 99
+
+---------------------------------------
+
*setchar(<string>, <char>, <index>)
Returns the original string with the char at the specified index set to
diff --git a/npc/other/Global_Functions.txt b/npc/other/Global_Functions.txt
index f6068d598..544e3a672 100644
--- a/npc/other/Global_Functions.txt
+++ b/npc/other/Global_Functions.txt
@@ -156,16 +156,6 @@ function script F_Rand {
return getarg(rand(getargcount()));
}
-//== Function F_Sex ========================================
-// Returns 1st argument if female, 2nd argument otherwise
-// Example: mes callfunc("F_Sex","What a beautiful lady!","What a handsome man!");
-function script F_SexMes {
- if (Sex == SEX_MALE)
- return getarg(0);
- else
- return getarg(1);
-}
-
//== Function F_Hi =========================================
// Returns random HELLO message
function script F_Hi {
diff --git a/npc/other/auction.txt b/npc/other/auction.txt
index 21b2972a8..76e1a6042 100644
--- a/npc/other/auction.txt
+++ b/npc/other/auction.txt
@@ -113,7 +113,7 @@ auction_02,43,17,0 warp auction_enterance_lhz 1,1,lighthalzen,209,169
next;
if (select("Yes", "No") == 1) {
mes "[Auction Broker]";
- if ( getbattleflag( "feature.auction" ) ) {
+ if (getbattleflag("features/auction")) {
mes "Very well.";
mes "Please take";
mes "a look, and see";
diff --git a/npc/quests/quests_moscovia.txt b/npc/quests/quests_moscovia.txt
index 4a9ab322b..c722f2677 100644
--- a/npc/quests/quests_moscovia.txt
+++ b/npc/quests/quests_moscovia.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-2017 Hercules Dev Team
//= Copyright (C) Lemongrass
//= Copyright (C) Euphy
//= Copyright (C) Joseph
@@ -17,6 +17,7 @@
//= Copyright (C) Gepard
//= Copyright (C) brianluau
//= Copyright (C) Kisuka
+//= Copyright (C) Asheraf
//=
//= Hercules is free software: you can redistribute it and/or modify
//= it under the terms of the GNU General Public License as published by
@@ -43,7 +44,7 @@
//= The Moving Island, Help Mikhail, Acorn Exchange, Banish Winter, Shafka
//= Hat, Koshei the Immortal.
//================= Current Version =======================================
-//= 2.3
+//= 2.4
//=========================================================================
//== The Moving Island :: mos_whale_edq ====================
@@ -65,6 +66,7 @@ moscovia,171,71,3 script Berbayeff#npc 4_M_RUSMAN2,{
mes "seen many marvelous things";
mes "from near and far.";
next;
+ setquest(18100);
mes "[Berbayeff]";
mes "I'm sure you'll probably";
mes "be interested in my story.";
@@ -189,6 +191,7 @@ moscovia,171,71,3 script Berbayeff#npc 4_M_RUSMAN2,{
mes "I'll definitely go up to that";
mes "island... and verify it with my own eyes!";
mos_whale_edq = 1;
+ changequest(18100, 18101);
close;
} else if (mos_whale_edq == 1) {
.@speak = rand(1,5);
@@ -235,6 +238,7 @@ moscovia,171,71,3 script Berbayeff#npc 4_M_RUSMAN2,{
mes "If you want to find the island";
mes "by ship, go to Mr. Ibanoff";
mes "and ask for a favor.";
+ changequest(18101, 18102);
close;
} else if (mos_whale_edq > 12 && mos_whale_edq < 42) {
emotion e_omg;
@@ -298,6 +302,8 @@ moscovia,135,49,5 script Mr. Ibanoff#npc 4_M_RUSBALD,{
mes "What's up?";
next;
if(select("Tell me an adventure story.", "Lend me your ship.") == 1) {
+ completequest(18101, 18102);
+ setquest(18103);
mes "[Mr. Ibanoff]";
mes "You are an adventurer, right?";
mes "You come from a strange land?";
@@ -399,6 +405,7 @@ moscovia,135,49,5 script Mr. Ibanoff#npc 4_M_RUSBALD,{
mes "If you ever need anything,";
mes "come talk to me whenever, hahaha!";
mos_whale_edq = 2;
+ changequest(18103, 18104);
close;
}
if (mos_whale_edq == 2) {
@@ -452,6 +459,7 @@ moscovia,135,49,5 script Mr. Ibanoff#npc 4_M_RUSBALD,{
mes "materials, bring them to me. I'll";
mes "repair the ship.";
mos_whale_edq = 3;
+ changequest(18104, 18105);
close;
}
emotion e_ag;
@@ -483,6 +491,7 @@ moscovia,135,49,5 script Mr. Ibanoff#npc 4_M_RUSBALD,{
delitem Tube,5;
delitem Jubilee,10;
mos_whale_edq = 4;
+ changequest(18105, 18106);
mes "[Mr. Ibanoff]";
mes "Okay, we are at the ready.";
mes "When would you like to depart?";
@@ -603,6 +612,7 @@ moscovia,135,49,5 script Mr. Ibanoff#npc 4_M_RUSBALD,{
mes "back to the island, I want to go";
mes "together with you! Eh? Hahaha!";
mos_whale_edq = 16;
+ changequest(18111, 18112);
close;
} else if (mos_whale_edq < 18) {
mes "[Mr. Ibanoff]";
@@ -640,6 +650,7 @@ moscovia,135,49,5 script Mr. Ibanoff#npc 4_M_RUSBALD,{
mes "[Mr. Ibanoff]";
mes "Again, let's get the ship ready and sail before the sun sets!";
mos_whale_edq = 19;
+ changequest(18113, 18114);
close;
}
mes "[Mr. Ibanoff]";
@@ -676,6 +687,7 @@ moscovia,135,49,5 script Mr. Ibanoff#npc 4_M_RUSBALD,{
mes "been, it's very good to see you";
mes "again.";
mos_whale_edq = 19;
+ changequest(18113, 18114);
next;
mes "[Mr. Ibanoff]";
mes "I can guess you'd like to go to";
@@ -821,6 +833,7 @@ mosk_ship,98,110,3 script Mr. Ibanoff#npc2 4_M_RUSBALD,{
mes "At first, hold the rudder to go";
mes "forward, to the east.";
mos_whale_edq = 5;
+ changequest(18106, 18107);
close;
} else if (mos_whale_edq == 5) {
mes "[Mr. Ibanoff]";
@@ -874,6 +887,7 @@ mosk_ship,98,110,3 script Mr. Ibanoff#npc2 4_M_RUSBALD,{
mes "Go around the deck to look more";
mes "carefully! Go!";
mos_whale_edq = 12;
+ changequest(18107, 18108);
donpcevent "#findship::OnEnable";
close;
} else if (mos_whale_edq == 12) {
@@ -904,6 +918,7 @@ mosk_ship,98,110,3 script Mr. Ibanoff#npc2 4_M_RUSBALD,{
mes "At first, hold the rudder to go";
mes "forward, to the east.";
mos_whale_edq = 20;
+ changequest(18114, 18115);
close;
} else if (mos_whale_edq == 20) {
mes "[Mr. Ibanoff]";
@@ -921,6 +936,7 @@ mosk_ship,98,110,3 script Mr. Ibanoff#npc2 4_M_RUSBALD,{
mes "There is a moving island!";
mes "We have done well!";
next;
+ changequest(18115, 18116);
mes "[Mr. Ibanoff]";
mes "Oh...my...";
mes "It really is there...";
@@ -1230,6 +1246,7 @@ mosk_fild01,86,104,3 script Aged Stranger#npc 4_M_GUSLIMAN,{
mes "the back of a gigantic whale!";
mes "That's why I call it Whale Island!";
next;
+ changequest(18109, 18110);
mes "["+strcharinfo(PC_NAME)+"]";
mes "How...? How is it possible";
mes "that the water flows in streams";
@@ -1269,6 +1286,7 @@ mosk_fild01,86,104,3 script Aged Stranger#npc 4_M_GUSLIMAN,{
next;
callsub S_AS_3;
mos_whale_edq = 14;
+ changequest(18110, 18111);
close2;
sleep2 20000;
mos_whale_edq = 15;
@@ -1411,6 +1429,7 @@ mosk_fild01,86,104,3 script Aged Stranger#npc 4_M_GUSLIMAN,{
mes "I'll send you back to the";
mes "mainland.";
mos_whale_edq = 31;
+ changequest(18116, 18117);
close;
} else if (mos_whale_edq == 31) {
mes "[Aged Stranger]";
@@ -1449,6 +1468,7 @@ mosk_fild01,86,104,3 script Aged Stranger#npc 4_M_GUSLIMAN,{
delitem Goats_Horn,20;
delitem Sea_Otter_Leather,10;
mos_whale_edq = 34;
+ changequest(18117, 18118);
mes "[Aged Stranger]";
mes "Wait for a moment until I make the";
mes "instrument successfully.";
@@ -1495,6 +1515,7 @@ mosk_fild01,86,104,3 script Aged Stranger#npc 4_M_GUSLIMAN,{
mes "the ancestors of Moscovia.";
getitem GUSLI, 1;
mos_whale_edq = 35;
+ changequest(18118, 18119);
next;
mes "[Aged Stranger]";
mes "I am the last person who has";
@@ -1696,6 +1717,7 @@ S_AS_1:
mes "With your ability to play, surely";
mes "you can win the admiration of all.";
mos_whale_edq = 38;
+ changequest(18119, 18120);
close;
}
mes "[Aged Stranger]";
@@ -1891,6 +1913,7 @@ mosk_in,131,92,3 script Csar Alexsay III#npc 4_M_RUSKING,{
mes "banishing winter with magic,";
mes "announce that to me immediately.";
mos_nowinter = 14;
+ changequest(18076, 18077);
close;
}
}
@@ -1934,6 +1957,7 @@ mosk_in,131,92,3 script Csar Alexsay III#npc 4_M_RUSKING,{
mes "If you do that, I will arrest you immediately!";
mes "So take care of yourself.";
mos_nowinter = 14;
+ changequest(18076, 18077);
close;
}
mes "[Csar Alexsay III]";
@@ -2004,6 +2028,7 @@ mosk_in,131,92,3 script Csar Alexsay III#npc 4_M_RUSKING,{
mes "I give it as an atonement";
mes "to make my people happy.";
mos_nowinter = 21;
+ completequest(18079);
getitem Old_Blue_Box,1;
next;
mes "[Csar Alexsay III]";
@@ -2111,6 +2136,7 @@ mosk_in,131,92,3 script Csar Alexsay III#npc 4_M_RUSKING,{
mes "You have a heavy responsibility.";
mes "Bring evidence of this whale island to me, to provide me with some relief. Now go.";
mos_whale_edq = 18;
+ changequest(18112, 18113);
close;
} else if (mos_whale_edq > 17 && mos_whale_edq < 35) {
mes "[Csar Alexsay III]";
@@ -2307,6 +2333,7 @@ mosk_in,131,92,3 script Csar Alexsay III#npc 4_M_RUSKING,{
getitem Old_Violet_Box,1;
getexp RENEWAL_EXP?100000:1200000,0;
mos_whale_edq = 41;
+ completequest(18120);
close;
}
mes "[Csar Alexsay III]";
@@ -2558,6 +2585,7 @@ OnTouch:
mes "Watch out! "+strcharinfo(PC_NAME)+"!";
mes "Ah... That... That is... What...";
mos_whale_edq = 13;
+ changequest(18108, 18109);
close2;
warp "mosk_fild01",95,93;
end;
@@ -2697,6 +2725,7 @@ function script F_MOS_1 {
mes "Mikhail is such a timid boy. I guess he didn't leave this village.";
mes "Please bring him to me, then~";
mos_swan = 1;
+ setquest(18060);
close;
}
@@ -2751,6 +2780,7 @@ mosk_in,144,279,5 script Gallina#mos 4_F_RUSWOMAN1,{
mes "Well, now I have to get to work!";
mes "I'll make you my hotcakes someday. Please visit me later";
mos_swan = 100;
+ completequest(18069);
getexp RENEWAL_EXP?90000:1000000,0;
close;
}
@@ -2863,7 +2893,10 @@ mosk_in,148,274,1 script Anna#mos 4_F_RUSCHILD,{
next;
mes "["+strcharinfo(PC_NAME)+"]";
mes "It's the only clue, I guess I'll go to ^3131FFInn 'Sticky Herb Tree'^000000?";
- if (mos_swan == 2) mos_swan = 3;
+ if (mos_swan == 2) {
+ mos_swan = 3;
+ changequest(18060, 18061);
+ }
next;
break;
case 4:
@@ -3084,6 +3117,7 @@ mosk_in,205,268,3 script Fire pot#mos HIDDEN_NPC,{
mes "- I need to know what's required for the paste.";
mes "I'll ask that guy ^3131FFMr. Victor^000000 about them. -";
mos_swan = 12;
+ changequest(18064, 18065);
close;
break;
case 2:
@@ -3139,6 +3173,7 @@ mosk_in,205,268,3 script Fire pot#mos HIDDEN_NPC,{
mes "Now I'm gonna give this back to Mom.";
donpcevent "Mikhail#mos::OnInit";
mos_swan = 25;
+ changequest(18068, 18069);
delitem High_Strength_Adhesive,1;
close;
}
@@ -3302,6 +3337,7 @@ mosk_in,135,191,5 script Landlord#mos 4_F_RUSWOMAN3,{
mes "I was unkind to make you stay here but wasn't it easier for you? hoho.";
mes "When it gets dark, promise me to come here again. Hoho";
mos_swan = 7;
+ changequest(18061, 18062);
close;
break;
case 3:
@@ -3380,6 +3416,7 @@ mosk_in,141,212,3 script Pub Owner#mos 4_M_RUSBALD,{
mes "[Pub Owner]";
mes "You're welcome.";
mos_swan = 8;
+ changequest(18062, 18063);
close;
}
mes "[Pub Owner]";
@@ -3596,6 +3633,7 @@ mosk_in,147,202,3 script Victor#mos 4_M_RUSMAN2,{
mes "[Victor]";
mes "He might've just hidden himself somewhere, haha!";
mos_swan = 10;
+ changequest(18062, 18063);
close;
} else if (mos_swan == 10 || mos_swan == 11) {
mes "[Victor]";
@@ -3633,6 +3671,7 @@ mosk_in,147,202,3 script Victor#mos 4_M_RUSMAN2,{
mes "[Victor]";
mes "You should bring ^3131FF'10 sticky herbs'^000000 and ^3131FF 1 medicine bowl^000000 to me.";
mos_swan = 13;
+ changequest(18065, 18066);
close;
} else if (mos_swan > 12 && mos_swan < 23) {
mes "[Victor]";
@@ -3664,6 +3703,7 @@ mosk_in,147,202,3 script Victor#mos 4_M_RUSMAN2,{
delitem Sticky_Herb,10;
delitem Medicine_Bowl,1;
mos_swan = 24;
+ changequest(18067, 18068);
getitem High_Strength_Adhesive,1;
close;
}
@@ -3730,6 +3770,7 @@ mosk_dun03,153,90,3 script Bubbling Swamp#mos1 CLEAR_NPC,{
mes "["+strcharinfo(PC_NAME)+"]";
mes "I don't see any traces of Mikhail. I think I should go back and check his house one more time.";
mos_swan = 11;
+ changequest(18063, 18064);
close;
} else if (mos_swan == 11 && mos_swan == 12) {
mes "- You can see a small muddy swamp -";
@@ -3748,6 +3789,7 @@ mosk_dun03,153,90,3 script Bubbling Swamp#mos1 CLEAR_NPC,{
if (mos_swan == 22) {
getitem Sticky_Herb,1;
mos_swan = 23;
+ changequest(18066, 18067);
close;
}
getitem Sticky_Herb,1;
@@ -4461,6 +4503,7 @@ mosk_in,215,46,5 script Baba Yaga, the Horrible 4_F_BABAYAGA,{
mes "a 1, 2, or 3 carat";
mes "^ff00001 Diamond^000000.";
mos_nowinter = 6;
+ changequest(18070, 18071);
next;
} else {
mes "[Baba Yaga, the Horrible]";
@@ -4481,6 +4524,7 @@ mosk_in,215,46,5 script Baba Yaga, the Horrible 4_F_BABAYAGA,{
mes "a 1, 2, or 3 carat";
mes "^ff0000Diamond^000000.";
mos_nowinter = 7;
+ changequest(18070, 18072);
next;
}
mes "[Baba Yaga, the Horrible]";
@@ -4541,6 +4585,7 @@ mosk_in,215,46,5 script Baba Yaga, the Horrible 4_F_BABAYAGA,{
mes "contain people's speech.";
mes "I must have this.";
next;
+ changequest(18071, 18073);
mes "[Baba Yaga, the Horrible]";
mes "I don't know how strong you are,";
mes "but I would like to recommend that";
@@ -4742,6 +4787,7 @@ mosk_in,215,46,5 script Baba Yaga, the Horrible 4_F_BABAYAGA,{
mes "[Baba Yaga, the Horrible]";
mes "Take care of yourself, cough, cough.";
mos_nowinter = 10;
+ changequest(18074, 18075);
close;
}
mes "[Baba Yaga, the Horrible]";
@@ -4888,8 +4934,9 @@ mosk_in,215,46,5 script Baba Yaga, the Horrible 4_F_BABAYAGA,{
mes "If you do this, what the villagers want";
mes "will be happening,";
mes "forever.";
- getitem Yaga_Secret_Medicine,1;
mos_nowinter = 19;
+ changequest(18077, 18078);
+ getitem(Yaga_Secret_Medicine, 1);
close;
} else if (mos_nowinter == 19) {
mes "[Baba Yaga, the Horrible]";
@@ -4935,6 +4982,7 @@ S_BY_1:
mes "where it is.";
mes "Could you please come back later?";
mos_nowinter = 5;
+ setquest(18070);
close;
}
@@ -5472,6 +5520,7 @@ moscovia,224,190,0 script #nowinterplz CLEAR_NPC,{
delitem Yaga_Secret_Medicine,1;
specialeffect EF_BARRIER;
mos_nowinter = 20;
+ changequest(18078, 18079);
next;
mes "-You feel like your";
mes "body is heating up.";
@@ -6166,7 +6215,10 @@ moscovia,196,71,3 script A Young Man#mos14 4_M_RUSMAN2,{
mes "I hope that winter never comes.";
mes "It is my dream.";
mos_middle = 1;
- if (mos_kid == 1 && mos_elder == 1) mos_nowinter = 11;
+ if (mos_kid == 1 && mos_elder == 1) {
+ mos_nowinter = 11;
+ changequest(18075, 18076);
+ }
close;
}
mes "[Fredek]";
@@ -6217,7 +6269,10 @@ moscovia,234,168,5 script A Man#mos15 4_M_RUSBALD,{
mes "But, design of coldness is";
mes "winter itself, isn't it?";
mos_elder = 1;
- if (mos_kid == 1 && mos_middle == 1) mos_nowinter = 11;
+ if (mos_kid == 1 && mos_middle == 1) {
+ mos_nowinter = 11;
+ changequest(18075, 18076);
+ }
close;
}
mes "[Gavrel]";
@@ -6267,7 +6322,10 @@ moscovia,228,80,3 script A Little Boy#mos16 4_M_RUSCHILD,{
mes "Do you think";
mes "the winter should come again?";
mos_kid = 1;
- if (mos_middle == 1 && mos_elder == 1) mos_nowinter = 11;
+ if (mos_middle == 1 && mos_elder == 1) {
+ mos_nowinter = 11;
+ changequest(18075, 18076);
+ }
close;
}
mes "[Rurik]";
@@ -6329,6 +6387,7 @@ OnTouch:
mes "Here it is.";
mes "That was easy to find.";
mos_nowinter = 9;
+ changequest(18073, 18074);
getitem Magic_Gourd_Bottle,1;
close;
}
@@ -6337,6 +6396,7 @@ OnTouch:
mes "Ah, I got it!";
mes "I better get out of here quickly.";
mos_nowinter = 9;
+ changequest(18073, 18074);
getitem Magic_Gourd_Bottle,1;
close;
}
@@ -6503,6 +6563,7 @@ moscovia,211,93,3 script Irina#edq 4_F_RUSCHILD,{
mes "Shafka still keeps you warm!";
close;
}
+ setquest(18121);
mes "[Irina]";
mes "Do you want to make a Shafka hat?";
mes "Heheh. Good idea!";
@@ -6525,6 +6586,7 @@ moscovia,211,93,3 script Irina#edq 4_F_RUSCHILD,{
delitem Sea_Otter_Leather,20;
delitem Spool,1;
getitem Chullos,1;
+ completequest(18121);
mes "[Irina]";
mes "Good, I made it. So, how about it?";
mes "Do you like it?";
@@ -6770,6 +6832,7 @@ mosk_dun01,167,160,3 script Gray Wolf#rus03 4_RUS_DWOLF,{
mes "I'm warning you again!";
mes "Unless you want to be killed, leave now.";
rhea_rus_main = 3;
+ setquest(8136);
emotion e_omg,1;
specialeffect2 EF_HIT2;
percentheal -50,0;
@@ -6918,6 +6981,7 @@ mosk_dun01,45,259,0 script Wall#rus04 HIDDEN_NPC,{
mes "Please don't forget about me.";
donpcevent "Gray Wolf#rus05::OnDisable";
rhea_rus_main = 6;
+ changequest(8136, 8137);
close;
} else if (rhea_rus_main > 5 && rhea_rus_main < 8) {
mes "[Girl's Voice]";
@@ -7084,6 +7148,7 @@ mosk_dun01,45,259,0 script Wall#rus04 HIDDEN_NPC,{
mes "Stop! Where do you think you're going?!!!";
delitem Gold_Key,1;
rhea_rus_main = 48;
+ changequest(8167, 8168);
monster "mosk_dun01",45,256,"Koshei, the Immortal",1890,1,"Wall#rus04::OnMyMobDead";
donpcevent "Koshei#rus47::OnEnable";
close;
@@ -7124,6 +7189,7 @@ mosk_dun01,45,259,0 script Wall#rus04 HIDDEN_NPC,{
mes "[Gray Wolf]";
mes "I can't keep her alive for much longer. You must find Baba Yaga.";
rhea_rus_main = 49;
+ changequest(8168, 8169);
close2;
donpcevent "Gray Wolf#rus05::OnDisable";
end;
@@ -7258,6 +7324,7 @@ mosk_dun01,45,259,0 script Wall#rus04 HIDDEN_NPC,{
mes "[Maria Morebna]";
mes "It's been a long time since I've felt the sunlight, fresh wind and the scent of grass. I'm so grateful.";
rhea_rus_main = 52;
+ completequest(8171);
.@rus_food = rand(1,6);
switch (rand(1,6)) {
case 1: getitem Dex_Dish08,1; break;
@@ -7475,6 +7542,7 @@ moscovia,178,127,0 script The Blacksmith#rus06 1_M_SMITH,{
mes "Bahahaha~";
mes "I promise you, I'll explain when you bring the ^0000ff25 Steel^000000 to me. Please just get the Steel and come back.";
rhea_rus_main = 7;
+ changequest(8137, 8138);
close;
} else if (rhea_rus_main == 7) {
if (countitem(Steel) > 24) {
@@ -7524,6 +7592,8 @@ moscovia,178,127,0 script The Blacksmith#rus06 1_M_SMITH,{
mes "And don't forget to wear these!";
delitem Steel,25;
rhea_rus_main = 8;
+ // if (BaseClass != Job_Thief)
+ changequest(8138, 8139);
if (BaseClass == Job_Merchant || BaseClass == Job_Swordman || BaseClass == Job_Thief || BaseClass == Job_Archer) getitem Iron_Boots01,1; else getitem Iron_Boots02,1; close;
}
mes "[The Blacksmith]";
@@ -7585,6 +7655,7 @@ moscovia,178,127,0 script The Blacksmith#rus06 1_M_SMITH,{
mes "Ah and you shouldn't be needing those Steel Boots anymore. Good luck!";
if (countitem(Iron_Boots01)) delitem Iron_Boots01,1; else delitem Iron_Boots02,1;
rhea_rus_main = 9;
+ changequest(8139, 8154);
close;
}
mes "[The Blacksmith]";
@@ -7753,6 +7824,7 @@ moscovia,206,81,0 script Vassili Grandpapa#rus07 4_M_05,{
mes "[Vassili Grandpapa]";
mes "She disappeared soon... after Now all I have is Ryubaba. She is also pretty and smart but nothing can relieve the sadnesss in my heart from losing Mashenka...";
rhea_rus_ring = 1;
+ setquest(8140);
close;
} else if (rhea_rus_ring && rhea_rus_ring < 8) {
mes "[Vassili Grandpapa]";
@@ -7879,6 +7951,7 @@ moscovia,206,81,0 script Vassili Grandpapa#rus07 4_M_05,{
mes "...It is my fault that this tragedy between my daughters happened. I will spend the rest of my life trying to make up for it...";
delitem Pointed_Wooden_Flute,1;
rhea_rus_ring = 10;
+ completequest(8144);
getitem Red_Ring,1;
if (RENEWAL_EXP) {
if (BaseLevel < 56) getexp 470,0;
@@ -8073,6 +8146,7 @@ moscovia,213,216,3 script Ryubaba#rus08 4_F_RUSWOMAN2,{
mes "[Ryubaba]";
mes "Right... Let me finish talking. We tried searching for her but we couldn't find her. She must have been wearing the ring when she disappeared around the marsh.";
rhea_rus_ring = 5;
+ changequest(8140, 8141);
close;
} else if (rhea_rus_ring > 4 && rhea_rus_ring < 7) {
mes "[Ryubaba]";
@@ -8184,6 +8258,7 @@ moscovia,213,216,3 script Ryubaba#rus08 4_F_RUSWOMAN2,{
mes "[Ryubaba]";
mes "W, wait!!!";
rhea_rus_ring = 8;
+ changequest(8143, 8144);
close2;
warp "moscovia",203,80;
end;
@@ -8195,6 +8270,7 @@ moscovia,213,216,3 script Ryubaba#rus08 4_F_RUSWOMAN2,{
mes "I have to repent for my sins and atone for them for the rest of my life.";
delitem Pointed_Wooden_Flute,1;
rhea_rus_ring = 9;
+ completequest(8143);
getitem Red_Ring,1;
if (RENEWAL_EXP) {
if (BaseLevel < 56) getexp 470,0;
@@ -8367,6 +8443,7 @@ mosk_fild02,157,233,0 script Shepherdess#rus10 1_F_04,{
mes "[Shepherdess]";
mes "I am an excellent flute player! If you get me enough Pointed Branches, I will make a flute from them and play beautiful music for you. Please~!";
rhea_rus_ring = 6;
+ changequest(8141, 8142);
close;
} else if (rhea_rus_ring == 6) {
if (countitem(Pointed_Branch) > 24) {
@@ -8421,6 +8498,7 @@ mosk_fild02,157,233,0 script Shepherdess#rus10 1_F_04,{
mes "- ^0000ff'Pointed Wooden Flute'!!^000000 -";
delitem Pointed_Branch,25;
rhea_rus_ring = 7;
+ changequest(8142, 8143);
getitem Pointed_Wooden_Flute,1;
close;
}
@@ -8544,6 +8622,7 @@ moscovia,166,145,1 script Worried Mother#rus19 4_F_RUSWOMAN3,{
mes "[Worried Mother]";
mes "Please, please find my daughter.";
rhea_rus_hair = 1;
+ setquest(8145);
close;
} else if (rhea_rus_hair == 1) {
mes "[Worried Mother]";
@@ -8567,6 +8646,7 @@ moscovia,166,145,1 script Worried Mother#rus19 4_F_RUSWOMAN3,{
mes "[Worried Mother]";
mes "I'm not sure where she would be but it has to be somewhere near water. Please, find where my daughter is. I beg of you.";
rhea_rus_hair = 2;
+ changequest(8145, 8146);
close;
} else if (rhea_rus_hair > 1 && rhea_rus_hair < 9) {
mes "[Worried Mother]";
@@ -8781,6 +8861,7 @@ mosk_fild02,124,202,3 script Lusalka#rus23 4_F_RUSGREEN,{
mes "- ^0000ffgolden earrings^000000 -";
mes "- ^0000fffrom Lusalka!^000000 -";
rhea_rus_hair = 3;
+ changequest(8146, 8147);
donpcevent "Lusalka#rus23::OnDisable";
close;
} else if (rhea_rus_hair > 2 && rhea_rus_hair < 7) {
@@ -8861,6 +8942,7 @@ mosk_fild02,124,202,3 script Lusalka#rus23 4_F_RUSGREEN,{
mes "W, who are you!? Ahkkk!!";
sc_start SC_BLIND,10000,0;
rhea_rus_hair = 8;
+ completequest(8150);
donpcevent "Lusalka#rus23::OnDisable";
close;
} else if (rhea_rus_hair > 7) {
@@ -8992,6 +9074,7 @@ prontera,228,279,3 script Wanderer#rus24 4_M_RUSMAN2,{
mes "me that he wanted";
mes "to travel to a desert.";
rhea_rus_hair = 4;
+ changequest(8147, 8148);
close;
} else if (rhea_rus_hair > 3 && rhea_rus_hair < 7) {
mes "[A Wanderer from a strange land]";
@@ -9070,6 +9153,7 @@ morocc,165,82,0 script Morroc Villager#rus25 1_M_02,{
mes "[Morroc Villager]";
mes "Yep that's gotta be who you're looking for. I can see his gloomy face right now... that poor sad man.";
rhea_rus_hair = 5;
+ changequest(8148, 8149);
close;
} else if (rhea_rus_hair > 4 && rhea_rus_hair < 7) {
mes "[Morroc Villager]";
@@ -9208,6 +9292,7 @@ moc_pryd04,126,120,0 script Soldier#rus26 4_M_RUSMAN1,{
mes "[A gloomy looking soldier]";
mes "Before the full moon, I will be back to Moscovia and meet her. I will come back so strong and happy that when I go to see her she will not suffer anymore.";
rhea_rus_hair = 7;
+ changequest(8149, 8150);
close;
} else if (rhea_rus_hair == 7) {
mes "[A gloomy looking soldier]";
@@ -9292,6 +9377,7 @@ OnTouch:
mes "[Voice unidentified]";
mes "Show me what you can do.";
rhea_rus_quiz = 1;
+ setquest(8151);
close;
}
}
@@ -9489,6 +9575,7 @@ mosk_fild02,243,270,0 script Marozka#rus31 4_M_LGTGRAND,{
mes "[Marozka]";
mes "That was a test of your strength. Now you must pass the test of mind and wisdom.";
rhea_rus_quiz = 29;
+ changequest(8152, 8153);
close;
} else if (rhea_rus_quiz == 29) {
if (getequipid(EQI_SHOES) != 2429) {
@@ -9556,6 +9643,7 @@ mosk_fild02,243,270,0 script Marozka#rus31 4_M_LGTGRAND,{
mes "[Marozka]";
mes "I hope you help Maria with your strength and kindness.";
rhea_rus_quiz = 30;
+ completequest(8153);
getitem Golden_Thread,10;
close;
}
@@ -9687,6 +9775,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{
mes "[Baba Yaga]";
mes "Ok! Move, move! You better be quick or I will find a way to punish you. Ehehehehehe.";
rhea_rus_main = 11;
+ changequest(8154, 8155);
close;
} else if (BaseClass == Job_Acolyte) {
mes "[Baba Yaga]";
@@ -9695,6 +9784,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{
mes "[Baba Yaga]";
mes "Ok! Move, move! You better be quick or I will find a way to punish you. Ehehehehehe.";
rhea_rus_main = 16;
+ changequest(8154, 8157);
close;
} else if (BaseClass == Job_Thief) {
mes "[Baba Yaga]";
@@ -9703,6 +9793,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{
mes "[Baba Yaga]";
mes "Ok! Move, move! You better be quick or I will find a way to punish you. Ehehehehehe.";
rhea_rus_main = 21;
+ changequest(8154, 8159);
close;
} else if (BaseClass == Job_Mage) {
mes "[Baba Yaga]";
@@ -9711,6 +9802,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{
mes "[Baba Yaga]";
mes "Ok! Move, move! You better be quick or I will find a way to punish you. Ehehehehehe.";
rhea_rus_main = 26;
+ changequest(8154, 8161);
close;
} else if (BaseClass == Job_Swordman) {
mes "[Baba Yaga]";
@@ -9719,6 +9811,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{
mes "[Baba Yaga]";
mes "Ok! Move, move! You better be quick or I will find a way to punish you. Ehehehehehe.";
rhea_rus_main = 31;
+ changequest(8154, 8163);
close;
}
mes "[Baba Yaga]";
@@ -9727,6 +9820,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{
mes "[Baba Yaga]";
mes "Ok! Move, move! You better be quick or I will find a way to punish you. Ehehehehehe.";
rhea_rus_main = 36;
+ changequest(8154, 8165);
close;
} else if (rhea_rus_main > 10 && rhea_rus_main < 16) {
mes "[Baba Yaga]";
@@ -9855,6 +9949,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{
mes "Here, help Maria with this key and watch out for Koshei. He is very dangerous. Kehehehehehe.";
rhea_rus_main = 47;
getitem Gold_Key,1;
+ changequest(8156, 8167);
close;
} else if (rhea_rus_main == 42) {
mes "["+ strcharinfo(PC_NAME) +"]";
@@ -9869,6 +9964,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{
mes "[Baba Yaga]";
mes "Here, help Maria with this key and watch out for Koshei. He is very dangerous. Kehehehehehe.";
rhea_rus_main = 47;
+ changequest(8158, 8167);
getitem Gold_Key,1;
close;
} else if (rhea_rus_main == 43) {
@@ -9886,6 +9982,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{
mes "Here, help Maria with this key and watch out for Koshei. He is very dangerous. Kehehehehehe.";
delitem Babayaga_Silver_Spoon,1;
rhea_rus_main = 47;
+ changequest(8160, 8167);
getitem Gold_Key,1;
close;
}
@@ -9911,6 +10008,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{
mes "[Baba Yaga]";
mes "Here, help Maria with this key and watch out for Koshei. He is very dangerous. Kehehehehehe.";
rhea_rus_main = 47;
+ changequest(8162, 8167);
getitem Gold_Key,1;
close;
} else if (rhea_rus_main == 45) {
@@ -9926,6 +10024,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{
mes "[Baba Yaga]";
mes "Here, help Maria with this key and watch out for Koshei. He is very dangerous. Kehehehehehe.";
rhea_rus_main = 47;
+ changequest(8164, 8167);
getitem Gold_Key,1;
close;
} else if (rhea_rus_main == 46) {
@@ -9941,6 +10040,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{
mes "[Baba Yaga]";
mes "Here, help Maria with this key and watch out for Koshei. He is very dangerous. Kehehehehehe.";
rhea_rus_main = 47;
+ changequest(8166, 8167);
getitem Gold_Key,1;
close;
} else if (rhea_rus_main > 46 && rhea_rus_main < 49) {
@@ -9979,6 +10079,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{
mes "[Baba Yaga]";
mes "Bring them to me quickly! Time is running out!";
rhea_rus_main = 50;
+ changequest(8169, 8170);
close;
} else if (rhea_rus_main == 50) {
if (countitem(Holy_Water) && countitem(Water_Of_Darkness) && countitem(Leaf_Of_Yggdrasil) > 1 && countitem(Leaflet_Of_Hinal) > 9) {
@@ -10031,6 +10132,7 @@ mosk_dun02,48,214,5 script Baba Yaga#rus32 4_F_BABAYAGA,{
delitem Leaf_Of_Yggdrasil,2;
delitem Leaflet_Of_Hinal,10;
rhea_rus_main = 51;
+ changequest(8170, 8171);
close;
}
mes "[Baba Yaga]";
@@ -10383,6 +10485,7 @@ OnTouch:
mes "["+ strcharinfo(PC_NAME) +"]";
mes "Ok, then. Let's get back to Baba Yaga...";
rhea_rus_main = 41;
+ changequest(8155, 8156);
close;
} else if (rhea_rus_main == 41) {
mes "[Cow]";
@@ -10482,6 +10585,7 @@ OnTouch:
mes "["+ strcharinfo(PC_NAME) +"]";
mes "Ok, then. Let's get back to Baba Yaga...";
rhea_rus_main = 41;
+ changequest(8155, 8156);
close;
} else if (rhea_rus_main == 41) {
mes "[Cow]";
@@ -10570,6 +10674,7 @@ OnTouch:
mes "["+ strcharinfo(PC_NAME) +"]";
mes "Ok, then. Let's get back to Baba Yaga...";
rhea_rus_main = 41;
+ changequest(8155, 8156);
close;
} else if (rhea_rus_main == 41) {
mes "[Cow]";
@@ -10764,6 +10869,7 @@ mosk_dun02,65,232,0 script Noisy Coffin#rus36 4_NFCOFFIN,{
mes "Hu, the job has been done.";
mes "Let's get back to Baba Yaga.";
rhea_rus_main = 42;
+ changequest(8157, 8158);
close;
} else if (rhea_rus_main == 20) {
mes "["+ strcharinfo(PC_NAME) +"]";
@@ -10777,6 +10883,7 @@ mosk_dun02,65,232,0 script Noisy Coffin#rus36 4_NFCOFFIN,{
mes "Hu, the job has been done.";
mes "Let's get back to Baba Yaga.";
rhea_rus_main = 42;
+ changequest(8157, 8158);
close;
} else if (rhea_rus_main == 42) {
mes "["+ strcharinfo(PC_NAME) +"]";
@@ -10835,6 +10942,7 @@ treasure01,165,58,0 script Old Treasure Box#rus37 HIDDEN_NPC,{
next;
mes "- ^0000ff You find Baba Yaga's spoon !!^000000 -";
rhea_rus_main = 43;
+ changequest(8159, 8160);
getitem Babayaga_Silver_Spoon,1;
close;
} else if (rhea_rus_main == 43) {
@@ -11111,6 +11219,7 @@ amatsu,233,234,3 script Momotoro Publisher#rus42 4_F_JPN2,{
mes "Thank you for buying our books. If you need more books, contact us please.";
Zeny -= 5000;
rhea_rus_main = 27;
+ changequest(8161, 8162);
getitem Book_Of_Magic,1;
close;
} else if (rhea_rus_main > 26 && rhea_rus_main < 31) {
@@ -11381,6 +11490,7 @@ mosk_dun02,57,220,0 script House Ghost Jar#rus43 HIDDEN_NPC,{
mes "[House Ghost]";
mes "I will never forget your kindness of entertaining me.";
rhea_rus_main = 45;
+ changequest(8163, 8164);
close;
} else if (rhea_rus_main == 45) {
mes "[House Ghost]";
@@ -11756,6 +11866,7 @@ pay_dun04,163,186,0 script Ghost Tree#rus45 HIDDEN_NPC,{
next;
mes "- ^0000ff You receive the best broom from Payon !!^000000 - ";
rhea_rus_main = 46;
+ changequest(8165, 8166);
close;
}
mes "[Ghost Tree]";
diff --git a/npc/quests/the_sign_quest.txt b/npc/quests/the_sign_quest.txt
index dd3750543..2102efaf0 100644
--- a/npc/quests/the_sign_quest.txt
+++ b/npc/quests/the_sign_quest.txt
@@ -12249,11 +12249,11 @@ OnInit:
end;
OnTouch:
- geffenia_warp = rand(1,4);
- if (geffenia_warp == 1) warp "gefenia01",58,169;
- else if (geffenia_warp == 2) warp "gefenia02",116,115;
- else if (geffenia_warp == 3) warp "gefenia03",130,206;
- else if (geffenia_warp == 4) warp "gefenia04",133,88;
+ .@geffenia_warp = rand(1,4);
+ if (.@geffenia_warp == 1) warp "gefenia01",58,169;
+ else if (.@geffenia_warp == 2) warp "gefenia02",116,115;
+ else if (.@geffenia_warp == 3) warp "gefenia03",130,206;
+ else if (.@geffenia_warp == 4) warp "gefenia04",133,88;
else warp "geffen",116,115;
end;
diff --git a/npc/re/merchants/shadow_refiner.txt b/npc/re/merchants/shadow_refiner.txt
index 4e5049e5f..2f8984498 100644
--- a/npc/re/merchants/shadow_refiner.txt
+++ b/npc/re/merchants/shadow_refiner.txt
@@ -158,7 +158,7 @@ itemmall,31,76,3 script Shadow Blacksmith#nomal 4_F_JOB_BLACKSMITH,{
}
delitem .@choose,1;
Zeny -= 20000;
- if (getequippercentrefinery(.@SelectedPart) > rand(100) || getequippercentrefinery(.@SelectedPart) > rand(100)) {
+ if (getequippercentrefinery(.@SelectedPart) > rand(100) || ( .@option == 1 && getequippercentrefinery(.@SelectedPart) > rand(100))) {
successrefitem .@SelectedPart;
mes "[Shadow Blacksmith]";
mes "Refine was successful.";
diff --git a/npc/woe-se/agit_main_se.txt b/npc/woe-se/agit_main_se.txt
index c9b34f610..5f291e658 100644
--- a/npc/woe-se/agit_main_se.txt
+++ b/npc/woe-se/agit_main_se.txt
@@ -1681,6 +1681,10 @@ OnEnable:
if (.@num == 3) set getd(".MyMobCount_"+.@num+strnpcinfo(NPC_NAME_HIDDEN)),4;
else if (.@num) set getd(".MyMobCount_"+.@num+strnpcinfo(NPC_NAME_HIDDEN)),6;
setwall strnpcinfo(NPC_NAME_HIDDEN),.@wall[0],.@wall[1],.@wall[2],.@wall[3],.@wall[4],substr(strnpcinfo(NPC_NAME_HIDDEN),0,1)+substr(strnpcinfo(NPC_NAME_HIDDEN),8,9)+"_"+strnpcinfo(NPC_NAME_VISIBLE);
+ if (.@num == 0)
+ setcell(strnpcinfo(NPC_NAME_HIDDEN), .@x[0], .@y[0], .@x[getarraysize(.@x)-1], .@y[getarraysize(.@y)-1], cell_basilica, true);
+ if (.@num == 1 && (strnpcinfo(NPC_NAME_HIDDEN) == "schg_cas01" || strnpcinfo(NPC_NAME_HIDDEN) == "schg_cas04" || strnpcinfo(NPC_NAME_HIDDEN) == "schg_cas05"))
+ setcell(strnpcinfo(NPC_NAME_HIDDEN), .@x[0], .@y[0], .@x[5], .@y[5], cell_basilica, true);
.@j = (getd(".MyMobCount_"+.@num+strnpcinfo(NPC_NAME_HIDDEN)))?getd(".MyMobCount_"+.@num+strnpcinfo(NPC_NAME_HIDDEN)):getarraysize(.@x);
for (.@i = 0; .@i<.@j; ++.@i)
guardian strnpcinfo(NPC_NAME_HIDDEN),.@x[.@i],.@y[.@i]," ",1905,strnpcinfo(NPC_NAME)+"::OnBarrierDestroyed";
@@ -1700,6 +1704,31 @@ OnBarrierDestroyed:
end;
OnDisable:
+ if (compare(strnpcinfo(NPC_NAME_HIDDEN),"arug")) {
+ if (strnpcinfo(NPC_NAME_HIDDEN) == "arug_cas01") {
+ setarray(.@x[0], 239, 245);
+ setarray(.@y[0], 73, 73);
+ } else if (strnpcinfo(NPC_NAME_HIDDEN) == "arug_cas02") {
+ setarray(.@x[0], 137, 143);
+ setarray(.@y[0], 137, 137);
+ } else { // Castles 3, 4, 5 are identical.
+ setarray(.@x[0], 139, 145);
+ setarray(.@y[0], 111, 111);
+ }
+ } else {
+ if (strnpcinfo(NPC_NAME_HIDDEN) == "schg_cas02") {
+ setarray(.@x[0], 289, 289);
+ setarray(.@y[0], 98, 104);
+ } else if (strnpcinfo(NPC_NAME_HIDDEN) == "schg_cas03") {
+ setarray(.@x[0], 326, 330);
+ setarray(.@y[0], 300, 300);
+ } else { // Castles 1, 4, 5 are identical.
+ setarray(.@x[0], 115, 125);
+ setarray(.@y[0], 49, 49);
+ setcell(strnpcinfo(NPC_NAME_HIDDEN), 115, 50, 125, 50, cell_basilica, false);
+ }
+ }
+ setcell(strnpcinfo(NPC_NAME_HIDDEN), .@x[0], .@y[0], .@x[1], .@y[1], cell_basilica, false);
delwall substr(strnpcinfo(NPC_NAME_HIDDEN),0,1)+substr(strnpcinfo(NPC_NAME_HIDDEN),8,9)+"_"+strnpcinfo(NPC_NAME_VISIBLE);
killmonster strnpcinfo(NPC_NAME_HIDDEN),strnpcinfo(NPC_NAME)+"::OnBarrierDestroyed";
end;
diff --git a/src/map/clif.c b/src/map/clif.c
index c48241898..6897c357a 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -1077,15 +1077,21 @@ void clif_set_unit_idle(struct block_list* bl, struct map_session_data *tsd, enu
#endif
#if PACKETVER >= 20150513
p.body = vd->body_style;
+#endif
+/* Might be earlier, this is when the named item bug began */
+#if PACKETVER >= 20131223
safestrncpy(p.name, clif->get_bl_name(bl), NAME_LENGTH);
#endif
-
clif->send(&p,sizeof(p),tsd?&tsd->bl:bl,target);
if (clif->isdisguised(bl)) {
#if PACKETVER >= 20091103
p.objecttype = pc->db_checkid(status->get_viewdata(bl)->class) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE
+#if PACKETVER >= 20131223
+ p.AID = -bl->id;
+#else
p.GID = -bl->id;
+#endif
#else
p.GID = -bl->id;
#endif
@@ -1220,6 +1226,9 @@ void clif_spawn_unit(struct block_list* bl, enum send_target target) {
#endif
#if PACKETVER >= 20150513
p.body = vd->body_style;
+#endif
+/* Might be earlier, this is when the named item bug began */
+#if PACKETVER >= 20131223
safestrncpy(p.name, clif->get_bl_name(bl), NAME_LENGTH);
#endif
if (clif->isdisguised(bl)) {
@@ -1228,7 +1237,11 @@ void clif_spawn_unit(struct block_list* bl, enum send_target target) {
clif->send(&p,sizeof(p),bl,target);
#if PACKETVER >= 20091103
p.objecttype = pc->db_checkid(status->get_viewdata(bl)->class) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE
+#if PACKETVER >= 20131223
+ p.AID = -bl->id;
+#else
p.GID = -bl->id;
+#endif
#else
p.GID = -bl->id;
#endif
@@ -1262,7 +1275,7 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd,
#endif
#if PACKETVER >= 20131223
p.AID = bl->id;
- p.GID = (tsd) ? tsd->status.char_id : 0; // CCODE
+ p.GID = (sd) ? sd->status.char_id : 0; // CCODE
#else
p.GID = bl->id;
#endif
@@ -1312,6 +1325,9 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd,
#endif
#if PACKETVER >= 20150513
p.body = vd->body_style;
+#endif
+/* Might be earlier, this is when the named item bug began */
+#if PACKETVER >= 20131223
safestrncpy(p.name, clif->get_bl_name(bl), NAME_LENGTH);
#endif
@@ -1320,7 +1336,11 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd,
if (clif->isdisguised(bl)) {
#if PACKETVER >= 20091103
p.objecttype = pc->db_checkid(status->get_viewdata(bl)->class) ? 0x0 : 0x5; //PC_TYPE : NPC_MOB_TYPE
+#if PACKETVER >= 20131223
+ p.AID = -bl->id;
+#else
p.GID = -bl->id;
+#endif
#else
p.GID = -bl->id;
#endif
@@ -1332,7 +1352,7 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd,
/// 01b0 <id>.L <type>.B <value>.L
/// type:
/// unused
-void clif_class_change(struct block_list *bl, int class_, int type)
+void clif_class_change(struct block_list *bl, int class_, int type, struct map_session_data *sd)
{
nullpo_retv(bl);
@@ -1343,7 +1363,11 @@ void clif_class_change(struct block_list *bl, int class_, int type)
WBUFL(buf,2)=bl->id;
WBUFB(buf,6)=type;
WBUFL(buf,7)=class_;
- clif->send(buf,packet_len(0x1b0),bl,AREA);
+
+ if (sd == NULL)
+ clif->send(buf, packet_len(0x1b0), bl, AREA);
+ else
+ clif->send(buf, packet_len(0x1b0), &sd->bl, SELF);
}
}
diff --git a/src/map/clif.h b/src/map/clif.h
index b27adb5be..aefba5974 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -671,7 +671,7 @@ struct clif_interface {
void (*changetraplook) (struct block_list *bl,int val);
void (*refreshlook) (struct block_list *bl,int id,int type,int val,enum send_target target);
void (*sendlook) (struct block_list *bl, int id, int type, int val, int val2, enum send_target target);
- void (*class_change) (struct block_list *bl,int class_,int type);
+ void (*class_change) (struct block_list *bl,int class_,int type, struct map_session_data *sd);
void (*skill_delunit) (struct skill_unit *su);
void (*skillunit_update) (struct block_list* bl);
int (*clearunit_delayed_sub) (int tid, int64 tick, int id, intptr_t data);
diff --git a/src/map/mob.c b/src/map/mob.c
index d5932f195..74d25b805 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2832,7 +2832,7 @@ int mob_class_change (struct mob_data *md, int class_) {
mob_stop_walking(md, STOPWALKING_FLAG_NONE);
unit->skillcastcancel(&md->bl, 0);
status->set_viewdata(&md->bl, class_);
- clif->class_change(&md->bl, md->vd->class, 1);
+ clif->class_change(&md->bl, md->vd->class, 1, NULL);
status_calc_mob(md, SCO_FIRST);
md->ud.state.speed_changed = 1; //Speed change update.
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h
index e461eebe9..4d474ac93 100644
--- a/src/map/packets_struct.h
+++ b/src/map/packets_struct.h
@@ -589,6 +589,9 @@ struct packet_spawn_unit {
#endif
#if PACKETVER >= 20150513
int16 body;
+#endif
+/* Might be earlier, this is when the named item bug began */
+#if PACKETVER >= 20131223
char name[NAME_LENGTH];
#endif
} __attribute__((packed));
@@ -657,6 +660,9 @@ struct packet_unit_walking {
#endif
#if PACKETVER >= 20150513
int16 body;
+#endif
+/* Might be earlier, this is when the named item bug began */
+#if PACKETVER >= 20131223
char name[NAME_LENGTH];
#endif
} __attribute__((packed));
@@ -723,6 +729,9 @@ struct packet_idle_unit {
#endif
#if PACKETVER >= 20150513
int16 body;
+#endif
+/* Might be earlier, this is when the named item bug began */
+#if PACKETVER >= 20131223
char name[NAME_LENGTH];
#endif
} __attribute__((packed));
diff --git a/src/map/script.c b/src/map/script.c
index 38931bd11..faaadb560 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -2825,7 +2825,7 @@ struct script_data *get_val(struct script_state* st, struct script_data* data) {
char postfix;
struct map_session_data *sd = NULL;
- if( !data_isreference(data) )
+ if (!data_isreference(data))
return data;// not a variable/constant
name = reference_getname(data);
@@ -2840,10 +2840,10 @@ struct script_data *get_val(struct script_state* st, struct script_data* data) {
}
//##TODO use reference_tovariable(data) when it's confirmed that it works [FlavioJS]
- if( !reference_toconstant(data) && not_server_variable(prefix) ) {
+ if (!reference_toconstant(data) && not_server_variable(prefix) && reference_getref(data) == NULL) {
sd = script->rid2sd(st);
- if( sd == NULL ) {// needs player attached
- if( postfix == '$' ) {// string variable
+ if (sd == NULL) {// needs player attached
+ if (postfix == '$') {// string variable
ShowWarning("script_get_val: cannot access player variable '%s', defaulting to \"\"\n", name);
data->type = C_CONSTSTR;
data->u.str = "";
@@ -2861,32 +2861,44 @@ struct script_data *get_val(struct script_state* st, struct script_data* data) {
const char *str = NULL;
switch (prefix) {
- case '@':
+ case '@':
+ if (data->ref) {
+ str = script->get_val_ref_str(st, data->ref, data);
+ } else {
str = pc->readregstr(sd, data->u.num);
- break;
- case '$':
- str = mapreg->readregstr(data->u.num);
- break;
- case '#':
- if (name[1] == '#')
- str = pc_readaccountreg2str(sd, data->u.num);// global
- else
- str = pc_readaccountregstr(sd, data->u.num);// local
- break;
- case '.':
- if (data->ref)
- str = script->get_val_ref_str(st, data->ref, data);
- else if (name[1] == '@')
- str = script->get_val_scope_str(st, &st->stack->scope, data);
- else
- str = script->get_val_npc_str(st, &st->script->local, data);
- break;
- case '\'':
- str = script->get_val_instance_str(st, name, data);
- break;
- default:
+ }
+ break;
+ case '$':
+ str = mapreg->readregstr(data->u.num);
+ break;
+ case '#':
+ if (data->ref) {
+ str = script->get_val_ref_str(st, data->ref, data);
+ } else if (name[1] == '#') {
+ str = pc_readaccountreg2str(sd, data->u.num);// global
+ } else {
+ str = pc_readaccountregstr(sd, data->u.num);// local
+ }
+ break;
+ case '.':
+ if (data->ref) {
+ str = script->get_val_ref_str(st, data->ref, data);
+ } else if (name[1] == '@') {
+ str = script->get_val_scope_str(st, &st->stack->scope, data);
+ } else {
+ str = script->get_val_npc_str(st, &st->script->local, data);
+ }
+ break;
+ case '\'':
+ str = script->get_val_instance_str(st, name, data);
+ break;
+ default:
+ if (data->ref) {
+ str = script->get_val_ref_str(st, data->ref, data);
+ } else {
str = pc_readglobalreg_str(sd, data->u.num);
- break;
+ }
+ break;
}
if (str == NULL || str[0] == '\0') {
@@ -2906,36 +2918,48 @@ struct script_data *get_val(struct script_state* st, struct script_data* data) {
data->u.num = reference_getconstant(data);
} else if( reference_toparam(data) ) {
data->u.num = pc->readparam(sd, reference_getparamtype(data));
- } else
- switch( prefix ) {
- case '@':
+ } else {
+ switch (prefix) {
+ case '@':
+ if (data->ref) {
+ data->u.num = script->get_val_ref_num(st, data->ref, data);
+ } else {
data->u.num = pc->readreg(sd, data->u.num);
- break;
- case '$':
- data->u.num = mapreg->readreg(data->u.num);
- break;
- case '#':
- if( name[1] == '#' )
- data->u.num = pc_readaccountreg2(sd, data->u.num);// global
- else
- data->u.num = pc_readaccountreg(sd, data->u.num);// local
- break;
- case '.':
- if (data->ref)
- data->u.num = script->get_val_ref_num(st, data->ref, data);
- else if (name[1] == '@')
- data->u.num = script->get_val_scope_num(st, &st->stack->scope, data);
- else
- data->u.num = script->get_val_npc_num(st, &st->script->local, data);
- break;
- case '\'':
- data->u.num = script->get_val_instance_num(st, name, data);
- break;
- default:
+ }
+ break;
+ case '$':
+ data->u.num = mapreg->readreg(data->u.num);
+ break;
+ case '#':
+ if (data->ref) {
+ data->u.num = script->get_val_ref_num(st, data->ref, data);
+ } else if (name[1] == '#') {
+ data->u.num = pc_readaccountreg2(sd, data->u.num);// global
+ } else {
+ data->u.num = pc_readaccountreg(sd, data->u.num);// local
+ }
+ break;
+ case '.':
+ if (data->ref) {
+ data->u.num = script->get_val_ref_num(st, data->ref, data);
+ } else if (name[1] == '@') {
+ data->u.num = script->get_val_scope_num(st, &st->stack->scope, data);
+ } else {
+ data->u.num = script->get_val_npc_num(st, &st->script->local, data);
+ }
+ break;
+ case '\'':
+ data->u.num = script->get_val_instance_num(st, name, data);
+ break;
+ default:
+ if (data->ref) {
+ data->u.num = script->get_val_ref_num(st, data->ref, data);
+ } else {
data->u.num = pc_readglobalreg(sd, data->u.num);
- break;
+ }
+ break;
}
-
+ }
}
data->ref = NULL;
@@ -3108,38 +3132,43 @@ void script_array_add_member(struct script_array *sa, unsigned int idx) {
**/
struct reg_db *script_array_src(struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref) {
struct reg_db *src = NULL;
-
nullpo_retr(NULL, name);
- switch( name[0] ) {
+
+ switch (name[0]) {
/* from player */
- default: /* char reg */
- case '@':/* temp char reg */
- case '#':/* account reg */
+ default: /* char reg */
+ case '@':/* temp char reg */
+ case '#':/* account reg */
+ if (ref != NULL) {
+ src = ref;
+ } else {
nullpo_retr(NULL, sd);
src = &sd->regs;
- break;
- case '$':/* map reg */
- src = &mapreg->regs;
- break;
- case '.':/* npc/script */
- if (ref != NULL) {
- src = ref;
- } else {
- nullpo_retr(NULL, st);
- src = (name[1] == '@') ? &st->stack->scope : &st->script->local;
- }
- break;
- case '\'':/* instance */
+ }
+ break;
+ case '$':/* map reg */
+ src = &mapreg->regs;
+ break;
+ case '.':/* npc/script */
+ if (ref != NULL) {
+ src = ref;
+ } else {
nullpo_retr(NULL, st);
- if( st->instance_id >= 0 ) {
- src = &instance->list[st->instance_id].regs;
- }
- break;
+ src = (name[1] == '@') ? &st->stack->scope : &st->script->local;
+ }
+ break;
+ case '\'':/* instance */
+ nullpo_retr(NULL, st);
+ if (st->instance_id >= 0) {
+ src = &instance->list[st->instance_id].regs;
+ }
+ break;
}
- if( src ) {
- if( !src->arrays )
+ if (src) {
+ if (!src->arrays) {
src->arrays = idb_alloc(DB_OPT_BASE);
+ }
return src;
}
return NULL;
@@ -3292,48 +3321,65 @@ int set_reg(struct script_state *st, struct map_session_data *sd, int64 num, con
return 0;
}
- if( is_string_variable(name) ) {// string variable
+ if (is_string_variable(name)) {// string variable
const char *str = (const char*)value;
switch (prefix) {
- case '@':
+ case '@':
+ if (ref) {
+ script->set_reg_ref_str(st, ref, num, name, str);
+ } else {
pc->setregstr(sd, num, str);
- return 1;
- case '$':
- return mapreg->setregstr(num, str);
- case '#':
- return (name[1] == '#') ?
- pc_setaccountreg2str(sd, num, str) :
- pc_setaccountregstr(sd, num, str);
- case '.':
- if (ref)
- script->set_reg_ref_str(st, ref, num, name, str);
- else if (name[1] == '@')
- script->set_reg_scope_str(st, &st->stack->scope, num, name, str);
- else
- script->set_reg_npc_str(st, &st->script->local, num, name, str);
- return 1;
- case '\'':
- set_reg_instance_str(st, num, name, str);
- return 1;
- default:
- return pc_setglobalreg_str(sd, num, str);
+ }
+ return 1;
+ case '$':
+ mapreg->setregstr(num, str);
+ return 1;
+ case '#':
+ if (ref) {
+ script->set_reg_ref_str(st, ref, num, name, str);
+ } else if (name[1] == '#') {
+ pc_setaccountreg2str(sd, num, str);
+ } else {
+ pc_setaccountregstr(sd, num, str);
+ }
+ return 1;
+ case '.':
+ if (ref) {
+ script->set_reg_ref_str(st, ref, num, name, str);
+ } else if (name[1] == '@') {
+ script->set_reg_scope_str(st, &st->stack->scope, num, name, str);
+ } else {
+ script->set_reg_npc_str(st, &st->script->local, num, name, str);
+ }
+ return 1;
+ case '\'':
+ set_reg_instance_str(st, num, name, str);
+ return 1;
+ default:
+ if (ref) {
+ script->set_reg_ref_str(st, ref, num, name, str);
+ } else {
+ pc_setglobalreg_str(sd, num, str);
+ }
+ return 1;
}
} else {// integer variable
// FIXME: This isn't safe, in 32bits systems we're converting a 64bit pointer
// to a 32bit int, this will lead to overflows! [Panikon]
int val = (int)h64BPTRSIZE(value);
- if(script->str_data[script_getvarid(num)].type == C_PARAM) {
- if( pc->setparam(sd, script->str_data[script_getvarid(num)].val, val) == 0 ) {
- if( st != NULL ) {
+ if (script->str_data[script_getvarid(num)].type == C_PARAM) {
+ if (pc->setparam(sd, script->str_data[script_getvarid(num)].val, val) == 0) {
+ if (st != NULL) {
ShowError("script:set_reg: failed to set param '%s' to %d.\n", name, val);
script->reportsrc(st);
// Instead of just stop the script execution we let the character close
// the window if it was open.
st->state = (sd->state.dialog) ? CLOSE : END;
- if( st->state == CLOSE )
+ if(st->state == CLOSE) {
clif->scriptclose(sd, st->oid);
+ }
}
return 0;
}
@@ -3341,28 +3387,44 @@ int set_reg(struct script_state *st, struct map_session_data *sd, int64 num, con
}
switch (prefix) {
- case '@':
+ case '@':
+ if (ref) {
+ script->set_reg_ref_num(st, ref, num, name, val);
+ } else {
pc->setreg(sd, num, val);
- return 1;
- case '$':
- return mapreg->setreg(num, val);
- case '#':
- return (name[1] == '#') ?
- pc_setaccountreg2(sd, num, val) :
- pc_setaccountreg(sd, num, val);
- case '.':
- if (ref)
- script->set_reg_ref_num(st, ref, num, name, val);
- else if (name[1] == '@')
- script->set_reg_scope_num(st, &st->stack->scope, num, name, val);
- else
- script->set_reg_npc_num(st, &st->script->local, num, name, val);
- return 1;
- case '\'':
- set_reg_instance_num(st, num, name, val);
- return 1;
- default:
- return pc_setglobalreg(sd, num, val);
+ }
+ return 1;
+ case '$':
+ mapreg->setreg(num, val);
+ return 1;
+ case '#':
+ if (ref) {
+ script->set_reg_ref_num(st, ref, num, name, val);
+ } else if (name[1] == '#') {
+ pc_setaccountreg2(sd, num, val);
+ } else {
+ pc_setaccountreg(sd, num, val);
+ }
+ return 1;
+ case '.':
+ if (ref) {
+ script->set_reg_ref_num(st, ref, num, name, val);
+ } else if (name[1] == '@') {
+ script->set_reg_scope_num(st, &st->stack->scope, num, name, val);
+ } else {
+ script->set_reg_npc_num(st, &st->script->local, num, name, val);
+ }
+ return 1;
+ case '\'':
+ set_reg_instance_num(st, num, name, val);
+ return 1;
+ default:
+ if (ref) {
+ script->set_reg_ref_num(st, ref, num, name, val);
+ } else {
+ pc_setglobalreg(sd, num, val);
+ }
+ return 1;
}
}
}
@@ -5197,7 +5259,7 @@ int script_load_translation(const char *file, uint8 lang_id)
VECTOR_TRUNCATE(msgstr);
continue;
}
-
+
if (strncasecmp(line, "msgid \"", 7) == 0) {
VECTOR_TRUNCATE(msgid);
for (i = 7; i < len - 2; i++) {
@@ -13840,15 +13902,26 @@ BUILDIN(undisguise)
* Transform a bl to another class,
* @type unused
*------------------------------------------*/
-BUILDIN(classchange) {
- int class, type;
- struct block_list *bl=map->id2bl(st->oid);
+BUILDIN(classchange)
+{
+ int class, type, target;
+ struct block_list *bl = map->id2bl(st->oid);
- if(bl==NULL) return true;
+ if (bl == NULL)
+ return true;
- class = script_getnum(st,2);
- type=script_getnum(st,3);
- clif->class_change(bl, class, type);
+ class = script_getnum(st, 2);
+ type = script_getnum(st, 3);
+ target = script_hasdata(st, 4) ? script_getnum(st, 4) : 0;
+
+ if (target > 0) {
+ struct map_session_data *sd = script->charid2sd(st, target);
+ if (sd != NULL) {
+ clif->class_change(bl, class, type, sd);
+ }
+ } else {
+ clif->class_change(bl, class, type, NULL);
+ }
return true;
}
@@ -15455,6 +15528,29 @@ BUILDIN(charat) {
}
//=======================================================
+// chr <int>
+//-------------------------------------------------------
+BUILDIN(chr)
+{
+ char output[2];
+ output[0] = script_getnum(st, 2);
+ output[1] = '\0';
+
+ script_pushstrcopy(st, output);
+ return true;
+}
+
+//=======================================================
+// ord <chr>
+//-------------------------------------------------------
+BUILDIN(ord)
+{
+ const char *chr = script_getstr(st, 2);
+ script_pushint(st, *chr);
+ return true;
+}
+
+//=======================================================
// setchar <string>, <char>, <index>
//-------------------------------------------------------
BUILDIN(setchar)
@@ -17498,6 +17594,55 @@ BUILDIN(getvariableofnpc)
return true;
}
+BUILDIN(getvariableofpc)
+{
+ const char* name;
+ struct script_data* data = script_getdata(st, 2);
+ struct map_session_data *sd = map->id2sd(script_getnum(st, 3));
+
+ if (!data_isreference(data)) {
+ ShowError("script:getvariableofpc: not a variable\n");
+ script->reportdata(data);
+ script_pushnil(st);
+ st->state = END;
+ return false;
+ }
+
+ name = reference_getname(data);
+
+ switch (*name)
+ {
+ case '#':
+ case '$':
+ case '.':
+ case '\'':
+ ShowError("script:getvariableofpc: illegal scope (not pc variable)\n");
+ script->reportdata(data);
+ script_pushnil(st);
+ st->state = END;
+ return false;
+ }
+
+ if (sd == NULL)
+ {
+ // player not found, return default value
+ if (script_hasdata(st, 4)) {
+ script_pushcopy(st, 4);
+ } else if (is_string_variable(name)) {
+ script_pushconststr(st, "");
+ } else {
+ script_pushint(st, 0);
+ }
+ return true;
+ }
+
+ if (!sd->regs.vars)
+ sd->regs.vars = i64db_alloc(DB_OPT_RELEASE_DATA);
+
+ script->push_val(st->stack, C_NAME, reference_getuid(data), &sd->regs);
+ return true;
+}
+
/// Opens a warp portal.
/// Has no "portal opening" effect/sound, it opens the portal immediately.
///
@@ -21009,7 +21154,7 @@ void script_parse_builtin(void) {
BUILDIN_DEF(getcartinventorylist,""),
BUILDIN_DEF(getskilllist,""),
BUILDIN_DEF(clearitem,""),
- BUILDIN_DEF(classchange,"ii"),
+ BUILDIN_DEF(classchange,"ii?"),
BUILDIN_DEF(misceffect,"i"),
BUILDIN_DEF(playbgm,"s"),
BUILDIN_DEF(playbgmall,"s?????"),
@@ -21075,6 +21220,8 @@ void script_parse_builtin(void) {
BUILDIN_DEF(getstrlen,"s"), //strlen [Valaris]
BUILDIN_DEF(charisalpha,"si"), //isalpha [Valaris]
BUILDIN_DEF(charat,"si"),
+ BUILDIN_DEF(chr,"i"),
+ BUILDIN_DEF(ord,"s"),
BUILDIN_DEF(setchar,"ssi"),
BUILDIN_DEF(insertchar,"ssi"),
BUILDIN_DEF(delchar,"si"),
@@ -21155,6 +21302,7 @@ void script_parse_builtin(void) {
BUILDIN_DEF(sleep2,"i"),
BUILDIN_DEF(awake,"s"),
BUILDIN_DEF(getvariableofnpc,"rs"),
+ BUILDIN_DEF(getvariableofpc,"ri?"),
BUILDIN_DEF(warpportal,"iisii"),
BUILDIN_DEF2(homunculus_evolution,"homevolution",""), //[orn]
BUILDIN_DEF2(homunculus_mutate,"hommutate","?"),
diff --git a/src/map/unit.c b/src/map/unit.c
index 739a369a6..feb11f89e 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -1461,7 +1461,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
} else if( src->type == BL_MER && skill_id == MA_REMOVETRAP ) {
if( !battle->check_range(battle->get_master(src), target, range + 1) )
return 0; // Aegis calc remove trap based on Master position, ignoring mercenary O.O
- } else if( !battle->check_range(src, target, range + (skill_id == RG_CLOSECONFINE?0:2)) ) {
+ } else if (!battle->check_range(src, target, range)) {
return 0; // Arrow-path check failed.
}
}
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index 57abf25e0..82d310832 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -974,8 +974,8 @@ typedef void (*HPMHOOK_pre_clif_refreshlook) (struct block_list **bl, int *id, i
typedef void (*HPMHOOK_post_clif_refreshlook) (struct block_list *bl, int id, int type, int val, enum send_target target);
typedef void (*HPMHOOK_pre_clif_sendlook) (struct block_list **bl, int *id, int *type, int *val, int *val2, enum send_target *target);
typedef void (*HPMHOOK_post_clif_sendlook) (struct block_list *bl, int id, int type, int val, int val2, enum send_target target);
-typedef void (*HPMHOOK_pre_clif_class_change) (struct block_list **bl, int *class_, int *type);
-typedef void (*HPMHOOK_post_clif_class_change) (struct block_list *bl, int class_, int type);
+typedef void (*HPMHOOK_pre_clif_class_change) (struct block_list **bl, int *class_, int *type, struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_class_change) (struct block_list *bl, int class_, int type, struct map_session_data *sd);
typedef void (*HPMHOOK_pre_clif_skill_delunit) (struct skill_unit **su);
typedef void (*HPMHOOK_post_clif_skill_delunit) (struct skill_unit *su);
typedef void (*HPMHOOK_pre_clif_skillunit_update) (struct block_list **bl);
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index 654c902d8..800fb8c76 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -7917,14 +7917,14 @@ void HP_clif_sendlook(struct block_list *bl, int id, int type, int val, int val2
}
return;
}
-void HP_clif_class_change(struct block_list *bl, int class_, int type) {
+void HP_clif_class_change(struct block_list *bl, int class_, int type, struct map_session_data *sd) {
int hIndex = 0;
if( HPMHooks.count.HP_clif_class_change_pre ) {
- void (*preHookFunc) (struct block_list **bl, int *class_, int *type);
+ void (*preHookFunc) (struct block_list **bl, int *class_, int *type, struct map_session_data **sd);
*HPMforce_return = false;
for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_class_change_pre; hIndex++ ) {
preHookFunc = HPMHooks.list.HP_clif_class_change_pre[hIndex].func;
- preHookFunc(&bl, &class_, &type);
+ preHookFunc(&bl, &class_, &type, &sd);
}
if( *HPMforce_return ) {
*HPMforce_return = false;
@@ -7932,13 +7932,13 @@ void HP_clif_class_change(struct block_list *bl, int class_, int type) {
}
}
{
- HPMHooks.source.clif.class_change(bl, class_, type);
+ HPMHooks.source.clif.class_change(bl, class_, type, sd);
}
if( HPMHooks.count.HP_clif_class_change_post ) {
- void (*postHookFunc) (struct block_list *bl, int class_, int type);
+ void (*postHookFunc) (struct block_list *bl, int class_, int type, struct map_session_data *sd);
for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_class_change_post; hIndex++ ) {
postHookFunc = HPMHooks.list.HP_clif_class_change_post[hIndex].func;
- postHookFunc(bl, class_, type);
+ postHookFunc(bl, class_, type, sd);
}
}
return;