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/banker.txt4
-rw-r--r--world/map/npc/functions/barber.txt6
-rw-r--r--world/map/npc/functions/clear_vars.txt10
-rw-r--r--world/map/npc/functions/dailyquest.txt7
-rwxr-xr-xworld/map/npc/functions/debug.txt19
-rw-r--r--world/map/npc/functions/evil_obelisk.txt3
-rw-r--r--world/map/npc/functions/ferry.txt3
-rw-r--r--world/map/npc/functions/game_rules.txt3
-rw-r--r--world/map/npc/functions/inn.txt3
-rw-r--r--world/map/npc/functions/lockpicking.txt4
-rw-r--r--world/map/npc/functions/magic.txt13
-rw-r--r--world/map/npc/functions/mob_points.txt3
-rw-r--r--world/map/npc/functions/process_equip.txt3
-rw-r--r--world/map/npc/functions/slot_machine.txt3
-rw-r--r--world/map/npc/functions/soul_menhir.txt3
-rw-r--r--world/map/npc/functions/strangerquiz.txt3
-rw-r--r--world/map/npc/functions/time.txt3
-rw-r--r--world/map/npc/functions/water_bottle.txt3
18 files changed, 60 insertions, 36 deletions
diff --git a/world/map/npc/functions/banker.txt b/world/map/npc/functions/banker.txt
index 42348957..09cfdef6 100644
--- a/world/map/npc/functions/banker.txt
+++ b/world/map/npc/functions/banker.txt
@@ -1,7 +1,7 @@
//
-function|script|Banker|{
-
+function|script|Banker|
+{
if (BankAccount == 0)
goto L_Start;
callsub S_MoveAccount;
diff --git a/world/map/npc/functions/barber.txt b/world/map/npc/functions/barber.txt
index 477b4a7b..4ad5ee1f 100644
--- a/world/map/npc/functions/barber.txt
+++ b/world/map/npc/functions/barber.txt
@@ -9,7 +9,8 @@
// or using GM commands, but scripts (such as this one) can set
// any value 0-255
-function|script|Barber|{
+function|script|Barber|
+{
set @style, getlook(LOOK_HAIR_STYLE);
set @color, getlook(LOOK_HAIR_COLOR);
@@ -113,7 +114,8 @@ L_Done:
// Since this is a function, not an NPC, OnInit doesn't work
// So call this from a real NPC's OnInit (001-1/barber.txt)
-function|script|OnInitBarber|{
+function|script|OnInitBarber|
+{
setarray $@HairStyles$,
"Bald", "Flat ponytail", "Bowl cut", "Combed back", "Emo", "Mohawk",
"Pompadour", "Center parting/Short and slick", "Long and slick",
diff --git a/world/map/npc/functions/clear_vars.txt b/world/map/npc/functions/clear_vars.txt
index 6cc311fe..db94680f 100644
--- a/world/map/npc/functions/clear_vars.txt
+++ b/world/map/npc/functions/clear_vars.txt
@@ -1,6 +1,7 @@
// Clears old variables
-function|script|ClearVariables|{
+function|script|ClearVariables|
+{
set EasterQuest, 0;
// Halloween 2006
@@ -184,8 +185,8 @@ L_Fix_Full:
// The variable TMW_Quest was used to save the progress in several subquests linearly.
// The subquests are moved to different nibbles of other variables
// to make it possible to do some of the quests in parallel.
-function|script|ClearVarTMW_Quest|{
-
+function|script|ClearVarTMW_Quest|
+{
if (TMW_Quest == 0) goto L_Done;
if (TMW_Quest <= 6) goto L_Bernard_Mikhail;
if (TMW_Quest <= 8) goto L_Sarah;
@@ -231,7 +232,8 @@ L_Done:
return;
}
--|script|#ClearGlobalVars|-1,{
+-|script|#ClearGlobalVars|-1,
+{
OnInit:
// Clear some entries of the arrays which save the Fluffy Hunting highscore list
diff --git a/world/map/npc/functions/dailyquest.txt b/world/map/npc/functions/dailyquest.txt
index 69270c79..9bc84c5b 100644
--- a/world/map/npc/functions/dailyquest.txt
+++ b/world/map/npc/functions/dailyquest.txt
@@ -27,7 +27,8 @@
// (DailyQuestBonus makes a good reward from non-daily quests)
-function|script|DailyQuestPoints|{
+function|script|DailyQuestPoints|
+{
set @dq_earliest, gettimetick(2) - 86400;
if (DailyQuestTime < @dq_earliest)
set DailyQuestTime, @dq_earliest;
@@ -54,8 +55,8 @@ L_Bonus:
return;
}
-function|script|DailyQuest|{
-
+function|script|DailyQuest|
+{
callfunc "DailyQuestPoints";
if (BaseLevel < @dq_level)
diff --git a/world/map/npc/functions/debug.txt b/world/map/npc/functions/debug.txt
index 83a41060..9f9559ea 100755
--- a/world/map/npc/functions/debug.txt
+++ b/world/map/npc/functions/debug.txt
@@ -1,7 +1,7 @@
// Authors: alastrim, Jenalya, Ali-G
-function|script|Debug|{
-
+function|script|Debug|
+{
L_Begin:
set @debug_mask, 65535;
set @debug_shift, 0;
@@ -861,7 +861,8 @@ L_ResetAll:
}
-042-2.gat,30,26,0|script|Debug0|154,{
+042-2.gat,30,26,0|script|Debug0|154,
+{
callfunc "Debug";
end;
OnInit:
@@ -869,7 +870,8 @@ OnInit:
disablenpc "Debug0";
}
-001-1.gat,41,29,0|script|Debug1|154,{
+001-1.gat,41,29,0|script|Debug1|154,
+{
callfunc "Debug";
end;
OnInit:
@@ -877,7 +879,8 @@ OnInit:
disablenpc "Debug1";
}
-009-1.gat,52,33,0|script|Debug2|154,{
+009-1.gat,52,33,0|script|Debug2|154,
+{
callfunc "Debug";
end;
OnInit:
@@ -885,7 +888,8 @@ OnInit:
disablenpc "Debug2";
}
-020-1.gat,75,85,0|script|Debug3|154,{
+020-1.gat,75,85,0|script|Debug3|154,
+{
callfunc "Debug";
end;
OnInit:
@@ -893,7 +897,8 @@ OnInit:
disablenpc "Debug3";
}
-botcheck.gat,50,28,0|script|Debug4|154,{
+botcheck.gat,50,28,0|script|Debug4|154,
+{
callfunc "Debug";
end;
OnInit:
diff --git a/world/map/npc/functions/evil_obelisk.txt b/world/map/npc/functions/evil_obelisk.txt
index f1447375..e3e40f79 100644
--- a/world/map/npc/functions/evil_obelisk.txt
+++ b/world/map/npc/functions/evil_obelisk.txt
@@ -1,4 +1,5 @@
-function|script|EvilObelisk|{
+function|script|EvilObelisk|
+{
mes "[Evil Obelisk]";
mes "(A mystical aura surrounds this stone. It seems to crave money.)";
next;
diff --git a/world/map/npc/functions/ferry.txt b/world/map/npc/functions/ferry.txt
index 43412026..a28f0511 100644
--- a/world/map/npc/functions/ferry.txt
+++ b/world/map/npc/functions/ferry.txt
@@ -1,6 +1,7 @@
// The ferry system
-function|script|Ferry|{
+function|script|Ferry|
+{
if (BaseLevel < 20)
goto L_LowerCost;
set @cost_tulimshar, 500;
diff --git a/world/map/npc/functions/game_rules.txt b/world/map/npc/functions/game_rules.txt
index 7cc2bd63..f735bf4a 100644
--- a/world/map/npc/functions/game_rules.txt
+++ b/world/map/npc/functions/game_rules.txt
@@ -1,6 +1,7 @@
//
-function|script|GameRules|{
+function|script|GameRules|
+{
set @read, 0;
menu
"English", L_English,
diff --git a/world/map/npc/functions/inn.txt b/world/map/npc/functions/inn.txt
index 85df4122..aad9e6c1 100644
--- a/world/map/npc/functions/inn.txt
+++ b/world/map/npc/functions/inn.txt
@@ -1,6 +1,7 @@
// INN
-function|script|Inn|{
+function|script|Inn|
+{
mes "[" + @npcname$ + "]";
mes "\"Would you like to rest? It's only " + @cost + " gp.\"";
next;
diff --git a/world/map/npc/functions/lockpicking.txt b/world/map/npc/functions/lockpicking.txt
index 1605431d..638e3914 100644
--- a/world/map/npc/functions/lockpicking.txt
+++ b/world/map/npc/functions/lockpicking.txt
@@ -4,8 +4,8 @@
// The player has to find the good number of times to hit a pin
//-----------------------------------------------------------------------------
-function|script|LockPicking|{
-
+function|script|LockPicking|
+{
set @lock_picking_success, 0;
setarray @pins, rand(1,3), rand(1,3), rand(1,3);
goto L_StartLockPicking;
diff --git a/world/map/npc/functions/magic.txt b/world/map/npc/functions/magic.txt
index bbd242c8..9fcb5226 100644
--- a/world/map/npc/functions/magic.txt
+++ b/world/map/npc/functions/magic.txt
@@ -10,8 +10,8 @@
// ------------------------------------------------------------
// Gain initial magic skill
// ------------------------------------------------------------
-function|script|MagicGainBasic|{
-
+function|script|MagicGainBasic|
+{
set MAGIC_FLAGS, MAGIC_FLAGS | MFLAG_DRANK_POTION;
close;
@@ -20,7 +20,8 @@ function|script|MagicGainBasic|{
// ------------------------------------------------------------
// Initialise Menu for selecting a choice of things to ask about
// ------------------------------------------------------------
-function|script|MagicTalkOptionsSetup|{
+function|script|MagicTalkOptionsSetup|
+{
set @QQ_ELANORE, 1;
set @QQ_MANASEED, 2;
set @QQ_MANAPOTION, 4;
@@ -40,7 +41,8 @@ function|script|MagicTalkOptionsSetup|{
// ------------------------------------------------------------
-function|script|MagicTalkMenu|{
+function|script|MagicTalkMenu|
+{
setarray @choice$, "", "", "", "", "", "", "", "", "", "";
set @choices_nr, 0;
setarray @choice_idx, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
@@ -159,7 +161,8 @@ L_Q_post_astralsoul:
// @SUP_name$ name of the skill to level up
// @SUP_xp # of experience points to award if the level up succeeds
// ------------------------------------------------------------
-function|script|SkillUp|{
+function|script|SkillUp|
+{
if (getskilllv(@SUP_id) >= @SUP_lvl)
goto L_shortcut;
diff --git a/world/map/npc/functions/mob_points.txt b/world/map/npc/functions/mob_points.txt
index 2f89010e..aae10658 100644
--- a/world/map/npc/functions/mob_points.txt
+++ b/world/map/npc/functions/mob_points.txt
@@ -1,6 +1,7 @@
// Mob points
-function|script|MobPoints|{
+function|script|MobPoints|
+{
if (@mobID < 1002) return;
setarray @points,
diff --git a/world/map/npc/functions/process_equip.txt b/world/map/npc/functions/process_equip.txt
index b8da56e8..4b8e1ccd 100644
--- a/world/map/npc/functions/process_equip.txt
+++ b/world/map/npc/functions/process_equip.txt
@@ -1,6 +1,7 @@
//
-function|script|ProcessEquip|{
+function|script|ProcessEquip|
+{
set @head, getequipid(equip_head);
set @torso, getequipid(equip_torso);
set @legs, getequipid(equip_legs);
diff --git a/world/map/npc/functions/slot_machine.txt b/world/map/npc/functions/slot_machine.txt
index a8ab7224..4081adca 100644
--- a/world/map/npc/functions/slot_machine.txt
+++ b/world/map/npc/functions/slot_machine.txt
@@ -1,6 +1,7 @@
//
-function|script|SlotMachine|{
+function|script|SlotMachine|
+{
mes "Pull the lever...";
next;
menu
diff --git a/world/map/npc/functions/soul_menhir.txt b/world/map/npc/functions/soul_menhir.txt
index a8d3f909..315c89d4 100644
--- a/world/map/npc/functions/soul_menhir.txt
+++ b/world/map/npc/functions/soul_menhir.txt
@@ -1,4 +1,5 @@
-function|script|SoulMenhir|{
+function|script|SoulMenhir|
+{
mes "[Soul Menhir]";
mes "(A mystical aura surrounds this stone. You feel mysteriously attracted to it. Something tells you to touch it. What do you do?)";
next;
diff --git a/world/map/npc/functions/strangerquiz.txt b/world/map/npc/functions/strangerquiz.txt
index 4901ca81..6290dbab 100644
--- a/world/map/npc/functions/strangerquiz.txt
+++ b/world/map/npc/functions/strangerquiz.txt
@@ -1,5 +1,6 @@
-function|script|StrangerQuiz|{
+function|script|StrangerQuiz|
+{
// param @quizparam$$
// return in @quizanswer$
set @quizanswer$, getspellinvocation(@quizparam$);
diff --git a/world/map/npc/functions/time.txt b/world/map/npc/functions/time.txt
index 2527b853..a8236cb4 100644
--- a/world/map/npc/functions/time.txt
+++ b/world/map/npc/functions/time.txt
@@ -6,7 +6,8 @@
// output @ts_date$ "yyyy-mm-dd"
// output @ts_time$ "hh:mm:ss"
-function|script|time_stamp|{
+function|script|time_stamp|
+{
// local variables
// if there is reasonable demand, these might be exported
// (that is what the builtin is likely to do)
diff --git a/world/map/npc/functions/water_bottle.txt b/world/map/npc/functions/water_bottle.txt
index e88c5965..e65009da 100644
--- a/world/map/npc/functions/water_bottle.txt
+++ b/world/map/npc/functions/water_bottle.txt
@@ -1,6 +1,7 @@
// Fills empty bottles with water
-function|script|WaterBottle|{
+function|script|WaterBottle|
+{
set @COST_PER_BOTTLE, 150;
mes "How many empty bottles do you want to fill with water? It costs " + @COST_PER_BOTTLE + "gp per bottle.";