Section 1
//AdLoader (CPMStar.AdLoader)
package CPMStar {
import flash.system.*;
import flash.display.*;
import flash.net.*;
public class AdLoader {
private static var cpmstarLoader:Loader;
public static function LoadAd(_arg1:int, _arg2:int):DisplayObject{
var _local3:String;
Security.allowDomain("server.cpmstar.com");
Security.allowInsecureDomain("server.cpmstar.com");
_local3 = "http://server.cpmstar.com/adviewas3.swf";
cpmstarLoader = new Loader();
cpmstarLoader.load(new URLRequest(((((_local3 + "?poolid=") + _arg1) + "&subpoolid=") + _arg2)));
return (cpmstarLoader);
}
}
}//package CPMStar
Section 2
//ArmorIntro_393 (monstersdend_fla.ArmorIntro_393)
package monstersdend_fla {
import flash.display.*;
public dynamic class ArmorIntro_393 extends MovieClip {
public function ArmorIntro_393(){
addFrameScript(125, frame126);
}
function frame126(){
this.stop();
MovieClip(parent).gotoAndStop(6);
}
}
}//package monstersdend_fla
Section 3
//BetaFunctionsPanel_175 (monstersdend_fla.BetaFunctionsPanel_175)
package monstersdend_fla {
import flash.text.*;
import flash.display.*;
public dynamic class BetaFunctionsPanel_175 extends MovieClip {
public var betaLevel:TextField;
public var betaEquipment:TextField;
public var betaHeal:TextField;
}
}//package monstersdend_fla
Section 4
//BookCover_69 (monstersdend_fla.BookCover_69)
package monstersdend_fla {
import flash.display.*;
public dynamic class BookCover_69 extends MovieClip {
public var options_button:SimpleButton;
public var credits_button:SimpleButton;
public var continue_button:SimpleButton;
}
}//package monstersdend_fla
Section 5
//CharLocked_45 (monstersdend_fla.CharLocked_45)
package monstersdend_fla {
import flash.display.*;
public dynamic class CharLocked_45 extends MovieClip {
public var logo:SimpleButton;
}
}//package monstersdend_fla
Section 6
//ClassIcon_41 (monstersdend_fla.ClassIcon_41)
package monstersdend_fla {
import flash.display.*;
public dynamic class ClassIcon_41 extends MovieClip {
public var bg:MovieClip;
}
}//package monstersdend_fla
Section 7
//CorridorSegment_83 (monstersdend_fla.CorridorSegment_83)
package monstersdend_fla {
import flash.display.*;
public dynamic class CorridorSegment_83 extends MovieClip {
public function CorridorSegment_83(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package monstersdend_fla
Section 8
//DifficultySelectBG_214 (monstersdend_fla.DifficultySelectBG_214)
package monstersdend_fla {
import flash.display.*;
public dynamic class DifficultySelectBG_214 extends MovieClip {
public function DifficultySelectBG_214(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package monstersdend_fla
Section 9
//EnchantOrbGlow_153 (monstersdend_fla.EnchantOrbGlow_153)
package monstersdend_fla {
import flash.display.*;
public dynamic class EnchantOrbGlow_153 extends MovieClip {
public function EnchantOrbGlow_153(){
addFrameScript(0, frame1);
}
function frame1(){
this.mouseEnabled = false;
}
}
}//package monstersdend_fla
Section 10
//Eye1_7 (monstersdend_fla.Eye1_7)
package monstersdend_fla {
import flash.display.*;
public dynamic class Eye1_7 extends MovieClip {
public function Eye1_7(){
addFrameScript(32, frame33, 91, frame92);
}
function frame92(){
if (Math.random() < 0.7){
this.gotoAndPlay("WaitLeft");
};
}
function frame33(){
if (Math.random() < 0.7){
this.gotoAndPlay("WaitRight");
};
}
}
}//package monstersdend_fla
Section 11
//Eye2_8 (monstersdend_fla.Eye2_8)
package monstersdend_fla {
import flash.display.*;
public dynamic class Eye2_8 extends MovieClip {
public function Eye2_8(){
addFrameScript(71, frame72, 123, frame124);
}
function frame72(){
if (Math.random() < 0.7){
this.gotoAndPlay("WaitLeft");
};
}
function frame124(){
if (Math.random() < 0.7){
this.gotoAndPlay("WaitRight");
};
}
}
}//package monstersdend_fla
Section 12
//FadeScreenDarker_52 (monstersdend_fla.FadeScreenDarker_52)
package monstersdend_fla {
import flash.display.*;
public dynamic class FadeScreenDarker_52 extends MovieClip {
public function FadeScreenDarker_52(){
addFrameScript(5, frame6);
}
function frame6(){
this.gotoAndStop(6);
}
}
}//package monstersdend_fla
Section 13
//FGL_logo_64 (monstersdend_fla.FGL_logo_64)
package monstersdend_fla {
import flash.display.*;
public dynamic class FGL_logo_64 extends MovieClip {
public function FGL_logo_64(){
addFrameScript(24, frame25);
}
function frame25(){
this.stop();
}
}
}//package monstersdend_fla
Section 14
//grid_marker_176 (monstersdend_fla.grid_marker_176)
package monstersdend_fla {
import flash.text.*;
import flash.display.*;
public dynamic class grid_marker_176 extends MovieClip {
public var owner_label:TextField;
}
}//package monstersdend_fla
Section 15
//IconEnchantGlow_146 (monstersdend_fla.IconEnchantGlow_146)
package monstersdend_fla {
import flash.display.*;
public dynamic class IconEnchantGlow_146 extends MovieClip {
public function IconEnchantGlow_146(){
addFrameScript(0, frame1);
}
function frame1(){
this.gotoAndStop(1);
}
}
}//package monstersdend_fla
Section 16
//InventoryProcessing_120 (monstersdend_fla.InventoryProcessing_120)
package monstersdend_fla {
import flash.display.*;
public dynamic class InventoryProcessing_120 extends MovieClip {
public function InventoryProcessing_120(){
addFrameScript(0, frame1, 29, frame30);
}
function frame1(){
this.stop();
}
function frame30(){
this.gotoAndPlay(2);
}
}
}//package monstersdend_fla
Section 17
//KongIntro_378 (monstersdend_fla.KongIntro_378)
package monstersdend_fla {
import flash.display.*;
public dynamic class KongIntro_378 extends MovieClip {
public function KongIntro_378(){
addFrameScript(144, frame145);
}
function frame145(){
this.stop();
MovieClip(parent).gotoAndStop(6);
}
}
}//package monstersdend_fla
Section 18
//ListEntryBG_350 (monstersdend_fla.ListEntryBG_350)
package monstersdend_fla {
import flash.display.*;
public dynamic class ListEntryBG_350 extends MovieClip {
public function ListEntryBG_350(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package monstersdend_fla
Section 19
//LoadingSymbol_50 (monstersdend_fla.LoadingSymbol_50)
package monstersdend_fla {
import flash.display.*;
public dynamic class LoadingSymbol_50 extends MovieClip {
public function LoadingSymbol_50(){
addFrameScript(3, frame4);
}
function frame4(){
this.gotoAndStop(4);
}
}
}//package monstersdend_fla
Section 20
//OnKongLoader_3 (monstersdend_fla.OnKongLoader_3)
package monstersdend_fla {
import flash.text.*;
import flash.display.*;
public dynamic class OnKongLoader_3 extends MovieClip {
public var sponsoredText:TextField;
public var kongLogo:SimpleButton;
public var biclopsLogo:SimpleButton;
}
}//package monstersdend_fla
Section 21
//player_arrow_impact_279 (monstersdend_fla.player_arrow_impact_279)
package monstersdend_fla {
import flash.display.*;
public dynamic class player_arrow_impact_279 extends MovieClip {
public var hit:MovieClip;
public function player_arrow_impact_279(){
addFrameScript(11, frame12);
}
function frame12(){
this.gotoAndStop(12);
}
}
}//package monstersdend_fla
Section 22
//PlayGameHint_76 (monstersdend_fla.PlayGameHint_76)
package monstersdend_fla {
import flash.display.*;
public dynamic class PlayGameHint_76 extends MovieClip {
public function PlayGameHint_76(){
addFrameScript(0, frame1);
}
function frame1(){
this.mouseEnabled = false;
this.mouseChildren = false;
}
}
}//package monstersdend_fla
Section 23
//poisonbubble_271 (monstersdend_fla.poisonbubble_271)
package monstersdend_fla {
import flash.display.*;
public dynamic class poisonbubble_271 extends MovieClip {
public function poisonbubble_271(){
addFrameScript(24, frame25);
}
function frame25(){
this.gotoAndStop(25);
}
}
}//package monstersdend_fla
Section 24
//QuestionMarkAnimated_323 (monstersdend_fla.QuestionMarkAnimated_323)
package monstersdend_fla {
import flash.display.*;
public dynamic class QuestionMarkAnimated_323 extends MovieClip {
public function QuestionMarkAnimated_323(){
addFrameScript(14, frame15);
}
function frame15(){
if (this.parent != null){
parent.removeChild(this);
};
}
}
}//package monstersdend_fla
Section 25
//RoomTint_87 (monstersdend_fla.RoomTint_87)
package monstersdend_fla {
import flash.display.*;
public dynamic class RoomTint_87 extends MovieClip {
public function RoomTint_87(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package monstersdend_fla
Section 26
//shield_gleam_251 (monstersdend_fla.shield_gleam_251)
package monstersdend_fla {
import flash.display.*;
public dynamic class shield_gleam_251 extends MovieClip {
public function shield_gleam_251(){
addFrameScript(0, frame1, 14, frame15);
}
function frame15(){
this.gotoAndStop(15);
}
function frame1(){
this.gotoAndStop(1);
}
}
}//package monstersdend_fla
Section 27
//SkillIconBG_12 (monstersdend_fla.SkillIconBG_12)
package monstersdend_fla {
import flash.display.*;
public dynamic class SkillIconBG_12 extends MovieClip {
public function SkillIconBG_12(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package monstersdend_fla
Section 28
//TableIntro_372 (monstersdend_fla.TableIntro_372)
package monstersdend_fla {
import flash.display.*;
public dynamic class TableIntro_372 extends MovieClip {
public var options_button:SimpleButton;
public var credits_button:SimpleButton;
public var continue_button:SimpleButton;
public function TableIntro_372(){
addFrameScript(29, frame30);
}
function frame30(){
this.stop();
}
}
}//package monstersdend_fla
Section 29
//TitleLogoLine_77 (monstersdend_fla.TitleLogoLine_77)
package monstersdend_fla {
import flash.display.*;
public dynamic class TitleLogoLine_77 extends MovieClip {
public var sponsorButton:SimpleButton;
public var armorButton:SimpleButton;
public var biclopsButton:SimpleButton;
public var muteButton:MuteButton;
}
}//package monstersdend_fla
Section 30
//vert_slash_276 (monstersdend_fla.vert_slash_276)
package monstersdend_fla {
import flash.display.*;
public dynamic class vert_slash_276 extends MovieClip {
public var slash:MovieClip;
public function vert_slash_276(){
addFrameScript(11, frame12);
}
function frame12(){
this.gotoAndStop(12);
}
}
}//package monstersdend_fla
Section 31
//VolumeControl_330 (monstersdend_fla.VolumeControl_330)
package monstersdend_fla {
import flash.display.*;
public dynamic class VolumeControl_330 extends MovieClip {
public var sfx_selector:MovieClip;
public var volCloseButton:SimpleButton;
public var global_selector:MovieClip;
public var music_selector:MovieClip;
}
}//package monstersdend_fla
Section 32
//VolumeSelector_331 (monstersdend_fla.VolumeSelector_331)
package monstersdend_fla {
import flash.text.*;
import flash.display.*;
public dynamic class VolumeSelector_331 extends MovieClip {
public var mid:TextField;
public var low:TextField;
public var off:TextField;
public var full:TextField;
}
}//package monstersdend_fla
Section 33
//AccuracyRoll (AccuracyRoll)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class AccuracyRoll extends MovieClip {
private var frameCount:int;// = 0
public var accuracy:TextField;
public function AccuracyRoll(_arg1:String=""):void{
frameCount = 0;
super();
addEventListener(Event.ENTER_FRAME, onFrame);
accuracy.text = _arg1;
}
private function onFrame(_arg1:Event):void{
frameCount++;
if (frameCount > 40){
if (parent != null){
parent.removeChild(this);
};
removeEventListener(Event.ENTER_FRAME, onFrame);
} else {
if (frameCount <= 10){
this.alpha = (frameCount * 0.1);
} else {
if (frameCount > 30){
this.alpha = ((40 - frameCount) * 0.1);
} else {
this.alpha = 1;
};
};
};
}
}
}//package
Section 34
//AdventurerJoinDialog (AdventurerJoinDialog)
package {
import flash.events.*;
import flash.ui.*;
import flash.text.*;
import flash.display.*;
public class AdventurerJoinDialog extends MovieClip {
public var charName:TextField;
public var yes_btn:MovieClip;
public var dialogue:TextField;
private var char:PC_Adventurer;
public var charGraphic:CharGraphic;
public var no_btn:MovieClip;
public function AdventurerJoinDialog(_arg1:int):void{
char = new PC_Adventurer(dm.main.pc_party);
switch (_arg1){
case Horde.greenskins:
default:
dialogue.text = "\"We came to end this madness, but we were ambushed, and my allies slain. I was able to avenge them, but not before being afflicted by the soul-twisting magicks of the orcs. I can feel it.. I do not have much time left. To die in battle is the only dignity left to me.\"";
break;
case Horde.undead:
dialogue.text = "\"A great host of undead fell upon my party, and I was the only survivor. I was not unscathed, however.. my flesh pierced by a lich's black blade. The wound seeps and festers, and I know full well there is no recovering from such an injury. I can hope only for vengeance.\"";
break;
case Horde.creatures:
dialogue.text = "\"Their attacks were relentless.. my allies and I fell beneath their raking claws and vile secretions. The creatures thought me dead, and I soon will be. I can feel the cursed poison in my blood.. before long it will reach my heart. But I refuse to go meekly into death's embrace.\"";
break;
case Horde.cultists:
dialogue.text = "They appeared suddenly.. otherwordly monsters unlike any I have seen before. I was lucky to escape, my fellows cut down in seconds. They had not forgotten me, though. Their magics probed for me, found me, and.. hurt me. I am no longer whole, and know that I will not live long.\"";
break;
case Horde.dwarves:
dialogue.text = "\"We were surprised to see them.. and fatally slow to defend ourselves. When the last dwarf was slain, I found I was the last of my party still standing. I fear it is not for long. In my mind's eye all I can see is one of their pagan runes, growing ever larger. I am cursed to die.\"";
break;
};
charName.text = char.charname;
dmf.embolden(charName);
charGraphic.setFrame(char.portrait);
this.yes_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickYes);
this.no_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickNo);
dm.stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
}
function clickYes(_arg1:MouseEvent):void{
if (parent != null){
dm.main.pc_party.members.push(char);
dm.main.saveParty();
cleanup();
parent.removeChild(this);
};
}
function clickNo(_arg1:MouseEvent):void{
if (parent != null){
cleanup();
parent.removeChild(this);
};
}
private function cleanup():void{
dm.stage.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickYes);
no_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickNo);
}
function reportKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ENTER){
clickYes(null);
} else {
if (_arg1.keyCode == Keyboard.ESCAPE){
clickNo(null);
};
};
}
}
}//package
Section 35
//AllyDiedDialog (AllyDiedDialog)
package {
import flash.events.*;
import flash.ui.*;
import flash.text.*;
import flash.display.*;
public class AllyDiedDialog extends MovieClip {
public var charName:TextField;
public var yes_btn:MovieClip;
public var dlg_text:TextField;
public var charGraphic:CharGraphic;
public function AllyDiedDialog(_arg1:PlayerCharacter):void{
dlg_text.text = (("Your ally, " + _arg1.charname) + ", has succumbed to his injuries and died. His last words were a whispered \"Thank you.\"\n\nThe party build him a cairn from nearby loose stones, then continue on with their quest.");
charName.text = _arg1.charname;
dmf.embolden(charName);
charGraphic.setFrame(_arg1.portrait);
yes_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
dm.stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
}
private function cleanup():void{
dm.stage.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
}
function clickOkay(_arg1:MouseEvent):void{
if (parent != null){
parent.removeChild(this);
cleanup();
};
}
function reportKeyDown(_arg1:KeyboardEvent):void{
if ((((_arg1.keyCode == Keyboard.ENTER)) || ((_arg1.keyCode == Keyboard.ESCAPE)))){
clickOkay(null);
};
}
}
}//package
Section 36
//Armor (Armor)
package {
public class Armor extends Equipment {
private var _type:int;// = 0
static const medium = 1;
static const light = 0;
static const heavy = 2;
static const special = 3;
public function Armor(){
_type = 0;
super();
item_name = "Armor";
item_level = 1;
type = Armor.light;
}
override public function generateItem(_arg1:int):void{
var _local2:*;
var _local3:*;
_local2 = false;
_local3 = false;
getItemModifiers();
if (item_rarity == Item.green){
if (dmf.randomNum(0, 100) >= 50){
_local3 = true;
} else {
_local2 = true;
};
};
if ((((item_rarity == Item.blue)) || (_local3))){
prefix = rollForPrefix(item_rarity);
};
if ((((item_rarity == Item.blue)) || (_local2))){
suffix = rollForSuffix(item_rarity);
};
armor_rating = scaleArmorForLevel(Math.ceil((base_armor_rating * (1 + (base_armor_mod / 100)))));
if (prefix >= 0){
applyPrefix();
};
if (suffix >= 0){
applySuffix();
};
if (((materials.length) && ((item_rarity < Item.purple)))){
material = rollForMaterial(item_rarity, materials);
scaleArmorForMaterial(material);
} else {
material = -1;
};
if (material >= 0){
item_name = ((materials[material] + " ") + item_name);
};
if (prefix >= 0){
item_name = ((prefixes[prefix][0] + " ") + item_name);
};
if (suffix >= 0){
item_name = ((item_name + " of ") + suffixes[suffix][0]);
};
if (item_rarity == Item.grey){
item_name = ((grey_name + " ") + item_name);
};
}
public function get type():int{
return (this._type);
}
override public function getItemTypeString(){
return ("Armor");
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
public function modifyBaseArmorForSlot():void{
var _local1:Number;
if (!(base_armor_rating)){
return;
};
_local1 = getModForSlot(slot);
base_armor_rating = Math.round((base_armor_rating * _local1));
}
public function set type(_arg1:int):void{
this._type = _arg1;
}
override public function itemStatsString(_arg1:String):String{
if (armor_rating){
_arg1 = (_arg1 + (String(armor_rating) + " Armor Rating\n"));
};
return (super.itemStatsString(_arg1));
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
super.applyPrefix();
}
public function scaleArmorForMaterial(_arg1:int){
var _local2:*;
_local2 = (1 + ((_arg1 + 1) * 0.05));
armor_rating = Math.round((armor_rating * _local2));
}
override public function getItemModifiers():void{
super.getItemModifiers();
prefixes.push(["Thick", 1.4]);
prefixes.push(["Soothing", 5]);
prefixes.push(["Purifying", 30]);
suffixes.push(["Reflection", 10]);
suffixes.push(["Tenacity", 30]);
suffixes.push(["Might", base_item_stat_bonus]);
suffixes.push(["Deftness", base_item_stat_bonus]);
}
}
}//package
Section 37
//armor_buff_effect (armor_buff_effect)
package {
import flash.display.*;
public dynamic class armor_buff_effect extends MovieClip {
public var shield:MovieClip;
public function armor_buff_effect(){
addFrameScript(0, frame1, 4, frame5, 9, frame10, 49, frame50);
}
function frame10(){
this.shield.gotoAndPlay(2);
}
function frame1(){
dm.sound.play(SoundControl.armorBuff);
}
function frame5(){
this.shield.gotoAndStop(1);
}
function frame50(){
this.stop();
}
}
}//package
Section 38
//armor_buff_sound (armor_buff_sound)
package {
import flash.media.*;
public dynamic class armor_buff_sound extends Sound {
}
}//package
Section 39
//arrow_fire_sound (arrow_fire_sound)
package {
import flash.media.*;
public dynamic class arrow_fire_sound extends Sound {
}
}//package
Section 40
//basilisk_sound (basilisk_sound)
package {
import flash.media.*;
public dynamic class basilisk_sound extends Sound {
}
}//package
Section 41
//battle_start2 (battle_start2)
package {
import flash.media.*;
public dynamic class battle_start2 extends Sound {
}
}//package
Section 42
//BattleActionsBar (BattleActionsBar)
package {
import flash.display.*;
public dynamic class BattleActionsBar extends Sprite {
public var retreat_all_skill:SkillIcon;
public var pass_skill:SkillIcon;
public var retreat_skill:SkillIcon;
}
}//package
Section 43
//Battlefield (Battlefield)
package {
import flash.events.*;
import flash.filters.*;
import flash.utils.*;
import flash.ui.*;
import flash.geom.*;
import flash.display.*;
import flash.text.*;
public class Battlefield extends MovieClip {
const PASS_TURN_DELAY = 600;
const max_blur = 30;
const color_white:uint = 0xFFFFFF;
const pass_animation_frame = 11;
const immune_animation_frame = 9;
const blur_steps = 3;
const stunned_animation_frame = 10;
const miss_animation_frame = 8;
const color_red:uint = 0xE90000;
public var active_info_panel:BattleInfoPanel;
public var currentWave:int;// = 1
var horde:Horde;
private var errorCode:int;// = 0
public var skillbar:SkillBar;
private var bonusAttacker:Character;
var passing:Boolean;// = false
public var bg:MovieClip;
private var bonusAttackPending:Boolean;// = false
var monsterTurnDelayTimer:Timer;
var npc_portraits:Array;
public var help_btn:HelpButton;
var retreatAll:Boolean;// = false
private var exitedSafely:Boolean;
public var selected_skill_text:TextField;
var turn:int;// = 0
var usedSkill:Boolean;// = false
public var pc2:EmptyPortrait;
public var target_info_panel:BattleInfoPanel;
public var pc6:EmptyPortrait;
public var pc1:EmptyPortrait;
public var pc3:EmptyPortrait;
public var pc4:EmptyPortrait;
public var pc5:EmptyPortrait;
private var numTargets:int;// = 0
var playerRegenTimer:Timer;
private var exitTimer:Timer;
var delayedHit:int;// = -1
var delayedHitsAttacker:Array;
var delayedHitsDelay:int;// = 300
var pc_portraits:Array;
var blurTimer:Timer;
var playerTargetPos:int;// = -1
public var options_btn:OptionsButton;
var hover:Character;
public var messages:BattleMessageBox;
var do_eor:Boolean;// = false
var speedlist:Array;
public var npc1:EmptyPortrait;
public var npc2:EmptyPortrait;
public var npc3:EmptyPortrait;
public var npc4:EmptyPortrait;
public var npc6:EmptyPortrait;
public var npc5:EmptyPortrait;
public var waveField:TextField;
var phl:CurrentPortraitHighlight;
var currentBlur:int;// = 0
public var initDisplay:InitiativeList;
var pc_party:Party;
var combat_grid:Array;
var doLethalAnim:Boolean;// = false
var delayedHitsSkill:Array;
var doNothingTimer:Timer;
var valid_targets:Array;
var valid_targets_portraits:Array;
var delayedHitsDamage:Array;
private var bonusAttackTarget:Character;
var turnDelayTimer:Timer;
var hadMonsterDelay:Boolean;// = false
var delayedHitsTarget:Array;
public var actionsbar:BattleActionsBar;
public static var damageSpongeMonster:MonsterCharacter;
public static var damageSpongePlayer:PlayerCharacter;
public function Battlefield(){
currentWave = 1;
pc_portraits = new Array();
npc_portraits = new Array();
speedlist = new Array(11);
turn = 0;
combat_grid = new Array(3);
valid_targets = new Array();
valid_targets_portraits = new Array();
playerTargetPos = -1;
bonusAttackPending = false;
errorCode = 0;
do_eor = false;
retreatAll = false;
delayedHit = -1;
delayedHitsDamage = new Array();
delayedHitsSkill = new Array();
delayedHitsTarget = new Array();
delayedHitsAttacker = new Array();
delayedHitsDelay = 300;
currentBlur = 0;
usedSkill = false;
hadMonsterDelay = false;
numTargets = 0;
doLethalAnim = false;
passing = false;
super();
pc1.pos = 1;
pc2.pos = 2;
pc3.pos = 3;
pc4.pos = 4;
pc5.pos = 5;
pc6.pos = 6;
npc1.pos = 1;
npc2.pos = 2;
npc3.pos = 3;
npc4.pos = 4;
npc5.pos = 5;
npc6.pos = 6;
damageSpongePlayer = null;
damageSpongeMonster = null;
waveField.mouseEnabled = false;
waveField.text = "";
addEventListener(Event.ADDED_TO_STAGE, added);
}
public function addNewPortrait(_arg1:Character):CharacterPortrait{
var _local2:CharacterPortrait;
var _local3:String;
var _local4:Array;
var _local5:*;
_local2 = new CharacterPortrait();
_local2.setChar(_arg1);
if ((_arg1 is MonsterCharacter)){
_local3 = "npc";
_local4 = npc_portraits;
} else {
if ((_arg1 is PlayerCharacter)){
_local3 = "pc";
_local4 = pc_portraits;
} else {
return (_local2);
};
};
_local5 = EmptyPortrait(getChildByName((_local3 + String(_arg1.pos))));
if (_local5 == null){
return (null);
};
_local5.empty.addChild(_local2);
_local2.addEventListener(MouseEvent.MOUSE_OVER, mousedOverEvent);
_local2.addEventListener(MouseEvent.MOUSE_OVER, mouseMoveEvent);
_local2.addEventListener(MouseEvent.MOUSE_OUT, mousedOutEvent);
_local4.push(_local2);
_arg1.portraitRef = _local2;
return (_local2);
}
private function updateCombatGrid():void{
var _local1:int;
var _local2:int;
var _local3:Character;
_local1 = 0;
_local2 = 0;
_local1 = 0;
while (_local1 < 3) {
combat_grid[_local1] = new Array(4);
_local2 = 0;
while (_local2 < 4) {
combat_grid[_local1][_local2] = null;
_local2++;
};
_local1++;
};
for each (_local3 in pc_party.members) {
AddCharToCombatGrid(_local3);
};
for each (_local3 in horde.members) {
AddCharToCombatGrid(_local3);
};
}
private function PlayerCanHit(_arg1:int){
var _local2:*;
var _local3:*;
var _local4:PlayerCharacter;
var _local5:MonsterCharacter;
var _local6:Boolean;
var _local7:*;
_local4 = PlayerCharacter(speedlist[turn]);
if (_arg1 > 6){
return;
};
if (_arg1 < 1){
return;
};
if (_arg1 > 3){
_local2 = (_arg1 % 4);
} else {
_local2 = (_arg1 - 1);
};
_local3 = (Math.ceil((_arg1 / 3)) - 1);
if (combat_grid[_local2][_local3] == null){
return;
};
_local5 = MonsterCharacter(combat_grid[_local2][_local3]);
if (MonsterCharacter(_local5).health <= 0){
return;
};
if (MonsterCharacter(_local5).hiding){
return;
};
if (MonsterCharacter(_local5).cannotTarget){
return;
};
if (((skillbar.getSelectedSkill().targetsStunned) && (!(_local5.stunned_duration)))){
return;
};
_local6 = ((_local5.summoned) || ((_local5 is mAetherguard)));
if (((skillbar.getSelectedSkill().targetsSummoned) && (!(_local6)))){
return;
};
if (((!((damageSpongeMonster == null))) && (!((damageSpongeMonster == _local5))))){
return;
};
_local7 = PortraitFromCharacter(_local5);
if (_local7 != null){
addPlayerTarget(_local5);
};
}
private function EndTurn(_arg1:Boolean=false):void{
var _local2:int;
var _local3:int;
if (!(_arg1)){
speedlist[turn].hadCombatTurn = true;
};
if ((speedlist[turn] is PlayerCharacter)){
if (((!((skillbar == null))) && (this.contains(skillbar)))){
removeChild(skillbar);
};
if (((!((actionsbar == null))) && (this.contains(actionsbar)))){
removeChild(actionsbar);
};
this.removeEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheelEvent);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
selected_skill_text.text = "";
};
RemoveTargetInfo();
_local3 = 1500;
if (passing){
_local3 = PASS_TURN_DELAY;
passing = false;
};
if (speedlist[turn].stunned_duration){
_local3 = PASS_TURN_DELAY;
};
if ((((speedlist[turn] is PlayerCharacter)) && (((speedlist[turn].retreated) || (speedlist[turn].retreating))))){
_local3 = 600;
};
turnDelayTimer = new Timer(_local3, 1);
turnDelayTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onTurnDelayComplete);
turnDelayTimer.start();
}
private function modifySkillDamage(_arg1:int, _arg2:Skill, _arg3:Character, _arg4:Character, _arg5:int, _arg6:Boolean){
var _local7:int;
var _local8:*;
var _local9:*;
if (_arg3.invulnerable){
return (0);
};
if ((((_arg3 is MonsterCharacter)) && (MonsterCharacter(_arg3).damageImmune))){
return (0);
};
if (((_arg2.onlyDamagesUndead) && (!((_arg3.type == MonsterCharacter.undead))))){
return (0);
};
if (((_arg2.splashDamageMultiplier) && (!(_arg6)))){
_arg1 = (_arg1 * _arg2.splashDamageMultiplier);
};
if (((_arg2.undeadMultiplier) && ((_arg3.type == MonsterCharacter.undead)))){
_arg1 = (_arg1 * _arg2.undeadMultiplier);
};
if ((((_arg4 is PlayerCharacter)) && (_arg1))){
_arg1 = PlayerCharacter(_arg4).multiplyDamageForTargetType(_arg1, _arg3.type);
};
if (((((_arg2.damageBonusVsCreatureType) && (_arg1))) && ((_arg3 is MonsterCharacter)))){
if (_arg2.damageBonusVsCreatureType == MonsterCharacter(_arg3).type){
_arg1 = (_arg1 * _arg2.damageBonusVsCreatureModifier);
};
};
if (_arg1){
_local7 = _arg3.damageAfterArmor(_arg1, _arg4);
if (_arg2.ignoresArmor){
_arg1 = Math.max(_arg1, _local7);
} else {
_arg1 = _local7;
};
};
if (((((_arg1) && ((_arg3 is MonsterCharacter)))) && (MonsterCharacter(_arg3).ethereal))){
if (_arg2.isPhysical()){
_arg1 = Math.round((_arg1 * (1 - (MonsterCharacter(_arg3).ethereal / 100))));
if (_arg1 == 0){
_arg1 = 1;
};
};
};
if ((((_arg4 is PC_Barbarian)) && ((dmf.randomNum(0, 99) < PC_Barbarian(_arg4).brutality)))){
_arg1 = Math.ceil((_arg1 * 1.5));
addFloater(_arg4, "Brutality!");
};
doLethalAnim = false;
if (((((_arg1) && (((((_arg2.addsPowerToLethality) || (_arg2.lethality))) || (_arg4.getLethality()))))) && (((!(_arg3.lethalityImmune)) || (DungeonMain.instantKill))))){
_local8 = _arg2.lethality;
if (_arg2.addsPowerToLethality){
_local8 = (_local8 + _arg5);
};
_local8 = (_local8 + Math.ceil((_arg4.getLethality() / numTargets)));
_local9 = dm.randomNum(0, 100);
if (_local9 < _local8){
_arg1 = _arg3.health;
doLethalAnim = true;
};
};
if (((_arg2.nonLethal) && ((_arg1 >= _arg3.health)))){
_arg1 = (_arg3.health - 1);
};
return (Math.round(_arg1));
}
function clickRetreatAll(_arg1:MouseEvent):void{
if ((speedlist[turn] is PlayerCharacter)){
if (pc_party.campaign == Campaign.SURVIVAL){
if (dm.main.battle_theme != null){
dm.main.battle_theme.fadeOut(0);
};
dm.main.survivalDefeat(currentWave);
return;
} else {
retreatAll = true;
clickRetreat(_arg1);
};
};
}
private function splashDamageCheck(_arg1:Skill, _arg2:Character, _arg3:Character):Boolean{
if (_arg3 == null){
return (false);
};
if (!(_arg1.splashHitsAllies)){
if (BattleFunctions.areEnemies(_arg3, _arg2)){
return (true);
};
} else {
return (true);
};
return (false);
}
private function emptyClicked(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
_local2 = _arg1.currentTarget;
if (((!((_local2 == null))) && ((_local2 is EmptyPortrait)))){
playerTargetPos = _local2.pos;
RemoveTargetInfo();
_local3 = skillbar.getSelectedSkill();
useSkill(speedlist[turn], _local3, speedlist[turn]);
};
}
private function addFloater(_arg1:Character, _arg2:String):void{
var _local3:CombatFloater;
_local3 = new CombatFloater(_arg2);
_local3.name = "floater";
if (_arg1.portraitRef != null){
_arg1.portraitRef.addChild(_local3);
};
}
private function initWave():void{
var _local1:CharacterPortrait;
var _local2:MonsterCharacter;
for each (_local1 in npc_portraits) {
if (_local1 == null){
} else {
if (_local1.parent != null){
_local1.parent.removeChild(_local1);
};
_local1.removeEventListener(MouseEvent.MOUSE_OVER, mousedOverEvent);
_local1.removeEventListener(MouseEvent.MOUSE_OVER, mouseMoveEvent);
_local1.removeEventListener(MouseEvent.MOUSE_OUT, mousedOutEvent);
};
};
Campaign.setForSurvivalWave(horde, currentWave);
for each (_local2 in horde.members) {
addNewPortrait(_local2);
};
CalculateInitiative(false);
updateCombatGrid();
initDisplay.refill(speedlist[turn]);
messages.addMessage((("Wave " + currentWave) + " has arrived!"), "Defeat these enemies!");
waveField.text = ("WAVE " + currentWave);
dmf.embolden(waveField);
dmf.setLetterSpacing(waveField, 6);
}
public function ValidTargetsForPlayer(_arg1:Skill):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:PlayerCharacter;
var _local14:MonsterCharacter;
var _local15:PlayerCharacter;
var _local16:MonsterCharacter;
_local2 = speedlist[turn];
_local8 = false;
_local9 = false;
valid_targets.length = 0;
valid_targets_portraits.length = 0;
RemoveTargetInfo();
selected_skill_text.text = skillbar.getSelectedSkill().skillname;
dm.embolden(selected_skill_text);
if (_arg1.usesWeaponRange){
if (_local2.gear[Equipment.weapon]){
if ((_local2.gear[Equipment.weapon] is MeleeWeapon)){
_local9 = true;
} else {
if ((_local2.gear[Equipment.weapon] is RangedWeapon)){
_local8 = true;
};
};
};
};
_local10 = PlayerCharacter(_local2).gear[Equipment.weapon];
if (!(_arg1.usable())){
selected_skill_text.textColor = color_red;
return;
};
selected_skill_text.textColor = color_white;
if (_arg1.targetsEmpty){
addEmptyListeners();
return;
};
if (_arg1.targetsSelf){
_local12 = PortraitFromCharacter(speedlist[turn]);
if (((_arg1.targetsFriendlyFrontRow) && ((speedlist[turn].pos > 3)))){
if (IsPlayerMeleeBlocked(speedlist[turn])){
return;
};
};
if (_local12 != null){
addPlayerTarget(speedlist[turn]);
};
return;
};
if (_arg1.targetsFriendlies){
_local5 = 0;
for (;_local5 < pc_portraits.length;_local5++) {
_local13 = pc_portraits[_local5].char_ref;
if (PlayerCharacter(_local13).retreated){
} else {
if (((_arg1.targetsSummoned) && (!(_local13.summoned)))){
} else {
if (_arg1.resurrects){
if ((((Character(_local13).health > 0)) || ((_local13 is PC_Adventurer)))){
continue;
};
} else {
if (Character(_local13).health <= 0){
continue;
};
};
if (((_arg1.targetsFriendlyFrontRow) && ((_local13.pos > 3)))){
//unresolved if
} else {
addPlayerTarget(_local13);
};
};
};
};
return;
};
if (_arg1.requiresVerticalGap){
if ((_local2 is PlayerCharacter)){
if (_local2.pos > 3){
_local15 = pc_party.memberInPos((_local2.pos - 3));
if (((!((_local15 == null))) && (!(_local15.isInactive())))){
return;
};
_local14 = combat_grid[(_local2.pos - 4)][1];
if ((((_local14 == null)) || (_local14.isInactive()))){
_local14 = combat_grid[(_local2.pos - 4)][0];
};
} else {
_local16 = combat_grid[(_local2.pos - 1)][1];
if (((!((_local16 == null))) && (!(_local16.isInactive())))){
return;
};
_local14 = combat_grid[(_local2.pos - 1)][0];
};
if (_local14 != null){
PlayerCanHit(_local14.pos);
};
return;
};
};
if (((_arg1.rangedAttack) || (_local8))){
_local5 = 1;
while (_local5 <= 6) {
PlayerCanHit(_local5);
_local5++;
};
return;
};
_local11 = IsPlayerMeleeBlocked(PlayerCharacter(_local2));
if ((((_local2.pos < 4)) || ((((_local2.pos > 3)) && (!(_local11)))))){
if (damageSpongeMonster != null){
PlayerCanHit(damageSpongeMonster.pos);
};
_local3 = 0;
_local5 = 0;
while (_local5 < 3) {
if (combat_grid[_local5][1] != null){
if (Character(combat_grid[_local5][1]).health > 0){
if (Character(combat_grid[_local5][1]).hiding){
} else {
_local3++;
_local7 = Character(combat_grid[_local5][1]).pos;
};
};
};
_local5++;
};
if (_local3 == 1){
PlayerCanHit(_local7);
} else {
if (_local3 > 1){
if (_local2.pos < 4){
PlayerCanHit((_local2.pos + 3));
if ((_local2.pos + 4) <= 6){
PlayerCanHit((_local2.pos + 4));
};
if ((_local2.pos + 2) >= 4){
PlayerCanHit((_local2.pos + 2));
};
} else {
PlayerCanHit(_local2.pos);
if ((_local2.pos + 1) <= 6){
PlayerCanHit((_local2.pos + 1));
};
if ((_local2.pos - 1) >= 4){
PlayerCanHit((_local2.pos - 1));
};
};
} else {
if (_local3 == 0){
_local4 = 0;
_local5 = 0;
while (_local5 < 3) {
if (combat_grid[_local5][0] != null){
if (Character(combat_grid[_local5][0]).health > 0){
if (Character(combat_grid[_local5][0]).hiding){
} else {
_local4++;
_local7 = Character(combat_grid[_local5][0]).pos;
};
};
};
_local5++;
};
if (_local4 == 1){
PlayerCanHit(_local7);
} else {
if (_local4 > 1){
if (_local2.pos < 4){
PlayerCanHit(_local2.pos);
if ((_local2.pos + 1) <= 3){
PlayerCanHit((_local2.pos + 1));
};
if ((_local2.pos - 1) >= 1){
PlayerCanHit((_local2.pos - 1));
};
} else {
PlayerCanHit((_local2.pos - 3));
if ((_local2.pos - 2) <= 3){
PlayerCanHit((_local2.pos - 2));
};
if ((_local2.pos - 4) >= 1){
PlayerCanHit((_local2.pos - 4));
};
};
};
};
};
};
};
};
}
private function updateCurrentTurnHighlight():void{
var _local1:Character;
_local1 = speedlist[turn];
if ((_local1 is PlayerCharacter)){
phl.x = EmptyPortrait(getChildByName(("pc" + _local1.pos))).x;
phl.y = EmptyPortrait(getChildByName(("pc" + _local1.pos))).y;
} else {
if ((_local1 is MonsterCharacter)){
phl.x = EmptyPortrait(getChildByName(("npc" + _local1.pos))).x;
phl.y = EmptyPortrait(getChildByName(("npc" + _local1.pos))).y;
};
};
}
private function IsPlayerMeleeBlocked(_arg1:PlayerCharacter):Boolean{
var _local2:*;
var _local3:*;
_local2 = 0;
_local3 = false;
if (_arg1.pos > 3){
_local2 = 0;
while (_local2 < 3) {
if (combat_grid[_local2][2] != null){
if (PlayerCharacter(combat_grid[_local2][2]).isInactive() == false){
_local3 = true;
};
};
_local2++;
};
};
if (_arg1.gear[Equipment.weapon] != null){
if ((_arg1.gear[Equipment.weapon] is iSpear)){
_local3 = false;
};
};
return (_local3);
}
function mouseMoveEvent(_arg1:MouseEvent):void{
}
private function addHydraHead(_arg1:int):void{
var _local2:*;
var _local3:*;
var _local4:mHydraHead;
var _local5:int;
var _local6:*;
_local2 = false;
_local3 = 0;
_local4 = new mHydraHead(_arg1);
_local5 = horde.findEmptySlot(true);
if (!(_local5)){
return;
};
_local4.pos = _local5;
AddCharToCombatGrid(_local4);
horde.members.push(_local4);
_local6 = addNewPortrait(_local4);
_local4.portraitRef = _local6;
}
function unBlurDone(_arg1:TimerEvent):void{
blurTimer.removeEventListener(TimerEvent.TIMER, unBlurStep);
blurTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, unBlurDone);
this.filters = null;
}
private function AddCharToCombatGrid(_arg1:Character):void{
var _local2:int;
var _local3:int;
if (_arg1 == null){
return;
};
if (_arg1.pos > 3){
_local2 = (_arg1.pos % 4);
} else {
_local2 = (_arg1.pos - 1);
};
_local3 = (Math.ceil((_arg1.pos / 3)) - 1);
if ((_arg1 is PlayerCharacter)){
_local3 = (_local3 + 2);
};
combat_grid[_local2][_local3] = _arg1;
}
private function addAccuracyRoll(_arg1:int):void{
var _local2:String;
var _local3:AccuracyRoll;
_local2 = String(_arg1);
_local3 = new AccuracyRoll(_local2);
_local3.x = 424;
_local3.y = 427.5;
addChild(_local3);
}
public function onTurnDelayComplete(_arg1:TimerEvent):void{
var _local2:*;
turnDelayTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTurnDelayComplete);
updateAllBars();
doNothingTimer = new Timer(500, 1);
doNothingTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onDoNothingDelayComplete);
doNothingTimer.start();
}
private function PassTurn(){
var _local1:CharacterPortrait;
_local1 = PortraitFromCharacter(speedlist[turn]);
passing = true;
messages.addMessage((speedlist[turn].charname + " passes."), "");
_local1.addAnimationFrame(pass_animation_frame, (PASS_TURN_DELAY + 500));
if (!(speedlist[turn].cancelPowerRegen)){
speedlist[turn].powerRegenMod = 2;
};
_local1.update();
EndTurn();
}
private function replaceChar(_arg1:Character, _arg2:Character):void{
var _local3:*;
var _local4:*;
var _local5:*;
_local3 = 0;
while (_local3 < horde.members.length) {
if (horde.members[_local3] == _arg1){
horde.members[_local3] = _arg2;
};
_local3++;
};
_local4 = 0;
while (_local4 < 3) {
_local5 = 0;
while (_local5 < 4) {
if (combat_grid[_local4][_local5] == _arg1){
combat_grid[_local4][_local5] = _arg2;
return;
};
_local5++;
};
_local4++;
};
}
private function IncrementTurn():Boolean{
var i:*;
var j:*;
var players_alive:Boolean;
var monsters_alive:Boolean;
var next_turn:Boolean;
var err_txt:*;
var err_dlg:*;
players_alive = false;
monsters_alive = false;
next_turn = false;
errorCode = 6500;
turn++;
if (turn >= speedlist.length){
turn = 0;
errorCode = 6501;
i = 0;
while (i < speedlist.length) {
errorCode = 6502;
if (((!((speedlist[i] == null))) && ((speedlist[i] is Character)))){
errorCode = 6503;
speedlist[i].hadCombatTurn = false;
};
i = (i + 1);
};
};
errorCode = 6504;
i = 0;
while (i < horde.members.length) {
if (horde.members[i].health > 0){
monsters_alive = true;
};
i = (i + 1);
};
errorCode = 6505;
i = 0;
while (i < pc_party.members.length) {
if ((((pc_party.members[i].health > 0)) && ((pc_party.members[i].summoned == false)))){
if (PlayerCharacter(pc_party.members[i]).retreated == false){
players_alive = true;
};
};
i = (i + 1);
};
errorCode = 6506;
if (((((horde.legendary) && ((horde.members[0] is mHydraBody)))) && ((horde.members[0].health <= 0)))){
monsters_alive = false;
};
if (!(monsters_alive)){
horde.defeated = true;
};
if (((players_alive) && (monsters_alive))){
next_turn = true;
} else {
next_turn = false;
};
errorCode = 6507;
if (next_turn){
try {
initDisplay.turnOf(speedlist[turn], true);
} catch(error:Error) {
if (((DungeonMain.KONGREGATE) || (DungeonMain.BETA))){
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (("Update Turn Order Error: " + error.name) + "\n"));
if (speedlist[turn] != null){
err_txt = (err_txt + (((((("turn: " + turn) + "/") + String((speedlist.length - 1))) + " - ") + speedlist[turn].charname) + "\n"));
};
err_txt = (err_txt + (("errorCode: " + errorCode) + "\n"));
err_txt = (err_txt + ((("[" + error.errorID) + "] ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
};
} finally {
var _local4:* = true;
//unresolved jump
1;
return (_local4);
};
//unresolved jump
};
return (false);
}
function blurDone(_arg1:TimerEvent):void{
blurTimer.removeEventListener(TimerEvent.TIMER, blurStep);
blurTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, blurDone);
setBlur(max_blur);
}
private function playerRegenShown(_arg1:Event):void{
playerRegenTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, playerRegenShown);
if (usedSkill){
return;
};
PortraitFromCharacter(speedlist[turn]).update();
if (speedlist[turn].health <= 0){
EndTurn();
};
}
function mousedOverEvent(_arg1:MouseEvent):void{
var _local2:*;
_local2 = CharacterPortrait(_arg1.currentTarget).char_ref;
if (_local2 == null){
return;
};
hover = _local2;
UpdateInfoPanels();
initDisplay.highlightChar(_local2);
drawEffectedTargets();
}
public function cleanup():void{
var _local1:*;
var _local2:*;
help_btn.cleanup();
options_btn.cleanup();
active_info_panel.cleanup();
target_info_panel.cleanup();
skillbar.cleanup();
if (dm.stage != null){
_local2 = dm.stage.getChildByName("tooltip_skill");
if (_local2 != null){
stage.removeChild(_local2);
};
};
messages.cleanup();
removeEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheelEvent);
if (stage != null){
stage.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
};
actionsbar.pass_skill.cleanup();
actionsbar.pass_skill.removeEventListener(MouseEvent.MOUSE_DOWN, clickPassTurn);
actionsbar.retreat_skill.cleanup();
actionsbar.retreat_skill.removeEventListener(MouseEvent.MOUSE_DOWN, clickRetreat);
actionsbar.retreat_all_skill.cleanup();
actionsbar.retreat_all_skill.removeEventListener(MouseEvent.MOUSE_DOWN, clickRetreatAll);
_local1 = 0;
while (_local1 < npc_portraits.length) {
npc_portraits[_local1].removeEventListener(MouseEvent.MOUSE_OVER, mousedOverEvent);
npc_portraits[_local1].removeEventListener(MouseEvent.MOUSE_OVER, mouseMoveEvent);
npc_portraits[_local1].removeEventListener(MouseEvent.MOUSE_OUT, mousedOutEvent);
_local1++;
};
_local1 = 0;
while (_local1 < pc_portraits.length) {
pc_portraits[_local1].removeEventListener(MouseEvent.MOUSE_OVER, mousedOverEvent);
pc_portraits[_local1].removeEventListener(MouseEvent.MOUSE_OVER, mouseMoveEvent);
pc_portraits[_local1].removeEventListener(MouseEvent.MOUSE_OUT, mousedOutEvent);
_local1++;
};
initDisplay.cleanup();
initDisplay = null;
removeEventListener(Event.ENTER_FRAME, onFrame);
}
private function PortraitFromCharacter(_arg1:Character):CharacterPortrait{
var _local2:*;
var _local3:*;
if ((_arg1 is PlayerCharacter)){
_local2 = pc_portraits;
} else {
_local2 = npc_portraits;
};
_local3 = 0;
while (_local3 < _local2.length) {
if (_local2[_local3].char_ref == _arg1){
return (_local2[_local3]);
};
_local3++;
};
return (null);
}
private function exitBlur(_arg1:TimerEvent=null):void{
blurTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, exitBlur);
currentBlur = 0;
blurTimer = new Timer(50, blur_steps);
blurTimer.addEventListener(TimerEvent.TIMER, blurStep);
blurTimer.addEventListener(TimerEvent.TIMER_COMPLETE, blurDone);
blurTimer.start();
}
function onMouseWheelEvent(_arg1:MouseEvent):void{
if ((speedlist[turn] is MonsterCharacter)){
return;
};
if (_arg1.delta > 0){
skillbar.decrementSkill();
} else {
if (_arg1.delta < 0){
skillbar.incrementSkill();
};
};
ValidTargetsForPlayer(skillbar.getSelectedSkill());
if (hover != null){
drawEffectedTargets();
};
}
private function addEmptyListeners():void{
var _local1:int;
var _local2:*;
var _local3:PortraitHighlight;
_local1 = 1;
while (_local1 <= 6) {
if (pc_party.memberInPos(_local1) != null){
} else {
_local2 = getChildByName(("pc" + _local1));
_local2.addEventListener(MouseEvent.MOUSE_DOWN, emptyClicked);
_local3 = new PortraitHighlight();
_local3.name = "highlight";
_local2.addChild(_local3);
};
_local1++;
};
}
private function getEffectedTargets(_arg1:Character, _arg2:Skill):Array{
var _local3:*;
var _local4:*;
var _local5:Array;
_local5 = new Array();
if (_arg2.targetsSelf){
_local5.push(_arg1);
} else {
if (_arg2.hitsAllEnemies){
_local3 = 0;
while (_local3 < horde.members.length) {
_local5.push(horde.members[_local3]);
_local3++;
};
} else {
if (_arg2.hitsAllFriendlies){
_local3 = 0;
while (_local3 < pc_party.members.length) {
_local5.push(pc_party.members[_local3]);
_local3++;
};
} else {
if (_arg2.hitsAllMeleeRange){
_local5 = valid_targets;
} else {
if (_arg2.piercesColumn){
if (_arg1.pos < 4){
if (horde.memberInPos((_arg1.pos + 3)) != null){
_local5.push(horde.memberInPos((_arg1.pos + 3)));
};
} else {
if (horde.memberInPos((_arg1.pos - 3)) != null){
_local5.push(horde.memberInPos((_arg1.pos - 3)));
};
};
_local5.push(_arg1);
} else {
if (_arg2.splashDamageMultiplier){
if (_arg1.pos < 4){
if (horde.memberInPos((_arg1.pos + 3)) != null){
_local5.push(horde.memberInPos((_arg1.pos + 3)));
};
} else {
if (horde.memberInPos((_arg1.pos - 3)) != null){
_local5.push(horde.memberInPos((_arg1.pos - 3)));
};
if (_arg2.splashHitsAllies){
if (pc_party.memberInPos((_arg1.pos - 3)) != null){
_local5.push(pc_party.memberInPos((_arg1.pos - 3)));
};
};
};
if (((!((_arg1.pos == 4))) && (!((horde.memberInPos((_arg1.pos - 1)) == null))))){
_local5.push(horde.memberInPos((_arg1.pos - 1)));
};
if (((!((_arg1.pos == 3))) && (!((horde.memberInPos((_arg1.pos + 1)) == null))))){
_local5.push(horde.memberInPos((_arg1.pos + 1)));
};
_local5.push(_arg1);
} else {
_local5.push(_arg1);
};
};
};
};
};
};
_local3 = 0;
while (_local3 < _local5.length) {
if (_local5[_local3].health <= 0){
_local5.splice(_local3, 1);
_local3--;
} else {
if ((((_local5[_local3] is MonsterCharacter)) && (MonsterCharacter(_local5[_local3]).cannotTarget))){
_local5.splice(_local3, 1);
_local3--;
} else {
if ((((_local5[_local3] is PlayerCharacter)) && (PlayerCharacter(_local5[_local3]).retreated))){
_local5.splice(_local3, 1);
_local3--;
};
};
};
_local3++;
};
return (_local5);
}
private function checkAccuracyMiss(_arg1:Character, _arg2:Skill, _arg3:int, _arg4:Boolean, _arg5:Boolean=false):Boolean{
var _local6:Boolean;
var _local7:int;
var _local8:int;
_local6 = false;
_local7 = dm.randomNum(0, 99);
_local8 = _arg1.getAccuracy();
if (_arg2.attacksWithAccuracyMod != 1){
_local8 = Math.round((_local8 * _arg2.attacksWithAccuracyMod));
};
if (((_arg2.piercesColumn) && (!(_arg5)))){
if (_arg4){
_local7 = (_local8 - 1);
} else {
_local7 = (_local8 + 1);
};
};
if (_local7 >= _local8){
if (_arg1.canMissWith(_arg2)){
_local6 = true;
} else {
_local6 = false;
};
};
if (((_arg1.canMissWith(_arg2)) && (_arg5))){
addAccuracyRoll(_local7);
};
return (_local6);
}
private function onFrame(_arg1:Event):void{
var _local2:int;
var _local3:Character;
_local2 = 0;
_local2 = (pc_portraits.length - 1);
while (_local2 >= 0) {
_local3 = pc_portraits[_local2].char_ref;
if (_local3 != null){
if (((_local3.summoned) && ((pc_portraits[_local2].alpha == 0)))){
pc_party.members.splice(_local2, 1);
pc_portraits.splice(_local2, 1);
};
};
_local2--;
};
_local2 = (npc_portraits.length - 1);
while (_local2 >= 0) {
_local3 = npc_portraits[_local2].char_ref;
if (_local3 != null){
if (((_local3.summoned) && ((npc_portraits[_local2].alpha == 0)))){
horde.members.splice(_local2, 1);
npc_portraits.splice(_local2, 1);
};
};
_local2--;
};
updateCombatGrid();
initDisplay.removeDead();
}
private function addSummon(_arg1:Skill, _arg2:Character, _arg3:int):void{
var _local4:*;
var _local5:Character;
var _local6:CharacterPortrait;
_local4 = _arg1.summonsCreatureClass;
if ((_local4 is pShadowWolf)){
_local5 = new pShadowWolf(_arg2.level);
} else {
if ((_local4 is pShadow)){
_local5 = new pShadow(_arg2.level);
} else {
if ((_local4 is pManaSprite)){
_local5 = new pManaSprite(_arg2.level);
} else {
if ((_local4 is pBloodSprite)){
_local5 = new pBloodSprite(_arg2.level);
} else {
if ((_local4 is pWargolem)){
_local5 = new pWargolem(_arg2.level);
} else {
if ((_local4 is mVoidstalker)){
_local5 = new mVoidstalker(_arg2.level);
} else {
_local5 = new _local4.constructor(_arg2.level);
};
};
};
};
};
};
_local5.pos = _arg3;
if ((_arg2 is MonsterCharacter)){
horde.members.push(_local5);
} else {
PlayerSummon(_local5).party = pc_party;
pc_party.members.push(_local5);
if ((_arg2 is PC_Conjuror)){
if (PC_Conjuror(_arg2).aug_strength){
_local5.damage = (_local5.damage + Math.ceil((_local5.damage * (PC_Conjuror(_arg2).aug_strength / 100))));
};
if (PC_Conjuror(_arg2).aug_health){
_local5.health_max = (_local5.health_max + Math.ceil((_local5.health_max * (PC_Conjuror(_arg2).aug_health / 100))));
_local5.health = _local5.health_max;
};
};
};
AddCharToCombatGrid(_local5);
_local6 = addNewPortrait(_local5);
_local6.addPortraitAnimation(PortraitAnimation.summon);
if ((_local5 is pShadow)){
_local6.setShadow();
};
}
public function onDoNothingDelayComplete(_arg1:TimerEvent):void{
var err_txt:String;
var err_dlg:ErrorDialog;
var next_turn:Boolean;
var event = _arg1;
try {
errorCode = 5510;
doNothingTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onDoNothingDelayComplete);
if (bonusAttackPending){
if (bonusAttackOn(bonusAttackTarget)){
return;
} else {
bonusAttackPending = false;
};
};
errorCode = 5511;
next_turn = IncrementTurn();
errorCode = 5512;
} catch(error:Error) {
if (((DungeonMain.KONGREGATE) || (DungeonMain.BETA))){
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (("End Turn Error: " + error.name) + "\n"));
if (speedlist[turn] != null){
err_txt = (err_txt + (((((("turn: " + turn) + "/") + String((speedlist.length - 1))) + " - ") + speedlist[turn].charname) + "\n"));
};
err_txt = (err_txt + (("next turn: " + String(next_turn)) + "\n"));
err_txt = (err_txt + (("bonusAttackPending: " + String(bonusAttackPending)) + "\n"));
err_txt = (err_txt + (("errorCode: " + errorCode) + "\n"));
err_txt = (err_txt + ((("[" + error.errorID) + "] ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
};
};
try {
errorCode = 5513;
if (next_turn){
RunTurn();
};
} catch(error:Error) {
if (((DungeonMain.KONGREGATE) || (DungeonMain.BETA))){
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (("Next Turn Error: " + error.name) + "\n"));
if (speedlist[turn] != null){
err_txt = (err_txt + (((((("turn: " + turn) + "/") + String((speedlist.length - 1))) + " - ") + speedlist[turn].charname) + "\n"));
};
err_txt = (err_txt + (("next turn: " + String(next_turn)) + "\n"));
err_txt = (err_txt + (("errorCode: " + errorCode) + "\n"));
err_txt = (err_txt + ((("[" + error.errorID) + "] ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
};
};
if (!(next_turn)){
EndBattle();
};
}
private function updateAllBars():void{
var _local1:*;
_local1 = 0;
while (_local1 < npc_portraits.length) {
npc_portraits[_local1].update();
_local1++;
};
_local1 = 0;
while (_local1 < pc_portraits.length) {
pc_portraits[_local1].update();
_local1++;
};
}
function added(_arg1:Event):void{
var _local2:uint;
var _local3:*;
removeEventListener(Event.ADDED_TO_STAGE, added);
_local2 = 8;
if (((DungeonMain.showHints) && (!(Dungeon.hintShown(_local2))))){
_local3 = new HintDialog("Battle Start!", "You have encountered a group of enemies, and must now face them in battle. \n\nFirst, set your party's formation by dragging their character portraits. Melee fighters should be in the front row, and more vulnerable ranged fighters or spellcasters in the back row. The front row protects the back row from enemy melee attacks.", true, true);
DungeonMain.hints = (DungeonMain.hints + _local2);
stage.addChild(_local3);
dm.main.saveInterface();
};
if (DungeonMain.combatBlur){
entryBlur();
};
}
private function UpdateInfoPanels(_arg1:Character=null){
if (_arg1 == null){
_arg1 = speedlist[turn];
};
if (turn != -1){
if (!(this.contains(active_info_panel))){
addChild(active_info_panel);
};
active_info_panel.setChar(_arg1);
};
if (hover != null){
if (!(this.contains(target_info_panel))){
addChild(target_info_panel);
};
target_info_panel.setChar(hover);
} else {
if (this.contains(target_info_panel)){
removeChild(target_info_panel);
};
};
}
function delayedHitsTimerComplete(_arg1:TimerEvent):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:Character;
var _local6:Character;
var _local7:*;
var _local8:Boolean;
var _local9:int;
if (delayedHit >= delayedHitsDamage.length){
return;
};
_local2 = "";
updateAllBars();
_local3 = delayedHitsDamage[delayedHit];
_local4 = delayedHitsSkill[delayedHit];
_local5 = delayedHitsTarget[delayedHit];
_local6 = delayedHitsAttacker[delayedHit];
_local7 = PortraitFromCharacter(_local5);
_local8 = checkAccuracyMiss(_local6, _local4, 0, false);
if (_local8){
_local7.addAnimationFrame(miss_animation_frame, delayedHitsDelay);
_local2 = "(Miss)";
dm.sound.playMissSound(_local4, _local6, true);
} else {
_local9 = doSkillDamage(_local6, _local5, _local3, _local4);
addPortraitAnim(_local5, _local4, _local6);
_local2 = String(_local9);
};
delayedHit++;
if (delayedHit >= delayedHitsDamage.length){
_local2 = (_local2 + " damage!");
};
messages.updateMostRecent("", (" + " + _local2));
}
private function drawEffectedTargets():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:Array;
var _local5:*;
var _local6:CharacterPortrait;
var _local7:PortraitEffected;
removePortraitEffected();
if (!((speedlist[turn] is PlayerCharacter))){
return;
};
_local1 = false;
if (getChildByName("skillbar") == null){
return;
};
_local2 = 0;
while (_local2 < valid_targets.length) {
if (hover == valid_targets[_local2]){
_local1 = true;
};
_local2++;
};
if (_local1){
_local3 = skillbar.getSelectedSkill();
_local4 = getEffectedTargets(hover, _local3);
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].portraitRef;
_local7 = new PortraitEffected();
_local7.x = dmf.getGlobalX(_local6);
_local7.y = dmf.getGlobalY(_local6);
_local7.name = ("ei" + _local5);
bg.addChildAt(_local7, 1);
_local5++;
};
};
}
public function powerPreview(){
var _local1:*;
if ((speedlist[turn] is MonsterCharacter)){
return;
};
PortraitFromCharacter(speedlist[turn]).endPowerCostPreview();
_local1 = skillbar.getSelectedSkill().power_cost;
if (skillbar.getSelectedSkill().costsRemainingPower){
_local1 = speedlist[turn].power;
};
PortraitFromCharacter(speedlist[turn]).startPowerCostPreview(_local1);
}
private function useSkill(_arg1:Character, _arg2:Skill, _arg3:Character, _arg4:Boolean=false):void{
var j:int;
var lethality:int;
var chars:Array;
var miss:Boolean;
var total_damage:int;
var total_healing:int;
var total_power_damage:int;
var missed_targets:int;
var res:Boolean;
var attackTriggeredBonus:Boolean;
var quicknessChange:Boolean;
var staggerHits:Boolean;
var staggerHitsDelay:int;
var message1:String;
var message2:String;
var firstTarget:Boolean;
var c:Character;
var hits:int;
var damage:int;
var power_damage:int;
var oldPower:*;
var healing:int;
var tchars:Array;
var i:*;
var second_index:*;
var secondary:Character;
var t:*;
var splash_x:*;
var splash_y:*;
var splash_char:*;
var summon_pos:int;
var summon_row:*;
var summon_col:*;
var eepos:int;
var old_chars_length:*;
var swapTemp:int;
var shuffleTargets:Array;
var shuffleEmptyPrefix:String;
var order:Array;
var shufi:int;
var newPos:int;
var emptyP:EmptyPortrait;
var movePortrait:*;
var needHydraHeads:int;
var hh:MonsterCharacter;
var err_txt:*;
var err_dlg:ErrorDialog;
var temp_healing:int;
var temp_damage:int;
var oldPoison:int;
var actual_damage:int;
var actual_power_damage:int;
var doPoisonAmount:int;
var whirlwindPos:int;
var whirlwindMove:Boolean;
var whirlwindNewPos:Array;
var wx:int;
var wy:int;
var empty:EmptyPortrait;
var delayedHitsTimer:Timer;
var regen:*;
var bonusAttack:Boolean;
var benedictionQuickness:int;
var stun_chance:int;
var stun_roll:int;
var transformed:*;
var pd:*;
var pr:*;
var suicide_dmg:int;
var user = _arg1;
var skill = _arg2;
var target = _arg3;
var isBonusAttack = _arg4;
lethality = 0;
chars = new Array();
miss = false;
total_damage = 0;
total_healing = 0;
total_power_damage = 0;
missed_targets = 0;
res = false;
attackTriggeredBonus = false;
quicknessChange = false;
staggerHits = false;
staggerHitsDelay = 0;
message1 = "";
message2 = "";
errorCode = 999;
try {
usedSkill = true;
damage = skill.getDamage();
power_damage = skill.powerDamage;
if (skill.powerRestore){
power_damage = -(skill.powerRestore);
};
if (isBonusAttack){
bonusAttackPending = false;
};
damage = Math.round((damage * user.buff_damage));
damage = Math.round((damage * user.debuff_damage));
if (damage){
damage = Math.round((damage * user.damageMod));
user.damageMod = 1;
};
delayedHit = -1;
delayedHitsDamage.length = 0;
delayedHitsSkill.length = 0;
delayedHitsTarget.length = 0;
delayedHitsAttacker.length = 0;
if (skill.hitsAllMeleeRange){
if ((user is PlayerCharacter)){
chars = valid_targets.concat();
} else {
chars = BattleFunctions.findMonsterTargets(MonsterCharacter(user), skill, horde, combat_grid, pc_party);
};
} else {
if (skill.attacksTwoTargets){
staggerHits = true;
staggerHitsDelay = 400;
if ((user is PlayerCharacter)){
chars.push(target);
} else {
tchars = BattleFunctions.findMonsterTargets(MonsterCharacter(user), skill, horde, combat_grid, pc_party);
tchars = cullIntimidatingTargets(tchars, skill);
if (tchars.length == 1){
chars.push(target);
chars.push(target);
} else {
if (tchars.length == 2){
chars = tchars;
} else {
if (tchars.length > 2){
chars.push(target);
i = 0;
while (i < tchars.length) {
if (tchars[i] == target){
tchars.splice(i, 1);
};
i = (i + 1);
};
chars.push(tchars[dm.randomNum(0, (tchars.length - 1))]);
} else {
chars.push(target);
};
};
};
};
} else {
if (skill.piercesColumn){
if (target.pos > 3){
second_index = (target.pos - 3);
} else {
second_index = (target.pos + 3);
};
if ((target is MonsterCharacter)){
secondary = horde.memberInPos(second_index);
} else {
secondary = pc_party.memberInPos(second_index);
};
chars.push(target);
if (secondary != null){
chars.push(secondary);
};
} else {
if (skill.hitsAllEnemies){
if ((user is PlayerCharacter)){
chars = horde.members.concat();
} else {
chars = pc_party.members.concat();
};
} else {
if (skill.hitsAllFriendlies){
if ((user is MonsterCharacter)){
chars = horde.members.concat();
} else {
chars = pc_party.members.concat();
};
} else {
if (skill.splashDamageMultiplier){
chars.push(target);
t = target.pos;
splash_x = 0;
splash_y = 0;
if (t < 4){
splash_x = (t - 1);
} else {
splash_x = (t - 4);
};
if (t < 4){
splash_y = 0;
} else {
splash_y = 1;
};
if ((target is PlayerCharacter)){
splash_y = (splash_y + 2);
};
splash_char = validCharFromGrid((splash_x - 1), splash_y);
if (splashDamageCheck(skill, user, splash_char)){
chars.push(splash_char);
};
splash_char = validCharFromGrid((splash_x + 1), splash_y);
if (splashDamageCheck(skill, user, splash_char)){
chars.push(splash_char);
};
splash_char = validCharFromGrid(splash_x, (splash_y - 1));
if (splashDamageCheck(skill, user, splash_char)){
chars.push(splash_char);
};
splash_char = validCharFromGrid(splash_x, (splash_y + 1));
if (splashDamageCheck(skill, user, splash_char)){
chars.push(splash_char);
};
} else {
if (skill.summonsCreatureClass != null){
summon_pos = 0;
if ((user is MonsterCharacter)){
if (horde.members.length == 6){
return;
};
summon_row = 1;
while (summon_row >= 0) {
summon_col = 0;
while (summon_col < 3) {
if (combat_grid[summon_col][summon_row] == null){
summon_pos = combatGridToPos(summon_col, summon_row);
break;
};
summon_col = (summon_col + 1);
};
if (summon_pos > 0){
break;
};
summon_row = (summon_row - 1);
};
} else {
if (playerTargetPos != -1){
summon_pos = playerTargetPos;
playerTargetPos = -1;
};
};
if (skill.hitsAllEmpty){
eepos = 1;
while (eepos <= 6) {
if ((user is MonsterCharacter)){
if (horde.memberInPos(eepos) == null){
addSummon(skill, user, eepos);
};
} else {
if (pc_party.memberInPos(eepos) == null){
addSummon(skill, user, eepos);
};
};
eepos = (eepos + 1);
};
quicknessChange = true;
} else {
if (summon_pos > 0){
addSummon(skill, user, summon_pos);
quicknessChange = true;
};
};
} else {
chars.push(target);
};
};
};
};
};
};
};
if (skill.attacksMultipleTimes > 1){
old_chars_length = chars.length;
j = 1;
while (j < skill.attacksMultipleTimes) {
i = 0;
while (i < old_chars_length) {
chars.push(chars[i]);
i = (i + 1);
};
j = (j + 1);
};
staggerHits = true;
staggerHitsDelay = Math.round((1200 / chars.length));
};
if (skill.extraSpeedAttacks){
if (user.getQuickness() > target.getQuickness()){
staggerHits = true;
staggerHitsDelay = Math.round((1200 / skill.extraSpeedAttacks));
j = 0;
while (j < skill.extraSpeedAttacks) {
chars.push(target);
j = (j + 1);
};
};
};
if (skill.swapPositions){
swapTemp = target.pos;
target.pos = user.pos;
user.pos = swapTemp;
updateCombatGrid();
if (((!((target.portraitRef == null))) && (!((user.portraitRef == null))))){
swapPortraits(target.portraitRef, user.portraitRef);
updateCurrentTurnHighlight();
};
};
oldPower = user.power;
if ((((((user is PC_Mage)) && (skill.power_cost))) && ((dmf.randomNum(0, 99) < PC_Mage(user).mastery)))){
addFloater(user, "Spell Mastery!");
} else {
user.reducePower(skill.power_cost);
if (skill.costsRemainingPower){
user.power = 0;
};
};
numTargets = chars.length;
healing = skill.scaleHeal(skill.healing, numTargets);
if (skill.shufflesEnemies){
order = [1, 2, 3, 4, 5, 6];
order = dm.shuffleArray(order);
if ((user is PlayerCharacter)){
shuffleTargets = horde.members;
shuffleEmptyPrefix = "npc";
} else {
if ((user is MonsterCharacter)){
shuffleTargets = pc_party.members;
shuffleEmptyPrefix = "pc";
};
};
shufi = 0;
while (shufi < shuffleTargets.length) {
newPos = order[shufi];
shuffleTargets[shufi].pos = newPos;
emptyP = EmptyPortrait(getChildByName((shuffleEmptyPrefix + String(newPos))));
movePortrait = shuffleTargets[shufi].portraitRef;
if (((!((movePortrait == null))) && (!((emptyP == null))))){
if (movePortrait.parent != null){
movePortrait.parent.removeChild(movePortrait);
emptyP.addChild(movePortrait);
movePortrait.addHoverListeners();
};
};
shufi = (shufi + 1);
};
updateCombatGrid();
};
if (skill.hydraGrowHeads){
needHydraHeads = horde.needHydraHeads();
chars.length = 0;
if (needHydraHeads){
for each (hh in horde.members) {
if (!(needHydraHeads)){
break;
};
if ((((hh is mHydraHead)) && ((hh.health <= 0)))){
hh.resetMonster();
mHydraHead(hh).togglePortrait();
hh.portraitRef.update();
chars.push(hh);
needHydraHeads = (needHydraHeads - 1);
};
};
while (((needHydraHeads) && ((horde.members.length < 6)))) {
addHydraHead(user.level);
needHydraHeads = (needHydraHeads - 1);
quicknessChange = true;
};
};
};
} catch(error:Error) {
if (((DungeonMain.KONGREGATE) || (DungeonMain.BETA))){
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (("Skill target selection error: " + error.name) + "\n"));
if (skill != null){
err_txt = (err_txt + (("skill: " + skill.skillname) + "\n"));
};
if (speedlist[turn] != null){
err_txt = (err_txt + (((((("turn: " + turn) + "/") + String((speedlist.length - 1))) + " - ") + speedlist[turn].charname) + "\n"));
};
if (target != null){
err_txt = (err_txt + (("target: " + target.charname) + "\n"));
};
err_txt = (err_txt + (("errorCode: " + errorCode) + "\n"));
err_txt = (err_txt + ((("[" + error.errorID) + "] ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
};
};
firstTarget = true;
hits = 0;
try {
for each (c in chars) {
hits = (hits + 1);
if (c == null){
} else {
if (!((c is Character))){
} else {
if ((((c.health <= 0)) && (!((skill.resurrects == true))))){
} else {
if ((((c is PlayerCharacter)) && (PlayerCharacter(c).retreated))){
} else {
if ((((c == user)) && (skill.doesNotEffectSelf))){
} else {
if (c.portraitRef == null){
c.portraitRef = PortraitFromCharacter(c);
};
errorCode = 1;
temp_healing = healing;
if (skill.clonesPlayers){
if ((c is PlayerCharacter)){
createClone(PlayerCharacter(c));
quicknessChange = true;
};
};
if (skill.forceRetreat){
if ((c is PlayerCharacter)){
PlayerCharacter(c).retreating = true;
addFloater(c, "Fleeing!");
message2 = "Allies are fleeing the battle!";
};
};
errorCode = 2;
if (skill.cannotDie){
addFloater(c, "Defiant!");
c.cannotDie = skill.cannotDie;
c.cannotDieMin = skill.getDefianceHealth();
};
errorCode = 3;
if (skill.invulnerable){
c.invulnerable = skill.invulnerable;
};
errorCode = 4;
if (skill.makeDamageSponge){
if ((c is PlayerCharacter)){
damageSpongePlayer = PlayerCharacter(c);
} else {
damageSpongeMonster = MonsterCharacter(c);
};
addFloater(c, "Protecting!");
message2 = (c.charname + " is now protecting allies!");
};
errorCode = 5;
if (skill.tempDamageResistance){
c.temp_damage_resistance = skill.tempDamageResistance;
};
errorCode = 6;
if (skill.powerRegenMod != 1){
c.powerRegenMod = (c.powerRegenMod * skill.powerRegenMod);
};
errorCode = 7;
if (skill.hidesTarget){
c.hiding = true;
c.portraitRef.setHiding(true);
};
errorCode = 801;
if (skill.intimidating){
c.intimidating = true;
};
errorCode = 802;
temp_damage = modifySkillDamage(damage, skill, c, user, oldPower, (c == target));
errorCode = 9;
if (skill.summonsWhirlwind){
whirlwindPos = c.pos;
whirlwindMove = false;
whirlwindNewPos = new Array();
if ((((horde.members.length < 6)) && (!((c is mDemon))))){
if (c.pos > 3){
wx = (whirlwindPos % 4);
} else {
wx = (whirlwindPos - 1);
};
wy = (Math.ceil((whirlwindPos / 3)) - 1);
if ((((wy > 0)) && ((combat_grid[wx][(wy - 1)] == null)))){
whirlwindNewPos.push(combatGridToPos(wx, (wy - 1)));
};
if ((((wy < 1)) && ((combat_grid[wx][(wy + 1)] == null)))){
whirlwindNewPos.push(combatGridToPos(wx, (wy + 1)));
};
if ((((wx > 0)) && ((combat_grid[(wx - 1)][wy] == null)))){
whirlwindNewPos.push(combatGridToPos((wx - 1), wy));
};
if ((((wx < 2)) && ((combat_grid[(wx + 1)][wy] == null)))){
whirlwindNewPos.push(combatGridToPos((wx + 1), wy));
};
};
if (whirlwindNewPos.length){
whirlwindMove = true;
};
if (whirlwindMove){
c.pos = whirlwindNewPos[dmf.randomNum(0, (whirlwindNewPos.length - 1))];
updateCombatGrid();
if (c.portraitRef.parent != null){
c.portraitRef.parent.removeChild(c.portraitRef);
};
empty = EmptyPortrait(getChildByName(("npc" + String(c.pos))));
if (empty != null){
empty.empty.addChild(c.portraitRef);
};
summonWhirlwind(user, whirlwindPos);
quicknessChange = true;
} else {
temp_damage = Math.round((temp_damage * 1.2));
};
};
errorCode = 99;
if (((!(firstTarget)) && (staggerHits))){
if (delayedHit == -1){
delayedHit = 0;
};
delayedHitsDamage.push(temp_damage);
delayedHitsSkill.push(skill);
delayedHitsTarget.push(c);
delayedHitsAttacker.push(user);
delayedHitsDelay = staggerHitsDelay;
delayedHitsTimer = new Timer((staggerHitsDelay * (hits - 1)), 1);
delayedHitsTimer.addEventListener(TimerEvent.TIMER_COMPLETE, delayedHitsTimerComplete);
delayedHitsTimer.start();
} else {
errorCode = 10;
miss = checkAccuracyMiss(user, skill, total_damage, (missed_targets == 0), firstTarget);
errorCode = 11;
if (miss){
c.portraitRef.addAnimationFrame(miss_animation_frame, skill.portraitAnimationDuration);
missed_targets = (missed_targets + 1);
} else {
errorCode = 13;
if (skill.cancelPowerRegen > c.cancelPowerRegen){
c.cancelPowerRegen = skill.cancelPowerRegen;
c.powerRegenMod = 1;
c.buff_powerRegen = 0;
};
if (skill.cancelHealthRegen > c.cancelHealthRegen){
c.cancelHealthRegen = skill.cancelHealthRegen;
c.buff_healthRegen = 0;
};
if (skill.woundsRestorePower){
c.woundsRestorePower = Math.max(skill.woundsRestorePower, c.woundsRestorePower);
};
errorCode = 14;
if (((skill.crippling) && ((skill.crippling > c.crippled)))){
c.crippled = skill.crippling;
initDisplay.updateIcon(c);
quicknessChange = true;
};
errorCode = 15;
if (skill.curse){
c.cursed = Math.max(skill.curse, c.cursed);
};
errorCode = 16;
if (skill.removesCurse){
c.cursed = 0;
};
errorCode = 17;
c.damageMod = Math.max(skill.targetDamageMod, c.damageMod);
errorCode = 18;
if (skill.buff_resistPoison){
c.buff_resistPoison = Math.max(c.buff_resistPoison, skill.buff_resistPoison);
};
if (skill.buff_resistStun){
c.buff_resistStun = Math.max(c.buff_resistStun, skill.buff_resistStun);
};
if (skill.buff_damageResist){
c.buff_damageResist = Math.max(c.buff_damageResist, skill.buff_damageResist);
};
if (skill.buff_damageReflect){
c.buff_damageReflect = Math.max(c.buff_damageReflect, skill.buff_damageReflect);
};
if (skill.buff_powerRegen){
c.buff_powerRegen = Math.max(c.buff_powerRegen, skill.buff_powerRegen);
};
if (skill.buff_vampiric){
c.buff_vampiric = Math.max(c.buff_vampiric, skill.buff_vampiric);
};
if (skill.buff_stun){
c.buff_stun = Math.max(c.buff_stun, skill.buff_stun);
};
if (skill.buff_quickness){
c.buff_quickness = Math.max(c.buff_quickness, skill.buff_quickness);
initDisplay.updateIcon(c);
quicknessChange = true;
};
errorCode = 19;
if (skill.buff_damage > c.buff_damage){
c.buff_damage = skill.buff_damage;
};
if (skill.buff_accuracy){
c.buff_accuracy = Math.max(c.buff_accuracy, skill.buff_accuracy);
};
if (skill.buff_healthRegen){
regen = skill.buff_healthRegen;
if ((((skill.increasesWith >= Skill.strength)) && ((skill.increasesWith <= Skill.intellect)))){
regen = skill.scaleHeal(skill.buff_healthRegen);
};
c.buff_healthRegen = Math.max(c.buff_healthRegen, regen);
};
if (skill.debuff_damageResist){
c.debuff_damageResist = Math.max(skill.debuff_damageResist, c.debuff_damageResist);
};
if (skill.debuff_damage != 1){
c.debuff_damage = Math.min(skill.debuff_damage, c.debuff_damage);
};
errorCode = 20;
if (skill.resurrects){
if (c.health <= 0){
c.portraitRef.setAlive();
res = true;
};
};
errorCode = 21;
if ((((((user is PC_Ranger)) && ((c is MonsterCharacter)))) && ((dmf.randomNum(0, 99) < PC_Ranger(user).creatureLore)))){
if (c.debuff_damageResist < 40){
c.debuff_damageResist = (c.debuff_damageResist + 40);
addFloater(c, "Creature Lore!");
};
};
errorCode = 22;
oldPoison = c.poisoned;
if (temp_healing){
c.portraitRef.setHealthPreview(-(temp_healing));
};
actual_damage = 0;
errorCode = 22;
if (temp_damage){
actual_damage = doSkillDamage(user, c, temp_damage, skill);
};
errorCode = 23;
if (power_damage){
c.portraitRef.setPowerPreview(power_damage);
};
errorCode = 24;
actual_power_damage = c.reducePower(power_damage);
errorCode = 25;
total_damage = (total_damage + actual_damage);
total_power_damage = (total_power_damage + actual_power_damage);
total_healing = (total_healing + c.increaseHealth(temp_healing, skill.resurrects));
errorCode = 0xFF;
if (((!(bonusAttackPending)) && (!(isBonusAttack)))){
bonusAttack = false;
if (((((((actual_damage) && ((c.health > 0)))) && ((user is PC_Warrior)))) && ((dmf.randomNum(0, 99) < PC_Warrior(user).leadership)))){
addFloater(user, "Leadership!");
bonusAttack = true;
};
if (((skill.allyBonusAttack) || (bonusAttack))){
bonusAttackPending = true;
bonusAttackTarget = c;
bonusAttacker = null;
attackTriggeredBonus = true;
};
};
errorCode = 2551;
if ((((((skill is sClericHeal)) && ((user is PC_Cleric)))) && ((dmf.randomNum(0, 99) < PC_Cleric(user).benediction)))){
benedictionQuickness = c.getQuickness();
c.clearNegativeEffects();
if (benedictionQuickness != c.getQuickness()){
quicknessChange = true;
};
addFloater(user, "Benediction!");
};
errorCode = 26;
if (skill.stun_percent){
stun_chance = (skill.stun_percent + Math.ceil((user.getStunChance() / chars.length)));
if (target.invulnerable){
stun_chance = 0;
};
stun_roll = dmf.randomNum(0, 99);
if (stun_roll < stun_chance){
c.portraitRef.stunAnim();
c.stun(1);
if (!(skill.suppressStunAnim)){
c.portraitRef.checkStun();
};
};
};
errorCode = 27;
doPoisonAmount = 0;
if (skill.poisonDamage){
doPoisonAmount = (skill.scalePoison() + Math.ceil((user.getPoisonDamage() / chars.length)));
};
if ((((user is PC_Rogue)) && (actual_damage))){
doPoisonAmount = (doPoisonAmount + Math.ceil((actual_damage * (PC_Rogue(user).poisoncraft / 100))));
};
if (doPoisonAmount){
if (c.poison(doPoisonAmount)){
c.portraitRef.setPoisoned(true);
};
};
errorCode = 28;
if (skill.damageAccuracy){
if (skill.damageAccuracy > c.accuracy_penalty){
c.accuracy_penalty = skill.damageAccuracy;
};
};
errorCode = 29;
if (res){
CalculateInitiative(false);
initDisplay.insertChar(c, speedlist[turn]);
};
errorCode = 30;
if (((((skill.gainPowerFromKill) && (actual_damage))) && (!(c.health)))){
user.portraitRef.setPowerPreview(-(skill.gainPowerFromKill));
user.increasePower(skill.gainPowerFromKill);
};
errorCode = 31;
addPortraitAnim(c, skill, user);
errorCode = 32;
if (oldPoison < c.poisoned){
c.portraitRef.addPortraitAnimation(PortraitAnimation.poison);
};
errorCode = 33;
if (skill.removesPoison){
c.poisoned = 0;
c.portraitRef.setPoisoned(false);
};
errorCode = 34;
if (((skill.powerDrain) && (actual_power_damage))){
user.portraitRef.setPowerPreview(-(actual_power_damage));
user.increasePower(actual_power_damage);
user.portraitRef.addPortraitAnimation(PortraitAnimation.gainPower);
};
errorCode = 35;
if (skill.transformCreatureClass != null){
transformed = skill.transformCreatureClass;
transformed.pos = c.pos;
if ((c is MonsterCharacter)){
transformed.portraitRef = c.portraitRef;
replaceChar(c, transformed);
c.clearStatusEffects();
c.portraitRef.setChar(transformed, true);
c.portraitRef.addPortraitAnimation(PortraitAnimation.transform);
if (c == speedlist[turn]){
speedlist[turn] = transformed;
};
c = transformed;
quicknessChange = true;
};
};
firstTarget = false;
};
};
};
};
};
};
};
};
errorCode = 36;
message1 = (((user.charname + " ") + skill.verbage) + "!");
if (total_power_damage > 0){
pd = (total_power_damage + " power ");
if (skill.powerDrain){
pd = (pd + "drained");
} else {
pd = (pd + "damage");
};
message2 = pd;
} else {
if (total_power_damage < 0){
pr = (-(total_power_damage) + " power restored");
message2 = pr;
};
};
errorCode = 37;
if (((skill.healing) || (healing))){
message2 = (total_healing + " damage healed");
};
if (((staggerHits) && (damage))){
if (missed_targets){
message2 = "(Miss)";
} else {
message2 = String(total_damage);
};
} else {
if (((skill.damage) || (damage))){
message2 = (total_damage + " damage");
};
};
errorCode = 38;
if (((chars.length) && ((missed_targets == chars.length)))){
message2 = "Miss!";
errorCode = 381;
if (dm.sound != null){
errorCode = 3811;
dm.sound.playMissSound(skill, user);
};
} else {
errorCode = 382;
if (dm.sound != null){
errorCode = 3821;
dm.sound.playSoundForSkill(skill, user);
};
};
errorCode = 39;
if (skill.killsUser){
suicide_dmg = (user.health + 1);
user.portraitRef.setHealthPreview(suicide_dmg);
user.reduceHealth(suicide_dmg);
};
if (isBonusAttack){
message2 = (message2 + " (bonus attack)");
};
messages.addMessage(message1, message2);
if (((!(res)) && (!(quicknessChange)))){
initDisplay.removeDead();
};
errorCode = 40;
if (quicknessChange){
if (CalculateInitiative(false)){
errorCode = 41;
initDisplay.refill(speedlist[turn]);
};
};
errorCode = 100;
} catch(error:Error) {
if (((DungeonMain.KONGREGATE) || (DungeonMain.BETA))){
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (((("Skill use error: " + error.name) + " ") + error.message) + "\n"));
if (skill != null){
err_txt = (err_txt + (("skill: " + skill.skillname) + "\n"));
};
if (speedlist[turn] != null){
err_txt = (err_txt + (((((("turn: " + turn) + "/") + String((speedlist.length - 1))) + " - ") + speedlist[turn].charname) + "\n"));
};
if (target != null){
err_txt = (err_txt + (("target: " + target.charname) + "\n"));
};
if (c != null){
err_txt = (err_txt + (("hitting: " + c.charname) + "\n"));
};
if (c != null){
err_txt = (err_txt + (("targets: " + chars.length) + "\n"));
};
err_txt = (err_txt + (("errorCode: " + errorCode) + "\n"));
err_txt = (err_txt + ((("[" + error.errorID) + "] ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
};
} finally {
UpdateInfoPanels();
EndTurn(isBonusAttack);
doLethalAnim = false;
};
}
private function addPlayerTarget(_arg1:Character):void{
var _local2:CharacterPortrait;
var _local3:*;
var _local4:PortraitHighlight;
_local2 = CharacterPortrait(PortraitFromCharacter(_arg1));
_local3 = 0;
while (_local3 < valid_targets.length) {
if (valid_targets[_local3] == _arg1){
return;
};
_local3++;
};
valid_targets.push(_arg1);
valid_targets_portraits.push(_local2);
_local2.addEventListener(MouseEvent.MOUSE_DOWN, clickAttack);
_local4 = new PortraitHighlight();
_local4.name = "highlight";
_local2.addChild(_local4);
}
private function summonWhirlwind(_arg1:Character, _arg2:int):void{
var _local3:Character;
var _local4:CharacterPortrait;
_local3 = new mWhirlwind(_arg1.level);
_local3.pos = _arg2;
horde.members.push(_local3);
AddCharToCombatGrid(_local3);
_local4 = addNewPortrait(_local3);
_local4.addPortraitAnimation(PortraitAnimation.summonWhirlwind);
}
private function removeEmptyListeners():void{
var _local1:int;
var _local2:*;
var _local3:*;
_local1 = 1;
while (_local1 <= 6) {
_local2 = getChildByName(("pc" + _local1));
_local2.removeEventListener(MouseEvent.MOUSE_DOWN, emptyClicked);
_local3 = _local2.getChildByName("highlight");
if (_local3 != null){
_local2.removeChild(_local3);
};
_local1++;
};
}
function clickRetreat(_arg1:MouseEvent):void{
if ((speedlist[turn] is PlayerCharacter)){
if ((((pc_party.campaign == Campaign.SURVIVAL)) && (!(speedlist[turn].summoned)))){
messages.addMessage((speedlist[turn].charname + " cannot retreat!"), "This battle is to the death.");
return;
};
if (PlayerCharacter(speedlist[turn]).canQuickRetreat()){
RetreatCharacter(speedlist[turn]);
} else {
PlayerCharacter(speedlist[turn]).retreating = true;
messages.addMessage((speedlist[turn].charname + " is retreating."), "");
PortraitFromCharacter(speedlist[turn]).update();
EndTurn();
};
};
}
private function CanPlayerHit(_arg1:PlayerCharacter, _arg2:MonsterCharacter):Boolean{
var _local3:*;
var _local4:*;
var _local5:*;
_local5 = 0;
if (IsPlayerMeleeBlocked(_arg1)){
return (false);
};
if (((!((damageSpongeMonster == null))) && ((_arg2 == damageSpongeMonster)))){
return (true);
};
if (_arg2.pos > 3){
if ((((((((((((_arg2.pos == _arg1.pos)) || ((_arg2.pos == (_arg1.pos + 1))))) || ((_arg2.pos == (_arg1.pos - 1))))) || ((_arg2.pos == (_arg1.pos + 4))))) || ((_arg2.pos == (_arg1.pos + 3))))) || ((_arg2.pos == (_arg1.pos + 2))))){
return (true);
};
return (false);
//unresolved jump
};
_local3 = 0;
while (_local3 < 3) {
if (combat_grid[_local3][1] != null){
if ((((Character(combat_grid[_local3][1]).health > 0)) && (!(Character(combat_grid[_local3][1]).hiding)))){
_local5++;
};
};
_local3++;
};
if (_local5){
return (false);
};
if ((((((((((((_arg2.pos == _arg1.pos)) || ((_arg2.pos == (_arg1.pos + 1))))) || ((_arg2.pos == (_arg1.pos - 1))))) || ((_arg2.pos == (_arg1.pos - 4))))) || ((_arg2.pos == (_arg1.pos - 3))))) || ((_arg2.pos == (_arg1.pos - 2))))){
return (true);
};
return (false);
}
private function cullIntimidatingTargets(_arg1:Array, _arg2:Skill):Array{
var _local3:int;
if (_arg2.hitsAllEnemies){
return (_arg1);
};
if (_arg2.hitsAllFriendlies){
return (_arg1);
};
if (_arg2.targetsSelf){
return (_arg1);
};
_local3 = (_arg1.length - 1);
while (_local3 >= 0) {
if (_arg1.length == 1){
break;
};
if ((_arg1[_local3] is PlayerCharacter)){
if (_arg1[_local3].intimidating){
_arg1.splice(_local3, 1);
} else {
if ((((_arg1[_local3] is PC_Rogue)) && (PC_Rogue(_arg1[_local3]).elusiveness))){
if (dmf.randomNum(0, 99) < PC_Rogue(_arg1[_local3]).elusiveness){
addFloater(_arg1[_local3], "Elusiveness!");
_arg1.splice(_local3, 1);
};
};
};
};
_local3--;
};
return (_arg1);
}
private function EndBattle():void{
var err_txt:String;
var err_dlg:ErrorDialog;
var r:int;
var p:PlayerCharacter;
var pAlive:Boolean;
var pc:PlayerCharacter;
var duration:int;
try {
if (pc_party.campaign == Campaign.SURVIVAL){
pAlive = false;
for each (pc in pc_party.members) {
if (pc == null){
} else {
if (pc.health <= 0){
continue;
} else {
if ((pc is PlayerSummon)){
continue;
} else {
pAlive = true;
};
};
};
};
if (pAlive){
currentWave++;
initWave();
RunTurn();
return;
} else {
if (dm.main != null){
if (dm.main.battle_theme != null){
dm.main.battle_theme.fadeOut();
};
dm.main.survivalDefeat(currentWave);
};
return;
};
};
for each (p in pc_party.members) {
if (p == null){
} else {
if (p.health <= 0){
} else {
r = p.getReplenishing();
if (r){
p.increaseHealthByPercentage(r);
p.increasePowerByPercentage(r);
};
};
};
};
} catch(error:Error) {
if (((DungeonMain.KONGREGATE) || (DungeonMain.BETA))){
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (("Replenish Error: " + error.name) + "\n"));
err_txt = (err_txt + (("r: " + r) + "\n"));
err_txt = (err_txt + (("errorCode: " + errorCode) + "\n"));
err_txt = (err_txt + ((("[" + error.errorID) + "] ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
};
};
try {
duration = 500;
if (dm.main != null){
if (dm.main.battle_theme != null){
dm.main.battle_theme.fadeOut(duration);
};
} else {
if (parent != null){
if (DungeonMain(parent).battle_theme != null){
DungeonMain(parent).battle_theme.fadeOut(duration);
};
};
};
exitedSafely = false;
exitTimer = new Timer(duration, 1);
exitTimer.addEventListener(TimerEvent.TIMER_COMPLETE, exitBattleTimer);
exitTimer.start();
if (DungeonMain.combatBlur){
blurTimer = new Timer((duration - 150), 1);
blurTimer.addEventListener(TimerEvent.TIMER_COMPLETE, exitBlur);
blurTimer.start();
};
} catch(error:Error) {
if (((DungeonMain.KONGREGATE) || (DungeonMain.BETA))){
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (("End Battle Timer Error: " + error.name) + "\n"));
err_txt = (err_txt + (("errorCode: " + errorCode) + "\n"));
err_txt = (err_txt + ((("[" + error.errorID) + "] ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
};
exitBattleTimer(null);
};
}
private function convertPlayerPos(_arg1:int):int{
if (_arg1 < 4){
return ((_arg1 + 3));
};
if (_arg1 > 3){
return ((_arg1 - 3));
};
return (0);
}
private function RetreatCharacter(_arg1:PlayerCharacter):void{
_arg1.retreating = false;
_arg1.retreated = true;
_arg1.clearStatusEffects();
if (_arg1.summoned){
messages.addMessage((_arg1.charname + " disappears!"), "Unsummoned");
} else {
messages.addMessage((_arg1.charname + " leaves the battle!"), "");
};
PortraitFromCharacter(_arg1).setRetreated();
initDisplay.removeDead();
EndTurn();
}
function mousedOutEvent(_arg1:MouseEvent):void{
hover = null;
UpdateInfoPanels();
removePortraitEffected();
initDisplay.setNormalColors();
}
function stopDragging(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:EmptyPortrait;
var _local7:CharacterPortrait;
var _local8:EmptyPortrait;
var _local9:int;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:PlayerCharacter;
var _local14:CharacterPortrait;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = 500;
if ((((_arg1 == null)) || ((_arg1.currentTarget == null)))){
return;
};
_local7 = CharacterPortrait(_arg1.currentTarget);
_local9 = 0;
this.addChild(_local7);
_local7.stopDrag();
_local10 = (_local7.x + (_local7.width / 2));
_local11 = (_local7.y + (_local7.height / 2));
_local12 = 0;
while (_local12 < 6) {
_local8 = EmptyPortrait(getChildByName(("pc" + String((_local12 + 1)))));
_local2 = (_local8.x + (_local8.width / 2));
_local3 = (_local8.y + (_local8.height / 2));
_local4 = DistanceBetween(_local2, _local3, _local10, _local11);
if (_local4 > 80){
} else {
if (_local4 < _local5){
_local5 = _local4;
_local6 = _local8;
_local9 = (_local12 + 1);
};
};
_local12++;
};
if (_local5 == 500){
_local7.x = EmptyPortrait(getChildByName(("pc" + String(_local7.char_ref.pos)))).x;
_local7.y = EmptyPortrait(getChildByName(("pc" + String(_local7.char_ref.pos)))).y;
} else {
_local13 = pc_party.memberInPos(_local9);
_local14 = PortraitFromCharacter(_local13);
if (_local13 != null){
_local13.pos = _local7.char_ref.pos;
_local14.x = EmptyPortrait(getChildByName(("pc" + String(_local7.char_ref.pos)))).x;
_local14.y = EmptyPortrait(getChildByName(("pc" + String(_local7.char_ref.pos)))).y;
};
_local7.x = _local6.x;
_local7.y = _local6.y;
_local7.char_ref.pos = _local9;
};
}
private function doTurnRegen(_arg1:Character, _arg2:CharacterPortrait):Boolean{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:String;
var _local7:String;
_local3 = 0;
_local4 = 0;
_local4 = _arg1.getPowerRegen();
if ((((_arg1 is PlayerCharacter)) && (pc_party.tactical))){
_local4 = 0;
};
if (_arg1.cancelPowerRegen > 0){
_local4 = 0;
_arg1.cancelPowerRegen--;
};
_arg1.powerRegenMod = 1;
if (_arg1.cancelHealthRegen > 0){
_local3 = 0;
_arg1.cancelHealthRegen--;
} else {
_local3 = _arg1.getHealthRegen();
};
if (_arg1.poisoned){
_local5 = _arg1.poisoned;
_local3 = (_local3 - _local5);
if (_arg2 != null){
_arg2.addPortraitAnimation(PortraitAnimation.poison);
};
_local6 = (((_arg1.charname + " takes ") + _local5) + " damage from poison!");
_local7 = "";
if ((_arg1.health + _local3) <= 0){
_local7 = (_arg1.charname + " has died!");
};
messages.addMessage(_local6, _local7);
};
if (_arg2 != null){
_arg2.setHealthPreview(-(_local3));
_arg2.setPowerPreview(-(_local4));
};
_arg1.increaseHealth(_local3);
_arg1.increasePower(_local4);
UpdateInfoPanels();
return (true);
}
function exitBattleTimer(_arg1:TimerEvent):void{
var _local2:Character;
if (exitedSafely){
return;
};
exitedSafely = true;
if (exitTimer != null){
exitTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, exitBattleTimer);
};
for each (_local2 in pc_party.members) {
_local2.portraitRef = null;
};
for each (_local2 in horde.members) {
_local2.portraitRef = null;
};
if (dm.main != null){
dm.main.PostBattle(horde, pc_party);
} else {
if (parent != null){
DungeonMain(parent).PostBattle(horde, pc_party);
};
};
}
private function doSkillDamage(_arg1:Character, _arg2:Character, _arg3:int, _arg4:Skill):int{
var inflicted:int;
var targetPortrait:CharacterPortrait;
var p:CharacterPortrait;
var stun_chance:*;
var stun_roll:*;
var poison_dmg:*;
var acc_dmg:int;
var health_delta:int;
var v_pc:int;
var reflect:*;
var curseAdd:*;
var err_txt:*;
var err_dlg:*;
var c = _arg1;
var target = _arg2;
var damage = _arg3;
var skill = _arg4;
inflicted = 0;
try {
targetPortrait = PortraitFromCharacter(target);
p = PortraitFromCharacter(c);
if (((((damage) && ((target is PC_Mage)))) && ((dmf.randomNum(0, 99) < PC_Mage(target).shielding)))){
target.portraitRef.setPowerPreview(10);
target.reducePower(10);
addFloater(target, "Shielding!");
var _local6:* = 0;
//unresolved jump
0;
return (_local6);
};
if (damage <= 0){
_local6 = 0;
//unresolved jump
1;
return (_local6);
};
if (targetPortrait != null){
targetPortrait.setHealthPreview(damage);
};
inflicted = target.reduceHealth(damage);
if (target.woundsRestorePower){
target.portraitRef.setPowerPreview(target.woundsRestorePower);
target.increasePower(target.woundsRestorePower);
target.portraitRef.addPortraitAnimation(PortraitAnimation.gainPower);
};
if (((((inflicted) && ((target is PC_Barbarian)))) && ((dmf.randomNum(0, 99) < PC_Barbarian(target).vengeance)))){
target.damageMod = Math.max(1.3, target.damageMod);
addFloater(target, "Vengeance!");
};
if (((c.getStunChance()) && (!(skill.stun_percent)))){
stun_chance = Math.ceil((c.getStunChance() / numTargets));
if (target.invulnerable){
stun_chance = 0;
};
stun_roll = dm.randomNum(1, 100);
if (stun_roll <= stun_chance){
if (targetPortrait != null){
targetPortrait.stunAnim();
};
target.stun(1);
if (((!(skill.suppressStunAnim)) && (!((targetPortrait == null))))){
targetPortrait.checkStun();
};
};
};
if (((c.getPoisonDamage()) && (!(skill.poisonDamage)))){
poison_dmg = Math.ceil((c.getPoisonDamage() / numTargets));
if (((target.poison(poison_dmg)) && (!((targetPortrait == null))))){
targetPortrait.setPoisoned(true);
};
};
if (((c.getAccuracyDamage()) && (!(skill.damageAccuracy)))){
acc_dmg = Math.ceil((c.getAccuracyDamage() / numTargets));
if (acc_dmg > target.accuracy_penalty){
target.accuracy_penalty = acc_dmg;
};
};
if (inflicted){
health_delta = 0;
if (((skill.vampiric_percent) || (c.getVampiric()))){
v_pc = (skill.vampiric_percent + c.getVampiric());
health_delta = Math.ceil(((v_pc / 100) * inflicted));
if ((c is PlayerCharacter)){
health_delta = Math.min(health_delta, (c.health_max / 2));
};
if (p != null){
p.addPortraitAnimation(PortraitAnimation.gainHealth);
};
};
if (((((target.getDamageReflection()) || (c.cursed))) && (inflicted))){
reflect = Math.round((inflicted * (target.getDamageReflection() / 100)));
if ((target is MonsterCharacter)){
reflect = Math.min(reflect, (target.damage / 2));
};
if (c.cursed){
curseAdd = Math.round((c.cursed * inflicted));
if ((target is MonsterCharacter)){
curseAdd = Math.min(curseAdd, (target.damage / 2));
};
if (curseAdd > 0){
reflect = (reflect + curseAdd);
if (p != null){
p.addPortraitAnimation(PortraitAnimation.curse);
};
};
};
health_delta = (health_delta - reflect);
};
if (p != null){
p.setHealthPreview(-(health_delta));
};
c.increaseHealth(health_delta);
};
} catch(error:Error) {
if (((DungeonMain.KONGREGATE) || (DungeonMain.BETA))){
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (((("Do Skill Damage error: " + error.name) + " ") + error.message) + "\n"));
if (skill != null){
err_txt = (err_txt + (("skill: " + skill.skillname) + "\n"));
};
if (c != null){
err_txt = (err_txt + (("user: " + c.charname) + "\n"));
};
if (target != null){
err_txt = (err_txt + (("target: " + target.charname) + "\n"));
};
if (targetPortrait == null){
err_txt = (err_txt + "targetPortrait = null\n");
};
if (p == null){
err_txt = (err_txt + "p = null\n");
};
err_txt = (err_txt + (("errorCode: " + errorCode) + "\n"));
err_txt = (err_txt + (("damage: " + inflicted) + "\n"));
err_txt = (err_txt + ((("[" + error.errorID) + "] ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
};
} finally {
var _local8:* = inflicted;
//unresolved jump
3;
return (_local8);
};
}
private function RunTurn():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:Character;
var _local6:CharacterPortrait;
var _local7:Boolean;
var _local8:Skill;
var _local9:*;
var _local10:Array;
var _local11:Character;
var _local12:Character;
var _local13:int;
var _local14:*;
var _local15:*;
var _local16:*;
var _local17:int;
var _local18:Array;
var _local19:*;
var _local20:*;
var _local21:*;
var _local22:SkillIcon;
var _local23:*;
_local4 = 0;
errorCode = 1330;
while ((((((((speedlist[turn] == null)) || ((speedlist[turn].health <= 0)))) || (speedlist[turn].hadCombatTurn))) || ((((speedlist[turn] is PlayerCharacter)) && (PlayerCharacter(speedlist[turn]).retreated))))) {
IncrementTurn();
_local4++;
if (_local4 > speedlist.length){
EndBattle();
};
};
errorCode = 1331;
_local5 = speedlist[turn];
if (_local5.portraitRef == null){
_local5.portraitRef = PortraitFromCharacter(_local5);
};
_local6 = _local5.portraitRef;
if (_local5.temp_damage_resistance){
_local5.temp_damage_resistance = 0;
};
if (_local5.cannotDie){
_local5.cannotDie--;
};
if (_local5.invulnerable){
_local5.invulnerable--;
};
if (_local5.hiding){
_local5.hiding = false;
_local6.setHiding(false);
};
if (_local5.woundsRestorePower){
_local5.woundsRestorePower = 0;
};
if (((!((damageSpongeMonster == null))) && ((damageSpongeMonster.health <= 0)))){
damageSpongeMonster = null;
};
if (((!((damageSpongePlayer == null))) && ((damageSpongePlayer.health <= 0)))){
damageSpongePlayer = null;
};
errorCode = 1335;
usedSkill = false;
updateCurrentTurnHighlight();
errorCode = 1336;
if ((((_local5 is PlayerCharacter)) && ((damageSpongePlayer == _local5)))){
damageSpongePlayer = null;
} else {
if ((((_local5 is MonsterCharacter)) && ((damageSpongeMonster == _local5)))){
damageSpongeMonster = null;
};
};
UpdateInfoPanels();
errorCode = 1337;
if ((((_local5 is MonsterCharacter)) && (hadMonsterDelay))){
if (_local6 != null){
_local6.update();
};
} else {
_local7 = doTurnRegen(_local5, _local6);
if (!(_local7)){
return;
};
};
errorCode = 1338;
if (_local5.stunned_duration > 0){
errorCode = 1339;
_local5.stunned_duration--;
if (_local6 != null){
_local6.addAnimationFrame(stunned_animation_frame, (PASS_TURN_DELAY + 500));
};
messages.addMessage((_local5.charname + " is stunned!"), "");
EndTurn();
return;
};
if ((((_local5 is MonsterCharacter)) && (!(hadMonsterDelay)))){
errorCode = 1342;
monsterTurnDelayTimer = new Timer(300, 1);
monsterTurnDelayTimer.addEventListener(TimerEvent.TIMER_COMPLETE, monsterTurnDelayComplete);
monsterTurnDelayTimer.start();
return;
};
hadMonsterDelay = false;
errorCode = 1350;
if ((_local5 is PlayerCharacter)){
if (PlayerCharacter(_local5).retreating){
RetreatCharacter(PlayerCharacter(_local5));
return;
};
if (retreatAll){
clickRetreat(null);
return;
};
};
errorCode = 1352;
if ((_local5 is PlayerCharacter)){
playerRegenTimer = new Timer(500, 1);
playerRegenTimer.addEventListener(TimerEvent.TIMER_COMPLETE, playerRegenShown);
playerRegenTimer.start();
};
if ((_local5 is MonsterCharacter)){
errorCode = 1360;
if (!(_local5.skills.length)){
PassTurn();
return;
};
_local9 = null;
_local10 = new Array(0);
_local13 = 0;
if (MonsterCharacter(_local5).mindless){
_local1 = 0;
while (_local1 < _local5.skills.length) {
_local8 = _local5.skills[_local1];
_local9 = BattleFunctions.findMonsterTargets(MonsterCharacter(_local5), _local8, horde, combat_grid, pc_party);
if (_local8.makeDamageSponge){
_local14 = 0;
_local15 = 0;
while (_local15 < horde.members.length) {
if (horde.members[_local15].health > 0){
_local14++;
};
_local15++;
};
if ((((_local9.length > 1)) || ((_local14 > 1)))){
_local10.push(_local8);
};
} else {
if (_local9.length >= 1){
_local10.push(_local8);
};
};
_local1++;
};
if (!(_local10.length)){
PassTurn();
return;
};
if (_local10.length == 1){
_local8 = _local10[0];
} else {
_local8 = _local10[dm.randomNum(0, (_local10.length - 1))];
};
_local9 = BattleFunctions.findMonsterTargets(MonsterCharacter(_local5), _local8, horde, combat_grid, pc_party);
_local9 = cullIntimidatingTargets(_local9, _local8);
_local12 = _local9[0];
if (((_local8.targetsFriendlies) && ((_local9.length > 1)))){
if (_local8.makeDamageSponge){
_local1 = 0;
while (_local1 < _local9.length) {
if (_local9[_local1].getEffectiveHealth() > _local13){
_local13 = _local9[_local1].getEffectiveHealth();
_local12 = _local9[_local1];
};
_local1++;
};
} else {
if (_local8.damage){
_local1 = 0;
while (_local1 < _local9.length) {
if (_local9[_local1].health > _local13){
_local13 = _local9[_local1].health;
_local12 = _local9[_local1];
};
_local1++;
};
} else {
if (_local8.healing){
_local13 = 9999;
_local1 = 0;
while (_local1 < _local9.length) {
if (_local9[_local1].health < _local13){
_local13 = _local9[_local1].health;
_local12 = _local9[_local1];
};
_local1++;
};
};
};
};
_local11 = _local12;
} else {
_local11 = _local9[dm.randomNum(0, (_local9.length - 1))];
};
} else {
_local1 = 0;
while (_local1 < _local5.skills.length) {
_local8 = _local5.skills[_local1];
_local9 = BattleFunctions.findMonsterTargets(MonsterCharacter(_local5), _local8, horde, combat_grid, pc_party);
if (_local9.length >= 1){
_local10.push(_local8);
};
_local1++;
};
if (!(_local10.length)){
PassTurn();
return;
};
_local16 = false;
_local1 = 0;
while (_local1 < _local10.length) {
if (((_local10[_local1].makeDamageSponge) && ((damageSpongeMonster == null)))){
_local8 = _local10[_local1];
_local16 = true;
break;
};
_local1++;
};
if (!(_local16)){
_local17 = 0;
_local18 = new Array();
_local1 = (_local10.length - 1);
while (_local1 >= 0) {
if (_local10[_local1].aiPriority > _local17){
_local17 = _local10[_local1].aiPriority;
_local18 = new Array();
_local18.push(_local10[_local1]);
} else {
if (_local10[_local1].aiPriority == _local17){
_local18.push(_local10[_local1]);
};
};
_local1--;
};
if (_local18.length){
_local10 = _local18;
};
_local8 = _local10[dm.randomNum(0, (_local10.length - 1))];
};
if (((((!(_local8.power_cost)) && ((_local8.aiPriority == 5)))) && ((dm.randomNum(0, 500) > 250)))){
_local1 = 0;
while (_local1 < _local10.length) {
if (((_local10[_local1].power_cost) && (!(_local10[_local1].aiCastCount)))){
_local8 = _local10[_local1];
if (dm.randomNum(0, 500) > 250){
break;
};
};
_local1++;
};
};
_local9 = BattleFunctions.findMonsterTargets(MonsterCharacter(_local5), _local8, horde, combat_grid, pc_party);
_local9 = cullIntimidatingTargets(_local9, _local8);
_local12 = _local9[0];
if (((_local8.targetsFriendlies) && ((_local9.length > 1)))){
if (_local8.makeDamageSponge){
_local1 = 0;
while (_local1 < _local9.length) {
if (_local9[_local1].getEffectiveHealth() > _local13){
_local13 = _local9[_local1].getEffectiveHealth();
_local12 = _local9[_local1];
};
_local1++;
};
} else {
if (((_local8.damage) || (_local8.aiTargetHealthiest))){
_local1 = 0;
while (_local1 < _local9.length) {
if (_local9[_local1].health > _local13){
_local13 = _local9[_local1].health;
_local12 = _local9[_local1];
};
_local1++;
};
} else {
if (_local8.healing){
_local13 = 9999;
_local1 = 0;
while (_local1 < _local9.length) {
if (_local9[_local1].health < _local13){
_local13 = _local9[_local1].health;
_local12 = _local9[_local1];
};
_local1++;
};
};
};
};
_local11 = _local12;
} else {
_local19 = false;
if (_local8.damage){
if (_local8.aiTargetHealthiest){
_local13 = 0;
_local1 = 0;
while (_local1 < _local9.length) {
if (_local9[_local1].health > _local13){
_local13 = _local9[_local1].health;
_local12 = _local9[_local1];
};
_local1++;
};
} else {
_local13 = 9999;
_local1 = 0;
while (_local1 < _local9.length) {
if (_local9[_local1].getEffectiveHealth() < _local8.damage){
_local11 = _local9[_local1];
_local19 = true;
break;
} else {
if (_local9[_local1].getEffectiveHealth() < _local13){
_local13 = _local9[_local1].getEffectiveHealth();
_local12 = _local9[_local1];
};
};
_local1++;
};
};
if (!(_local19)){
_local11 = _local12;
};
};
if (!(_local19)){
_local11 = _local9[dm.randomNum(0, (_local9.length - 1))];
};
};
};
if (((!((_local8 == null))) && (!((_local11 == null))))){
useMonsterSkill(_local8, _local11);
} else {
PassTurn();
};
} else {
if ((_local5 is PlayerCharacter)){
errorCode = 1400;
if (_local5.summoned){
actionsbar.retreat_skill.setSkill(new sUnsummon(_local5));
} else {
actionsbar.retreat_skill.setSkill(new sRetreat(_local5));
};
if (pc_party.campaign == Campaign.SURVIVAL){
actionsbar.retreat_all_skill.setSkill(new sMenuQuit(_local5));
} else {
actionsbar.retreat_all_skill.setSkill(new sRetreatAll(_local5));
};
actionsbar.pass_skill.setSkill(new sPassTurn(_local5));
if (!(this.contains(actionsbar))){
addChild(actionsbar);
};
this.addEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheelEvent);
stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
errorCode = 1401;
_local20 = skillbar.x;
_local21 = skillbar.y;
skillbar = null;
skillbar = new SkillBar();
skillbar.x = _local20;
skillbar.y = _local21;
skillbar.name = "skillbar";
addChild(skillbar);
errorCode = 1403;
_local1 = 0;
while (_local1 < _local5.skills.length) {
if (_local5.skills[_local1].active == false){
} else {
_local22 = new SkillIcon();
_local22.setSkill(_local5.skills[_local1]);
_local22.setOwner(PlayerCharacter(_local5));
skillbar.addIcon(_local22);
};
_local1++;
};
errorCode = 1405;
powerPreview();
errorCode = 1406;
ValidTargetsForPlayer(skillbar.getSelectedSkill());
errorCode = 1407;
if (hover != null){
drawEffectedTargets();
};
errorCode = 1408;
if (((DungeonMain.showHints) && (!(Dungeon.hintShown(64))))){
_local23 = new HintDialog("Player Turn", "It is your character's turn. A turn involves selecting a skill and then a target for the skill. Player characters start with three skills, but may later use up to six.\n\nIf you do not (or cannot) use a skill this turn, you may also Pass or Retreat. Pass means the character takes no action, but recovers power more quickly. Retreat causes the character to leave the battle, and can prevent the total defeat of the party.", true, true);
DungeonMain.hints = (DungeonMain.hints + 64);
stage.addChild(_local23);
dm.main.saveInterface();
};
};
};
}
function unBlurStep(_arg1:TimerEvent):void{
setBlur((currentBlur - Math.round((max_blur / blur_steps))));
}
private function addPortraitAnim(_arg1:Character, _arg2:Skill, _arg3:Character):void{
var _local4:CharacterPortrait;
_local4 = _arg1.portraitRef;
if (showImmune(_arg1, _local4, _arg2, _arg3)){
_local4.addAnimationFrame(immune_animation_frame, 1500);
} else {
if (_arg2.hasPortraitAnimation){
_local4.addAnimationFrame(_arg2.portraitAnimationFrame, _arg2.portraitAnimationDuration);
};
if (((_arg2.showWeaponAnimation) && (_arg3.skills[0].specialAnimation))){
_local4.addPortraitAnimation(_arg3.skills[0].specialAnimation);
};
if (_arg2.specialAnimation){
_local4.addPortraitAnimation(_arg2.specialAnimation);
};
if (doLethalAnim){
_local4.addPortraitAnimation(PortraitAnimation.lethal);
doLethalAnim = false;
};
};
}
private function bonusAttackOn(_arg1:Character):Boolean{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:PlayerCharacter;
if (_arg1 == null){
return (false);
};
if (_arg1.health <= 0){
return (false);
};
_local2 = new Array();
errorCode = 1800;
if ((_arg1 is MonsterCharacter)){
if (bonusAttacker != null){
_local2.push(bonusAttacker);
errorCode = 1890;
} else {
errorCode = 1801;
for each (_local5 in pc_party.members) {
if (_local5 == null){
} else {
if (_local5.health <= 0){
} else {
if (_local5 == speedlist[turn]){
} else {
if (_local5.retreated){
} else {
if (_local5.retreating){
} else {
if (_local5.stunned_duration){
} else {
if (_local5.gear[Equipment.weapon] == null){
} else {
errorCode = 1802;
if ((((_local5.gear[Equipment.weapon] is RangedWeapon)) || ((_local5.gear[Equipment.weapon] is MageWeapon)))){
_local2.push(_local5);
} else {
errorCode = 1803;
if (CanPlayerHit(_local5, MonsterCharacter(_arg1))){
_local2.push(_local5);
} else {
continue;
};
};
};
};
};
};
};
};
};
};
};
errorCode = 1805;
if (_local2.length){
errorCode = 1810;
_local4 = dmf.randomNum(0, (_local2.length - 1));
phl.x = EmptyPortrait(getChildByName(("pc" + _local2[_local4].pos))).x;
phl.y = EmptyPortrait(getChildByName(("pc" + _local2[_local4].pos))).y;
UpdateInfoPanels();
errorCode = 1812;
useSkill(_local2[_local4], _local2[_local4].skills[0], _arg1, true);
return (true);
};
return (false);
};
return (false);
}
private function combatGridToPos(_arg1:int, _arg2:int):int{
if ((((_arg2 < 2)) && ((_arg2 >= 0)))){
return (((_arg1 + 1) + (_arg2 * 3)));
};
if (_arg2 < 4){
return (((_arg1 + 1) + ((_arg2 - 2) * 3)));
};
return (-1);
}
private function RemoveTargetInfo():void{
var _local1:*;
var _local2:PortraitHighlight;
_local1 = 0;
while (_local1 < npc_portraits.length) {
npc_portraits[_local1].removeEventListener(MouseEvent.MOUSE_DOWN, clickAttack);
_local2 = PortraitHighlight(npc_portraits[_local1].getChildByName("highlight"));
if (_local2 != null){
npc_portraits[_local1].removeChild(_local2);
_local2 = null;
};
_local1++;
};
_local1 = 0;
while (_local1 < pc_portraits.length) {
pc_portraits[_local1].removeEventListener(MouseEvent.MOUSE_DOWN, clickAttack);
_local2 = PortraitHighlight(pc_portraits[_local1].getChildByName("highlight"));
if (_local2 != null){
pc_portraits[_local1].removeChild(_local2);
_local2 = null;
};
_local1++;
};
removeEmptyListeners();
removePortraitEffected();
}
function monsterTurnDelayComplete(_arg1:Event):void{
hadMonsterDelay = true;
monsterTurnDelayTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, monsterTurnDelayComplete);
if (speedlist[turn].health <= 0){
hadMonsterDelay = false;
initDisplay.removeDead();
EndTurn();
return;
};
RunTurn();
}
private function removePortraitEffected():void{
var _local1:*;
var _local2:*;
_local1 = 0;
while (_local1 < 12) {
_local2 = bg.getChildByName(("ei" + _local1));
if (_local2 == null){
} else {
bg.removeChild(_local2);
};
_local1++;
};
}
private function validCharFromGrid(_arg1:int, _arg2:int):Character{
if (_arg1 > 2){
return (null);
};
if (_arg1 < 0){
return (null);
};
if (_arg2 < 0){
return (null);
};
if (_arg2 > 3){
return (null);
};
return (combat_grid[_arg1][_arg2]);
}
private function useMonsterSkill(_arg1:Skill, _arg2:Character){
PortraitFromCharacter(speedlist[turn]).setPowerPreview(_arg1.power_cost);
useSkill(speedlist[turn], _arg1, _arg2);
_arg1.aiCastCount++;
}
private function createClone(_arg1:PlayerCharacter):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:Boolean;
var _local7:*;
_local2 = false;
_local3 = 0;
_local4 = _arg1.getEvilClone();
if (_local4 == null){
return;
};
if (_arg1.pos < 4){
_local4.pos = (_arg1.pos + 3);
} else {
if (_arg1.pos != 5){
_local4.pos = (_arg1.pos - 3);
} else {
_local6 = (_arg1.pos < 4);
_local7 = pc_party.findEmptySlot(_local6);
if (!(_local7)){
return;
};
_local4.pos = convertPlayerPos(_local7);
};
};
AddCharToCombatGrid(_local4);
horde.members.push(_local4);
_local5 = addNewPortrait(_local4);
_local5.setClone();
}
function reportKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.SPACE){
PassTurn();
} else {
if (_arg1.charCode == 114){
clickRetreat(null);
} else {
if (String.fromCharCode(_arg1.charCode) == "1"){
skillbar.setSelectedSkillByPosition(1);
} else {
if (String.fromCharCode(_arg1.charCode) == "2"){
skillbar.setSelectedSkillByPosition(2);
} else {
if (String.fromCharCode(_arg1.charCode) == "3"){
skillbar.setSelectedSkillByPosition(3);
} else {
if (String.fromCharCode(_arg1.charCode) == "4"){
skillbar.setSelectedSkillByPosition(4);
} else {
if (String.fromCharCode(_arg1.charCode) == "5"){
skillbar.setSelectedSkillByPosition(5);
} else {
if (String.fromCharCode(_arg1.charCode) == "6"){
skillbar.setSelectedSkillByPosition(6);
} else {
if (((DungeonMain.debug) && ((_arg1.charCode == 107)))){
speedlist[turn].health = 0;
initDisplay.removeDead();
EndTurn();
};
};
};
};
};
};
};
};
};
if (hover != null){
drawEffectedTargets();
};
}
private function battleReady(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:Array;
var _local7:MonsterCharacter;
var _local8:String;
messages.removeEventListener(MouseEvent.MOUSE_DOWN, battleReady);
messages.clearAll();
if (pc_party.campaign == Campaign.SURVIVAL){
currentWave = 1;
initWave();
};
turn = 0;
addEventListener(Event.ENTER_FRAME, onFrame);
phl = new CurrentPortraitHighlight();
addChild(phl);
_local2 = 0;
while (_local2 < pc_party.members.length) {
pc_portraits[_local2].removeEventListener(MouseEvent.MOUSE_DOWN, startDragging);
pc_portraits[_local2].removeEventListener(MouseEvent.MOUSE_UP, stopDragging);
if (this.contains(pc_portraits[_local2])){
removeChild(pc_portraits[_local2]);
};
pc_portraits[_local2].x = 0;
pc_portraits[_local2].y = 0;
_local5 = EmptyPortrait(getChildByName(("pc" + String(pc_party.members[_local2].pos))));
if (_local5 != null){
_local5.empty.addChild(pc_portraits[_local2]);
};
pc_portraits[_local2].addHoverListeners();
_local2++;
};
actionsbar.pass_skill.addEventListener(MouseEvent.MOUSE_DOWN, clickPassTurn);
actionsbar.retreat_skill.addEventListener(MouseEvent.MOUSE_DOWN, clickRetreat);
actionsbar.retreat_all_skill.addEventListener(MouseEvent.MOUSE_DOWN, clickRetreatAll);
UpdateInfoPanels();
updateCombatGrid();
this.addEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheelEvent);
if (pc_party.campaign == Campaign.DELUXE){
if (horde.isCampaignBoss()){
addSpeechBubble(horde.members[0], "Interlopers. You will regret coming here.");
} else {
if (((horde.hasFearSower()) && ((dmf.randomNum(0, 100) < 75)))){
_local6 = new Array();
_local6.push("Shudder at the coming of the Dreadfather!");
_local6.push("These lands are ripe for the harvest.");
_local6.push("You will know fear. Even if we must teach you.");
_local6.push("There is no victory for you. Abandon hope.");
_local6.push("You are not ready. You will never be ready.");
_local6.push("We have built an unstoppable army, in thrall to terror. You cannot win.");
_local6.push("Do you wish to see the pale flame of your life extinguished here, so far from your home?");
_local6.push("There is no going back for you. Your doom is here.");
_local6.push("He would still welcome you, if only you would fear him. What you call courage is merely ignorance.");
_local6.push("He is coming, and nothing you hold dear is safe.");
_local6.push("Do not think you will rest in peace. We will amuse ourselves with you.");
_local6.push("No god you call on will hear you. No strength of arms will prevail.");
_local6.push("A new day has come, and everything you have loved is ended. Give in to despair.");
_local7 = horde.members[(horde.members.length - 1)];
_local8 = _local6[dmf.randomNum(0, (_local6.length - 1))];
addSpeechBubble(_local7, _local8);
};
};
};
RunTurn();
}
function blurStep(_arg1:TimerEvent):void{
setBlur((currentBlur + Math.round((max_blur / blur_steps))));
}
function clickPassTurn(_arg1:MouseEvent):void{
if ((speedlist[turn] is PlayerCharacter)){
PassTurn();
};
}
private function showImmune(_arg1:Character, _arg2:CharacterPortrait, _arg3:Skill, _arg4:Character):Boolean{
if (!(_arg1.invulnerable)){
return (false);
};
if (_arg4 == _arg1){
return (false);
};
if (_arg3.damage){
return (true);
};
if (_arg3.stun_percent){
return (true);
};
if (_arg3.poisonDamage){
return (true);
};
return (false);
}
public function layoutBoard():void{
var _local1:EmptyPortrait;
var _local2:int;
var _local3:int;
var _local4:PlayerCharacter;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:int;
var _local10:Skill;
turn = -1;
for each (_local4 in pc_party.members) {
_local4.retreating = false;
_local4.retreated = false;
_local4.hadCombatTurn = false;
if (!((_local4 is PC_Adventurer))){
_local8 = _local4.gear[Equipment.weapon];
_local9 = 1;
if (_local4.skills[0] != null){
_local9 = _local4.skills[0].position;
};
if (_local8 != null){
if ((_local8 is MeleeWeapon)){
_local4.skills[0] = new sWeaponAttack(_local4);
} else {
if ((_local8 is RangedWeapon)){
_local4.skills[0] = new sRangedAttack(_local4);
} else {
if ((_local8 is MageWeapon)){
_local4.skills[0] = new sMageAttack(_local4);
};
};
};
_local4.skills[0].active = true;
} else {
_local4.skills[0] = new sUnarmedAttack(pc_party.members[_local2]);
_local4.skills[0].active = true;
};
_local4.skills[0].position = _local9;
};
if ((_local4 is PC_Cleric)){
for each (_local10 in _local4.skills) {
if ((_local10 is sClericSmite)){
_local10.stun_percent = PC_Cleric(_local4).wrath;
};
};
};
_local7 = new CharacterPortrait();
_local7.setChar(_local4);
if (_local4.pos == 0){
pc_party.setMemberPos(_local4, 1);
};
_local1 = EmptyPortrait(getChildByName(("pc" + String(_local4.pos))));
_local7.x = _local1.x;
_local7.y = _local1.y;
_local4.portraitRef = _local7;
this.addChild(_local7);
_local7.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
_local7.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
_local7.addEventListener(MouseEvent.MOUSE_OVER, mousedOverEvent);
_local7.addEventListener(MouseEvent.MOUSE_OVER, mouseMoveEvent);
_local7.addEventListener(MouseEvent.MOUSE_OUT, mousedOutEvent);
pc_portraits.push(_local7);
};
_local2 = (horde.members.length - 1);
while (_local2 >= 0) {
if (horde.members[_local2].summoned){
horde.members.splice(_local2, 1);
} else {
horde.members[_local2].clearStatusEffects();
horde.members[_local2].resetSkills();
horde.members[_local2].health = horde.members[_local2].health_max;
horde.members[_local2].power = horde.members[_local2].power_max;
horde.members[_local2].hadCombatTurn = false;
addNewPortrait(horde.members[_local2]);
};
_local2--;
};
_local5 = "Adjust Party Formation";
_local6 = "Click here when ready to begin battle!";
messages.addMessage(_local5, _local6);
messages.addEventListener(MouseEvent.MOUSE_DOWN, battleReady);
selected_skill_text.text = "";
removeChild(actionsbar);
removeChild(skillbar);
removeChild(active_info_panel);
removeChild(target_info_panel);
CalculateInitiative();
initDisplay.turnOf(speedlist[0], false);
}
private function swapPortraits(_arg1:CharacterPortrait, _arg2:CharacterPortrait):void{
var _local3:EmptyPortrait;
if (_arg1.parent != null){
_arg1.parent.removeChild(_arg1);
};
if (_arg2.parent != null){
_arg2.parent.removeChild(_arg2);
};
_local3 = EmptyPortrait(getChildByName(("pc" + String(_arg1.char_ref.pos))));
if (_local3 != null){
_local3.empty.addChild(_arg1);
};
_local3 = EmptyPortrait(getChildByName(("pc" + String(_arg2.char_ref.pos))));
if (_local3 != null){
_local3.empty.addChild(_arg2);
};
_arg1.addHoverListeners();
_arg2.addHoverListeners();
}
private function setBlur(_arg1:int):void{
var _local2:BlurFilter;
_local2 = new BlurFilter();
_local2.blurX = _arg1;
_local2.blurY = _arg1;
_local2.quality = BitmapFilterQuality.LOW;
this.filters = [_local2];
currentBlur = _arg1;
}
function clickAttack(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
var _local4:Character;
var _local5:*;
_local4 = Character(CharacterPortrait(_arg1.currentTarget).char_ref);
_local5 = skillbar.getSelectedSkill();
RemoveTargetInfo();
useSkill(speedlist[turn], _local5, _local4);
}
private function CalculateInitiative(_arg1:Boolean=true):Boolean{
var _local2:int;
var _local3:int;
var _local4:Array;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:Character;
var _local9:Array;
var _local10:*;
var _local11:int;
var _local12:int;
var _local13:*;
_local2 = 0;
_local3 = 0;
_local4 = pc_party.members.concat(horde.members);
_local7 = 0;
_local8 = speedlist[turn];
_local9 = speedlist;
speedlist = new Array();
_local2 = (_local4.length - 1);
while (_local2 >= 0) {
_local5 = 0;
_local6 = 0;
_local3 = (_local4.length - 1);
while (_local3 >= 0) {
if (_local4[_local3] == null){
} else {
_local11 = _local4[_local3].getQuickness();
if (_local11 == -1){
} else {
if (_local11 >= _local6){
_local6 = _local11;
_local5 = _local3;
};
};
};
_local3--;
};
speedlist.push(_local4[_local5]);
_local4.splice(_local5, 1);
_local2--;
};
if (!(_arg1)){
_local12 = -1;
_local2 = 0;
while (_local2 < speedlist.length) {
if (speedlist[_local2] == _local8){
_local12 = _local2;
};
_local2++;
};
if (_local12 != -1){
turn = _local12;
};
} else {
turn = 0;
};
initDisplay.setData(speedlist);
_local10 = false;
if (_local9.length != speedlist.length){
_local10 = true;
} else {
_local13 = 0;
while (_local13 < _local9.length) {
if (_local9[_local13] != speedlist[_local13]){
_local10 = true;
break;
};
_local13++;
};
};
if (_local10){
updateCombatGrid();
};
return (_local10);
}
private function addSpeechBubble(_arg1:Character, _arg2:String):void{
var _local3:SpeechBubble;
var _local4:Point;
var _local5:Point;
if (_arg1.portraitRef == null){
return;
};
_local3 = new SpeechBubble(_arg2);
_local4 = new Point(5, 59);
_local5 = _arg1.portraitRef.localToGlobal(_local4);
_local3.x = _local5.x;
_local3.y = _local5.y;
if (stage != null){
stage.addChild(_local3);
};
}
private function entryBlur():void{
setBlur(max_blur);
blurTimer = new Timer(50, blur_steps);
blurTimer.addEventListener(TimerEvent.TIMER, unBlurStep);
blurTimer.addEventListener(TimerEvent.TIMER_COMPLETE, unBlurDone);
blurTimer.start();
}
function startDragging(_arg1:MouseEvent):void{
stage.addChild(CharacterPortrait(_arg1.currentTarget));
CharacterPortrait(_arg1.currentTarget).startDrag();
}
public static function DistanceBetween(_arg1:int, _arg2:int, _arg3:int, _arg4:int):int{
var _local5:*;
var _local6:*;
_local5 = Math.abs((_arg1 - _arg3));
_local6 = Math.abs((_arg2 - _arg4));
return (Math.sqrt(((_local5 * _local5) + (_local6 * _local6))));
}
}
}//package
Section 44
//BattleFunctions (BattleFunctions)
package {
public class BattleFunctions {
public static function findMonsterTargets(_arg1:MonsterCharacter, _arg2:Skill, _arg3:Horde, _arg4:Array, _arg5:Party):Array{
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:Array;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:*;
var _local14:*;
var _local15:Array;
var _local16:PlayerCharacter;
var _local17:MonsterCharacter;
var _local18:PlayerCharacter;
var _local19:*;
_local9 = new Array(0);
_local12 = 0;
_local13 = 0;
_local14 = _arg1.pos;
if (!(_arg2.usable())){
return (_local9);
};
if (((!((_arg2.aiCastLimit == -1))) && ((_arg2.aiCastCount >= _arg2.aiCastLimit)))){
return (_local9);
};
if (((_arg2.aiNotUnlessHurt) && ((_arg1.health == _arg1.health_max)))){
return (_local9);
};
if (((_arg2.aiNotUnlessLowPower) && ((_arg1.power > 20)))){
return (_local9);
};
if (((_arg2.aiOnlyWhenHordeDead) && ((_arg3.aliveCount > 1)))){
return (_local9);
};
if (_local14 > 3){
_local12 = (_local14 % 4);
} else {
_local12 = (_local14 - 1);
};
_local13 = (Math.ceil((_local14 / 3)) - 1);
if (_arg2.targetsEmpty){
if (_arg2.summonsCreatureClass != null){
if (_arg3.members.length < 6){
_local9.push(_arg1);
return (_local9);
};
};
} else {
if (_arg2.requiresVerticalGap){
if (_arg1.pos < 4){
_local17 = _arg3.memberInPos((_arg1.pos + 3));
if ((((_local17 == null)) || (_local17.isInactive()))){
_local16 = _arg4[(_arg1.pos - 1)][2];
if ((((_local16 == null)) || (_local16.isInactive()))){
_local16 = _arg4[(_arg1.pos - 1)][3];
};
};
} else {
_local18 = _arg4[(_arg1.pos - 4)][2];
if ((((_local18 == null)) || (_local18.isInactive()))){
_local16 = _arg4[(_arg1.pos - 4)][3];
};
};
if (_local16 != null){
if (validTargetForMonster(_local16, _arg2)){
_local9.push(_local16);
};
};
} else {
if (_arg2.hitsAllFriendlies){
_local6 = 0;
while (_local6 < _arg3.members.length) {
if (validTargetForMonster(_arg3.members[_local6], _arg2)){
if (_arg3.members[_local6] != _arg1){
_local9.push(_arg3.members[_local6]);
};
};
_local6++;
};
} else {
if (_arg2.targetsFriendlies){
_local6 = 0;
while (_local6 < _arg3.members.length) {
if (validTargetForMonster(_arg3.members[_local6], _arg2)){
if (_arg3.members[_local6] != _arg1){
_local9.push(_arg3.members[_local6]);
};
};
_local6++;
};
} else {
if (_arg2.targetsSelf){
if (((!(_arg2.aiAllowSuicide)) && ((_arg1.health <= _arg2.damage)))){
return (_local9);
};
_local9.push(_arg1);
} else {
if (_arg2.hydraGrowHeads){
if (_arg3.needHydraHeads()){
_local9.push(_arg1);
};
} else {
if (_arg2.rangedAttack){
_local6 = 0;
while (_local6 < _arg5.members.length) {
if (validTargetForMonster(_arg5.members[_local6], _arg2)){
_local9.push(_arg5.members[_local6]);
};
_local6++;
};
} else {
_local19 = false;
if (_local14 < 4){
_local6 = 0;
while (_local6 < 3) {
if (_arg4[_local6][1] != null){
if ((((_arg4[_local6][1].health > 0)) && (!(_arg4[_local6][1].hiding)))){
_local19 = true;
};
};
_local6++;
};
};
if (Battlefield.damageSpongePlayer != null){
_local9.push(Battlefield.damageSpongePlayer);
};
if ((((_local14 > 3)) || ((((_local14 < 4)) && (!(_local19)))))){
_local10 = 0;
_local6 = 0;
while (_local6 < 3) {
if (validTargetForMonster(_arg4[_local6][2], _arg2)){
_local10++;
_local8 = Character(_arg4[_local6][2]);
};
_local6++;
};
if (_local10 == 1){
_local9.push(_local8);
} else {
if (_local10 > 0){
if (validTargetForMonster(_arg4[_local12][2], _arg2)){
_local9.push(_arg4[_local12][2]);
};
if ((_local12 - 1) >= 0){
if (validTargetForMonster(_arg4[(_local12 - 1)][2], _arg2)){
_local9.push(_arg4[(_local12 - 1)][2]);
};
};
if ((_local12 + 1) < 3){
if (validTargetForMonster(_arg4[(_local12 + 1)][2], _arg2)){
_local9.push(_arg4[(_local12 + 1)][2]);
};
};
} else {
if (_local10 == 0){
_local11 = 0;
_local6 = 0;
while (_local6 < 3) {
if (validTargetForMonster(_arg4[_local6][3], _arg2)){
_local11++;
_local8 = Character(_arg4[_local6][3]);
};
_local6++;
};
if (_local11 == 1){
_local9.push(_local8);
} else {
if (_local11 > 0){
if (validTargetForMonster(_arg4[_local12][3], _arg2)){
_local9.push(_arg4[_local12][3]);
};
if ((_local12 - 1) >= 0){
if (validTargetForMonster(_arg4[(_local12 - 1)][3], _arg2)){
_local9.push(_arg4[(_local12 - 1)][3]);
};
};
if ((_local12 + 1) < 3){
if (validTargetForMonster(_arg4[(_local12 + 1)][3], _arg2)){
_local9.push(_arg4[(_local12 + 1)][3]);
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
_local15 = new Array();
_local6 = 0;
while (_local6 < _local9.length) {
if (BattleFunctions.skillBeneficial(_arg2, _local9[_local6], _arg3)){
_local15.push(_local9[_local6]);
};
_local6++;
};
return (_local15);
}
public static function areEnemies(_arg1:Character, _arg2:Character):Boolean{
if ((((_arg1 is PlayerCharacter)) && ((_arg2 is MonsterCharacter)))){
return (true);
};
if ((((_arg1 is MonsterCharacter)) && ((_arg2 is PlayerCharacter)))){
return (true);
};
return (false);
}
public static function validTargetForMonster(_arg1:Character, _arg2:Skill):Boolean{
if (_arg1 != null){
if ((_arg1 is PlayerCharacter)){
if (PlayerCharacter(_arg1).retreated){
return (false);
};
if (((!((Battlefield.damageSpongePlayer == null))) && (!((Battlefield.damageSpongePlayer == _arg1))))){
return (false);
};
};
if ((((_arg1 is MonsterCharacter)) && (MonsterCharacter(_arg1).cannotTarget))){
return (false);
};
if (((_arg2.aiTargetOnlyLowHealth) && ((_arg1.getHealthPercent() >= 33)))){
return (false);
};
if (((_arg2.targetsFriendlyFrontRow) && ((_arg1.pos < 4)))){
return (false);
};
if (((_arg2.aiTargetsBackRow) && ((_arg1.pos <= 3)))){
return (false);
};
if (((_arg2.makeDamageSponge) && (!((Battlefield.damageSpongeMonster == null))))){
return (false);
};
if (((_arg2.targetsStunned) && (!(_arg1.stunned_duration)))){
return (false);
};
if (((_arg2.targetsSummoned) && (!(_arg1.summoned)))){
return (false);
};
if (_arg1.hiding){
return (false);
};
if (_arg2.resurrects){
if (_arg1.health <= 0){
return (true);
};
return (false);
};
if (((_arg2.healing) && ((_arg1.health >= _arg1.health_max)))){
return (false);
};
if (_arg1.health > 0){
return (true);
};
};
return (false);
}
public static function skillBeneficial(_arg1:Skill, _arg2:Character, _arg3:Horde):Boolean{
var _local4:Character;
_local4 = _arg1.char_ref;
if (_arg1.aiAlwaysUse == true){
return (true);
};
if (((_arg1.damage) && (areEnemies(_arg2, _local4)))){
return (true);
};
if (((_arg1.vampiric_percent) && ((_local4.health < _local4.health_max)))){
return (true);
};
if (((_arg1.healing) && ((_arg2.health < _arg2.health_max)))){
return (true);
};
if (((_arg1.powerRestore) && ((_arg2.power < _arg2.power_max)))){
return (true);
};
if ((_arg1.tempDamageResistance > _arg2.temp_damage_resistance)){
return (true);
};
if (((_arg1.powerDamage) && (_arg2.power))){
return (true);
};
if (((_arg1.powerDrain) && ((_local4.power < _local4.power_max)))){
return (true);
};
if (_arg1.clonesPlayers){
return (true);
};
if (_arg1.shufflesEnemies){
return (true);
};
if (_arg1.transformCreatureClass != null){
return (true);
};
if (_arg1.cancelPowerRegen > _arg2.cancelPowerRegen){
return (true);
};
if (_arg1.cancelHealthRegen > _arg2.cancelHealthRegen){
return (true);
};
if (((_arg1.hydraGrowHeads) && (_arg3.needHydraHeads()))){
return (true);
};
if (((_arg1.forceRetreat) && (areEnemies(_arg2, _local4)))){
return (true);
};
if (((((_arg1.stun_percent) && ((_arg2.stunned_duration <= 0)))) && ((_arg2.getStunResist() < 100)))){
return (true);
};
if (((_arg1.poisonDamage) && ((_arg2.getPoisonResist() < 100)))){
return (true);
};
if (((((_arg1.lethality) || (_arg1.addsPowerToLethality))) && (!(_arg2.lethalityImmune)))){
return (true);
};
if (((_arg1.removesCurse) && (_arg2.cursed))){
return (true);
};
if (((_arg1.removesPoison) && (_arg2.poisoned))){
return (true);
};
if (((_arg1.cannotDie) && (!(_arg2.cannotDie)))){
return (true);
};
if (((_arg1.invulnerable) && (!(_arg2.invulnerable)))){
return (true);
};
if (((_arg1.hidesTarget) && (!(_arg2.hiding)))){
return (true);
};
if (((_arg1.intimidating) && (!(_arg2.intimidating)))){
return (true);
};
if (_arg1.damageAccuracy > _arg2.accuracy_penalty){
return (true);
};
if (_arg1.crippling > _arg2.crippled){
return (true);
};
if (_arg1.woundsRestorePower > _arg2.woundsRestorePower){
return (true);
};
if (_arg1.curse > _arg2.cursed){
return (true);
};
if (_arg1.buff_resistPoison > _arg2.buff_resistPoison){
return (true);
};
if (_arg1.buff_resistStun > _arg2.buff_resistStun){
return (true);
};
if (_arg1.buff_damageResist > _arg2.buff_damageResist){
return (true);
};
if (_arg1.buff_damageReflect > _arg2.buff_damageReflect){
return (true);
};
if (_arg1.buff_healthRegen > _arg2.buff_healthRegen){
return (true);
};
if (_arg1.buff_powerRegen > _arg2.buff_powerRegen){
return (true);
};
if (_arg1.buff_vampiric > _arg2.buff_vampiric){
return (true);
};
if (_arg1.buff_stun > _arg2.buff_stun){
return (true);
};
if (_arg1.buff_quickness > _arg2.buff_quickness){
return (true);
};
if (_arg1.buff_damage > _arg2.buff_damage){
return (true);
};
if (_arg1.buff_accuracy > _arg2.buff_accuracy){
return (true);
};
if (_arg1.buff_quickness > _arg2.buff_quickness){
return (true);
};
if (_arg1.debuff_damageResist > _arg2.debuff_damageResist){
return (true);
};
if (_arg1.debuff_damage < _arg2.debuff_damage){
return (true);
};
if (_arg1.targetDamageMod != 1){
if (areEnemies(_local4, _arg2)){
if (_arg1.targetDamageMod < _arg2.damageMod){
return (true);
};
} else {
if (_arg1.targetDamageMod > _arg2.damageMod){
return (true);
};
};
};
if (_arg1.makeDamageSponge){
if ((((_arg2 is PlayerCharacter)) && ((Battlefield.damageSpongePlayer == null)))){
return (true);
};
if ((((_arg2 is MonsterCharacter)) && ((Battlefield.damageSpongeMonster == null)))){
return (true);
};
};
return (false);
}
}
}//package
Section 45
//BattleInfoPanel (BattleInfoPanel)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class BattleInfoPanel extends MovieClip {
const color_green:uint = 52275;
const color_white:uint = 0xFFFFFF;
const color_red:uint = 0xE90000;
public var large_portrait:CharGraphic;
public var poison_resist_number:TextField;
public var name_label:TextField;
public var accuracy_number:TextField;
public var damage_resist_number:TextField;
public var stun_resist_number:TextField;
public var health_bar:NumericIndicatorHealth;
public var regenHealthAmount:TextField;
public var regenPowerAmount:TextField;
public var level_label:TextField;
var portrait_w;// = 20
public var power_bar:NumericIndicatorPower;
var portrait_h;// = 20
public var description_label:TextField;
public function BattleInfoPanel(){
portrait_w = 20;
portrait_h = 20;
super();
portrait_w = large_portrait.width;
portrait_h = large_portrait.height;
accuracy_number.addEventListener(MouseEvent.MOUSE_OVER, mouseOverIcons);
damage_resist_number.addEventListener(MouseEvent.MOUSE_OVER, mouseOverIcons);
poison_resist_number.addEventListener(MouseEvent.MOUSE_OVER, mouseOverIcons);
stun_resist_number.addEventListener(MouseEvent.MOUSE_OVER, mouseOverIcons);
accuracy_number.addEventListener(MouseEvent.MOUSE_OUT, mouseOutIcons);
damage_resist_number.addEventListener(MouseEvent.MOUSE_OUT, mouseOutIcons);
poison_resist_number.addEventListener(MouseEvent.MOUSE_OUT, mouseOutIcons);
stun_resist_number.addEventListener(MouseEvent.MOUSE_OUT, mouseOutIcons);
addEventListener(Event.REMOVED_FROM_STAGE, mouseOutIcons);
}
public function setChar(_arg1:Character):void{
var _local2:*;
var _local3:*;
var _local4:*;
name_label.text = _arg1.charname;
dmf.embolden(name_label);
level_label.text = ((("Level " + String(_arg1.level)) + " ") + _arg1.classname);
UpdateDescription(description_label, _arg1);
large_portrait.setChar(_arg1);
regenHealthAmount.text = String(_arg1.getHealthRegen());
regenPowerAmount.text = String(_arg1.getPowerRegen());
health_bar.bar.width = ((60 / 100) * _arg1.getHealthPercent());
health_bar.numbers.text = ((String(_arg1.health) + "/") + String(_arg1.health_max));
power_bar.bar.width = ((60 / 100) * _arg1.getPowerPercent());
power_bar.numbers.text = ((String(_arg1.power) + "/") + String(_arg1.power_max));
if (getChildByName("health_bar") == null){
addChild(health_bar);
};
if (getChildByName("power_bar") == null){
addChild(power_bar);
};
accuracy_number.text = (String(_arg1.getAccuracy()) + "%");
damage_resist_number.text = (String(_arg1.getDamageResist()) + "%");
poison_resist_number.text = (String(_arg1.getPoisonResist()) + "%");
stun_resist_number.text = (String(_arg1.getStunResist()) + "%");
_local2 = 0;
if ((_arg1 is MonsterCharacter)){
_local2 = MonsterCharacter(_arg1).damage_resistance;
} else {
if ((_arg1 is PlayerCharacter)){
_local2 = PlayerCharacter(_arg1).getDamageReductionFromArmor();
};
};
_local3 = (_arg1.getPoisonResist() - _arg1.buff_resistPoison);
_local4 = (_arg1.getStunResist() - _arg1.buff_resistStun);
accuracy_number.textColor = getColorForText(_arg1.accuracy, _arg1.getAccuracy());
damage_resist_number.textColor = getColorForText(_local2, _arg1.getDamageResist());
poison_resist_number.textColor = getColorForText(_local3, _arg1.getPoisonResist());
stun_resist_number.textColor = getColorForText(_local4, _arg1.getStunResist());
}
private function getColorForText(_arg1, _arg2):uint{
if (_arg2 > _arg1){
return (color_green);
};
if (_arg2 < _arg1){
return (color_red);
};
return (color_white);
}
private function mouseOutIcons(_arg1:Event=null):void{
var _local2:*;
if (dm.stage != null){
_local2 = dm.stage.getChildByName("BattleInfoTooltip");
if (_local2 != null){
dm.stage.removeChild(_local2);
};
};
}
private function UpdateDescription(_arg1:TextField, _arg2:Character){
var _local3:String;
if ((_arg2 is PlayerCharacter)){
_local3 = "";
} else {
_local3 = (_arg2.description + "\n ");
};
if (_arg2.lethalityImmune){
_local3 = (_local3 + "'Instant Kill' Immunity, ");
};
if (((parent) && ((parent is Battlefield)))){
if (((((!((Battlefield.damageSpongePlayer == null))) && ((_arg2 is PlayerCharacter)))) && ((Battlefield.damageSpongePlayer == _arg2)))){
_local3 = (_local3 + "Protecting Allies! ");
} else {
if (((((!((Battlefield.damageSpongeMonster == null))) && ((_arg2 is MonsterCharacter)))) && ((Battlefield.damageSpongeMonster == _arg2)))){
_local3 = (_local3 + "Protecting Allies! ");
};
};
};
if (_arg2.cancelPowerRegen){
_local3 = (_local3 + (("No Power Regeneration(" + _arg2.cancelPowerRegen) + "), "));
};
if (_arg2.cancelHealthRegen){
_local3 = (_local3 + (("No Health Regeneration(" + _arg2.cancelHealthRegen) + "), "));
};
if (_arg2.woundsRestorePower){
_local3 = (_local3 + (("Wounds Restore Power(" + _arg2.woundsRestorePower) + "), "));
};
if (_arg2.intimidating){
_local3 = (_local3 + "Intimidating, ");
};
if (_arg2.damageMod != 1){
_local3 = (_local3 + (("Next Attack(" + Math.round((_arg2.damageMod * 100))) + "%), "));
};
if (_arg2.powerRegenMod != 1){
_local3 = (_local3 + (("Temp Power Regen(" + Math.round((_arg2.powerRegenMod * 100))) + "%), "));
};
if (_arg2.cursed){
_local3 = (_local3 + (("Cursed(" + (_arg2.cursed * 100)) + "%), "));
};
if (_arg2.temp_damage_resistance){
_local3 = (_local3 + (("Temp Damage Resist(" + _arg2.temp_damage_resistance) + "), "));
};
if (_arg2.buff_resistPoison){
_local3 = (_local3 + (("Buff Resist Poison(" + _arg2.buff_resistPoison) + "), "));
};
if (_arg2.buff_resistStun){
_local3 = (_local3 + (("Buff Resist Stun(" + _arg2.buff_resistStun) + "), "));
};
if (_arg2.buff_damageResist){
_local3 = (_local3 + (("Buff Damage Resist(" + _arg2.buff_damageResist) + "), "));
};
if (_arg2.buff_damageReflect){
_local3 = (_local3 + (("Buff Damage Reflect(" + _arg2.buff_damageReflect) + "), "));
};
if (_arg2.buff_healthRegen){
_local3 = (_local3 + (("Buff Health Regen(" + _arg2.buff_healthRegen) + "), "));
};
if (_arg2.buff_powerRegen){
_local3 = (_local3 + (("Buff Power Regen(" + _arg2.buff_powerRegen) + "), "));
};
if (_arg2.buff_vampiric){
_local3 = (_local3 + (("Buff Health Drain(" + _arg2.buff_vampiric) + "), "));
};
if (_arg2.buff_stun){
_local3 = (_local3 + (("Buff Stun Chance(" + _arg2.buff_stun) + "), "));
};
if (_arg2.buff_quickness){
_local3 = (_local3 + (("Buff Quickness(" + _arg2.buff_quickness) + "), "));
};
if (_arg2.buff_damage != 1){
_local3 = (_local3 + (("Buff Damage(+" + (Math.round((_arg2.buff_damage * 100)) - 100)) + "%), "));
};
if (_arg2.buff_accuracy){
_local3 = (_local3 + (("Buff Accuracy(" + _arg2.buff_accuracy) + "), "));
};
if (_arg2.debuff_damageResist){
_local3 = (_local3 + (("Reduce Damage Resist(" + _arg2.debuff_damageResist) + "), "));
};
if (_arg2.debuff_damage != 1){
_local3 = (_local3 + (("Reduce Damage(" + Math.round(((1 - _arg2.debuff_damage) * 100))) + "%), "));
};
if (_arg2.potion_damage_resist){
_local3 = (_local3 + (("Potion Armor(+" + _arg2.potion_damage_resist) + "%), "));
};
if (_arg2.potion_damage_bonus){
_local3 = (_local3 + (("Potion Damage(+" + _arg2.potion_damage_bonus) + "%), "));
};
if (_arg2.potion_poison_resist){
_local3 = (_local3 + (("Potion Poison Resist(+" + _arg2.potion_poison_resist) + "%), "));
};
if (_arg2.potion_stun_resist){
_local3 = (_local3 + (("Potion Stun Resist(+" + _arg2.potion_stun_resist) + "%), "));
};
if (_arg2.potion_quickness_bonus){
_local3 = (_local3 + (("Potion Quickness(+" + _arg2.potion_quickness_bonus) + "), "));
};
if (_arg2.poisoned){
_local3 = (_local3 + (("Poisoned(" + _arg2.poisoned) + "), "));
};
if (_arg2.accuracy_penalty){
_local3 = (_local3 + (("Blinded(" + _arg2.accuracy_penalty) + "), "));
};
if (_arg2.crippled){
_local3 = (_local3 + (("Slowed(" + _arg2.crippled) + "), "));
};
if (_arg2.stunned_duration){
_local3 = (_local3 + (("Stunned(" + _arg2.stunned_duration) + "), "));
};
if (_arg2.cannotDie){
_local3 = (_local3 + (("Defiant(" + _arg2.cannotDie) + "), "));
};
if (_arg2.invulnerable){
_local3 = (_local3 + (("Invulnerable(" + _arg2.invulnerable) + "), "));
};
if ((((_arg2 is PlayerCharacter)) && (PlayerCharacter(_arg2).retreating))){
_local3 = (_local3 + "Retreating, ");
};
if ((((_arg2 is PlayerCharacter)) && (PlayerCharacter(_arg2).retreated))){
_local3 = (_local3 + "Retreated, ");
};
if (_arg2.hiding){
_local3 = (_local3 + "Hidden, ");
};
if (_local3.length > 1){
_local3 = _local3.slice(0, (_local3.length - 2));
};
_arg1.text = _local3;
}
private function mouseOverIcons(_arg1:MouseEvent):void{
var _local2:BattleInfoPanelKey;
mouseOutIcons();
_local2 = new BattleInfoPanelKey();
_local2.name = "BattleInfoTooltip";
_local2.x = 130.5;
_local2.y = (this.y + 10);
dm.stage.addChild(_local2);
}
public function cleanup():void{
mouseOutIcons();
removeEventListener(Event.REMOVED_FROM_STAGE, mouseOutIcons);
accuracy_number.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverIcons);
damage_resist_number.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverIcons);
poison_resist_number.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverIcons);
stun_resist_number.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverIcons);
accuracy_number.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutIcons);
damage_resist_number.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutIcons);
poison_resist_number.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutIcons);
stun_resist_number.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutIcons);
}
}
}//package
Section 46
//BattleInfoPanelKey (BattleInfoPanelKey)
package {
import flash.display.*;
public dynamic class BattleInfoPanelKey extends MovieClip {
}
}//package
Section 47
//battlements_loop02 (battlements_loop02)
package {
import flash.media.*;
public dynamic class battlements_loop02 extends Sound {
}
}//package
Section 48
//BattleMessageBox (BattleMessageBox)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class BattleMessageBox extends MovieClip {
public var next_btn:BattleMessageScroller;
public var previous_btn:BattleMessageScroller;
var messages2:Array;
var messages1:Array;
var current:int;// = -1
public var line1:TextField;
public var line2:TextField;
public function BattleMessageBox():void{
current = -1;
super();
messages1 = new Array();
messages2 = new Array();
previous_btn.addEventListener(MouseEvent.MOUSE_DOWN, goPrevious);
next_btn.addEventListener(MouseEvent.MOUSE_DOWN, goNext);
previous_btn.doubleClickEnabled = true;
next_btn.doubleClickEnabled = true;
previous_btn.addEventListener(MouseEvent.DOUBLE_CLICK, doubleClickArrow);
next_btn.addEventListener(MouseEvent.DOUBLE_CLICK, doubleClickArrow);
previous_btn.useHandCursor = false;
next_btn.useHandCursor = false;
previousEnabled(false);
nextEnabled(false);
}
function doubleClickArrow(_arg1:MouseEvent):void{
}
public function clearAll():void{
current = 0;
messages1.length = 0;
messages2.length = 0;
line1.text = "";
line2.text = "";
previousEnabled(false);
nextEnabled(false);
}
public function addMessage(_arg1:String, _arg2:String):void{
current = messages1.length;
messages1.push(_arg1);
messages2.push(_arg2);
displayCurrent();
}
private function displayCurrent():void{
if ((((current < 0)) || (!(messages1.length)))){
return;
};
display(current);
}
public function updateMostRecent(_arg1:String, _arg2:String):void{
var _local3:*;
_local3 = (messages1.length - 1);
if (_arg1.length){
messages1[_local3] = (messages1[_local3] + _arg1);
};
if (_arg2.length){
messages2[_local3] = (messages2[_local3] + _arg2);
};
display(_local3);
}
private function previousEnabled(_arg1:Boolean):void{
if (((_arg1) && (!(this.contains(previous_btn))))){
addChild(previous_btn);
} else {
if (((!(_arg1)) && (this.contains(previous_btn)))){
removeChild(previous_btn);
};
};
}
function goNext(_arg1:MouseEvent):void{
current = Math.min((current + 1), (messages1.length - 1));
displayCurrent();
}
public function cleanup():void{
previous_btn.removeEventListener(MouseEvent.MOUSE_DOWN, goPrevious);
next_btn.removeEventListener(MouseEvent.MOUSE_DOWN, goNext);
previous_btn.removeEventListener(MouseEvent.DOUBLE_CLICK, doubleClickArrow);
next_btn.removeEventListener(MouseEvent.DOUBLE_CLICK, doubleClickArrow);
}
private function display(_arg1:int):void{
line1.text = String(messages1[_arg1]);
line2.text = String(messages2[_arg1]);
dm.embolden(line1);
dm.embolden(line2);
if (_arg1 < (messages1.length - 1)){
nextEnabled(true);
} else {
nextEnabled(false);
};
if (_arg1 > 0){
previousEnabled(true);
} else {
previousEnabled(false);
};
}
private function nextEnabled(_arg1:Boolean):void{
if (((_arg1) && (!(this.contains(next_btn))))){
addChild(next_btn);
} else {
if (((!(_arg1)) && (this.contains(next_btn)))){
removeChild(next_btn);
};
};
}
function goPrevious(_arg1:MouseEvent):void{
current = Math.max((current - 1), 0);
displayCurrent();
}
}
}//package
Section 49
//BattleMessageScroller (BattleMessageScroller)
package {
import flash.display.*;
public dynamic class BattleMessageScroller extends SimpleButton {
}
}//package
Section 50
//BattleMusic (BattleMusic)
package {
import flash.media.*;
public class BattleMusic extends Music {
public function BattleMusic(_arg1:Boolean=true, _arg2:Horde=null):void{
var _local3:Sound;
super();
if (_arg2 == null){
_local3 = new rollingthunder_c();
} else {
if (_arg2.legendary){
_local3 = new rollingthunder_c();
} else {
if (_arg2.isCampaignBoss()){
_local3 = new morpheus_calls_loop02();
} else {
if (_arg2.race == Horde.dwarves){
_local3 = new battlements_loop02();
} else {
if (_arg2.race == Horde.undead){
_local3 = new black_mountain_loop01();
} else {
if (_arg2.race == Horde.greenskins){
_local3 = new stormbringers_loop01();
} else {
if (_arg2.race == Horde.creatures){
_local3 = new bonebreaker_loop03();
} else {
if (_arg2.race == Horde.cultists){
_local3 = new hellwars_loop02();
} else {
_local3 = new rollingthunder_c();
};
};
};
};
};
};
};
};
channel = _local3.play(0, 99999);
if (channel == null){
return;
};
active = true;
if (_arg1){
this.fadeIn(750);
} else {
this.setVolume(volumeSetting);
};
}
}
}//package
Section 51
//beer_effect (beer_effect)
package {
import flash.display.*;
public dynamic class beer_effect extends MovieClip {
public function beer_effect(){
addFrameScript(4, frame5, 49, frame50);
}
function frame5(){
dm.sound.play(SoundControl.potionSound);
}
function frame50(){
this.stop();
}
}
}//package
Section 52
//black_mountain_loop01 (black_mountain_loop01)
package {
import flash.media.*;
public dynamic class black_mountain_loop01 extends Sound {
}
}//package
Section 53
//blind_effect (blind_effect)
package {
import flash.display.*;
public dynamic class blind_effect extends MovieClip {
public function blind_effect(){
addFrameScript(0, frame1, 19, frame20);
}
function frame1(){
dm.sound.play(SoundControl.blind);
}
function frame20(){
this.gotoAndStop(20);
}
}
}//package
Section 54
//blind_sound (blind_sound)
package {
import flash.media.*;
public dynamic class blind_sound extends Sound {
}
}//package
Section 55
//BloodRandom (BloodRandom)
package {
import flash.display.*;
public dynamic class BloodRandom extends MovieClip {
public var f;
public function BloodRandom(){
addFrameScript(0, frame1);
}
function frame1(){
f = DungeonMain.RandomNum(1, this.totalFrames);
this.gotoAndStop(f);
}
}
}//package
Section 56
//blueburst (blueburst)
package {
import flash.display.*;
public dynamic class blueburst extends MovieClip {
}
}//package
Section 57
//bonebreaker_loop03 (bonebreaker_loop03)
package {
import flash.media.*;
public dynamic class bonebreaker_loop03 extends Sound {
}
}//package
Section 58
//buff_chant_sound (buff_chant_sound)
package {
import flash.media.*;
public dynamic class buff_chant_sound extends Sound {
}
}//package
Section 59
//buff_effect (buff_effect)
package {
import flash.display.*;
public dynamic class buff_effect extends MovieClip {
public function buff_effect(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.buff);
}
function frame45(){
this.stop();
}
}
}//package
Section 60
//buff_quickness_effect (buff_quickness_effect)
package {
import flash.display.*;
public dynamic class buff_quickness_effect extends MovieClip {
}
}//package
Section 61
//BuyPanel (BuyPanel)
package {
import flash.display.*;
public dynamic class BuyPanel extends Sprite {
public var consumablesTab:ItemModeTab;
public var armorLightTab:ItemModeTab;
public var allTab:ItemModeTab;
public var buyDisabler:MovieClip;
public var weaponsTab:ItemModeTab;
public var buyList:ShopListScrolling;
public var accessoriesTab:ItemModeTab;
public var buyButton:MovieClip;
public var armorMediumTab:ItemModeTab;
public var armorHeavyTab:ItemModeTab;
}
}//package
Section 62
//BuySellTab (BuySellTab)
package {
import flash.text.*;
import flash.display.*;
public dynamic class BuySellTab extends MovieClip {
public var tab_text:TextField;
}
}//package
Section 63
//BuySkillPanel (BuySkillPanel)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class BuySkillPanel extends Sprite {
public var sk_icon:SkillIcon;
public var bg:MovieClip;
public var buyButton:SimpleButton;
public var skill:Skill;
public var sk_description:TextField;
public var isSelected:Boolean;// = false
public function BuySkillPanel():void{
isSelected = false;
super();
bg.gotoAndStop("normal");
buyButton.addEventListener(MouseEvent.MOUSE_DOWN, clicked);
}
public function setBlank():void{
if (this.contains(sk_description)){
removeChild(sk_description);
};
if (this.contains(sk_icon)){
removeChild(sk_icon);
};
removeButton();
cleanup();
}
public function setSkill(_arg1:Skill):void{
if (_arg1 == null){
return;
};
this.skill = _arg1;
sk_icon.gotoAndStop(_arg1.iconFrame);
sk_icon.setSkill(_arg1);
sk_icon.setOwner(PlayerCharacter(_arg1.char_ref));
sk_icon.setUsable(_arg1.usable(true));
sk_description.mouseEnabled = false;
sk_description.text = _arg1.skillname;
dm.embolden(sk_description);
}
function clicked(_arg1:MouseEvent):void{
if ((((parent == null)) || (!((parent is BuySkills))))){
return;
};
if (BuySkills(parent).pointsFree > 0){
isSelected = true;
BuySkills(parent).skillSelected();
setBlank();
};
}
public function cleanup():void{
sk_icon.cleanup();
buyButton.removeEventListener(MouseEvent.MOUSE_DOWN, clicked);
}
public function removeButton():void{
if (this.contains(buyButton)){
removeChild(buyButton);
};
}
}
}//package
Section 64
//BuySkillPanelR (BuySkillPanelR)
package {
public dynamic class BuySkillPanelR extends BuySkillPanel {
}
}//package
Section 65
//BuySkills (BuySkills)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class BuySkills extends MovieClip {
public var pass2_description:TextField;
public var sk4:BuySkillPanel;
public var cancel_btn:MovieClip;
public var points_txt:TextField;
public var pass1_button:SimpleButton;
public var pass1_icon:PassiveSkillIcon;
var char_ref:PlayerCharacter;
var info_panel:CharInfoPanel;
public var pass1_description:TextField;
public var pass2_points:int;// = 0
public var pass2_icon:PassiveSkillIcon;
public var pass1_points:int;// = 0
public var continue_btn:MovieClip;
public var sk1:BuySkillPanel;
public var sk2:BuySkillPanel;
public var sk3:BuySkillPanel;
public var sk5:BuySkillPanelR;
public var sk8:BuySkillPanelR;
public var sk6:BuySkillPanelR;
public var sk7:BuySkillPanelR;
var pointsFree:int;// = 0
public var pass2_button:SimpleButton;
public function BuySkills(_arg1:CharInfoPanel=null){
pointsFree = 0;
pass1_points = 0;
pass2_points = 0;
super();
if (_arg1 != null){
this.info_panel = _arg1;
};
continue_btn.addEventListener(MouseEvent.MOUSE_DOWN, continueClick);
cancel_btn.addEventListener(MouseEvent.MOUSE_DOWN, cancelClick);
}
private function updateSkillPoints():void{
var _local1:*;
var _local2:*;
points_txt.text = String(pointsFree);
dm.embolden(points_txt);
if (!(pointsFree)){
_local1 = 1;
while (_local1 <= 8) {
_local2 = getChildByName(("sk" + _local1));
if (_local2 != null){
_local2.removeButton();
};
_local1++;
};
if (contains(pass1_button)){
removeChild(pass1_button);
};
if (contains(pass2_button)){
removeChild(pass2_button);
};
};
}
public function setChar(_arg1:PlayerCharacter):void{
var _local2:*;
var _local3:*;
var _local4:*;
if (_arg1 == null){
return;
};
char_ref = _arg1;
_local3 = 1;
_local4 = 0;
while (_local4 < _arg1.skills.length) {
if (_arg1.skills[_local4].unlocked){
} else {
_local2 = getChildByName(("sk" + _local3));
if (_local2 == null){
} else {
_local2.setSkill(_arg1.skills[_local4]);
_local3++;
};
};
_local4++;
};
_local4 = _local3;
while (_local4 <= 8) {
_local2 = getChildByName(("sk" + _local4));
if (_local2 != null){
_local2.setBlank();
};
_local4++;
};
if (_arg1.passive_skill_offense < 25){
pass1_description.text = _arg1.getPassiveSkillName(true);
dmf.embolden(pass1_description);
pass1_icon.updateSkill(_arg1, true);
pass1_button.addEventListener(MouseEvent.MOUSE_DOWN, passive1Click);
} else {
removePassive1();
};
if (_arg1.passive_skill_defense < 25){
pass2_description.text = _arg1.getPassiveSkillName(false);
dmf.embolden(pass2_description);
pass2_icon.updateSkill(_arg1, false);
pass2_button.addEventListener(MouseEvent.MOUSE_DOWN, passive2Click);
} else {
removePassive2();
};
pointsFree = _arg1.skill_points;
updateSkillPoints();
}
function cancelClick(_arg1:MouseEvent):void{
this.cleanup();
if (parent != null){
stage.removeChild(this);
};
}
function continueClick(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
_local2 = 1;
while (_local2 <= 8) {
_local3 = getChildByName(("sk" + _local2));
if (_local3 == null){
} else {
if (((_local3.isSelected) && (!((_local3.skill == null))))){
_local3.skill.unlocked = true;
};
};
_local2++;
};
char_ref.passive_skill_offense = Math.min(25, (char_ref.passive_skill_offense + pass1_points));
char_ref.passive_skill_defense = Math.min(25, (char_ref.passive_skill_defense + pass2_points));
char_ref.skill_points = pointsFree;
this.cleanup();
if (info_panel != null){
info_panel.updateValues();
};
if (stage != null){
stage.removeChild(this);
};
}
public function skillSelected():void{
pointsFree--;
updateSkillPoints();
}
private function passive2Click(_arg1:MouseEvent):void{
if (((pointsFree) && (((char_ref.passive_skill_defense + pass2_points) < 25)))){
pass2_points++;
pass2_icon.setSkillRank((char_ref.passive_skill_defense + pass2_points));
skillSelected();
if ((char_ref.passive_skill_defense + pass2_points) == 25){
removePassive2();
};
};
}
private function removePassive1():void{
if (contains(pass1_description)){
removeChild(pass1_description);
};
if (contains(pass1_icon)){
removeChild(pass1_icon);
};
if (contains(pass1_button)){
removeChild(pass1_button);
};
}
private function removePassive2():void{
if (contains(pass2_description)){
removeChild(pass2_description);
};
if (contains(pass2_icon)){
removeChild(pass2_icon);
};
if (contains(pass2_button)){
removeChild(pass2_button);
};
}
public function skillDeselected():void{
pointsFree++;
updateSkillPoints();
}
public function cleanup():void{
var _local1:*;
var _local2:*;
continue_btn.removeEventListener(MouseEvent.MOUSE_DOWN, continueClick);
cancel_btn.removeEventListener(MouseEvent.MOUSE_DOWN, cancelClick);
_local1 = 1;
while (_local1 <= 8) {
_local2 = getChildByName(("sk" + _local1));
if (_local2 != null){
_local2.cleanup();
};
_local1++;
};
pass1_button.removeEventListener(MouseEvent.MOUSE_DOWN, passive1Click);
pass2_button.removeEventListener(MouseEvent.MOUSE_DOWN, passive2Click);
}
private function passive1Click(_arg1:MouseEvent):void{
if (((pointsFree) && (((char_ref.passive_skill_offense + pass1_points) < 25)))){
pass1_points++;
pass1_icon.setSkillRank((char_ref.passive_skill_offense + pass1_points));
skillSelected();
if ((char_ref.passive_skill_offense + pass1_points) == 25){
removePassive1();
};
};
}
}
}//package
Section 66
//Campaign (Campaign)
package {
public class Campaign {
public static const ORIGINAL = 1;
public static const INFINITE = 3;
public static const DELUXE = 2;
static const WAVES:int = 20;
public static const SURVIVAL = 4;
private static function addWaveMonster(_arg1:MonsterCharacter, _arg2:int, _arg3:Horde):void{
if (_arg3.members.length < 6){
_arg1.pos = _arg2;
_arg3.members.push(_arg1);
};
}
public static function getName(_arg1:int):String{
switch (_arg1){
case ORIGINAL:
return ("The Den of Corruption");
case DELUXE:
return ("The Den of Terror");
case INFINITE:
return ("The Den of Endless Evil");
case SURVIVAL:
return ("The Fall of Tellunos");
default:
return ("The Den of Mysteriousness(??)");
};
}
public static function getIntroText(_arg1:int):String{
switch (_arg1){
case ORIGINAL:
default:
return ("The party of adventurers make their way to the ancient ruin,\nequipped only with what meagre provisions the locals could spare.\n\nThe words of the village headman had filled them with a quiet\ndread, yet steeled their resolve. If the world is to be saved, they\nmust assault the dungeon and destroy the corruption lurking in its\ndepths.\n\nThey must enter the monsters' den.");
case DELUXE:
return ("'No man we've sent has returned whole.'\n\nThis was met with silence from the small group seated around\nthe tavern bench. Agitated, the speaker continued.\n\n'What crawls back is barely worth calling a man- their wits\nshattered, our best soldiers return as gibbering wrecks. If they\nreturn at all. Is any reward worth that?'\n\nBut the band of adventurers had made their decision.\n\n'We are not your craven soldiers. Give me the map and await our return.'\n\n'Have the reward ready.'");
};
}
public static function getOutroText(_arg1:int):String{
switch (_arg1){
case ORIGINAL:
default:
return ("The demonic presence begins to fade, drawn back to whichever\nhellish realm spawned it. Not willingly, as its final scream of rage\nand pain shakes the dungeon to its very foundations.\n\nDebris begins to rain from the ceiling, and jagged chasms open in\nthe stone floor, revealing still deeper levels of the dungeon. That,\nhowever, must remain a mystery for another time. The heroes,\nvictorious in their quest, realize they must leave now lest their\nretreat be forever barred by the mounting piles of fallen rubble.\nBounding up the stairs, they find themselves passing back through\nall the levels in which they have fought, and bled, and which may\nyet become their tomb.\n\nFinally, desperately, they surge forth from the ruin's entrance, as\nthe dungeon collapses behind them in a final exhalation of dust and debris. Jubilance and disbelief.\n\nThey have succeeded, and they have survived.");
case DELUXE:
return ("The Dreadfather falls, a foul-smelling smoke rising from the corpse.\nA trophy is hastily collected, as the glow of the Journeyman's Stone\nbegins to fade. Thankfully, power enough remains to return the\nweary adventurers to the entrance of the dungeon.\n\nThe threat is over. Without his terrifying presence to unify them,\nhis army will fall to infighting and the remnants will scatter.\n\nIn a small tavern, a man drinks, lamenting that his duties drive\nhim to send so many to their doom. Soon he will have to search for\nanother eager party of adventurers to set on his hopeless quest.\n\nHis reverie is interrupted by a sudden thump on the table, and a\nterrible stench assaults him. The canvas bag falls open to reveal its\ngrisly contents, and he is faced with a nightmarish rictus grin.\n\n'Let's talk about that reward..'");
};
}
public static function setForSurvivalWave(_arg1:Horde, _arg2:int):void{
var _local3:MonsterCharacter;
var _local4:int;
_arg1.members.length = 0;
_local4 = 9;
_local4 = (_local4 + Math.ceil((_arg2 / WAVES)));
_arg2 = (_arg2 % WAVES);
if (_arg2 == 0){
_arg2 = 20;
};
switch (_arg2){
case 1:
addWaveMonster(new mSkeleton(_local4), 4, _arg1);
addWaveMonster(new mSkeleton(_local4), 6, _arg1);
addWaveMonster(new mVampire(_local4), 2, _arg1);
break;
case 2:
addWaveMonster(new mOrcBerserker(_local4), 4, _arg1);
addWaveMonster(new mOrcBerserker(_local4), 6, _arg1);
addWaveMonster(new mOrcChampion(_local4), 5, _arg1);
break;
case 3:
addWaveMonster(new mCultNeophyte(_local4), 4, _arg1);
addWaveMonster(new mCultNeophyte(_local4), 5, _arg1);
addWaveMonster(new mCultNeophyte(_local4), 6, _arg1);
break;
case 4:
addWaveMonster(new mDwarfCrossbow(_local4), 1, _arg1);
addWaveMonster(new mDwarfCrossbow(_local4), 3, _arg1);
addWaveMonster(new mDwarfVeteran(_local4), 5, _arg1);
break;
case 5:
addWaveMonster(new mOrcBerserker(_local4), 4, _arg1);
addWaveMonster(new mOrcJuggernaut(_local4), 5, _arg1);
addWaveMonster(new mOrcBerserker(_local4), 6, _arg1);
break;
case 6:
addWaveMonster(new mBoneHorror(_local4), 5, _arg1);
addWaveMonster(new mVampire(_local4), 1, _arg1);
addWaveMonster(new mLich(_local4), 2, _arg1);
addWaveMonster(new mVampire(_local4), 3, _arg1);
break;
case 7:
addWaveMonster(new mDwarfCrossbow(_local4), 1, _arg1);
addWaveMonster(new mDwarfRunecaster(_local4), 2, _arg1);
addWaveMonster(new mDwarfCrossbow(_local4), 3, _arg1);
addWaveMonster(new mDwarfManiac(_local4), 6, _arg1);
break;
case 8:
addWaveMonster(new mTroll(_local4), 5, _arg1);
addWaveMonster(new mOrcShaman(_local4), 1, _arg1);
addWaveMonster(new mGoblinArtificer(_local4), 2, _arg1);
addWaveMonster(new mOrcShaman(_local4), 3, _arg1);
break;
case 9:
addWaveMonster(new mCultChosen(_local4), 4, _arg1);
addWaveMonster(new mCultWarrior(_local4), 5, _arg1);
addWaveMonster(new mCultChosen(_local4), 6, _arg1);
addWaveMonster(new mCultArcher(_local4), 2, _arg1);
break;
case 10:
addWaveMonster(new mNecromancer(_local4), 2, _arg1);
addWaveMonster(new mSkeleton(_local4), 4, _arg1);
addWaveMonster(new mBoneHorror(_local4), 5, _arg1);
addWaveMonster(new mSkeleton(_local4), 6, _arg1);
break;
case 11:
addWaveMonster(new mOrcSavage(_local4), 1, _arg1);
addWaveMonster(new mOrcSavage(_local4), 3, _arg1);
addWaveMonster(new mOrcChampion(_local4), 4, _arg1);
addWaveMonster(new mTroll(_local4), 5, _arg1);
addWaveMonster(new mOrcChampion(_local4), 6, _arg1);
break;
case 12:
addWaveMonster(new mCultArcher(_local4), 2, _arg1);
addWaveMonster(new mCultArcher(_local4), 3, _arg1);
addWaveMonster(new mCultWarrior(_local4), 4, _arg1);
addWaveMonster(new mCultChosen(_local4), 5, _arg1);
addWaveMonster(new mCultWarrior(_local4), 6, _arg1);
break;
case 13:
addWaveMonster(new mSkeletonArcher(_local4), 1, _arg1);
addWaveMonster(new mSkeletonArcher(_local4), 2, _arg1);
addWaveMonster(new mGhost(_local4), 4, _arg1);
addWaveMonster(new mGhost(_local4), 5, _arg1);
addWaveMonster(new mGhost(_local4), 6, _arg1);
break;
case 14:
addWaveMonster(new mDwarfRunecaster(_local4), 1, _arg1);
addWaveMonster(new mDwarfRunecaster(_local4), 3, _arg1);
addWaveMonster(new mDwarfWarrior(_local4), 4, _arg1);
addWaveMonster(new mDwarfManiac(_local4), 5, _arg1);
addWaveMonster(new mDwarfWarrior(_local4), 6, _arg1);
break;
case 15:
addWaveMonster(new mCultArcher(_local4), 1, _arg1);
addWaveMonster(new mCultPriest(_local4), 2, _arg1);
addWaveMonster(new mCultArcher(_local4), 3, _arg1);
addWaveMonster(new mCultEngine(_local4), 5, _arg1);
addWaveMonster(new mCultNeophyte(_local4), 6, _arg1);
break;
case 16:
addWaveMonster(new mDwarfCrossbow(_local4), 1, _arg1);
addWaveMonster(new mDwarfRunecaster(_local4), 2, _arg1);
addWaveMonster(new mDwarfCrossbow(_local4), 3, _arg1);
addWaveMonster(new mDwarfVeteran(_local4), 4, _arg1);
addWaveMonster(new mDwarfVeteran(_local4), 5, _arg1);
addWaveMonster(new mDwarfVeteran(_local4), 6, _arg1);
break;
case 17:
addWaveMonster(new mSkeletonArcher(_local4), 1, _arg1);
addWaveMonster(new mLich(_local4), 2, _arg1);
addWaveMonster(new mLich(_local4), 3, _arg1);
addWaveMonster(new mSkeleton(_local4), 4, _arg1);
addWaveMonster(new mBoneHorror(_local4), 5, _arg1);
addWaveMonster(new mBoneHorror(_local4), 6, _arg1);
break;
case 18:
addWaveMonster(new mOrcShaman(_local4), 1, _arg1);
addWaveMonster(new mOrcSavage(_local4), 2, _arg1);
addWaveMonster(new mOrcShaman(_local4), 3, _arg1);
addWaveMonster(new mOrcBerserker(_local4), 4, _arg1);
addWaveMonster(new mOrcChampion(_local4), 5, _arg1);
addWaveMonster(new mOrcBerserker(_local4), 6, _arg1);
break;
case 19:
addWaveMonster(new mCultArcher(_local4), 1, _arg1);
addWaveMonster(new mCultPriest(_local4), 2, _arg1);
addWaveMonster(new mCultArcher(_local4), 3, _arg1);
addWaveMonster(new mCultNeophyte(_local4), 4, _arg1);
addWaveMonster(new mCultChosen(_local4), 5, _arg1);
addWaveMonster(new mCultNeophyte(_local4), 6, _arg1);
break;
case 20:
addWaveMonster(new mDwarfCrossbow(_local4), 1, _arg1);
addWaveMonster(new mDwarfPrince(_local4), 2, _arg1);
addWaveMonster(new mDwarfCrossbow(_local4), 3, _arg1);
addWaveMonster(new mDwarfWarrior(_local4), 4, _arg1);
addWaveMonster(new mDwarfWarrior(_local4), 5, _arg1);
addWaveMonster(new mDwarfWarrior(_local4), 6, _arg1);
break;
};
}
public static function getTintFrame(_arg1:int):int{
switch (_arg1){
case ORIGINAL:
return (1);
case DELUXE:
return (2);
case INFINITE:
default:
return (3);
};
}
}
}//package
Section 67
//CampaignItemFragment (CampaignItemFragment)
package {
public class CampaignItemFragment extends Consumable {
public function CampaignItemFragment(_arg1:int=1){
item_name = "Glowing Stone Fragment";
lore = "Retains magical residue from the journey to this place.";
campaign_combiner = true;
item_rarity = Item.quest;
icon_frame = 131;
}
override public function getWorth():int{
return (0);
}
}
}//package
Section 68
//CampaignItemStone (CampaignItemStone)
package {
public class CampaignItemStone extends Consumable {
public function CampaignItemStone(_arg1:int=1){
item_name = "Journeyman's Stone";
campaign_portal = true;
item_rarity = Item.quest;
icon_frame = 132;
}
override public function getWorth():int{
return (0);
}
}
}//package
Section 69
//CampaignPaneNew (CampaignPaneNew)
package {
import flash.display.*;
public dynamic class CampaignPaneNew extends Sprite {
}
}//package
Section 70
//CampaignPaneOriginal (CampaignPaneOriginal)
package {
import flash.display.*;
public dynamic class CampaignPaneOriginal extends Sprite {
}
}//package
Section 71
//CampaignPaneSurvival (CampaignPaneSurvival)
package {
import flash.display.*;
public dynamic class CampaignPaneSurvival extends Sprite {
}
}//package
Section 72
//CampaignSelect (CampaignSelect)
package {
import flash.events.*;
import flash.display.*;
public class CampaignSelect extends MovieClip {
const FADE_OUT_FRAMES = 7;
const FADE_IN_FRAMES = 15;
public var nextButton:SimpleButton;
private var campaign:int;// = 1
private var fadeOut:Boolean;// = false
public var optionsButton:OptionsBookButton;
public var pane:Sprite;
public var continueButton:NewProceedButton;
private var fadeIn:Boolean;// = false
public function CampaignSelect():void{
campaign = Campaign.ORIGINAL;
fadeIn = false;
fadeOut = false;
super();
nextButton.addEventListener(MouseEvent.MOUSE_DOWN, cycleClick);
continueButton.addEventListener(MouseEvent.MOUSE_DOWN, continueClick);
addEventListener(Event.ENTER_FRAME, onFrame);
addNewPane();
}
private function continueClick(_arg1:MouseEvent):void{
cleanup();
dm.main.campaignSelected(campaign);
}
private function paneFadeIn():void{
fadeOut = false;
fadeIn = true;
}
private function addNewPane():void{
var _local1:Sprite;
if (campaign == Campaign.ORIGINAL){
_local1 = new CampaignPaneOriginal();
} else {
if (campaign == Campaign.DELUXE){
_local1 = new CampaignPaneNew();
} else {
if (campaign == Campaign.SURVIVAL){
_local1 = new CampaignPaneSurvival();
};
};
};
if (_local1 != null){
if (pane != null){
removeChild(pane);
};
_local1.alpha = 0;
_local1.y = 37;
_local1.mouseEnabled = false;
_local1.mouseChildren = false;
addChild(_local1);
pane = _local1;
paneFadeIn();
nextButton.mouseEnabled = true;
};
}
private function cycleClick(_arg1:MouseEvent):void{
if (campaign == Campaign.ORIGINAL){
campaign = Campaign.DELUXE;
} else {
if (campaign == Campaign.DELUXE){
campaign = Campaign.SURVIVAL;
} else {
if (campaign == Campaign.SURVIVAL){
campaign = Campaign.ORIGINAL;
};
};
};
paneFadeOut();
}
private function paneFadeOut():void{
fadeOut = true;
fadeIn = false;
nextButton.mouseEnabled = false;
}
public function cleanup():void{
removeEventListener(Event.ENTER_FRAME, onFrame);
continueButton.removeEventListener(MouseEvent.MOUSE_DOWN, continueClick);
optionsButton.cleanup();
}
private function onFrame(_arg1:Event):void{
if (fadeOut){
pane.alpha = (pane.alpha - (1 / FADE_OUT_FRAMES));
if (pane.alpha <= 0){
pane.alpha = 0;
fadeOut = false;
addNewPane();
};
} else {
if (fadeIn){
pane.alpha = (pane.alpha + (1 / FADE_IN_FRAMES));
if (pane.alpha >= 1){
pane.alpha = 1;
fadeIn = false;
};
};
};
}
}
}//package
Section 73
//Character (Character)
package {
import flash.display.*;
public class Character {
const power_max = 100;
private var _intellect:int;// = 1
private var _power:int;// = 100
private var _type:int;// = 0
var cursed;// = 0
public var customPortrait:BitmapData;
var invulnerable:int;// = 0
private var _potion_poison_resist:int;// = 0
private var _description:String;// = ""
private var _charname:String;
var skills:Array;
var debuff_damageResist:int;// = 0
private var _dexterity:int;// = 1
private var _quickness:int;// = 50
var cancelPowerRegen:int;// = 0
private var _potion_quickness_bonus:int;// = 0
private var _accuracy:int;// = 95
var power_per_turn;// = 10
var cancelHealthRegen:int;// = 0
var crippled:int;// = 0
var hadCombatTurn:Boolean;// = false
var cannotDie:int;// = 0
private var _classname:String;
private var _level;// = 1
private var _damage_resistance:int;// = 0
public var customLoading:Boolean;// = false
private var _damage:int;// = 0
private var _endurance:int;// = 1
var cannotDieMin:int;// = 1
private var _health_max:int;// = 50
var buff_damageResist;// = 0
var buff_quickness;// = 0
var buff_damage;// = 1
private var _stunResist:int;// = 0
private var _poisonResist:int;// = 0
var woundsRestorePower:int;// = 0
public var portraitRef:CharacterPortrait;
private var _potion_stun_resist:int;// = 0
var buff_vampiric;// = 0
var damageMod;// = 1
private var _useCustomPortrait:Boolean;// = false
private var _customPortraitUrl:String;// = ""
private var _portrait:int;// = 1
var buff_stun;// = 0
var buff_resistStun;// = 0
var accuracy_penalty:int;// = 0
var lethalityImmune:Boolean;// = false
var buff_healthRegen;// = 0
public var summoned:Boolean;// = false
var temp_damage_resistance:int;// = 0
var buff_damageReflect;// = 0
var buff_accuracy;// = 0
private var _health:int;// = 50
var hiding:Boolean;// = false
private var _pos:int;// = 0
private var _strength:int;// = 1
var buff_powerRegen;// = 0
var poisoned:int;// = 0
var powerRegenMod:Number;// = 1
var debuff_damage:Number;// = 1
private var _potion_damage_bonus:int;// = 0
var stunned_duration:int;// = 0
var intimidating:Boolean;// = false
private var _potion_damage_resist:int;// = 0
var buff_resistPoison;// = 0
static const ACCURACY_MINIMUM = 10;
public function Character(){
_level = 1;
_health_max = 50;
_health = 50;
power_per_turn = 10;
_power = 100;
_damage = 0;
_damage_resistance = 0;
_type = 0;
_description = "";
_strength = 1;
_endurance = 1;
_dexterity = 1;
_intellect = 1;
_quickness = 50;
_accuracy = 95;
_portrait = 1;
_pos = 0;
_poisonResist = 0;
_stunResist = 0;
summoned = false;
_useCustomPortrait = false;
_customPortraitUrl = "";
customLoading = false;
skills = new Array();
stunned_duration = 0;
accuracy_penalty = 0;
poisoned = 0;
powerRegenMod = 1;
hiding = false;
intimidating = false;
cannotDie = 0;
cannotDieMin = 1;
cursed = 0;
lethalityImmune = false;
invulnerable = 0;
temp_damage_resistance = 0;
damageMod = 1;
crippled = 0;
cancelPowerRegen = 0;
cancelHealthRegen = 0;
woundsRestorePower = 0;
buff_resistPoison = 0;
buff_resistStun = 0;
buff_damageResist = 0;
buff_damageReflect = 0;
buff_healthRegen = 0;
buff_powerRegen = 0;
buff_vampiric = 0;
buff_stun = 0;
buff_quickness = 0;
buff_damage = 1;
buff_accuracy = 0;
debuff_damageResist = 0;
debuff_damage = 1;
_potion_damage_resist = 0;
_potion_damage_bonus = 0;
_potion_poison_resist = 0;
_potion_stun_resist = 0;
_potion_quickness_bonus = 0;
hadCombatTurn = false;
super();
}
public function set health_max(_arg1:int):void{
this._health_max = _arg1;
}
public function get classname():String{
return (this._classname);
}
public function get endurance():int{
return (this._endurance);
}
public function set power(_arg1:int):void{
this._power = _arg1;
}
public function getHealthRegen(_arg1:Boolean=true):int{
if (_arg1){
return (buff_healthRegen);
};
return (0);
}
public function set classname(_arg1:String):void{
this._classname = _arg1;
}
public function set endurance(_arg1:int):void{
this._endurance = _arg1;
}
public function set damage_resistance(_arg1:int):void{
this._damage_resistance = _arg1;
}
public function get description():String{
return (this._description);
}
public function getVampiric(_arg1:Boolean=true):int{
if (_arg1){
return (buff_vampiric);
};
return (0);
}
public function set potion_damage_resist(_arg1:int):void{
this._potion_damage_resist = _arg1;
}
public function set poisonResist(_arg1:int):void{
this._poisonResist = _arg1;
}
public function getPowerRegen(_arg1:Boolean=true):int{
if (_arg1){
return (Math.round(((power_per_turn + buff_powerRegen) * powerRegenMod)));
};
return (power_per_turn);
}
public function genderPossessive(_arg1:Boolean=false):String{
if (_arg1){
return ("Their");
};
return ("their");
}
public function get strength():int{
return (this._strength);
}
public function genderPronoun(_arg1:Boolean=false):String{
if (_arg1){
return ("They");
};
return ("they");
}
public function get pos():int{
return (this._pos);
}
public function get health():int{
return (this._health);
}
public function get potion_stun_resist():int{
return (this._potion_stun_resist);
}
public function getAccuracy(_arg1:Boolean=true):int{
var _local2:int;
if (_arg1){
_local2 = ((accuracy + buff_accuracy) - accuracy_penalty);
} else {
_local2 = accuracy;
};
_local2 = Math.max(ACCURACY_MINIMUM, _local2);
return (_local2);
}
public function set potion_quickness_bonus(_arg1:int):void{
this._potion_quickness_bonus = _arg1;
}
public function set type(_arg1:int):void{
this._type = _arg1;
}
public function getDamageReflection(_arg1:Boolean=true):int{
if (_arg1){
return (buff_damageReflect);
};
return (0);
}
public function getLethality(_arg1:Boolean=true):int{
return (0);
}
public function get potion_damage_bonus():int{
return (this._potion_damage_bonus);
}
public function set strength(_arg1:int):void{
this._strength = _arg1;
}
public function set stunResist(_arg1:int):void{
this._stunResist = _arg1;
}
public function getHealthPercent():int{
return (Math.round((100 / (health_max / health))));
}
public function getStunChance(_arg1:Boolean=true):int{
return (0);
}
public function set pos(_arg1:int):void{
this._pos = _arg1;
}
public function getEffectiveHealth():int{
return (health);
}
public function getDamageResist(_arg1:Boolean=true):int{
if (_arg1){
return (((buff_damageResist + temp_damage_resistance) + potion_damage_resist));
};
return (0);
}
public function set potion_poison_resist(_arg1:int):void{
this._potion_poison_resist = _arg1;
}
public function hasPowerForSkill(_arg1:Skill):Boolean{
if (_arg1.power_cost > power){
return (false);
};
return (true);
}
public function increaseHealthByPercentage(_arg1:int, _arg2:Boolean=false):int{
var _local3:*;
_local3 = Math.round((health_max * (_arg1 / 100)));
return (increaseHealth(_local3, _arg2));
}
public function set health(_arg1:int):void{
this._health = _arg1;
}
public function loadCustomPortrait():void{
var _local1:CustomPortrait;
if (!(useCustomPortrait)){
return;
};
customLoading = true;
_local1 = new CustomPortrait(customPortraitUrl, customLoaded, customFailed);
}
public function stun(_arg1:int):Boolean{
var _local2:int;
_local2 = getStunResist();
if (invulnerable){
return (false);
};
if (dmf.randomNum(0, 99) >= _local2){
stunned_duration = _arg1;
return (true);
};
return (false);
}
public function getAccuracyDamage(_arg1:Boolean=true):int{
return (0);
}
public function set potion_stun_resist(_arg1:int):void{
this._potion_stun_resist = _arg1;
}
public function getIntellect(_arg1:Boolean=true):int{
return (this.intellect);
}
public function reduceHealthByPercentage(_arg1:int):int{
var _local2:*;
_local2 = ((health_max / 100) * _arg1);
return (reduceHealth(_local2));
}
public function customLoaded(_arg1:BitmapData, _arg2:Character=null):void{
customLoading = false;
customPortrait = _arg1;
if (portraitRef != null){
portraitRef.update();
};
}
public function set damage(_arg1:int):void{
this._damage = _arg1;
}
public function get charname():String{
return (this._charname);
}
public function set potion_damage_bonus(_arg1:int):void{
this._potion_damage_bonus = _arg1;
}
public function get accuracy():int{
return (this._accuracy);
}
public function set intellect(_arg1:int):void{
this._intellect = _arg1;
}
public function get health_max():int{
return (this._health_max);
}
public function get power():int{
return (this._power);
}
public function set level(_arg1:int):void{
this._level = _arg1;
}
public function get damage_resistance():int{
return (this._damage_resistance);
}
public function getPoisonDamage(_arg1:Boolean=true):int{
return (0);
}
public function get potion_damage_resist():int{
return (this._potion_damage_resist);
}
public function get poisonResist():int{
return (this._poisonResist);
}
public function getDexterity(_arg1:Boolean=true):int{
return (this.dexterity);
}
public function clearNegativeEffects():void{
stunned_duration = 0;
accuracy_penalty = 0;
poisoned = 0;
if (damageMod < 1){
damageMod = 1;
};
if (powerRegenMod < 1){
powerRegenMod = 1;
};
if (temp_damage_resistance < 0){
temp_damage_resistance = 0;
};
crippled = 0;
cursed = 0;
cancelPowerRegen = 0;
cancelHealthRegen = 0;
debuff_damageResist = 0;
debuff_damage = 1;
}
public function getQuickness(_arg1:Boolean=true):int{
var _local2:*;
_local2 = this.quickness;
if (_arg1){
_local2 = (_local2 + ((buff_quickness + potion_quickness_bonus) - crippled));
};
_local2 = Math.max(_local2, 0);
return (_local2);
}
public function poison(_arg1:int):Boolean{
var _local2:int;
var _local3:int;
if (invulnerable){
return (false);
};
_local2 = getPoisonResist();
if (_local2 >= 100){
return (false);
};
_local3 = Math.round((_arg1 * (1 - (_local2 / 100))));
if (_local3 > 0){
poisoned = (poisoned + _local3);
return (true);
};
return (false);
}
public function set useCustomPortrait(_arg1:Boolean):void{
this._useCustomPortrait = _arg1;
}
public function set portrait(_arg1:int):void{
this._portrait = _arg1;
}
public function get potion_quickness_bonus():int{
return (this._potion_quickness_bonus);
}
public function get type():int{
return (this._type);
}
public function customFailed(_arg1:Character=null):void{
customLoading = false;
customPortrait = null;
if (portraitRef != null){
portraitRef.update();
};
}
public function increaseHealth(_arg1:int, _arg2:Boolean=false):int{
var _local3:int;
_local3 = health;
if ((((_local3 <= 0)) && (!(_arg2)))){
return (0);
};
health = (health + _arg1);
if (health > health_max){
health = health_max;
};
if (health < 0){
health = 0;
clearStatusEffects();
};
if (((((_arg2) && ((_local3 <= 0)))) && ((health > 0)))){
clearStatusEffects();
};
return ((health - _local3));
}
public function reducePower(_arg1:int):int{
var _local2:*;
_local2 = power;
power = (power - _arg1);
if (power < 0){
power = 0;
};
if (power > 100){
power = 100;
};
return ((_local2 - power));
}
public function getStunResist(_arg1:Boolean=true):int{
if (_arg1){
return (((stunResist + buff_resistStun) + potion_stun_resist));
};
return (stunResist);
}
public function get stunResist():int{
return (this._stunResist);
}
public function set customPortraitUrl(_arg1:String):void{
this._customPortraitUrl = _arg1;
}
public function getEndurance(_arg1:Boolean=true):int{
return (this.endurance);
}
public function get potion_poison_resist():int{
return (this._potion_poison_resist);
}
public function clearStatusEffects():void{
cannotDie = 0;
invulnerable = 0;
stunned_duration = 0;
accuracy_penalty = 0;
poisoned = 0;
damageMod = 1;
powerRegenMod = 1;
temp_damage_resistance = 0;
crippled = 0;
cursed = 0;
hiding = false;
cancelPowerRegen = 0;
cancelHealthRegen = 0;
woundsRestorePower = 0;
intimidating = false;
buff_resistPoison = 0;
buff_resistStun = 0;
buff_damageResist = 0;
buff_damageReflect = 0;
buff_healthRegen = 0;
buff_powerRegen = 0;
buff_vampiric = 0;
buff_stun = 0;
buff_quickness = 0;
buff_damage = 1;
buff_accuracy = 0;
buff_quickness = 0;
debuff_damageResist = 0;
debuff_damage = 1;
potion_damage_resist = 0;
potion_damage_bonus = 0;
potion_poison_resist = 0;
potion_stun_resist = 0;
potion_quickness_bonus = 0;
}
public function reduceHealth(_arg1:int):int{
var _local2:int;
if (invulnerable){
return (0);
};
_local2 = health;
health = (health - _arg1);
if ((((health < cannotDieMin)) && ((cannotDie > 0)))){
health = Math.min(_local2, cannotDieMin);
};
if (health <= 0){
health = 0;
clearStatusEffects();
};
if (health > health_max){
health = health_max;
};
return ((_local2 - health));
}
public function get damage():int{
return (this._damage);
}
public function get intellect():int{
return (this._intellect);
}
public function get level():int{
return (this._level);
}
public function set dexterity(_arg1:int):void{
this._dexterity = _arg1;
}
public function set quickness(_arg1:int):void{
this._quickness = _arg1;
}
public function damageAfterArmor(_arg1:int, _arg2:Character):int{
return (_arg1);
}
public function get useCustomPortrait():Boolean{
return (this._useCustomPortrait);
}
public function getPoisonResist(_arg1:Boolean=true):int{
if (_arg1){
return (((poisonResist + buff_resistPoison) + potion_poison_resist));
};
return (poisonResist);
}
public function get portrait():int{
return (this._portrait);
}
public function get customPortraitUrl():String{
return (this._customPortraitUrl);
}
public function genderSelf(_arg1:Boolean=false):String{
if (_arg1){
return ("Itself");
};
return ("itself");
}
public function isInactive():Boolean{
if (health <= 0){
return (true);
};
if (hiding){
return (true);
};
return (false);
}
public function getStrength(_arg1:Boolean=true):int{
return (this.strength);
}
public function getHealingBonus(_arg1:Boolean=true):int{
return (0);
}
public function set charname(_arg1:String):void{
this._charname = _arg1;
}
public function get dexterity():int{
return (this._dexterity);
}
public function get quickness():int{
return (this._quickness);
}
public function canMissWith(_arg1:Skill):Boolean{
if (_arg1.alwaysHits){
return (false);
};
if (_arg1.targetsFriendlies){
return (false);
};
if (_arg1.targetsSelf){
return (false);
};
if (_arg1.targetsEmpty){
return (false);
};
return (true);
}
public function increasePowerByPercentage(_arg1:int):int{
return (increasePower(_arg1));
}
public function increasePower(_arg1:int):int{
var _local2:*;
_local2 = power;
power = (power + _arg1);
if (power > power_max){
power = power_max;
};
return ((power - _local2));
}
public function set accuracy(_arg1:int):void{
this._accuracy = _arg1;
}
public function getPowerPercent():int{
return (Math.round((100 / (power_max / power))));
}
public function set description(_arg1:String):void{
this._description = _arg1;
}
}
}//package
Section 74
//CharacterInfo (CharacterInfo)
package {
import flash.text.*;
import flash.display.*;
public class CharacterInfo extends MovieClip {
public var playerClass:TextField;
public var playerName:TextField;
public var customPortrait:DisplayObject;
public var playerGraphic:CharGraphic;
public function CharacterInfo():void{
}
public function setChar(_arg1:Character):void{
if (_arg1 == null){
return;
};
playerGraphic.setChar(_arg1);
playerName.text = _arg1.charname;
dmf.embolden(playerName);
playerClass.text = _arg1.classname;
}
private function removeCustomPortrait():void{
if (customPortrait == null){
return;
};
if (this.contains(customPortrait)){
removeChild(customPortrait);
};
}
}
}//package
Section 75
//CharacterPortrait (CharacterPortrait)
package {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.text.*;
public class CharacterPortrait extends MovieClip {
const FADE_OUT_FRAMES = 30;
const FADE_IN_FRAMES = 15;
public var char_ref:Character;
public var healthbar:HealthBar;
var animationFrame:PortraitAnimationFrame;
var hasCurseAnim:Boolean;// = false
private var dead:Boolean;
private var hoverEnabled:Boolean;// = false
var hasGainHealthAnim:Boolean;// = false
private var fadeIn:Boolean;// = false
private var selectFX:PortraitSelect;
public var graphic:CharGraphic;
var animationDurationTimer:Timer;
public var powerbar:PowerBar;
var hasLethalAnim:Boolean;// = false
public var nametag:TextField;
private var fadeOut:Boolean;// = false
var isHiding:Boolean;// = false
public var level_glow:LevelUpGlow;
var hasPoisonAnim:Boolean;// = false
var animations:Array;
var hasGainPowerAnim:Boolean;// = false
private var poisoned:Boolean;// = false
var timers:Array;
static const HEALTHBAR_HEIGHT = 58;
public function CharacterPortrait(){
poisoned = false;
level_glow = new LevelUpGlow();
hoverEnabled = false;
isHiding = false;
animations = new Array();
timers = new Array();
hasCurseAnim = false;
hasPoisonAnim = false;
hasLethalAnim = false;
hasGainHealthAnim = false;
hasGainPowerAnim = false;
fadeIn = false;
fadeOut = false;
super();
dead = false;
this.gotoAndStop(1);
this.mouseChildren = false;
addEventListener(Event.ENTER_FRAME, onFrame);
addHoverListeners();
}
public function setClone():void{
var _local1:*;
_local1 = new ClonePortrait();
this.addChild(_local1);
this.addSpecialAnimation(new clone_create_effect(), 1500);
}
public function setShadow():void{
var _local1:*;
_local1 = new ShadowPortrait();
graphic.addChild(_local1);
}
public function setPoisoned(_arg1:Boolean):void{
var _local2:*;
var _local3:*;
var _local4:*;
if (((_arg1) && (!(poisoned)))){
poisoned = true;
_local2 = new LightGreenBar();
_local2.x = healthbar.lightbar.x;
_local2.y = healthbar.lightbar.y;
_local2.height = healthbar.lightbar.height;
_local2.width = healthbar.lightbar.width;
_local2.name = healthbar.lightbar.name;
healthbar.removeChild(healthbar.lightbar);
healthbar.addChild(_local2);
_local2 = new GreenBar();
_local2.x = healthbar.bar.x;
_local2.y = healthbar.bar.y;
_local2.height = healthbar.bar.height;
_local2.width = healthbar.bar.width;
_local2.name = healthbar.bar.name;
healthbar.removeChild(healthbar.bar);
healthbar.addChild(_local2);
} else {
if (((poisoned) && (!(_arg1)))){
poisoned = false;
_local3 = healthbar.getChildByName("bar");
_local4 = healthbar.getChildByName("lightbar");
healthbar.bar.height = _local3.height;
healthbar.lightbar.height = _local4.height;
healthbar.removeChild(_local3);
healthbar.removeChild(_local4);
healthbar.addChild(healthbar.lightbar);
healthbar.addChild(healthbar.bar);
};
};
}
private function mouse_over(_arg1:MouseEvent):void{
mouse_out(null);
if (DungeonMain.portraitHighlight){
selectFX = new PortraitSelect();
selectFX.x = 0;
selectFX.y = 0;
addChild(selectFX);
};
}
function specialAnimationDurationTimerComplete(_arg1:TimerEvent):void{
var _local2:*;
var _local3:MovieClip;
_local2 = getTimerIndex(Timer(_arg1.target));
if (_local2 < 0){
return;
};
_local3 = animations[_local2];
if (_local3 != null){
if (this.contains(_local3)){
this.removeChild(_local3);
};
if ((_local3 is curse_effect)){
hasCurseAnim = false;
};
if ((_local3 is poisoneffect)){
hasPoisonAnim = false;
};
if ((_local3 is lethal_effect)){
hasLethalAnim = false;
};
if ((_local3 is gain_health_effect)){
hasGainHealthAnim = false;
};
if ((_local3 is gain_power_effect)){
hasGainPowerAnim = false;
};
_local3.stop();
animations.splice(_local2, 1);
_local3 = null;
timers.splice(_local2, 1);
};
}
private function removed(_arg1:Event):void{
hoverEnabled = false;
mouse_out(null);
removeEventListener(MouseEvent.MOUSE_OVER, mouse_over);
removeEventListener(MouseEvent.MOUSE_OUT, mouse_out);
removeEventListener(Event.REMOVED_FROM_STAGE, removed);
removeEventListener(Event.ENTER_FRAME, onFrame);
}
public function setNameTag(_arg1:String){
this.nametag.text = _arg1;
}
public function setRetreated():void{
var _local1:RetreatedEffect;
_local1 = new RetreatedEffect();
_local1.x = 0;
_local1.y = 0;
_local1.alpha = 0.5;
_local1.name = "r_effect";
addChild(_local1);
floaterCheck();
fadeOut = true;
}
private function floaterCheck():void{
var _local1:*;
_local1 = getChildByName("floater");
if (_local1 != null){
dmf.childToTop(_local1);
};
}
private function getTimerIndex(_arg1:Timer):int{
var _local2:*;
_local2 = 0;
while (_local2 < timers.length) {
if (timers[_local2] == _arg1){
return (_local2);
};
_local2++;
};
return (-1);
}
public function setHealthPreview(_arg1:int){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_local2 = (char_ref.health - _arg1);
if (_local2 < 0){
_local2 = 0;
};
if (_local2 > char_ref.health_max){
_local2 = char_ref.health_max;
};
_local3 = ((100 / char_ref.health_max) * _local2);
_local4 = healthbar.getChildByName("bar");
_local5 = healthbar.getChildByName("lightbar");
if (_arg1 >= 0){
_local4.height = ((HEALTHBAR_HEIGHT / 100) * _local3);
} else {
_local5.height = Math.round(((HEALTHBAR_HEIGHT / 100) * _local3));
};
}
public function setPowerPreview(_arg1:int){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_local2 = (char_ref.power - _arg1);
if (_local2 < 0){
_local2 = 0;
};
if (_local2 > char_ref.power_max){
_local2 = char_ref.power_max;
};
_local3 = ((100 / char_ref.power_max) * _local2);
_local4 = powerbar.getChildByName("bar");
_local5 = powerbar.getChildByName("lightbar");
if (_arg1 >= 0){
_local4.height = ((HEALTHBAR_HEIGHT / 100) * _local3);
} else {
_local5.height = Math.round(((HEALTHBAR_HEIGHT / 100) * _local3));
};
}
public function setHiding(_arg1:Boolean){
var _local2:*;
if (_arg1){
if (!(isHiding)){
_local2 = new HidingEffect();
_local2.x = 0;
_local2.y = 0;
_local2.alpha = 0.5;
_local2.name = "hiding_effect";
addChild(_local2);
floaterCheck();
};
isHiding = true;
} else {
isHiding = false;
_local2 = getChildByName("hiding_effect");
if (_local2 != null){
removeChild(_local2);
};
};
}
private function mouse_out(_arg1:MouseEvent):void{
if (selectFX != null){
if (this.contains(selectFX)){
removeChild(selectFX);
selectFX = null;
};
};
}
public function update():void{
this.graphic.setChar(char_ref);
this.setPoisoned((char_ref.poisoned > 0));
this.setNameTag(char_ref.charname);
this.updateBars();
}
private function onFrame(_arg1:Event):void{
if (fadeOut){
this.alpha = (this.alpha - (1 / FADE_OUT_FRAMES));
if (this.alpha <= 0){
this.alpha = 0;
fadeOut = false;
if (parent != null){
parent.removeChild(this);
};
};
} else {
if (fadeIn){
this.alpha = (this.alpha + (1 / FADE_IN_FRAMES));
if (this.alpha >= 1){
this.alpha = 1;
fadeIn = false;
};
};
};
}
public function setChar(_arg1:Character, _arg2:Boolean=false){
char_ref = _arg1;
if (!(_arg2)){
update();
};
}
public function setGlow():void{
if (!((char_ref is PlayerCharacter))){
return;
};
if (((PlayerCharacter(char_ref).stat_points) || (PlayerCharacter(char_ref).skill_points))){
if (!(this.contains(level_glow))){
addChildAt(level_glow, 0);
};
} else {
if (this.contains(level_glow)){
removeChild(level_glow);
};
};
}
public function updateBars():void{
if (((dead) && ((char_ref.health > 0)))){
setAlive();
};
setHealth(char_ref.getHealthPercent());
setPower(char_ref.getPowerPercent());
checkStun();
}
function animationDurationTimerComplete(_arg1:TimerEvent):void{
animationDurationTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, animationDurationTimerComplete);
if (this.getChildByName("anim") != null){
this.removeChild(animationFrame);
};
animationFrame = null;
}
public function addAnimationFrame(_arg1:int, _arg2:int=1500){
if (animationFrame != null){
return;
};
animationFrame = new PortraitAnimationFrame(_arg1);
animationFrame.name = "anim";
animationFrame.x = graphic.x;
animationFrame.y = graphic.y;
this.addChild(animationFrame);
floaterCheck();
animationDurationTimer = new Timer(_arg2, 1);
animationDurationTimer.addEventListener(TimerEvent.TIMER_COMPLETE, animationDurationTimerComplete);
animationDurationTimer.start();
}
public function addHoverListeners():void{
if (!(hoverEnabled)){
addEventListener(MouseEvent.MOUSE_OVER, mouse_over);
addEventListener(MouseEvent.MOUSE_OUT, mouse_out);
addEventListener(Event.REMOVED_FROM_STAGE, removed);
hoverEnabled = true;
};
}
public function setHealth(_arg1:Number){
var _local2:*;
var _local3:*;
_local2 = healthbar.getChildByName("bar");
_local2.height = Math.round(((58 / 100) * _arg1));
_local3 = healthbar.getChildByName("lightbar");
_local3.height = Math.round(((58 / 100) * _arg1));
if ((((char_ref.health <= 0)) && (!(dead)))){
this.setDead();
};
}
public function startPowerCostPreview(_arg1:int){
var _local2:*;
_local2 = (char_ref.power - _arg1);
if (_local2 < 0){
return;
};
this.powerbar.bar.height = ((HEALTHBAR_HEIGHT / 100) * _local2);
}
public function setAlive(){
var _local1:*;
dead = false;
_local1 = getChildByName("dead_effect");
if (_local1 != null){
removeChild(_local1);
};
}
public function addPortraitAnimation(_arg1:int):void{
var _local2:MovieClip;
if (!(_arg1)){
return;
};
_local2 = PortraitAnimation.getAnimation(_arg1);
if (_local2 != null){
_local2.gotoAndStop(1);
addSpecialAnimation(_local2);
floaterCheck();
};
_local2 = null;
}
private function addSpecialAnimation(_arg1:MovieClip, _arg2:int=1500){
var _local3:Timer;
var _local4:int;
var _local5:*;
_arg1.x = graphic.x;
_arg1.y = graphic.y;
if ((_arg1 is curse_effect)){
if (!(hasCurseAnim)){
hasCurseAnim = true;
} else {
return;
};
} else {
if ((_arg1 is poisoneffect)){
if (!(hasPoisonAnim)){
hasPoisonAnim = true;
} else {
return;
};
} else {
if ((_arg1 is lethal_effect)){
if (!(hasLethalAnim)){
hasLethalAnim = true;
} else {
return;
};
} else {
if ((_arg1 is gain_health_effect)){
if (!(hasGainHealthAnim)){
hasGainHealthAnim = true;
} else {
return;
};
} else {
if ((_arg1 is gain_power_effect)){
if (!(hasGainPowerAnim)){
hasGainPowerAnim = true;
} else {
return;
};
} else {
if ((_arg1 is player_multi_slash)){
_local4 = dmf.randomNum(-20, 20);
_arg1.rotation = _local4;
} else {
if ((_arg1 is revive_effect)){
_local5 = this.graphic.currentFrame;
revive_effect(_arg1).gfx.gotoAndStop(_local5);
} else {
if ((((_arg1 is player_arrow)) && ((_arg2 == 750)))){
player_arrow(_arg1).spark.x = dmf.randomNum(15, 43);
player_arrow(_arg1).spark.y = dmf.randomNum(15, 43);
};
};
};
};
};
};
};
};
_arg1.gotoAndPlay(1);
this.addChild(_arg1);
_local3 = new Timer(_arg2, 1);
_local3.addEventListener(TimerEvent.TIMER_COMPLETE, specialAnimationDurationTimerComplete, false, 0, true);
_local3.start();
animations.push(_arg1);
timers.push(_local3);
}
public function setPower(_arg1:Number){
this.powerbar.bar.height = ((HEALTHBAR_HEIGHT / 100) * _arg1);
this.powerbar.lightbar.height = ((HEALTHBAR_HEIGHT / 100) * _arg1);
}
public function checkStun():void{
if (!(char_ref.stunned_duration)){
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
};
}
public function setDead(){
var _local1:DeadEffect;
dead = true;
setHealth(0);
_local1 = new DeadEffect();
_local1.x = 0;
_local1.y = 0;
_local1.alpha = 0.5;
_local1.name = "dead_effect";
addChild(_local1);
floaterCheck();
if (char_ref.summoned){
fadeOut = true;
};
}
public function stunAnim():void{
if (!(char_ref.stunned_duration)){
if (((((!((parent == null))) && (!((parent.parent == null))))) && ((parent.parent is EmptyPortrait)))){
EmptyPortrait(parent.parent).gotoAndPlay(2);
};
};
}
public function endPowerCostPreview(){
this.powerbar.bar.height = this.powerbar.lightbar.height;
}
}
}//package
Section 76
//CharCreationPanel (CharCreationPanel)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class CharCreationPanel extends MovieClip {
const animate_frames = 10;
public var charLocked:MovieClip;
var end_y;// = 0
public var portrait_left:SimpleButton;
var portraits:Array;
public var delete_button:SimpleButton;
public var name_text:TextField;
public var customPortraitButton:SimpleButton;
public var portrait_right:SimpleButton;
public var random_name_btn:MovieClip;
var selected_portrait:int;// = 0
public var selected_class:int;// = 1
var lastRandomName:String;
public var gender_icon:MovieClip;
public var theText:TextField;
var char:PlayerCharacter;
var lowered_y;// = 0
var animating;// = false
public var description_text:TextField;
public var portrait:CharGraphic;
public var class_text:TextField;
public var class1:MovieClip;
public var class2:MovieClip;
public var class3:MovieClip;
public var class4:MovieClip;
public var class5:MovieClip;
public var class6:MovieClip;
var frame_count;// = 0
public var class7:MovieClip;
public var skill_preview:SimpleButton;
var start_y;// = 0
var slot:int;// = 1
public function CharCreationPanel():void{
var _local1:*;
var _local2:*;
portraits = new Array();
selected_portrait = 0;
selected_class = 1;
slot = 1;
animating = false;
frame_count = 0;
start_y = 0;
end_y = 0;
lowered_y = 0;
super();
random_name_btn.addEventListener(MouseEvent.MOUSE_DOWN, randomName);
portrait_left.addEventListener(MouseEvent.MOUSE_DOWN, cyclePortrait);
portrait_right.addEventListener(MouseEvent.MOUSE_DOWN, cyclePortrait);
customPortraitButton.addEventListener(MouseEvent.MOUSE_DOWN, showCustomPortraitDialog);
gender_icon.addEventListener(MouseEvent.MOUSE_DOWN, toggleGender);
skill_preview.addEventListener(MouseEvent.MOUSE_DOWN, previewSkills);
_local1 = 1;
while (_local1 <= 7) {
_local2 = getChildByName(("class" + _local1));
_local2.addEventListener(MouseEvent.MOUSE_DOWN, setClass);
_local2.gotoAndStop(_local1);
_local2.bg.gotoAndStop(1);
_local1++;
};
delete_button.addEventListener(MouseEvent.MOUSE_DOWN, deleteChar);
charLocked.logo.addEventListener(MouseEvent.MOUSE_DOWN, kongClick);
setLock(false);
}
public function updateFromChar():void{
name_text.text = char.charname;
}
public function finalize():void{
if (name_text.text != null){
char.charname = name_text.text;
};
char.portrait = portraits[selected_portrait];
}
private function updateClass():void{
var _local1:*;
var _local2:*;
if (selected_class == PlayerCharacter.WARRIOR){
class_text.text = "Warrior";
description_text.text = "Warriors can wear the heaviest armor and excel at combat with melee weapons. They are difficult to kill and good at protecting more vulnerable members of the party.";
} else {
if (selected_class == PlayerCharacter.ROGUE){
class_text.text = "Rogue";
description_text.text = "Rogues inflict high damage in melee combat, but can also do well with a bow. They have many abilities which debilitate their foes. They may wear medium armor.";
} else {
if (selected_class == PlayerCharacter.RANGER){
class_text.text = "Ranger";
description_text.text = "Rangers are masters of ranged weapons and the lore of the wild. They prefer to fight from afar, where they can heal and support their allies. They may wear medium armor.";
} else {
if (selected_class == PlayerCharacter.MAGE){
class_text.text = "Mage";
description_text.text = "Mages use their arcane knowledge to destroy foes from afar and augment their allies. They can inflict a lot of damage, but may wear only the lightest armor.";
} else {
if (selected_class == PlayerCharacter.CLERIC){
class_text.text = "Cleric";
description_text.text = "Clerics are holy warriors who call upon divine powers to heal and support their allies or smite their enemies. They wear heavy armor but their weapon selection is limited.";
} else {
if (selected_class == PlayerCharacter.CONJUROR){
class_text.text = "Conjuror";
description_text.text = "Conjurors are masters of summoning magic, conjuring constructs to aid their allies and vex their enemies as well as calling forth temporary allies. They wear light armor.";
} else {
if (selected_class == PlayerCharacter.BARBARIAN){
class_text.text = "Barbarian";
description_text.text = "Barbarians are reckless, brutal fighters. Favoring melee weapons, they inflict high damage and hinder their enemies' ability to fight effectively. They wear medium armor.";
};
};
};
};
};
};
};
if (((DungeonMain.LOCKED) && ((selected_class == PlayerCharacter.CONJUROR)))){
description_text.text = "";
setLock(true);
} else {
setLock(false);
};
dm.embolden(class_text);
class_text.autoSize = TextFieldAutoSize.CENTER;
theText.x = (class_text.x - 23);
_local1 = 1;
while (_local1 <= 7) {
_local2 = MovieClip(getChildByName(("class" + _local1)));
if (_local1 == selected_class){
_local2.bg.gotoAndStop(2);
} else {
_local2.bg.gotoAndStop(1);
};
_local1++;
};
selected_portrait = (selected_class - 1);
updatePortrait();
}
function previewSkills(_arg1:MouseEvent):void{
var _local2:PlayerCharacter;
var _local3:SkillsPreview;
if (selected_class == PlayerCharacter.WARRIOR){
_local2 = new PC_Warrior();
} else {
if (selected_class == PlayerCharacter.ROGUE){
_local2 = new PC_Rogue();
} else {
if (selected_class == PlayerCharacter.RANGER){
_local2 = new PC_Ranger();
} else {
if (selected_class == PlayerCharacter.MAGE){
_local2 = new PC_Mage();
} else {
if (selected_class == PlayerCharacter.CLERIC){
_local2 = new PC_Cleric();
} else {
if (selected_class == PlayerCharacter.CONJUROR){
_local2 = new PC_Conjuror();
} else {
if (selected_class == PlayerCharacter.BARBARIAN){
_local2 = new PC_Barbarian();
} else {
return;
};
};
};
};
};
};
};
_local3 = new SkillsPreview(_local2);
stage.addChild(_local3);
}
function cycleClass(_arg1:MouseEvent):void{
var _local2:SelectArrow;
if ((_arg1.currentTarget is SelectArrow)){
_local2 = SelectArrow(_arg1.currentTarget);
} else {
return;
};
_local2.clicked();
if (_local2.name == "class_left"){
selected_class--;
if (selected_class < 1){
selected_class = 5;
};
} else {
if (_local2.name == "class_right"){
selected_class++;
if (selected_class > 7){
selected_class = 1;
};
};
};
updateClass();
}
function setClass(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
_local2 = 1;
while (_local2 <= 7) {
_local3 = getChildByName(("class" + _local2));
if (_local3 == null){
} else {
if (_arg1.currentTarget == _local3){
selected_class = _local2;
};
};
_local2++;
};
updateClass();
}
private function updatePortraitsArray():void{
var _local1:int;
portraits.length = 0;
_local1 = 0;
if (char.male){
_local1 = 1;
while (_local1 <= 12) {
portraits.push(_local1);
_local1++;
};
} else {
_local1 = 14;
while (_local1 <= 21) {
portraits.push(_local1);
_local1++;
};
};
}
public function createChar(_arg1:MouseEvent=null):void{
char = new PlayerCharacter();
gender_icon.gotoAndStop("male");
if (dmf.randomNum(0, 99) < 25){
toggleGender(null);
};
randomName();
if (this.slot == 4){
selected_class = dmf.randomNum(4, 6);
} else {
selected_class = this.slot;
};
selected_portrait = (selected_class - 1);
updatePortraitsArray();
updatePortrait();
updateClass();
}
function cyclePortrait(_arg1:MouseEvent):void{
var _local2:SelectArrow;
if ((_arg1.currentTarget is SelectArrow)){
_local2 = SelectArrow(_arg1.currentTarget);
} else {
return;
};
if (_local2.name == "portrait_left"){
selected_portrait--;
if (selected_portrait < 0){
selected_portrait = (portraits.length - 1);
};
} else {
if (_local2.name == "portrait_right"){
selected_portrait++;
if (selected_portrait > (portraits.length - 1)){
selected_portrait = 0;
};
};
};
updatePortrait();
}
public function cleanup():void{
var _local1:*;
var _local2:*;
_local1 = 1;
while (_local1 <= 7) {
_local2 = getChildByName(("char" + _local1));
if (_local2 == null){
} else {
_local2.removeEventListener(MouseEvent.MOUSE_DOWN, setClass);
};
_local1++;
};
random_name_btn.removeEventListener(MouseEvent.MOUSE_DOWN, randomName);
portrait_left.removeEventListener(MouseEvent.MOUSE_DOWN, cyclePortrait);
portrait_right.removeEventListener(MouseEvent.MOUSE_DOWN, cyclePortrait);
customPortraitButton.removeEventListener(MouseEvent.MOUSE_DOWN, showCustomPortraitDialog);
delete_button.removeEventListener(MouseEvent.MOUSE_DOWN, deleteChar);
skill_preview.removeEventListener(MouseEvent.MOUSE_DOWN, previewSkills);
gender_icon.removeEventListener(MouseEvent.MOUSE_DOWN, toggleGender);
charLocked.logo.removeEventListener(MouseEvent.MOUSE_DOWN, kongClick);
}
private function setLock(_arg1:Boolean):void{
if (_arg1){
if (!(contains(charLocked))){
addChild(charLocked);
};
} else {
if (contains(charLocked)){
removeChild(charLocked);
};
};
}
public function loadCustomPortrait():void{
portrait.setChar(char);
}
function animateFrame(_arg1:Event):void{
var _local2:*;
var _local3:*;
animating = true;
frame_count++;
if ((((frame_count > animate_frames)) || ((this.y == end_y)))){
removeEventListener(Event.ENTER_FRAME, animateFrame);
animating = false;
return;
};
_local2 = (end_y - start_y);
_local3 = (_local2 / animate_frames);
this.y = (start_y + (frame_count * _local3));
}
private function showCustomPortraitDialog(_arg1:MouseEvent):void{
var _local2:*;
_local2 = new CustomPortraitDialog(char, this);
stage.addChild(_local2);
}
function toggleGender(_arg1:MouseEvent):void{
if (char.male){
char.male = false;
gender_icon.gotoAndStop("female");
} else {
char.male = true;
gender_icon.gotoAndStop("male");
};
selected_portrait = (selected_class - 1);
updatePortraitsArray();
updatePortrait();
if (name_text.text == lastRandomName){
randomName();
};
}
private function kongClick(_arg1:MouseEvent):void{
dmf.link(Links.KONG_GAME);
}
private function updatePortrait():void{
if (!(portraits.length)){
return;
};
char.useCustomPortrait = false;
portrait.setFrame(portraits[selected_portrait]);
char.portrait = portraits[selected_portrait];
}
function deleteChar(_arg1:MouseEvent):void{
var _local2:*;
char = null;
if (parent != null){
_local2 = parent.getChildByName(("empty" + slot));
if (_local2 != null){
_local2.y = this.y;
};
this.y = -200;
};
}
function randomName(_arg1:MouseEvent=null):void{
var _local2:int;
var _local3:String;
var _local4:*;
_local2 = 0;
_local3 = "";
_local4 = name_text.text;
while ((((char.charname == null)) || ((((char.charname == _local4)) && ((_local2 < 100)))))) {
_local3 = PlayerCharacter.randomName(char.male);
if (!(PartyCreation(parent).isNameTaken(_local3))){
char.charname = _local3;
};
_local2++;
};
if (_local4 != _local3){
lastRandomName = _local3;
};
name_text.text = char.charname;
}
}
}//package
Section 77
//CharGraphic (CharGraphic)
package {
import flash.events.*;
import flash.display.*;
public class CharGraphic extends MovieClip {
private var customPortrait:Bitmap;
public var char_ref:Character;
private var frame:int;
public var custom:Boolean;// = false
static const whirlwind = 89;
static const sprite_green = 79;
static const vampire = 25;
static const dreadfather = 96;
static const dragon = 44;
static const sprite_red = 78;
static const dwarf_scarred = 64;
static const zombie = 21;
static const golem = 81;
static const warrior1 = 4;
static const poison_drake = 48;
static const fearSower = 95;
static const loading = 76;
static const cult_neophyte = 58;
static const dwarf_crossbow = 63;
static const skeleton = 23;
static const empty = 74;
static const wolf = 80;
static const blank = 75;
static const dwarf_veteran = 65;
static const orc_woman = 39;
static const adventurer = 70;
static const orc_shaman = 37;
static const dwarf_fruit = 66;
static const lightning_drake = 49;
static const cult_warrior = 51;
static const orc_warlord = 35;
static const voidstalker = 59;
static const aetherguard = 54;
static const bone_horror = 29;
static const satyr = 94;
static const dwarf_warlord = 67;
static const ghost = 22;
static const sprite_blue = 77;
static const rogue1 = 5;
static const hydraHead1 = 90;
static const hydraHead2 = 91;
static const lich = 28;
static const hydraBody = 73;
static const cult_engine = 57;
static const orc_juggernaut = 36;
static const beholder = 45;
static const skeleton_archer = 24;
static const minotaur = 72;
static const death_knight = 26;
static const barbarian1 = 7;
static const gorgon = 71;
static const necromancer = 27;
static const cleric1 = 2;
static const greebler = 47;
static const conjuror1 = 6;
static const arachnoid = 43;
static const goblin = 33;
static const dwarf_maniac = 61;
static const ascendant = 55;
static const cult_chosen = 56;
static const orc = 31;
static const dwarf_warrior = 62;
static const orc_champion = 38;
static const basilisk = 42;
static const demon = 60;
static const dwarf_runesmith = 68;
static const cult_archer = 52;
static const troll = 32;
static const goblin_archer = 34;
static const cult_priest = 53;
static const gargoyle = 46;
static const ranger1 = 1;
static const mage1 = 3;
public function CharGraphic(_arg1:int=1){
custom = false;
super();
addFrameScript(0, frame1);
setFrame(_arg1);
}
public function setChar(_arg1:Character, _arg2:Boolean=false):void{
var _local3:CustomPortrait;
this.char_ref = _arg1;
if (_arg1.useCustomPortrait){
if (_arg1.customLoading){
setFrame(loading);
};
if (((_arg2) || ((_arg1.customPortrait == null)))){
_local3 = new CustomPortrait(_arg1.customPortraitUrl, addCustomPortrait, addCustomFailed, _arg1);
} else {
addCustomPortrait(_arg1.customPortrait);
};
} else {
custom = false;
removeCustomPortrait();
setFrame(_arg1.portrait);
};
}
public function setFrame(_arg1:int){
this.frame = _arg1;
this.gotoAndStop(_arg1);
}
public function addCustomPortrait(_arg1:BitmapData, _arg2:Character=null):void{
if (((!((_arg2 == null))) && (!((_arg2 == char_ref))))){
return;
};
removeCustomPortrait();
custom = true;
setFrame(blank);
customPortrait = new Bitmap(_arg1);
customPortrait.smoothing = true;
customPortrait.width = 58;
customPortrait.height = 58;
customPortrait.x = 0;
customPortrait.y = 0;
addChild(customPortrait);
}
function frame1(){
this.stop();
}
public function addCustomFailed(_arg1:Character=null):void{
if (((!((_arg1 == null))) && (!((_arg1 == char_ref))))){
return;
};
removeCustomPortrait();
setFrame(empty);
custom = false;
}
private function removed(_arg1:Event):void{
removeCustomPortrait();
}
private function removeCustomPortrait():void{
if (customPortrait == null){
return;
};
if (this.contains(customPortrait)){
removeChild(customPortrait);
};
customPortrait = null;
}
}
}//package
Section 78
//CharInfoPanel (CharInfoPanel)
package {
import flash.events.*;
import flash.display.*;
public class CharInfoPanel extends MovieClip {
public var stats_tab:InventoryTab;
public var skills_tab:InventoryTab;
var char_ref:PlayerCharacter;
public var stats_panel:CharStatsPanel;
public var skills_panel:CharSkillsPanel;
public function CharInfoPanel(_arg1:PlayerCharacter=null){
var _local2:uint;
super();
char_ref = _arg1;
if (_arg1 != null){
setChar(_arg1);
};
stats_tab.tab_text.text = "Statistics";
stats_tab.gotoAndStop(1);
stats_tab.addEventListener(MouseEvent.MOUSE_DOWN, clickStatsTab);
_local2 = (numChildren - 1);
setChildIndex(stats_tab, _local2);
skills_tab.tab_text.text = "Skills";
skills_tab.gotoAndStop(2);
skills_tab.addEventListener(MouseEvent.MOUSE_DOWN, clickSkillsTab);
removeChild(skills_panel);
}
public function setChar(_arg1:PlayerCharacter){
var _local2:uint;
if (_arg1 == null){
return;
};
char_ref = _arg1;
stats_panel.char_ref = _arg1;
skills_panel.char_ref = _arg1;
updateValues();
if (parent){
_local2 = (parent.numChildren - 1);
parent.setChildIndex(this, _local2);
};
}
function clickStatsTab(_arg1:MouseEvent):void{
dm.childToTop(stats_tab);
stats_tab.gotoAndStop(1);
if (!(this.contains(stats_panel))){
addChild(stats_panel);
};
if (this.contains(skills_panel)){
removeChild(skills_panel);
};
dm.childToTop(stats_panel);
skills_tab.gotoAndStop(2);
updateTabFlashes();
}
public function updateValues():void{
stats_panel.updateValues();
skills_panel.updateValues();
updateTabFlashes();
if (((!((parent == null))) && ((parent is Inventory)))){
Inventory(parent).updateStats();
};
}
function clickSkillsTab(_arg1:MouseEvent):void{
dm.childToTop(skills_tab);
skills_tab.gotoAndStop(1);
if (this.contains(stats_panel)){
removeChild(stats_panel);
};
if (!(this.contains(skills_panel))){
addChild(skills_panel);
};
dm.childToTop(skills_panel);
stats_tab.gotoAndStop(2);
updateTabFlashes();
}
public function cleanup():void{
stats_tab.removeEventListener(MouseEvent.MOUSE_DOWN, clickStatsTab);
skills_tab.removeEventListener(MouseEvent.MOUSE_DOWN, clickSkillsTab);
stats_panel.cleanup();
skills_panel.cleanup();
}
private function updateTabFlashes():void{
stats_tab.setFlasher((char_ref.stat_points > 0));
skills_tab.setFlasher((char_ref.skill_points > 0));
}
}
}//package
Section 79
//CharSkillsPanel (CharSkillsPanel)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class CharSkillsPanel extends Sprite {
public var idle3:SkillIconEmpty;
public var active2:SkillIconEmpty;
public var active3:SkillIconEmpty;
var dragged_icon:SkillIcon;
public var idle10:SkillIconEmpty;
public var idle4:SkillIconEmpty;
public var idle7:SkillIconEmpty;
public var passiveDefense:PassiveSkillIcon;
var char_ref:PlayerCharacter;
public var newskills_button:TextField;
public var idle8:SkillIconEmpty;
var dragging:Boolean;// = false
public var skillpoints_number:TextField;
public var passiveOffense:PassiveSkillIcon;
var start_drag_x;// = 0
var start_drag_y;// = 0
public var idle1:SkillIconEmpty;
public var idle2:SkillIconEmpty;
var num_active:int;// = 0
public var idle6:SkillIconEmpty;
public var active1:SkillIconEmpty;
var num_idle:int;// = 0
public var active4:SkillIconEmpty;
public var active5:SkillIconEmpty;
public var active6:SkillIconEmpty;
public var idle5:SkillIconEmpty;
public var idle9:SkillIconEmpty;
public function CharSkillsPanel(_arg1:PlayerCharacter=null){
start_drag_x = 0;
start_drag_y = 0;
dragging = false;
num_idle = 0;
num_active = 0;
super();
char_ref = _arg1;
newskills_button.addEventListener(MouseEvent.MOUSE_DOWN, buySkillsClick);
if (_arg1 != null){
updateValues();
};
}
function buySkillsClick(_arg1:MouseEvent):void{
var _local2:*;
_local2 = new BuySkills(CharInfoPanel(parent));
_local2.setChar(char_ref);
stage.addChild(_local2);
}
private function getActiveSkillInPosition(_arg1:int):Skill{
var _local2:*;
_local2 = 0;
while (_local2 < char_ref.skills.length) {
if (((char_ref.skills[_local2].active) && ((char_ref.skills[_local2].position == _arg1)))){
return (char_ref.skills[_local2]);
};
_local2++;
};
return (null);
}
private function removeSkillIcons():void{
var _local1:*;
var _local2:*;
_local1 = 0;
num_active = 0;
num_idle = 0;
_local1 = 0;
while (_local1 < 6) {
_local2 = getChildByName(("icon_active" + (_local1 + 1)));
removeIcon(_local2);
_local1++;
};
_local1 = 0;
while (_local1 < 10) {
_local2 = getChildByName(("icon_idle" + (_local1 + 1)));
removeIcon(_local2);
_local1++;
};
}
function startItemDragging(_arg1:MouseEvent):void{
var _local2:SkillIcon;
var _local3:uint;
var _local4:*;
if (((!((_arg1.currentTarget.parent == null))) && ((_arg1.currentTarget.parent is SkillIcon)))){
_local2 = _arg1.currentTarget.parent;
} else {
return;
};
_local3 = (numChildren - 1);
setChildIndex(_local2, _local3);
start_drag_x = _local2.x;
start_drag_y = _local2.y;
_local2.startDrag();
dragging = true;
dragged_icon = _local2;
_local4 = _local2.tooltip;
if (_local4 != null){
_local2.mouseOutTarget(null);
};
}
private function removeIcon(_arg1:SkillIcon):void{
if (_arg1 == null){
return;
};
if (this.contains(_arg1)){
removeChild(_arg1);
};
_arg1.bg.removeEventListener(MouseEvent.MOUSE_DOWN, startItemDragging);
_arg1.bg.removeEventListener(MouseEvent.MOUSE_UP, stopItemDragging);
_arg1.bg.removeEventListener(MouseEvent.DOUBLE_CLICK, mouseDblClickSkill);
_arg1.cleanup();
}
public function updateValues(){
var _local1:*;
var _local2:Skill;
var _local3:SkillIcon;
var _local4:*;
var _local5:*;
if (char_ref == null){
return;
};
skillpoints_number.text = String(char_ref.skill_points);
passiveOffense.updateSkill(char_ref, true);
passiveDefense.updateSkill(char_ref, false);
removeSkillIcons();
setDefaultAttack();
_local4 = 0;
for (;_local4 < char_ref.skills.length;_local4++) {
_local2 = char_ref.skills[_local4];
if (_local2 == null){
} else {
if (!(_local2.unlocked)){
} else {
if (num_active >= 6){
_local2.active = false;
};
if (_local2.active){
_local1 = getChildByName(("active" + _local2.position));
if (_local1 == null){
continue;
};
_local3 = new SkillIcon();
_local3.setSkill(_local2);
_local3.setOwner(char_ref);
_local3.x = _local1.x;
_local3.y = _local1.y;
_local3.name = ("icon_active" + _local2.position);
addChild(_local3);
_local3.bg.addEventListener(MouseEvent.MOUSE_DOWN, startItemDragging);
_local3.bg.addEventListener(MouseEvent.MOUSE_UP, stopItemDragging);
_local3.bg.doubleClickEnabled = true;
_local3.bg.addEventListener(MouseEvent.DOUBLE_CLICK, mouseDblClickSkill);
_local3.setUsable(_local3.skill_ref.usable(true));
num_active++;
} else {
_local1 = getChildByName(("idle" + (num_idle + 1)));
if (_local1 == null){
} else {
_local3 = new SkillIcon();
_local3.setSkill(_local2);
_local3.setOwner(char_ref);
_local3.x = _local1.x;
_local3.y = _local1.y;
addChild(_local3);
_local3.name = ("icon_idle" + (num_idle + 1));
_local3.bg.addEventListener(MouseEvent.MOUSE_DOWN, startItemDragging);
_local3.bg.addEventListener(MouseEvent.MOUSE_UP, stopItemDragging);
_local3.bg.doubleClickEnabled = true;
_local3.bg.addEventListener(MouseEvent.DOUBLE_CLICK, mouseDblClickSkill);
_local3.setUsable(_local3.skill_ref.usable(true));
num_idle++;
};
};
};
};
};
}
function mouseDblClickSkill(_arg1:MouseEvent):void{
var _local2:SkillIcon;
if (_arg1.currentTarget.parent == null){
return;
};
if (!((_arg1.currentTarget.parent is SkillIcon))){
return;
};
_local2 = SkillIcon(_arg1.currentTarget.parent);
if (_local2.skill_ref.active){
_local2.skill_ref.active = false;
updateValues();
} else {
if (num_active < 6){
_local2.skill_ref.active = true;
_local2.skill_ref.position = lowestAvailablePosition();
updateValues();
};
};
}
private function lowestAvailablePosition():int{
var _local1:*;
var _local2:*;
_local2 = 1;
while (_local2 <= 6) {
if (getChildByName(("icon_active" + _local2)) == null){
return (_local2);
};
_local2++;
};
return (-1);
}
public function cleanup():void{
newskills_button.removeEventListener(MouseEvent.MOUSE_DOWN, buySkillsClick);
removeSkillIcons();
}
private function setDefaultAttack():void{
var _local1:*;
var _local2:*;
_local1 = char_ref.gear[Equipment.weapon];
_local2 = 1;
if (char_ref.skills[0] != null){
_local2 = char_ref.skills[0].position;
};
if (_local1 != null){
if ((_local1 is MeleeWeapon)){
char_ref.skills[0] = new sWeaponAttack(char_ref);
} else {
if ((_local1 is RangedWeapon)){
char_ref.skills[0] = new sRangedAttack(char_ref);
} else {
if ((_local1 is MageWeapon)){
char_ref.skills[0] = new sMageAttack(char_ref);
};
};
};
} else {
char_ref.skills[0] = new sUnarmedAttack(char_ref);
};
char_ref.skills[0].active = true;
char_ref.skills[0].position = _local2;
}
function stopItemDragging(_arg1:MouseEvent):void{
var _local2:*;
var _local3:SkillIcon;
var _local4:*;
_local2 = 0;
_local3 = _arg1.currentTarget.parent;
if (_local3 == null){
return;
};
if (!((_local3 is SkillIcon))){
return;
};
_arg1.currentTarget.stopDrag();
if (!(dragging)){
return;
};
dragging = false;
if ((((_local3.x == start_drag_x)) && ((_local3.y == start_drag_y)))){
return;
};
_local4 = _local3.dropTarget.parent;
if (_local4 == null){
return;
};
if (_local4.name == "bg"){
_local4 = _local4.parent;
if (_local4 == null){
return;
};
};
if ((_local4 is SkillIcon)){
if (_local4.name.search("idle") > -1){
if (_local3.skill_ref.active){
if (_local3.skill_ref == char_ref.skills[0]){
updateValues();
return;
};
_local3.skill_ref.active = false;
SkillIcon(_local4).skill_ref.position = _local3.skill_ref.position;
SkillIcon(_local4).skill_ref.active = true;
};
updateValues();
} else {
if (_local4.name.search("active") > -1){
if (_local3.skill_ref.active){
_local2 = _local3.skill_ref.position;
_local3.skill_ref.position = SkillIcon(_local4).skill_ref.position;
SkillIcon(_local4).skill_ref.position = _local2;
updateValues();
} else {
if (SkillIcon(_local4).skill_ref == char_ref.skills[0]){
updateValues();
return;
};
_local3.skill_ref.position = SkillIcon(_local4).skill_ref.position;
_local3.skill_ref.active = true;
SkillIcon(_local4).skill_ref.active = false;
updateValues();
};
};
};
} else {
if ((_local4 is SkillIconEmpty)){
_local3.x = _local4.x;
_local3.y = _local4.y;
if (_local4.name.search("idle") > -1){
if (_local3.skill_ref == char_ref.skills[0]){
updateValues();
return;
};
if (_local3.skill_ref.active){
_local3.skill_ref.active = false;
updateValues();
};
} else {
if (_local4.name.search("active") > -1){
_local3.skill_ref.active = true;
_local3.skill_ref.position = _local4.name.charAt((_local4.name.length - 1)).valueOf();
updateValues();
};
};
} else {
updateValues();
};
};
}
}
}//package
Section 80
//CharStatsPanel (CharStatsPanel)
package {
import flash.events.*;
import flash.display.*;
public class CharStatsPanel extends Sprite {
const color_green:uint = 52275;
const color_white:uint = 0xFFFFFF;
const color_red:uint = 0xE90000;
public var dexterity_inc:StatIncreaseButton;
public var healthRegen_number:StatNumber;
public var str_number:StatNumber;
public var damage_number:StatNumber;
public var poisonResist_number:StatNumber;
public var quickness_number:StatNumber;
public var end_number:StatNumber;
var char_ref:PlayerCharacter;
public var powerRegen_number:StatNumber;
public var lethality_number:StatNumber;
public var armor_number:StatNumber;
public var accuracy_number:StatNumber;
public var dex_number:StatNumber;
public var statpoints_number:StatNumber;
public var undo_btn:SimpleButton;
public var reduction_number:StatNumber;
public var int_number:StatNumber;
public var intellect_inc:StatIncreaseButton;
public var stunResist_number:StatNumber;
public var endurance_inc:StatIncreaseButton;
public var stun_number:StatNumber;
public var blind_number:StatNumber;
public var vampiric_number:StatNumber;
public var poison_number:StatNumber;
public var reflection_number:StatNumber;
public var strength_inc:StatIncreaseButton;
public function CharStatsPanel(_arg1:PlayerCharacter=null){
char_ref = _arg1;
strength_inc.addEventListener(MouseEvent.MOUSE_DOWN, statClick);
endurance_inc.addEventListener(MouseEvent.MOUSE_DOWN, statClick);
dexterity_inc.addEventListener(MouseEvent.MOUSE_DOWN, statClick);
intellect_inc.addEventListener(MouseEvent.MOUSE_DOWN, statClick);
undo_btn.addEventListener(MouseEvent.MOUSE_DOWN, undoClick);
undo_btn.useHandCursor = false;
if (this.contains(undo_btn)){
this.removeChild(undo_btn);
};
if (_arg1 != null){
updateValues();
};
}
function undoClick(_arg1:MouseEvent):void{
char_ref.stat_points = char_ref.old_stat_points;
char_ref.strength = char_ref.old_strength;
char_ref.endurance = char_ref.old_endurance;
char_ref.dexterity = char_ref.old_dexterity;
char_ref.intellect = char_ref.old_intellect;
if (((!((parent == null))) && ((parent is CharInfoPanel)))){
CharInfoPanel(parent).updateValues();
} else {
updateValues();
};
if (this.contains(undo_btn)){
this.removeChild(undo_btn);
};
}
public function updateValues(){
var _local1:*;
var _local2:*;
if (char_ref == null){
return;
};
if (char_ref.stat_points){
enableButtons();
} else {
disableButtons();
};
if (char_ref.stat_points == char_ref.old_stat_points){
if (this.contains(undo_btn)){
this.removeChild(undo_btn);
};
} else {
if (!(this.contains(undo_btn))){
this.addChild(undo_btn);
};
};
str_number.nlabel.text = String(char_ref.getStrength());
end_number.nlabel.text = String(char_ref.getEndurance());
dex_number.nlabel.text = String(char_ref.getDexterity());
int_number.nlabel.text = String(char_ref.getIntellect());
statpoints_number.nlabel.text = String(char_ref.stat_points);
accuracy_number.nlabel.text = (String(char_ref.getAccuracy()) + "%");
quickness_number.nlabel.text = String(char_ref.getQuickness());
damage_number.nlabel.text = String(char_ref.getWeaponDamage());
armor_number.nlabel.text = String(char_ref.getArmorRating());
reduction_number.nlabel.text = (String(char_ref.getDamageResist()) + "%");
poisonResist_number.nlabel.text = (String(char_ref.getPoisonResist()) + "%");
stunResist_number.nlabel.text = (String(char_ref.getStunResist()) + "%");
healthRegen_number.nlabel.text = String(char_ref.getHealthRegen());
powerRegen_number.nlabel.text = String(char_ref.getPowerRegen());
vampiric_number.nlabel.text = (String(char_ref.getVampiric()) + "%");
stun_number.nlabel.text = (String(char_ref.getStunChance()) + "%");
poison_number.nlabel.text = String(char_ref.getPoisonDamage());
blind_number.nlabel.text = String(char_ref.getAccuracyDamage());
lethality_number.nlabel.text = (String(char_ref.getLethality()) + "%");
reflection_number.nlabel.text = (String(char_ref.getDamageReflection()) + "%");
reduction_number.nlabel.textColor = color_white;
damage_number.nlabel.textColor = color_white;
poisonResist_number.nlabel.textColor = color_white;
stunResist_number.nlabel.textColor = color_white;
quickness_number.nlabel.textColor = color_white;
if (char_ref.potion_damage_resist){
reduction_number.nlabel.textColor = color_green;
};
if (char_ref.potion_damage_bonus){
damage_number.nlabel.textColor = color_green;
};
if (char_ref.potion_poison_resist){
poisonResist_number.nlabel.textColor = color_green;
};
if (char_ref.potion_stun_resist){
stunResist_number.nlabel.textColor = color_green;
};
if (char_ref.potion_quickness_bonus){
quickness_number.nlabel.textColor = color_green;
};
str_number.tt_title = "Strength";
end_number.tt_title = "Endurance";
dex_number.tt_title = "Dexterity";
int_number.tt_title = "Intellect";
statpoints_number.tt_title = "Stat Points";
accuracy_number.tt_title = "Accuracy";
quickness_number.tt_title = "Quickness";
damage_number.tt_title = "Weapon Damage";
armor_number.tt_title = "Armor Rating";
reduction_number.tt_title = "Damage Reduction";
poisonResist_number.tt_title = "Poison Resistance";
stunResist_number.tt_title = "Stun Resistance";
healthRegen_number.tt_title = "Health Regeneration";
powerRegen_number.tt_title = "Power Regeneration";
vampiric_number.tt_title = "Health Drain on Hit";
stun_number.tt_title = "Cause Stun on Hit";
poison_number.tt_title = "Poison Damage on Hit";
blind_number.tt_title = "Accuracy Damage on Hit";
lethality_number.tt_title = "Instant Kill on Hit";
reflection_number.tt_title = "Damage Reflection";
str_number.tt_text = "Increases damage done with melee weapons.";
end_number.tt_text = "Increases total health points.";
dex_number.tt_text = "Increases damage done with ranged weapons.";
int_number.tt_text = "Increases the effectiveness of magic.";
statpoints_number.tt_text = "You may spend Stat Points to increase one of the character's four main statistics: Strength, Endurance, Dexterity or Intellect. A character gains three extra Stat Points each time they level up.";
accuracy_number.tt_text = "Chance to hit with attacks in combat. Higher accuracy is always better, as it helps counteract Blind effects.";
quickness_number.tt_text = "Determines turn order in combat. Characters with higher Quickness act sooner.";
armor_number.tt_text = "The total of the Armor Rating on all the character's equipment. A higher armor rating grants a greater level of incoming damage reduction.";
reduction_number.tt_text = "Damage the character receives is reduced by this amount.";
poisonResist_number.tt_text = "Percentage reduction in the damage received from poison effects.";
stunResist_number.tt_text = "Percentage chance of resisting stun effects.";
healthRegen_number.tt_text = "Health regenerated during combat at the start of the character's turn.";
powerRegen_number.tt_text = "Power regenerated during combat at the start of the character's turn.";
vampiric_number.tt_text = "Damaging hits will return this percentage of damage caused back to the character as restored health. Vampiric effects cannot return more than half your total health in one turn.";
stun_number.tt_text = "Percentage chance that damaging hits will stun the target. If attacking multiple targets or multiple times, the chance is divided amongst all targets.";
poison_number.tt_text = "Damaging hits will add this amount of ongoing poison damage to the target. If attacking multiple targets or multiple times, the effect is divided amongst all targets.";
blind_number.tt_text = "On a damaging hit, the target's accuracy is reduced by up to this amount. If attacking multiple targets or multiple times, the effect is divided amongst all targets.";
lethality_number.tt_text = "Percentage chance that damaging hits will instantly kill the target. If attacking multiple targets or multiple times, the chance is divided amongst all targets.";
reflection_number.tt_text = "This percentage of damage received is inflicted on the attacker.";
damage_number.tt_text = "Damage for basic weapon attacks.";
if (char_ref.gear[Equipment.weapon]){
_local1 = 0;
_local2 = "stat";
damage_number.tt_text = (damage_number.tt_text + (("\n\n" + char_ref.gear[Equipment.weapon].damage) + " (weapon)"));
if ((char_ref.gear[Equipment.weapon] is iDagger)){
_local1 = (char_ref.getStrengthDamageBonus() + char_ref.getDexterityDamageBonus());
_local2 = "strength+dexterity";
} else {
if ((char_ref.gear[Equipment.weapon] is MeleeWeapon)){
_local1 = char_ref.getStrengthDamageBonus();
_local2 = "strength";
} else {
if ((char_ref.gear[Equipment.weapon] is RangedWeapon)){
_local1 = char_ref.getDexterityDamageBonus();
_local2 = "dexterity";
} else {
if ((char_ref.gear[Equipment.weapon] is MageWeapon)){
_local1 = char_ref.getIntellectDamageBonus();
_local2 = "intellect";
};
};
};
};
damage_number.tt_text = (damage_number.tt_text + ((((" + " + _local1) + " (") + _local2) + " bonus)\n"));
} else {
damage_number.tt_text = (("Base damage for attacks.\n\n " + char_ref.getUnarmedDamage()) + " (strength bonus)");
};
}
private function disableButtons():void{
strength_inc.gotoAndStop(2);
endurance_inc.gotoAndStop(2);
dexterity_inc.gotoAndStop(2);
intellect_inc.gotoAndStop(2);
}
private function enableButtons():void{
strength_inc.gotoAndStop(1);
endurance_inc.gotoAndStop(1);
dexterity_inc.gotoAndStop(1);
intellect_inc.gotoAndStop(1);
}
public function cleanup():void{
strength_inc.removeEventListener(MouseEvent.MOUSE_DOWN, statClick);
endurance_inc.removeEventListener(MouseEvent.MOUSE_DOWN, statClick);
dexterity_inc.removeEventListener(MouseEvent.MOUSE_DOWN, statClick);
intellect_inc.removeEventListener(MouseEvent.MOUSE_DOWN, statClick);
undo_btn.removeEventListener(MouseEvent.MOUSE_DOWN, undoClick);
strength_inc.cleanup();
endurance_inc.cleanup();
dexterity_inc.cleanup();
intellect_inc.cleanup();
str_number.cleanup();
end_number.cleanup();
dex_number.cleanup();
int_number.cleanup();
statpoints_number.cleanup();
accuracy_number.cleanup();
quickness_number.cleanup();
armor_number.cleanup();
reduction_number.cleanup();
reflection_number.cleanup();
poisonResist_number.cleanup();
stunResist_number.cleanup();
healthRegen_number.cleanup();
powerRegen_number.cleanup();
vampiric_number.cleanup();
poison_number.cleanup();
blind_number.cleanup();
lethality_number.cleanup();
damage_number.cleanup();
}
function statClick(_arg1:MouseEvent):void{
var _local2:*;
var _local3:int;
_local2 = false;
if (!(char_ref.stat_points)){
disableButtons();
return;
};
_local3 = 1;
if (_arg1.shiftKey){
_local3 = char_ref.stat_points;
} else {
if (_arg1.ctrlKey){
_local3 = Math.floor(((char_ref.stat_points / 3) * 2));
};
};
if (_arg1.currentTarget.contains(strength_inc)){
char_ref.strength = (char_ref.strength + _local3);
_local2 = true;
} else {
if (_arg1.currentTarget.contains(endurance_inc)){
char_ref.endurance = (char_ref.endurance + _local3);
_local2 = true;
} else {
if (_arg1.currentTarget.contains(dexterity_inc)){
char_ref.dexterity = (char_ref.dexterity + _local3);
_local2 = true;
} else {
if (_arg1.currentTarget.contains(intellect_inc)){
char_ref.intellect = (char_ref.intellect + _local3);
_local2 = true;
};
};
};
};
if (_local2){
char_ref.stat_points = (char_ref.stat_points - _local3);
if (!(char_ref.stat_points)){
disableButtons();
};
if (((!((parent == null))) && ((parent is CharInfoPanel)))){
CharInfoPanel(parent).updateValues();
} else {
updateValues();
};
if (!(this.contains(undo_btn))){
this.addChild(undo_btn);
};
};
}
}
}//package
Section 81
//CleanSlate (CleanSlate)
package {
public class CleanSlate extends Consumable {
public function CleanSlate(_arg1:int=1){
item_name = "Clean Slate";
lore = "It's not often you get a chance to start over.";
reset_stats = true;
item_rarity = Item.orange;
icon_frame = 84;
}
}
}//package
Section 82
//ClickToScroll (ClickToScroll)
package {
import flash.events.*;
import flash.display.*;
public class ClickToScroll extends MovieClip {
private var _scrolling:Boolean;// = false
public function ClickToScroll():void{
_scrolling = false;
super();
_scrolling = false;
addEventListener(MouseEvent.MOUSE_DOWN, down);
addEventListener(MouseEvent.MOUSE_UP, up);
addEventListener(MouseEvent.MOUSE_OUT, out);
}
public function get scrolling():Boolean{
return (_scrolling);
}
private function out(_arg1:MouseEvent):void{
_scrolling = false;
}
private function down(_arg1:MouseEvent):void{
_scrolling = true;
}
public function cleanup():void{
removeEventListener(MouseEvent.MOUSE_DOWN, down);
removeEventListener(MouseEvent.MOUSE_UP, up);
removeEventListener(MouseEvent.MOUSE_OUT, out);
}
private function up(_arg1:MouseEvent):void{
_scrolling = false;
}
}
}//package
Section 83
//clone_create_effect (clone_create_effect)
package {
import flash.display.*;
public dynamic class clone_create_effect extends MovieClip {
public function clone_create_effect(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.clone);
}
function frame45(){
this.stop();
}
}
}//package
Section 84
//clone_effect (clone_effect)
package {
import flash.display.*;
public dynamic class clone_effect extends MovieClip {
public function clone_effect(){
addFrameScript(44, frame45);
}
function frame45(){
this.stop();
}
}
}//package
Section 85
//ClonePortrait (ClonePortrait)
package {
import flash.display.*;
public dynamic class ClonePortrait extends MovieClip {
}
}//package
Section 86
//coins_sound (coins_sound)
package {
import flash.media.*;
public dynamic class coins_sound extends Sound {
}
}//package
Section 87
//CombatFloater (CombatFloater)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class CombatFloater extends MovieClip {
private const FLOAT_FRAMES:int = 45;
private const Y_DISTANCE:int = 50;
private const FADE_FRAMES:int = 5;
private var text:String;
private var original_y:int;
public var floatText:TextField;
private var frameCount:int;
public function CombatFloater(_arg1:String="Blank"):void{
this.setText(_arg1);
frameCount = 0;
original_y = floatText.y;
addEventListener(Event.ENTER_FRAME, onFrame);
}
public function remove():void{
removeEventListener(Event.ENTER_FRAME, onFrame);
if (parent != null){
parent.removeChild(this);
};
}
public function setText(_arg1:String):void{
this.text = _arg1;
floatText.text = _arg1;
dmf.embolden(floatText);
}
private function onFrame(_arg1:Event):void{
frameCount++;
if (frameCount > FLOAT_FRAMES){
remove();
} else {
floatText.y = (original_y - ((frameCount / FLOAT_FRAMES) * Y_DISTANCE));
if (frameCount > (FLOAT_FRAMES - FADE_FRAMES)){
floatText.alpha = Math.max((floatText.alpha - (1 / FADE_FRAMES)), 0);
};
};
}
}
}//package
Section 88
//confuse_effect (confuse_effect)
package {
import flash.display.*;
public dynamic class confuse_effect extends MovieClip {
}
}//package
Section 89
//Consumable (Consumable)
package {
public class Consumable extends Item {
private var _stack:int;// = 1
var restore_power:int;// = 0
var increase_dexterity:int;// = 0
var poison_resist:int;// = 0
var increase_strength:int;// = 0
var resurrect:Boolean;// = false
var restore_health:int;// = 0
var reset_stats:Boolean;// = false
var stun_resist:int;// = 0
var town_portal:Boolean;// = false
var damage_resist:int;// = 0
var increase_intellect:int;// = 0
var damage_bonus:int;// = 0
var increase_endurance:int;// = 0
var campaign_combiner:Boolean;// = false
var quickness_bonus:int;// = 0
var sneaky:Boolean;// = false
var campaign_portal:Boolean;// = false
public function Consumable(){
_stack = 1;
restore_health = 0;
restore_power = 0;
resurrect = false;
sneaky = false;
reset_stats = false;
town_portal = false;
campaign_combiner = false;
campaign_portal = false;
increase_strength = 0;
increase_dexterity = 0;
increase_endurance = 0;
increase_intellect = 0;
damage_resist = 0;
damage_bonus = 0;
poison_resist = 0;
stun_resist = 0;
quickness_bonus = 0;
super();
item_name = "Consumable";
item_level = 0;
item_rarity = Item.grey;
icon_frame = 1;
}
override public function itemStatsString(_arg1:String):String{
_arg1 = "";
_arg1 = (_arg1 + "Use: ");
if (town_portal){
_arg1 = (_arg1 + "Teleport to the Emporium, to trade equipment and items\n");
};
if (reset_stats){
_arg1 = (_arg1 + "Reset a character's strength, endurance, dexterity and intellect to base amounts for level, recover all spent Stat points.\n\n(Tip: Shift-click on increase button to spend all remaining stat points, ctrl-click to spend 2/3)\n");
};
if (resurrect){
_arg1 = (_arg1 + "Revives a character\n");
};
if (sneaky){
_arg1 = (_arg1 + "Allows the party to pass by one enemy horde without being attacked\n");
};
if (restore_health){
_arg1 = (_arg1 + (("Restores " + restore_health) + "% maximum health\n"));
};
if (restore_power){
_arg1 = (_arg1 + (("Restores " + restore_power) + "% maximum power\n"));
};
if (damage_resist){
_arg1 = (_arg1 + (("Grants +" + damage_resist) + "% damage resistance for next battle\n"));
};
if (damage_bonus){
_arg1 = (_arg1 + (("Grants +" + damage_bonus) + "% bonus damage for next battle\n"));
};
if (stun_resist){
_arg1 = (_arg1 + (("Grants +" + stun_resist) + "% stun resistance for next battle\n"));
};
if (poison_resist){
_arg1 = (_arg1 + (("Grants +" + poison_resist) + "% poison resistance for next battle\n"));
};
if (quickness_bonus){
_arg1 = (_arg1 + (("Grants +" + quickness_bonus) + " quickness for next battle\n"));
};
if (increase_strength){
_arg1 = (_arg1 + (("Permanently increase Strength by " + increase_strength) + "\n"));
};
if (increase_endurance){
_arg1 = (_arg1 + (("Permanently increase Endurance by " + increase_endurance) + "\n"));
};
if (increase_dexterity){
_arg1 = (_arg1 + (("Permanently increase Dexterity by " + increase_dexterity) + "\n"));
};
if (increase_intellect){
_arg1 = (_arg1 + (("Permanently increase Intellect by " + increase_intellect) + "\n"));
};
if (campaign_combiner){
_arg1 = (_arg1 + "Combine nine fragments into a Journeyman's Stone\n");
};
if (campaign_portal){
_arg1 = (_arg1 + "Teleport to the Sanctum, to face the Dreadfather\n");
};
_arg1 = (_arg1 + "\n(Cannot be used in combat)\n");
return (_arg1);
}
public function get stack():int{
return (this._stack);
}
public function set stack(_arg1:int):void{
this._stack = _arg1;
}
public function basicRevivePotion(){
item_name = "Weak Revival Potion";
restore_health = 1;
resurrect = true;
item_rarity = Item.green;
item_level = 1;
icon_frame = 6;
}
public function basicRejuvePotion(){
item_name = "Weak Rejuvenation Potion";
restore_health = 20;
restore_power = 20;
item_rarity = Item.blue;
item_level = 1;
icon_frame = 7;
}
private function preventStatUndo(_arg1:PlayerCharacter):void{
_arg1.old_strength = _arg1.strength;
_arg1.old_endurance = _arg1.endurance;
_arg1.old_dexterity = _arg1.dexterity;
_arg1.old_intellect = _arg1.intellect;
_arg1.old_stat_points = _arg1.stat_points;
}
override public function getItemTypeString(){
return ("Consumable");
}
override public function getWorth():int{
var _local1:Number;
var _local2:*;
_local1 = 50;
_local1 = (_local1 * (1 + ((ITEM_VALUE_INCREASE_PER_LEVEL * item_level) / 100)));
_local2 = Item.blue;
while (_local2 <= item_rarity) {
_local1 = (_local1 * 1.75);
_local2++;
};
return (Math.round(_local1));
}
public function basicPowerPotion(){
item_name = "Weak Power Potion";
restore_power = 20;
item_rarity = Item.green;
item_level = 1;
icon_frame = 5;
}
public function basicHealthPotion(){
item_name = "Weak Healing Potion";
restore_health = 20;
item_rarity = Item.green;
item_level = 1;
icon_frame = 4;
}
public function consume(_arg1:PlayerCharacter, _arg2:Party):Boolean{
var _local3:Boolean;
var _local4:*;
var _local5:*;
var _local6:*;
_local3 = false;
if (campaign_combiner){
if (stack >= 9){
_arg2.addToInventory(new CampaignItemStone());
this.stack = 0;
_local3 = true;
} else {
_local3 = false;
};
};
if (campaign_portal){
if (dm.main != null){
dm.main.goToSanctum();
};
return (true);
};
if (reset_stats){
_arg1.stat_points = ((_arg1.level - 1) * PlayerCharacter.STATS_PER_LEVEL);
_local6 = (1 + ((_arg1.level - 1) * PlayerCharacter.STATS_PER_LEVEL));
_arg1.strength = _local6;
_arg1.endurance = _local6;
_arg1.dexterity = _local6;
_arg1.intellect = _local6;
preventStatUndo(_arg1);
_local3 = true;
};
if (((resurrect) && ((_arg1.health > 0)))){
return (false);
};
if (((sneaky) && ((_arg2.sneaking < 2)))){
_arg2.sneaking = 2;
_local3 = true;
};
if (((restore_health) && (_arg1.increaseHealthByPercentage(restore_health, resurrect)))){
_local3 = true;
};
if (_arg1.health > 0){
if (restore_power){
if (_arg1.increasePower(restore_power)){
_local3 = true;
};
};
if (damage_resist){
_arg1.potion_damage_resist = Math.max(_arg1.potion_damage_resist, damage_resist);
_local3 = true;
};
if (poison_resist){
_arg1.potion_poison_resist = Math.max(_arg1.potion_poison_resist, poison_resist);
_local3 = true;
};
if (stun_resist){
_arg1.potion_stun_resist = Math.max(_arg1.potion_stun_resist, stun_resist);
_local3 = true;
};
if (quickness_bonus){
_arg1.potion_quickness_bonus = Math.max(_arg1.potion_quickness_bonus, quickness_bonus);
_local3 = true;
};
};
if (town_portal){
if (dm.main != null){
dm.main.goToShop();
};
_local3 = true;
};
if (increase_strength){
_arg1.strength = (_arg1.strength + increase_strength);
preventStatUndo(_arg1);
_local3 = true;
};
if (increase_endurance){
_arg1.endurance = (_arg1.endurance + increase_endurance);
preventStatUndo(_arg1);
_local3 = true;
};
if (increase_dexterity){
_arg1.dexterity = (_arg1.dexterity + increase_dexterity);
preventStatUndo(_arg1);
_local3 = true;
};
if (increase_intellect){
_arg1.intellect = (_arg1.intellect + increase_intellect);
preventStatUndo(_arg1);
_local3 = true;
};
if (_local3){
this.stack--;
if (this.stack <= 0){
_local4 = 0;
while (_local4 < Party.MAX_INVENTORY) {
if (_arg2.inventory[_local4] == this){
_arg2.inventory.splice(_local4, 1);
};
_local4++;
};
_local4 = 0;
while (_local4 < Party.MAX_OVERFLOW) {
if (_arg2.overflow[_local4] == this){
_arg2.overflow.splice(_local4, 1);
};
_local4++;
};
};
};
return (_local3);
}
}
}//package
Section 90
//CorridorConnectorH (CorridorConnectorH)
package {
import flash.display.*;
public class CorridorConnectorH extends DoorIcon {
public var gfx:MovieClip;
public var tint:MovieClip;
public function CorridorConnectorH(){
this.gotoAndStop(1);
}
override public function setAlpha(_arg1:Number):void{
tint.alpha = _arg1;
gfx.alpha = _arg1;
}
override public function getAlpha():Number{
return (gfx.alpha);
}
public function setFloorTint(_arg1:int):void{
if (tint != null){
tint.gotoAndStop(_arg1);
};
}
}
}//package
Section 91
//CorridorConnectorV (CorridorConnectorV)
package {
import flash.display.*;
public class CorridorConnectorV extends DoorIcon {
public var gfx:MovieClip;
public var tint:MovieClip;
public function CorridorConnectorV(){
this.gotoAndStop(1);
}
override public function setAlpha(_arg1:Number):void{
tint.alpha = _arg1;
gfx.alpha = _arg1;
}
override public function getAlpha():Number{
return (gfx.alpha);
}
public function setFloorTint(_arg1:int):void{
if (tint != null){
tint.gotoAndStop(_arg1);
};
}
}
}//package
Section 92
//cosmic_prison (cosmic_prison)
package {
import flash.display.*;
public dynamic class cosmic_prison extends MovieClip {
public function cosmic_prison(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.cosmicPrison);
}
function frame45(){
this.stop();
}
}
}//package
Section 93
//cosmic_prison_sound (cosmic_prison_sound)
package {
import flash.media.*;
public dynamic class cosmic_prison_sound extends Sound {
}
}//package
Section 94
//creature_slash (creature_slash)
package {
import flash.display.*;
public dynamic class creature_slash extends MovieClip {
public var blood:BloodRandom;
public function creature_slash(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.monsterClaws);
}
function frame45(){
this.stop();
}
}
}//package
Section 95
//creature_slash_sound (creature_slash_sound)
package {
import flash.media.*;
public dynamic class creature_slash_sound extends Sound {
}
}//package
Section 96
//creature_spear (creature_spear)
package {
import flash.display.*;
public dynamic class creature_spear extends MovieClip {
public var blood:BloodRandom;
public var slash:MovieClip;
public function creature_spear(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.monsterSlash);
}
function frame45(){
this.stop();
}
}
}//package
Section 97
//creature_weapon (creature_weapon)
package {
import flash.display.*;
public dynamic class creature_weapon extends MovieClip {
public var blood:BloodRandom;
public var slash:horz_slash;
public function creature_weapon(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.monsterSlash);
slash.rotation = DungeonMain.RandomNum(-15, 15);
}
function frame45(){
this.stop();
}
}
}//package
Section 98
//CreditsScreen (CreditsScreen)
package {
import flash.events.*;
import flash.display.*;
public class CreditsScreen extends MovieClip {
public var yes_btn:MovieClip;
public var cerberus_link:SimpleButton;
public var fglLogo:MovieClip;
public var biclops_link:SimpleButton;
public var biclopsLogo:SimpleButton;
public function CreditsScreen():void{
biclops_link.addEventListener(MouseEvent.MOUSE_DOWN, biclopsClick);
biclopsLogo.addEventListener(MouseEvent.MOUSE_DOWN, biclopsClick);
cerberus_link.addEventListener(MouseEvent.MOUSE_DOWN, cerberusClick);
fglLogo.addEventListener(MouseEvent.MOUSE_DOWN, fglClick);
yes_btn.addEventListener(MouseEvent.MOUSE_DOWN, exitClick);
}
function exitClick(_arg1:MouseEvent):void{
if (this.parent != null){
cleanup();
parent.removeChild(this);
};
}
public function cerberusClick(_arg1:MouseEvent):void{
dm.link("http://www.cerberusart.com");
}
public function fglClick(_arg1:MouseEvent):void{
dm.link("http://www.flashgamelicense.com");
}
private function cleanup():void{
biclops_link.removeEventListener(MouseEvent.MOUSE_DOWN, biclopsClick);
biclopsLogo.removeEventListener(MouseEvent.MOUSE_DOWN, biclopsClick);
cerberus_link.removeEventListener(MouseEvent.MOUSE_DOWN, cerberusClick);
fglLogo.removeEventListener(MouseEvent.MOUSE_DOWN, fglClick);
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, exitClick);
}
public function biclopsClick(_arg1:MouseEvent):void{
dm.link("http://www.biclopsgames.com");
}
}
}//package
Section 99
//CurrentPortraitHighlight (CurrentPortraitHighlight)
package {
import flash.display.*;
public dynamic class CurrentPortraitHighlight extends MovieClip {
}
}//package
Section 100
//CurrentRoomIcon (CurrentRoomIcon)
package {
import flash.display.*;
public dynamic class CurrentRoomIcon extends MovieClip {
}
}//package
Section 101
//curse_effect (curse_effect)
package {
import flash.display.*;
public dynamic class curse_effect extends MovieClip {
public function curse_effect(){
addFrameScript(0, frame1, 49, frame50);
}
function frame1(){
dm.sound.play(SoundControl.curse, 0.5);
}
function frame50(){
this.stop();
}
}
}//package
Section 102
//curse_sound (curse_sound)
package {
import flash.media.*;
public dynamic class curse_sound extends Sound {
}
}//package
Section 103
//CustomPortrait (CustomPortrait)
package {
import flash.system.*;
import flash.net.*;
import flash.display.*;
import flash.events.*;
public class CustomPortrait {
private var callbackFailure:Function;
private var char_ref:Character;
private var portraitLoader:Loader;
private var isLoading:Boolean;// = false
private var callbackSuccess:Function;
public function CustomPortrait(_arg1:String, _arg2:Function, _arg3:Function, _arg4:Character=null):void{
isLoading = false;
super();
this.callbackSuccess = _arg2;
this.callbackFailure = _arg3;
if (_arg4 != null){
this.char_ref = _arg4;
};
initLoader();
loadUrl(_arg1);
}
private function doneLoad(_arg1:Event):void{
var _local2:BitmapData;
var _local3:Bitmap;
isLoading = false;
cleanupLoader();
_local3 = Bitmap(portraitLoader.content);
if (_local3 != null){
_local2 = _local3.bitmapData;
};
if (callbackSuccess != null){
callbackSuccess(_local2, char_ref);
};
}
private function loadUrl(_arg1:String):Boolean{
var host:String;
var slash:int;
var context:LoaderContext;
var fullUrl:String;
var u = _arg1;
if (isLoading){
return (false);
};
try {
if (Security.sandboxType == "localWithFile"){
isLoading = false;
return (false);
};
if (portraitLoader.content != null){
initLoader();
};
host = u.substring(7, u.length);
slash = host.indexOf("/");
host = host.substring(0, slash);
context = new LoaderContext();
context.checkPolicyFile = true;
Security.loadPolicyFile("http://www.biclopsgames.com/linker/crossdomain.xml");
fullUrl = ("http://www.biclopsgames.com/linker/imagelinker.php?url=" + u);
portraitLoader.load(new URLRequest(fullUrl), context);
return (true);
} catch(error:Error) {
isLoading = false;
return (false);
};
return (false);
}
public function cleanupLoader():void{
portraitLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, doneLoad);
portraitLoader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, imageErrorHandler);
}
public function initLoader():void{
if (portraitLoader != null){
cleanupLoader();
};
isLoading = false;
portraitLoader = new Loader();
portraitLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, doneLoad);
portraitLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, imageErrorHandler);
}
private function imageErrorHandler(_arg1:IOErrorEvent):void{
isLoading = false;
cleanupLoader();
if (callbackFailure != null){
callbackFailure(char_ref);
};
}
}
}//package
Section 104
//CustomPortraitDialog (CustomPortraitDialog)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class CustomPortraitDialog extends MovieClip {
public var yes_btn:MovieClip;
private var char_ref:PlayerCharacter;
private var loading:Boolean;// = false
public var resultsText:TextField;
public var image:Bitmap;
public var load_btn:MovieClip;
private var caller:Object;
public var urlInput:TextField;
public var no_btn:MovieClip;
public function CustomPortraitDialog(_arg1:PlayerCharacter=null, _arg2:Object=null):void{
loading = false;
super();
if (_arg1 != null){
this.char_ref = _arg1;
} else {
return;
};
if (_arg2 != null){
this.caller = _arg2;
} else {
return;
};
resultsText.text = "";
urlInput.text = char_ref.customPortraitUrl;
loadImage();
yes_btn.addEventListener(MouseEvent.CLICK, yesClick);
no_btn.addEventListener(MouseEvent.CLICK, noClick);
load_btn.addEventListener(MouseEvent.CLICK, loadClick);
}
private function loadImage():void{
var _local1:*;
if (loading){
return;
};
resultsText.text = "Loading..";
loading = true;
_local1 = new CustomPortrait(String(urlInput.text), imageLoad, imageLoadFail);
}
private function removeImage():void{
if (image == null){
return;
};
if (this.contains(image)){
this.removeChild(image);
};
}
private function noClick(_arg1:MouseEvent):void{
char_ref.useCustomPortrait = false;
remove();
}
private function loadClick(_arg1:MouseEvent):void{
loadImage();
}
public function remove():void{
removeImage();
cleanup();
if (this.parent != null){
if ((caller is Inventory)){
Inventory(caller).selectChar(char_ref);
} else {
if ((caller is CharCreationPanel)){
CharCreationPanel(caller).loadCustomPortrait();
};
};
parent.removeChild(this);
};
}
private function addImage():void{
image.smoothing = true;
image.width = 58;
image.height = 58;
image.x = 115;
image.y = 175;
addChild(image);
}
public function imageLoadFail(_arg1:Character=null):void{
loading = false;
resultsText.text = "Image failed to load.";
removeImage();
}
public function cleanup():void{
yes_btn.removeEventListener(MouseEvent.CLICK, yesClick);
no_btn.removeEventListener(MouseEvent.CLICK, noClick);
load_btn.removeEventListener(MouseEvent.CLICK, loadClick);
}
private function yesClick(_arg1:MouseEvent):void{
char_ref.useCustomPortrait = true;
char_ref.customPortraitUrl = String(urlInput.text);
if (image != null){
char_ref.customPortrait = image.bitmapData;
};
char_ref.loadCustomPortrait();
remove();
}
public function imageLoad(_arg1:BitmapData, _arg2:Character=null):void{
loading = false;
resultsText.text = "Image loaded.";
removeImage();
this.image = new Bitmap(_arg1);
addImage();
}
}
}//package
Section 105
//dCheckBox (dCheckBox)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class dCheckBox extends MovieClip {
public var description:TextField;
public var hitBox:Sprite;
private var hover:Boolean;// = false
public var checked:Boolean;// = false
private var clickCallback:Function;
public function dCheckBox(_arg1:Boolean=false, _arg2:String=""):void{
checked = false;
hover = false;
super();
checked = _arg1;
description.mouseEnabled = false;
mouseChildren = false;
addEventListener(MouseEvent.MOUSE_DOWN, mouseClick);
addEventListener(MouseEvent.MOUSE_OVER, mouseOn);
addEventListener(MouseEvent.MOUSE_OUT, mouseOff);
setDescription(_arg2);
update();
}
function mouseClick(_arg1:MouseEvent):void{
if (checked){
checked = false;
} else {
checked = true;
};
update();
if (this.clickCallback != null){
clickCallback();
};
}
function mouseOn(_arg1:MouseEvent):void{
hover = true;
update();
}
function mouseOff(_arg1:MouseEvent):void{
hover = false;
update();
}
public function setDescription(_arg1:String, _arg2:Boolean=false, _arg3:uint=0xFFFFFF):void{
description.text = _arg1;
if (_arg2){
dmf.embolden(description);
};
description.autoSize = TextFieldAutoSize.LEFT;
description.textColor = _arg3;
hitBox.width = ((description.x + description.width) + 10);
}
public function cleanup():void{
removeEventListener(MouseEvent.MOUSE_DOWN, mouseClick);
removeEventListener(MouseEvent.MOUSE_OVER, mouseOn);
removeEventListener(MouseEvent.MOUSE_OUT, mouseOff);
clickCallback = null;
}
private function update():void{
if (!(checked)){
if (hover){
this.gotoAndStop(3);
} else {
this.gotoAndStop(1);
};
} else {
if (hover){
this.gotoAndStop(4);
} else {
this.gotoAndStop(2);
};
};
}
public function setCallback(_arg1:Function):void{
this.clickCallback = _arg1;
}
public function setChecked(_arg1:Boolean):void{
this.checked = _arg1;
update();
}
}
}//package
Section 106
//DeadEffect (DeadEffect)
package {
import flash.display.*;
public dynamic class DeadEffect extends MovieClip {
}
}//package
Section 107
//debuff_effect (debuff_effect)
package {
import flash.display.*;
public dynamic class debuff_effect extends MovieClip {
public function debuff_effect(){
addFrameScript(4, frame5, 44, frame45);
}
function frame5(){
dm.sound.play(SoundControl.debuff);
}
function frame45(){
this.stop();
}
}
}//package
Section 108
//debuff_sound (debuff_sound)
package {
import flash.media.*;
public dynamic class debuff_sound extends Sound {
}
}//package
Section 109
//destroy_item_sound (destroy_item_sound)
package {
import flash.media.*;
public dynamic class destroy_item_sound extends Sound {
}
}//package
Section 110
//Difficulty (Difficulty)
package {
public class Difficulty {
static const TACTICAL = 2;
static const HARDCORE = 1;
static const EXTREME = 3;
static const BEGINNER = 1;
static const ATTRITION = 4;
static const STANDARD = 2;
public function Difficulty():void{
}
public static function getMultiplier(_arg1:int, _arg2:uint):int{
var _local3:Number;
_local3 = 100;
if (_arg1 == BEGINNER){
_local3 = (_local3 * 0.5);
} else {
if (_arg1 == EXTREME){
_local3 = (_local3 * 1.5);
};
};
if ((_arg2 & HARDCORE) == HARDCORE){
_local3 = (_local3 * 1.25);
};
if ((_arg2 & TACTICAL) == TACTICAL){
_local3 = (_local3 * 1.5);
};
if ((_arg2 & ATTRITION) == ATTRITION){
_local3 = (_local3 * 1.2);
};
return (Math.round(_local3));
}
}
}//package
Section 111
//DifficultySelect (DifficultySelect)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class DifficultySelect extends MovieClip {
public var checkHardcore:dCheckBox;
public var beginner:MovieClip;
public var optionsButton:OptionsBookButton;
private var difficultySelected:int;// = 2
public var checkAttrition:dCheckBox;
public var totalModifierLabel:TextField;
public var checkTactical:dCheckBox;
public var extreme:MovieClip;
public var proceed:SimpleButton;
public var standard:MovieClip;
private var party:Party;
public function DifficultySelect(_arg1:Party=null):void{
difficultySelected = Difficulty.STANDARD;
super();
party = _arg1;
standard.addEventListener(MouseEvent.CLICK, standardClicked);
beginner.addEventListener(MouseEvent.CLICK, beginnerClicked);
extreme.addEventListener(MouseEvent.CLICK, extremeClicked);
standard.useHandCursor = true;
beginner.useHandCursor = true;
extreme.useHandCursor = true;
updateHighlightedDifficulty();
checkHardcore.setDescription("Hardcore: ", true, 0x111111);
checkAttrition.setDescription("Attrition: ", true, 0x111111);
checkTactical.setDescription("Tactical: ", true, 0x111111);
proceed.addEventListener(MouseEvent.MOUSE_DOWN, continueClicked);
addEventListener(Event.ENTER_FRAME, onFrame);
}
private function updateHighlightedDifficulty():void{
standard.gotoAndStop(1);
beginner.gotoAndStop(1);
extreme.gotoAndStop(1);
switch (difficultySelected){
case Difficulty.BEGINNER:
beginner.gotoAndStop(2);
break;
case Difficulty.STANDARD:
standard.gotoAndStop(2);
break;
case Difficulty.EXTREME:
extreme.gotoAndStop(2);
break;
};
}
private function getMods():uint{
var _local1:uint;
_local1 = 0;
if (checkHardcore.checked){
_local1 = (_local1 + Difficulty.HARDCORE);
};
if (checkAttrition.checked){
_local1 = (_local1 + Difficulty.ATTRITION);
};
if (checkTactical.checked){
_local1 = (_local1 + Difficulty.TACTICAL);
};
return (_local1);
}
function beginnerClicked(_arg1:MouseEvent):void{
difficultySelected = Difficulty.BEGINNER;
updateHighlightedDifficulty();
}
private function continueClicked(_arg1:MouseEvent):void{
setDifficulty(difficultySelected);
cleanup();
dm.main.difficultySelected();
}
function standardClicked(_arg1:MouseEvent):void{
difficultySelected = Difficulty.STANDARD;
updateHighlightedDifficulty();
}
private function updateDifficultyNumber():void{
var _local1:int;
_local1 = Difficulty.getMultiplier(difficultySelected, getMods());
totalModifierLabel.text = (String(_local1) + "%");
dmf.embolden(totalModifierLabel);
}
private function onFrame(_arg1:Event):void{
updateDifficultyNumber();
}
public function cleanup():void{
standard.removeEventListener(MouseEvent.CLICK, standardClicked);
beginner.removeEventListener(MouseEvent.CLICK, beginnerClicked);
extreme.removeEventListener(MouseEvent.CLICK, extremeClicked);
proceed.removeEventListener(MouseEvent.MOUSE_DOWN, continueClicked);
optionsButton.cleanup();
removeEventListener(Event.ENTER_FRAME, onFrame);
}
private function setDifficulty(_arg1:int):void{
if (party != null){
party.difficulty = _arg1;
party.difficultyMods = getMods();
};
}
function extremeClicked(_arg1:MouseEvent):void{
difficultySelected = Difficulty.EXTREME;
updateHighlightedDifficulty();
}
}
}//package
Section 112
//Dijkstra (Dijkstra)
package {
class Dijkstra {
private var startNode:Number;
private var numberOfNodes:Number;
private var nodesLeft:Array;
private var previousNode:Array;
private var map:Array;
private var infiniteDistance:Number;
private var bestPath:Number;
private var visited:Array;
private var pathsFound:Boolean;// = false
private var distance:Array;
public static const NO_CONNECTION = 99999999;
function Dijkstra(_arg1:Array, _arg2:Number){
pathsFound = false;
super();
this.infiniteDistance = NO_CONNECTION;
this.startNode = _arg2;
this.distance = new Array();
this.previousNode = new Array();
this.visited = new Array();
this.map = _arg1;
this.numberOfNodes = this.map[0].length;
this.bestPath = 0;
this.nodesLeft = new Array();
}
private function nodesNotVisited(_arg1:Array):Array{
var _local2:*;
var _local3:*;
_local2 = new Array();
_local3 = 0;
while (_local3 < this.numberOfNodes) {
if (!(_arg1[_local3])){
_local2.push(_local3);
};
_local3++;
};
return (_local2);
}
private function findBestPath(_arg1:Array, _arg2:Array):Number{
var _local3:*;
var _local4:*;
var _local5:*;
_local3 = this.infiniteDistance;
_local4 = 0;
_local5 = 0;
while (_local5 < _arg2.length) {
if (_arg1[_arg2[_local5]] < _local3){
_local3 = _arg1[_arg2[_local5]];
_local4 = _arg2[_local5];
};
_local5++;
};
return (_local4);
}
public function findShortestPathTo(_arg1:Number, _arg2:int):Array{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:int;
if (!(pathsFound)){
this.findShortestPath();
};
_local3 = new Array();
_local4 = null;
_local5 = _arg1;
_local3.push(_arg1);
_local6 = 1;
while (((!((_local4 == this.startNode))) && ((_local6 < _arg2)))) {
_local3.push(this.previousNode[_local5]);
_local4 = this.previousNode[_local5];
_local5 = this.previousNode[_local5];
_local6++;
};
if (_local6 >= _arg2){
_local3.length = 0;
} else {
_local3.reverse();
};
return (_local3);
}
public function findShortestPath():void{
var _local1:*;
var _local2:int;
var _local3:int;
_local1 = 0;
while (_local1 < this.numberOfNodes) {
if (_local1 == this.startNode){
this.visited[_local1] = 1;
this.distance[_local1] = 0;
} else {
this.visited[_local1] = 0;
this.distance[_local1] = this.map[this.startNode][_local1];
};
this.previousNode[_local1] = this.startNode;
_local1++;
};
_local2 = 300;
_local3 = 0;
while (((this.somethingLeft(this.visited)) && ((_local3 < _local2)))) {
this.nodesLeft = this.nodesNotVisited(this.visited);
this.bestPath = this.findBestPath(this.distance, this.nodesLeft);
this.updateDistanceAndPrevious(this.bestPath);
this.visited[this.bestPath] = 1;
_local3++;
};
if (_local3 >= _local2){
};
pathsFound = true;
}
private function getResults():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
_local1 = new Array();
_local2 = 0;
while (_local2 < this.numberOfNodes) {
_local1[_local2] = new Array();
_local3 = null;
_local4 = _local2;
_local1[_local2].push(_local2);
while (_local3 != this.startNode) {
_local1[_local2].push(this.previousNode[_local4]);
_local3 = this.previousNode[_local4];
_local4 = this.previousNode[_local4];
};
_local1[_local2].reverse();
_local2++;
};
}
private function somethingLeft(_arg1:Array):Boolean{
var _local2:*;
_local2 = 0;
while (_local2 < this.numberOfNodes) {
if (!(_arg1[_local2])){
return (true);
};
_local2++;
};
return (false);
}
private function updateDistanceAndPrevious(_arg1:Number):void{
var _local2:*;
_local2 = 0;
while (_local2 < this.numberOfNodes) {
if (((!((this.map[_arg1][_local2] == this.infiniteDistance))) || ((this.map[_arg1][_local2] == 0)))){
if ((this.distance[_arg1] + this.map[_arg1][_local2]) < this.distance[_local2]){
this.distance[_local2] = (this.distance[_arg1] + this.map[_arg1][_local2]);
this.previousNode[_local2] = _arg1;
};
};
_local2++;
};
}
}
}//package
Section 113
//disintegrate_effect (disintegrate_effect)
package {
import flash.display.*;
public dynamic class disintegrate_effect extends MovieClip {
public function disintegrate_effect(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.disintegrate);
}
function frame45(){
this.stop();
}
}
}//package
Section 114
//disintegrate_sound (disintegrate_sound)
package {
import flash.media.*;
public dynamic class disintegrate_sound extends Sound {
}
}//package
Section 115
//dm (dm)
package {
import flash.external.*;
import flash.net.*;
import flash.text.*;
import flash.display.*;
public class dm {
static var stage:Stage;
static var party:Party;
static var sound:SoundControl;
static var MeezGPF;
static var main:DungeonMain;
static var kongregate;
public static function randomNum(_arg1:int, _arg2:int):int{
var _local3:*;
_local3 = (Math.round((Math.random() * (_arg2 - _arg1))) + _arg1);
return (_local3);
}
public static function copyArray(_arg1:Array):Array{
var _local2:Array;
var _local3:*;
_local2 = new Array(_arg1.length);
_local3 = 0;
while (_local3 < _local2.length) {
_local2[_local3] = _arg1[_local3];
_local3++;
};
return (_local2);
}
public static function shuffleArray(_arg1:Array):Array{
var _local2:Array;
var _local3:Array;
var _local4:*;
var _local5:Array;
_local2 = new Array();
_local3 = new Array(_arg1.length);
_local4 = 0;
while (_local4 < _local3.length) {
_local3[_local4] = _arg1[_local4];
_local4++;
};
while (_local3.length) {
_local4 = dmf.randomNum(0, (_local3.length - 1));
_local5 = _local3.splice(_local4, 1);
_local2.push(_local5[0]);
};
return (_local2);
}
static function vector_length(_arg1:Number, _arg2:Number):Number{
return (Math.sqrt(((_arg1 * _arg1) + (_arg2 * _arg2))));
}
public static function joinArrays(_arg1:Array, _arg2:Array):Array{
var _local3:Array;
var _local4:*;
_local3 = new Array();
_local4 = 0;
while (_local4 < _arg1.length) {
_local3.push(_arg1[_local4]);
_local4++;
};
_local4 = 0;
while (_local4 < _arg2.length) {
_local3.push(_arg2[_local4]);
_local4++;
};
return (_local3);
}
public static function childToTop(_arg1:DisplayObjectContainer):void{
var _local2:*;
if ((((_arg1 == null)) || ((_arg1.parent == null)))){
return;
};
_local2 = (_arg1.parent.numChildren - 1);
_arg1.parent.setChildIndex(_arg1, _local2);
}
static function vectors2angle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
_local5 = vector_length(_arg1, _arg2);
_local6 = vector_length(_arg3, _arg4);
if (_local5 != 0){
_arg1 = (_arg1 / _local5);
_arg2 = (_arg2 / _local5);
};
if (_local6 != 0){
_arg3 = (_arg3 / _local6);
_arg4 = (_arg4 / _local6);
};
_local7 = dot(_arg1, _arg2, _arg3, _arg4);
_local8 = (_local7 / (Math.sqrt(vector_length(_arg1, _arg2)) * Math.sqrt(vector_length(_arg3, _arg4))));
_local9 = Math.acos(_local8);
_local10 = dm.radians_to_degrees(_local9);
return (_local10);
}
static function radians_to_degrees(_arg1:Number):Number{
return ((_arg1 * (180 / Math.PI)));
}
static function dot(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg1 * _arg3) + (_arg2 * _arg4)));
}
public static function link(_arg1:String):void{
var url = _arg1;
try {
ExternalInterface.call("window.open", url, "_blank", "");
} catch(error) {
navigateToURL(new URLRequest(url), "_blank");
};
}
public static function embolden(_arg1:TextField){
var _local2:TextFormat;
_local2 = _arg1.getTextFormat();
_local2.bold = true;
_arg1.setTextFormat(_local2);
}
}
}//package
Section 116
//dmf (dmf)
package {
import flash.external.*;
import flash.net.*;
import flash.text.*;
import flash.display.*;
import flash.geom.*;
public class dmf {
public static function shuffleArray(_arg1:Array):Array{
var _local2:Array;
var _local3:Array;
var _local4:*;
var _local5:Array;
_local2 = new Array();
if (_arg1 == null){
return (_local2);
};
_local3 = new Array(_arg1.length);
_local4 = 0;
while (_local4 < _local3.length) {
_local3[_local4] = _arg1[_local4];
_local4++;
};
while (_local3.length) {
_local4 = randomNum(0, (_local3.length - 1));
_local5 = _local3.splice(_local4, 1);
_local2.push(_local5[0]);
};
return (_local2);
}
public static function getCurrentTimeString():String{
var _local1:Date;
_local1 = new Date();
return (String(((((_local1.getHours() + ":") + _local1.getMinutes()) + ":") + _local1.getSeconds())));
}
public static function randomNum(_arg1:int, _arg2:int):int{
var _local3:*;
_local3 = (Math.round((Math.random() * (_arg2 - _arg1))) + _arg1);
return (_local3);
}
public static function copyArray(_arg1:Array):Array{
var _local2:Array;
var _local3:*;
_local2 = new Array(_arg1.length);
_local3 = 0;
while (_local3 < _local2.length) {
_local2[_local3] = _arg1[_local3];
_local3++;
};
return (_local2);
}
public static function hasFlag(_arg1:uint, _arg2:uint):Boolean{
if ((_arg1 & _arg2) == _arg2){
return (true);
};
return (false);
}
public static function getGlobalY(_arg1:DisplayObjectContainer):int{
var _local2:Point;
_local2 = _arg1.localToGlobal(new Point(0, 0));
return (_local2.y);
}
static function vector_length(_arg1:Number, _arg2:Number):Number{
return (Math.sqrt(((_arg1 * _arg1) + (_arg2 * _arg2))));
}
static function vectors2angle(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
_local5 = vector_length(_arg1, _arg2);
_local6 = vector_length(_arg3, _arg4);
if (_local5 != 0){
_arg1 = (_arg1 / _local5);
_arg2 = (_arg2 / _local5);
};
if (_local6 != 0){
_arg3 = (_arg3 / _local6);
_arg4 = (_arg4 / _local6);
};
_local7 = dot(_arg1, _arg2, _arg3, _arg4);
_local8 = (_local7 / (Math.sqrt(vector_length(_arg1, _arg2)) * Math.sqrt(vector_length(_arg3, _arg4))));
_local9 = Math.acos(_local8);
_local10 = radians_to_degrees(_local9);
return (_local10);
}
public static function joinArrays(_arg1:Array, _arg2:Array):Array{
var _local3:Array;
var _local4:*;
_local3 = new Array();
_local4 = 0;
while (_local4 < _arg1.length) {
_local3.push(_arg1[_local4]);
_local4++;
};
_local4 = 0;
while (_local4 < _arg2.length) {
_local3.push(_arg2[_local4]);
_local4++;
};
return (_local3);
}
static function dot(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (((_arg1 * _arg3) + (_arg2 * _arg4)));
}
public static function numberToText(_arg1:int, _arg2:Boolean=false):String{
var _local3:String;
_local3 = "number";
if (_arg1 == 0){
_local3 = "zero";
} else {
if (_arg1 == 1){
_local3 = "one";
} else {
if (_arg1 == 2){
_local3 = "two";
} else {
if (_arg1 == 3){
_local3 = "three";
} else {
if (_arg1 == 4){
_local3 = "four";
} else {
if (_arg1 == 5){
_local3 = "five";
} else {
if (_arg1 == 6){
_local3 = "six";
} else {
if (_arg1 == 7){
_local3 = "seven";
} else {
if (_arg1 == 8){
_local3 = "eight";
} else {
if (_arg1 == 9){
_local3 = "nine";
} else {
if (_arg1 == 10){
_local3 = "ten";
};
};
};
};
};
};
};
};
};
};
};
if (_arg2){
_local3 = _local3.toUpperCase();
};
return (_local3);
}
public static function boldText(_arg1:TextField){
var _local2:TextFormat;
_local2 = _arg1.getTextFormat();
_local2.bold = true;
_arg1.setTextFormat(_local2);
}
public static function distanceBetween(_arg1:int, _arg2:int, _arg3:int, _arg4:int):int{
var _local5:*;
var _local6:*;
_local5 = Math.abs((_arg1 - _arg3));
_local6 = Math.abs((_arg2 - _arg4));
return (Math.sqrt(((_local5 * _local5) + (_local6 * _local6))));
}
public static function randomString(_arg1:Array):String{
return (_arg1[randomNum(0, (_arg1.length - 1))]);
}
public static function embolden(_arg1:TextField){
boldText(_arg1);
}
static function radians_to_degrees(_arg1:Number):Number{
return ((_arg1 * (180 / Math.PI)));
}
public static function arrayContains(_arg1:Array, _arg2:Object):Boolean{
var _local3:*;
if ((((_arg1 == null)) || (!(_arg1.length)))){
return (false);
};
_local3 = 0;
while (_local3 < _arg1.length) {
if (_arg1[_local3] == _arg2){
return (true);
};
_local3++;
};
return (false);
}
public static function link(_arg1:String):void{
var url = _arg1;
try {
ExternalInterface.call("window.open", url, "_blank", "");
} catch(error) {
navigateToURL(new URLRequest(url), "_blank");
};
}
public static function setLetterSpacing(_arg1:TextField, _arg2:int):void{
var _local3:TextFormat;
_local3 = _arg1.getTextFormat();
_local3.letterSpacing = _arg2;
_arg1.setTextFormat(_local3);
}
public static function italicText(_arg1:TextField){
var _local2:TextFormat;
_local2 = _arg1.getTextFormat();
_local2.italic = true;
_arg1.setTextFormat(_local2);
}
public static function childToTop(_arg1:DisplayObjectContainer):void{
var _local2:*;
if ((((_arg1 == null)) || ((_arg1.parent == null)))){
return;
};
_local2 = (_arg1.parent.numChildren - 1);
_arg1.parent.setChildIndex(_arg1, _local2);
}
public static function getGlobalX(_arg1:DisplayObjectContainer):int{
var _local2:Point;
_local2 = _arg1.localToGlobal(new Point(0, 0));
return (_local2.x);
}
}
}//package
Section 117
//DoorIcon (DoorIcon)
package {
import flash.display.*;
public class DoorIcon extends MovieClip {
public var door_gfx:MovieClip;
var room2:DungeonRoom;
var room1:DungeonRoom;
public function DoorIcon(){
this.gotoAndStop(1);
}
public function setAlpha(_arg1:Number):void{
this.door_gfx.alpha = _arg1;
}
public function getAlpha():Number{
return (this.door_gfx.alpha);
}
public function setVert():void{
this.rotation = 90;
}
}
}//package
Section 118
//DownLevelDialog (DownLevelDialog)
package {
import flash.events.*;
import flash.ui.*;
import flash.display.*;
public class DownLevelDialog extends MovieClip {
public var yes_btn:MovieClip;
public var no_btn:MovieClip;
public function DownLevelDialog(){
this.yes_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickYes);
this.no_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickNo);
dm.stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
}
function clickYes(_arg1:MouseEvent):void{
Dungeon(parent).descend();
cleanup();
}
function clickNo(_arg1:MouseEvent):void{
if (parent != null){
cleanup();
parent.removeChild(this);
};
}
private function cleanup():void{
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickYes);
no_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickNo);
dm.stage.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
}
function reportKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ENTER){
clickYes(null);
} else {
if (_arg1.keyCode == Keyboard.ESCAPE){
clickNo(null);
};
};
}
}
}//package
Section 119
//Dungeon (Dungeon)
package {
import flash.events.*;
import flash.ui.*;
import flash.display.*;
public class Dungeon extends Sprite {
const hintStart = 32;
const hintShop = 0x0100;
const tile_dungeon = 1;
const hintBattle = 8;
const tile_cave = 2;
const hintInventory = 2;
const hintDefeat = 4;
const hintSave = 128;
const hintLevel = 1;
const hintTurn = 64;
const hintHorde = 16;
const bar_max_width = 147;
var bossRoom:DungeonRoom;
var a_tallrooms:Array;
private var travelling:Boolean;// = false
var previousLevelCleared;// = false
private var currentRoute:Array;
private var dungeonSavePending:Boolean;// = false
public var portalScrollRoomIndex:int;// = -1
var entryRoom:DungeonRoom;
var hint:HintDialog;
var door_array:Array;
var currentRoomIcon:CurrentRoomIcon;
var a_chambers:Array;
var moveArrow:Sprite;
var shrines:Array;
var race:int;// = 0
private var adjacencyMap:Array;
var tileset:int;
var a_galleries:Array;
var exitRoom:DungeonRoom;
var exit_found;// = false
var a_largerooms:Array;
var grid:Array;
var dinterface:DungeonInterface;
var a_corridors:Array;
private var search2:Dijkstra;
var chests:Array;
var pc_party:Party;
private var search:Dijkstra;
var a_widerooms:Array;
var dungeon_level:int;// = 1
private var adjacencyMap2:Array;
var hordes:Array;
var a_cells:Array;
var currentRoom:DungeonRoom;
var room_array:Array;
static const grid_height = 15;
static const GRID_SIZE = 20;
static const SCREEN_Y_OFFSET = 15;
static const grid_width = 26;
static const SCREEN_X_OFFSET = 15;
public function Dungeon(_arg1:Party=null, _arg2:int=1, _arg3:int=0, _arg4:Boolean=false){
dungeon_level = 1;
race = 0;
tileset = tile_dungeon;
portalScrollRoomIndex = -1;
room_array = new Array();
door_array = new Array();
hordes = new Array();
shrines = new Array();
chests = new Array();
exit_found = false;
previousLevelCleared = false;
dungeonSavePending = false;
travelling = false;
super();
if (_arg1 == null){
return;
};
this.previousLevelCleared = _arg4;
this.portalScrollRoomIndex = -1;
dungeon_level = _arg2;
pc_party = _arg1;
dinterface = new DungeonInterface();
if (!(_arg3)){
race = Dungeon.getMonsterRace(_arg2, 0, _arg1.campaign);
} else {
race = _arg3;
};
drawInterface();
addEventListener(Event.ENTER_FRAME, onFrame);
if (DungeonMain.showHints){
if ((((_arg2 == 2)) && (!(hintShown(hintLevel))))){
hint = new HintDialog("Level Up!", "You have descended to the next level of the dungeon, and your characters have grown in power. \n\nEach level they will gain points to increase their statistics and buy new skills.\n\nClick on a portrait to enter the Inventory screen and spend these points.");
DungeonMain.hints = (DungeonMain.hints + hintLevel);
};
if ((((_arg2 == 1)) && (!(hintShown(hintStart))))){
hint = new HintDialog("The Dungeon Map", "This is the Dungeon Map. From here, you move your party from room to room, encountering monsters and finding treasure while searching for the entrance to the next level of the dungeon.\n\nThe brightest room shows the current position of your party, while slightly dimmer rooms are those you can move to from your current position. Simply click on a room to move there.\n\nIf you can't figure out where to explore next, try clicking the 'Map Hint' button.");
DungeonMain.hints = (DungeonMain.hints + hintStart);
};
};
}
function showCriticalPath(_arg1:Event):void{
var _local2:*;
_local2 = 0;
while (_local2 < room_array.length) {
if (room_array[_local2].criticalPath){
room_array[_local2].hintFlash();
};
_local2++;
};
}
public function useRest():void{
var _local1:*;
var _local2:*;
var _local3:*;
_local1 = getChildByName("rest_dlg");
if (_local1 != null){
removeChild(_local1);
};
if (entryRoom == null){
return;
};
_local2 = entryRoom.getEntrance();
if (_local2 == null){
return;
};
_local3 = new RestScreen();
addChild(_local3);
pc_party.fullRecovery();
_local2.enableRest = false;
_local2.removeGlow();
previousLevelCleared = false;
if (parent != null){
DungeonMain(parent).saveParty();
DungeonMain(parent).saveDungeon(false);
};
}
private function saveClick(_arg1:MouseEvent):void{
if (parent != null){
DungeonMain(parent).saveClick(_arg1);
};
}
public function exploreAll(_arg1:MouseEvent):void{
var _local2:*;
foundExit();
_local2 = 0;
while (_local2 < room_array.length) {
if (room_array[_local2] == null){
} else {
room_array[_local2].explored = true;
room_array[_local2].seen = true;
};
_local2++;
};
roomHighlights(true);
}
private function generateDoors():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:DoorIcon;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:*;
_local10 = -1;
_local11 = -1;
_local1 = 0;
while (_local1 < room_array.length) {
_local2 = 0;
for (;_local2 < room_array[_local1].adjacent.length;_local2++) {
if (room_array[_local1] == null){
} else {
if (room_array[_local1].adjacent[_local2] == room_array[_local1]){
} else {
_local8 = room_array[_local1];
_local7 = room_array[_local1].adjacent[_local2];
if ((((_local7 is DungeonCorridor)) && ((room_array[_local1] is DungeonCorridor)))){
addCorridorConnection(_local7, room_array[_local1]);
} else {
_local6 = new DoorIcon();
_local6.x = 0;
_local6.y = 0;
_local6.room1 = _local8;
_local6.room2 = _local7;
_local12 = 0;
_local13 = 0;
if (_local7.grid_x >= (_local8.grid_x + _local8.getGridWidth())){
_local6.setVert();
_local12 = (_local8.grid_x + _local8.getGridWidth());
_local13 = _local8.grid_y;
if ((((_local12 >= grid_width)) || ((_local13 >= grid_height)))){
continue;
};
_local6.x = (SCREEN_X_OFFSET + (GRID_SIZE * (_local8.grid_x + _local8.getGridWidth())));
_local10 = -1;
_local11 = -1;
_local3 = 0;
while (_local3 < _local8.getGridHeight()) {
_local9 = grid[_local12][(_local13 + _local3)];
if (_local9 == null){
} else {
if (_local9 == _local7){
if (_local10 == -1){
_local10 = _local3;
};
_local11 = _local3;
};
};
_local3++;
};
_local5 = ((_local10 + _local11) / 2);
_local6.y = (SCREEN_Y_OFFSET + (GRID_SIZE * (_local8.grid_y + _local5)));
} else {
if (_local7.grid_y >= (_local8.grid_y + _local8.getGridHeight())){
_local12 = _local8.grid_x;
_local13 = (_local8.grid_y + _local8.getGridHeight());
if ((((_local12 >= grid_width)) || ((_local13 >= grid_height)))){
continue;
};
_local6.y = Math.round((SCREEN_Y_OFFSET + (GRID_SIZE * (_local8.grid_y + _local8.getGridHeight()))));
_local10 = -1;
_local11 = -1;
_local3 = 0;
while (_local3 < _local8.getGridWidth()) {
_local9 = grid[(_local12 + _local3)][_local13];
if (_local9 == null){
} else {
if (_local9 == _local7){
if (_local10 == -1){
_local10 = _local3;
};
_local11 = _local3;
};
};
_local3++;
};
_local5 = ((_local10 + _local11) / 2);
_local6.x = (SCREEN_X_OFFSET + (GRID_SIZE * (_local8.grid_x + _local5)));
};
};
if ((((_local6.x > 0)) && ((_local6.y > 0)))){
door_array.push(_local6);
DungeonRoom(_local6.room1).addDoor(_local6);
DungeonRoom(_local6.room2).addDoor(_local6);
};
};
};
};
};
_local1++;
};
}
private function drawRooms():void{
var _local1:DungeonRoom;
for each (_local1 in room_array) {
if (_local1 != null){
this.addChild(_local1);
};
};
}
private function newCorridorConnection(_arg1:Boolean, _arg2:int, _arg3:int, _arg4:DungeonRoom, _arg5:DungeonRoom):void{
var _local6:*;
if (_arg1){
_local6 = new CorridorConnectorV();
} else {
_local6 = new CorridorConnectorH();
};
_local6.room1 = _arg4;
_local6.room2 = _arg5;
_local6.y = _arg3;
_local6.x = _arg2;
_local6.setFloorTint(Campaign.getTintFrame(pc_party.campaign));
_arg4.addDoor(_local6);
_arg5.addDoor(_local6);
door_array.push(_local6);
}
private function validPathIndices(_arg1:Array):Boolean{
var _local2:Array;
var _local3:int;
_local2 = new Array();
for each (_local3 in _arg1) {
_local2.push(room_array[_local3]);
};
return (validPathRooms(_local2));
}
private function updateInventoryCount():void{
dinterface.items_label.text = ((String((pc_party.inventory.length + pc_party.overflow.length)) + "/") + String(Party.MAX_INVENTORY));
if (pc_party.overflow.length){
dinterface.items_label.textColor = 0xFF0000;
} else {
dinterface.items_label.textColor = 0xFFFFFF;
};
dm.embolden(dinterface.items_label);
}
private function addRoomToTypeArray(_arg1:DungeonRoom):void{
if ((((_arg1 is rCorridorV)) || ((_arg1 is rCorridorH)))){
a_corridors.push(_arg1);
} else {
if ((_arg1 is rCell)){
a_cells.push(_arg1);
} else {
if ((_arg1 is rChamber)){
a_chambers.push(_arg1);
} else {
if ((_arg1 is rLargeRoom)){
a_largerooms.push(_arg1);
} else {
if ((_arg1 is rGallery)){
a_galleries.push(_arg1);
} else {
if ((_arg1 is rTallRoom)){
a_tallrooms.push(_arg1);
} else {
if ((_arg1 is rWideRoom)){
a_widerooms.push(_arg1);
};
};
};
};
};
};
};
}
private function portalScrollOnLevel():Boolean{
if (pc_party.attrition){
return (false);
};
if ((dungeon_level % 2) != 0){
return (true);
};
return (false);
}
private function isExistingRoomConnection(_arg1:DungeonRoom, _arg2:DungeonRoom):Boolean{
var _local3:*;
_local3 = 0;
while (_local3 < _arg1.doors.length) {
if ((((_arg1.doors[_local3].room1 == _arg2)) || ((_arg1.doors[_local3].room2 == _arg2)))){
return (true);
};
_local3++;
};
return (false);
}
private function getRoomCount():int{
return ((room_array.length - a_corridors.length));
}
private function PlaceRoom(_arg1:DungeonRoom):Boolean{
var _local2:*;
var _local3:*;
var _local4:*;
_local4 = checkFootprintEmpty(_arg1);
if (!(_local4)){
return (false);
};
_arg1.x = (SCREEN_X_OFFSET + (_arg1.grid_x * GRID_SIZE));
_arg1.y = (SCREEN_Y_OFFSET + (_arg1.grid_y * GRID_SIZE));
fillGridForRoom(_arg1);
room_array.push(_arg1);
_arg1.setFloor();
_arg1.setFloorTint(Campaign.getTintFrame(pc_party.campaign));
_arg1.addFurniture();
addRoomToTypeArray(_arg1);
return (true);
}
private function isDungeonTooSmall():Boolean{
if (room_array.length < 40){
return (true);
};
if (getRoomCount() < 10){
return (true);
};
return (false);
}
private function ConnectRooms(_arg1:DungeonRoom, _arg2:DungeonRoom, _arg3:int){
var _local4:*;
var _local5:*;
if ((((_arg2 == null)) || ((_arg1 == null)))){
return;
};
if (_arg2.num_adjacent == DungeonRoom.max_adjacent){
return;
};
if (_arg1.num_adjacent == DungeonRoom.max_adjacent){
return;
};
if ((_arg1 is DungeonCorridor)){
if ((_arg2 is DungeonCorridor)){
_arg1.setAdjacentTo(_arg2);
return;
};
};
if (_arg2.num_adjacent == 0){
_arg1.setAdjacentTo(_arg2);
return;
};
if ((_arg1 is DungeonCorridor)){
if (_arg1.num_adjacent < 2){
_arg1.setAdjacentTo(_arg2);
return;
};
};
if ((_arg2 is DungeonCorridor)){
if (_arg2.num_adjacent < 2){
_arg1.setAdjacentTo(_arg2);
return;
};
};
_local4 = ((((_arg3 * room_array.length) + _arg2.floor_frame_number) + (_arg1.grid_x * _arg2.grid_y)) + (_arg2.grid_x * _arg1.grid_y));
_local5 = (_local4 % 10);
if (_arg1.num_adjacent == 0){
_arg1.setAdjacentTo(_arg2);
} else {
if (_arg1.num_adjacent == 1){
if (_local5 >= 4){
_arg1.setAdjacentTo(_arg2);
};
} else {
if (_arg1.num_adjacent == 2){
if (_local5 >= 8){
_arg1.setAdjacentTo(_arg2);
};
} else {
if (_local5 >= 9){
_arg1.setAdjacentTo(_arg2);
};
};
};
};
}
private function ClearAllRoomEdges(){
var _local1:*;
_local1 = 0;
while (_local1 < room_array.length) {
if (room_array[_local1] == null){
} else {
room_array[_local1].clearAdjacent();
};
_local1++;
};
}
private function GenerateSpecialEncounter():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Array;
var _local7:int;
var _local8:DungeonRoom;
var _local9:Horde;
var _local10:int;
_local1 = 0;
if ((((pc_party.campaign == Campaign.ORIGINAL)) && ((dungeon_level == 9)))){
return;
};
_local2 = 33;
_local3 = 45;
_local4 = 25;
_local5 = 30;
if (DungeonMain.BETA){
_local2 = 100;
_local3 = 0;
_local4 = 100;
_local5 = 0;
};
if (dmf.randomNum(0, 99) <= _local2){
_local7 = dmf.randomNum(0, 99);
if (_local7 < _local3){
_local6 = getRandomRoomList(false);
_local1 = 0;
while (_local1 < _local6.length) {
if (roomValidForShrine(_local6[_local1])){
addSpecialShrineToRoom(_local6[_local1]);
break;
};
_local1++;
};
} else {
if (_local7 < (_local3 + _local4)){
if (dungeon_level == 1){
return;
};
_local6 = getRandomRoomList(true);
for each (_local8 in _local6) {
if (_local8.criticalPath){
} else {
if (roomValidForMonster(_local8)){
_local9 = new Horde(this.race, this.dungeon_level, 0, _local8, false, true);
_local8.setHorde(_local9);
hordes.push(_local9);
_local9.mask = null;
break;
};
};
};
} else {
if (_local7 < ((_local3 + _local4) + _local5)){
_local10 = dmf.randomNum(Encounter.RESCUE, Encounter.LURKER);
if ((((pc_party.campaign == Campaign.ORIGINAL)) && ((dungeon_level == DungeonMain.MAX_LEVEL)))){
return;
};
if ((((pc_party.members.length > 4)) || (pc_party.hasAlly()))){
_local10 = Encounter.LURKER;
};
_local6 = getRandomRoomList(true);
_local1 = 0;
while (_local1 < _local6.length) {
if (roomValidForShrine(_local6[_local1])){
_local6[_local1].special = _local10;
addSpecialIconToRoom(_local6[_local1]);
break;
};
_local1++;
};
};
};
};
};
}
private function buildAdjacencyMaps():void{
adjacencyMap = getAdjacencyMap(true);
adjacencyMap2 = getAdjacencyMap(false);
search = new Dijkstra(adjacencyMap, currentRoom.index);
search.findShortestPath();
search2 = new Dijkstra(adjacencyMap2, currentRoom.index);
search2.findShortestPath();
}
public function useShrine():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:Array;
var _local5:Item;
var _local6:*;
var _local7:*;
var _local8:Consumable;
var _local9:Array;
var _local10:Enchantment;
if ((((currentRoom.shrine == null)) || (currentRoom.shrine.used))){
return;
};
_local1 = getChildByName("shrine_dlg");
if (_local1 != null){
removeChild(_local1);
};
if ((currentRoom.shrine is RecoveryShrine)){
pc_party.fullRecovery();
pc_party.stat_shrines_used++;
_local2 = 0;
while (_local2 < pc_party.members.length) {
_local3 = dinterface.getChildByName(("char" + (_local2 + 1)));
if (_local3 == null){
} else {
CharacterPortrait(_local3).addPortraitAnimation(PortraitAnimation.heal);
};
_local2++;
};
} else {
if (currentRoom.shrine.type == SpecialShrine.EQUIPMENT_BUFF){
_local4 = new Array();
for each (_local5 in pc_party.inventory) {
if ((_local5 is Equipment)){
if (_local5.item_rarity != Item.white){
continue;
} else {
_local4.push(_local5);
};
};
};
if (_local4.length){
_local6 = _local4[dmf.randomNum(0, (_local4.length - 1))];
_local7 = new _local6.constructor(dungeon_level, Item.purple);
pc_party.removeFromInventory(_local6);
pc_party.addToInventory(_local7);
dm.sound.play(SoundControl.heal);
};
} else {
if (currentRoom.shrine.type == SpecialShrine.POTION_BUFF){
pc_party.addToInventory(new PotionBody());
_local9 = new Array();
_local8 = pc_party.getHealthPotion(false);
if (((!((_local8 == null))) && ((_local8.stack >= 5)))){
_local9.push(_local8);
};
_local8 = pc_party.getHealthPotion(true);
if (((!((_local8 == null))) && ((_local8.stack >= 10)))){
_local9.push(_local8);
};
_local8 = pc_party.getPowerPotion(false);
if (((!((_local8 == null))) && ((_local8.stack >= 5)))){
_local9.push(_local8);
};
_local8 = pc_party.getPowerPotion(true);
if (((!((_local8 == null))) && ((_local8.stack >= 10)))){
_local9.push(_local8);
};
if (!(_local9.length)){
} else {
_local8 = _local9[dmf.randomNum(0, (_local9.length - 1))];
if ((_local8 is PotionPowerSmall)){
_local8.stack = (_local8.stack - 10);
pc_party.addToInventory(new PotionWits());
} else {
if ((_local8 is PotionPower)){
_local8.stack = (_local8.stack - 5);
pc_party.addToInventory(new PotionWits());
} else {
if ((_local8 is PotionHealthSmall)){
_local8.stack = (_local8.stack - 10);
pc_party.addToInventory(new PotionBody());
} else {
if ((_local8 is PotionHealth)){
_local8.stack = (_local8.stack - 5);
pc_party.addToInventory(new PotionBody());
};
};
};
};
if (_local8.stack <= 0){
pc_party.removeFromInventory(_local8);
};
dm.sound.play(SoundControl.heal);
};
} else {
if (currentRoom.shrine.type == SpecialShrine.ENCHANTMENT){
_local10 = new Enchantment(dungeon_level, 0, true);
pc_party.addToInventory(_local10);
dm.sound.play(SoundControl.heal);
};
};
};
};
currentRoom.shrine.used = true;
currentRoom.shrine.fade();
dm.main.saveParty();
dm.main.saveDungeon(false);
updateChars();
}
function removed(_arg1:Event):void{
stage.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
}
private function addRecoveryShrineToRoom(_arg1:DungeonRoom):void{
var _local2:*;
_local2 = new RecoveryShrine();
_local2.x = _arg1.getCenterHorz();
_local2.y = _arg1.getCenterVert();
_arg1.shrine = _local2;
_local2.room = _arg1;
_arg1.setChild(_local2);
shrines.push(_local2);
_local2.mask = null;
}
function roomOut(_arg1:MouseEvent):void{
var _local2:DungeonRoom;
if (travelling){
return;
};
_local2 = DungeonRoom(_arg1.currentTarget);
if (!(_local2.seen)){
return;
};
currentRoute = null;
removeMovementArrow();
}
private function initGrid():void{
var _local1:*;
var _local2:*;
grid = new Array(grid_width);
_local1 = 0;
while (_local1 < grid_width) {
grid[_local1] = new Array(grid_height);
_local2 = 0;
while (_local2 < grid_height) {
grid[_local1][_local2] = null;
_local2++;
};
_local1++;
};
}
private function drawInterface():void{
var _local1:CharacterPortrait;
var _local2:*;
var _local3:*;
dinterface.x = 0;
dinterface.y = 0;
this.addChild(dinterface);
dinterface.campaign_label.mouseEnabled = false;
dinterface.campaign_label.text = Campaign.getName(pc_party.campaign);
dm.embolden(dinterface.campaign_label);
dinterface.level_label.mouseEnabled = false;
dinterface.level_label.text = ("Level " + dungeon_level);
dm.embolden(dinterface.level_label);
if (DungeonMain.debug){
dinterface.explore_btn.addEventListener(MouseEvent.MOUSE_DOWN, exploreAll);
dinterface.newdungeon_btn.addEventListener(MouseEvent.MOUSE_DOWN, newDungeonClick);
dinterface.clear_btn.addEventListener(MouseEvent.MOUSE_DOWN, clearHordes);
dinterface.gear_btn.addEventListener(MouseEvent.MOUSE_DOWN, addDebugGear);
dinterface.heal_btn.addEventListener(MouseEvent.MOUSE_DOWN, debugHeal);
dinterface.critical_btn.addEventListener(MouseEvent.MOUSE_DOWN, showCriticalPath);
dinterface.level_debug.text = ((("Health: " + MonsterCharacter.getHealthMax(dungeon_level)) + " | Damage: ") + MonsterCharacter.getBaseDamage(dungeon_level));
} else {
if (dinterface.contains(dinterface.explore_btn)){
dinterface.removeChild(dinterface.explore_btn);
};
if (dinterface.contains(dinterface.newdungeon_btn)){
dinterface.removeChild(dinterface.newdungeon_btn);
};
if (dinterface.contains(dinterface.clear_btn)){
dinterface.removeChild(dinterface.clear_btn);
};
if (dinterface.contains(dinterface.gear_btn)){
dinterface.removeChild(dinterface.gear_btn);
};
if (dinterface.contains(dinterface.heal_btn)){
dinterface.removeChild(dinterface.heal_btn);
};
if (dinterface.contains(dinterface.level_debug)){
dinterface.removeChild(dinterface.level_debug);
};
if (dinterface.contains(dinterface.critical_btn)){
dinterface.removeChild(dinterface.critical_btn);
};
};
if (DungeonMain.BETA){
if (!(dinterface.contains(dinterface.betaFunctions))){
dinterface.addChild(dinterface.betaFunctions);
};
dinterface.betaFunctions.betaLevel.addEventListener(MouseEvent.MOUSE_DOWN, descendClick);
dinterface.betaFunctions.betaEquipment.addEventListener(MouseEvent.MOUSE_DOWN, addBetaGear);
dinterface.betaFunctions.betaHeal.addEventListener(MouseEvent.MOUSE_DOWN, debugHeal);
} else {
if (dinterface.contains(dinterface.betaFunctions)){
dinterface.removeChild(dinterface.betaFunctions);
};
};
dinterface.rest_button.addEventListener(MouseEvent.MOUSE_DOWN, restButtonClick);
dinterface.inventory_btn.addEventListener(MouseEvent.MOUSE_DOWN, inventoryClick);
dinterface.menu_btn.addEventListener(MouseEvent.MOUSE_DOWN, menuClick);
dinterface.hint_btn.addEventListener(MouseEvent.MOUSE_DOWN, hintClick);
dinterface.rating_btn.addEventListener(MouseEvent.MOUSE_DOWN, ratingClick);
this.addEventListener(Event.ADDED_TO_STAGE, added);
this.addEventListener(Event.REMOVED_FROM_STAGE, removed);
updateInventoryCount();
_local2 = 0;
while (_local2 < pc_party.members.length) {
_local3 = dinterface.getChildByName(("slot" + (_local2 + 1)));
if (_local3 == null){
} else {
if ((pc_party.members[_local2] is PC_Adventurer)){
} else {
_local1 = new CharacterPortrait();
_local1.x = _local3.x;
_local1.y = _local3.y;
_local1.setChar(pc_party.members[_local2]);
_local1.name = ("char" + (_local2 + 1));
_local1.setGlow();
dinterface.addChild(_local1);
pc_party.members[_local2].portraitRef = _local1;
dinterface.removeChild(_local3);
_local1.addEventListener(MouseEvent.MOUSE_DOWN, portraitClick);
};
};
_local2++;
};
if (!(exit_found)){
if (dinterface.getChildByName("descend_button") != null){
dinterface.removeChild(dinterface.descend_button);
};
};
if (((!(previousLevelCleared)) && (!((dungeon_level == 10))))){
removeRestButton();
};
}
function roomOver(_arg1:MouseEvent):void{
var _local2:DungeonRoom;
var _local3:Array;
var _local4:int;
var _local5:DungeonRoom;
var _local6:Array;
if (travelling){
return;
};
_local2 = DungeonRoom(_arg1.currentTarget);
if (_local2 == currentRoom){
return;
};
if (!(_local2.seen)){
return;
};
if (!(DungeonMain.pathfinding)){
if (currentRoom.isAdjacentTo(_local2)){
currentRoute = new Array();
currentRoute.push(currentRoom);
currentRoute.push(_local2);
drawMovementArrow(currentRoute);
} else {
removeMovementArrow();
return;
};
};
_local3 = new Array();
_local4 = 999;
if (((!((_local2.horde == null))) && (!(_local2.horde.defeated)))){
for each (_local5 in _local2.adjacent) {
if (!(_local5.seen)){
} else {
_local6 = findRouteTo(_local5, false);
if (_local6.length < _local4){
_local4 = _local6.length;
_local3 = _local6;
};
};
};
};
if (validPathRooms(_local3)){
_local3.push(_local2);
currentRoute = _local3;
} else {
currentRoute = findRouteTo(_local2);
};
drawMovementArrow(currentRoute);
}
public function fullyCleared():Boolean{
var _local1:*;
if (getHordesDefeated() == hordes.length){
_local1 = 0;
while (_local1 < room_array.length) {
if (room_array[_local1].explored == false){
return (false);
};
_local1++;
};
return (true);
};
return (false);
}
private function addRoomListeners():void{
var _local1:*;
_local1 = 0;
while (_local1 < room_array.length) {
room_array[_local1].addEventListener(MouseEvent.MOUSE_DOWN, roomClick);
room_array[_local1].addEventListener(MouseEvent.MOUSE_OVER, roomOver);
room_array[_local1].addEventListener(MouseEvent.MOUSE_OUT, roomOut);
_local1++;
};
}
private function addTreasureToRoom(_arg1:DungeonRoom, _arg2:Boolean):void{
var _local3:*;
_local3 = new TreasureChest(pc_party, dungeon_level);
if (_arg2){
_local3.loot.push(new PortalScroll());
portalScrollRoomIndex = _arg1.index;
};
_local3.x = _arg1.getCenterHorz();
_local3.y = _arg1.getCenterVert();
_arg1.treasure = _local3;
chests.push(_local3);
_arg1.setChild(_local3);
_local3.mask = null;
}
public function getIntroduction(_arg1:int):String{
var _local2:*;
var _local3:String;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
_local2 = false;
_local3 = "The party descend to the next level.\n\n";
if (pc_party.members.length == 1){
return ("");
};
if ((((dungeon_level > DungeonMain.MAX_LEVEL)) && ((_arg1 == Horde.special)))){
return ((_local3 + "An uneasy peace holds in this area, as the dungeon's denizens come together to plot and scheme."));
};
_local4 = dmf.randomNum(0, (pc_party.members.length - 1));
if (dmf.randomNum(0, 100) < 8){
_local2 = true;
} else {
_local2 = false;
};
if ((pc_party.members[_local4] is PC_Cleric)){
if (_local2){
_local3 = (_local3 + (((pc_party.members[_local4].charname + " performs a rite of battle.\n'") + Horde.nameForRace(_arg1, true)) + ", then? It makes little difference. Nothing may hinder the righteous.'"));
} else {
if (_arg1 == Horde.undead){
_local3 = (_local3 + (pc_party.members[_local4].charname + " scowls.\n'This place bears the taint of the undead.'"));
} else {
if (_arg1 == Horde.greenskins){
_local3 = (_local3 + (("'There is heresy here. The greenskins and their false gods hold\nsway,' spits " + pc_party.members[_local4].charname) + ", growing incensed."));
} else {
if (_arg1 == Horde.creatures){
_local3 = (_local3 + (("'The creatures here are base, soulless things: the work of no higher\npower,' mutters " + pc_party.members[_local4].charname) + "."));
} else {
if (_arg1 == Horde.cultists){
_local3 = (_local3 + (pc_party.members[_local4].charname + " appears distressed.\n'This place.. it is utterly corrupted by the heresies of the cultists.\nWe should not linger here.'"));
} else {
if (_arg1 == Horde.dwarves){
_local3 = (_local3 + (((("'The graven images of the dwarves. Those twisted parodies of true men lurk here.' says " + pc_party.members[_local4].charname) + ", disgust plain on ") + pc_party.members[_local4].genderPossessive()) + " face."));
};
};
};
};
};
};
} else {
if ((pc_party.members[_local4] is PC_Warrior)){
if (_local2){
_local3 = (_local3 + (((pc_party.members[_local4].charname + " says 'An opportunity to test my prowess against ") + Horde.nameForRace(_arg1)) + " is welcome. To arms!'"));
} else {
if (_arg1 == Horde.undead){
_local3 = (_local3 + (((("'It is plain that this is the domain of the undead. Be on your\nguard,' says " + pc_party.members[_local4].charname) + ", adjusting ") + pc_party.members[_local4].genderPossessive()) + " armor."));
} else {
if (_arg1 == Horde.greenskins){
_local3 = (_local3 + (pc_party.members[_local4].charname + " points.\n'Look, there: the trappings of the orc. Stupid beasts, but\ndangerous. Stay close.'"));
} else {
if (_arg1 == Horde.creatures){
_local3 = (_local3 + (pc_party.members[_local4].charname + " inhales, then spits.\n'The stench of carrion. Whatever monsters lurk here, they shall not\nfind us so easy a meal.'"));
} else {
if (_arg1 == Horde.cultists){
_local3 = (_local3 + (("'Ho, there- that emblem. The mark of the Cult of the Outward\nPath,' notes " + pc_party.members[_local4].charname) + ".\n'Our foes will not hail from this world alone.'"));
} else {
if (_arg1 == Horde.dwarves){
_local3 = (_local3 + (("'The stonework here is different. Could this area belong to the dwarves?' asks " + pc_party.members[_local4].charname) + "."));
};
};
};
};
};
};
} else {
if ((pc_party.members[_local4] is PC_Rogue)){
if (_local2){
_local3 = (_local3 + (((((((((pc_party.members[_local4].charname + " checks ") + pc_party.members[_local4].genderPossessive()) + " pack for provisions.\n'I just hope we're not fighting any more ") + Horde.nameForRace(_arg1)) + ".'\n") + pc_party.members[_local4].genderPronoun(true)) + " turns ") + pc_party.members[_local4].genderPossessive()) + " head sharply as a distinctive sound echoes down the corridor.\n'Well. I suppose I should have seen that coming.'"));
} else {
if (_arg1 == Horde.undead){
_local3 = (_local3 + (("'Did you hear that?' asks " + pc_party.members[_local4].charname) + ", peering nervously into the gloom.\n'I have a bad feeling we're dealing with walking corpses, here.'"));
} else {
if (_arg1 == Horde.greenskins){
_local3 = (_local3 + (((pc_party.members[_local4].charname + " sniffs the air.\n'Did we take a wrong turn into a sewer? Oh, right.. orcs.'\n") + pc_party.members[_local4].genderPronoun(true)) + " sighs."));
} else {
if (_arg1 == Horde.creatures){
_local3 = (_local3 + (pc_party.members[_local4].charname + " sits down heavily, taking a moment to rest.\n'Ugh, I think I may be sitting in monster droppings.'"));
} else {
if (_arg1 == Horde.cultists){
_local3 = (_local3 + (("'This place doesn't feel right,' mutters " + pc_party.members[_local4].charname) + ".\n'It's those twisted cultists.'"));
} else {
if (_arg1 == Horde.dwarves){
_local3 = (_local3 + (pc_party.members[_local4].charname + " looks around appraisingly.\n'This is definitely dwarf work-- they can't live anywhere without embellishing it with their carvings. And where there are dwarves.. there's treasure.'"));
};
};
};
};
};
};
} else {
if ((pc_party.members[_local4] is PC_Mage)){
if (_local2){
_local3 = (_local3 + (((("At a gesture from " + pc_party.members[_local4].charname) + ", a glyph appears fleetingly in the air.\n'") + Horde.nameForRace(_arg1, true)) + ". There can be no doubt: my mastery of detection spells\nis complete.'"));
} else {
if (_arg1 == Horde.undead){
_local3 = (_local3 + (("Warning glyphs flash in the air about " + pc_party.members[_local4].charname) + ".\n'The dark arts are at work in this place. The dead walk.'"));
} else {
if (_arg1 == Horde.greenskins){
_local3 = (_local3 + (pc_party.members[_local4].charname + " concentrates for a moment.\n'The mystic arts are being practiced here, but weakly. This place\nmust be home to the vile orcs and their kin.'"));
} else {
if (_arg1 == Horde.creatures){
_local3 = (_local3 + (((pc_party.members[_local4].charname + " falters in ") + pc_party.members[_local4].genderPossessive()) + " preparation.\n'There is ancient power here. The creatures of the deep are drawn to\nit.'"));
} else {
if (_arg1 == Horde.cultists){
_local3 = (_local3 + (("'The fabric of the aether has been rent,' states " + pc_party.members[_local4].charname) + ".\n'No doubt the work of those reckless amateurs, the Cult of the\nOutward Path.'"));
} else {
if (_arg1 == Horde.dwarves){
_local3 = (_local3 + (("'I sense runic energies. It can only be agents of the Earthern Nations,' says " + pc_party.members[_local4].charname) + ".\n'What a pity they have allied themselves with our enemy.'"));
};
};
};
};
};
};
} else {
if ((pc_party.members[_local4] is PC_Ranger)){
if (_local2){
_local3 = (_local3 + (((("Examining the entrance, " + pc_party.members[_local4].charname) + " slowly nods.\n'There were ") + Horde.nameForRace(_arg1)) + " here, and recently. The signs of their passage\n are unmistakable.'"));
} else {
if (_arg1 == Horde.undead){
_local3 = (_local3 + (pc_party.members[_local4].charname + " crouches, noting debris strewn on the dank stone floor.\n'Nothing but bonemeal and crypt-dust. Undead.'"));
} else {
if (_arg1 == Horde.greenskins){
_local3 = (_local3 + (("'I've found something! Look here: the spoor of greenskins,' calls " + pc_party.members[_local4].charname) + ", after examining the area."));
} else {
if (_arg1 == Horde.creatures){
_local3 = (_local3 + (((pc_party.members[_local4].charname + " grows excited as ") + pc_party.members[_local4].genderPronoun()) + " scouts the immediate area.\n'There are tracks here.. creatures of many types. We have found\nourselves a hunt.'"));
} else {
if (_arg1 == Horde.cultists){
_local3 = (_local3 + (("'Human footprints,' remarks " + pc_party.members[_local4].charname) + ".\n'Cultists?'"));
} else {
if (_arg1 == Horde.dwarves){
_local3 = (_local3 + (("'It doesn't take a master tracker to identify this place.' says " + pc_party.members[_local4].charname) + ".\n'There are definitely dwarves from the Eartern Nations nearby.'"));
};
};
};
};
};
};
} else {
if ((pc_party.members[_local4] is PC_Barbarian)){
if (_local2){
_local3 = (_local3 + (((pc_party.members[_local4].charname + " growls 'I will tear these ") + Horde.nameForRace(_arg1)) + " apart!'"));
} else {
if (_arg1 == Horde.undead){
_local3 = (_local3 + (("'This place is crawling with the dead. Can't they stay killed?' growls " + pc_party.members[_local4].charname) + "."));
} else {
if (_arg1 == Horde.greenskins){
_local3 = (_local3 + (("'Greenskins. I begin to wonder if we'll ever find a real fight in this hole!' says " + pc_party.members[_local4].charname) + ", scowling."));
} else {
if (_arg1 == Horde.creatures){
_local3 = (_local3 + (("'What kind of sty is this?' demands " + pc_party.members[_local4].charname) + ", kicking at debris strewn on the ground.\n'Some strange manner of beast. Foul tasting, no doubt.'"));
} else {
if (_arg1 == Horde.cultists){
_local3 = (_local3 + (("'The gaudy emblems of the fanatics,' notes " + pc_party.members[_local4].charname) + ".\n'I am ill at ease around such madness.'"));
} else {
if (_arg1 == Horde.dwarves){
_local3 = (_local3 + (("'I smell ale!' roars " + pc_party.members[_local4].charname) + ".\n'Let us take it from the half-men, come!'"));
};
};
};
};
};
};
} else {
if ((pc_party.members[_local4] is PC_Conjuror)){
if (_local2){
_local3 = (_local3 + (((pc_party.members[_local4].charname + " stares fixedly into the empty air.\n'There are ") + Horde.nameForRace(_arg1, true)) + " nearby. I have it from a reliable source.'"));
} else {
if (_arg1 == Horde.undead){
_local3 = (_local3 + (pc_party.members[_local4].charname + " falls silent.\n'Necromancy.. I can sense the souls in bondage. We will face the undead here.'"));
} else {
if (_arg1 == Horde.greenskins){
_local3 = (_local3 + (("I've seen enough Orc-pits in my time to know the look of one,' remarks " + pc_party.members[_local4].charname) + "\n'Greenskins live here.'"));
} else {
if (_arg1 == Horde.creatures){
_local3 = (_local3 + (("'Creatures. I can hear them.' says " + pc_party.members[_local4].charname) + "\n'It's not a sound I'm likely to forget.'"));
} else {
if (_arg1 == Horde.cultists){
_local3 = (_local3 + (("'Aetherbreachers,' sighs " + pc_party.members[_local4].charname) + ".\n'The signs are unmistakable. We will have to intervene- the dimensional boundary must be respected.'"));
} else {
if (_arg1 == Horde.dwarves){
_local3 = (_local3 + (("'This is familiar enough,' says " + pc_party.members[_local4].charname) + ".\n'A dwarf-den. What could they be looking for, here?'"));
};
};
};
};
};
};
} else {
_local3 = (_local3 + (((pc_party.members[_local4].charname + " says 'There are ") + Horde.nameForRace(_arg1)) + " here.'"));
};
};
};
};
};
};
};
_local3 = (_local3 + "\n\n");
_local5 = _local4;
while (_local5 == _local4) {
_local5 = dmf.randomNum(0, (pc_party.members.length - 1));
};
if (dmf.randomNum(0, 100) < 8){
_local2 = true;
} else {
_local2 = false;
};
if ((pc_party.members[_local5] is PC_Cleric)){
if (_local2){
_local3 = (_local3 + (pc_party.members[_local5].charname + " intones a sonorous prayer.\n'Let our faith be our shield!'"));
} else {
if (_arg1 == Horde.undead){
_local3 = (_local3 + (((("'Those lost souls will find peace this day,' promises " + pc_party.members[_local5].charname) + ",\n") + pc_party.members[_local5].genderPossessive()) + " countenance grim."));
} else {
if (_arg1 == Horde.greenskins){
_local3 = (_local3 + (((((pc_party.members[_local5].charname + " grimaces.\n'The beasts will not defile this place much longer. We shall make\ncertain of it,' ") + pc_party.members[_local5].genderPronoun()) + " growls, hefting ") + pc_party.members[_local5].genderPossessive()) + " weapon."));
} else {
if (_arg1 == Horde.creatures){
_local3 = (_local3 + (((pc_party.members[_local5].charname + " readies ") + pc_party.members[_local5].genderSelf()) + ".\n'Let us cleanse this foul menagerie.'"));
} else {
if (_arg1 == Horde.cultists){
_local3 = (_local3 + (("'Heretics!' snarls " + pc_party.members[_local5].charname) + ".\n'Their work here is an affront: we must make an end of it.'"));
} else {
if (_arg1 == Horde.dwarves){
_local3 = (_local3 + (("'Crude and misshapen things, a mockery of the divine!' snarls " + pc_party.members[_local5].charname) + "."));
};
};
};
};
};
};
} else {
if ((pc_party.members[_local5] is PC_Warrior)){
if (_local2){
_local3 = (_local3 + (((pc_party.members[_local5].charname + " draws ") + pc_party.members[_local5].genderPossessive()) + " weapon.\n'Stay behind me. We will cut a path, no matter how many may come.'"));
} else {
if (_arg1 == Horde.undead){
_local3 = (_local3 + (pc_party.members[_local5].charname + " nods slightly.\n'Then let us lay them to rest.'"));
} else {
if (_arg1 == Horde.greenskins){
_local3 = (_local3 + (((pc_party.members[_local5].charname + " sharpens ") + pc_party.members[_local5].genderPossessive()) + " blade.\n'The clumsy brawn of those ragged brutes is little match for the\nfighting arm of a seasoned warrior. Let them come.'"));
} else {
if (_arg1 == Horde.creatures){
_local3 = (_local3 + (((pc_party.members[_local5].charname + " shifts ") + pc_party.members[_local5].genderPossessive()) + " weight.\n'It will take more than a monstrous rabble to slow us.\nCome, this way.'"));
} else {
if (_arg1 == Horde.cultists){
_local3 = (_local3 + (("'The Cult of the Outward Path,' muses " + pc_party.members[_local5].charname) + ".\n'Let us see if the fiends they worship can protect them.'"));
} else {
if (_arg1 == Horde.dwarves){
_local3 = (_local3 + (("'Their small size belies their strength,' remarks " + pc_party.members[_local5].charname) + ".\n'Banish any thoughts of an easy battle.'"));
};
};
};
};
};
};
} else {
if ((pc_party.members[_local5] is PC_Rogue)){
if (_local2){
_local3 = (_local3 + (pc_party.members[_local5].charname + " glances around.\n'Is it too late to go back?'"));
} else {
if (_arg1 == Horde.undead){
_local3 = (_local3 + (("'Great. My favorite,' snorts " + pc_party.members[_local5].charname) + "."));
} else {
if (_arg1 == Horde.greenskins){
_local3 = (_local3 + (((pc_party.members[_local5].charname + " holds ") + pc_party.members[_local5].genderPossessive()) + " nose.\n'I suppose they won't smell any better after we kill them..'"));
} else {
if (_arg1 == Horde.creatures){
_local3 = (_local3 + (pc_party.members[_local5].charname + " sighs.\n'More things that want to eat me.'"));
} else {
if (_arg1 == Horde.cultists){
_local3 = (_local3 + (((("'Religious types,' mutters " + pc_party.members[_local5].charname) + ", rolling ") + pc_party.members[_local5].genderPossessive()) + " eyes."));
_local6 = 0;
while (_local6 < pc_party.members.length) {
if ((pc_party.members[_local6] is PC_Cleric)){
_local3 = (_local3 + (((("\n\n" + pc_party.members[_local6].charname) + " glares at ") + pc_party.members[_local5].charname) + "."));
break;
};
_local6++;
};
} else {
if (_arg1 == Horde.dwarves){
_local3 = (_local3 + (("'Some people might feel guilty about taking from someone smaller than themselves,' muses " + pc_party.members[_local5].charname) + ".\n'Not me.'"));
};
};
};
};
};
};
} else {
if ((pc_party.members[_local5] is PC_Mage)){
if (_local2){
_local3 = (_local3 + (pc_party.members[_local5].charname + " finishes an incantation.\n'I am prepared.'"));
} else {
if (_arg1 == Horde.undead){
_local3 = (_local3 + (pc_party.members[_local5].charname + " frowns.\n'The spawn of the dark arts. Despicable.'"));
} else {
if (_arg1 == Horde.greenskins){
_local3 = (_local3 + (pc_party.members[_local5].charname + " nods.\n'Communers with spirits and petty dabblers in the art. Precious\nlittle here to challenge me.'"));
} else {
if (_arg1 == Horde.creatures){
_local3 = (_local3 + (((pc_party.members[_local5].charname + " snaps shut ") + pc_party.members[_local5].genderPossessive()) + " spellbook.\n'Monsters and aberrations. I have some experience with their ilk.'"));
} else {
if (_arg1 == Horde.cultists){
_local3 = (_local3 + (("'Meddlers! Fools!' rages " + pc_party.members[_local5].charname) + ".\n'They cannot begin to comprehend the forces they toy with.'"));
} else {
if (_arg1 == Horde.dwarves){
_local3 = (_local3 + (("'Greed has ever been the downfall of the dwarves,' says " + pc_party.members[_local5].charname) + ".\n'No matter what bribes they have been offered, they will not halt us here.'"));
};
};
};
};
};
};
} else {
if ((pc_party.members[_local5] is PC_Ranger)){
if (_local2){
_local3 = (_local3 + (pc_party.members[_local5].charname + " smiles.\n'Easy prey.'"));
} else {
if (_arg1 == Horde.undead){
_local3 = (_local3 + (pc_party.members[_local5].charname + " nocks an arrow.\n'Unnatural foes, but they shall fall all the same.'"));
} else {
if (_arg1 == Horde.greenskins){
_local3 = (_local3 + (pc_party.members[_local5].charname + " appears disappointed.\n'Savages. They lack all finesse.'"));
} else {
if (_arg1 == Horde.creatures){
_local3 = (_local3 + (((pc_party.members[_local5].charname + " tests ") + pc_party.members[_local5].genderPossessive()) + " bowstring.\n'At last, worthy prey.'"));
} else {
if (_arg1 == Horde.cultists){
_local3 = (_local3 + (("'Perhaps here I can find a fresh challenge,' remarks " + pc_party.members[_local5].charname) + "."));
} else {
if (_arg1 == Horde.dwarves){
_local3 = (_local3 + (("'The dwarves are hardy foes, don't underestimate them,' says " + pc_party.members[_local5].charname) + "."));
};
};
};
};
};
};
} else {
if ((pc_party.members[_local5] is PC_Barbarian)){
if (_local2){
_local3 = (_local3 + (("'My blade cries out for blood!' says " + pc_party.members[_local5].charname) + ", a little too loudly."));
} else {
if (_arg1 == Horde.undead){
_local3 = (_local3 + (pc_party.members[_local5].charname + " grunts.\n'I will show these corpses how to die!'"));
} else {
if (_arg1 == Horde.greenskins){
_local3 = (_local3 + (("'Orcs?' " + pc_party.members[_local5].charname) + " spits.\n'Let us see who is the stronger.'"));
} else {
if (_arg1 == Horde.creatures){
_local3 = (_local3 + (("'In my youth I wrestled many beasts,' says " + pc_party.members[_local5].charname) + "\n'I have only gotten stronger.'"));
} else {
if (_arg1 == Horde.cultists){
_local3 = (_local3 + (("'Pah! Weaklings!' mutters " + pc_party.members[_local5].charname) + "."));
} else {
if (_arg1 == Horde.dwarves){
_local3 = (_local3 + (("'The dwarves are hardy foes, don't underestimate them,' says " + pc_party.members[_local5].charname) + "."));
};
};
};
};
};
};
} else {
if ((pc_party.members[_local5] is PC_Conjuror)){
if (_local2){
_local3 = (_local3 + (pc_party.members[_local5].charname + " mutters in an ancient tongue, and a faint glow suffuses the air around him.\n'Let's get this over with.'"));
} else {
if (_arg1 == Horde.undead){
_local3 = (_local3 + (("'Necromancy. It shames me to admit I dabbled with it in my youth,' says " + pc_party.members[_local5].charname) + " sadly.\n'I was a fool.'"));
_local7 = 0;
while (_local7 < pc_party.members.length) {
if ((pc_party.members[_local7] is PC_Mage)){
_local3 = (_local3 + (((("\n\n" + pc_party.members[_local7].charname) + " scowls at ") + pc_party.members[_local5].charname) + ". 'Indeed.'"));
break;
};
_local7++;
};
} else {
if (_arg1 == Horde.greenskins){
_local3 = (_local3 + (("'Greenskins? Be wary of their shamans, and the dark power they wield. I know it only too well.' says " + pc_party.members[_local5].charname) + " enigmatically.\n"));
} else {
if (_arg1 == Horde.creatures){
_local3 = (_local3 + (pc_party.members[_local5].charname + " looks up.\n'I have an interest in the creatures of the deep places. Perhaps I can learn something here.'"));
} else {
if (_arg1 == Horde.cultists){
_local3 = (_local3 + (("'They are so close to the truth, but so woefully misguided,' sighs " + pc_party.members[_local5].charname) + ".\n'I pity them, more than anything. And yet they must be stopped.'"));
} else {
if (_arg1 == Horde.dwarves){
_local3 = (_local3 + (("'The Earthen Nations? Here?' asks " + pc_party.members[_local5].charname) + ".\n'I suppose they were always difficult to trust.'"));
};
};
};
};
};
};
} else {
_local3 = (_local3 + (((pc_party.members[_local5].charname + " says 'We will defeat the ") + Horde.nameForRace(_arg1)) + ".'"));
};
};
};
};
};
};
};
return (_local3);
}
function TestForAdjacentCorridorV(_arg1:DungeonRoom):Boolean{
if (_arg1 == null){
return (false);
};
if ((_arg1 is rCorridorV)){
return (true);
};
return (false);
}
public function updateChars():void{
var _local1:CharacterPortrait;
var _local2:int;
updateCleared();
updateRating();
updateInventoryCount();
_local2 = 0;
while (_local2 < pc_party.members.length) {
_local1 = CharacterPortrait(dinterface.getChildByName(("char" + (_local2 + 1))));
if ((((_local1 == null)) || (!((_local1 is CharacterPortrait))))){
} else {
pc_party.members[_local2].portraitRef = _local1;
CharacterPortrait(_local1).update();
CharacterPortrait(_local1).setGlow();
CharacterPortrait(_local1).setHiding((pc_party.sneaking > 0));
};
_local2++;
};
if (parent != null){
DungeonMain(parent).saveParty();
DungeonMain(parent).saveChars();
};
}
function TestForAdjacentCorridorH(_arg1:DungeonRoom):Boolean{
if (_arg1 == null){
return (false);
};
if ((_arg1 is rCorridorH)){
return (true);
};
return (false);
}
private function updateCleared():void{
var _local1:int;
var _local2:*;
_local1 = getClearedPercent();
dinterface.cleared_bar.label.text = ((" " + String(_local1)) + "% CLEARED");
dinterface.cleared_bar.bar_mask.width = Math.ceil(((_local1 / 100) * bar_max_width));
_local2 = "normal";
if (_local1 == 100){
_local2 = "complete";
};
dinterface.cleared_bar.holder.gotoAndStop(_local2);
}
private function GenerateMonsters():void{
var _local1:DungeonRoom;
var _local2:*;
var _local3:int;
var _local4:int;
var _local5:Array;
var _local6:*;
var _local7:*;
var _local8:MonsterCharacter;
var _local9:Horde;
_local2 = 0;
if (DungeonMain.nobaddies){
return;
};
_local3 = (10 - hordes.length);
_local4 = 0;
if ((((pc_party.campaign == Campaign.ORIGINAL)) && ((dungeon_level == DungeonMain.MAX_LEVEL)))){
_local3--;
} else {
_local7 = getBossRoom();
addHordeToRoom(_local7, 1);
bossRoom = _local7;
_local4++;
};
_local5 = getRandomRoomList(true);
_local6 = 0;
for (;_local6 < _local5.length;_local6++) {
if (roomValidForMonster(_local5[_local6])){
addHordeToRoom(_local5[_local6]);
_local4++;
} else {
continue;
};
if (_local4 >= _local3){
break;
};
};
if (pc_party.campaign == Campaign.DELUXE){
_local8 = new mFearSower(dungeon_level);
for each (_local9 in hordes) {
if ((((_local9.members.length == 6)) || ((_local9.members.length < 3)))){
} else {
if (_local9.legendary){
} else {
_local8.pos = _local9.findEmptySlot(true);
_local9.members.push(_local8);
break;
};
};
};
};
}
public function createFromDataArray(_arg1:Array, _arg2:int, _arg3:Array, _arg4:Boolean=false):Boolean{
var _local5:*;
var _local6:DungeonRoom;
var _local7:Boolean;
var _local8:*;
var _local9:Horde;
this.race = race;
this.tileset = tileset;
this.previousLevelCleared = _arg4;
initGrid();
initRoomArrays();
_local5 = 0;
while (_local5 < _arg1.length) {
_local6 = DungeonRoomData(_arg1[_local5]).toRoom(_arg4);
PlaceRoom(_local6);
if ((_local6 is rDemonRoom)){
bossRoom = _local6;
};
if (_arg1[_local5].treasure){
_local7 = false;
if (_local5 == portalScrollRoomIndex){
_local7 = true;
};
if (pc_party.attrition){
_local7 = false;
};
addTreasureToRoom(_local6, _local7);
} else {
if (_arg1[_local5].shrine){
if (_arg1[_local5].shrine == RecoveryShrine.TYPE_ID){
addRecoveryShrineToRoom(_local6);
} else {
addSpecialShrineToRoom(_local6, _arg1[_local5].shrine);
};
} else {
if (_arg1[_local5].special){
addSpecialIconToRoom(_local6);
} else {
_local8 = 0;
while (_local8 < _arg3.length) {
if (HordeData(_arg3[_local8]).roomIndex == _local5){
_local9 = HordeData(_arg3[_local8]).toHorde();
room_array[_local5].setHorde(_local9);
hordes.push(_local9);
_local9.mask = null;
if (_local9.boss){
bossRoom = _local6;
};
break;
};
_local8++;
};
};
};
};
_local5++;
};
TestAllRoomEdges();
generateDoors();
_local5 = 0;
while (_local5 < room_array.length) {
if (_arg1[_local5].isEntrance){
room_array[_local5].addEntrance(_arg4);
entryRoom = room_array[_local5];
} else {
if (_arg1[_local5].isExit){
room_array[_local5].addExit();
exitRoom = room_array[_local5];
};
};
_local5++;
};
setIndices();
drawRooms();
drawDoors();
currentRoom = room_array[_arg2];
currentRoom.travelTo(true);
roomHighlights(true);
updateDemonRoom();
if (((previousLevelCleared) || ((dungeon_level == 10)))){
addRestButton();
} else {
removeRestButton();
};
addRoomListeners();
return (true);
}
public function cleanup():void{
var _local1:int;
var _local2:*;
removeEventListener(Event.ENTER_FRAME, onFrame);
dinterface.explore_btn.removeEventListener(MouseEvent.MOUSE_DOWN, exploreAll);
dinterface.newdungeon_btn.removeEventListener(MouseEvent.MOUSE_DOWN, newDungeonClick);
dinterface.clear_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clearHordes);
dinterface.gear_btn.removeEventListener(MouseEvent.MOUSE_DOWN, addDebugGear);
dinterface.heal_btn.removeEventListener(MouseEvent.MOUSE_DOWN, debugHeal);
dinterface.critical_btn.removeEventListener(MouseEvent.MOUSE_DOWN, showCriticalPath);
dinterface.rating_btn.removeEventListener(MouseEvent.MOUSE_DOWN, ratingClick);
dinterface.inventory_btn.removeEventListener(MouseEvent.MOUSE_DOWN, inventoryClick);
dinterface.menu_btn.removeEventListener(MouseEvent.MOUSE_DOWN, menuClick);
dinterface.hint_btn.removeEventListener(MouseEvent.MOUSE_DOWN, hintClick);
dinterface.descend_button.removeEventListener(MouseEvent.MOUSE_DOWN, descendClick);
dinterface.rest_button.removeEventListener(MouseEvent.MOUSE_DOWN, restButtonClick);
this.removeEventListener(Event.ADDED_TO_STAGE, added);
this.removeEventListener(Event.REMOVED_FROM_STAGE, removed);
dinterface.help_btn.cleanup();
dinterface.options_btn.cleanup();
_local1 = 0;
while (_local1 < pc_party.members.length) {
_local2 = dinterface.getChildByName(("char" + (_local1 + 1)));
if (_local2 != null){
_local2.removeEventListener(MouseEvent.MOUSE_DOWN, portraitClick);
};
_local1++;
};
_local1 = 0;
while (_local1 < hordes.length) {
hordes[_local1].cleanup();
_local1++;
};
_local1 = 0;
while (_local1 < room_array.length) {
room_array[_local1].removeEventListener(MouseEvent.MOUSE_DOWN, roomClick);
room_array[_local1].removeEventListener(MouseEvent.MOUSE_OVER, roomOver);
room_array[_local1].removeEventListener(MouseEvent.MOUSE_OUT, roomOut);
_local1++;
};
dinterface.betaFunctions.betaLevel.removeEventListener(MouseEvent.MOUSE_DOWN, descendClick);
dinterface.betaFunctions.betaEquipment.removeEventListener(MouseEvent.MOUSE_DOWN, addBetaGear);
dinterface.betaFunctions.betaHeal.removeEventListener(MouseEvent.MOUSE_DOWN, debugHeal);
}
private function clearHordes(_arg1:MouseEvent=null):void{
var _local2:*;
if (!(DungeonMain.debug)){
return;
};
_local2 = 0;
while (_local2 < hordes.length) {
hordes[_local2].fade();
_local2++;
};
hordeDefeated(null);
}
private function showDescendDialog():void{
var _local1:*;
if (getChildByName("downlevel_dlg") == null){
_local1 = new DownLevelDialog();
_local1.name = "downlevel_dlg";
addChild(_local1);
};
}
private function newDungeonClick(_arg1:MouseEvent):void{
DungeonMain(parent).NewDungeonClick(_arg1);
}
public function removeMovementArrow():void{
var _local1:*;
_local1 = this;
if (moveArrow == null){
moveArrow = _local1.getChildByName("arrow");
};
if (((!((moveArrow == null))) && (_local1.contains(moveArrow)))){
_local1.removeChild(moveArrow);
moveArrow = null;
};
}
public function descend():void{
if (parent != null){
DungeonMain(parent).descendClick(null);
};
}
private function findRouteTo(_arg1:DungeonRoom, _arg2:Boolean=true):Array{
var _local3 = ??pushnamespace
;
var _local4:Array;
var _local5:Array;
var _local6:int;
_local3 = 120;
_local4 = new Array();
if (currentRoom.isAdjacentTo(_arg1)){
_local4.push(currentRoom);
_local4.push(_arg1);
return (_local4);
};
if (!(DungeonMain.pathfinding)){
return (_local4);
};
if (search == null){
buildAdjacencyMaps();
};
_local5 = search.findShortestPathTo(_arg1.index, _local3);
if (((_arg2) && (!(validPathIndices(_local5))))){
_local5 = search2.findShortestPathTo(_arg1.index, _local3);
};
for each (_local6 in _local5) {
_local4.push(room_array[_local6]);
};
return (_local4);
}
function CloseTreasureReport():void{
var _local1:*;
_local1 = getChildByName("treasure_report");
if (_local1 != null){
stage.removeEventListener(KeyboardEvent.KEY_DOWN, treasureReportKeyDown);
if (_local1.chest != null){
if (!(_local1.chest.looted)){
_local1.chest.fade();
};
};
_local1.take_btn.removeEventListener(MouseEvent.MOUSE_DOWN, treasureTakeClick);
_local1.discard_btn.removeEventListener(MouseEvent.MOUSE_DOWN, treasureDiscardClick);
_local1.cleanup();
removeChild(_local1);
_local1 = null;
};
if (parent != null){
DungeonMain(parent).saveInventory();
DungeonMain(parent).saveDungeon(false);
};
updateInventoryCount();
}
private function findCriticalPath():void{
var _local1:*;
var _local2:*;
var _local3:Dijkstra;
var _local4:Array;
var _local5:int;
var _local6:*;
if ((((entryRoom == null)) || ((exitRoom == null)))){
return;
};
_local1 = new Array(room_array.length);
_local2 = 0;
while (_local2 < room_array.length) {
_local1[_local2] = new Array(room_array.length);
_local6 = 0;
while (_local6 < room_array.length) {
if (_local2 == _local6){
_local1[_local2][_local6] = 0;
} else {
if (room_array[_local2].isAdjacentTo(room_array[_local6])){
_local1[_local2][_local6] = 1;
} else {
_local1[_local2][_local6] = Dijkstra.NO_CONNECTION;
};
};
_local6++;
};
_local2++;
};
_local3 = new Dijkstra(_local1, entryRoom.index);
_local3.findShortestPath();
_local4 = _local3.findShortestPathTo(exitRoom.index, 999);
for each (_local5 in _local4) {
DungeonRoom(room_array[_local5]).criticalPath = true;
};
}
private function getRandomRoomListIncreasingSize(_arg1:Boolean=false):Array{
var _local2:Array;
_local2 = new Array();
if (_arg1){
_local2 = dm.joinArrays(_local2, dm.shuffleArray(a_corridors));
};
_local2 = dm.joinArrays(_local2, dm.shuffleArray(a_cells));
_local2 = dm.joinArrays(_local2, dm.shuffleArray(a_chambers));
_local2 = dm.joinArrays(_local2, dm.shuffleArray(a_widerooms));
_local2 = dm.joinArrays(_local2, dm.shuffleArray(a_tallrooms));
_local2 = dm.joinArrays(_local2, dm.shuffleArray(a_galleries));
_local2 = dm.joinArrays(_local2, dm.shuffleArray(a_largerooms));
return (_local2);
}
private function checkFootprintEmpty(_arg1:DungeonRoom):Boolean{
var _local2:*;
var _local3:*;
_local2 = 0;
while (_local2 < _arg1.getGridWidth()) {
_local3 = 0;
while (_local3 < _arg1.getGridHeight()) {
if (((((_arg1.grid_x + _local2) >= grid_width)) || (((_arg1.grid_y + _local3) >= grid_height)))){
return (false);
};
if (grid[(_arg1.grid_x + _local2)][(_arg1.grid_y + _local3)] != null){
return (false);
};
_local3++;
};
_local2++;
};
return (true);
}
private function addSpecialIconToRoom(_arg1:DungeonRoom):void{
var _local2:SpecialEncounterIcon;
_local2 = new SpecialEncounterIcon();
_local2.name = "specialIcon";
_local2.x = _arg1.getCenterHorz();
_local2.y = _arg1.getCenterVert();
_arg1.setChild(_local2);
}
private function RemoveUselessCorridors():Boolean{
var _local1:*;
var _local2:*;
_local1 = false;
_local2 = 0;
while (_local2 < room_array.length) {
if ((((room_array[_local2] is DungeonCorridor)) && ((room_array[_local2].num_adjacent == 1)))){
if (room_array[_local2].getChildByName("entrance") != null){
} else {
if (room_array[_local2].getChildByName("exit") != null){
} else {
DeleteRoom(_local2);
_local1 = true;
};
};
};
_local2++;
};
return (_local1);
}
private function onFrame(_arg1:Event):void{
if (dungeonSavePending){
dungeonSavePending = false;
dungeonSave();
};
}
function portraitClick(_arg1:MouseEvent):void{
var _local2:*;
if (_arg1.currentTarget == null){
return;
};
if (!((_arg1.currentTarget is CharacterPortrait))){
return;
};
_local2 = PlayerCharacter(CharacterPortrait(_arg1.currentTarget).char_ref);
dm.main.goToInventory(_local2);
}
private function isValidEntryPoint(_arg1:DungeonRoom):Boolean{
if (_arg1 == null){
return (false);
};
if ((((_arg1 is DungeonCorridor)) && ((_arg1.num_adjacent > 1)))){
return (false);
};
return (true);
}
function debugHeal(_arg1:MouseEvent):void{
pc_party.fullRecovery();
updateChars();
}
private function findEntryPoint():DungeonRoom{
var _local1:*;
_local1 = 0;
_local1 = 0;
while (_local1 < a_corridors.length) {
if (!(isValidEntryPoint(a_corridors[_local1]))){
} else {
if (a_corridors[_local1].num_adjacent == 1){
return (a_corridors[_local1]);
};
};
_local1++;
};
return (null);
}
private function addSpecialShrineToRoom(_arg1:DungeonRoom, _arg2:int=-1):void{
var _local3:*;
_local3 = new SpecialShrine(_arg2);
_local3.x = _arg1.getCenterHorz();
_local3.y = _arg1.getCenterVert();
_arg1.shrine = _local3;
_local3.room = _arg1;
_arg1.setChild(_local3);
shrines.push(_local3);
_local3.mask = null;
}
function addDebugGear(_arg1:MouseEvent):void{
var _local2:Item;
if (DungeonMain.debug == false){
return;
};
pc_party.addDeluxeLoot();
pc_party.addAllOrangesFrom(new mGorgon(pc_party.level));
while (pc_party.inventory.length < Party.MAX_INVENTORY) {
_local2 = TreasureChest.getItem(dungeon_level, Item.purple);
if (TreasureChest.testItemSuitable(_local2, pc_party)){
pc_party.addToInventory(_local2);
};
};
updateInventoryCount();
}
private function setIndices():void{
var _local1:*;
_local1 = 0;
while (_local1 < room_array.length) {
room_array[_local1].index = _local1;
_local1++;
};
}
private function addCorridorConnection(_arg1:DungeonRoom, _arg2:DungeonRoom):void{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
_local5 = 0;
_local6 = 0;
_local7 = false;
if (isExistingRoomConnection(_arg1, _arg2)){
return;
};
if ((_arg1 is rCorridorV)){
if ((_arg2 is rCorridorV)){
_local7 = true;
_local5 = _arg1.x;
_local6 = Math.max(_arg1.y, _arg2.y);
newCorridorConnection(_local7, _local5, _local6, _arg1, _arg2);
} else {
if ((_arg2 is rCorridorH)){
if (_arg2.y < _arg1.y){
_local7 = true;
} else {
if (Math.abs((_arg1.y - _arg2.y)) >= 40){
_local7 = true;
} else {
_local7 = false;
};
};
_local5 = Math.max(_arg1.x, _arg2.x);
_local6 = Math.max(_arg1.y, _arg2.y);
newCorridorConnection(_local7, _local5, _local6, _arg1, _arg2);
};
};
} else {
if ((_arg2 is rCorridorH)){
_local7 = false;
_local5 = Math.max(_arg1.x, _arg2.x);
_local6 = _arg1.y;
newCorridorConnection(_local7, _local5, _local6, _arg1, _arg2);
};
};
}
private function ValidateDungeonLayout(_arg1:Boolean=false):Boolean{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:Array;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
_local2 = 0;
_local3 = 0;
_local4 = false;
_local5 = 0;
_local6 = new Array();
_local7 = 0;
_local8 = 0;
_local3 = 0;
while (_local3 < room_array.length) {
room_array[_local3].validate_id = -1;
_local3++;
};
while ((((_local5 < room_array.length)) && ((_local2 < room_array.length)))) {
if (room_array[_local2].validate_id > -1){
_local2++;
} else {
_local6[_local8] = room_array[_local2].validate(_local8);
_local5 = (_local5 + _local6[_local8]);
if (_local6[_local8] > _local6[_local7]){
_local7 = _local8;
};
_local8++;
_local2++;
};
};
_local3 = 0;
for (;_local3 < room_array.length;_local3++) {
if (room_array[_local3].validate_id != _local7){
if ((((((pc_party.campaign == Campaign.ORIGINAL)) && ((dungeon_level == DungeonMain.MAX_LEVEL)))) && ((room_array[_local3] == bossRoom)))){
room_array.length = 0;
return (true);
};
DeleteRoom(_local3);
_local3--;
_local4 = true;
continue;
} else {
if (_arg1){
if ((((room_array[_local3] is DungeonCorridor)) && ((room_array[_local3].num_adjacent == 1)))){
DeleteRoom(_local3);
_local3--;
_local4 = true;
continue;
};
} else {
if ((((((room_array[_local3] is DungeonCorridor)) && ((room_array[_local3].num_adjacent == 1)))) && (!((room_array[_local3].adjacent[0] is DungeonCorridor))))){
_local9 = room_array[_local3].adjacent[0];
_local10 = room_array[_local3].grid_x;
_local11 = room_array[_local3].grid_y;
if ((room_array[_local3] is rCorridorH)){
if ((((getRoomAtGridPos(_local10, (_local11 - 1)) == _local9)) || ((getRoomAtGridPos((_local10 + 1), (_local11 - 1)) == _local9)))){
DeleteRoom(_local3);
_local3--;
_local4 = true;
continue;
};
if ((((getRoomAtGridPos(_local10, (_local11 + 1)) == _local9)) || ((getRoomAtGridPos((_local10 + 1), (_local11 + 1)) == _local9)))){
DeleteRoom(_local3);
_local3--;
_local4 = true;
continue;
};
} else {
if ((room_array[_local3] is rCorridorV)){
if ((((getRoomAtGridPos((_local10 - 1), _local11) == _local9)) && ((getRoomAtGridPos((_local10 - 1), (_local11 + 1)) == _local9)))){
DeleteRoom(_local3);
_local3--;
_local4 = true;
} else {
if ((((getRoomAtGridPos((_local10 + 1), _local11) == _local9)) && ((getRoomAtGridPos((_local10 + 1), (_local11 + 1)) == _local9)))){
DeleteRoom(_local3);
_local3--;
_local4 = true;
continue;
};
};
};
};
};
};
};
};
return (_local4);
}
private function pointlessBusyWork():void{
}
function GoToInventory():void{
CloseTreasureReport();
dm.main.InventoryClick(null);
}
function added(_arg1:Event):void{
var _local2:int;
var _local3:*;
stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
_local2 = 1;
while (_local2 <= 4) {
_local3 = CharacterPortrait(dinterface.getChildByName(("char" + _local2)));
if (_local3 != null){
_local3.addHoverListeners();
};
_local2++;
};
if (hint != null){
stage.addChild(hint);
hint = null;
};
}
private function getRandomRoomList(_arg1:Boolean=false):Array{
var _local2:Array;
_local2 = new Array();
_local2 = dm.joinArrays(_local2, a_largerooms);
_local2 = dm.joinArrays(_local2, a_galleries);
_local2 = dm.joinArrays(_local2, a_widerooms);
_local2 = dm.joinArrays(_local2, a_tallrooms);
_local2 = dm.joinArrays(_local2, a_chambers);
_local2 = dm.joinArrays(_local2, a_cells);
if (_arg1){
_local2 = dm.joinArrays(_local2, a_corridors);
};
return (dm.shuffleArray(_local2));
}
function restButtonClick(_arg1:MouseEvent):void{
showRestDialog();
}
private function finishMove(_arg1:int=0):void{
removeMovementArrow();
travelling = false;
currentRoute = null;
if (_arg1){
if (pc_party.roomMovedRegen(_arg1)){
updateChars();
} else {
dm.main.saveParty();
};
};
roomHighlights((_arg1 > 0));
}
private function descendClick(_arg1:MouseEvent):void{
showDescendDialog();
}
public function retreatFromMonsters(_arg1:Horde):void{
var _local2:*;
if (_arg1 != null){
_arg1.gotoAndStop("normal");
};
_local2 = 0;
while (_local2 < DungeonRoom.max_adjacent) {
if (currentRoom.adjacent[_local2] == currentRoom){
} else {
if (currentRoom.adjacent[_local2] == null){
} else {
if (currentRoom.adjacent[_local2].explored){
currentRoom.travelFrom();
currentRoom.adjacent[_local2].travelTo();
currentRoom = currentRoom.adjacent[_local2];
roomHighlights(true);
return;
};
};
};
_local2++;
};
}
private function getHordesDefeated():int{
var _local1:*;
var _local2:*;
_local1 = 0;
_local2 = 0;
while (_local2 < hordes.length) {
if (hordes[_local2].defeated){
_local1++;
};
_local2++;
};
return (_local1);
}
private function showRestDialog():void{
var _local1:*;
if (!(previousLevelCleared)){
return;
};
if (this.getChildByName("rest_dlg") == null){
_local1 = new RestDialog();
_local1.name = "rest_dlg";
this.addChild(_local1);
};
}
private function initRoomArrays():void{
a_corridors = new Array();
a_cells = new Array();
a_chambers = new Array();
a_largerooms = new Array();
a_galleries = new Array();
a_tallrooms = new Array();
a_widerooms = new Array();
}
public function satyrQuestComplete():void{
var _local1:SpecialEncounterIcon;
var _local2:TreasureChest;
currentRoom.special = 0;
dm.main.saveDungeon(false);
_local1 = SpecialEncounterIcon(currentRoom.getChildByName("specialIcon"));
if (_local1 != null){
currentRoom.removeChild(_local1);
};
_local2 = new TreasureChest(pc_party, (pc_party.level + 1), 4, 1, false);
addTreasureReport(_local2, false);
}
private function getRoomAtGridPos(_arg1:int, _arg2:int):DungeonRoom{
if (_arg1 >= grid_width){
return (null);
};
if (_arg2 >= grid_height){
return (null);
};
if (_arg1 < 0){
return (null);
};
if (_arg2 < 0){
return (null);
};
return (DungeonRoom(grid[_arg1][_arg2]));
}
private function encounter(_arg1:DungeonRoom):Boolean{
var _local2:*;
var _local3:*;
var _local4:String;
var _local5:String;
var _local6:*;
var _local7:AdventurerJoinDialog;
var _local8:SpecialEncounterIcon;
var _local9:Boolean;
var _local10:SatyrQuestDialog;
if (_arg1.isEntrance){
_local2 = _arg1.getEntrance();
if (_local2 == null){
return (false);
};
if (_local2.enableRest){
showRestDialog();
return (true);
};
} else {
if (_arg1.isExit){
foundExit();
showDescendDialog();
return (true);
};
if (_arg1.horde != null){
if (_arg1.horde.defeated){
return (false);
};
if (pc_party.sneaking){
pc_party.sneaking = 1;
return (false);
};
_local3 = stage.getChildByName("tooltip_horde");
if (_local3 != null){
stage.removeChild(_local3);
};
enterBattle(_arg1.horde);
return (true);
} else {
if (_arg1.treasure != null){
addTreasureReport(_arg1.treasure);
return (true);
};
if (_arg1.shrine != null){
if (_arg1.shrine.used){
return (false);
};
if (getChildByName("shrine_dlg") == null){
if (_arg1.shrine.type == RecoveryShrine.TYPE_ID){
_local5 = "Altar of Restoration";
_local4 = "Praying at the altar will fully recover your party's health and power, and revive any fallen. Each altar may be used only once.\n\nUse this altar now?";
} else {
if (_arg1.shrine.type == SpecialShrine.EQUIPMENT_BUFF){
_local5 = "Mysterious Altar";
_local4 = "This altar is engraved with the words\n'MUNDANE BECOMES EXTRAORDINARY'\n\nUse this altar now?";
} else {
if (_arg1.shrine.type == SpecialShrine.POTION_BUFF){
_local5 = "Mysterious Altar";
_local4 = "This altar is engraved with the words\n'TEMPORARY BECOMES PERMANENT'\n\nUse this altar now?";
} else {
if (_arg1.shrine.type == SpecialShrine.ENCHANTMENT){
_local5 = "Mysterious Altar";
_local4 = "This altar is engraved with the words\n'A GIFT OF MAGIC'\n\nUse this altar now?";
};
};
};
};
_local6 = new ShrineUseDialog(_local5, _local4);
_local6.name = "shrine_dlg";
addChild(_local6);
return (true);
};
} else {
if (_arg1.special){
if (_arg1.special == Encounter.RESCUE){
_local7 = new AdventurerJoinDialog(this.race);
_local7.name = "adv_dlg";
addChild(_local7);
_local8 = SpecialEncounterIcon(_arg1.getChildByName("specialIcon"));
if (_local8 != null){
_arg1.removeChild(_local8);
};
_arg1.special = 0;
dm.main.saveDungeon(false);
return (true);
} else {
if (_arg1.special == Encounter.LURKER){
_local9 = (getHordesDefeated() == hordes.length);
_local10 = new SatyrQuestDialog(_local9);
addChild(_local10);
return (true);
};
};
};
};
};
};
return (false);
}
private function refreshRoomArrays():void{
var _local1:*;
initRoomArrays();
_local1 = 0;
while (_local1 < room_array.length) {
addRoomToTypeArray(DungeonRoom(room_array[_local1]));
_local1++;
};
}
public function hordeDefeated(_arg1:Horde):void{
updateCleared();
updateDemonRoom();
buildAdjacencyMaps();
}
function hintClick(_arg1:Event):void{
var _local2:*;
_local2 = 0;
while (_local2 < room_array.length) {
if (room_array[_local2].explored){
} else {
if (room_array[_local2].seen){
room_array[_local2].hintFlash();
};
};
_local2++;
};
}
function treasureTakeClick(_arg1:MouseEvent){
var _local2:TreasureReport;
var _local3:*;
_local2 = TreasureReport(getChildByName("treasure_report"));
if (_local2 == null){
return;
};
_local3 = 0;
while (_local3 < _local2.icons.length) {
if (_local2.icons[_local3].taking){
pc_party.addToInventory(_local2.icons[_local3].item_ref);
};
_local3++;
};
CloseTreasureReport();
dm.sound.play(SoundControl.lootItem);
if (pc_party.overflow.length){
GoToInventory();
};
}
private function dungeonSave():void{
dm.main.saveParty();
dm.main.saveDungeon(false);
}
private function findExitPoint(_arg1:DungeonRoom):DungeonRoom{
var _local2:Array;
var _local3:*;
_local2 = getRandomRoomListIncreasingSize(true);
_local3 = 0;
while (_local3 < _local2.length) {
if (!(isRoomValidExit(_local2[_local3], _arg1))){
} else {
if (_local2[_local3].num_adjacent == 1){
return (_local2[_local3]);
};
};
_local3++;
};
return (null);
}
private function roomValidForShrine(_arg1:DungeonRoom):Boolean{
var _local2 = ??pushnamespace
;
var _local3:*;
var _local4:*;
if (_arg1 == null){
return (false);
};
if (_arg1.horde != null){
return (false);
};
if (_arg1.treasure != null){
return (false);
};
if (_arg1.shrine != null){
return (false);
};
if (_arg1.special){
return (false);
};
if (_arg1.isExit){
return (false);
};
if (_arg1.isEntrance){
return (false);
};
if ((_arg1 is DungeonCorridor)){
return (false);
};
if ((_arg1 is rCell)){
return (false);
};
_local2 = 5;
_local3 = 0;
for (;_local3 < shrines.length;_local3++) {
if (shrines[_local3].room == null){
continue;
} else {
_local4 = shrines[_local3].room;
};
if (Math.abs((_arg1.grid_x - _local4.grid_x)) < _local2){
return (false);
};
if (Math.abs((_arg1.grid_y - _local4.grid_y)) < _local2){
return (false);
};
};
return (true);
}
private function getAdjacencyMap(_arg1:Boolean):Array{
var _local2:Array;
var _local3:int;
var _local4:Boolean;
var _local5:int;
_local2 = new Array(room_array.length);
_local3 = 0;
while (_local3 < room_array.length) {
_local2[_local3] = new Array(room_array.length);
_local4 = false;
if (((((_arg1) && (!((room_array[_local3].horde == null))))) && (!(room_array[_local3].horde.defeated)))){
_local4 = true;
};
_local5 = 0;
while (_local5 < room_array.length) {
if (((_local4) || (((((_arg1) && (!((room_array[_local5].horde == null))))) && (!(room_array[_local5].horde.defeated)))))){
_local2[_local3][_local5] = Dijkstra.NO_CONNECTION;
} else {
if (_local3 == _local5){
_local2[_local3][_local5] = 0;
} else {
if (room_array[_local3].isAdjacentTo(room_array[_local5])){
if (((!(room_array[_local3].seen)) || (!(room_array[_local5].seen)))){
_local2[_local3][_local5] = Dijkstra.NO_CONNECTION;
} else {
_local2[_local3][_local5] = 1;
};
} else {
_local2[_local3][_local5] = Dijkstra.NO_CONNECTION;
};
};
};
_local5++;
};
_local3++;
};
return (_local2);
}
private function GenerateTreasure():void{
var _local1:int;
var _local2:Array;
var _local3:*;
var _local4:Boolean;
var _local5:*;
var _local6:DungeonRoom;
_local1 = dmf.randomNum(4, 6);
_local2 = getRandomRoomList(false);
_local3 = 0;
_local4 = portalScrollOnLevel();
if (((!(pc_party.attrition)) && (!(_local4)))){
if (dmf.randomNum(0, 99) < 20){
_local4 = true;
};
};
_local5 = 0;
while (_local5 < _local2.length) {
_local6 = _local2[_local5];
if (((_local6.isExit) || (_local6.isEntrance))){
} else {
if (_local6.horde != null){
} else {
if (_local6.shrine != null){
} else {
if (_local6.treasure != null){
} else {
if (_local6.special){
} else {
addTreasureToRoom(_local6, _local4);
_local4 = false;
_local3++;
if (_local3 >= _local1){
break;
};
};
};
};
};
};
_local5++;
};
}
function treasureReportKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ENTER){
treasureTakeClick(null);
} else {
if (_arg1.keyCode == Keyboard.ESCAPE){
treasureDiscardClick(null);
};
};
}
private function debugReport(_arg1:MouseEvent):void{
var _local2:DungeonRoom;
_local2 = currentRoom;
if (_local2 == null){
return;
};
if ((((((_local2 is DungeonCorridor)) && ((_local2.num_adjacent == 1)))) && (!((_local2.adjacent[0] is DungeonCorridor))))){
};
}
private function menuClick(_arg1:MouseEvent):void{
var _local2:FadeToBlack;
_local2 = new FadeToBlack();
this.addChild(_local2);
dm.main.dungeonMenuClick(_arg1);
}
private function getBossRoom():DungeonRoom{
var _local1:Array;
var _local2:int;
var _local3:Array;
var _local4:DungeonRoom;
_local2 = 0;
_local3 = new Array();
_local3 = dm.joinArrays(_local3, dm.shuffleArray(a_largerooms));
_local3 = dm.joinArrays(_local3, dm.shuffleArray(a_galleries));
_local3 = dm.joinArrays(_local3, dm.shuffleArray(a_widerooms));
_local3 = dm.joinArrays(_local3, dm.shuffleArray(a_tallrooms));
_local3 = dm.joinArrays(_local3, dm.shuffleArray(a_chambers));
_local3 = dm.joinArrays(_local3, dm.shuffleArray(a_cells));
_local3 = dm.joinArrays(_local3, dm.shuffleArray(a_corridors));
for each (_local4 in _local3) {
if (_local4.criticalPath){
continue;
} else {
if (!(roomValidForMonster(_local4))){
continue;
} else {
return (_local4);
};
};
};
return (room_array[0]);
}
function addBetaGear(_arg1:MouseEvent):void{
var _local2:Item;
if (!(DungeonMain.BETA)){
return;
};
while (pc_party.inventory.length < Party.MAX_INVENTORY) {
_local2 = TreasureChest.getItem(dungeon_level, dmf.randomNum(Item.green, Item.blue));
if (TreasureChest.testItemSuitable(_local2, pc_party)){
pc_party.addToInventory(_local2);
};
};
updateInventoryCount();
}
private function TestAllRoomEdges(){
var _local1:*;
ClearAllRoomEdges();
_local1 = 0;
while (_local1 < room_array.length) {
if (room_array[_local1] == null){
} else {
if (room_array[_local1].num_adjacent == DungeonRoom.max_adjacent){
} else {
TestRoomEdges(_local1);
};
};
_local1++;
};
specialEdgeTests();
}
private function roomClick(_arg1:MouseEvent):void{
var _local2:DungeonRoom;
var _local3:int;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
_local2 = DungeonRoom(_arg1.currentTarget);
if (!(_local2.seen)){
return;
};
if (pc_party.overflow.length){
_local5 = new WarningDialog("You are carrying too many items. You must enter the Inventory screen and discard some.");
this.addChild(_local5);
return;
};
travelling = true;
if (currentRoute == null){
currentRoute = findRouteTo(_local2);
};
_local3 = 0;
_local4 = 1;
while (_local4 < currentRoute.length) {
currentRoute[(_local4 - 1)].travelFrom();
currentRoom = currentRoute[_local4];
if (!(currentRoom.explored)){
dm.party.stat_rooms_explored++;
_local3++;
};
if (pc_party.sneaking == 1){
pc_party.sneaking = 0;
_local6 = 0;
while (_local6 < pc_party.members.length) {
_local7 = dinterface.getChildByName(("char" + (_local6 + 1)));
if ((((_local7 == null)) || (!((_local7 is CharacterPortrait))))){
} else {
_local7.setHiding((pc_party.sneaking > 0));
};
_local6++;
};
};
if (currentRoom.travelTo()){
if (_local4 == (currentRoute.length - 1)){
finishMove(_local3);
encounter(currentRoom);
return;
};
if (((!((currentRoom.horde == null))) && (!(currentRoom.horde.defeated)))){
if (encounter(currentRoom)){
finishMove(_local3);
return;
};
};
};
_local4++;
};
finishMove(_local3);
}
public function roomHighlights(_arg1:Boolean=true):void{
var _local2:int;
var _local3:int;
var _local4:*;
var _local5:int;
var _local6:int;
var _local7:String;
var _local8:*;
var _local9:*;
_local2 = 0;
_local3 = 0;
_local4 = 0;
while (_local4 < room_array.length) {
if (room_array[_local4] == null){
} else {
if (room_array[_local4].explored){
room_array[_local4].setAlpha(0.3);
_local3++;
} else {
if (room_array[_local4].seen){
room_array[_local4].setAlpha(0.2);
} else {
room_array[_local4].setAlpha(0);
};
};
};
_local4++;
};
currentRoom.setAlpha(1);
if (currentRoomIcon == null){
currentRoomIcon = new CurrentRoomIcon();
};
if (currentRoomIcon.parent != null){
currentRoomIcon.parent.removeChild(currentRoomIcon);
};
currentRoomIcon.x = currentRoom.getCenterHorz();
currentRoomIcon.y = currentRoom.getCenterVert();
currentRoomIcon.width = ((currentRoom.getGridWidth() * GRID_SIZE) - 4);
currentRoomIcon.height = ((currentRoom.getGridHeight() * GRID_SIZE) - 4);
if (currentRoom.hasSpecial()){
currentRoom.addChildAt(currentRoomIcon, (currentRoom.numChildren - 2));
} else {
currentRoom.addChild(currentRoomIcon);
};
_local5 = 0;
while (_local5 < currentRoom.num_adjacent) {
currentRoom.adjacent[_local5].setAlpha(0.6);
_local5++;
};
_local6 = 0;
while (_local6 < door_array.length) {
if (((DungeonRoom(door_array[_local6].room1).seen) && (DungeonRoom(door_array[_local6].room2).seen))){
_local8 = door_array[_local6].room1.getAlpha();
_local9 = door_array[_local6].room2.getAlpha();
if ((((door_array[_local6] is CorridorConnectorH)) || ((door_array[_local6] is CorridorConnectorV)))){
door_array[_local6].setAlpha(Math.min(_local8, _local9));
} else {
door_array[_local6].setAlpha(((_local8 + _local9) / 2));
};
} else {
door_array[_local6].setAlpha(0);
};
_local6++;
};
_local2 = Math.round(((_local3 / room_array.length) * 100));
dinterface.explored_bar.label.text = (("EXPLORED " + String(_local2)) + "% ");
dinterface.explored_bar.bar_mask.width = Math.ceil(((_local2 / 100) * bar_max_width));
_local7 = "normal";
if (_local2 >= 100){
_local7 = "complete";
};
dinterface.explored_bar.holder.gotoAndStop(_local7);
updateCleared();
updateDemonRoom();
updateRating();
if (_arg1){
if (((!((currentRoom.horde == null))) && (!(currentRoom.horde.defeated)))){
dungeonSavePending = false;
} else {
dungeonSavePending = true;
};
};
if (DungeonMain.pathfinding){
buildAdjacencyMaps();
};
}
private function GenerateShrines():void{
var _local1:int;
var _local2:Array;
var _local3:*;
var _local4:int;
_local1 = 2;
if ((((dungeon_level > 3)) && ((dmf.randomNum(0, 99) < 35)))){
_local1 = 1;
};
_local2 = getRandomRoomList(false);
_local3 = 0;
_local4 = 0;
for (;_local4 < _local2.length;_local4++) {
if (roomValidForShrine(_local2[_local4])){
addRecoveryShrineToRoom(_local2[_local4]);
_local3++;
} else {
continue;
};
if (_local3 >= _local1){
break;
};
};
}
private function validPathRooms(_arg1:Array):Boolean{
if (_arg1.length == 0){
return (false);
};
if ((((_arg1.length == 2)) && (!(_arg1[0].isAdjacentTo(_arg1[1]))))){
return (false);
};
return (true);
}
private function DeleteRoom(_arg1:int){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
if (_arg1 >= room_array.length){
return;
};
if (_arg1 < 0){
return;
};
if (room_array[_arg1] != null){
_local2 = room_array[_arg1].grid_x;
_local3 = room_array[_arg1].grid_y;
_local4 = 0;
while (_local4 < room_array[_arg1].getGridWidth()) {
_local6 = 0;
while (_local6 < room_array[_arg1].getGridHeight()) {
grid[(_local2 + _local4)][(_local3 + _local6)] = null;
_local6++;
};
_local4++;
};
_local5 = 0;
while (_local5 < room_array[_arg1].num_adjacent) {
DungeonRoom(room_array[_arg1]).setNotAdjacentTo(room_array[_arg1].adjacent[_local5]);
_local5++;
};
};
room_array.splice(_arg1, 1);
}
private function isRoomValidExit(_arg1:DungeonRoom, _arg2:DungeonRoom):Boolean{
var _local3 = ??pushnamespace
;
_local3 = 6;
if (_arg1 == null){
return (false);
};
if (_arg1 == _arg2){
return (false);
};
if (Math.abs((_arg1.grid_x - _arg2.grid_x)) < _local3){
return (false);
};
if (Math.abs((_arg1.grid_y - _arg2.grid_y)) < _local3){
return (false);
};
if ((((_arg1 is DungeonCorridor)) && ((_arg1.num_adjacent > 1)))){
return (false);
};
return (true);
}
private function demonSpawnCheck():Boolean{
if (((!((bossRoom == null))) && (!((bossRoom.horde == null))))){
return (false);
};
if (getHordesDefeated() == hordes.length){
return (true);
};
return (false);
}
private function roomValidForMonster(_arg1:DungeonRoom):Boolean{
var _local2:*;
if (_arg1 == null){
return (false);
};
if (_arg1.horde != null){
return (false);
};
if (_arg1.shrine != null){
return (false);
};
if (_arg1.treasure != null){
return (false);
};
if (_arg1.isExit){
return (false);
};
if (_arg1.isEntrance){
return (false);
};
if (_arg1.special){
return (false);
};
if ((_arg1 is DungeonCorridor)){
if (dmf.randomNum(0, 1000) < 700){
return (false);
};
};
_local2 = 0;
while (_local2 < DungeonRoom.max_adjacent) {
if (_arg1.adjacent[_local2] == null){
} else {
if (_arg1.adjacent[_local2] == _arg1){
} else {
if (_arg1.adjacent[_local2].horde != null){
return (false);
};
if (_arg1.adjacent[_local2].isEntrance){
return (false);
};
};
};
_local2++;
};
return (true);
}
private function fillGridForRoom(_arg1:DungeonRoom):void{
var _local2:*;
var _local3:*;
_local2 = 0;
while (_local2 < _arg1.getGridWidth()) {
_local3 = 0;
while (_local3 < _arg1.getGridHeight()) {
grid[(_arg1.grid_x + _local2)][(_arg1.grid_y + _local3)] = _arg1;
_local3++;
};
_local2++;
};
}
public function generateDungeon():Boolean{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:DungeonRoom;
var _local13:*;
var _local14:*;
var _local15:*;
var _local16:*;
var _local17:*;
var _local18:*;
room_array = new Array();
door_array = new Array();
bossRoom = null;
currentRoom = null;
entryRoom = null;
exitRoom = null;
initGrid();
initRoomArrays();
_local8 = false;
_local9 = 0;
_local10 = 0;
if ((((pc_party.campaign == Campaign.ORIGINAL)) && ((dungeon_level == DungeonMain.MAX_LEVEL)))){
_local12 = new rDemonRoom();
_local14 = ((grid_width - _local12.getGridWidth()) / 2);
_local15 = ((grid_height - _local12.getGridHeight()) / 2);
_local12.grid_x = dmf.randomNum((_local14 - 2), (_local14 + 2));
_local12.grid_y = dmf.randomNum((_local15 - 2), (_local15 + 2));
PlaceRoom(_local12);
bossRoom = _local12;
};
_local1 = 0;
while (_local1 < grid_width) {
_local2 = 0;
while (_local2 < grid_height) {
if (grid[_local1][_local2] != null){
} else {
if (dmf.randomNum(1, 100) > 50){
_local16 = dmf.randomNum(0, 100);
_local17 = (a_corridors.length > Math.round((room_array.length / 2)));
if ((((_local17 == false)) && ((_local16 > 70)))){
if (dmf.randomNum(1, 100) > 50){
_local8 = false;
} else {
_local8 = true;
};
if (_local8){
_local12 = new rCorridorV();
} else {
_local12 = new rCorridorH();
};
_local12.grid_x = _local1;
_local12.grid_y = _local2;
PlaceCorridor(DungeonCorridor(_local12), true);
} else {
if (_local16 > 65){
_local12 = new rCell();
} else {
if (_local16 > 50){
_local12 = new rChamber();
} else {
if (_local16 > 35){
_local12 = new rTallRoom();
} else {
if (_local16 > 20){
_local12 = new rWideRoom();
} else {
if (_local16 > 10){
_local12 = new rLargeRoom();
} else {
_local12 = new rGallery();
};
};
};
};
};
_local12.grid_x = _local1;
_local12.grid_y = _local2;
PlaceRoom(_local12);
};
};
};
_local2++;
};
_local1++;
};
if (isDungeonTooSmall()){
return (false);
};
TestAllRoomEdges();
_local13 = false;
while (!(_local13)) {
_local18 = ValidateDungeonLayout(false);
if (isDungeonTooSmall()){
return (false);
};
if (_local18){
TestAllRoomEdges();
} else {
_local13 = true;
};
};
refreshRoomArrays();
generateDoors();
entryRoom = findEntryPoint();
if ((((entryRoom == null)) || (!(entryRoom.num_adjacent)))){
return (false);
};
entryRoom.addEntrance(previousLevelCleared);
currentRoom = entryRoom;
if ((((pc_party.campaign == Campaign.ORIGINAL)) && ((dungeon_level == DungeonMain.MAX_LEVEL)))){
} else {
exit_found = false;
exitRoom = findExitPoint(entryRoom);
if (exitRoom == null){
return (false);
};
exitRoom.addExit();
};
setIndices();
findCriticalPath();
GenerateSpecialEncounter();
GenerateShrines();
GenerateTreasure();
GenerateMonsters();
drawRooms();
drawDoors();
pc_party.stat_rooms_total = (pc_party.stat_rooms_total + room_array.length);
pc_party.stat_rooms_explored++;
currentRoom.travelTo(true);
roomHighlights(true);
updateDemonRoom();
addRoomListeners();
return (true);
}
private function drawDoors():void{
var _local1:*;
_local1 = 0;
while (_local1 < door_array.length) {
addChild(door_array[_local1]);
_local1++;
};
}
public function addRestButton():void{
if (!(dinterface.contains(dinterface.rest_button))){
dinterface.addChild(dinterface.rest_button);
};
}
private function TestRoomEdges(_arg1:int){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
_local2 = 0;
_local3 = 0;
_local5 = room_array[_arg1].getGridWidth();
_local6 = room_array[_arg1].getGridHeight();
_local7 = (room_array[_arg1].grid_x - 1);
_local8 = room_array[_arg1].grid_y;
if ((((_local7 >= 0)) && ((_local8 >= 0)))){
_local2 = 0;
while (_local2 < _local6) {
if (grid[_local7][(_local8 + _local2)] != null){
_local4 = grid[_local7][(_local8 + _local2)];
ConnectRooms(room_array[_arg1], _local4, _arg1);
};
_local2++;
};
};
_local7 = room_array[_arg1].grid_x;
_local8 = (room_array[_arg1].grid_y - 1);
if ((((_local8 >= 0)) && ((_local7 >= 0)))){
_local2 = 0;
while (_local2 < _local5) {
if (grid[(_local7 + _local2)][_local8] != null){
_local4 = grid[(_local7 + _local2)][_local8];
ConnectRooms(room_array[_arg1], _local4, _arg1);
};
_local2++;
};
};
}
private function updateDemonRoom():void{
var _local1:*;
var _local2:*;
if (pc_party.campaign != Campaign.ORIGINAL){
return;
};
if (dungeon_level != DungeonMain.MAX_LEVEL){
return;
};
if (bossRoom == null){
return;
};
if ((bossRoom is rDemonRoom)){
_local1 = (getHordesDefeated() + 1);
_local2 = Math.min((getHordesDefeated() + 1), bossRoom.totalFrames);
if (bossRoom.currentFrame != _local2){
rDemonRoom(bossRoom).toFrame(_local2);
};
if (demonSpawnCheck()){
addHordeToRoom(bossRoom, 1);
};
};
}
private function enterBattle(_arg1:Horde):void{
if (dm.main != null){
dm.main.beginBattle(_arg1);
} else {
if (parent != null){
DungeonMain(parent).beginBattle(_arg1);
};
};
}
private function specialEdgeTests():void{
var _local1:*;
var _local2:DungeonCorridor;
var _local3:DungeonRoom;
var _local4:*;
_local1 = 0;
while (_local1 < room_array.length) {
if ((((room_array[_local1] is DungeonCorridor)) && ((room_array[_local1].num_adjacent == 2)))){
_local4 = 0;
while (_local4 < room_array[_local1].num_adjacent) {
if ((room_array[_local1].adjacent[_local4] is DungeonCorridor)){
_local2 = room_array[_local1].adjacent[_local4];
} else {
_local3 = room_array[_local1].adjacent[_local4];
};
_local4++;
};
if (((((!((_local2 == null))) && (!((_local3 == null))))) && (_local2.isAdjacentTo(_local3)))){
room_array[_local1].setNotAdjacentTo(_local3, true);
};
};
_local1++;
};
}
function linkClick(_arg1:MouseEvent):void{
dm.link("http://www.maxgames.com");
}
private function inventoryClick(_arg1:MouseEvent):void{
DungeonMain(parent).InventoryClick(_arg1);
}
public function drawMovementArrow(_arg1:Array):void{
var _local2:*;
var _local3:DungeonRoom;
var _local4:*;
var _local5:int;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
var _local12:*;
var _local13:*;
var _local14:*;
var _local15:DoorIcon;
removeMovementArrow();
if ((((_arg1 == null)) || (!(_arg1.length)))){
return;
};
_local2 = 0xFFFFFF;
moveArrow = new Sprite();
moveArrow.name = "arrow";
moveArrow.mouseEnabled = false;
moveArrow.mouseChildren = false;
_local3 = _arg1[(_arg1.length - 1)];
_local4 = new MovementArrowHead();
_local5 = 0;
_local6 = 0;
while (_local6 < _arg1.length) {
if (((!((_arg1[_local6].horde == null))) && (!(_arg1[_local6].horde.defeated)))){
_local5++;
if (!(pc_party.sneaking)){
_local2 = 0xFF0000;
_local4.gotoAndStop("red");
break;
};
};
_local6++;
};
if (_local5 > 1){
_local2 = 0xFF0000;
_local4.gotoAndStop("red");
};
if (_local2 == 0xFFFFFF){
if (!(_local3.explored)){
_local2 = 39423;
_local4.gotoAndStop("blue");
} else {
_local2 = 26367;
_local4.gotoAndStop("blue");
};
};
_local6 = 0;
while (_local6 < (_arg1.length - 1)) {
_local7 = (_arg1[_local6].x + Math.round(((_arg1[_local6].getGridWidth() * GRID_SIZE) / 2)));
_local8 = (_arg1[_local6].y + Math.round(((_arg1[_local6].getGridHeight() * GRID_SIZE) / 2)));
_local9 = _local7;
_local10 = _local8;
_local15 = _arg1[_local6].findDoorTo(_arg1[(_local6 + 1)]);
if (_local15 != null){
if ((((_local15 is CorridorConnectorH)) || ((((_local15 is DoorIcon)) && (!((_local15.rotation == 0))))))){
_local9 = _local15.x;
_local10 = (_local15.y + 10);
} else {
if ((((_local15 is CorridorConnectorV)) || ((((_local15 is DoorIcon)) && ((_local15.rotation == 0)))))){
_local9 = (_local15.x + 10);
_local10 = _local15.y;
} else {
_local9 = (_local15.x + Math.round((_local15.width / 2)));
_local10 = (_local15.y + Math.round((_local15.height / 2)));
};
};
};
_local11 = (_arg1[(_local6 + 1)].x + Math.round(((_arg1[(_local6 + 1)].getGridWidth() * GRID_SIZE) / 2)));
_local12 = (_arg1[(_local6 + 1)].y + Math.round(((_arg1[(_local6 + 1)].getGridHeight() * GRID_SIZE) / 2)));
moveArrow.graphics.lineStyle(4, _local2, 0.9);
moveArrow.graphics.moveTo(_local7, _local8);
moveArrow.graphics.lineTo(_local9, _local10);
moveArrow.graphics.lineTo(_local11, _local12);
_local6++;
};
_local4.x = _local11;
_local4.y = _local12;
_local13 = Math.round(dm.vectors2angle((_local11 - _local9), (_local12 - _local10), 1, 0));
if (_local12 < _local8){
_local13 = -(_local13);
};
_local4.rotation = _local13;
_local14 = this;
moveArrow.addChild(_local4);
_local14.addChild(moveArrow);
dm.childToTop(moveArrow);
}
public function foundExit():void{
exit_found = true;
dinterface.addChild(dinterface.descend_button);
dinterface.descend_button.addEventListener(MouseEvent.MOUSE_DOWN, descendClick);
}
private function addHordeToRoom(_arg1:DungeonRoom, _arg2:int=0):void{
var _local3:Horde;
_local3 = new Horde(this.race, this.dungeon_level, _arg2, _arg1);
_arg1.setHorde(_local3);
hordes.push(_local3);
_local3.mask = null;
}
public function removeRestButton():void{
if (dinterface.contains(dinterface.rest_button)){
dinterface.removeChild(dinterface.rest_button);
};
}
public function updateRating():void{
dinterface.rating_label.text = String(pc_party.getScore());
dm.embolden(dinterface.rating_label);
}
public function addTreasureReport(_arg1:TreasureChest, _arg2:Boolean=false):void{
var _local3:String;
var _local4:*;
var _local5:*;
if (_arg1.looted){
return;
};
if (_arg2){
_local3 = "drop";
} else {
_local3 = "chest";
};
_local4 = new TreasureReport(_local3);
_local4.name = "treasure_report";
_local4.chest = _arg1;
_local5 = 0;
while (_local5 < _arg1.loot.length) {
_local4.addItemRef(_arg1.loot[_local5]);
_local5++;
};
_local4.take_btn.addEventListener(MouseEvent.MOUSE_DOWN, treasureTakeClick);
_local4.discard_btn.addEventListener(MouseEvent.MOUSE_DOWN, treasureDiscardClick);
stage.addEventListener(KeyboardEvent.KEY_DOWN, treasureReportKeyDown);
addChild(_local4);
_local4.drawIcons();
}
function reportKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.SPACE){
hintClick(_arg1);
};
}
function treasureDiscardClick(_arg1:MouseEvent):void{
CloseTreasureReport();
dm.sound.play(SoundControl.destroyItem);
}
function ratingClick(_arg1:Event):void{
var _local2:*;
_local2 = new RatingDialog(pc_party);
addChild(_local2);
}
private function getClearedPercent():int{
var _local1:*;
var _local2:*;
_local1 = hordes.length;
if (_local1 <= 0){
return (0);
};
_local2 = getHordesDefeated();
return (Math.ceil(((_local2 / _local1) * 100)));
}
private function PlaceCorridor(_arg1:DungeonCorridor, _arg2:Boolean=false):int{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:DungeonRoom;
var _local7:*;
var _local8:*;
var _local9:Boolean;
var _local10:*;
_local3 = 0;
_local4 = _arg1.grid_x;
_local5 = _arg1.grid_y;
_local7 = (_arg1 is rCorridorV);
_local8 = checkFootprintEmpty(_arg1);
if (!(_local8)){
return (0);
};
_local9 = false;
if (_local7){
_local3 = 0;
while (_local3 < 2) {
if (((((_local4 - 1) < 0)) || (((_local5 + _local3) >= grid_height)))){
return (0);
};
_local6 = grid[(_local4 - 1)][(_local5 + _local3)];
_local9 = ((_local9) || (TestForAdjacentCorridorV(_local6)));
if (((((_local4 + 1) >= grid_width)) || (((_local5 + _local3) >= grid_height)))){
return (0);
};
_local6 = grid[(_local4 + 1)][(_local5 + _local3)];
_local9 = ((_local9) || (TestForAdjacentCorridorV(_local6)));
_local3++;
};
} else {
_local3 = 0;
while (_local3 < 2) {
if (((((_local4 + _local3) >= grid_width)) || (((_local5 - 1) < 0)))){
return (0);
};
_local6 = grid[(_local4 + _local3)][(_local5 - 1)];
_local9 = ((_local9) || (TestForAdjacentCorridorH(_local6)));
if (((((_local4 + _local3) >= grid_width)) || (((_local5 + 1) >= grid_height)))){
return (0);
};
_local6 = grid[(_local4 + _local3)][(_local5 + 1)];
_local9 = ((_local9) || (TestForAdjacentCorridorH(_local6)));
_local3++;
};
};
if (_local9){
return (0);
};
_arg1.x = (SCREEN_X_OFFSET + (_local4 * GRID_SIZE));
_arg1.y = (SCREEN_Y_OFFSET + (_local5 * GRID_SIZE));
fillGridForRoom(_arg1);
room_array.push(_arg1);
addRoomToTypeArray(_arg1);
_arg1.setFloorTint(Campaign.getTintFrame(pc_party.campaign));
_local10 = 1;
if (((_arg2) || ((dmf.randomNum(1, 100) > 20)))){
if (_local7){
_local5 = (_local5 + rCorridorV.grid_height);
} else {
_local4 = (_local4 + rCorridorH.grid_width);
};
if (dmf.randomNum(1, 100) > 70){
_local7 = !(_local7);
if (!(_local7)){
_local5 = (_local5 + (rCorridorV.grid_height - 1));
};
};
if (_local7){
_arg1 = new rCorridorV();
} else {
_arg1 = new rCorridorH();
};
_arg1.grid_x = _local4;
_arg1.grid_y = _local5;
_local10 = (_local10 + PlaceCorridor(_arg1, false));
};
return (_local10);
}
public static function hintShown(_arg1:int):Boolean{
return (((DungeonMain.hints & _arg1) == _arg1));
}
public static function getMonsterRace(_arg1:int, _arg2:int, _arg3:int):int{
var _local4:Array;
var _local5:int;
if (((!((_arg3 == Campaign.DELUXE))) && (((_arg1 % DungeonMain.MAX_LEVEL) == 0)))){
return (Horde.special);
};
if (_arg1 == 1){
if (_arg3 == Campaign.ORIGINAL){
return (Horde.undead);
};
};
_local4 = new Array();
_local5 = 1;
while (_local5 <= 16) {
if ((_arg2 & _local5) != _local5){
if ((((_local5 == Horde.dwarves)) && ((_arg3 == Campaign.ORIGINAL)))){
} else {
if ((((_local5 == Horde.special)) && ((_arg3 == Campaign.DELUXE)))){
} else {
_local4.push(_local5);
};
};
};
_local5 = (_local5 * 2);
};
if (!(_local4.length)){
return (Horde.undead);
};
return (_local4[dmf.randomNum(0, (_local4.length - 1))]);
}
}
}//package
Section 120
//DungeonCorridor (DungeonCorridor)
package {
public class DungeonCorridor extends DungeonRoom {
public function DungeonCorridor(){
isCorridor = true;
}
}
}//package
Section 121
//DungeonInterface (DungeonInterface)
package {
import flash.text.*;
import flash.display.*;
public dynamic class DungeonInterface extends MovieClip {
public var cleared_bar:ProgressCleared;
public var slot3:EmptyPortrait;
public var campaign_label:TextField;
public var slot1:EmptyPortrait;
public var slot4:EmptyPortrait;
public var level_debug:TextField;
public var slot2:EmptyPortrait;
public var explored_bar:ProgressExplored;
public var options_btn:OptionsButton;
public var help_btn:HelpButton;
public var clear_btn:TextField;
public var descend_button:MovieClip;
public var menu_btn:MovieClip;
public var level_label:TextField;
public var betaFunctions:MovieClip;
public var heal_btn:TextField;
public var gear_btn:TextField;
public var items_label:TextField;
public var explore_btn:TextField;
public var rating_btn:MovieClip;
public var newdungeon_btn:TextField;
public var hint_btn:MovieClip;
public var rating_label:TextField;
public var critical_btn:TextField;
public var inventory_btn:MovieClip;
public var rest_button:MovieClip;
}
}//package
Section 122
//DungeonLoading (DungeonLoading)
package {
import flash.events.*;
import flash.ui.*;
import flash.media.*;
import flash.display.*;
import flash.text.*;
public class DungeonLoading extends Sprite {
private var text_contents:String;
public var blinker:MovieClip;
var channel:SoundChannel;
public var proceed_btn:NewProceedButton;
public var prose:TextField;
var anim_frame:int;// = 0
private var proceed_fn:Function;
public function DungeonLoading(){
anim_frame = 0;
super();
this.addEventListener(Event.REMOVED_FROM_STAGE, removed);
}
function frameAnim(_arg1:Event):void{
var _local2 = ??pushnamespace
;
var _local3:*;
if (anim_frame == 1){
startWriteSound();
};
_local2 = 4;
_local3 = Math.min((_local2 * anim_frame), text_contents.length);
prose.text = text_contents.substr(0, _local3);
if (_local3 >= text_contents.length){
this.removeEventListener(Event.ENTER_FRAME, frameAnim);
endWriteSound();
};
anim_frame++;
}
public function allowProceed():void{
if (!(this.contains(proceed_btn))){
addChild(proceed_btn);
};
if (this.contains(blinker)){
removeChild(blinker);
};
setChildIndex(proceed_btn, (numChildren - 1));
if (proceed_fn != null){
proceed_btn.addEventListener(MouseEvent.MOUSE_DOWN, proceed_fn);
dm.stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
};
}
function removed(_arg1:Event):void{
this.removeEventListener(Event.REMOVED_FROM_STAGE, removed);
if (proceed_fn != null){
proceed_btn.removeEventListener(MouseEvent.MOUSE_DOWN, proceed_fn);
};
this.removeEventListener(Event.ENTER_FRAME, frameAnim);
dm.stage.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
endWriteSound();
}
private function startWriteSound():void{
channel = new writing_sound().play(0, 999);
channel.soundTransform = new SoundTransform(SoundControl.volumeSetting);
}
public function setText(_arg1:String):int{
var _local2:int;
text_contents = _arg1;
prose.text = _arg1;
_local2 = prose.textHeight;
prose.text = "";
this.addEventListener(Event.ENTER_FRAME, frameAnim);
return (_local2);
}
private function endWriteSound():void{
if (channel != null){
channel.stop();
};
}
public function setCallback(_arg1:Function):void{
proceed_fn = _arg1;
}
function reportKeyDown(_arg1:KeyboardEvent):void{
if ((((_arg1.keyCode == Keyboard.ENTER)) || ((_arg1.keyCode == Keyboard.ESCAPE)))){
proceed_fn(null);
};
}
}
}//package
Section 123
//DungeonMain (DungeonMain)
package {
import flash.net.*;
import flash.events.*;
import flash.system.*;
import flash.external.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
public class DungeonMain extends MovieClip {
var dungeon_theme:DungeonMusic;
private var saveLevel:int;
public var debug_label:TextField;
var suspendSaving:Boolean;// = false
private var interfaceSettings:SharedObject;
private var cacheParty:SharedObject;
var infiniteTransition:Boolean;// = false
private var kongLoaded:Boolean;// = false
var dungeonTimer:Timer;
var battle:Battlefield;
var dungeon:Dungeon;
public var version_label:TextField;
var creation:PartyCreation;
var title_theme:TitleMusic;
private var cacheDungeon:SharedObject;
var loading:DungeonLoading;
var recent_monsters:uint;// = 0
var inventory:Inventory;
private var enterSavedBattleTimer:Timer;
private var battleTimer:Timer;
private var creationSlot:int;// = 0
private var saveRating:int;
var battle_theme:BattleMusic;
var level:int;// = 1
private var saveGold:int;
var pc_party:Party;
private var mochi:MochiBot;
private var test2:int;// = 2
private var test1:int;// = 1
private var cacheInventory:SharedObject;
static const nosaving = false;
static const nobaddies = false;
static const MAX_LEVEL:int = 9;
static const APP_HEIGHT:int = 450;
static const cacheSaves:Boolean = true;
static const skillsUnlocked = false;
static const debugitems = false;
static const startAtLevel = 1;
static const debug = false;
static const instantKill = false;
static const GAME_VERSION:String = "1.73";
static const APP_WIDTH:int = 550;
static const BETA:Boolean = false;
static var highLevel:int = 0;
static var highScore:int = 0;
static var LOCKED:Boolean = true;
public static var kongregateSWF;
static var tooltipDelay:uint = 1;
static var bestSurvival:int = 0;
static var OURWORLD:Boolean = false;
static var pathfinding:Boolean = true;
static var hints:uint = 0;
static var portraitHighlight:Boolean = true;
static var ANDKON:Boolean = false;
static var KONGREGATE:Boolean = false;
static var showHints:Boolean = true;
static var ARMORGAMES:Boolean = false;
static var combatBlur:Boolean = true;
public function DungeonMain():void{
level = 1;
recent_monsters = 0;
kongLoaded = false;
creationSlot = 0;
infiniteTransition = false;
suspendSaving = false;
test1 = 1;
test2 = 2;
super();
addEventListener(Event.ADDED_TO_STAGE, added);
debug_label.text = "Constructing..";
version_label.text = ((("FLASH PLAYER VERSION: " + String(Capabilities.version)) + " ") + String(Capabilities.playerType));
debug_label.text = "Initializing sound..";
dm.sound = new SoundControl();
debug_label.text = "Initializing game..";
dm.main = this;
if (stage != null){
dm.stage = stage;
};
if (kongCheck()){
KONGREGATE = true;
} else {
if (hostUrlContains("armorgames.com")){
ARMORGAMES = true;
} else {
if (hostUrlContains("andkon.com")){
ANDKON = true;
} else {
if (hostUrlContains("ourworld.com")){
OURWORLD = true;
};
};
};
};
if (((((((((KONGREGATE) || (ARMORGAMES))) || (ANDKON))) || (OURWORLD))) || (debug))){
LOCKED = false;
};
if (KONGREGATE){
initKongregateAPI();
};
mochi = MochiBot.track(this, "a94f5633");
debug_label.text = "Registering aliases..";
registerAliases();
loadInterface();
bookIntro();
}
function saveClick(_arg1:MouseEvent):void{
saveAll(false);
}
private function updateHighScores(_arg1:int=-1):void{
var _local2:Boolean;
if (_arg1 == -1){
_arg1 = pc_party.getScore();
};
_local2 = false;
if (_arg1 > highScore){
highScore = _arg1;
_local2 = true;
};
if (level > highLevel){
highLevel = level;
_local2 = true;
};
if (_local2){
saveInterface();
};
}
public function survivalDefeat(_arg1:int):void{
var msg:String;
var wave = _arg1;
if (battle != null){
battle.cleanup();
battle = null;
};
if (wave > 1){
msg = (("The defenders fall, and the city is put to the torch.\n\nSongs will be written about the brave adventurers who stood in its\ndefense until the last, and the heroic deeds performed this day.\n\nThe task set before them was impossible, and yet " + String((wave - 1))) + " waves of\nattackers were slain. The enemy's victory was not without a price.");
} else {
msg = "The defenders fall, and the city is put to the torch.\n\nThe townsfolk had pinned their hopes on the ragged group of\nadventurers. Those hopes were woefully misplaced.\n\nNot a single wave of attackers were felled, and the enemy took\nthe city unopposed.";
};
addLoadingScreen(msg, this.closeHardcoreDefeatDialog, false, true);
if (wave > bestSurvival){
bestSurvival = wave;
saveInterface();
};
try {
if (((KONGREGATE) && (!((kongregateSWF == null))))){
kongregateSWF.stats.submit("HighestSurvivalWave", wave);
};
} catch(e:Error) {
};
}
private function startDungeonTimer():void{
dungeonTimer = new Timer(50, 1);
dungeonTimer.addEventListener(TimerEvent.TIMER_COMPLETE, generateDungeon);
dungeonTimer.start();
}
public function clearSaveCache():void{
cacheParty = null;
cacheInventory = null;
cacheDungeon = null;
}
public function saveInterface():void{
if (nosaving){
return;
};
if ((((interfaceSettings == null)) || ((interfaceSettings.size == 0)))){
interfaceSettings = SharedObject.getLocal("interface");
};
interfaceSettings.data.globalVolumeSetting = GlobalVolume.volumeSetting;
interfaceSettings.data.sfxVolumeSetting = SoundControl.volumeSetting;
interfaceSettings.data.musicVolumeSetting = Music.volumeSetting;
interfaceSettings.data.quality = QualitySelector.quality;
interfaceSettings.data.showHints = showHints;
interfaceSettings.data.hints = hints;
interfaceSettings.data.combatBlur = combatBlur;
interfaceSettings.data.portraitHighlight = portraitHighlight;
interfaceSettings.data.pathfinding = pathfinding;
interfaceSettings.data.tooltipDelay = tooltipDelay;
interfaceSettings.data.highScore = highScore;
interfaceSettings.data.highLevel = highLevel;
interfaceSettings.data.bestSurvival = bestSurvival;
interfaceSettings.flush();
}
function kLoadComplete(_arg1:Event):void{
kongregateSWF = _arg1.target.content;
kongregateSWF.services.connect();
kongLoaded = true;
}
public function musicTitleTheme(_arg1:Boolean=false):void{
if (((!((title_theme == null))) && (title_theme.active))){
return;
};
stopMusic();
title_theme = new TitleMusic(true, _arg1);
}
public function saveInventory():void{
var _local1:SharedObject;
var _local2:*;
if (((nosaving) || (suspendSaving))){
return;
};
if (((!(cacheSaves)) || ((((cacheInventory == null)) || ((cacheInventory.size == 0)))))){
_local1 = SharedObject.getLocal((("slot" + pc_party.save_slot) + "_inventory"));
if (cacheSaves){
cacheInventory = _local1;
};
} else {
_local1 = cacheInventory;
};
_local1.data.inventory = new Array(pc_party.inventory.length);
_local2 = 0;
while (_local2 < pc_party.inventory.length) {
_local1.data.inventory[_local2] = pc_party.inventory[_local2];
_local2++;
};
_local1.data.overflow = new Array(pc_party.overflow.length);
_local2 = 0;
while (_local2 < pc_party.overflow.length) {
_local1.data.overflow[_local2] = pc_party.overflow[_local2];
_local2++;
};
if (!(cacheSaves)){
_local1.flush();
_local1.close();
};
}
public function saveChars():void{
var _local1:SharedObject;
var _local2:PlayerCharacter;
var _local3:PlayerCharacter;
var _local4:int;
if (((nosaving) || (suspendSaving))){
return;
};
_local1 = SharedObject.getLocal((("slot" + pc_party.save_slot) + "_chars"));
for each (_local3 in pc_party.members) {
if ((_local3 is PC_Adventurer)){
_local2 = _local3;
};
};
if (_local2 != null){
_local1.data.ally = _local2;
} else {
_local1.data.ally = null;
};
_local4 = 0;
while (_local4 < 4) {
saveChar(_local4, _local1);
_local4++;
};
_local1.flush();
_local1.close();
}
private function proceedAnimate(_arg1:Boolean=false):void{
var _local2:*;
var _local3:FadeFromPage;
_local2 = getChildByName("loadingPage");
if (_local2 != null){
_local2.animate();
};
if (!(_arg1)){
_local3 = new FadeFromPage();
addChildAt(_local3, (numChildren - 1));
};
}
public function closeInventory():void{
inventory.cleanup();
removeChild(inventory);
if (pc_party.campaign == Campaign.SURVIVAL){
} else {
addChild(dungeon);
saveParty();
saveInventory();
dungeon.updateChars();
};
}
public function leaveShop(_arg1:int):void{
var _local2:*;
var _local3:*;
_local2 = getChildByName("shop");
pc_party.gold = _arg1;
if (_local2 != null){
inventory = new Inventory(pc_party);
_local3 = new TeleportTransition(_local2, inventory);
stage.addChild(_local3);
saveParty();
saveChars();
saveInventory();
_local3.setReady();
};
}
public function creationFinished(_arg1:Party):void{
var _local2:*;
var _local3:PageTurn;
var _local4:int;
var _local5:*;
var _local6:*;
_arg1.version = GAME_VERSION;
pc_party = _arg1;
dm.party = _arg1;
if (DungeonMain.debugitems){
_local4 = 0;
_local4 = 0;
while (_local4 < 5) {
_arg1.addToInventory(new PortalScroll());
_local4++;
};
_local4 = 0;
while (_local4 < 9) {
_arg1.addToInventory(new CampaignItemFragment());
_local4++;
};
_local4 = 0;
while (_local4 < 10) {
_arg1.addToInventory(new Enchantment(1));
_local4++;
};
};
_local2 = getChildByName("creationPage");
if (_local2 != null){
PageTurn(_local2).animate();
};
if (pc_party.campaign == Campaign.SURVIVAL){
levelTo(10);
pc_party.gold = 100000;
pc_party.inventory.length = 0;
_local5 = new SurvivalPrep();
_local3 = new PageTurn(_local5);
_local3.name = "survivalPage";
this.addChildAt(_local3, (this.numChildren - 1));
stopMusic(1500);
} else {
_local6 = new DifficultySelect(pc_party);
_local3 = new PageTurn(_local6);
_local3.name = "difficultyPage";
this.addChildAt(_local3, (this.numChildren - 1));
};
}
function closeDefeatDialog(_arg1:MouseEvent):void{
var _local2 = ??pushnamespace
;
var _local3:*;
proceedAnimate();
musicDungeonTheme();
_local2 = 4;
if (((((!(pc_party.beginner)) && (DungeonMain.showHints))) && ((Dungeon.hintShown(_local2) == false)))){
_local3 = new HintDialog("Defeat!", "You suffer a penalty for the defeat of the entire party.\n\nEach character loses an item of equipment, and up to two items are lost from party inventory.");
DungeonMain.hints = (DungeonMain.hints + _local2);
stage.addChild(_local3);
saveInterface();
};
}
private function checkRecentMonsters():void{
var _local1:uint;
_local1 = 0;
if (pc_party.campaign == Campaign.ORIGINAL){
_local1 = (((Horde.greenskins + Horde.undead) + Horde.cultists) + Horde.creatures);
} else {
_local1 = ((((Horde.greenskins + Horde.undead) + Horde.cultists) + Horde.creatures) + Horde.dwarves);
};
if (recent_monsters == _local1){
recent_monsters = 0;
};
}
private function musicBattleTheme(_arg1:Horde):void{
stopMusic();
battle_theme = new BattleMusic(true, _arg1);
}
public function NewDungeonClick(_arg1:MouseEvent){
var _local2:*;
var _local3:*;
removeChild(dungeon);
dungeon.cleanup();
_local2 = dungeon.race;
dungeon = null;
dungeon = new Dungeon(pc_party, level);
_local3 = false;
while (!(_local3)) {
_local3 = dungeon.generateDungeon();
};
addChild(dungeon);
}
function closeHardcoreDefeatDialog(_arg1:MouseEvent):void{
if (((!((loading == null))) && (!((loading.parent == null))))){
loading.parent.removeChild(loading);
};
if (((!((dungeon == null))) && (!((dungeon.parent == null))))){
dungeon.parent.removeChild(dungeon);
};
mainMenu();
}
public function saveDungeon(_arg1:Boolean=true):void{
var _local2:SharedObject;
var _local3:DungeonRoom;
var _local4:Horde;
if (((nosaving) || (suspendSaving))){
return;
};
if (pc_party.campaign == Campaign.SURVIVAL){
return;
};
if (((!(cacheSaves)) || ((((cacheDungeon == null)) || ((cacheDungeon.size == 0)))))){
_local2 = SharedObject.getLocal((("slot" + pc_party.save_slot) + "_dungeon"));
if (cacheSaves){
cacheDungeon = _local2;
};
_arg1 = true;
} else {
_local2 = cacheDungeon;
};
_local2.data.recent_monsters = recent_monsters;
_local2.data.race = dungeon.race;
_local2.data.tileset = dungeon.tileset;
_local2.data.exit_found = dungeon.exit_found;
_local2.data.previous_cleared = dungeon.previousLevelCleared;
_local2.data.portalScrollRoomIndex = dungeon.portalScrollRoomIndex;
_local2.data.currentRoomIndex = dungeon.currentRoom.index;
_local2.data.rooms = new Array();
for each (_local3 in dungeon.room_array) {
_local2.data.rooms.push(_local3.roomData());
};
if (_arg1){
_local2.data.hordes = new Array();
for each (_local4 in dungeon.hordes) {
_local2.data.hordes.push(_local4.hordeData());
};
if (dungeon.hordes.length >= 1){
_local2.data.h0_members = dungeon.hordes[0].members;
};
if (dungeon.hordes.length >= 2){
_local2.data.h1_members = dungeon.hordes[1].members;
};
if (dungeon.hordes.length >= 3){
_local2.data.h2_members = dungeon.hordes[2].members;
};
if (dungeon.hordes.length >= 4){
_local2.data.h3_members = dungeon.hordes[3].members;
};
if (dungeon.hordes.length >= 5){
_local2.data.h4_members = dungeon.hordes[4].members;
};
if (dungeon.hordes.length >= 6){
_local2.data.h5_members = dungeon.hordes[5].members;
};
if (dungeon.hordes.length >= 7){
_local2.data.h6_members = dungeon.hordes[6].members;
};
if (dungeon.hordes.length >= 8){
_local2.data.h7_members = dungeon.hordes[7].members;
};
if (dungeon.hordes.length >= 9){
_local2.data.h8_members = dungeon.hordes[8].members;
};
if (dungeon.hordes.length >= 10){
_local2.data.h9_members = dungeon.hordes[9].members;
};
};
if (!(cacheSaves)){
_local2.flush();
_local2.close();
};
}
private function saveChar(_arg1:int, _arg2:SharedObject):void{
var _local3:PlayerCharacter;
var _local4:Array;
var _local5:Array;
var _local6:Array;
var _local7:Skill;
var _local8:Array;
var _local9:int;
_local3 = pc_party.members[_arg1];
if (_local3 != null){
_local4 = new Array();
_local5 = new Array();
_local6 = new Array();
for each (_local7 in _local3.skills) {
_local4.push(_local7.active);
_local5.push(_local7.position);
_local6.push(_local7.unlocked);
};
_local8 = new Array(Equipment.gearSlots);
_local9 = 0;
while (_local9 < Equipment.gearSlots) {
_local8[_local9] = _local3.gear[_local9];
_local9++;
};
if (_arg1 == 0){
_arg2.data.char1_skills_active = _local4;
_arg2.data.char1_skills_position = _local5;
_arg2.data.char1_skills_unlocked = _local6;
_arg2.data.char1_equipment = _local8;
_arg2.data.char1 = _local3;
} else {
if (_arg1 == 1){
_arg2.data.char2_skills_active = _local4;
_arg2.data.char2_skills_position = _local5;
_arg2.data.char2_skills_unlocked = _local6;
_arg2.data.char2_equipment = _local8;
_arg2.data.char2 = _local3;
} else {
if (_arg1 == 2){
_arg2.data.char3_skills_active = _local4;
_arg2.data.char3_skills_position = _local5;
_arg2.data.char3_skills_unlocked = _local6;
_arg2.data.char3_equipment = _local8;
_arg2.data.char3 = _local3;
} else {
if (_arg1 == 3){
_arg2.data.char4_skills_active = _local4;
_arg2.data.char4_skills_position = _local5;
_arg2.data.char4_skills_unlocked = _local6;
_arg2.data.char4_equipment = _local8;
_arg2.data.char4 = _local3;
};
};
};
};
};
}
public function beginBattle(_arg1:Horde, _arg2:Boolean=false):void{
var err_txt:*;
var err_dlg:ErrorDialog;
var h = _arg1;
var skipSave = _arg2;
try {
dungeon.mouseEnabled = false;
dungeon.mouseChildren = false;
battle = new Battlefield();
battle.pc_party = pc_party;
battle.horde = h;
if (!(skipSave)){
saveAll(true);
};
suspendSaving = true;
} catch(error:Error) {
if (((DungeonMain.KONGREGATE) || (DungeonMain.BETA))){
err_txt = "An error has occurred. Please submit a bug report with the following information:\n\n";
err_txt = (err_txt + (("Init Battlefield error: " + error.name) + "\n"));
if (h != null){
err_txt = (err_txt + (("horde: " + h) + "\n"));
};
err_txt = (err_txt + (("suspend: " + suspendSaving) + "\n"));
err_txt = (err_txt + ((("[" + error.errorID) + "] ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
};
};
try {
battleTimer = new Timer(1000, 1);
battleTimer.addEventListener(TimerEvent.TIMER_COMPLETE, battleTimerFinished);
battleTimer.start();
if (h.room != null){
dmf.childToTop(h.room);
};
h.battleAnim();
} catch(error:Error) {
battleTimerFinished(null);
};
}
public function mainMenu(_arg1:Boolean=false, _arg2:Boolean=false):void{
var _local3:*;
var _local4:*;
var _local5:String;
var _local6:HintDialog;
debug_label.text = "Accessing main menu..";
suspendSaving = false;
clearSaveCache();
_local3 = getChildByName("intro");
if (((!((_local3 == null))) && (contains(_local3)))){
removeChild(_local3);
};
if (battle_theme != null){
battle_theme.fadeOut(500);
};
if (dungeon_theme != null){
dungeon_theme.fadeOut(500);
};
if (title_theme == null){
musicTitleTheme();
};
_local4 = new TitleScreen();
_local4.name = "title";
addChild(_local4);
if (!(_arg2)){
_local4.closeCover();
};
if (_arg1){
_local5 = "The quest has been completed, but the adventure is not over. \n\nYou may continue with your party, gaining power and items, as long as you wish.\n\nCheck the party inventory for bonus rewards!";
_local6 = new HintDialog("Infinite Mode Unlocked", _local5, false, true);
stage.addChild(_local6);
};
}
private function campaignBossDefeated(_arg1:int):void{
var new_monsters:*;
var campaign = _arg1;
if (dungeon != null){
dungeon.cleanup();
if (dungeon.parent != null){
dungeon.parent.removeChild(dungeon);
};
};
dungeon = null;
infiniteTransition = true;
pc_party.campaign = Campaign.INFINITE;
pc_party.fullRecovery();
levelUp();
pc_party.removeQuestItems();
if (campaign == Campaign.ORIGINAL){
pc_party.addDemonLoot();
} else {
if (campaign == Campaign.DELUXE){
pc_party.addDeluxeLoot();
};
};
checkRecentMonsters();
new_monsters = Dungeon.getMonsterRace(level, recent_monsters, pc_party.campaign);
addToRecentMonsters(new_monsters);
dungeon = new Dungeon(pc_party, level, new_monsters, true);
addLoadingScreen(Campaign.getOutroText(campaign), this.proceedClick, true);
updateHighScores();
try {
if (((KONGREGATE) && (!((kongregateSWF == null))))){
if (campaign == Campaign.ORIGINAL){
kongregateSWF.stats.submit("original_quest_complete", 1);
} else {
if (campaign == Campaign.DELUXE){
kongregateSWF.stats.submit("deluxe_quest_complete", 1);
};
};
kongregateSWF.stats.submit("any_quest_complete", 1);
};
} catch(e:Error) {
} finally {
startDungeonTimer();
};
}
private function kongCheck():Boolean{
var _local1:String;
var _local2:int;
var _local3:int;
var _local4:String;
var _local5:int;
var _local6:int;
var _local7:*;
if (dm.stage == null){
return (false);
};
_local1 = dm.stage.loaderInfo.url;
_local2 = (_local1.indexOf("://") + 3);
_local3 = _local1.indexOf("/", _local2);
_local4 = _local1.substring(_local2, _local3);
_local5 = (_local4.lastIndexOf(".") - 1);
_local6 = (_local4.lastIndexOf(".", _local5) + 1);
_local4 = _local4.substring(_local6, _local4.length);
_local7 = dm.stage.loaderInfo.parameters;
if ((((_local4 == "kongregate.com")) && ((_local7.kongregate == "true")))){
return (true);
};
return (false);
}
public function loadInterface():void{
var _local1:ErrorDialog;
debug_label.text = "Loading interface settings..";
interfaceSettings = SharedObject.getLocal("interface");
if (interfaceSettings.size > 0){
GlobalVolume.setVolume(interfaceSettings.data.globalVolumeSetting);
SoundControl.volumeSetting = interfaceSettings.data.sfxVolumeSetting;
setMusicVolume(interfaceSettings.data.musicVolumeSetting);
if (interfaceSettings.data.quality != null){
QualitySelector.setQuality(interfaceSettings.data.quality);
};
showHints = interfaceSettings.data.showHints;
hints = interfaceSettings.data.hints;
combatBlur = interfaceSettings.data.combatBlur;
portraitHighlight = interfaceSettings.data.portraitHighlight;
pathfinding = interfaceSettings.data.pathfinding;
tooltipDelay = interfaceSettings.data.tooltipDelay;
highScore = Math.max(highScore, interfaceSettings.data.highScore);
highLevel = Math.max(highLevel, interfaceSettings.data.highLevel);
bestSurvival = Math.max(bestSurvival, interfaceSettings.data.bestSurvival);
};
}
public function descendClick(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
var _local4:*;
saveAll(false);
suspendSaving = true;
levelUp();
dungeon.cleanup();
removeChild(dungeon);
_local2 = dungeon.race;
_local3 = dungeon.fullyCleared();
dungeon = null;
checkRecentMonsters();
_local4 = Dungeon.getMonsterRace(level, recent_monsters, pc_party.campaign);
addToRecentMonsters(_local4);
dungeon = new Dungeon(pc_party, level, _local4, _local3);
if ((((pc_party.campaign == Campaign.ORIGINAL)) && ((level == MAX_LEVEL)))){
addLoadingScreen("The party descend to the next level.\n\nIn their quest they have battled many and experienced much, but\nthey find themselves unprepared for what awaits them here. Never\nyet have they encountered so palpable a sense of evil. It pervades\nthese halls, and lesser men would flee in terror at its touch.\n\nThese few, though, have not come so far only to falter at the last. They sense that they have reached their destination and victory\nnow lies within their grasp.\n\nWithout exchanging a word, the heroes know what they must do. Nothing in this place may be suffered to live.", this.proceedClick, true);
} else {
addLoadingScreen(dungeon.getIntroduction(_local4), this.proceedClick);
};
startDungeonTimer();
}
function battleTimerFinished(_arg1:TimerEvent):void{
battleTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, battleTimerFinished);
battle.layoutBoard();
if (this.contains(dungeon)){
removeChild(dungeon);
};
addChild(battle);
dungeon.mouseEnabled = true;
dungeon.mouseChildren = true;
musicBattleTheme(battle.horde);
}
private function added(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, added);
if (stage != null){
dm.stage = stage;
};
}
public function bookIntro():void{
var intro:Intro;
debug_label.text = "Starting intro..";
try {
intro = new Intro();
intro.name = "intro";
addChild(intro);
musicTitleTheme(false);
} catch(e:Error) {
if (((!((intro == null))) && (contains(intro)))){
removeChild(intro);
};
mainMenu(false, true);
};
}
public function saveAll(_arg1:Boolean=false):void{
var i:int;
var j:int;
var saved:int;
var enteringBattle = _arg1;
if (((nosaving) || (suspendSaving))){
return;
};
saved = 0;
beginStatSubmit();
try {
saveInterface();
saved = 1;
saveParty(enteringBattle);
saved = 2;
saveChars();
saved = 3;
saveInventory();
saved = 4;
saveDungeon();
saved = 5;
if (cacheSaves){
if (((!((cacheParty == null))) && ((cacheParty.size > 0)))){
cacheParty.flush();
};
if (((!((cacheInventory == null))) && ((cacheInventory.size > 0)))){
cacheInventory.flush();
};
if (((!((cacheDungeon == null))) && ((cacheDungeon.size > 0)))){
cacheDungeon.flush();
};
};
} catch(error:Error) {
};
}
public function beginStatSubmit():void{
var kongTF:TextField;
if (pc_party.campaign == Campaign.SURVIVAL){
return;
};
saveRating = Math.round(pc_party.getScore());
saveGold = Math.round(pc_party.gold);
saveLevel = Math.round(pc_party.level);
try {
if (((((KONGREGATE) || (debug))) && (!((kongregateSWF == null))))){
kongregateSWF.stats.submit("HighestRating", saveRating);
kongregateSWF.stats.submit("HighestGold", saveGold);
kongregateSWF.stats.submit("HighestLevel", saveLevel);
kongregateSWF.stats.submit("HighestSurvivalWave", bestSurvival);
if (pc_party.campaign == Campaign.INFINITE){
kongregateSWF.stats.submit("any_quest_complete", 1);
};
if (debug){
kongTF = TextField(stage.getChildByName("kongTF"));
if (kongTF == null){
kongTF = new TextField();
};
kongTF.name = "kongTF";
kongTF.text = ((((((dmf.getCurrentTimeString() + " Level: ") + saveLevel) + ", Rating: ") + saveRating) + ", Gold: ") + saveGold);
kongTF.width = 450;
kongTF.textColor = 1048575;
kongTF.mouseEnabled = false;
kongTF.x = 3;
kongTF.y = 3;
if (!(stage.contains(kongTF))){
stage.addChild(kongTF);
};
};
};
} catch(error:Error) {
};
}
private function getLoadingScreen(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:Boolean=false):PageTurn{
var _local5:*;
var _local6:PageTurn;
var _local7:*;
loading = new DungeonLoading();
loading.name = "dungeonloading";
loading.setCallback(_arg2);
_local5 = loading.setText(_arg1);
loading.prose.y = ((APP_HEIGHT - _local5) / 2);
if (_arg3){
_local7 = (((loading.prose.y + loading.prose.textHeight) + 15) - loading.proceed_btn.y);
if (_local7 > 0){
loading.prose.y = Math.max(0, (loading.prose.y - _local7));
};
};
if (_arg4){
loading.allowProceed();
} else {
loading.removeChild(loading.proceed_btn);
};
_local6 = new PageTurn(loading);
_local6.name = "loadingPage";
return (_local6);
}
private function initKongregateAPI():void{
var _local1:Object;
var _local2:String;
var _local3:URLRequest;
var _local4:Loader;
debug_label.text = "Init Kongregate API..";
if (kongLoaded){
return;
};
Security.allowDomain("kongregate.com");
Security.allowDomain("http://www.kongregate.com/flash/API_AS3_Local.swf");
_local1 = LoaderInfo(root.loaderInfo).parameters;
_local2 = ((_local1.api_path) || ("http://www.kongregate.com/flash/API_AS3_Local.swf"));
_local3 = new URLRequest(_local2);
_local4 = new Loader();
_local4.contentLoaderInfo.addEventListener(Event.COMPLETE, kLoadComplete);
_local4.load(_local3);
this.addChild(_local4);
}
public function goToInventory(_arg1:PlayerCharacter=null){
inventory = new Inventory(pc_party);
if (((!((dungeon == null))) && (this.contains(dungeon)))){
removeChild(dungeon);
};
addChild(inventory);
inventory.init();
if (_arg1 != null){
inventory.selectChar(_arg1);
};
}
private function levelTo(_arg1:int):void{
var _local2:PlayerCharacter;
pc_party.level = _arg1;
this.level = _arg1;
for each (_local2 in pc_party.members) {
_local2.levelTo(_arg1);
};
}
public function goToShop():void{
var _local1:Shop;
var _local2:*;
inventory.cleanup();
saveAll();
clearSaveCache();
_local1 = new Shop(pc_party);
_local1.name = "shop";
_local2 = new TeleportTransition(inventory, _local1);
stage.addChild(_local2);
_local2.setReady();
}
public function removeInventory():void{
if (inventory != null){
inventory.cleanup();
if (this.contains(inventory)){
removeChild(inventory);
};
inventory = null;
};
}
private function levelUp():void{
var _local1:*;
level++;
pc_party.level++;
_local1 = 0;
while (_local1 < pc_party.members.length) {
if (level > pc_party.members[_local1].level){
pc_party.members[_local1].levelUp();
};
_local1++;
};
pc_party.fullRecovery();
}
private function stopMusic(_arg1:int=0):void{
if (_arg1){
if (title_theme != null){
title_theme.fadeOut(_arg1);
};
if (battle_theme != null){
battle_theme.fadeOut(_arg1);
};
if (dungeon_theme != null){
dungeon_theme.fadeOut(_arg1);
};
} else {
if (title_theme != null){
title_theme.stop();
title_theme = null;
};
if (battle_theme != null){
battle_theme.stop();
battle_theme = null;
};
if (dungeon_theme != null){
dungeon_theme.stop();
dungeon_theme = null;
};
};
}
public function beginSurvivalMode():void{
var _local1:FadeFromPage;
var _local2:*;
suspendSaving = false;
saveAll();
clearSaveCache();
suspendSaving = true;
pc_party.fullRecovery();
battle = new Battlefield();
battle.pc_party = pc_party;
battle.horde = new Horde();
battle.horde.members.length = 0;
battle.layoutBoard();
musicBattleTheme(battle.horde);
this.addChildAt(battle, (this.numChildren - 1));
_local1 = new FadeFromPage();
addChildAt(_local1, (this.numChildren - 1));
_local2 = getChildByName("survivalPage");
if (_local2 != null){
PageTurn(_local2).animate();
};
}
public function saveParty(_arg1:Boolean=false):void{
var _local2:SharedObject;
var _local3:int;
if (((nosaving) || (suspendSaving))){
return;
};
if (((!(cacheSaves)) || ((((cacheParty == null)) || ((cacheParty.size == 0)))))){
_local2 = SharedObject.getLocal((("slot" + pc_party.save_slot) + "_party"));
if (cacheSaves){
cacheParty = _local2;
};
} else {
_local2 = cacheParty;
};
_local2.data.battle = _arg1;
if (_arg1){
_local2.data.pc_party = pc_party.duplicate();
} else {
_local2.data.pc_party = pc_party;
};
if (pc_party.campaign != Campaign.SURVIVAL){
_local3 = pc_party.getScore();
updateHighScores(_local3);
};
if (!(cacheSaves)){
_local2.flush();
_local2.close();
};
}
public function difficultySelected():void{
var _local1:*;
var _local2:*;
var _local3:String;
var _local4:PageTurn;
var _local5:*;
recent_monsters = 0;
_local1 = Dungeon.getMonsterRace(1, recent_monsters, pc_party.campaign);
addToRecentMonsters(_local1);
level = 1;
if (DungeonMain.debug){
level = startAtLevel;
pc_party.level = level;
_local5 = 1;
while (_local5 < level) {
pc_party.levelUp();
_local5++;
};
};
dungeon = new Dungeon(pc_party, level, _local1, false);
_local2 = getChildByName("difficultyPage");
if (_local2 != null){
PageTurn(_local2).animate();
};
_local3 = Campaign.getIntroText(pc_party.campaign);
if (_local3 == ""){
_local3 = ("Could not retrieve intro text for campaign " + pc_party.campaign);
};
_local4 = getLoadingScreen(_local3, this.proceedClick);
this.addChildAt(_local4, (this.numChildren - 1));
startDungeonTimer();
}
public function loadGameMenu(){
var _local1:*;
var _local2:PageTurn;
_local1 = new LoadParty();
_local1.name = "LoadParty";
_local2 = new PageTurn(_local1);
_local2.name = "loadPage";
this.addChildAt(_local2, (this.numChildren - 1));
}
public function proceedClick(_arg1:MouseEvent):void{
addChildAt(dungeon, (numChildren - 1));
proceedAnimate();
if (infiniteTransition){
saveAll();
infiniteTransition = false;
mainMenu(true);
} else {
musicDungeonTheme(true);
};
}
private function addToRecentMonsters(_arg1:int):void{
if ((recent_monsters & _arg1) == _arg1){
recent_monsters = 0;
} else {
recent_monsters = (recent_monsters + _arg1);
};
}
public function startGame(_arg1:int=1){
var _local2:*;
var _local3:PageTurn;
var _local4:*;
clearSaveCache();
this.creationSlot = _arg1;
loadInterface();
_local2 = new CampaignSelect();
_local3 = new PageTurn(_local2);
_local3.name = "campaignPage";
this.addChildAt(_local3, (this.numChildren - 1));
_local4 = getChildByName("loadPage");
if (_local4 != null){
PageTurn(_local4).animate();
};
}
public function generateDungeon(_arg1:TimerEvent=null):void{
var _local2:*;
var _local3:*;
if (dungeonTimer != null){
dungeonTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, generateDungeon);
};
_local2 = false;
_local3 = 0;
while (((!(_local2)) && ((_local3 < 5)))) {
_local2 = dungeon.generateDungeon();
_local3++;
};
if (_local2){
dungeonLoadingFinished();
} else {
startDungeonTimer();
};
}
public function PostBattle(_arg1:Horde, _arg2:Party):void{
var _local3:*;
var _local4:PlayerCharacter;
var _local5:int;
var _local6:int;
var _local7:AllyDiedDialog;
var _local8:*;
var _local9:Boolean;
var _local10:String;
var _local11:Number;
var _local12:TreasureChest;
var _local13:Item;
var _local14:MonsterCharacter;
var _local15:MonsterCharacter;
_local3 = false;
battle.cleanup();
removeChild(battle);
battle = null;
suspendSaving = false;
_local4 = PlayerCharacter(pc_party.getAlly());
if (_local4 != null){
_local6 = dmf.randomNum(0, 99);
if (_local4.health > 0){
if (_local6 < 25){
_local7 = new AllyDiedDialog(_local4);
dungeon.addChild(_local7);
_local4.health = 0;
};
};
};
_local5 = (pc_party.members.length - 1);
while (_local5 >= 0) {
if (pc_party.members[_local5].summoned){
pc_party.members.splice(_local5, 1);
} else {
if ((((pc_party.members[_local5] is PC_Adventurer)) && ((pc_party.members[_local5].health <= 0)))){
pc_party.members.splice(_local5, 1);
} else {
pc_party.members[_local5].clearStatusEffects();
};
};
_local5--;
};
_arg1.resetMembers();
_arg1.tooltip = null;
addChild(dungeon);
if (pc_party.isPartyDead()){
pc_party.stat_party_defeats++;
if (pc_party.hardcore){
beginStatSubmit();
deleteSave(pc_party.save_slot);
pc_party = null;
_local8 = "The heroes have fallen. Jubilant shouts ring through the ancient\nhalls as the enemy celebrate their victory.\n\nThough the adventurers fought bravely and endured much, in the\nend it was not enough-- the forces of darkness proving too strong.\n\nThe only hope that remains is that another group of brave souls\nmay be found, to attempt once more to enter the monsters' den\nand penetrate its dark heart.";
addLoadingScreen(_local8, this.closeHardcoreDefeatDialog, false, true);
return;
};
_local9 = pc_party.deathPenalty();
if ((((pc_party.campaign == Campaign.DELUXE)) && (_arg1.isCampaignBoss()))){
saveAll();
} else {
dungeon.retreatFromMonsters(_arg1);
};
if (pc_party.beginner){
_local10 = "The party has been defeated in battle. The enemy cheer over\nthe fallen bodies, exultant in their victory.\n\nTime passes.\n\nEventually, the bodies begin to stir. Were the enemy less successful\nthan they hoped, or is this a miracle-- an act of divine provenance?\n\nWhatever the explanation may be, our heroes have survived to\ncontinue their quest. There is hope yet.";
} else {
_local10 = "The party has been defeated in battle. The enemy pick over the\nfallen bodies, claiming a few choice items as trophies of their\nvictory.\n\nTime passes.\n\nEventually, the bodies begin to stir. Were the enemy less successful\nthan they hoped, or is this a miracle-- an act of divine provenance?\n\nWhatever the explanation may be, our heroes have survived to\ncontinue their quest. There is hope yet.";
};
addLoadingScreen(_local10, this.closeDefeatDialog, false, true);
if (_local9){
};
_local3 = true;
} else {
if (!(_arg1.defeated)){
if ((((pc_party.campaign == Campaign.DELUXE)) && (_arg1.isCampaignBoss()))){
saveAll();
} else {
dungeon.retreatFromMonsters(_arg1);
};
};
};
dungeon.updateChars();
if (_arg1.defeated){
_arg1.fade();
pc_party.stat_hordes_defeated++;
if (_arg1.boss){
pc_party.stat_leaders_defeated++;
};
if (_arg1.isCampaignBoss()){
campaignBossDefeated(pc_party.campaign);
return;
};
dungeon.hordeDefeated(_arg1);
_local11 = 0.75;
_local12 = new TreasureChest(pc_party, level, Math.round((_arg1.members.length * _local11)), _arg1.boss, true);
if (((((_arg1.legendary) || ((_arg1.boss > 1)))) || (((((_arg1.boss) && ((pc_party.campaign == Campaign.INFINITE)))) && ((_arg1.race == Horde.special)))))){
for each (_local15 in _arg1.members) {
if (((!((_local15 == null))) && ((((((((((_local15 is mHydraBody)) || ((_local15 is mGorgon)))) || ((_local15 is mMinotaur)))) || ((_local15 is mDreadfather)))) || ((_local15 is mDemon)))))){
_local14 = _local15;
};
};
if (_local14 != null){
_local13 = _local14.getOrangeLoot();
} else {
_local13 = _arg1.members[0].getOrangeLoot();
};
if (_local13 != null){
_local12.loot.length = 0;
_local12.loot.push(_local13);
//unresolved jump
};
};
if ((((pc_party.campaign == Campaign.DELUXE)) && (_arg1.hasFearSower()))){
if (pc_party.needCampaignFragment()){
_local12.loot.push(new CampaignItemFragment());
};
};
if (_local12.loot.length){
dungeon.addTreasureReport(_local12, true);
};
};
dungeon.updateRating();
if (!(_local3)){
musicDungeonTheme();
};
saveAll(false);
}
public function removeDungeon():void{
if (dungeon != null){
if (this.contains(dungeon)){
removeChild(dungeon);
};
dungeon.cleanup();
dungeon = null;
};
}
public function goToSanctum():void{
var _local1:Horde;
var _local2:*;
inventory.cleanup();
saveParty();
saveChars();
saveInventory();
_local1 = new Horde(Horde.special, level, 1, null, true, false);
_local1.addDeluxeBoss();
battle = new Battlefield();
battle.pc_party = pc_party;
battle.horde = _local1;
battle.layoutBoard();
musicBattleTheme(_local1);
_local2 = new TeleportTransition(inventory, battle);
stage.addChild(_local2);
_local2.setReady();
}
private function addLoadingScreen(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:Boolean=false):void{
var _local5:PageTurn;
stopMusic(200);
_local5 = getLoadingScreen(_arg1, _arg2, _arg3, _arg4);
addChild(_local5);
}
public function InventoryClick(_arg1:MouseEvent){
goToInventory();
}
private function dungeonLoadingFinished():void{
suspendSaving = false;
saveAll(false);
loading.allowProceed();
}
public function campaignSelected(_arg1:int):void{
var _local2:*;
var _local3:PageTurn;
_local2 = getChildByName("campaignPage");
if (_local2 != null){
PageTurn(_local2).animate();
};
level = 1;
creation = new PartyCreation();
creation.pc_party.save_slot = creationSlot;
creation.pc_party.campaign = _arg1;
_local3 = new PageTurn(creation);
_local3.name = "creationPage";
this.addChildAt(_local3, (this.numChildren - 1));
}
public function dungeonMenuClick(_arg1:MouseEvent):void{
saveAll(false);
mainMenu();
}
function maxGamesClick(_arg1:MouseEvent):void{
dmf.link("http://www.maxgames.com");
}
public function setMusicVolume(_arg1:Number):void{
Music.volumeSetting = _arg1;
if (((!((dungeon_theme == null))) && (dungeon_theme.active))){
dungeon_theme.setVolume(_arg1);
};
if (((!((battle_theme == null))) && (battle_theme.active))){
battle_theme.setVolume(_arg1);
};
if (((!((title_theme == null))) && (title_theme.active))){
title_theme.setVolume(_arg1);
};
}
private function hostUrlContains(_arg1:String):Boolean{
if ((((dm.stage == null)) && ((stage == null)))){
return (false);
};
if (dm.stage.loaderInfo.loaderURL.indexOf(_arg1) != -1){
return (true);
};
return (false);
}
private function enterSavedBattleTimerExpired(_arg1:Event):void{
var _local2:Horde;
enterSavedBattleTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, enterSavedBattleTimerExpired);
_local2 = dungeon.currentRoom.horde;
beginBattle(_local2, true);
}
private function musicDungeonTheme(_arg1:Boolean=false):void{
stopMusic();
dungeon_theme = new DungeonMusic(_arg1);
}
public function loadGame(_arg1:int):void{
var _local2:int;
var _local3:int;
var _local4:Boolean;
var _local5:SharedObject;
var _local6:ErrorDialog;
var _local7:PlayerCharacter;
var _local8:PC_Adventurer;
var _local9:*;
var _local10:*;
var _local11:FadeFromPage;
var _local12:*;
var _local13:*;
var _local14:PageTurn;
if ((((_arg1 <= 0)) || ((_arg1 > 3)))){
return;
};
_local4 = false;
loadInterface();
clearSaveCache();
_local5 = SharedObject.getLocal((("slot" + _arg1) + "_party"));
if (((!((_local5 == null))) && ((_local5.size > 0)))){
if (cacheSaves){
cacheParty = _local5;
};
_local4 = _local5.data.battle;
pc_party = Party(_local5.data.pc_party);
dm.party = pc_party;
pc_party.save_slot = _arg1;
this.level = pc_party.level;
} else {
_local6 = new ErrorDialog("Error!", "The party information could not be loaded.");
dm.stage.addChild(_local6);
};
_local5 = SharedObject.getLocal((("slot" + _arg1) + "_chars"));
if (((!((_local5 == null))) && ((_local5.size > 0)))){
if (_local5.data.char1 != null){
pc_party.members[0] = _local5.data.char1;
_local2 = 0;
while (_local2 < _local5.data.char1_skills_active.length) {
pc_party.members[0].skills[_local2].active = _local5.data.char1_skills_active[_local2];
pc_party.members[0].skills[_local2].position = _local5.data.char1_skills_position[_local2];
pc_party.members[0].skills[_local2].unlocked = _local5.data.char1_skills_unlocked[_local2];
_local2++;
};
_local2 = 0;
while (_local2 < Equipment.gearSlots) {
pc_party.members[0].gear[_local2] = _local5.data.char1_equipment[_local2];
_local2++;
};
pc_party.members[0].party = pc_party;
};
if (_local5.data.char2 != null){
pc_party.members[1] = _local5.data.char2;
_local2 = 0;
while (_local2 < _local5.data.char2_skills_active.length) {
pc_party.members[1].skills[_local2].active = _local5.data.char2_skills_active[_local2];
pc_party.members[1].skills[_local2].position = _local5.data.char2_skills_position[_local2];
pc_party.members[1].skills[_local2].unlocked = _local5.data.char2_skills_unlocked[_local2];
_local2++;
};
_local2 = 0;
while (_local2 < Equipment.gearSlots) {
pc_party.members[1].gear[_local2] = _local5.data.char2_equipment[_local2];
_local2++;
};
pc_party.members[1].party = pc_party;
};
if (_local5.data.char3 != null){
pc_party.members[2] = _local5.data.char3;
_local2 = 0;
while (_local2 < _local5.data.char3_skills_active.length) {
pc_party.members[2].skills[_local2].active = _local5.data.char3_skills_active[_local2];
pc_party.members[2].skills[_local2].position = _local5.data.char3_skills_position[_local2];
pc_party.members[2].skills[_local2].unlocked = _local5.data.char3_skills_unlocked[_local2];
_local2++;
};
_local2 = 0;
while (_local2 < Equipment.gearSlots) {
pc_party.members[2].gear[_local2] = _local5.data.char3_equipment[_local2];
_local2++;
};
pc_party.members[2].party = pc_party;
};
if (_local5.data.char4 != null){
pc_party.members[3] = _local5.data.char4;
_local2 = 0;
while (_local2 < _local5.data.char4_skills_active.length) {
pc_party.members[3].skills[_local2].active = _local5.data.char4_skills_active[_local2];
pc_party.members[3].skills[_local2].position = _local5.data.char4_skills_position[_local2];
pc_party.members[3].skills[_local2].unlocked = _local5.data.char4_skills_unlocked[_local2];
_local2++;
};
_local2 = 0;
while (_local2 < Equipment.gearSlots) {
pc_party.members[3].gear[_local2] = _local5.data.char4_equipment[_local2];
_local2++;
};
pc_party.members[3].party = pc_party;
};
for each (_local7 in pc_party.members) {
_local7.loadCustomPortrait();
};
if (_local5.data.ally != null){
_local8 = _local5.data.ally;
_local8.party = pc_party;
_local8.initAdvSkills();
pc_party.members.push(_local8);
};
} else {
_local6 = new ErrorDialog("Error!", "The character information could not be loaded.");
dm.stage.addChild(_local6);
};
_local5 = SharedObject.getLocal((("slot" + _arg1) + "_inventory"));
if (((!((_local5 == null))) && ((_local5.size > 0)))){
if (cacheSaves){
cacheInventory = _local5;
};
pc_party.inventory = _local5.data.inventory;
pc_party.overflow = _local5.data.overflow;
} else {
_local6 = new ErrorDialog("Error!", "The inventory information could not be loaded.");
dm.stage.addChild(_local6);
};
_local5 = SharedObject.getLocal((("slot" + _arg1) + "_dungeon"));
if (((!((_local5 == null))) && ((_local5.size > 0)))){
if (cacheSaves){
cacheDungeon = _local5;
};
recent_monsters = _local5.data.recent_monsters;
if (_local5.data.hordes.length >= 1){
_local5.data.hordes[0].members = _local5.data.h0_members;
};
if (_local5.data.hordes.length >= 2){
_local5.data.hordes[1].members = _local5.data.h1_members;
};
if (_local5.data.hordes.length >= 3){
_local5.data.hordes[2].members = _local5.data.h2_members;
};
if (_local5.data.hordes.length >= 4){
_local5.data.hordes[3].members = _local5.data.h3_members;
};
if (_local5.data.hordes.length >= 5){
_local5.data.hordes[4].members = _local5.data.h4_members;
};
if (_local5.data.hordes.length >= 6){
_local5.data.hordes[5].members = _local5.data.h5_members;
};
if (_local5.data.hordes.length >= 7){
_local5.data.hordes[6].members = _local5.data.h6_members;
};
if (_local5.data.hordes.length >= 8){
_local5.data.hordes[7].members = _local5.data.h7_members;
};
if (_local5.data.hordes.length >= 9){
_local5.data.hordes[8].members = _local5.data.h8_members;
};
if (_local5.data.hordes.length >= 10){
_local5.data.hordes[9].members = _local5.data.h9_members;
};
dungeon = new Dungeon(pc_party, this.level, _local5.data.race);
dungeon.portalScrollRoomIndex = _local5.data.portalScrollRoomIndex;
_local9 = dungeon.createFromDataArray(_local5.data.rooms, _local5.data.currentRoomIndex, _local5.data.hordes, _local5.data.previous_cleared);
if (!(_local9)){
} else {
if (_local5.data.exit_found){
dungeon.foundExit();
};
_local10 = getChildByName("loadPage");
if (_local10 != null){
_local10.animate();
};
addChildAt(dungeon, (numChildren - 1));
_local11 = new FadeFromPage();
addChildAt(_local11, (numChildren - 1));
if (((((_local4) && (!((dungeon.currentRoom.horde == null))))) && (!(dungeon.currentRoom.horde.defeated)))){
dungeon.currentRoom.horde.resetMembers();
dungeon.mouseEnabled = false;
dungeon.mouseChildren = false;
enterSavedBattleTimer = new Timer(2000, 1);
enterSavedBattleTimer.addEventListener(TimerEvent.TIMER_COMPLETE, enterSavedBattleTimerExpired);
enterSavedBattleTimer.start();
} else {
musicDungeonTheme(true);
};
};
} else {
if (pc_party.campaign != Campaign.SURVIVAL){
_local6 = new ErrorDialog("Error!", "The dungeon information could not be loaded.");
dm.stage.addChild(_local6);
};
};
if (pc_party.campaign == Campaign.SURVIVAL){
_local12 = getChildByName("loadPage");
if (_local12 != null){
_local12.animate();
};
_local13 = new SurvivalPrep();
_local14 = new PageTurn(_local13);
_local14.name = "survivalPage";
this.addChildAt(_local14, (this.numChildren - 1));
} else {
beginStatSubmit();
};
}
public static function RandomNum(_arg1:int, _arg2:int):int{
var _local3:*;
_local3 = (Math.round((Math.random() * (_arg2 - _arg1))) + _arg1);
return (_local3);
}
public static function deleteSave(_arg1:int):void{
if (DungeonMain.debug){
};
clearObject((("slot" + _arg1) + "_party"));
clearObject((("slot" + _arg1) + "_chars"));
clearObject((("slot" + _arg1) + "_inventory"));
clearObject((("slot" + _arg1) + "_dungeon"));
}
public static function registerAliases():void{
registerClassAlias("PartyAlias", Party);
registerClassAlias("PlayerCharacterAlias", PlayerCharacter);
registerClassAlias("PC_ClericAlias", PC_Cleric);
registerClassAlias("PC_RogueAlias", PC_Rogue);
registerClassAlias("PC_MageAlias", PC_Mage);
registerClassAlias("PC_WarriorAlias", PC_Warrior);
registerClassAlias("PC_RangerAlias", PC_Ranger);
registerClassAlias("PC_ConjurorAlias", PC_Conjuror);
registerClassAlias("PC_BarbarianAlias", PC_Barbarian);
registerClassAlias("PC_AdventurerAlias", PC_Adventurer);
registerClassAlias("DungeonRoomDataAlias", DungeonRoomData);
registerClassAlias("HordeDataAlias", HordeData);
registerClassAlias("MonsterCharacterAlias", MonsterCharacter);
registerClassAlias("mDemonAlias", mDemon);
registerClassAlias("mDreadfatherAlias", mDreadfather);
registerClassAlias("mFearSower", mFearSower);
registerClassAlias("mDeathKnightAlias", mDeathKnight);
registerClassAlias("mNecromancerAlias", mNecromancer);
registerClassAlias("mOrcJuggernaut", mOrcJuggernaut);
registerClassAlias("mOrcWarlordAlias", mOrcWarlord);
registerClassAlias("mDragonAlias", mDragon);
registerClassAlias("mBeholderAlias", mBeholder);
registerClassAlias("mCultEngineAlias", mCultEngine);
registerClassAlias("mAscendantAlias", mAscendant);
registerClassAlias("mZombieAlias", mZombie);
registerClassAlias("mBoneHorrorAlias", mBoneHorror);
registerClassAlias("mGhostAlias", mGhost);
registerClassAlias("mSkeletonAlias", mSkeleton);
registerClassAlias("mLichAlias", mLich);
registerClassAlias("mVampireAlias", mVampire);
registerClassAlias("mSkeletonArcherAlias", mSkeletonArcher);
registerClassAlias("mTrollAlias", mTroll);
registerClassAlias("mOrcBerserkerAlias", mOrcBerserker);
registerClassAlias("mOrcChampionAlias", mOrcChampion);
registerClassAlias("mOrcSavageAlias", mOrcSavage);
registerClassAlias("mOrcShamanAlias", mOrcShaman);
registerClassAlias("mGoblinArtificerAlias", mGoblinArtificer);
registerClassAlias("mBasiliskAlias", mBasilisk);
registerClassAlias("mArachnoidAlias", mArachnoid);
registerClassAlias("mGreeblerAlias", mGreebler);
registerClassAlias("mGargoyleAlias", mGargoyle);
registerClassAlias("mPoisonDrakeAlias", mPoisonDrake);
registerClassAlias("mLightningDrakeAlias", mLightningDrake);
registerClassAlias("mCultWarriorAlias", mCultWarrior);
registerClassAlias("mCultArcherAlias", mCultArcher);
registerClassAlias("mCultChosenAlias", mCultChosen);
registerClassAlias("mCultPriestAlias", mCultPriest);
registerClassAlias("mCultNeophyteAlias", mCultNeophyte);
registerClassAlias("mVoidstalkerAlias", mVoidstalker);
registerClassAlias("mAetherguardAlias", mAetherguard);
registerClassAlias("mDwarfManiacAlias", mDwarfManiac);
registerClassAlias("mDwarfWarriorAlias", mDwarfWarrior);
registerClassAlias("mDwarfVeteranAlias", mDwarfVeteran);
registerClassAlias("mDwarfCrossbowAlias", mDwarfCrossbow);
registerClassAlias("mDwarfRunecasterAlias", mDwarfRunecaster);
registerClassAlias("mDwarfWarleaderAlias", mDwarfWarleader);
registerClassAlias("mDwarfPrinceAlias", mDwarfPrince);
registerClassAlias("mGorgonAlias", mGorgon);
registerClassAlias("mMinotaurAlias", mMinotaur);
registerClassAlias("mHydraBodyAlias", mHydraBody);
registerClassAlias("mHydraHeadAlias", mHydraHead);
registerClassAlias("mWhirlwindAlias", mWhirlwind);
registerClassAlias("iDaggerAlias", iDagger);
registerClassAlias("iSwordAlias", iSword);
registerClassAlias("iAxeAlias", iAxe);
registerClassAlias("iMaceAlias", iMace);
registerClassAlias("iSpearAlias", iSpear);
registerClassAlias("iBowAlias", iBow);
registerClassAlias("iCrossbowAlias", iCrossbow);
registerClassAlias("iStaffAlias", iStaff);
registerClassAlias("iPlateHelmetAlias", iPlateHelmet);
registerClassAlias("iPlateGlovesAlias", iPlateGloves);
registerClassAlias("iPlateGreavesAlias", iPlateGreaves);
registerClassAlias("iPlateBootsAlias", iPlateBoots);
registerClassAlias("iPlateBreastplateAlias", iPlateBreastplate);
registerClassAlias("iLeatherHatAlias", iLeatherHat);
registerClassAlias("iLeatherGlovesAlias", iLeatherGloves);
registerClassAlias("iLeatherLegsAlias", iLeatherLegs);
registerClassAlias("iLeatherBootsAlias", iLeatherBoots);
registerClassAlias("iLeatherChestAlias", iLeatherChest);
registerClassAlias("iCLothHat", iClothHat);
registerClassAlias("iClothGloves", iClothGloves);
registerClassAlias("iClothlegs", iClothLegs);
registerClassAlias("iClothShows", iClothShoes);
registerClassAlias("iClothRobe", iClothRobe);
registerClassAlias("iRingAlias", iRing);
registerClassAlias("iCloakAlias", iCloak);
registerClassAlias("iQuiverAlias", iQuiver);
registerClassAlias("iParryingDaggerAlias", iParryingDagger);
registerClassAlias("iShieldBucklerAlias", iShieldBuckler);
registerClassAlias("iShieldTowerAlias", iShieldTower);
registerClassAlias("iCenserAlias", iCenser);
registerClassAlias("OffhandAlias", Offhand);
registerClassAlias("pothealthsmall", PotionHealthSmall);
registerClassAlias("potpowersmall", PotionPowerSmall);
registerClassAlias("potrejuvesmall", PotionRejuveSmall);
registerClassAlias("potreviveweak", PotionReviveWeak);
registerClassAlias("pothealth", PotionHealth);
registerClassAlias("potpower", PotionPower);
registerClassAlias("potrejuve", PotionRejuve);
registerClassAlias("potrevive", PotionRevive);
registerClassAlias("potresist", PotionPoisonResist);
registerClassAlias("potshield", PotionShield);
registerClassAlias("potquickness", PotionQuickness);
registerClassAlias("potbody", PotionBody);
registerClassAlias("potwits", PotionWits);
registerClassAlias("sneakscroll", SneakyScroll);
registerClassAlias("tabula", CleanSlate);
registerClassAlias("townportal", PortalScroll);
registerClassAlias("enchant", Enchantment);
registerClassAlias("CampaignItemFragmentAlias", CampaignItemFragment);
registerClassAlias("CampaignItemStoneAlias", CampaignItemStone);
}
private static function clearObject(_arg1:String):void{
var _local2:SharedObject;
_local2 = SharedObject.getLocal(_arg1);
if (_local2.size > 0){
_local2.clear();
_local2.flush();
_local2.close();
};
}
}
}//package
Section 124
//DungeonMusic (DungeonMusic)
package {
import flash.media.*;
public class DungeonMusic extends Music {
var segment2:Sound;
var segment1:Sound;
var playingSegment:int;// = 0
public function DungeonMusic(_arg1:Boolean=true):void{
playingSegment = 0;
super();
if (dm.main.pc_party.campaign == Campaign.ORIGINAL){
segment1 = new return_of_the_knights_b();
} else {
if (dm.main.pc_party.campaign == Campaign.DELUXE){
segment1 = new fields_of_honor_loop01();
} else {
if ((dm.main.pc_party.level % 2) == 1){
segment1 = new return_of_the_knights_b();
} else {
segment1 = new fields_of_honor_loop01();
};
};
};
channel = segment1.play(0, 99999);
if (channel == null){
return;
};
active = true;
if (_arg1){
this.fadeIn();
} else {
this.setVolume(volumeSetting);
};
}
}
}//package
Section 125
//DungeonRoom (DungeonRoom)
package {
import flash.display.*;
public class DungeonRoom extends MovieClip {
public var shrine:MovieClip;
public var floor:MovieClip;
public var horde:Horde;
private var _floor_frame_number:int;// = 0
public var criticalPath:Boolean;// = false
private var _isExit:Boolean;// = false
var doors:Array;
private var _furniture_frame_number:int;// = 0
public var treasure:TreasureChest;
public var special:int;// = 0
private var _grid_x:int;// = 0
private var _grid_y:int;// = 0
var validate_id:int;// = -1
public var tint:MovieClip;
var isCorridor:Boolean;
public var adjacent:Array;
private var _seen:Boolean;// = false
private var _explored:Boolean;// = false
var isCorridorH:Boolean;
private var _isEntrance:Boolean;// = false
private var _index:int;// = 0
static const max_adjacent = 6;
public function DungeonRoom(){
adjacent = new Array();
doors = new Array(max_adjacent);
_grid_x = 0;
_grid_y = 0;
_furniture_frame_number = 0;
_floor_frame_number = 0;
_seen = false;
_explored = false;
special = 0;
_isExit = false;
_isEntrance = false;
_index = 0;
criticalPath = false;
validate_id = -1;
super();
isCorridor = false;
isCorridorH = false;
}
public function get isEntrance():Boolean{
return (this._isEntrance);
}
public function set isEntrance(_arg1:Boolean):void{
this._isEntrance = _arg1;
}
public function getGridHeight():int{
return (0);
}
public function setAlpha(_arg1:Number):void{
this.alpha = _arg1;
}
public function getEntrance():EntryStairs{
var _local1:*;
if (!(this.isEntrance)){
return (null);
};
_local1 = getChildByName("entrance");
return (_local1);
}
public function isAdjacentTo(_arg1:DungeonRoom):Boolean{
var _local2:*;
_local2 = 0;
while (_local2 < num_adjacent) {
if (adjacent[_local2] == _arg1){
return (true);
};
_local2++;
};
return (false);
}
public function get explored():Boolean{
return (this._explored);
}
protected function setAlphaChildren(_arg1:Number):void{
if (treasure != null){
treasure.alpha = _arg1;
};
if (horde != null){
horde.alpha = _arg1;
};
if (shrine != null){
shrine.alpha = _arg1;
};
if (isEntrance){
getChildByName("entrance").alpha = _arg1;
};
if (isExit){
getChildByName("exit").alpha = _arg1;
};
}
public function hasValidTreasure():Boolean{
if (((!((this.treasure == null))) && (!(this.treasure.looted)))){
return (true);
};
return (false);
}
public function addFurniture():void{
if (furniture_frame_number == 0){
furniture_frame_number = dmf.randomNum(1, this.totalFrames);
};
this.gotoAndStop(furniture_frame_number);
}
public function set explored(_arg1:Boolean):void{
this._explored = _arg1;
}
public function realHeight():int{
return ((getGridHeight() * Dungeon.GRID_SIZE));
}
private function resetDoors():void{
var _local1:DoorIcon;
for each (_local1 in doors) {
if (_local1 == null){
} else {
_local1.gotoAndStop(1);
};
};
}
public function addEntrance(_arg1:Boolean):void{
var _local2:*;
var _local3:EntryStairs;
var _local4:*;
var _local5:*;
var _local6:*;
_local2 = 0;
this.isEntrance = true;
this.furniture_frame_number = 1;
_local3 = new EntryStairs(_arg1);
_local3.name = "entrance";
_local4 = (this.x + (this.realWidth() / 2));
_local5 = (this.y + (this.realHeight() / 2));
_local6 = false;
if (isCorridor){
if (isCorridorH){
_local6 = false;
_local2 = 0;
while (_local2 < doors.length) {
if (doors[_local2].x >= _local4){
_local6 = true;
};
_local2++;
};
if (_local6){
_local3.rotation = 180;
};
} else {
_local3.rotation = 90;
_local6 = false;
_local2 = 0;
while (_local2 < doors.length) {
if (doors[_local2].y >= _local5){
_local6 = true;
};
_local2++;
};
if (_local6){
_local3.rotation = 270;
};
};
};
_local3.x = getCenterHorz();
_local3.y = getCenterVert();
this.setChild(_local3);
}
public function get seen():Boolean{
return (this._seen);
}
private function highlightDoor():void{
var _local1:DungeonRoom;
var _local2:*;
if (((!((parent == null))) && ((parent is Dungeon)))){
_local1 = Dungeon(parent).currentRoom;
} else {
return;
};
_local2 = 0;
while (_local2 < doors.length) {
if (doors[_local2] == null){
} else {
if ((((doors[_local2].room1 == _local1)) || ((doors[_local2].room2 == _local1)))){
doors[_local2].gotoAndStop(2);
};
};
_local2++;
};
}
public function cleanup():void{
}
public function hasPathTo(_arg1:DungeonRoom):Boolean{
var _local2:Array;
var _local3:Array;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
_local2 = new Array();
_local3 = new Array();
_local4 = false;
_local2.push(this);
while ((_local5 = _local2.pop())) {
_local3.push(_local5);
_local6 = 0;
while (_local6 < num_adjacent) {
if (_local5.adjacent[_local6] != _local5){
_local4 = false;
_local7 = 0;
while (_local7 < _local3.length) {
if (_local3[_local7] == _local5.adjacent[_local6]){
_local4 = true;
};
_local7++;
};
if (!(_local4)){
_local2.push(_local5.adjacent[_local6]);
};
};
_local6++;
};
if (_local5 == _arg1){
return (true);
};
};
return (false);
}
public function clearAdjacent():void{
adjacent.length = 0;
doors.length = 0;
}
public function hasSpecial():Boolean{
if (((!((this.horde == null))) && (!(horde.defeated)))){
return (true);
};
if (((!((this.shrine == null))) && (!(shrine.used)))){
return (true);
};
if (((!((this.treasure == null))) && (!(treasure.looted)))){
return (true);
};
if (this.special){
return (true);
};
if (this.isExit){
return (true);
};
if (this.isEntrance){
return (true);
};
return (false);
}
public function setHorde(_arg1:Horde):void{
this.horde = _arg1;
_arg1.room = this;
_arg1.x = getCenterHorz();
_arg1.y = getCenterVert();
_arg1.name = "horde";
if (_arg1.defeated == false){
this.setChild(_arg1);
};
}
public function set isExit(_arg1:Boolean):void{
this._isExit = _arg1;
}
public function setFloor():void{
var _local1:MovieClip;
_local1 = MovieClip(this.getChildByName("floor"));
if (_local1 == null){
return;
};
if (floor_frame_number == 0){
floor_frame_number = dmf.randomNum(1, _local1.totalFrames);
};
_local1.gotoAndStop(floor_frame_number);
}
public function get index():int{
return (this._index);
}
public function realWidth():int{
return ((getGridWidth() * Dungeon.GRID_SIZE));
}
public function toTop():void{
var _local1:*;
if (parent == null){
return;
};
_local1 = (parent.numChildren - 1);
if (parent.getChildByName("arrow") != null){
_local1--;
};
parent.setChildIndex(this, _local1);
}
public function setFloorTint(_arg1:int):void{
if (tint != null){
tint.gotoAndStop(_arg1);
};
}
public function set seen(_arg1:Boolean):void{
this._seen = _arg1;
}
public function set furniture_frame_number(_arg1:int):void{
this._furniture_frame_number = _arg1;
}
public function getCenterVert():int{
return (((this.getGridHeight() * Dungeon.GRID_SIZE) / 2));
}
public function roomData():DungeonRoomData{
var _local1:*;
_local1 = new DungeonRoomData();
this.copyValuesTo(_local1);
return (_local1);
}
public function validate(_arg1:int):int{
var _local2:*;
var _local3:*;
_local2 = 0;
if (this.validate_id != -1){
return (_local2);
};
this.validate_id = _arg1;
_local2++;
_local3 = 0;
while (_local3 < adjacent.length) {
_local2 = (_local2 + adjacent[_local3].validate(_arg1));
_local3++;
};
return (_local2);
}
public function travelTo(_arg1:Boolean=false):Boolean{
var _local2:DungeonRoom;
seen = true;
explored = true;
if ((((parent == null)) && (!((parent is Dungeon))))){
return (false);
};
for each (_local2 in adjacent) {
if (_local2 != null){
_local2.seen = true;
};
};
if (!(_arg1)){
if (treasure != null){
return (true);
};
if (isExit){
return (true);
};
if (isEntrance){
return (true);
};
if (shrine != null){
return (true);
};
if (this.special){
return (true);
};
};
if (horde != null){
return (true);
};
return (false);
}
public function setNotAdjacentTo(_arg1:DungeonRoom, _arg2:Boolean=true){
var _local3:*;
_local3 = 0;
while (_local3 < adjacent.length) {
if (adjacent[_local3] == _arg1){
adjacent.splice(_local3, 1);
_local3--;
if (_arg2){
_arg1.setNotAdjacentTo(this, false);
};
return;
};
_local3++;
};
}
public function setAdjacentTo(_arg1:DungeonRoom, _arg2:Boolean=true){
var _local3:*;
_local3 = 0;
while (_local3 < adjacent.length) {
if (adjacent[_local3] == _arg1){
return;
};
_local3++;
};
adjacent.push(_arg1);
if (_arg2){
_arg1.setAdjacentTo(this, false);
};
}
public function set floor_frame_number(_arg1:int):void{
this._floor_frame_number = _arg1;
}
public function addExit():void{
var _local1:*;
var _local2:ExitStairs;
var _local3:*;
var _local4:*;
var _local5:*;
_local1 = 0;
this.isExit = true;
this.furniture_frame_number = 1;
_local2 = new ExitStairs();
_local2.name = "exit";
_local3 = (this.x + (this.realWidth() / 2));
_local4 = (this.y + (this.realHeight() / 2));
_local5 = false;
if (isCorridor){
_local2.gotoAndStop(1);
if (isCorridorH){
_local5 = false;
_local1 = 0;
while (_local1 < doors.length) {
if (doors[_local1].x > _local3){
_local5 = true;
};
_local1++;
};
if (_local5){
_local2.rotation = 180;
};
} else {
_local2.rotation = 90;
_local5 = false;
_local1 = 0;
while (_local1 < doors.length) {
if (doors[_local1].y >= _local4){
_local5 = true;
};
_local1++;
};
if (_local5){
_local2.rotation = 270;
};
};
} else {
_local2.gotoAndStop(2);
};
_local2.x = getCenterHorz();
_local2.y = getCenterVert();
this.setChild(_local2);
}
public function getGridWidth():int{
return (0);
}
public function get isExit():Boolean{
return (this._isExit);
}
public function getCenterHorz():int{
return (((this.getGridWidth() * Dungeon.GRID_SIZE) / 2));
}
public function set grid_x(_arg1:int):void{
this._grid_x = _arg1;
}
public function set grid_y(_arg1:int):void{
this._grid_y = _arg1;
}
public function get furniture_frame_number():int{
return (this._furniture_frame_number);
}
public function set index(_arg1:int):void{
this._index = _arg1;
}
public function getAlpha():Number{
return (this.alpha);
}
public function hintFlash():void{
var _local1:*;
_local1 = new RoomFlash();
_local1.x = this.x;
_local1.y = this.y;
_local1.width = (this.getGridWidth() * Dungeon.GRID_SIZE);
_local1.height = (this.getGridHeight() * Dungeon.GRID_SIZE);
if (isCorridor){
_local1.x = (_local1.x + 1);
_local1.y = (_local1.y + 1);
_local1.width = (_local1.width - 2);
_local1.height = (_local1.height - 2);
} else {
_local1.x = (_local1.x + 2);
_local1.y = (_local1.y + 2);
_local1.width = (_local1.width - 4);
_local1.height = (_local1.height - 4);
};
_local1.alpha = 0.8;
parent.addChild(_local1);
}
public function get floor_frame_number():int{
return (this._floor_frame_number);
}
public function get grid_y():int{
return (this._grid_y);
}
public function get grid_x():int{
return (this._grid_x);
}
protected function copyValuesTo(_arg1:DungeonRoomData):void{
_arg1.roomType = DungeonRoomData.getRoomTypeOf(this);
_arg1.grid_x = this.grid_x;
_arg1.grid_y = this.grid_y;
_arg1.furniture_frame_number = this.furniture_frame_number;
_arg1.floor_frame_number = this.floor_frame_number;
_arg1.seen = this.seen;
_arg1.explored = this.explored;
_arg1.isEntrance = this.isEntrance;
_arg1.isExit = this.isExit;
_arg1.treasure = ((!((this.treasure == null))) && (!((this.treasure.looted == true))));
_arg1.special = this.special;
if ((((this.shrine == null)) || (this.shrine.used))){
_arg1.shrine = 0;
} else {
_arg1.shrine = this.shrine.type;
};
}
public function setChild(_arg1:DisplayObject):void{
this.addChild(_arg1);
}
public function get num_adjacent():int{
return (this.adjacent.length);
}
public function findDoorTo(_arg1:DungeonRoom):DoorIcon{
var _local2:*;
_local2 = 0;
while (_local2 < doors.length) {
if ((((doors[_local2].room1 == _arg1)) || ((doors[_local2].room2 == _arg1)))){
return (doors[_local2]);
};
_local2++;
};
return (null);
}
public function travelFrom():void{
}
public function addDoor(_arg1:DoorIcon):Boolean{
var _local2:*;
_local2 = 0;
while (_local2 < doors.length) {
if (doors[_local2] == _arg1){
return (false);
};
_local2++;
};
doors.push(_arg1);
return (true);
}
}
}//package
Section 126
//DungeonRoomData (DungeonRoomData)
package {
public class DungeonRoomData {
private var _isExit:Boolean;// = false
private var _roomType:int;// = 1
private var _explored:Boolean;// = false
private var _treasure:Boolean;// = false
private var _isEntrance:Boolean;// = false
private var _shrine:int;// = 0
private var _furniture_frame_number:int;// = 0
private var _floor_frame_number:int;// = 0
private var _seen:Boolean;// = false
private var _grid_x:int;// = 0
private var _grid_y:int;// = 0
private var _special:int;// = 0
static const chamber = 5;
static const demonRoom = 9;
static const tallRoom = 8;
static const cell = 4;
static const corridorV = 2;
static const wideRoom = 3;
static const gallery = 6;
static const largeRoom = 7;
static const corridorH = 1;
public function DungeonRoomData(){
_grid_x = 0;
_grid_y = 0;
_furniture_frame_number = 0;
_floor_frame_number = 0;
_seen = false;
_explored = false;
_isExit = false;
_isEntrance = false;
_roomType = 1;
_treasure = false;
_shrine = 0;
_special = 0;
super();
}
public function set grid_y(_arg1:int):void{
this._grid_y = _arg1;
}
public function get shrine():int{
return (this._shrine);
}
public function set shrine(_arg1:int):void{
this._shrine = _arg1;
}
public function get furniture_frame_number():int{
return (this._furniture_frame_number);
}
public function set furniture_frame_number(_arg1:int):void{
this._furniture_frame_number = _arg1;
}
public function get isEntrance():Boolean{
return (this._isEntrance);
}
public function set isEntrance(_arg1:Boolean):void{
this._isEntrance = _arg1;
}
public function get floor_frame_number():int{
return (this._floor_frame_number);
}
public function get treasure():Boolean{
return (this._treasure);
}
public function get explored():Boolean{
return (this._explored);
}
public function get roomType():int{
return (this._roomType);
}
public function get special():int{
return (this._special);
}
public function get grid_x():int{
return (this._grid_x);
}
public function get grid_y():int{
return (this._grid_y);
}
public function set isExit(_arg1:Boolean):void{
this._isExit = _arg1;
}
public function set floor_frame_number(_arg1:int):void{
this._floor_frame_number = _arg1;
}
public function set explored(_arg1:Boolean):void{
this._explored = _arg1;
}
public function set treasure(_arg1:Boolean):void{
this._treasure = _arg1;
}
public function get isExit():Boolean{
return (this._isExit);
}
public function set roomType(_arg1:int):void{
this._roomType = _arg1;
}
public function set special(_arg1:int):void{
this._special = _arg1;
}
public function set seen(_arg1:Boolean):void{
this._seen = _arg1;
}
public function get seen():Boolean{
return (this._seen);
}
public function toRoom(_arg1:Boolean):DungeonRoom{
var _local2:DungeonRoom;
if (roomType == corridorH){
_local2 = new rCorridorH();
} else {
if (roomType == corridorV){
_local2 = new rCorridorV();
} else {
if (roomType == wideRoom){
_local2 = new rWideRoom();
} else {
if (roomType == cell){
_local2 = new rCell();
} else {
if (roomType == chamber){
_local2 = new rChamber();
} else {
if (roomType == gallery){
_local2 = new rGallery();
} else {
if (roomType == largeRoom){
_local2 = new rLargeRoom();
} else {
if (roomType == tallRoom){
_local2 = new rTallRoom();
} else {
if (roomType == demonRoom){
_local2 = new rDemonRoom();
} else {
_local2 = new rCorridorH();
};
};
};
};
};
};
};
};
};
_local2.grid_x = this.grid_x;
_local2.grid_y = this.grid_y;
_local2.furniture_frame_number = this.furniture_frame_number;
_local2.floor_frame_number = this.floor_frame_number;
_local2.seen = this.seen;
_local2.explored = this.explored;
_local2.special = this.special;
return (_local2);
}
public function set grid_x(_arg1:int):void{
this._grid_x = _arg1;
}
public static function getRoomTypeOf(_arg1:DungeonRoom):int{
if ((_arg1 is rCorridorH)){
return (corridorH);
};
if ((_arg1 is rCorridorV)){
return (corridorV);
};
if ((_arg1 is rWideRoom)){
return (wideRoom);
};
if ((_arg1 is rCell)){
return (cell);
};
if ((_arg1 is rChamber)){
return (chamber);
};
if ((_arg1 is rGallery)){
return (gallery);
};
if ((_arg1 is rLargeRoom)){
return (largeRoom);
};
if ((_arg1 is rTallRoom)){
return (tallRoom);
};
if ((_arg1 is rDemonRoom)){
return (demonRoom);
};
return (0);
}
}
}//package
Section 127
//EmptyCustomPortrait (EmptyCustomPortrait)
package {
import flash.display.*;
public dynamic class EmptyCustomPortrait extends Sprite {
}
}//package
Section 128
//EmptyPortrait (EmptyPortrait)
package {
import flash.display.*;
public class EmptyPortrait extends MovieClip {
public var pos:int;// = -1
public var empty:MovieClip;
public function EmptyPortrait(){
pos = -1;
super();
addFrameScript(0, frame1, 12, frame13);
this.gotoAndStop(1);
}
function frame1(){
this.stop();
}
function frame13(){
this.gotoAndStop(1);
}
}
}//package
Section 129
//EnchantAnimation (EnchantAnimation)
package {
import flash.display.*;
public dynamic class EnchantAnimation extends MovieClip {
public function EnchantAnimation(){
addFrameScript(10, frame11);
}
function frame11(){
stop();
if (this.parent != null){
this.parent.removeChild(this);
};
}
}
}//package
Section 130
//Enchantment (Enchantment)
package {
public class Enchantment extends Item {
private var _enchantType:int;// = 0
static const STRENGTH = 1;
static const REGEN_POWER = 53;
static const REPLENISH = 51;
static const POISON = 5;
static const PROTECTION = 7;
static const INTELLECT = 4;
static const DEXTERITY = 3;
static const ENDURANCE = 2;
static const ENHANCEMENT = 50;
static const RESISTANCE = 52;
static const REGEN_HEALTH = 6;
public function Enchantment(_arg1:int=1, _arg2:int=0, _arg3:Boolean=false):void{
_enchantType = 0;
super();
this.item_level = _arg1;
if (_arg2){
enchantType = _arg2;
} else {
if (_arg3){
enchantType = dmf.randomNum(ENHANCEMENT, REGEN_POWER);
} else {
enchantType = dmf.randomNum(STRENGTH, PROTECTION);
};
};
icon_frame = iconForEnchantment(enchantType);
item_name = ("Orb of " + nameForEnchantment(enchantType));
if (enchantType >= ENHANCEMENT){
item_rarity = Item.purple;
} else {
item_rarity = Item.blue;
};
}
public function useOn(_arg1:Equipment, _arg2:PlayerCharacter, _arg3:Party):Boolean{
var _local4:Boolean;
var _local5:*;
var _local6:*;
_local4 = false;
if ((_arg1 is Weapon)){
if (enchantType == PROTECTION){
return (false);
};
} else {
if (enchantType == POISON){
return (false);
};
};
if (_arg1.enchantmentType){
return (false);
};
_local4 = true;
_arg1.enchantmentType = this.enchantType;
_arg1.enchantmentValue = this.getValue();
switch (enchantType){
case STRENGTH:
_arg1.mod_strength = (_arg1.mod_strength + _arg1.enchantmentValue);
break;
case ENDURANCE:
_arg1.mod_endurance = (_arg1.mod_endurance + _arg1.enchantmentValue);
break;
case DEXTERITY:
_arg1.mod_dexterity = (_arg1.mod_dexterity + _arg1.enchantmentValue);
break;
case INTELLECT:
_arg1.mod_intellect = (_arg1.mod_intellect + _arg1.enchantmentValue);
break;
case POISON:
_arg1.poisonDamage = (_arg1.poisonDamage + _arg1.enchantmentValue);
break;
case REGEN_HEALTH:
_arg1.healthRegen = (_arg1.healthRegen + _arg1.enchantmentValue);
break;
case PROTECTION:
_arg1.armor_rating = (_arg1.armor_rating + _arg1.enchantmentValue);
break;
case ENHANCEMENT:
_arg1.multiplyStats(1.1);
if ((_arg1 is Weapon)){
Weapon(_arg1).damage = Math.ceil((Weapon(_arg1).damage * 1.1));
};
break;
case REPLENISH:
_arg1.replenishing = (_arg1.replenishing + _arg1.enchantmentValue);
break;
case REGEN_POWER:
_arg1.powerRegen = (_arg1.powerRegen + _arg1.enchantmentValue);
break;
case RESISTANCE:
_arg1.resistPoison = (_arg1.resistPoison + _arg1.enchantmentValue);
_arg1.resistStun = (_arg1.resistStun + _arg1.enchantmentValue);
break;
};
return (_local4);
}
override public function getItemTypeString(){
return ("Enchantment");
}
override public function getWorth():int{
var _local1:Number;
_local1 = 200;
_local1 = (_local1 * (1 + ((ITEM_VALUE_INCREASE_PER_LEVEL * item_level) / 100)));
if (enchantType >= ENHANCEMENT){
_local1 = (_local1 * 2.5);
if (enchantType == ENHANCEMENT){
_local1 = (_local1 * 2);
};
};
return (Math.round(_local1));
}
public function set enchantType(_arg1:int):void{
this._enchantType = _arg1;
}
public function get enchantType():int{
return (_enchantType);
}
public function getValue():int{
var _local1:int;
_local1 = 0;
switch (enchantType){
case STRENGTH:
case ENDURANCE:
case DEXTERITY:
case INTELLECT:
_local1 = (1 + Math.floor((item_level / DungeonMain.MAX_LEVEL)));
break;
case POISON:
_local1 = Equipment.scalePoisonDamage(5, item_level);
break;
case REGEN_HEALTH:
_local1 = Equipment.scaleHealthRegen(2, item_level);
break;
case PROTECTION:
_local1 = Equipment.armorScale(30, item_level);
break;
case ENHANCEMENT:
_local1 = 10;
break;
case REPLENISH:
_local1 = 20;
break;
case REGEN_POWER:
_local1 = 2;
break;
case RESISTANCE:
_local1 = 30;
break;
};
return (_local1);
}
override public function itemStatsString(_arg1:String):String{
var _local2:int;
_arg1 = "";
_local2 = getValue();
_arg1 = (_arg1 + "Use: Drag onto an equipped item to enchant it.\n\n");
switch (enchantType){
case STRENGTH:
_arg1 = (_arg1 + ("Strength: +" + _local2));
break;
case ENDURANCE:
_arg1 = (_arg1 + ("Endurance: +" + _local2));
break;
case DEXTERITY:
_arg1 = (_arg1 + ("Dexterity: +" + _local2));
break;
case INTELLECT:
_arg1 = (_arg1 + ("Intellect: +" + _local2));
break;
case POISON:
_arg1 = (_arg1 + (("Poison: +" + _local2) + " (Weapons only)"));
break;
case REGEN_HEALTH:
_arg1 = (_arg1 + ("Regenerate: +" + _local2));
break;
case PROTECTION:
_arg1 = (_arg1 + (("Protection: +" + _local2) + " (Armor only)"));
break;
case ENHANCEMENT:
_arg1 = (_arg1 + (("Enhancement: +" + _local2) + "%"));
break;
case REPLENISH:
_arg1 = (_arg1 + (("Replenishment: +" + _local2) + "%"));
break;
case REGEN_POWER:
_arg1 = (_arg1 + ("Power Regeneration: +" + _local2));
break;
case RESISTANCE:
_arg1 = (_arg1 + (("Resistance: +" + _local2) + "%"));
break;
default:
_arg1 = (_arg1 + "Blank Enchantment");
};
_arg1 = (_arg1 + "\n");
return (_arg1);
}
public static function iconForEnchantment(_arg1:int):int{
var _local2:int;
_local2 = iconIdForEnchantment(_arg1);
if (_local2){
return ((117 + _local2));
};
return (1);
}
public static function iconIdForEnchantment(_arg1:int):int{
switch (_arg1){
case STRENGTH:
return (8);
case ENDURANCE:
return (6);
case DEXTERITY:
return (5);
case INTELLECT:
return (7);
case POISON:
return (4);
case REGEN_HEALTH:
return (1);
case PROTECTION:
return (3);
case ENHANCEMENT:
return (11);
case REPLENISH:
return (9);
case REGEN_POWER:
return (2);
case RESISTANCE:
return (10);
default:
return (0);
};
}
public static function nameForEnchantment(_arg1:int):String{
switch (_arg1){
case STRENGTH:
return ("Brawn");
case ENDURANCE:
return ("Perseverance");
case DEXTERITY:
return ("Alacrity");
case INTELLECT:
return ("Acumen");
case POISON:
return ("Toxicity");
case REGEN_HEALTH:
return ("Recuperation");
case PROTECTION:
return ("Protection");
case ENHANCEMENT:
return ("Enhancement");
case REPLENISH:
return ("Replenishment");
case REGEN_POWER:
return ("Power");
case RESISTANCE:
return ("Resistance");
default:
return ("Emptiness");
};
}
}
}//package
Section 131
//Encounter (Encounter)
package {
public class Encounter {
public static const RESCUE:int = 1;
public static const LURKER:int = 2;
}
}//package
Section 132
//EntryStairs (EntryStairs)
package {
import flash.display.*;
public class EntryStairs extends Sprite {
public var glow:StairsGlow;
var enableRest:Boolean;// = false
public function EntryStairs(_arg1:Boolean=false){
enableRest = false;
super();
this.enableRest = _arg1;
if (!(_arg1)){
removeGlow();
};
}
public function removeGlow():void{
if (this.contains(glow)){
removeChild(glow);
};
}
}
}//package
Section 133
//equip_bow_sound (equip_bow_sound)
package {
import flash.media.*;
public dynamic class equip_bow_sound extends Sound {
}
}//package
Section 134
//equip_shield_sound (equip_shield_sound)
package {
import flash.media.*;
public dynamic class equip_shield_sound extends Sound {
}
}//package
Section 135
//equip_sound (equip_sound)
package {
import flash.media.*;
public dynamic class equip_sound extends Sound {
}
}//package
Section 136
//equip_staff_sound (equip_staff_sound)
package {
import flash.media.*;
public dynamic class equip_staff_sound extends Sound {
}
}//package
Section 137
//equip_sword_sound (equip_sword_sound)
package {
import flash.media.*;
public dynamic class equip_sword_sound extends Sound {
}
}//package
Section 138
//Equipment (Equipment)
package {
public class Equipment extends Item {
const base_accuracy_bonus = 10;
const purple_armor_multiplier = 1.5;
const base_item_stat_bonus = 1;
private var _damageBonusVsCreatureType:int;// = 0
var white_chance;// = 15
var base_armor_mod:int;// = 0
private var _whoEquips:uint;// = 0
protected var materials:Array;
private var _blind:int;// = 0
private var _suffix:int;// = -1
private var _poisonDamage:int;// = 0
private var _armor_rating:int;// = 0
private var _mod_intellect:int;// = 0
private var _material:int;// = -1
var grey_chance;// = 5
private var _accuracyBonus:int;// = 0
var blue_chance;// = 24
private var _mod_strength:int;// = 0
protected var prefixes:Array;
private var _mod_dexterity:int;// = 0
private var _mod_quickness:int;// = 0
private var _enchantmentType:int;// = 0
private var _enchantmentValue:int;// = 0
private var _replenishing:int;// = 0
private var _slot:int;// = 0
private var _quickRetreat:Boolean;// = false
private var _vampiric_percent:int;// = 0
private var _mod_healing:int;// = 0
private var _mod_endurance:int;// = 0
private var _armorBonusVsCreatureType:int;// = 0
var purple_chance;// = 1
private var _armorBonusVsCreatureModifier:Number;// = 1
private var _damageBonusVsCreatureModifier:Number;// = 1
var base_armor_rating:int;// = 0
private var _damageReflection:int;// = 0
private var _resistStun:int;// = 0
private var _resistPoison:int;// = 0
private var _healthRegen:int;// = 0
private var _lethality:int;// = 0
private var _prefix:int;// = -1
protected var suffixes:Array;
private var _powerRegen:int;// = 0
protected var grey_name:String;// = "Damaged"
var green_chance;// = 55
private var _causes_stun_percent:int;// = 0
static const boots = 4;
static const weapon = 0;
static const legs = 5;
static const gearSlots = 9;
static const back = 3;
static const max_stat_for_purple = 4;
static const offhand = 1;
static const head = 8;
static const ring = 2;
static const ARMOR_SCALE_CONSTANT:Number = 0.2;
static const gloves = 7;
static const armor = 6;
static var clericEquip:uint = 2;
static var allEquip:uint = 4095;
static var warriorEquip:uint = 8;
static var barbarianEquip:uint = 32;
static var rangerEquip:uint = 1;
static var conjurorEquip:uint = 64;
static var mageEquip:uint = 16;
static var rogueEquip:uint = 4;
public function Equipment(){
_slot = 0;
grey_name = "Damaged";
grey_chance = 5;
white_chance = 15;
green_chance = 55;
blue_chance = 24;
purple_chance = 1;
_material = -1;
_prefix = -1;
_suffix = -1;
materials = new Array();
_whoEquips = 0;
_enchantmentType = 0;
_enchantmentValue = 0;
_vampiric_percent = 0;
_causes_stun_percent = 0;
_poisonDamage = 0;
_powerRegen = 0;
_healthRegen = 0;
_quickRetreat = false;
_accuracyBonus = 0;
_resistPoison = 0;
_resistStun = 0;
_damageReflection = 0;
_blind = 0;
_lethality = 0;
_damageBonusVsCreatureType = 0;
_damageBonusVsCreatureModifier = 1;
_armorBonusVsCreatureType = 0;
_armorBonusVsCreatureModifier = 1;
_armor_rating = 0;
base_armor_rating = 0;
base_armor_mod = 0;
_replenishing = 0;
_mod_strength = 0;
_mod_endurance = 0;
_mod_dexterity = 0;
_mod_intellect = 0;
_mod_quickness = 0;
_mod_healing = 0;
super();
item_name = "Equipment";
slot = Equipment.gearSlots;
item_level = 1;
icon_frame = 1;
}
public function set slot(_arg1:int):void{
this._slot = _arg1;
}
public function setBlind(_arg1:int=10, _arg2:int=20):void{
this.blind = (this.blind + adjustStat(_arg1, _arg2));
}
public function setPoisonDamage(_arg1:int=5):void{
this.poisonDamage = (this.poisonDamage + scalePoisonDamage(_arg1, item_level));
}
public function set mod_endurance(_arg1:int):void{
this._mod_endurance = _arg1;
}
public function set enchantmentType(_arg1:int):void{
this._enchantmentType = _arg1;
}
public function generateItem(_arg1:int):void{
}
public function set quickRetreat(_arg1:Boolean):void{
this._quickRetreat = _arg1;
}
public function get powerRegen():int{
return (this._powerRegen);
}
public function setPowerRegen(_arg1:int=1, _arg2:int=4):void{
this.powerRegen = (this.powerRegen + adjustStat(_arg1, _arg2));
}
public function set lethality(_arg1:int):void{
this._lethality = _arg1;
}
public function set damageBonusVsCreatureModifier(_arg1:Number):void{
this._damageBonusVsCreatureModifier = _arg1;
}
public function rollForMaterial(_arg1:int, _arg2:Array):int{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
if (_arg1 == Item.grey){
return (-1);
};
if (_arg1 >= Item.purple){
return (-1);
};
_local3 = Math.ceil((100 / _arg2.length));
_local4 = dmf.randomNum(0, 100);
_local5 = 0;
while (_local5 < _arg2.length) {
_local6 = ((_local5 + 1) * _local3);
if (_local4 <= _local6){
return (_local5);
};
_local5++;
};
return (1);
}
override public function getItemTypeString(){
return ("Equipment");
}
public function set material(_arg1:int):void{
this._material = _arg1;
}
public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
if (suffixes[_local1][0] == "Reflection"){
setDamageReflection();
return;
};
if (suffixes[_local1][0] == "Tenacity"){
setResistStun();
return;
};
if (suffixes[_local1][0] == "Accuracy"){
setAccuracy();
return;
};
if (suffixes[_local1][0] == "Might"){
setStrength();
return;
};
if (suffixes[_local1][0] == "Resilience"){
setEndurance();
return;
};
if (suffixes[_local1][0] == "Insight"){
setIntellect();
return;
};
if (suffixes[_local1][0] == "Deftness"){
setDexterity();
return;
};
if (suffixes[_local1][0] == "Speed"){
setQuickness();
return;
};
if (suffixes[_local1][0] == "Lethality"){
setLethality();
return;
};
if (suffixes[_local1][0] == "Discretion"){
quickRetreat = true;
return;
};
}
public function set powerRegen(_arg1:int):void{
this._powerRegen = _arg1;
}
public function get enchantmentValue():int{
return (this._enchantmentValue);
}
override public function itemStatsString(_arg1:String):String{
if (replenishing){
_arg1 = (_arg1 + (("Replenishes " + replenishing) + "% health and power at the end of every battle\n"));
};
if (damageBonusVsCreatureType == MonsterCharacter.undead){
_arg1 = (_arg1 + (Math.floor((damageBonusVsCreatureModifier * 100)) + "% damage to undead\n"));
};
if (damageBonusVsCreatureType == MonsterCharacter.greenskin){
_arg1 = (_arg1 + (Math.floor((damageBonusVsCreatureModifier * 100)) + "% damage to greenskins\n"));
};
if (damageBonusVsCreatureType == MonsterCharacter.creature){
_arg1 = (_arg1 + (Math.floor((damageBonusVsCreatureModifier * 100)) + "% damage to deep creatures\n"));
};
if (damageBonusVsCreatureType == MonsterCharacter.human){
_arg1 = (_arg1 + (Math.floor((damageBonusVsCreatureModifier * 100)) + "% damage to humans\n"));
};
if (damageBonusVsCreatureType == MonsterCharacter.dwarf){
_arg1 = (_arg1 + (Math.floor((damageBonusVsCreatureModifier * 100)) + "% damage to dwarves\n"));
};
if (armorBonusVsCreatureType == MonsterCharacter.undead){
_arg1 = (_arg1 + (("+" + Math.floor(((armorBonusVsCreatureModifier * 100) - 100))) + "% normal damage resistance versus undead\n"));
};
if (armorBonusVsCreatureType == MonsterCharacter.greenskin){
_arg1 = (_arg1 + (("+" + Math.floor(((armorBonusVsCreatureModifier * 100) - 100))) + "% normal damage resistance versus greenskins\n"));
};
if (armorBonusVsCreatureType == MonsterCharacter.creature){
_arg1 = (_arg1 + (("+" + Math.floor(((armorBonusVsCreatureModifier * 100) - 100))) + "% normal damage resistance versus deep creatures\n"));
};
if (armorBonusVsCreatureType == MonsterCharacter.human){
_arg1 = (_arg1 + (("+" + Math.floor(((armorBonusVsCreatureModifier * 100) - 100))) + "% normal damage resistance versus humans\n"));
};
if (armorBonusVsCreatureType == MonsterCharacter.dwarf){
_arg1 = (_arg1 + (("+" + Math.floor(((armorBonusVsCreatureModifier * 100) - 100))) + "% normal damage resistance versus dwarves\n"));
};
if (mod_strength > 0){
_arg1 = (_arg1 + (("+" + mod_strength) + " Strength\n"));
};
if (mod_endurance > 0){
_arg1 = (_arg1 + (("+" + mod_endurance) + " Endurance\n"));
};
if (mod_dexterity > 0){
_arg1 = (_arg1 + (("+" + mod_dexterity) + " Dexterity\n"));
};
if (mod_intellect > 0){
_arg1 = (_arg1 + (("+" + mod_intellect) + " Intellect\n"));
};
if (causes_stun_percent > 0){
_arg1 = (_arg1 + (String(causes_stun_percent) + "% chance to stun target\n"));
};
if (blind > 0){
_arg1 = (_arg1 + (("Reduces target's accuracy by " + blind) + "%\n"));
};
if (lethality > 0){
_arg1 = (_arg1 + (lethality + "% chance to kill target\n"));
};
if (powerRegen > 0){
_arg1 = (_arg1 + (("+" + powerRegen) + " power regeneration\n"));
};
if (healthRegen > 0){
_arg1 = (_arg1 + (("+" + healthRegen) + " health regeneration\n"));
};
if (damageReflection > 0){
_arg1 = (_arg1 + (damageReflection + "% damage reflection\n"));
};
if (resistPoison != 0){
_arg1 = (_arg1 + (resistPoison + "% reduced damage from poison\n"));
};
if (resistStun != 0){
_arg1 = (_arg1 + (resistStun + "% chance to resist stun\n"));
};
if (vampiric_percent > 0){
_arg1 = (_arg1 + (("Drain health (" + vampiric_percent) + "% of damage)\n"));
};
if (poisonDamage > 0){
_arg1 = (_arg1 + (("Apply " + poisonDamage) + " poison damage on hit\n"));
};
if (accuracyBonus){
_arg1 = (_arg1 + (("+" + accuracyBonus) + " chance to hit\n"));
};
if (mod_quickness > 0){
_arg1 = (_arg1 + (("+" + mod_quickness) + " Quickness\n"));
} else {
if (mod_quickness < 0){
_arg1 = (_arg1 + (mod_quickness + " Quickness\n"));
};
};
if (quickRetreat){
_arg1 = (_arg1 + "Wearer may retreat instantly\n");
};
return (_arg1);
}
public function set healthRegen(_arg1:int):void{
this._healthRegen = _arg1;
}
public function adjustStat(_arg1:int, _arg2:int, _arg3:Boolean=false):int{
var _local4:Number;
var _local5:*;
_local4 = 0;
if (_arg3){
_local4 = ((item_level - 1) / DungeonMain.MAX_LEVEL);
} else {
_local4 = Math.min(1, ((item_level - 1) / DungeonMain.MAX_LEVEL));
};
_local5 = Math.round((_arg1 + (_local4 * Math.abs((_arg2 - _arg1)))));
return (_local5);
}
public function SetRarity(_arg1:int){
var _local2:int;
if (_arg1 >= 0){
this.item_rarity = _arg1;
return;
};
_local2 = dmf.randomNum(1, 100);
if (_local2 <= grey_chance){
item_rarity = Item.grey;
} else {
if (_local2 <= (white_chance + grey_chance)){
item_rarity = Item.white;
} else {
if (_local2 <= ((green_chance + grey_chance) + white_chance)){
item_rarity = Item.green;
} else {
if (_local2 <= (((blue_chance + green_chance) + grey_chance) + white_chance)){
item_rarity = Item.blue;
} else {
item_rarity = Item.purple;
};
};
};
};
}
public function setStunChance(_arg1:int=5, _arg2:int=10):void{
this.causes_stun_percent = (this.causes_stun_percent + adjustStat(_arg1, _arg2));
}
public function get prefix():int{
return (this._prefix);
}
public function get vampiric_percent():int{
return (this._vampiric_percent);
}
public function get mod_intellect():int{
return (this._mod_intellect);
}
public function get armor_rating():int{
return (this._armor_rating);
}
public function get poisonDamage():int{
return (this._poisonDamage);
}
public function set suffix(_arg1:int):void{
this._suffix = _arg1;
}
public function get accuracyBonus():int{
return (this._accuracyBonus);
}
public function set blind(_arg1:int):void{
this._blind = _arg1;
}
public function set armorBonusVsCreatureModifier(_arg1:Number):void{
this._armorBonusVsCreatureModifier = _arg1;
}
public function get causes_stun_percent():int{
return (this._causes_stun_percent);
}
public function rollForPrefix(_arg1:int):int{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
if ((((_arg1 == Item.grey)) || ((_arg1 == Item.white)))){
return (-1);
};
_local2 = Math.ceil((100 / prefixes.length));
_local3 = dmf.randomNum(0, 100);
_local4 = 0;
while (_local4 < prefixes.length) {
_local5 = ((_local4 + 1) * _local2);
if (_local3 <= _local5){
return (_local4);
};
_local4++;
};
return (-1);
}
public function setStrength(_arg1:int=1, _arg2:int=3):void{
this.mod_strength = (this.mod_strength + adjustStat(_arg1, _arg2, true));
}
public function get mod_healing():int{
return (this._mod_healing);
}
public function get mod_dexterity():int{
return (this._mod_dexterity);
}
public function get mod_quickness():int{
return (this._mod_quickness);
}
public function setLethality(_arg1:int=5, _arg2:int=10):void{
this.lethality = (this.lethality + adjustStat(_arg1, _arg2));
}
override public function getWorth():int{
var _local1 = ??pushnamespace
;
var _local2:Number;
var _local3:Number;
_local1 = 100;
_local2 = _local1;
_local3 = (1 + ((item_level * ITEM_VALUE_INCREASE_PER_LEVEL) / 100));
_local2 = (_local2 * _local3);
switch (item_rarity){
case Item.grey:
_local2 = (_local2 * 0.75);
break;
case Item.white:
default:
break;
case Item.green:
_local2 = (_local2 * 1.75);
break;
case Item.blue:
_local2 = (_local2 * 2.5);
break;
case Item.purple:
_local2 = (_local2 * 9);
break;
case Item.orange:
_local2 = (_local2 * 12);
break;
};
if (material > 0){
_local2 = (_local2 * (1 + (material * 0.05)));
};
_local2 = (_local2 * getModForSlot(slot));
if (powerRegen){
_local2 = (_local2 * 1.15);
};
if (lethality){
_local2 = (_local2 * 1.1);
};
if (enchantmentType){
if (enchantmentType >= Enchantment.ENHANCEMENT){
_local2 = (_local2 * 1.1);
} else {
_local2 = (_local2 * 1.05);
};
};
return (Math.round(_local2));
}
public function get mod_strength():int{
return (this._mod_strength);
}
public function multiplyStats(_arg1:Number):void{
mod_strength = Math.ceil((mod_strength * _arg1));
mod_endurance = Math.ceil((mod_endurance * _arg1));
mod_dexterity = Math.ceil((mod_dexterity * _arg1));
mod_intellect = Math.ceil((mod_intellect * _arg1));
mod_quickness = (mod_quickness + Math.ceil(Math.abs((mod_quickness * (_arg1 - 1)))));
mod_healing = Math.ceil((mod_healing * _arg1));
vampiric_percent = Math.ceil((vampiric_percent * _arg1));
causes_stun_percent = Math.ceil((causes_stun_percent * _arg1));
poisonDamage = Math.ceil((poisonDamage * _arg1));
blind = Math.ceil((blind * _arg1));
lethality = Math.ceil((lethality * _arg1));
powerRegen = Math.ceil((powerRegen * _arg1));
healthRegen = Math.ceil((healthRegen * _arg1));
replenishing = Math.ceil((replenishing * _arg1));
accuracyBonus = Math.ceil((accuracyBonus * _arg1));
resistPoison = (resistPoison + Math.ceil(Math.abs((resistPoison * (_arg1 - 1)))));
resistStun = Math.ceil((resistStun * _arg1));
damageReflection = Math.ceil((damageReflection * _arg1));
damageBonusVsCreatureModifier = (damageBonusVsCreatureModifier * _arg1);
armorBonusVsCreatureModifier = (armorBonusVsCreatureModifier * _arg1);
armor_rating = Math.ceil((armor_rating * _arg1));
}
public function getItemModifiers():void{
prefixes = new Array();
prefixes.push(["Runed", 2]);
suffixes = new Array();
suffixes.push(["Resilience", base_item_stat_bonus]);
suffixes.push(["Insight", base_item_stat_bonus]);
suffixes.push(["Speed", 5]);
}
public function set enchantmentValue(_arg1:int):void{
this._enchantmentValue = _arg1;
}
public function get damageReflection():int{
return (this._damageReflection);
}
public function getModForSlot(_arg1:int):Number{
var _local2:*;
_local2 = 1;
if (_arg1 == Equipment.boots){
_local2 = 1;
} else {
if (_arg1 == Equipment.gloves){
_local2 = 1;
} else {
if (_arg1 == Equipment.legs){
_local2 = 1.2;
} else {
if (_arg1 == Equipment.armor){
_local2 = 1.5;
} else {
if (_arg1 == Equipment.head){
_local2 = 1.2;
} else {
if (_arg1 == Equipment.weapon){
_local2 = 1.5;
} else {
if (_arg1 == Equipment.offhand){
_local2 = 1.2;
} else {
if (_arg1 == Equipment.ring){
_local2 = 1.3;
} else {
if (_arg1 == Equipment.back){
_local2 = 1.1;
};
};
};
};
};
};
};
};
};
return (_local2);
}
public function get replenishing():int{
return (this._replenishing);
}
public function get mod_endurance():int{
return (this._mod_endurance);
}
public function set mod_intellect(_arg1:int):void{
this._mod_intellect = _arg1;
}
public function get enchantmentType():int{
return (this._enchantmentType);
}
public function set damageBonusVsCreatureType(_arg1:int):void{
this._damageBonusVsCreatureType = _arg1;
}
public function setResistPoison(_arg1:int=20, _arg2:int=30):void{
this.resistPoison = (this.resistPoison + adjustStat(_arg1, _arg2));
}
public function get lethality():int{
return (this._lethality);
}
public function get quickRetreat():Boolean{
return (this._quickRetreat);
}
public function setVampiric(_arg1:int=5, _arg2:int=7):void{
this.vampiric_percent = (this.vampiric_percent + adjustStat(_arg1, _arg2));
}
public function get damageBonusVsCreatureModifier():Number{
return (this._damageBonusVsCreatureModifier);
}
public function set prefix(_arg1:int):void{
this._prefix = _arg1;
}
public function get material():int{
return (this._material);
}
public function usableString():String{
var _local1:String;
if (whoEquips == allEquip){
return ("Usable: All");
};
_local1 = "";
if ((warriorEquip & whoEquips) == warriorEquip){
_local1 = (_local1 + "Warrior, ");
};
if ((rogueEquip & whoEquips) == rogueEquip){
_local1 = (_local1 + "Rogue, ");
};
if ((clericEquip & whoEquips) == clericEquip){
_local1 = (_local1 + "Cleric, ");
};
if ((rangerEquip & whoEquips) == rangerEquip){
_local1 = (_local1 + "Ranger, ");
};
if ((mageEquip & whoEquips) == mageEquip){
_local1 = (_local1 + "Mage, ");
};
if ((barbarianEquip & whoEquips) == barbarianEquip){
_local1 = (_local1 + "Barbarian, ");
};
if ((conjurorEquip & whoEquips) == conjurorEquip){
_local1 = (_local1 + "Conjuror, ");
};
if (_local1 == ""){
return ("Usable: None");
};
_local1 = _local1.substr(0, (_local1.length - 2));
return (("Usable: " + _local1));
}
public function set resistPoison(_arg1:int):void{
this._resistPoison = _arg1;
}
public function set vampiric_percent(_arg1:int):void{
this._vampiric_percent = _arg1;
}
public function set poisonDamage(_arg1:int):void{
this._poisonDamage = _arg1;
}
public function set armor_rating(_arg1:int):void{
this._armor_rating = _arg1;
}
public function setIntellect(_arg1:int=1, _arg2:int=3):void{
this.mod_intellect = (this.mod_intellect + adjustStat(_arg1, _arg2, true));
}
public function get healthRegen():int{
return (this._healthRegen);
}
public function set whoEquips(_arg1:uint):void{
this._whoEquips = _arg1;
}
public function set accuracyBonus(_arg1:int):void{
this._accuracyBonus = _arg1;
}
public function get suffix():int{
return (this._suffix);
}
public function get armorBonusVsCreatureModifier():Number{
return (this._armorBonusVsCreatureModifier);
}
public function get blind():int{
return (this._blind);
}
override public function itemData():ItemData{
var _local1:ItemData;
_local1 = new ItemData();
_local1.item_level = this.item_level;
_local1.item_rarity = this.item_rarity;
_local1.purple_num = this.purple_num;
_local1.material = this.material;
_local1.prefix = this.prefix;
_local1.suffix = this.suffix;
return (_local1);
}
public function set causes_stun_percent(_arg1:int):void{
this._causes_stun_percent = _arg1;
}
public function set armorBonusVsCreatureType(_arg1:int):void{
this._armorBonusVsCreatureType = _arg1;
}
public function scaleArmorForLevel(_arg1:int):int{
return (armorScale(_arg1, item_level));
}
public function setAccuracy(_arg1:int=5, _arg2:int=15):void{
this.accuracyBonus = (this.accuracyBonus + adjustStat(_arg1, _arg2));
}
public function setDamageReflection(_arg1:int=25, _arg2:int=45):void{
this.damageReflection = (this.damageReflection + adjustStat(_arg1, _arg2));
}
public function rollForSuffix(_arg1:int):int{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
if ((((_arg1 == Item.grey)) || ((_arg1 == Item.white)))){
return (-1);
};
_local2 = Math.ceil((100 / suffixes.length));
_local3 = dmf.randomNum(0, 100);
_local4 = 0;
while (_local4 < suffixes.length) {
_local5 = ((_local4 + 1) * _local2);
if (_local3 <= _local5){
return (_local4);
};
_local4++;
};
return (-1);
}
public function setHealthRegen(_arg1:int=5):void{
this.healthRegen = (this.healthRegen + scaleHealthRegen(_arg1, item_level));
}
public function set mod_healing(_arg1:int):void{
this._mod_healing = _arg1;
}
public function get damageBonusVsCreatureType():int{
return (this._damageBonusVsCreatureType);
}
public function set resistStun(_arg1:int):void{
this._resistStun = _arg1;
}
public function setQuickness(_arg1:int=3, _arg2:int=10):void{
this.mod_quickness = (this.mod_quickness + adjustStat(_arg1, _arg2));
}
public function set mod_dexterity(_arg1:int):void{
this._mod_dexterity = _arg1;
}
public function setDexterity(_arg1:int=1, _arg2:int=3):void{
this.mod_dexterity = (this.mod_dexterity + adjustStat(_arg1, _arg2, true));
}
public function get resistPoison():int{
return (this._resistPoison);
}
public function set mod_quickness(_arg1:int):void{
this._mod_quickness = _arg1;
}
public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
if (prefixes[_local1][0] == "Runed"){
setPowerRegen();
return;
};
if (prefixes[_local1][0] == "Vampiric"){
setVampiric();
return;
};
if (prefixes[_local1][0] == "Staggering"){
setStunChance();
return;
};
if (prefixes[_local1][0] == "Unerring"){
setAccuracy();
return;
};
if (prefixes[_local1][0] == "Venomous"){
setPoisonDamage();
return;
};
if (prefixes[_local1][0] == "Blinding"){
setBlind();
return;
};
if (prefixes[_local1][0] == "Soothing"){
setHealthRegen();
return;
};
if (prefixes[_local1][0] == "Purifying"){
setResistPoison();
return;
};
if (prefixes[_local1][0] == "Thick"){
armor_rating = Math.ceil((armor_rating * prefixes[_local1][1]));
return;
};
}
public function get whoEquips():uint{
return (this._whoEquips);
}
public function get armorBonusVsCreatureType():int{
return (this._armorBonusVsCreatureType);
}
public function set mod_strength(_arg1:int):void{
this._mod_strength = _arg1;
}
public function get resistStun():int{
return (this._resistStun);
}
public function setEndurance(_arg1:int=1, _arg2:int=3):void{
this.mod_endurance = (this.mod_endurance + adjustStat(_arg1, _arg2, true));
}
public function setResistStun(_arg1:int=20, _arg2:int=30):void{
this.resistStun = (this.resistStun + adjustStat(_arg1, _arg2));
}
public function set damageReflection(_arg1:int):void{
this._damageReflection = _arg1;
}
public function set replenishing(_arg1:int):void{
this._replenishing = _arg1;
}
public function get slot():int{
return (this._slot);
}
public static function scalePoisonDamage(_arg1:int, _arg2:int):int{
return (Math.round((MonsterCharacter.getHealthMax(_arg2) * (_arg1 / 100))));
}
public static function armorScale(_arg1:int, _arg2:int):int{
return (Math.ceil((_arg1 * (1 + ((_arg2 - 1) * Equipment.ARMOR_SCALE_CONSTANT)))));
}
public static function scaleHealthRegen(_arg1:int, _arg2:int):int{
return (Math.round((_arg1 * (PlayerCharacter.baseHealthForLevel(_arg2) / 100))));
}
}
}//package
Section 139
//ErrorDialog (ErrorDialog)
package {
import flash.events.*;
import flash.ui.*;
import flash.display.*;
import flash.text.*;
public class ErrorDialog extends MovieClip {
public var yes_btn:MovieClip;
public var bg:MovieClip;
public var dlg_text:TextField;
public var dlg_title:TextField;
public function ErrorDialog(_arg1:String="", _arg2:String=""):void{
var _local3:Number;
var _local4:int;
var _local5:int;
var _local6:int;
super();
if (_arg1.length){
setTitle(_arg1);
};
if (_arg2.length){
setText(_arg2);
};
yes_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
dlg_title.y = (bg.y + 5);
dlg_text.y = (dlg_title.y + 40);
yes_btn.y = ((dlg_text.y + dlg_text.textHeight) + 18);
_local3 = (bg.height / 200);
_local4 = ((yes_btn.y - bg.y) + 26);
bg.height = Math.round((_local4 * _local3));
_local5 = bg.y;
bg.y = (((DungeonMain.APP_HEIGHT - _local4) - 130) / 2);
_local6 = (_local5 - bg.y);
dlg_title.y = (dlg_title.y - _local6);
dlg_text.y = (dlg_text.y - _local6);
yes_btn.y = (yes_btn.y - _local6);
dm.stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
}
public function setTitle(_arg1:String):void{
dlg_title.text = _arg1;
dm.embolden(dlg_title);
}
private function cleanup():void{
dm.stage.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
}
public function setText(_arg1:String):void{
dlg_text.text = _arg1;
}
function clickOkay(_arg1:MouseEvent):void{
if (stage != null){
stage.removeChild(this);
cleanup();
};
}
function reportKeyDown(_arg1:KeyboardEvent):void{
if ((((_arg1.keyCode == Keyboard.ENTER)) || ((_arg1.keyCode == Keyboard.ESCAPE)))){
clickOkay(null);
};
}
}
}//package
Section 140
//ExitStairs (ExitStairs)
package {
import flash.display.*;
public dynamic class ExitStairs extends MovieClip {
}
}//package
Section 141
//FadeFromPage (FadeFromPage)
package {
import flash.display.*;
public dynamic class FadeFromPage extends MovieClip {
public function FadeFromPage(){
addFrameScript(39, frame40);
}
function frame40(){
this.stop();
if (parent != null){
parent.removeChild(this);
};
}
}
}//package
Section 142
//FadeScreen (FadeScreen)
package {
import flash.display.*;
public dynamic class FadeScreen extends MovieClip {
public function FadeScreen(){
addFrameScript(5, frame6);
}
function frame6(){
this.gotoAndStop(6);
}
}
}//package
Section 143
//FadeToBlack (FadeToBlack)
package {
import flash.display.*;
public dynamic class FadeToBlack extends MovieClip {
public function FadeToBlack(){
addFrameScript(14, frame15);
}
function frame15(){
this.stop();
}
}
}//package
Section 144
//feardeath_effect (feardeath_effect)
package {
import flash.display.*;
public dynamic class feardeath_effect extends MovieClip {
public function feardeath_effect(){
addFrameScript(0, frame1, 34, frame35, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.curse, 0.75);
}
function frame35(){
this.stop();
}
function frame45(){
this.stop();
}
}
}//package
Section 145
//fields_of_honor_loop01 (fields_of_honor_loop01)
package {
import flash.media.*;
public dynamic class fields_of_honor_loop01 extends Sound {
}
}//package
Section 146
//fire_effect (fire_effect)
package {
import flash.display.*;
public dynamic class fire_effect extends MovieClip {
public var flames:fire_scroll;
public function fire_effect(){
addFrameScript(0, frame1, 49, frame50);
}
function frame1(){
dm.sound.play(SoundControl.flames);
this.flames.x = DungeonMain.RandomNum(0, 240);
}
function frame50(){
this.stop();
}
}
}//package
Section 147
//fire_scroll (fire_scroll)
package {
import flash.display.*;
public dynamic class fire_scroll extends MovieClip {
public function fire_scroll(){
addFrameScript(44, frame45);
}
function frame45(){
this.gotoAndStop(45);
}
}
}//package
Section 148
//flames_sound (flames_sound)
package {
import flash.media.*;
public dynamic class flames_sound extends Sound {
}
}//package
Section 149
//freeze_sound (freeze_sound)
package {
import flash.media.*;
public dynamic class freeze_sound extends Sound {
}
}//package
Section 150
//frozen_effect (frozen_effect)
package {
import flash.display.*;
public dynamic class frozen_effect extends MovieClip {
public function frozen_effect(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.freeze);
}
function frame45(){
this.stop();
}
}
}//package
Section 151
//frozen_wastelands_loop02 (frozen_wastelands_loop02)
package {
import flash.media.*;
public dynamic class frozen_wastelands_loop02 extends Sound {
}
}//package
Section 152
//gain_both_effect (gain_both_effect)
package {
import flash.display.*;
public dynamic class gain_both_effect extends MovieClip {
public function gain_both_effect(){
addFrameScript(44, frame45);
}
function frame45(){
this.stop();
}
}
}//package
Section 153
//gain_health_effect (gain_health_effect)
package {
import flash.display.*;
public dynamic class gain_health_effect extends MovieClip {
public function gain_health_effect(){
addFrameScript(20, frame21, 44, frame45);
}
function frame21(){
this.stop();
}
function frame45(){
this.stop();
}
}
}//package
Section 154
//gain_power_effect (gain_power_effect)
package {
import flash.display.*;
public dynamic class gain_power_effect extends MovieClip {
public function gain_power_effect(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.powerUp);
}
function frame45(){
this.stop();
}
}
}//package
Section 155
//GlobalVolume (GlobalVolume)
package {
import flash.media.*;
import flash.utils.*;
import flash.events.*;
public class GlobalVolume {
static const fade_out_time = 500;
static const volumeFull = 1;
static const volumeMid = 0.5;
static const volumeLow = 0.15;
static const sound_fade_steps = 20;
static const fade_in_time = 1000;
static const volumeOff = 0;
static var volumeSetting:Number = 1;
static var fadeTimer:Timer;
static var fadeFromSetting:Number = 0;
public static function beginFade():void{
var _local1:*;
if (volumeSetting == fadeFromSetting){
return;
};
if (volumeSetting > fadeFromSetting){
_local1 = fade_in_time;
} else {
_local1 = fade_out_time;
};
SoundMixer.soundTransform = new SoundTransform(fadeFromSetting);
fadeTimer = new Timer(Math.round((_local1 / sound_fade_steps)), sound_fade_steps);
fadeTimer.addEventListener(TimerEvent.TIMER, fadeStep);
fadeTimer.addEventListener(TimerEvent.TIMER_COMPLETE, fadeDone);
fadeTimer.start();
}
public static function mute():void{
setVolume(volumeOff);
}
public static function setVolume(_arg1:Number, _arg2:Boolean=false):void{
fadeFromSetting = volumeSetting;
volumeSetting = _arg1;
if (_arg2){
beginFade();
} else {
SoundMixer.soundTransform = new SoundTransform(_arg1);
};
}
static function fadeDone(_arg1:TimerEvent):void{
fadeTimer.removeEventListener(TimerEvent.TIMER, fadeStep);
fadeTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, fadeDone);
SoundMixer.soundTransform = new SoundTransform(volumeSetting);
}
static function fadeStep(_arg1:TimerEvent):void{
var _local2:*;
var _local3:*;
_local2 = ((volumeSetting - fadeFromSetting) / sound_fade_steps);
_local3 = (SoundMixer.soundTransform.volume + _local2);
SoundMixer.soundTransform = new SoundTransform(_local3);
}
}
}//package
Section 156
//GoldDisplay (GoldDisplay)
package {
import flash.text.*;
import flash.display.*;
public class GoldDisplay extends Sprite {
public var goldLabel:TextField;
public var goldIcon:Sprite;
public function GoldDisplay():void{
}
public function setGold(_arg1:int):void{
goldLabel.text = String(_arg1);
}
}
}//package
Section 157
//GreenBar (GreenBar)
package {
import flash.display.*;
public dynamic class GreenBar extends Sprite {
}
}//package
Section 158
//heal1_sound (heal1_sound)
package {
import flash.media.*;
public dynamic class heal1_sound extends Sound {
}
}//package
Section 159
//healeffect (healeffect)
package {
import flash.display.*;
public dynamic class healeffect extends MovieClip {
public function healeffect(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.heal);
}
function frame45(){
this.stop();
}
}
}//package
Section 160
//healeffect_green (healeffect_green)
package {
import flash.display.*;
public dynamic class healeffect_green extends MovieClip {
}
}//package
Section 161
//HealthBar (HealthBar)
package {
import flash.display.*;
public dynamic class HealthBar extends MovieClip {
public var bar:RedBar;
public var lightbar:RedBar;
}
}//package
Section 162
//HeavyArmor (HeavyArmor)
package {
public class HeavyArmor extends Armor {
public function HeavyArmor(){
type = Armor.heavy;
mod_quickness = (mod_quickness - 5);
whoEquips = (Equipment.warriorEquip + Equipment.clericEquip);
base_armor_rating = 27;
grey_name = "Battered";
materials.push("Iron", "Steel", "Damascene", "Mithril", "Magesteel", "Planeforged");
}
override public function getItemTypeString(){
return ("Heavy Armor");
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function itemStatsString(_arg1:String):String{
return (super.itemStatsString(_arg1));
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
if (prefixes[_local1][0] == "Lightweight"){
mod_quickness = (mod_quickness + prefixes[_local1][1]);
if (mod_quickness > 0){
mod_quickness = 0;
};
return;
};
super.applyPrefix();
}
override public function getWorth():int{
return (Math.round((1.2 * super.getWorth())));
}
override public function getItemModifiers():void{
super.getItemModifiers();
prefixes.push(["Lightweight", 2]);
}
}
}//package
Section 163
//hellwars_loop02 (hellwars_loop02)
package {
import flash.media.*;
public dynamic class hellwars_loop02 extends Sound {
}
}//package
Section 164
//HelpButton (HelpButton)
package {
import flash.events.*;
import flash.display.*;
public class HelpButton extends MovieClip {
var target:DisplayObjectContainer;
var helpscreen:MovieClip;
public function HelpButton(){
addEventListener(MouseEvent.MOUSE_DOWN, clicked);
}
public function clicked(_arg1:MouseEvent){
if (parent == null){
return;
};
target = parent;
if ((parent is DungeonInterface)){
helpscreen = new HelpScreenDungeon();
target = parent.parent;
} else {
if ((parent is Inventory)){
helpscreen = new HelpScreenInventory();
} else {
if ((parent is Battlefield)){
helpscreen = new HelpScreenBattlefield();
} else {
if ((parent is Shop)){
helpscreen = new HelpScreenShop();
};
};
};
};
if (helpscreen == null){
return;
};
helpscreen.addEventListener(MouseEvent.MOUSE_DOWN, closeHelp);
target.addChild(helpscreen);
}
function closeHelp(_arg1:MouseEvent):void{
if (helpscreen == null){
return;
};
if (target == null){
target = parent;
};
helpscreen.removeEventListener(MouseEvent.MOUSE_DOWN, closeHelp);
if (target.contains(helpscreen)){
target.removeChild(helpscreen);
};
helpscreen = null;
}
public function cleanup():void{
removeEventListener(MouseEvent.MOUSE_DOWN, clicked);
}
}
}//package
Section 165
//HelpScreenBattlefield (HelpScreenBattlefield)
package {
import flash.display.*;
public dynamic class HelpScreenBattlefield extends MovieClip {
}
}//package
Section 166
//HelpScreenDungeon (HelpScreenDungeon)
package {
import flash.display.*;
public dynamic class HelpScreenDungeon extends MovieClip {
}
}//package
Section 167
//HelpScreenInventory (HelpScreenInventory)
package {
import flash.display.*;
public dynamic class HelpScreenInventory extends MovieClip {
}
}//package
Section 168
//HelpScreenShop (HelpScreenShop)
package {
import flash.display.*;
public dynamic class HelpScreenShop extends MovieClip {
}
}//package
Section 169
//hide3_sound (hide3_sound)
package {
import flash.media.*;
public dynamic class hide3_sound extends Sound {
}
}//package
Section 170
//HidingEffect (HidingEffect)
package {
import flash.display.*;
public dynamic class HidingEffect extends MovieClip {
}
}//package
Section 171
//HintDialog (HintDialog)
package {
import flash.events.*;
import flash.ui.*;
import flash.display.*;
import flash.text.*;
public class HintDialog extends MovieClip {
public var yes_btn:MovieClip;
var checkboxEnabled:Boolean;// = true
public var showCheck:dCheckBox;
public var bg:MovieClip;
public var dlg_text:TextField;
public var dlg_title:TextField;
public function HintDialog(_arg1:String="", _arg2:String="", _arg3:Boolean=true, _arg4:Boolean=false){
var _local5:Number;
var _local6:int;
var _local7:int;
var _local8:*;
checkboxEnabled = true;
super();
if (_arg1.length){
setTitle(_arg1);
};
if (_arg2.length){
setText(_arg2);
};
yes_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
if (_arg3){
showCheck.setChecked(DungeonMain.showHints);
showCheck.setDescription("Show hints and tips");
} else {
removeChild(showCheck);
checkboxEnabled = false;
};
dlg_text.mouseEnabled = false;
dlg_title.y = (bg.y + 5);
dlg_text.y = (dlg_title.y + 40);
yes_btn.y = ((dlg_text.y + dlg_text.textHeight) + 18);
showCheck.y = yes_btn.y;
_local5 = (bg.height / 200);
_local6 = ((yes_btn.y - bg.y) + 26);
bg.height = Math.round((_local6 * _local5));
_local7 = bg.y;
if (!(_arg4)){
bg.y = (((DungeonMain.APP_HEIGHT - _local6) - 130) / 2);
} else {
bg.y = ((DungeonMain.APP_HEIGHT - _local6) / 2);
};
_local8 = (_local7 - bg.y);
dlg_title.y = (dlg_title.y - _local8);
dlg_text.y = (dlg_text.y - _local8);
yes_btn.y = (yes_btn.y - _local8);
showCheck.y = (showCheck.y - _local8);
dm.stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
}
public function setTitle(_arg1:String):void{
dlg_title.text = _arg1;
dm.embolden(dlg_title);
}
private function cleanup():void{
dm.stage.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
showCheck.cleanup();
}
public function setText(_arg1:String):void{
dlg_text.text = _arg1;
}
function clickOkay(_arg1:MouseEvent):void{
DungeonMain.showHints = showCheck.checked;
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
if (parent != null){
parent.removeChild(this);
} else {
if ((((dm.stage == null)) && (!((stage == null))))){
dm.stage = stage;
};
if (((!((dm.stage == null))) && (dm.stage.contains(this)))){
dm.stage.removeChild(this);
};
};
if (dm.main != null){
dm.main.saveInterface();
};
cleanup();
}
function reportKeyDown(_arg1:KeyboardEvent):void{
if ((((_arg1.keyCode == Keyboard.ENTER)) || ((_arg1.keyCode == Keyboard.ESCAPE)))){
clickOkay(null);
};
}
}
}//package
Section 172
//Horde (Horde)
package {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
public class Horde extends MovieClip {
var tooltip:HordeTooltip;
private var mousingOver:Boolean;// = false
private var mouseOverFrames:int;// = 0
public var members:Array;
public var legendary:Boolean;// = false
public var defeated:Boolean;// = false
public var bg:MovieClip;
public var boss:int;// = 0
public var level:int;// = 1
private var mousedOverEvent:MouseEvent;
public var icon:HordeIcon;
public var race:int;// = 1
public var room:DungeonRoom;
static const dwarves = 16;
static const cultists = 8;
static const greenskins = 2;
static const creatures = 4;
static const special = 32;
static const max_size = 6;
static const undead = 1;
public function Horde(_arg1:int=32, _arg2:int=1, _arg3:int=0, _arg4:DungeonRoom=null, _arg5:Boolean=false, _arg6:Boolean=false):void{
var _local7:int;
var _local8:MonsterCharacter;
var _local9:*;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:MonsterCharacter;
var _local14:MonsterCharacter;
var _local15:int;
var _local16:Boolean;
var _local17:Array;
var _local18:*;
var _local19:*;
var _local20:*;
var _local21:*;
var _local22:*;
members = new Array();
defeated = false;
race = Horde.undead;
level = 1;
boss = 0;
legendary = false;
mousingOver = false;
mouseOverFrames = 0;
super();
addFrameScript(0, frame1, 14, frame15, 29, frame30);
_local7 = 0;
_local9 = dmf.randomNum(2, 4);
_local10 = -1;
this.race = _arg1;
this.level = _arg2;
this.boss = _arg3;
this.room = _arg4;
this.legendary = _arg6;
_local11 = dm.main.pc_party.campaign;
if (legendary){
icon.gotoAndStop(3);
_local12 = dmf.randomNum(0, 100);
if (DungeonMain.BETA){
_local12 = 99;
};
if (_local12 < 33){
_local8 = new mGorgon(_arg2);
_local8.pos = 2;
_local10 = 1;
members.push(_local8);
} else {
if (_local12 < 66){
_local8 = new mMinotaur(_arg2);
_local8.pos = 5;
_local10 = 1;
members.push(_local8);
} else {
_local8 = new mHydraBody(_arg2);
_local8.pos = 2;
members.push(_local8);
_local13 = new mHydraHead(_arg2);
_local13.pos = 4;
members.push(_local13);
_local14 = new mHydraHead(_arg2);
_local14.pos = 6;
members.push(_local14);
_local10 = 3;
};
};
} else {
if (boss > 0){
icon.gotoAndStop(2);
if (!(_arg5)){
if (((((_arg2 % DungeonMain.MAX_LEVEL) == 0)) && (!((_local11 == Campaign.DELUXE))))){
if (_local11 == Campaign.ORIGINAL){
_local8 = new mDemon(_arg2);
_local8.pos = 2;
_local10 = 1;
} else {
_local15 = dmf.randomNum(0, 300);
if (_local15 < 150){
if (_local15 < 75){
_local8 = new mDemon(_arg2);
_local8.pos = 2;
_local10 = 1;
} else {
_local10 = addDeluxeBoss();
};
} else {
_local8 = getBoss(true);
_local8.pos = 5;
members.push(_local8);
_local8 = getBoss(false);
_local8.pos = 2;
_local10 = 6;
this.boss = 2;
};
};
} else {
_local16 = true;
if (_local11 == Campaign.ORIGINAL){
if (_arg2 <= 4){
_local16 = true;
} else {
if (_arg2 <= 8){
_local16 = false;
} else {
_local16 = (dmf.randomNum(0, 1000) > 500);
};
};
} else {
if (_arg2 == 1){
_local16 = true;
} else {
_local16 = (dmf.randomNum(0, 1000) > 500);
};
};
_local8 = getBoss(_local16);
_local10 = 6;
};
};
if (((!((_local8 == null))) && (!(_arg5)))){
if (_local16){
_local8.pos = 5;
} else {
_local8.pos = 2;
};
members.push(_local8);
_local7 = _local8.pos;
_local9 = (_local9 + 2);
};
};
_local9 = (_local9 + getRoomSizeModifier());
if ((_arg2 % DungeonMain.MAX_LEVEL) == 0){
_local9++;
} else {
if (_arg2 == 1){
_local9 = (_local9 - 1);
};
};
_local9 = Math.min(_local9, 6);
_local9 = Math.max(_local9, 1);
if (_local10 != -1){
_local9 = _local10;
};
while ((((members.length < _local9)) && (!(_arg5)))) {
_local17 = new Array(6);
_local18 = 0;
while (_local18 < 6) {
_local17[_local18] = (_local18 + 1);
_local18++;
};
_local17 = dm.shuffleArray(_local17);
_local19 = 0;
while (_local19 < 6) {
if (_local17[_local19] == _local7){
} else {
if (memberInPos(_local17[_local19]) != null){
} else {
_local20 = (_local9 - members.length);
_local21 = Math.round((75 / _local20));
if (dmf.randomNum(0, 100) <= _local21){
_local22 = _arg2;
_local8 = GetMonsterForSlot(_arg1, _local22, _local17[_local19]);
members.push(_local8);
if (members.length == _local9){
break;
};
};
};
};
_local19++;
};
};
};
bg.addEventListener(MouseEvent.MOUSE_OVER, hordeMouseOnTarget);
bg.addEventListener(MouseEvent.MOUSE_OUT, hordeMouseOutTarget);
addEventListener(Event.ENTER_FRAME, onFrame);
}
public function battleAnim():void{
this.gotoAndPlay("battle");
dm.sound.play(SoundControl.battleStart, SoundControl.volumeSetting);
}
private function getBoss(_arg1:Boolean):MonsterCharacter{
var _local2:MonsterCharacter;
var _local3:int;
_local3 = 0;
if (race == Horde.special){
_local3 = dmf.randomNum(1, 5);
};
if ((((race == Horde.undead)) || ((_local3 == 1)))){
if (_arg1){
_local2 = new mDeathKnight(level);
} else {
_local2 = new mNecromancer(level);
};
} else {
if ((((race == Horde.greenskins)) || ((_local3 == 2)))){
if (_arg1){
_local2 = new mOrcJuggernaut(level);
} else {
_local2 = new mOrcWarlord(level);
};
} else {
if ((((race == Horde.creatures)) || ((_local3 == 3)))){
if (_arg1){
_local2 = new mDragon(level);
} else {
_local2 = new mBeholder(level);
};
} else {
if ((((race == Horde.cultists)) || ((_local3 == 4)))){
if (_arg1){
_local2 = new mCultEngine(level);
} else {
_local2 = new mAscendant(level);
};
} else {
if ((((race == Horde.dwarves)) || ((_local3 == 5)))){
if (_arg1){
_local2 = new mDwarfWarleader(level);
} else {
_local2 = new mDwarfPrince(level);
};
};
};
};
};
};
return (_local2);
}
public function needHydraHeads():int{
var _local1:int;
var _local2:MonsterCharacter;
_local1 = 0;
for each (_local2 in members) {
if ((((_local2 is mHydraHead)) && ((_local2.health <= 0)))){
_local1 = (_local1 + 2);
};
};
return (_local1);
}
protected function GetMonsterForSlot(_arg1:int, _arg2:int, _arg3:int):MonsterCharacter{
var _local4:MonsterCharacter;
var _local5:*;
var _local6:int;
_local5 = (_arg3 > 3);
if (_arg1 == Horde.special){
_local6 = dmf.randomNum(0, 99);
if (((!((dm.main.pc_party == null))) && ((dm.main.pc_party.campaign == Campaign.ORIGINAL)))){
_local6 = dmf.randomNum(20, 99);
};
if (_local6 >= 80){
_local4 = getUndead(_arg1, _arg2, _local5);
} else {
if (_local6 >= 60){
_local4 = getGreenskin(_arg1, _arg2, _local5);
} else {
if (_local6 >= 40){
_local4 = getCreature(_arg1, _arg2, _local5);
} else {
if (_local6 >= 20){
_local4 = getCultist(_arg1, _arg2, _local5);
} else {
_local4 = getDwarf(_arg1, _arg2, _local5);
};
};
};
};
} else {
if (_arg1 == Horde.undead){
_local4 = getUndead(_arg1, _arg2, _local5);
} else {
if (_arg1 == Horde.greenskins){
_local4 = getGreenskin(_arg1, _arg2, _local5);
} else {
if (_arg1 == Horde.creatures){
_local4 = getCreature(_arg1, _arg2, _local5);
} else {
if (_arg1 == Horde.cultists){
_local4 = getCultist(_arg1, _arg2, _local5);
} else {
if (_arg1 == Horde.dwarves){
_local4 = getDwarf(_arg1, _arg2, _local5);
} else {
_local4 = new mGreebler(_arg2);
};
};
};
};
};
};
_local4.pos = _arg3;
return (_local4);
}
private function newTooltip(_arg1:MouseEvent):Boolean{
var _local2:*;
var _local3:Array;
var _local4:Boolean;
var _local5:String;
var _local6:*;
var _local7:*;
_local2 = 0;
_local3 = new Array();
if (!(members.length)){
return (false);
};
if (_arg1 == null){
return (false);
};
_local5 = getHordeDescription();
_local6 = 0;
while (_local6 < members.length) {
if (members[_local6].health <= 0){
} else {
_local4 = true;
_local7 = 0;
while (_local7 < _local3.length) {
if (_local3[_local7][0] == members[_local6].charname){
var _local8 = _local3[_local7];
var _local9 = 1;
var _local10 = (_local8[_local9] + 1);
_local8[_local9] = _local10;
_local4 = false;
break;
};
_local7++;
};
if (_local4){
_local3.push([members[_local6].charname, 1, members[_local6].portrait]);
};
};
_local6++;
};
tooltip = new HordeTooltip(_local5, _local3, boss, legendary);
tooltip.mouseEnabled = false;
tooltip.mouseChildren = false;
tooltip.name = "tooltip_horde";
tooltip.setForEvent(_arg1);
stage.addChild(tooltip);
tooltip.mask = null;
return (true);
}
public function fullRecovery():void{
var _local1:*;
_local1 = 0;
while (_local1 < members.length) {
members[_local1].clearStatusEffects();
members[_local1].health = members[_local1].health_max;
members[_local1].power = members[_local1].power_max;
_local1++;
};
}
function onFadeComplete(_arg1:TimerEvent):void{
if (parent != null){
parent.removeChild(this);
};
}
public function findEmptySlot(_arg1:Boolean):int{
var _local2:int;
_local2 = 0;
if (_arg1){
_local2 = 4;
while (_local2 <= 6) {
if (memberInPos(_local2) == null){
return (_local2);
};
_local2++;
};
};
_local2 = 1;
while (_local2 <= 3) {
if (memberInPos(_local2) == null){
return (_local2);
};
_local2++;
};
if (_arg1){
return (0);
};
_local2 = 4;
while (_local2 <= 6) {
if (memberInPos(_local2) == null){
return (_local2);
};
_local2++;
};
return (0);
}
function hordeMouseOnTarget(_arg1:MouseEvent):void{
if (room == null){
return;
};
if (!(room.seen)){
return;
};
mousingOver = true;
mouseOverFrames = 0;
mousedOverEvent = _arg1;
}
function frame1(){
this.gotoAndStop("normal");
}
public function memberInPos(_arg1:int):MonsterCharacter{
var _local2:MonsterCharacter;
if (_arg1 <= 0){
return (null);
};
if (_arg1 > 6){
return (null);
};
for each (_local2 in members) {
if (_local2.pos == _arg1){
return (_local2);
};
};
return (null);
}
private function getGreenskin(_arg1:int, _arg2:int, _arg3:Boolean):MonsterCharacter{
var _local4:*;
var _local5:MonsterCharacter;
_local4 = dmf.randomNum(0, 100);
if (_arg3){
if (_local4 <= 20){
_local5 = new mOrcChampion(_arg2);
} else {
if (_local4 <= 50){
_local5 = new mTroll(_arg2);
} else {
_local5 = new mOrcBerserker(_arg2);
};
};
} else {
if (_local4 <= 40){
_local5 = new mOrcShaman(_arg2);
} else {
if (_local4 <= 70){
_local5 = new mGoblinArtificer(_arg2);
} else {
_local5 = new mOrcSavage(_arg2);
};
};
};
return (_local5);
}
public function get aliveCount():int{
var _local1:int;
var _local2:Character;
_local1 = 0;
for each (_local2 in members) {
if (_local2.health > 0){
_local1++;
};
};
return (_local1);
}
public function fade():void{
var _local1:Timer;
defeated = true;
cleanup();
if (tooltip != null){
if (tooltip.parent != null){
tooltip.parent.removeChild(tooltip);
};
};
this.gotoAndPlay("fade");
_local1 = new Timer(500, 1);
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, onFadeComplete);
_local1.start();
}
private function getUndead(_arg1:int, _arg2:int, _arg3:Boolean):MonsterCharacter{
var _local4:*;
var _local5:MonsterCharacter;
_local4 = dmf.randomNum(0, 100);
if (_arg3){
if (_local4 <= 20){
_local5 = new mBoneHorror(_arg2);
} else {
if (_local4 <= 50){
_local5 = new mGhost(_arg2);
} else {
_local5 = new mSkeleton(_arg2);
};
};
} else {
if (_local4 <= 30){
_local5 = new mLich(_arg2);
} else {
if (_local4 <= 60){
_local5 = new mVampire(_arg2);
} else {
_local5 = new mSkeletonArcher(_arg2);
};
};
};
return (_local5);
}
function frame15(){
this.gotoAndStop(15);
}
function frame30(){
this.gotoAndStop(30);
}
private function getCultist(_arg1:int, _arg2:int, _arg3:Boolean):MonsterCharacter{
var _local4:*;
var _local5:MonsterCharacter;
_local4 = dmf.randomNum(0, 100);
if (_arg3){
if (_local4 <= 40){
_local5 = new mCultWarrior(_arg2);
} else {
if (_local4 <= 80){
_local5 = new mCultNeophyte(_arg2);
} else {
_local5 = new mCultChosen(_arg2);
};
};
} else {
if (_local4 <= 60){
_local5 = new mCultArcher(_arg2);
} else {
_local5 = new mCultPriest(_arg2);
};
};
return (_local5);
}
private function getDwarf(_arg1:int, _arg2:int, _arg3:Boolean):MonsterCharacter{
var _local4:*;
var _local5:MonsterCharacter;
_local4 = dmf.randomNum(0, 100);
if (_arg3){
if (_local4 <= 30){
_local5 = new mDwarfManiac(_arg2);
} else {
if (_local4 <= 70){
_local5 = new mDwarfWarrior(_arg2);
} else {
_local5 = new mDwarfVeteran(_arg2);
};
};
} else {
if (_local4 <= 60){
_local5 = new mDwarfCrossbow(_arg2);
} else {
_local5 = new mDwarfRunecaster(_arg2);
};
};
return (_local5);
}
function hordeMouseOutTarget(_arg1:MouseEvent):void{
if (tooltip != null){
tooltip.fade();
tooltip = null;
};
mousingOver = false;
mouseOverFrames = 0;
}
public function hydraSlots():int{
var _local1:int;
var _local2:MonsterCharacter;
_local1 = (0 + (6 - members.length));
for each (_local2 in members) {
if (_local2.health <= 0){
_local1++;
};
};
return (_local1);
}
public function cleanup():void{
bg.removeEventListener(MouseEvent.MOUSE_OVER, hordeMouseOnTarget);
bg.removeEventListener(MouseEvent.MOUSE_OUT, hordeMouseOutTarget);
removeEventListener(Event.ENTER_FRAME, onFrame);
}
private function getCreature(_arg1:int, _arg2:int, _arg3:Boolean):MonsterCharacter{
var _local4:*;
var _local5:MonsterCharacter;
_local4 = dmf.randomNum(0, 100);
if (_arg3){
if (_local4 <= 40){
_local5 = new mArachnoid(_arg2);
} else {
if (_local4 <= 60){
_local5 = new mBasilisk(_arg2);
} else {
_local5 = new mGreebler(_arg2);
};
};
} else {
if (_local4 <= 35){
_local5 = new mPoisonDrake(_arg2);
} else {
if (_local4 <= 70){
_local5 = new mLightningDrake(_arg2);
} else {
_local5 = new mGargoyle(_arg2);
};
};
};
return (_local5);
}
public function hasFearSower():Boolean{
var _local1:Boolean;
var _local2:MonsterCharacter;
_local1 = false;
for each (_local2 in members) {
if ((_local2 is mFearSower)){
_local1 = true;
};
};
return (_local1);
}
public function addDeluxeBoss():int{
var _local1:MonsterCharacter;
members.length = 0;
_local1 = new mDreadfather(level);
_local1.pos = 2;
members.push(_local1);
_local1 = new mFearSower(level);
_local1.pos = 4;
members.push(_local1);
_local1 = new mFearSower(level);
_local1.pos = 5;
members.push(_local1);
_local1 = new mFearSower(level);
_local1.pos = 6;
members.push(_local1);
return (4);
}
public function resetMembers():void{
var _local1:int;
_local1 = (members.length - 1);
while (_local1 >= 0) {
if (MonsterCharacter(members[_local1]).originalPos != -1){
members[_local1].pos = MonsterCharacter(members[_local1]).originalPos;
};
if (members[_local1].summoned){
members.splice(_local1, 1);
} else {
if ((((members[0] is mDemon)) && ((_local1 > 0)))){
members.splice(_local1, 1);
} else {
if (((((legendary) && ((members[0] is mHydraBody)))) && ((_local1 > 0)))){
if ((members[_local1] is mHydraHead)){
if (members[_local1].pos == 1){
members.splice(_local1, 1);
} else {
if (members[_local1].pos == 3){
members.splice(_local1, 1);
} else {
if (members[_local1].pos == 5){
members.splice(_local1, 1);
} else {
members[_local1].resetMonster();
};
};
};
};
} else {
members[_local1].resetMonster();
};
};
};
_local1--;
};
}
protected function getHordeDescription():String{
if (legendary){
return ("Legendary Monster");
};
if (race == Horde.undead){
if (boss){
return ("Death's Champions");
};
if (members.length <= 2){
return ("Wandering Bones");
};
if (members.length <= 4){
return ("Restless Dead");
};
return ("Undying Horde");
//unresolved jump
};
if (race == Horde.greenskins){
if (boss){
return ("Warleader's Band");
};
if (members.length <= 2){
return ("Greenskin Patrol");
};
if (members.length <= 4){
return ("Savage Host");
};
return ("Orcish Legion");
//unresolved jump
};
if (race == Horde.creatures){
if (boss){
return ("Ancient Ones");
};
if (members.length <= 2){
return ("Scavengers");
};
if (members.length <= 4){
return ("Hunting Pack");
};
return ("Beastly Horde");
//unresolved jump
};
if (race == Horde.special){
if (boss){
if ((((members[0] is mDemon)) || ((members[0] is mDreadfather)))){
return ("Hellish Overlord");
};
return ("Diabolical Cabal");
} else {
if (members.length <= 2){
return ("Honor Guard");
};
if (members.length <= 4){
return ("United Forces");
};
return ("Alliance of Evil");
};
//unresolved jump
};
if (race == Horde.cultists){
if (boss){
return ("The Enlightened");
};
if (members.length <= 2){
return ("Cult Sentries");
};
if (members.length <= 4){
return ("Path Faithful");
};
return ("Planebreakers");
//unresolved jump
};
if (race == Horde.dwarves){
if (boss){
return ("Earthlord's Retinue");
};
if (members.length <= 2){
return ("Mountain Guards");
};
if (members.length <= 4){
return ("Nations' War Party");
};
return ("Dwarven Regiment");
//unresolved jump
};
return (Horde.nameForRace(race, true));
}
private function onFrame(_arg1:Event):void{
if (mousingOver){
mouseOverFrames++;
};
if (mouseOverFrames > Tooltip.delayFrames){
newTooltip(mousedOverEvent);
mousingOver = false;
mouseOverFrames = 0;
};
}
public function hordeData():HordeData{
var _local1:HordeData;
_local1 = new HordeData();
_local1.roomIndex = this.room.index;
_local1.defeated = this.defeated;
_local1.race = this.race;
_local1.boss = this.boss;
_local1.legendary = this.legendary;
_local1.level = this.level;
return (_local1);
}
protected function getRoomSizeModifier():int{
if (room == null){
return (0);
};
if ((room is rCorridorV)){
return (-1);
};
if ((room is rCorridorH)){
return (-1);
};
if ((room is rCell)){
return (0);
};
if ((room is rChamber)){
return (0);
};
if ((room is rTallRoom)){
return (1);
};
if ((room is rWideRoom)){
return (1);
};
if ((room is rGallery)){
return (2);
};
if ((room is rLargeRoom)){
return (2);
};
return (0);
}
public function isCampaignBoss():Boolean{
var _local1:MonsterCharacter;
if (!(boss)){
return (false);
};
if (dm.main.pc_party.campaign == Campaign.INFINITE){
return (false);
};
if (((!((room == null))) && ((room is rDemonRoom)))){
return (true);
};
for each (_local1 in members) {
if ((((_local1 is mDemon)) || ((_local1 is mDreadfather)))){
return (true);
};
};
return (false);
}
public static function getEngineName():String{
var _local1:Array;
var _local2:Array;
var _local3:String;
_local1 = new Array("Consecrator", "Retributor", "Assimilator", "Annihilator", "Exemplifier", "Admonisher", "Intensifier", "Augmentor");
_local2 = new Array("1", "2", "3", "4", "5", "6", "7", "8", "9");
_local3 = "";
_local3 = (_local3 + _local1[dmf.randomNum(0, (_local1.length - 1))]);
_local3 = (_local3 + "-");
_local3 = (_local3 + _local2[dmf.randomNum(0, (_local2.length - 1))]);
return (_local3);
}
public static function getNecromancerName():String{
var _local1:Array;
var _local2:Array;
var _local3:Array;
var _local4:String;
_local1 = new Array("Ner", "Zag", "Jal", "Sel", "Bal", "Dam", "Zel", "Sal", "Nar", "Mal", "Tral");
_local2 = new Array("'", "a", "e", "u", "o");
_local3 = new Array("gar", "zar", "thon", "sal", "tor", "thul", "thal", "bann");
_local4 = "";
_local4 = (_local4 + _local1[dmf.randomNum(0, (_local1.length - 1))]);
_local4 = (_local4 + _local2[dmf.randomNum(0, (_local2.length - 1))]);
_local4 = (_local4 + _local3[dmf.randomNum(0, (_local3.length - 1))]);
return (_local4);
}
public static function getKnightName():String{
var _local1:Array;
var _local2:Array;
var _local3:String;
_local1 = new Array("Ser ", "Sir ", "Lord ", "Black ", "Fell ", "Dread ");
_local2 = new Array("Nigel", "Neil", "Niles", "Charles", "Boris", "Jethro", "Gerald", "Horace", "Stan", "Alan", "Hank", "Marty", "Trevor", "Trent", "Bruce", "Eugene", "Wally", "Harold", "Hamish", "Carlos", "Jeremy", "Jerome", "Jermaine", "Tito", "George", "Hans", "Chad", "Rupert", "Ruprecht", "Albert", "Alfred", "Phineas", "Brent", "Colin", "Travis", "Jarvis", "Elton", "Ernest");
_local3 = "";
_local3 = (_local3 + _local1[dmf.randomNum(0, (_local1.length - 1))]);
_local3 = (_local3 + _local2[dmf.randomNum(0, (_local2.length - 1))]);
return (_local3);
}
public static function nameForRace(_arg1:int, _arg2:Boolean=false):String{
if (_arg2){
if (_arg1 == Horde.undead){
return ("Undead");
};
if (_arg1 == Horde.greenskins){
return ("Greenskins");
};
if (_arg1 == Horde.creatures){
return ("Deep Creatures");
};
if (_arg1 == Horde.cultists){
return ("Cultists");
};
if (_arg1 == Horde.dwarves){
return ("Dwarves");
};
return ("Monsters");
//unresolved jump
};
if (_arg1 == Horde.undead){
return ("undead");
};
if (_arg1 == Horde.greenskins){
return ("greenskins");
};
if (_arg1 == Horde.creatures){
return ("deep creatures");
};
if (_arg1 == Horde.cultists){
return ("cultists");
};
if (_arg1 == Horde.dwarves){
return ("dwarves");
};
return ("monsters");
}
public static function getBeholderName():String{
return (getNecromancerName());
}
public static function getGreenskinName():String{
var _local1:Array;
var _local2:Array;
var _local3:String;
_local1 = new Array("Gral", "Grun", "Grun", "Kil", "Skar", "Krum", "Har", "Zug", "Kaz", "Bom");
_local2 = new Array("gog", "gul", "grul", "guk", "krul", "krag", "zog", "bog", "skag", "zak");
_local3 = "";
_local3 = (_local3 + _local1[dmf.randomNum(0, (_local1.length - 1))]);
_local3 = (_local3 + _local2[dmf.randomNum(0, (_local2.length - 1))]);
return (_local3);
}
public static function getDwarfName():String{
var _local1:Array;
var _local2:Array;
var _local3:Array;
var _local4:String;
_local1 = new Array("Gr", "Gl", "G", "Th", "Thr", "N", "D", "B", "Br");
_local2 = new Array("i", "u", "o", "oi", "ou", "ý", "ú", "á", "ö");
_local3 = new Array("n", "mli", "rin", "run", "din", "ld", "lin", "lun");
_local4 = "";
_local4 = (_local4 + _local1[dmf.randomNum(0, (_local1.length - 1))]);
_local4 = (_local4 + _local2[dmf.randomNum(0, (_local2.length - 1))]);
_local4 = (_local4 + _local3[dmf.randomNum(0, (_local3.length - 1))]);
return (_local4);
}
public static function getDragonName():String{
var _local1:Array;
var _local2:Array;
var _local3:Array;
var _local4:String;
_local1 = new Array("Sm", "Br", "N");
_local2 = new Array("au", "auga", "aga", "alga", "aulga");
_local3 = new Array("g", "fen", "l", "n");
_local4 = "";
_local4 = (_local4 + _local1[dmf.randomNum(0, (_local1.length - 1))]);
_local4 = (_local4 + _local2[dmf.randomNum(0, (_local2.length - 1))]);
_local4 = (_local4 + _local3[dmf.randomNum(0, (_local3.length - 1))]);
return (_local4);
}
public static function getLurkerName():String{
var _local1:Array;
var _local2:Array;
var _local3:String;
_local1 = new Array("Sh", "Gh", "Sn", "Fh", "Ts");
_local2 = new Array("ee", "ib", "el", "ul", "eb", "im");
_local3 = "";
_local3 = (_local3 + _local1[dmf.randomNum(0, (_local1.length - 1))]);
_local3 = (_local3 + _local2[dmf.randomNum(0, (_local2.length - 1))]);
return (_local3);
}
}
}//package
Section 173
//HordeData (HordeData)
package {
public class HordeData {
private var _level:int;// = 0
private var _boss:int;// = 0
var members:Array;
private var _defeated:Boolean;// = false
private var _roomIndex:int;// = 0
private var _legendary:Boolean;// = false
private var _race:int;
public function HordeData(){
members = new Array();
_roomIndex = 0;
_defeated = false;
_race = Horde.undead;
_level = 0;
_boss = 0;
_legendary = false;
super();
}
public function get level():int{
return (this._level);
}
public function set level(_arg1:int):void{
this._level = _arg1;
}
public function get race():int{
return (this._race);
}
public function get defeated():Boolean{
return (this._defeated);
}
public function set boss(_arg1:int):void{
this._boss = _arg1;
}
public function set defeated(_arg1:Boolean):void{
this._defeated = _arg1;
}
public function set race(_arg1:int):void{
this._race = _arg1;
}
public function get boss():int{
return (this._boss);
}
public function set roomIndex(_arg1:int):void{
this._roomIndex = _arg1;
}
public function set legendary(_arg1:Boolean):void{
this._legendary = _arg1;
}
public function get roomIndex():int{
return (this._roomIndex);
}
public function get legendary():Boolean{
return (this._legendary);
}
public function toHorde():Horde{
var _local1:Horde;
var _local2:*;
_local1 = new Horde(this.race, this.level, this.boss, null, true, this.legendary);
_local1.defeated = this.defeated;
_local1.members = this.members;
_local2 = 0;
while (_local2 < members.length) {
MonsterCharacter(_local1.members[_local2]).initSkills();
_local2++;
};
return (_local1);
}
}
}//package
Section 174
//HordeIcon (HordeIcon)
package {
import flash.display.*;
public dynamic class HordeIcon extends MovieClip {
public function HordeIcon(){
addFrameScript(0, frame1);
}
function frame1(){
this.gotoAndStop(1);
}
}
}//package
Section 175
//HordeTooltip (HordeTooltip)
package {
import flash.text.*;
import flash.display.*;
public class HordeTooltip extends Tooltip {
const boss_text = 16777164;
public var tooltip_bg:Sprite;
public var t2:TextField;
public var t3:TextField;
public var t5:TextField;
public var t1:TextField;
public var t6:TextField;
public var t4:TextField;
public var title_label:TextField;
public var p1:CharGraphic;
public var p2:CharGraphic;
public var p3:CharGraphic;
public var p5:CharGraphic;
public var p6:CharGraphic;
public var p4:CharGraphic;
public function HordeTooltip(_arg1:String="", _arg2:Array=null, _arg3:int=0, _arg4:Boolean=false):void{
var _local5:*;
var _local6:*;
var _local7:TextField;
var _local8:MovieClip;
super();
if (_arg2 == null){
return;
};
_local5 = _arg2.length;
if (_arg1 == ""){
_arg1 = "Blank";
};
title_label.text = _arg1;
dm.embolden(title_label);
_local6 = (_local5 + 1);
while (_local6 <= 6) {
removeChild(getChildByName(("p" + _local6)));
removeChild(getChildByName(("t" + _local6)));
_local6++;
};
_local6 = 1;
while (_local6 <= _local5) {
_local7 = TextField(getChildByName(("t" + _local6)));
if (_local6 <= _arg3){
_local7.text = getString(_arg2, (_local6 - 1), true);
_local7.textColor = boss_text;
} else {
if (_arg4){
_local7.text = getString(_arg2, (_local6 - 1));
_local7.textColor = boss_text;
} else {
_local7.text = getString(_arg2, (_local6 - 1));
};
};
_local8 = MovieClip(getChildByName(("p" + _local6)));
_local8.setFrame(_arg2[(_local6 - 1)][2]);
_local6++;
};
tooltip_bg.height = ((39 + (_local5 * 30)) + 7);
}
private function getString(_arg1:Array, _arg2:int, _arg3:Boolean=false):String{
if (_arg2 >= _arg1.length){
return ("Blank");
};
if (_arg3){
return ((((("x " + String(_arg1[_arg2][1])) + " '") + _arg1[_arg2][0]) + "'"));
};
return (((("x " + String(_arg1[_arg2][1])) + " ") + _arg1[_arg2][0]));
}
}
}//package
Section 176
//horz_slash (horz_slash)
package {
import flash.display.*;
public dynamic class horz_slash extends MovieClip {
public var slash:MovieClip;
public function horz_slash(){
addFrameScript(11, frame12);
}
function frame12(){
this.gotoAndStop(12);
}
}
}//package
Section 177
//iAxe (iAxe)
package {
public class iAxe extends SteelEdgedWeapon {
public function iAxe(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Greataxe";
slot = weapon;
item_level = _arg1;
whoEquips = ((Equipment.warriorEquip + Equipment.rangerEquip) + Equipment.barbarianEquip);
twoHanded = true;
icon_frame = 10;
base_damage = axe_base_damage;
mod_quickness = (mod_quickness - 15);
grey_name = "Rusty";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 2;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Blood Harvester";
base_damage_mod = 50;
setHealthRegen();
setVampiric(7, 12);
icon_frame = 38;
} else {
if (_local2 == 2){
item_name = "Golden Axe";
base_damage_mod = 50;
setStunChance(15, 25);
setStrength(2, max_stat_for_purple);
icon_frame = 39;
} else {
item_name = "Executioner";
base_damage_mod = 48;
setLethality(3, 6);
damageBonusVsCreatureType = MonsterCharacter.human;
damageBonusVsCreatureModifier = 1.2;
setStrength(2, max_stat_for_purple);
icon_frame = 145;
};
};
}
override public function getWorth():int{
return (Math.round((1.4 * super.getWorth())));
}
}
}//package
Section 178
//iBow (iBow)
package {
public class iBow extends RangedWeapon {
public function iBow(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Bow";
slot = weapon;
item_level = _arg1;
whoEquips = ((Equipment.warriorEquip + Equipment.rangerEquip) + Equipment.rogueEquip);
twoHanded = true;
icon_frame = 15;
base_damage = bow_base_damage;
grey_name = "Cracked";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 3;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "The Huntsman";
base_damage_mod = 50;
damageBonusVsCreatureType = MonsterCharacter.creature;
damageBonusVsCreatureModifier = 1.2;
setAccuracy();
setLethality();
setPoisonDamage();
icon_frame = 53;
} else {
if (_local2 == 2){
item_name = "Manhunter Bow";
lore = "No man escapes the Manhunter";
base_damage_mod = 50;
damageBonusVsCreatureType = MonsterCharacter.human;
damageBonusVsCreatureModifier = 1.2;
setStunChance(15, 20);
setAccuracy();
icon_frame = 52;
} else {
if (_local2 == 3){
item_name = "Silencer";
base_damage_mod = 50;
setBlind(15, 30);
setStunChance();
setDexterity();
icon_frame = 146;
};
};
};
}
override public function getWorth():int{
return (Math.round((1.1 * super.getWorth())));
}
}
}//package
Section 179
//iCenser (iCenser)
package {
public class iCenser extends Offhand {
public function iCenser(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Censer";
slot = offhand;
item_level = _arg1;
whoEquips = Equipment.clericEquip;
base_armor_rating = 0;
mod_healing = (item_level * 5);
icon_frame = 63;
grey_name = "Tarnished";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 3;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Inquisitor's Censer";
mod_healing = Math.round((mod_healing * 1.2));
setStrength(2, max_stat_for_purple);
damageBonusVsCreatureType = MonsterCharacter.undead;
damageBonusVsCreatureModifier = 1.3;
icon_frame = 75;
} else {
if (_local2 == 2){
item_name = "Blessed Censer of the Exalted Priest-Lord";
mod_healing = (mod_healing * 2);
setHealthRegen();
setResistPoison(50, 75);
icon_frame = 76;
} else {
item_name = "Thurifer's Censer";
mod_healing = Math.round((mod_healing * 1.2));
armorBonusVsCreatureType = MonsterCharacter.undead;
armorBonusVsCreatureModifier = 2;
setResistPoison(40, 50);
setPowerRegen(3, 5);
creator = "Aensland";
icon_frame = 174;
};
};
}
override public function itemStatsString(_arg1:String):String{
var _local2:*;
_local2 = super.itemStatsString(_arg1);
if (_local2.length){
_local2 = (_local2 + "\n");
};
_local2 = (_local2 + ("Special(Censer): Increases the effect of Healing abilities by " + mod_healing));
return (_local2);
}
override public function getWorth():int{
return (Math.round((1.18 * super.getWorth())));
}
override public function getItemModifiers():void{
super.getItemModifiers();
prefixes.push(["Vampiric", 10]);
}
}
}//package
Section 180
//iCloak (iCloak)
package {
public class iCloak extends Armor {
public function iCloak(_arg1:int=1, _arg2:int=-1){
type = Armor.light;
mod_quickness = 0;
whoEquips = Equipment.allEquip;
base_armor_rating = 2;
materials.push("Linen", "Wool", "Velvet", "Silk", "Suncloth", "Aetherweave");
SetRarity(_arg2);
item_level = _arg1;
item_name = "Cloak";
slot = Equipment.back;
icon_frame = 55;
if (item_rarity == Item.orange){
return;
};
modifyBaseArmorForSlot();
grey_name = "Threadbare";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 4;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Cloak of Flames";
base_armor_rating = Math.round((base_armor_rating * 3));
setStrength(2, max_stat_for_purple);
setDamageReflection(40, 60);
setQuickness(8, 15);
icon_frame = 57;
} else {
if (_local2 == 2){
item_name = "Manashroud";
base_armor_rating = Math.round((base_armor_rating * 2));
setIntellect(2, max_stat_for_purple);
setPowerRegen(5, 8);
icon_frame = 58;
} else {
if (_local2 == 3){
item_name = "Shroud of Darkness";
base_armor_rating = Math.round((base_armor_rating * 2));
quickRetreat = true;
setBlind(15, 25);
setDexterity(2, max_stat_for_purple);
icon_frame = 56;
} else {
item_name = "Shroud of Shifting Evermist";
base_armor_rating = Math.round((base_armor_rating * 2));
setDamageReflection(40, 50);
setIntellect(1, 4);
setPowerRegen(4, 6);
creator = "Desk333";
icon_frame = 177;
};
};
};
}
override public function getItemTypeString(){
return ("Cloak");
}
override public function getItemModifiers():void{
super.getItemModifiers();
prefixes.push(["Vampiric", 10]);
suffixes.push(["Discretion", 1]);
}
}
}//package
Section 181
//iClothGloves (iClothGloves)
package {
public class iClothGloves extends LightArmor {
public function iClothGloves(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Gloves";
icon_frame = 31;
slot = Equipment.gloves;
modifyBaseArmorForSlot();
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 3;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Thief's Gloves";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setDexterity(2, max_stat_for_purple);
setBlind();
setQuickness();
icon_frame = 88;
} else {
if (_local2 == 2){
item_name = "Savant's Gloves";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setIntellect(2, max_stat_for_purple);
setEndurance();
setPowerRegen();
icon_frame = 87;
} else {
item_name = "Sacred Gloves";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setIntellect();
setStrength();
setResistStun();
mod_healing = (item_level * 2);
whoEquips = clericEquip;
icon_frame = 158;
};
};
}
override public function getItemModifiers():void{
super.getItemModifiers();
suffixes.push(["Accuracy", base_accuracy_bonus]);
}
}
}//package
Section 182
//iClothHat (iClothHat)
package {
public class iClothHat extends LightArmor {
public function iClothHat(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Hood";
icon_frame = 33;
slot = Equipment.head;
modifyBaseArmorForSlot();
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 4;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Facemask of the Bandit Chieftain";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setStrength(2, max_stat_for_purple);
setDexterity(2, max_stat_for_purple);
setPoisonDamage(2);
icon_frame = 90;
} else {
if (_local2 == 2){
item_name = "Savant's Hood";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setIntellect(2, max_stat_for_purple);
setEndurance();
setPowerRegen();
icon_frame = 89;
} else {
if (_local2 == 3){
item_name = "Sacred Hood";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setIntellect();
setStrength();
setAccuracy();
mod_healing = (item_level * 2);
whoEquips = clericEquip;
icon_frame = 160;
} else {
item_name = "Enlightening Hood";
base_armor_rating = Math.round((base_armor_rating * 1.4));
setIntellect(1, 3);
setDamageReflection(27, 54);
setBlind(20, 30);
creator = "LightningLord";
whoEquips = ((clericEquip + mageEquip) + conjurorEquip);
icon_frame = 175;
};
};
};
}
}
}//package
Section 183
//iClothLegs (iClothLegs)
package {
public class iClothLegs extends LightArmor {
public function iClothLegs(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Trousers";
icon_frame = 34;
slot = Equipment.legs;
modifyBaseArmorForSlot();
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 3;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Swashbuckler's Pantaloons";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setStrength();
setDexterity();
setQuickness();
icon_frame = 85;
} else {
if (_local2 == 2){
item_name = "Savant's Leggings";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setIntellect(2, max_stat_for_purple);
setEndurance();
setPowerRegen();
icon_frame = 86;
} else {
item_name = "Sacred Leggings";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setIntellect();
setStrength();
setResistStun();
mod_healing = (item_level * 2);
whoEquips = clericEquip;
icon_frame = 159;
};
};
}
}
}//package
Section 184
//iClothRobe (iClothRobe)
package {
public class iClothRobe extends LightArmor {
public function iClothRobe(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Robe";
icon_frame = 35;
slot = Equipment.armor;
modifyBaseArmorForSlot();
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 3;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Sacred Vestments";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setIntellect();
setStrength();
setResistPoison();
mod_healing = (item_level * 2);
whoEquips = clericEquip;
icon_frame = 92;
} else {
if (_local2 == 2){
item_name = "Savant's Robe";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setIntellect(2, max_stat_for_purple);
setEndurance();
setPowerRegen();
icon_frame = 91;
} else {
item_name = "Mystic's Infusing Robe";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setIntellect(2, max_stat_for_purple);
replenishing = 50;
setPowerRegen();
icon_frame = 161;
};
};
}
}
}//package
Section 185
//iClothShoes (iClothShoes)
package {
public class iClothShoes extends LightArmor {
public function iClothShoes(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Slippers";
icon_frame = 36;
slot = Equipment.boots;
modifyBaseArmorForSlot();
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 3;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Lightstep Slippers";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setDexterity(2, max_stat_for_purple);
setQuickness(5, 10);
quickRetreat = true;
icon_frame = 95;
} else {
if (_local2 == 2){
item_name = "Savant's Slippers";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setIntellect(2, max_stat_for_purple);
setEndurance();
setPowerRegen();
icon_frame = 94;
} else {
item_name = "Sacred Slippers";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setIntellect();
setStrength();
setResistPoison();
mod_healing = (item_level * 2);
whoEquips = clericEquip;
icon_frame = 157;
};
};
}
override public function getItemModifiers():void{
super.getItemModifiers();
suffixes.push(["Discretion", 1]);
}
}
}//package
Section 186
//iCrossbow (iCrossbow)
package {
public class iCrossbow extends RangedWeapon {
public function iCrossbow(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Crossbow";
slot = weapon;
item_level = _arg1;
whoEquips = ((Equipment.warriorEquip + Equipment.rangerEquip) + Equipment.rogueEquip);
twoHanded = true;
mod_quickness = (mod_quickness - 20);
icon_frame = 67;
base_damage = crossbow_base_damage;
grey_name = "Worn";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 3;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Mystically Augmented Bolt-Throwing System Mk I";
lore = "This weapon is remarkably easy to handle.";
base_damage_mod = 50;
setAccuracy(15, 30);
mod_quickness = 0;
setDexterity();
icon_frame = 72;
} else {
if (_local2 == 2){
item_name = "Quarrel-Ender";
lore = "The most efficient way to end any argument.";
base_damage_mod = 50;
setBlind(10, 15);
setPoisonDamage();
setLethality(7, 15);
icon_frame = 71;
} else {
item_name = "Crossbones";
base_damage_mod = 50;
damageBonusVsCreatureType = MonsterCharacter.undead;
damageBonusVsCreatureModifier = 1.2;
setDexterity();
setEndurance();
icon_frame = 147;
};
};
}
override public function getWorth():int{
return (Math.round((1.15 * super.getWorth())));
}
}
}//package
Section 187
//iDagger (iDagger)
package {
public class iDagger extends SteelEdgedWeapon {
public function iDagger(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Dagger";
slot = weapon;
item_level = _arg1;
whoEquips = Equipment.rogueEquip;
icon_frame = 16;
base_damage = dagger_base_damage;
mod_quickness = (mod_quickness + 5);
grey_name = "Worn";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 3;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Pestilence Blade";
base_damage_mod = 30;
setPoisonDamage(20);
icon_frame = 41;
resistPoison = -10;
} else {
if (_local2 == 2){
item_name = "Bloodseeker";
base_damage_mod = 35;
setVampiric(10, 20);
setAccuracy();
icon_frame = 40;
} else {
item_name = "The Shudderer";
lore = "It brings a pointy reckoning..";
base_damage_mod = 40;
setStunChance(15, 25);
icon_frame = 42;
};
};
}
override public function itemStatsString(_arg1:String):String{
var _local2:*;
_local2 = super.itemStatsString(_arg1);
_local2 = (_local2 + "\nSpecial(Dagger): Gains bonus damage from both Strength and Dexterity");
return (_local2);
}
override public function getWorth():int{
return (Math.round((0.95 * super.getWorth())));
}
}
}//package
Section 188
//iLeatherBoots (iLeatherBoots)
package {
public class iLeatherBoots extends MediumArmor {
public function iLeatherBoots(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Boots";
icon_frame = 24;
slot = Equipment.boots;
modifyBaseArmorForSlot();
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 4;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Heavy Spineskin Boots";
base_armor_rating = Math.round((base_armor_rating * Math.round((purple_armor_multiplier * 1.5))));
setStrength(2, max_stat_for_purple);
setEndurance();
setDamageReflection(40, 60);
icon_frame = 99;
} else {
if (_local2 == 2){
item_name = "Assassin's Boots";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
damageBonusVsCreatureType = MonsterCharacter.dwarf;
damageBonusVsCreatureModifier = 1.1;
quickRetreat = true;
setLethality(3, 5);
whoEquips = (whoEquips - Equipment.clericEquip);
icon_frame = 167;
} else {
if (_local2 == 3){
item_name = "Bloodsoaked Berserker's Boots";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setStrength(2, max_stat_for_purple);
setEndurance();
setHealthRegen();
icon_frame = 170;
} else {
item_name = "Stalker's Boots";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setDexterity(2, max_stat_for_purple);
setEndurance();
setHealthRegen();
icon_frame = 98;
};
};
};
}
override public function getItemModifiers():void{
super.getItemModifiers();
suffixes.push(["Discretion", 1]);
}
}
}//package
Section 189
//iLeatherChest (iLeatherChest)
package {
public class iLeatherChest extends MediumArmor {
public function iLeatherChest(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Jerkin";
icon_frame = 47;
slot = Equipment.armor;
modifyBaseArmorForSlot();
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 3;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Bloodsoaked Berserker's Jerkin";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setStrength(2, max_stat_for_purple);
setEndurance();
setResistStun();
icon_frame = 104;
} else {
if (_local2 == 2){
item_name = "Assassin's Jerkin";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
damageBonusVsCreatureType = MonsterCharacter.greenskin;
damageBonusVsCreatureModifier = 1.1;
setResistStun(30, 50);
setLethality(3, 5);
whoEquips = (whoEquips - Equipment.clericEquip);
icon_frame = 166;
} else {
item_name = "Stalker's Jerkin";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setDexterity(2, max_stat_for_purple);
setEndurance();
setHealthRegen();
icon_frame = 103;
};
};
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
}
}
}//package
Section 190
//iLeatherGloves (iLeatherGloves)
package {
public class iLeatherGloves extends MediumArmor {
public function iLeatherGloves(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Gloves";
icon_frame = 32;
slot = Equipment.gloves;
modifyBaseArmorForSlot();
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 3;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Assassin's Gloves";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
damageBonusVsCreatureType = MonsterCharacter.undead;
damageBonusVsCreatureModifier = 1.1;
setResistStun(30, 50);
setLethality(3, 5);
whoEquips = (whoEquips - Equipment.clericEquip);
icon_frame = 101;
} else {
if (_local2 == 2){
item_name = "Bloodsoaked Berserker's Gloves";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setStrength(2, max_stat_for_purple);
setEndurance();
setPowerRegen(1, 2);
icon_frame = 168;
} else {
item_name = "Stalker's Gloves";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setDexterity(2, max_stat_for_purple);
setEndurance();
setHealthRegen();
icon_frame = 100;
};
};
}
override public function getItemModifiers():void{
super.getItemModifiers();
prefixes.push(["Staggering", 10]);
suffixes.push(["Accuracy", base_accuracy_bonus]);
}
}
}//package
Section 191
//iLeatherHat (iLeatherHat)
package {
public class iLeatherHat extends MediumArmor {
public function iLeatherHat(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Helmet";
icon_frame = 48;
slot = Equipment.head;
modifyBaseArmorForSlot();
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 3;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Assassin's Hood";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
damageBonusVsCreatureType = MonsterCharacter.human;
damageBonusVsCreatureModifier = 1.1;
setResistPoison(30, 50);
setLethality(3, 5);
whoEquips = (whoEquips - Equipment.clericEquip);
icon_frame = 54;
} else {
if (_local2 == 2){
item_name = "Bloodsoaked Berserker's Hood";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setStrength(2, max_stat_for_purple);
setEndurance();
setPowerRegen(1, 2);
icon_frame = 169;
} else {
item_name = "Stalker's Hood";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setDexterity(2, max_stat_for_purple);
setEndurance();
setHealthRegen();
icon_frame = 102;
};
};
}
override public function getItemModifiers():void{
super.getItemModifiers();
}
}
}//package
Section 192
//iLeatherLegs (iLeatherLegs)
package {
public class iLeatherLegs extends MediumArmor {
public function iLeatherLegs(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Leggings";
icon_frame = 29;
slot = Equipment.legs;
modifyBaseArmorForSlot();
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 3;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Bloodsoaked Berserker's Leggings";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setStrength(2, max_stat_for_purple);
setEndurance();
setResistStun();
icon_frame = 97;
} else {
if (_local2 == 2){
item_name = "Assassin's Leggings";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
damageBonusVsCreatureType = MonsterCharacter.creature;
damageBonusVsCreatureModifier = 1.1;
setResistPoison(30, 50);
setLethality(3, 5);
whoEquips = (whoEquips - Equipment.clericEquip);
icon_frame = 165;
} else {
item_name = "Stalker's Leggings";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setDexterity(2, max_stat_for_purple);
setEndurance();
setHealthRegen();
icon_frame = 96;
};
};
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
}
}
}//package
Section 193
//iMace (iMace)
package {
public class iMace extends MeleeWeapon {
public function iMace(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Mace";
slot = weapon;
item_level = _arg1;
whoEquips = ((((Equipment.warriorEquip + Equipment.clericEquip) + Equipment.rogueEquip) + Equipment.barbarianEquip) + Equipment.conjurorEquip);
icon_frame = 13;
base_damage = mace_base_damage;
grey_name = "Battered";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 4;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Scepter of Grace";
base_damage_mod = 50;
setPowerRegen(4, 6);
setResistPoison(20, 30);
setResistStun(20, 30);
setIntellect(2, max_stat_for_purple);
icon_frame = 43;
} else {
if (_local2 == 2){
item_name = "The Punisher";
base_damage_mod = 60;
setBlind(20, 30);
setStunChance(15, 25);
icon_frame = 44;
} else {
if (_local2 == 3){
item_name = "Inquisitor's Mace";
lore = "Destroy the abomination.";
damageBonusVsCreatureType = MonsterCharacter.undead;
damageBonusVsCreatureModifier = 1.5;
base_damage_mod = 55;
setStrength(2, max_stat_for_purple);
icon_frame = 148;
} else {
item_name = "Mace of the Hill Giant";
lore = "The mace of the enormous Hill Giant!";
creator = "ChaosBlade";
base_damage_mod = 60;
setStrength(2, 5);
setStunChance(20, 25);
setStrength(2, 5);
icon_frame = 176;
};
};
};
}
override public function getWorth():int{
return (Math.round((0.9 * super.getWorth())));
}
}
}//package
Section 194
//InitiativeIcon (InitiativeIcon)
package {
import flash.text.*;
import flash.display.*;
public class InitiativeIcon extends MovieClip {
var start_y:int;
var dying:Boolean;// = false
protected var char_ref:Character;
var nametext:String;// = "Error"
var pos:int;// = 1
var target_y:int;
var tcolor:uint;// = 0xFFFFFF
public var pos_icon:InitiativePositionIndicator;
public var name_label:TextField;
public function InitiativeIcon(_arg1:Character=null){
tcolor = 0xFFFFFF;
nametext = "Error";
pos = 1;
dying = false;
super();
addFrameScript(8, frame9, 9, frame10, 19, frame20, 20, frame21, 30, frame31, 39, frame40, 40, frame41, 49, frame50);
if (_arg1 != null){
this.char_ref = _arg1;
this.updateNow();
};
}
public function fix():void{
if (name_label != null){
name_label.text = this.nametext;
name_label.textColor = this.tcolor;
};
if (pos_icon != null){
pos_icon.gotoAndStop(this.pos);
};
}
function setColor(_arg1:uint):void{
this.tcolor = _arg1;
fix();
}
function frame10(){
if (dying){
tcolor = 0;
};
this.fix();
}
function frame20(){
this.gotoAndStop(20);
this.fix();
}
function frame9(){
if (!(dying)){
this.gotoAndStop(9);
};
this.fix();
}
public function fade():void{
this.gotoAndPlay("fade");
}
public function kill():void{
dying = true;
fix();
if (this.currentFrame == 9){
this.gotoAndPlay("death");
};
}
function frame21(){
this.fix();
}
function frame31(){
this.fix();
}
public function updateNow():void{
this.nametext = (((char_ref.charname + " Q") + char_ref.getQuickness()) + " ");
this.pos = char_ref.pos;
fix();
}
public function res():void{
dying = false;
fix();
this.gotoAndPlay("revive");
}
function frame40(){
this.gotoAndStop(40);
this.fix();
}
function frame41(){
this.fix();
}
public function getChar():Character{
return (char_ref);
}
function frame50(){
this.gotoAndStop(50);
this.fix();
}
}
}//package
Section 195
//InitiativeList (InitiativeList)
package {
import flash.events.*;
import flash.text.*;
import flash.utils.*;
import flash.display.*;
public class InitiativeList extends MovieClip {
const highlight_color = 0xFFFF00;
const player_color = 0xFFFFFF;
const entry_height = 15;
const monster_color = 0xE90000;
const dead_color = 0;
private var icons:Array;
private var turn_order:Array;
public var bg:MovieClip;
private var entry_data:Array;
private var highlighted:Character;
var turn:int;// = 0
var current:int;
private var last_turn:Character;
var frame_count;// = 0
var animate_frames;// = 10
static const MAX_ENTRIES = 25;
public function InitiativeList(){
icons = new Array();
turn_order = new Array();
turn = 0;
frame_count = 0;
animate_frames = 10;
super();
}
function refillTimerComplete(_arg1:TimerEvent):void{
var _local2:*;
var _local3:*;
var _local4:*;
_local2 = 0;
while (_local2 < icons.length) {
if (bg.contains(icons[_local2])){
bg.removeChild(icons[_local2]);
};
_local2++;
};
icons.length = 0;
_local3 = 0;
while (_local3 < turn_order.length) {
_local4 = new InitiativeIcon(turn_order[_local3]);
_local4.setColor(getColorFor(turn_order[_local3]));
_local4.x = 0;
if (_local3 > 0){
_local4.target_y = (entry_height * (_local3 + 1));
_local4.start_y = bg.height;
_local4.y = bg.height;
} else {
_local4.y = (entry_height * _local3);
_local4.target_y = _local4.y;
_local4.start_y = _local4.y;
_local4.gotoAndStop(1);
_local4.fix();
};
icons.push(_local4);
bg.addChild(_local4);
_local3++;
};
animate_frames = 30;
frame_count = 0;
addEventListener(Event.ENTER_FRAME, animateFrame);
}
private function getColorFor(_arg1:Character):uint{
var _local2:uint;
if (((!((highlighted == null))) && ((highlighted == _arg1)))){
_local2 = highlight_color;
} else {
if (!(shouldAdd(_arg1))){
_local2 = dead_color;
} else {
if ((_arg1 is MonsterCharacter)){
_local2 = monster_color;
} else {
_local2 = player_color;
};
};
};
return (_local2);
}
private function buildTurnOrder(_arg1:Character, _arg2:Boolean=false):Boolean{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:int;
_local5 = 0;
_local6 = false;
_local7 = false;
turn_order.length = 0;
_local3 = 0;
while (_local3 < entry_data.length) {
if (entry_data[_local3] == _arg1){
_local5 = _local3;
if (_arg2){
if (shouldAdd(last_turn)){
turn_order.push(last_turn);
} else {
_local7 = true;
};
};
_local4 = _local5;
while (_local4 < entry_data.length) {
if (shouldAdd(entry_data[_local4])){
if (Character(entry_data[_local4]).hadCombatTurn == false){
turn_order.push(entry_data[_local4]);
};
};
_local4++;
};
break;
};
_local3++;
};
last_turn = _arg1;
_local8 = turn_order.length;
_local9 = MAX_ENTRIES;
if (_arg2){
_local9 = (_local9 + 2);
};
_local10 = 0;
while ((((_local8 < _local9)) && ((_local10 < MAX_ENTRIES)))) {
_local3 = 0;
while (_local3 < entry_data.length) {
if (shouldAdd(entry_data[_local3])){
turn_order.push(entry_data[_local3]);
_local8++;
if (_local8 >= MAX_ENTRIES){
break;
};
};
_local3++;
};
_local10++;
};
return (_local7);
}
public function removeDead():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
_local3 = 0;
_local4 = false;
_local1 = 0;
while (_local1 < turn_order.length) {
icons[_local1].start_y = icons[_local1].y;
icons[_local1].target_y = icons[_local1].y;
if ((((Character(turn_order[_local1]).health <= 0)) || ((((turn_order[_local1] is PlayerCharacter)) && (turn_order[_local1].retreated))))){
if (_local1 > 1){
_local3 = (_local3 + entry_height);
};
icons[_local1].kill();
_local4 = true;
} else {
icons[_local1].target_y = (icons[_local1].target_y - _local3);
};
_local1++;
};
if (_local4){
animate_frames = 10;
frame_count = -30;
addEventListener(Event.ENTER_FRAME, animateFrame);
};
}
public function setData(_arg1:Array=null){
if (_arg1 == null){
return;
};
entry_data = _arg1;
}
public function highlightChar(_arg1:Character):Boolean{
var _local2:*;
var _local3:*;
_local2 = false;
_local3 = 0;
while (_local3 < icons.length) {
if (icons[_local3].getChar() != _arg1){
} else {
if (icons[_local3].getChar().health <= 0){
} else {
highlighted = _arg1;
icons[_local3].setColor(highlight_color);
_local2 = true;
};
};
_local3++;
};
if (_local2){
return (true);
};
return (false);
}
public function refill(_arg1:Character):void{
var _local2:Boolean;
var _local3:*;
var _local4:Timer;
_local2 = false;
buildTurnOrder(_arg1);
_local3 = 0;
while (_local3 < icons.length) {
if (!(_local2)){
if (icons[_local3].getChar() == _arg1){
_local2 = true;
};
} else {
icons[_local3].fade();
};
_local3++;
};
_local4 = new Timer(350, 1);
_local4.addEventListener(TimerEvent.TIMER_COMPLETE, refillTimerComplete);
_local4.start();
}
public function turnOf(_arg1:Character, _arg2:Boolean):void{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
_local5 = false;
_local3 = 0;
while (_local3 < icons.length) {
if (icons[_local3] == null){
} else {
if (bg.contains(icons[_local3])){
bg.removeChild(icons[_local3]);
};
};
_local3++;
};
icons.length = 0;
_local5 = buildTurnOrder(_arg1, _arg2);
_local3 = 0;
while (_local3 < turn_order.length) {
_local6 = new InitiativeIcon(turn_order[_local3]);
_local6.setColor(getColorFor(turn_order[_local3]));
_local6.x = 0;
_local7 = 0;
if (_local5){
_local7 = (_local3 + 1);
} else {
_local7 = _local3;
};
_local6.y = (entry_height * _local7);
if (_arg2){
} else {
_local6.gotoAndStop(1);
_local6.fix();
};
icons.push(_local6);
bg.addChild(_local6);
_local3++;
};
}
function animateFrame(_arg1:Event):void{
var _local2:*;
var _local3:*;
var _local4:*;
frame_count++;
if (frame_count < 1){
return;
};
if (frame_count > animate_frames){
removeEventListener(Event.ENTER_FRAME, animateFrame);
return;
};
_local2 = 0;
while (_local2 < icons.length) {
if (icons[_local2].start_y == icons[_local2].target_y){
} else {
if (icons[_local2].y == icons[_local2].target_y){
} else {
_local3 = (icons[_local2].target_y - icons[_local2].start_y);
_local4 = (_local3 / animate_frames);
icons[_local2].y = (icons[_local2].start_y + (frame_count * _local4));
};
};
_local2++;
};
}
public function insertChar(_arg1:Character, _arg2:Character):void{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
buildTurnOrder(_arg2);
_local3 = 0;
_local4 = -1;
_local5 = false;
_local6 = 0;
_local7 = 0;
while (_local7 < turn_order.length) {
_local4 = (_local7 + 1);
icons[_local4].start_y = icons[_local4].y;
icons[_local4].target_y = icons[_local4].y;
if (turn_order[_local7] == _arg1){
insertIconAt(_local4, _arg1, _local3);
_local3 = (_local3 + entry_height);
_local5 = true;
} else {
icons[_local4].target_y = (icons[_local4].target_y + _local3);
};
_local7++;
};
if (_local5){
animate_frames = 10;
frame_count = 0;
addEventListener(Event.ENTER_FRAME, animateFrame);
};
}
public function cleanup():void{
removeEventListener(Event.ENTER_FRAME, animateFrame);
}
public function setNormalColors():void{
var _local1:uint;
var _local2:*;
var _local3:Character;
highlighted = null;
_local2 = 0;
while (_local2 < icons.length) {
if (icons[_local2] == null){
} else {
_local3 = icons[_local2].getChar();
if ((((_local3 == null)) || (!(shouldAdd(_local3))))){
_local1 = dead_color;
} else {
if ((_local3 is MonsterCharacter)){
_local1 = monster_color;
} else {
_local1 = player_color;
};
};
icons[_local2].setColor(_local1);
};
_local2++;
};
}
private function insertIconAt(_arg1:int, _arg2:Character, _arg3:int):void{
var _local4:*;
var _local5:*;
var _local6:InitiativeIcon;
_local6 = new InitiativeIcon(_arg2);
_local6.setColor(getColorFor(_arg2));
icons.splice(_arg1, 0, _local6);
_local6.x = 0;
_local6.y = ((entry_height * _arg1) + _arg3);
bg.addChild(_local6);
_local6.res();
}
public function setDead(_arg1:Character):void{
var _local2:*;
var _local3:*;
_local2 = 0;
while (_local2 < icons.length) {
if (icons[_local2].getChar() == _arg1){
icons[_local2].setColor(dead_color);
};
_local2++;
};
}
public function updateIcon(_arg1:Character):void{
var _local2:*;
_local2 = 0;
while (_local2 < icons.length) {
if (icons[_local2].getChar() == _arg1){
icons[_local2].updateNow();
};
_local2++;
};
}
private function shouldAdd(_arg1:Character):Boolean{
if (_arg1 == null){
return (false);
};
if (_arg1.health <= 0){
return (false);
};
if ((((_arg1 is PlayerCharacter)) && (PlayerCharacter(_arg1).retreated))){
return (false);
};
return (true);
}
private function numOf(_arg1:Character):int{
var _local2:*;
var _local3:*;
_local2 = 0;
_local3 = 0;
while (_local3 < turn_order.length) {
if (turn_order[_local3] == _arg1){
_local2++;
};
_local3++;
};
return (_local2);
}
}
}//package
Section 196
//InitiativePositionIndicator (InitiativePositionIndicator)
package {
import flash.display.*;
public dynamic class InitiativePositionIndicator extends MovieClip {
}
}//package
Section 197
//Intro (Intro)
package {
import flash.events.*;
import flash.display.*;
public class Intro extends MovieClip {
private var sponsorIntro:MovieClip;
public function Intro():void{
addEventListener(Event.ENTER_FRAME, onFrame);
}
private function sponsorIntroClick(_arg1:MouseEvent):void{
if (DungeonMain.ARMORGAMES){
dm.link(Links.ARMORGAMES);
} else {
dm.link(Links.KONG_HOME);
};
}
private function onFrame(_arg1:Event):void{
if (this.currentFrame == this.totalFrames){
removeEventListener(Event.ENTER_FRAME, onFrame);
this.stop();
if (parent != null){
parent.removeChild(this);
};
dm.main.mainMenu(false, true);
};
}
}
}//package
Section 198
//Inventory (Inventory)
package {
import flash.events.*;
import flash.ui.*;
import flash.display.*;
import flash.text.*;
public class Inventory extends Sprite {
public var highlight1:MovieClip;
var dragged_icon:InventoryIcon;
public var highlight2:MovieClip;
public var player_power_bar:NumericIndicatorPower;
public var player_level_label:TextField;
public var large_portrait:CharGraphic;
public var party_items:InventoryPanel;
public var info_panel:CharInfoPanel;
public var portraits:Array;
public var options_btn:OptionsButton;
public var goldDisplay:GoldDisplay;
var dragging:Boolean;// = false
public var menu_btn:MovieClip;
public var empty1:EmptyPortrait;
public var empty4:EmptyPortrait;
public var empty3:EmptyPortrait;
public var help_btn:MovieClip;
public var pc_party:Party;
public var empty2:EmptyPortrait;
public var player_name_label:TextField;
private var initialised:Boolean;// = false
var start_drag_x;// = 0
var start_drag_y;// = 0
public var exit_btn:MovieClip;
public var player_health_bar:NumericIndicatorHealth;
public var paperdoll:Paperdoll;
public var statusbar:TextField;
public var destroy:MovieClip;
public var tooltipController:ItemTooltipController;
public static var selectedChar:PlayerCharacter;
public function Inventory(_arg1:Party=null):void{
portraits = new Array();
initialised = false;
start_drag_x = 0;
start_drag_y = 0;
dragging = false;
super();
if (_arg1 != null){
this.pc_party = _arg1;
} else {
this.pc_party = dm.main.pc_party;
};
exit_btn.addEventListener(MouseEvent.MOUSE_DOWN, exitClick);
menu_btn.addEventListener(MouseEvent.MOUSE_DOWN, menuClick);
destroy.gotoAndStop(1);
destroy.addEventListener(MouseEvent.MOUSE_MOVE, destroyHover);
large_portrait.addEventListener(MouseEvent.CLICK, customPortraitClick);
statusbar.text = "";
tooltipController = new ItemTooltipController();
highlight1.mouseEnabled = false;
highlight1.mouseChildren = false;
highlight2.mouseEnabled = false;
highlight2.mouseChildren = false;
addEventListener(Event.ADDED_TO_STAGE, added);
selectChar(pc_party.members[0]);
}
function added(_arg1:Event):void{
var _local2:*;
var _local3:*;
removeEventListener(Event.ADDED_TO_STAGE, added);
if (stage != null){
init();
_local2 = 2;
if (((DungeonMain.showHints) && (!(Dungeon.hintShown(_local2))))){
_local3 = new HintDialog("Status and Inventory", "On this screen you can review and upgrade your characters' skills and statistics, as well as manage their equipment.\n\nEquip items you find by double-clicking their icon, or dragging to the paperdoll or character portrait. \n\nDiscard items by dragging them onto the red 'X' or click on them while holding the 'control' key.", true, true);
DungeonMain.hints = (DungeonMain.hints + _local2);
stage.addChild(_local3);
dm.main.saveInterface();
};
};
}
public function init():void{
var _local1:*;
var _local2:*;
var _local3:*;
if (initialised){
return;
};
initialised = true;
selectChar(pc_party.members[0]);
goldDisplay.setGold(pc_party.gold);
_local1 = 0;
while (_local1 < pc_party.members.length) {
if ((pc_party.members[_local1] is PC_Adventurer)){
} else {
pc_party.members[_local1].old_strength = pc_party.members[_local1].strength;
pc_party.members[_local1].old_endurance = pc_party.members[_local1].endurance;
pc_party.members[_local1].old_dexterity = pc_party.members[_local1].dexterity;
pc_party.members[_local1].old_intellect = pc_party.members[_local1].intellect;
pc_party.members[_local1].old_stat_points = pc_party.members[_local1].stat_points;
_local2 = getChildByName(("empty" + (_local1 + 1)));
_local3 = new CharacterPortrait();
_local3.x = _local2.x;
_local3.y = _local2.y;
_local3.setChar(pc_party.members[_local1]);
_local3.name = ("portrait" + _local1);
_local3.setGlow();
_local3.setHiding((pc_party.sneaking > 0));
removeChild(_local2);
addChild(_local3);
_local3.addEventListener(MouseEvent.MOUSE_DOWN, portraitClick);
portraits.push(_local3);
pc_party.members[_local1].portraitRef = _local3;
};
_local1++;
};
updateInventoryPanels();
stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
stage.addEventListener(KeyboardEvent.KEY_UP, reportKeyUp);
}
function startItemDragging(_arg1:MouseEvent):void{
var _local2:*;
if (_arg1.ctrlKey){
_local2 = InventoryIcon(_arg1.currentTarget.parent);
_local2.bg.removeEventListener(MouseEvent.MOUSE_UP, stopItemDragging);
destroyItem(_local2.item_ref);
return;
};
if (_arg1.currentTarget.parent == null){
return;
};
dragged_icon = InventoryIcon(_arg1.currentTarget.parent);
dm.childToTop(dragged_icon);
dm.childToTop(dragged_icon.parent);
start_drag_x = dragged_icon.x;
start_drag_y = dragged_icon.y;
InventoryIcon(dragged_icon).startDrag();
dragging = true;
stage.addEventListener(Event.ENTER_FRAME, checkDropTarget);
tooltipController.destroyTooltip();
_arg1.updateAfterEvent();
}
public function consume(_arg1:Consumable, _arg2:PlayerCharacter){
var _local3:*;
var _local4:int;
var _local5:int;
if ((_arg1 is CampaignItemFragment)){
statusbar.text = (((_arg2.charname + " combines the ") + _arg1.item_name) + "s.");
} else {
statusbar.text = (((_arg2.charname + " uses the ") + _arg1.item_name) + ".");
};
_local3 = portraitFromCharacter(_arg2);
_local4 = 0;
if (((!((_local3 == null))) && (!((_arg1 is CleanSlate))))){
if ((_arg1 is SneakyScroll)){
} else {
if ((_arg1 is PortalScroll)){
} else {
if ((_arg1 is CampaignItemStone)){
} else {
if ((_arg1 is CampaignItemFragment)){
} else {
if (_arg1.resurrect){
_local4 = PortraitAnimation.revive;
} else {
if ((_arg1 is PotionPoisonResist)){
_local4 = PortraitAnimation.buff;
} else {
if (_arg1.restore_health){
_local4 = PortraitAnimation.heal;
} else {
if (_arg1.restore_power){
_local4 = PortraitAnimation.gainPower;
} else {
if (_arg1.damage_resist){
_local4 = PortraitAnimation.armorBuff;
} else {
_local4 = PortraitAnimation.buff;
};
};
};
};
};
};
};
};
};
_local5 = -1;
if ((_arg1 is SneakyScroll)){
_local5 = SoundControl.hideSound;
} else {
if ((_arg1 is PortalScroll)){
_local5 = SoundControl.summon;
} else {
if ((_arg1 is CampaignItemStone)){
_local5 = SoundControl.summon;
} else {
if ((_arg1 is CampaignItemFragment)){
_local5 = SoundControl.equipGeneric;
} else {
_local5 = SoundControl.potionSound;
};
};
};
};
if (_local5 != -1){
dm.sound.play(_local5, 1, true);
};
};
if (_arg1.stack <= 0){
_arg1 = null;
};
updateStats();
updatePaperdoll(selectedChar);
updateInventoryPanels();
if (_local4){
_local3.addPortraitAnimation(_local4);
};
}
public function removeItemFrom(_arg1:Item, _arg2:PlayerCharacter){
var _local3:Equipment;
if (!((_arg1 is Equipment))){
return;
};
_local3 = Equipment(_arg1);
if (_arg2.unequip(Equipment(_arg1))){
updateStats();
updatePaperdoll(selectedChar);
updateInventoryPanels();
statusbar.text = (((_arg2.charname + " removes the ") + _local3.item_name) + ".");
} else {
statusbar.text = (((_arg2.charname + " cannot remove the ") + _local3.item_name) + ".");
};
}
public function exitClick(_arg1:MouseEvent){
if (pc_party.overflow.length){
statusbar.text = "Your party is carrying too many items. Discard some.";
} else {
dm.main.closeInventory();
};
}
public function destroyItem(_arg1:Item):void{
var _local2:*;
if (_arg1.item_rarity == Item.quest){
statusbar.text = "Quest items cannot be destroyed.";
} else {
statusbar.text = (_arg1.item_name + " destroyed.");
pc_party.destroyItem(_arg1);
dm.sound.play(SoundControl.destroyItem, 1, true);
_local2 = 0;
while (_local2 < Equipment.gearSlots) {
if (selectedChar.gear[_local2] == _arg1){
selectedChar.gear[_local2] = null;
};
_local2++;
};
_arg1 = null;
};
tooltipController.destroyTooltip();
updateStats();
updatePaperdoll(selectedChar);
updateInventoryPanels();
}
public function setDraggable(_arg1:InventoryIcon):void{
_arg1.bg.addEventListener(MouseEvent.MOUSE_DOWN, startItemDragging, false, 0, true);
_arg1.bg.addEventListener(MouseEvent.MOUSE_UP, stopItemDragging, false, 0, true);
}
function destroyHover(_arg1:MouseEvent){
if (((dragging) && (_arg1.buttonDown))){
destroy.gotoAndStop(2);
} else {
destroy.gotoAndStop(1);
};
}
private function menuClick(_arg1:MouseEvent):void{
var _local2:FadeToBlack;
_local2 = new FadeToBlack();
this.addChild(_local2);
dm.main.dungeonMenuClick(_arg1);
}
public function updateStats():void{
var _local1:*;
_local1 = 0;
while (_local1 < portraits.length) {
pc_party.members[_local1].recalculateMaxHealth();
if (portraits[_local1] == null){
} else {
portraits[_local1].update();
portraits[_local1].setGlow();
portraits[_local1].setHiding((pc_party.sneaking > 0));
};
_local1++;
};
player_health_bar.bar.width = ((60 / 100) * selectedChar.getHealthPercent());
player_health_bar.numbers.text = ((String(selectedChar.health) + "/") + String(selectedChar.health_max));
player_power_bar.bar.width = ((60 / 100) * selectedChar.getPowerPercent());
player_power_bar.numbers.text = ((String(selectedChar.power) + "/") + String(selectedChar.power_max));
if (parent != null){
};
}
public function updatePaperdoll(_arg1:PlayerCharacter):void{
var _local2:*;
var _local3:*;
var _local4:uint;
_local4 = (numChildren - 1);
setChildIndex(paperdoll, _local4);
tooltipController.destroyTooltip();
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
_local2 = paperdoll.getChildByName(("slot" + String(_local3)));
if (_local2 == null){
} else {
paperdoll.removeChild(_local2);
};
_local3++;
};
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (_local3 == Equipment.weapon){
if (((!((_arg1.gear[_local3] == null))) && (Weapon(_arg1.gear[_local3]).twoHanded))){
paperdoll.offhand.gotoAndStop(2);
} else {
paperdoll.offhand.gotoAndStop(1);
};
};
if (_arg1.gear[_local3] == null){
} else {
if (_arg1.gear[_local3].slot == Equipment.gearSlots){
} else {
if (_arg1.gear[_local3].slot != _local3){
} else {
_local2 = new InventoryIcon(_arg1.gear[_local3], tooltipController);
_local2.x = paperdoll.getSlotX(_arg1.gear[_local3].slot);
_local2.y = paperdoll.getSlotY(_arg1.gear[_local3].slot);
_local2.name = ("slot" + String(_local3));
paperdoll.addChild(_local2);
setDraggable(_local2);
};
};
};
_local3++;
};
info_panel.setChar(_arg1);
}
public function consumeFailed(_arg1:Item, _arg2:PlayerCharacter){
if ((_arg1 is CampaignItemFragment)){
statusbar.text = (("The " + _arg1.item_name) + " cannot be combined yet.");
} else {
statusbar.text = (((_arg2.charname + " cannot use the ") + _arg1.item_name) + " at this time.");
};
updateInventoryPanels();
}
public function selectChar(_arg1:PlayerCharacter){
var _local2:*;
_local2 = 0;
selectedChar = _arg1;
tooltipController.setChar(_arg1);
player_name_label.text = _arg1.charname;
dm.embolden(player_name_label);
player_level_label.text = ((("Level " + String(_arg1.level)) + " ") + String(_arg1.classname));
dm.embolden(player_level_label);
player_health_bar.bar.width = ((60 / 100) * _arg1.getHealthPercent());
player_health_bar.numbers.text = ((String(_arg1.health) + "/") + String(_arg1.health_max));
player_power_bar.bar.width = ((60 / 100) * _arg1.getPowerPercent());
player_power_bar.numbers.text = ((String(_arg1.power) + "/") + String(_arg1.power_max));
info_panel.setChar(_arg1);
large_portrait.setChar(_arg1);
updatePaperdoll(_arg1);
party_items.updateFilter();
}
private function enchant(_arg1:Item, _arg2:Enchantment, _arg3:InventoryIcon):Boolean{
var _local4:EnchantAnimation;
if (_arg2.useOn(Equipment(_arg1), selectedChar, pc_party)){
pc_party.removeFromInventory(_arg2);
updateStats();
updatePaperdoll(selectedChar);
updateInventoryPanels();
statusbar.text = (((_arg1.item_name + " enchanted with the ") + _arg2.item_name) + ".");
_local4 = new EnchantAnimation();
_local4.x = (paperdoll.x + _arg3.x);
_local4.y = (paperdoll.y + _arg3.y);
stage.addChild(_local4);
return (true);
};
updateInventoryPanels();
statusbar.text = (((_arg1.item_name + " cannot be enchanted with the ") + _arg2.item_name) + ".");
return (false);
}
private function onPortrait(_arg1:InventoryIcon):CharacterPortrait{
var _local2:CharacterPortrait;
if ((((_arg1 == null)) || ((_arg1.dropTarget == null)))){
return (null);
};
for each (_local2 in portraits) {
if (_local2 == null){
continue;
} else {
if (_local2 == _arg1.dropTarget){
return (_local2);
};
if (_local2.contains(_arg1.dropTarget)){
return (_local2);
};
};
};
return (null);
}
private function reportKeyUp(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.CONTROL){
destroy.gotoAndStop(1);
};
}
function portraitClick(_arg1:MouseEvent):void{
selectChar(PlayerCharacter(CharacterPortrait(_arg1.currentTarget).char_ref));
}
public function cleanup():void{
var _local1:*;
var _local2:*;
if (help_btn != null){
help_btn.cleanup();
};
if (options_btn != null){
options_btn.cleanup();
};
if (exit_btn != null){
exit_btn.removeEventListener(MouseEvent.MOUSE_DOWN, exitClick);
};
if (destroy != null){
destroy.removeEventListener(MouseEvent.MOUSE_MOVE, destroyHover);
};
if (menu_btn != null){
menu_btn.removeEventListener(MouseEvent.MOUSE_DOWN, menuClick);
};
if (large_portrait != null){
large_portrait.removeEventListener(MouseEvent.CLICK, customPortraitClick);
};
if (stage != null){
stage.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
stage.removeEventListener(KeyboardEvent.KEY_UP, reportKeyUp);
} else {
dm.stage.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
dm.stage.removeEventListener(KeyboardEvent.KEY_UP, reportKeyUp);
};
_local1 = 0;
while (_local1 < portraits.length) {
portraits[_local1].removeEventListener(MouseEvent.MOUSE_DOWN, portraitClick);
_local1++;
};
_local1 = 0;
while (_local1 < Equipment.gearSlots) {
_local2 = paperdoll.getChildByName(("slot" + String(_local1)));
if (_local2 != null){
_local2.cleanup();
};
_local1++;
};
if (party_items != null){
party_items.cleanup();
};
if (info_panel != null){
info_panel.cleanup();
};
}
public function useItemOn(_arg1:Item, _arg2:PlayerCharacter){
if ((_arg1 is Equipment)){
if (_arg2.equip(Equipment(_arg1))){
equipped(_arg1, _arg2);
} else {
equipFailed(_arg1, _arg2);
};
} else {
if ((_arg1 is Consumable)){
if (Consumable(_arg1).consume(_arg2, pc_party)){
pc_party.balanceInventory();
consume(Consumable(_arg1), _arg2);
} else {
consumeFailed(_arg1, _arg2);
};
} else {
updateInventoryPanels();
updatePaperdoll(selectedChar);
statusbar.text = (("The " + _arg1.item_name) + " is not usable.");
};
};
}
public function checkDropTarget(_arg1:Event){
if (!(dragging)){
return;
};
if (dragged_icon == null){
return;
};
if (dragged_icon.dropTarget == null){
return;
};
if (dragged_icon.dropTarget.parent == null){
return;
};
if (dragged_icon.dropTarget.parent == destroy){
destroy.gotoAndStop(2);
} else {
destroy.gotoAndStop(1);
};
}
public function updateInventoryPanels():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:int;
_local1 = 0;
_local2 = 0;
tooltipController.destroyTooltip();
_local3 = new InventoryPanel(pc_party, tooltipController);
_local3.x = party_items.x;
_local3.y = party_items.y;
_local3.width = party_items.original_width;
_local3.height = party_items.original_height;
removeChild(party_items);
party_items.cleanup();
party_items = null;
party_items = _local3;
addChildAt(party_items, (numChildren - 1));
setChildIndex(paperdoll, (numChildren - 1));
party_items.updateListeners();
_local4 = (pc_party.inventory.length + pc_party.overflow.length);
party_items.updateCount(_local4);
}
private function reportKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.CONTROL){
destroy.gotoAndStop(2);
};
}
function stopItemDragging(_arg1:MouseEvent):void{
var _local2:int;
var _local3:Item;
var _local4:*;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:InventoryIcon;
var _local13:PlayerCharacter;
_local2 = 0;
_arg1.currentTarget.stopDrag();
if (!(dragging)){
return;
};
dragging = false;
stage.removeEventListener(Event.ENTER_FRAME, checkDropTarget);
_local3 = InventoryIcon(dragged_icon).item_ref;
if ((((dragged_icon.x == start_drag_x)) && ((dragged_icon.y == start_drag_y)))){
return;
};
_local4 = false;
if (dragged_icon.dropTarget != null){
if ((((dragged_icon.dropTarget == destroy)) || (destroy.contains(dragged_icon.dropTarget)))){
_local4 = true;
};
};
if (draggedOnPaperdoll(dragged_icon)){
if ((_local3 is Enchantment)){
_local5 = 0;
_local6 = 500;
_local7 = (dmf.getGlobalX(dragged_icon) + (dragged_icon.width / 2));
_local8 = (dmf.getGlobalY(dragged_icon) + (dragged_icon.height / 2));
_local2 = 0;
while (_local2 < Equipment.gearSlots) {
_local9 = ((paperdoll.getSlotX(_local2) + 10) + paperdoll.x);
_local10 = ((paperdoll.getSlotY(_local2) + 10) + paperdoll.y);
_local11 = dmf.distanceBetween(_local9, _local10, _local7, _local8);
if (_local11 > 20){
} else {
if (_local11 < _local6){
_local6 = _local11;
_local5 = _local2;
};
};
_local2++;
};
if (_local6 == 500){
updateInventoryPanels();
return;
};
_local12 = InventoryIcon(paperdoll.getChildByName(("slot" + _local5)));
if (_local12 != null){
enchant(_local12.item_ref, Enchantment(_local3), _local12);
return;
};
updateInventoryPanels();
return;
} else {
if (dragged_icon.parent == paperdoll){
updatePaperdoll(selectedChar);
return;
};
useItemOn(_local3, selectedChar);
};
} else {
if (_local4){
destroy.gotoAndStop(1);
destroyItem(_local3);
} else {
if (onPortrait(dragged_icon) != null){
_local13 = PlayerCharacter(onPortrait(dragged_icon).char_ref);
useItemOn(_local3, _local13);
} else {
if ((((party_items == dragged_icon.dropTarget)) || (party_items.contains(dragged_icon.dropTarget)))){
if (paperdoll.contains(dragged_icon)){
removeItemFrom(_local3, selectedChar);
} else {
updateInventoryPanels();
};
} else {
updatePaperdoll(selectedChar);
updateInventoryPanels();
};
};
};
};
_arg1.updateAfterEvent();
}
public function equipFailed(_arg1:Item, _arg2:PlayerCharacter){
updatePaperdoll(selectedChar);
updateInventoryPanels();
statusbar.text = (((_arg2.charname + " cannot equip the ") + _arg1.item_name) + ".");
}
private function draggedOnPaperdoll(_arg1:Object):Boolean{
if (_arg1 == null){
return (false);
};
if (_arg1.dropTarget == null){
return (false);
};
if (paperdoll.contains(_arg1.dropTarget)){
return (true);
};
return (false);
}
private function customPortraitClick(_arg1:MouseEvent):void{
var _local2:*;
_local2 = new CustomPortraitDialog(selectedChar, this);
this.addChild(_local2);
}
public function equipped(_arg1:Item, _arg2:PlayerCharacter){
statusbar.text = (((_arg2.charname + " equips the ") + _arg1.item_name) + ".");
dm.sound.play(getEquipSound(_arg1), 1, true);
_arg1 = null;
updateStats();
updatePaperdoll(selectedChar);
updateInventoryPanels();
}
private function getEquipSound(_arg1:Item):int{
if ((_arg1 is iSword)){
return (SoundControl.equipSword);
};
if ((_arg1 is iAxe)){
return (SoundControl.equipAxe);
};
if ((_arg1 is iDagger)){
return (SoundControl.equipDagger);
};
if ((_arg1 is iMace)){
return (SoundControl.equipMace);
};
if ((_arg1 is iSpear)){
return (SoundControl.equipSpear);
};
if ((_arg1 is iBow)){
return (SoundControl.equipBow);
};
if ((_arg1 is iCrossbow)){
return (SoundControl.equipCrossbow);
};
if ((_arg1 is iStaff)){
return (SoundControl.equipStaff);
};
if ((_arg1 is Shield)){
return (SoundControl.equipShield);
};
if ((_arg1 is iParryingDagger)){
return (SoundControl.equipDagger);
};
return (SoundControl.equipGeneric);
}
private function portraitFromCharacter(_arg1:PlayerCharacter):CharacterPortrait{
var _local2:*;
_local2 = 0;
while (_local2 < portraits.length) {
if (portraits[_local2].char_ref == _arg1){
return (portraits[_local2]);
};
_local2++;
};
return (null);
}
}
}//package
Section 199
//InventoryIcon (InventoryIcon)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class InventoryIcon extends MovieClip {
private var mousingOver:Boolean;// = false
private var mouseOverFrames:int;// = 0
public var bg:Sprite;
public var stack_size:TextField;
var item_ref:Item;
public var outline:MovieClip;
var taking:Boolean;// = true
private var mousedOverEvent:MouseEvent;
public var recommendRating:int;// = 0
public var enchantGlow:MovieClip;
var draggable:Boolean;// = false
var tooltipController:ItemTooltipController;
public function InventoryIcon(_arg1:Item=null, _arg2:ItemTooltipController=null){
draggable = false;
taking = true;
mousingOver = false;
mouseOverFrames = 0;
recommendRating = 0;
super();
if (_arg1 == null){
return;
};
if (_arg2 != null){
this.tooltipController = _arg2;
};
enchantGlow.gotoAndStop(1);
setItem(_arg1);
}
function mouseOverInventoryIcon(_arg1:MouseEvent):void{
mousingOver = true;
mouseOverFrames = 0;
mousedOverEvent = _arg1;
}
function doubleClick(_arg1:MouseEvent=null):void{
var _local2:*;
if ((parent is InventoryPanel)){
_local2 = Inventory.selectedChar;
Inventory(parent.parent).useItemOn(item_ref, _local2);
} else {
if ((parent is Paperdoll)){
if ((parent.parent is Inventory)){
Inventory(parent.parent).removeItemFrom(item_ref, Inventory.selectedChar);
} else {
if ((parent.parent is Shop)){
Shop(parent.parent).removeItemFrom(item_ref, Shop.selectedChar);
};
};
};
};
}
function mouseMoveInventoryIcon(_arg1:MouseEvent):void{
if (mousingOver){
this.mousedOverEvent = _arg1;
tooltipController.updatePositionFromEvent(_arg1);
} else {
mouseOverInventoryIcon(_arg1);
};
}
function mouseOutInventoryIcon(_arg1:MouseEvent):void{
mousingOver = false;
mouseOverFrames = 0;
if (tooltipController != null){
tooltipController.destroyTooltip();
};
}
public function setItem(_arg1:Item):void{
var _local2:int;
if (item_ref != null){
cleanup();
};
this.item_ref = _arg1;
this.gotoAndStop(_arg1.icon_frame);
stack_size.mouseEnabled = false;
outline.mouseEnabled = false;
outline.mouseChildren = false;
enchantGlow.mouseEnabled = false;
enchantGlow.mouseChildren = false;
if ((((item_ref is Consumable)) && ((Consumable(item_ref).stack > 1)))){
stack_size.text = String(Consumable(item_ref).stack);
} else {
if (this.contains(stack_size)){
removeChild(stack_size);
};
};
outline.gotoAndStop((_arg1.item_rarity + 1));
bg.addEventListener(MouseEvent.MOUSE_OVER, mouseOverInventoryIcon);
bg.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveInventoryIcon);
bg.addEventListener(MouseEvent.MOUSE_OUT, mouseOutInventoryIcon);
if ((((_arg1 is Equipment)) || ((_arg1 is Consumable)))){
bg.doubleClickEnabled = true;
bg.addEventListener(MouseEvent.DOUBLE_CLICK, doubleClick);
};
if ((_arg1 is Equipment)){
_local2 = (1 + Enchantment.iconIdForEnchantment(Equipment(_arg1).enchantmentType));
enchantGlow.gotoAndStop(_local2);
} else {
enchantGlow.gotoAndStop(1);
};
addEventListener(Event.ENTER_FRAME, onFrame);
}
public function cleanup():void{
bg.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverInventoryIcon);
bg.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveInventoryIcon);
bg.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutInventoryIcon);
bg.removeEventListener(MouseEvent.DOUBLE_CLICK, doubleClick);
if (draggable){
bg.removeEventListener(MouseEvent.MOUSE_DOWN, Inventory(parent.parent).startItemDragging);
bg.removeEventListener(MouseEvent.MOUSE_UP, Inventory(parent.parent).stopItemDragging);
};
removeEventListener(Event.ENTER_FRAME, onFrame);
if (tooltipController != null){
tooltipController.destroyTooltip();
};
}
private function onFrame(_arg1:Event):void{
if (mousingOver){
if (mouseOverFrames > Tooltip.delayFrames){
if (tooltipController != null){
tooltipController.showTooltip(mousedOverEvent, item_ref);
if ((((((parent is InventoryPanel)) || ((parent is Paperdoll)))) && ((((item_ref is Equipment)) || ((item_ref is Consumable)))))){
tooltipController.enableDoubleClick(this, doubleClick);
};
};
};
mouseOverFrames++;
};
}
}
}//package
Section 200
//InventoryIconBg (InventoryIconBg)
package {
import flash.display.*;
public dynamic class InventoryIconBg extends MovieClip {
}
}//package
Section 201
//InventoryPanel (InventoryPanel)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class InventoryPanel extends Sprite {
const icon_start_y = 40;
const row_width = 15;
const OVERFLOW_START_Y = 140;
const ICON_WIDTH = 20;
const ICON_HEIGHT = 20;
const ICON_GAP = 4;
public var sortRarity:InvFilter;
public var filterAll:InvFilter;
public var ignoreArmorBox:dCheckBox;
public var sortType:InvFilter;
private var processing:Boolean;// = false
public var icons:Array;
public var filterRecommend:InvFilterRecommend;
public var filterWeapons:InvFilter;
var original_height:int;// = 0
public var sortValue:InvFilter;
public var filterMisc:InvFilter;
public var filterUsable:InvFilter;
public var sortLevel:InvFilter;
public var sortDirection:MovieClip;
private var pc_party:Party;
public var filterArmor:InvFilter;
public var count_label:TextField;
public var workingAnim:MovieClip;
var original_width:int;// = 0
public var sortNone:InvFilter;
private var tooltipController:ItemTooltipController;
static const SORT_LEVEL = 3;
static const SORT_NAME = 5;
static const SORT_VALUE = 6;
static const SORT_RARITY = 4;
static const FILTER_WEAPONS = 3;
static const FILTER_MISC = 5;
static const FILTER_RECOMMEND = 10;
static const FILTER_ARMOR = 4;
static const SORT_NONE = 1;
static const FILTER_ALL = 1;
static const SORT_TYPE = 2;
static const FILTER_USABLE = 2;
public function InventoryPanel(_arg1:Party=null, _arg2:ItemTooltipController=null):void{
icons = new Array();
processing = false;
original_width = 0;
original_height = 0;
super();
original_width = width;
original_height = height;
this.tooltipController = _arg2;
if (_arg1 == null){
this.pc_party = dm.main.pc_party;
} else {
this.pc_party = _arg1;
};
setSortDirection(pc_party.sortAscending);
filterAll.filterLabel.text = "All";
filterUsable.filterLabel.text = "Usable";
filterWeapons.filterLabel.text = "Weapons";
filterArmor.filterLabel.text = "Armor";
filterMisc.filterLabel.text = "Misc";
filterAll.addEventListener(MouseEvent.CLICK, doFilterAll);
filterUsable.addEventListener(MouseEvent.CLICK, doFilterUsable);
filterWeapons.addEventListener(MouseEvent.CLICK, doFilterWeapons);
filterArmor.addEventListener(MouseEvent.CLICK, doFilterArmor);
filterMisc.addEventListener(MouseEvent.CLICK, doFilterMisc);
filterRecommend.addEventListener(MouseEvent.CLICK, doFilterRecommend);
sortNone.filterLabel.text = "None";
sortLevel.filterLabel.text = "Level";
sortType.filterLabel.text = "Type";
sortRarity.filterLabel.text = "Rarity";
sortValue.filterLabel.text = "Value";
sortNone.addEventListener(MouseEvent.CLICK, doSortNone);
sortType.addEventListener(MouseEvent.CLICK, doSortType);
sortLevel.addEventListener(MouseEvent.CLICK, doSortLevel);
sortRarity.addEventListener(MouseEvent.CLICK, doSortRarity);
sortValue.addEventListener(MouseEvent.CLICK, doSortValue);
addEventListener(Event.ENTER_FRAME, perFrame);
updateSort(false);
updateIcons();
updateFilter();
updateRecommendOptions();
ignoreArmorBox.addEventListener(MouseEvent.MOUSE_DOWN, ignoreArmorClicked);
ignoreArmorBox.setDescription("Ignore armor values when recommending items for this character", false, 0x999999);
}
public function updateSort(_arg1:Boolean=true):void{
var _local2:MovieClip;
var _local3:Array;
var _local4:uint;
var _local5:uint;
var _local6:Array;
var _local7:Array;
var _local8:Array;
var _local9:*;
processing = true;
if (pc_party.invSort == SORT_NONE){
_local2 = sortNone;
} else {
if (pc_party.invSort == SORT_TYPE){
_local2 = sortType;
} else {
if (pc_party.invSort == SORT_LEVEL){
_local2 = sortLevel;
} else {
if (pc_party.invSort == SORT_RARITY){
_local2 = sortRarity;
} else {
if (pc_party.invSort == SORT_VALUE){
_local2 = sortValue;
};
};
};
};
};
sortNone.gotoAndStop(1);
sortType.gotoAndStop(1);
sortRarity.gotoAndStop(1);
sortLevel.gotoAndStop(1);
sortValue.gotoAndStop(1);
_local2.gotoAndStop(2);
if (pc_party.sortAscending){
_local5 = Array.DESCENDING;
_local4 = (Array.DESCENDING | Array.NUMERIC);
} else {
_local5 = 0;
_local4 = Array.NUMERIC;
};
if (pc_party.invSort == SORT_LEVEL){
_local3 = dm.joinArrays(pc_party.inventory, pc_party.overflow);
_local3.sortOn(["item_level", "icon_frame", "item_name"], [_local4, _local4, _local5]);
} else {
if (pc_party.invSort == SORT_VALUE){
_local3 = dm.joinArrays(pc_party.inventory, pc_party.overflow);
_local3.sortOn(["item_value", "item_level", "icon_frame"], [_local4, _local4, _local4]);
} else {
if (pc_party.invSort == SORT_NAME){
_local3 = dm.joinArrays(pc_party.inventory, pc_party.overflow);
_local3.sortOn(["item_name", "item_level", "icon_frame"], [_local5, _local4, _local4]);
} else {
if (pc_party.invSort == SORT_RARITY){
_local3 = dm.joinArrays(pc_party.inventory, pc_party.overflow);
_local3.sortOn(["item_rarity", "item_level", "icon_frame"], [_local5, _local4, _local4]);
} else {
if (pc_party.invSort == SORT_TYPE){
_local6 = pc_party.getConsumables();
_local7 = pc_party.getEquipment();
_local8 = pc_party.getMisc();
_local6.sortOn(["icon_frame", "item_name", "item_level"], [_local4, _local5, _local4]);
_local8.sortOn(["icon_frame", "item_name", "item_level"], [_local4, _local5, _local4]);
_local7.sortOn(["slot", "icon_frame", "item_name", "item_level"], [_local4, _local4, _local5, _local4]);
if (pc_party.sortAscending){
_local3 = _local7.concat(_local8.concat(_local6));
} else {
_local3 = _local6.concat(_local8.concat(_local7));
};
};
};
};
};
};
if (((!((_local3 == null))) && (_local3.length))){
pc_party.inventory.length = 0;
pc_party.overflow.length = 0;
_local9 = 0;
while (_local9 < Party.MAX_INVENTORY) {
if (_local3.length){
pc_party.inventory.push(_local3.pop());
};
_local9++;
};
while (_local3.length) {
pc_party.overflow.push(_local3.pop());
};
};
updateIcons();
if (_arg1){
updateFilter();
} else {
processing = false;
};
}
private function doFilterRecommend(_arg1:MouseEvent):void{
if (pc_party.invFilter == FILTER_RECOMMEND){
return;
};
pc_party.invFilter = FILTER_RECOMMEND;
updateFilter();
}
private function doFilterArmor(_arg1:MouseEvent):void{
pc_party.invFilter = FILTER_ARMOR;
updateFilter();
}
private function doSortLevel(_arg1:MouseEvent):void{
if (pc_party.invSort == SORT_LEVEL){
toggleDirection();
} else {
setSortDirection(false);
};
pc_party.invSort = SORT_LEVEL;
updateSort();
}
private function updateRecommendOptions():void{
if (pc_party.invFilter == FILTER_RECOMMEND){
if (!(this.contains(ignoreArmorBox))){
addChild(ignoreArmorBox);
};
if (Inventory.selectedChar != null){
ignoreArmorBox.setChecked(Inventory.selectedChar.ignoreArmorValues);
};
} else {
if (this.contains(ignoreArmorBox)){
removeChild(ignoreArmorBox);
};
};
}
private function doSortValue(_arg1:MouseEvent):void{
if (pc_party.invSort == SORT_VALUE){
toggleDirection();
} else {
setSortDirection(false);
};
pc_party.invSort = SORT_VALUE;
updateSort();
}
private function perFrame(_arg1:Event):void{
if (((processing) && ((workingAnim.currentFrame == 1)))){
workingAnim.gotoAndPlay(2);
dm.childToTop(workingAnim);
} else {
if (!(processing)){
workingAnim.gotoAndStop(1);
};
};
}
private function setSortDirection(_arg1:Boolean):void{
pc_party.sortAscending = _arg1;
if (pc_party.sortAscending){
sortDirection.gotoAndStop("up");
} else {
sortDirection.gotoAndStop("down");
};
}
private function doFilterMisc(_arg1:MouseEvent):void{
pc_party.invFilter = FILTER_MISC;
updateFilter();
}
private function doFilterWeapons(_arg1:MouseEvent):void{
pc_party.invFilter = FILTER_WEAPONS;
updateFilter();
}
public function updateListeners():void{
var _local1:InventoryIcon;
if ((((parent == null)) || (!((parent is Inventory))))){
return;
};
for each (_local1 in icons) {
Inventory(parent).setDraggable(_local1);
};
}
public function addItemRef(_arg1:Item):InventoryIcon{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
if (_arg1 == null){
return (null);
};
_local2 = 0;
_local3 = 0;
_local4 = icons.length;
if (_local4 < Party.MAX_INVENTORY){
_local3 = Math.floor((_local4 / row_width));
_local2 = (_local4 % row_width);
_local5 = new InventoryIcon(_arg1, tooltipController);
icons.push(_local5);
drawIcon(_local5, _local4);
return (_local5);
};
if (_local4 < (Party.MAX_INVENTORY + Party.MAX_OVERFLOW)){
_local2 = (_local4 % row_width);
_local6 = new InventoryIcon(_arg1, tooltipController);
icons.push(_local6);
drawIcon(_local6, _local4);
return (_local6);
};
return (null);
}
public function updateFilter():void{
var _local1:*;
var _local2:MovieClip;
var _local3:InventoryIcon;
var _local4:*;
var _local5:int;
var _local6:*;
var _local7:Array;
var _local8:Array;
var _local9:Item;
var _local10:*;
var _local11:*;
var _local12:InventoryIcon;
_local1 = 0;
processing = true;
if (pc_party.invFilter == FILTER_ALL){
_local2 = filterAll;
} else {
if (pc_party.invFilter == FILTER_USABLE){
_local2 = filterUsable;
} else {
if (pc_party.invFilter == FILTER_WEAPONS){
_local2 = filterWeapons;
} else {
if (pc_party.invFilter == FILTER_ARMOR){
_local2 = filterArmor;
} else {
if (pc_party.invFilter == FILTER_MISC){
_local2 = filterMisc;
} else {
if (pc_party.invFilter == FILTER_RECOMMEND){
_local2 = filterRecommend;
};
};
};
};
};
};
updateRecommendOptions();
filterAll.gotoAndStop("normal");
filterUsable.gotoAndStop("normal");
filterWeapons.gotoAndStop("normal");
filterArmor.gotoAndStop("normal");
filterMisc.gotoAndStop("normal");
filterRecommend.gotoAndStop("normal");
_local2.gotoAndStop("highlight");
for each (_local3 in icons) {
if (this.contains(_local3)){
removeChild(_local3);
};
};
_local4 = Inventory.selectedChar;
if (_local4 == null){
return;
};
_local5 = 0;
if (pc_party.invFilter == FILTER_RECOMMEND){
_local6 = 0;
while (_local6 < Equipment.gearSlots) {
_local7 = new Array();
_local8 = new Array();
_local10 = _local4.gear[Equipment.weapon];
if (((!((_local10 == null))) && (_local10.twoHanded))){
//unresolved if
} else {
for each (_local3 in icons) {
_local9 = _local3.item_ref;
if (!((_local9 is Equipment))){
} else {
if (Equipment(_local9).slot != _local6){
} else {
if (!(_local4.itemUsable(_local9))){
} else {
if ((((((_local6 == Equipment.weapon)) && ((_local9 is Weapon)))) && (Weapon(_local9).twoHanded))){
//unresolved if
} else {
_local3.recommendRating = _local4.evaluateEquipment(_local3.item_ref);
_local7.push(_local3);
};
};
};
};
};
_local11 = _local4.evaluateEquipment(_local4.gear[_local6]);
if (_local7.length){
_local7.sortOn("recommendRating", (Array.DESCENDING | Array.NUMERIC));
for each (_local12 in _local7) {
if (_local12.recommendRating > _local11){
drawIcon(_local12, _local5);
_local5++;
break;
};
};
};
};
_local6++;
};
} else {
for each (_local3 in icons) {
if (pc_party.invFilter == FILTER_USABLE){
if (_local4.itemUsable(_local3.item_ref)){
drawIcon(_local3, _local5);
_local5++;
};
} else {
if (pc_party.invFilter == FILTER_WEAPONS){
if ((_local3.item_ref is Weapon)){
drawIcon(_local3, _local5);
_local5++;
};
} else {
if (pc_party.invFilter == FILTER_ARMOR){
if ((_local3.item_ref is Armor)){
drawIcon(_local3, _local5);
_local5++;
};
} else {
if (pc_party.invFilter == FILTER_MISC){
if ((((((((_local3.item_ref is Jewellery)) || ((_local3.item_ref is iCloak)))) || ((_local3.item_ref is Offhand)))) || (!((_local3.item_ref is Equipment))))){
drawIcon(_local3, _local5);
_local5++;
};
} else {
drawIcon(_local3, _local5);
_local5++;
};
};
};
};
};
};
processing = false;
}
public function cleanup():void{
var _local1:InventoryIcon;
for each (_local1 in icons) {
_local1.cleanup();
};
removeEventListener(Event.ENTER_FRAME, perFrame);
filterAll.removeEventListener(MouseEvent.CLICK, doFilterAll);
filterUsable.removeEventListener(MouseEvent.CLICK, doFilterUsable);
filterWeapons.removeEventListener(MouseEvent.CLICK, doFilterWeapons);
filterArmor.removeEventListener(MouseEvent.CLICK, doFilterArmor);
filterMisc.removeEventListener(MouseEvent.CLICK, doFilterMisc);
sortNone.removeEventListener(MouseEvent.CLICK, doSortNone);
sortType.removeEventListener(MouseEvent.CLICK, doSortType);
sortLevel.removeEventListener(MouseEvent.CLICK, doSortLevel);
sortRarity.removeEventListener(MouseEvent.CLICK, doSortRarity);
sortValue.removeEventListener(MouseEvent.CLICK, doSortValue);
ignoreArmorBox.removeEventListener(MouseEvent.MOUSE_DOWN, ignoreArmorClicked);
}
private function doSortNone(_arg1:MouseEvent):void{
if (pc_party.invSort == SORT_NONE){
toggleDirection();
} else {
setSortDirection(false);
};
pc_party.invSort = SORT_NONE;
updateSort();
}
private function doFilterUsable(_arg1:MouseEvent):void{
pc_party.invFilter = FILTER_USABLE;
updateFilter();
}
private function doFilterAll(_arg1:MouseEvent):void{
pc_party.invFilter = FILTER_ALL;
updateFilter();
}
public function updateCount(_arg1:int){
var _local2 = ??pushnamespace
;
var _local3 = ??pushnamespace
;
_local2 = 0xFF0000;
_local3 = 0xFFFFFF;
if (_arg1 > Party.MAX_INVENTORY){
count_label.textColor = _local2;
} else {
count_label.textColor = _local3;
};
count_label.text = ((_arg1 + "/") + Party.MAX_INVENTORY);
dm.embolden(count_label);
}
private function doSortType(_arg1:MouseEvent):void{
if (pc_party.invSort == SORT_TYPE){
toggleDirection();
} else {
setSortDirection(false);
};
pc_party.invSort = SORT_TYPE;
updateSort();
}
private function updateIcons():void{
var _local1:InventoryIcon;
var _local2:Item;
var _local3:Item;
for each (_local1 in icons) {
if (this.contains(_local1)){
removeChild(_local1);
};
_local1.cleanup();
};
icons.length = 0;
for each (_local2 in pc_party.inventory) {
addItemRef(_local2);
};
for each (_local3 in pc_party.overflow) {
addItemRef(_local3);
};
updateListeners();
}
private function doSortRarity(_arg1:MouseEvent):void{
if (pc_party.invSort == SORT_RARITY){
toggleDirection();
} else {
setSortDirection(false);
};
pc_party.invSort = SORT_RARITY;
updateSort();
}
private function ignoreArmorClicked(_arg1:MouseEvent):void{
Inventory.selectedChar.ignoreArmorValues = !(Inventory.selectedChar.ignoreArmorValues);
updateFilter();
}
private function drawIcon(_arg1:InventoryIcon, _arg2:int):void{
var _local3:*;
var _local4:*;
_local3 = 0;
_local4 = Math.floor((_arg2 / row_width));
if (_arg2 < Party.MAX_INVENTORY){
_local3 = (_arg2 % row_width);
_arg1.x = (10 + (_local3 * (ICON_WIDTH + ICON_GAP)));
_arg1.y = (icon_start_y + (_local4 * (ICON_HEIGHT + ICON_GAP)));
} else {
if (_arg2 < (Party.MAX_INVENTORY + Party.MAX_OVERFLOW)){
_local3 = (_arg2 % row_width);
_arg1.x = (10 + (_local3 * (ICON_WIDTH + ICON_GAP)));
_arg1.y = OVERFLOW_START_Y;
};
};
this.addChild(_arg1);
}
private function toggleDirection():void{
setSortDirection(!(pc_party.sortAscending));
}
}
}//package
Section 202
//InventoryTab (InventoryTab)
package {
import flash.text.*;
import flash.display.*;
public class InventoryTab extends MovieClip {
public var tab_text:TextField;
public var flasher:MovieClip;
var flashing:Boolean;// = false
public function InventoryTab(){
flashing = false;
super();
this.gotoAndStop(1);
flashing = true;
}
public function setFlasher(_arg1:Boolean=true):void{
if (((_arg1) && (!(flashing)))){
flasher.gotoAndPlay(1);
flashing = true;
} else {
if (((!(_arg1)) && (flashing))){
flasher.gotoAndStop(1);
flashing = false;
};
};
}
}
}//package
Section 203
//InvFilter (InvFilter)
package {
import flash.text.*;
import flash.display.*;
public dynamic class InvFilter extends MovieClip {
public var filterLabel:TextField;
public function InvFilter(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package
Section 204
//InvFilterRecommend (InvFilterRecommend)
package {
import flash.text.*;
import flash.display.*;
public dynamic class InvFilterRecommend extends MovieClip {
public var filterLabel:TextField;
public function InvFilterRecommend(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package
Section 205
//iParryingDagger (iParryingDagger)
package {
public class iParryingDagger extends Offhand {
public function iParryingDagger(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Parrying Dagger";
slot = offhand;
item_level = _arg1;
whoEquips = ((Equipment.rogueEquip + Equipment.warriorEquip) + Equipment.rangerEquip);
base_armor_rating = 20;
icon_frame = 17;
grey_name = "Worn";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 2;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Bladeturner";
base_armor_rating = Math.round((base_armor_rating * 1.5));
setDamageReflection();
setEndurance();
mod_quickness = 10;
icon_frame = 70;
} else {
if (_local2 == 2){
item_name = "Distracting Blade";
base_armor_rating = Math.round((base_armor_rating * 1.5));
setBlind();
setAccuracy();
setDexterity();
mod_quickness = 5;
icon_frame = 149;
};
};
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function itemStatsString(_arg1:String):String{
var _local2:*;
_local2 = super.itemStatsString(_arg1);
return (_local2);
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
}
}
}//package
Section 206
//iPlateBoots (iPlateBoots)
package {
public class iPlateBoots extends HeavyArmor {
public function iPlateBoots(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Plate Sabatons";
icon_frame = 12;
slot = Equipment.boots;
modifyBaseArmorForSlot();
grey_name = "Battered";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 3;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Stalwart Guardian's Sabatons";
base_armor_rating = Math.round((base_armor_rating * Math.round((purple_armor_multiplier * 1.2))));
setStrength();
setEndurance();
setHealthRegen();
icon_frame = 108;
} else {
if (_local2 == 2){
item_name = "Sabatons of the Valiant Crusader";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setIntellect();
setEndurance();
setPowerRegen();
icon_frame = 107;
} else {
item_name = "Indomitable Sabatons";
base_armor_rating = Math.round(((base_armor_rating * purple_armor_multiplier) * 1.5));
setEndurance();
setResistStun(20);
setResistPoison(20);
icon_frame = 142;
};
};
}
override public function getItemModifiers():void{
super.getItemModifiers();
suffixes.push(["Discretion", 1]);
}
}
}//package
Section 207
//iPlateBreastplate (iPlateBreastplate)
package {
public class iPlateBreastplate extends HeavyArmor {
public function iPlateBreastplate(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Breastplate";
icon_frame = 11;
slot = Equipment.armor;
modifyBaseArmorForSlot();
grey_name = "Battered";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 4;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Stalwart Guardian's Breastplate";
base_armor_rating = Math.round((base_armor_rating * Math.round((purple_armor_multiplier * 1.2))));
setStrength();
setEndurance();
setHealthRegen();
icon_frame = 114;
} else {
if (_local2 == 2){
item_name = "Breastplate of the Valiant Crusader";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setIntellect();
setEndurance();
setPowerRegen();
icon_frame = 113;
} else {
if (_local2 == 3){
item_name = "Indomitable Breastplate";
base_armor_rating = Math.round(((base_armor_rating * purple_armor_multiplier) * 1.5));
setEndurance();
setResistStun(20);
setResistPoison(20);
icon_frame = 141;
} else {
item_name = "Dragon Scale Mystical Breastplate";
base_armor_rating = Math.round(((base_armor_rating * purple_armor_multiplier) * 0.8));
lore = "The mystical properties of dragon skin give you uncommon speed and protection.";
setEndurance();
setHealthRegen(5);
mod_quickness = 0;
setDamageReflection(20, 20);
creator = "jciv";
whoEquips = (whoEquips + ((rogueEquip + barbarianEquip) + rangerEquip));
icon_frame = 179;
};
};
};
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
}
}
}//package
Section 208
//iPlateGloves (iPlateGloves)
package {
public class iPlateGloves extends HeavyArmor {
public function iPlateGloves(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Plate Gauntlets";
icon_frame = 14;
slot = Equipment.gloves;
modifyBaseArmorForSlot();
grey_name = "Battered";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 4;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Stalwart Guardian's Gauntlets";
base_armor_rating = Math.round((base_armor_rating * Math.round((purple_armor_multiplier * 1.2))));
setStrength();
setEndurance();
setHealthRegen();
icon_frame = 110;
} else {
if (_local2 == 2){
item_name = "Ogrish Gauntlets";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setStrength(2, max_stat_for_purple);
setEndurance();
setStunChance(10, 20);
icon_frame = 115;
} else {
if (_local2 == 3){
item_name = "Gauntlets of the Valiant Crusader";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setIntellect();
setEndurance();
setPowerRegen();
icon_frame = 109;
} else {
item_name = "Indomitable Gauntlets";
base_armor_rating = Math.round(((base_armor_rating * purple_armor_multiplier) * 1.5));
setEndurance();
setResistStun(20);
setResistPoison(20);
icon_frame = 140;
};
};
};
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
if (prefixes[_local1][0] == "Staggering"){
setStunChance();
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
prefixes.push(["Staggering", 10]);
suffixes.push(["Accuracy", base_accuracy_bonus]);
}
}
}//package
Section 209
//iPlateGreaves (iPlateGreaves)
package {
public class iPlateGreaves extends HeavyArmor {
public function iPlateGreaves(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_level = _arg1;
item_name = "Plate Greaves";
icon_frame = 18;
slot = Equipment.legs;
modifyBaseArmorForSlot();
grey_name = "Battered";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 3;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Stalwart Guardian's Greaves";
base_armor_rating = Math.round((base_armor_rating * Math.round((purple_armor_multiplier * 1.2))));
setStrength();
setEndurance();
setHealthRegen();
icon_frame = 112;
} else {
if (_local2 == 2){
item_name = "Greaves of the Valiant Crusader";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setIntellect();
setEndurance();
setPowerRegen();
icon_frame = 111;
} else {
item_name = "Indomitable Greaves";
base_armor_rating = Math.round(((base_armor_rating * purple_armor_multiplier) * 1.5));
setEndurance();
setResistStun(20);
setResistPoison(20);
icon_frame = 139;
};
};
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
}
}
}//package
Section 210
//iPlateHelmet (iPlateHelmet)
package {
public class iPlateHelmet extends HeavyArmor {
public function iPlateHelmet(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Plate Helm";
item_level = _arg1;
slot = Equipment.head;
modifyBaseArmorForSlot();
icon_frame = 2;
grey_name = "Dented";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 3;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Stalwart Guardian's Helm";
base_armor_rating = Math.round((base_armor_rating * Math.round((purple_armor_multiplier * 1.2))));
setStrength();
setEndurance();
setHealthRegen();
icon_frame = 106;
} else {
if (_local2 == 2){
item_name = "Helm of the Valiant Crusader";
base_armor_rating = Math.round((base_armor_rating * purple_armor_multiplier));
setIntellect();
setEndurance();
setPowerRegen();
icon_frame = 105;
} else {
item_name = "Indomitable Helm";
base_armor_rating = Math.round(((base_armor_rating * purple_armor_multiplier) * 1.5));
setEndurance();
setResistStun(20);
setResistPoison(20);
icon_frame = 138;
};
};
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
}
}
}//package
Section 211
//iQuiver (iQuiver)
package {
public class iQuiver extends Armor {
public function iQuiver(_arg1:int=1, _arg2:int=-1){
type = Armor.special;
whoEquips = Equipment.rangerEquip;
base_armor_rating = 0;
materials.length = 0;
SetRarity(_arg2);
item_level = _arg1;
item_name = "Quiver";
icon_frame = 64;
slot = Equipment.back;
grey_name = "Tattered";
setQuickness(8, 15);
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 2;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Basilisk-hide Quiver";
setDexterity(2, max_stat_for_purple);
setQuickness(2, 5);
setStunChance(10, 15);
icon_frame = 65;
} else {
item_name = "Quickdraw Quiver";
setDexterity(2, max_stat_for_purple);
setQuickness(10, 15);
quickRetreat = true;
icon_frame = 144;
};
}
override public function getItemTypeString(){
return ("Quiver");
}
override public function getWorth():int{
return (Math.round((1.2 * super.getWorth())));
}
override public function getItemModifiers():void{
var _local1:*;
super.getItemModifiers();
_local1 = 0;
while (_local1 < prefixes.length) {
if (prefixes[_local1][0] == "Thick"){
prefixes.splice(_local1, 1);
break;
};
_local1++;
};
prefixes.push(["Staggering", 10]);
prefixes.push(["Unerring", base_accuracy_bonus]);
prefixes.push(["Venomous", 5]);
prefixes.push(["Blinding", 10]);
prefixes.push(["Vampiric", 10]);
suffixes.push(["Lethality", 1]);
}
}
}//package
Section 212
//iRing (iRing)
package {
public class iRing extends Jewellery {
public function iRing(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Ring";
slot = ring;
item_level = _arg1;
grey_name = "Tarnished";
whoEquips = Equipment.allEquip;
if (item_rarity == Item.orange){
return;
};
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
if (item_rarity != Item.purple){
if (materials[material] == "Gold"){
icon_frame = 20;
} else {
if (materials[material] == "Silver"){
icon_frame = 21;
} else {
if (materials[material] == "Crystalline"){
icon_frame = 22;
} else {
if (materials[material] == "Obsidian"){
icon_frame = 23;
} else {
icon_frame = 21;
};
};
};
};
};
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 3;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Nature's Band";
setHealthRegen();
setPowerRegen(3, 5);
setResistPoison(30, 40);
icon_frame = 61;
} else {
if (_local2 == 2){
item_name = "Bone Ring";
setVampiric();
setStrength();
setDexterity();
accuracyBonus = 5;
icon_frame = 62;
} else {
item_name = "Ring of Truth";
setEndurance();
setIntellect();
quickRetreat = true;
icon_frame = 143;
};
};
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function itemStatsString(_arg1:String):String{
var _local2:*;
_local2 = super.itemStatsString(_arg1);
return (_local2);
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
if (prefixes[_local1][0] == "Protective"){
base_armor_rating = prefixes[_local1][1];
return;
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
prefixes.push(["Protective", 15]);
prefixes.push(["Vampiric", 10]);
}
}
}//package
Section 213
//iShieldBuckler (iShieldBuckler)
package {
public class iShieldBuckler extends Shield {
public function iShieldBuckler(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Buckler";
slot = offhand;
item_level = _arg1;
whoEquips = (((Equipment.allEquip - Equipment.mageEquip) - Equipment.barbarianEquip) - Equipment.conjurorEquip);
base_armor_rating = 50;
mod_quickness = -10;
icon_frame = 26;
grey_name = "Worn";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 3;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Buckler of the Faded Legion";
base_armor_rating = Math.round((base_armor_rating * 1.25));
setHealthRegen(12);
setEndurance(2, max_stat_for_purple);
icon_frame = 73;
} else {
if (_local2 == 2){
item_name = "Foe-Holder";
base_armor_rating = Math.round((base_armor_rating * 1.5));
quickRetreat = true;
setEndurance();
setStunChance(10, 20);
icon_frame = 74;
} else {
item_name = "Trickster's Shield";
base_armor_rating = Math.round((base_armor_rating * 1.2));
setStunChance();
setBlind();
setDamageReflection();
icon_frame = 150;
};
};
}
override public function getWorth():int{
return (Math.round((1.1 * super.getWorth())));
}
}
}//package
Section 214
//iShieldTower (iShieldTower)
package {
public class iShieldTower extends Shield {
public function iShieldTower(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Tower Shield";
slot = offhand;
item_level = _arg1;
whoEquips = (Equipment.warriorEquip + Equipment.clericEquip);
base_armor_rating = 100;
mod_quickness = -20;
icon_frame = 28;
grey_name = "Dented";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 3;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Aegis of the Immortal Champion";
base_armor_rating = Math.round((base_armor_rating * 1.3));
setResistPoison(50, 70);
setResistStun(50, 70);
setEndurance();
icon_frame = 37;
} else {
if (_local2 == 2){
item_name = "Retribution";
base_armor_rating = Math.round((base_armor_rating * 1.2));
setDamageReflection(50, 75);
setStrength(2, max_stat_for_purple);
setLethality();
icon_frame = 60;
} else {
item_name = "Sanctified Guardian";
base_armor_rating = Math.round((base_armor_rating * 1.2));
setEndurance();
setPowerRegen();
mod_healing = (item_level * 2);
icon_frame = 151;
};
};
}
override public function itemStatsString(_arg1:String):String{
var _local2:String;
_local2 = super.itemStatsString(_arg1);
if (mod_healing){
_local2 = (_local2 + (("Increases the effect of Healing abilities by " + mod_healing) + "\n"));
};
return (_local2);
}
override public function getWorth():int{
return (Math.round((1.2 * super.getWorth())));
}
}
}//package
Section 215
//iSpear (iSpear)
package {
public class iSpear extends SteelEdgedWeapon {
public function iSpear(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Spear";
slot = weapon;
item_level = _arg1;
whoEquips = (Equipment.warriorEquip + Equipment.rangerEquip);
twoHanded = true;
icon_frame = 49;
base_damage = spear_base_damage;
mod_quickness = (mod_quickness - 10);
grey_name = "Bent";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1:*;
var _local2:*;
_local1 = 3;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Wicked Barb";
base_damage_mod = 50;
setAccuracy();
setPoisonDamage();
setLethality(5, 10);
icon_frame = 50;
} else {
if (_local2 == 2){
item_name = "Spear of the Fallen Emperor";
base_damage_mod = 40;
setHealthRegen();
setPowerRegen(4, 6);
setEndurance(2, max_stat_for_purple);
icon_frame = 51;
} else {
item_name = "Ancients' Guardpike";
base_damage_mod = 45;
setEndurance(2, max_stat_for_purple);
setDamageReflection();
setResistStun();
quickRetreat = true;
icon_frame = 152;
};
};
}
override public function itemStatsString(_arg1:String):String{
var _local2:*;
_local2 = super.itemStatsString(_arg1);
_local2 = (_local2 + "\nSpecial(Spear): May make melee attacks past allies from the back row");
return (_local2);
}
override public function getWorth():int{
return (Math.round((1.35 * super.getWorth())));
}
}
}//package
Section 216
//iStaff (iStaff)
package {
public class iStaff extends MageWeapon {
public function iStaff(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Staff";
slot = weapon;
item_level = _arg1;
whoEquips = (Equipment.mageEquip + Equipment.conjurorEquip);
twoHanded = true;
icon_frame = 66;
base_damage = staff_base_damage;
grey_name = "Warped";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 3;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Archmage's Channeling Staff";
base_damage_mod = 50;
setPowerRegen(5, 10);
setResistStun(40, 60);
icon_frame = 68;
} else {
if (_local2 == 2){
item_name = "Luminescent Staff of the Enlightened Magus";
base_damage_mod = 50;
setBlind(25, 35);
setIntellect(2, max_stat_for_purple);
icon_frame = 69;
} else {
item_name = "Staff of the Exiled Student";
base_damage_mod = 60;
setIntellect();
setEndurance();
setVampiric();
icon_frame = 153;
};
};
}
override public function getWorth():int{
return (Math.round((1.13 * super.getWorth())));
}
}
}//package
Section 217
//iSword (iSword)
package {
public class iSword extends SteelEdgedWeapon {
public function iSword(_arg1:int=1, _arg2:int=-1){
SetRarity(_arg2);
item_name = "Longsword";
slot = weapon;
item_level = _arg1;
whoEquips = (Equipment.allEquip - Equipment.clericEquip);
icon_frame = 3;
base_damage = sword_base_damage;
grey_name = "Notched";
if (item_rarity == Item.purple){
statsForPurple();
};
generateItem(_arg2);
}
protected function statsForPurple(){
var _local1 = ??pushnamespace
;
var _local2:*;
_local1 = 3;
_local2 = dmf.randomNum(1, _local1);
this.purple_num = _local2;
if (_local2 == 1){
item_name = "Death's Edge";
lore = "To even touch the blade is to risk death.";
base_damage_mod = 60;
setLethality(10, 20);
icon_frame = 45;
} else {
if (_local2 == 2){
item_name = "Mageblade";
base_damage_mod = 40;
setPowerRegen(4, 6);
setIntellect();
icon_frame = 46;
} else {
item_name = "Orcsbane";
base_damage_mod = 50;
setAccuracy();
setEndurance(2, max_stat_for_purple);
damageBonusVsCreatureType = MonsterCharacter.greenskin;
damageBonusVsCreatureModifier = 1.3;
icon_frame = 59;
};
};
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
if (prefixes[_local1][0] == "Consecrated"){
whoEquips = (whoEquips + Equipment.clericEquip);
return;
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
prefixes.push(["Consecrated", 0]);
}
}
}//package
Section 218
//Item (Item)
package {
public class Item {
public var priceModifier:int;// = 0
private var _icon_frame:int;// = 1
public var playerOwner:PlayerCharacter;
private var _lore:String;// = ""
private var _item_rarity;// = 0
private var _purple_num:int;// = 0
private var _creator:String;// = ""
private var _item_name:String;// = "Item"
private var _item_level:int;// = 1
static const green = 2;
static const white = 1;
static const orange = 5;
static const quest = 6;
static const ITEM_VALUE_INCREASE_PER_LEVEL = 20;
static const blue = 3;
static const purple = 4;
static const grey = 0;
public function Item():void{
_item_level = 1;
_item_name = "Item";
_icon_frame = 1;
_lore = "";
_item_rarity = 0;
_purple_num = 0;
priceModifier = 0;
_creator = "";
super();
}
public function get purple_num():int{
return (this._purple_num);
}
public function get item_value():int{
return (getWorth());
}
public function set purple_num(_arg1:int):void{
this._purple_num = _arg1;
}
public function set icon_frame(_arg1:int):void{
this._icon_frame = _arg1;
}
public function itemStatsString(_arg1:String):String{
return (_arg1);
}
public function getItemTypeString(){
return ("Item");
}
public function get item_rarity():int{
return (this._item_rarity);
}
public function get item_level():int{
return (this._item_level);
}
public function itemData():ItemData{
var _local1:ItemData;
_local1 = new ItemData();
_local1.item_level = this.item_level;
_local1.item_rarity = this.item_rarity;
_local1.purple_num = this.purple_num;
return (_local1);
}
public function getWorth():int{
return (99);
}
public function get icon_frame():int{
return (this._icon_frame);
}
public function set lore(_arg1:String):void{
this._lore = _arg1;
}
public function set item_name(_arg1:String):void{
this._item_name = _arg1;
}
public function get creator():String{
return (this._creator);
}
public function get lore():String{
return (this._lore);
}
public function get item_name():String{
return (this._item_name);
}
public function set creator(_arg1:String):void{
this._creator = _arg1;
}
public function set item_rarity(_arg1:int):void{
this._item_rarity = _arg1;
}
public function set item_level(_arg1:int):void{
this._item_level = _arg1;
}
public static function textColorForRarity(_arg1:int):uint{
var _local2 = ??pushnamespace
;
var _local3 = ??pushnamespace
;
var _local4 = ??pushnamespace
;
var _local5 = ??pushnamespace
;
var _local6 = ??pushnamespace
;
var _local7 = ??pushnamespace
;
var _local8 = ??pushnamespace
;
var _local9 = ??pushnamespace
;
_local2 = 0xCCCCCC;
_local3 = 0x66FF00;
_local4 = 26367;
_local5 = 0x9900FF;
_local6 = 0xCC0000;
_local7 = 0xFFFFFF;
_local8 = 0xFF6600;
_local9 = 0xFFFF00;
if (_arg1 == Item.white){
return (_local7);
};
if (_arg1 == Item.green){
return (_local3);
};
if (_arg1 == Item.blue){
return (_local4);
};
if (_arg1 == Item.purple){
return (_local5);
};
if (_arg1 == Item.orange){
return (_local8);
};
if (_arg1 == Item.quest){
return (_local9);
};
return (_local2);
}
}
}//package
Section 219
//ItemComparison (ItemComparison)
package {
import flash.display.*;
import flash.text.*;
public class ItemComparison extends MovieClip {
public var indicator:MovieClip;
public var itemName:TextField;
public function ItemComparison(_arg1:PlayerCharacter=null, _arg2:int=-1, _arg3:Equipment=null):void{
var _local4:Equipment;
var _local5:int;
var _local6:int;
super();
if ((((_arg1 == null)) || ((_arg2 == -1)))){
return;
};
_local4 = _arg1.gear[_arg2];
if (_local4 != null){
itemName.text = _local4.item_name;
itemName.textColor = Item.textColorForRarity(_local4.item_rarity);
dmf.embolden(itemName);
if (_arg1.itemUsable(_arg3)){
_local5 = _arg1.evaluateEquipment(_local4);
_local6 = _arg1.evaluateEquipment(_arg3);
if (_local5 > _local6){
indicator.gotoAndStop("worse");
} else {
if (_local6 > _local5){
indicator.gotoAndStop("better");
} else {
indicator.gotoAndStop("equal");
};
};
} else {
indicator.gotoAndStop("none");
};
} else {
itemName.text = "None";
itemName.textColor = Item.textColorForRarity(Item.grey);
dmf.embolden(itemName);
if (_arg1.itemUsable(_arg3)){
if ((((((_arg2 == Equipment.offhand)) && (!((_arg1.gear[Equipment.weapon] == null))))) && (Weapon(_arg1.gear[Equipment.weapon]).twoHanded))){
indicator.gotoAndStop("blocked");
} else {
indicator.gotoAndStop("better");
};
} else {
indicator.gotoAndStop("none");
};
};
}
}
}//package
Section 220
//ItemData (ItemData)
package {
public class ItemData {
private var _material:int;// = -1
private var _item_rarity;// = 0
private var _suffix:int;// = -1
private var _prefix:int;// = -1
private var _purple_num:int;// = 0
private var _item_level:int;// = 1
public function ItemData():void{
_item_level = 1;
_item_rarity = 0;
_material = -1;
_prefix = -1;
_suffix = -1;
_purple_num = 0;
super();
}
public function get purple_num():int{
return (this._purple_num);
}
public function set purple_num(_arg1:int):void{
this._purple_num = _arg1;
}
public function set material(_arg1:int):void{
this._material = _arg1;
}
public function get suffix():int{
return (this._suffix);
}
public function get prefix():int{
return (this._prefix);
}
public function get item_rarity():int{
return (this._item_rarity);
}
public function get item_level():int{
return (this._item_level);
}
public function set prefix(_arg1:int):void{
this._prefix = _arg1;
}
public function get material():int{
return (this._material);
}
public function set suffix(_arg1:int):void{
this._suffix = _arg1;
}
public function set item_rarity(_arg1:int):void{
this._item_rarity = _arg1;
}
public function set item_level(_arg1:int):void{
this._item_level = _arg1;
}
}
}//package
Section 221
//ItemDestroyTarget (ItemDestroyTarget)
package {
import flash.geom.*;
import flash.text.*;
import flash.events.*;
import flash.display.*;
public class ItemDestroyTarget extends MovieClip {
var tooltip:Tooltip;
function mouseOverTarget(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
var _local4:Point;
if (_arg1.buttonDown){
return;
};
if (tooltip == null){
if (!(newTooltip())){
return;
};
};
_local2 = _arg1.target.mouseX;
_local3 = _arg1.target.mouseY;
_local4 = _arg1.target.localToGlobal(new Point(_arg1.target.mouseX, _arg1.target.mouseY));
if ((_local4.x + tooltip.width) > DungeonMain.APP_WIDTH){
_local2 = (_local2 + (DungeonMain.APP_WIDTH - (_local4.x + tooltip.width)));
};
if ((_local4.y + tooltip.height) > DungeonMain.APP_HEIGHT){
_local3 = (_local3 + (DungeonMain.APP_HEIGHT - (_local4.y + tooltip.height)));
};
tooltip.x = _local2;
tooltip.y = _local3;
_arg1.updateAfterEvent();
}
private function newTooltip():Boolean{
return (true);
}
function mouseMoveTarget(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
var _local4:Point;
if (_arg1.buttonDown){
return;
};
if (tooltip == null){
if (!(newTooltip())){
return;
};
};
_local2 = _arg1.target.mouseX;
_local3 = _arg1.target.mouseY;
_local4 = _arg1.target.localToGlobal(new Point(_arg1.target.mouseX, _arg1.target.mouseY));
if ((_local4.x + tooltip.width) > DungeonMain.APP_WIDTH){
_local2 = (_local2 + (DungeonMain.APP_WIDTH - (_local4.x + tooltip.width)));
};
if ((_local4.y + tooltip.height) > DungeonMain.APP_HEIGHT){
_local3 = (_local3 + (DungeonMain.APP_HEIGHT - (_local4.y + tooltip.height)));
};
tooltip.x = _local2;
tooltip.y = _local3;
_arg1.updateAfterEvent();
}
function mouseOutTarget(_arg1:MouseEvent):void{
if (tooltip != null){
removeChild(tooltip);
tooltip = null;
};
}
}
}//package
Section 222
//ItemModeTab (ItemModeTab)
package {
import flash.text.*;
import flash.display.*;
public dynamic class ItemModeTab extends MovieClip {
public var tab_text:TextField;
}
}//package
Section 223
//ItemTooltip (ItemTooltip)
package {
import flash.text.*;
import flash.display.*;
public class ItemTooltip extends Tooltip {
public var tooltip_bg:Sprite;
public var priceLabel:TextField;
public var stats_label:TextField;
public var name_label:TextField;
public var item_ref:Item;
public var gold:Sprite;
public var level_label:TextField;
public var enchanted_label:TextField;
public var equipped_text:MovieClip;
public var specialLabel:TextField;
public var type_label:TextField;
public var usable_label:TextField;
public function ItemTooltip(_arg1:Item=null, _arg2:PlayerCharacter=null, _arg3:Boolean=false){
var _local4:*;
var _local5:String;
var _local6 = ??pushnamespace
;
var _local7 = ??pushnamespace
;
super();
if (_arg1 == null){
return;
};
if (!(_arg3)){
removeChild(equipped_text);
};
item_ref = _arg1;
name_label.autoSize = TextFieldAutoSize.CENTER;
name_label.text = Item(item_ref).item_name;
dm.embolden(name_label);
_local4 = name_label.height;
name_label.autoSize = TextFieldAutoSize.NONE;
if (_local4 == 16){
name_label.height = (_local4 + 5);
} else {
name_label.height = (_local4 + 2);
};
setTextColor();
level_label.y = ((name_label.y + name_label.height) + 2);
type_label.y = ((name_label.y + name_label.height) + 2);
if (item_ref.item_level){
level_label.text = ("Level " + String(item_ref.item_level));
} else {
if ((item_ref is Consumable)){
level_label.text = ("Stack: " + String(Consumable(item_ref).stack));
} else {
removeChild(level_label);
};
};
if (item_ref.item_rarity == Item.quest){
type_label.text = "Quest Item";
} else {
type_label.text = item_ref.getItemTypeString();
};
_local5 = "";
if (item_ref.lore != ""){
_local5 = (("\"" + item_ref.lore) + "\"\n\n");
};
_local5 = (_local5 + item_ref.itemStatsString(""));
stats_label.text = _local5;
stats_label.autoSize = TextFieldAutoSize.CENTER;
stats_label.y = ((type_label.y + type_label.height) + 8);
if ((((item_ref is Equipment)) && (Equipment(item_ref).enchantmentType))){
enchanted_label.text = ("Enchanted: " + Enchantment.nameForEnchantment(Equipment(item_ref).enchantmentType));
enchanted_label.y = ((stats_label.y + stats_label.height) + 8);
usable_label.y = ((enchanted_label.y + enchanted_label.height) + 8);
} else {
removeChild(enchanted_label);
usable_label.y = ((stats_label.y + stats_label.height) + 8);
};
if ((item_ref is Equipment)){
usable_label.text = Equipment(item_ref).usableString();
} else {
usable_label.text = "";
};
usable_label.autoSize = TextFieldAutoSize.CENTER;
_local6 = 0xCC0000;
_local7 = 0xFFFFFF;
if (_arg2 != null){
if (_arg2.itemUsable(item_ref)){
usable_label.textColor = _local7;
} else {
usable_label.textColor = _local6;
};
};
priceLabel.text = String(item_ref.getWorth());
priceLabel.autoSize = TextFieldAutoSize.RIGHT;
priceLabel.y = ((usable_label.y + usable_label.height) + 2);
gold.x = (priceLabel.x - 12);
gold.y = (priceLabel.y + 4);
specialLabel.y = priceLabel.y;
if (item_ref.creator.length){
specialLabel.text = ("by " + item_ref.creator);
} else {
specialLabel.text = "";
};
tooltip_bg.height = ((priceLabel.y + priceLabel.height) + 4);
}
public function setTextColor(){
name_label.textColor = Item.textColorForRarity(item_ref.item_rarity);
}
override public function get realHeight():int{
return (this.tooltip_bg.height);
}
override public function get realWidth():int{
return (this.tooltip_bg.width);
}
}
}//package
Section 224
//ItemTooltipController (ItemTooltipController)
package {
import flash.events.*;
public class ItemTooltipController {
private var tooltip:ItemTooltip;
private var c_tooltip:ItemTooltip;
private var char_ref:PlayerCharacter;
public function ItemTooltipController():void{
}
public function destroyTooltip():void{
if (tooltip != null){
tooltip.fade();
};
if (c_tooltip != null){
c_tooltip.fade();
};
tooltip = null;
c_tooltip = null;
}
public function showTooltip(_arg1:MouseEvent, _arg2:Item):void{
if (_arg1 == null){
return;
};
if (_arg1.buttonDown){
destroyTooltip();
return;
};
if (_arg2 == null){
return;
};
if (tooltip != null){
if (tooltip.item_ref != _arg2){
destroyTooltip();
} else {
return;
};
};
if (((!((char_ref == null))) && ((_arg2 is Equipment)))){
if (((((!((char_ref.gear[Equipment(_arg2).slot] == null))) && (!((char_ref.gear[Equipment(_arg2).slot] == _arg2))))) && (char_ref.itemUsable(_arg2)))){
c_tooltip = new ItemTooltip(char_ref.gear[Equipment(_arg2).slot], char_ref, true);
c_tooltip.mouseEnabled = false;
c_tooltip.mouseChildren = false;
c_tooltip.name = "c_tooltip";
if (dm.stage != null){
dm.stage.addChild(c_tooltip);
};
};
};
tooltip = new ItemTooltip(_arg2, char_ref, false);
tooltip.mouseEnabled = false;
tooltip.mouseChildren = false;
tooltip.name = "tooltip";
if (dm.stage != null){
dm.stage.addChild(tooltip);
};
updatePositionFromEvent(_arg1);
}
public function setChar(_arg1:PlayerCharacter){
this.char_ref = _arg1;
}
public function enableDoubleClick(_arg1:InventoryIcon, _arg2:Function):void{
if (tooltip == null){
return;
};
tooltip.doubleClickEnabled = true;
tooltip.addEventListener(MouseEvent.DOUBLE_CLICK, _arg2, false, 0, true);
}
public function updatePositionFromEvent(_arg1:MouseEvent):void{
var _local2:int;
if (tooltip != null){
tooltip.setForEvent(_arg1);
if (c_tooltip != null){
c_tooltip.x = tooltip.x;
c_tooltip.y = ((tooltip.y - c_tooltip.realHeight) - 2);
if (c_tooltip.y < 0){
_local2 = Math.abs(c_tooltip.y);
c_tooltip.y = (c_tooltip.y + _local2);
tooltip.y = (tooltip.y + _local2);
};
};
};
}
public function removeTooltip(_arg1:MouseEvent, _arg2:Item){
if (((!((tooltip == null))) && ((tooltip.item_ref == _arg2)))){
destroyTooltip();
};
}
}
}//package
Section 225
//Jewellery (Jewellery)
package {
public class Jewellery extends Equipment {
public function Jewellery(){
whoEquips = Equipment.allEquip;
grey_name = "Tarnished";
materials.push("Silver", "Gold", "Platinum", "Obsidian", "Crystalline");
base_armor_rating = 0;
grey_chance = 0;
white_chance = 0;
green_chance = 70;
blue_chance = 29;
purple_chance = 1;
}
override public function generateItem(_arg1:int):void{
var _local2:*;
var _local3:*;
_local2 = false;
_local3 = false;
item_rarity = Math.max(Item.green, item_rarity);
if (item_rarity == Item.green){
if (dmf.randomNum(0, 100) >= 50){
_local3 = true;
} else {
_local2 = true;
};
};
getItemModifiers();
if ((((item_rarity == Item.blue)) || (_local3))){
prefix = rollForPrefix(item_rarity);
};
if ((((item_rarity == Item.blue)) || (_local2))){
suffix = rollForSuffix(item_rarity);
};
if (prefix >= 0){
applyPrefix();
};
if (suffix >= 0){
applySuffix();
};
if (base_armor_rating){
armor_rating = scaleArmorForLevel((base_armor_rating * (1 + (base_armor_mod / 100))));
};
if (((materials.length) && ((item_rarity < Item.purple)))){
material = rollForMaterial(item_rarity, materials);
} else {
material = -1;
};
if (material >= 0){
item_name = ((materials[material] + " ") + item_name);
};
if (prefix >= 0){
item_name = ((prefixes[prefix][0] + " ") + item_name);
};
if (suffix >= 0){
item_name = ((item_name + " of ") + suffixes[suffix][0]);
};
if (item_rarity == Item.grey){
item_name = ((grey_name + " ") + item_name);
};
}
override public function getItemTypeString(){
return ("Jewellery");
}
override public function itemStatsString(_arg1:String):String{
if (armor_rating){
_arg1 = (String(armor_rating) + " Armor Rating\n");
};
return (super.itemStatsString(_arg1));
}
override public function getItemModifiers():void{
super.getItemModifiers();
suffixes.push(["Might", base_item_stat_bonus]);
suffixes.push(["Deftness", base_item_stat_bonus]);
}
}
}//package
Section 226
//lethal_effect (lethal_effect)
package {
import flash.display.*;
public dynamic class lethal_effect extends MovieClip {
public function lethal_effect(){
addFrameScript(44, frame45);
}
function frame45(){
this.stop();
}
}
}//package
Section 227
//LevelUpGlow (LevelUpGlow)
package {
import flash.display.*;
public dynamic class LevelUpGlow extends MovieClip {
}
}//package
Section 228
//LightArmor (LightArmor)
package {
public class LightArmor extends Armor {
public function LightArmor(){
type = Armor.light;
mod_quickness = (mod_quickness - 0);
whoEquips = Equipment.allEquip;
base_armor_rating = 4;
grey_name = "Threadbare";
materials.push("Linen", "Wool", "Velvet", "Silk", "Suncloth", "Aetherweave");
}
override public function getItemTypeString(){
return ("Light Armor");
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function itemStatsString(_arg1:String):String{
return (super.itemStatsString(_arg1));
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
}
}
}//package
Section 229
//LightGreenBar (LightGreenBar)
package {
import flash.display.*;
public dynamic class LightGreenBar extends Sprite {
}
}//package
Section 230
//Lightning (Lightning)
package {
import flash.display.*;
public dynamic class Lightning extends MovieClip {
public var flash:LightningFlash;
public function Lightning(){
addFrameScript(0, frame1);
}
function frame1(){
dm.sound.play(SoundControl.lightning);
}
}
}//package
Section 231
//lightning_sound (lightning_sound)
package {
import flash.media.*;
public dynamic class lightning_sound extends Sound {
}
}//package
Section 232
//LightningFlash (LightningFlash)
package {
import flash.display.*;
public dynamic class LightningFlash extends MovieClip {
public var lightning:RandomLightning;
public function LightningFlash(){
addFrameScript(3, frame4);
}
function frame4(){
this.stop();
}
}
}//package
Section 233
//Links (Links)
package {
public class Links {
public static const KONG_HOME:String = "http://www.kongregate.com/?gamereferral=monstersden";
public static const KONG_GAME:String = "http://www.kongregate.com/games/garin/monsters-den-book-of-dread/?gamereferral=monstersden";
public static const ARMORGAMES:String = "http://www.armorgames.com";
}
}//package
Section 234
//LoaderClass (LoaderClass)
package {
import CPMStar.*;
import flash.events.*;
import flash.system.*;
import flash.external.*;
import flash.net.*;
import flash.display.*;
import flash.text.*;
public class LoaderClass extends MovieClip {
public var bar:MovieClip;
public var clickPlayButton:SimpleButton;
var loading:Boolean;// = false
public var total_label:TextField;
public var errorText:TextField;
public var kongIntro:MovieClip;
public var armorIntro:MovieClip;
public var dungeonMain:MovieClip;
public var loaded_label:TextField;
public var adBox:MovieClip;
public var onKong:MovieClip;
static const SITELOCKED:Boolean = false;
static const SITELOCK_URL:String = "www.biclopsgames.com";
public function LoaderClass(){
loading = false;
super();
addFrameScript(0, frame1, 3, frame4, 4, frame5, 5, frame6);
onKong.biclopsLogo.addEventListener(MouseEvent.CLICK, biclopsClick);
onKong.kongLogo.addEventListener(MouseEvent.CLICK, kongClick);
stage.showDefaultContextMenu = false;
this.gotoAndStop(1);
onKong.gotoAndStop(1);
removeChild(clickPlayButton);
if (((SITELOCKED) && (!(hostUrlContains(SITELOCK_URL))))){
removeChild(loaded_label);
removeChild(total_label);
removeChild(bar);
errorText.text = ("Sorry, this version of the game will only run on " + SITELOCK_URL);
errorText.textColor = 0xFFFFFF;
} else {
loading = true;
addEventListener(Event.ENTER_FRAME, enterLoaderFrame);
if (hostUrlContains("kongregate.com")){
removeChild(adBox);
} else {
if (hostUrlContains("andkon.com")){
onKong.gotoAndStop(2);
removeChild(adBox);
} else {
onKong.x = -86;
onKong.y = 53;
if (hostUrlContains("armorgames.com")){
onKong.removeChild(onKong.sponsoredText);
onKong.removeChild(onKong.kongLogo);
onKong.y = -62;
};
initializeAds();
clickPlayButton.addEventListener(MouseEvent.MOUSE_DOWN, playClick);
};
};
};
}
private function initializeAds():void{
var _local1:int;
var _local2:int;
var _local3:DisplayObject;
if (hostUrlContains("armorgames.com")){
_local1 = 1052;
_local2 = 15;
} else {
_local1 = 1429;
_local2 = 501;
};
if (Security.sandboxType != "localWithFile"){
_local3 = AdLoader.LoadAd(_local1, _local2);
adBox.addChild(_local3);
};
}
function enterLoaderFrame(_arg1:Event):void{
if (loading){
updateText(_arg1);
} else {
if (hostUrlContains("kongregate.com")){
playClick(null);
} else {
if (hostUrlContains("andkon.com")){
playClick(null);
} else {
addChild(clickPlayButton);
};
};
};
}
private function debugSandbox():void{
errorText.text = String(Security.sandboxType);
}
function frame6(){
this.stop();
}
function kongClick(_arg1:MouseEvent):void{
var url:String;
var e = _arg1;
url = Links.KONG_HOME;
try {
ExternalInterface.call("window.open", url, "_blank", "");
} catch(error) {
navigateToURL(new URLRequest(url), "_blank");
};
}
function frame4(){
kongIntro.addEventListener(MouseEvent.CLICK, kongClick);
}
function frame5(){
armorIntro.addEventListener(MouseEvent.CLICK, armorClick);
}
function armorClick(_arg1:MouseEvent):void{
var url:String;
var e = _arg1;
url = Links.ARMORGAMES;
try {
ExternalInterface.call("window.open", url, "_blank", "");
} catch(error) {
navigateToURL(new URLRequest(url), "_blank");
};
}
function frame1(){
this.gotoAndStop(1);
}
private function playClick(_arg1:MouseEvent):void{
clickPlayButton.removeEventListener(MouseEvent.MOUSE_DOWN, playClick);
if (contains(adBox)){
removeChild(adBox);
};
if (contains(clickPlayButton)){
removeChild(clickPlayButton);
};
removeEventListener(Event.ENTER_FRAME, enterLoaderFrame);
if (onKong.kongLogo != null){
onKong.kongLogo.removeEventListener(MouseEvent.CLICK, kongClick);
};
onKong.biclopsLogo.removeEventListener(MouseEvent.CLICK, biclopsClick);
this.gotoAndStop(3);
if (hostUrlContains("kongregate.com")){
this.gotoAndStop(6);
} else {
if (hostUrlContains("andkon.com")){
this.gotoAndStop(6);
} else {
if (hostUrlContains("armorgames.com")){
this.gotoAndStop(5);
} else {
this.gotoAndStop(4);
};
};
};
}
private function updateText(_arg1:Event):void{
var _local2:*;
var _local3:*;
_local2 = stage.loaderInfo.bytesTotal;
_local3 = stage.loaderInfo.bytesLoaded;
loaded_label.text = (String(Math.round((_local3 / 0x0400))) + "kB");
total_label.text = (String(Math.round((_local2 / 0x0400))) + "kB");
bar.width = Math.round(((_local3 / _local2) * 550));
if (_local3 >= _local2){
loading = false;
};
}
private function hostUrlContains(_arg1:String):Boolean{
if (stage.loaderInfo.loaderURL.indexOf(_arg1) != -1){
return (true);
};
return (false);
}
function biclopsClick(_arg1:MouseEvent):void{
var url:String;
var e = _arg1;
url = "http://www.biclopsgames.com";
try {
ExternalInterface.call("window.open", url, "_blank", "");
} catch(error) {
navigateToURL(new URLRequest(url), "_blank");
};
}
}
}//package
Section 235
//LoadParty (LoadParty)
package {
import flash.events.*;
import flash.net.*;
import flash.text.*;
import flash.display.*;
public class LoadParty extends MovieClip {
public var party1:SaveGameStatusContainer;
public var party3:SaveGameStatusContainer;
public var party2:SaveGameStatusContainer;
public var highestRatingField:TextField;
public var highestWaveField:TextField;
public var optionsButton:OptionsBookButton;
public var highestLevelField:TextField;
public function LoadParty():void{
DungeonMain.registerAliases();
party1.slot = 1;
party2.slot = 2;
party3.slot = 3;
loadSlot(1);
loadSlot(2);
loadSlot(3);
if (DungeonMain.highScore < party1.score){
DungeonMain.highScore = party1.score;
};
if (DungeonMain.highScore < party2.score){
DungeonMain.highScore = party2.score;
};
if (DungeonMain.highScore < party3.score){
DungeonMain.highScore = party3.score;
};
if (DungeonMain.highLevel < party1.level){
DungeonMain.highLevel = party1.level;
};
if (DungeonMain.highLevel < party2.level){
DungeonMain.highLevel = party2.level;
};
if (DungeonMain.highLevel < party3.level){
DungeonMain.highLevel = party3.level;
};
highestRatingField.text = String(DungeonMain.highScore);
highestLevelField.text = String(DungeonMain.highLevel);
highestWaveField.text = String(DungeonMain.bestSurvival);
addEventListener(Event.ADDED_TO_STAGE, added);
}
function added(_arg1:Event):void{
var _local2 = ??pushnamespace
;
var _local3:*;
removeEventListener(Event.ADDED_TO_STAGE, added);
_local2 = 128;
if (((DungeonMain.showHints) && (!(Dungeon.hintShown(_local2))))){
_local3 = new HintDialog("Saving", "Monsters' Den saves your progress automatically. You may quit at any time, and return to continue playing your game later.", true, true);
DungeonMain.hints = (DungeonMain.hints + _local2);
stage.addChild(_local3);
dm.main.saveInterface();
};
}
private function loadSlot(_arg1:int):void{
var _local2:SharedObject;
var _local3:SaveGameStatusContainer;
var _local4:Party;
var _local5:SharedObject;
if ((((_arg1 < 1)) || ((_arg1 > 3)))){
return;
};
_local3 = SaveGameStatusContainer(getChildByName(("party" + _arg1)));
_local2 = SharedObject.getLocal((("slot" + _arg1) + "_party"));
if (_local2.size > 0){
_local4 = Party(_local2.data.pc_party);
if (_local4 == null){
_local3.emptySlot();
return;
};
_local5 = SharedObject.getLocal((("slot" + _arg1) + "_chars"));
if (_local5.size > 0){
if (_local5.data.char1 != null){
_local4.members[0] = _local5.data.char1;
};
if (_local5.data.char2 != null){
_local4.members[1] = _local5.data.char2;
};
if (_local5.data.char3 != null){
_local4.members[2] = _local5.data.char3;
};
if (_local5.data.char4 != null){
_local4.members[3] = _local5.data.char4;
};
};
if (_local3 != null){
_local3.setParty(_local4, _local2.data.battle);
};
} else {
_local3.emptySlot();
};
}
public function deleteSlot(_arg1:int):void{
var _local2:SaveGameStatusContainer;
if ((((_arg1 < 1)) || ((_arg1 >= 4)))){
return;
};
DungeonMain.deleteSave(_arg1);
_local2 = SaveGameStatusContainer(getChildByName(("party" + _arg1)));
if (_local2 != null){
_local2.emptySlot();
};
}
public function menuClick(_arg1:MouseEvent):void{
if (root != null){
dm.main.mainMenu();
cleanup();
dm.main.removeChild(this);
};
}
public function cleanup():void{
party1.cleanup();
party2.cleanup();
party3.cleanup();
optionsButton.cleanup();
}
public function newGame(_arg1:int):void{
dm.main.startGame(_arg1);
cleanup();
}
}
}//package
Section 236
//LootSettings (LootSettings)
package {
import flash.events.*;
import flash.display.*;
public class LootSettings extends Sprite {
public var checkWhite:dCheckBox;
public var checkGrey:dCheckBox;
public var checkConsumables:dCheckBox;
public var checkEnchantments:dCheckBox;
public var returnButton:MovieClip;
public var checkBlue:dCheckBox;
public var checkMediumArmor:dCheckBox;
public var checkGreen:dCheckBox;
public var checkHeavyArmor:dCheckBox;
public var checkPurple:dCheckBox;
public var checkLightArmor:dCheckBox;
static const GREEN = 4;
static const HEAVY = 128;
static const WHITE = 2;
static const ENCHANTMENTS = 0x0200;
static const CONSUMABLES = 0x0100;
static const MEDIUM = 64;
static const LIGHT = 32;
static const BLUE = 8;
static const PURPLE = 16;
static const GREY = 1;
public function LootSettings():void{
checkGrey.setDescription("'Damaged'", true, Item.textColorForRarity(Item.grey));
checkWhite.setDescription("'Common'", true, Item.textColorForRarity(Item.white));
checkGreen.setDescription("'Magical'", true, Item.textColorForRarity(Item.green));
checkBlue.setDescription("'Rare'", true, Item.textColorForRarity(Item.blue));
checkPurple.setDescription("'Unique'", true, Item.textColorForRarity(Item.purple));
checkLightArmor.setDescription("Light Armor");
checkMediumArmor.setDescription("Medium Armor");
checkHeavyArmor.setDescription("Heavy Armor");
checkEnchantments.setDescription("Enchantments");
checkConsumables.setDescription("Consumables");
initValues();
returnButton.addEventListener(MouseEvent.MOUSE_DOWN, returnClick);
}
private function returnClick(_arg1:MouseEvent):void{
updateValues();
cleanup();
dm.main.saveParty();
if (parent != null){
if ((parent is TreasureReport)){
TreasureReport(parent).updateSettings();
};
parent.removeChild(this);
};
}
private function updateValues():void{
var _local1:uint;
_local1 = 0;
if (checkGrey.checked){
_local1 = (_local1 + GREY);
};
if (checkWhite.checked){
_local1 = (_local1 + WHITE);
};
if (checkGreen.checked){
_local1 = (_local1 + GREEN);
};
if (checkBlue.checked){
_local1 = (_local1 + BLUE);
};
if (checkPurple.checked){
_local1 = (_local1 + PURPLE);
};
if (checkLightArmor.checked){
_local1 = (_local1 + LIGHT);
};
if (checkMediumArmor.checked){
_local1 = (_local1 + MEDIUM);
};
if (checkHeavyArmor.checked){
_local1 = (_local1 + HEAVY);
};
if (checkConsumables.checked){
_local1 = (_local1 + CONSUMABLES);
};
if (checkEnchantments.checked){
_local1 = (_local1 + ENCHANTMENTS);
};
if (dm.party != null){
dm.party.lootSettings = _local1;
};
}
private function initValues():void{
var _local1:uint;
_local1 = 0;
if (dm.party != null){
_local1 = dm.party.lootSettings;
};
if ((_local1 & GREY) == GREY){
checkGrey.setChecked(true);
} else {
checkGrey.setChecked(false);
};
if ((_local1 & WHITE) == WHITE){
checkWhite.setChecked(true);
} else {
checkWhite.setChecked(false);
};
if ((_local1 & GREEN) == GREEN){
checkGreen.setChecked(true);
} else {
checkGreen.setChecked(false);
};
if ((_local1 & BLUE) == BLUE){
checkBlue.setChecked(true);
} else {
checkBlue.setChecked(false);
};
if ((_local1 & PURPLE) == PURPLE){
checkPurple.setChecked(true);
} else {
checkPurple.setChecked(false);
};
if ((_local1 & LIGHT) == LIGHT){
checkLightArmor.setChecked(true);
} else {
checkLightArmor.setChecked(false);
};
if ((_local1 & MEDIUM) == MEDIUM){
checkMediumArmor.setChecked(true);
} else {
checkMediumArmor.setChecked(false);
};
if ((_local1 & HEAVY) == HEAVY){
checkHeavyArmor.setChecked(true);
} else {
checkHeavyArmor.setChecked(false);
};
if ((_local1 & CONSUMABLES) == CONSUMABLES){
checkConsumables.setChecked(true);
} else {
checkConsumables.setChecked(false);
};
if ((_local1 & ENCHANTMENTS) == ENCHANTMENTS){
checkEnchantments.setChecked(true);
} else {
checkEnchantments.setChecked(false);
};
}
public function cleanup():void{
returnButton.removeEventListener(MouseEvent.MOUSE_DOWN, returnClick);
}
public static function defaultValues():uint{
return ((((((((((GREY + WHITE) + GREEN) + BLUE) + PURPLE) + LIGHT) + MEDIUM) + HEAVY) + CONSUMABLES) + ENCHANTMENTS));
}
}
}//package
Section 237
//lose_power_effect (lose_power_effect)
package {
import flash.display.*;
public dynamic class lose_power_effect extends MovieClip {
}
}//package
Section 238
//mAetherguard (mAetherguard)
package {
public class mAetherguard extends MonsterCharacter {
public function mAetherguard(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.special;
classname = "Planar Entity";
ethereal = 20;
charname = "Aetherguard";
portrait = CharGraphic.aetherguard;
mindless = true;
description = "Slightly resistant to physical damage.";
quickness = 50;
health_max = Math.round((health_max * 1.2));
health = health_max;
damage = Math.round((damage * 1.4));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sAetherLightning(this));
}
}
}//package
Section 239
//mage_staff_sound (mage_staff_sound)
package {
import flash.media.*;
public dynamic class mage_staff_sound extends Sound {
}
}//package
Section 240
//MageWeapon (MageWeapon)
package {
public class MageWeapon extends Weapon {
public function MageWeapon(){
materials.push("Elm", "Oak", "Ash", "Yew", "Voidwood", "Planespine");
whoEquips = (Equipment.mageEquip + Equipment.conjurorEquip);
}
override public function getItemTypeString(){
return ("Mage Weapon");
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function itemStatsString(_arg1:String):String{
return (super.itemStatsString(_arg1));
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
}
}
}//package
Section 241
//mArachnoid (mArachnoid)
package {
public class mArachnoid extends MonsterCharacter {
public function mArachnoid(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.creature;
charname = "Arachnoid";
classname = "Deep Creature";
portrait = CharGraphic.arachnoid;
mindless = true;
description = "Twisted fusion of man and spider. Tangles its enemies in webbing.";
poisonResist = 25;
quickness = 45;
damage_resistance = 0;
regenerate = 0;
health_max = Math.round((health_max * 1));
health = health_max;
damage = Math.round((damage * 1));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sArachnoidWeb(this));
}
}
}//package
Section 242
//mAscendant (mAscendant)
package {
public class mAscendant extends MonsterCharacter {
public function mAscendant(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.special;
power_per_turn = Math.round((power_per_turn * 1.5));
regenerate = 10;
charname = Horde.getBeholderName();
classname = "Ascended Human";
portrait = CharGraphic.ascendant;
mindless = false;
description = "Cult Leader. Defensive spellcaster. Regenerates.";
accuracy = 150;
damage_resistance = 0;
poisonResist = 75;
stunResist = 75;
quickness = 50;
lethalityImmune = true;
damage = Math.round((damage * 1.2));
health_max = Math.round((health_max * 1.45));
if (((!((dm.party == null))) && (dm.party.extreme))){
health_max = (health_max * MonsterCharacter.EXTREME_HEALTH_MOD);
};
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sAscendantRanged(this));
skills.push(new sCelestialArmor(this));
skills.push(new sCelestialSpeed(this));
skills.push(new sCelestialAccuracy(this));
}
}
}//package
Section 243
//mBasilisk (mBasilisk)
package {
public class mBasilisk extends MonsterCharacter {
public function mBasilisk(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.creature;
classname = "Deep Creature";
charname = "Basilisk";
portrait = CharGraphic.basilisk;
mindless = true;
description = "Stuns with attacks.";
quickness = 30;
damage_resistance = 0;
causes_stun_percent = 30;
regenerate = 0;
health_max = Math.round((health_max * 1));
health = health_max;
damage = Math.round((damage * 0.8));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttack(this));
skills.push(new sBasiliskPetrify(this));
}
}
}//package
Section 244
//mBeholder (mBeholder)
package {
public class mBeholder extends MonsterCharacter {
public function mBeholder(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.creature;
charname = Horde.getBeholderName();
classname = "Beholder";
portrait = CharGraphic.beholder;
mindless = false;
description = "Deep Creature Leader. Powerful spellcaster. Ignores armor.";
accuracy = 150;
damage_resistance = 0;
poisonResist = 30;
stunResist = 50;
quickness = 40;
lethalityImmune = true;
damage = Math.round((damage * 1.5));
health_max = Math.round((health_max * 1.25));
if (((!((dm.party == null))) && (dm.party.extreme))){
health_max = (health_max * MonsterCharacter.EXTREME_HEALTH_MOD);
};
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sBeholderRanged(this));
skills.push(new sBeholderDrain(this));
skills.push(new sBeholderRecover(this));
}
}
}//package
Section 245
//mBoneHorror (mBoneHorror)
package {
public class mBoneHorror extends MonsterCharacter {
public function mBoneHorror(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.undead;
classname = "Undead";
poisonResist = 50;
charname = "Bone Horror";
portrait = CharGraphic.bone_horror;
mindless = true;
description = "Undead. Lumbering, jagged monstrosity of bone. Reflects damage.";
damage_reflection = 10;
quickness = 20;
health_max = Math.round((health_max * 1.3));
health = health_max;
damage = Math.round((damage * 1.4));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttack(this));
}
}
}//package
Section 246
//mCultArcher (mCultArcher)
package {
public class mCultArcher extends MonsterCharacter {
public function mCultArcher(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.human;
classname = "Human";
power_per_turn = Math.round((power_per_turn * 1.5));
charname = "Protector";
portrait = CharGraphic.cult_archer;
mindless = true;
description = "Armored. Ranged attack.";
quickness = 60;
damage_resistance = 20;
health_max = Math.round((health_max * 0.9));
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterRangedAttack(this));
skills.push(new sCultistArrow(this));
}
}
}//package
Section 247
//mCultChosen (mCultChosen)
package {
public class mCultChosen extends MonsterCharacter {
public function mCultChosen(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.human;
classname = "Human";
power_per_turn = Math.round((power_per_turn * 1.5));
charname = "Chosen";
portrait = CharGraphic.cult_chosen;
mindless = true;
description = "Armored. Warrior/Spellcaster.";
quickness = 40;
damage_resistance = 20;
health_max = Math.round((health_max * 1));
health = health_max;
damage = Math.round((damage * 1.2));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sCultistMeleeStun(this));
skills.push(new sCultistSever(this));
}
}
}//package
Section 248
//mCultEngine (mCultEngine)
package {
public class mCultEngine extends MonsterCharacter {
public function mCultEngine(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.special;
power_per_turn = Math.round((power_per_turn * 1.5));
charname = Horde.getEngineName();
classname = "Nexus Engine";
portrait = CharGraphic.cult_engine;
mindless = false;
description = "Sacred Icon. Gathers and stores planar energy.";
accuracy = 120;
damage_resistance = 35;
poisonResist = 100;
stunResist = 100;
quickness = 10;
lethalityImmune = true;
damage = Math.round((damage * 1.55));
health_max = Math.round((health_max * 1.3));
if (((!((dm.party == null))) && (dm.party.extreme))){
health_max = (health_max * MonsterCharacter.EXTREME_HEALTH_MOD);
};
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sMonsterMeleeAE(this));
skills.push(new sEngineConduit(this));
skills.push(new sVoidCannon(this));
}
}
}//package
Section 249
//mCultNeophyte (mCultNeophyte)
package {
public class mCultNeophyte extends MonsterCharacter {
public function mCultNeophyte(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.human;
classname = "Human";
power_per_turn = Math.round((power_per_turn * 1.5));
charname = "Neophyte";
portrait = CharGraphic.cult_neophyte;
mindless = false;
description = "Sacrifice themselves to summon more powerful allies.";
quickness = 35;
health_max = Math.round((health_max * 0.8));
health = health_max;
damage = Math.round((damage * 1));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sTransformAetherguard(this));
}
}
}//package
Section 250
//mCultPriest (mCultPriest)
package {
public class mCultPriest extends MonsterCharacter {
public function mCultPriest(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.human;
classname = "Human";
power_per_turn = Math.round((power_per_turn * 1.5));
charname = "Acolyte";
portrait = CharGraphic.cult_priest;
mindless = false;
description = "Spellcaster. Summons planar entities.";
quickness = 35;
health_max = Math.round((health_max * 0.8));
health = health_max;
damage = Math.round((damage * 0.8));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterMagicAttack(this));
skills.push(new sCultistHeal(this));
skills.push(new sSummonVoidstalker(this));
}
}
}//package
Section 251
//mCultWarrior (mCultWarrior)
package {
public class mCultWarrior extends MonsterCharacter {
public function mCultWarrior(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.human;
classname = "Human";
power_per_turn = Math.round((power_per_turn * 1.5));
charname = "Guardian";
portrait = CharGraphic.cult_warrior;
mindless = true;
description = "Armored.";
quickness = 45;
damage_resistance = 20;
health_max = Math.round((health_max * 0.9));
health = health_max;
damage = Math.round((damage * 0.9));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sCultistMeleeStun(this));
}
}
}//package
Section 252
//mDeathKnight (mDeathKnight)
package {
public class mDeathKnight extends MonsterCharacter {
public function mDeathKnight(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.undead;
poisonResist = 50;
charname = Horde.getKnightName();
classname = "Fallen Knight";
portrait = CharGraphic.death_knight;
mindless = false;
description = "Undead Leader. Powerful warrior.";
accuracy = 140;
damage_resistance = 30;
poisonResist = 50;
stunResist = 75;
quickness = 40;
lethalityImmune = true;
damage = Math.round((damage * 1.5));
health_max = Math.round((health_max * 1.3));
if (((!((dm.party == null))) && (dm.party.extreme))){
health_max = (health_max * MonsterCharacter.EXTREME_HEALTH_MOD);
};
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sMonsterMeleeAE(this));
skills.push(new sDeathKnightRally(this));
}
}
}//package
Section 253
//mDemon (mDemon)
package {
public class mDemon extends MonsterCharacter {
public function mDemon(_arg1:int=1){
super(_arg1);
charname = "The Corruptor";
classname = "Demon";
type = MonsterCharacter.special;
portrait = CharGraphic.demon;
mindless = false;
description = "Dungeon Lord. Source of the danger to this world.";
accuracy = 140;
damage_resistance = 20;
poisonResist = 50;
stunResist = 75;
power_per_turn = 20;
quickness = 50;
lethalityImmune = true;
damage = Math.round((damage * 1.5));
health_max = Math.round((health_max * 3));
if (((!((dm.party == null))) && (dm.party.extreme))){
health_max = (health_max * MonsterCharacter.EXTREME_HEALTH_MOD);
};
health = health_max;
initSkills();
}
override public function getUniqueItems(_arg1:int):Array{
var _local2:Equipment;
var _local3:Array;
_local3 = new Array();
_local2 = new iRing(level, Item.orange);
_local2.item_name = "Signet of the Demonslayer";
_local2.lore = "Presented to honor those who freed the world from the demon's tyranny.";
_local2.replenishing = 20;
_local2.powerRegen = 5;
_local2.resistPoison = 50;
_local2.resistStun = 50;
_local2.icon_frame = 116;
_local3.push(_local2);
_local2 = new iCloak(level, Item.orange);
_local2.item_name = "Demonhide Cloak";
_local2.lore = "Fashioned from the skin of the demon itself.";
_local2.lethality = 4;
_local2.armor_rating = _local2.scaleArmorForLevel(20);
_local2.setStrength(3, 5);
_local2.setEndurance(3, 5);
_local2.setIntellect(3, 5);
_local2.setDexterity(3, 5);
_local2.icon_frame = 117;
_local3.push(_local2);
return (_local3);
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttack(this));
skills.push(new sDemonDoubleAttack(this));
skills.push(new sDemonPoison(this));
skills.push(new sDemonClone(this));
}
}
}//package
Section 254
//mDragon (mDragon)
package {
public class mDragon extends MonsterCharacter {
public function mDragon(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.creature;
classname = "Dragon";
charname = Horde.getDragonName();
portrait = CharGraphic.dragon;
mindless = false;
description = "Deep Creature Leader. Attacks multiple enemies.";
accuracy = 140;
damage_resistance = 20;
poisonResist = 0;
stunResist = 75;
quickness = 25;
lethalityImmune = true;
damage = Math.round((damage * 1.5));
health_max = Math.round((health_max * 1.6));
if (((!((dm.party == null))) && (dm.party.extreme))){
health_max = (health_max * MonsterCharacter.EXTREME_HEALTH_MOD);
};
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttack(this));
skills.push(new sDragonFlame(this));
skills.push(new sDragonTail(this));
}
}
}//package
Section 255
//mDreadfather (mDreadfather)
package {
public class mDreadfather extends MonsterCharacter {
public function mDreadfather(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.special;
classname = "Demon";
poisonResist = 75;
stunResist = 90;
charname = "Dreadfather";
portrait = CharGraphic.dreadfather;
mindless = false;
description = "Lord of Terror.";
lethalityImmune = true;
power_per_turn = 25;
accuracy = 135;
quickness = 55;
health_max = Math.round((health_max * 3.5));
health = health_max;
if (((!((dm.party == null))) && (dm.party.extreme))){
health_max = (health_max * MonsterCharacter.EXTREME_HEALTH_MOD);
};
damage = Math.round((damage * 1));
initSkills();
}
override public function getUniqueItems(_arg1:int):Array{
var _local2:Equipment;
var _local3:Number;
var _local4:Array;
_local3 = (_arg1 / DungeonMain.MAX_LEVEL);
_local4 = new Array();
_local2 = new iClothHat(level, Item.orange);
_local2.item_name = "Dreadfather's Visage";
_local2.lore = "Best not to think about how this was made.";
_local2.armor_rating = _local2.scaleArmorForLevel(25);
_local2.mod_strength = Math.ceil((3 * _local3));
_local2.mod_dexterity = Math.ceil((3 * _local3));
_local2.mod_intellect = Math.ceil((3 * _local3));
_local2.resistStun = 50;
_local2.icon_frame = 135;
_local4.push(_local2);
_local2 = new Offhand();
_local2.item_level = this.level;
_local2.item_rarity = Item.orange;
_local2.item_name = "The Book of Dread";
_local2.lore = "Dark secrets are held within.";
_local2.powerRegen = 4;
_local2.vampiric_percent = 10;
_local2.mod_intellect = Math.ceil((4 * _local3));
_local2.setPoisonDamage(10);
_local2.whoEquips = (Equipment.allEquip - Equipment.barbarianEquip);
_local2.icon_frame = 136;
_local4.push(_local2);
return (_local4);
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sDreadfatherDrain(this));
skills.push(new sDreadfatherRevive(this));
skills.push(new sForceRetreat(this));
}
}
}//package
Section 256
//mDwarfCrossbow (mDwarfCrossbow)
package {
public class mDwarfCrossbow extends MonsterCharacter {
public function mDwarfCrossbow(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.dwarf;
classname = "Dwarf";
poisonResist = 20;
stunResist = 50;
charname = "Crossbowman";
portrait = CharGraphic.dwarf_crossbow;
mindless = true;
description = "Armored. Ranged attack ignores enemy armor.";
quickness = 35;
damage_resistance = 20;
health_max = Math.round((health_max * 0.9));
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sDwarfCrossbowAttack(this));
skills.push(new sDwarvenAle(this));
}
}
}//package
Section 257
//mDwarfManiac (mDwarfManiac)
package {
public class mDwarfManiac extends MonsterCharacter {
public function mDwarfManiac(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.dwarf;
classname = "Dwarf";
poisonResist = 20;
stunResist = 100;
charname = "Dwarf Maniac";
portrait = CharGraphic.dwarf_maniac;
mindless = true;
description = "Charges the back row. Immune to stun.";
quickness = 40;
health_max = Math.round((health_max * 1));
health = health_max;
damage = Math.round((damage * 1.1));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sDwarfCharge(this));
skills.push(new sDwarvenAle(this));
}
}
}//package
Section 258
//mDwarfPrince (mDwarfPrince)
package {
public class mDwarfPrince extends MonsterCharacter {
public function mDwarfPrince(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.dwarf;
poisonResist = 20;
stunResist = 75;
charname = Horde.getDwarfName();
classname = "Mountain Prince";
portrait = CharGraphic.dwarf_fruit;
mindless = false;
description = "Dwarf Leader. Noble lord.";
accuracy = 130;
damage_resistance = 0;
quickness = 40;
lethalityImmune = true;
damage = Math.round((damage * 1));
health_max = Math.round((health_max * 1.5));
if (((!((dm.party == null))) && (dm.party.extreme))){
health_max = (health_max * MonsterCharacter.EXTREME_HEALTH_MOD);
};
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sDwarfCrossbowAttack(this));
skills.push(new sDwarfSponge(this));
skills.push(new sDwarfPride(this));
skills.push(new sDwarvenAle(this));
}
}
}//package
Section 259
//mDwarfRunecaster (mDwarfRunecaster)
package {
public class mDwarfRunecaster extends MonsterCharacter {
public function mDwarfRunecaster(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.dwarf;
classname = "Dwarf";
poisonResist = 20;
stunResist = 50;
charname = "Runecaster";
portrait = CharGraphic.dwarf_scarred;
mindless = false;
description = "Defensive spellcaster.";
quickness = 20;
damage_resistance = 10;
health_max = Math.round((health_max * 0.8));
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sDwarvenAle(this));
skills.push(new sRuneProtection(this));
skills.push(new sRuneStrength(this));
}
}
}//package
Section 260
//mDwarfWarleader (mDwarfWarleader)
package {
public class mDwarfWarleader extends MonsterCharacter {
public function mDwarfWarleader(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.dwarf;
poisonResist = 20;
stunResist = 75;
charname = Horde.getDwarfName();
classname = "Battleforger";
portrait = CharGraphic.dwarf_warlord;
mindless = false;
description = "Dwarf Leader. Expert warrior. Heavily armored.";
accuracy = 130;
damage_resistance = 50;
quickness = 30;
lethalityImmune = true;
damage = Math.round((damage * 1.35));
health_max = Math.round((health_max * 1.3));
if (((!((dm.party == null))) && (dm.party.extreme))){
health_max = (health_max * MonsterCharacter.EXTREME_HEALTH_MOD);
};
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sMonsterMeleeAE(this));
skills.push(new sDwarfOnslaught(this));
skills.push(new sDwarvenAle(this));
}
}
}//package
Section 261
//mDwarfWarrior (mDwarfWarrior)
package {
public class mDwarfWarrior extends MonsterCharacter {
public function mDwarfWarrior(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.dwarf;
classname = "Dwarf";
poisonResist = 20;
stunResist = 50;
charname = "Dwarf Warrior";
portrait = CharGraphic.dwarf_warrior;
mindless = true;
description = "Armored.";
quickness = 30;
damage_resistance = 30;
health_max = Math.round((health_max * 0.8));
health = health_max;
damage = Math.round((damage * 1));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sDwarfPunishing(this));
skills.push(new sDwarvenAle(this));
}
}
}//package
Section 262
//mDwarfVeteran (mDwarfVeteran)
package {
public class mDwarfVeteran extends MonsterCharacter {
public function mDwarfVeteran(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.dwarf;
classname = "Dwarf";
poisonResist = 20;
stunResist = 50;
charname = "Dwarf Veteran";
portrait = CharGraphic.dwarf_veteran;
mindless = true;
description = "Recovers from injury.";
regenerate = 7;
quickness = 35;
health_max = Math.round((health_max * 1.2));
health = health_max;
damage = Math.round((damage * 1));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sDwarfHammerAE(this));
skills.push(new sDwarvenAle(this));
}
}
}//package
Section 263
//MediumArmor (MediumArmor)
package {
public class MediumArmor extends Armor {
public function MediumArmor(){
type = Armor.medium;
mod_quickness = (mod_quickness - 1);
whoEquips = ((Equipment.allEquip - Equipment.mageEquip) - Equipment.conjurorEquip);
base_armor_rating = 10;
grey_name = "Patched";
materials.push("Leather", "Studded", "Scaled", "Trollhide", "Symbiotic", "Shiftsteel");
}
override public function getItemTypeString(){
return ("Medium Armor");
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function itemStatsString(_arg1:String):String{
return (super.itemStatsString(_arg1));
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
super.applyPrefix();
}
override public function getWorth():int{
return (Math.round((1.1 * super.getWorth())));
}
override public function getItemModifiers():void{
super.getItemModifiers();
}
}
}//package
Section 264
//MeleeWeapon (MeleeWeapon)
package {
public class MeleeWeapon extends Weapon {
public function MeleeWeapon(){
materials.push("Iron", "Steel", "Damascene", "Mithril", "Magesteel", "Planeforged");
}
override public function getItemTypeString(){
if (twoHanded){
return ("2H Melee Weapon");
};
return ("Melee Weapon");
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
suffixes.push(["Might", base_item_stat_bonus]);
}
}
}//package
Section 265
//mFearSower (mFearSower)
package {
public class mFearSower extends MonsterCharacter {
public function mFearSower(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.special;
classname = "Fearsower";
poisonResist = 50;
stunResist = 50;
charname = "Fearsower";
portrait = CharGraphic.fearSower;
mindless = false;
description = "Advance agent of the Dreadfather.";
accuracy = 100;
quickness = 60;
health_max = Math.round((health_max * 1.2));
health = health_max;
damage = Math.round((damage * 1.2));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttack(this));
skills.push(new sInstillFear(this));
skills.push(new sWither(this));
}
}
}//package
Section 266
//mGargoyle (mGargoyle)
package {
public class mGargoyle extends MonsterCharacter {
public function mGargoyle(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.creature;
classname = "Deep Creature";
type = MonsterCharacter.creature;
charname = "Gargoyle";
portrait = CharGraphic.gargoyle;
mindless = true;
description = "Flying creature. Highly resistant to damage.";
quickness = 60;
damage_resistance = 80;
poisonResist = 100;
regenerate = 0;
health_max = Math.round((health_max * 0.2));
health = health_max;
damage = Math.round((damage * 1));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttack(this));
skills.push(new sMonsterFlightAttack(this));
skills.push(new sMonsterStoneForm(this));
}
}
}//package
Section 267
//mGhost (mGhost)
package {
public class mGhost extends MonsterCharacter {
public function mGhost(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.undead;
classname = "Undead";
poisonResist = 100;
stunResist = 100;
ethereal = 80;
charname = "Wraith";
portrait = CharGraphic.ghost;
mindless = true;
description = "Highly resistant to physical attacks. Ignores armor.";
quickness = 60;
health_max = Math.round((health_max * 0.3));
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sGhostAttack(this));
skills.push(new sGhostTouch(this));
skills.push(new sGhostHide(this));
}
}
}//package
Section 268
//mGoblinArtificer (mGoblinArtificer)
package {
public class mGoblinArtificer extends MonsterCharacter {
public function mGoblinArtificer(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.greenskin;
classname = "Greenskin";
stunResist = 25;
charname = "Goblin Artificer";
portrait = CharGraphic.goblin;
mindless = true;
description = "Ranged explosive attack. Hated by their kin.";
quickness = 60;
accuracy = 95;
health_max = Math.round((health_max * 0.8));
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sGoblinCrossbow(this));
skills.push(new sGoblinGrenade(this));
}
}
}//package
Section 269
//mGorgon (mGorgon)
package {
public class mGorgon extends MonsterCharacter {
public function mGorgon(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.creature;
classname = "Legendary Creature";
charname = "Gorgon";
portrait = CharGraphic.gorgon;
mindless = false;
description = "Renowned for her ability to turn her foes to stone.";
accuracy = 140;
quickness = 60;
damage_resistance = 0;
causes_stun_percent = 0;
regenerate = 0;
poisonResist = 50;
stunResist = 100;
lethalityImmune = true;
health_max = Math.round((health_max * 4.3));
health_max = legendaryBonusHealth(_arg1);
health = health_max;
damage = Math.round((damage * 2));
initSkills();
}
override public function getUniqueItems(_arg1:int):Array{
var _local2:Equipment;
var _local3:Array;
_local3 = new Array();
_local2 = new Offhand();
_local2.item_level = this.level;
_local2.item_rarity = Item.orange;
_local2.item_name = "Head of the Gorgon";
_local2.lore = "Sever its head, and turn the power of the Gorgon against your enemies.";
_local2.powerRegen = 5;
_local2.resistPoison = 50;
_local2.causes_stun_percent = 50;
_local2.whoEquips = Equipment.allEquip;
_local2.icon_frame = 130;
_local3.push(_local2);
_local2 = new iRing(level, Item.orange);
_local2.item_name = "Serpentine Band";
_local2.lore = "A trophy from the Gorgon.";
_local2.setPoisonDamage(10);
_local2.resistPoison = 50;
_local2.setStrength(3, 6);
_local2.setDexterity(3, 6);
_local2.setQuickness(5, 10);
_local2.whoEquips = Equipment.allEquip;
_local2.icon_frame = 172;
_local3.push(_local2);
return (_local3);
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sGorgonSlash(this));
skills.push(new sGorgonGaze(this));
skills.push(new sGorgonSnakes(this));
}
}
}//package
Section 270
//mGreebler (mGreebler)
package {
public class mGreebler extends MonsterCharacter {
public function mGreebler(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.creature;
classname = "Deep Creature";
charname = "Greebler";
portrait = CharGraphic.greebler;
description = "Poisonous claws. Can attack at range.";
quickness = 65;
health_max = Math.round((health_max * 0.8));
health = health_max;
damage = Math.round((damage * 0.8));
poison_damage = Math.round((damage * 0.2));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttack(this));
skills.push(new sMonsterShadowStrike(this));
}
}
}//package
Section 271
//mHydraBody (mHydraBody)
package {
public class mHydraBody extends MonsterCharacter {
public function mHydraBody(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.creature;
classname = "Legendary Creature";
charname = "Hydra";
portrait = CharGraphic.hydraBody;
mindless = false;
description = "Regenerates health and heads.";
accuracy = 95;
quickness = 30;
damage_resistance = 0;
causes_stun_percent = 0;
regenerate = 5;
poisonResist = 40;
stunResist = 50;
lethalityImmune = true;
health_max = Math.round((health_max * 3.3));
health_max = legendaryBonusHealth(_arg1);
health = health_max;
damage = 0;
initSkills();
}
override public function getUniqueItems(_arg1:int):Array{
var _local2:Equipment;
var _local3:Array;
_local3 = new Array();
_local2 = new iSword(_arg1, Item.orange);
_local2.item_name = "Hydra's Tooth";
_local2.lore = "Hastily bound, this razor-sharp tooth confers some of the Hydra's regenerative abilities on the wielder.";
_local2.whoEquips = (Equipment.allEquip - Equipment.clericEquip);
_local2.icon_frame = 133;
Weapon(_local2).base_damage_mod = 100;
_local2.setLethality(10, 15);
_local2.setHealthRegen(10);
_local2.generateItem(Item.orange);
_local3.push(_local2);
_local2 = new iCloak(_arg1, Item.orange);
_local2.item_name = "Hydraskin Cloak";
_local2.lore = "Wrapping oneself in the skin of the Hydra is known to have recuperative effects.";
_local2.whoEquips = Equipment.allEquip;
_local2.icon_frame = 134;
_local2.base_armor_mod = 300;
_local2.setHealthRegen(10);
_local2.powerRegen = 2;
_local2.replenishing = 50;
_local2.generateItem(Item.orange);
_local3.push(_local2);
return (_local3);
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sHydraGrowHeads(this));
}
}
}//package
Section 272
//mHydraHead (mHydraHead)
package {
public class mHydraHead extends MonsterCharacter {
public function mHydraHead(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.creature;
classname = "Legendary Creature";
charname = "Hydra Head";
if (dmf.randomNum(0, 100) > 50){
portrait = CharGraphic.hydraHead1;
} else {
portrait = CharGraphic.hydraHead2;
};
mindless = true;
description = "Regenerates health.";
accuracy = 125;
quickness = 40;
damage_resistance = 0;
causes_stun_percent = 0;
regenerate = 5;
poisonResist = 40;
lethalityImmune = true;
health_max = Math.round((health_max * 1.3));
health_max = legendaryBonusHealth(_arg1);
health = health_max;
damage = Math.round((damage * 1.2));
initSkills();
}
public function togglePortrait():void{
if (portrait == CharGraphic.hydraHead1){
portrait = CharGraphic.hydraHead2;
} else {
portrait = CharGraphic.hydraHead1;
};
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sHydraBite(this));
}
override public function getOrangeLoot():Item{
return (null);
}
}
}//package
Section 273
//MiscTooltip (MiscTooltip)
package {
import flash.text.*;
import flash.display.*;
public class MiscTooltip extends Tooltip {
public var tooltip_bg:Sprite;
public var text_label:TextField;
public var title_label:TextField;
public function MiscTooltip(_arg1:String="", _arg2:String=""){
var _local3:*;
super();
if (_arg1 == null){
_arg1 = "Blank";
};
if (_arg2 == null){
_arg2 = "Tooltip contents failed to load.";
};
title_label.autoSize = TextFieldAutoSize.CENTER;
title_label.text = _arg1;
dm.embolden(title_label);
_local3 = title_label.height;
title_label.autoSize = TextFieldAutoSize.NONE;
if (_local3 == 16){
title_label.height = (_local3 + 6);
} else {
title_label.height = (_local3 + 4);
};
text_label.y = (title_label.y + title_label.height);
text_label.text = _arg2;
text_label.autoSize = TextFieldAutoSize.CENTER;
tooltip_bg.height = ((text_label.y + text_label.height) + 12);
}
}
}//package
Section 274
//miss_magic_sound (miss_magic_sound)
package {
import flash.media.*;
public dynamic class miss_magic_sound extends Sound {
}
}//package
Section 275
//miss_melee_sound (miss_melee_sound)
package {
import flash.media.*;
public dynamic class miss_melee_sound extends Sound {
}
}//package
Section 276
//miss_ranged_sound (miss_ranged_sound)
package {
import flash.media.*;
public dynamic class miss_ranged_sound extends Sound {
}
}//package
Section 277
//miss_thrown_sound (miss_thrown_sound)
package {
import flash.media.*;
public dynamic class miss_thrown_sound extends Sound {
}
}//package
Section 278
//mLich (mLich)
package {
public class mLich extends MonsterCharacter {
public function mLich(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.undead;
classname = "Undead";
poisonResist = 50;
charname = "Lich";
portrait = CharGraphic.lich;
mindless = false;
description = "Undead. Spellcaster.";
quickness = 35;
health_max = Math.round((health_max * 0.8));
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterMagicCold(this));
skills.push(new sLichStun(this));
skills.push(new sLichAE(this));
}
}
}//package
Section 279
//mLightningDrake (mLightningDrake)
package {
public class mLightningDrake extends MonsterCharacter {
public function mLightningDrake(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.creature;
charname = "Storm Drake";
classname = "Deep Creature";
portrait = CharGraphic.lightning_drake;
mindless = true;
description = "Flying creature. Has lightning attack.";
quickness = 55;
damage_resistance = 0;
health_max = Math.round((health_max * 1));
health = health_max;
damage = Math.round((damage * 1.1));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttack(this));
skills.push(new sMonsterFlightAttack(this));
skills.push(new sLightningDrakeAE(this));
}
}
}//package
Section 280
//mMinotaur (mMinotaur)
package {
public class mMinotaur extends MonsterCharacter {
public function mMinotaur(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.creature;
classname = "Legendary Creature";
charname = "Minotaur";
portrait = CharGraphic.minotaur;
mindless = false;
description = "Half man, Half bull.";
accuracy = 130;
quickness = 50;
damage_resistance = 0;
causes_stun_percent = 20;
stunResist = 100;
regenerate = 0;
lethalityImmune = true;
health_max = Math.round((health_max * 6));
health_max = legendaryBonusHealth(_arg1);
health = health_max;
damage = Math.round((damage * 2.2));
initSkills();
}
override public function getUniqueItems(_arg1:int):Array{
var _local2:Equipment;
var _local3:Array;
_local3 = new Array();
_local2 = new iAxe(_arg1, Item.orange);
_local2.item_name = "Minotaur's Axe";
_local2.lore = "The axe wielded by the mighty Minotaur.";
_local2.whoEquips = ((Equipment.barbarianEquip + Equipment.warriorEquip) + Equipment.rangerEquip);
_local2.icon_frame = 137;
Weapon(_local2).base_damage_mod = 100;
_local2.setStrength(1, 6);
_local2.setEndurance(1, 6);
_local2.generateItem(Item.orange);
_local3.push(_local2);
_local2 = new Offhand();
_local2.item_name = "Minotaur Horn";
_local2.lore = "Makes a fine trumpet.";
_local2.item_level = this.level;
_local2.item_rarity = Item.orange;
_local2.setPowerRegen(2, 4);
_local2.setHealthRegen(5);
_local2.replenishing = 30;
_local2.setResistStun();
_local2.setAccuracy();
_local2.quickRetreat = true;
_local2.whoEquips = Equipment.allEquip;
_local2.icon_frame = 181;
_local3.push(_local2);
return (_local3);
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sMonsterMeleeAE(this));
skills.push(new sMinotaurLabyrinth(this));
}
}
}//package
Section 281
//mNecromancer (mNecromancer)
package {
public class mNecromancer extends MonsterCharacter {
public function mNecromancer(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.undead;
charname = Horde.getNecromancerName();
classname = "Arch-Lich";
portrait = CharGraphic.necromancer;
mindless = false;
description = "Undead Leader. Powerful spellcaster.";
accuracy = 150;
damage_resistance = 10;
poisonResist = 50;
stunResist = 30;
quickness = 35;
lethalityImmune = true;
damage = Math.round((damage * 1.7));
health_max = Math.round((health_max * 1.4));
if (((!((dm.party == null))) && (dm.party.extreme))){
health_max = (health_max * MonsterCharacter.EXTREME_HEALTH_MOD);
};
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterMagicCold(this));
skills.push(new sNecroDrain(this));
skills.push(new sNecroSponge(this));
}
}
}//package
Section 282
//MochiBot (MochiBot)
package {
import flash.net.*;
import flash.display.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
var self:MochiBot;
var server:String;
var lv:URLVariables;
var url:String;
var req:URLRequest;
var loader:Loader;
var parent = _arg1;
var tag = _arg2;
try {
self = new (MochiBot);
if (Security.sandboxType == "localWithFile"){
return (null);
};
parent.addChild(self);
Security.allowDomain("core.mochibot.com");
Security.allowInsecureDomain("core.mochibot.com");
server = "http://core.mochibot.com/my/core.swf";
lv = new URLVariables();
lv["sb"] = Security.sandboxType;
lv["v"] = Capabilities.version;
lv["swfid"] = tag;
lv["mv"] = "8";
lv["fv"] = "9";
url = self.root.loaderInfo.loaderURL;
if (url.indexOf("http") == 0){
lv["url"] = url;
} else {
lv["url"] = "local";
};
req = new URLRequest(server);
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader = new Loader();
self.addChild(loader);
loader.load(req);
} catch(error) {
};
return (self);
}
}
}//package
Section 283
//monster_arrow (monster_arrow)
package {
import flash.display.*;
public dynamic class monster_arrow extends MovieClip {
public var blood:BloodRandom;
public var spark:monster_arrow_impact;
public function monster_arrow(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.monsterArrow);
this.spark.x = dm.randomNum(15, 43);
this.spark.y = dm.randomNum(15, 43);
}
function frame45(){
this.stop();
}
}
}//package
Section 284
//monster_arrow_drainpower (monster_arrow_drainpower)
package {
import flash.display.*;
public dynamic class monster_arrow_drainpower extends MovieClip {
public var blood:BloodRandom;
public var spark:monster_arrow_impact;
public function monster_arrow_drainpower(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.monsterArrow);
this.spark.x = dm.randomNum(15, 43);
this.spark.y = dm.randomNum(15, 43);
}
function frame45(){
this.stop();
}
}
}//package
Section 285
//monster_arrow_impact (monster_arrow_impact)
package {
import flash.display.*;
public dynamic class monster_arrow_impact extends MovieClip {
public var hit:MovieClip;
public function monster_arrow_impact(){
addFrameScript(11, frame12);
}
function frame12(){
this.gotoAndStop(12);
}
}
}//package
Section 286
//monster_drain_effect (monster_drain_effect)
package {
import flash.display.*;
public dynamic class monster_drain_effect extends MovieClip {
public function monster_drain_effect(){
addFrameScript(44, frame45);
}
function frame45(){
this.stop();
}
}
}//package
Section 287
//monster_magic_attack (monster_magic_attack)
package {
import flash.display.*;
public dynamic class monster_magic_attack extends MovieClip {
public function monster_magic_attack(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.monsterMagicAttack);
}
function frame45(){
this.stop();
}
}
}//package
Section 288
//monster_magic_sound (monster_magic_sound)
package {
import flash.media.*;
public dynamic class monster_magic_sound extends Sound {
}
}//package
Section 289
//monster_thrown (monster_thrown)
package {
import flash.display.*;
public dynamic class monster_thrown extends MovieClip {
public var blood:BloodRandom;
public var spark:monster_arrow_impact;
public function monster_thrown(){
addFrameScript(0, frame1, 4, frame5, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.thrown);
}
function frame5(){
this.spark.x = dm.randomNum(15, 43);
this.spark.y = dm.randomNum(15, 43);
}
function frame45(){
this.stop();
}
}
}//package
Section 290
//MonsterCharacter (MonsterCharacter)
package {
public class MonsterCharacter extends Character {
private var _regenerate:int;// = 0
private var _mindless:Boolean;// = true
private var _cannotTarget:Boolean;// = false
private var _poison_damage:int;// = 0
private var _damage_reflection:int;// = 0
private var _damageImmune:Boolean;// = false
private var _ethereal:int;// = 0
private var _vampiric_percent:int;// = 0
private var _originalPos:int;// = -1
private var _accuracy_damage:int;// = 0
private var _causes_stun_percent:int;// = 0
static const greenskin:int = 2;
static const BEGINNER_HEALTH_MOD = 0.7;
static const BASE_HEALTH = 100;
static const EXTREME_HEALTH_MOD = 1.2;
static const HEALTH_SCALE_RATE = 60;
static const BASE_DAMAGE = 20;
static const BEGINNER_DAMAGE_MOD = 0.75;
static const DAMAGE_SCALE_RATE = 35;
static const dwarf:int = 5;
static const EXTREME_DAMAGE_MOD = 1.2;
static const human:int = 4;
static const special:int = 6;
static const undead:int = 1;
static const creature:int = 3;
public function MonsterCharacter(_arg1:int=1){
_originalPos = -1;
_regenerate = 0;
_mindless = true;
_ethereal = 0;
_damageImmune = false;
_cannotTarget = false;
_vampiric_percent = 0;
_causes_stun_percent = 0;
_damage_reflection = 0;
_accuracy_damage = 0;
_poison_damage = 0;
super();
this.level = _arg1;
classname = "Monster";
health_max = getHealthMax(_arg1);
damage = getBaseDamage(_arg1);
}
public function set damage_reflection(_arg1:int):void{
this._damage_reflection = _arg1;
}
override public function getHealthRegen(_arg1:Boolean=true):int{
var _local2:*;
_local2 = Math.round(((regenerate / 100) * health_max));
if (_arg1){
_local2 = (_local2 + buff_healthRegen);
};
return (_local2);
}
override public function getVampiric(_arg1:Boolean=true):int{
if (_arg1){
return ((vampiric_percent + buff_vampiric));
};
return (vampiric_percent);
}
override public function getDamageReflection(_arg1:Boolean=true):int{
if (_arg1){
return ((damage_reflection + buff_damageReflect));
};
return (damage_reflection);
}
public function get cannotTarget():Boolean{
return (this._cannotTarget);
}
public function resetSkills():void{
var _local1:*;
_local1 = 0;
while (_local1 < skills.length) {
skills[_local1].aiCastCount = 0;
_local1++;
};
}
public function get poison_damage():int{
return (this._poison_damage);
}
public function get vampiric_percent():int{
return (this._vampiric_percent);
}
override public function getStunChance(_arg1:Boolean=true):int{
if (_arg1){
return ((causes_stun_percent + buff_stun));
};
return (causes_stun_percent);
}
public function getGenericItems(_arg1:int):Array{
var _local2:Array;
var _local3:Equipment;
_local2 = new Array();
_local3 = new iClothHat(_arg1, Item.orange);
_local3.item_name = "Victor's Laurels";
_local3.armor_rating = _local3.scaleArmorForLevel(6);
_local3.setStrength(3, 5);
_local3.setIntellect(3, 5);
_local3.setPowerRegen(3, 4);
_local3.setQuickness(5, 5);
_local3.icon_frame = 154;
_local2.push(_local3);
_local3 = new iClothRobe(_arg1, Item.orange);
_local3.item_name = "Robe of Affliction";
_local3.armor_rating = (_local3.armor_rating * 2);
_local3.setBlind();
_local3.setStunChance();
_local3.setVampiric();
_local3.setPoisonDamage();
_local3.setLethality(3, 5);
_local3.setIntellect();
_local3.icon_frame = 173;
_local2.push(_local3);
_local3 = new iLeatherGloves(_arg1, Item.orange);
_local3.item_name = "Very Nimble Gloves";
_local3.armor_rating = (_local3.armor_rating * 2);
_local3.setDexterity(5, 7);
_local3.quickRetreat = true;
_local3.setQuickness(5, 10);
_local3.setLethality();
_local3.icon_frame = 156;
_local2.push(_local3);
_local3 = new iLeatherBoots(_arg1, Item.orange);
_local3.item_name = "Quicksilver Boots";
_local3.armor_rating = (_local3.armor_rating * 2);
_local3.setStrength(3, 5);
_local3.setDexterity(3, 5);
_local3.setIntellect(3, 5);
_local3.setBlind();
_local3.setQuickness(10, 15);
_local3.icon_frame = 171;
_local2.push(_local3);
_local3 = new iPlateHelmet(_arg1, Item.orange);
_local3.item_name = "Omega Helm";
_local3.armor_rating = (_local3.armor_rating * 2);
_local3.setEndurance(5, 7);
_local3.setHealthRegen();
_local3.setLethality();
_local3.icon_frame = 155;
_local2.push(_local3);
_local3 = new iPlateGreaves(_arg1, Item.orange);
_local3.item_name = "Greaves of the Dwarf-King";
_local3.lore = "Uncomfortably tight.";
_local3.armor_rating = (_local3.armor_rating * 2);
_local3.setEndurance(4, 6);
_local3.setResistStun();
_local3.setStunChance(12, 15);
_local3.damageBonusVsCreatureType = MonsterCharacter.dwarf;
_local3.damageBonusVsCreatureModifier = 1.3;
_local3.armorBonusVsCreatureType = MonsterCharacter.dwarf;
_local3.armorBonusVsCreatureModifier = 1.3;
_local3.icon_frame = 162;
_local2.push(_local3);
_local3 = new iPlateGloves(_arg1, Item.orange);
_local3.item_name = "High Five";
_local3.creator = "Logan";
_local3.armor_rating = (_local3.armor_rating * 2);
_local3.powerRegen = 5;
_local3.accuracyBonus = 5;
_local3.lethality = 5;
_local3.causes_stun_percent = 5;
_local3.mod_quickness = 5;
_local3.icon_frame = 163;
_local2.push(_local3);
_local3 = new iRing(_arg1, Item.orange);
_local3.item_name = "Ring of Boundless Energy";
_local3.setPowerRegen(2, 4);
_local3.replenishing = 100;
_local3.setQuickness(5, 15);
_local3.icon_frame = 164;
_local2.push(_local3);
_local3 = new iCrossbow(_arg1, Item.orange);
_local3.item_name = "Foe-Piercer";
_local3.lore = "Built by master craftsmen, in a long-forgotten age.";
Weapon(_local3).base_damage_mod = 70;
_local3.setQuickness(2, 5);
_local3.setDexterity(3, 6);
_local3.setLethality(5, 10);
_local3.setStunChance(20, 30);
_local3.icon_frame = 183;
_local3.generateItem(Item.orange);
_local2.push(_local3);
_local3 = new iStaff(_arg1, Item.orange);
_local3.item_name = "Staff of Destiny";
_local3.lore = "No man may harm the wielder.";
Weapon(_local3).base_damage_mod = 70;
_local3.armorBonusVsCreatureType = MonsterCharacter.human;
_local3.armorBonusVsCreatureModifier = 5;
_local3.setQuickness(5, 10);
_local3.setIntellect(3, 6);
_local3.setEndurance(3, 6);
_local3.setHealthRegen(10);
_local3.icon_frame = 182;
_local3.generateItem(Item.orange);
_local2.push(_local3);
_local3 = new iParryingDagger(_arg1, Item.orange);
_local3.item_name = "Mythic Shadow";
_local3.armor_rating = Math.round((_local3.armor_rating * 1.6));
_local3.setBlind(8, 11);
_local3.setQuickness(10, 13);
_local3.setStrength(2, 4);
_local3.setPoisonDamage(10);
_local3.creator = "Dark Nova";
_local3.whoEquips = Equipment.rogueEquip;
_local3.icon_frame = 178;
_local2.push(_local3);
_local3 = new iQuiver(_arg1, Item.orange);
_local3.item_name = "The Magical Quiver of Archranger Bilko, Undead Hunter";
_local3.lore = "Bilko was one of the most legendary Rangers to have ever lived.";
_local3.damageBonusVsCreatureType = MonsterCharacter.undead;
_local3.damageBonusVsCreatureModifier = 1.2;
_local3.setDexterity(2, 4);
_local3.setIntellect();
_local3.setHealthRegen(10);
_local3.setPowerRegen(5);
_local3.creator = "SwordPaladin";
_local3.icon_frame = 180;
_local2.push(_local3);
return (_local2);
}
override public function getEffectiveHealth():int{
var _local1:*;
var _local2:*;
_local1 = ((100 - getDamageResist()) / 100);
_local2 = Math.round((health / _local1));
return (_local2);
}
override public function getDamageResist(_arg1:Boolean=true):int{
if (_arg1){
return (Math.min(99, (((damage_resistance + buff_damageResist) + temp_damage_resistance) - debuff_damageResist)));
};
return (Math.min(99, damage_resistance));
}
public function get causes_stun_percent():int{
return (this._causes_stun_percent);
}
public function get regenerate():int{
return (this._regenerate);
}
override public function getAccuracyDamage(_arg1:Boolean=true):int{
return (accuracy_damage);
}
public function get originalPos():int{
return (this._originalPos);
}
public function get damageImmune():Boolean{
return (this._damageImmune);
}
public function set cannotTarget(_arg1:Boolean):void{
this._cannotTarget = _arg1;
}
public function set accuracy_damage(_arg1:int):void{
this._accuracy_damage = _arg1;
}
public function get mindless():Boolean{
return (this._mindless);
}
public function get damage_reflection():int{
return (this._damage_reflection);
}
override public function getPoisonDamage(_arg1:Boolean=true):int{
return (poison_damage);
}
public function set ethereal(_arg1:int):void{
this._ethereal = _arg1;
}
public function set poison_damage(_arg1:int):void{
this._poison_damage = _arg1;
}
public function legendaryBonusHealth(_arg1:int):int{
var _local2:Number;
_local2 = (1 + ((level - 1) * 0.03));
return (Math.ceil((health_max * _local2)));
}
public function set vampiric_percent(_arg1:int):void{
this._vampiric_percent = _arg1;
}
public function set regenerate(_arg1:int):void{
this._regenerate = _arg1;
}
public function getUniqueItems(_arg1:int):Array{
var _local2:Array;
_local2 = new Array();
return (_local2);
}
override public function reduceHealth(_arg1:int):int{
var _local2:*;
var _local3:*;
_local2 = health;
_local3 = super.reduceHealth(_arg1);
if ((((((health <= 0)) && ((_local2 > 0)))) && ((_local3 > 0)))){
};
return (_local3);
}
public function set causes_stun_percent(_arg1:int):void{
this._causes_stun_percent = _arg1;
}
public function initSkills():void{
}
public function get accuracy_damage():int{
return (this._accuracy_damage);
}
public function set originalPos(_arg1:int):void{
this._originalPos = _arg1;
}
public function get ethereal():int{
return (this._ethereal);
}
public function resetMonster():void{
clearStatusEffects();
resetSkills();
health = health_max;
power = power_max;
}
override public function damageAfterArmor(_arg1:int, _arg2:Character):int{
var _local3:int;
_local3 = ((damage_resistance + buff_damageResist) - debuff_damageResist);
if (_local3 >= 100){
_local3 = 99;
};
if (_local3 != 0){
_arg1 = Math.round((_arg1 * (1 - (_local3 / 100))));
};
if (_arg1 <= 0){
_arg1 = 1;
};
return (_arg1);
}
public function set damageImmune(_arg1:Boolean):void{
this._damageImmune = _arg1;
}
public function set mindless(_arg1:Boolean):void{
this._mindless = _arg1;
}
public function getOrangeLoot():Item{
var _local1:int;
var _local2:Array;
var _local3:Array;
var _local4:Array;
var _local5:int;
var _local6:*;
var _local7:ErrorDialog;
_local1 = 50;
_local3 = dmf.shuffleArray(getUniqueItems(level));
_local4 = dmf.shuffleArray(getGenericItems(level));
if ((((_local3 == null)) || (!(_local3.length)))){
_local2 = _local4;
} else {
if ((((_local4 == null)) || (!(_local4.length)))){
_local2 = _local3;
} else {
if (dmf.randomNum(0, 99) < _local1){
_local2 = _local3.concat(_local4);
} else {
_local2 = _local4.concat(_local3);
};
};
};
if (_local2.length){
_local5 = 0;
while (_local5 < _local2.length) {
if (TreasureChest.testItemSuitable(_local2[_local5], dm.main.pc_party)){
return (_local2[_local5]);
};
_local5++;
};
return (_local2[0]);
//unresolved jump
};
if (((DungeonMain.KONGREGATE) || (DungeonMain.BETA))){
_local6 = "An error has occurred. Please submit a bug report with the following information:\n\n";
_local6 = (_local6 + "Orange loot generation error!\n");
_local6 = (_local6 + (((("monster: " + charname) + " (") + level) + ")\n"));
if (_local3 != null){
_local6 = (_local6 + (("uniques: " + _local3.length) + "\n"));
};
if (_local4 != null){
_local6 = (_local6 + (("generics: " + _local4.length) + "\n"));
};
_local7 = new ErrorDialog("Error!", _local6);
dm.stage.addChild(_local7);
};
return (null);
}
public static function getBaseDamage(_arg1:int):int{
var _local2:*;
var _local3:int;
_local2 = (BASE_DAMAGE + Math.round(((_arg1 - 1) * (BASE_DAMAGE * (DAMAGE_SCALE_RATE / 100)))));
if (_arg1 == 1){
_local2 = Math.round((_local2 * 0.7));
} else {
if (_arg1 == 2){
_local2 = Math.round((_local2 * 0.8));
} else {
if (_arg1 == 3){
_local2 = Math.round((_local2 * 0.9));
};
};
};
if (_arg1 > 9){
_local3 = Math.round((_local2 * ((_arg1 - 9) / 200)));
_local3 = Math.min(_local3, (PlayerCharacter.baseHealthForLevel(_arg1) * 0.5));
_local2 = (_local2 + _local3);
};
if (dm.party != null){
if (dm.party.beginner){
_local2 = (_local2 * BEGINNER_DAMAGE_MOD);
};
if (dm.party.extreme){
_local2 = (_local2 * EXTREME_DAMAGE_MOD);
};
};
return (_local2);
}
public static function getHealthMax(_arg1:int, _arg2:Boolean=true):int{
var _local3:*;
_local3 = (BASE_HEALTH + getHealthIncrease(_arg1, _arg2));
if (!(_arg2)){
return (_local3);
};
if (_arg1 == 1){
_local3 = Math.round((_local3 * 0.7));
} else {
if (_arg1 == 2){
_local3 = Math.round((_local3 * 0.8));
} else {
if (_arg1 == 3){
_local3 = Math.round((_local3 * 0.9));
};
};
};
if (dm.party != null){
if (dm.party.beginner){
_local3 = (_local3 * BEGINNER_HEALTH_MOD);
};
if (dm.party.extreme){
_local3 = (_local3 * EXTREME_HEALTH_MOD);
};
};
return (_local3);
}
public static function getHealthIncrease(_arg1:int, _arg2:Boolean=true):int{
var _local3:*;
var _local4:int;
_arg1--;
_local3 = Math.round((_arg1 * (BASE_HEALTH * (HEALTH_SCALE_RATE / 100))));
if (_arg2){
_local4 = 10;
if (((!((dm.party == null))) && (dm.party.extreme))){
_local4 = 8;
};
if (_arg1){
_local3 = (_local3 + Math.round((_arg1 * (_arg1 / _local4))));
};
};
return (_local3);
}
}
}//package
Section 291
//mOrcBerserker (mOrcBerserker)
package {
public class mOrcBerserker extends MonsterCharacter {
public function mOrcBerserker(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.greenskin;
classname = "Greenskin";
stunResist = 25;
charname = "Orc Berserker";
portrait = CharGraphic.orc;
mindless = true;
description = "Attacks twice.";
quickness = 60;
health_max = Math.round((health_max * 1));
health = health_max;
damage = Math.round((damage * 1));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterDoubleAttack(this));
}
}
}//package
Section 292
//mOrcChampion (mOrcChampion)
package {
public class mOrcChampion extends MonsterCharacter {
public function mOrcChampion(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.greenskin;
classname = "Greenskin";
stunResist = 25;
charname = "Orc Champion";
portrait = CharGraphic.orc_champion;
mindless = true;
description = "Orcish elite.";
quickness = 45;
damage_resistance = 10;
health_max = Math.round((health_max * 1.1));
health = health_max;
damage = Math.round((damage * 1.1));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sOrcSponge(this));
}
}
}//package
Section 293
//mOrcJuggernaut (mOrcJuggernaut)
package {
public class mOrcJuggernaut extends MonsterCharacter {
public function mOrcJuggernaut(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.greenskin;
charname = Horde.getGreenskinName();
classname = "Half-Troll";
portrait = CharGraphic.orc_juggernaut;
mindless = false;
description = "Greenskin Leader. Slow, hulking warrior. Regenerates.";
accuracy = 120;
damage_resistance = 0;
poisonResist = 50;
stunResist = 75;
quickness = 45;
lethalityImmune = true;
regenerate = 10;
damage = Math.round((damage * 1.5));
health_max = Math.round((health_max * 1.6));
if (((!((dm.party == null))) && (dm.party.extreme))){
health_max = (health_max * MonsterCharacter.EXTREME_HEALTH_MOD);
};
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sMonsterDoubleAttack(this));
skills.push(new sTrollHowl(this));
}
}
}//package
Section 294
//mOrcSavage (mOrcSavage)
package {
public class mOrcSavage extends MonsterCharacter {
public function mOrcSavage(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.greenskin;
classname = "Greenskin";
stunResist = 25;
charname = "Orc Savage";
portrait = CharGraphic.orc_woman;
mindless = true;
description = "Strong ranged attack, but inaccurate.";
quickness = 65;
accuracy = 65;
health_max = Math.round((health_max * 1));
health = health_max;
damage = Math.round((damage * 1.1));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sOrcAxeThrow(this));
skills.push(new sMonsterDoubleAttack(this));
}
}
}//package
Section 295
//mOrcShaman (mOrcShaman)
package {
public class mOrcShaman extends MonsterCharacter {
public function mOrcShaman(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.greenskin;
classname = "Greenskin";
stunResist = 25;
charname = "Orc Shaman";
portrait = CharGraphic.orc_shaman;
mindless = false;
description = "Spellcaster. Heals allies and curses enemies.";
quickness = 35;
health_max = Math.round((health_max * 0.9));
health = health_max;
damage = Math.round((damage * 1));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sMonsterHeal(this));
skills.push(new sMonsterCurse(this));
}
}
}//package
Section 296
//mOrcWarlord (mOrcWarlord)
package {
public class mOrcWarlord extends MonsterCharacter {
public function mOrcWarlord(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.greenskin;
charname = Horde.getGreenskinName();
classname = "Orc Warlord";
portrait = CharGraphic.orc_warlord;
mindless = false;
description = "Greenskin Leader.";
accuracy = 140;
damage_resistance = 20;
poisonResist = 25;
stunResist = 75;
quickness = 35;
lethalityImmune = true;
health_max = Math.round((health_max * 1.5));
if (((!((dm.party == null))) && (dm.party.extreme))){
health_max = (health_max * MonsterCharacter.EXTREME_HEALTH_MOD);
};
health = health_max;
damage = Math.round((damage * 1.6));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sWarlordRevive(this));
skills.push(new sWarlordFocus(this));
skills.push(new sWarlordBuff(this));
}
}
}//package
Section 297
//morpheus_calls_loop02 (morpheus_calls_loop02)
package {
import flash.media.*;
public dynamic class morpheus_calls_loop02 extends Sound {
}
}//package
Section 298
//MovementArrowHead (MovementArrowHead)
package {
import flash.display.*;
public dynamic class MovementArrowHead extends MovieClip {
}
}//package
Section 299
//mPoisonDrake (mPoisonDrake)
package {
public class mPoisonDrake extends MonsterCharacter {
public function mPoisonDrake(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.creature;
charname = "Poison Drake";
classname = "Deep Creature";
portrait = CharGraphic.poison_drake;
mindless = true;
description = "Spits poison.";
quickness = 45;
damage_resistance = 0;
poisonResist = 100;
health_max = Math.round((health_max * 1));
health = health_max;
damage = Math.round((damage * 1));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttack(this));
skills.push(new sPoisonDrakeShot(this));
skills.push(new sPoisonDrakeAE(this));
}
}
}//package
Section 300
//mSkeleton (mSkeleton)
package {
public class mSkeleton extends MonsterCharacter {
public function mSkeleton(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.undead;
classname = "Undead";
poisonResist = 50;
charname = "Skeleton";
portrait = CharGraphic.skeleton;
mindless = true;
description = "Undead. Fragile, but slowly mends.";
quickness = 40;
health_max = Math.round((health_max * 1));
health = health_max;
damage_resistance = -10;
regenerate = 6;
stunResist = 0;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
}
}
}//package
Section 301
//mSkeletonArcher (mSkeletonArcher)
package {
public class mSkeletonArcher extends MonsterCharacter {
public function mSkeletonArcher(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.undead;
classname = "Undead";
poisonResist = 50;
charname = "Undead Archer";
portrait = CharGraphic.skeleton_archer;
mindless = true;
description = "Undead. Ranged attack. Fragile, but slowly mends.";
quickness = 50;
health_max = Math.round((health_max * 1));
health = health_max;
damage_resistance = -10;
regenerate = 6;
stunResist = 0;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sMonsterRangedAttack(this));
}
}
}//package
Section 302
//mTroll (mTroll)
package {
public class mTroll extends MonsterCharacter {
public function mTroll(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.greenskin;
classname = "Greenskin";
stunResist = 25;
charname = "Troll";
portrait = CharGraphic.troll;
mindless = true;
description = "Regenerates health. Slow. Strong attack.";
quickness = 20;
accuracy = 80;
damage_resistance = 0;
regenerate = 15;
health_max = Math.round((health_max * 1.2));
health = health_max;
damage = Math.round((damage * 1.6));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttackWeapon(this));
skills.push(new sMonsterPierce(this));
}
}
}//package
Section 303
//Music (Music)
package {
import flash.media.*;
import flash.utils.*;
import flash.events.*;
public class Music {
const fade_out_time = 500;
const sound_fade_steps = 25;
const fade_in_time = 1000;
var channel:SoundChannel;
var fadeInTimer:Timer;
var active:Boolean;// = false
var fadeStepCount;// = 0
var fadeOutTimer:Timer;
static var volumeSetting = 0.15;
public function Music(_arg1:Sound=null, _arg2:Boolean=true, _arg3:Boolean=true):void{
var _local4:*;
fadeStepCount = 0;
active = false;
super();
if (_arg1 == null){
return;
};
_local4 = 1;
if (_arg2){
_local4 = 99999;
};
channel = _arg1.play(0, _local4);
if (channel == null){
return;
};
active = true;
if (_arg3){
this.fadeIn();
} else {
this.setVolume(volumeSetting);
};
}
function musicFadeOutStep(_arg1:TimerEvent):void{
var _local2:*;
var _local3:*;
fadeStepCount--;
_local2 = (1 / sound_fade_steps);
_local3 = (fadeStepCount * _local2);
_local3 = (_local3 * volumeSetting);
if (channel != null){
channel.soundTransform = new SoundTransform(_local3);
};
}
public function stop():void{
if (channel != null){
channel.stop();
};
active = false;
}
public function fadeIn(_arg1:int=1000):void{
if (channel == null){
return;
};
channel.soundTransform = new SoundTransform(0);
fadeStepCount = 0;
fadeInTimer = new Timer((_arg1 / sound_fade_steps), sound_fade_steps);
fadeInTimer.addEventListener(TimerEvent.TIMER, musicFadeInStep);
fadeInTimer.addEventListener(TimerEvent.TIMER_COMPLETE, musicFadeInDone);
fadeInTimer.start();
}
public function setVolume(_arg1:Number):void{
if (channel == null){
return;
};
_arg1 = Math.max(0, _arg1);
_arg1 = Math.min(volumeSetting, _arg1);
channel.soundTransform = new SoundTransform(_arg1);
}
public function mute():void{
setVolume(0);
}
function musicFadeInDone(_arg1:TimerEvent):void{
fadeInTimer.removeEventListener(TimerEvent.TIMER, musicFadeInStep);
fadeInTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, musicFadeInDone);
if (channel != null){
channel.soundTransform = new SoundTransform(volumeSetting);
};
}
function musicFadeInStep(_arg1:TimerEvent):void{
var _local2:*;
var _local3:*;
fadeStepCount++;
_local2 = (1 / sound_fade_steps);
_local3 = (fadeStepCount * _local2);
_local3 = (_local3 * volumeSetting);
if (channel != null){
channel.soundTransform = new SoundTransform(_local3);
};
}
function musicFadeOutDone(_arg1:TimerEvent):void{
fadeOutTimer.removeEventListener(TimerEvent.TIMER, musicFadeOutStep);
fadeOutTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, musicFadeOutDone);
if (channel != null){
channel.stop();
};
}
public function fadeOut(_arg1:int=1000):void{
if (channel == null){
return;
};
active = false;
fadeStepCount = sound_fade_steps;
channel.soundTransform = new SoundTransform(volumeSetting);
fadeOutTimer = new Timer((_arg1 / sound_fade_steps), sound_fade_steps);
fadeOutTimer.addEventListener(TimerEvent.TIMER, musicFadeOutStep);
fadeOutTimer.addEventListener(TimerEvent.TIMER_COMPLETE, musicFadeOutDone);
fadeOutTimer.start();
}
}
}//package
Section 304
//MuteButton (MuteButton)
package {
import flash.events.*;
import flash.display.*;
public class MuteButton extends MovieClip {
public function MuteButton():void{
setGraphic();
addEventListener(MouseEvent.MOUSE_DOWN, clicked);
}
public function setGraphic():void{
if (GlobalVolume.volumeSetting == GlobalVolume.volumeOff){
gotoAndStop("mute");
} else {
gotoAndStop("on");
};
}
private function clicked(_arg1:MouseEvent):void{
if (GlobalVolume.volumeSetting > GlobalVolume.volumeOff){
GlobalVolume.volumeSetting = GlobalVolume.volumeOff;
} else {
GlobalVolume.volumeSetting = GlobalVolume.volumeFull;
};
GlobalVolume.setVolume(GlobalVolume.volumeSetting);
setGraphic();
if (dm.main != null){
dm.main.saveInterface();
};
}
public function cleanup():void{
removeEventListener(MouseEvent.MOUSE_DOWN, clicked);
}
}
}//package
Section 305
//mVampire (mVampire)
package {
public class mVampire extends MonsterCharacter {
public function mVampire(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.undead;
classname = "Undead";
poisonResist = 50;
charname = "Vampire";
portrait = CharGraphic.vampire;
mindless = true;
description = "Undead. Drains health.";
quickness = 60;
vampiric_percent = Math.floor((75 + (_arg1 * 0.5)));
health_max = Math.round((health_max * 0.9));
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttack(this));
skills.push(new sVampireAttack(this));
}
}
}//package
Section 306
//mWhirlwind (mWhirlwind)
package {
public class mWhirlwind extends MonsterCharacter {
public function mWhirlwind(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.special;
classname = "Whirlwind";
charname = "Whirlwind";
portrait = CharGraphic.whirlwind;
description = "Localised weather event. Dissipates at end of round.";
summoned = true;
quickness = 0;
accuracy = 0;
damageImmune = true;
cannotTarget = true;
poisonResist = 100;
stunResist = 100;
health_max = 1;
health = health_max;
damage = 0;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sDissipate(this));
}
}
}//package
Section 307
//mVoidstalker (mVoidstalker)
package {
public class mVoidstalker extends MonsterCharacter {
public function mVoidstalker(_arg1:int=1){
super(_arg1);
summoned = true;
type = MonsterCharacter.special;
classname = "Planar Entity";
ethereal = 20;
charname = "Voidstalker";
portrait = CharGraphic.voidstalker;
description = "Slightly resistant to physical damage. Reduces target's accuracy. Can attack at range.";
accuracy_damage = 30;
quickness = 80;
health_max = Math.round((health_max * 0.7));
health = health_max;
damage = Math.round((damage * 0.9));
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sMonsterAttack(this));
skills.push(new sMonsterShadowStrike(this));
}
}
}//package
Section 308
//mZombie (mZombie)
package {
public class mZombie extends MonsterCharacter {
public function mZombie(_arg1:int=1){
super(_arg1);
type = MonsterCharacter.undead;
classname = "Undead";
poisonResist = 50;
charname = "Zombie";
portrait = CharGraphic.zombie;
mindless = true;
description = "Undead. Slow, but tough. Has debilitating attacks.";
quickness = 20;
health_max = Math.round((health_max * 1.3));
health = health_max;
initSkills();
}
override public function initSkills():void{
skills.length = 0;
skills.push(new sZombieAttack(this));
skills.push(new sZombieAE(this));
}
}
}//package
Section 309
//NewProceedButton (NewProceedButton)
package {
import flash.display.*;
public dynamic class NewProceedButton extends SimpleButton {
}
}//package
Section 310
//NumericIndicatorHealth (NumericIndicatorHealth)
package {
import flash.display.*;
import flash.text.*;
public dynamic class NumericIndicatorHealth extends Sprite {
public var bar:MovieClip;
public var numbers:TextField;
}
}//package
Section 311
//NumericIndicatorPower (NumericIndicatorPower)
package {
import flash.display.*;
import flash.text.*;
public dynamic class NumericIndicatorPower extends Sprite {
public var bar:MovieClip;
public var numbers:TextField;
}
}//package
Section 312
//Offhand (Offhand)
package {
public class Offhand extends Equipment {
public function Offhand(){
slot = offhand;
}
override public function generateItem(_arg1:int):void{
var _local2:*;
var _local3:*;
_local2 = false;
_local3 = false;
if (item_rarity == Item.green){
if (dmf.randomNum(0, 100) >= 50){
_local3 = true;
} else {
_local2 = true;
};
};
if (item_rarity == Item.grey){
item_rarity = Item.white;
};
getItemModifiers();
if ((((item_rarity == Item.blue)) || (_local3))){
prefix = rollForPrefix(item_rarity);
};
if ((((item_rarity == Item.blue)) || (_local2))){
suffix = rollForSuffix(item_rarity);
};
if (prefix >= 0){
applyPrefix();
};
if (suffix >= 0){
applySuffix();
};
if (base_armor_rating){
armor_rating = scaleArmorForLevel((base_armor_rating * (1 + (base_armor_mod / 100))));
};
if (prefix >= 0){
item_name = ((prefixes[prefix][0] + " ") + item_name);
};
if (suffix >= 0){
item_name = ((item_name + " of ") + suffixes[suffix][0]);
};
}
override public function getItemTypeString(){
return ("Offhand");
}
override public function itemStatsString(_arg1:String):String{
if (armor_rating){
_arg1 = (_arg1 + (String(armor_rating) + " Armor Rating\n"));
};
return (super.itemStatsString(_arg1));
}
override public function getItemModifiers():void{
super.getItemModifiers();
suffixes.push(["Might", base_item_stat_bonus]);
}
}
}//package
Section 313
//OnOffSelectorMenu (OnOffSelectorMenu)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class OnOffSelectorMenu extends MovieClip {
public var onLabel:TextField;
public var isOn:Boolean;// = false
public var offLabel:TextField;
public function OnOffSelectorMenu():void{
isOn = false;
super();
offLabel.addEventListener(MouseEvent.MOUSE_DOWN, clickOff);
onLabel.addEventListener(MouseEvent.MOUSE_DOWN, clickOn);
}
public function setTo(_arg1:Boolean):void{
if (_arg1){
this.gotoAndStop("on");
} else {
this.gotoAndStop("off");
};
this.isOn = _arg1;
}
function clickOn(_arg1:MouseEvent):void{
setTo(true);
}
public function cleanup():void{
offLabel.removeEventListener(MouseEvent.MOUSE_DOWN, clickOff);
onLabel.removeEventListener(MouseEvent.MOUSE_DOWN, clickOn);
}
function clickOff(_arg1:MouseEvent):void{
setTo(false);
}
}
}//package
Section 314
//OptionsBookButton (OptionsBookButton)
package {
import flash.events.*;
import flash.display.*;
public class OptionsBookButton extends SimpleButton {
public function OptionsBookButton():void{
this.addEventListener(MouseEvent.MOUSE_DOWN, clickedOn);
}
public function cleanup():void{
this.removeEventListener(MouseEvent.MOUSE_DOWN, clickedOn);
}
function clickedOn(_arg1:MouseEvent):void{
if (stage != null){
stage.addChild(new OptionsScreen());
};
}
}
}//package
Section 315
//OptionsButton (OptionsButton)
package {
import flash.events.*;
import flash.display.*;
public class OptionsButton extends MovieClip {
public function OptionsButton():void{
this.addEventListener(MouseEvent.MOUSE_DOWN, clickedOn);
}
function clickedOn(_arg1:MouseEvent):void{
if (stage != null){
stage.addChild(new OptionsScreen());
};
}
public function cleanup():void{
this.removeEventListener(MouseEvent.MOUSE_DOWN, clickedOn);
}
}
}//package
Section 316
//OptionsScreen (OptionsScreen)
package {
import flash.events.*;
import flash.display.*;
public class OptionsScreen extends MovieClip {
public var pathfinding_selector:OnOffSelectorMenu;
public var yes_btn:MovieClip;
public var portrait_selector:OnOffSelectorMenu;
public var quality_selector:QualitySelectorMenu;
public var showHintsBox:dCheckBox;
public var vc:VolumeControlMenu;
public var tooltip_selector:TooltipSelectorMenu;
public var blur_selector:OnOffSelectorMenu;
public function OptionsScreen(){
this.yes_btn.addEventListener(MouseEvent.MOUSE_DOWN, exitClick);
vc.init();
showHintsBox.setChecked(DungeonMain.showHints);
showHintsBox.setDescription("Show hints and tips");
pathfinding_selector.setTo(DungeonMain.pathfinding);
blur_selector.setTo(DungeonMain.combatBlur);
portrait_selector.setTo(DungeonMain.portraitHighlight);
}
function exitClick(_arg1:MouseEvent):void{
DungeonMain.showHints = showHintsBox.checked;
DungeonMain.combatBlur = blur_selector.isOn;
DungeonMain.portraitHighlight = portrait_selector.isOn;
DungeonMain.pathfinding = pathfinding_selector.isOn;
if (parent != null){
parent.removeChild(this);
} else {
if ((((dm.stage == null)) && (!((stage == null))))){
dm.stage = stage;
};
if (((!((dm.stage == null))) && (dm.stage.contains(this)))){
dm.stage.removeChild(this);
};
};
if (dm.main != null){
dm.main.saveInterface();
};
cleanup();
}
private function cleanup():void{
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, exitClick);
blur_selector.cleanup();
portrait_selector.cleanup();
quality_selector.cleanup();
tooltip_selector.cleanup();
pathfinding_selector.cleanup();
}
}
}//package
Section 317
//PageTurn (PageTurn)
package {
import flash.events.*;
import flash.display.*;
public class PageTurn extends MovieClip {
private var child:Sprite;
public var page:MovieClip;
public function PageTurn(_arg1:Sprite=null):void{
addFrameScript(1, frame2, 14, frame15);
this.gotoAndStop(1);
this.addEventListener(Event.ENTER_FRAME, onFrame);
if (_arg1 != null){
setChild(_arg1);
};
}
function frame15(){
this.stop();
this.remove();
}
public function remove():void{
this.removeEventListener(Event.ENTER_FRAME, onFrame);
if (((((!((child == null))) && (!((page == null))))) && (page.contains(child)))){
page.removeChild(child);
};
if (parent != null){
parent.removeChild(this);
};
}
function frame2(){
dm.sound.play(SoundControl.pageTurn);
}
public function onFrame(_arg1:Event):void{
if (currentFrame == totalFrames){
remove();
};
}
public function setChild(_arg1:Sprite):void{
if (((!((child == null))) && (page.contains(child)))){
page.removeChild(child);
};
this.child = _arg1;
page.addChild(_arg1);
}
public function animate():void{
this.gotoAndPlay(1);
}
}
}//package
Section 318
//Paperdoll (Paperdoll)
package {
import flash.display.*;
public class Paperdoll extends Sprite {
public var weapon:PaperdollEmptySlot;
public var legs:PaperdollEmptySlot;
public var ring:PaperdollEmptySlot;
public var armor:PaperdollEmptySlot;
public var gloves:PaperdollEmptySlot;
public var offhand:PaperdollEmptySlot;
public var boots:PaperdollEmptySlot;
public var cloak:PaperdollEmptySlot;
public var head:PaperdollEmptySlot;
public function Paperdoll():void{
}
public function getSlotX(_arg1:int):int{
var _local2:*;
_local2 = 0;
if (_arg1 == Equipment.head){
_local2 = head.x;
} else {
if (_arg1 == Equipment.armor){
_local2 = armor.x;
} else {
if (_arg1 == Equipment.gloves){
_local2 = gloves.x;
} else {
if (_arg1 == Equipment.boots){
_local2 = boots.x;
} else {
if (_arg1 == Equipment.back){
_local2 = cloak.x;
} else {
if (_arg1 == Equipment.weapon){
_local2 = weapon.x;
} else {
if (_arg1 == Equipment.offhand){
_local2 = offhand.x;
} else {
if (_arg1 == Equipment.ring){
_local2 = ring.x;
} else {
if (_arg1 == Equipment.legs){
_local2 = legs.x;
};
};
};
};
};
};
};
};
};
return (_local2);
}
public function getSlotY(_arg1:int):int{
var _local2:*;
_local2 = 0;
if (_arg1 == Equipment.head){
_local2 = head.y;
} else {
if (_arg1 == Equipment.armor){
_local2 = armor.y;
} else {
if (_arg1 == Equipment.gloves){
_local2 = gloves.y;
} else {
if (_arg1 == Equipment.boots){
_local2 = boots.y;
} else {
if (_arg1 == Equipment.back){
_local2 = cloak.y;
} else {
if (_arg1 == Equipment.weapon){
_local2 = weapon.y;
} else {
if (_arg1 == Equipment.offhand){
_local2 = offhand.y;
} else {
if (_arg1 == Equipment.ring){
_local2 = ring.y;
} else {
if (_arg1 == Equipment.legs){
_local2 = legs.y;
};
};
};
};
};
};
};
};
};
return (_local2);
}
}
}//package
Section 319
//PaperdollEmptySlot (PaperdollEmptySlot)
package {
import flash.display.*;
public dynamic class PaperdollEmptySlot extends MovieClip {
public function PaperdollEmptySlot(){
addFrameScript(0, frame1);
}
function frame1(){
this.gotoAndStop(1);
}
}
}//package
Section 320
//Party (Party)
package {
public class Party {
var overflow:Array;
var members:Array;
private var _stat_rooms_explored:int;// = 0
private var _difficultyMods:uint;// = 0
private var _stat_rooms_total:int;// = 0
private var _stat_party_defeats:int;// = 0
private var _gold:int;// = 0
private var _invFilter:int;
private var _stat_shrines_used:int;// = 0
private var _difficulty:int;
var inventory:Array;
private var _stat_hordes_defeated:int;// = 0
private var _campaign:int;// = 1
var save_slot:int;// = 1
private var _level:int;// = 1
private var _version:String;// = "1.0"
private var _sneaking:int;// = 0
private var _stat_member_deaths:int;// = 0
private var _stat_leaders_defeated:int;// = 0
private var _lootSettings:uint;
private var _sortAscending:Boolean;// = true
private var _invSort:int;
static const MAX_INVENTORY = 45;
static const SCORE_SHRINES = -150;
static const MAX_OVERFLOW = 15;
static const SCORE_DEATHS = -100;
static const SCORE_DEFEATS = -1000;
static const SCORE_LEVEL = 1000;
static const max_size = 4;
static const SCORE_LEADERS = 500;
public function Party():void{
var _local1:*;
var _local2:*;
members = new Array();
save_slot = 1;
inventory = new Array();
overflow = new Array();
_level = 1;
_campaign = 1;
_difficulty = Difficulty.STANDARD;
_difficultyMods = 0;
_version = "1.0";
_sneaking = 0;
_gold = 0;
_stat_party_defeats = 0;
_stat_member_deaths = 0;
_stat_shrines_used = 0;
_stat_hordes_defeated = 0;
_stat_leaders_defeated = 0;
_stat_rooms_explored = 0;
_stat_rooms_total = 0;
_lootSettings = LootSettings.defaultValues();
_invFilter = InventoryPanel.FILTER_ALL;
_invSort = InventoryPanel.SORT_NONE;
_sortAscending = true;
super();
_local1 = 0;
while (_local1 < 5) {
addToInventory(new SneakyScroll());
_local1++;
};
_local1 = 0;
while (_local1 < 5) {
addToInventory(new PotionHealthSmall());
_local1++;
};
_local1 = 0;
while (_local1 < 5) {
addToInventory(new PotionPowerSmall());
_local1++;
};
_local1 = 0;
while (_local1 < 5) {
addToInventory(new PotionReviveWeak());
_local1++;
};
if (DungeonMain.debugitems){
_local1 = 0;
while (_local1 < 5) {
addToInventory(new CleanSlate());
_local1++;
};
};
}
public function set level(_arg1:int):void{
this._level = _arg1;
}
public function duplicate():Party{
var _local1:Party;
_local1 = new Party();
_local1.save_slot = save_slot;
_local1.level = level;
_local1.campaign = campaign;
_local1.difficulty = difficulty;
_local1.difficultyMods = difficultyMods;
_local1.version = version;
_local1.sneaking = sneaking;
_local1.gold = gold;
_local1.stat_party_defeats = stat_party_defeats;
_local1.stat_member_deaths = stat_member_deaths;
_local1.stat_shrines_used = stat_shrines_used;
_local1.stat_hordes_defeated = stat_hordes_defeated;
_local1.stat_leaders_defeated = stat_leaders_defeated;
_local1.stat_rooms_explored = stat_rooms_explored;
_local1.stat_rooms_total = stat_rooms_total;
_local1.lootSettings = lootSettings;
_local1.invFilter = invFilter;
_local1.invSort = invSort;
_local1.sortAscending = sortAscending;
return (_local1);
}
public function get difficultyMods():uint{
return (this._difficultyMods);
}
public function get campaign():int{
return (this._campaign);
}
public function get hardcore():Boolean{
return (((this._difficultyMods & Difficulty.HARDCORE) == Difficulty.HARDCORE));
}
public function set difficultyMods(_arg1:uint):void{
this._difficultyMods = _arg1;
}
public function get stat_member_deaths():int{
return (this._stat_member_deaths);
}
public function setMemberPos(_arg1:PlayerCharacter, _arg2:int){
var _local3:*;
var _local4:*;
var _local5:Boolean;
var _local6:Boolean;
var _local7:PlayerCharacter;
var _local8:Boolean;
_local5 = false;
_local6 = false;
for each (_local7 in members) {
if (_local7.pos == _arg2){
_local5 = true;
};
if (_local7 == _arg1){
_local6 = true;
};
};
if (!(_local6)){
return;
};
if (_local5){
_local3 = 1;
while (_local3 <= 6) {
_local8 = true;
_local4 = 0;
while (_local4 < members.length) {
if (members[_local4].pos == _local3){
_local8 = false;
};
_local4++;
};
if (_local8){
_arg1.pos = _local3;
break;
};
_local3++;
};
} else {
_arg1.pos = _arg2;
};
}
public function addDeluxeLoot():void{
addAllOrangesFrom(new mDreadfather(level));
}
public function set campaign(_arg1:int):void{
this._campaign = _arg1;
}
public function destroyItem(_arg1:Item):Boolean{
var _local2:*;
var _local3:*;
_local2 = false;
_local3 = 0;
while (_local3 < Party.MAX_INVENTORY) {
if (inventory[_local3] == _arg1){
(inventory[_local3] == null);
inventory.splice(_local3, 1);
_local2 = true;
break;
};
_local3++;
};
if (!(_local2)){
_local3 = 0;
while (_local3 < Party.MAX_OVERFLOW) {
if (overflow[_local3] == _arg1){
(overflow[_local3] == null);
overflow.splice(_local3, 1);
_local2 = true;
break;
};
_local3++;
};
};
if (!(_local2)){
return (false);
};
balanceInventory();
return (true);
}
public function get invSort():int{
return (this._invSort);
}
public function needCampaignFragment():Boolean{
var _local1:Item;
if (campaign != Campaign.DELUXE){
return (false);
};
for each (_local1 in inventory) {
if ((_local1 is CampaignItemFragment)){
if (Consumable(_local1).stack >= 9){
return (false);
};
return (true);
} else {
if ((_local1 is CampaignItemStone)){
return (false);
};
};
};
return (true);
}
public function set stat_party_defeats(_arg1:int):void{
this._stat_party_defeats = _arg1;
}
public function getOverflowIndex(_arg1:Item):int{
var _local2:*;
_local2 = 0;
while (_local2 < overflow.length) {
if (this.overflow[_local2] == _arg1){
return (_local2);
};
_local2++;
};
return (-1);
}
public function set stat_member_deaths(_arg1:int):void{
this._stat_member_deaths = _arg1;
}
private function sameConsumableType(_arg1:Item, _arg2:Item):Boolean{
if ((((_arg1 is Consumable)) && ((_arg2 is Consumable)))){
if (_arg1.item_name == _arg2.item_name){
return (true);
};
return (false);
//unresolved jump
};
return (false);
}
public function fullRecovery():void{
var _local1:*;
_local1 = 0;
while (_local1 < members.length) {
members[_local1].health = members[_local1].health_max;
members[_local1].power = members[_local1].power_max;
members[_local1].clearStatusEffects();
_local1++;
};
}
public function levelUp():void{
var _local1:*;
_local1 = 0;
while (_local1 < members.length) {
members[_local1].levelUp();
_local1++;
};
}
public function getConsumables():Array{
var _local1:Item;
var _local2:Array;
_local2 = new Array();
for each (_local1 in inventory) {
if ((_local1 is Consumable)){
_local2.push(_local1);
};
};
for each (_local1 in overflow) {
if ((_local1 is Consumable)){
_local2.push(_local1);
};
};
return (_local2);
}
public function get sneaking():int{
return (this._sneaking);
}
public function get beginner():Boolean{
return ((this._difficulty == Difficulty.BEGINNER));
}
public function findEmptySlot(_arg1:Boolean):int{
var _local2:*;
if (_arg1){
_local2 = 1;
while (_local2 <= 3) {
if (memberInPos(_local2) == null){
return (_local2);
};
_local2++;
};
};
_local2 = 4;
while (_local2 <= 6) {
if (memberInPos(_local2) == null){
return (_local2);
};
_local2++;
};
if (_arg1){
return (0);
};
_local2 = 1;
while (_local2 <= 3) {
if (memberInPos(_local2) == null){
return (_local2);
};
_local2++;
};
return (0);
}
public function getTotalExplorePercent():Number{
return ((stat_rooms_explored / stat_rooms_total));
}
public function get tactical():Boolean{
return (((this._difficultyMods & Difficulty.TACTICAL) == Difficulty.TACTICAL));
}
public function set stat_leaders_defeated(_arg1:int):void{
this._stat_leaders_defeated = _arg1;
}
public function set invSort(_arg1:int):void{
this._invSort = _arg1;
}
public function isPartyDead():Boolean{
var _local1:*;
_local1 = 0;
while (_local1 < members.length) {
if ((((members[_local1].health > 0)) && ((members[_local1].summoned == false)))){
return (false);
};
_local1++;
};
return (true);
}
public function getMisc():Array{
var _local1:Item;
var _local2:Array;
_local2 = new Array();
for each (_local1 in inventory) {
if ((_local1 is Equipment)){
continue;
} else {
if ((_local1 is Consumable)){
continue;
} else {
_local2.push(_local1);
};
};
};
for each (_local1 in overflow) {
if ((_local1 is Equipment)){
continue;
} else {
if ((_local1 is Consumable)){
continue;
} else {
_local2.push(_local1);
};
};
};
return (_local2);
}
public function getLevelScore():int{
var _local1:int;
var _local2:Number;
var _local3:Number;
_local1 = 0;
_local2 = getTotalExplorePercent();
_local3 = getTotalClearPercent();
_local1 = (_local1 + (level * SCORE_LEVEL));
_local1 = (_local1 * (_local2 + _local3));
return (Math.round(_local1));
}
public function getAlly():PlayerCharacter{
var _local1:PlayerCharacter;
for each (_local1 in members) {
if ((_local1 is PC_Adventurer)){
return (_local1);
};
};
return (null);
}
public function get gold():int{
return (this._gold);
}
public function deathPenalty():Boolean{
var _local1:*;
var _local2:int;
var _local3:Array;
var _local4:int;
var _local5:int;
var _local6:Boolean;
_local1 = false;
fullRecovery();
if (this.beginner){
return (false);
};
_local2 = 0;
while (_local2 < members.length) {
_local1 = ((members[_local2].loseRandomEquipment()) || (_local1));
_local2++;
};
_local3 = dm.shuffleArray(inventory);
_local4 = 0;
_local5 = 0;
while (_local5 < _local3.length) {
if (_local4 >= 2){
break;
};
if ((_local3[_local5] is Equipment)){
_local6 = destroyItem(_local3[_local5]);
if (_local6){
_local1 = true;
_local4++;
};
};
_local5++;
};
return (_local1);
}
public function memberInPos(_arg1:int):PlayerCharacter{
var _local2:PlayerCharacter;
if (_arg1 <= 0){
return (null);
};
if (_arg1 > 6){
return (null);
};
for each (_local2 in members) {
if (_local2.pos == _arg1){
return (_local2);
};
};
return (null);
}
public function set difficulty(_arg1:int):void{
this._difficulty = _arg1;
}
public function get stat_hordes_defeated():int{
return (this._stat_hordes_defeated);
}
public function get level():int{
return (this._level);
}
public function scanForItemUpdates():Boolean{
var _local1:Array;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
return (false);
_local3 = 0;
while (_local3 < _local1.length) {
_local5 = Item(_local1[_local3]).item_level;
if (_local5 > 9){
if ((_local1[_local3] is Weapon)){
_local7 = (30 * (_local5 - 1));
_local8 = Math.round((Weapon(_local1[_local3]).damage / (((_local5 - 1) * (_local7 / 300)) + 1)));
Weapon(_local1[_local3]).damage = Weapon(_local1[_local3]).scaleWeaponDamageForLevel(_local8);
} else {
if ((_local1[_local3] is iPlateGloves)){
if (_local1[_local3].icon_frame == 108){
_local1[_local3].icon_frame = 110;
} else {
if (_local1[_local3].icon_frame == 107){
_local1[_local3].icon_frame = 109;
};
};
};
};
_local6 = 0;
if (_local1[_local3].mod_strength){
_local6 = _local1[_local3].mod_strength;
if (_local6 <= Equipment.max_stat_for_purple){
_local1[_local3].mod_strength = 0;
_local1[_local3].setStrength((_local6 - 2), _local6);
};
};
if (_local1[_local3].mod_endurance){
_local6 = _local1[_local3].mod_endurance;
if (_local6 <= Equipment.max_stat_for_purple){
_local1[_local3].mod_endurance = 0;
_local1[_local3].setEndurance((_local6 - 2), _local6);
};
};
if (_local1[_local3].mod_dexterity){
_local6 = _local1[_local3].mod_dexterity;
if (_local6 <= Equipment.max_stat_for_purple){
_local1[_local3].mod_dexterity = 0;
_local1[_local3].setDexterity((_local6 - 2), _local6);
};
};
if (_local1[_local3].mod_intellect){
_local6 = _local1[_local3].mod_intellect;
if (_local6 <= Equipment.max_stat_for_purple){
_local1[_local3].mod_intellect = 0;
_local1[_local3].setIntellect((_local6 - 2), _local6);
};
};
};
_local3++;
};
_local3 = 0;
while (_local3 < 4) {
addToInventory(new CleanSlate());
_local3++;
};
return (true);
}
public function roomMovedRegen(_arg1:int=1):Boolean{
var _local2:Boolean;
var _local3:int;
var _local4:int;
var _local5:PlayerCharacter;
if (_arg1 <= 0){
return (false);
};
_local2 = false;
for each (_local5 in members) {
if (_local5.health < _local5.health_max){
_local3 = Math.round(((_local5.getHealthRegen() * _arg1) / 3));
_local5.increaseHealth(_local3);
_local2 = true;
};
if (_local5.power < _local5.power_max){
_local4 = Math.round(((_local5.getPowerRegen() * _arg1) / 3));
_local5.increasePower(_local4);
_local2 = true;
};
};
return (_local2);
}
public function set invFilter(_arg1:int):void{
this._invFilter = _arg1;
}
public function get stat_party_defeats():int{
return (this._stat_party_defeats);
}
public function getHealthPotion(_arg1:Boolean=false):Consumable{
var _local2:Item;
for each (_local2 in inventory) {
if (_arg1){
if ((_local2 is PotionHealthSmall)){
return (Consumable(_local2));
};
} else {
if ((_local2 is PotionHealth)){
return (Consumable(_local2));
};
};
};
return (null);
}
public function addDemonLoot():void{
addAllOrangesFrom(new mDemon(level));
}
public function removeQuestItems():void{
var _local1:Item;
for each (_local1 in inventory) {
if (_local1.item_rarity == Item.quest){
destroyItem(_local1);
};
};
}
public function set sneaking(_arg1:int):void{
this._sneaking = _arg1;
}
public function set stat_rooms_total(_arg1:int):void{
this._stat_rooms_total = _arg1;
}
public function get extreme():Boolean{
return ((this._difficulty == Difficulty.EXTREME));
}
public function set stat_shrines_used(_arg1:int):void{
this._stat_shrines_used = _arg1;
}
public function set version(_arg1:String):void{
this._version = _arg1;
}
public function get stat_leaders_defeated():int{
return (this._stat_leaders_defeated);
}
public function get attrition():Boolean{
return (((this._difficultyMods & Difficulty.ATTRITION) == Difficulty.ATTRITION));
}
public function removeFromInventory(_arg1:Item):Boolean{
var _local2:*;
var _local3:int;
_local2 = false;
_local3 = getItemIndex(_arg1);
if (_local3 >= 0){
inventory.splice(_local3, 1);
_local2 = true;
} else {
_local3 = getOverflowIndex(_arg1);
if (_local3 >= 0){
overflow.splice(_local3, 1);
_local2 = true;
};
};
if (_local2){
balanceInventory();
};
return (_local2);
}
public function hasAlly():Boolean{
var _local1:PlayerCharacter;
for each (_local1 in members) {
if ((_local1 is PC_Adventurer)){
return (true);
};
};
return (false);
}
public function get difficulty():int{
return (this._difficulty);
}
public function set gold(_arg1:int):void{
this._gold = _arg1;
}
public function getPowerPotion(_arg1:Boolean=false):Consumable{
var _local2:Item;
for each (_local2 in inventory) {
if (_arg1){
if ((_local2 is PotionPowerSmall)){
return (Consumable(_local2));
};
} else {
if ((_local2 is PotionPower)){
return (Consumable(_local2));
};
};
};
return (null);
}
public function set sortAscending(_arg1:Boolean):void{
this._sortAscending = _arg1;
}
public function set stat_rooms_explored(_arg1:int):void{
this._stat_rooms_explored = _arg1;
}
public function addToInventory(_arg1:Item):Boolean{
var _local2:int;
if (_arg1 == null){
return (false);
};
if ((_arg1 is Consumable)){
_local2 = 0;
while (_local2 < inventory.length) {
if (sameConsumableType(inventory[_local2], _arg1)){
inventory[_local2].stack++;
return (true);
};
_local2++;
};
_local2 = 0;
while (_local2 < overflow.length) {
if (sameConsumableType(overflow[_local2], _arg1)){
overflow[_local2].stack++;
return (true);
};
_local2++;
};
};
if (inventory.length < Party.MAX_INVENTORY){
inventory.push(_arg1);
return (true);
};
if (overflow.length < Party.MAX_OVERFLOW){
overflow.push(_arg1);
return (true);
};
return (false);
}
public function get invFilter():int{
return (this._invFilter);
}
public function getItemIndex(_arg1:Item):int{
var _local2:*;
_local2 = 0;
while (_local2 < inventory.length) {
if (this.inventory[_local2] == _arg1){
return (_local2);
};
_local2++;
};
return (-1);
}
public function get stat_rooms_total():int{
return (this._stat_rooms_total);
}
public function set lootSettings(_arg1:int):void{
this._lootSettings = _arg1;
}
public function get stat_shrines_used():int{
return (this._stat_shrines_used);
}
public function get version():String{
return (this._version);
}
public function get sortAscending():Boolean{
return (this._sortAscending);
}
public function getScore(_arg1:Boolean=true):int{
var _local2:int;
var _local3:Number;
_local2 = 0;
_local2 = (_local2 + getLevelScore());
_local2 = (_local2 + (stat_leaders_defeated * SCORE_LEADERS));
_local2 = (_local2 + (stat_member_deaths * SCORE_DEATHS));
_local2 = (_local2 + (stat_shrines_used * SCORE_SHRINES));
_local2 = (_local2 + (stat_party_defeats * SCORE_DEFEATS));
if (_arg1){
_local3 = Difficulty.getMultiplier(difficulty, difficultyMods);
_local2 = Math.round((_local2 * (_local3 / 100)));
};
return (_local2);
}
public function getEquipment():Array{
var _local1:Item;
var _local2:Array;
_local2 = new Array();
for each (_local1 in inventory) {
if ((_local1 is Equipment)){
_local2.push(_local1);
};
};
for each (_local1 in overflow) {
if ((_local1 is Equipment)){
_local2.push(_local1);
};
};
return (_local2);
}
public function get stat_rooms_explored():int{
return (this._stat_rooms_explored);
}
public function getTotalClearPercent():Number{
return ((stat_hordes_defeated / (level * 10)));
}
public function balanceInventory():void{
while (((overflow.length) && ((inventory.length < Party.MAX_INVENTORY)))) {
inventory.push(overflow[0]);
overflow.splice(0, 1);
};
}
public function unequipItem(_arg1:Equipment):Boolean{
var _local2:*;
var _local3:*;
var _local4:*;
_local2 = false;
_local3 = -1;
_local4 = 0;
while (_local4 < members.length) {
if (members[_local4].gear[_arg1.slot] == _arg1){
_local3 = _local4;
break;
};
_local4++;
};
if (_local3 != -1){
if (addToInventory(_arg1)){
members[_local3].gear[_arg1.slot] = null;
_local2 = true;
};
} else {
_local2 = true;
};
return (_local2);
}
public function get lootSettings():int{
return (this._lootSettings);
}
public function addAllOrangesFrom(_arg1:MonsterCharacter):void{
var _local2:Array;
var _local3:Item;
_local2 = _arg1.getUniqueItems(level);
for each (_local3 in _local2) {
addToInventory(_local3);
};
}
public function set stat_hordes_defeated(_arg1:int):void{
this._stat_hordes_defeated = _arg1;
}
}
}//package
Section 321
//PartyCreation (PartyCreation)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
public class PartyCreation extends MovieClip {
var tooltip:Tooltip;
public var optionsButton:OptionsBookButton;
public var empty1:SimpleButton;
public var empty4:SimpleButton;
public var enter_button:SimpleButton;
public var empty3:SimpleButton;
var pc_party:Party;
public var char3:CharCreationPanel;
public var empty2:SimpleButton;
public var char1:CharCreationPanel;
public var char2:CharCreationPanel;
var timerCount;// = 0
public var char4:CharCreationPanel;
var addCharTimer:Timer;
public function PartyCreation():void{
var _local1:*;
var _local2:*;
var _local3:SimpleButton;
timerCount = 0;
super();
pc_party = new Party();
enter_button.addEventListener(MouseEvent.MOUSE_DOWN, enterClick);
_local1 = 1;
while (_local1 <= 4) {
_local2 = CharCreationPanel(getChildByName(("char" + _local1)));
_local2.slot = _local1;
_local2.createChar();
_local3 = SimpleButton(getChildByName(("empty" + _local1)));
if (_local3 != null){
_local3.addEventListener(MouseEvent.MOUSE_DOWN, createClick);
_local3.y = -400;
};
_local1++;
};
}
public function isNameTaken(_arg1:String):Boolean{
var _local2:*;
var _local3:CharCreationPanel;
_local2 = 1;
while (_local2 <= 4) {
_local3 = CharCreationPanel(getChildByName(("char" + _local2)));
if (_local3.char == null){
} else {
if (_local3.char.charname == _arg1){
return (true);
};
};
_local2++;
};
return (false);
}
function createClick(_arg1:MouseEvent):void{
var _local2:*;
var _local3:CharCreationPanel;
_local2 = 1;
while (_local2 <= 4) {
if (_arg1.currentTarget == getChildByName(("empty" + _local2))){
_local3 = CharCreationPanel(getChildByName(("char" + _local2)));
if (_local3 != null){
_local3.createChar();
_local3.y = _arg1.currentTarget.y;
_arg1.currentTarget.y = -200;
};
};
_local2++;
};
}
private function charCount():int{
var _local1:*;
var _local2:*;
var _local3:*;
_local1 = 0;
_local2 = 1;
while (_local2 <= 4) {
_local3 = CharCreationPanel(getChildByName(("char" + _local2)));
if (_local3 == null){
} else {
if (_local3.char == null){
} else {
_local1++;
};
};
_local2++;
};
return (_local1);
}
function enterClick(_arg1:MouseEvent):void{
var _local2:CharCreationPanel;
var _local3:int;
var _local4:WarningDialog;
var _local5:*;
var _local6:*;
_local3 = charCount();
if (_local3 == 0){
_local4 = new WarningDialog();
_local4.setText("You must add some characters to your party before entering the dungeon.");
addChild(_local4);
return;
};
pc_party.members.length = 0;
_local5 = 1;
while (_local5 <= 4) {
_local2 = CharCreationPanel(getChildByName(("char" + _local5)));
if (_local2 == null){
} else {
if (_local2.char == null){
} else {
if (((DungeonMain.LOCKED) && ((_local2.selected_class == PlayerCharacter.CONJUROR)))){
_local4 = new WarningDialog();
_local4.setText("The Conjuror class cannot be used on this site. Please select a different class before proceeding.");
addChild(_local4);
return;
};
_local2.finalize();
_local6 = pc_party.members.push(convertClass(_local2.char, _local2.selected_class));
};
};
_local5++;
};
this.cleanup();
dm.main.creationFinished(pc_party);
}
function addCharTimerTick(_arg1:TimerEvent):void{
var _local2:*;
timerCount++;
_local2 = CharCreationPanel(getChildByName(("char" + timerCount)));
if (_local2 == null){
return;
};
if (_local2.char != null){
return;
};
if (_local2.animating){
return;
};
_local2.createChar();
}
public function cleanup():void{
var _local1:*;
enter_button.removeEventListener(MouseEvent.MOUSE_DOWN, enterClick);
empty1.removeEventListener(MouseEvent.MOUSE_DOWN, createClick);
empty2.removeEventListener(MouseEvent.MOUSE_DOWN, createClick);
empty3.removeEventListener(MouseEvent.MOUSE_DOWN, createClick);
empty4.removeEventListener(MouseEvent.MOUSE_DOWN, createClick);
optionsButton.cleanup();
_local1 = 1;
while (_local1 <= 4) {
CharCreationPanel(getChildByName(("char" + _local1))).cleanup();
_local1++;
};
}
private function convertClass(_arg1:PlayerCharacter, _arg2:int):PlayerCharacter{
var _local3:*;
var _local4:*;
var _local5:Boolean;
var _local6:PlayerCharacter;
_local3 = _arg1.charname;
_local4 = _arg1.portrait;
_local5 = _arg1.male;
if (_arg2 == PlayerCharacter.WARRIOR){
_local6 = new PC_Warrior(pc_party);
} else {
if (_arg2 == PlayerCharacter.MAGE){
_local6 = new PC_Mage(pc_party);
} else {
if (_arg2 == PlayerCharacter.RANGER){
_local6 = new PC_Ranger(pc_party);
} else {
if (_arg2 == PlayerCharacter.ROGUE){
_local6 = new PC_Rogue(pc_party);
} else {
if (_arg2 == PlayerCharacter.CLERIC){
_local6 = new PC_Cleric(pc_party);
} else {
if (_arg2 == PlayerCharacter.CONJUROR){
_local6 = new PC_Conjuror(pc_party);
} else {
if (_arg2 == PlayerCharacter.BARBARIAN){
_local6 = new PC_Barbarian(pc_party);
};
};
};
};
};
};
};
_local6.charname = _local3;
_local6.portrait = _local4;
_local6.male = _local5;
_local6.useCustomPortrait = _arg1.useCustomPortrait;
_local6.customPortraitUrl = _arg1.customPortraitUrl;
_local6.customPortrait = _arg1.customPortrait;
return (_local6);
}
function backClick(_arg1:MouseEvent):void{
pc_party = null;
if (((parent) && ((parent is DungeonMain)))){
this.cleanup();
DungeonMain(parent).loadGameMenu();
DungeonMain(parent).removeChild(this);
};
}
}
}//package
Section 322
//PassiveSkillIcon (PassiveSkillIcon)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class PassiveSkillIcon extends MovieClip {
var tooltip:PassiveSkillTooltip;
private var mousingOver:Boolean;// = false
public var skillRank:TextField;
private var mouseOverFrames:int;// = 0
public var char_ref:PlayerCharacter;
private var mousedOverEvent:MouseEvent;
private var offense:Boolean;// = true
public function PassiveSkillIcon():void{
offense = true;
mousingOver = false;
mouseOverFrames = 0;
super();
addFrameScript(0, frame1);
this.addEventListener(MouseEvent.MOUSE_OVER, mouseOverTarget);
this.addEventListener(MouseEvent.MOUSE_OUT, mouseOutTarget);
this.addEventListener(Event.ADDED_TO_STAGE, added);
this.addEventListener(Event.ENTER_FRAME, onFrame);
}
function added(_arg1:Event):void{
this.addEventListener(Event.REMOVED_FROM_STAGE, removed);
}
public function updateSkill(_arg1:PlayerCharacter, _arg2:Boolean):void{
this.char_ref = _arg1;
this.offense = _arg2;
this.gotoAndStop(_arg1.getPassiveSkillIcon(_arg2));
if (_arg2){
setSkillRank(char_ref.passive_skill_offense);
} else {
setSkillRank(char_ref.passive_skill_defense);
};
}
function mouseOverTarget(_arg1:MouseEvent):void{
mousingOver = true;
mouseOverFrames = 0;
mousedOverEvent = _arg1;
}
private function newTooltip(_arg1:MouseEvent):Boolean{
var _local2:int;
var _local3:String;
var _local4:String;
_local2 = 0;
if (offense){
_local2 = char_ref.passive_skill_offense;
} else {
_local2 = char_ref.passive_skill_defense;
};
if (((!((parent == null))) && ((parent is BuySkills)))){
if (offense){
_local2 = (_local2 + BuySkills(parent).pass1_points);
} else {
_local2 = (_local2 + BuySkills(parent).pass2_points);
};
};
_local3 = char_ref.getPassiveSkillName(offense);
_local4 = char_ref.getPassiveSkillDescription(offense, _local2);
tooltip = new PassiveSkillTooltip(_local3, _local4, _local2);
tooltip.mouseEnabled = false;
tooltip.mouseChildren = false;
tooltip.name = "tooltip_skill";
tooltip.setForEvent(_arg1);
if (stage != null){
stage.addChild(tooltip);
return (true);
};
return (false);
}
function mouseOutTarget(_arg1:MouseEvent):void{
if (tooltip != null){
tooltip.fade();
tooltip = null;
};
mousingOver = false;
mouseOverFrames = 0;
}
function frame1(){
this.stop();
}
function removed(_arg1:Event):void{
this.removeEventListener(Event.REMOVED_FROM_STAGE, removed);
if (this.tooltip != null){
mouseOutTarget(null);
};
}
public function cleanup():void{
this.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverTarget);
this.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutTarget);
this.removeEventListener(Event.ADDED_TO_STAGE, added);
this.removeEventListener(Event.ENTER_FRAME, onFrame);
}
private function onFrame(_arg1:Event):void{
if (mousingOver){
mouseOverFrames++;
};
if (mouseOverFrames > Tooltip.delayFrames){
newTooltip(mousedOverEvent);
mousingOver = false;
mouseOverFrames = 0;
};
}
public function setSkillRank(_arg1:int):void{
skillRank.text = (String(_arg1) + "/25");
}
}
}//package
Section 323
//PassiveSkillTooltip (PassiveSkillTooltip)
package {
import flash.text.*;
import flash.display.*;
public class PassiveSkillTooltip extends Tooltip {
public var tooltip_bg:Sprite;
public var rank_label:TextField;
public var text_label:TextField;
public var title_label:TextField;
public function PassiveSkillTooltip(_arg1:String="", _arg2:String="", _arg3:int=0){
if (_arg1 == null){
_arg1 = "Blank";
};
if (_arg2 == null){
_arg2 = "Tooltip contents failed to load.";
};
title_label.text = _arg1;
dmf.embolden(title_label);
rank_label.text = (("Rank " + String(_arg3)) + "/25");
text_label.text = _arg2;
text_label.autoSize = TextFieldAutoSize.CENTER;
tooltip_bg.height = ((text_label.y + text_label.height) + 15);
}
}
}//package
Section 324
//pBloodSprite (pBloodSprite)
package {
public class pBloodSprite extends PlayerSummon {
public function pBloodSprite(_arg1:int=1){
super(_arg1);
classname = "Bloodsprite";
charname = "Bloodsprite";
portrait = CharGraphic.sprite_red;
description = "Summoned.";
quickness = 60;
power_per_turn = 0;
health_max = Math.round((health_max * 0.5));
health = health_max;
damage = Math.round((damage * 0.5));
skills.push(new sSummonAttack(this));
skills.push(new sSpriteRestoreHealth(this));
initSummonSkills();
}
}
}//package
Section 325
//PC_Adventurer (PC_Adventurer)
package {
public class PC_Adventurer extends PlayerCharacter {
public function PC_Adventurer(_arg1:Party=null):void{
var _local2:int;
super();
this.party = _arg1;
if (_arg1 != null){
this.level = _arg1.level;
} else {
this.level = 1;
};
_local2 = Math.round((1 + (level * (STATS_PER_LEVEL + 1.5))));
strength = _local2;
endurance = _local2;
dexterity = _local2;
intellect = _local2;
quickness = 50;
charname = randomName(true);
playerclass = PlayerCharacter.ADVENTURER;
classname = "Adventurer";
description = "Cannot be revived.";
portrait = CharGraphic.adventurer;
pos = 0;
poisonResist = 25;
stunResist = 50;
health_max = getMaxHealth();
health = health_max;
damage = getAdvDamage();
initAdvSkills();
}
override public function canQuickRetreat():Boolean{
return (false);
}
public function getAdvDamage():int{
var _local1:int;
_local1 = Weapon.scaleWeaponDamageForLevelNew(Weapon.sword_base_damage, this.level);
_local1 = (_local1 + (strength * PlayerCharacter.DAMAGE_PER_STAT));
return (_local1);
}
override public function reduceHealth(_arg1:int):int{
var _local2:*;
if (invulnerable){
return (0);
};
_local2 = health;
health = (health - _arg1);
if ((((health < cannotDieMin)) && ((cannotDie > 0)))){
health = Math.min(_local2, cannotDieMin);
};
if (health < 0){
health = 0;
clearStatusEffects();
};
if (health > health_max){
health = health_max;
};
return ((_local2 - health));
}
override public function getEvilClone():MonsterCharacter{
return (null);
}
public function initAdvSkills():void{
var _local1:*;
skills.length = 0;
skills.push(new sAdventurerAttack(this));
skills.push(new sAdventurerThrow(this));
skills.push(new sAdventurerHeal(this));
_local1 = 0;
while (_local1 < skills.length) {
skills[_local1].position = (_local1 + 1);
skills[_local1].active = true;
_local1++;
};
}
}
}//package
Section 326
//PC_Barbarian (PC_Barbarian)
package {
public class PC_Barbarian extends PlayerCharacter {
public static const OFFENSE_PER_POINT:int = 2;
public static const DEFENSE_PER_POINT:int = 4;
public function PC_Barbarian(_arg1:Party=null){
this.party = _arg1;
quickness = 55;
health_max = getMaxHealth();
health = health_max;
level = 1;
charname = "Bruce";
playerclass = PlayerCharacter.BARBARIAN;
classname = "Barbarian";
portrait = CharGraphic.warrior1;
pos = 0;
skills.push(new sWeaponAttack(this));
skills.push(new sBarbarianReckless(this));
skills.push(new sBarbarianCharge(this));
skills.push(new sBarbarianBrutalize(this));
skills.push(new sBarbarianPulverize(this));
skills.push(new sBarbarianJostle(this));
skills.push(new sBarbarianBoast(this));
skills.push(new sBarbarianWhirlwind(this));
skills.push(new sBarbarianPowerGain(this));
skills.push(new sBarbarianIntimidate(this));
skills.push(new sBarbarianLastStand(this));
setActiveSkillsDefault();
generateDefaultGear();
}
override public function getPassiveSkillDescription(_arg1:Boolean, _arg2:int=-1):String{
var _local3:int;
var _local4:String;
_local3 = 0;
if (_arg2 != -1){
_local3 = _arg2;
} else {
if (_arg1){
_local3 = passive_skill_offense;
} else {
_local3 = passive_skill_defense;
};
};
if (_arg1){
_local4 = String(Math.round((OFFENSE_PER_POINT * _local3)));
} else {
_local4 = String(Math.round((DEFENSE_PER_POINT * _local3)));
};
if (_arg1){
return ((((("Each skill rank:\n" + String(OFFENSE_PER_POINT)) + "% chance that an attack will cause 50% additional damage.\n\nCurrent: ") + _local4) + "%"));
};
return ((((("Each skill rank:\n" + String(DEFENSE_PER_POINT)) + "% chance when damage received that damage inflicted next turn increases by 30%.\n\nCurrent: ") + _local4) + "%"));
}
override public function getPassiveSkillIcon(_arg1:Boolean):int{
if (_arg1){
return (14);
};
return (13);
}
override public function getPassiveSkillName(_arg1:Boolean):String{
if (_arg1){
return ("Brutality");
};
return ("Vengeance");
}
public function generateDefaultGear(){
this.gear[Equipment.armor] = new iLeatherChest(1, Item.grey);
this.gear[Equipment.gloves] = new iLeatherGloves(1, Item.grey);
this.gear[Equipment.legs] = new iLeatherLegs(1, Item.grey);
this.gear[Equipment.boots] = new iLeatherBoots(1, Item.grey);
this.gear[Equipment.weapon] = new iAxe(1, Item.grey);
}
public function get brutality():int{
return (Math.round((OFFENSE_PER_POINT * passive_skill_offense)));
}
public function get vengeance():int{
return (Math.round((DEFENSE_PER_POINT * passive_skill_defense)));
}
}
}//package
Section 327
//PC_Cleric (PC_Cleric)
package {
public class PC_Cleric extends PlayerCharacter {
public static const WRATH_PER_POINT:int = 3;
public static const BENEDICTION_PER_POINT:int = 4;
public function PC_Cleric(_arg1:Party=null){
this.party = _arg1;
quickness = 45;
charname = "Jeremy";
playerclass = PlayerCharacter.CLERIC;
classname = "Cleric";
portrait = CharGraphic.cleric1;
pos = 0;
health_max = getMaxHealth();
health = health_max;
skills.push(new sWeaponAttack(this));
skills.push(new sClericHeal(this));
skills.push(new sClericSmite(this));
skills.push(new sClericFlash(this));
skills.push(new sClericHealGroup(this));
skills.push(new sClericDamageBuff(this));
skills.push(new sClericRevive(this));
skills.push(new sClericAE(this));
skills.push(new sClericPurify(this));
skills.push(new sClericShield(this));
skills.push(new sClericMelee(this));
setActiveSkillsDefault();
generateDefaultGear();
}
override public function getPassiveSkillDescription(_arg1:Boolean, _arg2:int=-1):String{
var _local3:int;
var _local4:String;
_local3 = 0;
if (_arg2 != -1){
_local3 = _arg2;
} else {
if (_arg1){
_local3 = passive_skill_offense;
} else {
_local3 = passive_skill_defense;
};
};
if (_arg1){
_local4 = String(Math.round((WRATH_PER_POINT * _local3)));
} else {
_local4 = String(Math.round((BENEDICTION_PER_POINT * _local3)));
};
if (_arg1){
return ((((("Each skill rank:\n" + String(WRATH_PER_POINT)) + "% chance that the Smite spell will stun the target.\n\nCurrent: ") + _local4) + "%"));
};
return ((((("Each skill rank:\n" + String(BENEDICTION_PER_POINT)) + "% chance that the Heal spell will remove all negative afflictions from the target.\n\nCurrent: ") + _local4) + "%"));
}
public function get benediction():int{
return (Math.round((BENEDICTION_PER_POINT * passive_skill_defense)));
}
override public function getPassiveSkillIcon(_arg1:Boolean):int{
if (_arg1){
return (5);
};
return (4);
}
override public function getPassiveSkillName(_arg1:Boolean):String{
if (_arg1){
return ("Wrath");
};
return ("Benediction");
}
public function generateDefaultGear(){
var _local1:Armor;
var _local2:*;
_local1 = new iPlateBreastplate(1, Item.grey);
this.gear[_local1.slot] = _local1;
_local1 = new iPlateGloves(1, Item.grey);
this.gear[_local1.slot] = _local1;
_local1 = new iPlateBoots(1, Item.grey);
this.gear[_local1.slot] = _local1;
_local1 = new iPlateGreaves(1, Item.grey);
this.gear[_local1.slot] = _local1;
_local2 = new iMace(1, Item.grey);
this.gear[_local2.slot] = _local2;
}
public function get wrath():int{
return (Math.round((WRATH_PER_POINT * passive_skill_offense)));
}
}
}//package
Section 328
//PC_Conjuror (PC_Conjuror)
package {
public class PC_Conjuror extends PlayerCharacter {
public static const AUG_STRENGTH_PER_POINT:int = 2;
public static const AUG_HEALTH_PER_POINT:int = 2;
public function PC_Conjuror(_arg1:Party=null):void{
this.party = _arg1;
quickness = 40;
charname = "Hubert";
playerclass = PlayerCharacter.CONJUROR;
classname = "Conjuror";
portrait = CharGraphic.mage1;
pos = 0;
health_max = getMaxHealth();
health = health_max;
skills.push(new sMageAttack(this));
skills.push(new sConjurorWolf(this));
skills.push(new sConjurorShadow(this));
skills.push(new sConjurorManaSprite(this));
skills.push(new sConjurorBloodSprite(this));
skills.push(new sConjurorWargolem(this));
skills.push(new sConjurorWhirlwind(this));
skills.push(new sConjurorBanish(this));
skills.push(new sConjurorHeal(this));
skills.push(new sConjurorArmor(this));
skills.push(new sConjurorRevive(this));
setActiveSkillsDefault();
generateDefaultGear();
}
override public function getPassiveSkillDescription(_arg1:Boolean, _arg2:int=-1):String{
var _local3:int;
var _local4:String;
_local3 = 0;
if (_arg2 != -1){
_local3 = _arg2;
} else {
if (_arg1){
_local3 = passive_skill_offense;
} else {
_local3 = passive_skill_defense;
};
};
if (_arg1){
_local4 = String(Math.round((AUG_STRENGTH_PER_POINT * _local3)));
} else {
_local4 = String(Math.round((AUG_HEALTH_PER_POINT * _local3)));
};
if (_arg1){
return ((((("Each skill rank:\n" + String(AUG_STRENGTH_PER_POINT)) + "% extra damage for summoned creatures' attacks.\n\nCurrent: ") + _local4) + "%"));
};
return ((((("Each skill rank:\n" + String(AUG_HEALTH_PER_POINT)) + "% extra health for summoned creatures.\n\nCurrent: ") + _local4) + "%"));
}
public function get aug_strength():int{
return (Math.round((AUG_STRENGTH_PER_POINT * passive_skill_offense)));
}
override public function getPassiveSkillIcon(_arg1:Boolean):int{
if (_arg1){
return (8);
};
return (9);
}
override public function getPassiveSkillName(_arg1:Boolean):String{
if (_arg1){
return ("Augment Strength");
};
return ("Augment Health");
}
public function generateDefaultGear(){
this.gear[Equipment.head] = new iClothHat(1, Item.grey);
this.gear[Equipment.armor] = new iClothRobe(1, Item.grey);
this.gear[Equipment.gloves] = new iClothGloves(1, Item.grey);
this.gear[Equipment.legs] = new iClothLegs(1, Item.grey);
this.gear[Equipment.boots] = new iClothShoes(1, Item.grey);
this.gear[Equipment.weapon] = new iStaff(1, Item.grey);
}
public function get aug_health():int{
return (Math.round((AUG_HEALTH_PER_POINT * passive_skill_defense)));
}
}
}//package
Section 329
//PC_Mage (PC_Mage)
package {
public class PC_Mage extends PlayerCharacter {
public static const OFFENSE_PER_POINT:int = 1;
public static const DEFENSE_PER_POINT:int = 1;
public function PC_Mage(_arg1:Party=null){
this.party = _arg1;
quickness = 40;
charname = "Errol";
playerclass = PlayerCharacter.MAGE;
classname = "Mage";
portrait = CharGraphic.mage1;
pos = 0;
health_max = getMaxHealth();
health = health_max;
skills.push(new sMageAttack(this));
skills.push(new sMageBolt(this));
skills.push(new sMageExplosion(this));
skills.push(new sMageAE(this));
skills.push(new sMagePrison(this));
skills.push(new sMageInvisibility(this));
skills.push(new sMageArmor(this));
skills.push(new sMageThorns(this));
skills.push(new sMageSword(this));
skills.push(new sMageTouch(this));
skills.push(new sMageDrain(this));
setActiveSkillsDefault();
generateDefaultGear();
}
override public function getPassiveSkillDescription(_arg1:Boolean, _arg2:int=-1):String{
var _local3:int;
var _local4:String;
_local3 = 0;
if (_arg2 != -1){
_local3 = _arg2;
} else {
if (_arg1){
_local3 = passive_skill_offense;
} else {
_local3 = passive_skill_defense;
};
};
if (_arg1){
_local4 = String(Math.round((OFFENSE_PER_POINT * _local3)));
} else {
_local4 = String(Math.round((DEFENSE_PER_POINT * _local3)));
};
if (_arg1){
return ((((("Each skill rank:\n" + String(OFFENSE_PER_POINT)) + "% chance that no power cost will be deducted when casting a spell.\n\nCurrent: ") + _local4) + "%"));
};
return ((((("Each skill rank:\n" + String(DEFENSE_PER_POINT)) + "% chance that incoming damage will be nullified at the cost of 10 power.\n\nCurrent: ") + _local4) + "%"));
}
public function get mastery():int{
return (Math.round((OFFENSE_PER_POINT * passive_skill_offense)));
}
override public function getPassiveSkillIcon(_arg1:Boolean):int{
if (_arg1){
return (10);
};
return (11);
}
override public function getPassiveSkillName(_arg1:Boolean):String{
if (_arg1){
return ("Spell Mastery");
};
return ("Shielding");
}
public function generateDefaultGear(){
this.gear[Equipment.head] = new iClothHat(1, Item.grey);
this.gear[Equipment.armor] = new iClothRobe(1, Item.grey);
this.gear[Equipment.gloves] = new iClothGloves(1, Item.grey);
this.gear[Equipment.legs] = new iClothLegs(1, Item.grey);
this.gear[Equipment.boots] = new iClothShoes(1, Item.grey);
this.gear[Equipment.weapon] = new iStaff(1, Item.grey);
}
public function get shielding():int{
return (Math.round((DEFENSE_PER_POINT * passive_skill_defense)));
}
}
}//package
Section 330
//PC_Ranger (PC_Ranger)
package {
public class PC_Ranger extends PlayerCharacter {
public static const OFFENSE_PER_POINT:int = 2;
public static const DEFENSE_PER_POINT:int = 1;
public function PC_Ranger(_arg1:Party=null):void{
this.party = _arg1;
quickness = 55;
charname = "Hamish";
playerclass = PlayerCharacter.RANGER;
classname = "Ranger";
portrait = CharGraphic.ranger1;
pos = 0;
health_max = getMaxHealth();
health = health_max;
skills.push(new sRangedAttack(this));
skills.push(new sRangerPenetrate(this));
skills.push(new sRangerRegen(this));
skills.push(new sRangerHeal(this));
skills.push(new sRangerHunt(this));
skills.push(new sRangerAE(this));
skills.push(new sRangerStun(this));
skills.push(new sRangerMultiMelee(this));
skills.push(new sRangerPoison(this));
skills.push(new sRangerFocus(this));
skills.push(new sRangerHaste(this));
setActiveSkillsDefault();
generateDefaultGear();
}
override public function getHealthRegen(_arg1:Boolean=true):int{
var _local2:int;
var _local3:*;
_local2 = 0;
if (vitality){
_local2 = (_local2 + Math.ceil((health_max * (vitality / 100))));
};
if (_arg1){
_local2 = (_local2 + buff_healthRegen);
};
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].healthRegen);
};
_local3++;
};
return (_local2);
}
override public function getPassiveSkillDescription(_arg1:Boolean, _arg2:int=-1):String{
var _local3:int;
var _local4:String;
_local3 = 0;
if (_arg2 != -1){
_local3 = _arg2;
} else {
if (_arg1){
_local3 = passive_skill_offense;
} else {
_local3 = passive_skill_defense;
};
};
if (_arg1){
_local4 = String(Math.round((OFFENSE_PER_POINT * _local3)));
} else {
_local4 = String(Math.round((DEFENSE_PER_POINT * _local3)));
};
if (_arg1){
return ((((("Each skill rank:\n" + String(OFFENSE_PER_POINT)) + "% chance on attack to identify the target's vulnerability, reducing their damage resistance by 40 for the remainder of the battle.\n(This skill may reduce damage resistance below zero)\n\nCurrent: ") + _local4) + "%"));
};
return ((((("Each skill rank:\n" + String(DEFENSE_PER_POINT)) + "% of maximum health added to base health regeneration.\n\nCurrent: ") + _local4) + "%"));
}
override public function getPassiveSkillIcon(_arg1:Boolean):int{
if (_arg1){
return (15);
};
return (12);
}
override public function getPassiveSkillName(_arg1:Boolean):String{
if (_arg1){
return ("Creature Lore");
};
return ("Vitality");
}
public function generateDefaultGear(){
this.gear[Equipment.head] = new iLeatherHat(1, Item.grey);
this.gear[Equipment.armor] = new iLeatherChest(1, Item.grey);
this.gear[Equipment.gloves] = new iLeatherGloves(1, Item.grey);
this.gear[Equipment.legs] = new iLeatherLegs(1, Item.grey);
this.gear[Equipment.boots] = new iLeatherBoots(1, Item.grey);
this.gear[Equipment.weapon] = new iBow(1, Item.grey);
}
public function get vitality():int{
return (Math.round((DEFENSE_PER_POINT * passive_skill_defense)));
}
public function get creatureLore():int{
return (Math.round((OFFENSE_PER_POINT * passive_skill_offense)));
}
}
}//package
Section 331
//PC_Rogue (PC_Rogue)
package {
public class PC_Rogue extends PlayerCharacter {
public static const ELUSIVENESS_PER_POINT:int = 3;
public static const POISONCRAFT_PER_POINT:int = 2;
public function PC_Rogue(_arg1:Party=null){
this.party = _arg1;
quickness = 70;
charname = "Deepak";
playerclass = PlayerCharacter.ROGUE;
classname = "Rogue";
portrait = CharGraphic.rogue1;
pos = 0;
health_max = getMaxHealth();
health = health_max;
skills.push(new sWeaponAttack(this));
skills.push(new sRoguePoison(this));
skills.push(new sRogueCritical(this));
skills.push(new sRogueSneakAttack(this));
skills.push(new sRogueBlind(this));
skills.push(new sRogueOpening(this));
skills.push(new sRogueHide(this));
skills.push(new sRogueSap(this));
skills.push(new sRogueLuck(this));
skills.push(new sRogueFinisher(this));
skills.push(new sRogueCripple(this));
setActiveSkillsDefault();
generateDefaultGear();
}
public function get elusiveness():int{
return (Math.round((ELUSIVENESS_PER_POINT * passive_skill_defense)));
}
override public function getPassiveSkillDescription(_arg1:Boolean, _arg2:int=-1):String{
var _local3:int;
var _local4:String;
_local3 = 0;
if (_arg2 != -1){
_local3 = _arg2;
} else {
if (_arg1){
_local3 = passive_skill_offense;
} else {
_local3 = passive_skill_defense;
};
};
if (_arg1){
_local4 = String(Math.round((POISONCRAFT_PER_POINT * _local3)));
} else {
_local4 = String(Math.round((ELUSIVENESS_PER_POINT * _local3)));
};
if (_arg1){
return ((((("Each skill rank:\n" + String(POISONCRAFT_PER_POINT)) + "% of damage caused by weapon attacks is added to the target as poison.\n\nCurrent: ") + _local4) + "%"));
};
return ((((("Each skill rank:\n" + String(ELUSIVENESS_PER_POINT)) + "% chance that enemies will not directly target the rogue for attacks, if other targets are available. The rogue can still be a secondary target of an area attack directed at someone else.\n\nCurrent: ") + _local4) + "%"));
}
public function get poisoncraft():int{
return (Math.round((POISONCRAFT_PER_POINT * passive_skill_offense)));
}
override public function getPassiveSkillIcon(_arg1:Boolean):int{
if (_arg1){
return (6);
};
return (7);
}
override public function getPassiveSkillName(_arg1:Boolean):String{
if (_arg1){
return ("Poisoncraft");
};
return ("Elusiveness");
}
public function generateDefaultGear(){
this.gear[Equipment.head] = new iLeatherHat(1, Item.grey);
this.gear[Equipment.armor] = new iLeatherChest(1, Item.grey);
this.gear[Equipment.gloves] = new iLeatherGloves(1, Item.grey);
this.gear[Equipment.legs] = new iLeatherLegs(1, Item.grey);
this.gear[Equipment.boots] = new iLeatherBoots(1, Item.grey);
this.gear[Equipment.weapon] = new iDagger(1, Item.grey);
}
}
}//package
Section 332
//PC_Warrior (PC_Warrior)
package {
public class PC_Warrior extends PlayerCharacter {
public static const LEADERSHIP_PER_POINT:int = 3;
public static const ARMOR_PER_POINT:int = 2;
public function PC_Warrior(_arg1:Party=null){
this.party = _arg1;
quickness = 50;
health_max = getMaxHealth();
health = health_max;
level = 1;
charname = "Bruce";
playerclass = PlayerCharacter.WARRIOR;
classname = "Warrior";
portrait = CharGraphic.warrior1;
pos = 0;
skills.push(new sWeaponAttack(this));
skills.push(new sWarriorPowerAttack(this));
skills.push(new sWarriorDefiance(this));
skills.push(new sWarriorAE(this));
skills.push(new sWarriorAdrenaline(this));
skills.push(new sWarriorHeal(this));
skills.push(new sWarriorShield(this));
skills.push(new sWarriorInspire(this));
skills.push(new sWarriorExecute(this));
skills.push(new sWarriorBloodlust(this));
skills.push(new sWarriorSpeedAttack(this));
setActiveSkillsDefault();
generateDefaultGear();
}
override public function getPassiveSkillDescription(_arg1:Boolean, _arg2:int=-1):String{
var _local3:int;
var _local4:String;
_local3 = 0;
if (_arg2 != -1){
_local3 = _arg2;
} else {
if (_arg1){
_local3 = passive_skill_offense;
} else {
_local3 = passive_skill_defense;
};
};
if (_arg1){
_local4 = String(Math.round((LEADERSHIP_PER_POINT * _local3)));
} else {
_local4 = String(Math.round((ARMOR_PER_POINT * _local3)));
};
if (_arg1){
return ((((("Each skill rank:\n" + String(LEADERSHIP_PER_POINT)) + "% chance that a successful attack by the Warrior will cause a random ally to perform a bonus attack on the same target.\n\nCurrent: ") + _local4) + "%"));
};
return ((((("Each skill rank:\n" + String(ARMOR_PER_POINT)) + "% bonus to the Armor Rating gained from armor.\n\nCurrent: ") + _local4) + "%"));
}
override public function getPassiveSkillIcon(_arg1:Boolean):int{
if (_arg1){
return (2);
};
return (3);
}
override public function getArmorRating():int{
var _local1:Number;
_local1 = super.getArmorRating();
_local1 = (_local1 * (1 + ((ARMOR_PER_POINT * passive_skill_defense) / 100)));
return (Math.ceil(_local1));
}
override public function getPassiveSkillName(_arg1:Boolean):String{
if (_arg1){
return ("Leadership");
};
return ("Armor Proficiency");
}
public function generateDefaultGear(){
var _local1:Armor;
var _local2:*;
_local1 = new iPlateHelmet(1, Item.grey);
this.gear[_local1.slot] = _local1;
_local1 = new iPlateBreastplate(1, Item.grey);
this.gear[_local1.slot] = _local1;
_local1 = new iPlateGloves(1, Item.grey);
this.gear[_local1.slot] = _local1;
_local1 = new iPlateBoots(1, Item.grey);
this.gear[_local1.slot] = _local1;
_local1 = new iPlateGreaves(1, Item.grey);
this.gear[_local1.slot] = _local1;
_local2 = new iSword(1, Item.grey);
this.gear[_local2.slot] = _local2;
}
public function get leadership():int{
return (Math.round((LEADERSHIP_PER_POINT * passive_skill_offense)));
}
}
}//package
Section 333
//player_arrow (player_arrow)
package {
import flash.display.*;
public dynamic class player_arrow extends MovieClip {
public var spark:MovieClip;
public function player_arrow(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.playerArrow);
this.spark.x = dm.randomNum(15, 43);
this.spark.y = dm.randomNum(15, 43);
}
function frame45(){
this.stop();
}
}
}//package
Section 334
//player_mage_attack (player_mage_attack)
package {
import flash.display.*;
public dynamic class player_mage_attack extends MovieClip {
public function player_mage_attack(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.playerMagicAttack);
}
function frame45(){
this.stop();
}
}
}//package
Section 335
//player_multi_slash (player_multi_slash)
package {
import flash.display.*;
public dynamic class player_multi_slash extends MovieClip {
public var hslash:MovieClip;
public function player_multi_slash(){
addFrameScript(0, frame1, 11, frame12);
}
function frame12(){
this.stop();
this.gotoAndStop(12);
}
function frame1(){
dm.sound.play(SoundControl.playerSlash);
}
}
}//package
Section 336
//player_power_slash (player_power_slash)
package {
import flash.display.*;
public dynamic class player_power_slash extends MovieClip {
public function player_power_slash(){
addFrameScript(11, frame12);
}
function frame12(){
this.stop();
}
}
}//package
Section 337
//player_slash (player_slash)
package {
import flash.display.*;
public dynamic class player_slash extends MovieClip {
public var hslash:MovieClip;
public function player_slash(){
addFrameScript(0, frame1, 11, frame12);
}
function frame12(){
this.gotoAndStop(12);
}
function frame1(){
dm.sound.play(SoundControl.playerSlash);
}
}
}//package
Section 338
//PlayerCharacter (PlayerCharacter)
package {
public class PlayerCharacter extends Character {
const CLONE_DAMAGE_MULTIPLIER = 0.5;
const CLONE_HEALTH_MULTIPLIER = 2;
private var _passive_skill_defense:int;// = 0
private var _skill_points:int;// = 0
var retreated:Boolean;// = false
private var _passive_skill_offense:int;// = 0
var retreating:Boolean;// = false
var party:Party;
private var _male:Boolean;// = true
var old_stat_points:int;// = 0
protected var playerclass:int;
var old_strength:int;// = 0
var old_intellect:int;// = 0
private var _stat_points:int;// = 0
var gear:Array;
private var _ignoreArmorValues:Boolean;// = false
var old_dexterity:int;// = 0
var old_endurance:int;// = 0
static const HEALTH_PER_ENDURANCE = 4;
static const STATS_PER_LEVEL = 3;
static const RANGER = 4;
static const BARBARIAN = 6;
static const SUMMON = 9;
static const WARRIOR = 1;
static const DAMAGE_PER_STAT = 2;
static const CONJUROR = 7;
static const CLERIC = 2;
static const ADVENTURER = 10;
static const MAGE = 3;
static const ROGUE = 5;
static var base_health = 50;
public function PlayerCharacter(_arg1:Party=null){
gear = new Array(Equipment.gearSlots);
_stat_points = 0;
_skill_points = 0;
_passive_skill_offense = 0;
_passive_skill_defense = 0;
_male = true;
_ignoreArmorValues = false;
retreating = false;
retreated = false;
old_strength = 0;
old_endurance = 0;
old_dexterity = 0;
old_intellect = 0;
old_stat_points = 0;
super();
level = 1;
classname = "Player";
portrait = CharGraphic.warrior1;
pos = 0;
if (_arg1 != null){
this.party = _arg1;
};
}
public function getDexterityDamageBonus():int{
var _local1:*;
_local1 = getDexterity();
return (getBonus(_local1));
}
override public function getHealthRegen(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = 0;
if (_arg1){
_local2 = (_local2 + buff_healthRegen);
};
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].healthRegen);
};
_local3++;
};
return (_local2);
}
public function get male():Boolean{
return (this._male);
}
public function get ignoreArmorValues():Boolean{
return (this._ignoreArmorValues);
}
override public function getVampiric(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = 0;
if (_arg1){
_local2 = (_local2 + buff_vampiric);
};
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].vampiric_percent);
};
_local3++;
};
return (_local2);
}
public function set male(_arg1:Boolean):void{
this._male = _arg1;
}
public function set ignoreArmorValues(_arg1:Boolean):void{
this._ignoreArmorValues = _arg1;
}
public function multiplyDamageForTargetType(_arg1:int, _arg2:int):int{
var _local3:int;
var _local4:Number;
_local3 = 0;
_local4 = 1;
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (((!((gear[_local3] == null))) && ((gear[_local3].damageBonusVsCreatureType == _arg2)))){
_local4 = (_local4 * gear[_local3].damageBonusVsCreatureModifier);
};
_local3++;
};
return (Math.round((_arg1 * _local4)));
}
public function getPassiveSkillDescription(_arg1:Boolean, _arg2:int=-1):String{
if (_arg1){
return ("Generic Offensive Skill Description");
};
return ("Generic Defensive Skill Description");
}
public function getMaxHealth():int{
var _local1:*;
_local1 = getEndurance();
return (getHealthForEndurance(_local1));
}
override public function getPowerRegen(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = power_per_turn;
if (_arg1){
_local2 = (_local2 + buff_powerRegen);
};
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].powerRegen);
};
_local3++;
};
return (Math.round((_local2 * powerRegenMod)));
}
public function equip(_arg1:Equipment):Boolean{
var _local2:Boolean;
_local2 = itemUsable(_arg1);
if ((_arg1 is Offhand)){
if (gear[Equipment.weapon] != null){
if (gear[Equipment.weapon].twoHanded){
_local2 = false;
};
};
};
if ((_arg1 is Weapon)){
if (Weapon(_arg1).twoHanded){
if (gear[Equipment.offhand] != null){
_local2 = false;
};
};
};
if (!(_local2)){
return (false);
};
if (!(party.unequipItem(_arg1))){
return (false);
};
if (gear[_arg1.slot] != null){
if (!(party.unequipItem(gear[_arg1.slot]))){
return (false);
};
};
if (party.removeFromInventory(_arg1)){
gear[_arg1.slot] = _arg1;
return (true);
};
return (false);
}
override public function genderPossessive(_arg1:Boolean=false):String{
if (_arg1){
if (this.male){
return ("His");
};
return ("Her");
//unresolved jump
};
if (this.male){
return ("his");
};
return ("her");
}
public function loseRandomEquipment():Boolean{
var _local1:Array;
var _local2:Array;
var _local3:Array;
var _local4:int;
var _local5:Boolean;
_local1 = new Array();
_local2 = new Array();
_local3 = new Array();
_local4 = 0;
while (_local4 < Equipment.gearSlots) {
if (gear[_local4] == null){
} else {
if ((((gear[_local4].item_rarity == Item.grey)) || ((gear[_local4].item_rarity == Item.white)))){
_local1.push(gear[_local4]);
} else {
if ((((gear[_local4].item_rarity == Item.green)) || ((gear[_local4].item_rarity == Item.blue)))){
_local2.push(gear[_local4]);
} else {
if (gear[_local4].item_rarity == Item.purple){
_local3.push(gear[_local4]);
};
};
};
};
_local4++;
};
_local5 = false;
if (_local1.length){
_local5 = destroyEquipment(_local1[dmf.randomNum(0, (_local1.length - 1))]);
} else {
if (_local2.length){
_local5 = destroyEquipment(_local2[dmf.randomNum(0, (_local2.length - 1))]);
} else {
if (_local3.length){
_local5 = destroyEquipment(_local3[dmf.randomNum(0, (_local3.length - 1))]);
};
};
};
if (DungeonMain.debug){
};
return (_local5);
}
override public function genderPronoun(_arg1:Boolean=false):String{
if (_arg1){
if (this.male){
return ("He");
};
return ("She");
//unresolved jump
};
if (this.male){
return ("he");
};
return ("she");
}
private function getBonus(_arg1:int):int{
var _local2:*;
_local2 = (_arg1 * DAMAGE_PER_STAT);
return (_local2);
}
public function set stat_points(_arg1:int):void{
this._stat_points = _arg1;
}
override public function getAccuracy(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = accuracy;
if (_arg1){
_local2 = (_local2 + (buff_accuracy - accuracy_penalty));
};
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].accuracyBonus);
};
_local3++;
};
_local2 = Math.max(ACCURACY_MINIMUM, _local2);
return (_local2);
}
override public function getDamageReflection(_arg1:Boolean=true):int{
var _local2:int;
var _local3:int;
_local2 = 0;
if (_arg1){
_local2 = (_local2 + buff_damageReflect);
};
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].damageReflection);
};
_local3++;
};
return (_local2);
}
override public function getLethality(_arg1:Boolean=true):int{
var _local2:int;
var _local3:int;
_local2 = 0;
if (((DungeonMain.debug) && (DungeonMain.instantKill))){
return (100);
};
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].lethality);
};
_local3++;
};
return (_local2);
}
public function getPassiveSkillIcon(_arg1:Boolean):int{
return (1);
}
public function setActiveSkillsDefault():void{
var _local1:*;
var _local2:*;
_local1 = 0;
_local2 = 0;
while (_local2 < skills.length) {
if (_local1 >= 3){
break;
};
if (skills[_local2] != null){
skills[_local2].unlocked = true;
skills[_local2].active = true;
skills[_local2].position = (_local2 + 1);
_local1++;
};
_local2++;
};
if (DungeonMain.skillsUnlocked){
_local2 = 0;
while (_local2 < skills.length) {
skills[_local2].unlocked = true;
_local2++;
};
passive_skill_offense = 25;
passive_skill_defense = 25;
};
}
public function set passive_skill_defense(_arg1:int):void{
this._passive_skill_defense = _arg1;
}
public function getArmorRating():int{
var _local1:*;
var _local2:*;
_local1 = 0;
_local2 = 0;
while (_local2 < Equipment.gearSlots) {
if (gear[_local2] != null){
_local1 = (_local1 + gear[_local2].armor_rating);
};
_local2++;
};
return (_local1);
}
public function get skill_points():int{
return (this._skill_points);
}
public function getPassiveSkillName(_arg1:Boolean):String{
if (_arg1){
return ("Generic Offensive Skill");
};
return ("Generic Defensive Skill");
}
override public function getStunChance(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = 0;
if (_arg1){
_local2 = (_local2 + buff_stun);
};
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].causes_stun_percent);
};
_local3++;
};
return (_local2);
}
override public function getEffectiveHealth():int{
var _local1:*;
var _local2:*;
_local1 = ((100 - getDamageResist()) / 100);
_local2 = Math.round((health / _local1));
return (_local2);
}
override public function getDamageResist(_arg1:Boolean=true):int{
var _local2:*;
_local2 = 0;
if (_arg1){
_local2 = (_local2 + (((buff_damageResist + temp_damage_resistance) + potion_damage_resist) - debuff_damageResist));
};
_local2 = (_local2 + getDamageReductionFromArmor());
if (_local2 >= 100){
_local2 = 99;
};
return (_local2);
}
private function destroyEquipment(_arg1:Equipment):Boolean{
var _local2:*;
_local2 = 0;
while (_local2 < Equipment.gearSlots) {
if (gear[_local2] == _arg1){
gear[_local2] = null;
return (true);
};
_local2++;
};
return (false);
}
override public function getAccuracyDamage(_arg1:Boolean=true):int{
var _local2:int;
var _local3:int;
_local2 = 0;
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].blind);
};
_local3++;
};
return (_local2);
}
public function getIntellectDamageBonus():int{
var _local1:*;
_local1 = getIntellect();
return (getBonus(_local1));
}
override public function getIntellect(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = this.intellect;
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].mod_intellect);
};
_local3++;
};
return (_local2);
}
public function evaluateEquipment(_arg1:Equipment):int{
var _local2:int;
var _local3 = ??pushnamespace
;
var _local4:*;
var _local5:Number;
var _local6:Number;
if (_arg1 == null){
return (0);
};
_local2 = 0;
_local3 = 5;
if ((((playerclass == WARRIOR)) || ((playerclass == BARBARIAN)))){
if (((!((gear[Equipment.weapon] == null))) && ((gear[Equipment.weapon] is MeleeWeapon)))){
_local2 = (_local2 + (_local3 * _arg1.mod_strength));
} else {
_local2 = (_local2 + (_local3 * _arg1.mod_dexterity));
};
_local2 = (_local2 + (_local3 * _arg1.mod_endurance));
} else {
if (playerclass == ROGUE){
if (((!((gear[Equipment.weapon] == null))) && ((gear[Equipment.weapon] is MeleeWeapon)))){
_local2 = (_local2 + (_local3 * _arg1.mod_strength));
};
_local2 = (_local2 + (_local3 * _arg1.mod_dexterity));
_local2 = (_local2 + ((_local3 * _arg1.mod_endurance) * 0.8));
} else {
if (playerclass == RANGER){
if (((!((gear[Equipment.weapon] == null))) && ((gear[Equipment.weapon] is MeleeWeapon)))){
_local2 = (_local2 + (_local3 * _arg1.mod_strength));
} else {
_local2 = (_local2 + (_local3 * _arg1.mod_dexterity));
};
_local2 = (_local2 + ((_local3 * _arg1.mod_intellect) * 0.9));
_local2 = (_local2 + ((_local3 * _arg1.mod_endurance) * 0.8));
} else {
if ((((playerclass == MAGE)) || ((playerclass == CONJUROR)))){
if (((!((gear[Equipment.weapon] == null))) && ((gear[Equipment.weapon] is MeleeWeapon)))){
_local2 = (_local2 + ((_local3 * _arg1.mod_strength) * 0.5));
};
_local2 = (_local2 + (_local3 * _arg1.mod_intellect));
_local2 = (_local2 + ((_local3 * _arg1.mod_endurance) * 0.8));
} else {
if (playerclass == CLERIC){
if (getStrength() >= (getIntellect() * 0.8)){
_local2 = (_local2 + (_local3 * _arg1.mod_strength));
} else {
_local2 = (_local2 + ((_local3 * _arg1.mod_strength) * 0.5));
};
_local2 = (_local2 + (_local3 * _arg1.mod_intellect));
_local2 = (_local2 + ((_local3 * _arg1.mod_endurance) * 0.8));
_local2 = (_local2 + (_arg1.mod_healing * 2));
};
};
};
};
};
_local4 = _arg1.mod_quickness;
if (_arg1.mod_quickness < 0){
_local4 = (_local4 * 0.5);
};
_local2 = (_local2 + _local4);
_local2 = (_local2 + (_arg1.vampiric_percent * 0.5));
_local2 = (_local2 + (_arg1.causes_stun_percent * 0.6));
_local2 = (_local2 + (_arg1.damageReflection * 0.5));
_local2 = (_local2 + (_arg1.blind * 0.5));
_local2 = (_local2 + _arg1.lethality);
_local2 = (_local2 + _arg1.replenishing);
_local2 = (_local2 + (_arg1.poisonDamage * 1.5));
_local2 = (_local2 + (_arg1.powerRegen * 4));
_local2 = (_local2 + (_arg1.healthRegen * 2));
if (getAccuracy() < 100){
_local2 = (_local2 + _arg1.accuracyBonus);
};
if (getPoisonResist(false) < 100){
_local2 = (_local2 + (_arg1.resistPoison * 0.5));
};
if (getStunResist(false) < 100){
_local2 = (_local2 + (_arg1.resistStun * 0.5));
};
if (_arg1.damageBonusVsCreatureModifier > 1){
_local2 = (_local2 * ((_arg1.damageBonusVsCreatureModifier + 3) * 0.25));
};
if (_arg1.quickRetreat){
_local2 = (_local2 * 1.1);
};
_local5 = 1;
if ((_arg1 is Weapon)){
_local2 = (Weapon.scaleWeaponDamageForLevelNew(_local2, _arg1.item_level) * _local5);
_local2 = (_local2 + (Weapon(_arg1).damage * _local5));
};
if (!(ignoreArmorValues)){
if (playerclass == WARRIOR){
_local6 = 1.25;
} else {
if (playerclass == CLERIC){
_local6 = 1.1;
} else {
_local6 = 1;
};
};
_local2 = (_local2 * ((1 + (Equipment.ARMOR_SCALE_CONSTANT * (_arg1.item_level - 1))) * _local6));
_local2 = (_local2 + (_arg1.armor_rating * _local6));
};
return (Math.round(_local2));
}
public function canQuickRetreat():Boolean{
var _local1:*;
var _local2:*;
_local1 = false;
_local2 = 0;
while (_local2 < Equipment.gearSlots) {
if (gear[_local2] != null){
if (gear[_local2].quickRetreat){
return (true);
};
};
_local2++;
};
return (false);
}
override public function getPoisonDamage(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = 0;
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].poisonDamage);
};
_local3++;
};
return (_local2);
}
override public function getDexterity(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = this.dexterity;
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].mod_dexterity);
};
_local3++;
};
return (_local2);
}
override public function getQuickness(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = this.quickness;
if (_arg1){
_local2 = (_local2 + ((buff_quickness + potion_quickness_bonus) - crippled));
};
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].mod_quickness);
};
_local3++;
};
_local2 = Math.max(_local2, 0);
return (_local2);
}
public function getWeaponDamage():int{
var _local1:*;
_local1 = 0;
if (gear[Equipment.weapon] == null){
return (getUnarmedDamage());
};
if ((gear[Equipment.weapon] is iDagger)){
_local1 = (getStrengthDamageBonus() + getDexterityDamageBonus());
} else {
if ((gear[Equipment.weapon] is MeleeWeapon)){
_local1 = getStrengthDamageBonus();
} else {
if ((gear[Equipment.weapon] is RangedWeapon)){
_local1 = getDexterityDamageBonus();
} else {
if ((gear[Equipment.weapon] is MageWeapon)){
_local1 = getIntellectDamageBonus();
};
};
};
};
return ((this.gear[Equipment.weapon].damage + _local1));
}
public function set skill_points(_arg1:int):void{
this._skill_points = _arg1;
}
public function get stat_points():int{
return (this._stat_points);
}
override public function getStunResist(_arg1:Boolean=true):int{
var _local2:int;
var _local3:int;
_local2 = stunResist;
if (_arg1){
_local2 = (_local2 + (buff_resistStun + potion_stun_resist));
};
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].resistStun);
};
_local3++;
};
if (_local2 > 100){
_local2 = 100;
};
return (_local2);
}
public function get passive_skill_defense():int{
return (this._passive_skill_defense);
}
public function set passive_skill_offense(_arg1:int):void{
this._passive_skill_offense = _arg1;
}
override public function getEndurance(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = this.endurance;
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].mod_endurance);
};
_local3++;
};
return (_local2);
}
public function levelUp():void{
var _local1:int;
level++;
strength = (strength + STATS_PER_LEVEL);
endurance = (endurance + STATS_PER_LEVEL);
dexterity = (dexterity + STATS_PER_LEVEL);
intellect = (intellect + STATS_PER_LEVEL);
stat_points = (stat_points + STATS_PER_LEVEL);
if (level <= 59){
skill_points++;
};
_local1 = health_max;
health_max = getMaxHealth();
health = (health + (health_max - _local1));
}
public function getUnarmedDamage():int{
return ((getStrength() * 2));
}
public function unequip(_arg1:Equipment):Boolean{
if (party == null){
return (false);
};
if (party.addToInventory(gear[_arg1.slot])){
gear[_arg1.slot] = null;
return (true);
};
return (false);
}
override public function reduceHealth(_arg1:int):int{
var _local2:*;
var _local3:*;
_local2 = health;
_local3 = super.reduceHealth(_arg1);
if ((((((health <= 0)) && ((_local2 > 0)))) && ((_local3 > 0)))){
party.stat_member_deaths++;
};
return (_local3);
}
public function getArmorModifierVersus(_arg1:int):Number{
var _local2:Number;
var _local3:*;
_local2 = 1;
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (((!((gear[_local3] == null))) && ((gear[_local3].armorBonusVsCreatureType == _arg1)))){
_local2 = (_local2 * gear[_local3].armorBonusVsCreatureModifier);
};
_local3++;
};
return (_local2);
}
public function getReplenishing():int{
var _local1:*;
var _local2:*;
_local1 = 0;
_local2 = 0;
while (_local2 < Equipment.gearSlots) {
if (gear[_local2] != null){
_local1 = (_local1 + gear[_local2].replenishing);
};
_local2++;
};
return (_local1);
}
public function levelTo(_arg1:int):void{
var _local2:*;
_local2 = level;
while (_local2 < _arg1) {
levelUp();
_local2++;
};
}
public function getEvilClone():MonsterCharacter{
var _local1:*;
var _local2:*;
var _local3:*;
_local1 = new MonsterCharacter(level);
_local1.charname = ("Dark " + this.charname);
_local1.classname = ("Corrupted " + this.classname);
_local1.type = MonsterCharacter.human;
_local1.description = "A twisted shadow cast by the Corruptor's power.";
_local1.level = this.level;
_local1.summoned = true;
_local1.lethalityImmune = true;
_local1.portrait = this.portrait;
if (this.useCustomPortrait){
_local1.useCustomPortrait = true;
_local1.customPortraitUrl = this.customPortraitUrl;
_local1.loadCustomPortrait();
};
_local1.health_max = Math.round((this.health_max * CLONE_HEALTH_MULTIPLIER));
_local1.health = _local1.health_max;
_local1.power_per_turn = this.getPowerRegen(false);
_local1.strength = this.getStrength(false);
_local1.endurance = this.getEndurance(false);
_local1.dexterity = this.getDexterity(false);
_local1.intellect = this.getIntellect(false);
_local1.quickness = Math.max((this.getQuickness(false) - 5), 0);
_local1.accuracy = this.getAccuracy(false);
_local1.poisonResist = this.getPoisonResist(false);
_local1.stunResist = this.getStunResist(false);
_local1.pos = 0;
_local1.mindless = false;
_local1.ethereal = 0;
_local1.damage_resistance = this.getDamageResist(false);
_local1.vampiric_percent = this.getVampiric(false);
_local1.causes_stun_percent = this.getStunChance(false);
_local1.damage_reflection = Math.round((this.getDamageReflection(false) * 0.4));
_local1.accuracy_damage = this.getAccuracyDamage(false);
_local1.poison_damage = this.getPoisonDamage(false);
_local1.regenerate = Math.round(((this.getHealthRegen(false) / _local1.health_max) * 100));
_local2 = 0;
while (_local2 < skills.length) {
if (((skills[_local2].active) && (skills[_local2].usable(true)))){
_local3 = new skills[_local2].constructor(_local1);
_local3.damage = Math.round((skills[_local2].getDamage() * CLONE_DAMAGE_MULTIPLIER));
_local3.requiresWeapon = false;
_local3.requiresMelee = false;
_local3.requiresRanged = false;
_local3.requiresShield = false;
if (_local3.usesWeaponRange){
if (((!((gear[Equipment.weapon] == null))) && ((((gear[Equipment.weapon] is RangedWeapon)) || ((gear[Equipment.weapon] is MageWeapon)))))){
_local3.rangedAttack = true;
};
_local3.usesWeaponRange = false;
};
_local1.skills.push(_local3);
};
_local2++;
};
return (_local1);
}
public function recalculateMaxHealth():void{
health_max = getMaxHealth();
if (health > health_max){
health = health_max;
};
}
override public function damageAfterArmor(_arg1:int, _arg2:Character):int{
var _local3:int;
var _local4:Number;
_local3 = getDamageResist();
_local3 = Math.round((getArmorModifierVersus(_arg2.type) * _local3));
_local3 = Math.min(_local3, 95);
_local4 = (1 - (_local3 / 100));
if (_local3 != 0){
_arg1 = (_arg1 * _local4);
};
if (_arg1 == 0){
_arg1 = 1;
};
return (_arg1);
}
override public function getPoisonResist(_arg1:Boolean=true):int{
var _local2:int;
var _local3:int;
_local2 = poisonResist;
if (_arg1){
_local2 = (_local2 + (buff_resistPoison + potion_poison_resist));
};
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].resistPoison);
};
_local3++;
};
if (_local2 > 100){
_local2 = 100;
};
return (_local2);
}
public function get passive_skill_offense():int{
return (this._passive_skill_offense);
}
override public function genderSelf(_arg1:Boolean=false):String{
if (_arg1){
if (this.male){
return ("Himself");
};
return ("Herself");
//unresolved jump
};
if (this.male){
return ("himself");
};
return ("herself");
}
override public function isInactive():Boolean{
if (retreated){
return (true);
};
return (super.isInactive());
}
override public function getStrength(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = this.strength;
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].mod_strength);
};
_local3++;
};
return (_local2);
}
public function getStrengthDamageBonus():int{
var _local1:*;
_local1 = getStrength();
return (getBonus(_local1));
}
override public function getHealingBonus(_arg1:Boolean=true):int{
var _local2:*;
var _local3:*;
_local2 = 0;
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (gear[_local3] != null){
_local2 = (_local2 + gear[_local3].mod_healing);
};
_local3++;
};
return (_local2);
}
public function getDamageReductionFromArmor():int{
var _local1:int;
var _local2 = ??pushnamespace
;
var _local3:Number;
_local1 = getArmorRating();
_local2 = 250;
_local3 = (_local2 * (1 + ((level - 1) * (Equipment.ARMOR_SCALE_CONSTANT + 0.05))));
return (Math.round(((_local1 / _local3) * 40)));
}
public function itemUsable(_arg1:Item):Boolean{
var _local2:Boolean;
var _local3:Equipment;
if (!((_arg1 is Equipment))){
return (true);
};
_local2 = false;
_local3 = Equipment(_arg1);
if (_local3.whoEquips == Equipment.allEquip){
_local2 = true;
} else {
if ((((playerclass == PlayerCharacter.CLERIC)) && (((_local3.whoEquips & Equipment.clericEquip) == Equipment.clericEquip)))){
_local2 = true;
};
if ((((playerclass == PlayerCharacter.WARRIOR)) && (((_local3.whoEquips & Equipment.warriorEquip) == Equipment.warriorEquip)))){
_local2 = true;
};
if ((((playerclass == PlayerCharacter.ROGUE)) && (((_local3.whoEquips & Equipment.rogueEquip) == Equipment.rogueEquip)))){
_local2 = true;
};
if ((((playerclass == PlayerCharacter.RANGER)) && (((_local3.whoEquips & Equipment.rangerEquip) == Equipment.rangerEquip)))){
_local2 = true;
};
if ((((playerclass == PlayerCharacter.MAGE)) && (((_local3.whoEquips & Equipment.mageEquip) == Equipment.mageEquip)))){
_local2 = true;
};
if ((((playerclass == PlayerCharacter.CONJUROR)) && (((_local3.whoEquips & Equipment.conjurorEquip) == Equipment.conjurorEquip)))){
_local2 = true;
};
if ((((playerclass == PlayerCharacter.BARBARIAN)) && (((_local3.whoEquips & Equipment.barbarianEquip) == Equipment.barbarianEquip)))){
_local2 = true;
};
};
return (_local2);
}
public static function randomName(_arg1:Boolean):String{
var _local2:Array;
if (_arg1){
_local2 = new Array("Nigel", "Neil", "Niles", "Charles", "Boris", "Jethro", "Gerald", "Horace", "Stan", "Alan", "Hank", "Marty", "Trevor", "Trent", "Bruce", "Eugene", "Wally", "Harold", "Hamish", "Carlos", "Jeremy", "Jerome", "Jermaine", "Tito", "George", "Hans", "Chad", "Rupert", "Ruprecht", "Albert", "Alfred", "Phineas", "Brent", "Colin", "Travis", "Jarvis", "Elton", "Ernest", "Mitch");
} else {
_local2 = new Array("Tiffany", "Matilda", "Jemima", "Morag", "Mildred", "Martha", "Suzanne", "Sharon", "Chantel", "Miriam", "Muriel", "Susan", "Pam", "Desiree", "Bertha", "Olga", "Peggy", "Freda", "Charlene", "Bessy", "Priscilla", "Aubrey", "Mariah", "Nancy", "Barbara", "Kathleen", "Cynthia", "Maureen", "Judith", "Tammy", "Sheila", "Joyce", "Regina", "Wanda");
};
return (_local2[dmf.randomNum(0, (_local2.length - 1))]);
}
public static function baseHealthForLevel(_arg1:int):int{
return (getHealthForEndurance((1 + (_arg1 * STATS_PER_LEVEL))));
}
public static function getHealthForEndurance(_arg1:int):int{
return ((base_health + ((_arg1 - 1) * HEALTH_PER_ENDURANCE)));
}
}
}//package
Section 339
//PlayerSummon (PlayerSummon)
package {
public class PlayerSummon extends PlayerCharacter {
public function PlayerSummon(_arg1:int=1):void{
playerclass = PlayerCharacter.SUMMON;
summoned = true;
this.level = _arg1;
health_max = getSummonHealth(_arg1);
damage = getSummonDamage(_arg1);
}
override public function getDamageResist(_arg1:Boolean=true):int{
var _local2:*;
_local2 = 0;
if (_arg1){
_local2 = (_local2 + ((buff_damageResist + temp_damage_resistance) - debuff_damageResist));
};
_local2 = (_local2 + damage_resistance);
if (_local2 >= 100){
_local2 = 99;
};
return (_local2);
}
override public function canQuickRetreat():Boolean{
return (true);
}
override public function reduceHealth(_arg1:int):int{
var _local2:*;
if (invulnerable){
return (0);
};
_local2 = health;
health = (health - _arg1);
if ((((health < cannotDieMin)) && ((cannotDie > 0)))){
health = Math.min(_local2, cannotDieMin);
};
if (health < 0){
health = 0;
clearStatusEffects();
};
if (health > health_max){
health = health_max;
};
return ((_local2 - health));
}
override public function getEvilClone():MonsterCharacter{
return (null);
}
protected function initSummonSkills():void{
var _local1:*;
_local1 = 0;
while (_local1 < skills.length) {
skills[_local1].position = (_local1 + 1);
skills[_local1].active = true;
_local1++;
};
}
public static function getSummonHealth(_arg1:int):int{
var _local2:int;
_local2 = baseHealthForLevel(_arg1);
return (_local2);
}
public static function getSummonDamage(_arg1:int):int{
var _local2:int;
_local2 = Weapon.scaleWeaponDamageForLevelNew(Weapon.sword_base_damage, _arg1);
_local2 = (_local2 + ((1 + (_arg1 * PlayerCharacter.STATS_PER_LEVEL)) * PlayerCharacter.DAMAGE_PER_STAT));
return (_local2);
}
}
}//package
Section 340
//pManaSprite (pManaSprite)
package {
public class pManaSprite extends PlayerSummon {
public function pManaSprite(_arg1:int=1){
super(_arg1);
classname = "Manasprite";
charname = "Manasprite";
portrait = CharGraphic.sprite_blue;
description = "Summoned.";
quickness = 60;
power_per_turn = 0;
health_max = Math.round((health_max * 0.5));
health = health_max;
damage = Math.round((damage * 0.5));
skills.push(new sSummonAttack(this));
skills.push(new sSpriteRestorePower(this));
initSummonSkills();
}
}
}//package
Section 341
//poison_drake_sound (poison_drake_sound)
package {
import flash.media.*;
public dynamic class poison_drake_sound extends Sound {
}
}//package
Section 342
//poison_sound (poison_sound)
package {
import flash.media.*;
public dynamic class poison_sound extends Sound {
}
}//package
Section 343
//poisoneffect (poisoneffect)
package {
import flash.display.*;
public dynamic class poisoneffect extends MovieClip {
public function poisoneffect(){
addFrameScript(4, frame5, 49, frame50);
}
function frame5(){
dm.sound.play(SoundControl.poison, 0.75);
}
function frame50(){
this.stop();
}
}
}//package
Section 344
//PortalScroll (PortalScroll)
package {
public class PortalScroll extends Consumable {
public function PortalScroll(_arg1:int=1){
item_name = "Portal Scroll";
town_portal = true;
item_rarity = Item.purple;
icon_frame = 84;
}
override public function getWorth():int{
return (0);
}
}
}//package
Section 345
//PortraitAnimation (PortraitAnimation)
package {
import flash.display.*;
public class PortraitAnimation {
static const poison = 16;
static const cosmicPrison = 15;
static const swoopAttack = 61;
static const explosion = 13;
static const cultistArrow = 57;
static const playerSlash = 28;
static const summonWhirlwind = 79;
static const summonSlash = 31;
static const regenBuff = 7;
static const monsterBeer = 85;
static const armorBuff = 4;
static const fearDeath = 71;
static const fire = 11;
static const quicknessBuff = 6;
static const playerPowerSlash = 30;
static const creatureWeapon = 51;
static const monsterDrain = 98;
static const protectAllies = 20;
static const monsterArrow = 55;
static const buff = 3;
static const revive = 2;
static const defiance = 21;
static const debuff = 14;
static const blind = 9;
static const clone = 100;
static const mageAttack = 25;
static const web = 70;
static const holyDamage = 10;
static const transform = 81;
static const disintegrate = 99;
static const creatureSlash = 50;
static const playerMultiSlash = 29;
static const restore = 42;
static const curse = 8;
static const freeze = 12;
static const lethal = 17;
static const runeStrength = 86;
static const playerArrow = 26;
static const fireBuff = 5;
static const runeProtection = 87;
static const ghostAttack = 60;
static const gainHealth = 41;
static const monsterThrown = 58;
static const lightning = 18;
static const gainPower = 40;
static const creatureBite = 59;
static const creatureSpear = 52;
static const monsterThorns = 90;
static const playerUnarmed = 27;
static const confuse = 72;
static const heal = 1;
static const runePower = 88;
static const summon = 80;
static const powerDrain = 39;
static const monsterMagic = 56;
public static function getAnimation(_arg1:int):MovieClip{
var _local2:MovieClip;
if (_arg1 <= 0){
return (null);
};
_local2 = null;
switch (_arg1){
case heal:
_local2 = new healeffect();
break;
case revive:
_local2 = new revive_effect();
break;
case buff:
case quicknessBuff:
case monsterThorns:
case regenBuff:
_local2 = new buff_effect();
break;
case runeProtection:
case runePower:
_local2 = new rune_protection();
break;
case runeStrength:
_local2 = new rune_strength();
break;
case armorBuff:
case protectAllies:
case defiance:
_local2 = new armor_buff_effect();
break;
case summonSlash:
_local2 = new summon_slash();
break;
case confuse:
_local2 = new confuse_effect();
break;
case debuff:
_local2 = new debuff_effect();
break;
case poison:
_local2 = new poisoneffect();
break;
case curse:
_local2 = new curse_effect();
break;
case blind:
_local2 = new blind_effect();
break;
case holyDamage:
_local2 = new smite_effect();
break;
case lethal:
_local2 = new lethal_effect();
break;
case fire:
case explosion:
case fireBuff:
_local2 = new fire_effect();
break;
case lightning:
_local2 = new Lightning();
break;
case freeze:
_local2 = new frozen_effect();
break;
case cosmicPrison:
_local2 = new cosmic_prison();
break;
case fearDeath:
_local2 = new feardeath_effect();
break;
case playerArrow:
_local2 = new player_arrow();
break;
case playerSlash:
_local2 = new player_slash();
break;
case playerMultiSlash:
_local2 = new player_multi_slash();
break;
case playerPowerSlash:
_local2 = new player_power_slash();
break;
case mageAttack:
_local2 = new player_mage_attack();
break;
case summon:
_local2 = new summon_effect();
break;
case transform:
_local2 = new transform_effect();
break;
case summonWhirlwind:
_local2 = new summon_whirlwind();
break;
case powerDrain:
_local2 = new lose_power_effect();
break;
case gainPower:
_local2 = new gain_power_effect();
break;
case gainHealth:
_local2 = new gain_health_effect();
break;
case restore:
_local2 = new gain_both_effect();
break;
case creatureSlash:
case creatureBite:
case swoopAttack:
case ghostAttack:
_local2 = new creature_slash();
break;
case creatureWeapon:
_local2 = new creature_weapon();
break;
case creatureSpear:
_local2 = new creature_spear();
break;
case monsterMagic:
_local2 = new monster_magic_attack();
break;
case monsterArrow:
_local2 = new monster_arrow();
break;
case cultistArrow:
_local2 = new monster_arrow_drainpower();
break;
case monsterThrown:
_local2 = new monster_thrown();
break;
case web:
_local2 = new web_effect();
break;
case disintegrate:
_local2 = new disintegrate_effect();
break;
case monsterDrain:
_local2 = new monster_drain_effect();
break;
case monsterBeer:
_local2 = new beer_effect();
break;
case clone:
_local2 = new clone_effect();
break;
};
return (_local2);
}
}
}//package
Section 346
//PortraitAnimationFrame (PortraitAnimationFrame)
package {
import flash.display.*;
public class PortraitAnimationFrame extends MovieClip {
public function PortraitAnimationFrame(_arg1:int=0){
this.gotoAndStop(_arg1);
}
}
}//package
Section 347
//PortraitEffected (PortraitEffected)
package {
import flash.display.*;
public dynamic class PortraitEffected extends MovieClip {
}
}//package
Section 348
//PortraitHighlight (PortraitHighlight)
package {
import flash.display.*;
public dynamic class PortraitHighlight extends MovieClip {
}
}//package
Section 349
//PortraitSelect (PortraitSelect)
package {
import flash.display.*;
public dynamic class PortraitSelect extends MovieClip {
}
}//package
Section 350
//potion_sound (potion_sound)
package {
import flash.media.*;
public dynamic class potion_sound extends Sound {
}
}//package
Section 351
//PotionBody (PotionBody)
package {
public class PotionBody extends Consumable {
public function PotionBody(_arg1:int=1){
item_name = "Body Enhancement Elixir";
lore = "Sometimes referred to as 'Juice'";
increase_strength = 5;
increase_endurance = 5;
item_rarity = Item.orange;
icon_frame = 4;
}
}
}//package
Section 352
//PotionHealth (PotionHealth)
package {
public class PotionHealth extends Consumable {
public function PotionHealth(_arg1:int=1){
item_name = "Healing Potion";
restore_health = 75;
item_rarity = Item.blue;
icon_frame = 4;
}
}
}//package
Section 353
//PotionHealthSmall (PotionHealthSmall)
package {
public class PotionHealthSmall extends Consumable {
public function PotionHealthSmall(_arg1:int=1){
item_name = "Weak Healing Potion";
restore_health = 40;
item_rarity = Item.green;
icon_frame = 80;
}
}
}//package
Section 354
//PotionPoisonResist (PotionPoisonResist)
package {
public class PotionPoisonResist extends Consumable {
public function PotionPoisonResist(_arg1:int=1){
item_name = "Snake's Blood Potion";
restore_health = 20;
poison_resist = 100;
item_rarity = Item.green;
icon_frame = 77;
}
}
}//package
Section 355
//PotionPower (PotionPower)
package {
public class PotionPower extends Consumable {
public function PotionPower(_arg1:int=1){
item_name = "Power Potion";
restore_power = 75;
item_rarity = Item.blue;
icon_frame = 5;
}
}
}//package
Section 356
//PotionPowerSmall (PotionPowerSmall)
package {
public class PotionPowerSmall extends Consumable {
public function PotionPowerSmall(_arg1:int=1){
item_name = "Weak Power Potion";
restore_power = 40;
item_rarity = Item.green;
icon_frame = 81;
}
}
}//package
Section 357
//PotionQuickness (PotionQuickness)
package {
public class PotionQuickness extends Consumable {
public function PotionQuickness(_arg1:int=1){
item_name = "Elixir of Speed";
quickness_bonus = 20;
item_rarity = Item.green;
icon_frame = 78;
}
}
}//package
Section 358
//PotionRejuve (PotionRejuve)
package {
public class PotionRejuve extends Consumable {
public function PotionRejuve(_arg1:int=1){
item_name = "Rejuvenation Potion";
restore_health = 75;
restore_power = 75;
item_rarity = Item.blue;
icon_frame = 7;
}
}
}//package
Section 359
//PotionRejuveSmall (PotionRejuveSmall)
package {
public class PotionRejuveSmall extends Consumable {
public function PotionRejuveSmall(_arg1:int=1){
item_name = "Weak Rejuvenation Potion";
restore_health = 40;
restore_power = 40;
item_rarity = Item.green;
icon_frame = 83;
}
}
}//package
Section 360
//PotionRevive (PotionRevive)
package {
public class PotionRevive extends Consumable {
public function PotionRevive(_arg1:int=1){
item_name = "Revival Potion";
restore_health = 75;
resurrect = true;
item_rarity = Item.blue;
icon_frame = 6;
}
}
}//package
Section 361
//PotionReviveWeak (PotionReviveWeak)
package {
public class PotionReviveWeak extends Consumable {
public function PotionReviveWeak(_arg1:int=1){
item_name = "Weak Revival Potion";
restore_health = 30;
resurrect = true;
item_rarity = Item.green;
icon_frame = 82;
}
}
}//package
Section 362
//PotionShield (PotionShield)
package {
public class PotionShield extends Consumable {
public function PotionShield(_arg1:int=1){
item_name = "Elixir of Protection";
damage_resist = 20;
stun_resist = 50;
item_rarity = Item.green;
icon_frame = 79;
}
}
}//package
Section 363
//PotionWits (PotionWits)
package {
public class PotionWits extends Consumable {
public function PotionWits(_arg1:int=1){
item_name = "Elixir of Enhanced Wits";
increase_dexterity = 5;
increase_intellect = 5;
item_rarity = Item.orange;
icon_frame = 5;
}
}
}//package
Section 364
//power_up_sound (power_up_sound)
package {
import flash.media.*;
public dynamic class power_up_sound extends Sound {
}
}//package
Section 365
//PowerBar (PowerBar)
package {
import flash.display.*;
public dynamic class PowerBar extends MovieClip {
public var bar:MovieClip;
public var lightbar:MovieClip;
}
}//package
Section 366
//ProgressCleared (ProgressCleared)
package {
import flash.text.*;
import flash.display.*;
public dynamic class ProgressCleared extends MovieClip {
public var label:TextField;
public var bar_mask:MovieClip;
public var holder:MovieClip;
}
}//package
Section 367
//ProgressExplored (ProgressExplored)
package {
import flash.text.*;
import flash.display.*;
public dynamic class ProgressExplored extends MovieClip {
public var label:TextField;
public var bar_mask:MovieClip;
public var holder:MovieClip;
}
}//package
Section 368
//pShadow (pShadow)
package {
public class pShadow extends PlayerSummon {
public function pShadow(_arg1:int=1){
var _local2:int;
super(_arg1);
classname = "Shadow";
charname = "Shadow";
description = "Summoned. Acts as decoy or curses enemies.";
portrait = CharGraphic.warrior1;
if (((!((dm.main == null))) && (!((dm.main.pc_party == null))))){
if (dm.main.pc_party.members.length){
_local2 = dmf.randomNum(0, (dm.main.pc_party.members.length - 1));
portrait = dm.main.pc_party.members[_local2].portrait;
};
};
quickness = 50;
power_per_turn = 0;
health_max = 1;
health = health_max;
damage = 0;
skills.push(new sShadowCurse(this));
skills.push(new sShadowCure(this));
initSummonSkills();
}
}
}//package
Section 369
//pShadowWolf (pShadowWolf)
package {
public class pShadowWolf extends PlayerSummon {
public function pShadowWolf(_arg1:int=1){
super(_arg1);
classname = "Creature";
charname = "Dire Wolf";
portrait = CharGraphic.wolf;
description = "Summoned.";
quickness = 55;
health_max = Math.round((health_max * 0.6));
health = health_max;
damage = Math.round((damage * 0.8));
skills.push(new sSummonAttack(this));
initSummonSkills();
}
}
}//package
Section 370
//punch_sound (punch_sound)
package {
import flash.media.*;
public dynamic class punch_sound extends Sound {
}
}//package
Section 371
//pWargolem (pWargolem)
package {
public class pWargolem extends PlayerSummon {
public function pWargolem(_arg1:int=1){
super(_arg1);
classname = "Wargolem";
charname = "Wargolem";
portrait = CharGraphic.golem;
description = "Summoned. Animated stone and steel.";
quickness = 20;
damage_resistance = 50;
health_max = Math.round((health_max * 0.6));
health = health_max;
damage = Math.round((damage * 0.7));
skills.push(new sSummonAttack(this));
skills[0].specialAnimation = PortraitAnimation.playerSlash;
skills.push(new sWargolemHarden(this));
initSummonSkills();
}
}
}//package
Section 372
//QualitySelector (QualitySelector)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class QualitySelector extends MovieClip {
public var best:TextField;
public var low:TextField;
public var high:TextField;
public var med:TextField;
private static var _quality:String = "HIGH";
public function QualitySelector():void{
best.addEventListener(MouseEvent.MOUSE_DOWN, clickBest);
high.addEventListener(MouseEvent.MOUSE_DOWN, clickHigh);
med.addEventListener(MouseEvent.MOUSE_DOWN, clickMed);
low.addEventListener(MouseEvent.MOUSE_DOWN, clickLow);
addEventListener(Event.ADDED_TO_STAGE, added);
}
function added(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, added);
setQuality(quality);
updateGraphic();
}
function clickMed(_arg1:MouseEvent):void{
setQuality(StageQuality.MEDIUM);
updateGraphic();
}
function clickHigh(_arg1:MouseEvent):void{
setQuality(StageQuality.HIGH);
updateGraphic();
}
function clickLow(_arg1:MouseEvent):void{
setQuality(StageQuality.LOW);
updateGraphic();
}
public function cleanup():void{
best.removeEventListener(MouseEvent.MOUSE_DOWN, clickBest);
high.removeEventListener(MouseEvent.MOUSE_DOWN, clickHigh);
med.removeEventListener(MouseEvent.MOUSE_DOWN, clickMed);
low.removeEventListener(MouseEvent.MOUSE_DOWN, clickLow);
}
function clickBest(_arg1:MouseEvent):void{
setQuality(StageQuality.BEST);
updateGraphic();
}
private function updateGraphic():void{
if (stage.quality == "LOW"){
this.gotoAndStop("low");
} else {
if (stage.quality == "MEDIUM"){
this.gotoAndStop("med");
} else {
if (stage.quality == "HIGH"){
this.gotoAndStop("high");
} else {
if (stage.quality == "BEST"){
this.gotoAndStop("best");
};
};
};
};
}
public static function setQuality(_arg1:String):void{
_quality = _arg1;
if (dm.stage != null){
dm.stage.quality = _arg1;
};
}
public static function get quality():String{
return (_quality);
}
}
}//package
Section 373
//QualitySelectorMenu (QualitySelectorMenu)
package {
public dynamic class QualitySelectorMenu extends QualitySelector {
}
}//package
Section 374
//RandomBones (RandomBones)
package {
public dynamic class RandomBones extends RandomFrame {
public function RandomBones(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package
Section 375
//RandomFloor (RandomFloor)
package {
import flash.display.*;
public dynamic class RandomFloor extends MovieClip {
}
}//package
Section 376
//RandomFrame (RandomFrame)
package {
import flash.display.*;
public class RandomFrame extends MovieClip {
public function RandomFrame():void{
var _local1:int;
super();
_local1 = dmf.randomNum(1, this.totalFrames);
this.gotoAndStop(_local1);
}
}
}//package
Section 377
//RandomGear (RandomGear)
package {
public dynamic class RandomGear extends RandomFrame {
public function RandomGear(){
addFrameScript(0, frame1);
}
function frame1(){
this.stop();
}
}
}//package
Section 378
//RandomLightning (RandomLightning)
package {
import flash.display.*;
public dynamic class RandomLightning extends MovieClip {
public var f;
public var r;
public function RandomLightning(){
addFrameScript(0, frame1);
}
function frame1(){
f = dm.randomNum(1, this.totalFrames);
this.gotoAndStop(f);
r = dm.randomNum(0, 359);
this.rotation = r;
}
}
}//package
Section 379
//RangedWeapon (RangedWeapon)
package {
public class RangedWeapon extends Weapon {
public function RangedWeapon(){
materials.push("Elm", "Oak", "Ash", "Yew", "Voidwood", "Planespine");
}
override public function getItemTypeString(){
return ("Ranged Weapon");
}
override public function getItemModifiers():void{
super.getItemModifiers();
prefixes.push(["Venomous", 5]);
suffixes.push(["Deftness", base_item_stat_bonus]);
}
}
}//package
Section 380
//RatingDialog (RatingDialog)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class RatingDialog extends MovieClip {
public var yes_btn:MovieClip;
public var subtotal:TextField;
public var kongSubmitButton:MovieClip;
public var total:TextField;
public var col1:TextField;
public var col3:TextField;
public var col2:TextField;
public var difficulty:TextField;
public function RatingDialog(_arg1:Party=null){
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
super();
yes_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
kongSubmitButton.addEventListener(MouseEvent.MOUSE_DOWN, clickSubmit);
if (((!(DungeonMain.KONGREGATE)) && (!(DungeonMain.debug)))){
removeChild(kongSubmitButton);
};
if (_arg1 != null){
_local2 = _arg1.level;
_local3 = Math.round(((_arg1.stat_rooms_explored / _arg1.stat_rooms_total) * 100));
_local4 = Math.round(((_arg1.stat_hordes_defeated / (_local2 * 10)) * 100));
_local5 = (_local3 + _local4);
_local6 = _arg1.stat_member_deaths;
_local7 = _arg1.stat_shrines_used;
_local8 = _arg1.stat_party_defeats;
_local9 = _arg1.stat_leaders_defeated;
_arg1.getLevelScore();
col1.text = ((((((((((_local2 + "\n") + _local4) + "\n\n") + _local9) + "\n") + _local7) + "\n") + _local6) + "\n") + _local8);
col2.text = ((((((((((Party.SCORE_LEVEL + "\n") + _local3) + "\n\n") + Party.SCORE_LEADERS) + "\n") + Party.SCORE_SHRINES) + "\n") + Party.SCORE_DEATHS) + "\n") + Party.SCORE_DEFEATS);
col3.text = (((((((((((((_arg1.level * Party.SCORE_LEVEL) + "\nx") + _local5) + "%\n") + _arg1.getLevelScore()) + "\n") + (_local9 * Party.SCORE_LEADERS)) + "\n") + (_local7 * Party.SCORE_SHRINES)) + "\n") + (_local6 * Party.SCORE_DEATHS)) + "\n") + (_local8 * Party.SCORE_DEFEATS));
subtotal.text = String(_arg1.getScore(false));
difficulty.text = (("x" + String(Difficulty.getMultiplier(_arg1.difficulty, _arg1.difficultyMods))) + "%");
total.text = String(_arg1.getScore(true));
};
}
function clickOkay(_arg1:MouseEvent):void{
if (parent != null){
parent.removeChild(this);
cleanup();
};
}
function clickSubmit(_arg1:MouseEvent):void{
dm.main.beginStatSubmit();
}
private function cleanup():void{
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
kongSubmitButton.removeEventListener(MouseEvent.MOUSE_DOWN, clickSubmit);
}
}
}//package
Section 381
//rCell (rCell)
package {
public class rCell extends DungeonRoom {
static var grid_height = 2;
static var grid_width = 2;
override public function getGridHeight():int{
return (grid_height);
}
override public function getGridWidth():int{
return (grid_width);
}
}
}//package
Section 382
//rChamber (rChamber)
package {
public class rChamber extends DungeonRoom {
static var grid_height = 3;
static var grid_width = 3;
override public function getGridHeight():int{
return (grid_height);
}
override public function getGridWidth():int{
return (grid_width);
}
}
}//package
Section 383
//rCorridorH (rCorridorH)
package {
import flash.display.*;
public class rCorridorH extends DungeonCorridor {
public var gfx:MovieClip;
static var grid_height = 1;
static var grid_width = 2;
public function rCorridorH(){
isCorridorH = true;
}
override public function getGridHeight():int{
return (grid_height);
}
override public function setAlpha(_arg1:Number):void{
gfx.alpha = _arg1;
tint.alpha = _arg1;
setAlphaChildren(_arg1);
}
override public function getGridWidth():int{
return (grid_width);
}
override public function getAlpha():Number{
return (gfx.alpha);
}
override public function setChild(_arg1:DisplayObject):void{
addChild(_arg1);
}
}
}//package
Section 384
//rCorridorV (rCorridorV)
package {
import flash.display.*;
public class rCorridorV extends DungeonCorridor {
public var gfx:MovieClip;
static var grid_height = 2;
static var grid_width = 1;
override public function getGridHeight():int{
return (grid_height);
}
override public function setAlpha(_arg1:Number):void{
gfx.alpha = _arg1;
tint.alpha = _arg1;
setAlphaChildren(_arg1);
}
override public function getGridWidth():int{
return (grid_width);
}
override public function getAlpha():Number{
return (gfx.alpha);
}
override public function setChild(_arg1:DisplayObject):void{
addChild(_arg1);
}
}
}//package
Section 385
//rDemonRoom (rDemonRoom)
package {
import flash.display.*;
public class rDemonRoom extends DungeonRoom {
public var rune1:MovieClip;
public var rune2:MovieClip;
public var rune6:MovieClip;
public var rune8:MovieClip;
public var rune9:MovieClip;
public var rune7:MovieClip;
public var rune3:MovieClip;
public var rune4:MovieClip;
public var rune5:MovieClip;
static var grid_height = 5;
static var grid_width = 5;
override public function getGridHeight():int{
return (grid_height);
}
override public function getGridWidth():int{
return (grid_width);
}
public function toFrame(_arg1:int):void{
var _local2:*;
var _local3:*;
this.gotoAndStop(_arg1);
_local2 = 1;
while (_local2 < _arg1) {
_local3 = getChildByName(("rune" + _local2));
if (_local3 == null){
} else {
_local3.gotoAndPlay(1);
};
_local2++;
};
}
}
}//package
Section 386
//RecoveryShrine (RecoveryShrine)
package {
import flash.utils.*;
import flash.events.*;
import flash.display.*;
public class RecoveryShrine extends MovieClip {
var used:Boolean;
var room:DungeonRoom;
public static const TYPE_ID = 1;
public function RecoveryShrine(){
addFrameScript(0, frame1);
used = false;
this.gotoAndStop(1);
}
function onFadeComplete(_arg1:TimerEvent):void{
if (parent != null){
parent.removeChild(this);
};
}
function frame1(){
this.gotoAndStop(1);
}
public function fade():void{
var _local1:Timer;
used = true;
this.gotoAndPlay(2);
_local1 = new Timer(500, 1);
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, onFadeComplete);
_local1.start();
}
public function get type():int{
return (TYPE_ID);
}
}
}//package
Section 387
//RedBar (RedBar)
package {
import flash.display.*;
public dynamic class RedBar extends MovieClip {
}
}//package
Section 388
//RestDialog (RestDialog)
package {
import flash.events.*;
import flash.ui.*;
import flash.display.*;
public class RestDialog extends MovieClip {
public var yes_btn:MovieClip;
public var no_btn:MovieClip;
public function RestDialog(){
this.yes_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickYes);
this.no_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickNo);
dm.stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
}
function clickYes(_arg1:MouseEvent):void{
if (((!((parent == null))) && ((parent is Dungeon)))){
cleanup();
Dungeon(parent).useRest();
};
}
function clickNo(_arg1:MouseEvent):void{
if (parent != null){
cleanup();
parent.removeChild(this);
};
}
private function cleanup():void{
dm.stage.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickYes);
no_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickNo);
}
function reportKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ENTER){
clickYes(null);
} else {
if (_arg1.keyCode == Keyboard.ESCAPE){
clickNo(null);
};
};
}
}
}//package
Section 389
//RestScreen (RestScreen)
package {
import flash.display.*;
public dynamic class RestScreen extends MovieClip {
public function RestScreen(){
addFrameScript(14, frame15, 30, frame31);
}
function frame15(){
if (((!((this.parent == null))) && ((this.parent is Dungeon)))){
Dungeon(this.parent).updateChars();
Dungeon(this.parent).removeRestButton();
};
}
function frame31(){
if (this.parent != null){
parent.removeChild(this);
};
}
}
}//package
Section 390
//RetreatedEffect (RetreatedEffect)
package {
import flash.display.*;
public dynamic class RetreatedEffect extends Sprite {
}
}//package
Section 391
//return_of_the_knights_b (return_of_the_knights_b)
package {
import flash.media.*;
public dynamic class return_of_the_knights_b extends Sound {
}
}//package
Section 392
//revive_effect (revive_effect)
package {
import flash.display.*;
public dynamic class revive_effect extends MovieClip {
public var gfx:CharGraphic;
public function revive_effect(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.heal);
}
function frame45(){
this.stop();
}
}
}//package
Section 393
//rGallery (rGallery)
package {
public class rGallery extends DungeonRoom {
static var grid_height = 4;
static var grid_width = 3;
override public function getGridHeight():int{
return (grid_height);
}
override public function getGridWidth():int{
return (grid_width);
}
}
}//package
Section 394
//rLargeRoom (rLargeRoom)
package {
public class rLargeRoom extends DungeonRoom {
static var grid_height = 4;
static var grid_width = 4;
override public function getGridHeight():int{
return (grid_height);
}
override public function getGridWidth():int{
return (grid_width);
}
}
}//package
Section 395
//rollingthunder_c (rollingthunder_c)
package {
import flash.media.*;
public dynamic class rollingthunder_c extends Sound {
}
}//package
Section 396
//RoomFlash (RoomFlash)
package {
import flash.display.*;
public dynamic class RoomFlash extends MovieClip {
public function RoomFlash(){
addFrameScript(8, frame9);
}
function frame9(){
if (this.parent != null){
parent.removeChild(this);
};
}
}
}//package
Section 397
//rTallRoom (rTallRoom)
package {
public class rTallRoom extends DungeonRoom {
static var grid_height = 4;
static var grid_width = 2;
override public function getGridHeight():int{
return (grid_height);
}
override public function getGridWidth():int{
return (grid_width);
}
}
}//package
Section 398
//rune_protection (rune_protection)
package {
import flash.display.*;
public dynamic class rune_protection extends MovieClip {
public function rune_protection(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.armorBuff);
}
function frame45(){
this.stop();
}
}
}//package
Section 399
//rune_strength (rune_strength)
package {
import flash.display.*;
public dynamic class rune_strength extends MovieClip {
public function rune_strength(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.armorBuff);
}
function frame45(){
this.stop();
}
}
}//package
Section 400
//rWideRoom (rWideRoom)
package {
public class rWideRoom extends DungeonRoom {
static var grid_height = 2;
static var grid_width = 4;
override public function getGridHeight():int{
return (grid_height);
}
override public function getGridWidth():int{
return (grid_width);
}
}
}//package
Section 401
//sAdventurerAttack (sAdventurerAttack)
package {
public class sAdventurerAttack extends Skill {
public function sAdventurerAttack(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
active = true;
damage = _arg1.damage;
power_cost = 0;
skillname = "Attack";
verbage = "attacks";
iconFrame = 17;
specialAnimation = PortraitAnimation.playerSlash;
}
override public function description():String{
return ((("Melee attack for " + getDamage()) + " damage."));
}
}
}//package
Section 402
//sAdventurerHeal (sAdventurerHeal)
package {
public class sAdventurerHeal extends Skill {
public function sAdventurerHeal(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
active = true;
targetsFriendlies = true;
hitsAllFriendlies = true;
rangedAttack = true;
removesPoison = true;
healing = (_arg1.health_max * 0.2);
power_cost = 70;
iconFrame = 10;
skillname = "First Aid";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.heal;
}
override public function description():String{
return ((("Heal all allies for " + healing) + " and cure them of poison."));
}
}
}//package
Section 403
//sAdventurerThrow (sAdventurerThrow)
package {
public class sAdventurerThrow extends Skill {
public function sAdventurerThrow(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
active = true;
rangedAttack = true;
damage = (_arg1.damage * 0.75);
power_cost = 20;
skillname = "Bow Attack";
verbage = ("uses " + skillname);
iconFrame = 15;
specialAnimation = PortraitAnimation.playerArrow;
}
override public function description():String{
return ((("Ranged attack for " + getDamage()) + " damage."));
}
}
}//package
Section 404
//sAetherLightning (sAetherLightning)
package {
public class sAetherLightning extends Skill {
public function sAetherLightning(_arg1:Character){
char_ref = _arg1;
aiTargetsBackRow = true;
rangedAttack = true;
power_cost = 50;
damage = Math.round((char_ref.damage * 0.8));
splashDamageMultiplier = 0.7;
skillname = "Ion Bolt";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.lightning;
}
}
}//package
Section 405
//sArachnoidWeb (sArachnoidWeb)
package {
public class sArachnoidWeb extends Skill {
public function sArachnoidWeb(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 1;
rangedAttack = true;
hitsAllEnemies = true;
damage = 0;
power_cost = 80;
attacksWithAccuracyMod = 0.75;
crippling = 15;
damageAccuracy = 20;
skillname = "Web";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.web;
}
}
}//package
Section 406
//sAscendantRanged (sAscendantRanged)
package {
public class sAscendantRanged extends Skill {
public function sAscendantRanged(_arg1:Character){
char_ref = _arg1;
rangedAttack = true;
damage = Math.round((_arg1.damage * 1));
power_cost = 10;
ignoresArmor = false;
damageAccuracy = 10;
skillname = "Energy Flare";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.holyDamage;
}
}
}//package
Section 407
//SatyrQuestDialog (SatyrQuestDialog)
package {
import flash.events.*;
import flash.ui.*;
import flash.text.*;
import flash.display.*;
public class SatyrQuestDialog extends MovieClip {
public var charName:TextField;
public var yes_btn:MovieClip;
public var dialogue:TextField;
private var questComplete:Boolean;
public var charGraphic:CharGraphic;
public function SatyrQuestDialog(_arg1:Boolean=false):void{
charName.text = Horde.getLurkerName();
dmf.embolden(charName);
charGraphic.setFrame(CharGraphic.satyr);
questComplete = _arg1;
if (!(_arg1)){
dialogue.text = "\"You are not one of them. Come closer.\n\n\"This place was my home, before these monsters arrived. Now, I am an exile, hunted like vermin. Destroy them for me, every last one. In return, I will give you what I have pilfered from their supplies.\"";
} else {
dialogue.text = "\"You have done as I asked. More for the promise of reward than compassion or justice for me, I suspect.\n\n\"But you shall have your reward. Take it and go now. Leave me to my solitude.\"";
};
this.yes_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickYes);
dm.stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
}
function clickYes(_arg1:MouseEvent):void{
if (parent != null){
if (questComplete){
Dungeon(parent).satyrQuestComplete();
};
cleanup();
parent.removeChild(this);
};
}
private function cleanup():void{
dm.stage.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickYes);
}
function reportKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ENTER){
clickYes(null);
} else {
if (_arg1.keyCode == Keyboard.ESCAPE){
clickYes(null);
};
};
}
}
}//package
Section 408
//SaveDeleteDialog (SaveDeleteDialog)
package {
import flash.events.*;
import flash.ui.*;
import flash.display.*;
public class SaveDeleteDialog extends MovieClip {
public var yes_btn:MovieClip;
var slot:int;// = 0
public var no_btn:MovieClip;
public function SaveDeleteDialog(_arg1:int=0){
slot = 0;
super();
this.slot = _arg1;
this.yes_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickYes);
this.no_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickNo);
dm.stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
}
function clickYes(_arg1:MouseEvent):void{
if (((!((parent == null))) && ((parent is LoadParty)))){
LoadParty(parent).deleteSlot(slot);
cleanup();
parent.removeChild(this);
};
}
function clickNo(_arg1:MouseEvent):void{
if (parent != null){
parent.removeChild(this);
cleanup();
};
}
private function cleanup(){
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickYes);
no_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickNo);
dm.stage.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
}
function reportKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ESCAPE){
clickNo(null);
};
}
}
}//package
Section 409
//SaveGameEmpty (SaveGameEmpty)
package {
import flash.display.*;
public dynamic class SaveGameEmpty extends SimpleButton {
}
}//package
Section 410
//SaveGameStatus (SaveGameStatus)
package {
import flash.text.*;
import flash.display.*;
public class SaveGameStatus extends MovieClip {
var slot:int;// = 1
public var difficultyNumber:TextField;
public var campaignText:TextField;
public var del_btn:SimpleButton;
public var load_btn:SimpleButton;
var level:int;// = 1
var score:int;// = 0
public var char3:CharacterInfo;
public var char1:CharacterInfo;
public var scoreField:TextField;
public var char2:CharacterInfo;
public var levelText:TextField;
public var rulesText:TextField;
public var char4:CharacterInfo;
public function SaveGameStatus():void{
slot = 1;
level = 1;
score = 0;
super();
DungeonMain.registerAliases();
char1.mouseEnabled = false;
char1.mouseChildren = false;
char2.mouseEnabled = false;
char2.mouseChildren = false;
char3.mouseEnabled = false;
char3.mouseChildren = false;
char4.mouseEnabled = false;
char4.mouseChildren = false;
levelText.mouseEnabled = false;
campaignText.mouseEnabled = false;
rulesText.mouseEnabled = false;
scoreField.mouseEnabled = false;
difficultyNumber.mouseEnabled = false;
}
public function setParty(_arg1:Party, _arg2:Boolean=false):void{
var _local3:String;
var _local4:PlayerCharacter;
var _local5:String;
var _local6:*;
var _local7:CharacterInfo;
_local3 = "";
for each (_local4 in _arg1.members) {
_local4.loadCustomPortrait();
};
level = _arg1.level;
score = _arg1.getScore(true);
levelText.text = ("Level " + level);
dmf.embolden(levelText);
campaignText.text = Campaign.getName(_arg1.campaign);
dmf.embolden(campaignText);
if (_arg1.beginner){
_local3 = "Beginner";
} else {
if (_arg1.extreme){
_local3 = "Extreme";
} else {
_local3 = "Standard";
};
};
_local5 = "";
if (_arg1.hardcore){
_local5 = "Hardcore";
};
if (_arg1.tactical){
if (_local5.length){
_local5 = (_local5 + " - ");
};
_local5 = (_local5 + "Tactical");
};
if (_arg1.attrition){
if (_local5.length){
_local5 = (_local5 + " - ");
};
_local5 = (_local5 + "Attrition");
};
if (_local5.length){
rulesText.text = ((_local3 + "\n") + _local5);
} else {
rulesText.text = _local3;
};
difficultyNumber.text = (String(Difficulty.getMultiplier(_arg1.difficulty, _arg1.difficultyMods)) + "%");
dmf.embolden(difficultyNumber);
scoreField.text = String(score);
dmf.embolden(scoreField);
_local6 = 0;
while (_local6 < 4) {
_local7 = CharacterInfo(getChildByName(("char" + (_local6 + 1))));
if (_arg1.members[_local6] != null){
_local7.setChar(_arg1.members[_local6]);
} else {
removeChild(_local7);
};
_local6++;
};
}
}
}//package
Section 411
//SaveGameStatusContainer (SaveGameStatusContainer)
package {
import flash.events.*;
import flash.display.*;
public class SaveGameStatusContainer extends MovieClip {
private var scrolling:Boolean;// = false
public var slot:int;// = 1
public var empty_panel:SimpleButton;
public var empty:Boolean;// = false
public var status:SaveGameStatus;
public function SaveGameStatusContainer():void{
empty = false;
slot = 1;
scrolling = false;
super();
status.load_btn.addEventListener(MouseEvent.MOUSE_DOWN, loadClick);
status.del_btn.addEventListener(MouseEvent.MOUSE_DOWN, deleteClick);
empty_panel.addEventListener(MouseEvent.MOUSE_DOWN, emptyClick);
empty = false;
removeChild(empty_panel);
}
public function emptySlot():void{
if (empty){
return;
};
if (this.contains(empty_panel)){
return;
};
empty = true;
setHidden();
addChild(empty_panel);
}
function emptyClick(_arg1:MouseEvent):void{
if (parent != null){
LoadParty(parent).newGame(slot);
};
}
function loadClick(_arg1:MouseEvent):void{
dm.main.loadGame(slot);
}
public function get level():int{
return (status.level);
}
function deleteClick(_arg1:MouseEvent):void{
var _local2:SaveDeleteDialog;
if (((!((parent == null))) && ((parent is LoadParty)))){
_local2 = new SaveDeleteDialog(slot);
_local2.name = "dialog";
parent.addChild(_local2);
};
}
private function setHidden():void{
removeChild(status);
}
public function cleanup():void{
status.load_btn.removeEventListener(MouseEvent.MOUSE_DOWN, loadClick);
status.del_btn.removeEventListener(MouseEvent.MOUSE_DOWN, deleteClick);
empty_panel.removeEventListener(MouseEvent.MOUSE_DOWN, emptyClick);
}
public function setParty(_arg1:Party, _arg2:Boolean=false):void{
if (_arg1 == null){
emptySlot();
return;
};
empty = false;
status.setParty(_arg1, _arg2);
}
public function get score():int{
return (status.score);
}
}
}//package
Section 412
//sBarbarianBoast (sBarbarianBoast)
package {
public class sBarbarianBoast extends Skill {
public function sBarbarianBoast(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
alwaysHits = true;
rangedAttack = true;
aiCastLimit = 0;
damage = 0;
power_cost = 30;
crippling = 20;
iconFrame = 66;
allyBonusAttack = true;
skillname = "Boast";
verbage = ("begins to " + skillname);
specialAnimation = PortraitAnimation.debuff;
}
override public function description():String{
return ((("Targets any enemy. Does not miss. The target is demoralized, and receives a penalty to Quickness (up to " + crippling) + ") for the remainder of the battle. In addition, a random ally is goaded into action and performs a bonus weapon attack on the target."));
}
}
}//package
Section 413
//sBarbarianBrutalize (sBarbarianBrutalize)
package {
public class sBarbarianBrutalize extends Skill {
public function sBarbarianBrutalize(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
damage = 0;
power_cost = 50;
addWeaponDamage = true;
requiresMelee = true;
scaleWeaponDamage = 1;
debuff_damage = 0.7;
iconFrame = 52;
skillname = "Dismember";
verbage = ("uses " + skillname);
showWeaponAnimation = true;
specialAnimation = PortraitAnimation.debuff;
}
override public function description():String{
return ((((((("Melee attack for " + (scaleWeaponDamage * 100)) + "% weapon damage (") + getDamage()) + "). Reduces enemy damage by ") + Math.round(((1 - debuff_damage) * 100))) + "% for the remainder of the battle."));
}
}
}//package
Section 414
//sBarbarianCharge (sBarbarianCharge)
package {
public class sBarbarianCharge extends Skill {
public function sBarbarianCharge(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
damage = 0;
addWeaponDamage = true;
scaleWeaponDamage = 1.6;
power_cost = 35;
requiresMelee = true;
requiresVerticalGap = true;
stun_percent = 50;
iconFrame = 65;
skillname = "Charge";
verbage = "charges the enemy!";
specialAnimation = PortraitAnimation.playerPowerSlash;
}
override public function description():String{
return ((((((("Charge an enemy directly ahead, attacking for " + Math.round((scaleWeaponDamage * 100))) + "% weapon damage (") + getDamage()) + "). Attack has +") + stun_percent) + "% chance to stun the target. There must be an empty vertical space between the user and the target."));
}
}
}//package
Section 415
//sBarbarianIntimidate (sBarbarianIntimidate)
package {
public class sBarbarianIntimidate extends Skill {
public function sBarbarianIntimidate(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
aiCastLimit = 0;
damage = 0;
power_cost = 70;
targetsSelf = true;
intimidating = true;
buff_quickness = 10;
iconFrame = 67;
skillname = "Intimidate";
verbage = "is an intimidating presence";
}
override public function description():String{
return ((("Enemies will prefer to attack targets other than the user for the remainder of the combat. In addition, user's Quickness is increased by " + buff_quickness) + "."));
}
}
}//package
Section 416
//sBarbarianJostle (sBarbarianJostle)
package {
public class sBarbarianJostle extends Skill {
public function sBarbarianJostle(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
aiCastLimit = 0;
damage = 0;
power_cost = 10;
targetsFriendlies = true;
swapPositions = true;
iconFrame = 59;
skillname = "Jostle";
verbage = ("uses " + skillname);
}
override public function description():String{
return ("Swap position with target ally.");
}
}
}//package
Section 417
//sBarbarianLastStand (sBarbarianLastStand)
package {
public class sBarbarianLastStand extends Skill {
public function sBarbarianLastStand(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
requiresLowHealth = true;
requiresMelee = true;
damage = 0;
addWeaponDamage = true;
scaleWeaponDamage = 2;
lethality = 20;
power_cost = 40;
iconFrame = 14;
skillname = "Last Stand";
verbage = ("makes a " + skillname);
specialAnimation = PortraitAnimation.playerPowerSlash;
}
override public function description():String{
return ((((("May only be used when below 20% health. Perform a melee weapon attack on the target for 200% normal damage (" + getDamage()) + ") and +") + lethality) + "% chance to kill the target instantly."));
}
}
}//package
Section 418
//sBarbarianPowerGain (sBarbarianPowerGain)
package {
public class sBarbarianPowerGain extends Skill {
public function sBarbarianPowerGain(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
aiCastLimit = 0;
targetsSelf = true;
woundsRestorePower = 100;
power_cost = 0;
iconFrame = 72;
skillname = "Enrage";
verbage = "is fuelled by rage";
}
override public function description():String{
return ("If the user takes damage before their next turn, their power is completely restored.");
}
}
}//package
Section 419
//sBarbarianPulverize (sBarbarianPulverize)
package {
public class sBarbarianPulverize extends Skill {
public function sBarbarianPulverize(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
damage = 0;
power_cost = 55;
iconFrame = 71;
requiresMelee = true;
addWeaponDamage = true;
scaleWeaponDamage = 1.2;
debuff_damageResist = 20;
skillname = "Pulverize";
verbage = "pulverizes the enemy";
showWeaponAnimation = true;
specialAnimation = PortraitAnimation.debuff;
}
override public function description():String{
return ((((((("Weapon attack for " + (scaleWeaponDamage * 100)) + "% weapon damage (") + getDamage()) + "). Damages the target's armor and exposes their weak spots, reducing their damage resistance by ") + debuff_damageResist) + " for the remainder of the battle."));
}
}
}//package
Section 420
//sBarbarianReckless (sBarbarianReckless)
package {
public class sBarbarianReckless extends Skill {
public function sBarbarianReckless(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
aiCastLimit = 1;
damage = 0;
power_cost = 20;
targetsSelf = true;
buff_damage = 1.5;
debuff_damageResist = 50;
iconFrame = 58;
skillname = "Reckless Fury";
verbage = ("is consumed with " + skillname);
specialAnimation = PortraitAnimation.buff;
}
override public function description():String{
return ((((("Increase damage dealt by " + Math.round((buff_damage * 100))) + "%, but reduce damage resistance by ") + debuff_damageResist) + ". Lasts for the remainder of the battle."));
}
}
}//package
Section 421
//sBarbarianWhirlwind (sBarbarianWhirlwind)
package {
public class sBarbarianWhirlwind extends Skill {
public function sBarbarianWhirlwind(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
damage = 0;
addWeaponDamage = true;
requiresMelee = true;
usesWeaponRange = true;
scaleWeaponDamage = 1;
splashDamageMultiplier = 0.7;
splashHitsAllies = false;
power_cost = 65;
iconFrame = 5;
skillname = "Whirlwind";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.playerSlash;
}
override public function description():String{
return ((((("Perform a melee weapon attack (" + getDamage()) + " damage) on a target in range, and a lesser attack for ") + Math.round((getDamage() * splashDamageMultiplier))) + " damage on every enemy adjacent to the target."));
}
}
}//package
Section 422
//sBasiliskPetrify (sBasiliskPetrify)
package {
public class sBasiliskPetrify extends Skill {
public function sBasiliskPetrify(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 2;
hitsAllMeleeRange = true;
power_cost = 65;
damage = 0;
stun_percent = 100;
skillname = "Petrify";
verbage = ("uses " + skillname);
}
}
}//package
Section 423
//sBeholderDrain (sBeholderDrain)
package {
public class sBeholderDrain extends Skill {
public function sBeholderDrain(_arg1:Character){
char_ref = _arg1;
aiNotUnlessHurt = true;
aiTargetHealthiest = true;
rangedAttack = true;
damage = Math.round((_arg1.damage * 0.5));
vampiric_percent = Math.floor((100 + (level * 1)));
power_cost = 40;
ignoresArmor = true;
skillname = "Steal Soul";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.monsterDrain;
}
}
}//package
Section 424
//sBeholderRanged (sBeholderRanged)
package {
public class sBeholderRanged extends Skill {
public function sBeholderRanged(_arg1:Character){
char_ref = _arg1;
rangedAttack = true;
damage = Math.round((_arg1.damage * 1.3));
power_cost = 70;
ignoresArmor = true;
skillname = "Disentegrate";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.disintegrate;
}
}
}//package
Section 425
//sBeholderRecover (sBeholderRecover)
package {
public class sBeholderRecover extends Skill {
public function sBeholderRecover(_arg1:Character){
char_ref = _arg1;
aiNotUnlessLowPower = true;
targetsSelf = true;
damage = Math.round((_arg1.health_max * 0.1));
powerRestore = 100;
power_cost = 0;
skillname = "Channeling";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.gainPower;
}
}
}//package
Section 426
//sCelestialAccuracy (sCelestialAccuracy)
package {
public class sCelestialAccuracy extends Skill {
public function sCelestialAccuracy(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
aiCastLimit = 1;
damage = 0;
power_cost = 40;
targetsFriendlies = true;
hitsAllFriendlies = true;
buff_accuracy = 20;
skillname = "Celestial Guidance";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.buff;
}
}
}//package
Section 427
//sCelestialArmor (sCelestialArmor)
package {
public class sCelestialArmor extends Skill {
public function sCelestialArmor(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
aiCastLimit = 1;
damage = 0;
power_cost = 40;
targetsFriendlies = true;
hitsAllFriendlies = true;
buff_damageResist = 20;
skillname = "Celestial Protection";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.armorBuff;
}
override public function description():String{
return ((("Caster gains an additional " + buff_damageResist) + "% damage resistance for the remainder of the battle."));
}
}
}//package
Section 428
//sCelestialSpeed (sCelestialSpeed)
package {
public class sCelestialSpeed extends Skill {
public function sCelestialSpeed(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
aiCastLimit = 1;
damage = 0;
power_cost = 40;
targetsFriendlies = true;
hitsAllFriendlies = true;
buff_quickness = 10;
skillname = "Celestial Motion";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.buff;
}
}
}//package
Section 429
//sClericAE (sClericAE)
package {
public class sClericAE extends Skill {
public function sClericAE(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.intellect;
aiCastLimit = 0;
magicStrength = 0.5;
damage = getBaseMagicDamage(magicStrength);
rangedAttack = true;
hitsAllEnemies = true;
power_cost = 55;
iconFrame = 26;
skillname = "Litany of Pain";
verbage = ("intones the " + skillname);
specialAnimation = PortraitAnimation.holyDamage;
}
override public function description():String{
return ((("Magic area attack. Inflicts " + getDamage()) + " damage to all enemies."));
}
}
}//package
Section 430
//sClericDamageBuff (sClericDamageBuff)
package {
public class sClericDamageBuff extends Skill {
public function sClericDamageBuff(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
targetsFriendlies = true;
rangedAttack = true;
power_cost = 30;
targetDamageMod = 1.75;
iconFrame = 42;
skillname = "Anoint";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.buff;
}
override public function description():String{
return ((("Target party member deals " + Math.round((targetDamageMod * 100))) + "% normal damage on next attack."));
}
}
}//package
Section 431
//sClericFlash (sClericFlash)
package {
public class sClericFlash extends Skill {
public function sClericFlash(_arg1:Character){
char_ref = _arg1;
increasesWith = intellect;
magicStrength = 0.3;
damage = getBaseMagicDamage(magicStrength);
onlyDamagesUndead = true;
rangedAttack = true;
hitsAllEnemies = true;
power_cost = 40;
damageAccuracy = 30;
alwaysHits = true;
iconFrame = 13;
skillname = "Holy Light";
verbage = ("calls down " + skillname);
specialAnimation = PortraitAnimation.blind;
}
override public function description():String{
return ((((("Reduce all enemies' accuracy by " + damageAccuracy) + "% for the remainder of the battle. Deals ") + getDamage()) + " damage to Undead. Always hits."));
}
}
}//package
Section 432
//sClericHeal (sClericHeal)
package {
public class sClericHeal extends Skill {
public function sClericHeal(_arg1:Character){
char_ref = _arg1;
increasesWith = intellect;
nonCombat = true;
skillname = "Heal";
targetsFriendlies = true;
rangedAttack = true;
healing = 40;
power_cost = 25;
removesPoison = true;
iconFrame = 9;
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.heal;
}
override public function description():String{
return ((("Restore " + scaleHeal(healing)) + " health to one member of your party. Cures poison."));
}
}
}//package
Section 433
//sClericHealGroup (sClericHealGroup)
package {
public class sClericHealGroup extends Skill {
public function sClericHealGroup(_arg1:Character){
char_ref = _arg1;
increasesWith = intellect;
nonCombat = true;
targetsFriendlies = true;
hitsAllFriendlies = true;
rangedAttack = true;
removesPoison = true;
healing = 20;
power_cost = 60;
iconFrame = 10;
skillname = "Heal All";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.heal;
}
override public function description():String{
return ((("Restore " + scaleHeal(healing)) + " health to every member of your party. Cures poison."));
}
}
}//package
Section 434
//sClericMelee (sClericMelee)
package {
public class sClericMelee extends Skill {
public function sClericMelee(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
damage = 0;
addWeaponDamage = true;
scaleWeaponDamage = 2;
power_cost = 60;
requiresMelee = true;
iconFrame = 4;
skillname = "Fervor";
verbage = ("attacks with " + skillname);
specialAnimation = PortraitAnimation.playerPowerSlash;
}
override public function description():String{
return ((((("Melee attack for " + (scaleWeaponDamage * 100)) + "% weapon damage (") + getDamage()) + ")"));
}
}
}//package
Section 435
//sClericPurify (sClericPurify)
package {
public class sClericPurify extends Skill {
public function sClericPurify(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
targetsFriendlies = true;
hitsAllFriendlies = true;
rangedAttack = true;
power_cost = 20;
removesPoison = true;
removesCurse = true;
buff_resistPoison = 50;
iconFrame = 45;
skillname = "Purify";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.buff;
}
override public function description():String{
return ((("Removes poison and curse effects from all party members, and increases their poison resistance by " + buff_resistPoison) + " for the remainder of the battle."));
}
}
}//package
Section 436
//sClericRevive (sClericRevive)
package {
public class sClericRevive extends Skill {
public function sClericRevive(_arg1:Character){
char_ref = _arg1;
increasesWith = intellect;
aiCastLimit = 0;
nonCombat = true;
targetsFriendlies = true;
rangedAttack = true;
healing = 20;
power_cost = 75;
removesPoison = true;
resurrects = true;
iconFrame = 47;
skillname = "Revive";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.revive;
}
override public function description():String{
return ((("Revives fallen party member with " + scaleHeal(healing)) + " health."));
}
}
}//package
Section 437
//sClericShield (sClericShield)
package {
public class sClericShield extends Skill {
public function sClericShield(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
aiCastLimit = 1;
damage = 0;
power_cost = 55;
targetsSelf = true;
invulnerable = 1;
powerRegenMod = 0;
iconFrame = 19;
skillname = "Shield of Faith";
verbage = ("is enclosed in a " + skillname);
specialAnimation = PortraitAnimation.armorBuff;
}
override public function description():String{
return ((("Caster takes no damage until " + char_ref.genderPossessive()) + " next turn. Caster recovers no power at beginning of next turn."));
}
}
}//package
Section 438
//sClericSmite (sClericSmite)
package {
public class sClericSmite extends Skill {
public function sClericSmite(_arg1:Character){
char_ref = _arg1;
increasesWith = intellect;
magicStrength = 0.75;
damage = getBaseMagicDamage(magicStrength);
rangedAttack = true;
power_cost = 30;
undeadMultiplier = 2;
alwaysHits = true;
iconFrame = 44;
skillname = "Smite";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.holyDamage;
}
override public function description():String{
return ((((("Ranged magic attack for " + getDamage()) + " damage. Deals ") + Math.round((undeadMultiplier * 100))) + "% damage to undead. Always hits."));
}
}
}//package
Section 439
//sConjurorArmor (sConjurorArmor)
package {
public class sConjurorArmor extends Skill {
public function sConjurorArmor(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
aiCastLimit = 1;
damage = 0;
power_cost = 40;
targetsFriendlies = true;
hitsAllFriendlies = true;
buff_damageResist = 15;
iconFrame = 69;
skillname = "Eldritch Aegis";
verbage = ("conjures an " + skillname);
specialAnimation = PortraitAnimation.armorBuff;
}
override public function description():String{
return ((("Conjure a shield of force around all allies, increasing their resistance to damage by " + buff_damageResist) + "% for the remainder of the battle."));
}
}
}//package
Section 440
//sConjurorBanish (sConjurorBanish)
package {
public class sConjurorBanish extends Skill {
public function sConjurorBanish(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
damage = 100000;
rangedAttack = true;
targetsSummoned = true;
power_cost = 20;
iconFrame = 70;
skillname = "Banish";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.disintegrate;
}
override public function description():String{
return ("Instantly destroy a summoned enemy creature.");
}
}
}//package
Section 441
//sConjurorBloodSprite (sConjurorBloodSprite)
package {
public class sConjurorBloodSprite extends Skill {
public function sConjurorBloodSprite(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
aiCastLimit = 0;
damage = 0;
power_cost = 50;
targetsEmpty = true;
summonsCreatureClass = new pBloodSprite(char_ref.level);
iconFrame = 60;
skillname = summonsCreatureClass.charname;
verbage = ("summons a " + summonsCreatureClass.charname);
}
override public function description():String{
return ("Summon a Bloodsprite to an empty square on your side of the battlefield. Bloodsprites are weak fighters, but can heal your party.");
}
}
}//package
Section 442
//sConjurorHeal (sConjurorHeal)
package {
public class sConjurorHeal extends Skill {
public function sConjurorHeal(_arg1:Character){
char_ref = _arg1;
increasesWith = intellect;
targetsFriendlies = true;
targetsSummoned = true;
rangedAttack = true;
healing = 30;
power_cost = 25;
powerRestore = 50;
removesPoison = true;
removesCurse = true;
skillname = "Refresh Energies";
iconFrame = 9;
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.restore;
}
override public function description():String{
return ((((("Restore " + scaleHeal(healing)) + " health and ") + powerRestore) + " power to a friendly summoned creature. Removes poison and curse effects."));
}
}
}//package
Section 443
//sConjurorManaSprite (sConjurorManaSprite)
package {
public class sConjurorManaSprite extends Skill {
public function sConjurorManaSprite(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
aiCastLimit = 0;
damage = 0;
power_cost = 50;
targetsEmpty = true;
summonsCreatureClass = new pManaSprite(char_ref.level);
iconFrame = 61;
skillname = summonsCreatureClass.charname;
verbage = ("summons a " + summonsCreatureClass.charname);
}
override public function description():String{
return ("Summon a Manasprite to an empty square on your side of the battlefield. Manasprites are weak fighters, but can restore power to your party.");
}
}
}//package
Section 444
//sConjurorRevive (sConjurorRevive)
package {
public class sConjurorRevive extends Skill {
public function sConjurorRevive(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
aiCastLimit = 0;
nonCombat = true;
targetsFriendlies = true;
rangedAttack = true;
healing = (_arg1.health_max * 1000);
power_cost = 75;
removesPoison = true;
resurrects = true;
powerDamage = 100;
iconFrame = 47;
skillname = "Call Soul";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.revive;
}
override public function description():String{
return ("Revives fallen party member with full health but no power.");
}
}
}//package
Section 445
//sConjurorShadow (sConjurorShadow)
package {
public class sConjurorShadow extends Skill {
public function sConjurorShadow(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
aiCastLimit = 0;
damage = 0;
power_cost = 30;
targetsEmpty = true;
hitsAllEmpty = true;
summonsCreatureClass = new pShadow(char_ref.level);
iconFrame = 62;
skillname = "Wall of Shadows";
verbage = ("casts " + skillname);
}
override public function description():String{
return ("Summon a Shadow to every empty square on your side of the battlefield. Shadows act as decoys, and can curse the enemy or remove curses from your allies.");
}
}
}//package
Section 446
//sConjurorWargolem (sConjurorWargolem)
package {
public class sConjurorWargolem extends Skill {
public function sConjurorWargolem(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
aiCastLimit = 0;
damage = 0;
power_cost = 60;
targetsEmpty = true;
summonsCreatureClass = new pWargolem(char_ref.level);
iconFrame = 68;
skillname = summonsCreatureClass.charname;
verbage = ("summons a " + summonsCreatureClass.charname);
}
override public function description():String{
return ("Summon a Wargolem to an empty square on your side of the battlefield. Wargolems are heavily armored and ideal for forming a protective line.");
}
}
}//package
Section 447
//sConjurorWhirlwind (sConjurorWhirlwind)
package {
public class sConjurorWhirlwind extends Skill {
public function sConjurorWhirlwind(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.intellect;
aiCastLimit = 0;
magicStrength = 1;
damage = getBaseMagicDamage(magicStrength);
power_cost = 40;
alwaysHits = true;
rangedAttack = true;
summonsWhirlwind = true;
iconFrame = 64;
skillname = "Vortex";
verbage = ("summons a " + skillname);
specialAnimation = PortraitAnimation.confuse;
}
override public function description():String{
return ((("Summon a whirlwind to attack any single enemy, causing " + getDamage()) + " damage and knocking them into an adjacent empty square. If there are no adjacent empty spaces, the whirlwind dissipates immediately but inflicts an additional 20% damage."));
}
}
}//package
Section 448
//sConjurorWolf (sConjurorWolf)
package {
public class sConjurorWolf extends Skill {
public function sConjurorWolf(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
aiCastLimit = 0;
damage = 0;
power_cost = 40;
targetsEmpty = true;
summonsCreatureClass = new pShadowWolf(char_ref.level);
iconFrame = 63;
skillname = "Dire Wolf";
verbage = "summons a Dire Wolf";
}
override public function description():String{
return ("Summon a Dire Wolf to an empty square on your side of the battlefield. Dire Wolves are expendable close range fighters.");
}
}
}//package
Section 449
//sCultistArrow (sCultistArrow)
package {
public class sCultistArrow extends Skill {
public function sCultistArrow(_arg1:Character){
char_ref = _arg1;
rangedAttack = true;
damage = Math.round((_arg1.damage * 0.5));
powerDamage = 25;
power_cost = 75;
skillname = "Draining Shot";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.cultistArrow;
}
}
}//package
Section 450
//sCultistHeal (sCultistHeal)
package {
public class sCultistHeal extends Skill {
public function sCultistHeal(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 1;
targetsFriendlies = true;
hitsAllFriendlies = true;
rangedAttack = true;
healing = Math.round((_arg1.health_max / 6));
powerRestore = 20;
power_cost = 100;
removesPoison = false;
skillname = "Energy Flow";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.restore;
}
override public function description():String{
return ((("Restore " + scaleHeal(healing)) + " health to one member of your party. Cures poison."));
}
}
}//package
Section 451
//sCultistMeleeStun (sCultistMeleeStun)
package {
public class sCultistMeleeStun extends Skill {
public function sCultistMeleeStun(_arg1:Character){
char_ref = _arg1;
damage = Math.round((_arg1.damage * 1.2));
power_cost = 40;
stun_percent = 60;
skillname = "Impact";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.creatureWeapon;
}
}
}//package
Section 452
//sCultistSever (sCultistSever)
package {
public class sCultistSever extends Skill {
public function sCultistSever(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
aiCastLimit = 1;
damage = 0;
rangedAttack = true;
hitsAllEnemies = true;
attacksWithAccuracyMod = 0.5;
power_cost = 60;
cancelPowerRegen = 4;
skillname = "Sever";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.debuff;
}
}
}//package
Section 453
//sDeathKnightRally (sDeathKnightRally)
package {
public class sDeathKnightRally extends Skill {
public function sDeathKnightRally(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 1;
targetsFriendlies = true;
hitsAllFriendlies = true;
rangedAttack = true;
power_cost = 25;
buff_damage = 1.25;
healing = Math.round((_arg1.health_max / 6));
skillname = "Rally";
verbage = "rallies his troops";
specialAnimation = PortraitAnimation.buff;
}
override public function description():String{
return ("");
}
}
}//package
Section 454
//sDemonClone (sDemonClone)
package {
public class sDemonClone extends Skill {
public function sDemonClone(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 1;
aiPriority = 99;
damage = 0;
rangedAttack = true;
hitsAllEnemies = true;
alwaysHits = true;
clonesPlayers = true;
power_cost = 50;
skillname = "Dark Mirror";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.clone;
}
}
}//package
Section 455
//sDemonDoubleAttack (sDemonDoubleAttack)
package {
public class sDemonDoubleAttack extends Skill {
public function sDemonDoubleAttack(_arg1:Character){
char_ref = _arg1;
damage = Math.round((_arg1.damage * 0.6));
power_cost = 40;
attacksTwoTargets = true;
skillname = "Demonic Rage";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.creatureSlash;
}
}
}//package
Section 456
//sDemonPoison (sDemonPoison)
package {
public class sDemonPoison extends Skill {
public function sDemonPoison(_arg1:Character){
char_ref = _arg1;
aiPriority = 1;
rangedAttack = true;
power_cost = 30;
damage = 0;
poisonDamage = Math.round((_arg1.damage / 6));
damageAccuracy = 15;
crippling = 10;
skillname = "Touch of Corruption";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.poison;
}
}
}//package
Section 457
//sDissipate (sDissipate)
package {
public class sDissipate extends Skill {
public function sDissipate(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
aiAlwaysUse = true;
killsUser = true;
targetsSelf = true;
alwaysHits = true;
damage = 0;
power_cost = 0;
skillname = "Dissipate";
verbage = "dissipates";
}
}
}//package
Section 458
//sDragonFlame (sDragonFlame)
package {
public class sDragonFlame extends Skill {
public function sDragonFlame(_arg1:Character){
char_ref = _arg1;
rangedAttack = true;
hitsAllEnemies = true;
damage = Math.round((_arg1.damage * 0.6));
power_cost = 30;
hasPortraitAnimation = true;
portraitAnimationFrame = 6;
skillname = "Flame Breath";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.fire;
}
}
}//package
Section 459
//sDragonTail (sDragonTail)
package {
public class sDragonTail extends Skill {
public function sDragonTail(_arg1:Character){
char_ref = _arg1;
damage = Math.round((_arg1.damage * 0.8));
power_cost = 40;
hitsAllMeleeRange = true;
hasPortraitAnimation = true;
portraitAnimationFrame = 4;
skillname = "Tail Swipe";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.creatureWeapon;
}
override public function description():String{
return ("");
}
}
}//package
Section 460
//sDreadfatherDrain (sDreadfatherDrain)
package {
public class sDreadfatherDrain extends Skill {
public function sDreadfatherDrain(_arg1:Character){
char_ref = _arg1;
aiNotUnlessHurt = false;
aiTargetHealthiest = true;
aiPriority = 3;
rangedAttack = true;
damage = _arg1.damage;
vampiric_percent = Math.floor((100 + (level * 1)));
power_cost = 5;
ignoresArmor = true;
skillname = "Drain Will";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.monsterDrain;
}
}
}//package
Section 461
//sDreadfatherRevive (sDreadfatherRevive)
package {
public class sDreadfatherRevive extends Skill {
public function sDreadfatherRevive(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 3;
aiOnlyWhenHordeDead = true;
aiPriority = 7;
targetsFriendlies = true;
hitsAllFriendlies = true;
doesNotEffectSelf = true;
rangedAttack = true;
healing = char_ref.health_max;
power_cost = 50;
removesPoison = true;
resurrects = true;
skillname = "Master's Bidding";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.revive;
}
override public function description():String{
return ((("Revives fallen party member with " + scaleHeal(healing)) + " health."));
}
}
}//package
Section 462
//sDwarfCharge (sDwarfCharge)
package {
public class sDwarfCharge extends Skill {
public function sDwarfCharge(_arg1:Character){
char_ref = _arg1;
damage = Math.round((_arg1.damage * 1.5));
power_cost = 35;
requiresVerticalGap = true;
stun_percent = 50;
skillname = "Charge";
verbage = "charges forth!";
specialAnimation = PortraitAnimation.creatureSlash;
}
}
}//package
Section 463
//sDwarfCrossbowAttack (sDwarfCrossbowAttack)
package {
public class sDwarfCrossbowAttack extends Skill {
public function sDwarfCrossbowAttack(_arg1:Character){
char_ref = _arg1;
damage = Math.round((_arg1.damage * 0.8));
skillname = "Dwarven Crossbow";
rangedAttack = true;
power_cost = 20;
ignoresArmor = true;
verbage = ("fires " + skillname);
specialAnimation = PortraitAnimation.monsterArrow;
}
}
}//package
Section 464
//sDwarfHammerAE (sDwarfHammerAE)
package {
public class sDwarfHammerAE extends Skill {
public function sDwarfHammerAE(_arg1:Character){
char_ref = _arg1;
damage = Math.round((_arg1.damage * 1.2));
power_cost = 50;
stun_percent = 30;
splashDamageMultiplier = 0.7;
splashHitsAllies = false;
skillname = "Hammer Slam";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.creatureSlash;
}
}
}//package
Section 465
//sDwarfOnslaught (sDwarfOnslaught)
package {
public class sDwarfOnslaught extends Skill {
public function sDwarfOnslaught(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
aiCastLimit = 1;
damage = 0;
power_cost = 40;
targetsFriendlies = true;
hitsAllFriendlies = true;
buff_quickness = 30;
skillname = "Onslaught";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.buff;
}
}
}//package
Section 466
//sDwarfPride (sDwarfPride)
package {
public class sDwarfPride extends Skill {
public function sDwarfPride(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 1;
targetsFriendlies = true;
hitsAllFriendlies = true;
cannotDie = 1;
power_cost = 50;
skillname = "Dwarven Pride";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.armorBuff;
}
}
}//package
Section 467
//sDwarfPunishing (sDwarfPunishing)
package {
public class sDwarfPunishing extends Skill {
public function sDwarfPunishing(_arg1:Character):void{
char_ref = _arg1;
damage = _arg1.damage;
power_cost = 40;
debuff_damage = 0.5;
skillname = "Punishing Blow";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.creatureWeapon;
}
}
}//package
Section 468
//sDwarfSponge (sDwarfSponge)
package {
public class sDwarfSponge extends Skill {
public function sDwarfSponge(_arg1:Character){
char_ref = _arg1;
damage = 0;
power_cost = 20;
targetsFriendlies = true;
rangedAttack = true;
targetsFriendlyFrontRow = true;
makeDamageSponge = true;
skillname = "Fealty";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.protectAllies;
}
override public function description():String{
return ("");
}
}
}//package
Section 469
//sDwarvenAle (sDwarvenAle)
package {
public class sDwarvenAle extends Skill {
public function sDwarvenAle(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 1;
aiNotUnlessHurt = true;
targetsSelf = true;
healing = Math.round((_arg1.health_max * 0.6));
buff_damageResist = 10;
damageAccuracy = 15;
power_cost = 40;
skillname = "Dwarven Ale";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.monsterBeer;
}
override public function description():String{
return ((("Restore " + scaleHeal(healing)) + " health to one member of your party. Cures poison."));
}
}
}//package
Section 470
//SelectArrow (SelectArrow)
package {
import flash.display.*;
public dynamic class SelectArrow extends SimpleButton {
}
}//package
Section 471
//SellPanel (SellPanel)
package {
import flash.display.*;
public dynamic class SellPanel extends Sprite {
public var sellDisabler:MovieClip;
public var sellList:ShopListScrolling;
public var sellButton:MovieClip;
public var allTab:ItemModeTab;
public var equippedTab:ItemModeTab;
}
}//package
Section 472
//sEngineConduit (sEngineConduit)
package {
public class sEngineConduit extends Skill {
public function sEngineConduit(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
aiCastLimit = 1;
aiNotUnlessLowPower = true;
rangedAttack = true;
targetsFriendlies = true;
hitsAllFriendlies = true;
powerRestore = 50;
power_cost = 50;
iconFrame = 1;
skillname = "Conduit";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.gainPower;
}
}
}//package
Section 473
//sForceRetreat (sForceRetreat)
package {
public class sForceRetreat extends Skill {
public function sForceRetreat(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 2;
aiTargetOnlyLowHealth = true;
aiPriority = 10;
rangedAttack = true;
forceRetreat = true;
alwaysHits = true;
power_cost = 20;
skillname = "Creeping Dread";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.fearDeath;
}
}
}//package
Section 474
//sGhostAttack (sGhostAttack)
package {
public class sGhostAttack extends Skill {
public function sGhostAttack(_arg1:Character){
char_ref = _arg1;
damage = _arg1.damage;
power_cost = 0;
ignoresArmor = true;
skillname = "Attack";
verbage = "attacks";
specialAnimation = PortraitAnimation.ghostAttack;
}
}
}//package
Section 475
//sGhostHide (sGhostHide)
package {
public class sGhostHide extends Skill {
public function sGhostHide(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 1;
aiNotUnlessHurt = true;
damage = 0;
healing = Math.round((char_ref.health_max / 2));
power_cost = 50;
targetsSelf = true;
hidesTarget = true;
skillname = "Vanish";
verbage = "fades from view";
}
override public function description():String{
return ("");
}
}
}//package
Section 476
//sGhostTouch (sGhostTouch)
package {
public class sGhostTouch extends Skill {
public function sGhostTouch(_arg1:Character){
char_ref = _arg1;
damage = 0;
power_cost = 40;
powerDamage = 30;
stun_percent = 25;
curse = 0.3;
skillname = "Spectral Touch";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.curse;
}
}
}//package
Section 477
//sGoblinCrossbow (sGoblinCrossbow)
package {
public class sGoblinCrossbow extends Skill {
public function sGoblinCrossbow(_arg1:Character){
char_ref = _arg1;
damage = Math.round((_arg1.damage * 0.5));
power_cost = 0;
rangedAttack = true;
attacksTwoTargets = true;
skillname = "Repeating Crossbow";
verbage = "shoots";
specialAnimation = PortraitAnimation.monsterArrow;
}
}
}//package
Section 478
//sGoblinGrenade (sGoblinGrenade)
package {
public class sGoblinGrenade extends Skill {
public function sGoblinGrenade(_arg1:Character){
char_ref = _arg1;
rangedAttack = true;
damage = char_ref.damage;
power_cost = 30;
splashDamageMultiplier = 0.6;
splashHitsAllies = true;
skillname = "Grenade";
verbage = ("hurls " + skillname);
specialAnimation = PortraitAnimation.explosion;
}
override public function description():String{
return ("");
}
}
}//package
Section 479
//sGorgonGaze (sGorgonGaze)
package {
public class sGorgonGaze extends Skill {
public function sGorgonGaze(_arg1:Character){
char_ref = _arg1;
rangedAttack = true;
hitsAllEnemies = true;
damage = Math.round((_arg1.damage * 0.3));
stun_percent = 100;
power_cost = 15;
skillname = "Petrify";
verbage = ("uses " + skillname);
}
}
}//package
Section 480
//sGorgonSlash (sGorgonSlash)
package {
public class sGorgonSlash extends Skill {
public function sGorgonSlash(_arg1:Character){
char_ref = _arg1;
damage = _arg1.damage;
power_cost = 0;
skillname = "Raking Claws";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.creatureSlash;
}
}
}//package
Section 481
//sGorgonSnakes (sGorgonSnakes)
package {
public class sGorgonSnakes extends Skill {
public function sGorgonSnakes(_arg1:Character){
char_ref = _arg1;
rangedAttack = true;
hitsAllEnemies = true;
damage = Math.round((_arg1.damage * 0.6));
poisonDamage = Math.round((_arg1.damage * 0.5));
power_cost = 25;
skillname = "Nest of Vipers";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.creatureSlash;
}
}
}//package
Section 482
//ShadowPortrait (ShadowPortrait)
package {
import flash.display.*;
public dynamic class ShadowPortrait extends MovieClip {
}
}//package
Section 483
//Shield (Shield)
package {
public class Shield extends Offhand {
override public function generateItem(_arg1:int):void{
var _local2:*;
var _local3:*;
_local2 = false;
_local3 = false;
if (item_rarity == Item.grey){
item_rarity = Item.white;
};
getItemModifiers();
if (item_rarity == Item.green){
if (dmf.randomNum(0, 100) >= 50){
_local3 = true;
} else {
_local2 = true;
};
};
if ((((item_rarity == Item.blue)) || (_local3))){
prefix = rollForPrefix(item_rarity);
};
if ((((item_rarity == Item.blue)) || (_local2))){
suffix = rollForSuffix(item_rarity);
};
if (base_armor_rating){
armor_rating = scaleArmorForLevel((base_armor_rating * (1 + (base_armor_mod / 100))));
};
if (prefix >= 0){
applyPrefix();
};
if (suffix >= 0){
applySuffix();
};
if (prefix >= 0){
item_name = ((prefixes[prefix][0] + " ") + item_name);
};
if (suffix >= 0){
item_name = ((item_name + " of ") + suffixes[suffix][0]);
};
}
override public function getItemTypeString(){
return ("Shield");
}
override public function getItemModifiers():void{
super.getItemModifiers();
prefixes.push(["Thick", 1.4]);
}
}
}//package
Section 484
//Shop (Shop)
package {
import flash.events.*;
import flash.ui.*;
import flash.system.*;
import flash.text.*;
import flash.display.*;
public class Shop extends Sprite {
public var sellMode:int;// = 1
private var portraits:Array;
public var goldDisplay:GoldDisplay;
private var partyGold:int;// = 0
public var empty1:EmptyPortrait;
public var empty3:EmptyPortrait;
public var empty4:EmptyPortrait;
public var empty2:EmptyPortrait;
private var initialised:Boolean;// = false
public var bubble:SpeechBubble;
public var purpleCheck:dCheckBox;
public var playerGraphic:CharGraphic;
public var blueCheck:dCheckBox;
public var paperdoll:Paperdoll;
private var buyItems:Array;
public var sellTab:BuySellTab;
public var playerClass:TextField;
public var inventoryCount:TextField;
public var playerName:TextField;
public var buyPanel:BuyPanel;
public var buyTab:BuySellTab;
public var buyMode:int;// = 100
public var optionsButton:OptionsButton;
private var earnedGold:int;// = 0
private var comparisons:Array;
public var pc_party:Party;
public var buying:Boolean;
public var greenCheck:dCheckBox;
public var sellPanel:SellPanel;
public var helpButton:HelpButton;
public var exitButton:MovieClip;
public var tooltipController:ItemTooltipController;
static const BUY_ARMOR_LIGHT = 4;
static const BUBBLE_X = 10;
static const BUBBLE_Y = 118;
static const BUY_ALL = 100;
static const BUY_ARMOR_HEAVY = 2;
static const BUY_CONSUMABLES = 5;
static const SELL_EQUIPPED = 2;
static const SELL_ALL = 1;
static const BUY_ACCESSORIES = 1;
static const BUY_ARMOR_MEDIUM = 3;
static const BUY_WEAPONS = 0;
public static var selectedChar:PlayerCharacter;
public function Shop(_arg1:Party=null):void{
portraits = new Array();
buyMode = BUY_ALL;
sellMode = SELL_ALL;
initialised = false;
partyGold = 0;
earnedGold = 0;
super();
if (_arg1 != null){
this.pc_party = _arg1;
} else {
this.pc_party = dm.main.pc_party;
};
partyGold = pc_party.gold;
initialised = false;
tooltipController = new ItemTooltipController();
generateBuyItems();
addEventListener(Event.ADDED_TO_STAGE, init);
}
public function removeItemFrom(_arg1:Item, _arg2:PlayerCharacter){
var _local3:Equipment;
if (!((_arg1 is Equipment))){
return;
};
_local3 = Equipment(_arg1);
if (_arg2.unequip(Equipment(_arg1))){
if (_arg2 == selectedChar){
updatePaperdoll(_arg2);
};
addSellItems();
};
}
public function updatePaperdoll(_arg1:PlayerCharacter):void{
var _local2:InventoryIcon;
var _local3:int;
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
_local2 = InventoryIcon(paperdoll.getChildByName(("slot" + String(_local3))));
if (_local2 != null){
paperdoll.removeChild(_local2);
};
_local3++;
};
_local3 = 0;
while (_local3 < Equipment.gearSlots) {
if (_arg1.gear[_local3] == null){
} else {
if (_arg1.gear[_local3].slot == Equipment.gearSlots){
} else {
if (_arg1.gear[_local3].slot != _local3){
} else {
_local2 = new InventoryIcon(_arg1.gear[_local3], tooltipController);
_local2.x = paperdoll.getSlotX(_arg1.gear[_local3].slot);
_local2.y = paperdoll.getSlotY(_arg1.gear[_local3].slot);
_local2.name = ("slot" + String(_local3));
paperdoll.addChild(_local2);
if (_local3 == Equipment.weapon){
if (Weapon(_arg1.gear[_local3]).twoHanded){
paperdoll.offhand.gotoAndStop(2);
} else {
paperdoll.offhand.gotoAndStop(1);
};
};
};
};
};
_local3++;
};
}
private function updateBuyTabs():void{
buyPanel.allTab.gotoAndStop(2);
buyPanel.weaponsTab.gotoAndStop(2);
buyPanel.consumablesTab.gotoAndStop(2);
buyPanel.accessoriesTab.gotoAndStop(2);
buyPanel.armorLightTab.gotoAndStop(2);
buyPanel.armorMediumTab.gotoAndStop(2);
buyPanel.armorHeavyTab.gotoAndStop(2);
if (buyMode == BUY_ALL){
buyPanel.allTab.gotoAndStop(1);
} else {
if (buyMode == BUY_WEAPONS){
buyPanel.weaponsTab.gotoAndStop(1);
} else {
if (buyMode == BUY_CONSUMABLES){
buyPanel.consumablesTab.gotoAndStop(1);
} else {
if (buyMode == BUY_ACCESSORIES){
buyPanel.accessoriesTab.gotoAndStop(1);
} else {
if (buyMode == BUY_ARMOR_LIGHT){
buyPanel.armorLightTab.gotoAndStop(1);
} else {
if (buyMode == BUY_ARMOR_MEDIUM){
buyPanel.armorMediumTab.gotoAndStop(1);
} else {
if (buyMode == BUY_ARMOR_HEAVY){
buyPanel.armorHeavyTab.gotoAndStop(1);
};
};
};
};
};
};
};
addBuyItems();
buyPanel.buyList.resetHandle();
}
private function clickSellTabEquipped(_arg1:MouseEvent):void{
sellMode = SELL_EQUIPPED;
updateSellTabs();
}
private function updateInventoryCount():void{
var _local1:int;
var _local2:int;
_local1 = (pc_party.inventory.length + pc_party.overflow.length);
_local2 = (Party.MAX_INVENTORY + Party.MAX_OVERFLOW);
inventoryCount.text = ((String(_local1) + "/") + String(_local2));
dmf.embolden(inventoryCount);
}
private function clickBuyTabArmorMedium(_arg1:MouseEvent):void{
buyMode = BUY_ARMOR_MEDIUM;
updateBuyTabs();
}
private function getBuyItems():Array{
var b:Array;
var i:int;
var err_txt:*;
var err_dlg:ErrorDialog;
b = new Array();
try {
if (buyMode == BUY_ALL){
i = 0;
while (i < buyItems.length) {
if (buyItems[i].length){
b = b.concat(buyItems[i]);
};
i = (i + 1);
};
} else {
if ((((buyMode >= 0)) && ((buyMode <= BUY_CONSUMABLES)))){
b = buyItems[buyMode];
} else {
throw (new Error("invalid buy mode"));
};
};
} catch(error:Error) {
if (DungeonMain.KONGREGATE){
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (("Get Buy Items Error: " + error.name) + "\n"));
err_txt = (err_txt + (("buyMode: " + String(buyMode)) + "\n"));
err_txt = (err_txt + (("b.length: " + String(b.length)) + "\n"));
err_txt = (err_txt + (("greenChecked: " + greenCheck.checked) + "\n"));
err_txt = (err_txt + (("blueChecked: " + blueCheck.checked) + "\n"));
err_txt = (err_txt + (("purpleChecked: " + purpleCheck.checked) + "\n"));
err_txt = (err_txt + ((((("[" + error.errorID) + "] ") + error.message) + " ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
};
} finally {
var _local4:* = b;
//unresolved jump
1;
return (_local4);
};
}
private function sellTabClick(_arg1:MouseEvent):void{
buying = false;
updateTabs();
}
public function showComparisons(_arg1:Item):void{
var _local2:PlayerCharacter;
var _local3:ItemComparison;
var _local4:CharacterPortrait;
if ((_arg1 is Equipment)){
removeComparisons();
comparisons = new Array();
for each (_local2 in pc_party.members) {
if ((_local2 is PC_Adventurer)){
} else {
_local3 = new ItemComparison(_local2, Equipment(_arg1).slot, Equipment(_arg1));
comparisons.push(_local3);
_local4 = _local2.portraitRef;
if (_local4 != null){
dm.stage.addChild(_local3);
_local3.x = _local4.x;
_local3.y = _local4.y;
};
};
};
};
}
public function removeComparisons():void{
var _local1:ItemComparison;
for each (_local1 in comparisons) {
if (_local1.parent != null){
_local1.parent.removeChild(_local1);
};
};
}
private function getWelcomeText():String{
var _local1:String;
var _local2:int;
_local1 = "";
_local2 = dmf.randomNum(1, 100);
if (_local2 < 20){
_local1 = (_local1 + "Welcome to the Emporium, adventurer!\n\n");
_local1 = (_local1 + "Found one of our portal scrolls, did you? We get most of our business that way.");
} else {
if (_local2 < 40){
_local1 = (_local1 + "Sorry, didn't see you come in. What can I help you with today?");
} else {
if (_local2 < 60){
_local1 = (_local1 + "Welcome to the Emporium! Whatever it is you need, we have it.");
} else {
if (_local2 < 80){
_local1 = (_local1 + "Ah, adventurers! You've come to the right place.");
} else {
_local1 = (_local1 + "Welcome, welcome. Have a look around, our range is extensive. Maybe I can take some treasures off your hands?");
};
};
};
};
return (_local1);
}
public function selectChar(_arg1:PlayerCharacter){
selectedChar = _arg1;
tooltipController.setChar(_arg1);
playerGraphic.setChar(_arg1);
updatePaperdoll(_arg1);
playerName.text = _arg1.charname;
dmf.embolden(playerName);
playerClass.text = _arg1.classname;
}
private function addBuyItems(_arg1:Boolean=false):void{
var b:Array;
var gotten:Boolean;
var oldY:int;
var item:Item;
var showEntry:Boolean;
var sle:ShopListEntry;
var err_txt:*;
var err_dlg:ErrorDialog;
var retainPosition = _arg1;
b = new Array();
gotten = false;
try {
buyPanel.buyList.setShop(this);
oldY = buyPanel.buyList.scrollHandle.y;
buyPanel.buyList.empty();
b = getBuyItems();
gotten = true;
for each (item in b) {
if (item == null){
} else {
showEntry = true;
if ((((item.item_rarity == Item.green)) && ((greenCheck.checked == false)))){
showEntry = false;
} else {
if ((((item.item_rarity == Item.blue)) && ((blueCheck.checked == false)))){
showEntry = false;
} else {
if ((((item.item_rarity == Item.purple)) && ((purpleCheck.checked == false)))){
showEntry = false;
} else {
showEntry = true;
};
};
};
if (showEntry){
sle = new ShopListEntry(item, tooltipController, null, true, this);
if (sle != null){
buyPanel.buyList.addEntry(sle);
} else {
throw (new Error(("invalid sle for item " + item.item_name)));
};
};
};
};
buyPanel.buyList.finishedAdding();
if (retainPosition){
buyPanel.buyList.moveHandleTo(oldY);
buyPanel.buyList.update();
};
} catch(error:Error) {
if (DungeonMain.KONGREGATE){
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (("Add Buy Items Error: " + error.name) + "\n"));
err_txt = (err_txt + (("buyMode: " + String(buyMode)) + "\n"));
err_txt = (err_txt + (("b.length: " + String(b.length)) + "\n"));
err_txt = (err_txt + (("greenChecked: " + greenCheck.checked) + "\n"));
err_txt = (err_txt + (("blueChecked: " + blueCheck.checked) + "\n"));
err_txt = (err_txt + (("purpleChecked: " + purpleCheck.checked) + "\n"));
err_txt = (err_txt + ((((("[" + error.errorID) + "] ") + error.message) + " ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
};
};
}
private function addBubble(_arg1:String):void{
if (bubble != null){
bubble.fade();
};
bubble = new SpeechBubble(_arg1);
bubble.x = BUBBLE_X;
bubble.y = BUBBLE_Y;
addChild(bubble);
}
public function buyClick(_arg1:MouseEvent):void{
var refreshedItems:Boolean;
var buyItem:Item;
var g:int;
var messages:Array;
var messageText:String;
var invFullString:String;
var i:int;
var j:int;
var consumClass:*;
var consum:Item;
var err_txt:*;
var err_dlg:ErrorDialog;
var e = _arg1;
if (buyPanel.buyList.selectedEntry == null){
return;
};
refreshedItems = false;
removeComparisons();
buyItem = buyPanel.buyList.selectedEntry.item_ref;
g = buyPanel.buyList.selectedEntry.price;
try {
if ((((pc_party.inventory.length >= Party.MAX_INVENTORY)) && ((pc_party.overflow.length >= Party.MAX_OVERFLOW)))){
invFullString = "You're carrying too many items.";
if (dmf.randomNum(0, 100) > 50){
invFullString = "You look a little overburdened already..";
};
addBubble(invFullString);
return;
};
if (partyGold < g){
addBubble("Sorry, you can't afford that.");
return;
};
if ((((buyItem is Consumable)) && ((Consumable(buyItem).stack > 1)))){
Consumable(buyItem).stack--;
} else {
i = 0;
while (i < buyItems.length) {
j = 0;
while (j < buyItems[i].length) {
if (buyItems[i][j] == buyItem){
buyItems[i].splice(j, 1);
break;
};
j = (j + 1);
};
i = (i + 1);
};
};
addBuyItems(true);
refreshedItems = true;
dm.sound.play(SoundControl.lootItem);
if ((((buyItem is Consumable)) && ((Consumable(buyItem).stack > 1)))){
consumClass = buyItem;
consum = new consumClass.constructor();
pc_party.addToInventory(consum);
} else {
pc_party.addToInventory(buyItem);
};
partyGold = (partyGold - g);
updateGold();
updateInventoryCount();
messages = new Array();
if ((buyItem is Consumable)){
messages.push((("Demand for these keeps rising. I just recently had to raise the price on that " + buyItem.item_name) + "."));
messages.push((("A " + buyItem.item_name) + "? One of our most popular items! Can barely keep them on the shelves."));
} else {
messages.push((("A " + buyItem.item_name) + ", excellent choice."));
messages.push((("" + buyItem.item_name) + ", one of our most popular items."));
messages.push((("Enjoy your new " + buyItem.item_name) + "."));
messages.push((("You won't be disappointed with that " + buyItem.item_name) + "."));
messages.push((("I let you have that " + buyItem.item_name) + " for a song. Don't spread it around."));
messages.push((("Thanks for shopping at the Emporium! Here's your new " + buyItem.item_name) + "."));
messages.push((("Here's your " + buyItem.item_name) + ", pleasure doing business with you."));
messages.push((("You want a " + buyItem.item_name) + "? I hear a lot of good things about these."));
messages.push((("Remember to tell your friends where you got that impressive new " + buyItem.item_name) + "."));
messages.push((("That's one " + buyItem.item_name) + ". Can I help you with anyone else?"));
messages.push((("A fine selection. I had an eye on that " + buyItem.item_name) + " myself."));
};
messageText = messages[dmf.randomNum(0, (messages.length - 1))];
addBubble(messageText);
} catch(error:Error) {
if (DungeonMain.KONGREGATE){
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (("Buy Click Error: " + error.name) + "\n"));
err_txt = (err_txt + (("item: " + String(buyItem)) + "\n"));
err_txt = (err_txt + (("mode: " + String(buyMode)) + "\n"));
err_txt = (err_txt + (("refreshed: " + refreshedItems) + "\n"));
err_txt = (err_txt + ((("[" + error.errorID) + "] ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
};
};
}
public function cleanup():void{
var _local1:CharacterPortrait;
buyPanel.buyList.cleanup();
sellPanel.sellList.cleanup();
exitButton.removeEventListener(MouseEvent.MOUSE_DOWN, leaveClick);
buyTab.removeEventListener(MouseEvent.MOUSE_DOWN, buyTabClick);
sellTab.removeEventListener(MouseEvent.MOUSE_DOWN, sellTabClick);
removeEventListener(Event.ENTER_FRAME, onFrame);
greenCheck.cleanup();
blueCheck.cleanup();
purpleCheck.cleanup();
sellPanel.sellButton.removeEventListener(MouseEvent.MOUSE_DOWN, sellClick);
buyPanel.buyButton.removeEventListener(MouseEvent.MOUSE_DOWN, buyClick);
if (bubble != null){
bubble.fade();
};
dm.stage.removeEventListener(KeyboardEvent.KEY_DOWN, hotKey);
optionsButton.cleanup();
helpButton.cleanup();
removeComparisons();
for each (_local1 in portraits) {
_local1.removeEventListener(MouseEvent.MOUSE_DOWN, portraitClick);
};
}
function portraitClick(_arg1:MouseEvent):void{
selectChar(PlayerCharacter(CharacterPortrait(_arg1.currentTarget).char_ref));
}
private function updateGold():void{
goldDisplay.setGold(partyGold);
}
private function hotKey(_arg1:KeyboardEvent):void{
var _local2:*;
var _local3:String;
var _local4:int;
var _local5:ErrorDialog;
if (_arg1.keyCode == Keyboard.SPACE){
if (buying){
buyClick(null);
} else {
sellClick(null);
};
} else {
if (_arg1.keyCode == Keyboard.F1){
_local2 = dm.stage.getChildByName("debugPanel");
if (_local2 != null){
if (dm.stage.contains(_local2)){
dm.stage.removeChild(_local2);
};
} else {
_local3 = "";
_local4 = -1;
if (buying){
_local4 = buyPanel.buyList.entries.length;
} else {
_local4 = sellPanel.sellList.entries.length;
};
_local3 = (_local3 + (((Capabilities.os + " ") + Capabilities.language) + "\n"));
_local3 = (_local3 + (((Capabilities.version + " ") + Capabilities.playerType) + "\n"));
_local3 = (_local3 + (("Audio: " + Capabilities.hasAudioEncoder) + "\n"));
_local3 = (_local3 + "\n");
if (buying){
_local3 = (_local3 + (("buying: " + buying) + "\n"));
};
if (buyMode == BUY_ALL){
_local3 = (_local3 + (("buyMode: " + buyMode) + "\n"));
} else {
_local3 = (_local3 + (((("buyMode: " + buyMode) + ", mode items: ") + buyItems[buyMode].length) + "\n"));
};
_local3 = (_local3 + (("sellMode: " + sellMode) + "\n"));
_local3 = (_local3 + (("list entries: " + _local4) + ", "));
if (buying){
if (buyPanel.buyList.pane == null){
_local3 = (_local3 + "pane null");
} else {
_local3 = (_local3 + (("pane children: " + buyPanel.buyList.pane.numChildren) + ", "));
_local3 = (_local3 + (("pane height: " + buyPanel.buyList.paneHeight) + "\n"));
_local3 = (_local3 + (("pane x: " + buyPanel.buyList.pane.x) + ", "));
_local3 = (_local3 + (("pane y: " + buyPanel.buyList.pane.y) + "\n"));
if (buyPanel.buyList.pane.parent != null){
_local3 = (_local3 + "pane parent: true\n");
} else {
_local3 = (_local3 + "pane parent: false\n");
};
};
} else {
if (sellPanel.sellList.pane == null){
_local3 = (_local3 + "pane null");
} else {
_local3 = (_local3 + (("pane children: " + sellPanel.sellList.pane.numChildren) + ", "));
_local3 = (_local3 + (("pane height: " + sellPanel.sellList.paneHeight) + "\n"));
_local3 = (_local3 + (("pane x: " + sellPanel.sellList.pane.x) + ", "));
_local3 = (_local3 + (("pane y: " + sellPanel.sellList.pane.y) + "\n"));
if (sellPanel.sellList.pane.parent != null){
_local3 = (_local3 + "pane parent: true\n");
} else {
_local3 = (_local3 + "pane parent: false\n");
};
};
};
_local3 = (_local3 + (((((("g: " + greenCheck.checked) + ", b: ") + blueCheck.checked) + ", p: ") + purpleCheck.checked) + "\n"));
_local5 = new ErrorDialog("Debug Information", _local3);
_local5.name = "debugPanel";
dm.stage.addChild(_local5);
};
};
};
}
private function onFrame(_arg1:Event):void{
if (buying){
if (buyPanel.buyList.selectedEntry == null){
buyPanel.buyDisabler.alpha = 1;
buyPanel.buyDisabler.mouseEnabled = true;
} else {
buyPanel.buyDisabler.alpha = 0;
buyPanel.buyDisabler.mouseEnabled = false;
};
} else {
if (sellPanel.sellList.selectedEntry == null){
sellPanel.sellDisabler.alpha = 1;
sellPanel.sellDisabler.mouseEnabled = true;
} else {
sellPanel.sellDisabler.alpha = 0;
sellPanel.sellDisabler.mouseEnabled = false;
};
};
}
private function getSellItems():Array{
var list:Array;
var it:Item;
var fullInv:Array;
var player:PlayerCharacter;
var err_txt:*;
var err_dlg:ErrorDialog;
try {
fullInv = pc_party.inventory.concat(pc_party.overflow);
for each (it in fullInv) {
if (it != null){
it.playerOwner = null;
};
};
if (sellMode == SELL_ALL){
list = fullInv;
} else {
if (sellMode == SELL_EQUIPPED){
list = new Array();
for each (player in pc_party.members) {
if (player == null){
} else {
for each (it in player.gear) {
if (it != null){
it.playerOwner = player;
list.push(it);
};
};
};
};
} else {
throw (new Error(("invalid sell mode: " + sellMode)));
};
};
} catch(error:Error) {
if (DungeonMain.KONGREGATE){
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (("Get Sell Items Error: " + error.name) + "\n"));
if (sellPanel.sellList.entries != null){
err_txt = (err_txt + (("entries: " + String(sellPanel.sellList.entries.length)) + "\n"));
};
if (list != null){
err_txt = (err_txt + (("list: " + String(list.length)) + "\n"));
};
err_txt = (err_txt + ((((("[" + error.errorID) + "] ") + error.message) + ", ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
};
} finally {
var _local4:* = list;
//unresolved jump
1;
return (_local4);
};
}
private function outIcon(_arg1:MouseEvent):void{
removeComparisons();
}
private function clickBuyTabArmorHeavy(_arg1:MouseEvent):void{
buyMode = BUY_ARMOR_HEAVY;
updateBuyTabs();
}
private function clickBuyTabWeapons(_arg1:MouseEvent):void{
buyMode = BUY_WEAPONS;
updateBuyTabs();
}
public function init(_arg1:Event=null):void{
var _local2:*;
var _local3:String;
var _local4 = ??pushnamespace
;
var _local5:*;
var _local6:*;
var _local7:HintDialog;
if (initialised){
return;
};
initialised = true;
buying = true;
buyTab.tab_text.text = "Buy Items";
sellTab.tab_text.text = "Sell Items";
updateGold();
greenCheck.setDescription("'Magical'", true, Item.textColorForRarity(Item.green));
blueCheck.setDescription("'Rare'", true, Item.textColorForRarity(Item.blue));
purpleCheck.setDescription("'Unique'", true, Item.textColorForRarity(Item.purple));
greenCheck.setChecked(true);
blueCheck.setChecked(true);
purpleCheck.setChecked(true);
greenCheck.setCallback(checkFilters);
blueCheck.setCallback(checkFilters);
purpleCheck.setCallback(checkFilters);
buyPanel.buyList.setTooltipController(tooltipController);
exitButton.addEventListener(MouseEvent.MOUSE_DOWN, leaveClick);
buyTab.addEventListener(MouseEvent.MOUSE_DOWN, buyTabClick);
sellTab.addEventListener(MouseEvent.MOUSE_DOWN, sellTabClick);
dm.stage.addEventListener(KeyboardEvent.KEY_DOWN, hotKey);
updateTabs();
selectChar(pc_party.members[0]);
_local2 = 0;
while (_local2 < pc_party.members.length) {
if ((pc_party.members[_local2] is PC_Adventurer)){
} else {
_local5 = getChildByName(("empty" + (_local2 + 1)));
_local6 = new CharacterPortrait();
_local6.x = _local5.x;
_local6.y = _local5.y;
_local6.setChar(pc_party.members[_local2]);
_local6.name = ("portrait" + _local2);
_local6.setGlow();
pc_party.members[_local2].portraitRef = _local6;
removeChild(_local5);
addChild(_local6);
_local6.addEventListener(MouseEvent.MOUSE_DOWN, portraitClick);
portraits.push(_local6);
};
_local2++;
};
sellPanel.sellButton.addEventListener(MouseEvent.MOUSE_DOWN, sellClick);
buyPanel.buyButton.addEventListener(MouseEvent.MOUSE_DOWN, buyClick);
if (pc_party.campaign == Campaign.SURVIVAL){
_local3 = "Buy whatever you need.";
} else {
_local3 = getWelcomeText();
};
bubble.setText(_local3);
buyPanel.allTab.tab_text.text = "Show All Items";
buyPanel.weaponsTab.tab_text.text = "Show Weapons";
buyPanel.accessoriesTab.tab_text.text = "Other Equipment";
buyPanel.armorLightTab.tab_text.text = "Light Armor";
buyPanel.armorMediumTab.tab_text.text = "Medium Armor";
buyPanel.armorHeavyTab.tab_text.text = "Heavy Armor";
buyPanel.consumablesTab.tab_text.text = "Potions & Misc";
buyPanel.allTab.addEventListener(MouseEvent.MOUSE_DOWN, clickBuyTabAll);
buyPanel.weaponsTab.addEventListener(MouseEvent.MOUSE_DOWN, clickBuyTabWeapons);
buyPanel.accessoriesTab.addEventListener(MouseEvent.MOUSE_DOWN, clickBuyTabAccessories);
buyPanel.armorLightTab.addEventListener(MouseEvent.MOUSE_DOWN, clickBuyTabArmorLight);
buyPanel.armorMediumTab.addEventListener(MouseEvent.MOUSE_DOWN, clickBuyTabArmorMedium);
buyPanel.armorHeavyTab.addEventListener(MouseEvent.MOUSE_DOWN, clickBuyTabArmorHeavy);
buyPanel.consumablesTab.addEventListener(MouseEvent.MOUSE_DOWN, clickBuyTabConsumables);
sellPanel.allTab.tab_text.text = "Show Inventory";
sellPanel.equippedTab.tab_text.text = "Show Equipped";
sellPanel.allTab.addEventListener(MouseEvent.MOUSE_DOWN, clickSellTabAll);
sellPanel.equippedTab.addEventListener(MouseEvent.MOUSE_DOWN, clickSellTabEquipped);
updateInventoryCount();
addEventListener(Event.ENTER_FRAME, onFrame);
_local4 = 0x0100;
if (((DungeonMain.showHints) && ((Dungeon.hintShown(_local4) == false)))){
_local7 = new HintDialog("Emporium", "Visiting the Emporium gives you an opportunity to buy and sell items. You can switch between buying and selling using the tabs at the top of the screen, as well as filter which items are displayed.\n\nYou can press the space bar to buy/sell the currently selected item, or Ctrl-click to buy/sell an item instantly.");
DungeonMain.hints = (DungeonMain.hints + _local4);
dm.stage.addChild(_local7);
dm.main.saveInterface();
};
}
private function clickBuyTabConsumables(_arg1:MouseEvent):void{
buyMode = BUY_CONSUMABLES;
updateBuyTabs();
}
public function leaveClick(_arg1:MouseEvent):void{
var e = _arg1;
if (pc_party.campaign == Campaign.SURVIVAL){
pc_party.gold = partyGold;
dm.main.saveParty();
dm.main.saveInventory();
dm.main.saveChars();
parent.removeChild(this);
} else {
try {
if (((DungeonMain.KONGREGATE) && (!((DungeonMain.kongregateSWF == null))))){
DungeonMain.kongregateSWF.stats.submit("TotalGold", earnedGold);
};
} catch(e:Error) {
} finally {
cleanup();
dm.main.leaveShop(partyGold);
};
};
}
private function clickBuyTabArmorLight(_arg1:MouseEvent):void{
buyMode = BUY_ARMOR_LIGHT;
updateBuyTabs();
}
public function sellClick(_arg1:MouseEvent):void{
var sellItem:Item;
var owner:PlayerCharacter;
var g:int;
var refreshed:Boolean;
var messages:Array;
var messageText:String;
var err_txt:*;
var err_dlg:ErrorDialog;
var e = _arg1;
if (sellPanel.sellList.selectedEntry == null){
return;
};
sellItem = sellPanel.sellList.selectedEntry.item_ref;
owner = sellPanel.sellList.selectedEntry.equipper;
g = sellPanel.sellList.selectedEntry.price;
refreshed = false;
try {
removeComparisons();
if ((((sellItem is PortalScroll)) || ((g <= 0)))){
addBubble("Sorry, I'm not buying that.");
return;
};
if (((!((owner == null))) && ((sellItem is Equipment)))){
owner.gear[Equipment(sellItem).slot] = null;
if (owner == selectedChar){
updatePaperdoll(owner);
};
} else {
if ((((sellItem is Consumable)) && ((Consumable(sellItem).stack > 1)))){
Consumable(sellItem).stack--;
} else {
pc_party.removeFromInventory(sellItem);
};
};
earnedGold = (earnedGold + g);
partyGold = (partyGold + g);
updateGold();
updateInventoryCount();
dm.sound.play(SoundControl.lootItem);
addSellItems(true);
refreshed = true;
messages = new Array();
if ((sellItem is Consumable)){
messages.push((("Oh, a " + sellItem.item_name) + "? Excellent. Hard to keep these in stock."));
messages.push((("Thank you! We have customers asking for a " + sellItem.item_name) + " all the time. The going price just keeps on rising."));
} else {
if (sellItem.item_rarity == Item.grey){
messages.push((("Hmm. That " + sellItem.item_name) + " isn't much to look at, but maybe I can find a buyer."));
messages.push((("Alright, I'll buy the " + sellItem.item_name) + ", but I'm really doing you a favor here."));
messages.push((("Got a lot of use out of that " + sellItem.item_name) + ", did you? Look at the state it's in!"));
messages.push((("I prefer not to deal in damaged goods, but I'll take the " + sellItem.item_name) + " this time."));
} else {
if (sellItem.item_rarity == Item.orange){
messages.push((("Well now!. That " + sellItem.item_name) + " is an impressive item."));
messages.push((("That " + sellItem.item_name) + " is going to put a dent in my funds. Worth every penny, though."));
messages.push((("Don't see a lot of people willing to part with an item as good as that " + sellItem.item_name) + "."));
messages.push((("That one's going in the display case! \"Get your " + sellItem.item_name) + ", only at the Emporium!\"."));
messages.push((("Never even seen a " + sellItem.item_name) + " before. I have a lot of clients who'll want to hear about this!"));
} else {
messages.push((("Yes, I'll buy the " + sellItem.item_name) + "."));
messages.push((("Happy to buy that " + sellItem.item_name) + " from you."));
messages.push((("I'm sure I can find a buyer for that " + sellItem.item_name) + "."));
messages.push((("I'll take the " + sellItem.item_name) + " off your hands."));
messages.push((("That's a fair price for a " + sellItem.item_name) + "."));
messages.push((("Had a customer looking for a " + sellItem.item_name) + " like this."));
messages.push((("Always plenty of demand for a good " + sellItem.item_name) + "."));
messages.push((("I'll have no problem moving this " + sellItem.item_name) + "."));
};
};
};
messageText = messages[dmf.randomNum(0, (messages.length - 1))];
addBubble(messageText);
} catch(error:Error) {
if (DungeonMain.KONGREGATE){
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (("Sell Click Error: " + error.name) + "\n"));
err_txt = (err_txt + (("item: " + String(sellItem)) + "\n"));
err_txt = (err_txt + (("mode: " + String(sellMode)) + "\n"));
err_txt = (err_txt + (("refreshed: " + refreshed) + "\n"));
err_txt = (err_txt + ((("[" + error.errorID) + "] ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
};
};
}
private function clickBuyTabAll(_arg1:MouseEvent):void{
buyMode = BUY_ALL;
updateBuyTabs();
}
public function equipItem(_arg1:Item, _arg2:PlayerCharacter):void{
if (((_arg2.equip(Equipment(_arg1))) && (!(buying)))){
addSellItems();
updatePaperdoll(_arg2);
};
}
private function clickSellTabAll(_arg1:MouseEvent):void{
sellMode = SELL_ALL;
updateSellTabs();
}
private function generateBuyItems():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local1 = 0;
buyItems = new Array((BUY_CONSUMABLES + 1));
_local1 = 0;
while (_local1 < buyItems.length) {
buyItems[_local1] = new Array();
_local1++;
};
_local2 = 2;
_local3 = 1;
_local4 = 3;
_local5 = 3;
if (pc_party.campaign == Campaign.SURVIVAL){
_local2++;
_local3++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_WEAPONS].push(new iSword(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_WEAPONS].push(new iSword(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_WEAPONS].push(new iMace(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_WEAPONS].push(new iMace(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_WEAPONS].push(new iDagger(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_WEAPONS].push(new iDagger(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_WEAPONS].push(new iAxe(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_WEAPONS].push(new iAxe(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_WEAPONS].push(new iSpear(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_WEAPONS].push(new iSpear(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_WEAPONS].push(new iStaff(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_WEAPONS].push(new iStaff(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_WEAPONS].push(new iBow(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_WEAPONS].push(new iBow(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_WEAPONS].push(new iCrossbow(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_WEAPONS].push(new iCrossbow(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_ARMOR_HEAVY].push(new iPlateHelmet(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_ARMOR_HEAVY].push(new iPlateHelmet(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_ARMOR_HEAVY].push(new iPlateBreastplate(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_ARMOR_HEAVY].push(new iPlateBreastplate(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_ARMOR_HEAVY].push(new iPlateGloves(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_ARMOR_HEAVY].push(new iPlateGloves(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_ARMOR_HEAVY].push(new iPlateGreaves(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_ARMOR_HEAVY].push(new iPlateGreaves(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_ARMOR_HEAVY].push(new iPlateBoots(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_ARMOR_HEAVY].push(new iPlateBoots(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_ARMOR_MEDIUM].push(new iLeatherHat(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_ARMOR_MEDIUM].push(new iLeatherHat(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_ARMOR_MEDIUM].push(new iLeatherChest(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_ARMOR_MEDIUM].push(new iLeatherChest(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_ARMOR_MEDIUM].push(new iLeatherGloves(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_ARMOR_MEDIUM].push(new iLeatherGloves(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_ARMOR_MEDIUM].push(new iLeatherLegs(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_ARMOR_MEDIUM].push(new iLeatherLegs(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_ARMOR_MEDIUM].push(new iLeatherBoots(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_ARMOR_MEDIUM].push(new iLeatherBoots(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_ARMOR_LIGHT].push(new iClothHat(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_ARMOR_LIGHT].push(new iClothHat(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_ARMOR_LIGHT].push(new iClothRobe(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_ARMOR_LIGHT].push(new iClothRobe(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_ARMOR_LIGHT].push(new iClothGloves(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_ARMOR_LIGHT].push(new iClothGloves(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_ARMOR_LIGHT].push(new iClothLegs(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_ARMOR_LIGHT].push(new iClothLegs(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_ARMOR_LIGHT].push(new iClothShoes(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_ARMOR_LIGHT].push(new iClothShoes(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_ACCESSORIES].push(new iRing(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_ACCESSORIES].push(new iRing(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_ACCESSORIES].push(new iCloak(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_ACCESSORIES].push(new iCloak(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_ACCESSORIES].push(new iParryingDagger(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_ACCESSORIES].push(new iParryingDagger(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_ACCESSORIES].push(new iShieldBuckler(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_ACCESSORIES].push(new iShieldBuckler(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_ACCESSORIES].push(new iShieldTower(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_ACCESSORIES].push(new iShieldTower(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_ACCESSORIES].push(new iCenser(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_ACCESSORIES].push(new iCenser(pc_party.level, Item.blue));
_local1++;
};
_local1 = 0;
while (_local1 < _local2) {
buyItems[BUY_ACCESSORIES].push(new iQuiver(pc_party.level, Item.green));
_local1++;
};
_local1 = 0;
while (_local1 < _local3) {
buyItems[BUY_ACCESSORIES].push(new iQuiver(pc_party.level, Item.blue));
_local1++;
};
if (pc_party.campaign != Campaign.SURVIVAL){
addConsumable(new PotionHealth(), _local4);
addConsumable(new PotionPower(), _local4);
addConsumable(new PotionRevive(), _local4);
addConsumable(new SneakyScroll(), 1);
if (dmf.randomNum(0, 100) < 20){
addConsumable(new PotionPoisonResist(), 1);
};
if (dmf.randomNum(0, 100) < 20){
addConsumable(new PotionRejuve(), 1);
};
if (dmf.randomNum(0, 100) < 20){
addConsumable(new PotionShield(), 1);
};
if (dmf.randomNum(0, 100) < 20){
addConsumable(new PotionQuickness(), 1);
};
_local1 = 0;
while (_local1 < _local5) {
buyItems[BUY_CONSUMABLES].push(new Enchantment(pc_party.level, 0, false));
_local1++;
};
addPurple();
if (dmf.randomNum(0, 100) < 50){
addPurple();
};
};
}
private function buyTabClick(_arg1:MouseEvent):void{
buying = true;
updateTabs();
}
private function addPurple():void{
var _local1:Item;
_local1 = TreasureChest.getItem(pc_party.level, Item.purple);
if (_local1 != null){
if ((_local1 is Weapon)){
buyItems[BUY_WEAPONS].push(_local1);
} else {
if ((_local1 is LightArmor)){
buyItems[BUY_ARMOR_LIGHT].push(_local1);
} else {
if ((_local1 is MediumArmor)){
buyItems[BUY_ARMOR_MEDIUM].push(_local1);
} else {
if ((_local1 is HeavyArmor)){
buyItems[BUY_ARMOR_HEAVY].push(_local1);
} else {
buyItems[BUY_ACCESSORIES].push(_local1);
};
};
};
};
};
}
private function clickBuyTabAccessories(_arg1:MouseEvent):void{
buyMode = BUY_ACCESSORIES;
updateBuyTabs();
}
private function checkFilters(_arg1:MouseEvent=null):void{
if (buying){
addBuyItems();
} else {
addSellItems();
};
}
private function addConsumable(_arg1:Consumable, _arg2:int):void{
_arg1.stack = _arg2;
buyItems[BUY_CONSUMABLES].push(_arg1);
}
private function updateTabs():void{
if (buying){
updateBuyTabs();
buyTab.gotoAndStop(1);
sellTab.gotoAndStop(2);
dmf.childToTop(buyTab);
if (this.contains(sellPanel)){
this.removeChild(sellPanel);
};
if (!(this.contains(buyPanel))){
this.addChild(buyPanel);
};
} else {
updateSellTabs();
buyTab.gotoAndStop(2);
sellTab.gotoAndStop(1);
dmf.childToTop(sellTab);
if (this.contains(buyPanel)){
this.removeChild(buyPanel);
};
if (!(this.contains(sellPanel))){
this.addChild(sellPanel);
};
};
}
private function updateSellTabs():void{
sellPanel.allTab.gotoAndStop(2);
sellPanel.equippedTab.gotoAndStop(2);
if (sellMode == SELL_ALL){
sellPanel.allTab.gotoAndStop(1);
} else {
if (sellMode == SELL_EQUIPPED){
sellPanel.equippedTab.gotoAndStop(1);
};
};
addSellItems();
sellPanel.sellList.resetHandle();
}
private function addSellItems(_arg1:Boolean=false):void{
var sellList:Array;
var oldY:int;
var it:Item;
var sle:ShopListEntry;
var err_txt:*;
var err_dlg:ErrorDialog;
var retainPosition = _arg1;
try {
sellPanel.sellList.setShop(this);
oldY = sellPanel.sellList.scrollHandle.y;
sellPanel.sellList.empty();
sellList = getSellItems();
for each (it in sellList) {
if (it == null){
} else {
if ((((it.item_rarity == Item.green)) && (!(greenCheck.checked)))){
continue;
} else {
if ((((it.item_rarity == Item.blue)) && (!(blueCheck.checked)))){
continue;
} else {
if ((((it.item_rarity == Item.purple)) && (!(purpleCheck.checked)))){
continue;
};
};
};
sle = new ShopListEntry(it, tooltipController, it.playerOwner, false, this);
sellPanel.sellList.addEntry(sle);
};
};
sellPanel.sellList.finishedAdding();
if (retainPosition){
sellPanel.sellList.moveHandleTo(oldY);
sellPanel.sellList.update();
};
} catch(error:Error) {
if (DungeonMain.KONGREGATE){
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (("Add Sell Items Error: " + error.name) + "\n"));
if (sellList != null){
err_txt = (err_txt + (("entries: " + String(sellPanel.sellList.entries.length)) + "\n"));
};
if (sellList != null){
err_txt = (err_txt + (("sellList: " + String(sellList.length)) + "\n"));
};
err_txt = (err_txt + ((("[" + error.errorID) + "] ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
};
};
}
}
}//package
Section 485
//ShopListEntry (ShopListEntry)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class ShopListEntry extends Sprite {
public var ownerLabel:TextField;
public var priceLabel:TextField;
public var bg:MovieClip;
public var price:int;
public var gold:Sprite;
public var item_ref:Item;
public var ico:InventoryIcon;
public var itemLabel:TextField;
public var equipper:PlayerCharacter;
public var shop:Shop;
public var tooltipController:ItemTooltipController;
public static const FIXED_HEIGHT:int = 30;
public function ShopListEntry(_arg1:Item=null, _arg2:ItemTooltipController=null, _arg3:PlayerCharacter=null, _arg4:Boolean=true, _arg5:Shop=null):void{
var _local6:Number;
super();
select(false);
if (_arg1 == null){
return;
};
this.item_ref = _arg1;
if (_arg2 == null){
return;
};
this.tooltipController = _arg2;
if (_arg3 != null){
this.equipper = _arg3;
};
this.shop = _arg5;
itemLabel.mouseEnabled = false;
priceLabel.mouseEnabled = false;
ownerLabel.mouseEnabled = false;
gold.mouseEnabled = false;
ico.tooltipController = _arg2;
ico.setItem(_arg1);
addEventListener(MouseEvent.MOUSE_OVER, mouseOverIcon);
addEventListener(MouseEvent.MOUSE_OUT, mouseOutIcon);
itemLabel.text = String(_arg1.item_name);
itemLabel.textColor = Item.textColorForRarity(_arg1.item_rarity);
dmf.embolden(itemLabel);
if (equipper){
ownerLabel.text = ("Equipped by " + equipper.charname);
} else {
ownerLabel.text = "";
itemLabel.y = 8;
};
price = _arg1.getWorth();
if (_arg4){
price = Math.round((price * 3));
if (_arg1.priceModifier == 0){
_local6 = ((dmf.randomNum(0, 30) - 15) / 100);
_arg1.priceModifier = Math.round((_local6 * price));
};
price = (price + _arg1.priceModifier);
};
priceLabel.text = String(price);
priceLabel.autoSize = TextFieldAutoSize.RIGHT;
gold.x = (priceLabel.x - 12);
doubleClickEnabled = true;
addEventListener(MouseEvent.DOUBLE_CLICK, doubleClick);
}
public function select(_arg1:Boolean=true):void{
if (_arg1){
bg.gotoAndStop("selected");
} else {
bg.gotoAndStop("normal");
};
}
private function mouseOverIcon(_arg1:MouseEvent):void{
if (shop != null){
shop.showComparisons(item_ref);
};
}
private function doubleClick(_arg1:MouseEvent):void{
if (shop == null){
return;
};
if (!(shop.buying)){
if ((((shop.sellMode == Shop.SELL_EQUIPPED)) && (!((equipper == null))))){
shop.removeItemFrom(item_ref, equipper);
} else {
if (shop.sellMode == Shop.SELL_ALL){
shop.equipItem(item_ref, Shop.selectedChar);
};
};
};
}
private function mouseOutIcon(_arg1:MouseEvent):void{
if (shop != null){
shop.removeComparisons();
};
}
public function cleanup():void{
removeEventListener(MouseEvent.MOUSE_OVER, mouseOverIcon);
removeEventListener(MouseEvent.MOUSE_OUT, mouseOutIcon);
removeEventListener(MouseEvent.DOUBLE_CLICK, doubleClick);
}
}
}//package
Section 486
//ShopListScrolling (ShopListScrolling)
package {
import flash.events.*;
import flash.display.*;
public class ShopListScrolling extends Sprite {
const HANDLE_Y_MIN:int = 15;
const HANDLE_Y_MAX:int = 205;
public const VISIBLE_HEIGHT:int = 220;
private var scrolling:Boolean;// = false
public var scrollBar:Sprite;
public var scrollDown:ClickToScroll;
private var handleGrabPos:int;// = 0
public var visibleArea:Sprite;
private var scrollingDown:Boolean;// = false
public var scrollUp:ClickToScroll;
public var pane:Sprite;
private var scrollingUp:Boolean;// = false
public var scrollHandle:Sprite;
public var entries:Array;
public var selectedEntry:ShopListEntry;
public var paneHeight:int;// = 0
public var maskSprite:Sprite;
public var shop:Shop;
public var tooltipController:ItemTooltipController;
public function ShopListScrolling():void{
scrolling = false;
handleGrabPos = 0;
scrollingUp = false;
scrollingDown = false;
paneHeight = 0;
super();
entries = new Array();
addEventListener(Event.ENTER_FRAME, frame);
addEventListener(Event.REMOVED_FROM_STAGE, removed);
scrollHandle.addEventListener(MouseEvent.MOUSE_DOWN, startScroll);
scrollBar.addEventListener(MouseEvent.CLICK, clickBar);
}
private function entryClick(_arg1:MouseEvent):void{
var _local2:*;
_local2 = _arg1.target.parent;
if (_local2 == null){
return;
};
if ((_local2 is InventoryIcon)){
_local2 = _local2.parent;
};
unselect();
selectedEntry = _local2;
selectedEntry.select(true);
if (_arg1.ctrlKey){
if (shop != null){
if (shop.buying){
shop.buyClick(null);
} else {
shop.sellClick(null);
};
};
};
}
public function resetHandle():void{
moveHandleTo(HANDLE_Y_MIN);
update();
}
private function removed(_arg1:Event):void{
removeEventListener(Event.REMOVED_FROM_STAGE, removed);
stage.removeEventListener(MouseEvent.MOUSE_UP, stopScroll);
}
public function addEntry(_arg1:ShopListEntry):void{
var err_txt:*;
var err_dlg:ErrorDialog;
var s = _arg1;
try {
entries.push(s);
pane.addChild(s);
s.addEventListener(MouseEvent.CLICK, entryClick);
} catch(error:Error) {
if (DungeonMain.KONGREGATE){
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (("Add Entry Error: " + error.name) + "\n"));
err_txt = (err_txt + (("s: " + String(s)) + "\n"));
err_txt = (err_txt + ((((("[" + error.errorID) + "] ") + error.message) + " ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
};
};
}
private function clickBar(_arg1:MouseEvent):void{
var _local2:*;
_local2 = Math.round(((scrollBar.height - scrollHandle.height) / 2));
if (scrollBar.mouseY < scrollHandle.y){
moveHandleTo((scrollHandle.y - _local2));
update();
} else {
moveHandleTo((scrollHandle.y + _local2));
update();
};
}
private function frame(_arg1:Event):void{
var _local2 = ??pushnamespace
;
var _local3:int;
var _local4:*;
_local2 = 25;
if (scrolling){
if ((((this.mouseX < (pane.width - _local2))) || ((this.mouseX > (this.width + _local2))))){
stopScroll(null);
update();
} else {
_local3 = Math.round(this.mouseY);
moveHandleTo((_local3 - handleGrabPos));
update();
};
} else {
_local4 = 5;
if (scrollUp.scrolling){
moveHandleTo((scrollHandle.y - _local4));
update();
} else {
if (scrollDown.scrolling){
moveHandleTo((scrollHandle.y + _local4));
update();
};
};
};
}
public function setShop(_arg1:Shop):void{
this.shop = _arg1;
}
private function stopScroll(_arg1:MouseEvent):void{
if (stage != null){
stage.removeEventListener(MouseEvent.MOUSE_UP, stopScroll);
};
scrolling = false;
}
public function empty(_arg1:Boolean=true):void{
var e:ShopListEntry;
var i:int;
var c:*;
var err_txt:*;
var err_dlg:ErrorDialog;
var updateAfter = _arg1;
try {
unselect();
for each (e in entries) {
if (e == null){
} else {
if (e.parent != null){
e.parent.removeChild(e);
};
e.removeEventListener(MouseEvent.CLICK, entryClick);
e.cleanup();
};
};
entries.length = 0;
finishedAdding();
i = 0;
while (i < pane.numChildren) {
c = pane.getChildAt(i);
if ((c is ShopListEntry)){
pane.removeChild(c);
c.removeEventListener(MouseEvent.CLICK, entryClick);
ShopListEntry(c).cleanup();
};
i = (i + 1);
};
if (updateAfter){
resetHandle();
};
} catch(error:Error) {
if (DungeonMain.KONGREGATE){
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (("Empty List Error: " + error.name) + "\n"));
err_txt = (err_txt + (("entries: " + String(entries.length)) + "\n"));
err_txt = (err_txt + ((((("[" + error.errorID) + "] ") + error.message) + " ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
};
};
}
public function cleanup():void{
removeEventListener(Event.ENTER_FRAME, frame);
scrollHandle.removeEventListener(MouseEvent.MOUSE_DOWN, startScroll);
scrollBar.removeEventListener(MouseEvent.CLICK, clickBar);
scrollUp.cleanup();
scrollDown.cleanup();
empty(false);
}
public function finishedAdding():void{
var _local1:int;
var _local2:DisplayObject;
var _local3:Number;
var _local4:int;
_local1 = 0;
for each (_local2 in entries) {
if (_local2 == null){
} else {
_local2.x = 0;
_local2.y = _local1;
_local1 = (_local1 + ShopListEntry.FIXED_HEIGHT);
};
};
paneHeight = _local1;
_local3 = (VISIBLE_HEIGHT / paneHeight);
_local4 = (HANDLE_Y_MAX - HANDLE_Y_MIN);
if (paneHeight < VISIBLE_HEIGHT){
_local3 = 1;
};
scrollHandle.height = Math.round((_local3 * _local4));
}
public function setTooltipController(_arg1:ItemTooltipController):void{
var _local2:ShopListEntry;
this.tooltipController = _arg1;
for each (_local2 in entries) {
if (_local2 == null){
continue;
} else {
_local2.tooltipController = _arg1;
};
};
}
public function moveHandleTo(_arg1:int):void{
_arg1 = Math.max(HANDLE_Y_MIN, _arg1);
_arg1 = Math.min((HANDLE_Y_MAX - scrollHandle.height), _arg1);
scrollHandle.y = _arg1;
}
private function setMasks():void{
setChildIndex(maskSprite, (numChildren - 1));
pane.mask = maskSprite;
}
public function update():void{
var frac:Number;
var maxBarHeight:int;
var scrollBarHeight:int;
var scrollY:int;
var minY:int;
var err_txt:*;
var err_dlg:ErrorDialog;
frac = 0;
try {
moveHandleTo(scrollHandle.y);
maxBarHeight = (HANDLE_Y_MAX - HANDLE_Y_MIN);
scrollBarHeight = (maxBarHeight - scrollHandle.height);
scrollY = (Math.round(scrollHandle.y) - HANDLE_Y_MIN);
frac = (scrollY / scrollBarHeight);
if (scrollBarHeight == 0){
frac = 1;
};
minY = (VISIBLE_HEIGHT - paneHeight);
pane.x = 0;
pane.y = Math.round((frac * minY));
if (pane.y > 0){
pane.y = 0;
} else {
if (pane.y < minY){
pane.y = minY;
};
};
if (!(this.contains(pane))){
addChild(pane);
};
setMasks();
} catch(error:Error) {
if (DungeonMain.KONGREGATE){
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (("Scroll Update Error: " + error.name) + "\n"));
err_txt = (err_txt + (("scrollHandle: " + String(scrollHandle.y)) + "\n"));
err_txt = (err_txt + (("frac: " + String(frac)) + "\n"));
err_txt = (err_txt + ((((("[" + error.errorID) + "] ") + error.message) + " ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
};
};
}
private function startScroll(_arg1:MouseEvent):void{
stage.addEventListener(MouseEvent.MOUSE_UP, stopScroll);
scrolling = true;
handleGrabPos = Math.round((this.mouseY - scrollHandle.y));
}
public function unselect():void{
if (selectedEntry != null){
selectedEntry.select(false);
selectedEntry = null;
};
}
}
}//package
Section 487
//ShrineUseDialog (ShrineUseDialog)
package {
import flash.events.*;
import flash.ui.*;
import flash.display.*;
import flash.text.*;
public class ShrineUseDialog extends MovieClip {
public var yes_btn:MovieClip;
public var headerText:TextField;
public var no_btn:MovieClip;
public var bodyText:TextField;
public function ShrineUseDialog(_arg1:String="", _arg2:String=""):void{
if (_arg1 != ""){
headerText.text = _arg1;
dmf.embolden(headerText);
};
if (_arg2 != ""){
bodyText.text = _arg2;
};
this.yes_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickYes);
this.no_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickNo);
dm.stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
}
function clickYes(_arg1:MouseEvent):void{
if (((!((parent == null))) && ((parent is Dungeon)))){
cleanup();
Dungeon(parent).useShrine();
};
}
function clickNo(_arg1:MouseEvent):void{
if (parent != null){
cleanup();
parent.removeChild(this);
};
}
private function cleanup():void{
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickYes);
no_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickNo);
dm.stage.removeEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
}
function reportKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.ENTER){
clickYes(null);
} else {
if (_arg1.keyCode == Keyboard.ESCAPE){
clickNo(null);
};
};
}
}
}//package
Section 488
//sHydraBite (sHydraBite)
package {
public class sHydraBite extends Skill {
public function sHydraBite(_arg1:Character){
char_ref = _arg1;
rangedAttack = true;
damage = _arg1.damage;
power_cost = 25;
skillname = "Attack";
verbage = "attacks";
specialAnimation = PortraitAnimation.creatureBite;
}
}
}//package
Section 489
//sHydraGrowHeads (sHydraGrowHeads)
package {
public class sHydraGrowHeads extends Skill {
public function sHydraGrowHeads(_arg1:Character){
char_ref = _arg1;
hydraGrowHeads = true;
alwaysHits = true;
resurrects = true;
damage = 0;
power_cost = 30;
skillname = "Regenerate Heads!";
verbage = "regenerates heads";
}
}
}//package
Section 490
//sInstillFear (sInstillFear)
package {
public class sInstillFear extends Skill {
public function sInstillFear(_arg1:Character){
char_ref = _arg1;
rangedAttack = true;
stun_percent = 100;
power_cost = 35;
crippling = 100;
skillname = "Instill Fear";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.fearDeath;
}
}
}//package
Section 491
//Skill (Skill)
package {
public class Skill {
var showWeaponAnimation:Boolean;// = false
var requiresRanged:Boolean;// = false
var swapPositions:Boolean;// = false
var undeadMultiplier:Number;// = 0
var nonCombat:Boolean;// = false
var clonesPlayers:Boolean;// = false
var char_ref:Character;
var shufflesEnemies:Boolean;// = false
var invulnerable:int;// = 0
var makeDamageSponge:Boolean;// = false
var killsUser:Boolean;// = false
var debuff_damageResist:int;// = 0
var increaseRate:Number;// = 1
var onlyDamagesUndead:Boolean;// = false
var aiNotUnlessLowPower:Boolean;// = false
var crippling:int;// = 0
var removesPoison:Boolean;// = false
var aiTargetsBackRow:Boolean;// = false
var skillname:String;// = "Skill"
var cancelPowerRegen:int;// = 0
var forceRetreat:Boolean;// = false
var requiresMelee:Boolean;// = false
var cancelHealthRegen:int;// = 0
var targetsSummoned:Boolean;// = false
private var _power_cost:int;// = 0
var hidesTarget:Boolean;// = false
var iconFrame:int;// = 1
var aiCastLimit:int;// = -1
var transformCreatureClass:MonsterCharacter;// = null
var cannotDie:int;// = 0
var targetDamageMod;// = 1
var curse;// = 0
var costsRemainingPower:Boolean;// = false
var vampiric_percent:int;// = 0
var poisonDamage:int;// = 0
var attacksTwoTargets:Boolean;// = false
var buff_damageResist:int;// = 0
var addsPowerToLethality:Boolean;// = false
var hitsAllEnemies:Boolean;// = false
var hasPortraitAnimation:Boolean;// = false
var requiresShield:Boolean;// = false
var splashHitsAllies:Boolean;// = false
var requiresLowHealth:Boolean;// = false
var aiNotUnlessHurt:Boolean;// = false
var specialAnimation:int;// = 0
var powerDamage:int;// = 0
var increasesWith:int;// = 5
var buff_quickness:int;// = 0
var portraitAnimationDuration:int;// = 1500
var aiOnlyWhenHordeDead:Boolean;// = false
var unlocked:Boolean;// = false
var ignoresArmor:Boolean;// = false
var buff_damage:Number;// = 1
var aiAllowSuicide:Boolean;// = false
var portraitAnimationFrame:int;// = 0
var requiresVerticalGap:Boolean;// = false
var woundsRestorePower:int;// = 0
var healing:int;// = 0
var tempDamageResistance:int;// = 0
var buff_vampiric:int;// = 0
var active:Boolean;// = false
var gainPowerFromKill:int;// = 0
var extraSpeedAttacks:int;// = 0
var usesWeaponRange:Boolean;// = false
var lethality:int;// = 0
var splashDamageMultiplier:Number;// = 0
var scaleWeaponDamage;// = 1
var magicStrength:Number;// = 0
var damageBonusVsCreatureModifier;// = 1
var buff_stun:int;// = 0
var position:int;// = 1
var aiTargetOnlyLowHealth:Boolean;// = false
var allyBonusAttack:Boolean;// = false
var buff_resistStun:int;// = 0
var targetsStunned:Boolean;// = false
var targetsFriendlies:Boolean;// = false
var buff_healthRegen:int;// = 0
var hitsAllMeleeRange:Boolean;// = false
var piercesColumn:Boolean;// = false
var buff_damageReflect:int;// = 0
var removesCurse:Boolean;// = false
var buff_accuracy:int;// = 0
var summonsWhirlwind:Boolean;// = false
var requiresWeapon:Boolean;// = false
var targetsEmpty:Boolean;// = false
var damage:int;// = 0
var targetsSelf:Boolean;// = false
var hydraGrowHeads:Boolean;// = false
var verbage:String;
var damageBonusVsCreatureType;// = 0
var damageAccuracy:int;// = 0
var hitsAllEmpty:Boolean;// = false
var aiTargetHealthiest:Boolean;// = false
var buff_powerRegen:int;// = 0
var hitsAllFriendlies:Boolean;// = false
var attacksMultipleTimes:int;// = 0
var aiAlwaysUse:Boolean;// = false
var powerRegenMod:Number;// = 1
var doesNotEffectSelf:Boolean;// = false
var debuff_damage:Number;// = 1
var stun_percent:int;// = 0
var nonLethal:Boolean;// = false
var suppressStunAnim:Boolean;// = false
var aiCastCount:int;// = 0
var powerRestore:int;// = 0
var health_cost:int;// = 0
var targetsFriendlyFrontRow:Boolean;// = false
var intimidating:Boolean;// = false
var summonsCreatureClass:Character;// = null
var unarmedAttack:Boolean;// = false
var aiPriority:int;// = 5
var alwaysHits:Boolean;// = false
var resurrects:Boolean;// = false
var powerDrain:Boolean;// = false
var rangedAttack:Boolean;// = false
var addWeaponDamage;// = false
var buff_resistPoison:int;// = 0
var attacksWithAccuracyMod:Number;// = 1
static const intellect:int = 4;
static const strength:int = 1;
static const dexterity:int = 3;
static const endurance:int = 2;
static const level:int = 6;
static const weapon:int = 5;
static const none:int = 0;
public function Skill(){
skillname = "Skill";
verbage = ("uses " + String(skillname));
iconFrame = 1;
active = false;
position = 1;
unlocked = false;
nonCombat = false;
aiCastLimit = -1;
aiCastCount = 0;
aiNotUnlessHurt = false;
aiTargetHealthiest = false;
aiNotUnlessLowPower = false;
aiAllowSuicide = false;
aiTargetsBackRow = false;
aiTargetOnlyLowHealth = false;
aiAlwaysUse = false;
aiOnlyWhenHordeDead = false;
aiPriority = 5;
increasesWith = Skill.weapon;
increaseRate = 1;
requiresWeapon = false;
requiresMelee = false;
requiresRanged = false;
requiresShield = false;
unarmedAttack = false;
requiresLowHealth = false;
_power_cost = 0;
health_cost = 0;
damage = 0;
healing = 0;
buff_resistPoison = 0;
buff_resistStun = 0;
buff_damageResist = 0;
buff_damageReflect = 0;
buff_healthRegen = 0;
buff_powerRegen = 0;
buff_vampiric = 0;
buff_stun = 0;
buff_quickness = 0;
buff_damage = 1;
buff_accuracy = 0;
debuff_damageResist = 0;
debuff_damage = 1;
targetDamageMod = 1;
damageAccuracy = 0;
crippling = 0;
rangedAttack = false;
usesWeaponRange = false;
targetsFriendlies = false;
targetsSelf = false;
targetsEmpty = false;
hitsAllEmpty = false;
hitsAllFriendlies = false;
hitsAllEnemies = false;
hitsAllMeleeRange = false;
piercesColumn = false;
splashDamageMultiplier = 0;
splashHitsAllies = false;
doesNotEffectSelf = false;
requiresVerticalGap = false;
targetsFriendlyFrontRow = false;
targetsStunned = false;
targetsSummoned = false;
powerRegenMod = 1;
powerDamage = 0;
powerDrain = false;
gainPowerFromKill = 0;
powerRestore = 0;
woundsRestorePower = 0;
clonesPlayers = false;
summonsWhirlwind = false;
shufflesEnemies = false;
swapPositions = false;
lethality = 0;
costsRemainingPower = false;
addsPowerToLethality = false;
intimidating = false;
hidesTarget = false;
summonsCreatureClass = null;
transformCreatureClass = null;
makeDamageSponge = false;
tempDamageResistance = 0;
cancelPowerRegen = 0;
cancelHealthRegen = 0;
forceRetreat = false;
nonLethal = false;
undeadMultiplier = 0;
onlyDamagesUndead = false;
vampiric_percent = 0;
stun_percent = 0;
alwaysHits = false;
allyBonusAttack = false;
attacksMultipleTimes = 0;
attacksWithAccuracyMod = 1;
extraSpeedAttacks = 0;
attacksTwoTargets = false;
curse = 0;
removesCurse = false;
killsUser = false;
hydraGrowHeads = false;
poisonDamage = 0;
removesPoison = false;
resurrects = false;
cannotDie = 0;
invulnerable = 0;
ignoresArmor = false;
scaleWeaponDamage = 1;
addWeaponDamage = false;
magicStrength = 0;
damageBonusVsCreatureType = 0;
damageBonusVsCreatureModifier = 1;
hasPortraitAnimation = false;
portraitAnimationFrame = 0;
portraitAnimationDuration = 1500;
specialAnimation = 0;
showWeaponAnimation = false;
suppressStunAnim = false;
super();
aiPriority = 5;
}
public function description():String{
return ("Blank skill description");
}
public function isPhysical():Boolean{
if (skillname == "Magic Attack"){
return (false);
};
if (((((((unarmedAttack) || (addWeaponDamage))) || (requiresMelee))) || (requiresRanged))){
return (true);
};
if ((char_ref is PlayerSummon)){
return (true);
};
if ((char_ref is PC_Adventurer)){
return (true);
};
return (false);
}
public function getCostString():String{
var _local1:*;
if (((costsRemainingPower) && (power_cost))){
_local1 = (("Requires " + power_cost) + " power\n Uses remaining power");
} else {
if (costsRemainingPower){
_local1 = "Uses remaining power";
} else {
if (power_cost){
_local1 = (("Uses " + power_cost) + " power");
};
};
};
return (_local1);
}
public function getDamage():int{
var _local1:PlayerCharacter;
var _local2:int;
var _local3:*;
var _local4:*;
_local1 = null;
_local2 = damage;
if (((!((char_ref == null))) && ((char_ref is PlayerCharacter)))){
_local1 = PlayerCharacter(char_ref);
};
if (((unarmedAttack) && (!((_local1 == null))))){
return (_local1.getUnarmedDamage());
};
if (((addWeaponDamage) && (!((_local1 == null))))){
_local3 = _local1.getWeaponDamage();
_local3 = (_local3 * scaleWeaponDamage);
_local2 = (_local2 + Math.round(_local3));
};
if (((((((damage) && (!((_local1 == null))))) && (!((increasesWith == Skill.none))))) && (!((increasesWith == Skill.level))))){
_local4 = getStat(increasesWith);
if (_local4 > 0){
_local2 = (_local2 + getScaledDamage(_local4));
};
};
return (_local2);
}
public function scaleHeal(_arg1:int, _arg2:int=1):int{
var _local3:*;
var _local4:int;
var _local5:*;
if (_arg1 <= 0){
return (0);
};
_local3 = getStat(increasesWith);
if (_local3 > 0){
_local5 = (1 + (((_local3 - 1) * 0.05) * increaseRate));
_arg1 = Math.round((_arg1 * _local5));
};
_local4 = (_arg1 + Math.round((char_ref.getHealingBonus() / _arg2)));
return (_local4);
}
public function get power_cost():int{
return (this._power_cost);
}
private function getStat(_arg1:int):int{
var _local2:*;
_local2 = 0;
if (_arg1 == Skill.strength){
_local2 = char_ref.getStrength();
} else {
if (_arg1 == Skill.dexterity){
_local2 = char_ref.getDexterity();
} else {
if (_arg1 == Skill.endurance){
_local2 = char_ref.getEndurance();
} else {
if (_arg1 == Skill.intellect){
_local2 = char_ref.getIntellect();
} else {
if (_arg1 == Skill.level){
_local2 = (1 + (char_ref.level * PlayerCharacter.STATS_PER_LEVEL));
};
};
};
};
};
return (_local2);
}
private function getScaledDamage(_arg1:int):int{
var _local2:int;
var _local3:Number;
_arg1--;
_local2 = (30 * (char_ref.level - 1));
_local3 = ((_arg1 * increaseRate) * (_local2 / ((PlayerCharacter.STATS_PER_LEVEL * char_ref.level) * 2)));
if (magicStrength > 0){
_local3 = (_local3 * magicStrength);
};
return (Math.round(_local3));
}
public function usable(_arg1=false):Boolean{
var _local2:*;
var _local3:*;
var _local4:int;
var _local5:PlayerCharacter;
if ((char_ref is PlayerCharacter)){
_local2 = PlayerCharacter(char_ref).gear[Equipment.weapon];
_local3 = PlayerCharacter(char_ref).gear[Equipment.offhand];
if (((requiresWeapon) && ((_local2 == null)))){
return (false);
};
if (((requiresMelee) && (!((_local2 is MeleeWeapon))))){
return (false);
};
if (((requiresRanged) && (!((_local2 is RangedWeapon))))){
return (false);
};
if (((requiresShield) && (!((_local3 is Shield))))){
return (false);
};
if (summonsCreatureClass){
_local4 = 0;
for each (_local5 in PlayerCharacter(char_ref).party.members) {
if (_local5 == null){
} else {
if ((((_local5 is PlayerSummon)) && ((_local5.health <= 0)))){
} else {
_local4++;
};
};
};
if (_local4 >= 6){
return (false);
};
};
};
if (requiresLowHealth){
if (char_ref.getHealthPercent() > 20){
return (false);
};
};
if (char_ref.power < power_cost){
return (false);
};
return (true);
}
public function scalePoison():int{
if (((!((increasesWith == Skill.none))) && (!((increasesWith == Skill.weapon))))){
return ((poisonDamage + getScaledDamage(getStat(increasesWith))));
};
return (poisonDamage);
}
public function getDefianceHealth():int{
var _local1:*;
_local1 = 1;
if (((!((char_ref == null))) && ((char_ref is PlayerCharacter)))){
_local1 = char_ref.getEndurance();
};
return (_local1);
}
public function set power_cost(_arg1:int):void{
this._power_cost = _arg1;
}
public static function getBaseMagicDamage(_arg1:Number):int{
var _local2:*;
_local2 = Math.round(((Weapon.staff_base_damage * 2.2) * _arg1));
return (_local2);
}
}
}//package
Section 492
//SkillBar (SkillBar)
package {
import flash.events.*;
import flash.display.*;
public class SkillBar extends Sprite {
public var slot3:SkillIconEmpty;
var icons:Array;
public var slot2:SkillIconEmpty;
var selected_id:int;
var sih:SkillIconHighlight;
public var slot5:SkillIconEmpty;
public var slot1:SkillIconEmpty;
public var slot4:SkillIconEmpty;
public var slot6:SkillIconEmpty;
static const max_skills = 6;
public function SkillBar(){
icons = new Array();
super();
icons.length = 0;
selected_id = 0;
sih = new SkillIconHighlight();
addChild(sih);
}
public function incrementSkill(){
var _local1:*;
_local1 = (selected_id + 1);
if (_local1 >= icons.length){
_local1 = 0;
};
setSelectedSkill(_local1);
}
public function setSelectedSkill(_arg1:int):void{
sih.x = icons[_arg1].x;
sih.y = icons[_arg1].y;
selected_id = _arg1;
Battlefield(parent).powerPreview();
}
public function setSelectedSkillByPosition(_arg1:int):void{
var _local2:*;
_local2 = 0;
while (_local2 < icons.length) {
if (icons[_local2].skill_ref.position == _arg1){
setSelectedSkill(_local2);
Battlefield(parent).ValidTargetsForPlayer(icons[_local2].skill_ref);
break;
};
_local2++;
};
}
public function cleanup():void{
var _local1:*;
_local1 = 0;
while (_local1 < icons.length) {
icons[_local1].cleanup();
icons[_local1].removeEventListener(MouseEvent.MOUSE_DOWN, skillClick);
_local1++;
};
}
public function decrementSkill(){
var _local1:*;
_local1 = (selected_id - 1);
if (_local1 < 0){
_local1 = (icons.length - 1);
};
setSelectedSkill(_local1);
}
public function addIcon(_arg1:SkillIcon):Boolean{
var _local2:*;
var _local3:*;
var _local4:SkillIconEmpty;
if (icons.length < max_skills){
_local4 = SkillIconEmpty(getChildByName(("slot" + _arg1.skill_ref.position)));
if (_local4 == null){
return (false);
};
_arg1.x = _local4.x;
_arg1.y = _local4.y;
icons.push(_arg1);
_arg1.setUsable(_arg1.skill_ref.usable());
addChild(_arg1);
_arg1.addEventListener(MouseEvent.MOUSE_DOWN, skillClick);
reOrderByPosition();
setSelectedSkill(0);
return (true);
};
return (false);
}
public function skillClick(_arg1:MouseEvent):void{
var _local2:*;
var _local3:*;
_local2 = 0;
while (_local2 < icons.length) {
if (icons[_local2] == SkillIcon(_arg1.currentTarget)){
setSelectedSkill(_local2);
Battlefield(parent).ValidTargetsForPlayer(icons[_local2].skill_ref);
break;
};
_local2++;
};
}
public function getSelectedSkill():Skill{
var _local1:*;
_local1 = null;
if (selected_id < icons.length){
_local1 = SkillIcon(icons[selected_id]).skill_ref;
};
return (_local1);
}
private function reOrderByPosition():void{
var _local1:Array;
var _local2:*;
var _local3:*;
_local1 = new Array();
_local2 = 1;
while (_local2 <= 6) {
_local3 = 0;
while (_local3 < icons.length) {
if (icons[_local3].skill_ref.position == _local2){
_local1.push(icons[_local3]);
};
_local3++;
};
_local2++;
};
icons = _local1;
}
}
}//package
Section 493
//SkillIcon (SkillIcon)
package {
import flash.events.*;
import flash.display.*;
public class SkillIcon extends MovieClip {
var tooltip:SkillTooltip;
private var mousingOver:Boolean;// = false
private var mouseOverFrames:int;// = 0
var char_ref:PlayerCharacter;
public var bg:MovieClip;
private var mousedOverEvent:MouseEvent;
var skill_ref:Skill;
var tt_text:String;
var tt_title:String;
public function SkillIcon(){
mousingOver = false;
mouseOverFrames = 0;
super();
bg.addEventListener(MouseEvent.MOUSE_OVER, mouseOverTarget);
bg.addEventListener(MouseEvent.MOUSE_OUT, mouseOutTarget);
this.addEventListener(Event.ADDED_TO_STAGE, added);
this.addEventListener(Event.ENTER_FRAME, onFrame);
}
function added(_arg1:Event):void{
this.addEventListener(Event.REMOVED_FROM_STAGE, removed);
}
public function setUsable(_arg1:Boolean):void{
if (_arg1){
bg.gotoAndStop(1);
} else {
bg.gotoAndStop(2);
};
}
public function setSkill(_arg1:Skill){
if (_arg1 == null){
return;
};
this.skill_ref = _arg1;
tt_text = skill_ref.description();
tt_title = skill_ref.skillname;
this.gotoAndStop(_arg1.iconFrame);
if (((!((skill_ref.char_ref == null))) && ((skill_ref.char_ref is PlayerCharacter)))){
this.char_ref = PlayerCharacter(skill_ref.char_ref);
};
}
function mouseOverTarget(_arg1:MouseEvent):void{
mousingOver = true;
mouseOverFrames = 0;
mousedOverEvent = _arg1;
}
private function newTooltip(_arg1:MouseEvent):Boolean{
var _local2:String;
var _local3:String;
var _local4:Boolean;
var _local5:Boolean;
if (skill_ref != null){
_local4 = false;
if (skill_ref.requiresWeapon){
_local2 = "Requires Weapon";
if (char_ref.gear[Equipment.weapon] != null){
_local4 = true;
};
} else {
if (skill_ref.requiresMelee){
_local2 = "Requires Melee Weapon";
if (((!((char_ref.gear[Equipment.weapon] == null))) && ((char_ref.gear[Equipment.weapon] is MeleeWeapon)))){
_local4 = true;
};
} else {
if (skill_ref.requiresRanged){
_local2 = "Requires Ranged Weapon";
if (((!((char_ref.gear[Equipment.weapon] == null))) && ((char_ref.gear[Equipment.weapon] is RangedWeapon)))){
_local4 = true;
};
} else {
if (skill_ref.requiresShield){
_local2 = "Requires Shield";
if (((!((char_ref.gear[Equipment.offhand] == null))) && ((char_ref.gear[Equipment.offhand] is Shield)))){
_local4 = true;
};
};
};
};
};
if (skill_ref.increasesWith != Skill.none){
if (skill_ref.increasesWith == Skill.weapon){
_local3 = "Effect increases with Weapon Damage";
};
if (skill_ref.increasesWith == Skill.level){
_local3 = "Effect increases with Level";
};
if (skill_ref.increasesWith == Skill.strength){
_local3 = "Effect increases with Strength";
};
if (skill_ref.increasesWith == Skill.intellect){
_local3 = "Effect increases with Intellect";
};
if (skill_ref.increasesWith == Skill.endurance){
_local3 = "Effect increases with Endurance";
};
if (skill_ref.increasesWith == Skill.dexterity){
_local3 = "Effect increases with Dexterity";
};
};
_local5 = false;
if ((((char_ref.power > 0)) && ((char_ref.power >= skill_ref.power_cost)))){
_local5 = true;
};
tooltip = new SkillTooltip(tt_title, tt_text, _local2, _local4, _local3, skill_ref.getCostString(), _local5);
tooltip.mouseEnabled = false;
tooltip.mouseChildren = false;
tooltip.name = "tooltip_skill";
tooltip.setForEvent(_arg1);
if (stage != null){
stage.addChild(tooltip);
return (true);
};
return (false);
};
return (false);
}
function mouseOutTarget(_arg1:MouseEvent):void{
if (tooltip != null){
tooltip.fade();
tooltip = null;
};
mousingOver = false;
mouseOverFrames = 0;
}
public function setOwner(_arg1:PlayerCharacter){
this.char_ref = _arg1;
}
function removed(_arg1:Event):void{
this.removeEventListener(Event.REMOVED_FROM_STAGE, removed);
if (this.tooltip != null){
mouseOutTarget(null);
};
}
public function cleanup():void{
this.removeEventListener(Event.ADDED_TO_STAGE, added);
bg.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverTarget);
bg.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutTarget);
this.removeEventListener(Event.ENTER_FRAME, onFrame);
}
private function onFrame(_arg1:Event):void{
if (mousingOver){
mouseOverFrames++;
};
if (mouseOverFrames > Tooltip.delayFrames){
newTooltip(mousedOverEvent);
mousingOver = false;
mouseOverFrames = 0;
};
}
}
}//package
Section 494
//SkillIconEmpty (SkillIconEmpty)
package {
import flash.display.*;
public dynamic class SkillIconEmpty extends Sprite {
}
}//package
Section 495
//SkillIconHighlight (SkillIconHighlight)
package {
import flash.display.*;
public dynamic class SkillIconHighlight extends MovieClip {
}
}//package
Section 496
//SkillsPreview (SkillsPreview)
package {
import flash.text.*;
import flash.events.*;
import flash.display.*;
public class SkillsPreview extends MovieClip {
public var passive2:PassiveSkillIcon;
public var start2:SkillIcon;
public var start1:SkillIcon;
public var start3:SkillIcon;
public var class_label:TextField;
public var unlock4:SkillIcon;
public var unlock5:SkillIcon;
public var unlock2:SkillIcon;
public var unlock3:SkillIcon;
public var unlock8:SkillIcon;
public var unlock1:SkillIcon;
public var unlock6:SkillIcon;
public var unlock7:SkillIcon;
public var continue_btn:MovieClip;
public var passive1:PassiveSkillIcon;
public function SkillsPreview(_arg1:PlayerCharacter=null){
var _local2:*;
var _local3:SkillIcon;
var _local4:String;
super();
_local2 = 0;
if (_arg1 != null){
class_label.text = (_arg1.classname + " Skills");
dm.embolden(class_label);
_local2 = 0;
while (_local2 < 11) {
_local4 = "null";
if (_arg1.skills[_local2] != null){
_local4 = _arg1.skills[_local2].skillname;
};
_local2++;
};
_local2 = 0;
while (_local2 < 3) {
_local3 = SkillIcon(getChildByName(("start" + String((_local2 + 1)))));
if (_local3 != null){
_local3.setOwner(_arg1);
_local3.setSkill(_arg1.skills[_local2]);
};
_local2++;
};
_local2 = 3;
while (_local2 <= 10) {
_local3 = SkillIcon(getChildByName(("unlock" + String((_local2 - 2)))));
if (_local3 != null){
_local3.setOwner(_arg1);
_local3.setSkill(_arg1.skills[_local2]);
};
_local2++;
};
};
passive1.updateSkill(_arg1, true);
passive2.updateSkill(_arg1, false);
continue_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
}
private function cleanup():void{
continue_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
}
function clickOkay(_arg1:MouseEvent):void{
continue_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
if (dm.stage != null){
dm.stage.removeChild(this);
cleanup();
};
}
}
}//package
Section 497
//SkillTooltip (SkillTooltip)
package {
import flash.text.*;
import flash.display.*;
public class SkillTooltip extends Tooltip {
public var tooltip_bg:Sprite;
public var requires_label:TextField;
public var text_label:TextField;
public var title_label:TextField;
public var power_cost_label:TextField;
public var increase_label:TextField;
public function SkillTooltip(_arg1:String="", _arg2:String="", _arg3:String="", _arg4:Boolean=false, _arg5:String="", _arg6:String="", _arg7:Boolean=false){
var _local8:*;
var _local9:*;
super();
if (_arg1 == null){
_arg1 = "Blank";
};
if (_arg2 == null){
_arg2 = "Tooltip contents failed to load.";
};
title_label.autoSize = TextFieldAutoSize.CENTER;
title_label.text = _arg1;
dm.embolden(title_label);
_local8 = title_label.height;
title_label.autoSize = TextFieldAutoSize.NONE;
if (_local8 == 16){
title_label.height = (_local8 + 5);
};
_local9 = ((title_label.y + title_label.height) + 4);
if (_arg3 != null){
requires_label.y = (_local9 - 3);
_local9 = (_local9 + (requires_label.height + 3));
requires_label.text = _arg3;
dm.embolden(requires_label);
if (_arg4){
requires_label.textColor = white_text;
} else {
requires_label.textColor = red_text;
};
} else {
removeChild(requires_label);
};
if (_arg5 != null){
increase_label.y = (_local9 - 3);
if (_arg3 != null){
increase_label.y = (increase_label.y - 4);
};
_local9 = (_local9 + (increase_label.height + 3));
increase_label.text = _arg5;
} else {
removeChild(increase_label);
};
text_label.y = (_local9 + 3);
text_label.text = _arg2;
text_label.autoSize = TextFieldAutoSize.CENTER;
_local9 = ((text_label.y + text_label.height) + 4);
if (_arg6 != null){
power_cost_label.y = (_local9 + 6);
_local9 = (_local9 + (2 + power_cost_label.height));
power_cost_label.text = _arg6;
dm.embolden(power_cost_label);
if (_arg7){
power_cost_label.textColor = white_text;
} else {
power_cost_label.textColor = red_text;
};
} else {
removeChild(power_cost_label);
};
tooltip_bg.height = (_local9 + 15);
}
}
}//package
Section 498
//slash1_sound (slash1_sound)
package {
import flash.media.*;
public dynamic class slash1_sound extends Sound {
}
}//package
Section 499
//sLichAE (sLichAE)
package {
public class sLichAE extends Skill {
public function sLichAE(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 1;
rangedAttack = true;
hitsAllEnemies = true;
damage = Math.round((_arg1.damage / 4));
poisonDamage = Math.round((_arg1.damage / 6));
power_cost = 60;
skillname = "Poison Cloud";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.poison;
}
}
}//package
Section 500
//sLichStun (sLichStun)
package {
public class sLichStun extends Skill {
public function sLichStun(_arg1:Character){
char_ref = _arg1;
if (_arg1.level == 1){
aiCastLimit = 0;
} else {
aiCastLimit = 2;
};
rangedAttack = true;
hitsAllEnemies = true;
alwaysHits = true;
damage = Math.round((_arg1.damage / 4));
stun_percent = 50;
power_cost = 75;
skillname = "Fear of Death";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.fearDeath;
}
}
}//package
Section 501
//sLightningDrakeAE (sLightningDrakeAE)
package {
public class sLightningDrakeAE extends Skill {
public function sLightningDrakeAE(_arg1:Character){
char_ref = _arg1;
aiPriority = 7;
damage = Math.round((_arg1.damage * 0.8));
power_cost = 60;
hitsAllMeleeRange = true;
skillname = "Lightning Arc";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.lightning;
}
}
}//package
Section 502
//sMageAE (sMageAE)
package {
public class sMageAE extends Skill {
public function sMageAE(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.intellect;
aiCastLimit = 0;
magicStrength = 0.7;
damage = getBaseMagicDamage(magicStrength);
rangedAttack = true;
hitsAllEnemies = true;
power_cost = 55;
iconFrame = 40;
skillname = "Electrical Storm";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.lightning;
}
override public function description():String{
return ((("Magic area attack. Inflicts " + getDamage()) + " damage to all enemies."));
}
}
}//package
Section 503
//sMageArmor (sMageArmor)
package {
public class sMageArmor extends Skill {
public function sMageArmor(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
aiCastLimit = 1;
damage = 0;
power_cost = 25;
targetsSelf = true;
buff_damageResist = 40;
iconFrame = 19;
skillname = "Arcane Armor";
verbage = ("summons " + skillname);
specialAnimation = PortraitAnimation.armorBuff;
}
override public function description():String{
return ((("Caster gains an additional " + buff_damageResist) + "% damage resistance for the remainder of the battle."));
}
}
}//package
Section 504
//sMageAttack (sMageAttack)
package {
public class sMageAttack extends Skill {
public function sMageAttack(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
unlocked = true;
damage = 0;
addWeaponDamage = true;
rangedAttack = true;
power_cost = 0;
skillname = "Magic Attack";
if ((_arg1 is PlayerCharacter)){
verbage = (("fires a bolt from " + PlayerCharacter(char_ref).genderPossessive()) + " staff");
} else {
verbage = "fires a staff bolt";
};
iconFrame = 32;
specialAnimation = PortraitAnimation.mageAttack;
}
override public function description():String{
return ((("Ranged magic attack with equipped weapon. Causes " + getDamage()) + " damage.\n\n[Skill cannot be removed]"));
}
}
}//package
Section 505
//sMageBolt (sMageBolt)
package {
public class sMageBolt extends Skill {
public function sMageBolt(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.intellect;
magicStrength = 1;
damage = getBaseMagicDamage(magicStrength);
rangedAttack = true;
power_cost = 25;
stun_percent = 25;
iconFrame = 37;
skillname = "Freeze";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.freeze;
}
override public function description():String{
return ((((("Ranged magic attack for " + getDamage()) + " damage. ") + stun_percent) + "% chance to stun the target."));
}
}
}//package
Section 506
//sMageDrain (sMageDrain)
package {
public class sMageDrain extends Skill {
public function sMageDrain(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
rangedAttack = true;
hitsAllEnemies = true;
damage = 0;
powerDamage = 20;
powerDrain = true;
power_cost = 50;
iconFrame = 54;
skillname = "Power Siphon";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.monsterDrain;
}
override public function description():String{
return ((("Drains up to " + powerDamage) + " power from each enemy."));
}
}
}//package
Section 507
//sMageExplosion (sMageExplosion)
package {
public class sMageExplosion extends Skill {
public function sMageExplosion(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.intellect;
aiTargetsBackRow = true;
magicStrength = 0.8;
damage = getBaseMagicDamage(magicStrength);
rangedAttack = true;
power_cost = 35;
splashDamageMultiplier = 0.7;
splashHitsAllies = true;
skillname = "Fireball";
verbage = ("casts " + skillname);
iconFrame = 55;
specialAnimation = PortraitAnimation.explosion;
}
override public function description():String{
return ((((("Ranged magic attack for " + getDamage()) + " damage. Characters (including allies) in adjacent squares take ") + Math.round((getDamage() * splashDamageMultiplier))) + " damage."));
}
}
}//package
Section 508
//sMageInvisibility (sMageInvisibility)
package {
public class sMageInvisibility extends Skill {
public function sMageInvisibility(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
aiCastLimit = 0;
damage = 0;
power_cost = 30;
targetsFriendlies = true;
rangedAttack = true;
hidesTarget = true;
iconFrame = 16;
skillname = "Invisibility";
verbage = ("casts " + skillname);
}
override public function description():String{
return ("Target may not be directly attacked until their next turn.");
}
}
}//package
Section 509
//sMagePrison (sMagePrison)
package {
public class sMagePrison extends Skill {
public function sMagePrison(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.intellect;
rangedAttack = true;
stun_percent = 100;
alwaysHits = true;
tempDamageResistance = 40;
magicStrength = 0.3;
damage = getBaseMagicDamage(magicStrength);
power_cost = 30;
skillname = "Cosmic Prison";
verbage = ("conjures a " + skillname);
iconFrame = 39;
suppressStunAnim = true;
specialAnimation = PortraitAnimation.cosmicPrison;
}
override public function description():String{
return ((((("Encase the target in an arcane prison, causing " + getDamage()) + " damage. The target is stunned, but gains ") + tempDamageResistance) + "% damage resistance until their next turn. Does not miss.\n\n(Note: If the stun effect is resisted, the damage resistance bonus still applies)"));
}
}
}//package
Section 510
//sMageSword (sMageSword)
package {
public class sMageSword extends Skill {
public function sMageSword(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
damage = 0;
power_cost = 75;
iconFrame = 4;
requiresMelee = true;
addWeaponDamage = true;
rangedAttack = true;
scaleWeaponDamage = 1;
attacksWithAccuracyMod = 0.75;
attacksMultipleTimes = 4;
skillname = "Ensorcelled Blade";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.playerMultiSlash;
}
override public function description():String{
return ((((((("Four ranged attacks with equipped melee weapon on any target. (" + getDamage()) + "x") + attacksMultipleTimes) + " damage)\nAttacks are made at ") + Math.round((attacksWithAccuracyMod * 100))) + "% of user's current accuracy."));
}
}
}//package
Section 511
//sMageThorns (sMageThorns)
package {
public class sMageThorns extends Skill {
public function sMageThorns(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
damage = 0;
power_cost = 25;
targetsFriendlies = true;
rangedAttack = true;
buff_damageReflect = 100;
iconFrame = 41;
skillname = "Flickering Flames";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.fireBuff;
}
override public function description():String{
return ((("Target reflects " + buff_damageReflect) + "% of damage taken back onto attacker for the remainder of the battle."));
}
}
}//package
Section 512
//sMageTouch (sMageTouch)
package {
public class sMageTouch extends Skill {
public function sMageTouch(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.intellect;
magicStrength = 1.35;
damage = getBaseMagicDamage(magicStrength);
rangedAttack = false;
power_cost = 25;
iconFrame = 35;
skillname = "Incinerate";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.fire;
}
override public function description():String{
return ((("Close range magic attack. Causes " + getDamage()) + " damage to a single target in melee range."));
}
}
}//package
Section 513
//Smash (Smash)
package {
import flash.media.*;
public dynamic class Smash extends Sound {
}
}//package
Section 514
//sMenuQuit (sMenuQuit)
package {
public class sMenuQuit extends Skill {
public function sMenuQuit(_arg1:Character){
increasesWith = none;
char_ref = _arg1;
iconFrame = 74;
skillname = "Quit Battle";
}
override public function description():String{
return ("End the current battle and return to the main menu.");
}
}
}//package
Section 515
//sMinotaurLabyrinth (sMinotaurLabyrinth)
package {
public class sMinotaurLabyrinth extends Skill {
public function sMinotaurLabyrinth(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 1;
aiPriority = 8;
damage = 0;
power_cost = 20;
rangedAttack = true;
hitsAllEnemies = true;
alwaysHits = true;
shufflesEnemies = true;
skillname = "Labyrinth";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.confuse;
}
}
}//package
Section 516
//smite_effect (smite_effect)
package {
import flash.display.*;
public dynamic class smite_effect extends MovieClip {
public function smite_effect(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.smite);
}
function frame45(){
this.stop();
}
}
}//package
Section 517
//sMonsterAttack (sMonsterAttack)
package {
public class sMonsterAttack extends Skill {
public function sMonsterAttack(_arg1:Character){
char_ref = _arg1;
damage = _arg1.damage;
power_cost = 0;
skillname = "Attack";
verbage = "attacks";
specialAnimation = PortraitAnimation.creatureSlash;
}
}
}//package
Section 518
//sMonsterAttackWeapon (sMonsterAttackWeapon)
package {
public class sMonsterAttackWeapon extends Skill {
public function sMonsterAttackWeapon(_arg1:Character){
char_ref = _arg1;
damage = _arg1.damage;
power_cost = 0;
skillname = "Attack";
verbage = "attacks";
specialAnimation = PortraitAnimation.creatureWeapon;
}
}
}//package
Section 519
//sMonsterCurse (sMonsterCurse)
package {
public class sMonsterCurse extends Skill {
public function sMonsterCurse(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 2;
rangedAttack = true;
damage = 0;
power_cost = 25;
curse = 0.5;
skillname = "Curse";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.curse;
}
}
}//package
Section 520
//sMonsterDoubleAttack (sMonsterDoubleAttack)
package {
public class sMonsterDoubleAttack extends Skill {
public function sMonsterDoubleAttack(_arg1:Character){
char_ref = _arg1;
damage = Math.round((_arg1.damage * 0.65));
power_cost = 25;
attacksTwoTargets = true;
skillname = "Double Attack";
verbage = "attacks savagely";
specialAnimation = PortraitAnimation.creatureWeapon;
}
}
}//package
Section 521
//sMonsterFlightAttack (sMonsterFlightAttack)
package {
public class sMonsterFlightAttack extends Skill {
public function sMonsterFlightAttack(_arg1:Character){
char_ref = _arg1;
rangedAttack = true;
damage = Math.round((_arg1.damage * 0.9));
power_cost = 30;
skillname = "Flying Attack";
verbage = "swoops down on the enemy";
specialAnimation = PortraitAnimation.swoopAttack;
}
}
}//package
Section 522
//sMonsterHeal (sMonsterHeal)
package {
public class sMonsterHeal extends Skill {
public function sMonsterHeal(_arg1:Character){
char_ref = _arg1;
targetsFriendlies = true;
rangedAttack = true;
healing = Math.round((_arg1.health_max * 0.6));
power_cost = 40;
removesPoison = true;
skillname = "Heal";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.heal;
}
override public function description():String{
return ((("Restore " + scaleHeal(healing)) + " health to one member of your party. Cures poison."));
}
}
}//package
Section 523
//sMonsterMagicAttack (sMonsterMagicAttack)
package {
public class sMonsterMagicAttack extends Skill {
public function sMonsterMagicAttack(_arg1:Character){
char_ref = _arg1;
rangedAttack = true;
damage = _arg1.damage;
power_cost = 0;
skillname = "Arcane Bolt";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.monsterMagic;
}
}
}//package
Section 524
//sMonsterMagicCold (sMonsterMagicCold)
package {
public class sMonsterMagicCold extends Skill {
public function sMonsterMagicCold(_arg1:Character){
char_ref = _arg1;
rangedAttack = true;
damage = _arg1.damage;
power_cost = 0;
skillname = "Deathly Chill";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.freeze;
}
}
}//package
Section 525
//sMonsterMeleeAE (sMonsterMeleeAE)
package {
public class sMonsterMeleeAE extends Skill {
public function sMonsterMeleeAE(_arg1:Character){
char_ref = _arg1;
damage = Math.round((_arg1.damage * 0.8));
power_cost = 55;
hitsAllMeleeRange = true;
skillname = "Hew";
verbage = "hews through the enemy";
specialAnimation = PortraitAnimation.creatureWeapon;
}
override public function description():String{
return ("");
}
}
}//package
Section 526
//sMonsterPierce (sMonsterPierce)
package {
public class sMonsterPierce extends Skill {
public function sMonsterPierce(_arg1:Character){
char_ref = _arg1;
damage = Math.round((char_ref.damage * 0.9));
power_cost = 40;
piercesColumn = true;
skillname = "Spear Lunge";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.creatureSpear;
}
override public function description():String{
return ("");
}
}
}//package
Section 527
//sMonsterRangedAttack (sMonsterRangedAttack)
package {
public class sMonsterRangedAttack extends Skill {
public function sMonsterRangedAttack(_arg1:Character){
char_ref = _arg1;
damage = Math.round((_arg1.damage * 1));
skillname = "Arrow";
rangedAttack = true;
power_cost = 20;
verbage = ("fires " + skillname);
specialAnimation = PortraitAnimation.monsterArrow;
}
}
}//package
Section 528
//sMonsterShadowStrike (sMonsterShadowStrike)
package {
public class sMonsterShadowStrike extends Skill {
public function sMonsterShadowStrike(_arg1:Character){
char_ref = _arg1;
rangedAttack = true;
damage = Math.round((_arg1.damage * 1.1));
power_cost = 60;
skillname = "Shadowstrike";
verbage = "strikes from the shadows";
specialAnimation = PortraitAnimation.creatureSlash;
}
}
}//package
Section 529
//sMonsterStoneForm (sMonsterStoneForm)
package {
public class sMonsterStoneForm extends Skill {
public function sMonsterStoneForm(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 1;
aiNotUnlessHurt = true;
targetsSelf = true;
cannotDie = 1;
healing = Math.round((0.5 * _arg1.health_max));
power_cost = 50;
skillname = "Stone Form";
verbage = ("enters " + skillname);
specialAnimation = PortraitAnimation.armorBuff;
}
}
}//package
Section 530
//SneakyScroll (SneakyScroll)
package {
public class SneakyScroll extends Consumable {
public function SneakyScroll(_arg1:int=1){
item_name = "Scroll of Deception";
sneaky = true;
item_rarity = Item.blue;
icon_frame = 84;
}
override public function getWorth():int{
return (Math.round((super.getWorth() * 1.5)));
}
}
}//package
Section 531
//sNecroDrain (sNecroDrain)
package {
public class sNecroDrain extends Skill {
public function sNecroDrain(_arg1:Character){
char_ref = _arg1;
aiNotUnlessHurt = true;
rangedAttack = true;
targetsFriendlies = true;
damage = _arg1.damage;
vampiric_percent = Math.round((200 + (level * 1.5)));
powerDamage = 50;
powerDrain = true;
power_cost = 10;
skillname = "Drain Minion";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.monsterDrain;
}
override public function description():String{
return ("");
}
}
}//package
Section 532
//sNecroSponge (sNecroSponge)
package {
public class sNecroSponge extends Skill {
public function sNecroSponge(_arg1:Character){
char_ref = _arg1;
damage = 0;
power_cost = 30;
targetsFriendlies = true;
rangedAttack = true;
targetsFriendlyFrontRow = true;
makeDamageSponge = true;
skillname = "Servitude";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.protectAllies;
}
override public function description():String{
return ("");
}
}
}//package
Section 533
//sOrcAxeThrow (sOrcAxeThrow)
package {
public class sOrcAxeThrow extends Skill {
public function sOrcAxeThrow(_arg1:Character){
char_ref = _arg1;
damage = Math.round((_arg1.damage * 1));
rangedAttack = true;
power_cost = 20;
skillname = "Axe";
verbage = ("throws " + skillname);
specialAnimation = PortraitAnimation.monsterThrown;
}
}
}//package
Section 534
//sOrcSponge (sOrcSponge)
package {
public class sOrcSponge extends Skill {
public function sOrcSponge(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 2;
damage = 0;
power_cost = 50;
targetsSelf = true;
makeDamageSponge = true;
skillname = "Challenge";
verbage = ("issues a " + skillname);
specialAnimation = PortraitAnimation.protectAllies;
}
override public function description():String{
return ("");
}
}
}//package
Section 535
//SoundButton (SoundButton)
package {
import flash.events.*;
import flash.display.*;
public class SoundButton extends MovieClip {
var sound_enabled:Boolean;// = true
public var control:VolumeControl;
public var sound_icon:MovieClip;
public function SoundButton(){
sound_enabled = true;
super();
this.addEventListener(MouseEvent.MOUSE_DOWN, clickedOn);
iconTest();
}
public function removeControl(_arg1:Boolean=false):void{
if (control == null){
return;
};
if (!(_arg1)){
iconTest();
};
if (stage.contains(control)){
removeEventListener(Event.ENTER_FRAME, controlMouseOut);
stage.removeChild(control);
control.cleanup();
control = null;
};
}
function clickedOn(_arg1:MouseEvent):void{
if (control != null){
return;
};
createControl();
}
private function soundOn(_arg1:Boolean=false):void{
sound_icon.gotoAndStop("on");
}
public function cleanup():void{
this.removeEventListener(MouseEvent.MOUSE_DOWN, clickedOn);
removeControl(true);
}
private function createControl():void{
if (control != null){
removeControl();
};
control = new VolumeControl(this);
control.y = (this.y - (control.height - this.height));
control.x = this.x;
addEventListener(Event.ENTER_FRAME, controlMouseOut);
stage.addChild(control);
}
private function iconTest():void{
this.sound_enabled = (GlobalVolume.volumeSetting > 0);
if (sound_enabled){
soundOn();
} else {
soundOff();
};
}
private function soundOff(_arg1:Boolean=false):void{
sound_icon.gotoAndStop("off");
}
function controlMouseOut(_arg1:Event):void{
var _local2:Boolean;
_local2 = false;
if ((((control.mouseX > control.width)) || ((control.mouseX < 0)))){
_local2 = true;
};
if ((((control.mouseY > control.height)) || ((control.mouseY < 0)))){
_local2 = true;
};
if (_local2){
removeControl();
};
}
}
}//package
Section 536
//SoundControl (SoundControl)
package {
import flash.media.*;
import flash.events.*;
public class SoundControl {
var channels:Array;
static const smite = 54;
static const poisonDrake = 81;
static const poison = 75;
static const cosmicPrison = 74;
static const monsterMagicAttack = 61;
static const playerSlash = 64;
static const destroyItem = 20;
static const armorBuff = 90;
static const punch = 67;
static const monsterClaws = 66;
static const potionSound = 15;
static const equipMace = 5;
static const thrown = 69;
static const monsterArrow = 63;
static const buff = 58;
static const debuff = 77;
static const blind = 78;
static const web = 80;
static const clone = 99;
static const disintegrate = 68;
static const miss_ranged = 111;
static const miss_melee = 110;
static const equipBow = 7;
static const powerUp = 56;
static const equipGeneric = 1;
static const equipSpear = 6;
static const battleStart = 40;
static const equipStaff = 10;
static const curse = 76;
static const freeze = 52;
static const flames = 53;
static const playerArrow = 62;
static const equipSword = 2;
static const miss_magic = 113;
static const pageTurn = 42;
static const equipShield = 9;
static const equipAxe = 3;
static const playerMagicAttack = 60;
static const lightning = 51;
static const monsterSlash = 65;
static const writing = 41;
static const equipDagger = 4;
static const lootItem = 21;
static const heal = 57;
static const basilisk = 82;
static const miss_thrown = 112;
static const hideSound = 16;
static const summon = 100;
static const equipCrossbow = 8;
static const whirlwind = 73;
static var volumeSetting = GlobalVolume.volumeFull;
public function SoundControl():void{
channels = new Array();
}
public function playSoundForSkill(_arg1:Skill, _arg2:Character):void{
var _local3:int;
if ((((_arg1 == null)) || ((_arg2 == null)))){
return;
};
_local3 = getSoundForSkill(_arg1, _arg2);
if (_local3){
this.play(_local3);
};
}
function finishedSound(_arg1:Event):void{
var _local2:int;
_local2 = (channels.length - 1);
while (_local2 >= 0) {
if (channels[_local2] == null){
} else {
if (channels[_local2].channel == _arg1.target){
channels[_local2].channel.removeEventListener(Event.SOUND_COMPLETE, finishedSound);
channels.splice(_local2, 1);
};
};
_local2--;
};
}
public function getSoundForSkill(_arg1:Skill, _arg2:Character):int{
if (_arg1 == null){
return (0);
};
if (_arg1.hidesTarget){
return (hideSound);
};
if (_arg1.curse){
return (curse);
};
if (_arg1.unarmedAttack){
return (punch);
};
if ((_arg1 is sBasiliskPetrify)){
return (basilisk);
};
if ((_arg1 is sPoisonDrakeAE)){
return (poisonDrake);
};
if ((_arg1 is sPoisonDrakeShot)){
return (poisonDrake);
};
if ((_arg1 is sConjurorWhirlwind)){
return (whirlwind);
};
return (0);
}
public function getMissSound(_arg1:Skill, _arg2:Character):int{
var sound_id:int;
var anim:int;
var w:*;
var err_txt:*;
var err_dlg:ErrorDialog;
var sk = _arg1;
var user = _arg2;
sound_id = -1;
try {
if (sk.hidesTarget){
var _local4:* = hideSound;
//unresolved jump
0;
return (_local4);
};
anim = sk.specialAnimation;
if ((((user is PlayerCharacter)) && (sk.showWeaponAnimation))){
w = PlayerCharacter(user).gear[Equipment.weapon];
if (w != null){
if ((w is MeleeWeapon)){
anim = PortraitAnimation.playerSlash;
} else {
if ((w is MageWeapon)){
anim = PortraitAnimation.mageAttack;
} else {
if ((w is RangedWeapon)){
anim = PortraitAnimation.playerArrow;
};
};
};
};
};
if (sk.unarmedAttack){
anim = PortraitAnimation.playerSlash;
};
switch (anim){
case PortraitAnimation.creatureSlash:
case PortraitAnimation.creatureSpear:
case PortraitAnimation.creatureWeapon:
case PortraitAnimation.playerSlash:
case PortraitAnimation.playerMultiSlash:
case PortraitAnimation.playerPowerSlash:
sound_id = miss_melee;
break;
case PortraitAnimation.monsterThrown:
sound_id = miss_thrown;
break;
case PortraitAnimation.playerArrow:
case PortraitAnimation.monsterArrow:
case PortraitAnimation.cultistArrow:
sound_id = miss_ranged;
break;
};
if (sound_id == -1){
sound_id = miss_magic;
};
} catch(error:Error) {
if (DungeonMain.KONGREGATE){
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (("Miss Sound Error: " + error.name) + "\n"));
err_txt = (err_txt + (("id: " + sound_id) + "\n"));
err_txt = (err_txt + (("sk: " + String(sk.skillname)) + "\n"));
err_txt = (err_txt + (("user: " + String(user.charname)) + "\n"));
err_txt = (err_txt + ((("[" + error.errorID) + "] ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
};
} finally {
var _local6:* = sound_id;
//unresolved jump
2;
return (_local6);
};
}
private function idCheck(_arg1:int):Boolean{
var _local2:SoundEffect;
if (_arg1 == playerSlash){
return (true);
};
if (_arg1 == monsterSlash){
return (true);
};
if (_arg1 == playerArrow){
return (true);
};
if (_arg1 == monsterArrow){
return (true);
};
for each (_local2 in channels) {
if (_local2 == null){
} else {
if (_local2.id == _arg1){
if (((!((_local2.channel == null))) && ((_local2.channel.position < 0.5)))){
return (false);
};
};
};
};
return (true);
}
public function play(_arg1:int, _arg2:Number=1, _arg3:Boolean=false):void{
var _local4:Sound;
if (_arg1){
_local4 = soundFromConstant(_arg1);
playSound(_local4, _arg2, _arg1, _arg3);
};
}
public function playSound(_arg1:Sound, _arg2:Number=1, _arg3:int=-1, _arg4:Boolean=false):void{
var channel:SoundChannel;
var effect:*;
var err_txt:*;
var err_dlg:ErrorDialog;
var fx = _arg1;
var vol = _arg2;
var id = _arg3;
var overrideLimits = _arg4;
if (fx == null){
return;
};
try {
if (((!(overrideLimits)) && (!(idCheck(id))))){
return;
};
vol = (vol * volumeSetting);
channel = fx.play(0, 1);
if (channel != null){
channel.soundTransform = new SoundTransform(vol);
channel.addEventListener(Event.SOUND_COMPLETE, finishedSound);
effect = new SoundEffect(channel, id);
channels.push(effect);
};
} catch(error:Error) {
if (DungeonMain.KONGREGATE){
err_txt = "An error has occurred. Please submit a bug report with the following information:";
err_txt = (err_txt + "\n\n");
err_txt = (err_txt + (("Play Sound Error: " + error.name) + "\n"));
err_txt = (err_txt + (("id: " + id) + "\n"));
err_txt = (err_txt + (("fx: " + String(fx)) + "\n"));
err_txt = (err_txt + ((("[" + error.errorID) + "] ") + error.getStackTrace()));
err_dlg = new ErrorDialog("Error!", err_txt);
dm.stage.addChild(err_dlg);
};
};
}
public function soundFromConstant(_arg1:int):Sound{
var _local2:Sound;
switch (_arg1){
case equipGeneric:
_local2 = new equip_sound();
break;
case equipStaff:
_local2 = new equip_staff_sound();
break;
case equipSword:
case equipDagger:
case equipMace:
case equipAxe:
case equipSpear:
_local2 = new equip_sword_sound();
break;
case equipBow:
case equipCrossbow:
_local2 = new equip_bow_sound();
break;
case equipShield:
_local2 = new equip_shield_sound();
break;
case whirlwind:
_local2 = new whirlwind_sound();
break;
case pageTurn:
_local2 = new turn_page_sound();
break;
case potionSound:
_local2 = new potion_sound();
break;
case hideSound:
_local2 = new hide3_sound();
break;
case destroyItem:
_local2 = new destroy_item_sound();
break;
case lootItem:
_local2 = new coins_sound();
break;
case battleStart:
_local2 = new battle_start2();
break;
case writing:
_local2 = new writing_sound();
break;
case lightning:
_local2 = new lightning_sound();
break;
case freeze:
_local2 = new freeze_sound();
break;
case poison:
_local2 = new poison_sound();
break;
case flames:
_local2 = new flames_sound();
break;
case curse:
_local2 = new curse_sound();
break;
case blind:
_local2 = new blind_sound();
break;
case armorBuff:
_local2 = new armor_buff_sound();
break;
case punch:
_local2 = new punch_sound();
break;
case playerMagicAttack:
_local2 = new mage_staff_sound();
break;
case monsterMagicAttack:
_local2 = new monster_magic_sound();
break;
case powerUp:
_local2 = new power_up_sound();
break;
case playerArrow:
case monsterArrow:
_local2 = new arrow_fire_sound();
break;
case smite:
_local2 = new summon1_sound();
break;
case clone:
case summon:
_local2 = new summon2_sound();
break;
case web:
_local2 = new web_squirt_sound();
break;
case playerSlash:
case monsterSlash:
_local2 = new slash1_sound();
break;
case monsterClaws:
_local2 = new creature_slash_sound();
break;
case heal:
_local2 = new heal1_sound();
break;
case buff:
_local2 = new buff_chant_sound();
break;
case debuff:
_local2 = new debuff_sound();
break;
case cosmicPrison:
_local2 = new cosmic_prison_sound();
break;
case disintegrate:
_local2 = new disintegrate_sound();
break;
case thrown:
_local2 = new thrown_sound();
break;
case basilisk:
_local2 = new basilisk_sound();
break;
case poisonDrake:
_local2 = new poison_drake_sound();
break;
case miss_melee:
_local2 = new miss_melee_sound();
break;
case miss_ranged:
_local2 = new miss_ranged_sound();
break;
case miss_thrown:
_local2 = new miss_thrown_sound();
break;
case miss_magic:
_local2 = new miss_magic_sound();
break;
};
return (_local2);
}
public function playMissSound(_arg1:Skill, _arg2:Character, _arg3:Boolean=false):void{
var _local4:int;
if ((((_arg1 == null)) || ((_arg2 == null)))){
return;
};
_local4 = getMissSound(_arg1, _arg2);
if (_local4){
this.play(_local4, 1, _arg3);
};
}
}
}//package
Section 537
//SoundEffect (SoundEffect)
package {
import flash.media.*;
public class SoundEffect {
public var channel:SoundChannel;
public var id:int;
public function SoundEffect(_arg1:SoundChannel, _arg2:int):void{
this.channel = _arg1;
this.id = _arg2;
}
}
}//package
Section 538
//sPassTurn (sPassTurn)
package {
public class sPassTurn extends Skill {
public function sPassTurn(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
iconFrame = 24;
skillname = "Pass Turn";
}
override public function description():String{
return ("This character takes no action this turn. Power regeneration rate is increased for this round.\n\n[Shortcut: space bar]");
}
}
}//package
Section 539
//SpecialEncounterIcon (SpecialEncounterIcon)
package {
import flash.display.*;
public dynamic class SpecialEncounterIcon extends MovieClip {
}
}//package
Section 540
//SpecialShrine (SpecialShrine)
package {
import flash.utils.*;
import flash.events.*;
import flash.display.*;
public class SpecialShrine extends MovieClip {
private var _type:int;// = 2
var used:Boolean;
var room:DungeonRoom;
public static const EQUIPMENT_BUFF = 2;
public static const ENCHANTMENT = 4;
public static const POTION_BUFF = 3;
public function SpecialShrine(_arg1:int=-1){
_type = 2;
super();
addFrameScript(0, frame1);
used = false;
this.gotoAndStop(1);
if ((((_arg1 >= EQUIPMENT_BUFF)) && ((_arg1 <= ENCHANTMENT)))){
_type = _arg1;
} else {
_type = dmf.randomNum(EQUIPMENT_BUFF, ENCHANTMENT);
};
}
function onFadeComplete(_arg1:TimerEvent):void{
if (parent != null){
parent.removeChild(this);
};
}
function frame1(){
this.gotoAndStop(1);
}
public function fade():void{
var _local1:Timer;
used = true;
this.gotoAndPlay(2);
_local1 = new Timer(500, 1);
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, onFadeComplete);
_local1.start();
}
public function get type():int{
return (_type);
}
}
}//package
Section 541
//SpeechBubble (SpeechBubble)
package {
import flash.events.*;
import flash.text.*;
import flash.utils.*;
import flash.display.*;
public class SpeechBubble extends MovieClip {
private const FADE_FRAMES = 10;
public var dialogue:TextField;
private var fadingIn:Boolean;// = false
public var bg:Sprite;
private var timer:Timer;
private var fadingOut:Boolean;// = false
public function SpeechBubble(_arg1:String=""):void{
fadingIn = false;
fadingOut = false;
super();
setText(_arg1);
this.alpha = 0;
addEventListener(Event.ADDED, added);
addEventListener(Event.ENTER_FRAME, enter_frame);
addEventListener(MouseEvent.MOUSE_OVER, mouse_over);
}
public function added(_arg1:Event):void{
removeEventListener(Event.ADDED, added);
fadingIn = true;
timer = new Timer(6000, 1);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, timerComplete);
timer.start();
}
private function mouse_over(_arg1:MouseEvent):void{
if (((fadingIn) || (fadingOut))){
return;
};
fade();
}
public function enter_frame(_arg1:Event):void{
var _local2:Number;
if (fadingIn){
_local2 = (this.alpha + (1 / FADE_FRAMES));
this.alpha = Math.min(_local2, 1);
if (this.alpha == 1){
fadingIn = false;
removeEventListener(Event.ENTER_FRAME, enter_frame);
};
} else {
if (fadingOut){
_local2 = (this.alpha - (1 / FADE_FRAMES));
this.alpha = Math.max(_local2, 0);
this.y = (this.y + 20);
if (this.alpha == 0){
fadingOut = false;
removeEventListener(Event.ENTER_FRAME, enter_frame);
removeEventListener(MouseEvent.MOUSE_OVER, mouse_over);
if (parent != null){
parent.removeChild(this);
};
};
};
};
}
public function fade():void{
timer.removeEventListener(TimerEvent.TIMER_COMPLETE, timerComplete);
fadingIn = false;
fadingOut = true;
addEventListener(Event.ENTER_FRAME, enter_frame);
}
function timerComplete(_arg1:TimerEvent):void{
fade();
}
public function setText(_arg1:String):void{
dialogue.autoSize = TextFieldAutoSize.CENTER;
dialogue.text = _arg1;
dm.embolden(dialogue);
bg.height = (dialogue.height + 13);
}
}
}//package
Section 542
//sPoisonDrakeAE (sPoisonDrakeAE)
package {
public class sPoisonDrakeAE extends Skill {
public function sPoisonDrakeAE(_arg1:Character){
char_ref = _arg1;
skillname = "Venomous Cloud";
hitsAllMeleeRange = true;
power_cost = 55;
damage = Math.round((_arg1.damage * 0.5));
poisonDamage = Math.round((_arg1.damage * 0.5));
damageAccuracy = 25;
verbage = ("sprays a " + skillname);
specialAnimation = PortraitAnimation.poison;
}
}
}//package
Section 543
//sPoisonDrakeShot (sPoisonDrakeShot)
package {
public class sPoisonDrakeShot extends Skill {
public function sPoisonDrakeShot(_arg1:Character){
char_ref = _arg1;
rangedAttack = true;
power_cost = 30;
damage = Math.round((_arg1.damage * 0.7));
poisonDamage = Math.round((_arg1.damage * 0.5));
skillname = "Venom";
verbage = ("spits " + skillname);
specialAnimation = PortraitAnimation.poison;
}
}
}//package
Section 544
//sRangedAttack (sRangedAttack)
package {
public class sRangedAttack extends Skill {
public function sRangedAttack(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
unlocked = true;
damage = 0;
power_cost = 0;
addWeaponDamage = true;
rangedAttack = true;
requiresRanged = true;
iconFrame = 15;
skillname = "Ranged Attack";
verbage = "shoots";
specialAnimation = PortraitAnimation.playerArrow;
}
override public function description():String{
return ((("Ranged attack with equipped weapon. Causes " + getDamage()) + " damage.\n\n[Skill cannot be removed]"));
}
}
}//package
Section 545
//sRangerAE (sRangerAE)
package {
public class sRangerAE extends Skill {
public function sRangerAE(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
aiCastLimit = 0;
damage = 0;
power_cost = 60;
rangedAttack = true;
requiresRanged = true;
hitsAllEnemies = true;
addWeaponDamage = true;
scaleWeaponDamage = 0.5;
attacksMultipleTimes = 2;
attacksWithAccuracyMod = 0.7;
iconFrame = 29;
skillname = "Hail of Arrows";
verbage = "unleashes a hail of arrows";
specialAnimation = PortraitAnimation.playerArrow;
}
override public function description():String{
return ((((((("Perform two ranged attacks for " + Math.round((scaleWeaponDamage * 100))) + "% weapon damage each (") + getDamage()) + " damage) on every enemy. Attacks are made at ") + Math.round((attacksWithAccuracyMod * 100))) + "% of user's current accuracy."));
}
}
}//package
Section 546
//sRangerFocus (sRangerFocus)
package {
public class sRangerFocus extends Skill {
public function sRangerFocus(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
targetsSelf = true;
power_cost = 0;
powerRestore = 25;
iconFrame = 46;
skillname = "Focus";
verbage = "finds inner focus";
specialAnimation = PortraitAnimation.gainPower;
}
override public function description():String{
return ((("Recover " + powerRestore) + " power."));
}
}
}//package
Section 547
//sRangerHaste (sRangerHaste)
package {
public class sRangerHaste extends Skill {
public function sRangerHaste(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
aiCastLimit = 1;
targetsFriendlies = true;
hitsAllFriendlies = true;
rangedAttack = true;
alwaysHits = true;
buff_quickness = 20;
power_cost = 30;
iconFrame = 57;
skillname = "Swiftness";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.quicknessBuff;
}
override public function description():String{
return ((("All members of the party gain +" + buff_quickness) + " to Quickness for the remainder of the battle."));
}
}
}//package
Section 548
//sRangerHeal (sRangerHeal)
package {
public class sRangerHeal extends Skill {
public function sRangerHeal(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.intellect;
nonCombat = true;
targetsFriendlies = true;
rangedAttack = true;
removesPoison = true;
healing = 20;
power_cost = 30;
iconFrame = 9;
skillname = "Healing Lore";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.heal;
}
override public function description():String{
return ((("Restore " + scaleHeal(healing)) + " health to one member of your party. Cures poison."));
}
}
}//package
Section 549
//sRangerHunt (sRangerHunt)
package {
public class sRangerHunt extends Skill {
public function sRangerHunt(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.weapon;
addWeaponDamage = true;
usesWeaponRange = true;
requiresWeapon = true;
damage = 0;
scaleWeaponDamage = 1.1;
damageBonusVsCreatureType = MonsterCharacter.creature;
damageBonusVsCreatureModifier = 2;
lethality = 10;
power_cost = 30;
iconFrame = 34;
skillname = "Hunter's Prowess";
verbage = ("uses " + skillname);
showWeaponAnimation = true;
}
override public function description():String{
return ((("Weapon attack for slightly increased (" + getDamage()) + ") damage, with +10% chance to kill target outright. Deals double damage to deep creatures."));
}
}
}//package
Section 550
//sRangerMultiMelee (sRangerMultiMelee)
package {
public class sRangerMultiMelee extends Skill {
public function sRangerMultiMelee(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.weapon;
damage = 0;
power_cost = 55;
iconFrame = 4;
requiresMelee = true;
addWeaponDamage = true;
scaleWeaponDamage = 1;
attacksMultipleTimes = 3;
attacksWithAccuracyMod = 0.6;
ignoresArmor = true;
skillname = "Force of Nature";
verbage = ("is a " + skillname);
specialAnimation = PortraitAnimation.playerMultiSlash;
}
override public function description():String{
return ((((((("Three melee weapon attacks on a single target at " + Math.round((attacksWithAccuracyMod * 100))) + "% of user's current accuracy. (") + getDamage()) + "x") + attacksMultipleTimes) + " damage.) Ignores armor."));
}
}
}//package
Section 551
//sRangerPenetrate (sRangerPenetrate)
package {
public class sRangerPenetrate extends Skill {
public function sRangerPenetrate(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.weapon;
damage = 0;
power_cost = 30;
scaleWeaponDamage = 1;
addWeaponDamage = true;
rangedAttack = true;
requiresRanged = true;
piercesColumn = true;
iconFrame = 33;
skillname = "Pierce";
verbage = "fires a piercing shot";
showWeaponAnimation = true;
}
override public function description():String{
return ((((("Ranged attack for " + (scaleWeaponDamage * 100)) + "% weapon damage (") + getDamage()) + "). Hits up to two targets in a vertical line."));
}
}
}//package
Section 552
//sRangerPoison (sRangerPoison)
package {
public class sRangerPoison extends Skill {
public function sRangerPoison(_arg1:Character){
char_ref = _arg1;
increasesWith = intellect;
increaseRate = 0.7;
damage = 0;
power_cost = 30;
poisonDamage = 4;
requiresRanged = true;
addWeaponDamage = true;
rangedAttack = true;
iconFrame = 3;
skillname = "Envenomed Arrow";
verbage = ("fires an " + skillname);
showWeaponAnimation = true;
specialAnimation = PortraitAnimation.poison;
}
override public function description():String{
return ((((("Ranged weapon attack (" + getDamage()) + " damage). Applies ") + scalePoison()) + " poison damage."));
}
}
}//package
Section 553
//sRangerRegen (sRangerRegen)
package {
public class sRangerRegen extends Skill {
public function sRangerRegen(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.intellect;
targetsFriendlies = true;
rangedAttack = true;
removesPoison = true;
buff_resistPoison = 100;
buff_healthRegen = 10;
power_cost = 35;
iconFrame = 50;
skillname = "Nature's Balm";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.regenBuff;
}
override public function description():String{
return ((("Grant target immunity to poison and +" + scaleHeal(buff_healthRegen)) + " health regeneration per turn for the remainder of the battle."));
}
}
}//package
Section 554
//sRangerStun (sRangerStun)
package {
public class sRangerStun extends Skill {
public function sRangerStun(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
rangedAttack = true;
requiresRanged = true;
damage = 0;
addWeaponDamage = true;
scaleWeaponDamage = 0.75;
stun_percent = 100;
power_cost = 40;
iconFrame = 30;
skillname = "Pin";
verbage = "pins the enemy";
showWeaponAnimation = true;
}
override public function description():String{
return ((((("Ranged attack for " + (scaleWeaponDamage * 100)) + "% weapon damage (") + getDamage()) + ") which stuns the target."));
}
}
}//package
Section 555
//sRetreat (sRetreat)
package {
public class sRetreat extends Skill {
public function sRetreat(_arg1:Character){
increasesWith = none;
char_ref = _arg1;
iconFrame = 23;
skillname = "Retreat";
}
override public function description():String{
return ("Retreat this character from the battle. Takes one full turn.\n\n[Shortcut: r]");
}
}
}//package
Section 556
//sRetreatAll (sRetreatAll)
package {
public class sRetreatAll extends Skill {
public function sRetreatAll(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
iconFrame = 25;
skillname = "Full Retreat";
}
override public function description():String{
return ("Retreat all characters from the battle. Takes one full turn.");
}
}
}//package
Section 557
//sRogueBlind (sRogueBlind)
package {
public class sRogueBlind extends Skill {
public function sRogueBlind(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
damage = 0;
power_cost = 40;
damageAccuracy = 50;
stun_percent = 50;
alwaysHits = true;
iconFrame = 11;
skillname = "Flash Powder";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.blind;
}
override public function description():String{
return ((((("Reduce target in melee range's accuracy by " + damageAccuracy) + "% for the remainder of the battle. ") + stun_percent) + "% chance to cause stun. Does not miss."));
}
}
}//package
Section 558
//sRogueCripple (sRogueCripple)
package {
public class sRogueCripple extends Skill {
public function sRogueCripple(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
damage = 0;
power_cost = 25;
crippling = 100;
iconFrame = 53;
addWeaponDamage = true;
usesWeaponRange = true;
requiresWeapon = true;
nonLethal = true;
scaleWeaponDamage = 0.5;
skillname = "Cripple";
verbage = "launches a crippling attack";
showWeaponAnimation = true;
specialAnimation = PortraitAnimation.debuff;
}
override public function description():String{
return ((((("Special weapon attack for a maximum of " + (scaleWeaponDamage * 100)) + "% weapon damage (") + getDamage()) + "). This attack will not kill the target. If the attack hits, it reduces the target's Quickness to zero for the remainder of the battle, forcing them to act last in the turn order."));
}
}
}//package
Section 559
//sRogueCritical (sRogueCritical)
package {
public class sRogueCritical extends Skill {
public function sRogueCritical(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
damage = 0;
power_cost = 30;
addWeaponDamage = true;
usesWeaponRange = true;
requiresWeapon = true;
ignoresArmor = true;
scaleWeaponDamage = 1.1;
iconFrame = 12;
skillname = "Pierce Defenses";
verbage = "finds a weak spot";
showWeaponAnimation = true;
}
override public function description():String{
return ((((("Weapon attack for " + Math.round((scaleWeaponDamage * 100))) + "% weapon damage (") + getDamage()) + "). Ignores target's armor."));
}
}
}//package
Section 560
//sRogueFinisher (sRogueFinisher)
package {
public class sRogueFinisher extends Skill {
public function sRogueFinisher(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
damage = 1;
requiresWeapon = true;
targetsStunned = true;
usesWeaponRange = true;
lethality = 100;
power_cost = 30;
iconFrame = 14;
skillname = "Coup de Grâce";
verbage = ("delivers the " + skillname);
showWeaponAnimation = true;
}
override public function description():String{
return ("Instantly kill a stunned enemy. Target must be in weapon range.");
}
}
}//package
Section 561
//sRogueHide (sRogueHide)
package {
public class sRogueHide extends Skill {
public function sRogueHide(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
aiCastLimit = 0;
damage = 0;
power_cost = 20;
targetsSelf = true;
hidesTarget = true;
targetDamageMod = 2;
iconFrame = 16;
skillname = "Hide";
verbage = "hides";
}
override public function description():String{
return ((((("User may not be target of attacks until " + char_ref.genderPossessive()) + " next turn.\n\nIn addition, user will inflict ") + Math.round((targetDamageMod * 100))) + "% of normal damage on their next attack."));
}
}
}//package
Section 562
//sRogueLuck (sRogueLuck)
package {
public class sRogueLuck extends Skill {
public function sRogueLuck(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
targetsFriendlies = true;
hitsAllFriendlies = true;
rangedAttack = true;
alwaysHits = true;
buff_accuracy = 30;
power_cost = 20;
iconFrame = 22;
skillname = "Thief's Luck";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.buff;
}
override public function description():String{
return ((("All members of the party gain +" + buff_accuracy) + " to accuracy for the remainder of the battle."));
}
}
}//package
Section 563
//sRogueOpening (sRogueOpening)
package {
public class sRogueOpening extends Skill {
public function sRogueOpening(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
aiCastLimit = 0;
damage = 0;
power_cost = 40;
iconFrame = 51;
requiresMelee = true;
addWeaponDamage = true;
scaleWeaponDamage = 0.75;
allyBonusAttack = true;
skillname = "Create Opening";
verbage = "creates an opening";
showWeaponAnimation = true;
}
override public function description():String{
return ((("Melee attack for 75% weapon damage (" + getDamage()) + "). If it hits, a random ally performs a bonus weapon attack on the target."));
}
}
}//package
Section 564
//sRoguePoison (sRoguePoison)
package {
public class sRoguePoison extends Skill {
public function sRoguePoison(_arg1:Character){
char_ref = _arg1;
increasesWith = intellect;
increaseRate = 0.7;
damage = 0;
power_cost = 20;
poisonDamage = 4;
iconFrame = 3;
requiresWeapon = true;
addWeaponDamage = true;
usesWeaponRange = true;
skillname = "Poison";
verbage = ("applies " + skillname);
showWeaponAnimation = true;
}
override public function description():String{
return ((((("Weapon attack (" + getDamage()) + " damage). Applies ") + scalePoison()) + " poison damage."));
}
}
}//package
Section 565
//sRogueSap (sRogueSap)
package {
public class sRogueSap extends Skill {
public function sRogueSap(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
damage = 0;
power_cost = 40;
addWeaponDamage = true;
requiresMelee = true;
scaleWeaponDamage = 0.5;
powerDamage = 75;
iconFrame = 52;
skillname = "Sap Strength";
verbage = "saps the enemy's strength";
showWeaponAnimation = true;
specialAnimation = PortraitAnimation.powerDrain;
}
override public function description():String{
return ((((((("Melee attack for " + (scaleWeaponDamage * 100)) + "% weapon damage (") + getDamage()) + "). Reduces enemy power by ") + powerDamage) + "."));
}
}
}//package
Section 566
//sRogueSneakAttack (sRogueSneakAttack)
package {
public class sRogueSneakAttack extends Skill {
public function sRogueSneakAttack(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
damage = 0;
power_cost = 30;
iconFrame = 8;
requiresMelee = true;
addWeaponDamage = true;
rangedAttack = true;
scaleWeaponDamage = 1.2;
skillname = "Sneak Attack";
verbage = ("performs a " + skillname);
specialAnimation = PortraitAnimation.playerSlash;
}
override public function description():String{
return ((((("Melee weapon attack on any target for " + (scaleWeaponDamage * 100)) + "% weapon damage (") + getDamage()) + ")."));
}
}
}//package
Section 567
//sRuneProtection (sRuneProtection)
package {
public class sRuneProtection extends Skill {
public function sRuneProtection(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
aiCastLimit = 1;
damage = 0;
power_cost = 40;
targetsFriendlies = true;
hitsAllFriendlies = true;
buff_damageResist = 15;
skillname = "Rune of Protection";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.runeProtection;
}
override public function description():String{
return ((("Caster gains an additional " + buff_damageResist) + "% damage resistance for the remainder of the battle."));
}
}
}//package
Section 568
//sRuneStrength (sRuneStrength)
package {
public class sRuneStrength extends Skill {
public function sRuneStrength(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
aiPriority = 5;
aiCastLimit = 1;
damage = 0;
power_cost = 40;
targetsFriendlies = true;
hitsAllFriendlies = true;
buff_damage = 1.2;
skillname = "Rune of Strength";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.runeStrength;
}
override public function description():String{
return ((("Caster gains an additional " + buff_damageResist) + "% damage resistance for the remainder of the battle."));
}
}
}//package
Section 569
//sShadowCure (sShadowCure)
package {
public class sShadowCure extends Skill {
public function sShadowCure(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
aiCastLimit = 0;
targetsFriendlies = true;
removesCurse = true;
killsUser = true;
alwaysHits = true;
rangedAttack = true;
damage = 0;
power_cost = 100;
iconFrame = 75;
skillname = "Balance Karma";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.curse;
}
override public function description():String{
return ("Sacrifice this shadow to remove a curse from a friendly target.");
}
}
}//package
Section 570
//sShadowCurse (sShadowCurse)
package {
public class sShadowCurse extends Skill {
public function sShadowCurse(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
aiCastLimit = 0;
killsUser = true;
alwaysHits = true;
rangedAttack = true;
damage = 0;
power_cost = 100;
curse = 0.5;
iconFrame = 14;
skillname = "Hex";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.curse;
}
override public function description():String{
return ((("Sacrifice this shadow to place a curse(" + Math.round((curse * 100))) + "%) on an enemy target. Does not miss."));
}
}
}//package
Section 571
//sSpriteRestoreHealth (sSpriteRestoreHealth)
package {
public class sSpriteRestoreHealth extends Skill {
public function sSpriteRestoreHealth(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.level;
targetsFriendlies = true;
hitsAllFriendlies = true;
rangedAttack = true;
power_cost = 50;
removesPoison = false;
healing = Math.round((_arg1.health_max / 3));
iconFrame = 10;
skillname = "Bloodfont";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.heal;
}
override public function description():String{
return ((("Restore " + healing) + " health to each member of the party."));
}
}
}//package
Section 572
//sSpriteRestorePower (sSpriteRestorePower)
package {
public class sSpriteRestorePower extends Skill {
public function sSpriteRestorePower(_arg1:Character){
char_ref = _arg1;
increasesWith = Skill.none;
targetsFriendlies = true;
hitsAllFriendlies = true;
doesNotEffectSelf = true;
rangedAttack = true;
power_cost = 50;
powerRestore = 15;
iconFrame = 46;
skillname = "Manafont";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.gainPower;
}
override public function description():String{
return ((("Restore " + powerRestore) + " power to every other member of the party."));
}
}
}//package
Section 573
//sSummonAttack (sSummonAttack)
package {
public class sSummonAttack extends Skill {
public function sSummonAttack(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
active = true;
damage = _arg1.damage;
power_cost = 0;
skillname = "Attack";
verbage = "attacks";
iconFrame = 17;
specialAnimation = PortraitAnimation.summonSlash;
}
override public function description():String{
return ((("Melee attack for " + getDamage()) + " damage."));
}
}
}//package
Section 574
//sSummonVoidstalker (sSummonVoidstalker)
package {
public class sSummonVoidstalker extends Skill {
public function sSummonVoidstalker(_arg1:Character){
char_ref = _arg1;
aiPriority = 9;
targetsEmpty = true;
summonsCreatureClass = new mVoidstalker(char_ref.level);
power_cost = 60;
skillname = "Void Portal";
verbage = ("casts " + skillname);
}
}
}//package
Section 575
//StairsGlow (StairsGlow)
package {
import flash.display.*;
public dynamic class StairsGlow extends MovieClip {
}
}//package
Section 576
//StatIncreaseButton (StatIncreaseButton)
package {
import flash.events.*;
import flash.display.*;
public class StatIncreaseButton extends MovieClip {
public function StatIncreaseButton(){
addEventListener(MouseEvent.MOUSE_OVER, mouseOverTarget);
addEventListener(MouseEvent.MOUSE_OUT, mouseOutTarget);
this.gotoAndStop(2);
}
function mouseOverTarget(_arg1:MouseEvent):void{
if (this.currentFrame == 1){
this.gotoAndStop(3);
};
}
function mouseOutTarget(_arg1:MouseEvent):void{
if (this.currentFrame == 3){
this.gotoAndStop(1);
};
}
public function cleanup():void{
removeEventListener(MouseEvent.MOUSE_OVER, mouseOverTarget);
removeEventListener(MouseEvent.MOUSE_OUT, mouseOutTarget);
}
}
}//package
Section 577
//StatNumber (StatNumber)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class StatNumber extends Sprite {
var tooltip:MiscTooltip;
private var mousingOver:Boolean;// = false
private var mouseOverFrames:int;// = 0
public var nlabel:TextField;
private var mousedOverEvent:MouseEvent;
var tt_text:String;
var tt_title:String;
public function StatNumber(){
mousingOver = false;
mouseOverFrames = 0;
super();
nlabel.addEventListener(MouseEvent.MOUSE_OVER, mouseOverTarget);
nlabel.addEventListener(MouseEvent.MOUSE_OUT, mouseOutTarget);
addEventListener(Event.ENTER_FRAME, onFrame);
}
function mouseOverTarget(_arg1:MouseEvent):void{
mousingOver = true;
mouseOverFrames = 0;
mousedOverEvent = _arg1;
}
private function newTooltip(_arg1:MouseEvent):Boolean{
tooltip = new MiscTooltip(tt_title, tt_text);
tooltip.mouseEnabled = false;
tooltip.mouseChildren = false;
tooltip.name = "tooltip_stats";
tooltip.setForEvent(_arg1);
stage.addChild(tooltip);
return (true);
}
function mouseOutTarget(_arg1:MouseEvent):void{
if (tooltip != null){
tooltip.fade();
tooltip = null;
};
mousingOver = false;
mouseOverFrames = 0;
}
public function cleanup():void{
nlabel.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverTarget);
nlabel.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutTarget);
mouseOutTarget(null);
removeEventListener(Event.ENTER_FRAME, onFrame);
}
private function onFrame(_arg1:Event):void{
if (mousingOver){
mouseOverFrames++;
};
if (mouseOverFrames > Tooltip.delayFrames){
newTooltip(mousedOverEvent);
mousingOver = false;
mouseOverFrames = 0;
};
}
}
}//package
Section 578
//SteelEdgedWeapon (SteelEdgedWeapon)
package {
public class SteelEdgedWeapon extends MeleeWeapon {
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
if (prefixes[_local1][0] == "Sharp"){
base_damage_mod = 10;
return;
};
super.applyPrefix();
}
override public function getItemModifiers():void{
super.getItemModifiers();
prefixes.push(["Sharp", 1.1]);
}
}
}//package
Section 579
//stormbringers_loop01 (stormbringers_loop01)
package {
import flash.media.*;
public dynamic class stormbringers_loop01 extends Sound {
}
}//package
Section 580
//sTransformAetherguard (sTransformAetherguard)
package {
public class sTransformAetherguard extends Skill {
public function sTransformAetherguard(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 1;
aiPriority = 10;
aiAllowSuicide = true;
damage = _arg1.health_max;
targetsSelf = true;
transformCreatureClass = new mAetherguard(char_ref.level);
power_cost = 100;
skillname = "Breach Aether";
verbage = ("casts " + skillname);
}
}
}//package
Section 581
//sTrollHowl (sTrollHowl)
package {
public class sTrollHowl extends Skill {
public function sTrollHowl(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 1;
hitsAllEnemies = true;
rangedAttack = true;
power_cost = 50;
alwaysHits = true;
powerDamage = 25;
stun_percent = 50;
skillname = "Howl of Rage";
verbage = ("lets loose a " + skillname);
specialAnimation = PortraitAnimation.powerDrain;
}
override public function description():String{
return ("");
}
}
}//package
Section 582
//summon_effect (summon_effect)
package {
import flash.display.*;
public dynamic class summon_effect extends MovieClip {
public function summon_effect(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.summon);
}
function frame45(){
this.stop();
}
}
}//package
Section 583
//summon_slash (summon_slash)
package {
import flash.display.*;
public dynamic class summon_slash extends MovieClip {
public function summon_slash(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.monsterClaws);
}
function frame45(){
this.stop();
}
}
}//package
Section 584
//summon_whirlwind (summon_whirlwind)
package {
import flash.display.*;
public dynamic class summon_whirlwind extends MovieClip {
public function summon_whirlwind(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.summon);
}
function frame45(){
this.stop();
}
}
}//package
Section 585
//summon1_sound (summon1_sound)
package {
import flash.media.*;
public dynamic class summon1_sound extends Sound {
}
}//package
Section 586
//summon2_sound (summon2_sound)
package {
import flash.media.*;
public dynamic class summon2_sound extends Sound {
}
}//package
Section 587
//sUnarmedAttack (sUnarmedAttack)
package {
public class sUnarmedAttack extends Skill {
public function sUnarmedAttack(_arg1:Character){
char_ref = _arg1;
increasesWith = strength;
unlocked = true;
unarmedAttack = true;
damage = 0;
power_cost = 0;
iconFrame = 18;
skillname = "Unarmed Attack";
verbage = "attacks";
specialAnimation = PortraitAnimation.playerUnarmed;
}
override public function description():String{
return ((("Unarmed melee attack. Inflicts " + PlayerCharacter(char_ref).getUnarmedDamage()) + " damage.\n\n[Skill cannot be removed]"));
}
}
}//package
Section 588
//sUnsummon (sUnsummon)
package {
public class sUnsummon extends Skill {
public function sUnsummon(_arg1:Character){
increasesWith = none;
char_ref = _arg1;
iconFrame = 73;
skillname = "Unsummon";
}
override public function description():String{
return ("Remove this summoned creature from the battlefield.\n\n[Shortcut: r]");
}
}
}//package
Section 589
//SurvivalPrep (SurvivalPrep)
package {
import flash.events.*;
import flash.display.*;
public class SurvivalPrep extends Sprite {
public var beginButton:SimpleButton;
public var optionsButton:OptionsBookButton;
public var shopButton:SimpleButton;
public var manageButton:SimpleButton;
private var shop:Shop;
public function SurvivalPrep():void{
manageButton.addEventListener(MouseEvent.MOUSE_DOWN, clickManage);
shopButton.addEventListener(MouseEvent.MOUSE_DOWN, clickShop);
beginButton.addEventListener(MouseEvent.MOUSE_DOWN, clickBegin);
}
private function clickBegin(_arg1:MouseEvent):void{
cleanup();
dm.main.beginSurvivalMode();
}
private function clickManage(_arg1:MouseEvent):void{
dm.main.goToInventory();
}
public function cleanup():void{
if (shop != null){
shop.cleanup();
shop = null;
};
optionsButton.cleanup();
}
private function clickShop(_arg1:MouseEvent):void{
if (shop == null){
shop = new Shop();
shop.name = "shop";
};
dm.main.addChild(shop);
}
}
}//package
Section 590
//sVampireAttack (sVampireAttack)
package {
public class sVampireAttack extends Skill {
public function sVampireAttack(_arg1:Character){
char_ref = _arg1;
damage = _arg1.damage;
rangedAttack = true;
power_cost = 30;
hasPortraitAnimation = true;
portraitAnimationFrame = 5;
skillname = "Vampire Bite";
verbage = "strikes from the shadows";
specialAnimation = PortraitAnimation.creatureSlash;
}
}
}//package
Section 591
//sWargolemHarden (sWargolemHarden)
package {
public class sWargolemHarden extends Skill {
public function sWargolemHarden(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
damage = 0;
power_cost = 100;
targetsSelf = true;
invulnerable = 1;
iconFrame = 19;
skillname = "Harden";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.armorBuff;
}
override public function description():String{
return ("Wargolem becomes immune to damage until next turn.");
}
}
}//package
Section 592
//sWarlordBuff (sWarlordBuff)
package {
public class sWarlordBuff extends Skill {
public function sWarlordBuff(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 1;
targetsFriendlies = true;
hitsAllFriendlies = true;
rangedAttack = true;
power_cost = 25;
buff_quickness = 20;
buff_damageResist = 10;
skillname = "Battle Plan";
verbage = ("implements " + skillname);
specialAnimation = PortraitAnimation.buff;
}
override public function description():String{
return ("");
}
}
}//package
Section 593
//sWarlordFocus (sWarlordFocus)
package {
public class sWarlordFocus extends Skill {
public function sWarlordFocus(_arg1:Character){
char_ref = _arg1;
aiNotUnlessLowPower = true;
aiCastLimit = 1;
targetsSelf = true;
power_cost = 0;
powerRestore = 75;
skillname = "Survey";
verbage = "surveys the battlefield";
specialAnimation = PortraitAnimation.gainPower;
}
override public function description():String{
return ((("Recover " + powerRestore) + " power."));
}
}
}//package
Section 594
//sWarlordRevive (sWarlordRevive)
package {
public class sWarlordRevive extends Skill {
public function sWarlordRevive(_arg1:Character){
char_ref = _arg1;
aiCastLimit = 2;
targetsFriendlies = true;
rangedAttack = true;
healing = char_ref.health_max;
power_cost = 70;
removesPoison = true;
resurrects = true;
skillname = "Reinforce";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.revive;
}
override public function description():String{
return ((("Revives fallen party member with " + scaleHeal(healing)) + " health."));
}
}
}//package
Section 595
//sWarriorAdrenaline (sWarriorAdrenaline)
package {
public class sWarriorAdrenaline extends Skill {
public function sWarriorAdrenaline(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
aiCastLimit = 1;
targetsSelf = true;
power_cost = 25;
buff_resistStun = 100;
buff_damage = 1.3;
iconFrame = 48;
skillname = "Adrenaline";
verbage = "feels a burst of adrenaline";
specialAnimation = PortraitAnimation.buff;
}
override public function description():String{
return ((("User gains immunity to Stun effects and " + Math.round(((buff_damage - 1) * 100))) + "% bonus damage for the remainder of the battle."));
}
}
}//package
Section 596
//sWarriorAE (sWarriorAE)
package {
public class sWarriorAE extends Skill {
public function sWarriorAE(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
damage = 0;
addWeaponDamage = true;
requiresMelee = true;
scaleWeaponDamage = 1;
power_cost = 60;
hitsAllMeleeRange = true;
iconFrame = 5;
skillname = "Cleave";
verbage = "cleaves through the enemy";
specialAnimation = PortraitAnimation.playerSlash;
}
override public function description():String{
return ((("Perform a melee weapon attack (" + getDamage()) + " damage) on all targets in melee range."));
}
}
}//package
Section 597
//sWarriorBloodlust (sWarriorBloodlust)
package {
public class sWarriorBloodlust extends Skill {
public function sWarriorBloodlust(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
damage = 0;
addWeaponDamage = true;
scaleWeaponDamage = 1.1;
power_cost = 30;
requiresMelee = true;
gainPowerFromKill = 50;
iconFrame = 36;
skillname = "Bloodlust";
verbage = ("is filled with " + skillname);
showWeaponAnimation = true;
}
override public function description():String{
return ((((((("Melee attack for " + Math.round((scaleWeaponDamage * 100))) + "% weapon damage (") + getDamage()) + "). If this attack kills the target, the attacker gains ") + gainPowerFromKill) + " power."));
}
}
}//package
Section 598
//sWarriorDefiance (sWarriorDefiance)
package {
public class sWarriorDefiance extends Skill {
public function sWarriorDefiance(_arg1:Character){
char_ref = _arg1;
increasesWith = endurance;
aiCastLimit = 0;
damage = 0;
power_cost = 30;
targetsSelf = true;
cannotDie = 1;
iconFrame = 6;
skillname = "Defiance";
verbage = "shouts in defiance!";
specialAnimation = PortraitAnimation.defiance;
}
override public function description():String{
return ((((("User may not be reduced below " + getDefianceHealth()) + " health until ") + char_ref.genderPossessive()) + " next turn."));
}
}
}//package
Section 599
//sWarriorExecute (sWarriorExecute)
package {
public class sWarriorExecute extends Skill {
public function sWarriorExecute(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
aiCastLimit = 0;
damage = 0;
addWeaponDamage = true;
requiresMelee = true;
costsRemainingPower = true;
addsPowerToLethality = true;
power_cost = 0;
iconFrame = 14;
skillname = "Execute";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.playerPowerSlash;
}
override public function description():String{
return ((("Melee weapon attack (" + getDamage()) + " damage). The character's remaining power is added as percentage chance of killing the target outright."));
}
}
}//package
Section 600
//sWarriorHeal (sWarriorHeal)
package {
public class sWarriorHeal extends Skill {
public function sWarriorHeal(_arg1:Character){
char_ref = _arg1;
increasesWith = endurance;
increaseRate = 1.5;
nonCombat = true;
targetsSelf = true;
removesPoison = false;
healing = 20;
power_cost = 40;
iconFrame = 9;
skillname = "Resolve";
verbage = "finds the strength to continue";
specialAnimation = PortraitAnimation.heal;
}
override public function description():String{
return ((("Character recovers " + scaleHeal(healing)) + " health."));
}
}
}//package
Section 601
//sWarriorInspire (sWarriorInspire)
package {
public class sWarriorInspire extends Skill {
public function sWarriorInspire(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
aiCastLimit = 1;
targetsFriendlies = true;
hitsAllFriendlies = true;
rangedAttack = true;
power_cost = 15;
buff_damage = 1.2;
iconFrame = 27;
skillname = "Inspire";
verbage = "inspires the party";
specialAnimation = PortraitAnimation.buff;
}
override public function description():String{
return ((("All party members' damage is increased by " + Math.round(((buff_damage - 1) * 100))) + "% for the remainder of the battle."));
}
}
}//package
Section 602
//sWarriorPowerAttack (sWarriorPowerAttack)
package {
public class sWarriorPowerAttack extends Skill {
public function sWarriorPowerAttack(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
damage = 0;
addWeaponDamage = true;
scaleWeaponDamage = 1.3;
power_cost = 40;
requiresMelee = true;
iconFrame = 4;
skillname = "Power Attack";
verbage = ("performs a " + skillname);
specialAnimation = PortraitAnimation.playerPowerSlash;
}
override public function description():String{
return ((("Melee attack for 130% weapon damage (" + getDamage()) + ")"));
}
}
}//package
Section 603
//sWarriorShield (sWarriorShield)
package {
public class sWarriorShield extends Skill {
public function sWarriorShield(_arg1:Character){
char_ref = _arg1;
increasesWith = none;
damage = 0;
power_cost = 60;
targetsSelf = true;
requiresShield = true;
targetsFriendlyFrontRow = true;
makeDamageSponge = true;
tempDamageResistance = 25;
iconFrame = 19;
skillname = "Shield Wall";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.protectAllies;
}
override public function description():String{
return ((("User receives +" + tempDamageResistance) + "% damage resistance and is sole target of enemy attacks until his next turn. Other party members may still take damage from area attacks. Can only be used in the front row of the party formation."));
}
}
}//package
Section 604
//sWarriorSpeedAttack (sWarriorSpeedAttack)
package {
public class sWarriorSpeedAttack extends Skill {
public function sWarriorSpeedAttack(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
aiCastLimit = 0;
damage = 0;
addWeaponDamage = true;
power_cost = 75;
requiresMelee = true;
extraSpeedAttacks = 2;
iconFrame = 49;
skillname = "Overwhelm";
verbage = "overwhelms the enemy";
specialAnimation = PortraitAnimation.playerMultiSlash;
}
override public function description():String{
return ((("Melee weapon attack (" + getDamage()) + " damage). If the warrior has higher Quickness than the target, warrior performs two bonus weapon attacks on the same target."));
}
}
}//package
Section 605
//sWeaponAttack (sWeaponAttack)
package {
public class sWeaponAttack extends Skill {
public function sWeaponAttack(_arg1:Character){
char_ref = _arg1;
increasesWith = weapon;
unlocked = true;
damage = 0;
addWeaponDamage = true;
power_cost = 0;
skillname = "Melee Attack";
requiresMelee = true;
verbage = "attacks";
iconFrame = 17;
specialAnimation = PortraitAnimation.playerSlash;
}
override public function description():String{
return ((("Melee attack with equipped weapon. Inflicts " + getDamage()) + " damage. \n\n[Skill cannot be removed]"));
}
}
}//package
Section 606
//sWither (sWither)
package {
public class sWither extends Skill {
public function sWither(_arg1:Character):void{
char_ref = _arg1;
increasesWith = Skill.none;
damage = 0;
rangedAttack = true;
power_cost = 30;
cancelPowerRegen = 3;
cancelHealthRegen = 3;
skillname = "Wither";
verbage = ("casts " + skillname);
specialAnimation = PortraitAnimation.debuff;
}
}
}//package
Section 607
//sVoidCannon (sVoidCannon)
package {
public class sVoidCannon extends Skill {
public function sVoidCannon(_arg1:Character){
char_ref = _arg1;
rangedAttack = true;
damage = Math.round((_arg1.damage * 1));
power_cost = 75;
ignoresArmor = true;
piercesColumn = true;
skillname = "Void Cannon";
verbage = ("uses " + skillname);
specialAnimation = PortraitAnimation.disintegrate;
}
}
}//package
Section 608
//sZombieAE (sZombieAE)
package {
public class sZombieAE extends Skill {
public function sZombieAE(_arg1:Character){
char_ref = _arg1;
skillname = "Noxious Cloud";
hitsAllMeleeRange = true;
power_cost = 65;
damage = Math.round((_arg1.damage / 4));
poisonDamage = Math.round((_arg1.damage / 4));
damageAccuracy = 25;
verbage = ("emits a " + skillname);
specialAnimation = PortraitAnimation.poison;
}
}
}//package
Section 609
//sZombieAttack (sZombieAttack)
package {
public class sZombieAttack extends Skill {
public function sZombieAttack(_arg1:Character){
char_ref = _arg1;
damage = _arg1.damage;
powerDamage = 10;
power_cost = 0;
skillname = "Attack";
verbage = "attacks";
specialAnimation = PortraitAnimation.creatureSlash;
}
}
}//package
Section 610
//tab_flash (tab_flash)
package {
import flash.display.*;
public dynamic class tab_flash extends MovieClip {
}
}//package
Section 611
//TeleportTransition (TeleportTransition)
package {
import flash.display.*;
public class TeleportTransition extends MovieClip {
private const stopFrame = 15;
private var oldChild:DisplayObjectContainer;
private var newChild:DisplayObjectContainer;
private var ready:Boolean;// = false
public function TeleportTransition(_arg1:DisplayObjectContainer=null, _arg2:DisplayObjectContainer=null):void{
ready = false;
super();
addFrameScript(14, frame15, 15, frame16, 40, frame41);
this.ready = false;
oldChild = _arg1;
newChild = _arg2;
}
function frame15(){
}
public function setReady():void{
this.ready = true;
if (this.currentFrame == stopFrame){
this.gotoAndPlay("continue");
};
}
public function beginContinue():void{
var _local1:*;
if (this.ready){
_local1 = oldChild.parent;
if (_local1 != null){
_local1.removeChild(oldChild);
_local1.addChild(newChild);
};
if ((newChild is Shop)){
Shop(newChild).init();
};
};
}
public function remove():void{
if (parent != null){
parent.removeChild(this);
};
}
function frame16(){
this.beginContinue();
}
function frame41(){
this.stop();
this.remove();
}
}
}//package
Section 612
//ThinButtonBG (ThinButtonBG)
package {
import flash.events.*;
import flash.display.*;
public class ThinButtonBG extends MovieClip {
public function ThinButtonBG(){
this.gotoAndStop(1);
this.addEventListener(Event.ADDED_TO_STAGE, added, false, 0, true);
this.addEventListener(Event.REMOVED_FROM_STAGE, removed, false, 0, true);
}
function added(_arg1:Event):void{
this.addEventListener(MouseEvent.MOUSE_OVER, mouseOn);
this.addEventListener(MouseEvent.MOUSE_MOVE, mouseOn);
this.addEventListener(MouseEvent.MOUSE_OUT, mouseOff);
}
function mouseOn(_arg1:MouseEvent):void{
this.gotoAndStop(2);
}
function mouseOff(_arg1:MouseEvent):void{
this.gotoAndStop(1);
}
function removed(_arg1:Event):void{
this.removeEventListener(MouseEvent.MOUSE_OVER, mouseOn);
this.removeEventListener(MouseEvent.MOUSE_MOVE, mouseOn);
this.removeEventListener(MouseEvent.MOUSE_OUT, mouseOff);
}
}
}//package
Section 613
//thrown_sound (thrown_sound)
package {
import flash.media.*;
public dynamic class thrown_sound extends Sound {
}
}//package
Section 614
//TitleMusic (TitleMusic)
package {
import flash.media.*;
public class TitleMusic extends Music {
public function TitleMusic(_arg1:Boolean=false, _arg2:Boolean=false):void{
var _local3:int;
var _local4:*;
super();
if (_arg2){
_local3 = 6000;
} else {
_local3 = 2000;
};
_local4 = new frozen_wastelands_loop02();
channel = _local4.play(0, 99999);
if (channel == null){
return;
};
active = true;
if (_arg1){
channel.soundTransform = new SoundTransform(0);
};
if (_arg1){
this.fadeIn(_local3);
} else {
this.setVolume(volumeSetting);
};
}
}
}//package
Section 615
//TitleScreen (TitleScreen)
package {
import flash.text.*;
import flash.events.*;
import flash.display.*;
public class TitleScreen extends MovieClip {
public var options_button:SimpleButton;
public var versionText:TextField;
public var logoLine:MovieClip;
private var opening:Boolean;// = false
public var credits_button:SimpleButton;
public var buttonHintText:TextField;
private var closing:Boolean;// = false
public var cover:MovieClip;
public var continue_button:SimpleButton;
public function TitleScreen():void{
closing = false;
opening = false;
super();
addFrameScript(9, frame10, 39, frame40);
init();
this.gotoAndPlay(1);
mouseEnabled = false;
mouseChildren = false;
}
private function clearButtonHint():void{
buttonHintText.text = "";
}
function creditsClick(_arg1:MouseEvent):void{
addChild(new CreditsScreen());
}
private function init():void{
var _local1:String;
continue_button = cover.continue_button;
options_button = cover.options_button;
credits_button = cover.credits_button;
if (!(continue_button.hasEventListener(MouseEvent.MOUSE_DOWN))){
continue_button.addEventListener(MouseEvent.MOUSE_DOWN, continueClick);
};
if (!(continue_button.hasEventListener(MouseEvent.MOUSE_OVER))){
continue_button.addEventListener(MouseEvent.MOUSE_OVER, continueMouseOver);
};
if (!(continue_button.hasEventListener(MouseEvent.MOUSE_OUT))){
continue_button.addEventListener(MouseEvent.MOUSE_OUT, buttonMouseOut);
};
if (!(credits_button.hasEventListener(MouseEvent.MOUSE_DOWN))){
credits_button.addEventListener(MouseEvent.MOUSE_DOWN, creditsClick);
};
if (!(credits_button.hasEventListener(MouseEvent.MOUSE_OVER))){
credits_button.addEventListener(MouseEvent.MOUSE_OVER, creditsMouseOver);
};
if (!(credits_button.hasEventListener(MouseEvent.MOUSE_OUT))){
credits_button.addEventListener(MouseEvent.MOUSE_OUT, buttonMouseOut);
};
if (!(options_button.hasEventListener(MouseEvent.MOUSE_DOWN))){
options_button.addEventListener(MouseEvent.MOUSE_DOWN, optionsClick);
};
if (!(options_button.hasEventListener(MouseEvent.MOUSE_OVER))){
options_button.addEventListener(MouseEvent.MOUSE_OVER, optionsMouseOver);
};
if (!(options_button.hasEventListener(MouseEvent.MOUSE_OUT))){
options_button.addEventListener(MouseEvent.MOUSE_OUT, buttonMouseOut);
};
if (DungeonMain.ARMORGAMES){
if (logoLine.contains(logoLine.sponsorButton)){
logoLine.removeChild(logoLine.sponsorButton);
};
if (!(logoLine.contains(logoLine.armorButton))){
logoLine.addChild(logoLine.armorButton);
};
if (logoLine.contains(logoLine.biclopsButton)){
logoLine.removeChild(logoLine.biclopsButton);
};
} else {
if (DungeonMain.ANDKON){
if (logoLine.contains(logoLine.sponsorButton)){
logoLine.removeChild(logoLine.sponsorButton);
};
if (logoLine.contains(logoLine.armorButton)){
logoLine.removeChild(logoLine.armorButton);
};
if (!(logoLine.contains(logoLine.biclopsButton))){
logoLine.addChild(logoLine.biclopsButton);
};
} else {
if (!(logoLine.contains(logoLine.sponsorButton))){
logoLine.addChild(logoLine.sponsorButton);
};
if (logoLine.contains(logoLine.armorButton)){
logoLine.removeChild(logoLine.armorButton);
};
if (logoLine.contains(logoLine.biclopsButton)){
logoLine.removeChild(logoLine.biclopsButton);
};
};
};
if (!(logoLine.sponsorButton.hasEventListener(MouseEvent.MOUSE_DOWN))){
logoLine.sponsorButton.addEventListener(MouseEvent.MOUSE_DOWN, sponsorClick);
};
if (!(logoLine.armorButton.hasEventListener(MouseEvent.MOUSE_DOWN))){
logoLine.armorButton.addEventListener(MouseEvent.MOUSE_DOWN, sponsorClick);
};
if (!(logoLine.biclopsButton.hasEventListener(MouseEvent.MOUSE_DOWN))){
logoLine.biclopsButton.addEventListener(MouseEvent.MOUSE_DOWN, biclopsClick);
};
if (!(this.hasEventListener(Event.ENTER_FRAME))){
this.addEventListener(Event.ENTER_FRAME, onFrame);
};
_local1 = ("v" + String(DungeonMain.GAME_VERSION));
if (DungeonMain.KONGREGATE){
_local1 = (_local1 + "k");
} else {
if (DungeonMain.ARMORGAMES){
_local1 = (_local1 + "a");
};
};
if (DungeonMain.BETA){
_local1 = (_local1 + "\nBETA");
} else {
if (DungeonMain.debug){
_local1 = (_local1 + "\nDEBUG");
};
};
if (versionText != null){
versionText.text = _local1;
dmf.embolden(versionText);
};
clearButtonHint();
}
private function optionsMouseOver(_arg1:MouseEvent):void{
buttonHintText.text = "Options";
}
public function animationFinished():void{
this.removeEventListener(Event.ENTER_FRAME, onFrame);
if (parent != null){
parent.removeChild(this);
};
cleanup();
}
public function continueClick(_arg1:MouseEvent):void{
clearButtonHint();
cleanup();
DungeonMain(parent).loadGameMenu();
opening = true;
this.gotoAndPlay("open");
}
private function continueMouseOver(_arg1:MouseEvent):void{
buttonHintText.text = "Play Game";
}
function frame10(){
this.stop();
this.mouseEnabled = true;
this.mouseChildren = true;
}
function optionsClick(_arg1:MouseEvent):void{
addChild(new OptionsScreen());
}
public function sponsorClick(_arg1:MouseEvent):void{
if (DungeonMain.ARMORGAMES){
dm.link(Links.ARMORGAMES);
} else {
dm.link(Links.KONG_HOME);
};
}
private function creditsMouseOver(_arg1:MouseEvent):void{
buttonHintText.text = "Credits";
}
function frame40(){
this.stop();
this.animationFinished();
}
private function cleanup():void{
continue_button.removeEventListener(MouseEvent.MOUSE_DOWN, continueClick);
continue_button.removeEventListener(MouseEvent.MOUSE_OVER, continueMouseOver);
continue_button.removeEventListener(MouseEvent.MOUSE_OUT, buttonMouseOut);
credits_button.removeEventListener(MouseEvent.MOUSE_DOWN, creditsClick);
credits_button.removeEventListener(MouseEvent.MOUSE_OVER, creditsMouseOver);
credits_button.removeEventListener(MouseEvent.MOUSE_OUT, buttonMouseOut);
options_button.removeEventListener(MouseEvent.MOUSE_DOWN, optionsClick);
options_button.removeEventListener(MouseEvent.MOUSE_OVER, optionsMouseOver);
options_button.removeEventListener(MouseEvent.MOUSE_OUT, buttonMouseOut);
logoLine.sponsorButton.removeEventListener(MouseEvent.MOUSE_DOWN, sponsorClick);
logoLine.armorButton.removeEventListener(MouseEvent.MOUSE_DOWN, sponsorClick);
logoLine.biclopsButton.removeEventListener(MouseEvent.MOUSE_DOWN, biclopsClick);
logoLine.muteButton.cleanup();
}
private function buttonMouseOut(_arg1:MouseEvent):void{
clearButtonHint();
}
public function closeCover(_arg1:MouseEvent=null):void{
mouseEnabled = false;
mouseChildren = false;
closing = true;
this.gotoAndStop(this.totalFrames);
init();
}
private function onFrame(_arg1:Event):void{
if (closing){
this.gotoAndStop((this.currentFrame - 1));
if (currentFrame == 10){
closing = false;
init();
mouseEnabled = true;
mouseChildren = true;
dm.main.removeDungeon();
dm.main.removeInventory();
};
} else {
if (opening){
if (this.currentFrame == this.totalFrames){
animationFinished();
};
};
};
}
public function biclopsClick(_arg1:MouseEvent):void{
dm.link("http://www.biclopsgames.com");
}
}
}//package
Section 616
//Tooltip (Tooltip)
package {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
public class Tooltip extends Sprite {
const red_text = 0xCC0000;
const white_text = 0xFFFFFF;
const grey_text = 0xCCCCCC;
const purple_text = 0x9900FF;
const green_text = 0x66FF00;
const blue_text = 26367;
private var fadeOut:Boolean;// = false
private var fadeIn:Boolean;// = false
private var fadeCount:int;// = 0
static const DELAY_SHORT:uint = 1;
static const DELAY_MEDIUM:uint = 2;
static const DELAY_NONE:uint = 0;
static const FADE_IN_FRAMES = 5;
static const DELAY_LONG:uint = 4;
public function Tooltip():void{
fadeIn = false;
fadeOut = false;
fadeCount = 0;
super();
addEventListener(Event.ADDED_TO_STAGE, added, false, 0, true);
addEventListener(Event.ENTER_FRAME, onFrame, false, 0, true);
}
private function added(_arg1:Event):void{
fadeIn = true;
this.alpha = 0;
fadeCount = 0;
}
public function get realHeight():int{
return (this.height);
}
public function fade():void{
fadeIn = false;
fadeOut = true;
fadeCount = 0;
}
public function get realWidth():int{
return (this.width);
}
private function onFrame(_arg1:Event):void{
if (fadeOut){
this.alpha = (this.alpha - ((1 / FADE_IN_FRAMES) * fadeCount));
fadeCount++;
if ((((this.alpha <= 0)) || ((fadeCount > FADE_IN_FRAMES)))){
fadeOut = false;
if (parent != null){
parent.removeChild(this);
};
};
} else {
if (fadeIn){
this.alpha = (this.alpha + ((1 / FADE_IN_FRAMES) * fadeCount));
fadeCount++;
if (this.alpha >= 1){
fadeCount = 0;
fadeIn = false;
};
};
};
}
public function setForEvent(_arg1:MouseEvent):void{
var _local2:int;
var _local3:int;
var _local4:Point;
var _local5:int;
var _local6:int;
var _local7 = ??pushnamespace
;
if (_arg1 == null){
return;
};
_local2 = _arg1.target.mouseX;
_local3 = _arg1.target.mouseY;
_local4 = _arg1.target.localToGlobal(new Point(_local2, _local3));
_local5 = _local4.x;
_local6 = _local4.y;
_local7 = 5;
if (((_local4.x + this.realWidth) + _local7) > DungeonMain.APP_WIDTH){
_local5 = (_local5 + (DungeonMain.APP_WIDTH - ((_local4.x + this.realWidth) + _local7)));
};
if (((_local4.y + this.realHeight) + _local7) > DungeonMain.APP_HEIGHT){
_local6 = (_local6 + (DungeonMain.APP_HEIGHT - ((_local4.y + this.realHeight) + _local7)));
};
this.x = Math.floor(_local5);
this.y = Math.floor(_local6);
}
static function get delayFrames():int{
if (DungeonMain.tooltipDelay == DELAY_NONE){
return (0);
};
if (DungeonMain.tooltipDelay == DELAY_SHORT){
return (5);
};
if (DungeonMain.tooltipDelay == DELAY_MEDIUM){
return (15);
};
if (DungeonMain.tooltipDelay == DELAY_LONG){
return (25);
};
return (0);
}
}
}//package
Section 617
//TooltipSelectorMenu (TooltipSelectorMenu)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class TooltipSelectorMenu extends MovieClip {
public var low:TextField;
public var off:TextField;
public var long:TextField;
public var med:TextField;
public function TooltipSelectorMenu():void{
long.addEventListener(MouseEvent.MOUSE_DOWN, clickLong);
med.addEventListener(MouseEvent.MOUSE_DOWN, clickMed);
low.addEventListener(MouseEvent.MOUSE_DOWN, clickLow);
off.addEventListener(MouseEvent.MOUSE_DOWN, clickOff);
setFrame();
}
public function setFrame():void{
if (DungeonMain.tooltipDelay == Tooltip.DELAY_NONE){
this.gotoAndStop("off");
} else {
if (DungeonMain.tooltipDelay == Tooltip.DELAY_SHORT){
this.gotoAndStop("low");
} else {
if (DungeonMain.tooltipDelay == Tooltip.DELAY_MEDIUM){
this.gotoAndStop("med");
} else {
if (DungeonMain.tooltipDelay == Tooltip.DELAY_LONG){
this.gotoAndStop("long");
};
};
};
};
}
function clickMed(_arg1:MouseEvent):void{
this.gotoAndStop("med");
DungeonMain.tooltipDelay = Tooltip.DELAY_MEDIUM;
}
function clickLong(_arg1:MouseEvent):void{
this.gotoAndStop("long");
DungeonMain.tooltipDelay = Tooltip.DELAY_LONG;
}
function clickLow(_arg1:MouseEvent):void{
this.gotoAndStop("low");
DungeonMain.tooltipDelay = Tooltip.DELAY_SHORT;
}
public function cleanup():void{
long.removeEventListener(MouseEvent.MOUSE_DOWN, clickLong);
med.removeEventListener(MouseEvent.MOUSE_DOWN, clickMed);
low.removeEventListener(MouseEvent.MOUSE_DOWN, clickLow);
off.removeEventListener(MouseEvent.MOUSE_DOWN, clickOff);
}
function clickOff(_arg1:MouseEvent):void{
this.gotoAndStop("off");
DungeonMain.tooltipDelay = Tooltip.DELAY_NONE;
}
}
}//package
Section 618
//transform_effect (transform_effect)
package {
import flash.display.*;
public dynamic class transform_effect extends MovieClip {
public function transform_effect(){
addFrameScript(0, frame1, 14, frame15, 44, frame45);
}
function frame15(){
if (((!((this.parent == null))) && ((this.parent is CharacterPortrait)))){
CharacterPortrait(this.parent).update();
};
}
function frame1(){
dm.sound.play(SoundControl.summon);
}
function frame45(){
this.stop();
}
}
}//package
Section 619
//TreasureCategoryTake (TreasureCategoryTake)
package {
import flash.events.*;
import flash.display.*;
public class TreasureCategoryTake extends MovieClip {
public var take:Boolean;
public function TreasureCategoryTake():void{
take = true;
addEventListener(MouseEvent.MOUSE_DOWN, clicked);
}
function clicked(_arg1:MouseEvent):void{
take = !(take);
if (take){
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
};
TreasureReport(parent).takeSettingsChange(TreasureCategoryTake(_arg1.currentTarget));
}
public function cleanup():void{
removeEventListener(MouseEvent.MOUSE_DOWN, clicked);
}
}
}//package
Section 620
//TreasureChest (TreasureChest)
package {
import flash.text.*;
import flash.utils.*;
import flash.events.*;
import flash.display.*;
public class TreasureChest extends MovieClip {
var looted:Boolean;// = false
var loot:Array;
var chest_level;// = 1
var hordeLoot:Boolean;// = false
static const POTION_CHANCE = 20;
public function TreasureChest(_arg1:Party=null, _arg2:int=1, _arg3:int=0, _arg4=false, _arg5:Boolean=false){
var _local6:Boolean;
var _local7:Item;
loot = new Array();
chest_level = 1;
looted = false;
hordeLoot = false;
super();
addFrameScript(59, frame60, 74, frame75);
chest_level = _arg2;
hordeLoot = _arg5;
if (_arg4){
_local6 = false;
while (((!(_local6)) && (!((_arg1 == null))))) {
_local7 = getItem(_arg2, Item.purple);
if (testItemSuitable(_local7, _arg1)){
loot.push(_local7);
_local6 = true;
};
};
};
GenerateItems(_arg1, _arg3);
}
function frame75(){
this.stop();
}
private function GenerateItems(_arg1:Party, _arg2:int){
var _local3:*;
var _local4:*;
var _local5:Item;
var _local6:int;
var _local7:int;
_local3 = 0;
_local4 = 0;
_local5 = null;
if (!(_arg2)){
_arg2 = dmf.randomNum(1, 4);
};
while (loot.length < _arg2) {
_local5 = getItem(chest_level, -1, false, hordeLoot);
if (testItemSuitable(_local5, _arg1)){
loot.push(_local5);
};
};
if (dmf.randomNum(0, 99) < POTION_CHANCE){
_local6 = dmf.randomNum(1, 2);
_local7 = 0;
while (_local7 < _local6) {
_local5 = getItem(chest_level, -1, true);
loot.push(_local5);
_local7++;
};
};
}
function onFadeComplete(_arg1:TimerEvent):void{
if (parent != null){
parent.removeChild(this);
};
}
public function fade():void{
var _local1:Timer;
looted = true;
this.gotoAndPlay(61);
_local1 = new Timer(500, 1);
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, onFadeComplete);
_local1.start();
}
function frame60(){
this.gotoAndPlay(1);
}
public static function getItem(_arg1:int=-1, _arg2:int=-1, _arg3:Boolean=false, _arg4:Boolean=false):Item{
var _local5:Array;
var _local6:*;
_local5 = GetItemTypes(_arg1, _arg2, _arg3, _arg4);
_local6 = dmf.randomNum(0, _local5.length);
return (_local5[_local6]);
}
public static function testItemSuitable(_arg1:Item, _arg2:Party):Boolean{
var _local3:int;
var _local4:*;
if (_arg1 == null){
return (false);
};
if (_arg2 != null){
_local3 = 0;
_local4 = 0;
while (_local4 < _arg2.members.length) {
if (_arg2.members[_local4].itemUsable(_arg1)){
_local3++;
};
_local4++;
};
if (_local3 > 0){
return (true);
};
return (false);
};
return (false);
}
private static function GetItemTypes(_arg1:int, _arg2:int=0, _arg3:Boolean=false, _arg4:Boolean=false):Array{
var _local5:Array;
var _local6:*;
_local5 = new Array();
if (((_arg3) || ((((_arg2 == -1)) && ((dmf.randomNum(0, 99) < POTION_CHANCE)))))){
_local5.push(new PotionHealthSmall(_arg1));
_local5.push(new PotionHealthSmall(_arg1));
_local5.push(new PotionHealthSmall(_arg1));
_local5.push(new PotionPowerSmall(_arg1));
_local5.push(new PotionPowerSmall(_arg1));
_local5.push(new PotionPowerSmall(_arg1));
_local5.push(new PotionRejuveSmall(_arg1));
_local5.push(new PotionRejuveSmall(_arg1));
_local5.push(new PotionReviveWeak(_arg1));
_local5.push(new PotionReviveWeak(_arg1));
_local5.push(new PotionHealth(_arg1));
_local5.push(new PotionPower(_arg1));
_local5.push(new PotionRejuve(_arg1));
_local5.push(new PotionRevive(_arg1));
_local5.push(new PotionPoisonResist(_arg1));
_local5.push(new PotionShield(_arg1));
_local5.push(new PotionQuickness(_arg1));
if (_arg4){
_local5.push(new SneakyScroll());
_local5.push(new SneakyScroll());
};
_local5.push(new Enchantment(_arg1));
_local5.push(new Enchantment(_arg1));
return (_local5);
};
_local5.push(new iDagger(_arg1, _arg2));
_local5.push(new iDagger(_arg1, _arg2));
_local5.push(new iSword(_arg1, _arg2));
_local5.push(new iSword(_arg1, _arg2));
_local5.push(new iAxe(_arg1, _arg2));
_local5.push(new iSpear(_arg1, _arg2));
_local5.push(new iMace(_arg1, _arg2));
_local5.push(new iMace(_arg1, _arg2));
_local5.push(new iStaff(_arg1, _arg2));
_local5.push(new iStaff(_arg1, _arg2));
_local5.push(new iBow(_arg1, _arg2));
_local5.push(new iBow(_arg1, _arg2));
_local5.push(new iCrossbow(_arg1, _arg2));
_local5.push(new iPlateHelmet(_arg1, _arg2));
_local5.push(new iPlateGloves(_arg1, _arg2));
_local5.push(new iPlateGreaves(_arg1, _arg2));
_local5.push(new iPlateBoots(_arg1, _arg2));
_local5.push(new iPlateBreastplate(_arg1, _arg2));
_local5.push(new iLeatherHat(_arg1, _arg2));
_local5.push(new iLeatherGloves(_arg1, _arg2));
_local5.push(new iLeatherLegs(_arg1, _arg2));
_local5.push(new iLeatherBoots(_arg1, _arg2));
_local5.push(new iLeatherChest(_arg1, _arg2));
_local5.push(new iClothHat(_arg1, _arg2));
_local5.push(new iClothGloves(_arg1, _arg2));
_local5.push(new iClothLegs(_arg1, _arg2));
_local5.push(new iClothShoes(_arg1, _arg2));
_local5.push(new iClothRobe(_arg1, _arg2));
_local6 = 0;
while (_local6 < 2) {
_local5.push(new iRing(_arg1, _arg2));
_local5.push(new iCloak(_arg1, _arg2));
_local6++;
};
_local5.push(new iQuiver(_arg1, _arg2));
_local5.push(new iParryingDagger(_arg1, _arg2));
_local5.push(new iShieldBuckler(_arg1, _arg2));
_local5.push(new iShieldTower(_arg1, _arg2));
_local5.push(new iCenser(_arg1, _arg2));
return (_local5);
}
}
}//package
Section 621
//TreasureReport (TreasureReport)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class TreasureReport extends MovieClip {
const icon_gap:int = 4;
var chest:TreasureChest;
var icons:Array;
public var takeDisabler:Sprite;
public var bg:MovieClip;
public var discard_btn:MovieClip;
public var selected_count_label:TextField;
public var settings_btn:MovieClip;
public var weapons_lbl:TextField;
public var consumables_lbl:TextField;
private var comparisons:Array;
public var take_btn:MovieClip;
public var armor_lbl:TextField;
var tooltipController:ItemTooltipController;
public function TreasureReport(_arg1:String="chest"){
icons = new Array();
super();
tooltipController = new ItemTooltipController();
settings_btn.addEventListener(MouseEvent.MOUSE_DOWN, settingsClick);
this.gotoAndStop(_arg1);
}
private function updateSelectedCount():void{
var _local1:int;
var _local2:*;
_local1 = 0;
_local2 = 0;
while (_local2 < icons.length) {
if (icons[_local2].taking){
_local1++;
};
_local2++;
};
selected_count_label.text = (((String(_local1) + "/") + String(icons.length)) + " selected");
if (_local1){
takeDisabler.alpha = 0;
takeDisabler.mouseEnabled = false;
} else {
takeDisabler.alpha = 1;
takeDisabler.mouseEnabled = true;
};
}
public function updateSettings():void{
var _local1:Party;
var _local2:InventoryIcon;
var _local3:Item;
var _local4:int;
var _local5:Boolean;
_local1 = dm.main.pc_party;
for each (_local2 in icons) {
if (_local2 == null){
} else {
_local3 = _local2.item_ref;
_local4 = _local3.item_rarity;
_local5 = false;
if ((((_local4 == Item.grey)) && (!(dmf.hasFlag(_local1.lootSettings, LootSettings.GREY))))){
_local5 = setUnselected(_local2);
} else {
if ((((_local4 == Item.white)) && (!(dmf.hasFlag(_local1.lootSettings, LootSettings.WHITE))))){
_local5 = setUnselected(_local2);
} else {
if ((((_local4 == Item.green)) && (!(dmf.hasFlag(_local1.lootSettings, LootSettings.GREEN))))){
_local5 = setUnselected(_local2);
} else {
if ((((_local4 == Item.blue)) && (!(dmf.hasFlag(_local1.lootSettings, LootSettings.BLUE))))){
_local5 = setUnselected(_local2);
} else {
if ((((_local4 == Item.purple)) && (!(dmf.hasFlag(_local1.lootSettings, LootSettings.PURPLE))))){
_local5 = setUnselected(_local2);
} else {
if ((((_local3 is LightArmor)) && (!(dmf.hasFlag(_local1.lootSettings, LootSettings.LIGHT))))){
_local5 = setUnselected(_local2);
} else {
if ((((_local3 is MediumArmor)) && (!(dmf.hasFlag(_local1.lootSettings, LootSettings.MEDIUM))))){
_local5 = setUnselected(_local2);
} else {
if ((((_local3 is HeavyArmor)) && (!(dmf.hasFlag(_local1.lootSettings, LootSettings.HEAVY))))){
_local5 = setUnselected(_local2);
};
};
};
};
};
};
};
};
if (!(_local5)){
_local2.alpha = 1;
_local2.taking = true;
};
};
};
updateSelectedCount();
}
private function settingsClick(_arg1:MouseEvent):void{
var _local2:LootSettings;
_local2 = new LootSettings();
addChild(_local2);
}
public function takeSettingsChange(_arg1:TreasureCategoryTake):void{
}
public function drawIcons():void{
var _local1:Array;
var _local2:Array;
var _local3:Array;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7 = ??pushnamespace
;
var _local8 = ??pushnamespace
;
var _local9:*;
var _local10:*;
_local1 = new Array();
_local2 = new Array();
_local3 = new Array();
_local4 = 0;
while (_local4 < icons.length) {
if (icons[_local4] == null){
} else {
if (icons[_local4].item_ref == null){
} else {
if ((icons[_local4].item_ref is Weapon)){
_local2.push(icons[_local4]);
} else {
if ((icons[_local4].item_ref is Equipment)){
_local3.push(icons[_local4]);
} else {
_local1.push(icons[_local4]);
};
};
icons[_local4].addEventListener(MouseEvent.MOUSE_DOWN, clickedIcon);
icons[_local4].addEventListener(MouseEvent.MOUSE_OVER, overIcon);
icons[_local4].addEventListener(MouseEvent.MOUSE_OUT, outIcon);
};
};
_local4++;
};
_local5 = 0;
_local6 = 0;
_local7 = 18;
_local8 = 54;
_local9 = (consumables_lbl.y + _local7);
_local10 = (bg.x + 30);
removeChild(consumables_lbl);
removeChild(weapons_lbl);
removeChild(armor_lbl);
_local4 = 0;
while (_local4 < _local1.length) {
_local5 = Math.floor((_local4 / 12));
_local6 = (_local4 % 12);
_local1[_local4].x = (_local10 + (_local6 * (_local1[_local4].width + icon_gap)));
_local1[_local4].y = (_local9 + (_local5 * (_local1[_local4].height + icon_gap)));
addChild(_local1[_local4]);
_local4++;
};
if (_local1.length){
_local9 = (_local9 + _local8);
addChild(consumables_lbl);
};
weapons_lbl.y = (_local9 - _local7);
_local4 = 0;
while (_local4 < _local2.length) {
_local5 = Math.floor((_local4 / 12));
_local6 = (_local4 % 12);
_local2[_local4].x = (_local10 + (_local6 * (_local2[_local4].width + icon_gap)));
_local2[_local4].y = (_local9 + (_local5 * (_local2[_local4].height + icon_gap)));
addChild(_local2[_local4]);
_local4++;
};
if (_local2.length){
_local9 = (_local9 + _local8);
addChild(weapons_lbl);
};
armor_lbl.y = (_local9 - _local7);
_local4 = 0;
while (_local4 < _local3.length) {
_local5 = Math.floor((_local4 / 12));
_local6 = (_local4 % 12);
_local3[_local4].x = (_local10 + (_local6 * (_local3[_local4].width + icon_gap)));
_local3[_local4].y = (_local9 + (_local5 * (_local3[_local4].height + icon_gap)));
addChild(_local3[_local4]);
_local4++;
};
if (_local3.length){
addChild(armor_lbl);
};
updateSettings();
}
private function setUnselected(_arg1:InventoryIcon, _arg2:Boolean=false):Boolean{
var _local3:Party;
var _local4:Boolean;
_local3 = dm.main.pc_party;
_local4 = true;
if ((((_arg1.item_ref is Consumable)) && (dmf.hasFlag(_local3.lootSettings, LootSettings.CONSUMABLES)))){
_local4 = false;
};
if ((((_arg1.item_ref is Enchantment)) && (dmf.hasFlag(_local3.lootSettings, LootSettings.ENCHANTMENTS)))){
_local4 = false;
};
if (((_arg2) || (_local4))){
_arg1.taking = false;
_arg1.alpha = 0.3;
return (true);
};
return (false);
}
private function removeComparisons():void{
var _local1:ItemComparison;
for each (_local1 in comparisons) {
if (_local1.parent != null){
_local1.parent.removeChild(_local1);
};
};
}
private function overIcon(_arg1:MouseEvent):void{
var _local2:Item;
var _local3:Party;
var _local4:PlayerCharacter;
var _local5:ItemComparison;
var _local6:CharacterPortrait;
if (parent == null){
return;
};
_local2 = _arg1.currentTarget.item_ref;
_local3 = dm.main.pc_party;
if ((_local2 is Equipment)){
removeComparisons();
comparisons = new Array();
for each (_local4 in _local3.members) {
if ((_local4 is PC_Adventurer)){
} else {
_local5 = new ItemComparison(_local4, Equipment(_local2).slot, Equipment(_local2));
comparisons.push(_local5);
_local6 = _local4.portraitRef;
if (_local6 != null){
stage.addChild(_local5);
_local5.x = _local6.x;
_local5.y = _local6.y;
};
};
};
};
}
public function addItemRef(_arg1:Item):int{
var _local2:*;
var _local3:*;
var _local4:*;
if (_arg1 == null){
return (-1);
};
_local2 = 0;
_local3 = 0;
while (_local3 < Party.MAX_OVERFLOW) {
if (icons[_local3] == null){
_local4 = new InventoryIcon(_arg1, tooltipController);
icons.push(_local4);
return (_local3);
};
_local3++;
};
return (-1);
}
public function cleanup():void{
var _local1:*;
settings_btn.removeEventListener(MouseEvent.MOUSE_DOWN, settingsClick);
removeComparisons();
_local1 = 0;
while (_local1 < icons.length) {
icons[_local1].removeEventListener(MouseEvent.MOUSE_OVER, overIcon);
icons[_local1].removeEventListener(MouseEvent.MOUSE_OUT, outIcon);
icons[_local1].removeEventListener(MouseEvent.MOUSE_DOWN, clickedIcon);
icons[_local1].cleanup();
_local1++;
};
}
function clickedIcon(_arg1:MouseEvent):void{
var _local2:InventoryIcon;
_local2 = InventoryIcon(_arg1.currentTarget);
_local2.taking = !(_local2.taking);
if (_local2.taking){
_local2.alpha = 1;
} else {
setUnselected(_local2, true);
};
updateSelectedCount();
}
private function outIcon(_arg1:MouseEvent):void{
removeComparisons();
}
}
}//package
Section 622
//turn_page_sound (turn_page_sound)
package {
import flash.media.*;
public dynamic class turn_page_sound extends Sound {
}
}//package
Section 623
//WarningDialog (WarningDialog)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class WarningDialog extends MovieClip {
public var yes_btn:MovieClip;
public var dlg_text:TextField;
public function WarningDialog(_arg1:String=""){
if (_arg1.length){
setText(_arg1);
};
yes_btn.addEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
}
private function cleanup():void{
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
}
public function setText(_arg1:String):void{
dlg_text.text = _arg1;
}
function clickOkay(_arg1:MouseEvent):void{
yes_btn.removeEventListener(MouseEvent.MOUSE_DOWN, clickOkay);
if (parent != null){
parent.removeChild(this);
cleanup();
} else {
if (((!((stage == null))) && (stage.contains(this)))){
stage.removeChild(this);
cleanup();
};
};
}
}
}//package
Section 624
//Weapon (Weapon)
package {
public class Weapon extends Equipment {
private var _twoHanded:Boolean;// = false
var base_damage_mod:int;// = 0
var base_damage:int;// = 0
private var _damage:int;
static const dagger_base_damage = 14;
static const crossbow_base_damage = 16;
static const axe_base_damage = 22;
static const bow_base_damage = 14;
static const mace_base_damage = 14;
static const spear_base_damage = 20;
static const sword_base_damage = 15;
static const staff_base_damage = 14;
public function Weapon(){
_twoHanded = false;
base_damage = 0;
base_damage_mod = 0;
super();
item_name = "Weapon";
slot = weapon;
grey_name = "Damaged";
}
override public function generateItem(_arg1:int):void{
var _local2:*;
var _local3:*;
_local2 = false;
_local3 = false;
if (item_rarity == Item.green){
if (dmf.randomNum(0, 100) >= 50){
_local3 = true;
} else {
_local2 = true;
};
};
getItemModifiers();
if ((((item_rarity == Item.blue)) || (_local3))){
prefix = rollForPrefix(item_rarity);
};
if ((((item_rarity == Item.blue)) || (_local2))){
suffix = rollForSuffix(item_rarity);
};
if (prefix >= 0){
applyPrefix();
};
if (suffix >= 0){
applySuffix();
};
damage = scaleWeaponDamageForLevel((base_damage * (1 + (base_damage_mod / 100))));
if (((materials.length) && ((item_rarity < Item.purple)))){
material = rollForMaterial(item_rarity, materials);
scaleDamageForMaterial(material);
} else {
material = -1;
};
if (material >= 0){
item_name = ((materials[material] + " ") + item_name);
};
if (prefix >= 0){
item_name = ((prefixes[prefix][0] + " ") + item_name);
};
if (suffix >= 0){
item_name = ((item_name + " of ") + suffixes[suffix][0]);
};
if (item_rarity == Item.grey){
item_name = ((grey_name + " ") + item_name);
};
}
override public function getItemTypeString(){
return ("Weapon");
}
override public function applySuffix():void{
var _local1:*;
_local1 = suffix;
if (_local1 < 0){
return;
};
super.applySuffix();
}
public function get damage():int{
return (this._damage);
}
public function set twoHanded(_arg1:Boolean):void{
this._twoHanded = _arg1;
}
override public function itemStatsString(_arg1:String):String{
_arg1 = (_arg1 + (String(damage) + " damage\n"));
return (super.itemStatsString(_arg1));
}
override public function applyPrefix():void{
var _local1:*;
_local1 = prefix;
if (_local1 < 0){
return;
};
super.applyPrefix();
}
public function scaleWeaponDamageForLevel(_arg1:int):int{
return (scaleWeaponDamageForLevelNew(_arg1, item_level));
}
public function get twoHanded():Boolean{
return (this._twoHanded);
}
public function set damage(_arg1:int):void{
this._damage = _arg1;
}
override public function getItemModifiers():void{
super.getItemModifiers();
prefixes.push(["Staggering", 10]);
prefixes.push(["Unerring", base_accuracy_bonus]);
prefixes.push(["Venomous", 5]);
prefixes.push(["Blinding", 10]);
prefixes.push(["Vampiric", 10]);
suffixes.push(["Lethality", 1]);
}
public function scaleDamageForMaterial(_arg1:int){
var _local2:*;
_local2 = (1 + ((_arg1 + 1) * 0.05));
damage = Math.round((damage * _local2));
}
public static function scaleWeaponDamageForLevelNew(_arg1:int, _arg2:int):int{
var _local3:int;
var _local4 = ??pushnamespace
;
var _local5:Number;
var _local6:Number;
var _local7:*;
_local3 = MonsterCharacter.getHealthMax(_arg2, false);
_local4 = 5;
_local5 = (_local3 / _local4);
_local6 = (_arg1 / sword_base_damage);
_local7 = Math.round((_local5 * _local6));
return (_local7);
}
}
}//package
Section 625
//web_effect (web_effect)
package {
import flash.display.*;
public dynamic class web_effect extends MovieClip {
public function web_effect(){
addFrameScript(0, frame1, 44, frame45);
}
function frame1(){
dm.sound.play(SoundControl.web);
}
function frame45(){
this.stop();
}
}
}//package
Section 626
//web_squirt_sound (web_squirt_sound)
package {
import flash.media.*;
public dynamic class web_squirt_sound extends Sound {
}
}//package
Section 627
//whirlwind_sound (whirlwind_sound)
package {
import flash.media.*;
public dynamic class whirlwind_sound extends Sound {
}
}//package
Section 628
//VolumeControl (VolumeControl)
package {
import flash.events.*;
import flash.display.*;
public class VolumeControl extends MovieClip {
var soundButton:SoundButton;
public var sfx_selector:VolumeSelector;
public var volCloseButton:SimpleButton;
public var global_selector:VolumeSelector;
public var music_selector:VolumeSelector;
public function VolumeControl(_arg1:SoundButton=null):void{
init(_arg1);
if (volCloseButton != null){
volCloseButton.addEventListener(MouseEvent.MOUSE_DOWN, clickedClose);
};
}
public function init(_arg1:SoundButton=null):void{
if (_arg1 != null){
soundButton = _arg1;
};
global_selector.setFrameFromVolume(GlobalVolume.volumeSetting);
sfx_selector.setFrameFromVolume(SoundControl.volumeSetting);
music_selector.setFrameFromVolume(Music.volumeSetting);
}
function clickedClose(_arg1:MouseEvent):void{
volCloseButton.removeEventListener(MouseEvent.MOUSE_DOWN, clickedClose);
if (soundButton != null){
soundButton.removeControl();
} else {
if (stage != null){
this.cleanup();
stage.removeChild(this);
};
};
}
public function adjustVolume(_arg1:VolumeSelector, _arg2:Number):void{
if (_arg1 == global_selector){
GlobalVolume.setVolume(_arg2);
dm.main.saveInterface();
} else {
if (_arg1 == music_selector){
dm.main.setMusicVolume(_arg2);
dm.main.saveInterface();
} else {
if (_arg1 == sfx_selector){
SoundControl.volumeSetting = _arg2;
dm.main.saveInterface();
};
};
};
}
public function cleanup():void{
global_selector.cleanup();
sfx_selector.cleanup();
music_selector.cleanup();
}
}
}//package
Section 629
//VolumeControlMenu (VolumeControlMenu)
package {
public dynamic class VolumeControlMenu extends VolumeControl {
}
}//package
Section 630
//VolumeSelector (VolumeSelector)
package {
import flash.events.*;
import flash.text.*;
import flash.display.*;
public class VolumeSelector extends MovieClip {
const vol_mid = 2;
const vol_off = 0;
const vol_full = 3;
const vol_low = 1;
public var mid:TextField;
public var low:TextField;
public var off:TextField;
public var full:TextField;
public function VolumeSelector():void{
full.addEventListener(MouseEvent.MOUSE_DOWN, clickFull);
mid.addEventListener(MouseEvent.MOUSE_DOWN, clickMid);
low.addEventListener(MouseEvent.MOUSE_DOWN, clickLow);
off.addEventListener(MouseEvent.MOUSE_DOWN, clickOff);
}
private function setFrame(_arg1:int):void{
if (_arg1 == vol_off){
this.gotoAndStop("off");
} else {
if (_arg1 == vol_low){
this.gotoAndStop("low");
} else {
if (_arg1 == vol_mid){
this.gotoAndStop("mid");
} else {
if (_arg1 == vol_full){
this.gotoAndStop("full");
};
};
};
};
}
function clickFull(_arg1:MouseEvent):void{
var _local2:*;
_local2 = GlobalVolume.volumeFull;
setFrame(vol_full);
if (parent != null){
VolumeControl(parent).adjustVolume(this, _local2);
};
}
function clickLow(_arg1:MouseEvent):void{
var _local2:*;
_local2 = GlobalVolume.volumeLow;
setFrame(vol_low);
if (parent != null){
VolumeControl(parent).adjustVolume(this, _local2);
};
}
function clickMid(_arg1:MouseEvent):void{
var _local2:*;
_local2 = GlobalVolume.volumeMid;
setFrame(vol_mid);
if (parent != null){
VolumeControl(parent).adjustVolume(this, _local2);
};
}
public function cleanup():void{
full.removeEventListener(MouseEvent.MOUSE_DOWN, clickFull);
mid.removeEventListener(MouseEvent.MOUSE_DOWN, clickMid);
low.removeEventListener(MouseEvent.MOUSE_DOWN, clickLow);
off.removeEventListener(MouseEvent.MOUSE_DOWN, clickOff);
}
function clickOff(_arg1:MouseEvent):void{
var _local2:*;
_local2 = GlobalVolume.volumeOff;
setFrame(vol_off);
if (parent != null){
VolumeControl(parent).adjustVolume(this, _local2);
};
}
public function setFrameFromVolume(_arg1:Number):void{
if (_arg1 == GlobalVolume.volumeOff){
setFrame(vol_off);
} else {
if (_arg1 == GlobalVolume.volumeLow){
setFrame(vol_low);
} else {
if (_arg1 == GlobalVolume.volumeMid){
setFrame(vol_mid);
} else {
if (_arg1 == GlobalVolume.volumeFull){
setFrame(vol_full);
};
};
};
};
}
}
}//package
Section 631
//VolumeSelectorMenu (VolumeSelectorMenu)
package {
public dynamic class VolumeSelectorMenu extends VolumeSelector {
}
}//package
Section 632
//writing_sound (writing_sound)
package {
import flash.media.*;
public dynamic class writing_sound extends Sound {
}
}//package