mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-20 09:37:50 -05:00
Brought up to date with the private repository (feea4c7)
This commit is contained in:
1 parent
1aa738d692
commit
1b1df1ae48
7925 files changed
+2617237
-20
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,40 @@
|
||||
package quest
|
||||
{
|
||||
import flash.events.Event;
|
||||
|
||||
public class QuestEvent extends Event
|
||||
{
|
||||
|
||||
public static const LOAD_SFX:String = "QuestEventLoadSfx";
|
||||
|
||||
public static const PLAY_SFX:String = "QuestEventPlaySfx";
|
||||
|
||||
public static const TORCH:String = "QuestEventTorch";
|
||||
|
||||
public static const TRIGGER_CAMERASHAKE:String = "QuestEventTriggerCameraShake";
|
||||
|
||||
private var _secondaryType:String;
|
||||
|
||||
public function QuestEvent(param1:String, param2:String = "")
|
||||
{
|
||||
super(param1,true,false);
|
||||
this._secondaryType = param2;
|
||||
}
|
||||
|
||||
override public function clone() : Event
|
||||
{
|
||||
return new QuestEvent(type);
|
||||
}
|
||||
|
||||
override public function toString() : String
|
||||
{
|
||||
return formatToString("QuestEvent",type,this._secondaryType);
|
||||
}
|
||||
|
||||
public function get secondaryType() : String
|
||||
{
|
||||
return this._secondaryType;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,31 @@
|
||||
package quest
|
||||
{
|
||||
import flash.utils.ByteArray;
|
||||
import mx.core.MovieClipLoaderAsset;
|
||||
|
||||
[Embed(source="/_assets/assets.swf", symbol="symbol6")]
|
||||
public class QuestManager_torch extends MovieClipLoaderAsset
|
||||
{
|
||||
|
||||
private static var bytes:ByteArray = null;
|
||||
|
||||
public var dataClass:Class = QuestManager_torch_dataClass;
|
||||
|
||||
public function QuestManager_torch()
|
||||
{
|
||||
super();
|
||||
initialWidth = 13880 / 20;
|
||||
initialHeight = 8000 / 20;
|
||||
}
|
||||
|
||||
override public function get movieClipData() : ByteArray
|
||||
{
|
||||
if(bytes == null)
|
||||
{
|
||||
bytes = ByteArray(new this.dataClass());
|
||||
}
|
||||
return bytes;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package quest
|
||||
{
|
||||
import mx.core.ByteArrayAsset;
|
||||
|
||||
[Embed(source="/_assets/11_quest.QuestManager_torch_dataClass.bin", mimeType="application/octet-stream")]
|
||||
public class QuestManager_torch_dataClass extends ByteArrayAsset
|
||||
{
|
||||
|
||||
public function QuestManager_torch_dataClass()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,247 @@
|
||||
package quest
|
||||
{
|
||||
import avatar.AvatarManager;
|
||||
import avatar.AvatarView;
|
||||
import avatar.AvatarWorldView;
|
||||
import com.sbi.graphics.PaletteHelper;
|
||||
import flash.display.MovieClip;
|
||||
import flash.display.Sprite;
|
||||
import flash.geom.Point;
|
||||
import item.ItemXtCommManager;
|
||||
import loader.MediaHelper;
|
||||
|
||||
public class QuestMelee extends Sprite
|
||||
{
|
||||
|
||||
private var _weaponItem:Object;
|
||||
|
||||
private var _npc:QuestActor;
|
||||
|
||||
private var _mediaHelperObj:MediaHelper;
|
||||
|
||||
private var _swipeMC:MovieClip;
|
||||
|
||||
private var _localPlayerLaunched:Boolean;
|
||||
|
||||
private var _angle:Number;
|
||||
|
||||
private var _timer:Number;
|
||||
|
||||
private var _meleeID:int;
|
||||
|
||||
private var _players:Array;
|
||||
|
||||
private var _color:uint;
|
||||
|
||||
public function QuestMelee(param1:int)
|
||||
{
|
||||
super();
|
||||
this._meleeID = param1;
|
||||
}
|
||||
|
||||
public function get angle() : Number
|
||||
{
|
||||
return this._angle;
|
||||
}
|
||||
|
||||
public function destroy() : void
|
||||
{
|
||||
if(this._mediaHelperObj != null)
|
||||
{
|
||||
this._mediaHelperObj.destroy();
|
||||
this._mediaHelperObj = null;
|
||||
}
|
||||
if(parent != null)
|
||||
{
|
||||
parent.removeChild(this);
|
||||
}
|
||||
}
|
||||
|
||||
public function heartbeat(param1:Number) : Boolean
|
||||
{
|
||||
var _loc2_:Point = null;
|
||||
var _loc3_:Array = null;
|
||||
var _loc4_:QuestActor = null;
|
||||
var _loc5_:* = 0;
|
||||
var _loc6_:AvatarWorldView = null;
|
||||
var _loc7_:Number = NaN;
|
||||
var _loc8_:Number = NaN;
|
||||
if(this._timer > 0)
|
||||
{
|
||||
this._timer -= param1;
|
||||
if(this._timer <= 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if(this._swipeMC != null)
|
||||
{
|
||||
if(this._swipeMC.weaponDone)
|
||||
{
|
||||
this._timer = 2;
|
||||
}
|
||||
else if(this._swipeMC.hitActive)
|
||||
{
|
||||
_loc2_ = this._swipeMC.getCollisionPoint();
|
||||
_loc2_.x += x;
|
||||
_loc2_.y += y;
|
||||
if(this._npc != null)
|
||||
{
|
||||
if(this._players)
|
||||
{
|
||||
_loc5_ = int(this._players.length - 1);
|
||||
while(_loc5_ >= 0)
|
||||
{
|
||||
_loc6_ = AvatarManager.avatarViewList[this._players[_loc5_]];
|
||||
if(_loc6_ != null)
|
||||
{
|
||||
_loc7_ = _loc2_.x - (_loc6_.x + QuestManager.QUEST_PLAYER_AVATAR_OFFSETX);
|
||||
_loc8_ = _loc2_.y - (_loc6_.y + QuestManager.QUEST_PLAYER_AVATAR_OFFSETY);
|
||||
if(_loc7_ * _loc7_ + _loc8_ * _loc8_ < (this._swipeMC.radius + QuestManager.QUEST_PLAYER_AVATAR_RADIUS) * (this._swipeMC.radius + QuestManager.QUEST_PLAYER_AVATAR_RADIUS))
|
||||
{
|
||||
this.handleHit(null,_loc6_,this._localPlayerLaunched);
|
||||
this._players.splice(_loc5_,1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this._players.splice(_loc5_,1);
|
||||
}
|
||||
_loc5_--;
|
||||
}
|
||||
}
|
||||
_loc3_ = QuestManager.meleeRadiusCheck(this._meleeID,_loc2_,this._swipeMC.radius,true);
|
||||
if(_loc3_ != null)
|
||||
{
|
||||
for each(_loc4_ in _loc3_)
|
||||
{
|
||||
this.handleHit(_loc4_,null,true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc3_ = QuestManager.meleeRadiusCheck(this._meleeID,_loc2_,this._swipeMC.radius,false);
|
||||
if(_loc3_ != null)
|
||||
{
|
||||
for each(_loc4_ in _loc3_)
|
||||
{
|
||||
this.handleHit(_loc4_,null,this._localPlayerLaunched);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleHit(param1:QuestActor, param2:AvatarWorldView, param3:Boolean) : void
|
||||
{
|
||||
var _loc4_:Point = null;
|
||||
if(param1 != null)
|
||||
{
|
||||
param1.handleHit(param3,this._weaponItem.defId);
|
||||
_loc4_ = param1.actorOffset;
|
||||
_loc4_.x += param1.x - x;
|
||||
_loc4_.y += param1.y - y;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(param2 == AvatarManager.playerAvatarWorldView)
|
||||
{
|
||||
QuestXtCommManager.questActorAttacked("",this._weaponItem.defId,0,0);
|
||||
}
|
||||
_loc4_ = new Point(QuestManager.QUEST_PLAYER_AVATAR_OFFSETX,QuestManager.QUEST_PLAYER_AVATAR_OFFSETY);
|
||||
_loc4_.x += param2.x - x;
|
||||
_loc4_.y += param2.y - y;
|
||||
}
|
||||
var _loc5_:MediaHelper = new MediaHelper();
|
||||
_loc5_.init(this._weaponItem.attackMediaRefId,this.onEffectLoaded,_loc4_);
|
||||
}
|
||||
|
||||
public function swipe(param1:int, param2:uint, param3:Sprite, param4:int, param5:int, param6:QuestActor, param7:AvatarView) : Boolean
|
||||
{
|
||||
var _loc8_:Object = null;
|
||||
var _loc9_:Point = null;
|
||||
var _loc10_:Number = NaN;
|
||||
var _loc11_:Number = NaN;
|
||||
var _loc12_:Number = NaN;
|
||||
var _loc13_:Number = NaN;
|
||||
this._weaponItem = ItemXtCommManager.getItemDef(param1);
|
||||
this._color = param2;
|
||||
if(param6 == null)
|
||||
{
|
||||
if(param7 != null)
|
||||
{
|
||||
this._localPlayerLaunched = param7.userId == AvatarManager.playerSfsUserId;
|
||||
if(this._localPlayerLaunched)
|
||||
{
|
||||
QuestXtCommManager.sendQuestSwipe(this._weaponItem.defId,param4,param5,"",param7.userId,param2);
|
||||
}
|
||||
x = param7.x + QuestManager.QUEST_PLAYER_AVATAR_OFFSETX;
|
||||
y = param7.y + QuestManager.QUEST_PLAYER_AVATAR_OFFSETY;
|
||||
this._mediaHelperObj = new MediaHelper();
|
||||
this._mediaHelperObj.init(this._weaponItem.attackMediaRefId,this.onSwipeLoaded,this);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this._localPlayerLaunched = false;
|
||||
this._players = new Array();
|
||||
for(_loc8_ in AvatarManager.avatarViewList)
|
||||
{
|
||||
this._players.push(_loc8_);
|
||||
}
|
||||
_loc9_ = param6.actorOffset;
|
||||
this._npc = param6;
|
||||
x = this._npc.x + _loc9_.x;
|
||||
y = this._npc.y + _loc9_.y;
|
||||
this._mediaHelperObj = new MediaHelper();
|
||||
this._mediaHelperObj.init(this._weaponItem.attackMediaRefId,this.onSwipeLoaded,this);
|
||||
}
|
||||
if(this._mediaHelperObj != null)
|
||||
{
|
||||
_loc10_ = param4 - x;
|
||||
_loc11_ = param5 - y;
|
||||
if(_loc10_ == 0 && _loc11_ == 0)
|
||||
{
|
||||
_loc10_ = 1;
|
||||
}
|
||||
_loc12_ = Math.sqrt(_loc10_ * _loc10_ + _loc11_ * _loc11_);
|
||||
_loc10_ /= _loc12_;
|
||||
_loc11_ /= _loc12_;
|
||||
_loc13_ = Math.asin(_loc10_);
|
||||
if(_loc11_ > 0)
|
||||
{
|
||||
_loc13_ = -(Math.PI + _loc13_);
|
||||
}
|
||||
this._angle = _loc13_ * 180 / Math.PI;
|
||||
param3.addChild(this);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private function onEffectLoaded(param1:MovieClip) : void
|
||||
{
|
||||
param1.x = param1.passback.x;
|
||||
param1.y = param1.passback.y;
|
||||
param1.effect();
|
||||
addChild(param1);
|
||||
param1.mediaHelper.destroy();
|
||||
}
|
||||
|
||||
private function onSwipeLoaded(param1:MovieClip) : void
|
||||
{
|
||||
var _loc2_:Array = PaletteHelper.getRGBColors(this._color);
|
||||
var _loc3_:Array = new Array(new Array(_loc2_[0].r,_loc2_[0].g,_loc2_[0].b),new Array(_loc2_[1].r,_loc2_[1].g,_loc2_[1].b),new Array(_loc2_[2].r,_loc2_[2].g,_loc2_[2].b),new Array(_loc2_[3].r,_loc2_[3].g,_loc2_[3].b));
|
||||
param1.rgbColors = _loc3_;
|
||||
param1.setColors();
|
||||
addChild(param1);
|
||||
param1.strike(this._angle);
|
||||
this._swipeMC = param1;
|
||||
param1.mediaHelper.destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,568 @@
|
||||
package quest
|
||||
{
|
||||
import avatar.AvatarInfo;
|
||||
import avatar.AvatarManager;
|
||||
import avatar.AvatarWorldView;
|
||||
import avatar.NPCView;
|
||||
import flash.display.MovieClip;
|
||||
import flash.display.Sprite;
|
||||
import flash.events.Event;
|
||||
import flash.filters.GlowFilter;
|
||||
import flash.media.SoundChannel;
|
||||
import flash.text.TextField;
|
||||
import flash.text.TextFormat;
|
||||
import gskinner.motion.GTween;
|
||||
import gskinner.motion.easing.Linear;
|
||||
import loader.MediaHelper;
|
||||
|
||||
public class QuestPlayerData extends Sprite
|
||||
{
|
||||
|
||||
private var _levelUpHelperBottom:MediaHelper;
|
||||
|
||||
private var _levelUpHelperTop:MediaHelper;
|
||||
|
||||
private var _levelUpMCBottom:MovieClip;
|
||||
|
||||
private var _levelUpMCTop:MovieClip;
|
||||
|
||||
private var _levelUpLoaded:Boolean;
|
||||
|
||||
public var _avatarWorldView:AvatarWorldView;
|
||||
|
||||
private var _tintFrames:int;
|
||||
|
||||
private var _statusText:TextField;
|
||||
|
||||
private var _statusTextTween:GTween;
|
||||
|
||||
private var _healingTween:GTween;
|
||||
|
||||
private var _healingHeart:MovieClip;
|
||||
|
||||
private var _uID:int;
|
||||
|
||||
private var _itemEmoticonSound:SoundChannel;
|
||||
|
||||
private var _itemEmoticonSoundName:String;
|
||||
|
||||
private var _playerDamageMC:MovieClip;
|
||||
|
||||
private var _playerDamageMH:MediaHelper;
|
||||
|
||||
private var _pendingPlayerDamageMax:int;
|
||||
|
||||
private var _pendingPlayerDamageBefore:int;
|
||||
|
||||
private var _pendingPlayerDamageAfter:int;
|
||||
|
||||
private var _avSwitchedNPC:NPCView;
|
||||
|
||||
private var _avSwitchNPCID:int;
|
||||
|
||||
public function QuestPlayerData()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
private function updateAvatarStatus() : void
|
||||
{
|
||||
if(this._avatarWorldView == null)
|
||||
{
|
||||
this._avatarWorldView = AvatarManager.avatarViewList[this._uID];
|
||||
if(this._avatarWorldView)
|
||||
{
|
||||
this._avatarWorldView.addChild(this._statusText);
|
||||
this._avatarWorldView.addChild(this._healingHeart);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function init(param1:int) : void
|
||||
{
|
||||
this._uID = param1;
|
||||
this._avSwitchedNPC = null;
|
||||
this._statusText = new TextField();
|
||||
this._statusText.multiline = false;
|
||||
this._statusText.selectable = false;
|
||||
this._statusText.embedFonts = true;
|
||||
this._statusText.defaultTextFormat = new TextFormat("Tiki-Island",36,65280);
|
||||
this._statusText.filters = [new GlowFilter(0,1,3,3,10,2)];
|
||||
this._statusText.visible = false;
|
||||
this._healingHeart = GETDEFINITIONBYNAME("questHeartsCont");
|
||||
this._healingHeart.visible = false;
|
||||
this._pendingPlayerDamageMax = 0;
|
||||
this._playerDamageMH = new MediaHelper();
|
||||
this._playerDamageMH.init(2252,this.onPlayerDamageLoaded);
|
||||
this.updateAvatarStatus();
|
||||
}
|
||||
|
||||
private function playLevelUpEffect() : void
|
||||
{
|
||||
if(this._levelUpLoaded)
|
||||
{
|
||||
this._levelUpLoaded = false;
|
||||
if(Boolean(this._levelUpMCTop) && Boolean(this._levelUpMCBottom))
|
||||
{
|
||||
this._levelUpMCTop.gotoAndPlay("tintOn");
|
||||
this._levelUpMCTop.addEventListener(Event.ENTER_FRAME,this.levelUpEnterFrameHandler);
|
||||
this._levelUpMCBottom.gotoAndPlay("tintOn");
|
||||
this.updateAvatarStatus();
|
||||
if(this._avatarWorldView)
|
||||
{
|
||||
this._avatarWorldView.setBlendColor(4290903190,7534606);
|
||||
}
|
||||
QuestManager.playSound("ajq_stingerLevelUp");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this._levelUpLoaded = true;
|
||||
}
|
||||
}
|
||||
|
||||
public function playerDamaged(param1:int, param2:int, param3:int) : void
|
||||
{
|
||||
if(this._playerDamageMC != null && this._avatarWorldView != null)
|
||||
{
|
||||
if(this._playerDamageMC.parent != QuestManager._layerManager.room_chat)
|
||||
{
|
||||
this._pendingPlayerDamageMax = 0;
|
||||
this._playerDamageMC.x = this._avatarWorldView.x;
|
||||
this._playerDamageMC.y = this._avatarWorldView.y;
|
||||
QuestManager._layerManager.room_chat.addChild(this._playerDamageMC);
|
||||
this._playerDamageMC.hit(param1,param2,param3);
|
||||
this._playerDamageMC.addEventListener(Event.ENTER_FRAME,this.playerDamageFrameHandler);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this._pendingPlayerDamageMax = param1;
|
||||
this._pendingPlayerDamageBefore = param2;
|
||||
this._pendingPlayerDamageAfter = param3;
|
||||
}
|
||||
}
|
||||
|
||||
private function onPlayerDamageLoaded(param1:MovieClip) : void
|
||||
{
|
||||
this._playerDamageMC = param1;
|
||||
this._playerDamageMH.destroy();
|
||||
this._playerDamageMH = null;
|
||||
if(this._pendingPlayerDamageMax > 0)
|
||||
{
|
||||
this.playerDamaged(this._pendingPlayerDamageMax,this._pendingPlayerDamageBefore,this._pendingPlayerDamageAfter);
|
||||
}
|
||||
}
|
||||
|
||||
private function onLevelUpTopLoaded(param1:MovieClip) : void
|
||||
{
|
||||
if(param1)
|
||||
{
|
||||
if(Boolean(this._levelUpMCTop) && Boolean(this._levelUpMCTop.parent))
|
||||
{
|
||||
this._levelUpMCTop.parent.removeChild(this._levelUpMCTop);
|
||||
}
|
||||
this._levelUpMCTop = param1;
|
||||
this.updateAvatarStatus();
|
||||
if(this._avatarWorldView)
|
||||
{
|
||||
this._levelUpMCTop.x = this._avatarWorldView.x;
|
||||
this._levelUpMCTop.y = this._avatarWorldView.y;
|
||||
QuestManager._layerManager.room_chat.addChild(this._levelUpMCTop);
|
||||
}
|
||||
this.playLevelUpEffect();
|
||||
}
|
||||
}
|
||||
|
||||
private function onLevelUpBottomLoaded(param1:MovieClip) : void
|
||||
{
|
||||
if(param1)
|
||||
{
|
||||
if(Boolean(this._levelUpMCBottom) && Boolean(this._levelUpMCBottom.parent))
|
||||
{
|
||||
this._levelUpMCBottom.parent.removeChild(this._levelUpMCBottom);
|
||||
}
|
||||
this._levelUpMCBottom = param1;
|
||||
this.updateAvatarStatus();
|
||||
if(this._avatarWorldView)
|
||||
{
|
||||
this._avatarWorldView.addChildAt(this._levelUpMCBottom,0);
|
||||
}
|
||||
this.playLevelUpEffect();
|
||||
}
|
||||
}
|
||||
|
||||
private function playerDamageFrameHandler(param1:Event) : void
|
||||
{
|
||||
this._playerDamageMC.x = this._avatarWorldView.x;
|
||||
this._playerDamageMC.y = this._avatarWorldView.y;
|
||||
if(this._playerDamageMC != null && Boolean(this._playerDamageMC.finished))
|
||||
{
|
||||
this._playerDamageMC.removeEventListener(Event.ENTER_FRAME,this.playerDamageFrameHandler);
|
||||
if(this._playerDamageMC.parent == QuestManager._layerManager.room_chat)
|
||||
{
|
||||
QuestManager._layerManager.room_chat.removeChild(this._playerDamageMC);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function levelUpEnterFrameHandler(param1:Event) : void
|
||||
{
|
||||
if(this._levelUpMCTop != null)
|
||||
{
|
||||
this._levelUpMCTop.x = this._avatarWorldView.x;
|
||||
this._levelUpMCTop.y = this._avatarWorldView.y;
|
||||
}
|
||||
if(this._levelUpMCTop.currentFrameLabel == "tintOff")
|
||||
{
|
||||
this.updateAvatarStatus();
|
||||
if(this._avatarWorldView)
|
||||
{
|
||||
this._avatarWorldView.setBlendColor(0);
|
||||
}
|
||||
}
|
||||
if(this._levelUpMCTop.currentFrameLabel == "finished")
|
||||
{
|
||||
this._levelUpMCTop.removeEventListener(Event.ENTER_FRAME,this.levelUpEnterFrameHandler);
|
||||
}
|
||||
}
|
||||
|
||||
private function onTweenComplete(param1:GTween) : void
|
||||
{
|
||||
if(this._avatarWorldView)
|
||||
{
|
||||
if(Boolean(this._healingHeart) && Boolean(this._healingHeart.parent) && this._healingHeart.parent == this._avatarWorldView)
|
||||
{
|
||||
this._avatarWorldView.removeChild(this._healingHeart);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function onTweenStatusTextComplete(param1:GTween) : void
|
||||
{
|
||||
if(this._avatarWorldView)
|
||||
{
|
||||
if(Boolean(this._statusText) && Boolean(this._statusText.parent) && this._statusText.parent == this._avatarWorldView)
|
||||
{
|
||||
this._avatarWorldView.removeChild(this._statusText);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function levelUp(param1:int) : void
|
||||
{
|
||||
if(this._avatarWorldView)
|
||||
{
|
||||
this._avatarWorldView.updateNameBarLevelShape(param1);
|
||||
}
|
||||
this._levelUpHelperTop = new MediaHelper();
|
||||
this._levelUpHelperTop.init(1823,this.onLevelUpTopLoaded);
|
||||
this._levelUpHelperBottom = new MediaHelper();
|
||||
this._levelUpHelperBottom.init(1875,this.onLevelUpBottomLoaded);
|
||||
}
|
||||
|
||||
public function handleHit(param1:int) : void
|
||||
{
|
||||
var _loc2_:AvatarInfo = null;
|
||||
if(this._avatarWorldView != null)
|
||||
{
|
||||
_loc2_ = gMainFrame.userInfo.getAvatarInfoByUserName(this._avatarWorldView.userName);
|
||||
if(_loc2_ != null)
|
||||
{
|
||||
if(_loc2_.questHealthPercentage > 0)
|
||||
{
|
||||
this._tintFrames = 13;
|
||||
this.playHitText(String(param1));
|
||||
if(this._avatarWorldView)
|
||||
{
|
||||
this._avatarWorldView.handleOffScreenHit();
|
||||
addEventListener(Event.ENTER_FRAME,this.hitEnterFrameHandler);
|
||||
if(this._avatarWorldView == AvatarManager.playerAvatarWorldView)
|
||||
{
|
||||
QuestManager.playSound("ajq_playerhit");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(this._avatarWorldView)
|
||||
{
|
||||
this._avatarWorldView.handleOffScreenSleep();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function playHitText(param1:String) : void
|
||||
{
|
||||
this.updateAvatarStatus();
|
||||
if(!this._avatarWorldView)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public function playStatusText(param1:String) : void
|
||||
{
|
||||
this._statusText.visible = true;
|
||||
this._statusText.alpha = 2;
|
||||
this._statusText.text = param1;
|
||||
this._statusText.x = this.x - this._statusText.textWidth * 0.5 - this._avatarWorldView.radius * 0.5;
|
||||
this._statusText.y = this.y - this._avatarWorldView.radius * 2;
|
||||
if(this._statusTextTween)
|
||||
{
|
||||
this._statusTextTween.resetValues({
|
||||
"y":this._statusText.y - 90,
|
||||
"alpha":0
|
||||
});
|
||||
this._statusTextTween.beginning();
|
||||
this._statusTextTween.paused = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
this._statusTextTween = new GTween(this._statusText,1,{
|
||||
"y":this._statusText.y - 90,
|
||||
"alpha":0
|
||||
},{
|
||||
"onComplete":this.onTweenComplete,
|
||||
"ease":Linear.easeNone
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function handleHealing(param1:int) : void
|
||||
{
|
||||
this.updateAvatarStatus();
|
||||
if(this._avatarWorldView)
|
||||
{
|
||||
this._healingHeart.visible = true;
|
||||
this._healingHeart.alpha = 2;
|
||||
this._healingHeart.x = this.x - this._avatarWorldView.radius * 0.5;
|
||||
this._healingHeart.y = this.y - this._avatarWorldView.radius * 2 - 35;
|
||||
if(this._healingTween)
|
||||
{
|
||||
this._healingTween.resetValues({
|
||||
"y":this._healingHeart.y,
|
||||
"alpha":0
|
||||
});
|
||||
this._healingTween.beginning();
|
||||
this._healingTween.paused = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
this._healingTween = new GTween(this._healingHeart,1.5,{
|
||||
"y":this._healingHeart.y,
|
||||
"alpha":0
|
||||
},{
|
||||
"onComplete":this.onTweenComplete,
|
||||
"ease":Linear.easeNone
|
||||
});
|
||||
}
|
||||
this._avatarWorldView.handleOffScreenSleep(true);
|
||||
}
|
||||
}
|
||||
|
||||
public function destroy() : void
|
||||
{
|
||||
this.stopItemEmoticonSound();
|
||||
if(hasEventListener(Event.ENTER_FRAME))
|
||||
{
|
||||
removeEventListener(Event.ENTER_FRAME,this.hitEnterFrameHandler);
|
||||
}
|
||||
if(Boolean(this._levelUpMCTop) && this._levelUpMCTop.hasEventListener(Event.ENTER_FRAME))
|
||||
{
|
||||
this._levelUpMCTop.removeEventListener(Event.ENTER_FRAME,this.levelUpEnterFrameHandler);
|
||||
}
|
||||
if(this._playerDamageMC != null)
|
||||
{
|
||||
this._playerDamageMC.removeEventListener(Event.ENTER_FRAME,this.playerDamageFrameHandler);
|
||||
}
|
||||
if(this._playerDamageMH != null)
|
||||
{
|
||||
this._playerDamageMH.destroy();
|
||||
this._playerDamageMH = null;
|
||||
}
|
||||
}
|
||||
|
||||
private function soundEnterFrameHandler(param1:Event) : void
|
||||
{
|
||||
var _loc2_:Number = NaN;
|
||||
var _loc3_:Number = NaN;
|
||||
var _loc4_:Number = NaN;
|
||||
var _loc5_:Number = NaN;
|
||||
var _loc6_:Number = NaN;
|
||||
var _loc7_:Number = NaN;
|
||||
if(this._avatarWorldView)
|
||||
{
|
||||
if(this._itemEmoticonSoundName != null)
|
||||
{
|
||||
_loc2_ = 1;
|
||||
if(this._avatarWorldView != AvatarManager.playerAvatarWorldView && Boolean(AvatarManager.playerAvatarWorldView))
|
||||
{
|
||||
_loc3_ = AvatarManager.playerAvatarWorldView.x - this._avatarWorldView.x;
|
||||
_loc4_ = AvatarManager.playerAvatarWorldView.y - this._avatarWorldView.y;
|
||||
_loc5_ = _loc3_ * _loc3_ + _loc4_ * _loc4_;
|
||||
_loc6_ = 5 * 5;
|
||||
_loc7_ = 600 * 600;
|
||||
if(_loc5_ > _loc7_)
|
||||
{
|
||||
_loc2_ = 0;
|
||||
}
|
||||
else if(_loc5_ >= _loc6_)
|
||||
{
|
||||
_loc2_ = 1 - (_loc5_ - _loc6_) / (_loc7_ - _loc6_);
|
||||
}
|
||||
}
|
||||
if(_loc2_ > 0)
|
||||
{
|
||||
if(this._itemEmoticonSound == null)
|
||||
{
|
||||
this._itemEmoticonSound = QuestManager.playLoopingSound(this._itemEmoticonSoundName);
|
||||
}
|
||||
QuestManager.setSoundLevel(this._itemEmoticonSound,_loc2_,this._avatarWorldView);
|
||||
}
|
||||
else if(this._itemEmoticonSound != null)
|
||||
{
|
||||
this._itemEmoticonSound.stop();
|
||||
this._itemEmoticonSound = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function hitEnterFrameHandler(param1:Event) : void
|
||||
{
|
||||
this.updateAvatarStatus();
|
||||
if(this._avatarWorldView)
|
||||
{
|
||||
if(this._avatarWorldView.isValid())
|
||||
{
|
||||
--this._tintFrames;
|
||||
switch(this._tintFrames)
|
||||
{
|
||||
case 10:
|
||||
case 6:
|
||||
case 2:
|
||||
this._avatarWorldView.setBlendColor(0);
|
||||
break;
|
||||
case 12:
|
||||
case 8:
|
||||
case 4:
|
||||
this._avatarWorldView.setBlendColor(3439329279,0,true);
|
||||
break;
|
||||
case 0:
|
||||
removeEventListener(Event.ENTER_FRAME,this.hitEnterFrameHandler);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
removeEventListener(Event.ENTER_FRAME,this.hitEnterFrameHandler);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function stopItemEmoticonSound() : void
|
||||
{
|
||||
if(this._itemEmoticonSound != null)
|
||||
{
|
||||
this._itemEmoticonSound.stop();
|
||||
this._itemEmoticonSound = null;
|
||||
}
|
||||
if(this._itemEmoticonSoundName != null)
|
||||
{
|
||||
removeEventListener(Event.ENTER_FRAME,this.soundEnterFrameHandler);
|
||||
this._itemEmoticonSoundName = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function playItemEmoticonSound(param1:String) : void
|
||||
{
|
||||
this.stopItemEmoticonSound();
|
||||
var _loc2_:int = param1.lastIndexOf(".wav");
|
||||
if(_loc2_ > 0)
|
||||
{
|
||||
param1 = param1.substring(0,_loc2_);
|
||||
}
|
||||
param1 = param1.toLowerCase();
|
||||
this._itemEmoticonSoundName = param1;
|
||||
addEventListener(Event.ENTER_FRAME,this.soundEnterFrameHandler);
|
||||
}
|
||||
|
||||
public function setAvatarSwitched(param1:int) : void
|
||||
{
|
||||
this.updateAvatarStatus();
|
||||
if(this._avSwitchedNPC != null)
|
||||
{
|
||||
if(this._avSwitchedNPC.parent != null)
|
||||
{
|
||||
this._avSwitchedNPC.parent.removeChild(this._avSwitchedNPC);
|
||||
}
|
||||
this._avSwitchedNPC.destroy();
|
||||
this._avSwitchedNPC = null;
|
||||
}
|
||||
if(this._avatarWorldView != null)
|
||||
{
|
||||
this._avatarWorldView.showAvatar();
|
||||
}
|
||||
this._avSwitchNPCID = param1;
|
||||
}
|
||||
|
||||
public function onNpcLoaded() : void
|
||||
{
|
||||
if(this._avatarWorldView != null)
|
||||
{
|
||||
if(this._avSwitchedNPC != null)
|
||||
{
|
||||
this._avSwitchedNPC.x = this._avatarWorldView.x;
|
||||
this._avSwitchedNPC.y = this._avatarWorldView.y;
|
||||
this._avSwitchedNPC.npcMC.setVision(0);
|
||||
this._avSwitchedNPC.setNpcState(NPCView.NPC_STATE_IDLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function playerLeftRoom() : void
|
||||
{
|
||||
if(this._avSwitchedNPC != null)
|
||||
{
|
||||
if(this._avSwitchedNPC.parent != null)
|
||||
{
|
||||
this._avSwitchedNPC.parent.removeChild(this._avSwitchedNPC);
|
||||
}
|
||||
this._avSwitchedNPC.destroy();
|
||||
this._avSwitchedNPC = null;
|
||||
}
|
||||
this._avatarWorldView = null;
|
||||
}
|
||||
|
||||
public function heartbeat() : void
|
||||
{
|
||||
if(this._avatarWorldView != null)
|
||||
{
|
||||
if(this._avSwitchedNPC != null)
|
||||
{
|
||||
if(this._avSwitchedNPC.x != this._avatarWorldView.x || this._avSwitchedNPC.y != this._avatarWorldView.y)
|
||||
{
|
||||
this._avSwitchedNPC.setNpcState(NPCView.NPC_STATE_MOVE,this._avSwitchedNPC.x < this._avatarWorldView.x ? 90 : 270);
|
||||
this._avSwitchedNPC.x = this._avatarWorldView.x;
|
||||
this._avSwitchedNPC.y = this._avatarWorldView.y;
|
||||
}
|
||||
else
|
||||
{
|
||||
this._avSwitchedNPC.setNpcState(NPCView.NPC_STATE_IDLE);
|
||||
}
|
||||
}
|
||||
else if(this._avSwitchNPCID != 0)
|
||||
{
|
||||
if(this._avatarWorldView.isValid())
|
||||
{
|
||||
this._avatarWorldView.hideAvatar();
|
||||
this._avSwitchedNPC = new NPCView();
|
||||
this._avSwitchedNPC.x = this._avatarWorldView.x;
|
||||
this._avSwitchedNPC.y = this._avatarWorldView.y;
|
||||
this._avSwitchedNPC.init(this._avSwitchNPCID,0,-1,false,this.onNpcLoaded);
|
||||
QuestManager._layerManager.room_avatars.addChild(this._avSwitchedNPC);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,345 @@
|
||||
package quest
|
||||
{
|
||||
import avatar.AvatarManager;
|
||||
import avatar.AvatarView;
|
||||
import avatar.AvatarWorldView;
|
||||
import com.sbi.graphics.PaletteHelper;
|
||||
import flash.display.MovieClip;
|
||||
import flash.display.Sprite;
|
||||
import flash.geom.Point;
|
||||
import item.ItemXtCommManager;
|
||||
import loader.MediaHelper;
|
||||
import room.RoomManagerWorld;
|
||||
|
||||
public class QuestProjectile extends Sprite
|
||||
{
|
||||
|
||||
private static const PROJECTILE_VELOCITY:int = 400;
|
||||
|
||||
private static const PROJECTILE_RANGE:int = 600;
|
||||
|
||||
private static const PROJECTILE_RADIUS:int = 10;
|
||||
|
||||
private var _weaponItem:Object;
|
||||
|
||||
private var _npc:QuestActor;
|
||||
|
||||
private var _mediaHelperObj:MediaHelper;
|
||||
|
||||
private var _strikeMC:MovieClip;
|
||||
|
||||
private var _projectileMC:MovieClip;
|
||||
|
||||
private var _aimX:Number;
|
||||
|
||||
private var _aimY:Number;
|
||||
|
||||
private var _distanceTravelled:Number;
|
||||
|
||||
private var _timer:Number;
|
||||
|
||||
private var _angle:Number;
|
||||
|
||||
private var _collisionOffset:Point;
|
||||
|
||||
private var _color:uint;
|
||||
|
||||
private var _localPlayerLaunched:Boolean;
|
||||
|
||||
private var _healProjectile:Boolean;
|
||||
|
||||
public function QuestProjectile()
|
||||
{
|
||||
super();
|
||||
this._distanceTravelled = 0;
|
||||
this._timer = 0;
|
||||
}
|
||||
|
||||
public function get angle() : Number
|
||||
{
|
||||
return this._angle;
|
||||
}
|
||||
|
||||
public function destroy() : void
|
||||
{
|
||||
if(this._strikeMC != null && this._strikeMC.parent != null)
|
||||
{
|
||||
this._strikeMC.parent.removeChild(this._strikeMC);
|
||||
}
|
||||
if(this._mediaHelperObj != null)
|
||||
{
|
||||
this._mediaHelperObj.destroy();
|
||||
this._mediaHelperObj = null;
|
||||
}
|
||||
if(parent != null)
|
||||
{
|
||||
parent.removeChild(this);
|
||||
}
|
||||
this._strikeMC.weapon.rotation = 0;
|
||||
QuestManager.recycle(this._weaponItem.attackMediaRefId,this);
|
||||
}
|
||||
|
||||
public function heartbeat(param1:Number) : Boolean
|
||||
{
|
||||
var _loc2_:QuestActor = null;
|
||||
var _loc3_:Object = null;
|
||||
var _loc4_:AvatarWorldView = null;
|
||||
var _loc5_:Number = NaN;
|
||||
var _loc6_:Number = NaN;
|
||||
if(this._timer == 0)
|
||||
{
|
||||
if(this._projectileMC != null)
|
||||
{
|
||||
x += this._aimX * PROJECTILE_VELOCITY * param1;
|
||||
y += this._aimY * PROJECTILE_VELOCITY * param1;
|
||||
this._distanceTravelled += PROJECTILE_VELOCITY * param1;
|
||||
if(this._distanceTravelled > PROJECTILE_RANGE || RoomManagerWorld.instance.collisionTestGrid(x + this._collisionOffset.x,y + this._collisionOffset.y) == 1)
|
||||
{
|
||||
this.handleHit(true,null,null,false);
|
||||
}
|
||||
else if(this._npc != null || this._healProjectile)
|
||||
{
|
||||
for(_loc3_ in AvatarManager.avatarViewList)
|
||||
{
|
||||
_loc4_ = AvatarManager.avatarViewList[_loc3_];
|
||||
if(_loc4_ != null)
|
||||
{
|
||||
_loc5_ = x + this._collisionOffset.x - (_loc4_.x + QuestManager.QUEST_PLAYER_AVATAR_OFFSETX);
|
||||
_loc6_ = y + this._collisionOffset.y - (_loc4_.y + QuestManager.QUEST_PLAYER_AVATAR_OFFSETY);
|
||||
if(_loc5_ * _loc5_ + _loc6_ * _loc6_ < (PROJECTILE_RADIUS + QuestManager.QUEST_PLAYER_AVATAR_RADIUS) * (PROJECTILE_RADIUS + QuestManager.QUEST_PLAYER_AVATAR_RADIUS))
|
||||
{
|
||||
this.handleHit(false,null,_loc4_,this._localPlayerLaunched);
|
||||
}
|
||||
}
|
||||
}
|
||||
_loc2_ = QuestManager.projectileRadiusCheck(x + this._collisionOffset.x,y + this._collisionOffset.y,PROJECTILE_RADIUS,true);
|
||||
if(_loc2_ != null)
|
||||
{
|
||||
this.handleHit(false,_loc2_,null,true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc2_ = QuestManager.projectileRadiusCheck(x + this._collisionOffset.x,y + this._collisionOffset.y,PROJECTILE_RADIUS,false);
|
||||
if(_loc2_ != null)
|
||||
{
|
||||
this.handleHit(false,_loc2_,null,this._localPlayerLaunched);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this._timer -= param1;
|
||||
if(this._timer <= 0)
|
||||
{
|
||||
this._timer = 0;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleHit(param1:Boolean, param2:QuestActor, param3:AvatarWorldView, param4:Boolean) : void
|
||||
{
|
||||
var _loc5_:Point = null;
|
||||
this._projectileMC.visible = false;
|
||||
this._timer = 2;
|
||||
if(param1 == false)
|
||||
{
|
||||
if(param2 != null)
|
||||
{
|
||||
param2.handleHit(param4,this._weaponItem.defId);
|
||||
_loc5_ = param2.actorOffset;
|
||||
x = param2.x + _loc5_.x;
|
||||
y = param2.y + _loc5_.y;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!this._healProjectile)
|
||||
{
|
||||
if(param3 == AvatarManager.playerAvatarWorldView)
|
||||
{
|
||||
QuestXtCommManager.questActorAttacked("",this._weaponItem.defId,0,0);
|
||||
}
|
||||
}
|
||||
else if(this._localPlayerLaunched)
|
||||
{
|
||||
QuestXtCommManager.questPlayerHeal(this._weaponItem.defId,param3.avatarData.sfsUserId);
|
||||
}
|
||||
_loc5_ = new Point(QuestManager.QUEST_PLAYER_AVATAR_OFFSETX,QuestManager.QUEST_PLAYER_AVATAR_OFFSETY);
|
||||
x = _loc5_.x + param3.x;
|
||||
y = _loc5_.y + param3.y;
|
||||
}
|
||||
this._mediaHelperObj = new MediaHelper();
|
||||
this._mediaHelperObj.init(this._weaponItem.attackMediaRefId,this.onEffectLoaded);
|
||||
}
|
||||
}
|
||||
|
||||
private function setAngle() : void
|
||||
{
|
||||
var _loc1_:Number = this._aimX - x;
|
||||
var _loc2_:Number = this._aimY - y;
|
||||
if(_loc1_ == 0 && _loc2_ == 0)
|
||||
{
|
||||
_loc1_ = 1;
|
||||
}
|
||||
var _loc3_:Number = Math.sqrt(_loc1_ * _loc1_ + _loc2_ * _loc2_);
|
||||
this._aimX = _loc1_ / _loc3_;
|
||||
this._aimY = _loc2_ / _loc3_;
|
||||
var _loc4_:Number = Math.asin(this._aimX);
|
||||
if(this._aimY > 0)
|
||||
{
|
||||
_loc4_ = -(Math.PI + _loc4_);
|
||||
}
|
||||
this._angle = _loc4_ * 180 / Math.PI;
|
||||
}
|
||||
|
||||
public function relaunch(param1:int, param2:uint, param3:Sprite, param4:int, param5:int, param6:QuestActor, param7:AvatarView) : Boolean
|
||||
{
|
||||
var _loc8_:Point = null;
|
||||
this._color = param2;
|
||||
this._aimX = param4;
|
||||
this._aimY = param5;
|
||||
this._healProjectile = false;
|
||||
this._distanceTravelled = 0;
|
||||
this._timer = 0;
|
||||
if(param6 == null)
|
||||
{
|
||||
if(param7)
|
||||
{
|
||||
this._localPlayerLaunched = param7.userId == AvatarManager.playerSfsUserId;
|
||||
if(this._localPlayerLaunched)
|
||||
{
|
||||
QuestXtCommManager.sendQuestProjectileLaunch(this._weaponItem.defId,param4,param5,"",param7.userId,param2);
|
||||
}
|
||||
this._healProjectile = this._weaponItem.attack < 0;
|
||||
x = this._strikeMC.x = param7.x + QuestManager.QUEST_PLAYER_AVATAR_OFFSETX;
|
||||
y = this._strikeMC.y = param7.y + QuestManager.QUEST_PLAYER_AVATAR_OFFSETY;
|
||||
this.setAngle();
|
||||
this._strikeMC.strike(this._angle);
|
||||
param3.addChild(this._strikeMC);
|
||||
this._projectileMC.visible = true;
|
||||
this._projectileMC.projectile(this._angle);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this._localPlayerLaunched = false;
|
||||
_loc8_ = param6.actorOffset;
|
||||
this._npc = param6;
|
||||
x = this._strikeMC.x = this._npc.x + _loc8_.x;
|
||||
y = this._strikeMC.x = this._npc.y + _loc8_.y;
|
||||
this.setAngle();
|
||||
this._strikeMC.strike(this._angle);
|
||||
param3.addChild(this._strikeMC);
|
||||
this._projectileMC.visible = true;
|
||||
this._projectileMC.projectile(this._angle);
|
||||
}
|
||||
param3.addChild(this);
|
||||
return true;
|
||||
}
|
||||
|
||||
public function launch(param1:int, param2:uint, param3:Sprite, param4:int, param5:int, param6:QuestActor, param7:AvatarView) : Boolean
|
||||
{
|
||||
var _loc8_:Object = null;
|
||||
var _loc9_:Point = null;
|
||||
this._color = param2;
|
||||
this._weaponItem = ItemXtCommManager.getItemDef(param1);
|
||||
this._aimX = param4;
|
||||
this._aimY = param5;
|
||||
this._healProjectile = false;
|
||||
if(param6 == null)
|
||||
{
|
||||
if(param7)
|
||||
{
|
||||
this._localPlayerLaunched = param7.userId == AvatarManager.playerSfsUserId;
|
||||
if(this._localPlayerLaunched)
|
||||
{
|
||||
QuestXtCommManager.sendQuestProjectileLaunch(this._weaponItem.defId,param4,param5,"",param7.userId,param2);
|
||||
}
|
||||
_loc8_ = ItemXtCommManager.getItemDef(param1);
|
||||
if(_loc8_)
|
||||
{
|
||||
this._healProjectile = _loc8_.attack < 0;
|
||||
}
|
||||
x = param7.x + QuestManager.QUEST_PLAYER_AVATAR_OFFSETX;
|
||||
y = param7.y + QuestManager.QUEST_PLAYER_AVATAR_OFFSETY;
|
||||
this._mediaHelperObj = new MediaHelper();
|
||||
this._mediaHelperObj.init(this._weaponItem.attackMediaRefId,this.onStrikeLoaded);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this._localPlayerLaunched = false;
|
||||
_loc9_ = param6.actorOffset;
|
||||
this._npc = param6;
|
||||
x = this._npc.x + _loc9_.x;
|
||||
y = this._npc.y + _loc9_.y;
|
||||
this._mediaHelperObj = new MediaHelper();
|
||||
this._mediaHelperObj.init(this._weaponItem.attackMediaRefId,this.onStrikeLoaded);
|
||||
}
|
||||
if(this._mediaHelperObj != null)
|
||||
{
|
||||
this.setAngle();
|
||||
param3.addChild(this);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private function onStrikeLoaded(param1:MovieClip) : void
|
||||
{
|
||||
var _loc2_:Array = null;
|
||||
var _loc3_:Array = null;
|
||||
if(parent != null)
|
||||
{
|
||||
_loc2_ = PaletteHelper.getRGBColors(this._color);
|
||||
_loc3_ = new Array(new Array(_loc2_[0].r,_loc2_[0].g,_loc2_[0].b),new Array(_loc2_[1].r,_loc2_[1].g,_loc2_[1].b),new Array(_loc2_[2].r,_loc2_[2].g,_loc2_[2].b),new Array(_loc2_[3].r,_loc2_[3].g,_loc2_[3].b));
|
||||
param1.rgbColors = _loc3_;
|
||||
param1.setColors();
|
||||
param1.x += x;
|
||||
param1.y += y;
|
||||
param1.strike(this._angle);
|
||||
parent.addChild(param1);
|
||||
this._strikeMC = param1;
|
||||
if(this._mediaHelperObj != null)
|
||||
{
|
||||
this._mediaHelperObj.destroy();
|
||||
this._mediaHelperObj = null;
|
||||
}
|
||||
this._mediaHelperObj = new MediaHelper();
|
||||
this._mediaHelperObj.init(this._weaponItem.attackMediaRefId,this.onProjectileLoaded);
|
||||
}
|
||||
}
|
||||
|
||||
private function onEffectLoaded(param1:MovieClip) : void
|
||||
{
|
||||
addChild(param1);
|
||||
param1.effect();
|
||||
if(this._mediaHelperObj != null)
|
||||
{
|
||||
this._mediaHelperObj.destroy();
|
||||
this._mediaHelperObj = null;
|
||||
}
|
||||
}
|
||||
|
||||
private function onProjectileLoaded(param1:MovieClip) : void
|
||||
{
|
||||
var _loc2_:Array = PaletteHelper.getRGBColors(this._color);
|
||||
var _loc3_:Array = new Array(new Array(_loc2_[0].r,_loc2_[0].g,_loc2_[0].b),new Array(_loc2_[1].r,_loc2_[1].g,_loc2_[1].b),new Array(_loc2_[2].r,_loc2_[2].g,_loc2_[2].b),new Array(_loc2_[3].r,_loc2_[3].g,_loc2_[3].b));
|
||||
param1.rgbColors = _loc3_;
|
||||
param1.setColors();
|
||||
this._projectileMC = param1;
|
||||
addChild(this._projectileMC);
|
||||
this._projectileMC.projectile(this._angle);
|
||||
this._collisionOffset = this._projectileMC.getCollisionPoint();
|
||||
if(this._mediaHelperObj != null)
|
||||
{
|
||||
this._mediaHelperObj.destroy();
|
||||
this._mediaHelperObj = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,747 @@
|
||||
package quest
|
||||
{
|
||||
import avatar.AvatarManager;
|
||||
import com.carlcalderon.arthropod.Debug;
|
||||
import com.sbi.client.SFEvent;
|
||||
import com.sbi.debug.DebugUtility;
|
||||
import com.sbi.popup.SBOkPopup;
|
||||
import den.DenXtCommManager;
|
||||
import flash.utils.Dictionary;
|
||||
import gui.AdventureJoin;
|
||||
import gui.DarkenManager;
|
||||
import gui.GuiManager;
|
||||
import loader.DefPacksDefHelper;
|
||||
import localization.LocalizationManager;
|
||||
import room.RoomManagerWorld;
|
||||
import room.RoomXtCommManager;
|
||||
|
||||
public class QuestXtCommManager
|
||||
{
|
||||
|
||||
private static var _questCache:Array;
|
||||
|
||||
private static var _questDefLookups:Array;
|
||||
|
||||
private static var _scriptDefs:Object;
|
||||
|
||||
private static var _wasRoomWeCameFromDen:Boolean;
|
||||
|
||||
private static var _autoStartQuestOnNextWaitResponse:Boolean;
|
||||
|
||||
public function QuestXtCommManager()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function init() : void
|
||||
{
|
||||
_questCache = new Array();
|
||||
_questDefLookups = new Array();
|
||||
_autoStartQuestOnNextWaitResponse = false;
|
||||
}
|
||||
|
||||
public static function questAskComplete(param1:String, param2:int, param3:int) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("qaskr",[param1,param2,param3]);
|
||||
}
|
||||
|
||||
public static function questMiniGameComplete(param1:String, param2:int, param3:int) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("qmgc",[param1,param2,param3]);
|
||||
}
|
||||
|
||||
public static function questActorAttacked(param1:String, param2:int, param3:int, param4:int) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("qaa",[param1,param1 == "" ? 1 : 0,param2,param3,param4]);
|
||||
}
|
||||
|
||||
public static function questPhantomAttackDestructible(param1:String, param2:String) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("qpad",[param1,param2]);
|
||||
}
|
||||
|
||||
public static function questPlayerHeal(param1:int, param2:int) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("qph",[param1,param2]);
|
||||
}
|
||||
|
||||
public static function questActorTriggered(param1:String, param2:int = 0) : void
|
||||
{
|
||||
DebugUtility.debugTrace("sending \'qat\' command with actorId: " + param1,Debug.RED);
|
||||
gMainFrame.server.setXtObject_Str("qat",[param1,param2]);
|
||||
}
|
||||
|
||||
public static function questPickUpItem(param1:String) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("qpup",[param1,AvatarManager.playerSfsUserId]);
|
||||
}
|
||||
|
||||
public static function questActorTreasureTriggered(param1:String, param2:int = 0) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("qatt",[param1,param2]);
|
||||
}
|
||||
|
||||
public static function questActorUntriggered(param1:String) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("qaut",[param1]);
|
||||
}
|
||||
|
||||
public static function questActorPositionUpdate(param1:String, param2:int, param3:int, param4:int, param5:int, param6:int, param7:int) : void
|
||||
{
|
||||
if(QuestManager._questStartingPlayerCount > 1)
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("qau",[param1,param2,param3,param4,param5,param6,param7]);
|
||||
}
|
||||
}
|
||||
|
||||
public static function questActorSeek(param1:String, param2:int) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("qas",[param1,param2]);
|
||||
}
|
||||
|
||||
public static function questBeamZap(param1:String, param2:int) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("qbzap",[param1,param2]);
|
||||
}
|
||||
|
||||
public static function questPhantomZap(param1:String, param2:int, param3:int, param4:int) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("qpzap",[param1,param2,param3,param4]);
|
||||
}
|
||||
|
||||
public static function questFullRoomMinigameComplete(param1:String, param2:int) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("qfrmgdone",[param1,param2]);
|
||||
}
|
||||
|
||||
public static function sendQuestJoinPrivate(param1:String) : void
|
||||
{
|
||||
if(gMainFrame.server.getCurrentRoom())
|
||||
{
|
||||
DarkenManager.showLoadingSpiral(true);
|
||||
if(RoomXtCommManager._loadingNewRoom)
|
||||
{
|
||||
DebugUtility.debugTrace("IGNORING sendQuestWaitRequest request because user is already joining a new room!");
|
||||
return;
|
||||
}
|
||||
AvatarManager.joiningNewRoom = true;
|
||||
RoomXtCommManager._loadingNewRoom = true;
|
||||
RoomManagerWorld.instance.forceStopMovement();
|
||||
gMainFrame.server.setXtObject_Str("qjp",[gMainFrame.server.getCurrentRoomName(),param1]);
|
||||
}
|
||||
}
|
||||
|
||||
public static function sendQuestCreateJoinPublic(param1:int, param2:int = 0, param3:Boolean = false) : void
|
||||
{
|
||||
var _loc4_:String = null;
|
||||
if(gMainFrame.server.getCurrentRoom())
|
||||
{
|
||||
if(RoomXtCommManager._loadingNewRoom)
|
||||
{
|
||||
DebugUtility.debugTrace("IGNORING sendQuestWaitRequest request because user is already joining a new room!");
|
||||
return;
|
||||
}
|
||||
AvatarManager.joiningNewRoom = true;
|
||||
RoomXtCommManager._loadingNewRoom = true;
|
||||
_loc4_ = gMainFrame.server.getCurrentRoomName();
|
||||
if(_loc4_.indexOf("den") != -1)
|
||||
{
|
||||
_wasRoomWeCameFromDen = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
_wasRoomWeCameFromDen = false;
|
||||
}
|
||||
if(param3)
|
||||
{
|
||||
_autoStartQuestOnNextWaitResponse = true;
|
||||
}
|
||||
RoomManagerWorld.instance.forceStopMovement();
|
||||
gMainFrame.server.setXtObject_Str("qj",[gMainFrame.server.getCurrentRoomName(),param1,param2,0]);
|
||||
}
|
||||
}
|
||||
|
||||
public static function sendQuestCreateJoinPublicNoCurrentRoom(param1:int, param2:int = 0) : void
|
||||
{
|
||||
if(RoomXtCommManager._loadingNewRoom)
|
||||
{
|
||||
DebugUtility.debugTrace("IGNORING sendQuestWaitRequest request because user is already joining a new room!");
|
||||
return;
|
||||
}
|
||||
AvatarManager.joiningNewRoom = true;
|
||||
RoomXtCommManager._loadingNewRoom = true;
|
||||
RoomManagerWorld.instance.forceStopMovement();
|
||||
gMainFrame.server.setXtObject_Str("qj",["",param1,param2,0]);
|
||||
}
|
||||
|
||||
public static function sendQuestCreatePrivate(param1:int, param2:int = 0, param3:Boolean = false) : void
|
||||
{
|
||||
if(gMainFrame.server.getCurrentRoom())
|
||||
{
|
||||
if(RoomXtCommManager._loadingNewRoom)
|
||||
{
|
||||
DebugUtility.debugTrace("IGNORING sendQuestWaitRequest request because user is already joining a new room!");
|
||||
return;
|
||||
}
|
||||
AvatarManager.joiningNewRoom = true;
|
||||
RoomXtCommManager._loadingNewRoom = true;
|
||||
if(param3)
|
||||
{
|
||||
_autoStartQuestOnNextWaitResponse = true;
|
||||
}
|
||||
RoomManagerWorld.instance.forceStopMovement();
|
||||
gMainFrame.server.setXtObject_Str("qjc",[gMainFrame.server.getCurrentRoomName(),param1,param2]);
|
||||
}
|
||||
}
|
||||
|
||||
public static function sendQuestPrivateKick(param1:String) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("qjk",[param1]);
|
||||
}
|
||||
|
||||
public static function sendQuestJoinCancel() : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("qjx",[]);
|
||||
GuiManager.setSwapBtnGray(false);
|
||||
}
|
||||
|
||||
public static function sendQuestStartRequest() : void
|
||||
{
|
||||
if(gMainFrame.server.getCurrentRoom())
|
||||
{
|
||||
if(RoomXtCommManager._loadingNewRoom)
|
||||
{
|
||||
DebugUtility.debugTrace("IGNORING sendQuestStartRequest request because user is already joining a new room!");
|
||||
return;
|
||||
}
|
||||
AvatarManager.joiningNewRoom = true;
|
||||
RoomXtCommManager._loadingNewRoom = true;
|
||||
AvatarManager.resetCustomAdventureState();
|
||||
gMainFrame.server.setXtObject_Str("qs",[gMainFrame.server.getCurrentRoomName()]);
|
||||
}
|
||||
}
|
||||
|
||||
public static function sendQuestProjectileLaunch(param1:int, param2:int, param3:int, param4:String, param5:int, param6:uint) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("qp",[param1,param2,param3,param4,param5,param6]);
|
||||
}
|
||||
|
||||
public static function sendQuestSwipe(param1:int, param2:int, param3:int, param4:String, param5:int, param6:uint) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("qm",[param1,param2,param3,param4,param5,param6]);
|
||||
}
|
||||
|
||||
public static function sendQuestExit(param1:String) : void
|
||||
{
|
||||
DenXtCommManager.denChangePending = _wasRoomWeCameFromDen;
|
||||
gMainFrame.server.setXtObject_Str("qx",[param1]);
|
||||
}
|
||||
|
||||
public static function sendAttackPlayer(param1:String, param2:int, param3:int, param4:uint) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("qap",[param1,param2,param3,param4]);
|
||||
}
|
||||
|
||||
public static function sendQuestPlayerRequestRespawn(param1:int, param2:int, param3:int) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("qprr",[param1,param2,param3]);
|
||||
}
|
||||
|
||||
public static function sendPlantSeed(param1:int, param2:int, param3:int) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("qps",[param1,param2,param3]);
|
||||
}
|
||||
|
||||
public static function sendEatPhantom(param1:String, param2:String, param3:int, param4:int) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("qep",[param1,param2,param3,param4]);
|
||||
}
|
||||
|
||||
public static function sendPlantAte(param1:String, param2:String) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("qpa",[param1,param2]);
|
||||
}
|
||||
|
||||
public static function sendPickGiftResult(param1:int) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("qpgift",[param1]);
|
||||
}
|
||||
|
||||
public static function sendQuestCloneQuest() : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("qcq",[]);
|
||||
}
|
||||
|
||||
public static function sendQuestDropItem(param1:int, param2:int, param3:String) : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("qdroppup",[param1,param2,param3,AvatarManager.playerSfsUserId]);
|
||||
}
|
||||
|
||||
public static function sendQuestMovedItemsRequest() : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("qmi",[]);
|
||||
}
|
||||
|
||||
public static function sendPlaySwfComplete() : void
|
||||
{
|
||||
gMainFrame.server.setXtObject_Str("qplayswf",[]);
|
||||
}
|
||||
|
||||
public static function handleXtReply(param1:SFEvent) : void
|
||||
{
|
||||
var _loc2_:Object = param1.obj;
|
||||
switch(_loc2_[0])
|
||||
{
|
||||
case "qap":
|
||||
QuestManager.handleAttackPlayer(_loc2_);
|
||||
break;
|
||||
case "qau":
|
||||
QuestManager.handleQuestActorPositionUpdateResponse(_loc2_);
|
||||
break;
|
||||
case "qahs":
|
||||
QuestManager.handleActorHealthStatus(_loc2_);
|
||||
break;
|
||||
case "qas":
|
||||
QuestManager.handleQuestActorRequestSeekResponse(_loc2_);
|
||||
break;
|
||||
case "qjp":
|
||||
AvatarManager.joiningNewRoom = false;
|
||||
RoomXtCommManager._loadingNewRoom = false;
|
||||
DarkenManager.showLoadingSpiral(false);
|
||||
if(_loc2_[2] != 0)
|
||||
{
|
||||
GuiManager.setSwapBtnGray(true);
|
||||
QuestManager.handleQuestJoinResponse(_loc2_,AdventureJoin.CUSTOM_WAITING_TYPE,_loc2_[5]);
|
||||
}
|
||||
else if(_loc2_[3] == "NV")
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdOnly(14816));
|
||||
}
|
||||
else if(_loc2_[3] == "FULL")
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdOnly(14817));
|
||||
}
|
||||
else if(_loc2_[3] == "NAIR")
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdOnly(15706));
|
||||
}
|
||||
else if(_loc2_[3] == "NM")
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdOnly(14818));
|
||||
}
|
||||
else if(_loc2_[3] == "NB")
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdOnly(14819));
|
||||
}
|
||||
else if(_loc2_[3] == "NL")
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdAndInsertOnly(14697,_loc2_[4]));
|
||||
}
|
||||
else if(_loc2_[3] == "NAIL")
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdOnly(14820));
|
||||
}
|
||||
else if(_loc2_[3] == "NDL")
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdAndInsertOnly(14696,_loc2_[4]));
|
||||
}
|
||||
else if(_loc2_[3] == "NQ")
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdOnly(14822));
|
||||
}
|
||||
else
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdOnly(14816));
|
||||
}
|
||||
break;
|
||||
case "qjc":
|
||||
GuiManager.setSwapBtnGray(true);
|
||||
AvatarManager.joiningNewRoom = false;
|
||||
RoomXtCommManager._loadingNewRoom = false;
|
||||
DarkenManager.showLoadingSpiral(false);
|
||||
if(_loc2_[2] != 0)
|
||||
{
|
||||
GuiManager.closeWorldMapIfOpen();
|
||||
QuestManager.handleQuestJoinResponse(_loc2_,AdventureJoin.CUSTOM_SETTINGS_TYPE);
|
||||
}
|
||||
else if(_loc2_[3] == "NV")
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdOnly(14816));
|
||||
}
|
||||
else if(_loc2_[3] == "NAIR")
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdOnly(15706));
|
||||
}
|
||||
else if(_loc2_[3] == "NM")
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdOnly(14818));
|
||||
}
|
||||
else if(_loc2_[3] == "NL")
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdAndInsertOnly(14697,_loc2_[4]));
|
||||
}
|
||||
else if(_loc2_[3] == "NAIL")
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdOnly(14820));
|
||||
}
|
||||
else if(_loc2_[3] == "NDL")
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdAndInsertOnly(14696,_loc2_[4]));
|
||||
}
|
||||
else
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdOnly(14816));
|
||||
}
|
||||
break;
|
||||
case "qj":
|
||||
GuiManager.setSwapBtnGray(true);
|
||||
AvatarManager.joiningNewRoom = false;
|
||||
RoomXtCommManager._loadingNewRoom = false;
|
||||
DarkenManager.showLoadingSpiral(false);
|
||||
if(_loc2_[2] != 0)
|
||||
{
|
||||
QuestManager.handleQuestJoinResponse(_loc2_,AdventureJoin.NORMAL_TYPE,_loc2_[5]);
|
||||
}
|
||||
else if(_loc2_[3] == "NV")
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdOnly(14816));
|
||||
}
|
||||
else if(_loc2_[3] == "NAIR")
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdOnly(15706));
|
||||
}
|
||||
else if(_loc2_[3] == "NM")
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdOnly(14823));
|
||||
}
|
||||
else if(_loc2_[3] == "NL")
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdAndInsertOnly(14697,_loc2_[4]));
|
||||
}
|
||||
else if(_loc2_[3] == "NAIL")
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdOnly(14820));
|
||||
}
|
||||
else if(_loc2_[3] == "NDL")
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdAndInsertOnly(14696,_loc2_[4]));
|
||||
}
|
||||
else if(_loc2_[3] == "NDLERR")
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,"Total user var bits exceeded - increase support for additional levels!");
|
||||
}
|
||||
else
|
||||
{
|
||||
new SBOkPopup(GuiManager.guiLayer,LocalizationManager.translateIdOnly(14816));
|
||||
}
|
||||
break;
|
||||
case "qjx":
|
||||
GuiManager.setSwapBtnGray(false);
|
||||
QuestManager.handleQuestJoinCancelResponse(_loc2_);
|
||||
break;
|
||||
case "qw":
|
||||
QuestManager.handleQuestWaitResponse(_loc2_);
|
||||
if(_autoStartQuestOnNextWaitResponse)
|
||||
{
|
||||
_autoStartQuestOnNextWaitResponse = false;
|
||||
sendQuestStartRequest();
|
||||
}
|
||||
break;
|
||||
case "qs":
|
||||
GuiManager.setSwapBtnGray(false);
|
||||
questStartResponse(_loc2_);
|
||||
QuestManager.handleQuestStartResponse(_loc2_);
|
||||
break;
|
||||
case "qat":
|
||||
questActorTriggeredResponse(_loc2_);
|
||||
break;
|
||||
case "qcmd":
|
||||
QuestManager.handleCommand(_loc2_,false);
|
||||
break;
|
||||
case "qcmddbg":
|
||||
QuestManager.handleCommand(_loc2_,true);
|
||||
break;
|
||||
case "qp":
|
||||
QuestManager.handleLaunchProjectile(_loc2_);
|
||||
break;
|
||||
case "qm":
|
||||
QuestManager.handleSwipe(_loc2_);
|
||||
break;
|
||||
case "quxp":
|
||||
QuestManager.handleXpUpdate(_loc2_);
|
||||
break;
|
||||
case "quhp":
|
||||
QuestManager.handleHealthUpdate(_loc2_,false);
|
||||
break;
|
||||
case "qrspn":
|
||||
QuestManager.handleHealthUpdate(_loc2_,true);
|
||||
break;
|
||||
case "qad":
|
||||
QuestManager.handleActorDeath(_loc2_);
|
||||
break;
|
||||
case "qx":
|
||||
break;
|
||||
case "qxt":
|
||||
QuestManager.handleExitByType(_loc2_);
|
||||
break;
|
||||
case "qspn":
|
||||
QuestManager.handleSpawn(_loc2_);
|
||||
break;
|
||||
case "qatt":
|
||||
QuestManager.handleQuestActorTriggerTreasure(_loc2_);
|
||||
break;
|
||||
case "qusu":
|
||||
QuestManager.handleStatsUpdate(_loc2_);
|
||||
break;
|
||||
case "qulu":
|
||||
QuestManager.handleLevelUp(_loc2_);
|
||||
break;
|
||||
case "qpup":
|
||||
QuestManager.handlePickUpItem(_loc2_);
|
||||
break;
|
||||
case "qsnd":
|
||||
QuestManager.playSound(_loc2_[2],null,_loc2_[3] == "1");
|
||||
break;
|
||||
case "qmusic":
|
||||
QuestManager.playMusic(_loc2_[2]);
|
||||
break;
|
||||
case "qswfs":
|
||||
QuestManager.handleSetSwfState(_loc2_);
|
||||
break;
|
||||
case "qmlib":
|
||||
QuestManager.handleLoadMediaLib(_loc2_);
|
||||
break;
|
||||
case "qprr":
|
||||
QuestManager.handleQuestPlayerRequestRespawn(_loc2_);
|
||||
break;
|
||||
case "qpd":
|
||||
QuestManager.handleQuestPlayerDead(_loc2_);
|
||||
break;
|
||||
case "qsp":
|
||||
QuestManager.handleQuestSetPath(_loc2_);
|
||||
break;
|
||||
case "qps":
|
||||
QuestManager.handlePlantSeed(_loc2_);
|
||||
break;
|
||||
case "qpa":
|
||||
QuestManager.handlePlantAte(_loc2_[2],_loc2_[3]);
|
||||
break;
|
||||
case "qbzap":
|
||||
QuestManager.handleBeamZap(_loc2_);
|
||||
break;
|
||||
case "qpzap":
|
||||
QuestManager.handlePhantomZap(_loc2_);
|
||||
break;
|
||||
case "qpgift":
|
||||
QuestManager.handlePickGift(_loc2_);
|
||||
break;
|
||||
case "qplq":
|
||||
QuestManager.handlePlayerLeftQuest(_loc2_);
|
||||
break;
|
||||
case "qrc":
|
||||
QuestManager.handleQuestRoomChange(_loc2_);
|
||||
break;
|
||||
case "qviu":
|
||||
QuestManager.handleQuestVolumeInteractionUpdate(_loc2_);
|
||||
break;
|
||||
case "qtorch":
|
||||
QuestManager.handleQuestTorch(_loc2_);
|
||||
break;
|
||||
case "qgi":
|
||||
questPickUpItem(_loc2_[2]);
|
||||
break;
|
||||
case "qsndpk":
|
||||
QuestManager.loadQuestSfx(_loc2_[2]);
|
||||
break;
|
||||
case "qicon":
|
||||
QuestManager.handleActorIcon(_loc2_[2],_loc2_[3]);
|
||||
break;
|
||||
case "qseed":
|
||||
QuestManager.handleGiveSeed(_loc2_[2],_loc2_[3],_loc2_[4]);
|
||||
break;
|
||||
case "qmi":
|
||||
QuestManager.handleMovedItemList(_loc2_ as Array);
|
||||
break;
|
||||
case "qepr":
|
||||
QuestManager.handlePlantEatRecoil(_loc2_[2]);
|
||||
break;
|
||||
case "qplayswf":
|
||||
QuestManager.handlePlaySwf(_loc2_[2]);
|
||||
break;
|
||||
case "qshake":
|
||||
QuestManager.handleShake(_loc2_[2]);
|
||||
break;
|
||||
case "qaward":
|
||||
QuestManager.handleAward(_loc2_[2],_loc2_[3]);
|
||||
break;
|
||||
case "qposturi":
|
||||
QuestManager.handlePostUri(_loc2_[2]);
|
||||
break;
|
||||
case "qpreloadswf":
|
||||
QuestManager.handlPreloadSwf(_loc2_[2]);
|
||||
break;
|
||||
case "qfade":
|
||||
QuestManager.handleFade(_loc2_[2] == 1);
|
||||
break;
|
||||
case "qavsw":
|
||||
QuestManager.handleAvSwitch(_loc2_);
|
||||
}
|
||||
}
|
||||
|
||||
private static function questStartResponse(param1:Object) : void
|
||||
{
|
||||
var _loc6_:String = null;
|
||||
var _loc7_:Dictionary = null;
|
||||
var _loc8_:Object = null;
|
||||
var _loc9_:String = null;
|
||||
var _loc10_:int = 0;
|
||||
var _loc11_:int = 0;
|
||||
var _loc12_:String = null;
|
||||
var _loc13_:int = 0;
|
||||
var _loc14_:Boolean = false;
|
||||
var _loc15_:Boolean = false;
|
||||
var _loc16_:String = null;
|
||||
var _loc17_:String = null;
|
||||
var _loc2_:* = 2;
|
||||
var _loc3_:int = int(param1[_loc2_++]);
|
||||
var _loc4_:int = int(param1[_loc2_++]);
|
||||
var _loc5_:* = int(param1[_loc2_++]);
|
||||
if(_loc5_ >= 0)
|
||||
{
|
||||
_loc6_ = param1[_loc2_++];
|
||||
_loc7_ = new Dictionary();
|
||||
while(_loc5_ > 0)
|
||||
{
|
||||
_loc8_ = new Object();
|
||||
_loc9_ = param1[_loc2_++];
|
||||
_loc10_ = int(param1[_loc2_++]);
|
||||
_loc11_ = 0;
|
||||
_loc12_ = null;
|
||||
if(_loc10_ == QuestActor.QUEST_ACTOR_TYPE_SPEAKER)
|
||||
{
|
||||
_loc12_ = param1[_loc2_++];
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc11_ = int(param1[_loc2_++]);
|
||||
}
|
||||
_loc13_ = int(param1[_loc2_++]);
|
||||
_loc14_ = param1[_loc2_++] == 1;
|
||||
_loc15_ = param1[_loc2_++] == 1;
|
||||
_loc16_ = param1[_loc2_++];
|
||||
_loc17_ = param1[_loc2_++];
|
||||
_loc8_.visible = _loc14_;
|
||||
_loc8_.requireClick = _loc15_;
|
||||
_loc8_.defId = _loc11_;
|
||||
_loc8_.defName = _loc12_;
|
||||
_loc8_.type = _loc10_;
|
||||
_loc8_.state = _loc13_;
|
||||
_loc8_.pathName = _loc16_ != "" ? _loc16_ : null;
|
||||
QuestManager.initInitialActorStatus(_loc8_,null);
|
||||
_loc8_.pendingSwfStateName = _loc17_;
|
||||
_loc7_[_loc9_] = _loc8_;
|
||||
_loc5_--;
|
||||
}
|
||||
QuestManager.setActorDictionary(_loc7_,_loc6_);
|
||||
QuestManager.hasJustJoinedQuest = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
AvatarManager.joiningNewRoom = false;
|
||||
RoomXtCommManager._loadingNewRoom = false;
|
||||
}
|
||||
}
|
||||
|
||||
private static function questActorTriggeredResponse(param1:Object) : void
|
||||
{
|
||||
}
|
||||
|
||||
public static function questNPCDefResponse(param1:DefPacksDefHelper) : void
|
||||
{
|
||||
var _loc4_:Object = null;
|
||||
var _loc5_:Object = null;
|
||||
var _loc2_:Object = param1.def;
|
||||
DefPacksDefHelper.mediaArray[DefPacksDefHelper.DEF_NPC] = null;
|
||||
var _loc3_:Object = new Object();
|
||||
for each(_loc5_ in param1.def)
|
||||
{
|
||||
_loc4_ = {
|
||||
"avatarRefId":int(_loc5_.avatarRefId),
|
||||
"backColor":Number(_loc5_.backColor),
|
||||
"backItemRefId":int(_loc5_.backItemRefId),
|
||||
"eyesColor":Number(_loc5_.eyesColor),
|
||||
"eyesItemRefId":int(_loc5_.eyesItemRefId),
|
||||
"legColor":Number(_loc5_.legColor),
|
||||
"legItemRefId":int(_loc5_.legItemRefId),
|
||||
"headColor":int(_loc5_.headColor),
|
||||
"headMediaRefId":uint(_loc5_.headMediaRefId),
|
||||
"headItemRefId":int(_loc5_.headItemRefId),
|
||||
"defId":int(_loc5_.id),
|
||||
"mediaRefId":int(_loc5_.mediaRefId),
|
||||
"neckColor":Number(_loc5_.neckColor),
|
||||
"neckItemRefId":int(_loc5_.neckItemRefId),
|
||||
"patternColor":Number(_loc5_.patternColor),
|
||||
"patternItemRefId":int(_loc5_.patternItemRefId),
|
||||
"tailColor":Number(_loc5_.tailColor),
|
||||
"tailItemRefId":int(_loc5_.tailItemRefId),
|
||||
"titleStrId":int(_loc5_.titleStrId),
|
||||
"type":int(_loc5_.type),
|
||||
"baseColor":int(_loc5_.baseColor),
|
||||
"hps":int(_loc5_.hps),
|
||||
"defense":int(_loc5_.defense),
|
||||
"xpValue":int(_loc5_.xpValue),
|
||||
"iconMediaRefId":int(_loc5_.iconMediaRefId),
|
||||
"level":int(_loc5_.level),
|
||||
"attackable":int(_loc5_.attackable),
|
||||
"damageTouch":int(_loc5_.damageTouch)
|
||||
};
|
||||
_loc3_[_loc4_.defId] = _loc4_;
|
||||
}
|
||||
QuestManager.npcDefs = _loc3_;
|
||||
}
|
||||
|
||||
public static function scriptResponse(param1:DefPacksDefHelper) : void
|
||||
{
|
||||
var _loc4_:Object = null;
|
||||
var _loc5_:Object = null;
|
||||
var _loc2_:Object = param1.def;
|
||||
DefPacksDefHelper.mediaArray[DefPacksDefHelper.DEF_SCRIPT] = null;
|
||||
var _loc3_:Object = new Object();
|
||||
for each(_loc5_ in param1.def)
|
||||
{
|
||||
_loc4_ = {
|
||||
"defId":int(_loc5_.id),
|
||||
"avatarLimit":int(_loc5_.avatarLimit),
|
||||
"avatarMin":int(_loc5_.avatarMin),
|
||||
"descStrId":int(_loc5_.descStrId),
|
||||
"difficulty":int(_loc5_.difficulty),
|
||||
"levelMin":int(_loc5_.levelMin),
|
||||
"mediaRefId":int(_loc5_.mediaRefId),
|
||||
"time":int(_loc5_.time),
|
||||
"titleStrId":int(_loc5_.titleStrId),
|
||||
"hudType":int(_loc5_.hudType),
|
||||
"bannerMediaRefId":int(_loc5_.bannerMediaRefId),
|
||||
"membersOnly":(_loc5_.membersOnly == "1" ? true : false)
|
||||
};
|
||||
_loc3_[_loc4_.defId] = _loc4_;
|
||||
}
|
||||
_scriptDefs = _loc3_;
|
||||
}
|
||||
|
||||
public static function roomJoined(param1:String) : void
|
||||
{
|
||||
QuestManager.questRoomJoined(param1.indexOf("quest_") == 0);
|
||||
}
|
||||
|
||||
public static function getScriptDef(param1:int) : Object
|
||||
{
|
||||
return _scriptDefs[param1];
|
||||
}
|
||||
|
||||
private static function searchQuestCache(param1:int) : Object
|
||||
{
|
||||
return _questCache[param1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,340 @@
|
||||
package quest
|
||||
{
|
||||
import flash.display.MovieClip;
|
||||
import flash.events.MouseEvent;
|
||||
import flash.filters.ColorMatrixFilter;
|
||||
import flash.geom.Point;
|
||||
import flash.utils.Dictionary;
|
||||
import gui.GuiManager;
|
||||
import loader.MediaHelper;
|
||||
import room.RoomManagerWorld;
|
||||
|
||||
public class SeedInventoryHandling
|
||||
{
|
||||
|
||||
public const MAX_NUM_SEEDS:int = 5;
|
||||
|
||||
private var _seedsInventory:Dictionary;
|
||||
|
||||
private var _draggedSeed:MovieClip;
|
||||
|
||||
private var _mediaHelper:MediaHelper;
|
||||
|
||||
private var _mediaItems:Array;
|
||||
|
||||
private var _clickStartX:Number;
|
||||
|
||||
private var _clickStartY:Number;
|
||||
|
||||
public function SeedInventoryHandling()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(param1:Dictionary) : void
|
||||
{
|
||||
this._mediaItems = [];
|
||||
this._seedsInventory = param1;
|
||||
this.setupInventoryWindows();
|
||||
}
|
||||
|
||||
public function destroy() : void
|
||||
{
|
||||
var _loc1_:MovieClip = null;
|
||||
if(Boolean(this._draggedSeed) && this._draggedSeed.parent == GuiManager.guiLayer)
|
||||
{
|
||||
GuiManager.guiLayer.removeChild(this._draggedSeed);
|
||||
}
|
||||
this._draggedSeed = null;
|
||||
var _loc2_:int = 0;
|
||||
while(_loc2_ < this.MAX_NUM_SEEDS)
|
||||
{
|
||||
_loc1_ = GuiManager.mainHud["inventoriesWindow" + _loc2_];
|
||||
if(_loc1_)
|
||||
{
|
||||
_loc1_.removeEventListener(MouseEvent.MOUSE_DOWN,this.onSeedsClickStart);
|
||||
}
|
||||
_loc2_++;
|
||||
}
|
||||
this._seedsInventory = null;
|
||||
}
|
||||
|
||||
public function rebuildInventory(param1:Dictionary) : void
|
||||
{
|
||||
this._seedsInventory = param1;
|
||||
this.setupInventoryWindows();
|
||||
}
|
||||
|
||||
public function removeLastDraggedSeed() : void
|
||||
{
|
||||
if(this._draggedSeed)
|
||||
{
|
||||
this._draggedSeed.removeEventListener(MouseEvent.MOUSE_DOWN,this.onSeedsDragDown);
|
||||
this._draggedSeed.removeEventListener(MouseEvent.MOUSE_UP,this.onSeedsClickStartUp);
|
||||
this._draggedSeed.removeEventListener(MouseEvent.MOUSE_MOVE,this.onSeedMove);
|
||||
this._draggedSeed.stopDrag();
|
||||
if(this._draggedSeed.parent == GuiManager.guiLayer)
|
||||
{
|
||||
GuiManager.guiLayer.removeChild(this._draggedSeed);
|
||||
}
|
||||
this._draggedSeed = null;
|
||||
}
|
||||
}
|
||||
|
||||
private function setupInventoryWindows() : void
|
||||
{
|
||||
var _loc1_:Object = null;
|
||||
var _loc2_:int = 0;
|
||||
var _loc3_:MovieClip = null;
|
||||
var _loc4_:int = 0;
|
||||
var _loc5_:int = 0;
|
||||
var _loc6_:int = 0;
|
||||
var _loc7_:String = null;
|
||||
var _loc8_:Object = null;
|
||||
var _loc9_:Array = null;
|
||||
this._mediaItems = [];
|
||||
for(_loc7_ in this._seedsInventory)
|
||||
{
|
||||
_loc1_ = QuestManager.getNPCDef(int(_loc7_));
|
||||
if(_loc1_)
|
||||
{
|
||||
_loc2_ = int(_loc1_.mediaRefId);
|
||||
_loc3_ = GuiManager.mainHud["inventoriesWindow" + _loc4_];
|
||||
if(_loc3_ != null && _loc3_.numChildren > 0)
|
||||
{
|
||||
_loc8_ = _loc3_.getChildAt(0);
|
||||
if(_loc8_.hasOwnProperty("txt"))
|
||||
{
|
||||
_loc5_ = int(this._seedsInventory[_loc7_].count);
|
||||
_loc6_ = int(this._seedsInventory[_loc7_].max);
|
||||
_loc8_.txt.text = _loc5_ + "/" + _loc6_;
|
||||
if(_loc5_ == 0)
|
||||
{
|
||||
_loc9_ = new Array();
|
||||
_loc9_ = _loc9_.concat([0.33,0.33,0.33,0,0]);
|
||||
_loc9_ = _loc9_.concat([0.33,0.33,0.33,0,0]);
|
||||
_loc9_ = _loc9_.concat([0.33,0.33,0.33,0,0]);
|
||||
_loc9_ = _loc9_.concat([0,0,0,1,0]);
|
||||
_loc8_.filters = [new ColorMatrixFilter(_loc9_)];
|
||||
_loc3_.mouseEnabled = false;
|
||||
_loc3_.mouseChildren = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(_loc5_ >= _loc6_)
|
||||
{
|
||||
_loc8_.gotoAndPlay("on");
|
||||
}
|
||||
_loc8_.filters = null;
|
||||
_loc3_.mouseEnabled = true;
|
||||
_loc3_.mouseChildren = true;
|
||||
}
|
||||
_loc4_++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if(_loc2_ != 0)
|
||||
{
|
||||
this._mediaHelper = new MediaHelper();
|
||||
this._mediaHelper.init(_loc2_,this.onSeedLoaded,{
|
||||
"index":_loc4_,
|
||||
"contIcon":true,
|
||||
"defId":int(_loc7_)
|
||||
});
|
||||
this._mediaItems[_loc4_] = this._mediaHelper;
|
||||
this._mediaHelper = new MediaHelper();
|
||||
this._mediaHelper.init(_loc2_,this.onSeedLoaded,{
|
||||
"index":_loc4_,
|
||||
"contIcon":false,
|
||||
"defId":int(_loc7_)
|
||||
});
|
||||
this._mediaItems[_loc4_ + 1] = this._mediaHelper;
|
||||
_loc4_++;
|
||||
}
|
||||
}
|
||||
}
|
||||
while(_loc4_ < this.MAX_NUM_SEEDS)
|
||||
{
|
||||
_loc3_ = GuiManager.mainHud["inventoriesWindow" + _loc4_];
|
||||
if(_loc3_ != null)
|
||||
{
|
||||
_loc3_.mouseEnabled = false;
|
||||
_loc3_.mouseChildren = false;
|
||||
_loc3_.visible = false;
|
||||
}
|
||||
_loc4_++;
|
||||
}
|
||||
}
|
||||
|
||||
private function onSeedLoaded(param1:MovieClip) : void
|
||||
{
|
||||
var _loc2_:MovieClip = null;
|
||||
var _loc3_:MovieClip = null;
|
||||
var _loc4_:int = 0;
|
||||
var _loc5_:int = 0;
|
||||
var _loc6_:Array = null;
|
||||
if(param1)
|
||||
{
|
||||
param1.setAsIcon();
|
||||
if(param1.passback.contIcon)
|
||||
{
|
||||
_loc2_ = GETDEFINITIONBYNAME("vftCont");
|
||||
_loc3_ = GuiManager.mainHud["inventoriesWindow" + param1.passback.index];
|
||||
_loc4_ = int(this._seedsInventory[param1.passback.defId].count);
|
||||
_loc5_ = int(this._seedsInventory[param1.passback.defId].max);
|
||||
_loc2_.itemWindow.addChild(param1.getNPC());
|
||||
_loc2_.txt.text = _loc4_ + "/" + _loc5_;
|
||||
if(_loc4_ == 0)
|
||||
{
|
||||
_loc6_ = new Array();
|
||||
_loc6_ = _loc6_.concat([0.33,0.33,0.33,0,0]);
|
||||
_loc6_ = _loc6_.concat([0.33,0.33,0.33,0,0]);
|
||||
_loc6_ = _loc6_.concat([0.33,0.33,0.33,0,0]);
|
||||
_loc6_ = _loc6_.concat([0,0,0,1,0]);
|
||||
_loc2_.filters = [new ColorMatrixFilter(_loc6_)];
|
||||
if(_loc3_ != null)
|
||||
{
|
||||
_loc3_.mouseEnabled = false;
|
||||
_loc3_.mouseChildren = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(_loc4_ >= _loc5_)
|
||||
{
|
||||
_loc2_.gotoAndPlay("on");
|
||||
}
|
||||
_loc2_.filters = null;
|
||||
if(_loc3_ != null)
|
||||
{
|
||||
_loc3_.mouseEnabled = true;
|
||||
_loc3_.mouseChildren = true;
|
||||
}
|
||||
}
|
||||
if(_loc3_ != null)
|
||||
{
|
||||
while(_loc3_.numChildren > 0)
|
||||
{
|
||||
_loc3_.removeChildAt(0);
|
||||
}
|
||||
_loc3_.addChild(_loc2_);
|
||||
_loc3_.addEventListener(MouseEvent.MOUSE_DOWN,this.onSeedsClickStart,false,0,true);
|
||||
_loc3_.visible = true;
|
||||
}
|
||||
}
|
||||
else if(GuiManager.mainHud["inventoriesWindow" + param1.passback.index] != null)
|
||||
{
|
||||
GuiManager.mainHud["inventoriesWindow" + param1.passback.index].dragIcon = param1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function onSeedsClickStart(param1:MouseEvent) : void
|
||||
{
|
||||
param1.stopPropagation();
|
||||
this._clickStartX = param1.stageX;
|
||||
this._clickStartY = param1.stageY;
|
||||
if(this._draggedSeed == null || this._draggedSeed.windowName != param1.currentTarget.name)
|
||||
{
|
||||
if(Boolean(this._draggedSeed) && this._draggedSeed.parent == GuiManager.guiLayer)
|
||||
{
|
||||
GuiManager.guiLayer.removeChild(this._draggedSeed);
|
||||
}
|
||||
this._draggedSeed = param1.currentTarget.dragIcon.getNPC();
|
||||
this._draggedSeed.custom = {
|
||||
"prevPositionX":0,
|
||||
"prevPositionY":0,
|
||||
"xOut":false,
|
||||
"currWindow":param1.currentTarget
|
||||
};
|
||||
this._draggedSeed.addEventListener(MouseEvent.MOUSE_UP,this.onSeedsClickStartUp,false,0,true);
|
||||
this._draggedSeed.addEventListener(MouseEvent.MOUSE_MOVE,this.onSeedMove,false,0,true);
|
||||
this._draggedSeed.addEventListener(MouseEvent.MOUSE_DOWN,this.onSeedsDragDown,false,0,true);
|
||||
this._draggedSeed.x = param1.currentTarget.x;
|
||||
this._draggedSeed.y = param1.currentTarget.y;
|
||||
this._draggedSeed.custom.prevPositionX = 0;
|
||||
this._draggedSeed.custom.prevPositionY = 0;
|
||||
this._draggedSeed.custom.xOut = false;
|
||||
param1.currentTarget.dragIcon.setAsIcon();
|
||||
this._draggedSeed.passback = param1.currentTarget.dragIcon.passback;
|
||||
GuiManager.guiLayer.addChild(this._draggedSeed);
|
||||
}
|
||||
this._draggedSeed.startDrag(true);
|
||||
QuestManager.playSound("ajq_boomSeedSelect");
|
||||
}
|
||||
|
||||
private function onSeedsDragDown(param1:MouseEvent) : void
|
||||
{
|
||||
param1.stopPropagation();
|
||||
}
|
||||
|
||||
private function onSeedsClickStartUp(param1:MouseEvent) : void
|
||||
{
|
||||
param1.stopPropagation();
|
||||
if(Math.abs(this._clickStartX - param1.stageX) > 2 || Math.abs(this._clickStartY - param1.stageY) > 2)
|
||||
{
|
||||
this.onSeedsClickEnd(param1);
|
||||
}
|
||||
else if(this._draggedSeed != null)
|
||||
{
|
||||
this._clickStartX = -99999;
|
||||
this._clickStartY = -99999;
|
||||
}
|
||||
}
|
||||
|
||||
private function onSeedMove(param1:MouseEvent) : void
|
||||
{
|
||||
var _loc5_:Point = null;
|
||||
param1.stopPropagation();
|
||||
if(Math.abs(this._clickStartX - param1.stageX) > 2 || Math.abs(this._clickStartY - param1.stageY) > 2)
|
||||
{
|
||||
this._clickStartX = -99999;
|
||||
this._clickStartY = -99999;
|
||||
}
|
||||
var _loc2_:Number = param1.stageX - this._draggedSeed.custom.prevPositionX;
|
||||
var _loc3_:Number = param1.stageY - this._draggedSeed.custom.prevPositionY;
|
||||
var _loc4_:Number = _loc2_ * _loc2_ + _loc3_ * _loc3_;
|
||||
if(_loc4_ > 9)
|
||||
{
|
||||
this._draggedSeed.custom.prevPositionX = param1.stageX;
|
||||
this._draggedSeed.custom.prevPositionY = param1.stageY;
|
||||
_loc5_ = RoomManagerWorld.instance.convertScreenToWorldSpace(param1.stageX,param1.stageY);
|
||||
if(QuestManager.validatePlantSeedLocation(_loc5_) == false)
|
||||
{
|
||||
if(!param1.currentTarget.custom.xOut)
|
||||
{
|
||||
param1.currentTarget.custom.currWindow.dragIcon.setAsIconX();
|
||||
param1.currentTarget.custom.xOut = true;
|
||||
}
|
||||
}
|
||||
else if(param1.currentTarget.custom.xOut)
|
||||
{
|
||||
param1.currentTarget.custom.currWindow.dragIcon.setAsIcon();
|
||||
param1.currentTarget.custom.xOut = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function onSeedsClickEnd(param1:MouseEvent) : void
|
||||
{
|
||||
var _loc2_:Point = null;
|
||||
var _loc3_:Boolean = false;
|
||||
param1.stopPropagation();
|
||||
if(this._draggedSeed)
|
||||
{
|
||||
_loc2_ = RoomManagerWorld.instance.convertScreenToWorldSpace(param1.stageX,param1.stageY);
|
||||
_loc3_ = this._draggedSeed.hitTestObject(this._draggedSeed.custom.currWindow);
|
||||
if(!_loc3_)
|
||||
{
|
||||
if(QuestManager.validatePlantSeedLocation(_loc2_))
|
||||
{
|
||||
QuestXtCommManager.sendPlantSeed(this._draggedSeed.passback.defId,_loc2_.x,_loc2_.y);
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.removeLastDraggedSeed();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user