summaryrefslogtreecommitdiff
path: root/npc/functions
diff options
context:
space:
mode:
Diffstat (limited to 'npc/functions')
-rw-r--r--npc/functions/clear_vars.txt12
-rw-r--r--npc/functions/ghost.txt14
-rw-r--r--npc/functions/global_event_handler.txt3
-rw-r--r--npc/functions/main.txt15
-rw-r--r--npc/functions/scoreboards.txt2
-rw-r--r--npc/functions/vault.txt2
-rw-r--r--npc/functions/weather.txt3
7 files changed, 38 insertions, 13 deletions
diff --git a/npc/functions/clear_vars.txt b/npc/functions/clear_vars.txt
index e5e6e5d4..65d21291 100644
--- a/npc/functions/clear_vars.txt
+++ b/npc/functions/clear_vars.txt
@@ -1,7 +1,6 @@
+// Update variables on server init, login and logout
function script ClearVariables {
- if (@login_event != 1) goto L_Deprecated;
-
// Some temporary bugfix
GM = getgroupid();
@@ -142,6 +141,15 @@ function script ClearVariables {
}
+function script FlushVariables {
+ // Some variables should not be saved
+ GM = 0;
+ ##01_TMWEXP = 0;
+ return;
+}
+
+
+
function script ServerUpdate {
if ($@STARTUP) {
debugmes "Cowardly refusing to update server outside startup";
diff --git a/npc/functions/ghost.txt b/npc/functions/ghost.txt
index 3e1a9724..4c3b825a 100644
--- a/npc/functions/ghost.txt
+++ b/npc/functions/ghost.txt
@@ -1,6 +1,6 @@
function script SpawnGhost {
if ($GHOSTS_DISABLED)
- goto L_Return;
+ return;
if (BaseLevel >= 40 &&
(getmapname() == "026-1" ||
@@ -22,15 +22,11 @@ L_Spawn:
else if (!(iscollision(getmapname(), .@x + 1, .@y))) set .@x, .@x + 1; // right
// else on the player
- // FIXME (Is this a valid event label??)
- if (@GHOST_MAP$ != "")
- killmonster @GHOST_MAP$, "~GH~" + getcharid(0);
+ // FIXME - verify if ghost GID is still alive, maybe add it an event label
+ if (@GHOST_GID)
+ unitkill(@GHOST_GID);
- @GHOST_MAP$ = getmapname();
specialeffect(39, SELF, getcharid(3));
- monster getmapname(), .@x, .@y, strcharinfo(0), 1136, 1, "~GH~" + getcharid(0);
- return;
-
-L_Return:
+ @GHOST_GID = monster(getmapname(), .@x, .@y, strcharinfo(0), LesserGhost, 1);
return;
}
diff --git a/npc/functions/global_event_handler.txt b/npc/functions/global_event_handler.txt
index b63fb28f..ab0a68cd 100644
--- a/npc/functions/global_event_handler.txt
+++ b/npc/functions/global_event_handler.txt
@@ -9,13 +9,14 @@ OnPCLoginEvent:
ClearVariables(); // removes / converts old variables
DisplayMOTD(); // send the motd to the client, if enabled
TMWBirthday();
+ //skill SKILL_JANDE, 1, 0;
// add more here
vaultOnLogin();
@login_event = 2;
end;
OnPCLogoutEvent:
- GM = 0;
+ FlushVariables();
vaultOnLogout();
end;
diff --git a/npc/functions/main.txt b/npc/functions/main.txt
index 0b89ae72..c46f04d4 100644
--- a/npc/functions/main.txt
+++ b/npc/functions/main.txt
@@ -66,7 +66,7 @@ function script mesq {
}
function script g {
- return Sex == 0 ? getarg(0) : getarg(1);
+ return Sex ? getarg(1) : getarg(0);
}
function script b {
@@ -528,6 +528,19 @@ function script set_aggro {
return;
}
+// Makes a monster passive
+// unset_aggro( monster{, mode=MD_AGGRESSIVE} )
+function script unset_aggro {
+ .@m=getarg(0);
+ .@x=getarg(1, MD_AGGRESSIVE);
+ .@op=getunitdata(.@m, UDT_MODE);
+ if (.@op & .@x) {
+ .@op=.@op^.@x;
+ setunitdata(.@m, UDT_MODE, .@op);
+ }
+ return;
+}
+
// Special function which makes a date as a number
// numdate( - )
function script numdate {
diff --git a/npc/functions/scoreboards.txt b/npc/functions/scoreboards.txt
index dc21758d..3a6f4bf2 100644
--- a/npc/functions/scoreboards.txt
+++ b/npc/functions/scoreboards.txt
@@ -229,6 +229,8 @@ OnCall:
mesc l("Boss points: %s", fnum(BOSS_POINTS));
mesc l("Mob points: %s", fnum(Mobpt));
mesc l("Total Gold: %s", fnum((Zeny+BankVault)));
+ if (TUT_var > 10)
+ mesc l("Joined the world %s ago", FuzzyTime(TUT_var));
next;
break;
default:
diff --git a/npc/functions/vault.txt b/npc/functions/vault.txt
index 4f45c871..2022b726 100644
--- a/npc/functions/vault.txt
+++ b/npc/functions/vault.txt
@@ -88,6 +88,8 @@ function script vaultOnLogout {
"VAR1V", ##01_TMWQUEST,
"VAR2N", "TMWGLOBAL",
"VAR2V", ##01_TMWGLOBAL,
+ "VAR2N", "TMWEXP",
+ "VAR2V", ##01_TMWEXP,
"VEXP", ##VAULT_EXP,
"GOTO", ##VAULT_GOTO,
"MLTO", ##VAULT_MLTO);
diff --git a/npc/functions/weather.txt b/npc/functions/weather.txt
index dacbd984..5312f5dc 100644
--- a/npc/functions/weather.txt
+++ b/npc/functions/weather.txt
@@ -59,6 +59,8 @@ OnInit:
htput(.wcore, "052-1", CLIMATE_MODERATE);
htput(.wcore, "055-1", CLIMATE_MODERATE);
htput(.wcore, "057-1", CLIMATE_MODERATE);
+ htput(.wcore, "080-1", CLIMATE_MODERATE);
+ htput(.wcore, "080-3", CLIMATE_MODERATE);
htput(.wcore, "099-5", CLIMATE_MODERATE); // Doomsday Boss Room
// Icelands
@@ -71,6 +73,7 @@ OnInit:
htput(.wcore, "045-1", CLIMATE_ICELAND);
htput(.wcore, "046-1", CLIMATE_ICELAND);
htput(.wcore, "047-1", CLIMATE_ICELAND);
+ htput(.wcore, "081-1", CLIMATE_ICELAND);
// Special
htput(.wcore, "099-1", CLIMATE_NONE);