Guest User

Untitled

a guest
Mar 14th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 7.68 KB | None | 0 0
  1. class 1 prisioner: citizen {
  2. parameter:
  3.     string fnHi = "Prison_hi.htm";
  4.     string fnGiveDel = "Prison_Give_Del.htm";
  5.     string fnAttack = "Prison_attack.htm";
  6.     string fnPorts = "Prison_ports.htm";
  7.     string fnQuest = "Prison_quest.htm";
  8.     string fnnoItem = "Prison_noItem.htm";
  9. handler:
  10. EventHandler CREATED ()
  11.     {
  12.         myself :: AddMoveSuperPointDesire (myself.sm.name, 0,2000);
  13.         myself :: ChangeMoveType (0);
  14.         super;
  15.     }
  16.  
  17.  
  18.  
  19.  
  20. EventHandler TALKED (talker) {
  21.          if (myself :: GetInventoryInfo (talker, 1) -myself :: GetInventoryInfo (talker, 0)> = 3)
  22.          {
  23.          // Initial number
  24.          i0 = myself :: OwnItemCount (talker, 20001); // Chains
  25.          i1 = myself :: OwnItemCount (talker, 20002); // Firewood
  26.          i2 = myself :: OwnItemCount (talker, 20003); // key
  27.          i3 = myself :: OwnItemCount (talker, 30027); // Axe
  28.          // There is nothing for the quest
  29.          if (i0 == 0 && i1 == 0 && i2 == 0 && i3 == 0) {
  30.              myself :: ShowPage (talker, fnnoItem);
  31.          }
  32.          // There is a key, and no other item is
  33.          elseif (i2> 0 && i0 == 0 && i1 == 0 && i3 == 0) {
  34.              myself :: ShowPage (talker, fnPorts);
  35.          }
  36.          // There is no firewood and ax
  37.          // Elseif (i1> 0 && i3 == 0) {
  38.          elseif (i1> 0) {
  39.             myself :: ShowPage (talker, fnGiveDel);
  40.          }
  41.          // If there is no chain and ax
  42.          elseif (i0> 0 && i3 == 0) {
  43.             myself :: ShowPage (talker, fnHi);
  44.          }
  45.          // If there is no ax and firewood
  46.          elseif (i3> 0 && i1 == 0) {
  47.             myself :: ShowPage (talker, fnAttack);
  48.          }
  49.        
  50.          } Else {myself :: ShowSystemMessageStr (talker, "To pass the quest you need to reduce the number of items in the inventory.");}
  51. }
  52.  
  53.  
  54.  
  55.  
  56. EventHandler MENU_SELECTED (talker, ask, reply, i0) {
  57.          if (reply == 1) {
  58.              myself :: ShowPage (talker, fnQuest);
  59.          }
  60.          if (reply == 2) {
  61.                   i1 = myself :: OwnItemCount (talker, 30027);
  62.              if (i1 == 0) {
  63.                 myself :: GiveItem1 (talker, 30027,1);
  64.                }
  65.          }
  66.          if (reply == 3) {
  67.              myself :: ShowPage (talker, fnHi);
  68.          }
  69.          if (reply == 4) {
  70.              if (talker.karma == 0) {
  71.                 myself :: DeleteItem1 (talker, 20002,1);
  72.                 myself :: DeleteItem1 (talker, 20001,1);
  73.                    i4 = myself :: OwnItemCount (talker, 20001); // Chains
  74.                i5 = myself :: OwnItemCount (talker, 20002); // Firewood
  75.                if (i4 == 1 && i5 == 1) {
  76.                   myself :: GiveItem1 (talker, 20003,1);
  77.                }
  78.              }
  79.              else {myself :: DeleteItem1 (talker, 20002,1);}
  80.          }
  81.          if (reply == 6) {
  82.          // "Port Gludio"
  83.                    i1 = myself :: OwnItemCount (talker, 20001); // Chains
  84.                i2 = myself :: OwnItemCount (talker, 20002); // Firewood
  85.                i3 = myself :: OwnItemCount (talker, 30027); // Axe
  86.            i4 = myself :: OwnItemCount (talker, 20003); // key
  87.              if (i1! = 0) {
  88.               myself :: DeleteItem1 (talker, 20003, i1);
  89.              }
  90.              if (i2! = 0) {
  91.               myself :: DeleteItem1 (talker, 20003, i2);
  92.              }
  93.              if (i3! = 0) {
  94.               myself :: DeleteItem1 (talker, 20003, i3);
  95.              }
  96.              if (i4! = 0) {
  97.               myself :: DeleteItem1 (talker, 20003, i4);
  98.              }
  99.              myself :: InstantTeleport (talker, -12694,122776, -3114);
  100.          }
  101.          if (reply == 7) {
  102.              // "Port Dion"
  103.                    i1 = myself :: OwnItemCount (talker, 20001); // Chains
  104.                i2 = myself :: OwnItemCount (talker, 20002); // Firewood
  105.                i3 = myself :: OwnItemCount (talker, 30027); // Axe
  106.            i4 = myself :: OwnItemCount (talker, 20003); // key
  107.              if (i1! = 0) {
  108.               myself :: DeleteItem1 (talker, 20003, i1);
  109.              }
  110.              if (i2! = 0) {
  111.               myself :: DeleteItem1 (talker, 20003, i2);
  112.              }
  113.              if (i3! = 0) {
  114.               myself :: DeleteItem1 (talker, 20003, i3);
  115.              }
  116.              if (i4! = 0) {
  117.               myself :: DeleteItem1 (talker, 20003, i4);
  118.              }
  119.              myself :: InstantTeleport (talker, 15671,142994, -2704);
  120.          }
  121.          if (reply == 8) {
  122.              // "Giran Port"
  123.                    i1 = myself :: OwnItemCount (talker, 20001); // Chains
  124.                i2 = myself :: OwnItemCount (talker, 20002); // Firewood
  125.                i3 = myself :: OwnItemCount (talker, 30027); // Axe
  126.            i4 = myself :: OwnItemCount (talker, 20003); // key
  127.              if (i1! = 0) {
  128.               myself :: DeleteItem1 (talker, 20003, i1);
  129.              }
  130.              if (i2! = 0) {
  131.               myself :: DeleteItem1 (talker, 20003, i2);
  132.              }
  133.              if (i3! = 0) {
  134.               myself :: DeleteItem1 (talker, 20003, i3);
  135.              }
  136.              if (i4! = 0) {
  137.               myself :: DeleteItem1 (talker, 20003, i4);
  138.              }
  139.              myself :: InstantTeleport (talker, 83458,148012, -3400);
  140.          }
  141.          if (reply == 9) {
  142.              // "Port Oren"
  143.                    i1 = myself :: OwnItemCount (talker, 20001); // Chains
  144.                i2 = myself :: OwnItemCount (talker, 20002); // Firewood
  145.                i3 = myself :: OwnItemCount (talker, 30027); // Axe
  146.            i4 = myself :: OwnItemCount (talker, 20003); // key
  147.              if (i1! = 0) {
  148.               myself :: DeleteItem1 (talker, 20003, i1);
  149.              }
  150.              if (i2! = 0) {
  151.               myself :: DeleteItem1 (talker, 20003, i2);
  152.              }
  153.              if (i3! = 0) {
  154.               myself :: DeleteItem1 (talker, 20003, i3);
  155.              }
  156.              if (i4! = 0) {
  157.               myself :: DeleteItem1 (talker, 20003, i4);
  158.              }
  159.              myself :: InstantTeleport (talker, 83011,53207, -1470);
  160.          }
  161.          if (reply == 10) {
  162.              // "The port of Aden"
  163.                    i1 = myself :: OwnItemCount (talker, 20001); // Chains
  164.                i2 = myself :: OwnItemCount (talker, 20002); // Firewood
  165.                i3 = myself :: OwnItemCount (talker, 30027); // Axe
  166.            i4 = myself :: OwnItemCount (talker, 20003); // key
  167.              if (i1! = 0) {
  168.               myself :: DeleteItem1 (talker, 20003, i1);
  169.              }
  170.              if (i2! = 0) {
  171.               myself :: DeleteItem1 (talker, 20003, i2);
  172.              }
  173.              if (i3! = 0) {
  174.               myself :: DeleteItem1 (talker, 20003, i3);
  175.              }
  176.              if (i4! = 0) {
  177.               myself :: DeleteItem1 (talker, 20003, i4);
  178.              }
  179.              myself :: InstantTeleport (talker, 146705,25840, -2000);
  180.          }
  181.          if (reply == 11) {
  182.              // "Port Godart"
  183.                    i1 = myself :: OwnItemCount (talker, 20001); // Chains
  184.                i2 = myself :: OwnItemCount (talker, 20002); // Firewood
  185.                i3 = myself :: OwnItemCount (talker, 30027); // Axe
  186.            i4 = myself :: OwnItemCount (talker, 20003); // key
  187.              if (i1! = 0) {
  188.               myself :: DeleteItem1 (talker, 20003, i1);
  189.              }
  190.              if (i2! = 0) {
  191.               myself :: DeleteItem1 (talker, 20003, i2);
  192.              }
  193.              if (i3! = 0) {
  194.               myself :: DeleteItem1 (talker, 20003, i3);
  195.              }
  196.              if (i4! = 0) {
  197.               myself :: DeleteItem1 (talker, 20003, i4);
  198.              }
  199.              myself :: InstantTeleport (talker, 147 978, -55408, -2728);
  200.          }
  201. }        
  202. }
Add Comment
Please, Sign In to add comment