Advertisement
Guest User

Untitled

a guest
Jul 4th, 2019
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package
  2. {
  3.    
  4.     import flash.display.Sprite;                    // Required for all CH2 mods
  5.     import heroclickerlib.CH2;                      // Required for all CH2 mods
  6.     import models.Character;                        // Required to use onCharacterCreated
  7.     import models.MonsterDebuff;
  8.    
  9.     import models.Characters;                       // Required to create new Characters
  10.     import heroclickerlib.LevelGraph;               // Required to create Level Graphs (Skill Trees)
  11.     import models.Skill;                            // Required to create Skills
  12.     import models.Buff;                             // Required to create Buffs
  13.    
  14.     // Used in the exampleEffect function
  15.     import models.Monster;                          // Required to work with Monster information
  16.     import models.AttackData;                       // Required to work with AttackData
  17.     import com.playsaurus.numbers.BigNumber;        // Required to work with Big Numbers
  18.    
  19.     // Sound & Visuals
  20.     import heroclickerlib.world.CharacterDisplay;   // Required to use Sounds
  21.     import heroclickerlib.managers.SoundManager;    // Required to use Sounds
  22.     import heroclickerlib.GpuMovieClip;             // Required to use Movie Clips
  23.     import heroclickerlib.managers.CH2AssetManager; // Required to use Movie Clips
  24.    
  25.     import heroclickerlib.managers.ItemDropManager;
  26.     import heroclickerlib.managers.Formulas;
  27.  
  28.     public class ThiefMain extends Sprite
  29.     {
  30.         public var MOD_INFO:Object =   
  31.         {  
  32.             "name": "Thief",
  33.             "description": "Thief character",
  34.             "version": 1,
  35.             "author": "Playsaurus"
  36.         };
  37.        
  38.         // Creating a Character
  39.         public var thief:Character = new Character();
  40.        
  41.         public function onStartup(game:IdleHeroMain):void {
  42.            
  43.             // Basic Character Info
  44.             // Requires import models.Characters
  45.            
  46.             thief.assetGroupName = "HelpfulAdventurer";     // Lets a character use Cid's art assets
  47.             thief.name = "Thief";           // Needs to match mod name in MOD_INFO
  48.             thief.flavorName = "Thief";
  49.             thief.flavorClass = "Thiefly person";
  50.             thief.flavor = "A thief who is a thief.";
  51.             thief.availableForCreation = true;
  52.             thief.visibleOnCharacterSelect = true;
  53.             thief.startingSkills = ["Leap", "Throw Dagger", "Distract", "Backstab", "Pick Pocket", "Basic Poison"];
  54.             thief.upgradeableStats = Character.DEFAULT_UPGRADEABLE_STATS;
  55.             //thief.onCharacterDisplayCreated = null;
  56.             thief.monstersPerZone = 10;
  57.            
  58.             Characters.startingDefaultInstances[thief.name] = thief;
  59.            
  60.            
  61.             // Creating a Level Graph (aka Skill Tree)
  62.             // Requires import heroclickerlib.LevelGraph
  63.            
  64.             thief.levelGraphNodeTypes = {
  65.                
  66.                 // Test Nodes
  67.                 "P0": {
  68.                     "name": "Poisons",
  69.                     "tooltip": "Adds Poison Bounce & Splurt Skills; and Contagion, Slow Poison, Poison dagger, Offhand Poison, Triple Bounce & Poison Damage Traits." ,
  70.                     "flavorText": null,
  71.                     "alwaysAvailable": true,
  72.                     "setupFunction": function() {},
  73.                     "purchaseFunction": function() {
  74.                         CH2.currentCharacter.addTrait("Contagion", 1);
  75.                         CH2.currentCharacter.addTrait("Slow Poison", 1);
  76.                         CH2.currentCharacter.addTrait("Poison Dagger", 3);
  77.                         CH2.currentCharacter.addTrait("Poison Damage", 1);
  78.                         CH2.currentCharacter.addTrait("Offhand Poison", 1);
  79.                         CH2.currentCharacter.addTrait("Triple Bounce", 1);
  80.                        
  81.                         var poisonBounce:Skill = CH2.currentCharacter.getStaticSkill("Poison Bounce");
  82.                         CH2.currentCharacter.activateSkill(poisonBounce.uid);
  83.                        
  84.                         var splurt:Skill = CH2.currentCharacter.getStaticSkill("Splurt");
  85.                         CH2.currentCharacter.activateSkill(splurt.uid);
  86.                        
  87.                         CH2.currentCharacter.hasPurchasedFirstSkill = true;
  88.                     },
  89.                     "icon": ""
  90.                 },
  91.                 "C0": {
  92.                     "name": "Combat/Knives",
  93.                     "tooltip": "Adds Distract Damage Bonus, Offhand Accuracy, Offhand Damage, Throw Dagger Damage, Backstab Chain & Backstab Damage Traits." ,
  94.                     "flavorText": null,
  95.                     "alwaysAvailable": true,
  96.                     "setupFunction": function() {},
  97.                     "purchaseFunction": function() {
  98.                         CH2.currentCharacter.addTrait("Distract Damage Bonus", 1);
  99.                         CH2.currentCharacter.addTrait("Offhand Accuracy", 1);
  100.                         CH2.currentCharacter.addTrait("Offhand Damage", 1);
  101.                         CH2.currentCharacter.addTrait("Throw Dagger Damage", 1);
  102.                         CH2.currentCharacter.addTrait("Backstab Damage", 1);
  103.                         CH2.currentCharacter.addTrait("Backstab Chain", 1);
  104.                         CH2.currentCharacter.addTrait("Fan of Knives", 1);
  105.                     },
  106.                     "icon": ""
  107.                 },
  108.                 "G0": {
  109.                     "name": "Gambler",
  110.                     "tooltip": "Adds Bloopcoin Investment trait & buy/sell skills, Coin Toss skill, and (currently unimplemented) Five-Finger Discount skill." ,
  111.                     "flavorText": null,
  112.                     "alwaysAvailable": true,
  113.                     "setupFunction": function() {},
  114.                     "purchaseFunction": function() {
  115.                         CH2.currentCharacter.addTrait("Bloopcoin Investment", 1);
  116.                         var buyBloopcoins:Skill = CH2.currentCharacter.getStaticSkill("Buy Bloopcoins");
  117.                         CH2.currentCharacter.activateSkill(buyBloopcoins.uid);
  118.                         var sellBloopcoins:Skill = CH2.currentCharacter.getStaticSkill("Sell Bloopcoins");
  119.                         CH2.currentCharacter.activateSkill(sellBloopcoins.uid);
  120.                        
  121.                         var coinToss:Skill = CH2.currentCharacter.getStaticSkill("Coin Toss");
  122.                         CH2.currentCharacter.activateSkill(coinToss.uid);
  123.                        
  124.                         var fiveFingerDiscount:Skill = CH2.currentCharacter.getStaticSkill("Five-Finger Discount");
  125.                         CH2.currentCharacter.activateSkill(fiveFingerDiscount.uid);
  126.                        
  127.                         CH2.currentCharacter.hasPurchasedFirstSkill = true;
  128.                     },
  129.                     "icon": ""
  130.                 },
  131.                
  132.                 // Comabat/Knives Nodes
  133.                 "C1": {
  134.                     "name": "Distract Damage Bonus",
  135.                     "tooltip": "Adds Distract Damage Bonus Trait." ,
  136.                     "flavorText": null,
  137.                     "alwaysAvailable": false,
  138.                     "setupFunction": function() {},
  139.                     "purchaseFunction": function() {
  140.                         CH2.currentCharacter.addTrait("Distract Damage Bonus", 1);
  141.                     },
  142.                     "icon": ""
  143.                 },
  144.                 "C2": {
  145.                     "name": "Offhand Accuracy",
  146.                     "tooltip": "Adds Offhand Accuracy Trait." ,
  147.                     "flavorText": null,
  148.                     "alwaysAvailable": false,
  149.                     "setupFunction": function() {},
  150.                     "purchaseFunction": function() {
  151.                         CH2.currentCharacter.addTrait("Offhand Accuracy", 1);
  152.                     },
  153.                     "icon": ""
  154.                 },
  155.                 "C3": {
  156.                     "name": "Offhand Damage",
  157.                     "tooltip": "Adds Offhand Damage Trait." ,
  158.                     "flavorText": null,
  159.                     "alwaysAvailable": false,
  160.                     "setupFunction": function() {},
  161.                     "purchaseFunction": function() {
  162.                         CH2.currentCharacter.addTrait("Offhand Damage", 1);
  163.                     },
  164.                     "icon": ""
  165.                 },
  166.                 "C4": {
  167.                     "name": "Throw Dagger Damage",
  168.                     "tooltip": "Adds Throw Dagger Damage Trait." ,
  169.                     "flavorText": null,
  170.                     "alwaysAvailable": false,
  171.                     "setupFunction": function() {},
  172.                     "purchaseFunction": function() {
  173.                         CH2.currentCharacter.addTrait("Throw Dagger Damage", 1);
  174.                     },
  175.                     "icon": ""
  176.                 },
  177.                 "C5": {
  178.                     "name": "Backstab Damage",
  179.                     "tooltip": "Adds Backstab Damage Damage Trait." ,
  180.                     "flavorText": null,
  181.                     "alwaysAvailable": true,
  182.                     "setupFunction": function() {},
  183.                     "purchaseFunction": function() {
  184.                         CH2.currentCharacter.addTrait("Backstab Damage", 1);
  185.                     },
  186.                     "icon": ""
  187.                 },
  188.                 "C6": {
  189.                     "name": "Backstab Chain",
  190.                     "tooltip": "Adds Backstab Chain Trait." ,
  191.                     "flavorText": null,
  192.                     "alwaysAvailable": false,
  193.                     "setupFunction": function() {},
  194.                     "purchaseFunction": function() {
  195.                         CH2.currentCharacter.addTrait("Backstab Chain", 1);
  196.                     },
  197.                     "icon": ""
  198.                 },
  199.                 "C7": {
  200.                     "name": "Fan of Knives",
  201.                     "tooltip": "Adds Fan of Knives Trait." ,
  202.                     "flavorText": null,
  203.                     "alwaysAvailable": false,
  204.                     "setupFunction": function() {},
  205.                     "purchaseFunction": function() {
  206.                         CH2.currentCharacter.addTrait("Fan of Knives", 1);
  207.                     },
  208.                     "icon": ""
  209.                 },
  210.                 "C8": {
  211.                     "name": "Quick Leap",
  212.                     "tooltip": "Muliplies the cooldown of Leap by 0.8." ,
  213.                     "flavorText": null,
  214.                     "alwaysAvailable": false,
  215.                     "setupFunction": function() {},
  216.                     "purchaseFunction": function() {
  217.                         var leap:Skill = CH2.currentCharacter.getSkill("Leap");
  218.                         leap.cooldown *= 0.80;
  219.                         leap.cooldownRemaining = Math.min(leap.cooldownRemaining, leap.cooldown);
  220.                     },
  221.                     "icon": ""
  222.                 },
  223.                 "C9": {
  224.                     "name": "Preparation",
  225.                     "tooltip": "Gain stacks of preparation and consume them to increase haste." ,
  226.                     "flavorText": null,
  227.                     "alwaysAvailable": false,
  228.                     "setupFunction": function() {},
  229.                     "purchaseFunction": function() {
  230.                         CH2.currentCharacter.addTrait("Preparation", 1);
  231.                        
  232.                         var preparation:Skill = CH2.currentCharacter.getStaticSkill("Preparation");
  233.                         CH2.currentCharacter.activateSkill(preparation.uid);
  234.                        
  235.                         CH2.currentCharacter.hasPurchasedFirstSkill = true;
  236.                     },
  237.                     "icon": ""
  238.                 },
  239.                 "C10": {
  240.                     "name": "Extended Distract",
  241.                     "tooltip": "Increases the duration of Distract." ,
  242.                     "flavorText": null,
  243.                     "alwaysAvailable": true,
  244.                     "setupFunction": function() {},
  245.                     "purchaseFunction": function() {
  246.                         CH2.currentCharacter.addTrait("Extended Distract", 1);
  247.                     },
  248.                     "icon": ""
  249.                 },
  250.                
  251.                 // Poison Nodes
  252.                 "P1": {
  253.                     "name": "Contagion",
  254.                     "tooltip": "When a monster dies 10% of its remaining poison stacks transfer to the next monster." ,
  255.                     "flavorText": null,
  256.                     "alwaysAvailable": false,
  257.                     "setupFunction": function() {},
  258.                     "purchaseFunction": function() {
  259.                         CH2.currentCharacter.addTrait("Contagion", 1);
  260.                     },
  261.                     "icon": ""
  262.                 },
  263.                 "P2": {
  264.                     "name": "Slow Poison",
  265.                     "tooltip": "Reduces the amount of poison stacks lost per tick by 1." ,
  266.                     "flavorText": null,
  267.                     "alwaysAvailable": false,
  268.                     "setupFunction": function() {},
  269.                     "purchaseFunction": function() {
  270.                         CH2.currentCharacter.addTrait("Slow Poison", 1);
  271.                     },
  272.                     "icon": ""
  273.                 },
  274.                 "P3": {
  275.                     "name": "Poison Dagger",
  276.                     "tooltip": "Enemies hit with the Throw Dagger skill will have a 30% chance to be poisoned." ,
  277.                     "flavorText": null,
  278.                     "alwaysAvailable": false,
  279.                     "setupFunction": function() {},
  280.                     "purchaseFunction": function() {
  281.                         CH2.currentCharacter.addTrait("Poison Dagger", 3);
  282.                     },
  283.                     "icon": ""
  284.                 },
  285.                 "P4": {
  286.                     "name": "Improved Poison Dagger",
  287.                     "tooltip": "Increases the chance that enemies hit with the Throw Dagger skill will be poisoned by 10%." ,
  288.                     "flavorText": null,
  289.                     "alwaysAvailable": false,
  290.                     "setupFunction": function() {},
  291.                     "purchaseFunction": function() {
  292.                         CH2.currentCharacter.addTrait("Poison Dagger", 1);
  293.                     },
  294.                     "icon": ""
  295.                 },
  296.                 "P5": {
  297.                     "name": "Increase Poison Damage",
  298.                     "tooltip": "Increases the amount of damage poisons do." ,
  299.                     "flavorText": null,
  300.                     "alwaysAvailable": false,
  301.                     "setupFunction": function() {},
  302.                     "purchaseFunction": function() {
  303.                         CH2.currentCharacter.addTrait("Poison Damage", 1);
  304.                     },
  305.                     "icon": ""
  306.                 },
  307.                 "P6": {
  308.                     "name": "Skill: Poison Bounce",
  309.                     "tooltip": "Applies 15 poison stacks to the next 2 monsters." ,
  310.                     "flavorText": null,
  311.                     "alwaysAvailable": false,
  312.                     "setupFunction": function() {},
  313.                     "purchaseFunction": function() {
  314.                         var poisonBounce:Skill = CH2.currentCharacter.getStaticSkill("Poison Bounce");
  315.                         CH2.currentCharacter.activateSkill(poisonBounce.uid);
  316.                     },
  317.                     "icon": ""
  318.                 },
  319.                 "P7": {
  320.                     "name": "Skill: Splurt",
  321.                     "tooltip": "For the next 30 seconds, monsters' poison debuffs will gain 2 stacks each tick instead of lose them" ,
  322.                     "flavorText": null,
  323.                     "alwaysAvailable": true,
  324.                     "setupFunction": function() {},
  325.                     "purchaseFunction": function() {
  326.                         var splurt:Skill = CH2.currentCharacter.getStaticSkill("Splurt");
  327.                         CH2.currentCharacter.activateSkill(splurt.uid);
  328.                        
  329.                         CH2.currentCharacter.hasPurchasedFirstSkill = true;
  330.                     },
  331.                     "icon": ""
  332.                 },
  333.                 "P8": {
  334.                     "name": "Offhand Poison",
  335.                     "tooltip": "Your offhand attacks have a chance to apply poisons." ,
  336.                     "flavorText": null,
  337.                     "alwaysAvailable": false,
  338.                     "setupFunction": function() {},
  339.                     "purchaseFunction": function() {
  340.                         CH2.currentCharacter.addTrait("Offhand Poison", 1);
  341.                     },
  342.                     "icon": ""
  343.                 },
  344.                 "P9": {
  345.                     "name": "Triple Bounce",
  346.                     "tooltip": "Poison Bounce will now hit the next 3 monsters." ,
  347.                     "flavorText": null,
  348.                     "alwaysAvailable": false,
  349.                     "setupFunction": function() {},
  350.                     "purchaseFunction": function() {
  351.                         CH2.currentCharacter.addTrait("Triple Bounce", 1);
  352.                     },
  353.                     "icon": ""
  354.                 },
  355.                
  356.                 // Gambler Nodes
  357.                 "G1": {
  358.                     "name": "Bloopcoin Investment",
  359.                     "tooltip": "Gain the ability to buy and sell Bloopcoins for fun and profit!" ,
  360.                     "flavorText": null,
  361.                     "alwaysAvailable": true,
  362.                     "setupFunction": function() {},
  363.                     "purchaseFunction": function() {
  364.                         CH2.currentCharacter.addTrait("Bloopcoin Investment", 1);
  365.                        
  366.                         var buyBloopcoins:Skill = CH2.currentCharacter.getStaticSkill("Buy Bloopcoins");
  367.                         CH2.currentCharacter.activateSkill(buyBloopcoins.uid);
  368.                        
  369.                         var sellBloopcoins:Skill = CH2.currentCharacter.getStaticSkill("Sell Bloopcoins");
  370.                         CH2.currentCharacter.activateSkill(sellBloopcoins.uid);
  371.                        
  372.                         CH2.currentCharacter.hasPurchasedFirstSkill = true;
  373.                     },
  374.                     "icon": ""
  375.                 },
  376.                 "G2": {
  377.                     "name": "Coin Toss",
  378.                     "tooltip": "Toss some of your gold at a monster to do damage" ,
  379.                     "flavorText": null,
  380.                     "alwaysAvailable": false,
  381.                     "setupFunction": function() {},
  382.                     "purchaseFunction": function() {
  383.                         var coinToss:Skill = CH2.currentCharacter.getStaticSkill("Coin Toss");
  384.                         CH2.currentCharacter.activateSkill(coinToss.uid);
  385.                     },
  386.                     "icon": ""
  387.                 },
  388.                 "G3": {
  389.                     "name": "Five-Finger Discount",
  390.                     "tooltip": "A chance to steal a random catalog item from a monster (unimplemented)" ,
  391.                     "flavorText": null,
  392.                     "alwaysAvailable": false,
  393.                     "setupFunction": function() {},
  394.                     "purchaseFunction": function() {
  395.                         var fiveFingerDiscount:Skill = CH2.currentCharacter.getStaticSkill("Five-Finger Discount");
  396.                         CH2.currentCharacter.activateSkill(fiveFingerDiscount.uid);
  397.                     },
  398.                     "icon": ""
  399.                 },
  400.                
  401.                 // General Stat Nodes
  402.                 "Cc": {
  403.                     "name": "Crit Chance",
  404.                     "tooltip": "Adds 2% to your chance to score a critical hit." ,
  405.                     "flavorText": "Ever wonder what happens when you get over 100% Crit Chance? The Ancients once knew, but that is ancient history.",
  406.                     "alwaysAvailable": true,
  407.                     "setupFunction": function(){},
  408.                     "purchaseFunction": function() {CH2.currentCharacter.levelUpStat(CH2.STAT_CRIT_CHANCE)},
  409.                     "icon": "critChance"
  410.                 },
  411.                 "Cd": {
  412.                     "name": "Crit Damage",
  413.                     "tooltip": "Multiplies the damage of your critical hits by 120%." ,
  414.                     "flavorText": "When a number is multiplied by a fixed amount (greater than 1) many times, that number is said to grow \"exponentially\". This is because that process is usually represented by a formula that uses exponential notation.",
  415.                     "alwaysAvailable": true,
  416.                     "setupFunction": function(){},
  417.                     "purchaseFunction": function() {CH2.currentCharacter.levelUpStat(CH2.STAT_CRIT_DAMAGE)},
  418.                     "icon": "critDamage"
  419.                 },         
  420.                 "H": {
  421.                     "name": "Haste",
  422.                     "tooltip": "Multiplies your Haste by 105%." ,
  423.                     "flavorText": "Haste affects the rate that you auto-attack, and all cooldown speeds, including Automator cooldown speeds.",
  424.                     "alwaysAvailable": true,
  425.                     "setupFunction": function(){},
  426.                     "purchaseFunction": function() {CH2.currentCharacter.levelUpStat(CH2.STAT_HASTE)},
  427.                     "icon": "haste"
  428.                 },
  429.                 "Cl": {
  430.                     "name": "Click Damage",
  431.                     "tooltip": "Multiplies your click damage by 110%." ,
  432.                     "flavorText": "This affects damage from all skills that \"click\". But it does not affect auto-attacks, because those are not \"clicks\".",
  433.                     "alwaysAvailable": true,
  434.                     "setupFunction": function(){},
  435.                     "purchaseFunction": function() {CH2.currentCharacter.levelUpStat(CH2.STAT_CLICK_DAMAGE)},
  436.                     "icon": "clickDamage"
  437.                 }
  438.                
  439. /*
  440.                 // Node that adds a skill
  441.                 "N1": {
  442.                     "name": "Skill: Example Skill Node",
  443.                     "tooltip": "Adds Example Skill to this Character" ,
  444.                     "flavorText": null,
  445.                     "alwaysAvailable": true,
  446.                     "setupFunction": function() {},
  447.                     "purchaseFunction": function() {
  448.                         var skill:Skill = CH2.currentCharacter.getStaticSkill("Example Skill");
  449.                         CH2.currentCharacter.activateSkill(skill.uid);
  450.                        
  451.                         CH2.currentCharacter.hasPurchasedFirstSkill = true;
  452.                     },
  453.                     "icon": ""
  454.                 },
  455.                 // Nodes that add traits
  456.                 "N2": {
  457.                     "name": "Example Trait Node",
  458.                     "tooltip": "Increases the damage of Example Skill",
  459.                     "flavorText": "Adds ExampleTrait with a value of 1",
  460.                     "alwaysAvailable": false,
  461.                     "setupFunction": function() {},                
  462.                     "purchaseFunction": function() { CH2.currentCharacter.addTrait("ExampleTrait", 1); },
  463.                     "icon": ""
  464.                 },
  465.                 "N3": {
  466.                     "name": "Another Trait Node",
  467.                     "tooltip": "Increases the damage of Example Skill",
  468.                     "flavorText": "Adds ExampleTrait with a value of 2",
  469.                     "alwaysAvailable": false,
  470.                     "setupFunction": function() {},                
  471.                     "purchaseFunction": function() { CH2.currentCharacter.addTrait("ExampleTrait", 2); },
  472.                     "icon": ""
  473.                 },
  474.                 // Node that levels up a stat
  475.                 "N4": {
  476.                     "name": "Example Stat Node",
  477.                     "tooltip": "Levels up this character's crit chance based on statValueFunctions[CH2.STAT_CRIT_CHANCE]",
  478.                     "flavorText": null,
  479.                     "alwaysAvailable": true,
  480.                     "setupFunction": function() {},                
  481.                     "purchaseFunction": function () { CH2.currentCharacter.levelUpStat(CH2.STAT_CRIT_CHANCE); },
  482.                     "icon": ""
  483.                 },
  484.                 // Another node that adds a skill
  485.                 "N5": {
  486.                     "name": "Skill: Example Buff Skill Node",
  487.                     "tooltip": "Add the Buff Example Skill to this character",
  488.                     "flavorText": null,
  489.                     "alwaysAvailable": true,
  490.                     "setupFunction": function() {},                
  491.                     "purchaseFunction": function () {
  492.                         var skill:Skill = CH2.currentCharacter.getStaticSkill("Buff Example Skill");
  493.                         CH2.currentCharacter.activateSkill(skill.uid);
  494.                     },
  495.                     "icon": ""
  496.                 },
  497.                 // Node that unlocks the automator and creates a gem and stone
  498.                 "AN": {
  499.                     "name": "Automator Examples",
  500.                     "tooltip": "Unlocks the Automator, Example Skill Gem, and Example Cooldown Stone" ,
  501.                     "flavorText": null,
  502.                     "alwaysAvailable": false,
  503.                     "setupFunction": function() {   //setupFunction is run from the onCharacterCreated function below
  504.                         CH2.currentCharacter.automator.addCooldownStone("stone_ExampleCooldown", 5000);
  505.                         CH2.currentCharacter.automator.addSkillGem("gem_exampleSkill", exampleSkill);
  506.                         CH2.currentCharacter.automator.addGem("clicktest", "Perform a click", null, "Performs a single click.", function():Boolean{ CH2.world.onWorldClick(); return true; }, function():Boolean{ return true; }, 0);
  507.                     },
  508.                     "purchaseFunction": function() {
  509.                         CH2.currentCharacter.onAutomatorUnlocked();
  510.                         CH2.currentCharacter.automator.unlockStone("stone_ExampleCooldown");
  511.                         CH2.currentCharacter.automator.unlockGem("gem_exampleSkill");
  512.                         CH2.currentCharacter.automator.unlockGem("clicktest");
  513.                     },
  514.                     "icon": ""
  515.                 }*/
  516.             }
  517.            
  518. //          thief.levelGraphObject = {"edges":[{"1":[1, 2]}, {"2":[1, 3]}, {"3":[1, 4]}, {"4":[4, 5]}, {"5":[1, 6]}], "nodes":[{"1":{"val":"P1", "x":0, "y":0}}, {"2":{"val":"P2", "x":75, "y":0}}, {"3":{"val":"P2", "x": -75, "y":0}}, {"4":{"val":"P3", "x":0, "y": -75}}, {"5":{"val":"P4", "x":0, "y": -150}}, {"6":{"val":"P5", "x":0, "y":75}}]};
  519.            
  520.             //thief.levelGraphObject = {"nodes":[{"14":{"x":569, "val":"Cc", "y":643}}, {"15":{"x":624, "val":"Cd", "y":641}}, {"16":{"x":568, "val":"H", "y":693}}, {"17":{"x":624, "val":"Cl", "y":691}}, {"19":{"x": -1, "val":"P7", "y":1}}, {"21":{"x":65, "val":"P3", "y":100}}, {"22":{"x": -2, "val":"P2", "y":100}}, {"23":{"x": -2, "val":"P6", "y":195}}, {"24":{"x":65, "val":"P5", "y":195}}, {"25":{"x":65, "val":"P1", "y":292}}, {"26":{"x":127, "val":"P2", "y":292}}, {"27":{"x":161, "val":"P9", "y":474}}, {"29":{"x":67, "val":"P8", "y":380}}, {"30":{"x":161, "val":"P5", "y":380}}, {"31":{"x":222, "val":"P1", "y":474}}, {"32":{"x":163, "val":"P4", "y":539}}, {"33":{"x":101, "val":"P2", "y":474}}, {"34":{"x":65, "val":"Cl", "y":1}}, {"28":{"x": -2, "val":"P4", "y":292}}, {"35":{"x":630, "val":"P0", "y":411}}, {"36":{"x":630, "val":"C0", "y":481}}, {"37":{"x":630, "val":"G0", "y":551}}, {"39":{"x":463, "val":"C2", "y":1}}, {"40":{"x":564, "val":"C3", "y":1}}, {"41":{"x":365, "val":"C4", "y":103}}, {"42":{"x":463, "val":"C5", "y":103}}, {"43":{"x":564, "val":"C6", "y":103}}, {"44":{"x":463, "val":"C7", "y":221}}, {"45":{"x":365, "val":"C1", "y":0}}, {"49":{"x": -303, "val":"G1", "y": -5}}, {"50":{"x": -303, "val":"G2", "y":96}}, {"51":{"x": -302, "val":"G3", "y":206}}, {"52":{"x":565, "val":"C8", "y":221}}], "edges":[{"1":[29, 30]}, {"2":[27, 33]}, {"3":[41, 42]}, {"4":[42, 45]}, {"5":[40, 42]}, {"6":[28, 29]}, {"7":[41, 45]}, {"8":[25, 26]}, {"9":[31, 32]}, {"10":[49, 50]}, {"11":[23, 24]}, {"12":[39, 40]}, {"13":[24, 25]}, {"14":[44, 52]}, {"15":[42, 43]}, {"16":[27, 31]}, {"17":[25, 28]}, {"18":[42, 52]}, {"19":[21, 22]}, {"20":[21, 34]}, {"21":[43, 52]}, {"22":[19, 34]}, {"23":[27, 30]}, {"24":[40, 43]}, {"25":[50, 51]}, {"26":[42, 44]}, {"27":[32, 33]}, {"28":[39, 45]}, {"29":[26, 29]}, {"30":[22, 23]}, {"31":[39, 42]}, {"32":[41, 44]}]};
  521.             //thief.levelGraphObject = {"edges":[{"1":[25, 26]}, {"2":[42, 45]}, {"3":[42, 52]}, {"4":[40, 43]}, {"5":[43, 52]}, {"6":[23, 24]}, {"7":[22, 23]}, {"8":[44, 53]}, {"9":[27, 33]}, {"10":[41, 42]}, {"11":[24, 25]}, {"12":[40, 42]}, {"13":[21, 34]}, {"14":[41, 45]}, {"15":[25, 28]}, {"16":[42, 43]}, {"17":[27, 30]}, {"18":[29, 30]}, {"19":[49, 50]}, {"20":[39, 40]}, {"21":[32, 33]}, {"22":[42, 44]}, {"23":[41, 53]}, {"24":[44, 52]}, {"25":[21, 22]}, {"26":[26, 29]}, {"27":[28, 29]}, {"28":[50, 51]}, {"29":[39, 42]}, {"30":[42, 53]}, {"31":[31, 32]}, {"32":[27, 31]}, {"33":[19, 34]}, {"34":[39, 45]}], "nodes":[{"14":{"x":569, "val":"Cc", "y":643}}, {"15":{"x":624, "val":"Cd", "y":641}}, {"16":{"x":568, "val":"H", "y":693}}, {"17":{"x":624, "val":"Cl", "y":691}}, {"19":{"x": -1, "val":"P7", "y":1}}, {"21":{"x":65, "val":"P3", "y":100}}, {"22":{"x": -2, "val":"P2", "y":100}}, {"23":{"x": -2, "val":"P6", "y":195}}, {"24":{"x":65, "val":"P5", "y":195}}, {"25":{"x":65, "val":"P1", "y":292}}, {"26":{"x":127, "val":"P2", "y":292}}, {"27":{"x":161, "val":"P9", "y":474}}, {"29":{"x":67, "val":"P8", "y":380}}, {"30":{"x":161, "val":"P5", "y":380}}, {"31":{"x":222, "val":"P1", "y":474}}, {"32":{"x":163, "val":"P4", "y":539}}, {"33":{"x":101, "val":"P2", "y":474}}, {"34":{"x":65, "val":"Cl", "y":1}}, {"28":{"x": -2, "val":"P4", "y":292}}, {"35":{"x":630, "val":"P0", "y":411}}, {"36":{"x":630, "val":"C0", "y":481}}, {"37":{"x":630, "val":"G0", "y":551}}, {"39":{"x":463, "val":"C2", "y":1}}, {"40":{"x":564, "val":"C3", "y":1}}, {"41":{"x":365, "val":"C4", "y":103}}, {"42":{"x":463, "val":"C5", "y":103}}, {"43":{"x":564, "val":"C6", "y":103}}, {"44":{"x":463, "val":"C8", "y":221}}, {"45":{"x":365, "val":"C1", "y":0}}, {"49":{"x": -303, "val":"G1", "y": -5}}, {"50":{"x": -303, "val":"G2", "y":96}}, {"51":{"x": -302, "val":"G3", "y":206}}, {"52":{"x":565, "val":"C9", "y":221}}, {"53":{"x":365, "val":"C7", "y":221}}]};
  522.             thief.levelGraphObject = {"nodes":[{"14":{"x":569, "val":"Cc", "y":643}}, {"15":{"x":624, "val":"Cd", "y":641}}, {"16":{"x":568, "val":"H", "y":693}}, {"17":{"x":624, "val":"Cl", "y":691}}, {"19":{"x": -1, "val":"P7", "y":1}}, {"21":{"x":65, "val":"P3", "y":100}}, {"22":{"x": -2, "val":"P2", "y":100}}, {"23":{"x": -2, "val":"P6", "y":195}}, {"24":{"x":65, "val":"P5", "y":195}}, {"25":{"x":65, "val":"P1", "y":292}}, {"26":{"x":127, "val":"P2", "y":292}}, {"27":{"x":161, "val":"P9", "y":474}}, {"29":{"x":67, "val":"P8", "y":380}}, {"30":{"x":161, "val":"P5", "y":380}}, {"31":{"x":222, "val":"P1", "y":474}}, {"32":{"x":163, "val":"P4", "y":539}}, {"33":{"x":101, "val":"P2", "y":474}}, {"34":{"x":65, "val":"Cl", "y":1}}, {"28":{"x": -2, "val":"P4", "y":292}}, {"35":{"x":630, "val":"P0", "y":411}}, {"36":{"x":630, "val":"C0", "y":481}}, {"37":{"x":630, "val":"G0", "y":551}}, {"39":{"x":463, "val":"C2", "y":1}}, {"40":{"x":564, "val":"C3", "y":1}}, {"41":{"x":365, "val":"C4", "y":103}}, {"42":{"x":463, "val":"C5", "y":103}}, {"43":{"x":564, "val":"C6", "y":103}}, {"44":{"x":463, "val":"C8", "y":221}}, {"45":{"x":365, "val":"C1", "y":0}}, {"49":{"x": -303, "val":"G1", "y": -5}}, {"50":{"x": -303, "val":"G2", "y":96}}, {"51":{"x": -302, "val":"G3", "y":206}}, {"52":{"x":565, "val":"C9", "y":221}}, {"53":{"x":365, "val":"C7", "y":221}}, {"54":{"x":463, "val":"C10", "y":296}}], "edges":[{"1":[52, 54]}, {"2":[19, 34]}, {"3":[31, 32]}, {"4":[41, 45]}, {"5":[42, 44]}, {"6":[23, 24]}, {"7":[44, 54]}, {"8":[39, 40]}, {"9":[29, 30]}, {"10":[42, 43]}, {"11":[28, 29]}, {"12":[44, 53]}, {"13":[39, 42]}, {"14":[42, 52]}, {"15":[42, 54]}, {"16":[24, 25]}, {"17":[43, 52]}, {"18":[27, 31]}, {"19":[21, 22]}, {"20":[21, 34]}, {"21":[25, 26]}, {"22":[39, 45]}, {"23":[32, 33]}, {"24":[42, 53]}, {"25":[41, 53]}, {"26":[25, 28]}, {"27":[50, 51]}, {"28":[22, 23]}, {"29":[49, 50]}, {"30":[27, 30]}, {"31":[26, 29]}, {"32":[40, 43]}, {"33":[27, 33]}, {"34":[41, 42]}, {"35":[53, 54]}, {"36":[42, 45]}, {"37":[44, 52]}, {"38":[40, 42]}]};
  523.            
  524.             thief.levelGraph = LevelGraph.loadGraph(thief.levelGraphObject, thief);
  525.            
  526.             var leap:Skill = new Skill();
  527.             leap.modName = MOD_INFO["name"];
  528.             leap.name = "Leap";
  529.             leap.description = "Leap backwards";
  530.             leap.cooldown = 4000;
  531.             leap.iconId = 158;
  532.             leap.manaCost = 0;
  533.             leap.energyCost = 1;
  534.             leap.effectFunction = leapEffect;
  535.             leap.ignoresGCD = false;
  536.             leap.maximumRange = 9000;
  537.             leap.minimumRange = 0;
  538.             leap.tooltipFunction = function():Object {
  539.                 return this.skillTooltip("Leap backwards");
  540.             }
  541.             Character.staticSkillInstances[leap.name] = leap;
  542.            
  543.             var throwDagger:Skill = new Skill();
  544.             throwDagger.modName = MOD_INFO["name"];
  545.             throwDagger.name = "Throw Dagger";
  546.             throwDagger.description = "Throw a dagger at an enemy outside of melee range.";
  547.             throwDagger.cooldown = 2000;
  548.             throwDagger.iconId = 166;
  549.             throwDagger.manaCost = 0;
  550.             throwDagger.energyCost = 2;
  551.             throwDagger.effectFunction = throwDaggerEffect;
  552.             throwDagger.ignoresGCD = true;
  553.             throwDagger.maximumRange = 600;
  554.             throwDagger.minimumRange = 150;
  555.             throwDagger.tooltipFunction = function():Object {
  556.                 return this.skillTooltip("Throw dagger");
  557.             }
  558.             Character.staticSkillInstances[throwDagger.name] = throwDagger;
  559.            
  560.             var distract:Skill = new Skill();
  561.             distract.modName = MOD_INFO["name"];
  562.             distract.name = "Distract";
  563.             distract.description = "Distract";
  564.             distract.cooldown = 6000;
  565.             distract.iconId = 57;
  566.             distract.manaCost = 0;
  567.             distract.energyCost = 1;
  568.             distract.effectFunction = distractEffect;
  569.             distract.ignoresGCD = true;
  570.             distract.maximumRange = 9000;
  571.             distract.minimumRange = 150;
  572.             distract.tooltipFunction = function():Object {
  573.                 return this.skillTooltip("Distract");
  574.             }
  575.             Character.staticSkillInstances[distract.name] = distract;
  576.            
  577.             var pickPocket:Skill = new Skill();
  578.             pickPocket.modName = MOD_INFO["name"];
  579.             pickPocket.name = "Pick Pocket";
  580.             pickPocket.description = "Picks a Pocket";
  581.             pickPocket.cooldown = 10000;
  582.             pickPocket.iconId = 97;
  583.             pickPocket.manaCost = 0;
  584.             pickPocket.energyCost = 10;
  585.             pickPocket.effectFunction = pickPocketEffect;
  586.             pickPocket.ignoresGCD = false;
  587.             pickPocket.maximumRange = 150;
  588.             pickPocket.minimumRange = 0;
  589.             pickPocket.tooltipFunction = function():Object {
  590.                 return this.skillTooltip("Picks a Pocket");
  591.             }
  592.             Character.staticSkillInstances[pickPocket.name] = pickPocket;
  593.            
  594.             var basicPoison:Skill = new Skill();
  595.             basicPoison.modName = MOD_INFO["name"];
  596.             basicPoison.name = "Basic Poison";
  597.             basicPoison.description = "Applies 25 poison stacks to current monster";
  598.             basicPoison.cooldown = 5000;
  599.             basicPoison.iconId = 43;
  600.             basicPoison.manaCost = 0;
  601.             basicPoison.energyCost = 5;
  602.             basicPoison.effectFunction = basicPoisonEffect;
  603.             basicPoison.ignoresGCD = false;
  604.             basicPoison.maximumRange = 9000;
  605.             basicPoison.minimumRange = 0;
  606.             basicPoison.tooltipFunction = function():Object {
  607.                 return this.skillTooltip("Applies 25 poison stacks to current monster");
  608.             }
  609.             Character.staticSkillInstances[basicPoison.name] = basicPoison;
  610.            
  611.             var bouncePoison:Skill = new Skill();
  612.             bouncePoison.modName = MOD_INFO["name"];
  613.             bouncePoison.name = "Poison Bounce";
  614.             bouncePoison.description = "Applies 15 poison stacks to the next 2 monsters";
  615.             bouncePoison.cooldown = 5000;
  616.             bouncePoison.iconId = 185;
  617.             bouncePoison.manaCost = 0;
  618.             bouncePoison.energyCost = 15;
  619.             bouncePoison.effectFunction = bouncePoisonEffect;
  620.             bouncePoison.ignoresGCD = false;
  621.             bouncePoison.maximumRange = 200;
  622.             bouncePoison.minimumRange = 0;
  623.             bouncePoison.tooltipFunction = function():Object {
  624.                 return this.skillTooltip("Applies 15 poison stacks to the next 2 monsters");
  625.             }
  626.             Character.staticSkillInstances[bouncePoison.name] = bouncePoison;
  627.            
  628.             var splurt:Skill = new Skill();
  629.             splurt.modName = MOD_INFO["name"];
  630.             splurt.name = "Splurt";
  631.             splurt.description = "For the next 30 seconds, monsters' poison debuffs will gain 2 stacks each tick instead of lose them";
  632.             splurt.cooldown = 150000;
  633.             splurt.iconId = 108;
  634.             splurt.manaCost = 0;
  635.             splurt.energyCost = 15;
  636.             splurt.effectFunction = splurtEffect;
  637.             splurt.ignoresGCD = false;
  638.             splurt.maximumRange = 9000;
  639.             splurt.minimumRange = 0;
  640.             splurt.tooltipFunction = function():Object {
  641.                 return this.skillTooltip("For the next 30 seconds, monsters' poison debuffs will gain 2 stacks each tick instead of lose them");
  642.             }
  643.             Character.staticSkillInstances[splurt.name] = splurt;
  644.            
  645.             var backstab:Skill = new Skill();
  646.             backstab.modName = MOD_INFO["name"];
  647.             backstab.name = "Backstab";
  648.             backstab.description = "Stabs a Back";
  649.             backstab.cooldown = 5000;
  650.             backstab.iconId = 102;
  651.             backstab.manaCost = 0;
  652.             backstab.energyCost = 5;
  653.             backstab.effectFunction = backstabEffect;
  654.             backstab.ignoresGCD = false;
  655.             backstab.maximumRange = 150;
  656.             backstab.minimumRange = 0;
  657.             backstab.tooltipFunction = function():Object {
  658.                 return this.skillTooltip("Stabs a Back");
  659.             }
  660.             Character.staticSkillInstances[backstab.name] = backstab;
  661.            
  662.             var preparation:Skill = new Skill();
  663.             preparation.modName = MOD_INFO["name"];
  664.             preparation.name = "Preparation";
  665.             preparation.description = "Consume stacks of preparation to temporarily increase haste";
  666.             preparation.cooldown = 5000;
  667.             preparation.iconId = 91;
  668.             preparation.manaCost = 0;
  669.             preparation.energyCost = 5;
  670.             preparation.effectFunction = preparationEffect;
  671.             preparation.ignoresGCD = false;
  672.             preparation.maximumRange = 9000;
  673.             preparation.minimumRange = 0;
  674.             preparation.tooltipFunction = function():Object {
  675.                 return this.skillTooltip("Consume stacks of preparation to temporarily increase haste");
  676.             }
  677.             Character.staticSkillInstances[preparation.name] = preparation;
  678.            
  679.             var coinToss:Skill = new Skill();
  680.             coinToss.modName = MOD_INFO["name"];
  681.             coinToss.name = "Coin Toss";
  682.             coinToss.description = "Toss some of your gold at a monster to do damage";
  683.             coinToss.cooldown = 5000;
  684.             coinToss.iconId = 96;
  685.             coinToss.manaCost = 0;
  686.             coinToss.energyCost = 0;
  687.             coinToss.effectFunction = coinTossEffect;
  688.             coinToss.ignoresGCD = false;
  689.             coinToss.maximumRange = 150;
  690.             coinToss.minimumRange = 0;
  691.             coinToss.tooltipFunction = function():Object {
  692.                 return this.skillTooltip("Toss some of your gold at a monster to do damage");
  693.             }
  694.             Character.staticSkillInstances[coinToss.name] = coinToss;
  695.            
  696.             var fiveFingerDiscount:Skill = new Skill();
  697.             fiveFingerDiscount.modName = MOD_INFO["name"];
  698.             fiveFingerDiscount.name = "Five-Finger Discount";
  699.             fiveFingerDiscount.description = "A chance to steal a random catalog item from a monster";
  700.             fiveFingerDiscount.cooldown = 5000;
  701.             fiveFingerDiscount.iconId = 98;
  702.             fiveFingerDiscount.manaCost = 0;
  703.             fiveFingerDiscount.energyCost = 0;
  704.             fiveFingerDiscount.effectFunction = fiveFingerDiscountEffect;
  705.             fiveFingerDiscount.ignoresGCD = false;
  706.             fiveFingerDiscount.maximumRange = 150;
  707.             fiveFingerDiscount.minimumRange = 0;
  708.             fiveFingerDiscount.tooltipFunction = function():Object {
  709.                 return this.skillTooltip("A chance to steal a random catalog item from a monster");
  710.             }
  711.             Character.staticSkillInstances[fiveFingerDiscount.name] = fiveFingerDiscount;
  712.            
  713.             var buyBloopcoins:Skill = new Skill();
  714.             buyBloopcoins.modName = MOD_INFO["name"];
  715.             buyBloopcoins.name = "Buy Bloopcoins";
  716.             buyBloopcoins.description = "Spend gold to buy bloopcoins";
  717.             buyBloopcoins.cooldown = 0;
  718.             buyBloopcoins.iconId = 94;
  719.             buyBloopcoins.manaCost = 0;
  720.             buyBloopcoins.energyCost = 0;
  721.             buyBloopcoins.effectFunction = buyBloopcoinsEffect;
  722.             buyBloopcoins.ignoresGCD = true;
  723.             buyBloopcoins.maximumRange = 9000;
  724.             buyBloopcoins.minimumRange = 0;
  725.             buyBloopcoins.tooltipFunction = function():Object {
  726.                 return this.skillTooltip("Spend gold to buy bloopcoins");
  727.             }
  728.             Character.staticSkillInstances[buyBloopcoins.name] = buyBloopcoins;
  729.            
  730.             var sellBloopcoins:Skill = new Skill();
  731.             sellBloopcoins.modName = MOD_INFO["name"];
  732.             sellBloopcoins.name = "Sell Bloopcoins";
  733.             sellBloopcoins.description = "Sell your bloopcoins for gold";
  734.             sellBloopcoins.cooldown = 0;
  735.             sellBloopcoins.iconId = 95;
  736.             sellBloopcoins.manaCost = 0;
  737.             sellBloopcoins.energyCost = 0;
  738.             sellBloopcoins.effectFunction = sellBloopcoinsEffect;
  739.             sellBloopcoins.ignoresGCD = true;
  740.             sellBloopcoins.maximumRange = 9000;
  741.             sellBloopcoins.minimumRange = 0;
  742.             sellBloopcoins.tooltipFunction = function():Object {
  743.                 return this.skillTooltip("Sell your bloopcoins for gold");
  744.             }
  745.             Character.staticSkillInstances[sellBloopcoins.name] = sellBloopcoins;
  746.            
  747. /*         
  748.             var exampleSkill:Skill = new Skill;
  749.            
  750.             exampleSkill.modName = MOD_INFO["name"];
  751.             exampleSkill.name = "Example Skill";
  752.             exampleSkill.description = "";
  753.             exampleSkill.cooldown = 1000;
  754.             exampleSkill.iconId = 100;
  755.             exampleSkill.manaCost = 0;
  756.             exampleSkill.energyCost = 1;
  757.             exampleSkill.minimumAscensions = 0;
  758.             exampleSkill.effectFunction = exampleEffect;        // References exampleEffect function defined below
  759.             exampleSkill.ignoresGCD = false;
  760.             exampleSkill.maximumRange = 9000;
  761.             exampleSkill.minimumRange = 0;
  762.             exampleSkill.tooltipFunction = function():Object {
  763.                 var traitValue:Number = CH2.currentCharacter.getTrait("ExampleTrait");
  764.                 var damage:Number = 100 * (1 + traitValue);
  765.                 return this.skillTooltip("Does 100 * (1 + " + traitValue + ") damage to next monster (" + damage + " damage)");
  766.             }
  767.             Character.staticSkillInstances[exampleSkill.name] = exampleSkill;
  768.            
  769.            
  770.             // Another Skill
  771.            
  772.             var buffExampleSkill:Skill = new Skill;
  773.            
  774.             buffExampleSkill.modName = MOD_INFO["name"];
  775.             buffExampleSkill.name = "Buff Example Skill";
  776.             buffExampleSkill.description = "";
  777.             buffExampleSkill.cooldown = 1000;
  778.             buffExampleSkill.iconId = 101;
  779.             buffExampleSkill.manaCost = 10;
  780.             buffExampleSkill.energyCost = 0;
  781.             buffExampleSkill.minimumAscensions = 0;
  782.             buffExampleSkill.effectFunction = buffExampleEffect;    // References buffExampleEffect function defined below
  783.             buffExampleSkill.ignoresGCD = false;
  784.             buffExampleSkill.maximumRange = 9000;
  785.             buffExampleSkill.minimumRange = 0;
  786.             buffExampleSkill.tooltipFunction = function():Object {
  787.                 return this.skillTooltip("Adds Example Buff to this Character");
  788.             }
  789.             Character.staticSkillInstances[buffExampleSkill.name] = buffExampleSkill;          
  790.            
  791. */         
  792.             // Overwriting the default stat values and level up functions
  793.            
  794.             thief.statBaseValues[CH2.STAT_CRIT_CHANCE] = 0.1;
  795.            
  796.             // Default: statValueFunctions[CH2.STAT_CRIT_CHANCE] = Character.linear(0.02);
  797.             thief.statValueFunctions[CH2.STAT_HASTE] = Character.linear(0.1, 1);
  798.             thief.statValueFunctions[CH2.STAT_CRIT_DAMAGE] = Character.linear(0.03, 1);
  799.             // Default: statValueFunctions[CH2.STAT_CLICK_DAMAGE] = exponentialMultiplier(1.1);
  800.            
  801.         }
  802.        
  803.         public function onCharacterCreated(characterInstance:Character):void
  804.         {
  805.            
  806.             if (characterInstance.name == "Thief") {
  807.                
  808.                 //characterInstance.onCharacterDisplayCreated = setUpDisplay; // References setUpDisplay function defined below
  809.                 characterInstance.onCharacterDisplayCreatedHandler = this;
  810.                
  811.                 //characterInstance.attack = thiefAttack;
  812.                 //characterInstance.onKilledMonster = thiefOnKilledMonster;
  813.                 characterInstance.attackHandler = this;
  814.                 characterInstance.onKilledMonsterHandler = this;
  815.                
  816.                 // Adds a mod dependency to character saves created with this mod
  817.                 characterInstance.modDependencies[MOD_INFO["name"]] = true;
  818.             }
  819.            
  820.         }
  821.        
  822.         // Function Referenced by onCharacterDisplayCreated
  823.         //public function setUpDisplay(display:CharacterDisplay):void // Requires import heroclickerlib.world.CharacterDisplay
  824.         public function onCharacterDisplayCreatedOverride(display:CharacterDisplay):void
  825.         {
  826.            
  827.             // Loading a Sound
  828.             // Requires import heroclickerlib.managers.SoundManager
  829.            
  830.             SoundManager.instance.loadAudioClass("audio/HelpfulAdventurer/power_surge_activate");
  831.            
  832.             // Default Attack Sounds
  833.             SoundManager.instance.loadAudioClass("audio/HelpfulAdventurer/critical_hit");
  834.             SoundManager.instance.loadAudioClass("audio/HelpfulAdventurer/hit");
  835.            
  836.         }
  837.        
  838.         public function leapEffect():void
  839.         {
  840.             var character:Character = CH2.currentCharacter;
  841.             character.y -= 250;
  842.             character.state = Character.STATE_UNKNOWN;
  843.            
  844.             var buff:Buff = new Buff();        
  845.            
  846.             buff.name = "Leap";
  847.             buff.iconId = 99;
  848.             buff.duration = 2000;
  849.             buff.buffStat(CH2.STAT_MOVEMENT_SPEED, 0.001);
  850.            
  851.             character.buffs.addBuff(buff);
  852.         }
  853.        
  854.         public function distractEffect():void
  855.         {
  856.             var character:Character = CH2.currentCharacter;
  857.             var target:Monster = CH2.world.getNextMonster();
  858.             if (target)
  859.             {
  860.                 var debuff:MonsterDebuff = new MonsterDebuff(target);
  861.                 debuff.duration = 5000 + (5000 * character.getTrait("Extended Distract"));
  862.                 debuff.name = "Distract";
  863.                 debuff.startFunction = function() {
  864.                     target.display.display.scaleX = -1;
  865.                 }
  866.                
  867.                 debuff.attackedFunction = function(attackData:AttackData):void
  868.                 {
  869.                     attackData.damage.timesEqualsN(1.25 + 0.05 * character.getTrait("Distract Damage Bonus"));
  870.                 }
  871.                
  872.                 debuff.finishFunction = function()
  873.                 {
  874.                     target.display.display.scaleX = 1;
  875.                 }
  876.                 target.addDebuff(debuff);
  877.             }
  878.         }
  879.        
  880.         public function throwDaggerEffect():void {
  881.             var character:Character = CH2.currentCharacter;
  882.             var target:Monster;
  883.             var daggerCount:Number = character.getTrait("Fan of Knives") + 1;
  884.             var damageMultiplier:Number = 5 + character.getTrait("Throw Dagger Damage");
  885.             var poisonDagger:Number = character.getTrait("Poison Dagger");
  886.            
  887.             for (var i:int = 0; i < daggerCount; i++)
  888.             {
  889.                 target = CH2.world.getNextMonster();
  890.                 if (target)
  891.                 {
  892.                     var daggerAttack:AttackData = new AttackData();
  893.                     daggerAttack.damage = character.clickDamage.multiplyN(damageMultiplier);
  894.                     target.takeDamage(daggerAttack);
  895.                    
  896.                     if (poisonDagger)
  897.                     {
  898.                         if (CH2.roller.miscRoller.boolean(0.1 * poisonDagger))
  899.                         {
  900.                             applyPoisonDebuff(target,5);
  901.                         }
  902.                     }
  903.                 }
  904.             }
  905.         }
  906.        
  907.         public function pickPocketEffect():void
  908.         {
  909.             var character:Character = CH2.currentCharacter;
  910.             var target:Monster = CH2.world.getNextMonster();
  911.             if (target)
  912.             {
  913.                 var goldTaken:BigNumber = Formulas.instance.getGoldForZone(character.currentZone);
  914.                
  915.                 if (!target.hasDebuff("Distract"))
  916.                 {
  917.                     goldTaken.timesEqualsN(0.25);
  918.                 }
  919.                
  920.                 character.addGold(goldTaken);
  921.                 ItemDropManager.instance.goldSplash(goldTaken, target.x, target.y, character, "N");
  922.             }
  923.         }
  924.        
  925.         public function backstabEffect():void
  926.         {
  927.             var character:Character = CH2.currentCharacter;
  928.             var target:Monster = CH2.world.getNextMonster();
  929.             if (target)
  930.             {
  931.                 var damage:BigNumber;
  932.                 if (target.hasDebuff("Distract"))
  933.                 {
  934.                     damage = new BigNumber(character.clickDamage.multiplyN(15 + 1.5 * character.getTrait("Backstab Damage")));
  935.                 }
  936.                 else
  937.                 {
  938.                     damage = new BigNumber(0);
  939.                 }
  940.                
  941.                 var attackData:AttackData = new AttackData();
  942.                 attackData.monster = target;
  943.                 attackData.damage = damage;
  944.                
  945.                 character.attack(attackData);
  946.                
  947.                 var backstabChain:Number = character.getTrait("Backstab Chain");
  948.                 if (backstabChain)
  949.                 {
  950.                     if (CH2.roller.miscRoller.boolean(0.05 * backstabChain))
  951.                     {
  952.                         character.getSkill("Backstab").cooldownRemaining = 0;
  953.                         character.gcdRemaining = 0;
  954.                     }
  955.                 }
  956.             }
  957.         }
  958.        
  959.         public function preparationEffect():void
  960.         {
  961.             var character:Character = CH2.currentCharacter;
  962.             if (character.buffs.hasBuffByName("Preparation"))
  963.             {
  964.                 var prepBuff:Buff = character.buffs.getBuff("Preparation");
  965.                
  966.                 var hasteBuff:Buff = new Buff();           
  967.                
  968.                 hasteBuff.name = "Prepared Haste";
  969.                 hasteBuff.iconId = 91;
  970.                 hasteBuff.duration = 15000;
  971.                 hasteBuff.tooltipFunction = function()
  972.                 {
  973.                     return {
  974.                         "header": "Prepared Haste",
  975.                         "body": "Haste increased!"
  976.                     };
  977.                 }
  978.                 hasteBuff.buffStat(CH2.STAT_HASTE, 1 + prepBuff.stacks);
  979.                
  980.                 character.buffs.addBuff(hasteBuff);
  981.                
  982.                 prepBuff.stacks = 0;
  983.                 //character.buffs.removeBuff(prepBuff);
  984.             }
  985.         }
  986.        
  987.         public function basicPoisonEffect():void
  988.         {
  989.             var target:Monster = CH2.world.getNextMonster();
  990.             if (target)
  991.             {
  992.                 applyPoisonDebuff(target,25);
  993.             }
  994.         }
  995.        
  996.         public function splurtEffect():void
  997.         {
  998.             var character:Character = CH2.currentCharacter;
  999.            
  1000.             var splurtBuff:Buff = new Buff();          
  1001.            
  1002.             splurtBuff.name = "Splurt";
  1003.             splurtBuff.iconId = 108;
  1004.             splurtBuff.duration = 30000;
  1005.             splurtBuff.tooltipFunction = function()
  1006.             {
  1007.                 return {
  1008.                     "header": "Splurt",
  1009.                     "body": "Poisons applied to monsters gain 2 stacks each tick"
  1010.                 };
  1011.             }
  1012.            
  1013.             character.buffs.addBuff(splurtBuff);
  1014.            
  1015.         }
  1016.        
  1017.         public function bouncePoisonEffect():void
  1018.         {
  1019.             var character:Character = CH2.currentCharacter;
  1020.             var characterY:Number = character.y;
  1021.             var characterX:Number = character.x;
  1022.             var monster:Monster;
  1023.             var targets:Array;
  1024.            
  1025.             if (character.getTrait("Triple Bounce"))
  1026.             {
  1027.                 targets = CH2.world.monsters.getMonstersInRadius(characterX, characterY, 600);
  1028.             }
  1029.             else
  1030.             {
  1031.                 targets = CH2.world.monsters.getMonstersInRadius(characterX, characterY, 400);
  1032.             }
  1033.            
  1034.             var targetsLength:int = targets.length;
  1035.            
  1036.             for (var i:int = 0; i < targetsLength; i++)
  1037.             {
  1038.                 monster = targets[i];
  1039.                 if (monster.isAlive && monster.y >= characterY)
  1040.                 {
  1041.                     applyPoisonDebuff(monster,15);
  1042.                 }
  1043.             }  
  1044.         }
  1045.        
  1046.         public function coinTossEffect():void
  1047.         {
  1048.             var target = CH2.world.getNextMonster();
  1049.             var character:Character = CH2.currentCharacter;
  1050.            
  1051.             if (target)
  1052.             {
  1053.                 var goldToThrow:BigNumber = new BigNumber(5);
  1054.                 if (character.gold.gte(goldToThrow)) {
  1055.                     character.subtractGold(goldToThrow);
  1056.                    
  1057.                     var goldDamage:BigNumber = new BigNumber(goldToThrow.multiplyN(10));
  1058.                     var goldAttackData:AttackData = new AttackData();
  1059.                     goldAttackData.damage = goldDamage;
  1060.                     target.takeDamage(goldAttackData);
  1061.                 }
  1062.             }
  1063.         }
  1064.        
  1065.         public function fiveFingerDiscountEffect():void
  1066.         {
  1067.             var target = CH2.world.getNextMonster();
  1068.             var character:Character = CH2.currentCharacter;
  1069.            
  1070.             if (target)
  1071.             {
  1072.                
  1073.             }
  1074.         }
  1075.        
  1076.         var bloopcoins:Number = 0;
  1077.         var exchangeRate:Number = 1;
  1078.            
  1079.         public function buyBloopcoinsEffect():void
  1080.         {
  1081.             var character = CH2.currentCharacter;
  1082.             var amountToBuy:Number = 5;
  1083.             var bloopcoinCost:BigNumber = new BigNumber(amountToBuy * exchangeRate);
  1084.            
  1085.             if (character.gold.gte(bloopcoinCost))
  1086.             {
  1087.                 character.subtractGold(bloopcoinCost);
  1088.                 bloopcoins += amountToBuy;
  1089.                
  1090.                 if (!character.buffs.hasBuffByName("Bloopcoins"))
  1091.                 {
  1092.                     applyBloopcoinBuff();
  1093.                 }
  1094.             }
  1095.         }
  1096.        
  1097.         public function sellBloopcoinsEffect():void
  1098.         {
  1099.             var character = CH2.currentCharacter;
  1100.             if (bloopcoins > 0)
  1101.             {
  1102.                 var bloopcoinValue:BigNumber = new BigNumber(bloopcoins * exchangeRate);
  1103.                 character.addGold(bloopcoinValue);
  1104.                 bloopcoins = 0;
  1105.             }
  1106.         }
  1107.        
  1108.         public function applyExchangeRateBuff():void
  1109.         {
  1110.             var exchangeRateBuff:Buff = new Buff();        
  1111.            
  1112.             exchangeRateBuff.name = "Bloopcoin Exchange Rate";
  1113.             exchangeRateBuff.iconId = 93;
  1114.             exchangeRateBuff.isUntimedBuff = true;
  1115.             exchangeRateBuff.tooltipFunction = function() {
  1116.                 return {
  1117.                     "header": "Bloopcoin Exchange Rate",
  1118.                     "body": "Current rate: " + exchangeRate
  1119.                 };
  1120.             }
  1121.            
  1122.             CH2.currentCharacter.buffs.addBuff(exchangeRateBuff);
  1123.         }
  1124.        
  1125.         public function applyBloopcoinBuff():void
  1126.         {
  1127.             var bloopcoinBuff:Buff = new Buff();           
  1128.            
  1129.             bloopcoinBuff.name = "Bloopcoins";
  1130.             bloopcoinBuff.iconId = 94;
  1131.             bloopcoinBuff.isUntimedBuff = true;
  1132.             bloopcoinBuff.tooltipFunction = function() {
  1133.                 return {
  1134.                     "header": "Bloopcoins!",
  1135.                     "body": "Current amount: " + bloopcoins
  1136.                 };
  1137.             }
  1138.            
  1139.             CH2.currentCharacter.buffs.addBuff(bloopcoinBuff);
  1140.         }
  1141.        
  1142.         public function applyPreparationBuff():void
  1143.         {
  1144.             var character:Character = CH2.currentCharacter;
  1145.             if (character.buffs.hasBuffByName("Preparation"))
  1146.             {
  1147.                 var currentBuff:Buff = character.buffs.getBuff("Preparation");
  1148.                 currentBuff.stacks += 1;
  1149.             }
  1150.             else
  1151.             {
  1152.                 var preparationBuff:Buff = new Buff(); 
  1153.                
  1154.                 preparationBuff.name = "Preparation";
  1155.                 preparationBuff.iconId = 90;
  1156.                 preparationBuff.isUntimedBuff = true;
  1157.                 preparationBuff.tickFunction = function() {
  1158.                     if (preparationBuff.stacks <= 0) {
  1159.                         preparationBuff.isFinished = true;
  1160.                     }
  1161.                 }
  1162.                 preparationBuff.tooltipFunction = function() {
  1163.                     return {
  1164.                         "header": "Preparation",
  1165.                         "body": "Current stacks: " + preparationBuff.stacks
  1166.                     };
  1167.                 }
  1168.                
  1169.                 CH2.currentCharacter.buffs.addBuff(preparationBuff);
  1170.             }
  1171.         }
  1172.        
  1173.         public function applyPoisonDebuff(target:Monster, stacks:int):void
  1174.         {
  1175.             if (target)
  1176.             {
  1177.                 var currentPoison:MonsterDebuff = target.getDebuff("Poison");
  1178.                 if (currentPoison)
  1179.                 {
  1180.                     currentPoison.stacks += stacks;
  1181.                     return;
  1182.                 }
  1183.                 var debuff:MonsterDebuff = new MonsterDebuff(target);
  1184.                 var character:Character = CH2.currentCharacter;
  1185.                 var poisonStacksLostPerTick:int = 5 - character.getTrait("Slow Poison");
  1186.                 debuff.name = "Poison";
  1187.                 debuff.isUntimedDebuff = true;
  1188.                 debuff.isStackable = true;
  1189.                 debuff.stacks += stacks;
  1190.                 debuff.tickFunction = function() {
  1191.                     var poisonDamageNumber:BigNumber = new BigNumber(character.clickDamage.multiplyN((0.08 + 0.01 * character.getTrait("Poison Damage")) * debuff.stacks));
  1192.                     var poisonDamage:AttackData = new AttackData();
  1193.                     poisonDamage.damage = poisonDamageNumber;
  1194.                     target.takeDamage(poisonDamage);
  1195.                    
  1196.                     if (character.buffs.hasBuffByName("Splurt"))
  1197.                     {
  1198.                         debuff.stacks += 2;
  1199.                     }
  1200.                     else
  1201.                     {
  1202.                         debuff.stacks -= poisonStacksLostPerTick;
  1203.                     }
  1204.                    
  1205.                     if (debuff.stacks <= 0)
  1206.                     {
  1207.                         debuff.isFinished = true;
  1208.                     }
  1209.                    
  1210.                     var effect:GpuMovieClip = CH2AssetManager.instance.getGpuMovieClip("HelpfulAdventurer_bamplode1");
  1211.                     effect.gotoAndPlay(1);
  1212.                     effect.isLooping = false;
  1213.                     CH2.world.addEffect(effect, CH2.world.roomsFront, target.x, target.y);
  1214.                 }
  1215.                 debuff.deathFunction = function() {
  1216.                     var contagion:Number = character.getTrait("Contagion");
  1217.                     if (contagion)
  1218.                     {
  1219.                         var nextTarget:Monster = CH2.world.getNextMonster();
  1220.                         var stacksToTransfer:int = Math.floor(debuff.stacks * 0.1 * contagion);
  1221.                         applyPoisonDebuff(nextTarget, stacksToTransfer);
  1222.                     }
  1223.                 }
  1224.                 target.addDebuff(debuff);
  1225.             }
  1226.         }
  1227. /*     
  1228.         // Effect function referenced by exampleSkill
  1229.         public function exampleEffect():void {
  1230.            
  1231.             var monster:Monster =  CH2.world.getNextMonster();      // Requires import models.Monster  
  1232.            
  1233.             if (monster) {             
  1234.                
  1235.                 var attackData:AttackData = new AttackData();       // Requires import models.AttackData
  1236.                
  1237.                
  1238.                 // Using a Trait
  1239.                
  1240.                 var damage:Number;
  1241.                 if (CH2.currentCharacter.getTrait("ExampleTrait")) {
  1242.                     damage = 100 * (1 + CH2.currentCharacter.getTrait("ExampleTrait"));
  1243.                 }
  1244.                 else {
  1245.                     damage = 100;
  1246.                 }
  1247.                
  1248.                
  1249.                 var damageNumber:BigNumber = new BigNumber(damage); // Requires import com.playsaurus.numbers.BigNumber
  1250.                
  1251.                 attackData.damage = damageNumber;                      
  1252.                 CH2.currentCharacter.attack(attackData);
  1253.                
  1254.                
  1255.                 // Playing a Sound
  1256.                 // Requires import heroclickerlib.managers.SoundManager
  1257.                
  1258.                 SoundManager.instance.playSound("power_surge_activate");
  1259.                
  1260.                
  1261.                 // Adding a Visual Effect
  1262.                 // Requires import heroclickerlib.GpuMovieClip
  1263.                 // Requires import heroclickerlib.managers.CH2AssetManager
  1264.                
  1265.                 var effect:GpuMovieClip = CH2AssetManager.instance.getGpuMovieClip("HelpfulAdventurer_bamplode1");
  1266.                 effect.gotoAndPlay(1);
  1267.                 effect.isLooping = false;
  1268.                 CH2.world.addEffect(effect, CH2.world.roomsFront, monster.x, monster.y);
  1269.                
  1270.             }
  1271.         }
  1272.        
  1273.         // Effect function referenced by buffExampleSkill
  1274.         public function buffExampleEffect():void {
  1275.            
  1276.             // Creating a Buff
  1277.             // Requires import models.Buff
  1278.            
  1279.             var buff:Buff = new Buff();        
  1280.            
  1281.             buff.name = "Example Buff";
  1282.             buff.iconId = 200;
  1283.             buff.duration = 5000;
  1284.             buff.tickRate = 1000;
  1285.             buff.tickFunction = function() {
  1286.                 CH2.currentCharacter.addEnergy(5);
  1287.             }
  1288.             buff.tooltipFunction = function() {
  1289.                 return {
  1290.                     "header": "Example Buff",
  1291.                     "body": "Restoring " + (5 * CH2.currentCharacter.hasteRating).toFixed(2) + " energy per second."
  1292.                 };
  1293.             }
  1294.            
  1295.             CH2.currentCharacter.buffs.addBuff(buff);
  1296.         }  
  1297. */     
  1298.         //public function thiefAttack(attackData:AttackData):void
  1299.         public function attackOverride(attackData:AttackData):void
  1300.         {
  1301.             var character:Character = CH2.currentCharacter;
  1302.             character.attackDefault(attackData);
  1303.            
  1304.             if (attackData.monster.isAlive)
  1305.             {
  1306.                 var offhandAttack:AttackData = new AttackData();
  1307.                 if (CH2.roller.miscRoller.boolean(0.3 + 0.05 * character.getTrait("Offhand Accuracy")))
  1308.                 {
  1309.                     offhandAttack.damage = character.damage;
  1310.                     offhandAttack.damage.timesEqualsN(0.3 + 0.05 * character.getTrait("Offhand Damage"));
  1311.                     offhandAttack.isCritical = CH2.roller.attackRoller.boolean(character.criticalChance);
  1312.                     if (offhandAttack.isCritical)
  1313.                     {
  1314.                         offhandAttack.damage.timesEqualsN(character.criticalDamageMultiplier);
  1315.                         if (character.getTrait("Preparation") && !character.buffs.hasBuffByName("Prepared Haste"))
  1316.                         {
  1317.                             applyPreparationBuff();
  1318.                         }
  1319.                     }
  1320.                    
  1321.                     if (character.getTrait("Offhand Poison"))
  1322.                     {
  1323.                         if (CH2.roller.miscRoller.boolean(0.25 * character.getTrait("Offhand Poison")))
  1324.                         {
  1325.                             applyPoisonDebuff(attackData.monster,5);
  1326.                         }
  1327.                     }
  1328.                 }
  1329.                 else
  1330.                 {
  1331.                     offhandAttack.damage = new BigNumber(0);
  1332.                 }
  1333.                 attackData.monster.takeDamage(offhandAttack);
  1334.             }
  1335.            
  1336.             if (attackData.isCritical && character.getTrait("Preparation") && !character.buffs.hasBuffByName("Prepared Haste"))
  1337.             {
  1338.                 applyPreparationBuff();
  1339.             }
  1340.         }
  1341.        
  1342.         //public function thiefOnKilledMonster(monster:Monster):void
  1343.         public function onKilledMonsterOverride(monster:Monster):void
  1344.         {
  1345.             var character = CH2.currentCharacter;
  1346.             if (character.getTrait("Bloopcoin Investment"))
  1347.             {
  1348.                 if (!character.buffs.hasBuffByName("Bloopcoin Exchange Rate"))
  1349.                 {
  1350.                     applyExchangeRateBuff();
  1351.                 }
  1352.                 else
  1353.                 {
  1354.                     var rateChange:Number = CH2.roller.miscRoller.range(-0.05, 0.05);
  1355.                     exchangeRate += rateChange;
  1356.                 }
  1357.             }
  1358.            
  1359.             character.onKilledMonsterDefault(monster);
  1360.         }
  1361.        
  1362.     }
  1363.    
  1364. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement