summaryrefslogtreecommitdiff
path: root/world/map/npc/functions
diff options
context:
space:
mode:
Diffstat (limited to 'world/map/npc/functions')
-rw-r--r--world/map/npc/functions/clear_vars.txt2
-rwxr-xr-xworld/map/npc/functions/debug.txt2
-rw-r--r--world/map/npc/functions/default_npc_checks.txt74
-rw-r--r--world/map/npc/functions/ferry.txt2
-rw-r--r--world/map/npc/functions/gm_island.txt64
-rw-r--r--world/map/npc/functions/mob_points.txt11
-rw-r--r--world/map/npc/functions/travelers.txt2
7 files changed, 123 insertions, 34 deletions
diff --git a/world/map/npc/functions/clear_vars.txt b/world/map/npc/functions/clear_vars.txt
index b83ea630..a0c5e787 100644
--- a/world/map/npc/functions/clear_vars.txt
+++ b/world/map/npc/functions/clear_vars.txt
@@ -10,6 +10,8 @@ function|script|ClearVariables|,
L_SetAllTut:
if (FLAGS & FLAG_TUTORIAL_DONE)
goto L_ResetAllTut;
+ if ((FLAGS & FLAG_TUTORIAL_DONE) && (!(TUTORIAL & $@HasanCompleteBit)))
+ set TUTORIAL, TUTORIAL | $@HasanCompleteBit;
set @tutorial_tmp, (sorfina + tanisha + hasan + kaan);
set TUTORIAL, (TUTORIAL & ~(NIBBLE_0_MASK) | (@tutorial_tmp << NIBBLE_0_SHIFT));
set @tutorial_tmp, 0;
diff --git a/world/map/npc/functions/debug.txt b/world/map/npc/functions/debug.txt
index 9918cbaf..b4a66314 100755
--- a/world/map/npc/functions/debug.txt
+++ b/world/map/npc/functions/debug.txt
@@ -956,7 +956,7 @@ OnInit:
end;
}
-botcheck.gat,50,28,0|script|Debug4|154,
+017-9.gat,21,24,0|script|Debug4|154,
{
callfunc "Debug";
end;
diff --git a/world/map/npc/functions/default_npc_checks.txt b/world/map/npc/functions/default_npc_checks.txt
index 4ddd00ca..efe8818b 100644
--- a/world/map/npc/functions/default_npc_checks.txt
+++ b/world/map/npc/functions/default_npc_checks.txt
@@ -3,16 +3,16 @@
// Range
// Map, X, Y, Distance in Tiles
-// setarray $@npc_loc, 24, 113, 4;
+// setarray @npc_loc, 24, 113, 4;
function|script|PCtoNPCRange|,
{
set @npc_check, 0;
- set $@Nmap$, getmap() + ".gat";
- set $@Nx1, ($@npc_loc[0] - $@npc_loc[2]);
- set $@Ny1, ($@npc_loc[1] - $@npc_loc[2]);
- set $@Nx2, ($@npc_loc[0] + $@npc_loc[2]);
- set $@Ny2, ($@npc_loc[1] + $@npc_loc[2]);
- if (isin($@Nmap$, $@Nx1, $@Ny1, $@Nx2, $@Ny2))
+ set @Nmap$, getmap() + ".gat";
+ set @Nx1, (@npc_loc[0] - @npc_loc[2]);
+ set @Ny1, (@npc_loc[1] - @npc_loc[2]);
+ set @Nx2, (@npc_loc[0] + @npc_loc[2]);
+ set @Ny2, (@npc_loc[1] + @npc_loc[2]);
+ if (isin(@Nmap$, @Nx1, @Ny1, @Nx2, @Ny2))
goto L_Return;
set @npc_check, 1;
goto L_Return;
@@ -22,9 +22,9 @@ L_Return:
}
// Inventory & Weight
-// setarray @delitem_names$ Items to delete
+// @delitem_ids Items to delete
// @delitem_counts Counts of Items to delete
-// @getitem_names$ Items to get
+// @getitem_ids Items to get
// @getitem_counts Counts of Items to get
function|script|CheckInventory|,
{
@@ -33,78 +33,90 @@ function|script|CheckInventory|,
set @delitem_loop, 0;
set @getitem_loop, 0;
set @check_fail, 0;
+ set @msg_loop, 0;
- if (getarraysize(@delitem_names$))
+ if (getarraysize(@delitem_ids))
goto L_DelItemsLoop;
goto L_CheckGet;
L_DelItemsLoop:
- if(countitem(@delitem_names$[@delitem_loop]) >= @delitem_counts[@delitem_loop])
+ if(countitem(@delitem_ids[@delitem_loop]) >= @delitem_counts[@delitem_loop])
goto L_DelLoopAgain;
goto L_ReturnMissing;
L_DelLoopAgain:
- if((@delitems_loop + 1) == getarraysize(@delitems_names$))
+ set @delitem_loop, (@delitem_loop + 1);
+ if(@delitem_loop == getarraysize(@delitem_ids))
goto L_CheckGet;
- set @delitems_loop, (@delitems_loop + 1);
goto L_DelItemsLoop;
L_CheckGet:
- if (getarraysize(@getitem_names$))
+ if (getarraysize(@getitem_ids))
goto L_CheckWeight;
goto L_DelCheck;
L_CheckWeight:
getinventorylist;
- if (@inventorylist_count < (101 - getarraysize(@getitem_names$)))
+ if (100 < (@inventorylist_count + getarraysize(@getitem_ids)))
goto L_ReturnSpace;
goto L_GetItemsLoop;
L_GetItemsLoop:
- if (checkweight(@getitem_names$, 1) == 0)
+ if (checkweight(@getitem_ids[@getitem_loop], @getitem_counts[@getitem_loop]))
goto L_GetLoopAgain;
goto L_ReturnWeight;
L_GetLoopAgain:
- if((@getitems_loop + 1) == getarraysize(@getitems_names$))
+ set @getitem_loop, (@getitem_loop + 1);
+ if(@getitem_loop == getarraysize(@getitem_ids))
goto L_DelCheck;
- set @getitems_loop, (@getitems_loop + 1);
goto L_GetItemsLoop;
L_DelCheck:
- if (getarraysize(@delitem_names$))
+ if (getarraysize(@delitem_ids))
goto L_DelLoop;
goto L_CheckGet2;
L_DelLoop:
- delitem @delitem_names$[@del_loop], @delitem_counts[@del_loop];
+ delitem @delitem_ids[@del_loop], @delitem_counts[@del_loop];
goto L_DelAgain;
L_DelAgain:
- if((@del_loop + 1) == getarraysize(@delitems_names$))
- goto L_GetLoop;
set @del_loop, (@del_loop + 1);
+ if(@del_loop == getarraysize(@delitem_ids))
+ goto L_GetLoop;
goto L_DelLoop;
L_CheckGet2:
- if (getarraysize(@getitem_names$))
+ if (getarraysize(@getitem_ids))
goto L_GetLoop;
goto L_Return;
L_GetLoop:
- getitem @getitem_names$[@get_loop], @getitem_counts[@get_loop];
+ misceffect FX_GETITEM, strcharinfo(0);
+ getitem @getitem_ids[@get_loop], @getitem_counts[@get_loop];
goto L_GetAgain;
L_GetAgain:
- if((@get_loop + 1) == getarraysize(@getitems_names$))
- goto L_Return;
set @get_loop, (@get_loop + 1);
+ if(@get_loop == getarraysize(@getitem_ids))
+ goto L_Return;
goto L_GetLoop;
L_ReturnMissing:
- mes "\"You are missing required items.\"";
set @check_fail, 1;
- goto L_Return;
+ mes "\"You are missing required items.\"";
+ goto L_MissingMsg;
+
+L_MissingMsg:
+ mes "[@@"+@delitem_ids[@msg_loop]+"|"+getitemname(@delitem_ids[@msg_loop])+"@@] "+countitem(getitemname(@delitem_ids[@msg_loop]))+"/"+@delitem_counts[@msg_loop];
+ goto L_NextMsgCheck;
+
+L_NextMsgCheck:
+ set @msg_loop, (@msg_loop + 1);
+ if(@msg_loop == getarraysize(@delitem_ids))
+ goto L_Return;
+ goto L_MissingMsg;
L_ReturnWeight:
mes "\"You need to be carrying less weight.\"";
@@ -119,7 +131,9 @@ L_ReturnSpace:
goto L_Return;
L_Return:
- cleararray @delitem_names$, "", getarraysize(@delitem_names$);
- cleararray @getitem_names$, "", getarraysize(@getitem_names$);
+ cleararray @delitem_ids, "", getarraysize(@delitem_ids);
+ cleararray @delitem_counts, "", getarraysize(@delitem_counts);
+ cleararray @getitem_ids, "", getarraysize(@getitem_ids);
+ cleararray @getitem_counts, "", getarraysize(@getitem_counts);
return;
}
diff --git a/world/map/npc/functions/ferry.txt b/world/map/npc/functions/ferry.txt
index 271a2e39..c2e92271 100644
--- a/world/map/npc/functions/ferry.txt
+++ b/world/map/npc/functions/ferry.txt
@@ -1,6 +1,6 @@
// The ferry system
-botcheck.gat,27,28,0|script|#FerryConfig|-1,
+017-9.gat,27,28,0|script|#FerryConfig|-1,
{
end;
diff --git a/world/map/npc/functions/gm_island.txt b/world/map/npc/functions/gm_island.txt
new file mode 100644
index 00000000..cae9bdb0
--- /dev/null
+++ b/world/map/npc/functions/gm_island.txt
@@ -0,0 +1,64 @@
+// Add Localized Warp in town centers and Message to GM Island
+-|script|#GmConfig|-1,
+{
+ end;
+
+OnInit:
+ disablenpc "Gm Event#1";
+ disablenpc "Gm Event#2";
+ disablenpc "Gm Event#3";
+ end;
+}
+function|script|GmWarp|,
+{
+ warp "028-1", 110, 30;
+ return;
+}
+function|script|GmDebug|,
+{
+ if (getgmlevel() < 60)
+ goto L_Return;
+ goto L_Main;
+
+L_Main:
+ mes "[Gm Debug]";
+ mes "What do you want to do?";
+ menu
+ "Start Event.", L_GmStart,
+ "Stop Event.", L_GmStop;
+
+L_GmStart:
+ enablenpc "Gm Event#1";
+ enablenpc "Gm Event#2";
+ enablenpc "Gm Event#3";
+ goto L_Return;
+
+L_GmStop:
+ disablenpc "Gm Event#1";
+ disablenpc "Gm Event#2";
+ disablenpc "Gm Event#3";
+ goto L_Return;
+
+L_Return:
+ return;
+}
+017-9.gat,32,21,0|script|Gm Event Debug|368,
+{
+ callfunc "GmDebug";
+ close;
+}
+001-1.gat,49,68,0|script|Gm Event#1|368,0,0,
+{
+ callfunc "GmWarp";
+ end;
+}
+009-1.gat,46,30,0|script|Gm Event#2|368,0,0,
+{
+ callfunc "GmWarp";
+ end;
+}
+020-1.gat,67,89,0|script|Gm Event#3|368,0,0,
+{
+ callfunc "GmWarp";
+ end;
+}
diff --git a/world/map/npc/functions/mob_points.txt b/world/map/npc/functions/mob_points.txt
index fd9729de..eb5aeff7 100644
--- a/world/map/npc/functions/mob_points.txt
+++ b/world/map/npc/functions/mob_points.txt
@@ -137,13 +137,22 @@ function|script|MobPoints|,
if (MPQUEST == 1)
set Mobpt, Mobpt + @points[@mobID - 1002];
+ callfunc "ValonState";
+ if (((@valon_start) && (!(@valon_end))) && (@mobID == $@ValonMob[@valon_mob]))
+ goto L_ValonMobKill;
+ goto L_NatureKarma;
+
+L_ValonMobKill:
+ callfunc "AddValonCntMask";
+ goto L_NatureKarma;
+
+L_NatureKarma:
// Scorpion, Red Scorpion, Black Scorpion, Angry Scorpion
// DemonicMouboo, ViciousSquirrel, WickedMushroom, Bluepar
if ((@mobID == 1003) || (@mobID == 1004) || (@mobID == 1009) || (@mobID == 1057)
|| (@mobID == 1104) || (@mobID == 1105) || (@mobID == 1106) || (@mobID == 1107))
goto L_good;
-
// Attitude adjustment for the witch (can we refactor this to another function? Not sure about max. recursion depth)
set @value, 0;
diff --git a/world/map/npc/functions/travelers.txt b/world/map/npc/functions/travelers.txt
index 7aa0d4b1..e455eb74 100644
--- a/world/map/npc/functions/travelers.txt
+++ b/world/map/npc/functions/travelers.txt
@@ -6,7 +6,7 @@
// Costs Zeny
// Contains all warp points to find
-botcheck.gat,27,28,0|script|#TravelConfig|-1,
+017-9.gat,27,28,0|script|#TravelConfig|-1,
{
end;