diff options
author | Jesusaves <cpntb1@ymail.com> | 2018-12-31 19:09:49 -0200 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2018-12-31 19:09:49 -0200 |
commit | 2f16d8b8c34257733180058c82415d395ea27474 (patch) | |
tree | 09a7e0b77ba01cfade269593ee88c02122fd5976 /npc/functions | |
parent | f4ac215d94dc2c5eb58675f79e0be87932f78cc3 (diff) | |
parent | 28fdcc18ff9c80fea20414482ecc7c74fd0bf9cf (diff) | |
download | serverdata-jesusalva/GuidedTour.tar.gz serverdata-jesusalva/GuidedTour.tar.bz2 serverdata-jesusalva/GuidedTour.tar.xz serverdata-jesusalva/GuidedTour.zip |
Merge branch 'master' into jesusalva/GuidedTourjesusalva/GuidedTour
Diffstat (limited to 'npc/functions')
-rw-r--r-- | npc/functions/fishing.txt | 4 | ||||
-rw-r--r-- | npc/functions/generic-text.txt | 120 | ||||
-rw-r--r-- | npc/functions/main.txt | 4 | ||||
-rw-r--r-- | npc/functions/npcmove.txt | 2 | ||||
-rw-r--r-- | npc/functions/npcmovegraph.txt | 4 | ||||
-rw-r--r-- | npc/functions/quest-debug/036-HurnscaldQuests_Hinnak.txt | 32 | ||||
-rw-r--r-- | npc/functions/quest-debug/037-HurnscaldQuests_Soup.txt | 32 | ||||
-rw-r--r-- | npc/functions/quest-debug/038-HurnscaldQuests_Inspector.txt | 41 | ||||
-rw-r--r-- | npc/functions/quest-debug/039-HurnscaldQuests_ForestBow.txt | 42 | ||||
-rw-r--r-- | npc/functions/quest-debug/040-HurnscaldQuests_WoodenShield.txt | 37 |
10 files changed, 311 insertions, 7 deletions
diff --git a/npc/functions/fishing.txt b/npc/functions/fishing.txt index f1782f3e..dcf4ac02 100644 --- a/npc/functions/fishing.txt +++ b/npc/functions/fishing.txt @@ -183,7 +183,7 @@ function script fishing { .@fish_id = relative_array_random(getvariableofnpc(.fish_ids[0], .@npc$)); // RNG to obtain a fish - if (rand(gettimetick(0) - @fishing_tick) <= .@pull_rand_max + (100 * @FISHING_BOOSTER[getnpcid(0)])) + if (rand(gettimetick(0) - @fishing_tick) <= .@pull_rand_max + (100 * @FISHING_BOOSTER[getnpcid()])) { specialeffect(.@success_fx, SELF, playerattached()); // event success @@ -244,7 +244,7 @@ function script fishing { if (getvariableofnpc(.bait_ids[.@i], .@npc$) == .@bait) { .@bait_c = true; - @FISHING_BOOSTER[getnpcid(0)] = getvariableofnpc(.bait_ids[.@i + 1], .@npc$); + @FISHING_BOOSTER[getnpcid()] = getvariableofnpc(.bait_ids[.@i + 1], .@npc$); break; } } diff --git a/npc/functions/generic-text.txt b/npc/functions/generic-text.txt new file mode 100644 index 00000000..ede6e954 --- /dev/null +++ b/npc/functions/generic-text.txt @@ -0,0 +1,120 @@ +// Evol functions. +// Authors: +// gumi +// Description: +// text register + +function script generic { + .@flags = getarg(0, 1); + + .@villager = (1 << 0); + .@old = (1 << 1); + .@kid = (1 << 2); + .@sailor = (1 << 3); + .@busy = (1 << 4); + .@tired = (1 << 5); + .@angry = (1 << 6); + .@legion = (1 << 7); + .@crazy = (1 << 8); + + if (.@flags == 0) + return l("I'm sorry, I can't talk right now."); + + if (.@flags & .@villager) + { + setarray(.@array$[.@count], + l("It is a sunny day, don't you think?"), + l("I just want to live my life in peace."), + l("Isn't this place pretty? I love hanging out here!")); + + .@count += 3; + } + + if (.@flags & .@old) + { + setarray(.@array$[.@count], + l("Come closer dear, I can't hear you."), + l("Hmm... where did I put it again?"), + l("I miss the good old days.")); + + .@count += 3; + } + + if (.@flags & .@kid) + { + setarray(.@array$[.@count], + l("Mommy doesn't want me to talk to strangers.")); + + .@count += 1; + } + + if (.@flags & .@sailor) + { + setarray(.@array$[.@count], + l("So finally someone has came to visit me?"), + l("A-hoy matey!")); + + .@count += 2; + } + + if (.@flags & .@busy) + { + setarray(.@array$[.@count], + l("Can't talk right now."), + l("Can't you see I'm busy?"), + l("Come back later."), + l("I'm a little busy right now.")); + + .@count += 4; + } + + if (.@flags & .@tired) + { + setarray(.@array$[.@count], + l("I had a long day, come back tomorrow."), + l("I need to rest."), + l("*snores*")); + + .@count += 3; + } + + if (.@flags & .@angry) + { + setarray(.@array$[.@count], + l("Go pester someone else."), + l("I don't feel like talking to you."), + l("Stop wasting my time."), + l("Go fly a kite"), + l("Not in the mood to chat."), + l("Give me some space."), + l("Can you please go away?")); + + .@count += 7; + } + + if (.@flags & .@legion) + { + setarray(.@array$[.@count], + l("My breath smells bad."), + l("Don't distract me, I have to stay alert."), + l("Can't talk right now, I'm on patrol duty."), + l("I can't stay here and talk all day. I have a job to do."), + l("Keep moving."), + l("So you think you're tough? A warrior must also be loyal and patient."), + l("Practice! There are no secrets to becoming a warrior."), + l("There is no honor in fighting a weak opponent.")); + + .@count += 8; + } + + if (.@flags & .@crazy) + { + setarray(.@array$[.@count], + l("Do I look like a tree? I feel like one."), + l("What're you looking at?!")); + + .@count += 2; + } + + return .@array$[rand(.@count)]; +} diff --git a/npc/functions/main.txt b/npc/functions/main.txt index 97c34702..b620be0c 100644 --- a/npc/functions/main.txt +++ b/npc/functions/main.txt @@ -183,9 +183,9 @@ function script npctalkonce { set(getvariableofnpc(.talk_lock, strnpcinfo(NPC_NAME_UNIQUE)), gettimetick(2) + getarg(1, 1)); break; default: - if (gettimetick(2) <= @NPC_TALK_LOCK[getnpcid(0)]) + if (gettimetick(2) <= @NPC_TALK_LOCK[getnpcid()]) return false; - @NPC_TALK_LOCK[getnpcid(0)] = gettimetick(2) + getarg(1, 1); + @NPC_TALK_LOCK[getnpcid()] = gettimetick(2) + getarg(1, 1); } // talk mechanism diff --git a/npc/functions/npcmove.txt b/npc/functions/npcmove.txt index eb6acded..612ab036 100644 --- a/npc/functions/npcmove.txt +++ b/npc/functions/npcmove.txt @@ -47,7 +47,7 @@ function script domoveaction { } else if (.@cmd$ == "emote") { - unitemote getnpcid(0), getvariableofnpc(.movepathx[.@pos], strnpcinfo(3)); + unitemote getnpcid(), getvariableofnpc(.movepathx[.@pos], strnpcinfo(3)); return 2; } else if (.@cmd$ == "class") diff --git a/npc/functions/npcmovegraph.txt b/npc/functions/npcmovegraph.txt index b26f9a16..d03f15c5 100644 --- a/npc/functions/npcmovegraph.txt +++ b/npc/functions/npcmovegraph.txt @@ -115,7 +115,7 @@ function script execmovecmd { } else if (.@cmd$[0] == "emote") { - unitemote getnpcid(0), atoi(.@cmd$[1]); + unitemote getnpcid(), atoi(.@cmd$[1]); } else if (.@cmd$[0] == "class") { @@ -137,7 +137,7 @@ function script execmovecmd { .@x = getvariableofnpc(.movepos_x1[.@pos], strnpcinfo(3)); .@y = getvariableofnpc(.movepos_y1[.@pos], strnpcinfo(3)); if (getstrlen(.@map$) > 0) - unitwarp getnpcid(0), .@map$, .@x, .@y; + unitwarp getnpcid(), .@map$, .@x, .@y; else movenpc strnpcinfo(3), .@x, .@y; set getvariableofnpc(.movepos, strnpcinfo(3)), .@pos; diff --git a/npc/functions/quest-debug/036-HurnscaldQuests_Hinnak.txt b/npc/functions/quest-debug/036-HurnscaldQuests_Hinnak.txt new file mode 100644 index 00000000..61dc294e --- /dev/null +++ b/npc/functions/quest-debug/036-HurnscaldQuests_Hinnak.txt @@ -0,0 +1,32 @@ +// Hinnak quest debug +// Author: +// gumi + +function script QuestDebug36 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "HurnscaldQuests_Hinnak"; + mes "---"; + mes l("Quest state: @@, @@", + getq(HurnscaldQuests_Hinnak), + getq2(HurnscaldQuests_Hinnak)); + next; + + GenericQuestDebug HurnscaldQuests_Hinnak, + l("Cannot do the quest"), 0, + l("Can do the quest"), 1, + l("Hinnak asked for help"), 2, + l("Helped Hinnak"), 3; + + switch (@menuret) + { + case 0: + case 1: + case 2: setq HurnscaldQuests_Hinnak, getq(HurnscaldQuests_Hinnak), 0; break; + default: if (@menuret < 0) return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/037-HurnscaldQuests_Soup.txt b/npc/functions/quest-debug/037-HurnscaldQuests_Soup.txt new file mode 100644 index 00000000..43eba0d6 --- /dev/null +++ b/npc/functions/quest-debug/037-HurnscaldQuests_Soup.txt @@ -0,0 +1,32 @@ +// Mikhail & Bernard quest debug +// Author: +// gumi + +function script QuestDebug37 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "HurnscaldQuests_Soup"; + mes "---"; + mes l("Quest state: @@", + getq(HurnscaldQuests_Soup)); + next; + + GenericQuestDebug HurnscaldQuests_Soup, + l("Cannot do the quest"), 0, + l("Can do the quest"), 1, + l("Bernard wants roasted maggot"), 2, + l("brought maggot"), 3, + l("Bernard wants maggot slime"), 4, + l("brought maggot slime"), 5, + l("Mikhail needs maggot slime"), 6, + l("brought maggot slime"), 7; + + if (@menuret < 0) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/038-HurnscaldQuests_Inspector.txt b/npc/functions/quest-debug/038-HurnscaldQuests_Inspector.txt new file mode 100644 index 00000000..053f085e --- /dev/null +++ b/npc/functions/quest-debug/038-HurnscaldQuests_Inspector.txt @@ -0,0 +1,41 @@ +// Inspector quest debug +// Author: +// gumi + +function script QuestDebug38 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "HurnscaldQuests_Inspector"; + mes "---"; + mes l("Quest state: @@", + getq(HurnscaldQuests_Inspector)); + next; + + GenericQuestDebug HurnscaldQuests_Inspector, + l("Cannot do the quest"), 0, + l("Can do the quest"), 1, + l("Talked to Inspector (1)"), 2, + l("Talked to Old Woman (1)"), 3, + l("Talked to Old Woman (2)"), 4, + l("Talked to Inspector (2)"), 5, + l("Talked to Troupe Leader (1)"), 6, + l("Talked to Inspector (3)"), 7, + l("Talked to Old Man"), 8, + l("Talked to Old Woman (3)"), 9, + l("Talked to Inspector (4)"), 10, + l("Talked to Old Woman (4)"), 11, + l("Talked to Malek"), 12, + l("Searched the bookcase"), 13, + l("Talked to Inspector (5)"), 14, + l("Talked to Troupe Leader (2)"), 15, + l("Talked to Inspector (6)"), 16; + + if (@menuret < 0) + { + return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/039-HurnscaldQuests_ForestBow.txt b/npc/functions/quest-debug/039-HurnscaldQuests_ForestBow.txt new file mode 100644 index 00000000..c6a61a1b --- /dev/null +++ b/npc/functions/quest-debug/039-HurnscaldQuests_ForestBow.txt @@ -0,0 +1,42 @@ +// Jack Lumber quest debug +// Author: +// gumi + +function script QuestDebug39 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "HurnscaldQuests_ForestBow"; + mes "---"; + mes l("Quest state: @@", getq(HurnscaldQuests_ForestBow)); + mes "---"; + mes l("Related quests:"); + mes "HurnscaldQuests_WoodenShield: " + getq(HurnscaldQuests_WoodenShield); + next; + + GenericQuestDebug HurnscaldQuests_ForestBow, + menuimage("actions/manage", l("Debug Wooden Shield")), -1, + l("Cannot do the quest"), 0, + l("Can do the quest"), 1, + l("Alan wants to ask Jack"), 2, + l("Jack explained problem"), 3, + l("Alan asks to find wood"), 4, + l("Found perfect wood"), 5, + l("Got the bow"), 6; + + switch (@menuret) + { + case -1: callfunc "QuestDebug40"; break; + case 0: + case 1: + case 2: + case 3: + case 4: setq(HurnscaldQuests_WoodenShield, 0); break; + case 5: + case 6: setq(HurnscaldQuests_WoodenShield, max(1, getq(HurnscaldQuests_WoodenShield))); break; + default: if (@menuret < 0) return; + } + + } while (1); +} diff --git a/npc/functions/quest-debug/040-HurnscaldQuests_WoodenShield.txt b/npc/functions/quest-debug/040-HurnscaldQuests_WoodenShield.txt new file mode 100644 index 00000000..05d08130 --- /dev/null +++ b/npc/functions/quest-debug/040-HurnscaldQuests_WoodenShield.txt @@ -0,0 +1,37 @@ +// Jack Lumber quest debug +// Author: +// gumi + +function script QuestDebug40 { + do + { + clear; + setnpcdialogtitle l("Quest debug"); + mes "HurnscaldQuests_WoodenShield"; + mes "---"; + mes l("Quest state: @@", getq(HurnscaldQuests_WoodenShield)); + mes "---"; + mes l("Related quests:"); + mes "HurnscaldQuests_ForestBow: " + getq(HurnscaldQuests_ForestBow); + next; + + GenericQuestDebug HurnscaldQuests_WoodenShield, + menuimage("actions/manage", l("Debug Forest Bow")), -1, + l("Cannot do the quest"), 0, + l("Can do the quest"), 1, + l("Jack proposes shield"), 2, + l("Accepted the quest"), 3, + l("Got the shield"), 4; + + switch (@menuret) + { + case -1: callfunc "QuestDebug39"; break; + case 1: + case 2: + case 3: + case 4: setq(HurnscaldQuests_ForestBow, max(5, getq(HurnscaldQuests_ForestBow))); break; + default: if (@menuret < 0) return; + } + + } while (1); +} |