SHARE
TWEET

Untitled

a guest Jul 13th, 2018 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2.     Made by DarkShadow44
  3.     Discussion and updates on: http:--www.mobtalker.net/forums/viewtopic.php?f=15&t=29
  4.     Please don't redistribute, just link to there.
  5.     If you want to use this script as base for yours you may do that, but please copy only the basics, not the story.
  6.     I don't want someone to extend or change it a bit and give it away as his/hers.
  7. ]]
  8.  
  9. function CONFIG()
  10.     CurrentLanguage = Languages.Eng;
  11.     DEBUG = false;
  12.     DEBUG_SkipIntro = false;
  13.     DEBUG_DayChooser = true;
  14.     STARTPOS = 0;
  15.     useBetterLog = true;
  16. end
  17.  
  18. function TEST()
  19.     --askQuestion(Creeper_All_QuestionsGeneric);
  20. end
  21.  
  22. function ShowDayChooser()
  23.     SAY("<ScriptInfo>", "Choose a day to start at.");
  24.    
  25.     local maxStory = GetMaxStory();
  26.    
  27.     local tableDisplay = {};
  28.     local i = 0;
  29.     while(i <= maxStory) do
  30.         tableDisplay[i+1] = ""..i;
  31.         i = i + 1;
  32.     end
  33.     local choice = PromtChoiceStringsInt(tableDisplay, 5) - 1;
  34.     return choice;
  35. end
  36.  
  37. function GetMaxStory()
  38.     local index = 0;
  39.     while(List_Func_Story[index] ~= nil) do
  40.         index = index + 1;
  41.     end
  42.     return index-1;
  43. end
  44.  
  45. function initGenerics()
  46.     player = DCLib.Player.GetName();
  47.     List_Func_Story = {};
  48.     List_Func_Story_Sub = {};
  49.     registerStory();
  50.    
  51.     Languages = {};
  52.     Languages.Eng = 0;
  53.     Languages.Ger = 1;
  54.    
  55. Languages.Rus = 2;
  56.     Wait = {};
  57.     Wait.Tired = 0;
  58.     Wait.JustLeft = 1;
  59.     Wait.Insulted = 2;
  60.     Wait.SomethingToDo = 3;
  61.     Wait.Depressed = 4;
  62.     Wait.Sleeping = 5;
  63.     Wait.NotFound = 404;
  64.    
  65.     CONFIG();
  66.    
  67.     if(not TableSaveGenerics) then
  68.         TableSaveGenerics = {};
  69.         TableSaveGenerics["HatedPersons"] = {};
  70.         TableSaveGenerics["KnownPersons"] = {};
  71.         if(DCLib.Player.GetGameMode() == "creative") then
  72.             if(DEBUG_DayChooser) then
  73.                 TableSaveGenerics["DoScriptChooser"] = true;
  74.                 STARTPOS = ShowDayChooser();
  75.                 TableSaveGenerics["KnownPersons"][player] = true;
  76.                 TableSaveGenerics["DoScriptChooser"] = false;
  77.             end
  78.         end
  79.         TableSaveGenerics["NextStory"] = STARTPOS;
  80.         TableSaveGenerics["NextSubStory"] = -1;
  81.     end
  82.     if(TableSaveGenerics["DoScriptChooser"]) then
  83.         STARTPOS = ShowDayChooser();
  84.         TableSaveGenerics["KnownPersons"][player] = true;
  85.         TableSaveGenerics["DoScriptChooser"] = false;
  86.         TableSaveGenerics["NextStory"] = STARTPOS;
  87.         TableSaveGenerics["NextSubStory"] = -1;
  88.     end
  89. end
  90.  
  91. function Start_Generic()
  92.     if(DEBUG == true) then
  93.         LoveInc(1000);
  94.     end
  95.    
  96.     TEST();
  97.    
  98.     if(LoveGet() < -1) then
  99.         HatePlayer();
  100.     end
  101.    
  102.     if(TableSaveGenerics["HatedPersons"][player] ~= nil) then
  103.         RefusingToTalk();
  104.     else
  105.         if((TableSaveGenerics["KnownPersons"][player] == nil) and (DEBUG ~= true) and (DEBUG_SkipIntro ~= true)) then
  106.             FirstMet();
  107.         else
  108.             Story_Play();
  109.         end
  110.     end
  111. end
  112.  
  113. function Random(min, max)
  114.     return DCLib.Math.Random(min, max+1);
  115. end
  116.  
  117. function Rnd(new)
  118.     if(new) then
  119.         _rndLast = Random(0, 99);
  120.     end
  121.     return _rndLast;
  122. end
  123.  
  124. function Max(var1, var2)
  125.     return Math.Max(var1, var2);
  126. end
  127.  
  128. function Min(var1, var2)
  129.     return Math.Min(var1, var2);
  130. end
  131.  
  132. function HatePlayer()
  133.     TableSaveGenerics["HatedPersons"][player] = true;
  134. end
  135.  
  136. function TableDelete(tab, value)
  137.     keyFound = nil;
  138.     for key, val in next,tab do
  139.         if(val == value) then
  140.             keyFound = key;
  141.         end
  142.     end
  143.     if(keyFound ~=nil) then
  144.         tab[keyFound] = nil;
  145.     end
  146. end
  147.  
  148. function TableRandom(tab)
  149.     local tabCopy = {};
  150.     local index = 1;
  151.     for key, val in next,tab do
  152.         tabCopy[index] = val;
  153.         index = index + 1;
  154.     end
  155.     local rnd = DCLib.Table.Random(tabCopy);
  156.     return rnd;
  157. end
  158.  
  159.  
  160. function TableCopy(tab)
  161.      ret = {};
  162.     for key, val in next, tab do
  163.         ret[key] = val;
  164.     end
  165.     return ret;
  166. end
  167.  
  168. -- Table.Copy, deep copy
  169. if(not Table.Copy) then
  170.     Table.Copy = function(tab)
  171.         local ret = {};
  172.         for key, val in next, tab do
  173.             if(typeof(val) == "table") then
  174.                 ret[key] = Table.Copy(val);
  175.             else
  176.                 ret[key] = val;
  177.             end
  178.         end
  179.         return ret;
  180.     end
  181. end
  182.  
  183.  
  184.  
  185. function TableContains(tab, value)
  186.     for key, val in next, tab do
  187.         if(val == value) then
  188.             return true;
  189.         end
  190.     end
  191.     return false;
  192. end
  193.  
  194. function TableGetKey(tab, value)
  195.     for key, val in next, tab do
  196.         if(val == value) then
  197.             return key;
  198.         end
  199.     end
  200.     return nil;
  201. end
  202.  
  203. --returns count random entrys, in random order
  204. function TableGetNumRandom(tab, count)
  205.      ret = {};
  206.      item = nil;
  207.      found = 0;
  208.    
  209.     if(Table.Count(tab) < count) then
  210.         count = Table.Count(tab);
  211.     end
  212.    
  213.     tab = TableCopy(tab);
  214.    
  215.     while(found < count) do
  216.         item = TableRandom(tab);
  217.         TableDelete(tab, item);
  218.         ret[found] = item;
  219.         found = found + 1;
  220.     end
  221.    
  222.     return ret;
  223. end
  224.  
  225.  
  226. --Let's call it "a working PromtChoice"
  227. function PromtChoiceStrings(questions)
  228.     return PromtChoiceStringsEx(questions, Table.Count(questions));
  229. end
  230.  
  231. function PromtChoiceQuestion(questions, numPerPage)
  232.      askTable={};
  233.      pos=1;
  234.     for key, val in next, questions do
  235.         askTable[pos] = val["question"];
  236.         pos = pos + 1;
  237.     end
  238.    
  239.      string = PromtChoiceStringsEx(askTable, numPerPage);
  240.    
  241.      ret = nil;
  242.     for key, val in next, questions do
  243.         if(string == val["question"]) then
  244.             ret = val;
  245.         end
  246.         pos = pos + 1;
  247.     end
  248.    
  249.     return ret;
  250. end
  251.  
  252. --displays all strings and returns the position of the selected string in the array
  253. function PromtChoiceStringsInt(questions, numPerPage)
  254.      sel = PromtChoiceStringsEx(questions, numPerPage);
  255.      pos = 1;
  256.      found = false;
  257.     for key,val in next, questions do
  258.         if(val == sel) then
  259.             found = true;
  260.         else if(not found) then
  261.             pos = pos + 1;
  262.         end
  263.     end
  264.     return pos;
  265. end
  266.  
  267. function TableCopyLinear(tab)
  268.     ret = {};
  269.     num = 1;
  270.     for key, val in next, tab do
  271.         ret[num] = val;
  272.         num = num + 1;
  273.     end
  274.     return ret;
  275. end
  276.  
  277. function PromtChoiceStringsEx(questions, numPerPage)   
  278.     tab = TableCopyLinear(questions);
  279.     selectedIndex = ShowMenu(nil, tab);
  280.     return tab[selectedIndex];
  281.     --[[
  282.     if(Table.Count(questions) ~= 0) then
  283.         curTable = 1;
  284.         curTablePos = 1;
  285.         seperatedTables = {};
  286.         seperatedTables[1] = {};
  287.         for key, val in next, questions do
  288.             if(curTablePos <= numPerPage) then
  289.                 seperatedTables[curTable][curTablePos] = val;
  290.             else
  291.                 curTablePos = 1;
  292.                 curTable = curTable+1;
  293.                 seperatedTables[curTable] = {};
  294.                 seperatedTables[curTable][curTablePos] = val;
  295.             end
  296.             curTablePos  = curTablePos  + 1;
  297.         end
  298.        
  299.        
  300.          numTables = Table.Count(seperatedTables);
  301.          seperatedTablesMapped = {};
  302.          i=1;
  303.         while(i<=numTables) do
  304.              pos = 1;
  305.             seperatedTablesMapped[i] = {};
  306.            
  307.             if(i<numTables) then
  308.                 seperatedTablesMapped[i][pos] = "-->";
  309.                 pos = pos+1;
  310.             end
  311.            
  312.             if(i ~= 1) then
  313.                 seperatedTablesMapped[i][pos] = "<--";
  314.                 pos = pos+1;
  315.             end
  316.            
  317.             for key, val in next, seperatedTables[i] do
  318.                 seperatedTablesMapped[i][pos] = val;
  319.                 pos = pos+1;
  320.             end
  321.              i=i+1;
  322.         end
  323.          currentTable = 1;
  324.          ended = false;
  325.          selected = 1;
  326.         while(not ended) do
  327.             selected = PromtChoice2(seperatedTablesMapped[currentTable]);
  328.            
  329.             if(currentTable == 1) then -- first page
  330.                 if(numTables > 1 and selected == 1) then -- more pages available + first option selected
  331.                     currentTable = currentTable + 1;
  332.                 else
  333.                     ended = true;
  334.                 end
  335.             else if(currentTable == numTables) then -- last page
  336.                 if(selected == 1) then
  337.                     currentTable = currentTable - 1;
  338.                 else
  339.                     ended = true;
  340.                 end
  341.             else
  342.                 if(selected == 1) then
  343.                     currentTable = currentTable + 1;
  344.                 else if(selected == 2) then
  345.                     currentTable = currentTable - 1;
  346.                 else
  347.                     ended = true;
  348.                 end
  349.             end
  350.         end
  351.         return seperatedTablesMapped[currentTable][selected];
  352.     end
  353.     ]]
  354. end
  355.  
  356.  
  357. function PromtChoice2(questions) -- max: 7
  358.     if(Table.Count(questions) > 7) then
  359.         SAY("<ScriptError>", "In PromtChoice2, max numer of questions too big.");
  360.     end
  361.     clicked = nil;
  362.     if(Table.Count(questions) ~= 0) then
  363.         if(Table.Count(questions) < 8) then
  364.              toask = {};
  365.              curr = 1;
  366.             for key, val in next, questions do
  367.                 toask[curr] = val;
  368.                 curr = curr + 1;
  369.             end
  370.            
  371.             if(Table.Count(toask) == 1) then
  372.                 menu
  373.                     option toask[1]
  374.                         clicked = 1;
  375.                 end
  376.             else if(Table.Count(toask) == 2) then
  377.                 menu
  378.                     option toask[1]
  379.                         clicked = 1;
  380.                     option toask[2]
  381.                         clicked = 2;
  382.                 end
  383.             else if(Table.Count(toask) == 3) then
  384.                 menu
  385.                     option toask[1]
  386.                         clicked = 1;
  387.                     option toask[2]
  388.                         clicked = 2;
  389.                     option toask[3]
  390.                         clicked = 3;
  391.                 end
  392.             else if(Table.Count(toask) == 4) then
  393.                 menu
  394.                     option toask[1]
  395.                         clicked = 1;
  396.                     option toask[2]
  397.                         clicked = 2;
  398.                     option toask[3]
  399.                         clicked = 3;
  400.                     option toask[4]
  401.                         clicked = 4;
  402.                 end
  403.             else if(Table.Count(toask) == 5) then
  404.                 menu
  405.                     option toask[1]
  406.                         clicked = 1;
  407.                     option toask[2]
  408.                         clicked = 2;
  409.                     option toask[3]
  410.                         clicked = 3;
  411.                     option toask[4]
  412.                         clicked = 4;
  413.                     option toask[5]
  414.                         clicked = 5;
  415.                 end
  416.             else if(Table.Count(toask) == 6) then
  417.                 menu
  418.                     option toask[1]
  419.                         clicked = 1;
  420.                     option toask[2]
  421.                         clicked = 2;
  422.                     option toask[3]
  423.                         clicked = 3;
  424.                     option toask[4]
  425.                         clicked = 4;
  426.                     option toask[5]
  427.                         clicked = 5;
  428.                     option toask[6]
  429.                         clicked = 6;
  430.                 end
  431.             else if(Table.Count(toask) == 7) then
  432.                 menu
  433.                     option toask[1]
  434.                         clicked = 1;
  435.                     option toask[2]
  436.                         clicked = 2;
  437.                     option toask[3]
  438.                         clicked = 3;
  439.                     option toask[4]
  440.                         clicked = 4;
  441.                     option toask[5]
  442.                         clicked = 5;
  443.                     option toask[6]
  444.                         clicked = 6;
  445.                     option toask[7]
  446.                         clicked = 7;
  447.                 end
  448.             end
  449.         end
  450.     end
  451.     return clicked;
  452. end
  453.  
  454. function addQuestion(tab, tabDone, func, question, once)       
  455.     if(tabDone[question] ~= true) then
  456.         temp = {};
  457.         temp["func"] = func;
  458.         temp["question"] = question;
  459.         temp["once"] = once;
  460.         temp["done"] = tabDone;
  461.         tab[question] = temp;
  462.     end
  463. end
  464.  
  465. function askQuestionMob(questions, wasQuestion)
  466.     if(Table.Count(questions) == 0) then
  467.         if(wasQuestion == true) then
  468.             SAY(CurrentMobname, T("Ah forget it.", "Ach, vergiss es."));
  469.         else
  470.             SHOW(_CurrentMob, "Sad");
  471.             SAY(CurrentMobname, T("I can't remeber of anything left to tell you...", "Mir fällt nichts mehr ein was ich dir erzählen könnte..."));
  472.             SHOW(_CurrentMob, "Normal");
  473.         end
  474.         return -1;
  475.     end
  476.  
  477.     choice = TableRandom(questions);
  478.     if(choice["once"]) then
  479.         choice["done"][choice["question"]] = true;
  480.         TableDelete(questions, choice);
  481.     end
  482.    
  483.      waitReturned = choice["func"]();
  484.  
  485.     if(waitReturned ~= nil) then
  486.         WaitTomorrow(waitReturned);
  487.         return waitReturned;
  488.     end
  489.    
  490.     return -1;
  491. end
  492.  
  493. function askQuestion(questions)
  494.     return askQuestionEx(questions, 3); -- show 3 questions
  495. end
  496.  
  497. function askQuestionEx(questions, num)
  498.      questionsCopy = TableGetNumRandom(questions, num);
  499.     if(Table.Count(questionsCopy) == 0) then
  500.         return -2;
  501.     end
  502.      choice = PromtChoiceQuestion(questionsCopy, 3); -- show 3 quesitons per page
  503.     if(choice["once"]) then
  504.         choice["done"][choice["question"]] = true;
  505.         TableDelete(questions, choice);
  506.     end
  507.    
  508.      waitReturned = choice["func"]();
  509.  
  510.     if(waitReturned ~= nil) then
  511.         --WaitTomorrow(waitReturned);
  512.         return waitReturned;
  513.     end
  514.    
  515.     return -1;
  516. end
  517.  
  518. function WaitTomorrow(mode)
  519.     WaitTime(mode, 10000);
  520. end
  521.  
  522. function WaitTime(mode, time)
  523.     WaitSet(time);
  524.     TableSaveGenerics["Wait_Mode"] = mode;
  525. end
  526.  
  527. function WaitSet(ticks)
  528.     TableSaveGenerics["Wait_TimeStart"] = DCLib.World.GetTime();
  529.     TableSaveGenerics["Wait_TimeTicks"] = ticks;
  530. end
  531.  
  532. function WaitReady()
  533.     if(TableSaveGenerics["Wait_TimeTicks"] == nil) then
  534.         return true;
  535.     end
  536.    
  537.     if(DCLib.World.GetTime() < TableSaveGenerics["Wait_TimeStart"]) then
  538.         SAY(T("<ScriptWarning>", "ScriptWarnung>"), T("Invalid Time - Resetting wait timer to keep things running. Did you change the world time ?", "Ungültige Zeit - Timer wird zurückgesetzt um das Script am Laufen zu halten. Wurde die Weltzeit geändert ?"));
  539.         WaitSet(TableSaveGenerics["Wait_TimeTicks"], 10000);
  540.         return false;
  541.     end
  542.     return DCLib.World.GetTime() >= TableSaveGenerics["Wait_TimeStart"] + TableSaveGenerics["Wait_TimeTicks"];
  543. end
  544.  
  545. function MathAbs(num)
  546.     if(num < 0) then
  547.         num = -num;
  548.     end
  549.     return num;
  550. end
  551.  
  552. function GetAge()
  553.     if(TableSaveGenerics["Age"] ~= nil) then
  554.         return TableSaveGenerics["Age"];
  555.     end
  556.     return AskAge();
  557. end
  558.  
  559. function AskAge() --!!! SaveTable["Age"], ask in beginning, or when unused bevore NSFW scenes
  560.     SHOW(_CurrentMob, "Normal");
  561.     SAY(CurrentMobname, T("By the way, how old are you ?", "So nebenbei, wie alt bist du eigentlich ?"));
  562.      selected = "";
  563.    
  564.      finished = false;
  565.      age = -1;
  566.      loveDec = 1;
  567.    
  568.     while(not finished) do
  569.         menu
  570.             option "0-9"
  571.                 menu
  572.                     option "0-4"
  573.                         selected = PromtChoiceStrings({"0", "1", "2", "3", "4"});
  574.                     option "5-9"
  575.                         selected = PromtChoiceStrings({"5", "6", "7", "8", "9"});
  576.                 end
  577.             option "10-30"
  578.                 menu
  579.                     option "10-15"
  580.                         selected = PromtChoiceStrings({"10", "11", "12", "13", "14", "15"});
  581.                     option "16-20"
  582.                         selected = PromtChoiceStrings({"16", "17", "18", "19", "20"});
  583.                     option "21-25"
  584.                         selected = PromtChoiceStrings({"21", "22", "23", "24", "25"});
  585.                     option "26-30"
  586.                         selected = PromtChoiceStrings({"26", "27", "28", "29", "30"});
  587.                 end
  588.             option "31-60"
  589.                 menu
  590.                     option "31-35"
  591.                         selected = PromtChoiceStrings({"31", "32", "33", "34", "35"});
  592.                     option "36-40"
  593.                         selected = PromtChoiceStrings({"36", "37", "38", "39", "40"});
  594.                     option "41-45"
  595.                         selected = PromtChoiceStrings({"41", "42", "43", "44", "45"});
  596.                     option "46-50"
  597.                         selected = PromtChoiceStrings({"46", "47", "48", "49", "50"});
  598.                     option "51-55"
  599.                         selected = PromtChoiceStrings({"51", "52", "53", "54", "55"});
  600.                     option "56-60"
  601.                         selected = PromtChoiceStrings({"56", "57", "58", "59", "60"});
  602.                 end
  603.             option "> 60"
  604.                 menu
  605.                     option "61-65"
  606.                         selected = PromtChoiceStrings({"61", "62", "63", "64", "65"});
  607.                     option "66-70"
  608.                         selected = PromtChoiceStrings({"66", "67", "68", "69", "70"});
  609.                     option "71-75"
  610.                         selected = PromtChoiceStrings({"71", "72", "73", "74", "75"});
  611.                     option "76-80"
  612.                         selected = PromtChoiceStrings({"76", "77", "78", "79", "80"});
  613.                     option "> 80"
  614.                         menu
  615.                             option "81-85"
  616.                                 selected = PromtChoiceStrings({"81", "82", "83", "84", "85"});
  617.                             option "86-90"
  618.                                 selected = PromtChoiceStrings({"86", "87", "88", "89", "90"});
  619.                             option "91-95"
  620.                                 selected = PromtChoiceStrings({"91", "92", "93", "94", "95"});
  621.                             option "96-99"
  622.                                 selected = PromtChoiceStrings({"96", "97", "98", "99"});
  623.                         end
  624.                 end
  625.         end
  626.         age = toNumber(selected);
  627.         if((age > 60) or (age < 10)) then
  628.             SHOW(_CurrentMob, "Happy");
  629.             SAY(CurrentMobname, T("Sure you are ", "Sicher dass du ")..age..T(" years old ?", " Jahre alt bist ?"));
  630.             if(age < 10) then
  631.                 SHOW(_CurrentMob, "Angry");
  632.                 LoveDec(loveDec);
  633.                 loveDec = loveDec + 2;
  634.                 SAY(CurrentMobname, T("Please be honest, you CANNOT be that young...", "Bitte sei ehrlich du KANNST nicht so jung sein..."));
  635.                 SAY(CurrentMobname, T("You wouldn't even be here if you were...", "Sonst wärst du gar nicht hier..."));
  636.             end
  637.         else
  638.             finished = true;
  639.             SHOW(_CurrentMob, "Normal");
  640.             SAY(CurrentMobname, T("Ah ok.", "Ah, Ok."));
  641.             if(age == 21) then
  642.                 SHOW(_CurrentMob, "Happy");
  643.                 SAY(CurrentMobname, T("Hey, I am also 21 years old.", "Ich bin auch 21 Jahre alt."));
  644.                 SAY(CurrentMobname, T("That's cool, we are exactly the same age!", "Ist ja cool, wir haben das selbe Alter!"));
  645.             else
  646.                 SAY(CurrentMobname, T("So you are ", "Also bist du ")..age..T(" years old.", " Jahre alt"));
  647.                 SHOW(_CurrentMob, "Happy");
  648.                 SAY(CurrentMobname, T("I am 21.", "Ich bin 21."));
  649.                 if(MathAbs(age-21) <2) then
  650.                     SAY(CurrentMobname, T("Cool then we are nearly the same age.", "Cool, dann sind wir ja fast gleichalt!"));
  651.                 end
  652.                
  653.             end
  654.         end
  655.     end
  656.  
  657.     SHOW(_CurrentMob, "Normal");
  658.     TableSaveGenerics["Age"] = age;
  659.     return age;
  660.  
  661. end
  662.  
  663.  
  664. function Story_Generic_JustLeft()
  665.     SHOW(_CurrentMob, "Sad");
  666.     SAY(CurrentMobname, T("Why did you just went away yesterday... ?", "Warum bist du gestern einfach so gegangen... ?"));
  667.     LoveDec(4);
  668. end
  669.  
  670. function Story_Generic_Busy()
  671.     if(TableSaveGenerics["Wait_Mode"] == Wait.Tired) then
  672.         SHOW(_CurrentMob, "Tired");
  673.         SAY(CurrentMobname, T("I'm tired...", "Ich bin müde..."));
  674.     else if(TableSaveGenerics["Wait_Mode"] == Wait.JustLeft) then
  675.         SAY(CurrentMobname, T("*She is busy*", "*Sie ist beschäftigt*"));
  676.     else if(TableSaveGenerics["Wait_Mode"] == Wait.Insulted) then
  677.         SAY(CurrentMobname, T("I don't want to talk right now...", "Ich will jetzt nicht mit dir reden..."));
  678.     else if(TableSaveGenerics["Wait_Mode"] == Wait.SomethingToDo) then
  679.         SHOW(_CurrentMob, "Normal");
  680.         SAY(CurrentMobname, T("Sorry I have to do something for now.", "Sorry ich hab zu tun."));
  681.         SAY(CurrentMobname, T("Catch you later.", "Wir sehen uns später."));
  682.     else if(TableSaveGenerics["Wait_Mode"] == Wait.Depressed) then
  683.         SHOW(_CurrentMob, "Sad");
  684.         if(Rnd(true) < 25) then
  685.             SAY(CurrentMobname, T("*Sobs*", "*Schluchzt*"));
  686.         else
  687.             SAY(CurrentMobname, T("*Looks sad*", "*Schaut traurig*"));
  688.             SAY(CurrentMobname, T("*She seems not responsive*", "*Sie scheint nicht zu reagieren*"));
  689.         end
  690.     else if(TableSaveGenerics["Wait_Mode"] == Wait.Sleeping) then
  691.         SAY(CurrentMobname, T("*She is sleeping*", "*Sie schläft*"));
  692.     else if(TableSaveGenerics["Wait_Mode"] == Wait.NotFound) then
  693.         SAY(T("*You can't find her*", "Du kannst sie nicht finden*"));;
  694.     else
  695.         SAY(CurrentMobname, T("*She seems busy*", "*Sie scheint beschäftigt*"));
  696.     end
  697. end
  698.  
  699. function Story_Play()
  700.     if((not WaitReady()) and (DEBUG ~= true)) then
  701.         Story_Generic_Busy();
  702.     else if(TableSaveGenerics["NextSubStory"] ~= -1) then
  703.         TableSaveGenerics["LeftByEsc"] = true;
  704.          pos = TableSaveGenerics["NextSubStory"];
  705.         TableSaveGenerics["NextSubStory"] = -1;
  706.         if(List_Func_Story_Sub[pos]() == false) then
  707.             TableSaveGenerics["NextSubStory"] = pos;
  708.         end
  709.         TableSaveGenerics["LeftByEsc"] = false;
  710.     else if(List_Func_Story[TableSaveGenerics["NextStory"]] ~= nil) then
  711.         if((TableSaveGenerics["LeftByEsc"] == true) and (DEBUG ~= true)) then
  712.             if(TableSaveGenerics["LeftByEsc2"] ~= true) then
  713.                 TableSaveGenerics["LeftByEsc2"] = true;
  714.                 WaitTomorrow(Wait.JustLeft);
  715.                 TableSaveGenerics["NextStory"] = TableSaveGenerics["NextStory"] + 1;
  716.                 Story_Generic_Busy();
  717.             else
  718.                 TableSaveGenerics["LeftByEsc"] = false;
  719.                 TableSaveGenerics["LeftByEsc2"] = false;
  720.                 Story_Generic_JustLeft();
  721.             end
  722.         else
  723.             TableSaveGenerics["LeftByEsc"] = true;
  724.             if((List_Func_Story[TableSaveGenerics["NextStory"]]() == true) and (DEBUG ~= true)) then
  725.                 TableSaveGenerics["NextStory"] = TableSaveGenerics["NextStory"] + 1;
  726.             end
  727.             TableSaveGenerics["LeftByEsc"] = false;
  728.         end
  729.     else
  730.         SAY("<ScriptWarning>", T("No more story left. Please wait for an update.", "Keine Story mehr verfügbar. Bitte warten sie auf ein Update."));
  731.     end
  732. end
  733.  
  734. function T(eng, ger, rus)
  735.     if(CurrentLanguage == Languages.Eng) then
  736.         return eng;
  737.     else if(CurrentLanguage == Languages.Ger);       then
  738.         return ger;
  739.  else if(CurrentLanguage == Languages.Rus);      then
  740.         return rus; end
  741.     return "";
  742. end
  743.  
  744. --returns the number of items taken, for partial requests
  745. function TakeItem2(itemID, amount, meta)
  746.     num = 0;
  747.     while(DCLib.Player.TakeItem(itemID, 1, meta)) do
  748.         num = num + 1;
  749.     end
  750.     return num;
  751. end
  752.  
  753.  
  754. function LoveSet(num)
  755.     TableSaveGenerics["LoveLevel"] = num;
  756.    
  757.     if(num > 0) then
  758.         Wrapper.SetReaction("friendly");
  759.     end
  760. end
  761.  
  762. function LoveInc(num)
  763.     LoveSet(LoveGet() + num);
  764. end
  765.  
  766. function LoveDec(num)
  767.     LoveSet(LoveGet() - num);
  768. end
  769.  
  770. function LoveGet()
  771.     if(TableSaveGenerics["LoveLevel"] == nil) then
  772.         TableSaveGenerics["LoveLevel"] = 0;
  773.     end
  774.     return TableSaveGenerics["LoveLevel"];
  775. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top