package
{
import com.utils.*;
import flash.display.*;
import ninjasaga.*;
import ninjasaga.data.*;
public class Ene_91 extends EnemyBase
{
public function Ene_91()
{
addFrameScript(19, this.frame20, 40, this.frame41, 54, this.frame55, 73, this.frame74, 79, this.frame80, 94, this.frame95, 116, this.frame117, 126, this.frame127, 137, this.frame138, 160, this.frame161, 187, this.frame188, 211, this.frame212, 238, this.frame239, 268, this.frame269, 293, this.frame294, 314, this.frame315, 344, this.frame345, 372, this.frame373, 412, this.frame413, 429, this.frame430, 457, this.frame458, 477, this.frame478, 506, this.frame507, 519, this.frame520, 527, this.frame528, 546, this.frame547, 564, this.frame565, 579, this.frame580, 617, this.frame618);
this._enemyType = 6;
this._minLevel = 1;
this._maxLevel = 99;
this._Resistance = [{"type":ninjasaga.data.BattleData.EFFECT_STUN, "change":10}];
super();
this.dbChar.character_name = ninjasaga.Central.main.langLib.enemyDataTxt(ninjasaga.data.Enemy_LangData.ENE_91_NAME);
this._dbCharacter.character_speed = Math.round((9 + this._dbCharacter.character_level) * 1.2);
this._dbCharacter.character_lightning = Math.round(this._dbCharacter.character_level * 0.2);
this._dbCharacter.character_earth = Math.round(this._dbCharacter.character_level * 0.3);
this._dbCharacter.character_max_hp = Math.round(700 + (this._dbCharacter.character_level - 1) * (50 + 1.8 * this._dbCharacter.character_level));
this._dbCharacter.character_max_cp = Math.round(700 + (this._dbCharacter.character_level - 1) * (50 + 1.8 * this._dbCharacter.character_level));
this.BaseDmg = Math.round(25 + this._dbCharacter.character_level / 2 * (1 + 0.06 * this._dbCharacter.character_level));
this.SkillArray = [{"id":1, "lock":false, "priority":11, "desc":"Claw", "name":"", "action":"attack", "animation":"attack_01", "posType":ninjasaga.data.PositionType.MELEE_1, "dmg":Math.round(this.BaseDmg * 0.8), "Cooldown":0, "target":"threat_1"}, {"id":2, "lock":false, "priority":10, "desc":"Fire Ball ", "name":ninjasaga.Central.main.langLib.enemyDataTxt(ninjasaga.data.Enemy_LangData.ENE_91_SKILL_002), "action":"attack", "animation":"attack_02", "posType":ninjasaga.data.PositionType.RANGE_1, "dmg":Math.round(this.BaseDmg * 0.85), "Cooldown":2, "target":"threat_2"}, {"id":3, "lock":false, "priority":9, "desc":"Flame Wheel", "name":ninjasaga.Central.main.langLib.enemyDataTxt(ninjasaga.data.Enemy_LangData.ENE_91_SKILL_003), "action":"attack", "animation":"attack_03", "posType":ninjasaga.data.PositionType.RANGE_1, "dmg":Math.round(this.BaseDmg * 0.9), "Cooldown":4, "target":"threat_1"}, {"id":4, "lock":false, "priority":6, "desc":"Blazing Claw", "name":ninjasaga.Central.main.langLib.enemyDataTxt(ninjasaga.data.Enemy_LangData.ENE_91_SKILL_004), "action":"attack", "animation":"attack_04", "posType":ninjasaga.data.PositionType.MELEE_1, "dmg":Math.round(this.BaseDmg * 1), "Cooldown":6, "target":"threat_1"}, {"id":5, "lock":false, "priority":3, "desc":"Self Explosion", "name":ninjasaga.Central.main.langLib.enemyDataTxt(ninjasaga.data.Enemy_LangData.ENE_91_SKILL_005), "action":"attack", "animation":"attack_05", "posType":ninjasaga.data.PositionType.MELEE_1, "dmg":Math.round(this.BaseDmg * 1.3), "Cooldown":15, "target":"threat_1"}, {"id":6, "lock":true, "priority":8, "desc":"Fire Bullet Combo", "name":ninjasaga.Central.main.langLib.enemyDataTxt(ninjasaga.data.Enemy_LangData.ENE_91_SKILL_006), "action":"attack", "animation":"attack_06", "posType":ninjasaga.data.PositionType.RANGE_1, "dmg":Math.round(this.BaseDmg * 0.8), "Cooldown":6, "target":"all"}, {"id":7, "lock":true, "priority":4, "desc":"Fire Dragon Explosion", "name":ninjasaga.Central.main.langLib.enemyDataTxt(ninjasaga.data.Enemy_LangData.ENE_91_SKILL_007), "action":"attack", "animation":"attack_07", "posType":ninjasaga.data.PositionType.RANGE_2, "dmg":Math.round(this.BaseDmg * 1.2), "Cooldown":6, "target":"all", "effect":{"type":ninjasaga.data.BattleData.EFFECT_BURNING, "duration":4, "amount":1}}, {"id":8, "lock":true, "priority":7, "desc":"Red Dragon Vortex", "name":ninjasaga.Central.main.langLib.enemyDataTxt(ninjasaga.data.Enemy_LangData.ENE_91_SKILL_008), "action":"attack", "animation":"attack_08", "posType":ninjasaga.data.PositionType.RANGE_1, "dmg":Math.round(this.BaseDmg * 0.9), "Cooldown":18, "target":"all", "effect":{"type":ninjasaga.data.BattleData.EFFECT_BURNING, "duration":4, "amount":1}}, {"id":9, "lock":true, "priority":2, "desc":"Fire Energy", "name":ninjasaga.Central.main.langLib.enemyDataTxt(ninjasaga.data.Enemy_LangData.ENE_91_SKILL_009), "action":"special", "animation":"attack_09", "posType":ninjasaga.data.PositionType.RANGE_3, "dmg":0, "Cooldown":24, "target":"self", "heal":this._dbCharacter.character_level * 15, "effect":{"type":ninjasaga.data.BattleData.EFFECT_HEAL}}, {"id":10, "lock":false, "priority":1, "desc":"Fire Power", "name":ninjasaga.Central.main.langLib.enemyDataTxt(ninjasaga.data.Enemy_LangData.ENE_91_SKILL_010), "action":"special", "animation":"attack_10", "posType":ninjasaga.data.PositionType.RANGE_3, "dmg":0, "Cooldown":16, "target":"self", "effect":{"type":ninjasaga.data.BattleData.EFFECT_DAMAGE_BONUS, "duration":5, "amount":15}}, {"id":11, "lock":true, "priority":5, "desc":"Evil Poison", "name":ninjasaga.Central.main.langLib.enemyDataTxt(ninjasaga.data.Enemy_LangData.ENE_91_SKILL_011), "action":"attack", "animation":"attack_11", "posType":ninjasaga.data.PositionType.RANGE_2, "dmg":Math.round(this.BaseDmg * 0.2), "Cooldown":20, "target":"all", "effect":{"type":ninjasaga.data.BattleData.EFFECT_POISON, "duration":3, "amount":8}}];
return;
}
public function LoadSkillData(arg1:int, arg2:Object):Object
{
var loc1:*;
loc1 = null;
var loc3:*;
loc3 = null;
var loc4:*;
loc4 = 0;
var loc2:*;
loc2 = ninjasaga.data.Formula.calcDamage({"damage":this._damage});
arg2.battleSkillCooldown[this.SkillArray[arg1].name] = this.SkillArray[arg1].Cooldown;
if (this.SkillArray[arg1].name != "")
{
ninjasaga.Central.main.showInfo(this.SkillArray[arg1].name);
}
loc2 = ninjasaga.data.Formula.calcDamage({"damage":this.SkillArray[arg1].dmg});
loc4 = this.SkillArray[arg1].heal;
loc3 = this.SkillArray[arg1].effect;
loc1 = {"action":this.SkillArray[arg1].action, "animation":this.SkillArray[arg1].animation, "posType":this.SkillArray[arg1].posType, "dmg":loc2, "effect":loc3, "target":this.SkillArray[arg1].target, "heal":loc4};
this.target = this.CheckSkillTarget(this.SkillArray[arg1].target, arg2);
return loc1;
}
public function CheckSkillTarget(arg1:String, arg2:Object):*
{
var loc1:*;
loc1 = undefined;
var loc2:*;
loc2 = undefined;
var loc3:*;
loc3 = null;
var loc6:*;
loc6 = 0;
loc3 = arg2.getThreat();
var loc4:*;
loc4 = [];
var loc5:*;
loc5 = ninjasaga.Central.battle.partyArr;
if (loc3[ninjasaga.Central.main.getMainChar().getData(ninjasaga.data.DBCharacterData.ID)])
{
loc4.push({"char":ninjasaga.Central.main.getMainChar(), "threat":loc3[ninjasaga.Central.main.getMainChar().getData(ninjasaga.data.DBCharacterData.ID)].total, "hp":ninjasaga.Central.main.getMainChar().getData(ninjasaga.data.DBCharacterData.HP)});
}
if (loc5 != null)
{
loc6 = 0;
while (loc6 < loc5.length)
{
if (!loc5[loc6].isDead)
{
if (loc3[loc5[loc6].getData(ninjasaga.data.DBCharacterData.ID)])
{
loc4.push({"char":loc5[loc6], "threat":loc3[loc5[loc6].getData(ninjasaga.data.DBCharacterData.ID)].total, "hp":loc5[loc6].getData(ninjasaga.data.DBCharacterData.HP)});
}
}
loc6 = (loc6 + 1);
}
}
if (loc4.length == 0)
{
if (arg1 == "self")
{
return arg2;
}
return null;
}
var loc7:*;
loc7 = arg1;
switch (loc7)
{
case "self":
{
loc1 = arg2;
break;
}
case "threat_1":
{
loc4.sortOn("threat", Array.NUMERIC | Array.DESCENDING);
loc1 = loc4[0].char;
break;
}
case "threat_2":
{
loc4.sortOn("threat", Array.NUMERIC | Array.DESCENDING);
loc1 = loc4[0].char;
if (loc4[1])
{
loc1 = loc4[1].char;
}
break;
}
case "threat_3":
{
loc4.sortOn("threat", Array.NUMERIC | Array.DESCENDING);
loc1 = loc4[0].char;
if (loc4[2])
{
loc1 = loc4[2].char;
}
break;
}
case "hp_1":
{
loc4.sortOn("hp", Array.NUMERIC | Array.DESCENDING);
loc1 = loc4[0].char;
break;
}
case "hp_2":
{
loc4.sortOn("hp", Array.NUMERIC | Array.DESCENDING);
loc1 = loc4[0].char;
if (loc4[1])
{
loc1 = loc4[1].char;
}
break;
}
case "hp_3":
{
loc4.sortOn("hp", Array.NUMERIC | Array.DESCENDING);
loc1 = loc4[0].char;
if (loc4[2])
{
loc1 = loc4[2].char;
}
break;
}
case "all":
{
loc4.sortOn("threat", Array.NUMERIC | Array.DESCENDING);
loc1 = loc4[0].char;
break;
}
default:
{
loc1 = null;
break;
}
}
return loc1;
}
public function CheckSkillCooldown(arg1:int, arg2:Object):Boolean
{
var loc1:*;
loc1 = false;
loc1 = true;
loc1 = arg2.isBattleSkillCooldown(this.SkillArray[arg1].name);
return loc1;
}
public function getBattleAction():Object
{
var loc3:*;
loc3 = null;
var loc4:*;
loc4 = null;
var loc5:*;
loc5 = 0;
var loc6:*;
loc6 = 0;
var loc7:*;
loc7 = null;
var loc9:*;
loc9 = NaN;
var loc10:*;
loc10 = undefined;
var loc11:*;
loc11 = null;
var loc12:*;
loc12 = null;
var loc13:*;
loc13 = 0;
var loc1:*;
loc1 = ninjasaga.data.Formula.calcDamage({"damage":this._damage});
var loc2:*;
loc2 = com.utils.NumberUtil.getRandom();
var loc8:*;
loc8 = ninjasaga.Central.battle.enemyArr;
loc5 = 0;
while (loc5 < loc8.length)
{
if (loc8[loc5].getData(ninjasaga.data.DBCharacterData.ID) == this._dbCharacter.character_id)
{
loc9 = loc8[loc5].hp / loc8[loc5].maxHP;
loc10 = loc8[loc5];
break;
}
loc5 = (loc5 + 1);
}
loc7 = loc10.getThreat();
if (this._dbCharacter.character_level >= 10)
{
this.SkillArray[5].lock = false;
}
if (loc9 <= 0.3 && this._dbCharacter.character_level >= 30)
{
this.SkillArray[6].lock = false;
}
if (this._dbCharacter.character_level >= 15)
{
this.SkillArray[10].lock = false;
}
if (this._dbCharacter.character_level >= 20)
{
this.SkillArray[7].lock = false;
}
if (loc9 <= 0.5 && this._dbCharacter.character_level >= 20)
{
this.SkillArray[8].lock = false;
}
loc3 = null;
loc6 = 1;
while (loc6 <= this.MaxPiority)
{
if (loc3 == null)
{
loc5 = 0;
while (loc5 < this.SkillArray.length)
{
if (loc3 == null && !this.CheckSkillCooldown(loc5, loc10) && this.SkillArray[loc5].lock == false && this.SkillArray[loc5].priority == loc6)
{
loc3 = this.LoadSkillData(loc5, loc10);
}
loc5 = (loc5 + 1);
}
}
loc6 = (loc6 + 1);
}
if (loc3 == null)
{
loc3 = this.LoadSkillData(0, loc10);
}
if (this.target == null)
{
loc11 = [];
if ((loc12 = ninjasaga.Central.battle.partyArr) != null)
{
loc5 = 0;
while (loc5 < loc12.length)
{
if (!loc12[loc5].isDead)
{
loc11.push(loc12[loc5]);
}
loc5 = (loc5 + 1);
}
}
if (loc2 >= 0.3 && loc11.length > 0)
{
loc13 = Math.floor(com.utils.NumberUtil.randomNumber(0, loc11.length - 0.001));
this.target = loc11[loc13];
}
else
{
this.target = ninjasaga.Central.main.getMainChar();
}
}
ninjasaga.Central.battle.setDefender(this.target);
return loc3;
}
function frame20():*
{
gotoAndPlay("standby");
return;
}
function frame41():*
{
this.onAttackHit();
return;
}
function frame55():*
{
this.onActionFinish();
return;
}
function frame74():*
{
this.playFlyingObject(this["effectMc"]);
return;
}
function frame80():*
{
this.onAttackHit();
return;
}
function frame95():*
{
this.onActionFinish();
return;
}
function frame117():*
{
this.playFlyingObject(this["effectMc"]);
return;
}
function frame127():*
{
this.onAttackHit();
return;
}
function frame138():*
{
this.onActionFinish();
return;
}
function frame161():*
{
this.onAttackHit();
return;
}
function frame188():*
{
this.onActionFinish();
return;
}
function frame212():*
{
this.onAttackHit();
return;
}
function frame239():*
{
this.onActionFinish();
return;
}
function frame269():*
{
this.onAttackHit();
return;
}
function frame294():*
{
this.onActionFinish();
return;
}
function frame315():*
{
this.onAttackHit();
return;
}
function frame345():*
{
this.onActionFinish();
return;
}
function frame373():*
{
this.onAttackHit();
return;
}
function frame413():*
{
this.onActionFinish();
return;
}
function frame430():*
{
this.onAttackHit();
return;
}
function frame458():*
{
this.onActionFinish();
return;
}
function frame478():*
{
this.onAttackHit();
return;
}
function frame507():*
{
this.onActionFinish();
return;
}
function frame520():*
{
this.playFlyingObject(this["effectMc"]);
return;
}
function frame528():*
{
this.onAttackHit();
return;
}
function frame547():*
{
this.onActionFinish();
return;
}
function frame565():*
{
this.onActionFinish();
return;
}
function frame580():*
{
this.onActionFinish();
return;
}
function frame618():*
{
this.stop();
this.onActionFinish();
return;
}
public var effectMc:flash.display.MovieClip;
public var hitAreaMc:flash.display.MovieClip;
private var SkillArray:Array;
private var target:*;
private var MaxPiority:int=11;
private var BaseDmg:int=0;
}
}