Guest User

Untitled

a guest
Nov 22nd, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 291.83 KB | None | 0 0
  1. // Decompiled by AS3 Sorcerer 1.40
  2. // http://www.as3sorcerer.com/
  3.  
  4. //World
  5.  
  6. package {
  7. import flash.display.MovieClip;
  8. import flash.display.Loader;
  9. import flash.display.BitmapData;
  10. import flash.system.ApplicationDomain;
  11. import flash.system.LoaderContext;
  12. import flash.utils.Timer;
  13. import flash.geom.ColorTransform;
  14. import flash.display.DisplayObject;
  15. import flash.events.Event;
  16. import flash.events.TimerEvent;
  17. import flash.events.IOErrorEvent;
  18. import flash.events.ProgressEvent;
  19. import flash.net.URLRequest;
  20. import flash.utils.getDefinitionByName;
  21. import flash.events.MouseEvent;
  22. import flash.geom.Point;
  23. import flash.geom.Rectangle;
  24. import flash.display.Bitmap;
  25. import flash.geom.Matrix;
  26. import flash.media.Sound;
  27. import flash.utils.getQualifiedClassName;
  28. import flash.external.ExternalInterface;
  29. import flash.display.Sprite;
  30. import flash.display.Graphics;
  31. import flash.text.TextFormat;
  32. import flash.filters.GlowFilter;
  33. import flash.utils.*;
  34. import flash.external.*;
  35.  
  36. public class World extends MovieClip {
  37.  
  38. private const TICK_MAX = 24;
  39.  
  40. public var uiLock:Boolean = false;
  41. public var objInfo:Object;
  42. public var objSession:Object;
  43. public var objResponse:Object;
  44. public var objQuestString;
  45. var FEATURE_COLLISION:Boolean = true;
  46. var CELL_MODE:String = "normal";
  47. public var SCALE:Number = 1;
  48. public var WALKSPEED:Number = 8;
  49. var bitWalk:Boolean = false;
  50. var lastWalk:Date;
  51. public var strAreaName:String;
  52. public var strMapName:String;
  53. public var strMapFileName:String;
  54. public var intType:int;
  55. public var intKillCount:int;
  56. public var objLock;
  57. public var objExtra;
  58. public var objHouseData;
  59. public var objGuildData;
  60. public var returnInfo:Object;
  61. public var strFrame:String = "";
  62. public var strPad:String = "";
  63. public var spawnPoint:Object;
  64. var FG:MovieClip;
  65. public var CHARS:MovieClip;
  66. public var TRASH:MovieClip;
  67. public var map:MovieClip;
  68. public var mapBoundsMC:MovieClip = null;
  69. public var zSortArr:Array;
  70. public var ldr_map:Loader;
  71. var preLMC;
  72. var zManager:MovieClip;
  73. public var EFAO:Object;
  74. public var arrEvent:Array;
  75. public var arrEventR:Array;
  76. public var arrSolid:Array;
  77. public var arrSolidR:Array;
  78. public var avatars:Object;
  79. public var myAvatar:Avatar;
  80. public var mondef:Array;
  81. public var monswf:Array;
  82. public var monmap:Array;
  83. public var monsters:Array;
  84. public var combatAnims:Array;
  85. public var staticAnims:Array;
  86. public var bankinfo:Object;
  87. public var shopinfo:Object;
  88. public var shopBuyItem:Object;
  89. public var enhShopID:int = -1;
  90. public var enhShopItems:Array;
  91. public var enhItem:Object;
  92. public var hairshopinfo:Object;
  93. public var mapEvents:Object;
  94. public var adData:Object;
  95. public var cellMap:Object;
  96. private var tbmd:BitmapData;
  97. public var scrollData:Object;
  98. public var loaderD:ApplicationDomain;
  99. public var loaderC:LoaderContext;
  100. public var loaderContents;
  101. public var loaderContentsFileNames;
  102. public var loaderQueue:Array;
  103. public var playerDomains:Object;
  104. public var loaderManager:Object;
  105. public var mapLoadInProgress:Boolean = false;
  106. private var mapW:int = 960;
  107. private var mapH:int = 550;
  108. private var mapNW:int;
  109. private var mapNH:int;
  110. private var mapBmps:Array;
  111. private var mapTimer:Timer;
  112. public var actions:Object;
  113. var restTimer:Timer;
  114. var AATestTimer:Timer;
  115. var connTestTimer:Timer;
  116. var autoActionTimer:Timer;
  117. var afkTimer:Timer;
  118. var mvTimer:Timer;
  119. var mvTimerObj:Object;
  120. var actionTimer:Timer;
  121. var actionMap:Array;
  122. var autoAction:Object;
  123. var actionReady:Boolean = false;
  124. var actionResults:Object;
  125. var actionResultsMon:Object;
  126. var actionID:Number = 0;
  127. var actionIDLimit:Number = 30;
  128. var actionIDMon:Number = 0;
  129. var actionIDLimitMon:Number = 30;
  130. var actionDamage;
  131. var actionRangeSpamTS:Number = 0;
  132. var actionResultID:Number = 0;
  133. var actionResultIDLimit:Number = 30;
  134. var minLatencyOneWay = 20;
  135. var TcpAckDel = 170;
  136. var connMsgOut = false;
  137. public var guildHallData:GuildHall;
  138. public var mData:mapData;
  139. public var cHandle:cutsceneHandler;
  140. public var sController:soundController;
  141. public var chaosNames:Array;
  142. public var lock:Object;
  143. public var invTree:Object;
  144. public var uoTree:Object;
  145. public var monTree:Object;
  146. public var waveTree:Object;
  147. public var questTree:Object;
  148. public var enhPatternTree:Object;
  149. public var defaultCT:ColorTransform;
  150. public var whiteCT:ColorTransform;
  151. public var iconCT:ColorTransform;
  152. public var rarityCA:Array;
  153. public var deathCT:ColorTransform;
  154. public var monCT:ColorTransform;
  155. public var avtCT:ColorTransform;
  156. public var avtWCT:ColorTransform;
  157. public var avtMCT:ColorTransform;
  158. public var avtPCT:ColorTransform;
  159. public var statusPoisonCT:ColorTransform;
  160. public var statusFreezeCT:ColorTransform; //Freeze HP Addon Aura
  161. public var statusStoneCT:ColorTransform;
  162. public var GCD:int = 1500;
  163. public var GCDO:int = 1500;
  164. public var GCDTS:Number = 0;
  165. public var curRoom:int = 1;
  166. public var modID:int = -1;
  167. public var partyID:int = -1;
  168. public var guildID:int = -1;
  169. public var bPvP:Boolean = false;
  170. public var partyMembers:Array;
  171. public var partyOwner:String = "";
  172. public var areaUsers:Array;
  173. public var showHPBar:Boolean = false;
  174. public var rootClass:MovieClip;
  175. public var PVPMaps:Array;
  176. public var PVPQueue:Object;
  177. public var PVPResults:Object;
  178. public var PVPFactions:Array;
  179. public var bookData:Object;
  180. public var arrHouseItemQueue;
  181. public var ldr_House:Loader;
  182. private var ticksum:Number = 0;
  183. private var ticklist;
  184. private var bfps:Boolean = false;
  185. private var fpsTS:Number = 0;
  186. private var fpsQualityCounter:int = 0;
  187. private var fpsArrayQuality:Array;
  188. var arrQuality:Array;
  189.  
  190. public function World(_arg1:MovieClip){
  191. this.objInfo = new Object();
  192. this.objSession = new Object();
  193. this.objResponse = new Object();
  194. this.lastWalk = new Date();
  195. this.spawnPoint = new Object();
  196. this.zSortArr = new Array();
  197. this.ldr_map = new Loader();
  198. this.EFAO = {
  199. zc:0,
  200. zn:1,
  201. xpc:0,
  202. xpn:50,
  203. xpb:false
  204. };
  205. this.avatars = new Object();
  206. this.monsters = new Array();
  207. this.combatAnims = ["Attack1", "Attack2", "Attack3", "Attack4", "Hit", "Knockout", "Getup", "Stab", "Thrash", "Castgood", "Cast1", "Cast2", "Cast3", "Sword/ShieldFight", "Sword/ShieldAttack1", "Sword/ShieldAttack2", "ShieldBlock", "DuelWield/DaggerFight", "DuelWield/DaggerAttack1", "DuelWield/DaggerAttack2", "FistweaponFight", "FistweaponAttack1", "FistweaponAttack2", "PolearmFight", "PolearmAttack1", "PolearmAttack2", "RangedFight", "RangedAttack1", "UnarmedFight", "UnarmedAttack1", "UnarmedAttack2", "KickAttack", "FlipAttack", "Dodge"];
  208. this.staticAnims = ["Fall", "Knockout", "Die"];
  209. this.bankinfo = {
  210. items:[],
  211. hasRequested:{}
  212. };
  213. this.loaderD = new ApplicationDomain(ApplicationDomain.currentDomain);
  214. this.loaderC = new LoaderContext(false, this.loaderD);
  215. this.loaderContents = [];
  216. this.loaderContentsFileNames = [];
  217. this.loaderQueue = [];
  218. this.playerDomains = {};
  219. this.loaderManager = {
  220. i0:{
  221. n:"i0",
  222. loaderData:null,
  223. timer:new Timer(5000, 1),
  224. ldr:new Loader(),
  225. free:true,
  226. url:""
  227. },
  228. i1:{
  229. n:"i1",
  230. loaderData:null,
  231. timer:new Timer(5000, 1),
  232. ldr:new Loader(),
  233. free:true,
  234. url:""
  235. },
  236. i2:{
  237. n:"i2",
  238. loaderData:null,
  239. timer:new Timer(5000, 1),
  240. ldr:new Loader(),
  241. free:true,
  242. url:""
  243. },
  244. i3:{
  245. n:"i3",
  246. loaderData:null,
  247. timer:new Timer(5000, 1),
  248. ldr:new Loader(),
  249. free:true,
  250. url:""
  251. },
  252. i4:{
  253. n:"i4",
  254. loaderData:null,
  255. timer:new Timer(5000, 1),
  256. ldr:new Loader(),
  257. free:true,
  258. url:""
  259. },
  260. i5:{
  261. n:"i5",
  262. loaderData:null,
  263. timer:new Timer(5000, 1),
  264. ldr:new Loader(),
  265. free:true,
  266. url:""
  267. }
  268. };
  269. this.mapNW = this.mapW;
  270. this.mapNH = this.mapH;
  271. this.mapBmps = [];
  272. this.mapTimer = new Timer(2000);
  273. this.actions = new Object();
  274. this.restTimer = new Timer(2000, 1);
  275. this.AATestTimer = new Timer(700, 1);
  276. this.connTestTimer = new Timer(5000, 1);
  277. this.autoActionTimer = new Timer(2000, 1);
  278. this.afkTimer = new Timer(120000, 1);
  279. this.mvTimer = new Timer(1000, 1);
  280. this.actionMap = new Array();
  281. this.actionResults = new Object();
  282. this.actionResultsMon = new Object();
  283. this.chaosNames = new Array();
  284. this.lock = {
  285. loadShop:{
  286. cd:3000,
  287. ts:0
  288. },
  289. loadEnhShop:{
  290. cd:3000,
  291. ts:0
  292. },
  293. loadHairShop:{
  294. cd:3000,
  295. ts:0
  296. },
  297. equipItem:{
  298. cd:1500,
  299. ts:0
  300. },
  301. unequipItem:{
  302. cd:1500,
  303. ts:0
  304. },
  305. buyItem:{
  306. cd:1000,
  307. ts:0
  308. },
  309. sellItem:{
  310. cd:1000,
  311. ts:0
  312. },
  313. getMapItem:{
  314. cd:1000,
  315. ts:0
  316. },
  317. tryQuestComplete:{
  318. cd:1250,
  319. ts:0
  320. },
  321. acceptQuest:{
  322. cd:1000,
  323. ts:0
  324. },
  325. doIA:{
  326. cd:1000,
  327. ts:0
  328. },
  329. rest:{
  330. cd:1900,
  331. ts:0
  332. },
  333. who:{
  334. cd:3000,
  335. ts:0
  336. },
  337. tfer:{
  338. cd:3000,
  339. ts:0
  340. }
  341. };
  342. this.invTree = {};
  343. this.uoTree = {};
  344. this.monTree = {};
  345. this.waveTree = {};
  346. this.questTree = {};
  347. this.enhPatternTree = {};
  348. this.defaultCT = new ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
  349. this.whiteCT = new ColorTransform(1, 1, 1, 1, 0xFF, 0xFF, 0xFF, 0);
  350. this.iconCT = new ColorTransform(0.5, 0.5, 0.5, 1, -50, -50, -50, 0);
  351. this.rarityCA = [0x666666, 0xFFFFFF, 0x66FF00, 2663679, 0xFF00FF, 0xFFCC00, 0xFF0000];
  352. this.deathCT = new ColorTransform(0.7, 0.7, 1, 1, -20, -20, 20, 0);
  353. this.monCT = new ColorTransform(1, 1, 1, 1, 30, 0, 0, 0);
  354. this.avtCT = new ColorTransform(1, 1, 1, 1, 40, 40, 70, 0);
  355. this.avtWCT = new ColorTransform(0, 0, 0, 0, 0xFF, 0xFF, 0xFF, 0);
  356. this.avtMCT = new ColorTransform(0, 0, 0, 0, 30, 0, 0, 0);
  357. this.avtPCT = new ColorTransform(0, 0, 0, 0, 40, 40, 70, 0);
  358. this.statusPoisonCT = new ColorTransform(-0.3, -0.3, -0.3, 0, 0, 20, 0, 0);
  359. this.statusFreezeCT = new ColorTransform(-0.3, -0.3, -0.3, 0, -50, 80, 0xFF, 0); //Freeze Aura Feature
  360. this.statusStoneCT = new ColorTransform(-1.3, -1.3, -1.3, 0, 100, 100, 100, 0);
  361. this.partyMembers = [];
  362. this.areaUsers = [];
  363. this.PVPMaps = [{
  364. nam:"It's Us Or Them",
  365. desc:"This cozy PvP map is ideal for players new to PvP in AQW.",
  366. warzone:"usorthem",
  367. label:"usorthem",
  368. icon:"tower",
  369. hidden:true
  370. }, {
  371. nam:"Bludrut Brawl!",
  372. desc:"A larger map requiring communication, coordination, and a whole lot of DPS.",
  373. warzone:"bludrutbrawl",
  374. label:"bludrutbrawl",
  375. icon:"swords",
  376. hidden:false
  377. }, {
  378. nam:"Chaos Brawl!",
  379. desc:"A larger map requiring communication, coordination, and a whole lot of DPS.",
  380. warzone:"chaosbrawl",
  381. label:"chaosbrawl",
  382. icon:"flag",
  383. hidden:true
  384. /* HP PVP Arenas */
  385. }, {
  386. nam:"Heavens Shot!",
  387. desc:"A ranged only fight, good for Archers and Magicians with a lot of DPS!",
  388. warzone:"heavensshot",
  389. label:"wsg",
  390. icon:"swords",
  391. hidden:false
  392. }, {
  393. nam:"Champions Arena!",
  394. desc:"Join in the ancient war between Champions!",
  395. warzone:"arena",
  396. label:"usorthem",
  397. icon:"tower",
  398. hidden:false
  399. /* End */
  400. }, {
  401. nam:"Frost Brawl!",
  402. desc:"A larger map requiring communication, coordination, and a whole lot of DPS.",
  403. warzone:"frostbrawl",
  404. label:"frostbrawl",
  405. icon:"swords",
  406. hidden:true
  407. }, {
  408. nam:"Camp War!",
  409. desc:"Join in the ancient war between guilds!",
  410. warzone:"war camp",
  411. label:"darkoviapvp",
  412. icon:"flag",
  413. hidden:false
  414. }, {
  415. nam:"Doomwood Arena",
  416. desc:"This arena is for one on one duels.",
  417. warzone:"doomarena",
  418. label:"doomarena",
  419. icon:"swords",
  420. hidden:true
  421. }];
  422. this.PVPQueue = {
  423. warzone:"",
  424. ts:-1,
  425. avgWait:-1
  426. };
  427. this.PVPResults = {
  428. pvpScore:[],
  429. team:0
  430. };
  431. this.PVPFactions = [];
  432. this.arrHouseItemQueue = [];
  433. this.ldr_House = new Loader();
  434. this.ticklist = new Array();
  435. this.fpsArrayQuality = new Array();
  436. this.arrQuality = new Array("LOW", "MEDIUM", "HIGH");
  437. super();
  438. this.rootClass = _arg1;
  439. this.map = new MovieClip();
  440. this.addChild(this.map);
  441. this.CHARS = new MovieClip();
  442. var _local2:DisplayObject = this.addChild(this.CHARS);
  443. this.CHARS.mouseEnabled = false;
  444. _local2.x = 0;
  445. _local2.y = 0;
  446. this.TRASH = new MovieClip();
  447. this.addChild(this.TRASH);
  448. this.TRASH.mouseEnabled = false;
  449. this.TRASH.visible = false;
  450. this.TRASH.y = -1000;
  451. this.zManager = new MovieClip();
  452. this.addChild(this.zManager);
  453. this.FG = new MovieClip();
  454. this.addChild(this.FG);
  455. this.zManager.removeEventListener(Event.ENTER_FRAME, this.onZmanagerEnterFrame);
  456. this.autoActionTimer.removeEventListener("timer", this.autoActionHandler);
  457. this.restTimer.removeEventListener("timer", this.restRequest);
  458. this.AATestTimer.removeEventListener("timer", this.AATest);
  459. this.connTestTimer.removeEventListener("timer", this.connTest);
  460. this.afkTimer.removeEventListener("timer", this.afkTimerHandler);
  461. this.mvTimer.removeEventListener("timer", this.mvTimerHandler);
  462. this.mapTimer.removeEventListener(TimerEvent.TIMER, this.mapResizeCheck);
  463. this.zManager.addEventListener(Event.ENTER_FRAME, this.onZmanagerEnterFrame, false, 0, true);
  464. this.autoActionTimer.addEventListener(TimerEvent.TIMER_COMPLETE, this.autoActionHandler);
  465. this.restTimer.addEventListener("timer", this.restRequest);
  466. this.AATestTimer.addEventListener("timer", this.AATest);
  467. this.connTestTimer.addEventListener("timer", this.connTest);
  468. this.afkTimer.addEventListener("timer", this.afkTimerHandler);
  469. this.mvTimer.addEventListener("timer", this.mvTimerHandler);
  470. this.mapTimer.addEventListener(TimerEvent.TIMER, this.mapResizeCheck, false, 0, true);
  471. this.mapTimer.start();
  472. this.initLoaders();
  473. this.initCutscenes();
  474. }
  475.  
  476. public function initGuildhallData(_arg1:Array):void{
  477. var _local3:*;
  478. trace(("gd: " + _arg1));
  479. var _local2:uint;
  480. while (_local2 < _arg1.length) {
  481. trace(("i: " + _local2));
  482. for (_local3 in _arg1[_local2]) {
  483. trace(((((("gd[" + _local2) + "].[") + _local3) + "]: ") + _arg1[_local2][_local3]));
  484. };
  485. _local2++;
  486. };
  487. this.guildHallData = new GuildHall(_arg1, this.rootClass);
  488. }
  489.  
  490. public function killTimers():void{
  491. this.autoActionTimer.reset();
  492. this.restTimer.reset();
  493. this.AATestTimer.reset();
  494. this.connTestTimer.reset();
  495. this.afkTimer.reset();
  496. this.rootClass.chatF.mute.timer.reset();
  497. this.autoActionTimer.removeEventListener("timer", this.autoActionHandler);
  498. this.restTimer.removeEventListener("timer", this.restRequest);
  499. this.AATestTimer.removeEventListener("timer", this.AATest);
  500. this.connTestTimer.removeEventListener("timer", this.connTest);
  501. this.afkTimer.removeEventListener("timer", this.afkTimerHandler);
  502. this.mvTimer.removeEventListener("timer", this.mvTimerHandler);
  503. this.rootClass.chatF.mute.timer.removeEventListener("timer", this.rootClass.chatF.unmuteMe);
  504. }
  505.  
  506. public function killListeners():void{
  507. this.zManager.removeEventListener(Event.ENTER_FRAME, this.onZmanagerEnterFrame);
  508. removeChild(this.zManager);
  509. }
  510.  
  511. public function queueLoad(_arg1){
  512. _arg1.retries = 1;
  513. this.loaderQueue.push(_arg1);
  514. var _local2:* = this.getFreeLoader();
  515. if (_local2 != null){
  516. this.loadNext(_local2);
  517. };
  518. }
  519.  
  520. public function loaderCallback(_arg1:Event){
  521. var _local2:* = _arg1.target.loader;
  522. var _local3:* = this.getLoaderHost(_local2);
  523. if (_local3 != null){
  524. if (_local3.callBackA != null){
  525. _local3.callBackA(_arg1);
  526. };
  527. };
  528. this.closeLoader(_local3, true);
  529. }
  530.  
  531. public function loaderErrorHandler(_arg1:IOErrorEvent){
  532. var _local2:String = _arg1.toString();
  533. var _local3:String = _local2.substr((_local2.indexOf("URL: ") + 5));
  534. _local3 = _local3.substr(0, (_local3.length - 1));
  535. var _local4:* = this.getLoaderHostByURL(_local3);
  536. if (_local4 != null){
  537. if (_local4.callBackB != null){
  538. _local4.callBackB(_arg1);
  539. };
  540. };
  541. this.closeLoader(_local4, false, false);
  542. }
  543.  
  544. private function loaderProgressHandler(_arg1:Event){
  545. var _local2:* = _arg1.currentTarget;
  546. var _local3:* = this.getLoaderHostByLoaderInfo(_local2);
  547. if (_local3 != null){
  548. _local3.isOpen = true;
  549. };
  550. }
  551.  
  552. private function loaderTimerComplete(_arg1:TimerEvent):void{
  553. var _local2:* = this.getLoaderHostByTimer(Timer(_arg1.currentTarget));
  554. if (_local2 != null){
  555. _local2.timer.reset();
  556. if (!_local2.isOpen){
  557. if (_local2.loaderData.retries-- > 0){
  558. this.loaderQueue.push(_local2.loaderData);
  559. };
  560. this.closeLoader(_local2, false, true);
  561. };
  562. };
  563. }
  564.  
  565. public function getLoaderHost(_arg1){
  566. var _local2:*;
  567. for (_local2 in this.loaderManager) {
  568. if (this.loaderManager[_local2].ldr == _arg1){
  569. return (this.loaderManager[_local2]);
  570. };
  571. };
  572. return (null);
  573. }
  574.  
  575. public function getLoaderHostByLoaderInfo(_arg1):Object{
  576. var _local2:*;
  577. for (_local2 in this.loaderManager) {
  578. if (this.loaderManager[_local2].ldr.contentLoaderInfo == _arg1){
  579. return (this.loaderManager[_local2]);
  580. };
  581. };
  582. return (null);
  583. }
  584.  
  585. public function getLoaderHostByTimer(_arg1:Timer):Object{
  586. var _local2:*;
  587. for (_local2 in this.loaderManager) {
  588. if (this.loaderManager[_local2].timer == _arg1){
  589. return (this.loaderManager[_local2]);
  590. };
  591. };
  592. return (null);
  593. }
  594.  
  595. public function getLoaderHostByURL(_arg1:String):Object{
  596. var _local2:*;
  597. for (_local2 in this.loaderManager) {
  598. if (_arg1.indexOf(this.loaderManager[_local2].url) > -1){
  599. return (this.loaderManager[_local2]);
  600. };
  601. };
  602. return (null);
  603. }
  604.  
  605. public function getFreeLoader():Object{
  606. var _local1:*;
  607. if (this.loaderQueue.length > 0){
  608. for (_local1 in this.loaderManager) {
  609. if (this.loaderManager[_local1].free){
  610. this.loaderManager[_local1].free = false;
  611. return (this.loaderManager[_local1]);
  612. };
  613. };
  614. return (null);
  615. };
  616. return (null);
  617. }
  618.  
  619. public function closeLoader(_arg1:Object, _arg2:Boolean=true, _arg3:Boolean=true, _arg4:Boolean=true):void{
  620. if (_arg3){
  621. try {
  622. _arg1.ldr.unload();
  623. }
  624. catch(e:Error) {
  625. };
  626. };
  627. _arg1.free = true;
  628. _arg1.isOpen = false;
  629. _arg1.loaderData = null;
  630. _arg1.timer.reset();
  631. var _local5:* = this.getFreeLoader();
  632. if (((!((_local5 == null))) && (_arg4))){
  633. this.loadNext(_local5);
  634. };
  635. }
  636.  
  637. public function initLoaders():void{
  638. var _local1:Object;
  639. var _local2:*;
  640. for (_local2 in this.loaderManager) {
  641. _local1 = this.loaderManager[_local2];
  642. _local1.timer.addEventListener(TimerEvent.TIMER_COMPLETE, this.loaderTimerComplete, false, 0, true);
  643. _local1.ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, this.loaderCallback, false, 0, true);
  644. _local1.ldr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, this.loaderErrorHandler, false, 0, true);
  645. _local1.ldr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, this.loaderProgressHandler, false, 0, true);
  646. };
  647. }
  648.  
  649. public function clearLoaders(_arg1:Boolean=false){
  650. var lmi:Object;
  651. var i:* = undefined;
  652. var clearPlayerDomains:Boolean = _arg1;
  653. for (i in this.loaderManager) {
  654. lmi = this.loaderManager[i];
  655. try {
  656. lmi.ldr.close();
  657. }
  658. catch(e:Error) {
  659. };
  660. try {
  661. lmi.ldr.unload();
  662. }
  663. catch(e:Error) {
  664. };
  665. lmi.free = true;
  666. lmi.isOpen = false;
  667. lmi.loaderData = null;
  668. lmi.timer.reset();
  669. lmi.callBackA = null;
  670. lmi.callBackB = null;
  671. };
  672. if (clearPlayerDomains){
  673. this.playerDomains = {};
  674. };
  675. this.loaderD = new ApplicationDomain(ApplicationDomain.currentDomain);
  676. this.loaderC = new LoaderContext(false, this.loaderD);
  677. this.loaderQueue = [];
  678. }
  679.  
  680. public function killLoaders(){
  681. var _local1:Object;
  682. var _local2:*;
  683. for (_local2 in this.loaderManager) {
  684. _local1 = this.loaderManager[_local2];
  685. _local1.free = true;
  686. _local1.isOpen = false;
  687. _local1.loaderData = null;
  688. _local1.timer.reset();
  689. _local1.callBackA = null;
  690. _local1.callBackB = null;
  691. };
  692. this.loaderQueue = [];
  693. }
  694.  
  695. public function loadNext(_arg1:Object){
  696. if (this.loaderQueue.length > 0){
  697. this.loadNextWith(_arg1, this.loaderQueue.shift());
  698. };
  699. }
  700.  
  701. private function loadNextWith(_arg1:Object, _arg2:Object):void{
  702. var _local3:URLRequest;
  703. var _local4:LoaderContext = this.loaderC;
  704. if (_arg1 != null){
  705. _arg1.free = false;
  706. if (_arg2.callBackA != null){
  707. _arg1.callBackA = _arg2.callBackA;
  708. }
  709. else {
  710. _arg1.callBackA = null;
  711. };
  712. if (_arg2.callBackB != null){
  713. _arg1.callBackB = _arg2.callBackB;
  714. }
  715. else {
  716. _arg1.callBackB = null;
  717. };
  718. if (((((!((_arg2.avt == null))) && ((_arg2.avt == this.myAvatar)))) && (!((_arg2.sES == null))))){
  719. _local4 = this.mapPlayerAssetClass(_arg2.sES);
  720. };
  721. _local3 = new URLRequest(_arg2.strFile);
  722. _arg1.ldr.load(_local3, _local4);
  723. _arg1.url = _local3.url;
  724. _arg1.isOpen = false;
  725. _arg1.loaderData = _arg2;
  726. _arg1.timer.reset();
  727. _arg1.timer.start();
  728. }
  729. else {
  730. trace();
  731. trace("** No available loader found, event flow may terminate");
  732. trace();
  733. };
  734. }
  735.  
  736. private function mapPlayerAssetClass(_arg1:String):LoaderContext{
  737. if (this.playerDomains[_arg1] == null){
  738. this.playerDomains[_arg1] = {};
  739. this.playerDomains[_arg1].loaderD = new ApplicationDomain(ApplicationDomain.currentDomain);
  740. this.playerDomains[_arg1].loaderC = new LoaderContext(false, this.playerDomains[_arg1].loaderD);
  741. };
  742. return (this.playerDomains[_arg1].loaderC);
  743. }
  744.  
  745. public function getClass(_arg1:String):Class{
  746. var _local3:Class;
  747. var _local4:String;
  748. var _local2:Object = {};
  749. try {
  750. _local3 = (getDefinitionByName(_arg1) as Class);
  751. if (_local3 != null){
  752. return (_local3);
  753. };
  754. }
  755. catch(e:Error) {
  756. };
  757. try {
  758. _local3 = (this.rootClass.assetsDomain.getDefinition(_arg1) as Class);
  759. if (_local3 != null){
  760. return (_local3);
  761. };
  762. }
  763. catch(e:Error) {
  764. };
  765. try {
  766. _local3 = (this.loaderD.getDefinition(_arg1) as Class);
  767. if (_local3 != null){
  768. return (_local3);
  769. };
  770. }
  771. catch(e:Error) {
  772. };
  773. for (_local4 in this.playerDomains) {
  774. if (this.playerDomains[_local4].loaderD.hasDefinition(_arg1)){
  775. return ((this.playerDomains[_local4].loaderD.getDefinition(_arg1) as Class));
  776. };
  777. };
  778. trace((("getClass() could not find " + _arg1) + "!"));
  779. return (null);
  780. }
  781.  
  782. public function loadMap(_arg1:String){
  783. if (_arg1.indexOf("cdn.aqworlds.com") == -1){
  784. _arg1 = ((this.rootClass.getFilePath() + "maps/") + _arg1);
  785. };
  786. trace(("loadMap: " + _arg1));
  787. this.rootClass.mcConnDetail.showConn("Loading Map Files...");
  788. if (this.map != null){
  789. this.map.gotoAndStop("Wait");
  790. this.removeChild(this.map);
  791. this.map = null;
  792. };
  793. this.ldr_map.contentLoaderInfo.removeEventListener(Event.COMPLETE, this.onMapLoadComplete);
  794. this.ldr_map.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, this.onMapLoadError);
  795. this.ldr_map.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, this.onMapLoadProgress);
  796. this.ldr_map = new Loader();
  797. this.ldr_map.contentLoaderInfo.addEventListener(Event.COMPLETE, this.onMapLoadComplete, false, 0, true);
  798. this.ldr_map.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, this.onMapLoadError, false, 0, true);
  799. this.ldr_map.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, this.onMapLoadProgress, false, 0, true);
  800. this.ldr_map.load(new URLRequest(_arg1));
  801. this.rootClass.clearPopups();
  802. }
  803.  
  804. public function removeMapListeners():void{
  805. this.ldr_map.contentLoaderInfo.removeEventListener(Event.COMPLETE, this.onMapLoadComplete);
  806. this.ldr_map.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, this.onMapLoadError);
  807. this.ldr_map.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, this.onMapLoadProgress);
  808. }
  809.  
  810. private function onMapLoadProgress(_arg1:ProgressEvent):void{
  811. var _local2:int = Math.floor(((_arg1.bytesLoaded / _arg1.bytesTotal) * 100));
  812. this.rootClass.mcConnDetail.showConn((("Loading Map... " + _local2) + "%"));
  813. }
  814.  
  815. private function onMapLoadError(_arg1:IOErrorEvent){
  816. trace(("Mapload failed: " + _arg1));
  817. this.mapLoadInProgress = false;
  818. this.rootClass.mcConnDetail.showError("Loading Map Files... Failed!");
  819. }
  820.  
  821. private function onMapLoadComplete(_arg1:Event){
  822. trace(("Mapload complete: " + _arg1));
  823. trace(_arg1.target.url);
  824. this.rootClass.ui.visible = true;
  825. this.mapLoadInProgress = false;
  826. this.map = MovieClip(this.ldr_map.content);
  827. addChildAt(this.map, 0).x = 0;
  828. this.CHARS.x = 0;
  829. this.resetSpawnPoint();
  830. if (((!((this.mondef == null))) && (this.mondef.length))){
  831. this.initMonsters(this.mondef, this.monmap);
  832. }
  833. else {
  834. this.enterMap();
  835. };
  836. if (this.isMyHouse()){
  837. this.rootClass.ui.mcPopup.fOpen("House");
  838. };
  839. }
  840.  
  841. public function reloadCurrentMap():void{
  842. this.clearMonstersAndProps();
  843. this.loadMap(((this.strMapFileName + "?") + Math.random()));
  844. }
  845.  
  846. public function enterMap():void{
  847. var _local1:* = this.uoTreeLeaf(this.rootClass.sfc.myUserName);
  848. if ((((this.intType == 0)) || ((this.returnInfo == null)))){
  849. this.moveToCell(_local1.strFrame, _local1.strPad);
  850. }
  851. else {
  852. this.moveToCell(this.returnInfo.strCell, this.returnInfo.strPad);
  853. this.returnInfo = null;
  854. };
  855. this.initMapEvents();
  856. this.rootClass.mcConnDetail.hideConn();
  857. this.rootClass.ui.mcInterface.areaList.visible = true;
  858. if (this.myAvatar != null){
  859. this.rootClass.showPortrait(this.myAvatar);
  860. };
  861. }
  862.  
  863. public function setReturnInfo(_arg1:String, _arg2:String, _arg3:String):void{
  864. this.returnInfo = new Object();
  865. this.returnInfo.strMap = _arg1;
  866. this.returnInfo.strCell = _arg2;
  867. this.returnInfo.strPad = _arg3;
  868. }
  869.  
  870. public function exitCell():void{
  871. this.mvTimerKill();
  872. this.exitCombat();
  873. this.rootClass.clearPopups(["House"]);
  874. if (this.myAvatar != null){
  875. this.myAvatar.targets = {};
  876. if (this.myAvatar.pMC != null){
  877. this.myAvatar.pMC.stopWalking();
  878. };
  879. if (this.myAvatar.petMC != null){
  880. this.myAvatar.petMC.stopWalking();
  881. };
  882. if (this.myAvatar.target != null){
  883. this.setTarget(null);
  884. };
  885. };
  886. if (this.strFrame != "Wait"){
  887. this.clearMonstersAndProps();
  888. this.hideAllAvatars();
  889. };
  890. this.rootClass.sfcSocial = false;
  891. this.rootClass.ui.mcInterface.areaList.gotoAndStop("init");
  892. }
  893.  
  894. public function moveToCell(_arg1:String, _arg2:String, _arg3:Boolean=false):void{
  895. var _local4:*;
  896. var _local5:*;
  897. this.afkPostpone();
  898. if ((((((this.objLock == null)) || ((this.objLock[_arg1] == null)))) || ((this.objLock[_arg1] <= this.intKillCount)))){
  899. if (this.uoTree[this.rootClass.sfc.myUserName].freeze == null){
  900. _local4 = [];
  901. this.actionReady = false;
  902. this.bitWalk = false;
  903. _local5 = {};
  904. _local5.strFrame = _arg1;
  905. _local5.strPad = _arg2;
  906. if (_arg2.toLowerCase() != "none"){
  907. _local5.tx = 0;
  908. _local5.ty = 0;
  909. };
  910. this.uoTreeLeafSet(this.rootClass.sfc.myUserName, _local5);
  911. this.strFrame = _arg1;
  912. this.strPad = _arg2;
  913. if ((((this.strAreaName.indexOf("battleon") < 0)) || ((this.strAreaName.indexOf("battleontown") > -1)))){
  914. this.rootClass.menuClose();
  915. };
  916. if (!_arg3){
  917. this.rootClass.sfc.sendXtMessage("zm", "moveToCell", [_arg1, _arg2], "str", this.curRoom);
  918. };
  919. this.exitCell();
  920. this.map.gotoAndPlay("Blank");
  921. };
  922. };
  923. }
  924.  
  925. public function moveToCellByIDa(_arg1:int):void{
  926. this.rootClass.sfc.sendXtMessage("zm", "mtcid", [_arg1], "str", this.curRoom);
  927. }
  928.  
  929. public function moveToCellByIDb(_arg1:int):void{
  930. var _local2:MovieClip;
  931. var _local3:int;
  932. while (_local3 < this.arrEvent.length) {
  933. _local2 = (this.arrEvent[_local3] as MovieClip);
  934. if (((((("tID" in _local2)) && ((_local2.tID == _arg1)))) || ((((_local2.name.indexOf("ia") == 0)) && ((int(_local2.name.substr(2)) == _arg1)))))){
  935. this.moveToCell(_local2.tCell, _local2.tPad, true);
  936. };
  937. _local3++;
  938. };
  939. }
  940.  
  941. public function hideAllAvatars():void{
  942. var _local1:*;
  943. for (_local1 in this.avatars) {
  944. if (((!((this.avatars[_local1] == null))) && (!((this.avatars[_local1].pMC == null))))){
  945. this.avatars[_local1].hideMC();
  946. };
  947. };
  948. }
  949.  
  950. public function clearAllAvatars():void{
  951. var _local1:String;
  952. for (_local1 in this.avatars) {
  953. this.destroyAvatar(Number(_local1));
  954. };
  955. this.avatars = new Object();
  956. }
  957.  
  958. public function clearMonstersAndProps():void{
  959. var _local2:DisplayObject;
  960. var _local3:*;
  961. var _local1:int;
  962. _local1 = 0;
  963. while (_local1 < this.CHARS.numChildren) {
  964. _local2 = this.CHARS.getChildAt(_local1);
  965. if (((_local2.hasOwnProperty("isProp")) && (MovieClip(_local2).isProp))){
  966. this.CHARS.removeChild(_local2);
  967. _local1--;
  968. }
  969. else {
  970. if (((_local2.hasOwnProperty("isHouseItem")) && (MovieClip(_local2).isHouseItem))){
  971. _local2.removeEventListener(MouseEvent.MOUSE_DOWN, this.onHouseItemClick);
  972. this.CHARS.removeChild(_local2);
  973. _local1--;
  974. }
  975. else {
  976. if (((_local2.hasOwnProperty("isMonster")) && (MovieClip(_local2).isMonster))){
  977. MovieClip(_local2).fClose();
  978. _local1--;
  979. };
  980. };
  981. };
  982. _local1++;
  983. };
  984. _local1 = 0;
  985. while (_local1 < this.TRASH.numChildren) {
  986. _local2 = this.TRASH.getChildAt(_local1);
  987. if (((_local2.hasOwnProperty("isMonster")) && (MovieClip(_local2).isMonster))){
  988. MovieClip(_local2).fClose();
  989. _local1--;
  990. };
  991. _local1++;
  992. };
  993. _local1 = 0;
  994. while (_local1 < this.monsters.length) {
  995. this.monsters[_local1].pMC = null;
  996. _local1++;
  997. };
  998. while (this.rootClass.ui.mcPadNames.numChildren) {
  999. _local3 = this.rootClass.ui.mcPadNames.getChildAt(0);
  1000. MovieClip(_local3).stop();
  1001. this.rootClass.ui.mcPadNames.removeChild(_local3);
  1002. };
  1003. }
  1004.  
  1005. public function setMapEvents(_arg1:Object):void{
  1006. this.mapEvents = _arg1;
  1007. }
  1008.  
  1009. public function initMapEvents():void{
  1010. if (((("eventUpdate" in this.map)) && (!((this.mapEvents == null))))){
  1011. this.map.eventUpdate({
  1012. cmd:"event",
  1013. args:this.mapEvents
  1014. });
  1015. };
  1016. this.mapEvents = null;
  1017. }
  1018.  
  1019. public function setCellMap(_arg1:Object):void{
  1020. this.cellMap = _arg1;
  1021. }
  1022.  
  1023. public function updateCellMap(_arg1:Object):void{
  1024. var _local3:String;
  1025. var _local4:MovieClip;
  1026. var _local5:String;
  1027. var _local2:Object = {};
  1028. for (_local3 in this.cellMap) {
  1029. _local2 = this.cellMap[_local3];
  1030. if (((!((_local2.ias == null))) && (!((_local2.ias[_arg1.ID] == null))))){
  1031. for (_local5 in _arg1) {
  1032. _local2.ias[_arg1.ID][_local5] = _arg1[_local5];
  1033. };
  1034. };
  1035. };
  1036. try {
  1037. _local4 = MovieClip(this.CHARS.getChildByName(("ia" + _arg1.ID)));
  1038. _local4.update();
  1039. return;
  1040. }
  1041. catch(e:Error) {
  1042. };
  1043. try {
  1044. _local4 = MovieClip(this.map.getChildByName(("ia" + _arg1.ID)));
  1045. _local4.update();
  1046. }
  1047. catch(e:Error) {
  1048. };
  1049. }
  1050.  
  1051. public function onWalkClick():void{
  1052. var aura:Object;
  1053. var p:Point;
  1054. var mvPT:* = undefined;
  1055. var cLeaf:Object = this.myAvatar.dataLeaf;
  1056. for each (aura in cLeaf.auras) {
  1057. try {
  1058. if (aura.cat != null){
  1059. if (aura.cat == "stun"){
  1060. return;
  1061. };
  1062. if (aura.cat == "hex"){
  1063. return;
  1064. };
  1065. if (aura.cat == "stone"){
  1066. return;
  1067. };
  1068. if (aura.cat == "freeze"){
  1069. return;
  1070. };
  1071. if (aura.cat == "disabled"){
  1072. return;
  1073. };
  1074. if (aura.cat == "silenced"){
  1075. return;
  1076. };
  1077. };
  1078. }
  1079. catch(e:Error) {
  1080. trace(("world.onWalkClick > " + e));
  1081. };
  1082. };
  1083. p = new Point(mouseX, mouseY);
  1084. if (this.bitWalk){
  1085. this.afkPostpone();
  1086. if ((((((((mouseX >= 0)) && ((mouseX <= 960)))) && ((mouseY >= 0)))) && ((mouseY <= 500)))){
  1087. p = this.CHARS.globalToLocal(p);
  1088. p.x = Math.round(p.x);
  1089. p.y = Math.round(p.y);
  1090. mvPT = this.myAvatar.pMC.simulateTo(p.x, p.y, this.WALKSPEED);
  1091. if (mvPT != null){
  1092. this.myAvatar.pMC.walkTo(mvPT.x, mvPT.y, this.WALKSPEED);
  1093. if (this.bPvP){
  1094. this.pushMove(this.myAvatar.pMC, mvPT.x, mvPT.y, this.WALKSPEED);
  1095. }
  1096. else {
  1097. if (this.clickOnEventTest(mvPT.x, mvPT.y)){
  1098. this.pushMove(this.myAvatar.pMC, mvPT.x, mvPT.y, this.WALKSPEED);
  1099. }
  1100. else {
  1101. this.moveRequest({
  1102. mc:this.myAvatar.pMC,
  1103. tx:mvPT.x,
  1104. ty:mvPT.y,
  1105. sp:this.WALKSPEED
  1106. });
  1107. };
  1108. };
  1109. };
  1110. };
  1111. };
  1112. }
  1113.  
  1114. public function clickOnEventTest(_arg1:int, _arg2:int):Boolean{
  1115. var _local3:Rectangle = this.myAvatar.pMC.shadow.getBounds(this);
  1116. var _local4:Rectangle = new Rectangle();
  1117. _local3.x = (_arg1 - (_local3.width / 2));
  1118. _local3.y = (_arg2 - (_local3.height / 2));
  1119. var _local5:int;
  1120. while (_local5 < this.arrEvent.length) {
  1121. _local4 = this.arrEvent[_local5].shadow.getBounds(this);
  1122. if (_local3.intersects(_local4)){
  1123. return (true);
  1124. };
  1125. _local5++;
  1126. };
  1127. return (false);
  1128. }
  1129.  
  1130. public function moveRequest(_arg1:Object):void{
  1131. if (!this.mvTimer.running){
  1132. this.pushMove(_arg1.mc, _arg1.tx, _arg1.ty, _arg1.sp);
  1133. this.mvTimer.reset();
  1134. this.mvTimer.start();
  1135. }
  1136. else {
  1137. this.mvTimerObj = _arg1;
  1138. };
  1139. }
  1140.  
  1141. public function mvTimerHandler(_arg1:TimerEvent):void{
  1142. var _local2:Object = {};
  1143. if (this.mvTimerObj != null){
  1144. this.pushMove(this.mvTimerObj.mc, this.mvTimerObj.tx, this.mvTimerObj.ty, this.mvTimerObj.sp);
  1145. this.mvTimerObj = null;
  1146. this.mvTimer.reset();
  1147. this.mvTimer.start();
  1148. };
  1149. }
  1150.  
  1151. public function mvTimerKill():void{
  1152. this.mvTimer.reset();
  1153. this.mvTimerObj = null;
  1154. }
  1155.  
  1156. public function pushMove(_arg1:MovieClip, _arg2:int, _arg3:int, _arg4:int){
  1157. var _local5:* = {};
  1158. _local5.tx = int(_arg2);
  1159. _local5.ty = int(_arg3);
  1160. _local5.sp = int(_arg4);
  1161. this.uoTreeLeafSet(this.rootClass.sfc.myUserName, _local5);
  1162. this.rootClass.sfc.sendXtMessage("zm", "mv", [_arg2, _arg3, _arg4], "str", this.curRoom);
  1163. }
  1164.  
  1165. public function monstersToPads(){
  1166. var _local1:*;
  1167. var _local2:*;
  1168. for (_local1 in this.monsters) {
  1169. _local2 = this.monsters[_local1];
  1170. if (((!((_local2.objData == null))) && ((_local2.objData.strFrame == this.strFrame)))){
  1171. _local2.pMC.walkTo(_local2.pMC.ox, _local2.pMC.oy, (this.WALKSPEED * 1.4));
  1172. };
  1173. };
  1174. }
  1175.  
  1176. public function updatePadNames(){
  1177. var _local2:*;
  1178. var _local1:int;
  1179. while (_local1 < this.rootClass.ui.mcPadNames.numChildren) {
  1180. _local2 = MovieClip(this.rootClass.ui.mcPadNames.getChildAt(_local1));
  1181. if ((((((this.objLock == null)) || ((this.objLock[_local2.tCell] == null)))) || ((this.objLock[_local2.tCell] <= this.intKillCount)))){
  1182. _local2.cnt.lock.visible = false;
  1183. }
  1184. else {
  1185. _local2.cnt.lock.visible = true;
  1186. };
  1187. _local1++;
  1188. };
  1189. }
  1190.  
  1191. public function cellSetup(_arg1:Number, _arg2:Number, _arg3:String):void{
  1192. var _local4:Bitmap;
  1193. var _local9:DisplayObject;
  1194. var _local10:uint;
  1195. var _local11:DisplayObject;
  1196. var _local12:*;
  1197. var _local13:Array;
  1198. var _local14:Avatar;
  1199. var _local15:*;
  1200. trace("cellSetup");
  1201. this.CELL_MODE = _arg3;
  1202. this.SCALE = _arg1;
  1203. this.WALKSPEED = _arg2;
  1204. this.arrSolid = new Array();
  1205. this.arrEvent = new Array();
  1206. var _local5:BitmapData = new BitmapData(960, 550, true, 0);
  1207. var _local6:Array = [];
  1208. trace(("extra: " + this.objExtra["bMonName"]));
  1209. var _local7 = (Number(this.objExtra["bMonName"]) == 1);
  1210. var _local8:int;
  1211. while (_local8 < this.map.numChildren) {
  1212. _local9 = this.map.getChildAt(_local8);
  1213. if ((_local9 is MovieClip)){
  1214. if (MovieClip(_local9).hasPads){
  1215. trace("movieclip has pads");
  1216. _local10 = 0;
  1217. while (_local10 < MovieClip(_local9).numChildren) {
  1218. _local11 = MovieClip(_local9).getChildAt(_local10);
  1219. if ((((((_local11 is MovieClip)) && (MovieClip(_local11).isEvent))) && (!(MovieClip(_local11).isProp)))){
  1220. this.arrEvent.push(MovieClip(_local11));
  1221. };
  1222. if ((((_local11 is MovieClip)) && (MovieClip(_local11).isSolid))){
  1223. this.arrSolid.push(MovieClip(_local9));
  1224. };
  1225. _local10++;
  1226. };
  1227. };
  1228. };
  1229. if ((((_local9 is MovieClip)) && (MovieClip(_local9).isSolid))){
  1230. this.arrSolid.push(MovieClip(_local9));
  1231. };
  1232. if ((((_local9 is MovieClip)) && (("walk" in _local9)))){
  1233. MovieClip(_local9).btnWalkingArea.useHandCursor = false;
  1234. };
  1235. if ((((((_local9 is MovieClip)) && (MovieClip(_local9).isEvent))) && (!(MovieClip(_local9).isProp)))){
  1236. this.arrEvent.push(MovieClip(_local9));
  1237. };
  1238. if ((((_local9 is MovieClip)) && (MovieClip(_local9).isMonster))){
  1239. _local12 = [];
  1240. _local13 = this.getMonsters(MovieClip(_local9).MonMapID);
  1241. for each (_local14 in _local13) {
  1242. if (_local14 == null){
  1243. trace("No Monster Definition found for Pad!");
  1244. }
  1245. else {
  1246. _local14.pMC = this.createMonsterMC(MovieClip(_local9), _local14.objData.MonID, _local7);
  1247. _local14.pMC.scale(this.SCALE);
  1248. _local14.pMC.pAV = _local14;
  1249. _local14.pMC.setData();
  1250. if (_local14.dataLeaf == null){
  1251. this.TRASH.addChild(_local14.pMC);
  1252. };
  1253. };
  1254. };
  1255. };
  1256. if ((((_local9 is MovieClip)) && (MovieClip(_local9).isProp))){
  1257. _local15 = this.CHARS.addChild(_local9);
  1258. if (MovieClip(_local15).isEvent){
  1259. this.arrEvent.push(MovieClip(_local15));
  1260. MovieClip(_local15).isEvent = false;
  1261. };
  1262. _local8--;
  1263. };
  1264. if ((((((((((_local9 is MovieClip)) && ((_local9.width > 700)))) && (!(("isSolid" in _local9))))) && (!(("walk" in _local9))))) && (!(("btnSkip" in _local9))))){
  1265. MovieClip(_local9).mouseEnabled = false;
  1266. MovieClip(_local9).mouseChildren = false;
  1267. };
  1268. if ((((((((((_local9 is MovieClip)) && ((_local9.width >= 960)))) && (!(("isSolid" in _local9))))) && (!(("walk" in _local9))))) && (!(("btnSkip" in _local9))))){
  1269. };
  1270. _local8++;
  1271. };
  1272. this.buildBoundingRects();
  1273. if (this.map.bounds != null){
  1274. this.mapBoundsMC = (this.map.getChildByName("bounds") as MovieClip);
  1275. };
  1276. this.rebuildMapBMP(this.map);
  1277. this.playerInit();
  1278. this.updateMonsters();
  1279. this.updatePadNames();
  1280. if (this.objHouseData != null){
  1281. this.updateHouseItems();
  1282. };
  1283. if (this.guildHallData != null){
  1284. this.guildHallData.updateInterior();
  1285. };
  1286. }
  1287.  
  1288. private function buildBoundingRects():void{
  1289. var _local2:Rectangle;
  1290. var _local3:MovieClip;
  1291. var _local1:int;
  1292. this.arrEventR = [];
  1293. this.arrSolidR = [];
  1294. _local1 = 0;
  1295. while (_local1 < this.arrEvent.length) {
  1296. _local3 = this.arrEvent[_local1];
  1297. _local2 = _local3.getBounds(this.rootClass.stage);
  1298. this.arrEventR.push(_local2);
  1299. _local1++;
  1300. };
  1301. _local1 = 0;
  1302. while (_local1 < this.arrSolid.length) {
  1303. _local3 = this.arrSolid[_local1];
  1304. _local2 = _local3.getBounds(this.rootClass.stage);
  1305. this.arrSolidR.push(_local2);
  1306. _local1++;
  1307. };
  1308. }
  1309.  
  1310. public function killWalkObjects():void{
  1311. var _local2:DisplayObject;
  1312. var _local1:int;
  1313. while (_local1 < this.map.numChildren) {
  1314. _local2 = this.map.getChildAt(_local1);
  1315. if ((((_local2 is MovieClip)) && (MovieClip(_local2).isEvent))){
  1316. removeEventListener("enter", MovieClip(_local2).onEnter);
  1317. };
  1318. _local1++;
  1319. };
  1320. }
  1321.  
  1322. public function exitQuest():void{
  1323. if (this.returnInfo != null){
  1324. this.rootClass.sfc.sendXtMessage("zm", "cmd", ["tfer", this.rootClass.sfc.myUserName, this.returnInfo.strMap, this.returnInfo.strCell, this.returnInfo.strPad], "str", this.curRoom);
  1325. };
  1326. }
  1327.  
  1328. public function gotoTown(_arg1:String, _arg2:String, _arg3:String):void{
  1329. var _local4:* = this.uoTree[this.rootClass.sfc.myUserName];
  1330. if (_local4.intState == 0){
  1331. this.rootClass.chatF.pushMsg("warning", "You are dead!", "SERVER", "", 0);
  1332. }
  1333. else {
  1334. if (((!(this.rootClass.world.myAvatar.invLoaded)) || (!(this.rootClass.world.myAvatar.pMC.artLoaded())))){
  1335. this.rootClass.MsgBox.notify("Character still being loaded.");
  1336. }
  1337. else {
  1338. if (this.coolDown("tfer")){
  1339. this.rootClass.MsgBox.notify(("Joining " + _arg1));
  1340. this.setReturnInfo(_arg1, _arg2, _arg3);
  1341. this.rootClass.sfc.sendXtMessage("zm", "cmd", ["tfer", this.rootClass.sfc.myUserName, _arg1, _arg2, _arg3], "str", this.curRoom);
  1342. if ((((this.strAreaName.indexOf("battleon") < 0)) || ((this.strAreaName.indexOf("battleontown") > -1)))){
  1343. this.rootClass.menuClose();
  1344. };
  1345. }
  1346. else {
  1347. this.rootClass.MsgBox.notify("You must wait 5 seconds before joining another map.");
  1348. };
  1349. };
  1350. };
  1351. }
  1352.  
  1353. public function gotoQuest(_arg1:String, _arg2:String, _arg3:String):void{
  1354. this.gotoTown(_arg1, _arg2, _arg3);
  1355. }
  1356.  
  1357. public function openApop(_arg1){
  1358. var _local2:MovieClip;
  1359. if (((this.isMovieFront("Apop")) || (((!(("frame" in _arg1))) || (((("frame" in _arg1)) && (("cnt" in _arg1)))))))){
  1360. this.rootClass.menuClose();
  1361. _local2 = this.attachMovieFront("Apop");
  1362. _local2.update(_arg1);
  1363. };
  1364. }
  1365.  
  1366. public function setSpawnPoint(_arg1, _arg2):void{
  1367. this.spawnPoint.strFrame = _arg1;
  1368. this.spawnPoint.strPad = _arg2;
  1369. }
  1370.  
  1371. public function resetSpawnPoint():void{
  1372. this.spawnPoint.strFrame = "Enter";
  1373. this.spawnPoint.strPad = "Spawn";
  1374. }
  1375.  
  1376. public function initObjExtra(_arg1:String):void{
  1377. var _local2:Array;
  1378. var _local3:int;
  1379. var _local4:Array;
  1380. this.objExtra = new Object();
  1381. if (((!((_arg1 == null))) && (!((_arg1 == ""))))){
  1382. _local2 = _arg1.split(",");
  1383. _local3 = 0;
  1384. while (_local3 < _local2.length) {
  1385. _local4 = _local2[_local3].split("=");
  1386. this.objExtra[_local4[0]] = _local4[1];
  1387. _local3++;
  1388. };
  1389. };
  1390. }
  1391.  
  1392. public function initObjInfo(_arg1:String):void{
  1393. var _local2:Array;
  1394. var _local3:int;
  1395. var _local4:Array;
  1396. this.objInfo = new Object();
  1397. if (((!((_arg1 == null))) && (!((_arg1 == ""))))){
  1398. _local2 = _arg1.split(",");
  1399. _local3 = 0;
  1400. while (_local3 < _local2.length) {
  1401. _local4 = _local2[_local3].split("=");
  1402. this.objInfo[_local4[0]] = _local4[1];
  1403. _local3++;
  1404. };
  1405. };
  1406. }
  1407.  
  1408. private function rasterize(_arg1:Array, _arg2:Boolean=false):void{
  1409. var _local5:Object;
  1410. var _local6:Point;
  1411. var _local7:Matrix;
  1412. var _local8:String;
  1413. var _local9:DisplayObject;
  1414. trace("rasterize");
  1415. this.mapNW = this.rootClass.stage.stageWidth;
  1416. trace("line 572");
  1417. var _local3:Number = (this.mapNW / this.mapW);
  1418. var _local4:int;
  1419. this.mapNH = Math.round((this.mapH * _local3));
  1420. trace("line 577");
  1421. for each (_local5 in _arg1) {
  1422. _local5.child.x = _local5.x;
  1423. if (_local5.bmd != null){
  1424. _local5.bmd.dispose();
  1425. };
  1426. _local5.bmd = new BitmapData(this.mapNW, this.mapNH, true, 0x999999);
  1427. _local6 = new Point(0, 0);
  1428. _local6 = _local5.child.globalToLocal(_local6);
  1429. _local7 = new Matrix((_local3 * _local5.child.transform.matrix.a), 0, 0, (_local3 * _local5.child.transform.matrix.d), -(((_local6.x * _local3) * _local5.child.transform.matrix.a)), -(((_local6.y * _local3) * _local5.child.transform.matrix.d)));
  1430. _local5.bmd.draw(_local5.child, _local7, _local5.child.transform.colorTransform, null, new Rectangle(0, 0, this.mapNW, this.mapNH), false);
  1431. _local5.bm = new Bitmap(_local5.bmd);
  1432. _local8 = String(("bmp" + _local4));
  1433. _local9 = _local5.child.parent.getChildByName(_local8);
  1434. if (_local9 != null){
  1435. _local5.child.parent.removeChild(_local9);
  1436. };
  1437. _local5.bmDO = _local5.child.parent.addChildAt(_local5.bm, (_local5.child.parent.getChildIndex(_local5.child) + 1));
  1438. _local5.bmDO.name = _local8;
  1439. _local5.bmDO.width = this.mapW;
  1440. _local5.bmDO.height = this.mapH;
  1441. _local5.child.visible = false;
  1442. if (_arg2){
  1443. _local5.child.x = (_local5.child.x + 1200);
  1444. };
  1445. _local4++;
  1446. };
  1447. }
  1448.  
  1449. private function rebuildMapBMP(_arg1:MovieClip):void{
  1450. var _local2:MovieClip;
  1451. var _local3:int;
  1452. this.clearMapBmps();
  1453. _local3 = 0;
  1454. while (_local3 < _arg1.numChildren) {
  1455. _local2 = (_arg1.getChildAt(_local3) as MovieClip);
  1456. if ((((((((((((((((((((((((_local2 is MovieClip)) && ((_local2.width >= 960)))) && ((_local2.name.toLowerCase().indexOf("bmp") == -1)))) && ((_local2.name.toLowerCase().indexOf("cs") == -1)))) && ((_local2.name.toLowerCase().indexOf("bounds") == -1)))) && (((((_local2 as MovieClip) == null)) || ((MovieClip(_local2).totalFrames < 15)))))) && (!(("isSolid" in _local2))))) && (!(("isFloor" in _local2))))) && (!(("isWall" in _local2))))) && (!(("walk" in _local2))))) && (!(("btnSkip" in _local2))))) && (!(("noBmp" in _local2))))){
  1457. trace(("RASTERIZING " + _local2.name));
  1458. this.mapBmps.push({
  1459. child:_local2,
  1460. x:_local2.x,
  1461. bmDO:null
  1462. });
  1463. };
  1464. _local3++;
  1465. };
  1466. this.rasterize(this.mapBmps);
  1467. }
  1468.  
  1469. private function mapResizeCheck(_arg1:TimerEvent):void{
  1470. if (((!((this.map == null))) && ((this.mapBmps.length > 0)))){
  1471. if (this.mapNW != this.rootClass.stage.stageWidth){
  1472. this.rasterize(this.mapBmps);
  1473. };
  1474. };
  1475. }
  1476.  
  1477. private function clearMapBmps():void{
  1478. var _local1:Object;
  1479. if (this.mapBmps.length > 0){
  1480. for each (_local1 in this.mapBmps) {
  1481. _local1.bmDO.parent.removeChild(_local1.bmDO);
  1482. if (_local1.bmd != null){
  1483. _local1.bmd.dispose();
  1484. };
  1485. _local1.child = null;
  1486. _local1.bmd = null;
  1487. _local1.bm = null;
  1488. };
  1489. };
  1490. this.mapBmps = [];
  1491. }
  1492.  
  1493. public function initMap():mapData{
  1494. this.mData = new mapData(this.rootClass);
  1495. return (this.mData);
  1496. }
  1497.  
  1498. public function initCutscenes():cutsceneHandler{
  1499. this.cHandle = new cutsceneHandler(this.rootClass);
  1500. return (this.cHandle);
  1501. }
  1502.  
  1503. public function initSound(_arg1:Sound):soundController{
  1504. this.sController = new soundController(_arg1, this.rootClass);
  1505. return (this.sController);
  1506. }
  1507.  
  1508. public function gotoHouse(_arg1:String):void{
  1509. _arg1 = _arg1.toLowerCase();
  1510. if (((!((this.objHouseData == null))) && ((this.objHouseData.unm == _arg1)))){
  1511. return;
  1512. };
  1513. this.rootClass.sfc.sendXtMessage("zm", "house", [_arg1], "str", 1);
  1514. }
  1515.  
  1516. public function isHouseEquipped():Boolean{
  1517. var _local1:int;
  1518. while (_local1 < this.myAvatar.houseitems.length) {
  1519. if (this.myAvatar.houseitems[_local1].bEquip == 1){
  1520. return (true);
  1521. };
  1522. _local1++;
  1523. };
  1524. return (false);
  1525. }
  1526.  
  1527. public function isMyHouse(){
  1528. return (((!((this.objHouseData == null))) && ((this.objHouseData.unm == this.myAvatar.objData.strUsername.toLowerCase()))));
  1529. }
  1530.  
  1531. public function showHouseOptions(_arg1:String):void{
  1532. var _local2:MovieClip = this.rootClass.ui.mcPopup.mcHouseOptions;
  1533. switch (_arg1){
  1534. case "default":
  1535. case "save":
  1536. default:
  1537. _local2.visible = true;
  1538. _local2.bg.x = 0;
  1539. _local2.cnt.x = 0;
  1540. _local2.tTitle.x = 5;
  1541. _local2.bExpand.x = 190;
  1542. _local2.bg.visible = true;
  1543. _local2.cnt.visible = true;
  1544. _local2.tTitle.visible = true;
  1545. _local2.bExpand.visible = false;
  1546. return;
  1547. case "hide":
  1548. _local2.visible = true;
  1549. _local2.bg.x = 181;
  1550. _local2.cnt.x = 181;
  1551. _local2.tTitle.x = 186;
  1552. _local2.bExpand.x = 120;
  1553. _local2.bg.visible = false;
  1554. _local2.cnt.visible = false;
  1555. _local2.tTitle.visible = false;
  1556. _local2.bExpand.visible = true;
  1557. };
  1558. }
  1559.  
  1560. public function hideHouseOptions():void{
  1561. var _local2:int;
  1562. var _local1:MovieClip = this.rootClass.ui.mcPopup.mcHouseOptions;
  1563. if (_local1.visible){
  1564. _local2 = 0;
  1565. while (_local2 < _local1.numChildren) {
  1566. _local1.getChildAt(_local2).x = 190;
  1567. _local2++;
  1568. };
  1569. };
  1570. _local1.visible = false;
  1571. }
  1572.  
  1573. public function onHouseOptionsDesignClick(_arg1:MouseEvent):void{
  1574. this.rootClass.mixer.playSound("Click");
  1575. this.toggleHouseEdit();
  1576. }
  1577.  
  1578. public function onHouseOptionsSaveClick(_arg1:MouseEvent):void{
  1579. this.rootClass.mixer.playSound("Click");
  1580. this.saveHouseSetup();
  1581. }
  1582.  
  1583. public function onHouseOptionsHideClick(_arg1:MouseEvent):void{
  1584. this.rootClass.mixer.playSound("Click");
  1585. this.showHouseOptions("hide");
  1586. }
  1587.  
  1588. public function onHouseOptionsExpandClick(_arg1:MouseEvent):void{
  1589. this.rootClass.mixer.playSound("Click");
  1590. this.showHouseOptions("default");
  1591. }
  1592.  
  1593. public function onHouseOptionsFloorClick(_arg1:MouseEvent):void{
  1594. this.rootClass.mixer.playSound("Click");
  1595. this.showHouseInventory(70);
  1596. }
  1597.  
  1598. public function onHouseOptionsWallClick(_arg1:MouseEvent):void{
  1599. this.rootClass.mixer.playSound("Click");
  1600. this.showHouseInventory(72);
  1601. }
  1602.  
  1603. public function onHouseOptionsMiscClick(_arg1:MouseEvent):void{
  1604. this.rootClass.mixer.playSound("Click");
  1605. this.showHouseInventory(73);
  1606. }
  1607.  
  1608. public function onHouseOptionsHouseClick(_arg1:MouseEvent):void{
  1609. this.rootClass.mixer.playSound("Click");
  1610. this.gotoTown("buyhouse", "Enter", "Spawn");
  1611. }
  1612.  
  1613. public function showHouseInventory(_arg1:int){
  1614. if (this.myAvatar.houseitems != null){
  1615. this.sendLoadShopRequest(_arg1);
  1616. };
  1617. }
  1618.  
  1619. public function toggleHouseEdit():void{
  1620. if (((this.isMyHouse()) && (!((this.myAvatar.houseitems == null))))){
  1621. if (this.rootClass.ui.mcPopup.mcHouseMenu.visible){
  1622. this.rootClass.ui.mcPopup.mcHouseMenu.hideEditMenu();
  1623. }
  1624. else {
  1625. this.rootClass.ui.mcPopup.mcHouseMenu.showEditMenu();
  1626. };
  1627. };
  1628. }
  1629.  
  1630. public function loadHouseInventory(){
  1631. this.rootClass.sfc.sendXtMessage("zm", "loadHouseInventory", [], "str", this.curRoom);
  1632. }
  1633.  
  1634. public function redeemCode(_arg1):void{
  1635. this.rootClass.sfc.sendXtMessage("zm", "redeemCode", [_arg1], "str", this.curRoom);
  1636. }
  1637.  
  1638. public function updateHouseItems():void{
  1639. var _local1:int;
  1640. var _local2:Object;
  1641. if (this.objHouseData != null){
  1642. if (this.isMyHouse()){
  1643. this.initEquippedItems(this.objHouseData.arrPlacement);
  1644. };
  1645. _local1 = 0;
  1646. while (_local1 < this.objHouseData.arrPlacement.length) {
  1647. if (this.strFrame == this.objHouseData.arrPlacement[_local1].c){
  1648. _local2 = this.getHouseItem(this.objHouseData.arrPlacement[_local1].ID);
  1649. if (_local2 != null){
  1650. this.loadHouseItem(_local2, this.objHouseData.arrPlacement[_local1].x, this.objHouseData.arrPlacement[_local1].y);
  1651. };
  1652. };
  1653. _local1++;
  1654. };
  1655. };
  1656. }
  1657.  
  1658. public function attachHouseItem(_arg1:Object):void{
  1659. var _local2:Class = (this.loaderD.getDefinition(_arg1.item.sLink) as Class);
  1660. var _local3:* = new (_local2)();
  1661. _local3.x = _arg1.x;
  1662. _local3.y = _arg1.y;
  1663. _local3.ItemID = _arg1.item.ItemID;
  1664. _local3.item = _arg1.item;
  1665. _local3.isHouseItem = true;
  1666. _local3.isStable = false;
  1667. _local3.addEventListener(MouseEvent.MOUSE_DOWN, this.onHouseItemClick, false, 0, true);
  1668. var _local4:MovieClip = (this.CHARS.addChild(_local3) as MovieClip);
  1669. _local4.name = ("mc" + getQualifiedClassName(_local4));
  1670. this.houseItemValidate(_local3);
  1671. }
  1672.  
  1673. public function onHouseItemClick(_arg1:Event):void{
  1674. var _local2:MovieClip = (_arg1.currentTarget as MovieClip);
  1675. if (((this.isMyHouse()) && (this.rootClass.ui.mcPopup.mcHouseMenu.visible))){
  1676. this.rootClass.ui.mcPopup.mcHouseMenu.drawItemHandle(MovieClip(_arg1.currentTarget));
  1677. this.rootClass.ui.mcPopup.mcHouseMenu.onHandleMoveClick(_arg1.clone());
  1678. }
  1679. else {
  1680. if ((((_local2.btnButton == null)) || (!(_local2.btnButton.hasEventListener(MouseEvent.CLICK))))){
  1681. this.onWalkClick();
  1682. };
  1683. };
  1684. }
  1685.  
  1686. public function houseItemValidate(_arg1:MovieClip):void{
  1687. var _local3:int;
  1688. var _local4:DisplayObject;
  1689. var _local2:* = this.getHouseItem(_arg1.ItemID);
  1690. if (_local2.sType == "Floor Item"){
  1691. _arg1.isStable = false;
  1692. _arg1.addEventListener(Event.ENTER_FRAME, this.onHouseItemEnterFrame);
  1693. }
  1694. else {
  1695. if (_local2.sType == "Wall Item"){
  1696. _arg1.isStable = true;
  1697. _local3 = 0;
  1698. while (_local3 < this.map.numChildren) {
  1699. _local4 = this.map.getChildAt(_local3);
  1700. if ((((((_local4 is MovieClip)) && (MovieClip(_local4).isFloor))) && (MovieClip(_local4).hitTestObject(_arg1)))){
  1701. _arg1.isStable = false;
  1702. break;
  1703. };
  1704. _local3++;
  1705. };
  1706. if (!_arg1.isStable){
  1707. _arg1.transform.colorTransform = new ColorTransform(1, 1, 1, 1, 100, 0, 0, 0);
  1708. }
  1709. else {
  1710. _arg1.transform.colorTransform = new ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
  1711. };
  1712. };
  1713. };
  1714. }
  1715.  
  1716. public function onHouseItemEnterFrame(_arg1:Event):void{
  1717. var _local4:DisplayObject;
  1718. var _local5:Rectangle;
  1719. var _local2:MovieClip = (_arg1.currentTarget as MovieClip);
  1720. var _local3:int;
  1721. while (_local3 < this.map.numChildren) {
  1722. _local4 = this.map.getChildAt(_local3);
  1723. if ((((((_local4 is MovieClip)) && (MovieClip(_local4).isFloor))) && (MovieClip(_local4).hitTestPoint(_local2.x, _local2.y)))){
  1724. _local2.removeEventListener(Event.ENTER_FRAME, this.onHouseItemEnterFrame);
  1725. _local2.isStable = true;
  1726. break;
  1727. };
  1728. _local3++;
  1729. };
  1730. if (!_local2.isStable){
  1731. _local5 = _local2.getBounds(this.rootClass.stage);
  1732. if ((_local5.y + (_local5.height / 2)) > 495){
  1733. _local2.isStable = true;
  1734. _local2.y = Math.ceil((_local5.y - (_local5.y - _local2.y)));
  1735. _local2.removeEventListener(Event.ENTER_FRAME, this.onHouseItemEnterFrame);
  1736. }
  1737. else {
  1738. _local2.y = (_local2.y + 10);
  1739. };
  1740. if (this.rootClass.ui.mcPopup.mcHouseMenu.visible){
  1741. this.rootClass.ui.mcPopup.mcHouseMenu.drawItemHandle(_local2);
  1742. };
  1743. };
  1744. }
  1745.  
  1746. public function initHouseData(_arg1:Object):void{
  1747. this.objHouseData = _arg1;
  1748. if (this.objHouseData != null){
  1749. this.objHouseData.arrPlacement = this.createItemPlacementArray(this.objHouseData.sHouseInfo);
  1750. this.verifyItemQty();
  1751. };
  1752. }
  1753.  
  1754. public function verifyItemQty():void{
  1755. var _local3:*;
  1756. var _local4:*;
  1757. var _local1:* = {};
  1758. var _local2:int;
  1759. while (_local2 < this.objHouseData.arrPlacement.length) {
  1760. _local3 = this.objHouseData.arrPlacement[_local2].ID;
  1761. if (_local1[_local3] == null){
  1762. _local1[_local3] = 1;
  1763. }
  1764. else {
  1765. var _local5 = _local1;
  1766. var _local6 = _local3;
  1767. var _local7 = (_local5[_local6] + 1);
  1768. _local5[_local6] = _local7;
  1769. };
  1770. _local4 = this.getHouseItem(_local3);
  1771. if ((((_local4 == null)) || ((_local4.iQty < _local1[_local3])))){
  1772. this.objHouseData.sHouseInfo = "";
  1773. this.objHouseData.arrPlacement = [];
  1774. };
  1775. _local2++;
  1776. };
  1777. }
  1778.  
  1779. public function getHouseItem(_arg1:int):Object{
  1780. var _local2:int;
  1781. var _local3:int;
  1782. if (this.isMyHouse()){
  1783. _local2 = 0;
  1784. while (_local2 < this.myAvatar.houseitems.length) {
  1785. if (this.myAvatar.houseitems[_local2].ItemID == _arg1){
  1786. return (this.myAvatar.houseitems[_local2]);
  1787. };
  1788. _local2++;
  1789. };
  1790. }
  1791. else {
  1792. _local3 = 0;
  1793. while (_local3 < this.objHouseData.items.length) {
  1794. if (this.objHouseData.items[_local3].ItemID == _arg1){
  1795. return (this.objHouseData.items[_local3]);
  1796. };
  1797. _local3++;
  1798. };
  1799. };
  1800. return (null);
  1801. }
  1802.  
  1803. public function removeSelectedItem():void{
  1804. var _local1:MovieClip;
  1805. if (this.objHouseData.selectedMC == null){
  1806. this.rootClass.MsgBox.notify("Please selected an item to be removed.");
  1807. }
  1808. else {
  1809. _local1 = this.objHouseData.selectedMC;
  1810. _local1.removeEventListener(MouseEvent.MOUSE_DOWN, this.onHouseItemClick);
  1811. this.unequipHouseItem(_local1.ItemID);
  1812. this.CHARS.removeChild(_local1);
  1813. delete this.objHouseData.selectedMC;
  1814. };
  1815. }
  1816.  
  1817. public function equipHouse(_arg1:Object):void{
  1818. var _local2:* = new ModalMC();
  1819. var _local3:* = {};
  1820. _local3.strBody = (("Are you sure you want to equip '" + _arg1.sName) + "'? It will reset your house items?");
  1821. _local3.params = {item:_arg1};
  1822. _local3.callback = this.equipHouseRequest;
  1823. this.rootClass.ui.ModalStack.addChild(_local2);
  1824. _local2.init(_local3);
  1825. }
  1826.  
  1827. public function equipHouseRequest(_arg1):void{
  1828. if (_arg1.accept){
  1829. this.rootClass.world.sendEquipItemRequest(_arg1.item);
  1830. this.rootClass.world.equipHouseByID(_arg1.item.ItemID);
  1831. };
  1832. }
  1833.  
  1834. public function equipHouseByID(_arg1:int):void{
  1835. var _local2:int;
  1836. while (_local2 < this.myAvatar.houseitems.length) {
  1837. this.myAvatar.houseitems[_local2].bEquip = (((this.myAvatar.houseitems[_local2].ItemID)==_arg1) ? 1 : 0);
  1838. _local2++;
  1839. };
  1840. }
  1841.  
  1842. public function saveHouseSetup():void{
  1843. var _local3:DisplayObject;
  1844. var _local1:int;
  1845. while (_local1 < this.objHouseData.arrPlacement.length) {
  1846. if (this.strFrame == this.objHouseData.arrPlacement[_local1].c){
  1847. this.objHouseData.arrPlacement.splice(_local1, 1);
  1848. _local1--;
  1849. };
  1850. _local1++;
  1851. };
  1852. _local1 = 0;
  1853. while (_local1 < this.CHARS.numChildren) {
  1854. _local3 = this.CHARS.getChildAt(_local1);
  1855. if (((_local3.hasOwnProperty("isHouseItem")) && (MovieClip(_local3).isHouseItem))){
  1856. if (MovieClip(_local3).isStable){
  1857. this.objHouseData.arrPlacement.push({
  1858. c:this.strFrame,
  1859. ID:MovieClip(_local3).ItemID,
  1860. x:_local3.x,
  1861. y:_local3.y
  1862. });
  1863. }
  1864. else {
  1865. this.unequipHouseItem(MovieClip(_local3).ItemID);
  1866. _local3.removeEventListener(MouseEvent.MOUSE_DOWN, this.onHouseItemClick);
  1867. this.CHARS.removeChild(_local3);
  1868. };
  1869. };
  1870. _local1++;
  1871. };
  1872. var _local2:String = this.createItemPlacementString(this.objHouseData.arrPlacement);
  1873. trace(this.objHouseData.sHouseInfo);
  1874. trace(_local2);
  1875. if (this.objHouseData.sHouseInfo != _local2){
  1876. this.sendSaveHouseSetup(_local2);
  1877. this.objHouseData.sHouseInfo = _local2;
  1878. };
  1879. }
  1880.  
  1881. public function createItemPlacementString(_arg1:Array):String{
  1882. var _local3:int;
  1883. var _local4:*;
  1884. var _local2 = "";
  1885. if (_arg1.length > 0){
  1886. _local3 = 0;
  1887. while (_local3 < _arg1.length) {
  1888. for (_local4 in _arg1[_local3]) {
  1889. _local2 = ((((_local2 + _local4) + ":") + _arg1[_local3][_local4]) + ",");
  1890. };
  1891. _local2 = _local2.substring(0, (_local2.length - 1));
  1892. _local2 = (_local2 + "|");
  1893. _local3++;
  1894. };
  1895. _local2 = _local2.substring(0, (_local2.length - 1));
  1896. };
  1897. return (_local2);
  1898. }
  1899.  
  1900. public function createItemPlacementArray(_arg1:String):Array{
  1901. var _local3:*;
  1902. var _local4:int;
  1903. var _local5:*;
  1904. var _local6:*;
  1905. var _local7:int;
  1906. var _local2:Array = [];
  1907. if (_arg1.length > 0){
  1908. _local3 = _arg1.split("|");
  1909. _local4 = 0;
  1910. while (_local4 < _local3.length) {
  1911. _local5 = {};
  1912. _local6 = _local3[_local4].split(",");
  1913. _local7 = 0;
  1914. while (_local7 < _local6.length) {
  1915. _local5[_local6[_local7].split(":")[0]] = _local6[_local7].split(":")[1];
  1916. _local7++;
  1917. };
  1918. _local2.push(_local5);
  1919. _local4++;
  1920. };
  1921. };
  1922. return (_local2);
  1923. }
  1924.  
  1925. public function sendSaveHouseSetup(_arg1):void{
  1926. this.rootClass.sfc.sendXtMessage("zm", "housesave", [_arg1], "str", 1);
  1927. }
  1928.  
  1929. public function initEquippedItems(_arg1):void{
  1930. var _local3:int;
  1931. var _local2:int;
  1932. while (_local2 < this.myAvatar.houseitems.length) {
  1933. if (this.myAvatar.houseitems[_local2].sType != "House"){
  1934. this.myAvatar.houseitems[_local2].bEquip = 0;
  1935. _local3 = 0;
  1936. while (_local3 < _arg1.length) {
  1937. if (this.myAvatar.houseitems[_local2].ItemID == _arg1[_local3].ID){
  1938. this.myAvatar.houseitems[_local2].bEquip = 1;
  1939. };
  1940. _local3++;
  1941. };
  1942. };
  1943. _local2++;
  1944. };
  1945. }
  1946.  
  1947. public function initHouseInventory(_arg1):void{
  1948. this.myAvatar.houseitems = (((_arg1.items)==null) ? [] : _arg1.items);
  1949. this.initEquippedItems(this.createItemPlacementArray(_arg1.sHouseInfo));
  1950. var _local2:Array = this.myAvatar.houseitems;
  1951. var _local3:int;
  1952. while (_local3 < _local2.length) {
  1953. _local2[_local3].iQty = int(_local2[_local3].iQty);
  1954. this.rootClass.world.invTree[_local2[_local3].ItemID] = _local2[_local3];
  1955. _local3++;
  1956. };
  1957. }
  1958.  
  1959. public function unequipHouseItem(_arg1:int):void{
  1960. var _local2:int;
  1961. while (_local2 < this.myAvatar.houseitems.length) {
  1962. if (this.myAvatar.houseitems[_local2].ItemID == _arg1){
  1963. this.myAvatar.houseitems[_local2].bEquip = 0;
  1964. };
  1965. _local2++;
  1966. };
  1967. }
  1968.  
  1969. public function loadHouseItem(_arg1:Object, _arg2:int, _arg3:int):void{
  1970. var item:Object = _arg1;
  1971. var x:int = _arg2;
  1972. var y:int = _arg3;
  1973. try {
  1974. this.attachHouseItem({
  1975. item:item,
  1976. x:x,
  1977. y:y
  1978. });
  1979. }
  1980. catch(err:Error) {
  1981. arrHouseItemQueue.push({
  1982. item:item,
  1983. typ:"A",
  1984. x:x,
  1985. y:y
  1986. });
  1987. if (arrHouseItemQueue.length > 0){
  1988. loadNextHouseItem();
  1989. };
  1990. };
  1991. }
  1992.  
  1993. public function loadNextHouseItem():void{
  1994. this.ldr_House.load(new URLRequest((this.rootClass.getFilePath() + this.arrHouseItemQueue[0].item.sFile)), this.loaderC);
  1995. if (!this.ldr_House.hasEventListener(Event.COMPLETE)){
  1996. this.ldr_House.contentLoaderInfo.addEventListener(Event.COMPLETE, this.onHouseItemComplete);
  1997. };
  1998. }
  1999.  
  2000. public function onHouseItemComplete(_arg1:Event):void{
  2001. var _local2:* = this.arrHouseItemQueue[0];
  2002. if (_local2.typ == "A"){
  2003. this.attachHouseItem(_local2);
  2004. this.arrHouseItemQueue.splice(0, 1);
  2005. if (this.arrHouseItemQueue.length > 0){
  2006. this.loadNextHouseItem();
  2007. };
  2008. }
  2009. else {
  2010. this.rootClass.ui.mcPopup.mcHouseMenu.previewHouseItem(_local2);
  2011. this.arrHouseItemQueue.splice(0, 1);
  2012. if (this.arrHouseItemQueue.length > 0){
  2013. this.loadNextHouseItemB();
  2014. };
  2015. };
  2016. }
  2017.  
  2018. public function loadHouseItemB(_arg1:Object):void{
  2019. var item:Object = _arg1;
  2020. try {
  2021. this.rootClass.ui.mcPopup.mcHouseMenu.previewHouseItem({item:item});
  2022. }
  2023. catch(err:Error) {
  2024. rootClass.ui.mcPopup.mcHouseMenu.preview.t2.visible = true;
  2025. rootClass.ui.mcPopup.mcHouseMenu.preview.cnt.visible = false;
  2026. rootClass.ui.mcPopup.mcHouseMenu.preview.bAdd.visible = false;
  2027. arrHouseItemQueue.push({
  2028. item:item,
  2029. typ:"B"
  2030. });
  2031. if (arrHouseItemQueue.length > 0){
  2032. loadNextHouseItemB();
  2033. };
  2034. };
  2035. }
  2036.  
  2037. public function loadNextHouseItemB():void{
  2038. var _local1:Object = this.arrHouseItemQueue[0].item;
  2039. var _local2:String = _local1.sFile;
  2040. if (_local1.sType == "House"){
  2041. _local2 = (("maps/" + _local1.sFile.substr(0, -4)) + "_preview.swf");
  2042. };
  2043. this.ldr_House.load(new URLRequest((this.rootClass.getFilePath() + _local2)), this.loaderC);
  2044. if (!this.ldr_House.hasEventListener(Event.COMPLETE)){
  2045. this.ldr_House.contentLoaderInfo.addEventListener(Event.COMPLETE, this.onHouseItemComplete);
  2046. };
  2047. }
  2048.  
  2049. public function playerInit(){
  2050. var _local2:*;
  2051. trace("------------------------------ Player Init");
  2052. trace((" > " + this.rootClass.sfc.ipAddress));
  2053. var _local1:* = this.rootClass.sfc.getRoom(this.curRoom).getUserList();
  2054. var _local3:Array = [];
  2055. var _local4:int;
  2056. for (_local2 in _local1) {
  2057. _local3.push(_local1[_local2].getId());
  2058. };
  2059. if (_local3.length > 0){
  2060. this.objectByIDArray(_local3);
  2061. };
  2062. this.myAvatar = this.avatars[this.rootClass.sfc.myUserId];
  2063. this.myAvatar.isMyAvatar = true;
  2064. this.myAvatar.pMC.disablePNameMouse();
  2065. this.rootClass.sfcSocial = true;
  2066. }
  2067.  
  2068. public function objectByIDArray(_arg1:Array){
  2069. var _local2:int;
  2070. var _local3:int;
  2071. var _local4:*;
  2072. var _local5:String;
  2073. var _local6:Object;
  2074. var _local7:String;
  2075. trace("** WORLD objectByIDArray >");
  2076. var _local8:Array = [];
  2077. _local2 = 0;
  2078. while (_local2 < _arg1.length) {
  2079. _local3 = _arg1[_local2];
  2080. _local6 = this.getUoLeafById(_local3);
  2081. if (_local6 != null){
  2082. _local5 = _local6.uoName;
  2083. _local7 = String(_local6.strFrame);
  2084. if (_local3 == this.rootClass.sfc.myUserId){
  2085. _local7 = this.strFrame;
  2086. };
  2087. if (this.avatars[_local3] == null){
  2088. this.avatars[_local3] = new Avatar(this.rootClass);
  2089. this.avatars[_local3].uid = _local3;
  2090. this.avatars[_local3].pnm = _local5;
  2091. };
  2092. this.avatars[_local3].dataLeaf = _local6;
  2093. if ((((this.avatars[_local3].pMC == null)) && ((_local7 == this.strFrame)))){
  2094. this.avatars[_local3].pMC = this.createAvatarMC(_local3);
  2095. _local8.push(_local3);
  2096. };
  2097. this.updateUserDisplay(_local3);
  2098. }
  2099. else {
  2100. trace(("login failed for uid: " + _local3));
  2101. };
  2102. _local2++;
  2103. };
  2104. if (_local8.length > 0){
  2105. this.getUserDataByIds(_local8);
  2106. };
  2107. }
  2108.  
  2109. public function objectByID(_arg1:Number){
  2110. var _local3:*;
  2111. var _local4:*;
  2112. trace("** WORLD objectByID >");
  2113. var _local2:* = this.getUoLeafById(_arg1);
  2114. if (_local2 != null){
  2115. _local3 = _local2.uoName;
  2116. trace((" unm : " + _local3));
  2117. _local4 = String(_local2.strFrame);
  2118. if (_arg1 == this.rootClass.sfc.myUserId){
  2119. _local4 = this.strFrame;
  2120. };
  2121. if (this.avatars[_arg1] == null){
  2122. this.avatars[_arg1] = new Avatar(this.rootClass);
  2123. this.avatars[_arg1].uid = _arg1;
  2124. this.avatars[_arg1].pnm = _local3;
  2125. };
  2126. this.avatars[_arg1].dataLeaf = _local2;
  2127. if ((((this.avatars[_arg1].pMC == null)) && ((_local4 == this.strFrame)))){
  2128. this.avatars[_arg1].pMC = this.createAvatarMC(_arg1);
  2129. this.getUserDataById(_arg1);
  2130. };
  2131. this.updateUserDisplay(_arg1);
  2132. };
  2133. }
  2134.  
  2135. public function createAvatarMC(_arg1:Number):AvatarMC{
  2136. trace("** WORLD createAvatarMC >");
  2137. var _local2:AvatarMC = new AvatarMC();
  2138. _local2.name = ("a" + _arg1);
  2139. _local2.x = -600;
  2140. _local2.y = 0;
  2141. _local2.pAV = this.avatars[_arg1];
  2142. _local2.world = this;
  2143. return (_local2);
  2144. }
  2145.  
  2146. public function destroyAvatar(_arg1:Number){
  2147. if (this.avatars[_arg1] != null){
  2148. if (this.avatars[_arg1].pMC != null){
  2149. if (!this.avatars[_arg1].isMyAvatar){
  2150. this.avatars[_arg1].pMC.fClose();
  2151. delete this.avatars[_arg1];
  2152. };
  2153. };
  2154. };
  2155. }
  2156.  
  2157. public function updateUserDisplay(_arg1:Number){
  2158. var _local5:*;
  2159. var _local6:*;
  2160. var _local7:*;
  2161. trace(("** WORLD updateUserDisplay > " + _arg1));
  2162. var _local2:* = this.getMCByUserID(_arg1);
  2163. var _local3:* = this.getUoLeafById(_arg1);
  2164. var _local4:* = String(_local3.strFrame);
  2165. if (_local4 == this.strFrame){
  2166. _local2.tx = int(_local3.tx);
  2167. _local2.ty = int(_local3.ty);
  2168. _local5 = int(_local3.intState);
  2169. _local6 = null;
  2170. if (((((("strPad" in _local3)) && (!((_local3.strPad.toLowerCase() == "none"))))) && ((_local3.strPad in this.map)))){
  2171. _local6 = this.map[_local3.strPad];
  2172. };
  2173. if (((!((_local2.tx == 0))) || (!((_local2.ty == 0))))){
  2174. if (!this.testTxTy(new Point(_local2.tx, _local2.ty), _local2)){
  2175. _local7 = this.solveTxTy(new Point(_local2.tx, _local2.ty), _local2);
  2176. if (_local7 != null){
  2177. _local2.x = _local7.x;
  2178. _local2.y = _local7.y;
  2179. }
  2180. else {
  2181. _local2.x = int((960 / 2));
  2182. _local2.y = int((550 / 2));
  2183. };
  2184. }
  2185. else {
  2186. _local2.x = _local2.tx;
  2187. _local2.y = _local2.ty;
  2188. };
  2189. }
  2190. else {
  2191. if (_local6 != null){
  2192. _local2.x = int(((_local6.x + int((Math.random() * 10))) - 5));
  2193. _local2.y = int(((_local6.y + int((Math.random() * 10))) - 5));
  2194. }
  2195. else {
  2196. _local2.x = int((960 / 2));
  2197. _local2.y = int((550 / 2));
  2198. };
  2199. };
  2200. _local2.scale(this.SCALE);
  2201. if (_local5){
  2202. _local2.mcChar.gotoAndStop("Idle");
  2203. }
  2204. else {
  2205. _local2.mcChar.gotoAndStop("Dead");
  2206. };
  2207. if (this.showHPBar){
  2208. _local2.showHPBar();
  2209. }
  2210. else {
  2211. _local2.hideHPBar();
  2212. };
  2213. if (_arg1 == this.rootClass.sfc.myUserId){
  2214. this.bitWalk = true;
  2215. };
  2216. if ((((this.CELL_MODE == "normal")) || ((_arg1 == this.rootClass.sfc.myUserId)))){
  2217. _local2.pAV.showMC();
  2218. }
  2219. else {
  2220. _local2.pAV.hideMC();
  2221. };
  2222. if (((((this.bPvP) && (!((_local3.pvpTeam == null))))) && ((_local3.pvpTeam > -1)))){
  2223. _local2.mcChar.pvpFlag.visible = true;
  2224. _local2.mcChar.pvpFlag.gotoAndStop(new Array("a", "b", "c")[_local3.pvpTeam]);
  2225. }
  2226. else {
  2227. _local2.mcChar.pvpFlag.visible = false;
  2228. };
  2229. if (_local2.isLoaded){
  2230. _local2.gotoAndPlay("in2");
  2231. }
  2232. else {
  2233. _local2.gotoAndPlay("hold");
  2234. };
  2235. };
  2236. }
  2237.  
  2238. public function repairAvatars():void{
  2239. var _local1:Avatar;
  2240. this.rootClass.chatF.pushMsg("server", "Attempting to repair incomplete Avatars...", "SERVER", "", 0);
  2241. var _local2:Boolean;
  2242. for each (_local1 in this.avatars) {
  2243. if (!_local1.pMC.isLoaded){
  2244. _local2 = true;
  2245. if (_local1.objData != null){
  2246. this.rootClass.chatF.pushMsg("server", (" > repairing " + _local1.objData.strUsername), "SERVER", "", 0);
  2247. _local1.initAvatar(_local1.objData);
  2248. }
  2249. else {
  2250. if (_local1.pnm != null){
  2251. this.rootClass.chatF.pushMsg("warning", ((" *> Data load incomplete for " + _local1.pnm) + ", repair cannot continue."), "SERVER", "", 0);
  2252. }
  2253. else {
  2254. this.rootClass.chatF.pushMsg("warning", " *> Avatar instantiated but no data exists at all!", "SERVER", "", 0);
  2255. };
  2256. };
  2257. };
  2258. };
  2259. if (!_local2){
  2260. this.rootClass.chatF.pushMsg("server", " > No incomplete Avatars found!", "SERVER", "", 0);
  2261. };
  2262. }
  2263.  
  2264. private function solveTxTy(_arg1:Point, _arg2:MovieClip):Point{
  2265. var _local6:Point;
  2266. var _local7:Point;
  2267. var _local10:int;
  2268. var _local3:int = 20;
  2269. var _local4:int = (960 / _local3);
  2270. var _local5:int = (550 / _local3);
  2271. var _local8:Array = [];
  2272. var _local9:int;
  2273. while (_local9 <= _local4) {
  2274. _local10 = 0;
  2275. while (_local10 <= _local5) {
  2276. _local6 = new Point((_local9 * _local3), (_local10 * _local3));
  2277. if (this.testTxTy(_local6, _arg2)){
  2278. _local8.push({
  2279. x:_local6.x,
  2280. y:_local6.y,
  2281. d:Math.abs(Point.distance(_arg1, _local6))
  2282. });
  2283. };
  2284. _local10++;
  2285. };
  2286. _local9++;
  2287. };
  2288. if (_local8.length){
  2289. _local8.sortOn(["d"], [Array.NUMERIC]);
  2290. _local7 = new Point(((_local8[0].x + int((Math.random() * 10))) - 5), ((_local8[0].y + int((Math.random() * 10))) - 5));
  2291. while (!(this.testTxTy(_local7, _arg2))) {
  2292. _local7 = new Point(((_local8[0].x + int((Math.random() * 10))) - 5), ((_local8[0].y + int((Math.random() * 10))) - 5));
  2293. };
  2294. return (_local7);
  2295. };
  2296. return (null);
  2297. }
  2298.  
  2299. private function testTxTy(_arg1:Point, _arg2:MovieClip):Boolean{
  2300. var _local3:int = _arg2.shadow.width;
  2301. var _local4:int = _arg2.shadow.height;
  2302. var _local5:int = (_arg1.x - (_local3 / 2));
  2303. var _local6:int = (_arg1.y - (_local4 / 2));
  2304. var _local7:Rectangle = new Rectangle(_local5, _local6, _local3, _local4);
  2305. var _local8:Rectangle;
  2306. var _local9:MovieClip;
  2307. var _local10:Boolean;
  2308. var _local11:int;
  2309. while (_local11 < this.arrSolid.length) {
  2310. _local9 = MovieClip(this.arrSolid[_local11].shadow);
  2311. _local8 = new Rectangle(_local9.x, _local9.y, _local9.width, _local9.height);
  2312. _local10 = !(_local8.intersects(_local7));
  2313. _local11++;
  2314. };
  2315. return (_local10);
  2316. }
  2317.  
  2318. public function updatePortrait(_arg1:Avatar){
  2319. var _local2:Array;
  2320. var _local3:MovieClip;
  2321. var _local6:int;
  2322. var _local7:*;
  2323. var _local8:*;
  2324. var _local9:*;
  2325. var _local10:*;
  2326. var _local4:int;
  2327. var _local5:int;
  2328. if (_arg1 != this.myAvatar){
  2329. _local2 = [this.rootClass.ui.mcPortraitTarget];
  2330. }
  2331. else {
  2332. if (_arg1 == this.myAvatar.target){
  2333. _local2 = [this.rootClass.ui.mcPortraitTarget, this.rootClass.ui.mcPortrait];
  2334. }
  2335. else {
  2336. _local2 = [this.rootClass.ui.mcPortrait];
  2337. };
  2338. };
  2339. _local4 = 0;
  2340. while (_local4 < _local2.length) {
  2341. _local7 = {};
  2342. _local3 = _local2[_local4];
  2343. _local3.strName.mouseEnabled = false;
  2344. _local3.strClass.mouseEnabled = false;
  2345. if (_arg1.npcType == "monster"){
  2346. _local7 = this.monTree[_arg1.objData.MonMapID];
  2347. _local3.strName.text = _arg1.objData.strMonName.toUpperCase();
  2348. _local3.strClass.text = "Monster";
  2349. if (("stars" in _local3)){
  2350. _local6 = Math.round((Math.pow((_arg1.objData.intLevel * 1.3), 0.5) / 2));
  2351. _local5 = 1;
  2352. while (_local5 < 6) {
  2353. if (_local5 <= _local6){
  2354. _local3.stars.getChildByName(("s" + _local5)).visible = true;
  2355. }
  2356. else {
  2357. _local3.stars.getChildByName(("s" + _local5)).visible = false;
  2358. };
  2359. _local5++;
  2360. };
  2361. };
  2362. };
  2363. if (_arg1.npcType == "player"){
  2364. _local7 = this.uoTree[_arg1.pnm];
  2365. _local3.strName.text = _arg1.objData.strUsername.toUpperCase();
  2366. _local3.strClass.text = ((_arg1.objData.strClassName + ", Rank ") + _arg1.objData.iRank);
  2367. if (("stars" in _local3)){
  2368. _local5 = 1;
  2369. while (_local5 < 6) {
  2370. _local3.stars.getChildByName(("s" + _local5)).visible = false;
  2371. _local5++;
  2372. };
  2373. };
  2374. };
  2375. if ((((_arg1.npcType == "monster")) || ((_arg1.npcType == "player"))))
  2376. {
  2377. if ((_arg1.objData.intLevel - myAvatar.objData.intLevel) > 60)
  2378. {
  2379. _local3.strLevel.text = "";
  2380. _local3.strLevel.visible = false;
  2381. _local3.mcLevel.gotoAndStop("High");
  2382. } else {
  2383. _local3.strLevel.text = _arg1.objData.intLevel;
  2384. _local3.strLevel.visible = true;
  2385. _local3.mcLevel.gotoAndStop("Normal");
  2386. };
  2387. //_local3.strLevel.text = _arg1.objData.intLevel;
  2388. _local3.strLevel.text = _arg1.objData.intLevel;
  2389. _local8 = 0;
  2390. _local9 = 0;
  2391. _local10 = null;
  2392. _local8 = _local7.intHP;
  2393. _local9 = _local7.intHPMax;
  2394. _local10 = _local3.HP;
  2395. if (_local7.intHP >= 0){
  2396. _local10.strIntHP.text = String(_local7.intHP);
  2397. }
  2398. else {
  2399. _local10.strIntHP.text = "X";
  2400. };
  2401. if (_local8 < 0){
  2402. _local8 = 0;
  2403. };
  2404. if (_local8 > _local9){
  2405. _local8 = _local9;
  2406. };
  2407. _local10.intHPbar.x = Math.min(-((_local10.intHPbar.width * (1 - (_local8 / _local9)))), 0);
  2408. if (_arg1 == myAvatar){
  2409. if ((1 - (_local8 / _local9)) > 0.7){
  2410. _local10.Glint.gotoAndPlay("b");
  2411. //_local10.InterfaceGlint.gotoAndPlay("b");
  2412. } else {
  2413. _local10.Glint.gotoAndStop("a");
  2414. //_local10.InterfaceGlint.gotoAndPlay("a");
  2415. };
  2416. } else {
  2417. _local10.Glint.gotoAndStop("a");
  2418. //_local10.InterfaceGlint.gotoAndPlay("a");
  2419. };
  2420. _local10.intHPbar.x = Math.min(-((_local10.intHPbar.width * (1 - (_local8 / _local9)))), 0);
  2421. _local8 = _local7.intMP;
  2422. _local9 = _local7.intMPMax;
  2423. _local10 = _local3.MP;
  2424. if (_local7.intMP >= 0){
  2425. _local10.strIntMP.text = String(_local7.intMP);
  2426. }
  2427. else {
  2428. _local10.strIntMP.text = "X";
  2429. };
  2430. if (_local8 < 0){
  2431. _local8 = 0;
  2432. };
  2433. if (_local8 > _local9){
  2434. _local8 = _local9;
  2435. };
  2436. _local10.intMPbar.x = Math.min(-((_local10.intMPbar.width * (1 - (_local8 / _local9)))), 0);
  2437. if (_arg1 == myAvatar){
  2438. if ((1 - (_local8 / _local9)) > 0.7){
  2439. _local10.Glint.gotoAndPlay("b");
  2440. } else {
  2441. _local10.Glint.gotoAndStop("a");
  2442. };
  2443. } else {
  2444. _local10.Glint.gotoAndStop("a");
  2445. };
  2446. _local10.intMPbar.x = Math.min(-((_local10.intMPbar.width * (1 - (_local8 / _local9)))), 0);
  2447. };
  2448. _local4++;
  2449. };
  2450. }
  2451.  
  2452. public function getAvatarByUserID(_arg1:int):Avatar{
  2453. var _local2:String = String(_arg1);
  2454. if ((_local2 in this.avatars)){
  2455. return (this.avatars[_local2]);
  2456. };
  2457. return (null);
  2458. }
  2459.  
  2460. public function getAvatarByUserName(_arg1:String):Avatar{
  2461. var _local2:String;
  2462. for (_local2 in this.avatars) {
  2463. if (((((!((this.avatars[_local2] == null))) && (!((this.avatars[_local2].pnm == null))))) && ((this.avatars[_local2].pnm.toLowerCase() == _arg1.toLowerCase())))){
  2464. return (this.avatars[_local2]);
  2465. };
  2466. };
  2467. return (null);
  2468. }
  2469.  
  2470. public function getMCByUserName(_arg1):AvatarMC{
  2471. var _local2:String;
  2472. for (_local2 in this.avatars) {
  2473. if (((((!((this.avatars[_local2] == null))) && (!((this.avatars[_local2].pnm == null))))) && ((this.avatars[_local2].pnm.toLowerCase() == _arg1.toLowerCase())))){
  2474. if (this.avatars[_local2].pMC != null){
  2475. return (this.avatars[_local2].pMC);
  2476. };
  2477. };
  2478. };
  2479. return (null);
  2480. }
  2481.  
  2482. public function getMCByUserID(_arg1):AvatarMC{
  2483. if (((!((this.avatars[_arg1] == undefined))) && (!((this.avatars[_arg1].pMC == null))))){
  2484. return (this.avatars[_arg1].pMC);
  2485. };
  2486. return (null);
  2487. }
  2488.  
  2489. public function getUserByName(_arg1){
  2490. var _local3:*;
  2491. var _local4:*;
  2492. var _local5:*;
  2493. var _local6:*;
  2494. var _local2:Array = this.rootClass.sfc.getAllRooms();
  2495. for (_local3 in _local2) {
  2496. _local4 = _local2[_local3];
  2497. for (_local5 in _local4.getUserList()) {
  2498. _local6 = _local4.getUserList()[_local5];
  2499. if (String(_local6.getName()) == _arg1){
  2500. return (_local6);
  2501. };
  2502. };
  2503. };
  2504. return (null);
  2505. }
  2506.  
  2507. public function getUserById(_arg1:Number){
  2508. return (this.rootClass.sfc.getRoom(this.curRoom).getUser(Number(_arg1)));
  2509. }
  2510.  
  2511. public function getUoLeafById(_arg1):Object{
  2512. var _local2:Object;
  2513. for each (_local2 in this.uoTree) {
  2514. if (_local2.entID == _arg1){
  2515. return (_local2);
  2516. };
  2517. };
  2518. return (null);
  2519. }
  2520.  
  2521. public function getUoLeafByName(_arg1:String):Object{
  2522. var _local2:Object;
  2523. _arg1 = _arg1.toLowerCase();
  2524. for each (_local2 in this.uoTree) {
  2525. if (_local2.uoName == _arg1){
  2526. return (_local2);
  2527. };
  2528. };
  2529. return (null);
  2530. }
  2531.  
  2532. public function getUserDataById(_arg1){
  2533. trace("** WORLD getUserDataById >");
  2534. this.rootClass.sfc.sendXtMessage("zm", "retrieveUserData", [_arg1], "str", this.curRoom);
  2535. }
  2536.  
  2537. public function getUserDataByIds(_arg1:Array){
  2538. trace("** WORLD getUserDataByIds >");
  2539. this.rootClass.sfc.sendXtMessage("zm", "retrieveUserDatas", _arg1, "str", this.curRoom);
  2540. }
  2541.  
  2542. public function getUsersByCell(_arg1:String):Array{
  2543. var _local3:String;
  2544. var _local2:Array = [];
  2545. for (_local3 in this.avatars) {
  2546. if (this.avatars[_local3].dataLeaf.strFrame == _arg1){
  2547. _local2.push(this.avatars[_local3]);
  2548. };
  2549. };
  2550. return (_local2);
  2551. }
  2552.  
  2553. public function getAllAvatarsInCell():Array{
  2554. var _local1:Array = [];
  2555. _local1 = this.getMonstersByCell(this.myAvatar.dataLeaf.strFrame);
  2556. _local1 = _local1.concat(this.getUsersByCell(this.myAvatar.dataLeaf.strFrame));
  2557. return (_local1);
  2558. }
  2559.  
  2560. private function lookAtValue(_arg1:String, _arg2:int):Number{
  2561. return (parseInt(_arg1.charAt(_arg2), 36));
  2562. }
  2563.  
  2564. private function updateValue(_arg1, _arg2:int, _arg3:Number):String{
  2565. var _local4:String;
  2566. if ((((_arg3 >= 0)) && ((_arg3 < 10)))){
  2567. _local4 = String(_arg3);
  2568. }
  2569. else {
  2570. if ((((_arg3 >= 10)) && ((_arg3 < 36)))){
  2571. _local4 = String.fromCharCode((_arg3 + 55));
  2572. }
  2573. else {
  2574. _local4 = "0";
  2575. };
  2576. };
  2577. return (this.rootClass.strSetCharAt(_arg1, _arg2, _local4));
  2578. }
  2579.  
  2580. public function getQuestValue(_arg1:Number):Number{
  2581. if (((!((this.myAvatar == null))) && (!((this.myAvatar.objData == null))))){
  2582. if (_arg1 > 99){
  2583. return (this.lookAtValue(this.myAvatar.objData.strQuests2, (_arg1 - 100)));
  2584. };
  2585. return (this.lookAtValue(this.myAvatar.objData.strQuests, _arg1));
  2586. };
  2587. return (-1);
  2588. }
  2589.  
  2590. public function setQuestValue(_arg1:Number, _arg2:Number):void{
  2591. if (_arg1 > 99){
  2592. this.myAvatar.objData.strQuests2 = this.updateValue(this.myAvatar.objData.strQuests2, (_arg1 - 100), _arg2);
  2593. }
  2594. else {
  2595. this.myAvatar.objData.strQuests = this.updateValue(this.myAvatar.objData.strQuests, _arg1, _arg2);
  2596. };
  2597. }
  2598.  
  2599. public function sendUpdateQuestRequest(_arg1:Number, _arg2:Number):void{
  2600. this.rootClass.sfc.sendXtMessage("zm", "updateQuest", [_arg1, _arg2], "str", this.curRoom);
  2601. }
  2602.  
  2603. public function setHomeTownCurrent():void{
  2604. this.rootClass.sfc.sendXtMessage("zm", "setHomeTown", [], "str", this.curRoom);
  2605. this.myAvatar.objData.strHomeTown = this.myAvatar.objData.strMapName;
  2606. }
  2607.  
  2608. public function setHomeTown(_arg1:String):void{
  2609. this.rootClass.sfc.sendXtMessage("zm", "setHomeTown", [_arg1], "str", this.curRoom);
  2610. this.myAvatar.objData.strHomeTown = _arg1;
  2611. }
  2612.  
  2613. public function sendBankFromInvRequest(_arg1:Object){
  2614. var _local2:ModalMC;
  2615. var _local3:Object;
  2616. if (_arg1.bEquip == 1){
  2617. _local2 = new ModalMC();
  2618. _local3 = {};
  2619. _local3.strBody = "You must unequip the item before storing it in the bank!";
  2620. _local3.params = {};
  2621. _local3.glow = "red,medium";
  2622. _local3.btns = "mono";
  2623. this.rootClass.ui.ModalStack.addChild(_local2);
  2624. _local2.init(_local3);
  2625. }
  2626. else {
  2627. if ((((_arg1.bCoins == 0)) && ((this.myAvatar.iBankCount >= this.myAvatar.objData.iBankSlots)))){
  2628. _local2 = new ModalMC();
  2629. _local3 = {};
  2630. _local3.strBody = "You have exceeded your maximum bank storage for non-RC items!";
  2631. _local3.params = {};
  2632. _local3.glow = "red,medium";
  2633. _local3.btns = "mono";
  2634. this.rootClass.ui.ModalStack.addChild(_local2);
  2635. _local2.init(_local3);
  2636. }
  2637. else {
  2638. this.rootClass.sfc.sendXtMessage("zm", "bankFromInv", [_arg1.ItemID, _arg1.CharItemID], "str", this.curRoom);
  2639. };
  2640. };
  2641. }
  2642.  
  2643. public function sendBankToInvRequest(_arg1:Object){
  2644. var _local2:*;
  2645. var _local3:*;
  2646. if (this.myAvatar.items.length >= this.myAvatar.objData.iBagSlots){
  2647. _local2 = new ModalMC();
  2648. _local3 = {};
  2649. _local3.strBody = "You have exceeded your maximum inventory storage!";
  2650. _local3.params = {};
  2651. _local3.glow = "red,medium";
  2652. _local3.btns = "mono";
  2653. this.rootClass.ui.ModalStack.addChild(_local2);
  2654. _local2.init(_local3);
  2655. }
  2656. else {
  2657. this.rootClass.sfc.sendXtMessage("zm", "bankToInv", [_arg1.ItemID, _arg1.CharItemID], "str", this.curRoom);
  2658. };
  2659. }
  2660.  
  2661. public function sendBankSwapInvRequest(_arg1:Object, _arg2:Object){
  2662. var _local3:ModalMC;
  2663. var _local4:Object;
  2664. if (_arg2.bEquip == 1){
  2665. _local3 = new ModalMC();
  2666. _local4 = {};
  2667. _local4.strBody = "You must unequip the item before storing it in the bank!";
  2668. _local4.params = {};
  2669. _local4.glow = "red,medium";
  2670. _local4.btns = "mono";
  2671. this.rootClass.ui.ModalStack.addChild(_local3);
  2672. _local3.init(_local4);
  2673. }
  2674. else {
  2675. if ((((((_arg2.bCoins == 0)) && ((_arg1.bCoins == 1)))) && ((this.myAvatar.iBankCount >= this.myAvatar.objData.iBankSlots)))){
  2676. _local3 = new ModalMC();
  2677. _local4 = {};
  2678. _local4.strBody = "You have exceeded your maximum bank storage for non-RC items!";
  2679. _local4.params = {};
  2680. _local4.glow = "red,medium";
  2681. _local4.btns = "mono";
  2682. this.rootClass.ui.ModalStack.addChild(_local3);
  2683. _local3.init(_local4);
  2684. }
  2685. else {
  2686. this.rootClass.sfc.sendXtMessage("zm", "bankSwapInv", [_arg2.ItemID, _arg2.CharItemID, _arg1.ItemID, _arg1.CharItemID], "str", this.curRoom);
  2687. };
  2688. };
  2689. }
  2690.  
  2691. public function getInventory(_arg1){
  2692. //this.rootClass.sfc.sendXtMessage("zm", "retrieveInventory", [_arg1], "str", this.curRoom);
  2693. this.rootClass.sfc.sendXtMessage("zm", "retrievelnventory", [_arg1], "str", this.curRoom);
  2694. }
  2695.  
  2696. public function sendChangeColorRequest(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
  2697. this.rootClass.sfc.sendXtMessage("zm", "changeColor", [_arg1, _arg2, _arg3, _arg4, this.hairshopinfo.HairShopID], "str", this.curRoom);
  2698. }
  2699.  
  2700. public function sendChangeArmorColorRequest(_arg1:int, _arg2:int, _arg3:int):void{
  2701. this.rootClass.sfc.sendXtMessage("zm", "changeArmorColor", [_arg1, _arg2, _arg3], "str", this.curRoom);
  2702. }
  2703.  
  2704. public function sendLoadBankRequest(_arg1:Array=null):void{
  2705. var _local2:String;
  2706. if (_arg1[0] == "*"){
  2707. _arg1 = ["All"];
  2708. };
  2709. for each (_local2 in _arg1) {
  2710. this.bankinfo.hasRequested[_local2] = true;
  2711. };
  2712. this.rootClass.sfc.sendXtMessage("zm", "loadBank", _arg1, "str", this.curRoom);
  2713. }
  2714.  
  2715. public function sendReloadShopRequest(_arg1:int):void{
  2716. if (((((!((this.shopinfo == null))) && ((this.shopinfo.ShopID == _arg1)))) && (!((this.shopinfo.bLimited == null))))){
  2717. this.rootClass.sfc.sendXtMessage("zm", "reloadShop", [_arg1], "str", this.curRoom);
  2718. };
  2719. }
  2720.  
  2721. public function sendLoadShopRequest(_arg1:int):void{
  2722. if ((((this.shopinfo == null)) || (((!((this.shopinfo.ShopID == _arg1))) || (this.shopinfo.bLimited))))){
  2723. if (this.coolDown("loadShop")){
  2724. this.rootClass.menuClose();
  2725. this.rootClass.sfc.sendXtMessage("zm", "loadShop", [_arg1], "str", this.curRoom);
  2726. };
  2727. }
  2728. else {
  2729. this.rootClass.menuClose();
  2730. if (this.shopinfo.bHouse == 1){
  2731. this.rootClass.ui.mcPopup.fOpen("HouseShop");
  2732. }
  2733. else {
  2734. //FORGE SHOP
  2735. if (this.shopinfo.ShopID == -987){
  2736. this.rootClass.ui.mcPopup.fOpen("ForgeShop");
  2737. }
  2738. else {
  2739. if (this.rootClass.isMergeShop(this.shopinfo)){
  2740. this.rootClass.ui.mcPopup.fOpen("MergeShop");
  2741. }
  2742. else {
  2743. this.rootClass.ui.mcPopup.fOpen("Shop");
  2744. };
  2745. };
  2746. };
  2747. };
  2748. }
  2749.  
  2750. public function sendLoadHairShopRequest(_arg1:int):void{
  2751. if ((((this.hairshopinfo == null)) || (!((this.hairshopinfo.HairShopID == _arg1))))){
  2752. this.rootClass.sfc.sendXtMessage("zm", "loadHairShop", [_arg1], "str", this.curRoom);
  2753. }
  2754. else {
  2755. this.rootClass.openCharacterCustomize();
  2756. };
  2757. }
  2758.  
  2759. public function sendLoadEnhShopRequest(_arg1:int):void{
  2760. var _local2:ModalMC = new ModalMC();
  2761. var _local3:Object = {};
  2762. _local3.strBody = "Old enhancement shops are disabled on the PTR. Please visit AugoEidEs for the new shops.";
  2763. _local3.params = {};
  2764. _local3.btns = "mono";
  2765. this.rootClass.ui.ModalStack.addChild(_local2);
  2766. _local2.init(_local3);
  2767. }
  2768.  
  2769. public function sendEnhItemRequest(_arg1:Object):void{
  2770. this.enhItem = _arg1;
  2771. this.rootClass.sfc.sendXtMessage("zm", "enhanceItem", [_arg1.ItemID, _arg1.EnhID, this.enhShopID], "str", this.curRoom);
  2772. }
  2773.  
  2774. public function sendEnhItemRequestShop(_arg1:Object, _arg2:Object):void{
  2775. if (this.coolDown("buyItem")){
  2776. this.enhItem = _arg1;
  2777. this.rootClass.sfc.sendXtMessage("zm", "enhanceItemShop", [_arg1.ItemID, _arg2.ItemID, this.shopinfo.ShopID], "str", this.curRoom);
  2778. };
  2779. }
  2780.  
  2781. public function sendEnhItemRequestLocal(_arg1:Object, _arg2:Object):void{
  2782. if (this.coolDown("buyItem")){
  2783. this.enhItem = _arg1;
  2784. this.rootClass.sfc.sendXtMessage("zm", "enhanceItemLocal", [_arg1.ItemID, _arg2.ItemID], "str", this.curRoom);
  2785. };
  2786. }
  2787.  
  2788. public function sendBuyItemRequest(_arg1:Object):void{
  2789. var _local2:int;
  2790. if (this.coolDown("buyItem")){
  2791. if ((((_arg1.bStaff == 1)) && ((this.myAvatar.objData.intAccessLevel < 40)))){
  2792. this.rootClass.MsgBox.notify("Test Item: Cannot be purchased yet!");
  2793. }
  2794. else {
  2795. if (((!((this.shopinfo.sField == ""))) && (!((this.getAchievement(this.shopinfo.sField, this.shopinfo.iIndex) == 1))))){
  2796. this.rootClass.MsgBox.notify("Item Locked: Special requirement not met.");
  2797. }
  2798. else {
  2799. if ((((_arg1.bUpg == 1)) && (!(this.myAvatar.isUpgraded())))){
  2800. this.rootClass.showUpgradeWindow();
  2801. }
  2802. else {
  2803. if ((((_arg1.FactionID > 1)) && ((this.myAvatar.getRep(_arg1.FactionID) < _arg1.iReqRep)))){
  2804. this.rootClass.MsgBox.notify("Item Locked: Reputation Requirement not met.");
  2805. }
  2806. else {
  2807. if (!this.rootClass.validateArmor(_arg1)){
  2808. this.rootClass.MsgBox.notify("Item Locked: Class Requirement not met.");
  2809. }
  2810. else {
  2811. if ((((_arg1.iQSindex >= 0)) && ((this.getQuestValue(_arg1.iQSindex) < int(_arg1.iQSvalue))))){
  2812. this.rootClass.MsgBox.notify("Item Locked: Quest Requirement not met.");
  2813. }
  2814. else {
  2815. if (((((this.myAvatar.isItemInInventory(_arg1.ItemID)) || (this.myAvatar.isItemInBank(_arg1.ItemID)))) && (this.myAvatar.isItemStackMaxed(_arg1.ItemID)))){
  2816. this.rootClass.MsgBox.notify((("You cannot have more than " + _arg1.iStk) + " of that item!"));
  2817. }
  2818. else {
  2819. if ((((_arg1.bCoins == 0)) && ((_arg1.iCost > this.myAvatar.objData.intGold)))){
  2820. this.rootClass.MsgBox.notify("Insufficient Funds!");
  2821. }
  2822. else {
  2823. if ((((_arg1.bCoins == 1)) && ((_arg1.iCost > this.myAvatar.objData.intCoins)))){
  2824. _local2 = ExternalInterface.call("getGroup");
  2825. if (_local2 == 1){
  2826. this.rootClass.showACWindow();
  2827. }
  2828. else {
  2829. this.rootClass.MsgBox.notify("Insufficient Funds!");
  2830. };
  2831. }
  2832. else {
  2833. if (((((!(this.rootClass.isHouseItem(_arg1))) && ((this.myAvatar.items.length >= this.myAvatar.objData.iBagSlots)))) || (((this.rootClass.isHouseItem(_arg1)) && ((this.myAvatar.houseitems.length >= this.myAvatar.objData.iHouseSlots)))))){
  2834. this.rootClass.MsgBox.notify("Inventory Full!");
  2835. }
  2836. else {
  2837. if ((((this.shopBuyItem == null)) || (!((this.shopBuyItem.ShopItemID == _arg1.ShopItemID))))){
  2838. this.shopBuyItem = _arg1;
  2839. };
  2840. this.rootClass.sfc.sendXtMessage("zm", "buyItem", [this.shopBuyItem.ItemID, this.shopinfo.ShopID, this.shopBuyItem.ShopItemID], "str", this.curRoom);
  2841. };
  2842. };
  2843. };
  2844. };
  2845. };
  2846. };
  2847. };
  2848. };
  2849. };
  2850. };
  2851. };
  2852. }
  2853.  
  2854. public function sendSellItemRequest(_arg1:Object):void{
  2855. if (this.coolDown("sellItem")){
  2856. this.rootClass.sfc.sendXtMessage("zm", "sellItem", [_arg1.ItemID, _arg1.iQty, _arg1.CharItemID], "str", this.curRoom);
  2857. };
  2858. }
  2859.  
  2860. public function sendRemoveItemRequest(_arg1:Object, _arg2:int=1):void{
  2861. if (_arg2 == 1){
  2862. this.rootClass.sfc.sendXtMessage("zm", "removeItem", [_arg1.ItemID, _arg1.CharItemID], "str", this.curRoom);
  2863. }
  2864. else {
  2865. this.rootClass.sfc.sendXtMessage("zm", "removeItem", [_arg1.ItemID, _arg1.CharItemID, _arg2], "str", this.curRoom);
  2866. };
  2867. }
  2868.  
  2869. public function sendRemoveTempItemRequest(_arg1:int, _arg2:int):void{
  2870. this.rootClass.sfc.sendXtMessage("zm", "removeTempItem", [_arg1, _arg2], "str", this.curRoom);
  2871. this.myAvatar.removeTempItem(_arg1, _arg2);
  2872. }
  2873.  
  2874. public function sendEquipItemRequest(_arg1:Object):Boolean{
  2875. var _local2:Boolean = true;
  2876. if (((!((_arg1 == null))) && (!(this.myAvatar.isItemEquipped(_arg1.ItemID))))){
  2877. if (this.coolDown("equipItem")){
  2878. this.rootClass.sfc.sendXtMessage("zm", "equipItem", [_arg1.ItemID], "str", this.curRoom);
  2879. }
  2880. else {
  2881. _local2 = false;
  2882. };
  2883. }
  2884. else {
  2885. _local2 = false;
  2886. };
  2887. return (_local2);
  2888. }
  2889.  
  2890. public function sendForceEquipRequest(_arg1:int):void{
  2891. this.rootClass.sfc.sendXtMessage("zm", "forceEquipItem", [_arg1], "str", this.curRoom);
  2892. }
  2893.  
  2894. public function sendUnequipItemRequest(_arg1:Object):void{
  2895. if (((!((_arg1 == null))) && (this.myAvatar.isItemEquipped(_arg1.ItemID)))){
  2896. if (this.coolDown("unequipItem")){
  2897. this.rootClass.sfc.sendXtMessage("zm", "unequipItem", [_arg1.ItemID], "str", this.curRoom);
  2898. };
  2899. };
  2900. }
  2901.  
  2902. public function sendChangeClassRequest(_arg1:int):void{
  2903. this.rootClass.sfc.sendXtMessage("zm", "changeClass", [_arg1], "str", this.curRoom);
  2904. }
  2905.  
  2906. public function selfMute(_arg1:int=1):void{
  2907. this.rootClass.sfc.sendXtMessage("zm", "cmd", ["mute", _arg1, this.myAvatar.objData.strUsername.toLowerCase()], "str", this.rootClass.world.curRoom);
  2908. }
  2909.  
  2910. public function equipUseableItem(_arg1:Object):void{
  2911. var _local2:Object;
  2912. var _local4:Object;
  2913. var _local3:int;
  2914. _local3 = 0;
  2915. while (_local3 < this.actions.active.length) {
  2916. if (this.actions.active[_local3].ref == "i1"){
  2917. _local2 = this.actions.active[_local3];
  2918. };
  2919. _local3++;
  2920. };
  2921. _local2.sArg1 = String(_arg1.ItemID);
  2922. _local2.sArg2 = String(_arg1.sDesc);
  2923. this.rootClass.updateIcons(this.getActIcons(_local2), [_arg1.sFile], _arg1);
  2924. this.rootClass.updateActionObjIcon(_local2);
  2925. _local3 = 0;
  2926. while (_local3 < this.myAvatar.items.length) {
  2927. _local4 = this.myAvatar.items[_local3];
  2928. if ((((_local4.sType.toLowerCase() == "item")) && (!((_local4.sLink.toLowerCase() == "none"))))){
  2929. if (_local4.ItemID == _arg1.ItemID){
  2930. _local4.bEquip = 1;
  2931. this.rootClass.sfc.sendXtMessage("zm", "geia", [_local4.sLink, _local4.sMeta], "str", this.rootClass.world.curRoom);
  2932. }
  2933. else {
  2934. _local4.bEquip = 0;
  2935. };
  2936. };
  2937. _local3++;
  2938. };
  2939. if (this.rootClass.ui.mcPopup.mcInventory != null){
  2940. this.rootClass.ui.mcPopup.mcInventory.mcItemList.refreshList();
  2941. this.rootClass.ui.mcPopup.mcInventory.refreshDetail();
  2942. };
  2943. }
  2944.  
  2945. public function unequipUseableItem(_arg1:Object=null):void{
  2946. var _local2:Object;
  2947. var _local3:Object;
  2948. var _local4:int;
  2949. _local4 = 0;
  2950. while (_local4 < this.actions.active.length) {
  2951. if (this.actions.active[_local4].ref == "i1"){
  2952. _local2 = this.actions.active[_local4];
  2953. };
  2954. _local4++;
  2955. };
  2956. _local2.sArg1 = "";
  2957. _local2.sArg2 = "";
  2958. this.rootClass.updateIcons(this.getActIcons(_local2), ["icu1"], null);
  2959. if (_arg1 == null){
  2960. _local4 = 0;
  2961. while (_local4 < this.myAvatar.items.length) {
  2962. _local3 = this.myAvatar.items[_local4];
  2963. if (String(_local3.ItemID) == _local2.sArg1){
  2964. _arg1 = _local3;
  2965. };
  2966. _local4++;
  2967. };
  2968. };
  2969. _arg1.bEquip = 0;
  2970. if (this.rootClass.ui.mcPopup.mcInventory != null){
  2971. this.rootClass.ui.mcPopup.mcInventory.mcItemList.refreshList();
  2972. this.rootClass.ui.mcPopup.mcInventory.refreshDetail();
  2973. };
  2974. }
  2975.  
  2976. public function tryUseItem(_arg1:Object):void{
  2977. if (_arg1.sType.toLowerCase() == "clientuse"){
  2978. switch (_arg1.sLink){
  2979. };
  2980. }
  2981. else {
  2982. if (_arg1.sType.toLowerCase() == "serveruse"){
  2983. this.sendUseItemRequest(_arg1);
  2984. };
  2985. };
  2986. }
  2987.  
  2988. public function sendUseItemRequest(_arg1:Object):void{
  2989. this.rootClass.sfc.sendXtMessage("zm", "serverUseItem", ["+", _arg1.ItemID], "str", -1);
  2990. }
  2991.  
  2992. public function sendUseItemArrayRequest(_arg1:Array):void{
  2993. this.rootClass.sfc.sendXtMessage("zm", "serverUseItem", _arg1, "str", -1);
  2994. }
  2995.  
  2996. public function bankContains(_arg1:Array):Boolean{
  2997. var _local4:String;
  2998. var _local5:Object;
  2999. trace(("bankContains > " + _arg1.toString()));
  3000. var _local2:Array = [];
  3001. var _local3:int;
  3002. while ((((_local3 < this.bankinfo.items.length)) && (!((_local2.length == _arg1.length))))) {
  3003. _local5 = this.bankinfo.items[_local3];
  3004. _local3++;
  3005. if ((((_local2.indexOf(_local5.sType) == -1)) && ((_arg1.indexOf(_local5.sType) > -1)))){
  3006. _local2.push(_local5.sType);
  3007. };
  3008. };
  3009. return ((_local2.length == _arg1.length));
  3010. }
  3011.  
  3012. public function bankHasRequested(_arg1:Array):Boolean{
  3013. var _local2:String;
  3014. for each (_local2 in _arg1) {
  3015. if (!(_local2 in this.bankinfo.hasRequested)){
  3016. return (false);
  3017. };
  3018. };
  3019. return (true);
  3020. }
  3021.  
  3022. public function addItemsToBank(_arg1:Array):void{
  3023. var _local3:Object;
  3024. var _local4:Object;
  3025. var _local2:Boolean = true;
  3026. for each (_local3 in _arg1) {
  3027. _local2 = true;
  3028. for each (_local4 in this.bankinfo.items) {
  3029. if (_local4.ItemID == _local3.ItemID){
  3030. _local2 = false;
  3031. break;
  3032. };
  3033. };
  3034. if (_local2){
  3035. this.bankinfo.items.push(_local3);
  3036. };
  3037. };
  3038. }
  3039.  
  3040. public function toggleBank():void{
  3041. if (!this.uiLock){
  3042. if (this.rootClass.ui.mcPopup.currentLabel == "Bank"){
  3043. MovieClip(this.rootClass.ui.mcPopup.getChildByName("mcBank")).fClose();
  3044. }
  3045. else {
  3046. this.rootClass.ui.mcPopup.fOpen("Bank");
  3047. };
  3048. };
  3049. }
  3050.  
  3051. public function sendReport(_arg1:Array):void{
  3052. this.rootClass.sfc.sendXtMessage("zm", "cmd", _arg1, "str", this.rootClass.world.curRoom);
  3053. }
  3054.  
  3055. public function sendWhoRequest():void{
  3056. if (this.coolDown("who")){
  3057. this.rootClass.sfc.sendXtMessage("zm", "cmd", ["who"], "str", this.curRoom);
  3058. };
  3059. }
  3060.  
  3061. public function sendRewardReferralRequest(_arg1):void{
  3062. this.rootClass.sfc.sendXtMessage("zm", "rewardReferral", [], "str", this.curRoom);
  3063. }
  3064.  
  3065. public function sendGetAdDataRequest():void{
  3066. if (this.rootClass.world.myAvatar.objData.iDailyAds < this.rootClass.world.myAvatar.objData.iDailyAdCap){
  3067. this.rootClass.sfc.sendXtMessage("zm", "getAdData", [], "str", this.curRoom);
  3068. };
  3069. }
  3070.  
  3071. public function sendGetAdRewardRequest():void{
  3072. if (this.rootClass.world.myAvatar.objData.iDailyAds < this.rootClass.world.myAvatar.objData.iDailyAdCap){
  3073. this.rootClass.sfc.sendXtMessage("zm", "getAdReward", [], "str", this.curRoom);
  3074. };
  3075. }
  3076.  
  3077. public function sendWarVarsRequest():void{
  3078. this.rootClass.sfc.sendXtMessage("zm", "loadWarVars", [], "str", this.curRoom);
  3079. }
  3080.  
  3081. public function loadQuestStringData():void{
  3082. this.rootClass.sfc.sendXtMessage("zm", "loadQuestStringData", [], "str", this.curRoom);
  3083. }
  3084.  
  3085. public function buyBagSlots(_arg1:int):void{
  3086. this.rootClass.sfc.sendXtMessage("zm", "buyBagSlots", [_arg1], "str", this.curRoom);
  3087. }
  3088.  
  3089. public function buyBankSlots(_arg1:int):void{
  3090. this.rootClass.sfc.sendXtMessage("zm", "buyBankSlots", [_arg1], "str", this.curRoom);
  3091. }
  3092.  
  3093. public function buyHouseSlots(_arg1:int):void{
  3094. this.rootClass.sfc.sendXtMessage("zm", "buyHouseSlots", [_arg1], "str", this.curRoom);
  3095. }
  3096.  
  3097. public function sendLoadFriendsListRequest(){
  3098. this.rootClass.sfc.sendXtMessage("zm", "loadFriendsList", [], "str", this.curRoom);
  3099. }
  3100.  
  3101. public function sendLoadFactionRequest(){
  3102. this.rootClass.sfc.sendXtMessage("zm", "loadFactions", [], "str", this.curRoom);
  3103. }
  3104.  
  3105. public function initAchievements():void{
  3106. var _local2 = this.myAvatar.objData;
  3107. with (_local2) {
  3108. ip0 = uint(ip0);
  3109. ia0 = uint(ia0);
  3110. ia1 = uint(ia1);
  3111. id0 = uint(id0);
  3112. id1 = uint(id1);
  3113. id2 = uint(id2);
  3114. im0 = uint(im0);
  3115. iq0 = uint(iq0);
  3116. };
  3117. }
  3118.  
  3119. public function getAchievement(_arg1:String, _arg2:int):int{
  3120. if ((((_arg2 < 0)) || ((_arg2 > 31)))){
  3121. return (-1);
  3122. };
  3123. var _local3:* = this.myAvatar.objData[_arg1];
  3124. if (_local3 == null){
  3125. return (-1);
  3126. };
  3127. trace(("returning: " + ((_local3 & Math.pow(2, _arg2)) == 0)));
  3128. return (((((_local3 & Math.pow(2, _arg2)))==0) ? 0 : 1));
  3129. }
  3130.  
  3131. public function setAchievement(_arg1:String, _arg2:int, _arg3:int=1):void{
  3132. var _local4:* = ["ia0", "iq0"];
  3133. if ((((((((_local4.indexOf(_arg1) >= 0)) && ((_arg2 >= 0)))) && ((_arg2 < 32)))) && (!((this.getAchievement(_arg1, _arg2) == _arg3))))){
  3134. this.rootClass.sfc.sendXtMessage("zm", "setAchievement", [_arg1, _arg2, _arg3], "str", this.curRoom);
  3135. };
  3136. }
  3137.  
  3138. public function updateAchievement(_arg1:String, _arg2:int, _arg3:int):void{
  3139. if (_arg3 == 0){
  3140. this.myAvatar.objData[_arg1] = (this.myAvatar.objData[_arg1] & ~(Math.pow(2, _arg2)));
  3141. }
  3142. else {
  3143. if (_arg3 == 1){
  3144. this.myAvatar.objData[_arg1] = (this.myAvatar.objData[_arg1] | Math.pow(2, _arg2));
  3145. };
  3146. };
  3147. this.rootClass.readIA1Preferences();
  3148. }
  3149.  
  3150. public function showFriendsList():void{
  3151. var _local1:*;
  3152. trace(("friends: " + this.myAvatar.friends));
  3153. if (((!((this.myAvatar.friends == null))) && (this.myAvatar.friendsLoaded))){
  3154. _local1 = {};
  3155. _local1.typ = "userListFriends";
  3156. _local1.ul = this.myAvatar.friends;
  3157. this.rootClass.ui.mcOFrame.fOpenWith(_local1);
  3158. }
  3159. else {
  3160. this.myAvatar.friendsLoaded = true;
  3161. this.rootClass.sfc.sendXtMessage("zm", "getfriendlist", [], "str", -1);
  3162. };
  3163. }
  3164.  
  3165. public function showGuildList():void{
  3166. if (this.myAvatar.objData.guild != null){
  3167. this.rootClass.ui.mcPopup.fOpen("GuildPanel");
  3168. }
  3169. else {
  3170. this.rootClass.MsgBox.notify("You need to create or join a guild first.");
  3171. };
  3172. }
  3173.  
  3174. public function showIgnoreList():void{
  3175. var _local1:Object;
  3176. if (((!((this.rootClass.chatF.ignoreList.data.users == null))) && ((this.rootClass.chatF.ignoreList.data.users.length > 0)))){
  3177. _local1 = {};
  3178. _local1.typ = "userListIgnore";
  3179. this.rootClass.ui.mcOFrame.fOpenWith(_local1);
  3180. }
  3181. else {
  3182. this.rootClass.chatF.pushMsg("warning", "Your ignore list is empty!.", "SERVER", "", 0);
  3183. };
  3184. }
  3185.  
  3186. public function isModerator(_arg1:String):void{
  3187. this.rootClass.sfc.sendXtMessage("zm", "isModerator", [_arg1], "str", -1);
  3188. }
  3189.  
  3190. public function toggleName(_arg1, _arg2:String){
  3191. if (_arg2 == "on"){
  3192. this.getMCByUserID(_arg1).pname.visible = true;
  3193. };
  3194. if (_arg2 == "off"){
  3195. this.getMCByUserID(_arg1).pname.visible = false;
  3196. };
  3197. }
  3198.  
  3199. public function toggleHPBar():void{
  3200. var _local1:String;
  3201. var _local2:MovieClip;
  3202. var _local3:Avatar;
  3203. this.showHPBar = !(this.showHPBar);
  3204. for (_local1 in this.avatars) {
  3205. _local3 = this.avatars[_local1];
  3206. if (_local3.pMC != null){
  3207. _local2 = _local3.pMC;
  3208. if (this.showHPBar){
  3209. _local2.showHPBar();
  3210. }
  3211. else {
  3212. _local2.hideHPBar();
  3213. };
  3214. };
  3215. };
  3216. }
  3217.  
  3218. public function resPlayer(){
  3219. this.afkPostpone();
  3220. this.rootClass.sfc.sendXtMessage("zm", "resPlayerTimed", [this.rootClass.sfc.myUserId], "str", this.curRoom);
  3221. }
  3222.  
  3223. public function showResCounter(){
  3224. trace("line 1131");
  3225. var _local1:* = MovieClip(this.rootClass.ui.mcRes);
  3226. if (_local1.currentLabel == "in"){
  3227. return;
  3228. };
  3229. _local1.gotoAndPlay("in");
  3230. _local1.resC = 10;
  3231. trace("line 1136");
  3232. trace("line 1146");
  3233. if (_local1.resTimer == null){
  3234. _local1.resTimer = new Timer(1000);
  3235. _local1.resTimer.addEventListener("timer", this.resTimer);
  3236. }
  3237. else {
  3238. _local1.resTimer.reset();
  3239. };
  3240. trace("line 1153");
  3241. _local1.resTimer.start();
  3242. }
  3243.  
  3244. public function resTimer(_arg1:TimerEvent){
  3245. var _local2:* = MovieClip(this.rootClass.ui.mcRes);
  3246. _local2.resC--;
  3247. if (_local2.resC > 0){
  3248. _local2.mcTomb.ti.text = ("0" + _local2.resC);
  3249. }
  3250. else {
  3251. _local2.mcTomb.ti.text = "00";
  3252. _arg1.target.reset();
  3253. _local2.visible = false;
  3254. _local2.gotoAndStop(1);
  3255. this.resPlayer();
  3256. };
  3257. }
  3258.  
  3259. public function danceRequest(_arg1){
  3260. var _local2:*;
  3261. if (_arg1.accept){
  3262. this.rootClass.chatF.submitMsg(_arg1.emote1, "emote", this.rootClass.sfc.myUserName);
  3263. }
  3264. else {
  3265. _local2 = {};
  3266. _local2.typ = "danceDenied";
  3267. _local2.cell = this.strFrame;
  3268. this.rootClass.sfc.sendObjectToGroup(_local2, [_arg1.sender.getId()], this.curRoom);
  3269. };
  3270. }
  3271.  
  3272. public function rest():void{
  3273. if (!this.restTimer.running){
  3274. this.myAvatar.pMC.mcChar.gotoAndPlay("Rest");
  3275. this.rootClass.sfc.sendXtMessage("zm", "emotea", ["rest"], "str", 1);
  3276. this.restStart();
  3277. };
  3278. }
  3279.  
  3280. public function restStart(){
  3281. this.afkPostpone();
  3282. this.restTimer.reset();
  3283. this.restTimer.start();
  3284. }
  3285.  
  3286. public function restRequest(_arg1:TimerEvent){
  3287. var _local2:* = this.getUoLeafById(this.myAvatar.uid);
  3288. if (((((((!((_local2.intHP == _local2.intHPMax))) || (!((_local2.intMP == _local2.intMPMax))))) && ((this.myAvatar.pMC.mcChar.currentLabel == "Rest")))) && ((_local2.intState == 1)))){
  3289. if (this.coolDown("rest")){
  3290. this.rootClass.sfc.sendXtMessage("zm", "restRequest", [""], "str", 1);
  3291. this.restTimer.reset();
  3292. this.restTimer.start();
  3293. }
  3294. else {
  3295. this.restStart();
  3296. };
  3297. }
  3298. else {
  3299. this.restTimer.reset();
  3300. };
  3301. }
  3302.  
  3303. public function afkToggle():void{
  3304. var _local1:* = this.uoTree[this.rootClass.sfc.myUserName];
  3305. if (_local1 != null){
  3306. this.rootClass.sfc.sendXtMessage("zm", "afk", [!(_local1.afk)], "str", 1);
  3307. };
  3308. }
  3309.  
  3310. public function afkTimerHandler(_arg1:Event):void{
  3311. var _local2:* = this.uoTree[this.rootClass.sfc.myUserName];
  3312. if (_local2 != null){
  3313. this.rootClass.sfc.sendXtMessage("zm", "afk", [true], "str", 1);
  3314. };
  3315. }
  3316.  
  3317. public function afkPostpone():void{
  3318. this.afkTimer.reset();
  3319. this.afkTimer.start();
  3320. var _local1:* = new Date().getTime();
  3321. var _local2:* = this.uoTree[this.rootClass.sfc.myUserName];
  3322. if (((((!((_local2 == null))) && (_local2.afk))) && ((((_local2.afkts == null)) || ((_local1 > (_local2.afkts + 500))))))){
  3323. this.rootClass.sfc.sendXtMessage("zm", "afk", [false], "str", 1);
  3324. _local2.afkts = _local1;
  3325. };
  3326. }
  3327.  
  3328. public function hideAllPets():void{
  3329. var _local1:*;
  3330. for (_local1 in this.avatars) {
  3331. if (this.avatars[_local1] != null){
  3332. this.avatars[_local1].unloadPet();
  3333. };
  3334. };
  3335. }
  3336.  
  3337. public function showAllPets():void{
  3338. var _local1:*;
  3339. var _local2:Object;
  3340. var _local3:*;
  3341. for (_local1 in this.avatars) {
  3342. _local2 = this.getUoLeafById(_local1);
  3343. _local3 = String(_local2.strFrame);
  3344. if (_local3 == this.strFrame){
  3345. this.avatars[_local1].loadPet();
  3346. };
  3347. };
  3348. }
  3349.  
  3350. public function updateMonsters(){
  3351. var _local1:int;
  3352. if (this.monmap != null){
  3353. _local1 = 0;
  3354. while (_local1 < this.monmap.length) {
  3355. if (this.monmap[_local1].strFrame == this.strFrame){
  3356. this.updateMonster(this.monmap[_local1]);
  3357. };
  3358. _local1++;
  3359. };
  3360. };
  3361. }
  3362.  
  3363. public function updateMonster(_arg1:Object):void{
  3364. var _local2:* = this.getMonsterDefinition(_arg1.MonID);
  3365. var _local3:* = this.getMonster(_arg1.MonMapID);
  3366. if (_local3.pMC == null){
  3367. trace((">> Monster Pad Missing - MonMapID:" + _arg1.MonMapID));
  3368. return;
  3369. };
  3370. _local3.objData.intMPMax = int(_local3.objData.intMPMax);
  3371. _local3.objData.intHPMax = int(_local3.objData.intMPMax);
  3372. var _local4:* = this.monTree[_arg1.MonMapID];
  3373. if (((!((_local4.MonID == _local3.objData.MonID))) || ((_local4.intState == 0)))){
  3374. _local3.pMC.visible = false;
  3375. };
  3376. if ((_local3.pMC.x - this.myAvatar.pMC.x) >= 0){
  3377. _local3.pMC.turn("left");
  3378. };
  3379. _local3.pMC.updateNamePlate();
  3380. }
  3381.  
  3382. public function createMonsterMC(_arg1:MovieClip, _arg2:int, _arg3:Boolean=false):MonsterMC{
  3383. var _local5:MonsterMC;
  3384. var _local6:int;
  3385. var _local7:Class;
  3386. var _local4:* = this.getMonsterDefinition(_arg2);
  3387. if (_arg3){
  3388. _local6 = Math.round((Math.random() * (this.chaosNames.length - 1)));
  3389. trace("chaos names");
  3390. trace(this.chaosNames);
  3391. if (this.chaosNames[_local6] != this.rootClass.world.myAvatar.objData.strUsername){
  3392. _local5 = new MonsterMC(this.chaosNames[_local6]);
  3393. }
  3394. else {
  3395. _local6 = (((_local6)==0) ? ++_local6 : --_local6);
  3396. _local5 = new MonsterMC(this.chaosNames[_local6]);
  3397. };
  3398. trace(("mon name: " + this.chaosNames[_local6]));
  3399. }
  3400. else {
  3401. if (Number((this.objExtra["bChar"] == 1))){
  3402. _local5 = new MonsterMC(this.myAvatar.objData.strUsername);
  3403. }
  3404. else {
  3405. _local5 = new MonsterMC(_local4.strMonName);
  3406. };
  3407. };
  3408. this.CHARS.addChild(_local5);
  3409. _local5.x = _arg1.x;
  3410. _local5.y = _arg1.y;
  3411. _local5.ox = _local5.x;
  3412. _local5.oy = _local5.y;
  3413. if (Number((this.objExtra["bChar"] == 1))){
  3414. _local5.removeChildAt(1);
  3415. _local5.addChildAt((new dummyMC() as MovieClip), 1);
  3416. this.copyAvatarMC((_local5.getChildAt(1) as MovieClip));
  3417. }
  3418. else {
  3419. _local7 = (this.loaderD.getDefinition(_local4.strLinkage) as Class);
  3420. _local5.removeChildAt(1);
  3421. _local5.addChildAt(new (_local7)(), 1);
  3422. };
  3423. _local5.mouseEnabled = false;
  3424. _local5.bubble.mouseEnabled = (_local5.bubble.mouseChildren = false);
  3425. _local5.init();
  3426. if (("strDir" in _arg1)){
  3427. if (_arg1.strDir == "static"){
  3428. _local5.isStatic = true;
  3429. };
  3430. };
  3431. if (("noMove" in _arg1)){
  3432. _local5.noMove = _arg1.noMove;
  3433. };
  3434. return (_local5);
  3435. }
  3436.  
  3437. public function getMonDataById(){
  3438. }
  3439.  
  3440. public function retrieveMonData(){
  3441. this.rootClass.sfc.sendXtMessage("zm", "retrieveMonData", [], "str", 1);
  3442. }
  3443.  
  3444. private function getMonID(_arg1:int):int{
  3445. var _local2:String;
  3446. var _local3:*;
  3447. for (_local2 in this.monTree) {
  3448. _local3 = this.monTree[_local2];
  3449. if (_local3.MonMapID == _arg1){
  3450. return (_local3.MonID);
  3451. };
  3452. };
  3453. return (-1);
  3454. }
  3455.  
  3456. private function getMonsterDefinition(_arg1:int):Object{
  3457. var _local2:int;
  3458. while (_local2 < this.mondef.length) {
  3459. if (this.mondef[_local2].MonID == _arg1){
  3460. return (this.mondef[_local2]);
  3461. };
  3462. _local2++;
  3463. };
  3464. return (null);
  3465. }
  3466.  
  3467. public function getMonster(_arg1:int):Avatar{
  3468. var _local2:int;
  3469. while (_local2 < this.monsters.length) {
  3470. if ((((this.monsters[_local2].objData.MonMapID == _arg1)) && ((this.monsters[_local2].objData.MonID == this.monTree[_arg1].MonID)))){
  3471. return (this.monsters[_local2]);
  3472. };
  3473. _local2++;
  3474. };
  3475. return (null);
  3476. }
  3477.  
  3478. public function getMonsters(_arg1:int):Array{
  3479. var _local2:Array = [];
  3480. var _local3:int;
  3481. while (_local3 < this.monsters.length) {
  3482. if (this.monsters[_local3].objData.MonMapID == _arg1){
  3483. _local2.push(this.monsters[_local3]);
  3484. };
  3485. _local3++;
  3486. };
  3487. if (_local2.length > 0){
  3488. return (_local2);
  3489. };
  3490. return (null);
  3491. }
  3492.  
  3493. public function getMonsterCluster(_arg1:int):Array{
  3494. var _local2:* = [];
  3495. var _local3:int;
  3496. while (_local3 < this.monsters.length) {
  3497. if (this.monsters[_local3].objData.MonMapID == _arg1){
  3498. _local2.push(this.monsters[_local3]);
  3499. };
  3500. _local3++;
  3501. };
  3502. return (_local2);
  3503. }
  3504.  
  3505. public function getMonstersByCell(_arg1:String):Array{
  3506. var _local2:Array = [];
  3507. var _local3:int;
  3508. while (_local3 < this.monsters.length) {
  3509. if (((!((this.monsters[_local3].dataLeaf == null))) && ((this.monsters[_local3].dataLeaf.strFrame == _arg1)))){
  3510. _local2.push(this.monsters[_local3]);
  3511. };
  3512. _local3++;
  3513. };
  3514. return (_local2);
  3515. }
  3516.  
  3517. public function initMonsters(_arg1:Array, _arg2:Array){
  3518. var _local4:Object;
  3519. var _local5:int;
  3520. var _local6:*;
  3521. var _local7:*;
  3522. var _local8:*;
  3523. var _local3:int;
  3524. if (((!((_arg1 == null))) && (!((_arg2 == null))))){
  3525. this.monswf = new Array();
  3526. this.monsters = new Array();
  3527. _local4 = null;
  3528. _local3 = 0;
  3529. while (_local3 < _arg2.length) {
  3530. _local5 = 0;
  3531. while (_local5 < _arg1.length) {
  3532. if (_arg2[_local3].MonID == _arg1[_local5].MonID){
  3533. _local4 = _arg1[_local5];
  3534. };
  3535. _local5++;
  3536. };
  3537. this.monsters.push(new Avatar(this.rootClass));
  3538. _local6 = this.monsters[(this.monsters.length - 1)];
  3539. _local6.npcType = "monster";
  3540. if (_local6.objData == null){
  3541. _local6.objData = {};
  3542. };
  3543. for (_local7 in _local4) {
  3544. _local6.objData[_local7] = _local4[_local7];
  3545. };
  3546. for (_local7 in _arg2[_local3]) {
  3547. _local6.objData[_local7] = _arg2[_local3][_local7];
  3548. };
  3549. _local8 = this.monTree[String(_local6.objData.MonMapID)];
  3550. _local8.strFrame = String(_local6.objData.strFrame);
  3551. if (_local8.MonID == _local6.objData.MonID){
  3552. _local6.dataLeaf = this.monTree[_local6.objData.MonMapID];
  3553. }
  3554. else {
  3555. _local6.dataLeaf = null;
  3556. };
  3557. _local3++;
  3558. };
  3559. _local3 = 0;
  3560. while (_local3 < _arg1.length) {
  3561. trace(((((_local3 + " ") + this.rootClass.getFilePath()) + "mon/") + _arg1[_local3].strMonFileName));
  3562. this.queueLoad({
  3563. strFile:((this.rootClass.getFilePath() + "mon/") + _arg1[_local3].strMonFileName),
  3564. callBackA:this.onMonLoadComplete
  3565. });
  3566. _local3++;
  3567. };
  3568. };
  3569. }
  3570.  
  3571. private function onMonLoadComplete(_arg1:Event){
  3572. this.monswf.push(MovieClip(Loader(_arg1.target.loader).content));
  3573. trace((((((" >>>> successful " + Loader(_arg1.target.loader).contentLoaderInfo.url) + " ") + this.monswf.length) + " / ") + this.mondef.length));
  3574. if (this.monswf.length == this.mondef.length){
  3575. this.enterMap();
  3576. };
  3577. }
  3578.  
  3579. public function setTarget(_arg1){
  3580. if (((!((this.myAvatar == null))) && (!((this.myAvatar.target == _arg1))))){
  3581. if (this.myAvatar.target != null){
  3582. if (this.myAvatar.target.npcType == "monster"){
  3583. if (((((this.bPvP) && (!((this.myAvatar.target.dataLeaf.react == null))))) && ((this.myAvatar.target.dataLeaf.react[this.myAvatar.dataLeaf.pvpTeam] == 1)))){
  3584. this.myAvatar.target.pMC.modulateColor(this.avtPCT, "-");
  3585. }
  3586. else {
  3587. this.myAvatar.target.pMC.modulateColor(this.avtMCT, "-");
  3588. };
  3589. };
  3590. if (this.myAvatar.target.npcType == "player"){
  3591. if (((this.bPvP) && (!((this.myAvatar.target.dataLeaf.pvpTeam == this.myAvatar.dataLeaf.pvpTeam))))){
  3592. this.myAvatar.target.pMC.modulateColor(this.avtMCT, "-");
  3593. }
  3594. else {
  3595. this.myAvatar.target.pMC.modulateColor(this.avtPCT, "-");
  3596. };
  3597. };
  3598. };
  3599. if (_arg1 != null){
  3600. if (((!(this.bPvP)) && ((_arg1.npcType == "player")))){
  3601. if (this.autoActionTimer != null){
  3602. this.cancelAutoAttack();
  3603. };
  3604. };
  3605. this.myAvatar.target = _arg1;
  3606. if (this.myAvatar.target.npcType == "monster"){
  3607. if (((((this.bPvP) && (!((this.myAvatar.target.dataLeaf.react == null))))) && ((this.myAvatar.target.dataLeaf.react[this.myAvatar.dataLeaf.pvpTeam] == 1)))){
  3608. this.myAvatar.target.pMC.modulateColor(this.avtPCT, "+");
  3609. }
  3610. else {
  3611. this.myAvatar.target.pMC.modulateColor(this.avtMCT, "+");
  3612. };
  3613. };
  3614. if (this.myAvatar.target.npcType == "player"){
  3615. if (((this.bPvP) && (!((this.myAvatar.target.dataLeaf.pvpTeam == this.myAvatar.dataLeaf.pvpTeam))))){
  3616. this.myAvatar.target.pMC.modulateColor(this.avtMCT, "+");
  3617. }
  3618. else {
  3619. this.myAvatar.target.pMC.modulateColor(this.avtPCT, "+");
  3620. };
  3621. };
  3622. this.rootClass.showPortraitTarget(_arg1);
  3623. }
  3624. else {
  3625. this.rootClass.hidePortraitTarget();
  3626. if (this.myAvatar.dataLeaf.intState > 0){
  3627. this.exitCombat();
  3628. };
  3629. this.myAvatar.target = null;
  3630. };
  3631. };
  3632. }
  3633.  
  3634. public function cancelTarget():void{
  3635. if (((!((this.autoActionTimer == null))) && (this.autoActionTimer.running))){
  3636. this.cancelAutoAttack();
  3637. this.myAvatar.pMC.mcChar.gotoAndStop("Idle");
  3638. return;
  3639. };
  3640. if (this.myAvatar.target != null){
  3641. this.setTarget(null);
  3642. return;
  3643. };
  3644. }
  3645.  
  3646. public function approachTarget(){
  3647. var _local3:Object;
  3648. var _local5:Boolean;
  3649. var _local6:Point;
  3650. var _local7:Point;
  3651. var _local8:Number;
  3652. var _local9:Number;
  3653. var _local10:int;
  3654. var _local11:int;
  3655. var _local12:int;
  3656. var _local13:int;
  3657. var _local14:int;
  3658. var _local15:int;
  3659. var _local16:*;
  3660. var _local17:*;
  3661. var _local18:*;
  3662. var _local19:int;
  3663. var _local20:int;
  3664. var _local21:Array;
  3665. var _local22:Array;
  3666. var _local1:Boolean = true;
  3667. var _local2:Object = this.uoTree[this.rootClass.sfc.myUserName];
  3668. var _local4:Object = this.getAutoAttack();
  3669. if (this.myAvatar.target != null){
  3670. if (this.myAvatar.target.npcType == "monster"){
  3671. _local3 = this.monTree[this.myAvatar.target.objData.MonMapID];
  3672. }
  3673. else {
  3674. if (this.myAvatar.target.npcType == "player"){
  3675. _local3 = this.myAvatar.target.dataLeaf;
  3676. };
  3677. };
  3678. if ((((((_local3 == null)) || ((_local2.intState == 0)))) || ((_local3.intState == 0)))){
  3679. _local1 = false;
  3680. };
  3681. trace(("bPvP ? " + this.bPvP));
  3682. trace(("myAvatar.target.npcType ? " + (this.myAvatar.target.npcType == "player")));
  3683. if (((((this.bPvP) && (((((!((_local3.react == null))) && ((_local3.react[_local2.pvpTeam] == 1)))) || ((_local2.pvpTeam == _local3.pvpTeam)))))) || (((!(this.bPvP)) && ((this.myAvatar.target.npcType == "player")))))){
  3684. _local1 = false;
  3685. };
  3686. if (_local1){
  3687. this.rootClass.mixer.playSound("ClickBig");
  3688. if (_local4 != null){
  3689. if (this.actionRangeCheck(_local4)){
  3690. this.testAction(_local4);
  3691. }
  3692. else {
  3693. this.actionReady = true;
  3694. _local5 = false;
  3695. _local6 = this.myAvatar.pMC.mcChar.localToGlobal(new Point(0, 0));
  3696. _local7 = this.myAvatar.target.pMC.mcChar.localToGlobal(new Point(0, 0));
  3697. if (_local4.range > 301){
  3698. _local8 = Point.distance(_local6, _local7);
  3699. _local9 = (_local4.range * this.SCALE);
  3700. _local9 = (_local9 * 0.9);
  3701. if (_local9 < _local8){
  3702. _local7 = Point.interpolate(_local6, _local7, (_local9 / _local8));
  3703. };
  3704. _local5 = !(this.padHit(_local7.x, _local7.y, this.myAvatar.pMC.shadow.getBounds(this.rootClass.stage)));
  3705. }
  3706. else {
  3707. _local10 = 0;
  3708. while ((((_local10 < 100)) && (!(_local5)))) {
  3709. _local11 = int((50 + (Math.random() * 110)));
  3710. if (_local10 > 50){
  3711. _local11 = (_local11 * -1);
  3712. };
  3713. _local12 = ((((_local7.x - _local6.x))>=0) ? -(_local11) : _local11);
  3714. _local13 = ((Math.random() * 40) - 20);
  3715. _local12 = Math.ceil((_local12 * this.SCALE));
  3716. _local13 = Math.floor((_local13 * this.SCALE));
  3717. _local14 = (_local7.x + _local12);
  3718. _local15 = (_local7.y + _local13);
  3719. _local5 = !(this.padHit(_local14, _local15, this.myAvatar.pMC.shadow.getBounds(this.rootClass.stage)));
  3720. _local10++;
  3721. };
  3722. _local7.x = (_local7.x + _local12);
  3723. _local7.y = (_local7.y + _local13);
  3724. };
  3725. if (_local5){
  3726. this.myAvatar.pMC.walkTo(_local7.x, _local7.y, (this.WALKSPEED * 2));
  3727. this.pushMove(this.myAvatar.pMC, _local7.x, _local7.y, (this.WALKSPEED * 2));
  3728. }
  3729. else {
  3730. this.rootClass.chatF.pushMsg("server", "No path found!", "SERVER", "", 0);
  3731. };
  3732. };
  3733. };
  3734. };
  3735. }
  3736. else {
  3737. _local16 = this.myAvatar;
  3738. _local17 = null;
  3739. _local18 = null;
  3740. _local19 = ((("tgtMin" in _local4)) ? _local4.tgtMin : 1);
  3741. _local20 = ((("tgtMax" in _local4)) ? _local4.tgtMax : 1);
  3742. _local21 = [];
  3743. _local22 = this.getAllAvatarsInCell();
  3744. for each (_local17 in _local22) {
  3745. _local3 = _local17.dataLeaf;
  3746. if (((((!((_local3 == null))) && (((((((!(this.bPvP)) && ((_local17.npcType == "monster")))) || (((((this.bPvP) && ((_local17.npcType == "player")))) && (!((_local2.pvpTeam == _local3.pvpTeam))))))) || (((((((this.bPvP) && ((_local17.npcType == "monster")))) && (!((_local3.react == null))))) && ((_local3.react[_local2.pvpTeam] == 0)))))))) && (this.actionRangeCheck(_local4, _local17)))){
  3747. this.setTarget(_local17);
  3748. this.testAction(_local4);
  3749. return;
  3750. };
  3751. };
  3752. this.rootClass.chatF.pushMsg("warning", "No target selected!", "SERVER", "", 0);
  3753. };
  3754. }
  3755.  
  3756. public function padHit(_arg1:int, _arg2:int, _arg3:Rectangle):Boolean{
  3757. var _local5:Rectangle;
  3758. var _local6:MovieClip;
  3759. var _local4:int;
  3760. if ((((((((_arg1 < 0)) || ((_arg1 > 960)))) || ((_arg2 < 10)))) || ((_arg2 > 530)))){
  3761. return (false);
  3762. };
  3763. _arg3.x = int((_arg1 - (_arg3.width / 2)));
  3764. _arg3.y = int((_arg2 - (_arg3.height / 2)));
  3765. _local4 = 0;
  3766. while (_local4 < this.arrEvent.length) {
  3767. _local6 = this.arrEvent[_local4];
  3768. if (((("strSpawnCell" in _local6)) || (("tCell" in _local6)))){
  3769. _local5 = this.arrEventR[_local4];
  3770. if (_arg3.intersects(_local5)){
  3771. return (true);
  3772. };
  3773. };
  3774. _local4++;
  3775. };
  3776. return (false);
  3777. }
  3778.  
  3779. public function drawRects(_arg1:Array):void{
  3780. var _local5:Rectangle;
  3781. var _local2:Array = [0xFF0000, 0xFF00, 0xFF];
  3782. var _local3:Sprite = new Sprite();
  3783. var _local4:Graphics = _local3.graphics;
  3784. var _local6:int;
  3785. _local6 = 0;
  3786. while (_local6 < _arg1.length) {
  3787. _local5 = _arg1[_local6];
  3788. _local4.moveTo(_local5.x, _local5.y);
  3789. _local4.beginFill(_local2[_local6], 0.3);
  3790. _local4.lineTo((_local5.x + _local5.width), _local5.y);
  3791. _local4.lineTo((_local5.x + _local5.width), (_local5.y + _local5.height));
  3792. _local4.lineTo(_local5.x, (_local5.y + _local5.height));
  3793. _local4.lineTo(_local5.x, _local5.y);
  3794. _local4.endFill();
  3795. _local6++;
  3796. };
  3797. }
  3798.  
  3799. public function testAction(_arg1:Object, _arg2:Boolean=false){
  3800. var tLeaf:Object;
  3801. var aura:Object;
  3802. var pet:* = undefined;
  3803. var tgtOK:Boolean;
  3804. var sAvt:Avatar;
  3805. var to:Object;
  3806. var now:Number;
  3807. var actionObj:Object = _arg1;
  3808. var forceAARangeError:Boolean = _arg2;
  3809. trace(("testAction > " + actionObj.nam));
  3810. var a:int;
  3811. var b:int;
  3812. var c:int;
  3813. var cLeaf:Object = this.uoTreeLeaf(this.rootClass.sfc.myUserName);
  3814. var cAvt:* = this.myAvatar;
  3815. var tAvt:* = null;
  3816. var pAvt:* = null;
  3817. var tgtMin:int = ((("tgtMin" in actionObj)) ? actionObj.tgtMin : 1);
  3818. var tgtMax:int = ((("tgtMax" in actionObj)) ? actionObj.tgtMax : 1);
  3819. var targets:Array = [];
  3820. var scan:Array = this.getAllAvatarsInCell();
  3821. a = 0;
  3822. while (a < scan.length) {
  3823. tAvt = scan[a];
  3824. if ((((((tAvt.dataLeaf == null)) || ((tAvt.dataLeaf.intState == 0)))) || ((((tAvt.pMC == null)) || ((tAvt.pMC.x == null)))))){
  3825. scan.splice(a, 1);
  3826. a = (a - 1);
  3827. if (tAvt == this.myAvatar.target){
  3828. this.setTarget(null);
  3829. };
  3830. };
  3831. a = (a + 1);
  3832. };
  3833. a = 0;
  3834. tAvt = null;
  3835. if (((!((this.myAvatar.target == null))) && ((scan.indexOf(this.myAvatar.target) > -1)))){
  3836. scan.unshift(scan.splice(scan.indexOf(this.myAvatar.target), 1)[0]);
  3837. };
  3838. this.afkPostpone();
  3839. var errMsg:String = "none";
  3840. var forceAAloop:Boolean;
  3841. if (!this.actionTimeCheck(actionObj)){
  3842. errMsg = (("Ability '" + actionObj.nam) + "' is not ready yet.");
  3843. };
  3844. if ((((((errMsg == "none")) && (!((actionObj.mp == null))))) && ((Math.round((actionObj.mp * cLeaf.sta["$cmc"])) > cLeaf.intMP)))){
  3845. errMsg = "Not enough mana!";
  3846. };
  3847. if ((((errMsg == "none")) && (!((actionObj.sp == null))))){
  3848. if (!this.checkSP(actionObj.sp, cLeaf)){
  3849. errMsg = "Not Enough Spirit Power!";
  3850. };
  3851. };
  3852. if ((((((errMsg == "none")) && ((actionObj.ref == "i1")))) && ((actionObj.sArg1 == "")))){
  3853. errMsg = "No item assigned to that slot!";
  3854. };
  3855. if ((((((((((errMsg == "none")) && (!((this.myAvatar.target == null))))) && (("filter" in actionObj)))) && (("sRace" in this.myAvatar.target.objData)))) && (!((this.myAvatar.target.objData.sRace.toLowerCase() == actionObj.filter.toLowerCase()))))){
  3856. errMsg = (("Target is not a " + actionObj.filter) + "!");
  3857. };
  3858. if (errMsg == "none"){
  3859. for each (aura in cLeaf.auras) {
  3860. try {
  3861. if (aura.cat != null){
  3862. if (aura.cat == "stun"){
  3863. errMsg = "Cannot act while stunned!";
  3864. };
  3865. /* Addon Aura Errors */
  3866. if (aura.cat == "hex"){
  3867. errMsg = "Cannot act while in hex!";
  3868. };
  3869. if (aura.cat == "freeze"){
  3870. errMsg = "Cannot act while frozen!";
  3871. };
  3872. /* End */
  3873. if (aura.cat == "stone"){
  3874. errMsg = "Cannot act while petrified!";
  3875. };
  3876. if (aura.cat == "disabled"){
  3877. errMsg = "Cannot act while disabled!";
  3878. };
  3879. if (aura.cat == "silenced"){
  3880. errMsg = "Cannot act while silenced!";
  3881. };
  3882. if (errMsg != "none"){
  3883. forceAAloop = true;
  3884. };
  3885. };
  3886. }
  3887. catch(e:Error) {
  3888. trace(("combat.auraPreFlight > " + e));
  3889. };
  3890. };
  3891. };
  3892. if (errMsg == "none"){
  3893. if (actionObj.pet != null){
  3894. pet = cAvt.getItemByEquipSlot("pe");
  3895. if (cAvt.getItemByEquipSlot("pe") == null){
  3896. if (cAvt.checkTempItem(actionObj.pet, 1)){
  3897. this.summonPet(actionObj.pet, true);
  3898. }
  3899. else {
  3900. this.summonPet(actionObj.pet, false);
  3901. };
  3902. };
  3903. }
  3904. else {
  3905. if (actionObj.checkPet != null){
  3906. if (cAvt.getItemByEquipSlot("pe").sMeta.indexOf(actionObj.checkPet) == -1){
  3907. errMsg = "No battle pet equipped.";
  3908. };
  3909. };
  3910. };
  3911. };
  3912. if ((((errMsg == "none")) || (forceAAloop))){
  3913. if (this.myAvatar.target != null){
  3914. tAvt = this.myAvatar.target;
  3915. if (this.myAvatar.target.npcType == "monster"){
  3916. tLeaf = this.monTree[tAvt.objData.MonMapID];
  3917. }
  3918. else {
  3919. if (tAvt.npcType == "player"){
  3920. tLeaf = tAvt.dataLeaf;
  3921. };
  3922. };
  3923. };
  3924. switch (actionObj.tgt){
  3925. case "h":
  3926. if (tAvt == null){
  3927. if (tgtMin > 0){
  3928. for each (tAvt in scan) {
  3929. tLeaf = tAvt.dataLeaf;
  3930. if (((((!((tLeaf == null))) && (((((((!(this.bPvP)) && ((tAvt.npcType == "monster")))) || (((((this.bPvP) && ((tAvt.npcType == "player")))) && (!((cLeaf.pvpTeam == tLeaf.pvpTeam))))))) || (((((((this.bPvP) && ((tAvt.npcType == "monster")))) && (!((tLeaf.react == null))))) && ((tLeaf.react[cLeaf.pvpTeam] == 0)))))))) && (this.actionRangeCheck(actionObj, tAvt)))){
  3931. this.setTarget(tAvt);
  3932. this.testAction(actionObj);
  3933. return;
  3934. };
  3935. };
  3936. errMsg = "No target selected!";
  3937. if (actionObj.typ == "aa"){
  3938. this.cancelAutoAttack();
  3939. };
  3940. };
  3941. }
  3942. else {
  3943. if (((((((!(this.bPvP)) && ((tAvt.npcType == "player")))) || (((((this.bPvP) && ((tAvt.npcType == "player")))) && ((cLeaf.pvpTeam == tLeaf.pvpTeam)))))) || (((((((this.bPvP) && ((tAvt.npcType == "monster")))) && (!((tLeaf.react == null))))) && ((tLeaf.react[cLeaf.pvpTeam] == 1)))))){
  3944. errMsg = "Can't attack that target!";
  3945. if (actionObj.typ == "aa"){
  3946. this.cancelAutoAttack();
  3947. };
  3948. };
  3949. if ((((tgtMin > 0)) && ((tAvt.dataLeaf.intState == 0)))){
  3950. errMsg = "Your target is dead!";
  3951. };
  3952. };
  3953. break;
  3954. case "f":
  3955. if (tAvt == null){
  3956. this.setTarget(this.myAvatar);
  3957. tAvt = this.myAvatar;
  3958. tLeaf = tAvt.dataLeaf;
  3959. };
  3960. if (((((((!(this.bPvP)) && ((tAvt.npcType == "monster")))) || (((this.bPvP) && (!((cLeaf.pvpTeam == tLeaf.pvpTeam))))))) || (((((((this.bPvP) && ((tAvt.npcType == "monster")))) && (!((tLeaf.react == null))))) && ((tLeaf.react[cLeaf.pvpTeam] == 1)))))){
  3961. tAvt = this.myAvatar;
  3962. };
  3963. tLeaf = tAvt.dataLeaf;
  3964. break;
  3965. case "s":
  3966. if (tAvt == null){
  3967. this.setTarget(this.myAvatar);
  3968. tAvt = this.myAvatar;
  3969. };
  3970. if (((!((tAvt == null))) && (!((tAvt == this.myAvatar))))){
  3971. tAvt = this.myAvatar;
  3972. };
  3973. tLeaf = tAvt.dataLeaf;
  3974. break;
  3975. };
  3976. pAvt = tAvt;
  3977. if ((((((errMsg == "none")) && (!(this.actionRangeCheck(actionObj, pAvt))))) || (forceAAloop))){
  3978. if (!forceAAloop){
  3979. errMsg = "You are out of range! Move closer to your target!";
  3980. };
  3981. if (actionObj.typ == "aa"){
  3982. this.autoActionTimer.delay = 500;
  3983. this.autoActionTimer.reset();
  3984. this.autoActionTimer.start();
  3985. };
  3986. };
  3987. tgtOK = true;
  3988. if (errMsg == "none"){
  3989. while (scan.length > 0) {
  3990. tAvt = scan[0];
  3991. tLeaf = tAvt.dataLeaf;
  3992. tgtOK = true;
  3993. if (tLeaf.intState == 0){
  3994. tgtOK = false;
  3995. };
  3996. if (((((!((tAvt == null))) && (("filter" in actionObj)))) && (("sRace" in tAvt.objData)))){
  3997. if (tAvt.objData.sRace.toLowerCase() != actionObj.filter.toLowerCase()){
  3998. tgtOK = false;
  3999. };
  4000. };
  4001. switch (actionObj.tgt){
  4002. case "h":
  4003. if (((((((!(this.bPvP)) && ((tAvt.npcType == "player")))) || (((((this.bPvP) && ((tAvt.npcType == "player")))) && ((cLeaf.pvpTeam == tLeaf.pvpTeam)))))) || (((((((this.bPvP) && ((tAvt.npcType == "monster")))) && (!((tLeaf.react == null))))) && ((tLeaf.react[cLeaf.pvpTeam] == 1)))))){
  4004. tgtOK = false;
  4005. };
  4006. break;
  4007. case "f":
  4008. if (((((((!(this.bPvP)) && ((tAvt.npcType == "monster")))) || (((this.bPvP) && (!((cLeaf.pvpTeam == tLeaf.pvpTeam))))))) || (((((((this.bPvP) && ((tAvt.npcType == "monster")))) && (!((tLeaf.react == null))))) && ((tLeaf.react[cLeaf.pvpTeam] == 1)))))){
  4009. tgtOK = false;
  4010. };
  4011. break;
  4012. case "s":
  4013. if (((!((tAvt == null))) && (!((tAvt == this.myAvatar))))){
  4014. tgtOK = false;
  4015. };
  4016. break;
  4017. };
  4018. if (tgtOK){
  4019. sAvt = this.myAvatar;
  4020. if ((((actionObj.fx == "c")) && ((targets.length > 0)))){
  4021. sAvt = targets[(targets.length - 1)].avt;
  4022. };
  4023. a = Math.abs((tAvt.pMC.x - sAvt.pMC.x));
  4024. b = Math.abs((tAvt.pMC.y - sAvt.pMC.y));
  4025. c = Math.pow(((a * a) + (b * b)), 0.5);
  4026. if (this.actionRangeCheck(actionObj, tAvt)){
  4027. targets.push({
  4028. avt:tAvt,
  4029. d:c,
  4030. hp:tLeaf.intHP
  4031. });
  4032. };
  4033. };
  4034. scan.shift();
  4035. };
  4036. };
  4037. targets.sortOn("hp", Array.NUMERIC);
  4038. if (pAvt != null){
  4039. a = 0;
  4040. while (a < targets.length) {
  4041. to = targets[a];
  4042. if (to.avt == pAvt){
  4043. targets.unshift(targets.splice(a, 1)[0]);
  4044. };
  4045. a = (a + 1);
  4046. };
  4047. };
  4048. if (targets.length > tgtMax){
  4049. targets = targets.splice(0, tgtMax);
  4050. };
  4051. if (targets.length > 0){
  4052. if (pAvt != null){
  4053. if (((!((targets[0].avt == null))) && (!((targets[0].avt.dataLeaf == null))))){
  4054. tAvt = targets[0].avt;
  4055. tLeaf = tAvt.dataLeaf;
  4056. }
  4057. else {
  4058. tAvt = null;
  4059. tLeaf = null;
  4060. };
  4061. }
  4062. else {
  4063. tAvt = null;
  4064. tLeaf = null;
  4065. };
  4066. };
  4067. };
  4068. if (errMsg == "none"){
  4069. if (cLeaf.intState != 0){
  4070. if (((((!(actionObj.lock)) && ((((tLeaf == null)) || (!((tLeaf.intState == 0))))))) && ((targets.length >= tgtMin)))){
  4071. this.doAction(actionObj, targets);
  4072. };
  4073. if ((((this.myAvatar.target == null)) || ((((tLeaf == null)) || ((tLeaf.intState == 0)))))){
  4074. this.exitCombat();
  4075. };
  4076. };
  4077. }
  4078. else {
  4079. now = new Date().getTime();
  4080. if ((((errMsg == "You are out of range! Move closer to your target!")) && (((!((actionObj.typ == "aa"))) || (forceAARangeError))))){
  4081. if ((now - this.actionRangeSpamTS) > 3000){
  4082. this.actionRangeSpamTS = now;
  4083. this.rootClass.chatF.pushMsg("warning", errMsg, "SERVER", "", 0);
  4084. };
  4085. }
  4086. else {
  4087. if (actionObj.typ != "aa"){
  4088. this.rootClass.chatF.pushMsg("warning", errMsg, "SERVER", "", 0);
  4089. };
  4090. };
  4091. };
  4092. }
  4093.  
  4094. public function summonPet(_arg1:int, _arg2:Boolean){
  4095. if (_arg2){
  4096. this.rootClass.sfc.sendXtMessage("zm", "equipItem", [_arg1], "str", this.curRoom);
  4097. }
  4098. else {
  4099. this.rootClass.sfc.sendXtMessage("zm", "summonPet", [_arg1], "str", this.curRoom);
  4100. };
  4101. }
  4102.  
  4103. public function autoActionHandler(_arg1:TimerEvent){
  4104. trace("* autoActionHandler >");
  4105. if (((((((((!((this.myAvatar.dataLeaf == null))) && (!((this.myAvatar.dataLeaf.intState == 0))))) && (!((this.myAvatar.target == null))))) && (!((this.myAvatar.target.dataLeaf == null))))) && (!((this.myAvatar.target.dataLeaf.intState == 0))))){
  4106. this.testAction(this.getAutoAttack(), true);
  4107. }
  4108. else {
  4109. this.exitCombat();
  4110. };
  4111. }
  4112.  
  4113. public function getAutoAttack():Object{
  4114. var _local1:* = 0;
  4115. while (_local1 < this.actions.active.length) {
  4116. if (((((!((this.actions.active[_local1] == null))) && (!((this.actions.active[_local1].auto == null))))) && ((this.actions.active[_local1].auto == true)))){
  4117. return (this.actions.active[_local1]);
  4118. };
  4119. _local1++;
  4120. };
  4121. return (null);
  4122. }
  4123.  
  4124. public function exitCombat(){
  4125. var _local1:int;
  4126. this.actionReady = false;
  4127. if (((!((this.actions == null))) && (!((this.actions.active == null))))){
  4128. _local1 = 0;
  4129. while (_local1 < this.actions.active.length) {
  4130. this.actions.active[_local1].lock = false;
  4131. _local1++;
  4132. };
  4133. };
  4134. if (this.myAvatar != null){
  4135. if (((((((!((this.myAvatar.pMC == null))) && (!((this.myAvatar.pMC.mcChar == null))))) && (!(this.myAvatar.pMC.mcChar.onMove)))) && (!((this.myAvatar.pMC.mcChar.currentLabel == "Rest"))))){
  4136. this.myAvatar.pMC.mcChar.gotoAndStop("Idle");
  4137. };
  4138. if (this.myAvatar.dataLeaf != null){
  4139. this.myAvatar.dataLeaf.targets = {};
  4140. };
  4141. this.cancelAutoAttack();
  4142. };
  4143. }
  4144.  
  4145. public function cancelAutoAttack(){
  4146. var icon:MovieClip;
  4147. if (this.autoActionTimer != null){
  4148. this.autoActionTimer.reset();
  4149. };
  4150. if (this.AATestTimer != null){
  4151. this.AATestTimer.reset();
  4152. };
  4153. var i:* = 0;
  4154. while (i < this.actionMap.length) {
  4155. try {
  4156. if (this.actionMap[i] == "aa"){
  4157. icon = MovieClip(this.rootClass.ui.mcInterface.actBar.getChildByName(("i" + (i + 1))));
  4158. icon.bg.gotoAndStop(1);
  4159. };
  4160. }
  4161. catch(e:Error) {
  4162. trace(e);
  4163. };
  4164. i = (i + 1);
  4165. };
  4166. }
  4167.  
  4168. public function doAction(_arg1, _arg2){
  4169. var _local3:Avatar;
  4170. trace(("doAction > " + _arg1.nam));
  4171. this.afkPostpone();
  4172. if (_arg2.length > 0){
  4173. _local3 = _arg2[0].avt;
  4174. if (_local3 != this.myAvatar){
  4175. if ((_local3.pMC.x - this.myAvatar.pMC.x) >= 0){
  4176. this.myAvatar.pMC.turn("right");
  4177. }
  4178. else {
  4179. this.myAvatar.pMC.turn("left");
  4180. };
  4181. };
  4182. };
  4183. var _local4:int;
  4184. while (_local4 < _arg2.length) {
  4185. _local3 = _arg2[_local4].avt;
  4186. switch (_local3.npcType){
  4187. case "monster":
  4188. if (this.myAvatar.dataLeaf.targets[_local3.objData.MonMapID] == null){
  4189. this.myAvatar.dataLeaf.targets[_local3.objData.MonMapID] = "m";
  4190. };
  4191. break;
  4192. case "player":
  4193. if (this.myAvatar.dataLeaf.targets[_local3.objData.uid] == null){
  4194. this.myAvatar.dataLeaf.targets[_local3.objData.uid] = "p";
  4195. };
  4196. break;
  4197. };
  4198. _local4++;
  4199. };
  4200. this.getActionResult(_arg1, _arg2);
  4201. }
  4202.  
  4203. public function aggroMap(_arg1:String, _arg2:String, _arg3):void{
  4204. var _local12:*;
  4205. var _local13:*;
  4206. var _local4:String = _arg1.split(":")[0];
  4207. var _local5:String = _arg1.split(":")[1];
  4208. var _local6:String = _arg2.split(":")[0];
  4209. var _local7:String = _arg2.split(":")[1];
  4210. var _local8 = "";
  4211. var _local9 = "";
  4212. var _local10:Object = {};
  4213. var _local11:Object = {};
  4214. if (_local4 == "p"){
  4215. _local10 = this.getUoLeafById(_local5);
  4216. }
  4217. else {
  4218. _local10 = this.monTree[_local5];
  4219. };
  4220. if (_local6 == "p"){
  4221. _local11 = this.getUoLeafById(_local7);
  4222. }
  4223. else {
  4224. _local11 = this.monTree[_local7];
  4225. };
  4226. if (!("targets" in _local10)){
  4227. _local10.targets = {};
  4228. };
  4229. if (!("targets" in _local11)){
  4230. _local11.targets = {};
  4231. };
  4232. if (_local6 == "m"){
  4233. if (!(_local7 in _local10.targets)){
  4234. _local10.targets[_local7] = _local6;
  4235. };
  4236. if (!(_local5 in _local11.targets)){
  4237. _local11.targets[_local5] = _local4;
  4238. };
  4239. };
  4240. if ((((((_local4 == "p")) && ((_local6 == "p")))) && (_arg3))){
  4241. for (_local12 in this.monTree) {
  4242. _local13 = this.monTree[_local12];
  4243. if (((!((_local13.targets[_local7] == null))) && (!((_local5 in _local13.targets))))){
  4244. _local13.targets[_local5] = _local4;
  4245. };
  4246. };
  4247. };
  4248. }
  4249.  
  4250. private function actionTimeCheck(_arg1):Boolean{
  4251. var _local4:int;
  4252. trace("actionTimeCheck >");
  4253. var _local2:Number = new Date().getTime();
  4254. var _local3:Number = (1 - Math.min(Math.max(this.myAvatar.dataLeaf.sta.$tha, -1), 0.5));
  4255. if (_arg1.auto){
  4256. if (this.autoActionTimer.running){
  4257. trace("AA TIMER SELF-CLIPPING");
  4258. return (false);
  4259. };
  4260. return (true);
  4261. };
  4262. if ((_local2 - this.GCDTS) < this.GCD){
  4263. return (false);
  4264. };
  4265. if (_arg1.OldCD != null){
  4266. _local4 = Math.round((_arg1.OldCD * _local3));
  4267. }
  4268. else {
  4269. _local4 = Math.round((_arg1.cd * _local3));
  4270. };
  4271. trace(((("ActionObj: " + _arg1.nam) + " cooldown: ") + _arg1.cd));
  4272. if ((_local2 - _arg1.ts) >= _local4){
  4273. delete _arg1.OldCD;
  4274. return (true);
  4275. };
  4276. return (false);
  4277. }
  4278.  
  4279. private function actionRangeCheck(_arg1, _arg2:Avatar=null):Boolean{
  4280. var _local3:Point;
  4281. var _local4:Point;
  4282. var _local5:*;
  4283. var _local6:*;
  4284. var _local7:*;
  4285. var _local8:*;
  4286. trace("actionRangeCheck >");
  4287. if ((((_arg2 == null)) && (!((this.myAvatar.target == null))))){
  4288. _arg2 = this.myAvatar.target;
  4289. };
  4290. if (_arg2 == this.myAvatar){
  4291. return (true);
  4292. };
  4293. if (((("tgtMin" in _arg1)) && ((_arg1.tgtMin == 0)))){
  4294. return (true);
  4295. };
  4296. if (_arg2 == null){
  4297. return (false);
  4298. };
  4299. _local3 = this.myAvatar.pMC.mcChar.localToGlobal(new Point(0, 0));
  4300. _local4 = _arg2.pMC.mcChar.localToGlobal(new Point(0, 0));
  4301. _local5 = Math.abs((_local4.x - _local3.x));
  4302. _local6 = Math.abs((_local4.y - _local3.y));
  4303. _local7 = Math.pow(((_local5 * _local5) + (_local6 * _local6)), 0.5);
  4304. _local8 = (_arg1.range * this.SCALE);
  4305. if (_arg1.range <= 301){
  4306. if ((((_local5 <= _local8)) && ((_local6 <= (30 * this.SCALE))))){
  4307. return (true);
  4308. };
  4309. return (false);
  4310. };
  4311. if (_local7 <= _local8){
  4312. return (true);
  4313. };
  4314. return (false);
  4315. }
  4316.  
  4317. public function aggroAllMon(){
  4318. var _local2:*;
  4319. var _local1:* = [];
  4320. for (_local2 in this.monTree) {
  4321. if (this.monTree[_local2].strFrame == this.strFrame){
  4322. _local1.push(_local2);
  4323. };
  4324. };
  4325. this.aggroMons(_local1);
  4326. }
  4327.  
  4328. public function aggroMon(_arg1){
  4329. var _local2:* = [];
  4330. _local2.push(_arg1);
  4331. this.aggroMons(_local2);
  4332. }
  4333.  
  4334. public function aggroMons(_arg1){
  4335. if (_arg1.length){
  4336. this.rootClass.sfc.sendXtMessage("zm", "aggroMon", _arg1, "str", this.curRoom);
  4337. };
  4338. }
  4339.  
  4340. public function castSpellFX(_arg1, _arg2, _arg3, _arg4:int=0){
  4341. var _local5:Avatar;
  4342. var _local6:Class;
  4343. var _local7:*;
  4344. var _local8:Array;
  4345. var _local9:int;
  4346. if (((((!((_arg2.strl == null))) && (!((_arg2.strl == ""))))) && (!((_arg2.avts == null))))){
  4347. _local8 = [];
  4348. _local9 = 0;
  4349. if (_arg2.fx == "c"){
  4350. if (_arg2.strl == "lit1"){
  4351. _local8.push(_arg1.pMC.mcChar);
  4352. _local9 = 0;
  4353. while (_local9 < _arg2.avts.length) {
  4354. _local5 = _arg2.avts[_local9];
  4355. if (((((!((_local5 == null))) && (!((_local5.pMC == null))))) && (!((_local5.pMC.mcChar == null))))){
  4356. _local8.push(_local5.pMC.mcChar);
  4357. };
  4358. _local9++;
  4359. };
  4360. if (_local8.length > 1){
  4361. _local6 = (this.getClass("sp_C1") as Class);
  4362. if (_local6 != null){
  4363. _local7 = new (_local6)();
  4364. _local7.mouseEnabled = false;
  4365. _local7.mouseChildren = false;
  4366. _local7.visible = true;
  4367. _local7.world = this.rootClass.world;
  4368. _local7.strl = _arg2.strl;
  4369. this.rootClass.drawChainsLinear(_local8, 33, MovieClip(this.CHARS.addChild(_local7)));
  4370. };
  4371. };
  4372. };
  4373. }
  4374. else {
  4375. if (_arg2.fx == "f"){
  4376. _local8.push(_arg1.pMC.mcChar);
  4377. _local5 = _arg2.avts[0];
  4378. if (((((!((_local5 == null))) && (!((_local5.pMC == null))))) && (!((_local5.pMC.mcChar == null))))){
  4379. _local8.push(_local5.pMC.mcChar);
  4380. };
  4381. if (_local8.length > 1){
  4382. _local7 = new MovieClip();
  4383. _local7.mouseEnabled = false;
  4384. _local7.mouseChildren = false;
  4385. _local7.visible = true;
  4386. _local7.world = this.rootClass.world;
  4387. _local7.strl = _arg2.strl;
  4388. this.rootClass.drawFunnel(_local8, MovieClip(this.CHARS.addChild(_local7)));
  4389. };
  4390. }
  4391. else {
  4392. _local9 = 0;
  4393. while (_local9 < _arg2.avts.length) {
  4394. _local5 = _arg2.avts[_local9];
  4395. _local6 = (this.getClass(_arg2.strl) as Class);
  4396. if (_local6 != null){
  4397. _local7 = new (_local6)();
  4398. _local7.spellDur = _arg4;
  4399. if (_arg3 != null){
  4400. _local7.transform = _arg3.transform;
  4401. };
  4402. this.CHARS.addChild(_local7);
  4403. _local7.mouseEnabled = false;
  4404. _local7.mouseChildren = false;
  4405. _local7.visible = true;
  4406. _local7.world = this.rootClass.world;
  4407. _local7.strl = _arg2.strl;
  4408. _local7.tMC = _local5.pMC;
  4409. switch (_arg2.fx){
  4410. case "p":
  4411. _local7.x = _arg1.pMC.x;
  4412. _local7.y = (_arg1.pMC.y - (_arg1.pMC.mcChar.height * 0.5));
  4413. _local7.dir = ((((_local5.pMC.x - _arg1.pMC.x))>=0) ? 1 : -1);
  4414. break;
  4415. case "w":
  4416. _local7.x = _local7.tMC.x;
  4417. _local7.y = (_local7.tMC.y + 3);
  4418. if (_arg1 != null){
  4419. if (_local7.tMC.x < _arg1.pMC.x){
  4420. _local7.scaleX = (_local7.scaleX * -1);
  4421. };
  4422. };
  4423. break;
  4424. };
  4425. }
  4426. else {
  4427. trace();
  4428. trace(("*>*>*> Could not load class " + _arg2.strl));
  4429. trace();
  4430. };
  4431. _local9++;
  4432. };
  4433. };
  4434. };
  4435. };
  4436. }
  4437.  
  4438. public function showSpellFXHit(_arg1){
  4439. var _local2:* = {};
  4440. switch (_arg1.strl){
  4441. case "sp_ice1":
  4442. _local2.strl = "sp_ice2";
  4443. break;
  4444. case "sp_el3":
  4445. _local2.strl = "sp_el2";
  4446. break;
  4447. case "sp_ed3":
  4448. _local2.strl = "sp_ed1";
  4449. break;
  4450. case "sp_ef1":
  4451. case "sp_ef6":
  4452. _local2.strl = "sp_ef2";
  4453. break;
  4454. };
  4455. _local2.fx = "w";
  4456. _local2.avts = [_arg1.tMC.pAV];
  4457. this.castSpellFX(null, _local2, null);
  4458. }
  4459.  
  4460. public function doCastIA(_arg1:Object):void{
  4461. }
  4462.  
  4463. public function getActionByActID(_arg1:int):Object{
  4464. var _local2:Object;
  4465. var _local3:int;
  4466. while (_local3 < this.actions.active.length) {
  4467. if (this.actions.active[_local3].actID == _arg1){
  4468. _local2 = this.actions.active[_local3];
  4469. };
  4470. _local3++;
  4471. };
  4472. return (_local2);
  4473. }
  4474.  
  4475. public function getActionByRef(_arg1:String):Object{
  4476. var _local2:*;
  4477. for each (_local2 in this.actions.active) {
  4478. if (_local2.ref == _arg1){
  4479. return (_local2);
  4480. };
  4481. };
  4482. for each (_local2 in this.actions.passive) {
  4483. if (_local2.ref == _arg1){
  4484. return (_local2);
  4485. };
  4486. };
  4487. return (null);
  4488. }
  4489.  
  4490. public function handleSAR(_arg1:Object):void{
  4491. var _local2:Object = {};
  4492. var _local3 = "";
  4493. var _local4:int = -1;
  4494. var _local5 = "";
  4495. var _local6:int = -1;
  4496. if (_arg1.iRes == 1){
  4497. if (_arg1.actionResult.typ == "d"){
  4498. this.showAuraImpact(_arg1.actionResult);
  4499. _local2 = this.rootClass.copyObj(_arg1.actionResult);
  4500. _local2.a = [this.rootClass.copyObj(_arg1.actionResult)];
  4501. }
  4502. else {
  4503. this.aggroMap(_arg1.actionResult.cInf, _arg1.actionResult.tInf, (_arg1.actionResult.hp >= 0));
  4504. _local3 = _arg1.actionResult.cInf.split(":")[0];
  4505. _local4 = int(_arg1.actionResult.cInf.split(":")[1]);
  4506. _local5 = _arg1.actionResult.tInf.split(":")[0];
  4507. _local6 = int(_arg1.actionResult.tInf.split(":")[1]);
  4508. _local2 = this.rootClass.copyObj(_arg1.actionResult);
  4509. _local2.a = [this.rootClass.copyObj(_arg1.actionResult)];
  4510. if ((((_local3 == "p")) && ((_local4 == this.rootClass.sfc.myUserId)))){
  4511. this.showActionResult(_local2, _local2.actID);
  4512. }
  4513. else {
  4514. this.showIncomingAttackResult(_local2);
  4515. };
  4516. };
  4517. };
  4518. if (_arg1.iRes == 0){
  4519. switch (_arg1.actionResult.cInf.split(":")[0]){
  4520. case "p":
  4521. this.showActionResult(null, _arg1.actID);
  4522. return;
  4523. };
  4524. };
  4525. }
  4526.  
  4527. public function handleSARS(_arg1:Object):void{
  4528. var _local9:Array;
  4529. var _local10:int;
  4530. var _local2:Object = {};
  4531. var _local3 = "";
  4532. var _local4:int = -1;
  4533. var _local5 = "";
  4534. var _local6:int = -1;
  4535. var _local7:String = _arg1.cInf;
  4536. _local7 = _arg1.cInf;
  4537. _local3 = _local7.split(":")[0];
  4538. _local4 = int(_local7.split(":")[1]);
  4539. var _local8:Object = {};
  4540. if (_arg1.iRes == 1){
  4541. _local9 = [];
  4542. _local10 = 0;
  4543. while (_local10 < _arg1.a.length) {
  4544. _local8 = _arg1.a[_local10];
  4545. this.aggroMap(_local7, _local8.tInf, (_local8.hp >= 0));
  4546. _local10++;
  4547. };
  4548. if ((((_local3 == "p")) && ((_local4 == this.rootClass.sfc.myUserId)))){
  4549. this.showActionResult(this.rootClass.copyObj(_arg1), _arg1.actID);
  4550. }
  4551. else {
  4552. this.showIncomingAttackResult(this.rootClass.copyObj(_arg1));
  4553. };
  4554. };
  4555. if (_arg1.iRes == 0){
  4556. switch (_local7.split(":")[0]){
  4557. case "p":
  4558. this.showActionResult(null, _arg1.actID);
  4559. return;
  4560. };
  4561. };
  4562. }
  4563.  
  4564. public function getActionResult(_arg1, _arg2){
  4565. var _local3:*;
  4566. var _local4:*;
  4567. var _local5:String;
  4568. var _local6:Avatar;
  4569. var _local7:int;
  4570. var _local8:Number;
  4571. var _local9:*;
  4572. trace(("GAR > " + _arg1.nam));
  4573. _local3 = [];
  4574. _local4 = "gar";
  4575. _local5 = "";
  4576. _local7 = 0;
  4577. _local3.push(this.actionID);
  4578. if (_arg2.length > 0){
  4579. _local7 = 0;
  4580. while (_local7 < _arg2.length) {
  4581. _local6 = _arg2[_local7].avt;
  4582. if (_local7 > 0){
  4583. _local5 = (_local5 + ",");
  4584. };
  4585. _local5 = (_local5 + (_arg1.ref + ">"));
  4586. if (_local6.npcType == "monster"){
  4587. _local5 = (_local5 + ("m:" + _local6.objData.MonMapID));
  4588. };
  4589. if (_local6.npcType == "player"){
  4590. _local5 = (_local5 + ("p:" + _local6.uid));
  4591. };
  4592. _local7++;
  4593. };
  4594. }
  4595. else {
  4596. _local5 = (_local5 + (_arg1.ref + ">"));
  4597. };
  4598. _local3.push(_local5);
  4599. if (_arg1.ref == "i1"){
  4600. _local3.push(_arg1.sArg1);
  4601. };
  4602. _local3.push("wvz");
  4603. this.rootClass.sfc.sendXtMessage("zm", _local4, _local3, "str", 1);
  4604. _local8 = new Date().getTime();
  4605. _arg1.lock = true;
  4606. _arg1.actID = this.actionID;
  4607. this.actionID++;
  4608. if (this.actionID > this.actionIDLimit){
  4609. this.actionID = 0;
  4610. };
  4611. _arg1.lastTS = _arg1.ts;
  4612. _arg1.ts = _local8;
  4613. if (_arg1.typ != "aa"){
  4614. this.coolDownAct(_arg1);
  4615. this.globalCoolDownExcept(_arg1);
  4616. if (((!(this.autoActionTimer.running)) && ((_arg1.tgt == "h")))){
  4617. this.testAction(this.getAutoAttack());
  4618. };
  4619. }
  4620. else {
  4621. _local7 = 0;
  4622. while (_local7 < this.actionMap.length) {
  4623. if (this.actionMap[_local7] == _arg1.ref){
  4624. _local9 = MovieClip(this.rootClass.ui.mcInterface.actBar.getChildByName(("i" + (_local7 + 1))));
  4625. if (_local9.bg.currentLabel != "pulse"){
  4626. _local9.bg.gotoAndPlay("pulse");
  4627. };
  4628. };
  4629. _local7++;
  4630. };
  4631. this.actionReady = false;
  4632. };
  4633. this.actionResults[this.actionResultID] = {};
  4634. }
  4635.  
  4636. public function showActionResult(_arg1, _arg2){
  4637. var _local3:*;
  4638. var _local4:*;
  4639. var _local5:*;
  4640. var _local6:*;
  4641. var _local7:*;
  4642. var _local8:*;
  4643. var _local9:*;
  4644. _local3 = new Date();
  4645. _local4 = this.getActionByActID(_arg2);
  4646. if (_local4 != null){
  4647. _local4.lock = false;
  4648. _local4.actID = -1;
  4649. _local5 = _local4.ts;
  4650. _local6 = _local3.getTime();
  4651. _local7 = int(((_local6 - _local5) / 2));
  4652. if (_local4.typ == "aa"){
  4653. _local8 = Math.round((_local4.cd * (1 - Math.min(Math.max(this.myAvatar.dataLeaf.sta.$tha, -1), 0.5))));
  4654. _local9 = (_local8 - int((_local6 - _local5)));
  4655. if (_local9 > _local8){
  4656. _local9 = _local8;
  4657. };
  4658. if (_local9 < (_local8 - 100)){
  4659. _local9 = (_local8 - 100);
  4660. };
  4661. this.autoActionTimer.delay = _local9;
  4662. this.autoActionTimer.reset();
  4663. this.autoActionTimer.start();
  4664. };
  4665. if (_arg1 == null){
  4666. _local4.ts = _local4.lastTS;
  4667. }
  4668. else {
  4669. _local4.ts = Math.max(int((_local6 - _local7)), (_local5 + this.minLatencyOneWay));
  4670. this.unlockActionsExcept(_local4);
  4671. this.rootClass.updateActionObjIcon(_local4);
  4672. };
  4673. };
  4674. if (_arg1 != null){
  4675. this.playActionSound(_arg1);
  4676. if (_arg1.type != "none"){
  4677. this.actionResults[this.actionResultID] = new ActionImpactTimer();
  4678. this.actionResults[this.actionResultID].world = MovieClip(this);
  4679. this.actionResults[this.actionResultID].actionResult = _arg1;
  4680. this.actionResults[this.actionResultID].showImpact(250);
  4681. if (++this.actionResultID > this.actionResultIDLimit){
  4682. this.actionResultID = 0;
  4683. };
  4684. };
  4685. };
  4686. }
  4687.  
  4688. public function showIncomingAttackResult(_arg1:Object):void{
  4689. this.playActionSound(_arg1);
  4690. this.actionResultsMon[this.actionIDMon] = new ActionImpactTimer();
  4691. this.actionResultsMon[this.actionIDMon].world = MovieClip(this);
  4692. this.actionResultsMon[this.actionIDMon].actionResult = _arg1;
  4693. this.actionResultsMon[this.actionIDMon].showImpact(350);
  4694. this.actionIDMon++;
  4695. if (this.actionIDMon > this.actionIDLimitMon){
  4696. this.actionIDMon = 0;
  4697. };
  4698. }
  4699.  
  4700. public function playActionSound(_arg1:Object):void{
  4701. var _local2:Object;
  4702. if ((((_arg1.a.length > 0)) && (!((_arg1.a[0].type == null))))){
  4703. _local2 = _arg1.a[0];
  4704. switch (_local2.type){
  4705. case "hit":
  4706. if (_local2.hp >= 0){
  4707. if (Math.random() < 0.5){
  4708. this.rootClass.mixer.playSound("Hit1");
  4709. }
  4710. else {
  4711. this.rootClass.mixer.playSound("Hit2");
  4712. };
  4713. }
  4714. else {
  4715. this.rootClass.mixer.playSound("Heal");
  4716. };
  4717. return;
  4718. case "crit":
  4719. if (_local2.hp >= 0){
  4720. this.rootClass.mixer.playSound("Hit3");
  4721. }
  4722. else {
  4723. this.rootClass.mixer.playSound("Heal");
  4724. };
  4725. return;
  4726. case "miss":
  4727. this.rootClass.mixer.playSound("Miss");
  4728. return;
  4729. case "none":
  4730. this.rootClass.mixer.playSound("Good");
  4731. return;
  4732. };
  4733. };
  4734. }
  4735.  
  4736. public function showActionImpact(_arg1){
  4737. var _local2:MovieClip;
  4738. var _local3:*;
  4739. var _local4:*;
  4740. var _local5:String;
  4741. var _local6:int;
  4742. var _local8:Array;
  4743. var _local10:int;
  4744. var _local11:TextFormat;
  4745. var _local12:int;
  4746. var _local13:Array;
  4747. var _local14:Object;
  4748. _local3 = null;
  4749. _local4 = null;
  4750. _local5 = "";
  4751. _local6 = 0;
  4752. var _local7:Array = ["GOOD", "GREAT!", "MASSIVE!!"];
  4753. _local8 = [0xFFFFFF, 0xFFFFFF, 0xFFFFFF];
  4754. var _local9:Array = [2381688, 0, 0];
  4755. _local10 = 0;
  4756. _local11 = new TextFormat();
  4757. _local12 = 0;
  4758. _local13 = _arg1.a;
  4759. _local14 = {};
  4760. _local12 = 0;
  4761. while (_local12 < _local13.length) {
  4762. _local14 = _local13[_local12];
  4763. _local5 = _local14.tInf.split(":")[0];
  4764. _local6 = int(_local14.tInf.split(":")[1]);
  4765. switch (_local5){
  4766. case "p":
  4767. _local2 = this.avatars[_local6].pMC;
  4768. break;
  4769. case "m":
  4770. _local2 = this.getMonster(_local6).pMC;
  4771. break;
  4772. };
  4773. if (((((!((_local2 == null))) && (!((_local2.pAV == null))))) && (!((_local2.pAV.dataLeaf == null))))){
  4774. switch (_local14.type){
  4775. case "hit":
  4776. _local4 = new hitDisplay();
  4777. _local4.t.ti.autoSize = "center";
  4778. if (_local14.hp >= 0){
  4779. _local10 = 0;
  4780. _local4.t.ti.text = _local14.hp;
  4781. _local4.t.ti.textColor = _local8[_local10];
  4782. _local4.t.ti.filters = [new GlowFilter(0, 1, 5, 5, 5, 1, false, false)];
  4783. _local4.t.ti.setTextFormat(_local11);
  4784. }
  4785. else {
  4786. _local4.t.ti.text = (("+" + -(_local14.hp)) + "+");
  4787. _local4.t.ti.textColor = 65450;
  4788. };
  4789. this.wound(_local2, "damage");
  4790. //Hit animation Addon
  4791. break;
  4792. case "crit":
  4793. _local4 = new critDisplay();
  4794. _local4.t.ti.autoSize = "center";
  4795. if (_local14.hp > 0){
  4796. _local4.t.ti.text = _local14.hp;
  4797. _local4.t.ti.textColor = 16750916;
  4798. _local4.t.ti.filters = [new GlowFilter(0x330000, 1, 5, 5, 5, 1, false, false)];
  4799. }
  4800. else {
  4801. _local4.t.ti.text = -(_local14.hp);
  4802. _local4.t.ti.textColor = 65450;
  4803. };
  4804. this.wound(_local2, "damage");
  4805. if (this.isMoveOK(_local2.pAV.dataLeaf)){
  4806. _local2.queueAnim("Hit");
  4807. };
  4808. break;
  4809. case "miss":
  4810. _local4 = new avoidDisplay();
  4811. _local4.t.ti.text = "Miss!";
  4812. if (this.isMoveOK(_local2.pAV.dataLeaf)){
  4813. _local2.queueAnim("Dodge");
  4814. };
  4815. break;
  4816. case "dodge":
  4817. _local4 = new avoidDisplay();
  4818. _local4.t.ti.text = "Dodge!";
  4819. if (this.isMoveOK(_local2.pAV.dataLeaf)){
  4820. _local2.queueAnim("Dodge");
  4821. };
  4822. break;
  4823. case "parry":
  4824. _local4 = new avoidDisplay();
  4825. _local4.t.ti.text = "Parry!";
  4826. if (this.isMoveOK(_local2.pAV.dataLeaf)){
  4827. _local2.queueAnim("Dodge");
  4828. };
  4829. break;
  4830. case "block":
  4831. _local4 = new avoidDisplay();
  4832. _local4.t.ti.text = "Block!";
  4833. if (this.isMoveOK(_local2.pAV.dataLeaf)){
  4834. _local2.queueAnim("Block");
  4835. };
  4836. break;
  4837. case "none":
  4838. };
  4839. if (_local4 != null){
  4840. _local2.addChild(_local4);
  4841. _local4.x = _local2.mcChar.x;
  4842. _local4.y = (_local2.pname.y + 10);
  4843. };
  4844. if (_local3 != null){
  4845. _local2.addChild(_local3);
  4846. _local3.x = _local2.mcChar.x;
  4847. _local3.y = (_local2.pname.y + (_local2.mcChar.height / 2));
  4848. };
  4849. };
  4850. _local12++;
  4851. };
  4852. }
  4853.  
  4854. public function showAuraImpact(_arg1){
  4855. var _local2:MovieClip;
  4856. var _local3:*;
  4857. var _local4:*;
  4858. var _local5:*;
  4859. _local3 = _arg1.tInf.split(":")[0];
  4860. _local4 = int(_arg1.tInf.split(":")[1]);
  4861. _local5 = null;
  4862. switch (_local3){
  4863. case "p":
  4864. if (((((!((this.avatars[_local4] == null))) && (("pMC" in this.avatars[_local4])))) && (!((this.avatars[_local4].pMC == null))))){
  4865. _local2 = this.avatars[_local4].pMC;
  4866. };
  4867. break;
  4868. case "m":
  4869. if (((((!((this.getMonster(_local4) == null))) && (("pMC" in this.getMonster(_local4))))) && (!((this.getMonster(_local4).pMC == null))))){
  4870. _local2 = this.getMonster(_local4).pMC;
  4871. };
  4872. break;
  4873. };
  4874. if (_local2 != null){
  4875. _local5 = new dotDisplay();
  4876. _local5.t.ti.text = Math.abs(_arg1.hp);
  4877. if (_arg1.hp > 0){
  4878. _local5.t.ti.textColor = 0xEE9900;
  4879. };
  4880. _local2.addChild(_local5);
  4881. _local5.x = _local2.mcChar.x;
  4882. _local5.y = (_local2.pname.y + 10);
  4883. };
  4884. }
  4885.  
  4886. public function showAuraChange(_arg1:Object, _arg2:Avatar, _arg3:Object){
  4887. var tMC:MovieClip;
  4888. var actionDamage:* = undefined;
  4889. var cLeaf:Object;
  4890. var i:int;
  4891. var nc:int;
  4892. var gap:int;
  4893. var child:DisplayObject;
  4894. var cTyp:String;
  4895. var cID:int;
  4896. var tTyp:String;
  4897. var tID:int;
  4898. var aura:Object;
  4899. var existingAura:Object;
  4900. var dateObj:Date;
  4901. var isOK:Boolean;
  4902. var tFilters:Array;
  4903. var tFilter:* = undefined;
  4904. var auras:* = undefined;
  4905. var ai:* = undefined;
  4906. var actObj:* = undefined;
  4907. var icon1:* = undefined;
  4908. var filterIndex:int;
  4909. var resObj:Object = _arg1;
  4910. var tAvt:Avatar = _arg2;
  4911. var tLeaf:Object = _arg3;
  4912. trace("showAuraChange > ");
  4913. tMC = tAvt.pMC;
  4914. actionDamage = null;
  4915. var cAvt:Avatar;
  4916. cLeaf = null;
  4917. if (tMC != null){
  4918. i = 0;
  4919. nc = tMC.numChildren;
  4920. gap = 1;
  4921. if (resObj.cInf != null){
  4922. cTyp = String(resObj.cInf.split(":")[0]);
  4923. cID = int(resObj.cInf.split(":")[1]);
  4924. switch (cTyp){
  4925. case "p":
  4926. cAvt = this.getAvatarByUserID(cID);
  4927. cLeaf = this.getUoLeafById(cID);
  4928. break;
  4929. case "m":
  4930. cAvt = this.getMonster(cID);
  4931. cLeaf = this.monTree[cID];
  4932. break;
  4933. };
  4934. };
  4935. if (resObj.auras != null){
  4936. gap = resObj.auras.length;
  4937. };
  4938. i = 0;
  4939. while (i < nc) {
  4940. child = tMC.getChildAt(i);
  4941. if (((((!((child == null))) && (!((child.toString() == null))))) && ((child.toString().indexOf("auraDisplay") > -1)))){
  4942. child.y = (child.y - (int((child.height + 3)) * gap));
  4943. };
  4944. i = (i + 1);
  4945. };
  4946. aura = {};
  4947. existingAura = {};
  4948. dateObj = new Date();
  4949. isOK = true;
  4950. if (tLeaf.auras == null){
  4951. tLeaf.auras = [];
  4952. };
  4953. if (tLeaf.passives == null){
  4954. tLeaf.passives = [];
  4955. };
  4956. switch (resObj.cmd){
  4957. case "aura+":
  4958. case "aura++":
  4959. case "aura+p":
  4960. i = 0;
  4961. while (i < resObj.auras.length) {
  4962. aura = resObj.auras[i];
  4963. aura.cLeaf = cLeaf;
  4964. if (resObj.cmd == "aura+p"){
  4965. aura.passive = true;
  4966. }
  4967. else {
  4968. aura.passive = false;
  4969. };
  4970. if (!aura.passive){
  4971. if (aura.t != null){
  4972. aura.ts = dateObj.getTime();
  4973. };
  4974. if ((((((((tAvt == this.myAvatar)) || ((tAvt == this.myAvatar.target)))) || (((!((tLeaf.targets == null))) && (!((tLeaf.targets[this.rootClass.sfc.myUserId] == null))))))) || ((resObj.cmd == "aura++")))){
  4975. actionDamage = new auraDisplay();
  4976. actionDamage.t.ti.text = (aura.nam + "!");
  4977. if (aura.nam == "Spirit Power"){
  4978. actionDamage.t.ti.text = ((aura.nam + " ") + aura.val);
  4979. };
  4980. trace(("potionType: " + aura.potionType));
  4981. if (aura.potionType != null){
  4982. if (aura.potionType.toLowerCase() == "tonic"){
  4983. tAvt.objData.Tonic = true;
  4984. };
  4985. if (aura.potionType.toLowerCase() == "elixir"){
  4986. tAvt.objData.Elixir = true;
  4987. };
  4988. };
  4989. if (aura.nam == "Skill Locked"){
  4990. ai = 0;
  4991. while (ai < this.actions.active.length) {
  4992. actObj = this.actions.active[ai];
  4993. if (actObj.nam == aura.val){
  4994. icon1 = this.rootClass.ui.mcInterface.actBar.getChildByName(("i" + (ai + 1)));
  4995. icon1.actObj.skillLock = true;
  4996. };
  4997. ai = (ai + 1);
  4998. };
  4999. };
  5000. tMC.addChild(actionDamage);
  5001. actionDamage.x = (((tMC.mcChar.scaleX)<0) ? 35 : (-(actionDamage.t.ti.textWidth) - 35));
  5002. actionDamage.y = ((tMC.pname.y + 25) + ((actionDamage.height + 3) * i));
  5003. if (aura.fx != null){
  5004. this.addAuraFX(tMC, aura.fx);
  5005. };
  5006. };
  5007. if (aura.s != null){
  5008. switch (aura.s){
  5009. case "s":
  5010. if (tMC.mcChar.currentLabel != "Fall"){
  5011. tMC.clearQueue();
  5012. tMC.mcChar.gotoAndPlay("Fall");
  5013. };
  5014. break;
  5015. };
  5016. };
  5017. if (aura.cat != null){
  5018. isOK = true;
  5019. for each (existingAura in tLeaf.auras) {
  5020. try {
  5021. if (((!((existingAura.cat == null))) && ((existingAura.cat == aura.cat)))){
  5022. isOK = false;
  5023. };
  5024. }
  5025. catch(e:Error) {
  5026. trace(("combat.applyAuras > " + e));
  5027. };
  5028. };
  5029. if (isOK){
  5030. switch (aura.cat){
  5031. /* HP's Aura Addon */
  5032. case "stun":
  5033. tMC.mcChar.gotoAndStop("Facepalm");
  5034. tMC.mcChar.vertigoMC.visible = true;
  5035. rootClass.ui.mcStatus.iconStun.visible = true;
  5036. break;
  5037. case "hex":
  5038. tMC.mcChar.gotoAndStop("Hex");
  5039. rootClass.ui.mcStatus.iconHex.visible = true;
  5040. break;
  5041. case "silenced":
  5042. tMC.mcChar.gotoAndPlay("Facepalm");
  5043. tMC.mcChar.silenceMC.visible = true;
  5044. rootClass.ui.mcStatus.iconSilenced.visible = true;
  5045. break;
  5046. case "freeze":
  5047. tMC.modulateColor(this.statusFreezeCT, "+");
  5048. tMC.mcChar.stop();
  5049. rootClass.ui.mcStatus.iconFreeze.visible = true;
  5050. break;
  5051. /* End */
  5052. case "invi":
  5053. tMC.mcChar.visible = false;
  5054. tMC.shadow.visible = false;
  5055. tMC.pname.visible = false;
  5056. tMC.hpBar.visible = false;
  5057. myAvatar.petMC.visible = false;
  5058. rootClass.ui.mcStatus.iconInvicible.visible = true;
  5059. break;
  5060. case "paralyze":
  5061. tMC.mcChar.stop();
  5062. rootClass.ui.mcStatus.iconParalyze.visible = true;
  5063. break;
  5064. case "stone":
  5065. tMC.modulateColor(this.statusStoneCT, "+");
  5066. tMC.mcChar.stop();
  5067. rootClass.ui.mcStatus.iconStone.visible = true;
  5068. break;
  5069. case "d":
  5070. if (resObj.hp < 0){
  5071. rootClass.ui.mcStatus.iconHoT.visible = true;
  5072. } else {
  5073. rootClass.ui.mcStatus.iconDoT.visible = true;
  5074. }
  5075. break;
  5076. case "disabled":
  5077. rootClass.ui.mcStatus.iconDisabled.visible = true;
  5078. tMC.mcChar.stop();
  5079. break;
  5080. case "clean":
  5081. tFilters = tMC.mcChar.filters;
  5082. tFilters.push(new GlowFilter(0xFFFFFF, 1, 30, 30, 2, 2));
  5083. tMC.mcChar.filters = tFilters;
  5084. rootClass.ui.mcStatus.iconClean.visible = true;
  5085. break;
  5086. };
  5087. };
  5088. };
  5089. if (((!((aura.animOn == null))) && ((((cLeaf == null)) || ((cLeaf.intState == 2)))))){
  5090. if (aura.animOn.indexOf("fadeFX:") > -1){
  5091. this.removeAuraFX(tMC, aura.animOn.split(":")[1], "fade");
  5092. }
  5093. else {
  5094. if (aura.animOn.indexOf("useFX:") > -1){
  5095. this.removeAuraFX(tMC, aura.animOn.split(":")[1], "use");
  5096. }
  5097. else {
  5098. if (aura.animOn.indexOf("removeFX:") > -1){
  5099. this.removeAuraFX(tMC, aura.animOn.split(":")[1]);
  5100. }
  5101. else {
  5102. tMC.mcChar.gotoAndPlay(aura.animOn);
  5103. };
  5104. };
  5105. };
  5106. };
  5107. if (aura.msgOn != null){
  5108. if (aura.msgOn.charAt(0) == "@"){
  5109. if (tAvt == this.myAvatar){
  5110. this.rootClass.addUpdate(aura.msgOn.substr(1));
  5111. };
  5112. }
  5113. else {
  5114. this.rootClass.addUpdate(aura.msgOn);
  5115. };
  5116. };
  5117. if (aura.isNew){
  5118. tLeaf.auras.push(aura);
  5119. }
  5120. else {
  5121. this.updateAuraData(cLeaf, aura, tLeaf);
  5122. };
  5123. }
  5124. else {
  5125. tLeaf.passives.push(aura);
  5126. };
  5127. i = (i + 1);
  5128. };
  5129. return;
  5130. case "aura-":
  5131. case "aura--":
  5132. auras = [];
  5133. if (resObj.auras != null){
  5134. auras = resObj.auras;
  5135. }
  5136. else {
  5137. if (resObj.aura != null){
  5138. auras = [resObj.aura];
  5139. };
  5140. };
  5141. i = 0;
  5142. while (i < auras.length) {
  5143. aura = auras[i];
  5144. if (this.removeAura(aura, tLeaf, tMC)){
  5145. if ((((((((tAvt == this.myAvatar)) || ((tAvt == this.myAvatar.target)))) || (((!((tLeaf.targets == null))) && (!((tLeaf.targets[this.rootClass.sfc.myUserId] == null))))))) || ((resObj.cmd == "aura--")))){
  5146. actionDamage = new auraDisplay();
  5147. actionDamage.t.ti.text = (("*" + aura.nam) + " fades*");
  5148. actionDamage.t.ti.textColor = 0x999999;
  5149. tMC.addChild(actionDamage);
  5150. actionDamage.x = (((tMC.mcChar.scaleX)<0) ? 35 : (-(actionDamage.t.ti.textWidth) - 35));
  5151. actionDamage.y = (tMC.pname.y + 25);
  5152. };
  5153. if (aura.potionType != null){
  5154. if (aura.potionType.toLowerCase() == "tonic"){
  5155. tAvt.objData.Tonic = false;
  5156. };
  5157. if (aura.potionType.toLowerCase() == "elixir"){
  5158. tAvt.objData.Elixir = false;
  5159. };
  5160. };
  5161. if (aura.s != null){
  5162. switch (aura.s){
  5163. case "s":
  5164. if (tMC.mcChar.currentLabel == "Fall"){
  5165. if (this.isStatusGone("s", tLeaf)){
  5166. tMC.mcChar.gotoAndPlay("Getup");
  5167. };
  5168. };
  5169. break;
  5170. };
  5171. };
  5172. if (aura.cat != null){
  5173. isOK = true;
  5174. for each (existingAura in tLeaf.auras) {
  5175. try {
  5176. if (((!((existingAura.cat == null))) && ((existingAura.cat == aura.cat)))){
  5177. isOK = false;
  5178. };
  5179. }
  5180. catch(e:Error) {
  5181. trace(("combat.applyAuras > " + e));
  5182. };
  5183. };
  5184. if (isOK){
  5185. switch (aura.cat){
  5186. /* HP's Aura Addon */
  5187. case "stun":
  5188. tMC.mcChar.gotoAndPlay("Getup");
  5189. tMC.mcChar.vertigoMC.visible = false;
  5190. rootClass.ui.mcStatus.iconStun.visible = false;
  5191. break;
  5192. case "silenced":
  5193. tMC.mcChar.gotoAndPlay("Getup");
  5194. tMC.mcChar.silenceMC.visible = false;
  5195. rootClass.ui.mcStatus.iconSilenced.visible = false;
  5196. break;
  5197. case "hex":
  5198. tMC.mcChar.gotoAndPlay("Getup");
  5199. rootClass.ui.mcStatus.iconHex.visible = false;
  5200. break;
  5201. case "freeze":
  5202. tMC.modulateColor(this.statusFreezeCT, "-");
  5203. tMC.mcChar.play();
  5204. rootClass.ui.mcStatus.iconFreeze.visible = false;
  5205. break;
  5206. case "invi":
  5207. tMC.mcChar.visible = true;
  5208. tMC.shadow.visible = true;
  5209. tMC.pname.visible = true;
  5210. tMC.hpBar.visible = true;
  5211. myAvatar.petMC.visible = true;
  5212. rootClass.ui.mcStatus.iconInvicible.visible = false;
  5213. break;
  5214. /* End */
  5215. case "stone":
  5216. tMC.modulateColor(this.statusStoneCT, "-");
  5217. tMC.mcChar.play();
  5218. rootClass.ui.mcStatus.iconStone.visible = false;
  5219. break;
  5220. case "d":
  5221. if (resObj.hp < 0){
  5222. rootClass.ui.mcStatus.iconHoT.visible = false;
  5223. } else {
  5224. rootClass.ui.mcStatus.iconDoT.visible = false;
  5225. }
  5226. break;
  5227. case "paralyze":
  5228. tMC.mcChar.stop();
  5229. rootClass.ui.mcStatus.iconParalyze.visible = false;
  5230. break;
  5231. case "disabled":
  5232. rootClass.ui.mcStatus.iconDisabled.visible = false;
  5233. tMC.mcChar.play();
  5234. break;
  5235. case "clean":
  5236. tFilters = tMC.mcChar.filters;
  5237. filterIndex = 0;
  5238. while (filterIndex < tFilters.length) {
  5239. tFilter = tFilters[filterIndex];
  5240. if ((((tFilter is GlowFilter)) && ((GlowFilter(tFilter).color == 0xFFFFFF)))){
  5241. tFilters.splice(filterIndex, 1);
  5242. filterIndex = (filterIndex - 1);
  5243. };
  5244. filterIndex = (filterIndex + 1);
  5245. };
  5246. tMC.mcChar.filters = tFilters;
  5247. rootClass.ui.mcStatus.iconClean.visible = false;
  5248. break;
  5249. };
  5250. };
  5251. };
  5252. if (aura.nam == "Skill Locked"){
  5253. ai = 0;
  5254. while (ai < this.actions.active.length) {
  5255. actObj = this.actions.active[ai];
  5256. if (actObj.nam == aura.val){
  5257. icon1 = this.rootClass.ui.mcInterface.actBar.getChildByName(("i" + (ai + 1)));
  5258. icon1.actObj.skillLock = false;
  5259. icon1.cnt.alpha = 1;
  5260. };
  5261. ai = (ai + 1);
  5262. };
  5263. };
  5264. if (aura.animOff != null){
  5265. tMC.mcChar.gotoAndPlay(aura.animOff);
  5266. };
  5267. if (aura.msgOff != null){
  5268. if (aura.msgOff.charAt(0) == "@"){
  5269. if (tAvt == this.myAvatar){
  5270. this.rootClass.addUpdate(aura.msgOff.substr(1));
  5271. };
  5272. }
  5273. else {
  5274. this.rootClass.addUpdate(aura.msgOff);
  5275. };
  5276. };
  5277. };
  5278. i = (i + 1);
  5279. };
  5280. return;
  5281. case "aura*":
  5282. actionDamage = new auraDisplay();
  5283. actionDamage.t.ti.text = "* IMMUNE *";
  5284. tMC.addChild(actionDamage);
  5285. actionDamage.x = (((tMC.mcChar.scaleX)<0) ? 35 : (-(actionDamage.t.ti.textWidth) - 35));
  5286. actionDamage.y = ((tMC.pname.y + 25) + ((actionDamage.height + 3) * i));
  5287. return;
  5288. };
  5289. };
  5290. }
  5291.  
  5292. public function updateAuraData(_arg1:Object, _arg2:Object, _arg3:Object):void{
  5293. var _local4:Object;
  5294. for each (_local4 in _arg3.auras) {
  5295. if ((((_local4.nam == _arg2.nam)) && ((_local4.cLeaf == _arg1)))){
  5296. _local4.dur = _arg2.dur;
  5297. _local4.val = _arg2.val;
  5298. };
  5299. };
  5300. }
  5301.  
  5302. public function handleAuraEvent(_arg1:String, _arg2:Object):void{
  5303. var cLeaf:Object;
  5304. var tLeaf:Object;
  5305. var cAvt:Avatar;
  5306. var tAvt:Avatar;
  5307. var cTyp:String;
  5308. var cID:int;
  5309. var tTyp:String;
  5310. var tID:int;
  5311. var forceAura:Boolean;
  5312. var cmd:String = _arg1;
  5313. var resObj:Object = _arg2;
  5314. trace("handleAuraEvent >");
  5315. if (this.rootClass.sfcSocial){
  5316. forceAura = false;
  5317. if ((((cmd.indexOf("++") > -1)) || ((cmd.indexOf("--") > -1)))){
  5318. forceAura = true;
  5319. };
  5320. cAvt = null;
  5321. tAvt = null;
  5322. if (resObj.cInf != null){
  5323. cTyp = String(resObj.cInf.split(":")[0]);
  5324. cID = int(resObj.cInf.split(":")[1]);
  5325. switch (cTyp){
  5326. case "p":
  5327. cAvt = this.getAvatarByUserID(cID);
  5328. cLeaf = this.getUoLeafById(cID);
  5329. break;
  5330. case "m":
  5331. cAvt = this.getMonster(cID);
  5332. cLeaf = this.monTree[cID];
  5333. break;
  5334. };
  5335. };
  5336. if (resObj.tInf != null){
  5337. tTyp = String(resObj.tInf.split(":")[0]);
  5338. tID = int(resObj.tInf.split(":")[1]);
  5339. switch (tTyp){
  5340. case "p":
  5341. try {
  5342. tAvt = this.getAvatarByUserID(tID);
  5343. tLeaf = this.getUoLeafById(tID);
  5344. if (((forceAura) || ((tLeaf.strFrame == this.strFrame)))){
  5345. if (this.rootClass.sfcSocial){
  5346. this.showAuraChange(resObj, tAvt, tLeaf);
  5347. };
  5348. };
  5349. }
  5350. catch(e:Error) {
  5351. };
  5352. return;
  5353. case "m":
  5354. try {
  5355. tAvt = this.getMonster(tID);
  5356. tLeaf = this.monTree[tID];
  5357. if (((forceAura) || ((((cLeaf == null)) || (((!((cLeaf.targets[tID] == null))) && ((tLeaf.strFrame == this.strFrame)))))))){
  5358. if (this.rootClass.sfcSocial){
  5359. this.showAuraChange(resObj, tAvt, tLeaf);
  5360. };
  5361. };
  5362. }
  5363. catch(e:Error) {
  5364. trace((" HAE > " + e));
  5365. };
  5366. return;
  5367. };
  5368. };
  5369. };
  5370. }
  5371.  
  5372. public function removeAura(_arg1:Object, _arg2:Object, _arg3:MovieClip):Boolean{
  5373. var _local4:Boolean;
  5374. var _local5:int;
  5375. trace(("removeAura > " + _arg1.nam));
  5376. if (this.rootClass.sfcSocial){
  5377. _local4 = false;
  5378. _local5 = 0;
  5379. _local5 = 0;
  5380. while (_local5 < _arg2.auras.length) {
  5381. if (_arg2.auras[_local5].nam == _arg1.nam){
  5382. if (((!((_arg3 == null))) && (!((_arg2.auras[_local5].fx == null))))){
  5383. this.removeAuraFX(_arg3, _arg2.auras[_local5].fx, "fade");
  5384. };
  5385. _arg2.auras.splice(_local5, 1);
  5386. _local5 = _arg2.auras.length;
  5387. _local4 = true;
  5388. };
  5389. _local5++;
  5390. };
  5391. _local5 = 0;
  5392. while (_local5 < _arg2.passives.length) {
  5393. if (_arg2.passives[_local5].nam == _arg1.nam){
  5394. _arg2.passives.splice(_local5, 1);
  5395. _local5 = _arg2.passives.length;
  5396. _local4 = false;
  5397. };
  5398. _local5++;
  5399. };
  5400. trace(("returning " + _local4));
  5401. return (_local4);
  5402. };
  5403. trace("Unsocial, returning false");
  5404. return (false);
  5405. }
  5406.  
  5407. public function addAuraFX(_arg1:MovieClip, _arg2:String):void{
  5408. var c:Class;
  5409. var fx:MovieClip;
  5410. var tMC:MovieClip = _arg1;
  5411. var fxName:String = _arg2;
  5412. trace(("addAuraFX > " + fxName));
  5413. try {
  5414. if (tMC.fx.getChildByName(fxName) == null){
  5415. c = this.getClass(fxName);
  5416. fx = MovieClip(tMC.fx.addChild(new (c)()));
  5417. fx.name = fxName;
  5418. fx.y = -30;
  5419. };
  5420. }
  5421. catch(e:Error) {
  5422. trace(e);
  5423. };
  5424. trace("");
  5425. }
  5426.  
  5427. public function removeAuraFX(_arg1:MovieClip, _arg2:String, _arg3:String=null):void{
  5428. var i:int;
  5429. var fx:MovieClip;
  5430. var tMC:MovieClip = _arg1;
  5431. var fxName:String = _arg2;
  5432. var fxLabel = _arg3;
  5433. trace((("removeAuraFX > " + fxName) + (((fxLabel)!=null) ? (" " + fxLabel) : "")));
  5434. i = 0;
  5435. i = 0;
  5436. while (i < tMC.fx.numChildren) {
  5437. fx = MovieClip(tMC.fx.getChildAt(i));
  5438. if ((((fxName == "all")) || ((fx.name == fxName)))){
  5439. if (fxLabel != null){
  5440. try {
  5441. MovieClip(fx.getChildByName("inner")).gotoAndPlay(fxLabel);
  5442. }
  5443. catch(fxe:Error) {
  5444. trace(("fx play error > " + fxe));
  5445. };
  5446. }
  5447. else {
  5448. MovieClip(tMC.fx.removeChildAt(i)).stop();
  5449. i = (i - 1);
  5450. };
  5451. };
  5452. i = (i + 1);
  5453. };
  5454. }
  5455.  
  5456. public function isStatusGone(_arg1:String, _arg2:Object):Boolean{
  5457. var _local3:*;
  5458. _local3 = 0;
  5459. while (_local3 < _arg2.auras.length) {
  5460. if (((!((_arg2.auras[_local3].s == null))) && ((_arg2.auras[_local3].s == _arg1)))){
  5461. return (false);
  5462. };
  5463. _local3++;
  5464. };
  5465. return (true);
  5466. }
  5467.  
  5468. public function isMoveOK(_arg1:Object):Boolean{
  5469. var isOK:Boolean;
  5470. var aura:Object;
  5471. var tLeaf:Object = _arg1;
  5472. isOK = true;
  5473. aura = {};
  5474. if (tLeaf.auras != null){
  5475. for each (aura in tLeaf.auras) {
  5476. try {
  5477. if (aura.cat != null){
  5478. if (aura.cat == "stun"){
  5479. isOK = false;
  5480. };
  5481. if (aura.cat == "stone"){
  5482. isOK = false;
  5483. };
  5484. if (aura.cat == "disabled"){
  5485. isOK = false;
  5486. };
  5487. if (aura.cat == "silenced"){
  5488. isOK = false;
  5489. };
  5490. };
  5491. }
  5492. catch(e:Error) {
  5493. trace(("doAnim > " + e));
  5494. };
  5495. };
  5496. return (isOK);
  5497. };
  5498. return (false);
  5499. }
  5500.  
  5501. public function wound(_arg1, _arg2){
  5502. var _local3:*;
  5503. if (_arg2 == "damage"){
  5504. _local3 = new MovieClip();
  5505. _local3.name = "flickermc";
  5506. _local3.maxF = 3;
  5507. _local3.curF = 0;
  5508. _local3.addEventListener(Event.ENTER_FRAME, this.flickerFrame);
  5509. if (_arg1.contains(_local3)){
  5510. _arg1.flickermc.removeEventListener(Event.ENTER_FRAME, this.flickerFrame);
  5511. _arg1.removeChild(_local3);
  5512. };
  5513. _arg1.addChild(_local3);
  5514. };
  5515. }
  5516.  
  5517. public function flickerFrame(_arg1:Event){
  5518. var _local2:*;
  5519. _local2 = MovieClip(_arg1.currentTarget);
  5520. if (((!((_local2.parent == null))) && (!((_local2.parent.stage == null))))){
  5521. if (_local2.curF == 0){
  5522. _local2.parent.modulateColor(this.avtWCT, "+");
  5523. };
  5524. if (_local2.curF == 1){
  5525. _local2.parent.modulateColor(this.avtWCT, "-");
  5526. };
  5527. if (_local2.curF == 2){
  5528. _local2.parent.modulateColor(this.avtWCT, "+");
  5529. };
  5530. if (_local2.curF >= _local2.maxF){
  5531. _local2.parent.modulateColor(this.avtWCT, "-");
  5532. _local2.removeEventListener(Event.ENTER_FRAME, this.flickerFrame);
  5533. _local2.parent.removeChild(_local2);
  5534. };
  5535. _local2.curF++;
  5536. }
  5537. else {
  5538. _local2.removeEventListener(Event.ENTER_FRAME, this.flickerFrame);
  5539. };
  5540. }
  5541.  
  5542. public function unlockActionsExcept(_arg1){
  5543. var _local2:*;
  5544. var _local3:*;
  5545. var _local4:*;
  5546. var _local5:*;
  5547. var _local6:*;
  5548. var _local7:*;
  5549. _local2 = [];
  5550. _local3 = 0;
  5551. _local3 = 0;
  5552. while (_local3 < this.actions.active.length) {
  5553. _local5 = this.actions.active[_local3];
  5554. if (((((!((_local5.ref == _arg1.ref))) && ((_local5.lock == true)))) && ((_local5.ts < _arg1.ts)))){
  5555. _local6 = 0;
  5556. while (_local6 < this.actionMap.length) {
  5557. if (this.actionMap[_local6] == _local5.ref){
  5558. _local2.push(("i" + (_local6 + 1)));
  5559. };
  5560. _local6++;
  5561. };
  5562. };
  5563. _local3++;
  5564. };
  5565. _local4 = 0;
  5566. while (_local4 < _local2.length) {
  5567. _local7 = this.rootClass.ui.mcInterface.actBar.getChildByName(_local2[_local4]);
  5568. if (_local7.actObj != null){
  5569. _local7.actObj.lock = false;
  5570. };
  5571. _local4++;
  5572. };
  5573. }
  5574.  
  5575. public function unlockActions(){
  5576. var _local1:*;
  5577. var _local2:*;
  5578. _local1 = 0;
  5579. while (_local1 < this.actions.active.length) {
  5580. _local2 = this.actions.active[_local1];
  5581. _local2.lock = false;
  5582. _local1++;
  5583. };
  5584. }
  5585.  
  5586. public function updateActBar():void{
  5587. var _local1:*;
  5588. var _local2:*;
  5589. var _local3:*;
  5590. if (((((!((this.myAvatar == null))) && (!((this.myAvatar.dataLeaf == null))))) && (!((this.myAvatar.dataLeaf.sta == null))))){
  5591. _local1 = 0;
  5592. while (_local1 < this.rootClass.ui.mcInterface.actBar.numChildren) {
  5593. _local2 = this.rootClass.ui.mcInterface.actBar.getChildAt(_local1);
  5594. if (((("actObj" in _local2)) && (!((_local2.actObj == null))))){
  5595. _local3 = _local2.actObj.skillLock;
  5596. _local3 = (((_local3)==null) ? false : _local3);
  5597. if ((((this.myAvatar.dataLeaf.intMP >= Math.round((_local2.actObj.mp * this.myAvatar.dataLeaf.sta["$cmc"])))) && (!(_local3)))){
  5598. if (_local2.cnt.alpha < 1){
  5599. _local2.cnt.alpha = 1;
  5600. };
  5601. }
  5602. else {
  5603. if (_local2.cnt.alpha == 1){
  5604. _local2.cnt.alpha = 0.4;
  5605. };
  5606. };
  5607. };
  5608. _local1++;
  5609. };
  5610. };
  5611. }
  5612.  
  5613. public function getActIcons(_arg1:Object):Array{
  5614. var _local2:Array;
  5615. var _local3:MovieClip;
  5616. var _local4:*;
  5617. _local2 = [];
  5618. _local4 = 0;
  5619. while (_local4 < this.actionMap.length) {
  5620. if (this.actionMap[_local4] == _arg1.ref){
  5621. _local3 = (this.rootClass.ui.mcInterface.actBar.getChildByName(("i" + (_local4 + 1))) as MovieClip);
  5622. if (_local3 != null){
  5623. _local2.push(_local3);
  5624. };
  5625. };
  5626. _local4++;
  5627. };
  5628. return (_local2);
  5629. }
  5630.  
  5631. public function globalCoolDownExcept(_arg1:Object):void{
  5632. var _local2:Number;
  5633. var _local3:MovieClip;
  5634. var _local4:Object;
  5635. _local2 = new Date().getTime();
  5636. for each (_local4 in this.actions.active) {
  5637. if (_local4.isOK){
  5638. _local3 = this.getActIcons(_local4)[0];
  5639. if (_local3 != null){
  5640. try {
  5641. if (((((!((_local4 == _arg1))) && (!((_local4.ref == "aa"))))) && (((((!(("icon2" in _local3))) || ((_local3.icon2 == null)))) || (((((_local4.ts + _local4.cd) > _local2)) && ((((_local4.ts + _local4.cd) - _local2) < this.GCD)))))))){
  5642. this.coolDownAct(_local4, this.GCD, _local2);
  5643. };
  5644. }
  5645. catch(e:Error) {
  5646. };
  5647. };
  5648. };
  5649. };
  5650. this.GCDTS = _local2;
  5651. }
  5652.  
  5653. public function checkCooldown(_arg1:Object){
  5654. var _local2:Array;
  5655. var _local3:MovieClip;
  5656. var _local4:int;
  5657. var _local5:*;
  5658. var _local6:*;
  5659. var _local7:*;
  5660. _local2 = this.getActIcons(_arg1);
  5661. while (_local4 < _local2.length) {
  5662. _local3 = _local2[_local4];
  5663. if (_local3.icon2 != null){
  5664. _local3.bitmapData.dispose();
  5665. _local5 = new BitmapData(50, 50, true, 0);
  5666. _local5.draw(_local3, null, this.iconCT);
  5667. _local6 = new Bitmap(_local5);
  5668. _local7 = this.rootClass.ui.mcInterface.actBar.addChild(_local6);
  5669. _local3.icon2 = _local7;
  5670. };
  5671. _local4++;
  5672. };
  5673. }
  5674.  
  5675. public function coolDownAct(_arg1:Object, _arg2:int=-1, _arg3:Number=-1){
  5676. var _local4:Array;
  5677. var _local5:MovieClip;
  5678. var _local6:int;
  5679. var _local7:*;
  5680. var _local8:MovieClip;
  5681. var _local9:*;
  5682. var _local10:*;
  5683. var _local11:int;
  5684. var _local12:DisplayObject;
  5685. _local4 = this.getActIcons(_arg1);
  5686. _local6 = 0;
  5687. while (_local6 < _local4.length) {
  5688. _local5 = _local4[_local6];
  5689. _local7 = null;
  5690. _local8 = null;
  5691. if (_local5.icon2 == null){
  5692. _local9 = new BitmapData(50, 50, true, 0);
  5693. _local9.draw(_local5, null, this.iconCT);
  5694. _local10 = new Bitmap(_local9);
  5695. _local7 = this.rootClass.ui.mcInterface.actBar.addChild(_local10);
  5696. _local5.icon2 = _local7;
  5697. if (_arg2 == -1){
  5698. _local12 = this.rootClass.ui.mcInterface.actBar.addChild(new iconFlare());
  5699. _local7.transform = (_local12.transform = _local5.transform);
  5700. _local5.ts = _arg1.ts;
  5701. _local5.cd = _arg1.cd;
  5702. }
  5703. else {
  5704. _local7.transform = _local5.transform;
  5705. _local5.ts = _arg3;
  5706. _local5.cd = _arg2;
  5707. };
  5708. _local8 = (this.rootClass.ui.mcInterface.actBar.addChild(new ActMask()) as MovieClip);
  5709. _local8.scaleX = 0.33;
  5710. _local8.scaleY = 0.33;
  5711. _local8.x = int(((_local7.x + (_local7.width / 2)) - (_local8.width / 2)));
  5712. _local8.y = int(((_local7.y + (_local7.height / 2)) - (_local8.height / 2)));
  5713. _local11 = 0;
  5714. while (_local11 < 4) {
  5715. _local8[(("e" + _local11) + "oy")] = _local8[("e" + _local11)].y;
  5716. _local11++;
  5717. };
  5718. _local7.mask = _local8;
  5719. }
  5720. else {
  5721. _local7 = _local5.icon2;
  5722. _local8 = _local7.mask;
  5723. if (_arg2 == -1){
  5724. _local5.ts = _arg1.ts;
  5725. _local5.cd = _arg1.cd;
  5726. }
  5727. else {
  5728. _local5.ts = _arg3;
  5729. _local5.cd = _arg2;
  5730. };
  5731. };
  5732. _local8.e0.stop();
  5733. _local8.e1.stop();
  5734. _local8.e2.stop();
  5735. _local8.e3.stop();
  5736. _local5.removeEventListener(Event.ENTER_FRAME, this.countDownAct);
  5737. _local5.addEventListener(Event.ENTER_FRAME, this.countDownAct, false, 0, true);
  5738. _local6++;
  5739. };
  5740. }
  5741.  
  5742. public function countDownAct(_arg1:Event):void{
  5743. var _local2:*;
  5744. var _local3:*;
  5745. var _local4:*;
  5746. var _local5:*;
  5747. var _local6:*;
  5748. var _local7:*;
  5749. var _local8:*;
  5750. var _local9:*;
  5751. var _local10:*;
  5752. var _local11:*;
  5753. _local2 = new Date();
  5754. _local3 = _local2.getTime();
  5755. _local4 = MovieClip(_arg1.target);
  5756. _local5 = _local4.icon2;
  5757. _local6 = Math.round((_local4.cd * (1 - Math.min(Math.max(this.myAvatar.dataLeaf.sta.$tha, -1), 0.5))));
  5758. _local7 = ((_local3 - _local4.ts) / _local6);
  5759. _local8 = Math.floor((_local7 * 4));
  5760. _local9 = (int(((_local7 * 360) % 90)) + 1);
  5761. if (!_local4.actObj.lock){
  5762. if (_local7 < 0.99){
  5763. _local10 = 0;
  5764. while (_local10 < 4) {
  5765. if (_local10 < _local8){
  5766. _local5.mask[("e" + _local10)].y = -300;
  5767. }
  5768. else {
  5769. _local5.mask[("e" + _local10)].y = _local5.mask[(("e" + _local10) + "oy")];
  5770. if (_local10 > _local8){
  5771. _local5.mask[("e" + _local10)].gotoAndStop(0);
  5772. };
  5773. };
  5774. _local10++;
  5775. };
  5776. MovieClip(_local5.mask[("e" + _local8)]).gotoAndStop(_local9);
  5777. }
  5778. else {
  5779. _local11 = _local5.mask;
  5780. _local5.mask = null;
  5781. _local5.parent.removeChild(_local11);
  5782. _local4.removeEventListener(Event.ENTER_FRAME, this.countDownAct);
  5783. _local5.parent.removeChild(_local5);
  5784. _local5.bitmapData.dispose();
  5785. _local4.icon2 = null;
  5786. };
  5787. };
  5788. }
  5789.  
  5790. public function healByIcon(_arg1:Avatar):void{
  5791. var _local2:Object;
  5792. _local2 = this.getFirstHeal();
  5793. if (_local2 != null){
  5794. this.setTarget(_arg1);
  5795. this.testAction(_local2);
  5796. };
  5797. }
  5798.  
  5799. public function getFirstHeal():Object{
  5800. var _local1:*;
  5801. try {
  5802. _local1 = 0;
  5803. while (_local1 < this.actions.active.length) {
  5804. if (((((((!((this.actions.active[_local1] == null))) && (!((this.actions.active[_local1].damage == null))))) && ((this.actions.active[_local1].damage < 0)))) && (this.actions.active[_local1].isOK))){
  5805. return (this.actions.active[_local1]);
  5806. };
  5807. _local1++;
  5808. };
  5809. }
  5810. catch(e:Error) {
  5811. };
  5812. return (null);
  5813. }
  5814.  
  5815. public function AATest(_arg1:Event){
  5816. trace("TIMER AATest > DISABLED");
  5817. }
  5818.  
  5819. public function connTest(_arg1:Event){
  5820. trace("TIMER connTest > Failed! This should not appear, test was removed.");
  5821. }
  5822.  
  5823. function checkSP(_arg1:int, _arg2:Object):Boolean{
  5824. var _local3:*;
  5825. _local3 = 0;
  5826. while (_local3 < _arg2.auras.length) {
  5827. if (_arg2.auras[_local3].nam == "Spirit Power"){
  5828. if (_arg1 <= _arg2.auras[_local3].val){
  5829. return (true);
  5830. };
  5831. return (false);
  5832. };
  5833. _local3++;
  5834. };
  5835. return (false);
  5836. }
  5837.  
  5838. public function acceptQuest(_arg1:int):void{
  5839. if (this.questTree[_arg1] == null){
  5840. this.getQuests([_arg1]);
  5841. };
  5842. if (this.questTree[_arg1].status == null){
  5843. this.questTree[_arg1].status = "p";
  5844. this.rootClass.ui.mcQTracker.updateQuest();
  5845. };
  5846. if (!this.rootClass.ui.mcQTracker.visible){
  5847. this.rootClass.ui.mcQTracker.toggle();
  5848. };
  5849. this.rootClass.sfc.sendXtMessage("zm", "acceptQuest", [_arg1], "str", this.curRoom);
  5850. }
  5851.  
  5852. public function tryQuestComplete(_arg1:int, _arg2:int=-1, _arg3:Boolean=false):void{
  5853. this.rootClass.sfc.sendXtMessage("zm", "tryQuestComplete", [_arg1, _arg2, _arg3, "wvz"], "str", this.curRoom);
  5854. }
  5855.  
  5856. public function getMapItem(_arg1:int):void{
  5857. if (this.coolDown("getMapItem")){
  5858. this.rootClass.sfc.sendXtMessage("zm", "getMapItem", [_arg1], "str", this.curRoom);
  5859. };
  5860. }
  5861.  
  5862. public function isQuestInProgress(_arg1:int):Boolean{
  5863. return (((!((this.questTree[_arg1] == null))) && (!((this.questTree[_arg1].status == null)))));
  5864. }
  5865.  
  5866. public function getQuests(_arg1:Array):void{
  5867. this.rootClass.sfc.sendXtMessage("zm", "getQuests", _arg1, "str", this.curRoom);
  5868. }
  5869.  
  5870. public function getQuest(_arg1:int):void{
  5871. }
  5872.  
  5873. public function showQuestList(_arg1:String, _arg2:String, _arg3:String):void{
  5874. var _local4:*;
  5875. var _local5:*;
  5876. var _local6:*;
  5877. var _local7:*;
  5878. var _local8:*;
  5879. var _local9:String;
  5880. if (!this.rootClass.isGreedyModalInStack()){
  5881. this.rootClass.clearPopupsQ();
  5882. _local4 = this.rootClass.attachOnModalStack("QFrameMC");
  5883. _local5 = _arg2.split(",");
  5884. _local6 = _arg3.split(",");
  5885. _local4.sIDs = _local5;
  5886. _local4.tIDs = _local6;
  5887. _local4.world = this;
  5888. _local4.rootClass = this.rootClass;
  5889. _local4.qMode = _arg1;
  5890. _local7 = [];
  5891. _local8 = 0;
  5892. while (_local8 < _local5.length) {
  5893. _local9 = _local5[_local8];
  5894. if (this.questTree[_local9] == null){
  5895. _local7.push(_local9);
  5896. }
  5897. else {
  5898. if (this.questTree[_local9].strDynamic != null){
  5899. this.questTree[_local9] = null;
  5900. delete this.questTree[_local9];
  5901. _local7.push(_local9);
  5902. };
  5903. };
  5904. _local8++;
  5905. };
  5906. if ((((_local7.length > 0)) && (!((_arg2 == ""))))){
  5907. this.getQuests(_local7);
  5908. }
  5909. else {
  5910. _local4.open();
  5911. };
  5912. };
  5913. }
  5914.  
  5915. public function showQuests(_arg1:String, _arg2:String):void{
  5916. this.showQuestList(_arg2, _arg1, _arg1);
  5917. }
  5918.  
  5919. public function showQuestLink(_arg1:Object):void{
  5920. var _local2:String;
  5921. var _local3:String;
  5922. var _local4:String;
  5923. _local2 = "$({";
  5924. _local3 = "})$";
  5925. _local4 = "";
  5926. if (_arg1.unm.toLowerCase() != this.rootClass.sfc.myUserName){
  5927. _local4 = (_local4 + ((_arg1.unm + " issues a Call to Arms for ") + _local2));
  5928. _local4 = (_local4 + ["quest", _arg1.quest.sName, _arg1.quest.QuestID, _arg1.quest.iLvl, _arg1.unm].toString());
  5929. _local4 = (_local4 + (_local3 + "!"));
  5930. }
  5931. else {
  5932. _local4 = (_local4 + (("You issue a Call to Arms for " + _arg1.quest.sName) + "!"));
  5933. };
  5934. this.rootClass.chatF.pushMsg("event", _local4, "SERVER", "", 0);
  5935. }
  5936.  
  5937. public function getActiveQuests():String{
  5938. var _local1:String;
  5939. var _local2:*;
  5940. var _local3:*;
  5941. _local1 = "";
  5942. for (_local2 in this.questTree) {
  5943. _local3 = this.questTree[_local2];
  5944. if (_local3.status != null){
  5945. if (_local1.length){
  5946. _local1 = (_local1 + ("," + _local2));
  5947. }
  5948. else {
  5949. _local1 = (_local1 + _local2);
  5950. };
  5951. };
  5952. };
  5953. return (_local1);
  5954. }
  5955.  
  5956. public function checkAllQuestStatus(_arg1=null){
  5957. var _local2:Array;
  5958. var _local3:String;
  5959. var _local4:*;
  5960. var _local5:*;
  5961. var _local6:*;
  5962. var _local7:int;
  5963. var _local8:*;
  5964. var _local9:*;
  5965. var _local10:*;
  5966. _local2 = [];
  5967. if (_arg1 != null){
  5968. _local2 = [String(_arg1)];
  5969. }
  5970. else {
  5971. for (_local3 in this.questTree) {
  5972. _local2.push(_local3);
  5973. };
  5974. };
  5975. for each (_local3 in _local2) {
  5976. _local4 = this.questTree[_local3];
  5977. _local5 = {};
  5978. if (_local4.status != null){
  5979. if (((!((_local4.turnin == null))) && ((_local4.turnin.length > 0)))){
  5980. _local5.sItems = true;
  5981. _local7 = 0;
  5982. while (_local7 < _local4.turnin.length) {
  5983. _local8 = _local4.turnin[_local7].ItemID;
  5984. _local9 = _local4.turnin[_local7].iQty;
  5985. if ((((this.invTree[_local8] == null)) || ((this.invTree[_local8].iQty < _local9)))){
  5986. _local5.sItems = false;
  5987. break;
  5988. };
  5989. _local7++;
  5990. };
  5991. };
  5992. if (_local4.iTime != null){
  5993. _local5.iTime = false;
  5994. if (_local4.ts != null){
  5995. _local10 = new Date();
  5996. if ((_local10.getTime() - _local4.ts) <= _local4.iTime){
  5997. _local5.iTime = true;
  5998. };
  5999. };
  6000. };
  6001. _local4.status = "c";
  6002. for (_local6 in _local5) {
  6003. if (_local5[_local6] == false){
  6004. _local4.status = "p";
  6005. };
  6006. };
  6007. };
  6008. };
  6009. this.rootClass.ui.mcQTracker.updateQuest();
  6010. }
  6011.  
  6012. public function updateQuestProgress(_arg1:String, _arg2:Object):void{
  6013. var _local3:*;
  6014. var _local4:*;
  6015. var _local5:*;
  6016. var _local6:int;
  6017. var _local7:*;
  6018. var _local8:*;
  6019. var _local9:*;
  6020. for (_local3 in this.questTree) {
  6021. _local4 = this.questTree[_local3];
  6022. _local5 = {};
  6023. if (((!((_local4.status == null))) && ((_local4.status == "p")))){
  6024. if ((((((_arg1 == "item")) && (!((_local4.turnin == null))))) && ((_local4.turnin.length > 0)))){
  6025. _local5.sItems = true;
  6026. _local6 = 0;
  6027. while (_local6 < _local4.turnin.length) {
  6028. _local7 = _local4.turnin[_local6].ItemID;
  6029. _local8 = _local4.turnin[_local6].iQty;
  6030. if ((((((_arg2.ItemID == _local7)) && (!((this.invTree[_local7] == null))))) && ((this.invTree[_local7].iQty <= _local8)))){
  6031. _local9 = this.invTree[_local7];
  6032. this.rootClass.addUpdate(((((((_local4.sName + ": ") + _local9.sName) + " ") + this.invTree[_local7].iQty) + "/") + _local8));
  6033. };
  6034. _local6++;
  6035. };
  6036. };
  6037. this.checkAllQuestStatus(_local3);
  6038. if (_local4.status == "c"){
  6039. this.rootClass.addUpdate((_local4.sName + " complete!"));
  6040. this.rootClass.mixer.playSound("Good");
  6041. };
  6042. };
  6043. };
  6044. }
  6045.  
  6046. public function canTurnInQuest(_arg1:int):Boolean{
  6047. var _local2:*;
  6048. var _local3:int;
  6049. var _local4:*;
  6050. var _local5:*;
  6051. _local2 = this.questTree[_arg1];
  6052. if (((!((_local2.turnin == null))) && ((_local2.turnin.length > 0)))){
  6053. _local3 = 0;
  6054. while (_local3 < _local2.turnin.length) {
  6055. _local4 = _local2.turnin[_local3].ItemID;
  6056. _local5 = _local2.turnin[_local3].iQty;
  6057. if ((((this.invTree[_local4] == null)) || ((this.invTree[_local4].iQty < _local5)))){
  6058. return (false);
  6059. };
  6060. if (this.myAvatar.isItemEquipped(_local4)){
  6061. this.rootClass.MsgBox.notify("Cannot turn in equipped item(s)!");
  6062. return (false);
  6063. };
  6064. _local3++;
  6065. };
  6066. };
  6067. return (true);
  6068. }
  6069.  
  6070. public function abandonQuest(_arg1:int):void{
  6071. this.questTree[_arg1].status = null;
  6072. this.rootClass.ui.mcQTracker.updateQuest();
  6073. }
  6074.  
  6075. public function completeQuest(_arg1:int):void{
  6076. if (this.questTree[_arg1] != null){
  6077. this.questTree[_arg1].status = null;
  6078. this.rootClass.ui.mcQTracker.updateQuest();
  6079. };
  6080. }
  6081.  
  6082. public function toggleQuestLog():void{
  6083. var _local1:*;
  6084. _local1 = this.rootClass.getInstanceFromModalStack("QFrameMC");
  6085. if (_local1 == null){
  6086. this.showQuests("", "l");
  6087. }
  6088. else {
  6089. _local1.open();
  6090. };
  6091. }
  6092.  
  6093. public function isPartyMember(_arg1:String):Boolean{
  6094. var _local2:int;
  6095. _arg1 = _arg1.toLowerCase();
  6096. if (_arg1 != this.rootClass.sfc.myUserName){
  6097. _local2 = 0;
  6098. while (_local2 < this.partyMembers.length) {
  6099. if (this.partyMembers[_local2].toLowerCase() == _arg1){
  6100. return (true);
  6101. };
  6102. _local2++;
  6103. };
  6104. };
  6105. return (false);
  6106. }
  6107.  
  6108. public function doPartyAccept(_arg1:Object):void{
  6109. if (_arg1.accept){
  6110. this.rootClass.sfc.sendXtMessage("zm", "gp", ["pa", _arg1.pid], "str", 1);
  6111. }
  6112. else {
  6113. this.rootClass.sfc.sendXtMessage("zm", "gp", ["pd", _arg1.pid], "str", 1);
  6114. };
  6115. }
  6116.  
  6117. public function doCTAAccept(_arg1:Object):void{
  6118. if (_arg1.accept){
  6119. this.rootClass.sfc.sendXtMessage("zm", "gp", ["ctaa", _arg1.unm], "str", 1);
  6120. this.showQuests(_arg1.QuestID, "q");
  6121. };
  6122. }
  6123.  
  6124. public function doCTAClick(_arg1:MouseEvent):void{
  6125. var _local2:MovieClip;
  6126. var _local3:ModalMC;
  6127. var _local4:Object;
  6128. _local2 = (_arg1.currentTarget as MovieClip);
  6129. _local3 = new ModalMC();
  6130. _local4 = {};
  6131. _local4.strBody = (("Would you like to join the next avabilable party for " + _local2.sName) + "?");
  6132. _local4.callback = this.doCTAAccept;
  6133. _local4.params = {
  6134. QuestID:_local2.QuestID,
  6135. unm:_local2.unm
  6136. };
  6137. _local4.btns = "dual";
  6138. this.rootClass.ui.ModalStack.addChild(_local3);
  6139. _local3.init(_local4);
  6140. }
  6141.  
  6142. public function addPartyMember(_arg1:String){
  6143. this.partyMembers.push(_arg1);
  6144. this.updatePartyFrame();
  6145. }
  6146.  
  6147. public function removePartyMember(_arg1:String){
  6148. var _local2:*;
  6149. if (_arg1 != this.rootClass.sfc.myUserName){
  6150. _local2 = this.partyMembers.indexOf(_arg1);
  6151. if (_local2 > -1){
  6152. this.partyMembers.splice(_local2, 1);
  6153. };
  6154. }
  6155. else {
  6156. this.partyID = -1;
  6157. this.partyOwner = "";
  6158. this.partyMembers = [];
  6159. };
  6160. this.updatePartyFrame();
  6161. }
  6162.  
  6163. public function updatePartyFrame(_arg1:Object=null){
  6164. var _local2:MovieClip;
  6165. var _local3:int;
  6166. var _local4:int;
  6167. var _local5:MovieClip;
  6168. var _local6:int;
  6169. var _local7:Object;
  6170. var _local8:Array;
  6171. var _local9:Boolean;
  6172. var _local10:Boolean;
  6173. var _local11:String;
  6174. var _local12:*;
  6175. var _local13:*;
  6176. _local2 = null;
  6177. _local3 = 0;
  6178. _local4 = 0;
  6179. _local5 = null;
  6180. _local6 = 0;
  6181. _local7 = null;
  6182. _local8 = [];
  6183. _local9 = true;
  6184. _local10 = false;
  6185. if (((((!((_arg1 == null))) && (!((_arg1.range == null))))) && ((_arg1.range == false)))){
  6186. _local9 = false;
  6187. };
  6188. if (_arg1 != null){
  6189. _local8 = [_arg1.unm];
  6190. }
  6191. else {
  6192. _local10 = true;
  6193. _local8 = this.partyMembers;
  6194. };
  6195. if (_local8.length > 0){
  6196. _local11 = "";
  6197. if (_arg1 == null){
  6198. _local12 = [];
  6199. _local6 = 0;
  6200. _local6 = 0;
  6201. while (_local6 < this.rootClass.ui.mcPartyFrame.numChildren) {
  6202. _local12.push(MovieClip(this.rootClass.ui.mcPartyFrame.getChildAt(_local6)));
  6203. _local6++;
  6204. };
  6205. _local6 = 0;
  6206. _local6 = 0;
  6207. while (_local6 < _local12.length) {
  6208. _local2 = _local12[_local6];
  6209. _local13 = _local2.strName.text;
  6210. if (this.partyMembers.indexOf(_local13) == -1){
  6211. _local2.removeEventListener(MouseEvent.CLICK, this.onPartyPanelClick);
  6212. this.rootClass.ui.mcPartyFrame.removeChild(_local2);
  6213. };
  6214. _local6++;
  6215. };
  6216. };
  6217. _local6 = 0;
  6218. while (_local6 < _local8.length) {
  6219. _local11 = _local8[_local6];
  6220. _local2 = this.getPartyPanelByName(_local11);
  6221. _local7 = this.uoTree[_local11.toLowerCase()];
  6222. if (_local7 == null){
  6223. _local2.HP.visible = false;
  6224. _local2.MP.visible = false;
  6225. _local2.txtRange.visible = true;
  6226. }
  6227. else {
  6228. if (_local9){
  6229. _local3 = _local7.intHP;
  6230. _local4 = _local7.intHPMax;
  6231. _local5 = _local2.HP;
  6232. if (_local3 >= 0){
  6233. _local5.strIntHP.text = (_local5.strIntHPs.text = String(_local7.intHP));
  6234. }
  6235. else {
  6236. _local5.strIntHP.text = (_local5.strIntHPs.text = "X");
  6237. };
  6238. if (_local3 < 0){
  6239. _local3 = 0;
  6240. };
  6241. _local5.intHPbar.x = -((_local5.intHPbar.width * (1 - (_local3 / _local4))));
  6242. _local3 = _local7.intMP;
  6243. _local4 = _local7.intMPMax;
  6244. _local5 = _local2.MP;
  6245. if (_local3 >= 0){
  6246. _local5.strIntMP.text = (_local5.strIntMPs.text = String(_local7.intMP));
  6247. }
  6248. else {
  6249. _local5.strIntMP.text = (_local5.strIntMPs.text = "X");
  6250. };
  6251. if (_local3 < 0){
  6252. _local3 = 0;
  6253. };
  6254. _local5.intMPbar.x = -((_local5.intMPbar.width * (1 - (_local3 / _local4))));
  6255. _local2.HP.visible = true;
  6256. _local2.MP.visible = true;
  6257. _local2.txtRange.visible = false;
  6258. }
  6259. else {
  6260. _local2.HP.visible = false;
  6261. _local2.MP.visible = false;
  6262. _local2.txtRange.visible = true;
  6263. };
  6264. };
  6265. if (_local10){
  6266. _local2.y = int(((_local2.height + 2) * _local6));
  6267. };
  6268. _local2.partyLead.visible = (_local11.toLowerCase() == this.partyOwner.toLowerCase());
  6269. _local6++;
  6270. };
  6271. }
  6272. else {
  6273. _local6 = 0;
  6274. while ((((this.rootClass.ui.mcPartyFrame.numChildren > 0)) && ((_local6 < 10)))) {
  6275. _local2 = MovieClip(this.rootClass.ui.mcPartyFrame.getChildAt(0));
  6276. _local2.removeEventListener(MouseEvent.CLICK, this.onPartyPanelClick);
  6277. this.rootClass.ui.mcPartyFrame.removeChildAt(0);
  6278. _local6++;
  6279. };
  6280. };
  6281. this.rootClass.ui.mcPortrait.partyLead.visible = (this.partyOwner.toLowerCase() == this.rootClass.sfc.myUserName);
  6282. }
  6283.  
  6284. public function createPartyPanel(_arg1:Object):MovieClip{
  6285. var _local3:*;
  6286. var _local2:* = (this.rootClass.ui.mcPartyFrame.numChildren + 1);
  6287. _local3 = MovieClip(this.rootClass.ui.mcPartyFrame.addChild(new PartyPanel()));
  6288. _local3.strName.text = _arg1.unm;
  6289. _local3.HP.visible = false;
  6290. _local3.MP.visible = false;
  6291. _local3.txtRange.visible = false;
  6292. _local3.addEventListener(MouseEvent.CLICK, this.onPartyPanelClick, false, 0, true);
  6293. _local3.buttonMode = true;
  6294. return (_local3);
  6295. }
  6296.  
  6297. public function getPartyPanelByName(_arg1:String):MovieClip{
  6298. var _local2:*;
  6299. var _local3:MovieClip;
  6300. var _local4:int;
  6301. _local2 = this.rootClass.ui.mcPartyFrame.numChildren;
  6302. _local3 = null;
  6303. _local4 = 0;
  6304. while (_local4 < _local2) {
  6305. _local3 = MovieClip(this.rootClass.ui.mcPartyFrame.getChildAt(_local4));
  6306. if (_local3.strName.text == _arg1){
  6307. return (_local3);
  6308. };
  6309. _local4++;
  6310. };
  6311. return (this.createPartyPanel({unm:_arg1}));
  6312. }
  6313.  
  6314. public function onPartyPanelClick(_arg1:MouseEvent):void{
  6315. var _local2:*;
  6316. var _local3:*;
  6317. var _local4:Avatar;
  6318. _local2 = MovieClip(_arg1.currentTarget);
  6319. _local3 = {};
  6320. _local3.strUsername = _local2.strName.text;
  6321. if (_arg1.shiftKey){
  6322. _local4 = this.getAvatarByUserName(_local3.strUsername.toLowerCase());
  6323. if (((((((!((_local4 == null))) && (!((_local4.pMC == null))))) && (!((_local4.dataLeaf == null))))) && ((_local4.dataLeaf.strFrame == this.myAvatar.dataLeaf.strFrame)))){
  6324. this.setTarget(_local4);
  6325. };
  6326. }
  6327. else {
  6328. this.rootClass.ui.cMenu.fOpenWith("party", _local3);
  6329. };
  6330. }
  6331.  
  6332. public function partyInvite(_arg1:String):void{
  6333. this.rootClass.sfc.sendXtMessage("zm", "gp", ["pi", _arg1], "str", 1);
  6334. }
  6335.  
  6336. public function partyKick(_arg1:String):void{
  6337. this.rootClass.sfc.sendXtMessage("zm", "gp", ["pk", _arg1], "str", 1);
  6338. }
  6339.  
  6340. public function partyLeave():void{
  6341. this.rootClass.sfc.sendXtMessage("zm", "gp", ["pl"], "str", 1);
  6342. }
  6343.  
  6344. public function partySummon(_arg1:String):void{
  6345. this.rootClass.sfc.sendXtMessage("zm", "gp", ["ps", _arg1], "str", 1);
  6346. }
  6347.  
  6348. public function acceptPartySummon(_arg1:Object):void{
  6349. if (_arg1.accept){
  6350. this.rootClass.sfc.sendXtMessage("zm", "gp", ["psa"], "str", 1);
  6351. if (_arg1.strF == null){
  6352. this.rootClass.sfc.sendXtMessage("zm", "cmd", ["goto", _arg1.unm], "str", 1);
  6353. }
  6354. else {
  6355. this.moveToCell(_arg1.strF, _arg1.strP);
  6356. };
  6357. }
  6358. else {
  6359. this.rootClass.sfc.sendXtMessage("zm", "gp", ["psd", _arg1.unm], "str", 1);
  6360. };
  6361. }
  6362.  
  6363. public function partyUpdate(_arg1:String, _arg2:String):void{
  6364. }
  6365.  
  6366. public function partyPromote(_arg1:String):void{
  6367. this.rootClass.sfc.sendXtMessage("zm", "gp", ["pp", _arg1], "str", 1);
  6368. }
  6369.  
  6370. public function goto(_arg1){
  6371. var _local2:*;
  6372. var _local3:*;
  6373. _arg1 = _arg1.toLowerCase();
  6374. _local2 = this.uoTree[this.rootClass.sfc.myUserName];
  6375. _local3 = this.uoTree[String(_arg1).toLowerCase()];
  6376. if ((((_local2.intState == 1)) && ((((_local2.pvpTeam == null)) || ((_local2.pvpTeam == -1)))))){
  6377. if (((!((_local3 == null))) && (!((_local2.uoName == _local3.uoName))))){
  6378. if (((("nogoto" in this.map)) && (this.map.nogoto))){
  6379. this.rootClass.chatF.pushMsg("warning", "/goto can't target players within this map.", "SERVER", "", 0);
  6380. return;
  6381. };
  6382. if (_local2.strFrame != _local3.strFrame){
  6383. this.moveToCell(_local3.strFrame, _local3.strPad);
  6384. };
  6385. }
  6386. else {
  6387. this.rootClass.sfc.sendXtMessage("zm", "cmd", ["goto", _arg1], "str", 1);
  6388. };
  6389. };
  6390. }
  6391.  
  6392. public function pull(_arg1){
  6393. _arg1 = _arg1.toLowerCase();
  6394. this.rootClass.sfc.sendXtMessage("zm", "cmd", ["pull", _arg1], "str", 1);
  6395. }
  6396.  
  6397. public function requestFriend(_arg1:String):void{
  6398. this.rootClass.sfc.sendXtMessage("zm", "requestFriend", [_arg1], "str", 1);
  6399. }
  6400.  
  6401. public function addFriend(_arg1:Object):void{
  6402. if (_arg1.accept){
  6403. this.rootClass.sfc.sendXtMessage("zm", "addFriend", [_arg1.unm], "str", 1);
  6404. }
  6405. else {
  6406. this.rootClass.sfc.sendXtMessage("zm", "declineFriend", [_arg1.unm], "str", 1);
  6407. };
  6408. }
  6409.  
  6410. public function deleteFriend(_arg1:int, _arg2):void{
  6411. this.rootClass.sfc.sendXtMessage("zm", "deleteFriend", [_arg1, _arg2], "str", 1);
  6412. }
  6413.  
  6414. public function guildInvite(_arg1:String):void{
  6415. this.rootClass.sfc.sendXtMessage("zm", "guild", ["gi", _arg1], "str", 1);
  6416. }
  6417.  
  6418. public function guildRemove(_arg1:Object):void{
  6419. if (_arg1.accept){
  6420. this.rootClass.sfc.sendXtMessage("zm", "guild", ["gr", _arg1.userName], "str", 1);
  6421. };
  6422. }
  6423.  
  6424. public function guildPromote(_arg1:String):void{
  6425. this.rootClass.sfc.sendXtMessage("zm", "guild", ["gp", _arg1], "str", 1);
  6426. }
  6427.  
  6428. public function guildDemote(_arg1:String):void{
  6429. this.rootClass.sfc.sendXtMessage("zm", "guild", ["gd", _arg1], "str", 1);
  6430. }
  6431.  
  6432. public function doGuildAccept(_arg1:Object):void{
  6433. if (_arg1.accept){
  6434. this.rootClass.sfc.sendXtMessage("zm", "guild", ["ga", _arg1.guildID, _arg1.owner], "str", 1);
  6435. }
  6436. else {
  6437. this.rootClass.sfc.sendXtMessage("zm", "guild", ["gdi", _arg1.guildID, _arg1.owner], "str", 1);
  6438. };
  6439. }
  6440.  
  6441. public function setGuildMOTD(_arg1:String):void{
  6442. this.rootClass.sfc.sendXtMessage("zm", "guild", ["motd", _arg1], "str", 1);
  6443. }
  6444.  
  6445. public function createGuild(_arg1:Object):void{
  6446. if (_arg1.accept){
  6447. this.rootClass.sfc.sendXtMessage("zm", "guild", ["gc", _arg1.guildName], "str", 1);
  6448. };
  6449. }
  6450.  
  6451. public function addMemSlots(_arg1:int):void{
  6452. this.rootClass.sfc.sendXtMessage("zm", "guild", ["slots", _arg1], "str", 1);
  6453. }
  6454.  
  6455. public function renameGuild(_arg1:Object):void{
  6456. if (_arg1.accept){
  6457. this.rootClass.sfc.sendXtMessage("zm", "guild", ["rename", _arg1.guildName], "str", 1);
  6458. };
  6459. }
  6460.  
  6461. public function requestPVPQueue(_arg1:String, _arg2:int=-1):void{
  6462. this.rootClass.sfc.sendXtMessage("zm", "PVPQr", [_arg1, _arg2], "str", this.rootClass.world.curRoom);
  6463. }
  6464.  
  6465. public function handlePVPQueue(_arg1:Object):void{
  6466. var _local2:MovieClip;
  6467. if (_arg1.bitSuccess == 1){
  6468. this.PVPQueue.warzone = _arg1.warzone;
  6469. this.PVPQueue.ts = new Date().getTime();
  6470. this.PVPQueue.avgWait = _arg1.avgWait;
  6471. this.rootClass.showMCPVPQueue();
  6472. }
  6473. else {
  6474. this.PVPQueue.warzone = "";
  6475. this.PVPQueue.ts = -1;
  6476. this.PVPQueue.avgWait = -1;
  6477. this.rootClass.hideMCPVPQueue();
  6478. };
  6479. _local2 = this.rootClass.ui.mcPopup;
  6480. if ((((_local2.currentLabel == "PVPPanel")) && (!((_local2.mcPVPPanel == null))))){
  6481. _local2.mcPVPPanel.updateBody();
  6482. };
  6483. this.rootClass.closeModalByStrBody("A new Warzone battle has started!");
  6484. }
  6485.  
  6486. public function updatePVPAvgWait(_arg1:int):void{
  6487. this.PVPQueue.avgWait = _arg1;
  6488. }
  6489.  
  6490. public function duelExpire(){
  6491. this.rootClass.closeModalByStrBody("has challenged you to a duel.");
  6492. }
  6493.  
  6494. public function receivePVPInvite(_arg1:Object){
  6495. var _local2:*;
  6496. var _local3:*;
  6497. var _local4:*;
  6498. _local2 = new ModalMC();
  6499. _local3 = {};
  6500. _local4 = this.getWarzoneByWarzoneName(_arg1.warzone);
  6501. _local3.strBody = (("A new Warzone battle has started! Will you join " + _local4.nam) + "?");
  6502. _local3.greedy = true;
  6503. _local3.params = {};
  6504. _local3.callback = this.replyToPVPInvite;
  6505. this.rootClass.ui.ModalStack.addChild(_local2);
  6506. this.rootClass.ui.mcPopup.onClose();
  6507. this.rootClass.hideMCPVPQueue();
  6508. _local2.init(_local3);
  6509. }
  6510.  
  6511. public function replyToPVPInvite(_arg1:Object):void{
  6512. if (_arg1.accept){
  6513. this.sendPVPInviteAccept();
  6514. }
  6515. else {
  6516. this.sendPVPInviteDecline();
  6517. };
  6518. }
  6519.  
  6520. public function sendPVPInviteAccept():void{
  6521. this.rootClass.sfc.sendXtMessage("zm", "PVPIr", ["1"], "str", this.rootClass.world.curRoom);
  6522. }
  6523.  
  6524. public function sendPVPInviteDecline():void{
  6525. this.rootClass.sfc.sendXtMessage("zm", "PVPIr", ["0"], "str", this.rootClass.world.curRoom);
  6526. }
  6527.  
  6528. public function sendDuelInvite(_arg1:String):void{
  6529. this.rootClass.sfc.sendXtMessage("zm", "duel", [_arg1], "str", 1);
  6530. }
  6531.  
  6532. public function doDuelAccept(_arg1:Object):void{
  6533. if (_arg1.accept){
  6534. this.rootClass.sfc.sendXtMessage("zm", "da", [_arg1.unm], "str", 1);
  6535. }
  6536. else {
  6537. this.rootClass.sfc.sendXtMessage("zm", "dd", [_arg1.unm], "str", 1);
  6538. };
  6539. }
  6540.  
  6541. public function getWarzoneByName(_arg1:String){
  6542. var _local2:int;
  6543. _local2 = 0;
  6544. while (_local2 < this.PVPMaps.length) {
  6545. if (this.PVPMaps[_local2].nam == _arg1){
  6546. return (this.PVPMaps[_local2]);
  6547. };
  6548. _local2++;
  6549. };
  6550. return (null);
  6551. }
  6552.  
  6553. public function getWarzoneByWarzoneName(_arg1:String){
  6554. var _local2:int;
  6555. _local2 = 0;
  6556. while (_local2 < this.PVPMaps.length) {
  6557. if (this.PVPMaps[_local2].warzone == _arg1){
  6558. return (this.PVPMaps[_local2]);
  6559. };
  6560. _local2++;
  6561. };
  6562. return (null);
  6563. }
  6564.  
  6565. public function setPVPFactionData(_arg1:Array):void{
  6566. if (_arg1 != null){
  6567. this.PVPFactions = _arg1;
  6568. }
  6569. else {
  6570. this.PVPFactions = [];
  6571. };
  6572. }
  6573.  
  6574. public function attachMovieFront(_arg1):MovieClip{
  6575. var _local2:MovieClip;
  6576. var _local3:Class;
  6577. var _local4:*;
  6578. var _local5:*;
  6579. _local3 = (this.ldr_map.contentLoaderInfo.applicationDomain.getDefinition(_arg1) as Class);
  6580. _local4 = true;
  6581. if (this.FG.numChildren){
  6582. _local2 = MovieClip(this.FG.getChildAt(0));
  6583. _local5 = (_local2.constructor as Class);
  6584. if (_local5 == _local3){
  6585. _local4 = false;
  6586. };
  6587. };
  6588. if (_local4){
  6589. this.removeMovieFront();
  6590. _local2 = MovieClip(this.FG.addChild(new (_local3)()));
  6591. this.FG.mouseChildren = true;
  6592. };
  6593. return (_local2);
  6594. }
  6595.  
  6596. public function removeMovieFront(){
  6597. var _local1:int;
  6598. _local1 = 0;
  6599. while ((((this.FG.numChildren > 0)) && ((_local1 < 100)))) {
  6600. _local1++;
  6601. this.FG.removeChildAt(0);
  6602. };
  6603. this.rootClass.ldrMC.closeHistory();
  6604. this.rootClass.stage.focus = null;
  6605. }
  6606.  
  6607. public function getMovieFront(){
  6608. if ((((this.FG.numChildren > 0)) && (!((this.FG.getChildAt(0) == null))))){
  6609. return (this.FG.getChildAt(0));
  6610. };
  6611. return (null);
  6612. }
  6613.  
  6614. public function isMovieFront(_arg1:String):Boolean{
  6615. var _local2:MovieClip;
  6616. var _local3:Class;
  6617. var _local4:*;
  6618. var _local5:*;
  6619. _local3 = (this.ldr_map.contentLoaderInfo.applicationDomain.getDefinition(_arg1) as Class);
  6620. _local4 = false;
  6621. if (this.FG.numChildren){
  6622. _local2 = MovieClip(this.FG.getChildAt(0));
  6623. _local5 = (_local2.constructor as Class);
  6624. if (_local5 == _local3){
  6625. _local4 = true;
  6626. };
  6627. };
  6628. return (_local4);
  6629. }
  6630.  
  6631. public function loadMovieFront(_arg1:String, _arg2:String="Game Files"):void{
  6632. this.removeMovieFront();
  6633. this.rootClass.ldrMC.loadFile(this.FG, (this.rootClass.sFilePath + _arg1), _arg2);
  6634. }
  6635.  
  6636. public function showPreL(){
  6637. if ((((this.preLMC == null)) || (!(MovieClip(this).contains(this.preLMC))))){
  6638. this.preLMC = new PreL();
  6639. addChild(this.preLMC);
  6640. this.preLMC.x = ((960 / 2) - (this.preLMC.width / 2));
  6641. this.preLMC.y = ((550 / 2) - (this.preLMC.height / 2));
  6642. };
  6643. }
  6644.  
  6645. public function toggleFPS():void{
  6646. this.rootClass.ui.mcFPS.visible = !(this.rootClass.ui.mcFPS.visible);
  6647. }
  6648.  
  6649. public function toggleStatUp():void{
  6650. this.rootClass.ui.mcSkillUp.visible = !(this.rootClass.ui.mcSkillUp.visible);
  6651. this.rootClass.ui.mcSkillUp.gotoAndPlay("In");
  6652. }
  6653.  
  6654. private function calculateFPS():void{
  6655. var _local1:Number;
  6656. var _local2:int;
  6657. var _local3:int;
  6658. var _local4:*;
  6659. var _local5:Number;
  6660. var _local6:int;
  6661. var _local7:Number;
  6662. var _local8:int;
  6663. try {
  6664. if (this.fpsTS != 0){
  6665. _local1 = new Date().getTime();
  6666. _local2 = (_local1 - this.fpsTS);
  6667. _local3 = 0;
  6668. if (this.ticklist.length == this.TICK_MAX){
  6669. _local3 = this.ticklist.shift();
  6670. };
  6671. this.ticklist.push(_local2);
  6672. this.ticksum = ((this.ticksum + _local2) - _local3);
  6673. _local4 = (1000 / (this.ticksum / this.ticklist.length));
  6674. if (this.rootClass.ui.mcFPS.visible){
  6675. this.rootClass.ui.mcFPS.txtFPS.text = _local4.toPrecision(4);
  6676. };
  6677. if ((((((this.rootClass.userPreference.data.quality == "AUTO")) && ((this.ticklist.length == this.TICK_MAX)))) && (((++this.fpsQualityCounter % 24) == 0)))){
  6678. this.fpsArrayQuality.push(_local4);
  6679. if (this.fpsArrayQuality.length == 5){
  6680. _local5 = 0;
  6681. _local6 = 0;
  6682. while (_local6 < this.fpsArrayQuality.length) {
  6683. _local5 = (_local5 + this.fpsArrayQuality[_local6]);
  6684. _local6++;
  6685. };
  6686. _local7 = (_local5 / this.fpsArrayQuality.length);
  6687. _local8 = this.arrQuality.indexOf(this.rootClass.stage.quality);
  6688. if ((((_local7 < 12)) && ((_local8 > 0)))){
  6689. this.rootClass.stage.quality = this.arrQuality[(_local8 - 1)];
  6690. };
  6691. if ((((_local7 >= 12)) && ((_local8 < 2)))){
  6692. this.rootClass.stage.quality = this.arrQuality[(_local8 + 1)];
  6693. };
  6694. this.fpsArrayQuality = new Array();
  6695. };
  6696. };
  6697. };
  6698. this.fpsTS = new Date().getTime();
  6699. }
  6700. catch(e) {
  6701. };
  6702. }
  6703.  
  6704. public function onZmanagerEnterFrame(_arg1:Event){
  6705. var _local2:MovieClip;
  6706. var _local3:int;
  6707. var _local4:int;
  6708. var _local5:int;
  6709. var _local6:Number;
  6710. this.calculateFPS();
  6711. this.zSortArr = [];
  6712. _local3 = 0;
  6713. while (_local3 < this.CHARS.numChildren) {
  6714. _local2 = MovieClip(this.CHARS.getChildAt(_local3));
  6715. this.zSortArr.push({
  6716. mc:_local2,
  6717. oy:_local2.y
  6718. });
  6719. _local3++;
  6720. };
  6721. this.zSortArr.sortOn("oy", Array.NUMERIC);
  6722. _local4 = 0;
  6723. while (_local4 < this.zSortArr.length) {
  6724. _local2 = this.zSortArr[_local4].mc;
  6725. _local5 = this.CHARS.getChildIndex(_local2);
  6726. if (_local5 != _local4){
  6727. this.CHARS.swapChildrenAt(_local5, _local4);
  6728. };
  6729. _local4++;
  6730. };
  6731. if (this.EFAO.xpc++ > this.EFAO.xpn){
  6732. this.EFAO.xpc = 0;
  6733. try {
  6734. if (this.rootClass.stage == null){
  6735. this.killTimers();
  6736. this.killListeners();
  6737. return;
  6738. };
  6739. _local6 = new Date().getTime();
  6740. /*
  6741. if (((!((this.rootClass.stage == null))) && (!((this.myAvatar.objData.aura.dur == null))))){
  6742. if ((this.rootClass.ui.mcStatus.iconStun.boostTS + (this.rootClass.ui.mcStatus.iconStun.aura.dur * 1000)) < (_local6 + 1000)){
  6743. this.rootClass.sfc.sendXtMessage("zm", "serverUseItem", ["-", "xpboost"], "str", -1);
  6744. };
  6745. };
  6746. */
  6747. if (((!((this.rootClass.stage == null))) && (!((this.myAvatar.objData.iBoostXP == null))))){
  6748. if ((this.rootClass.ui.mcPortrait.iconBoostXP.boostTS + (this.rootClass.ui.mcPortrait.iconBoostXP.iBoostXP * 1000)) < (_local6 + 1000)){
  6749. this.rootClass.sfc.sendXtMessage("zm", "serverUseItem", ["-", "xpboost"], "str", -1);
  6750. };
  6751. };
  6752. if (((!((this.rootClass.stage == null))) && (!((this.myAvatar.objData.iBoostG == null))))){
  6753. if ((this.rootClass.ui.mcPortrait.iconBoostG.boostTS + (this.rootClass.ui.mcPortrait.iconBoostG.iBoostG * 1000)) < (_local6 + 1000)){
  6754. this.rootClass.sfc.sendXtMessage("zm", "serverUseItem", ["-", "gboost"], "str", -1);
  6755. };
  6756. };
  6757. if (((!((this.rootClass.stage == null))) && (!((this.myAvatar.objData.iBoostRep == null))))){
  6758. if ((this.rootClass.ui.mcPortrait.iconBoostRep.boostTS + (this.rootClass.ui.mcPortrait.iconBoostRep.iBoostRep * 1000)) < (_local6 + 1000)){
  6759. this.rootClass.sfc.sendXtMessage("zm", "serverUseItem", ["-", "repboost"], "str", -1);
  6760. };
  6761. };
  6762. if (((!((this.rootClass.stage == null))) && (!((this.myAvatar.objData.iBoostCP == null))))){
  6763. if ((this.rootClass.ui.mcPortrait.iconBoostCP.boostTS + (this.rootClass.ui.mcPortrait.iconBoostCP.iBoostCP * 1000)) < (_local6 + 1000)){
  6764. this.rootClass.sfc.sendXtMessage("zm", "serverUseItem", ["-", "cpboost"], "str", -1);
  6765. };
  6766. };
  6767. }
  6768. catch(e:Error) {
  6769. };
  6770. };
  6771. }
  6772.  
  6773. public function iaTrigger(_arg1:MovieClip){
  6774. var _local2:*;
  6775. if (this.coolDown("doIA")){
  6776. _local2 = [];
  6777. _local2.push(_arg1.iaType);
  6778. _local2.push(_arg1.name);
  6779. if (("iaPathMC" in _arg1)){
  6780. _local2.push(this.myAvatar.dataLeaf.strFrame);
  6781. }
  6782. else {
  6783. _local2.push(_arg1.iaFrame);
  6784. };
  6785. if (("iaStr" in _arg1)){
  6786. _local2.push(_arg1.iaStr);
  6787. };
  6788. if (("iaPathMC" in _arg1)){
  6789. _local2.push(_arg1.iaPathMC);
  6790. };
  6791. this.rootClass.sfc.sendXtMessage("zm", "ia", _local2, "str", 1);
  6792. };
  6793. }
  6794.  
  6795. public function actCastRequest(_arg1:Object):void{
  6796. var _local2:Array;
  6797. var _local3:Array;
  6798. var _local4:Object;
  6799. _local2 = ["castr"];
  6800. _local3 = [];
  6801. switch (_arg1.typ){
  6802. case "sia":
  6803. if (this.coolDown("doIA")){
  6804. _local4 = {};
  6805. _local4.typ = "sia";
  6806. _local4.callback = this.actCastTrigger;
  6807. _local4.args = _arg1;
  6808. _local4.dur = Number(_arg1.sAccessCD);
  6809. _local4.txt = _arg1.sMsg;
  6810. this.rootClass.ui.mcCastBar.fOpenWith(_local4);
  6811. _local3.push(1);
  6812. _local3.push(_arg1.ID);
  6813. };
  6814. break;
  6815. };
  6816. if (_local3.length > 0){
  6817. this.rootClass.sfc.sendXtMessage("zm", _local2, _local3, "str", 1);
  6818. };
  6819. }
  6820.  
  6821. public function actCastTrigger(_arg1:Object):void{
  6822. switch (_arg1.typ){
  6823. case "sia":
  6824. this.siaTrigger(_arg1);
  6825. return;
  6826. };
  6827. }
  6828.  
  6829. public function siaTrigger(_arg1:Object):void{
  6830. this.rootClass.sfc.sendXtMessage("zm", ["castt"], [], "str", 1);
  6831. }
  6832.  
  6833. public function uoTreeLeaf(_arg1):Object{
  6834. if (this.uoTree[_arg1.toLowerCase()] == null){
  6835. this.uoTree[_arg1.toLowerCase()] = {};
  6836. };
  6837. return (this.uoTree[_arg1.toLowerCase()]);
  6838. }
  6839.  
  6840. public function myLeaf():Object{
  6841. return (this.uoTreeLeaf(this.rootClass.sfc.myUserName));
  6842. }
  6843.  
  6844. public function uoTreeLeafSet(_arg1, _arg2:Object){
  6845. var _local3:*;
  6846. var _local4:*;
  6847. var _local5:*;
  6848. var _local6:*;
  6849. if (this.uoTree[_arg1.toLowerCase()] == null){
  6850. this.uoTree[_arg1.toLowerCase()] = {};
  6851. };
  6852. _local3 = this.uoTree[_arg1.toLowerCase()];
  6853. _local4 = [];
  6854. for (_local5 in _arg2) {
  6855. _local3[_local5] = _arg2[_local5];
  6856. _local6 = this.getAvatarByUserName(_arg1);
  6857. if (((!((_local6 == null))) && (!((_local6.objData == null))))){
  6858. _local6.objData[_local5] = _arg2[_local5];
  6859. };
  6860. _local4.push(((_local5 + ":") + String(_arg2[_local5])));
  6861. };
  6862. }
  6863.  
  6864. public function manageAreaUser(_arg1:String, _arg2:String):void{
  6865. var _local3:int;
  6866. _arg1 = _arg1.toLowerCase();
  6867. if (_arg2 == "+"){
  6868. if (this.areaUsers.indexOf(_arg1) == -1){
  6869. this.areaUsers.push(_arg1);
  6870. };
  6871. }
  6872. else {
  6873. _local3 = this.areaUsers.indexOf(_arg1);
  6874. if (_local3 > -1){
  6875. this.areaUsers.splice(_local3, 1);
  6876. };
  6877. };
  6878. this.rootClass.updateAreaName();
  6879. }
  6880.  
  6881. public function updateAreaUserCount():void{
  6882. }
  6883.  
  6884. public function coolDown(_arg1:String):Boolean{
  6885. var _local2:*;
  6886. var _local3:*;
  6887. var _local4:*;
  6888. var _local5:*;
  6889. _local2 = this.lock[_arg1];
  6890. _local3 = new Date();
  6891. _local4 = _local3.getTime();
  6892. _local5 = (_local4 - _local2.ts);
  6893. if (_local5 < _local2.cd){
  6894. this.rootClass.chatF.pushMsg("warning", "Action taken too quickly, try again in a moment.", "SERVER", "", 0);
  6895. return (false);
  6896. };
  6897. _local2.ts = _local4;
  6898. return (true);
  6899. }
  6900.  
  6901. public function copyAvatarMC(_arg1:MovieClip):void{
  6902. var _local2:AvatarMCCopier;
  6903. _local2 = new AvatarMCCopier(this);
  6904. _local2.copyTo(_arg1);
  6905. }
  6906.  
  6907. public function get Scale():Number{
  6908. return (this.SCALE);
  6909. }
  6910.  
  6911.  
  6912. }
  6913. }//package
Add Comment
Please, Sign In to add comment