diff options
Diffstat (limited to 'world/map/npc/functions')
-rw-r--r-- | world/map/npc/functions/banker.txt | 8 | ||||
-rw-r--r-- | world/map/npc/functions/barber.txt | 6 | ||||
-rw-r--r-- | world/map/npc/functions/clear_vars.txt | 10 | ||||
-rw-r--r-- | world/map/npc/functions/dailyquest.txt | 7 | ||||
-rwxr-xr-x | world/map/npc/functions/debug.txt | 19 | ||||
-rw-r--r-- | world/map/npc/functions/evil_obelisk.txt | 3 | ||||
-rw-r--r-- | world/map/npc/functions/ferry.txt | 18 | ||||
-rw-r--r-- | world/map/npc/functions/game_rules.txt | 3 | ||||
-rw-r--r-- | world/map/npc/functions/inn.txt | 3 | ||||
-rw-r--r-- | world/map/npc/functions/lockpicking.txt | 4 | ||||
-rw-r--r-- | world/map/npc/functions/magic.txt | 13 | ||||
-rw-r--r-- | world/map/npc/functions/mob_points.txt | 3 | ||||
-rw-r--r-- | world/map/npc/functions/process_equip.txt | 3 | ||||
-rw-r--r-- | world/map/npc/functions/slot_machine.txt | 3 | ||||
-rw-r--r-- | world/map/npc/functions/soul_menhir.txt | 3 | ||||
-rw-r--r-- | world/map/npc/functions/strangerquiz.txt | 3 | ||||
-rw-r--r-- | world/map/npc/functions/time.txt | 3 | ||||
-rw-r--r-- | world/map/npc/functions/water_bottle.txt | 3 |
18 files changed, 78 insertions, 37 deletions
diff --git a/world/map/npc/functions/banker.txt b/world/map/npc/functions/banker.txt index 863f3ce1..8ecb85fb 100644 --- a/world/map/npc/functions/banker.txt +++ b/world/map/npc/functions/banker.txt @@ -1,8 +1,10 @@ // -function|script|Banker|{ - - if (BankAccount > 0) callsub S_MoveAccount; +function|script|Banker|, +{ + if (BankAccount == 0) + goto L_Start; + callsub S_MoveAccount; L_Start: mes "[" + @npcname$ + "]"; diff --git a/world/map/npc/functions/barber.txt b/world/map/npc/functions/barber.txt index 477b4a7b..dc7f0329 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..1aa84d2b 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..9b9d626e 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..5bf82356 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..0875abb5 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 dd3e83d8..0b66f68e 100644 --- a/world/map/npc/functions/ferry.txt +++ b/world/map/npc/functions/ferry.txt @@ -1,10 +1,12 @@ // The ferry system -function|script|Ferry|{ +function|script|Ferry|, +{ if (BaseLevel < 20) goto L_LowerCost; set @cost_tulimshar, 500; set @cost_hurnscald, 500; + set @cost_nivalis, 500; L_Start: set @cost_candor, 1500; @@ -19,6 +21,7 @@ L_PlainMenu: menu "Tulimshar (" + @cost_tulimshar + "GP)", L_Tulimshar, "Hurnscald (" + @cost_hurnscald + "GP)", L_Hurnscald, + "Nivalis (" + @cost_nivalis + "GP)", L_Nivalis, "Nevermind", -; goto L_Close; @@ -26,6 +29,7 @@ L_MenuWithCandor: menu "Tulimshar (" + @cost_tulimshar + "GP)", L_Tulimshar, "Hurnscald (" + @cost_hurnscald + "GP)", L_Hurnscald, + "Nivalis (" + @cost_nivalis + "GP)", L_Nivalis, "Candor (" + @cost_candor + "GP)", L_Candor, "Nevermind", -; goto L_Close; @@ -50,6 +54,16 @@ L_Hurnscald: warp "008-1.gat", 137, 64; goto L_Close; +L_Nivalis: + if (@loc == DOCK_nivalis) + goto L_AlreadyThere; + if (Zeny < @cost_nivalis) + goto L_NotEnoughGP; + + set Zeny, Zeny - @cost_nivalis; + warp "031-1.gat", 95, 109; + goto L_Close; + L_Candor: if (@loc == DOCK_candor) goto L_AlreadyThere; @@ -71,12 +85,14 @@ L_NotEnoughGP: L_LowerCost: set @cost_tulimshar, 250; set @cost_hurnscald, 250; + set @cost_nivalis, 250; goto L_Start; L_Close: set @cost_tulimshar, 0; set @cost_hurnscald, 0; set @cost_candor, 0; + set @cost_nivalis, 0; set @loc, 0; close; } diff --git a/world/map/npc/functions/game_rules.txt b/world/map/npc/functions/game_rules.txt index 7cc2bd63..caf13cb1 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..271a4652 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..dc05fc53 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..a1faea94 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 99a71061..e4deec13 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..1e93320a 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..5d7e1ee6 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..02907210 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..211e7e4b 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..5f728639 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..f24f2bc5 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."; |