SHARE
TWEET

Untitled

a guest Dec 12th, 2015 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // SilvItemLog.js
  3. // Version: 1.05
  4. //=============================================================================
  5. /*:
  6.  * @plugindesc v1.05 Item Log. Displays the last looted items.
  7.    <SilverItemLog>
  8.  * @author Silver
  9.  *
  10.  * @param Auto Gain Loot
  11.  * @desc Automatically add the loot to the party's inventory? true/false
  12.  * @default true
  13.  *
  14.  * @param Auto Log Items
  15.  * @desc Automatically add items to the log window when added through the GainItem command? true/false
  16.  * @default true
  17.  *
  18.  * @param Item SFX
  19.  * @desc Automatically play this sound when picking up items, armors or weapons. Leave blank to disable.
  20.  * @default Item1
  21.  *
  22.  * @param Gold SFX
  23.  * @desc Automatically play this sound when picking up gold (currency). Leave blank to disable.
  24.  * @default Coin
  25.  *
  26.  * @param Window X
  27.  * @desc x-location of itemlog window. If window-alignment is set to Right, this will act as an offset value instead
  28.  * @default -2
  29.  *
  30.  * @param Window Y
  31.  * @desc y-location of itemlog window. If window-alignment is set to Top, this will act as an offset value instead
  32.  * @default 2
  33.  *
  34.  * @param Window Horizontal Alignment
  35.  * @desc Left/Right
  36.  * @default Right
  37.  *
  38.  * @param Window Vertical Alignment
  39.  * @desc Top/Bottom
  40.  * @default Top
  41.  *
  42.  * @param Window Width
  43.  * @desc width of the itemlog window
  44.  * @default 400
  45.  *
  46.  * @param Window Height
  47.  * @desc height of the itemlog window
  48.  * @default 160
  49.  *
  50.  * @param Font Size
  51.  * @desc Size of the font
  52.  * @default 24
  53.  *
  54.  * @param Text Offset X
  55.  * @desc Text offset X for the log entries
  56.  * @default 10
  57.  *
  58.  * @param Text Offset Y
  59.  * @desc Text offset Y for the log entries
  60.  * @default 6
  61.  *
  62.  * @param Standard Padding
  63.  * @desc Leave at default (it's basically an X and Y offset)
  64.  * @default 0
  65.  *
  66.  * @param Prefix Text
  67.  * @desc Prefix text
  68.  * @default Received
  69.  *
  70.  * @param Icon Y-offset
  71.  * @desc Extra Y-offset for the drawing of the icons to better align them with the sentences
  72.  * @default 4
  73.  *
  74.  * @param Fadeout Delay
  75.  * @desc How long before the window starts fading out (in frames)
  76.  * @default 240
  77.  *
  78.  * @param Fadeout Speed
  79.  * @desc How fast the window fades out
  80.  * @default 2
  81.  *
  82.  * @param Text Shading
  83.  * @desc Displays previously looted items in darker text. Set to 0 to disable.
  84.  * @default -0.15
  85.  *
  86.  * @param Gold IconIndex
  87.  * @desc iconindex for the gold/currency icon
  88.  * @default 163
  89.  *
  90.  * @param Window Skin
  91.  * @desc Name of the window skin to use for this window
  92.  * @default Window_ItemLog
  93.  *
  94.  * @help
  95.  * Plugin Command:
  96.  * ItemLog <loot type> <loot database-index> <amount> <optional: skip (override: does not actually add the item to the inventory)>
  97.  * example to loot 3 potions: ItemLog item 1 3
  98.  * example to loot 5 swords:  ItemLog weapon 1 5
  99.  * example to loot 6 axes:    ItemLog weapon 2 6
  100.  * example to log (but does not add to inventory regardless of the "Auto Gain Loot" parameter) 6 axes:    ItemLog weapon 2 6 skip
  101.  *
  102.  * The exception is gold, examples:
  103.  *                            ItemLog gold 123
  104.  *                            ItemLog gold 999
  105.  *
  106.  * Use the plugin command "ItemLog show" (w/o quotes) to show the window
  107.  * again without adding anything.
  108.  *
  109.  * Note that all commands & parameters are NOT case sensitive.
  110.  *
  111.  *
  112.  *--------------------------------------
  113.  * Version History:
  114.  *--------------------------------------
  115.  * v1.05 (12 December 2015)
  116.  * - Added a version history.
  117.  * - Fixed a bug that used the wrong amount of gold/item/etc. when using a game-variable instead of a fixed amount.
  118.  * - Added this plugin to Silv.Plugins.
  119.  *
  120.  * v1.00 - v1.04 (November 2015)
  121.  */
  122. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  123. // Utilities
  124. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  125. String.prototype.contains = function(it) { return this.indexOf(it) != -1; };
  126.  
  127. // Stack with limited size
  128. // Automatically removes the first element(s) if it exceeds it's maxsize
  129. function Queue_LSize(maxSize)
  130. {
  131.         this._maxSize = maxSize;
  132.     this.length = 0;
  133.     this._storage = [];
  134. }
  135.  
  136. Queue_LSize.prototype.itemByIdx = function(index)
  137. {
  138.         return this._storage[index];
  139. };
  140.  
  141. Queue_LSize.prototype.queue = function(data)
  142. {
  143.     this._storage[this.length] = data;
  144.         this.length++;
  145.         while (this.length > this._maxSize) { this.onAutoRemoval(this.dequeue()); }
  146. };
  147.  
  148. // For aliasing
  149. Queue_LSize.prototype.onAutoRemoval = function(removed_item) {};
  150.  
  151.  // Remove and return first item in array
  152. Queue_LSize.prototype.dequeue = function()
  153. {
  154.     if (this.length)
  155.         {
  156.         var deletedData = this._storage.shift();
  157.         this.length--;
  158.         return deletedData;
  159.     }
  160. };
  161. // Remove and return last item in array
  162. Queue_LSize.prototype.pop = function()
  163. {
  164.     if (this.length)
  165.         {
  166.         var deletedData = this._storage.pop();
  167.         this.length--;
  168.         return deletedData;
  169.     }
  170. };
  171. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  172. // Variables
  173. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  174. var Silv = Silv || {};
  175. Silv.Plugins = Silv.Plugins || {};
  176. Silv.Plugins.ItemLog = 1.05;
  177. Silv.Parameters = $plugins.filter(function(p) { return p.description.contains('<SilverItemLog>'); })[0].parameters;
  178. Silv.ItemLog = Silv.ItemLog || {};
  179. Silv.ItemLog.Window = null;
  180. Silv.ItemLog.AlreadyPlayedSFX = false;
  181. Silv.ItemLog.AutoLootGain = Silv.Parameters['Auto Gain Loot'].toLowerCase() == 'true';
  182. Silv.ItemLog.AutoLogItems = Silv.Parameters['Auto Log Items'].toLowerCase() == 'true';
  183. Silv.ItemLog.PickupSFXItem = Silv.Parameters['Item SFX'];
  184. Silv.ItemLog.PickupSFXGold = Silv.Parameters['Gold SFX'];
  185. Silv.ItemLog.Window_X = parseInt(Silv.Parameters['Window X']);
  186. Silv.ItemLog.Window_Y = parseInt(Silv.Parameters['Window Y']);
  187. Silv.ItemLog.WindowWidth = parseInt(Silv.Parameters['Window Width']);
  188. Silv.ItemLog.WindowHeight = parseInt(Silv.Parameters['Window Height']);
  189. Silv.ItemLog.WindowHorizontalAlignment = Silv.Parameters['Window Horizontal Alignment'].toLowerCase();
  190. Silv.ItemLog.WindowVerticalAlignment = Silv.Parameters['Window Vertical Alignment'].toLowerCase();
  191. Silv.ItemLog.FontSize = parseInt(Silv.Parameters['Font Size']);
  192. Silv.ItemLog.EntryTextOffsetX = parseInt(Silv.Parameters['Text Offset X']);
  193. Silv.ItemLog.EntryTextOffsetY = parseInt(Silv.Parameters['Text Offset Y']);
  194. Silv.ItemLog.StandardPadding = parseInt(Silv.Parameters['Standard Padding']);
  195. Silv.ItemLog.TextLines = Silv.ItemLog.TextLines || 'Error: Not yet set';
  196. Silv.ItemLog.PrefixText = Silv.Parameters['Prefix Text'];
  197. if (Silv.ItemLog.PrefixText.slice(-1) != ' ') { Silv.ItemLog.PrefixText += ' '; }
  198. Silv.ItemLog.IconOffsetY = parseInt(Silv.Parameters['Icon Y-offset']);
  199. Silv.ItemLog.FadeoutDelay = parseInt(Silv.Parameters['Fadeout Delay']);
  200. Silv.ItemLog.FadeoutSpeed = parseInt(Silv.Parameters['Fadeout Speed']);
  201. Silv.ItemLog.TextShadingValue = parseFloat(Silv.Parameters['Text Shading']);
  202. Silv.ItemLog.GoldIconIndex = parseInt(Silv.Parameters['Gold IconIndex']);
  203. Silv.ItemLog.WindowSkin = Silv.Parameters['Window Skin'];
  204.  
  205. (function()
  206. {
  207. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  208. // Window
  209. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  210. function Window_ItemLog() { this.initialize.apply(this, arguments); }
  211. // Inherit from base window
  212. Window_ItemLog.prototype = Object.create(Window_Base.prototype);
  213. // Set Constructor
  214. Window_ItemLog.prototype.constructor = Window_ItemLog;
  215.  
  216. Window_ItemLog.prototype.loadWindowskin = function() { this.windowskin = ImageManager.loadSystem(Silv.ItemLog.WindowSkin); };
  217. Window_ItemLog.prototype.standardPadding = function() { return Silv.ItemLog.StandardPadding; };
  218. Window_ItemLog.prototype.standardFontSize = function() { return Silv.ItemLog.FontSize; };
  219.  
  220. // Initialization
  221. Window_ItemLog.prototype.initialize = function(x, y, width, height)
  222. {
  223.     Window_Base.prototype.initialize.call(this, x, y, width, height);
  224.     this._helpWindow = null;
  225.     this._handlers = {};
  226.     this._touching = false;
  227.     this.deactivate();
  228.         var maxStackLines = parseInt((height - Silv.ItemLog.EntryTextOffsetY * 2) / parseFloat(Silv.ItemLog.FontSize));
  229.         Silv.ItemLog.TextLines = new Queue_LSize(maxStackLines);
  230.         this.fadeOutCnt = 0;
  231.         this.isFadingOut = false;
  232.         this.isFadedOut = false;
  233.        
  234.         this.update();
  235. };
  236.  
  237. // Update
  238. Window_ItemLog.prototype.update = function()
  239. {
  240.     Window_Base.prototype.update.call(this);
  241.        
  242.         Silv.ItemLog.AlreadyPlayedSFX = false;
  243.         this.updateFadeOut();
  244.     this.drawItemLogContents();
  245. };
  246.  
  247. // Update Fading Out
  248. Window_ItemLog.prototype.updateFadeOut = function()
  249. {
  250.         if (this.isFadedOut) { return; }
  251.        
  252.         if (!this.isFadingOut)
  253.         {
  254.                 this.fadeOutCnt++;
  255.                 if (this.fadeOutCnt > Silv.ItemLog.FadeoutDelay)
  256.                 {
  257.                         this.fadeOutCnt = 0;
  258.                         this.isFadingOut = true;
  259.                 }
  260.         }
  261.         else
  262.         {
  263.                 this.fadeOut();
  264.         }
  265. };
  266.  
  267. Window_ItemLog.prototype.fadeOut = function()
  268. {
  269.         this.opacity = this.contentsOpacity -= Silv.ItemLog.FadeoutSpeed;
  270.         this.isFadedOut = (this.opacity <= 0);
  271. };
  272.  
  273. Window_ItemLog.prototype.resetFade = function()
  274. {
  275.         this.isFadingOut = false;
  276.         this.fadeOutCnt = 0;
  277.         this.opacity = this.contentsOpacity  = 255;
  278.         this.isFadedOut = false;
  279. };
  280.  
  281. Window_ItemLog.prototype.fadeOutInstantly = function()
  282. {
  283.         this.opacity = this.contentsOpacity = 0;
  284.         this.isFadedOut = true;
  285. };
  286.  
  287. // Drawing
  288. Window_ItemLog.prototype.drawItemLogContents = function()
  289. {
  290.         if (typeof Silv.ItemLog.TextLines === 'string') { return; }
  291.         this.contents.clear();
  292.         this.resetTextColor();
  293.        
  294.         var textLinesCnt = Silv.ItemLog.TextLines.length;
  295.         var text = null;
  296.         for (var i = textLinesCnt - 1; i >= 0; i--)
  297.         {
  298.                 var line = Silv.ItemLog.TextLines.itemByIdx(i);
  299.                 text = line.t1;
  300.                 this.drawText(text, Silv.ItemLog.EntryTextOffsetX, Silv.ItemLog.EntryTextOffsetY + i * Silv.ItemLog.FontSize, 256, 'left');
  301.                 var newOffsetX = Silv.ItemLog.EntryTextOffsetX + this.contents.measureTextWidth(line.t1);
  302.                 this.drawLootIcon(line.iconIndex, newOffsetX, Silv.ItemLog.EntryTextOffsetY + i * Silv.ItemLog.FontSize + Silv.ItemLog.IconOffsetY);
  303.                 newOffsetX += Silv.ItemLog.FontSize + 4;
  304.                 text = line.t2;
  305.                 this.drawText(text, newOffsetX, Silv.ItemLog.EntryTextOffsetY + i * Silv.ItemLog.FontSize, 256, 'left');
  306.                
  307.                 this.contents.textColor = shadeColor(this.contents.textColor, Silv.ItemLog.TextShadingValue);
  308.         }
  309.        
  310.         function shadeColor(color, percent)
  311.         {  
  312.                 var f=parseInt(color.slice(1),16),t=percent<0?0:255,p=percent<0?percent*-1:percent,R=f>>16,G=f>>8&0x00FF,B=f&0x0000FF;
  313.                 return "#"+(0x1000000+(Math.round((t-R)*p)+R)*0x10000+(Math.round((t-G)*p)+G)*0x100+(Math.round((t-B)*p)+B)).toString(16).slice(1);
  314.         }
  315. };
  316.  
  317. Window_ItemLog.prototype.drawLootIcon = function(iconIndex, x, y)
  318. {
  319.     var bitmap = ImageManager.loadSystem('IconSet');
  320.     var pw = Window_Base._iconWidth;
  321.     var ph = Window_Base._iconHeight;
  322.     var sx = iconIndex % 16 * pw;
  323.     var sy = Math.floor(iconIndex / 16) * ph;
  324.     this.contents.blt(bitmap, sx, sy, pw, ph, x, y, Silv.ItemLog.FontSize, Silv.ItemLog.FontSize);
  325. };
  326. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  327. // Create the ItemLog window
  328. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  329. var alias_silv_itemlog_createDisplayObjects = Scene_Map.prototype.createDisplayObjects;
  330. Scene_Map.prototype.createDisplayObjects = function()
  331. {
  332.         alias_silv_itemlog_createDisplayObjects.call(this);
  333.         this.createItemLogWindow();
  334. };
  335.  
  336. Scene_Map.prototype.createItemLogWindow = function()
  337. {
  338.         var x = 0;
  339.         if (Silv.ItemLog.WindowHorizontalAlignment == 'right') { x = Graphics.width - Silv.ItemLog.WindowWidth; }
  340.         var y = 0;
  341.         if (Silv.ItemLog.WindowVerticalAlignment == 'bottom') { y = Graphics.height - Silv.ItemLog.WindowHeight; }
  342.        
  343.         if (Silv.ItemLog.Window !== null) { this.removeWindow(Silv.ItemLog.Window); }
  344.         Silv.ItemLog.Window = new Window_ItemLog(x + Silv.ItemLog.Window_X, y + Silv.ItemLog.Window_Y, Silv.ItemLog.WindowWidth, Silv.ItemLog.WindowHeight);
  345.         Silv.ItemLog.Window.fadeOutInstantly();
  346.         this.addChildAt(Silv.ItemLog.Window, 1);
  347. };
  348.  
  349. // Omg why does RPG Maker not have this method by default...
  350. Scene_Base.prototype.removeWindow = function(window)
  351. {
  352.         var index = this.children.indexOf(window);
  353.         if (index > -1) { this.children.splice(index, 1); }
  354. };
  355. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  356. // Saving & Loading
  357. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  358. /* Code below does not work for some reason. It does save the data but not load it properly.
  359. var alias_silv_ItemLog_makeSaveContents = DataManager.makeSaveContents;
  360. DataManager.makeSaveContents = function()
  361. {
  362.         contents = alias_silv_ItemLog_makeSaveContents.call(this);
  363.         contents.itemLogData = Silv.ItemLog.TextLines;
  364.         return contents;
  365. }
  366.  
  367. var alias_silv_ItemLog_extractSaveContents = DataManager.extractSaveContents;
  368. DataManager.extractSaveContents = function(contents)
  369. {
  370.         alias_silv_ItemLog_extractSaveContents.call(this, contents);
  371.         Silv = Silv || {};
  372.         Silv.ItemLog = Silv.ItemLog || {};
  373.         Silv.ItemLog.TextLines = contents.itemLogData;
  374. }
  375. */
  376. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  377. // Automatically add items
  378. //------------------------
  379. //
  380. // Explanation of the this._params:
  381. //
  382. // Gold
  383. // [0] = 0: increase, 1: decrease
  384. // [1] = 0: value, 1: $gameVariable was used to determine amount of gold
  385. // [2] = it is a direct amount of gold but if [1] == 1, then this is the gameVariable number that contains the gold-amount instead.
  386. //
  387. //
  388. // Items, Weapons & Armor
  389. // [0] = armor id matching the $dataArmors index
  390. // [1] = 0: increase, 1: decrease
  391. // [2] = 0: value, 1: $gameVariable was used to determine amount of armors
  392. // [3] = it is a direct amount of gold but if [2] == 1, then this is the gameVariable number that contains the gold-amount instead.
  393. // [4] = include equipment? true/false
  394. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  395. Silv.ItemLog.getAmount = function(params) // does not apply to gold! Gold has different parameters.. Yay for RPG Maker...
  396. {
  397.         return (params[2] == 0) ? params[3] : $gameVariables.value(params[3]);
  398. };
  399.  
  400. // Change Gold
  401. var alias_silv_command125 = Game_Interpreter.prototype.command125;
  402. Game_Interpreter.prototype.command125 = function()
  403. {
  404.         var amount = (this._params[1] == 0) ? this._params[2] : $gameVariables.value(this._params[2]);
  405.        
  406.     var retVal = alias_silv_command125.apply(this, arguments);
  407.         if (Silv.ItemLog.AutoLogItems) { PluginCommand('ItemLog', ['gold', String(amount), 'skip']); }
  408.     return retVal;
  409. };
  410.  
  411. // Change Items
  412. var alias_silv_command126 = Game_Interpreter.prototype.command126;
  413. Game_Interpreter.prototype.command126 = function()
  414. {
  415.     var retVal = alias_silv_command126.apply(this, arguments);
  416.         if (Silv.ItemLog.AutoLogItems) { PluginCommand('ItemLog', ['item', this._params[0], Silv.ItemLog.getAmount(this._params), 'skip']); }
  417.     return retVal;
  418. };
  419.  
  420. // Change Weapons
  421. var alias_silv_command127 = Game_Interpreter.prototype.command127;
  422. Game_Interpreter.prototype.command127 = function()
  423. {
  424.     var retVal = alias_silv_command127.apply(this, arguments);
  425.         if (Silv.ItemLog.AutoLogItems) { PluginCommand('ItemLog', ['weapon', this._params[0], Silv.ItemLog.getAmount(this._params), 'skip']); }
  426.     return retVal;
  427. };
  428.  
  429. // Change Armors
  430. var alias_silv_command128 = Game_Interpreter.prototype.command128;
  431. Game_Interpreter.prototype.command128 = function()
  432. {
  433.         console.log(this._params);
  434.     var retVal = alias_silv_command128.apply(this, arguments);
  435.         if (Silv.ItemLog.AutoLogItems) { PluginCommand('ItemLog', ['armor', this._params[0], Silv.ItemLog.getAmount(this._params), 'skip']); }
  436.     return retVal;
  437. };
  438. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  439. // Plugin Command
  440. // Note: The items are separated by spaces. The command is the first word and any following words are args. args is an array.
  441. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  442. var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  443. Game_Interpreter.prototype.pluginCommand = function(command, args)
  444. {
  445.         _Game_Interpreter_pluginCommand.call(this, command, args);
  446.         if (command.toLowerCase() == 'itemlog') { PluginCommand(command, args); }
  447. };
  448.  
  449. function PluginCommand(cmd, args)
  450. {
  451.         if (args[0].toLowerCase() == 'show')
  452.         {
  453.                 Silv.ItemLog.Window.resetFade();
  454.                 return;
  455.         }
  456.        
  457.         // arg: item 1 10
  458.         // arg: weapon 2 1
  459.         // arg: weapon 2 1 skip
  460.         // arg: gold 123
  461.         var db = getDatabase(args[0]);
  462.         var lootIdx = parseInt(args[1]);
  463.         var skipAddItemToInventory = (String(args[args.length - 1]).toLowerCase() == 'skip');
  464.         if (db != 'gold')
  465.         {
  466.                 var amount = args[2];
  467.                 if (amount.length == 1) { amount = ' ' + amount; }
  468.                 var name = db[lootIdx].name;
  469.                 var iconIndex = db[lootIdx].iconIndex;
  470.                
  471.                 var t1 = Silv.ItemLog.PrefixText + amount + 'x ';
  472.                 var t2 = name;                         
  473.                
  474.                 Silv.ItemLog.TextLines.queue({t1: t1, iconIndex: iconIndex, t2: t2});
  475.                
  476.         // Add loot
  477.                 if (Silv.ItemLog.AutoLootGain && !skipAddItemToInventory)
  478.                 {
  479.                         $gameParty.gainItem(db[lootIdx], parseInt(args[2]));
  480.                 }
  481.                
  482.                 // sfx
  483.                 if (!Silv.ItemLog.AlreadyPlayedSFX)
  484.                 {
  485.                         Play_SE(Silv.ItemLog.PickupSFXItem);
  486.                         Silv.ItemLog.AlreadyPlayedSFX = true;
  487.                 }
  488.         }
  489.         else
  490.         {
  491.                 var amount = parseInt(args[1]);
  492.                 Silv.ItemLog.TextLines.queue({t1: Silv.ItemLog.PrefixText + '    ', iconIndex: Silv.ItemLog.GoldIconIndex, t2: amount + ' ' + $dataSystem.currencyUnit});
  493.                
  494.                 // Add loot
  495.                 if (Silv.ItemLog.AutoLootGain && !skipAddItemToInventory)
  496.                 {
  497.                         $gameParty.gainGold(amount);
  498.                 }
  499.                
  500.                 // sfx
  501.                 if (!Silv.ItemLog.AlreadyPlayedSFX)
  502.                 {
  503.                         Play_SE(Silv.ItemLog.PickupSFXGold);
  504.                         Silv.ItemLog.AlreadyPlayedSFX = true;
  505.                 }
  506.         }
  507.         Silv.ItemLog.Window.resetFade(); // Reset the fadeout, if any.
  508.        
  509.         function getDatabase(code)
  510.         {
  511.                 code = code.toLowerCase();
  512.                 if (code.contains('item') || code.contains('itm'))
  513.                         return $dataItems;
  514.                 if (code.contains('armor'))
  515.                         return $dataArmors;
  516.                 if (code.contains('weapon') || code.contains('wpn'))
  517.                         return $dataWeapons;
  518.                 if (code.contains('gold'))
  519.                         return 'gold';
  520.                
  521.                 throw('getDatabase('+ code + ') ERROR: invalid code.');
  522.         }
  523.        
  524.         function Play_SE(filename)
  525.         {
  526.                 AudioManager.playSe({name: filename, volume: 90, pitch: 100, pan: 0});
  527.         }
  528. }
  529. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  530. })();
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top