3202 lines
128 KiB
C
3202 lines
128 KiB
C
|
||
|
||
function setCustomData_po_nanjixie_bykk(obj, receiveData)
|
||
{
|
||
if(!obj) return;
|
||
local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter());
|
||
local skillIndex = receiveData.readDword();
|
||
local subtype = receiveData.readDword();
|
||
|
||
obj.getVar("skillIndex").clear_vector();
|
||
obj.getVar("skillIndex").push_vector(skillIndex);
|
||
obj.getVar("subtype").clear_vector();
|
||
obj.getVar("subtype").push_vector(subtype);
|
||
|
||
switch(skillIndex){
|
||
case 29:
|
||
local totalDamage = receiveData.readDword();
|
||
obj.getVar("totalDamage").clear_vector();
|
||
obj.getVar("totalDamage").push_vector(totalDamage);
|
||
switch(subtype){
|
||
case 3:
|
||
local lifetime = receiveData.readDword();
|
||
obj.getVar("lifetime").clear_vector();
|
||
obj.getVar("lifetime").push_vector(lifetime);
|
||
local resttime = receiveData.readDword();
|
||
obj.getVar("resttime").clear_vector();
|
||
obj.getVar("resttime").push_vector(resttime);
|
||
local bullet_number = receiveData.readDword();
|
||
obj.getVar("bullet_number").clear_vector();
|
||
obj.getVar("bullet_number").push_vector(bullet_number);
|
||
local dsp_number = sqrChr.getVar("ExsS_OBJ").get_obj_vector_size();
|
||
if(dsp_number > 0){
|
||
sqrChr.getVar("ExsS_OBJ").push_obj_vector(obj);
|
||
}
|
||
else{
|
||
sqrChr.getVar("ExsS_OBJ").clear_obj_vector();
|
||
sqrChr.getVar("ExsS_OBJ").push_obj_vector(obj);
|
||
}
|
||
break;
|
||
case 4:
|
||
local lifetime = receiveData.readDword();
|
||
obj.getVar("lifetime").clear_vector();
|
||
obj.getVar("lifetime").push_vector(lifetime);
|
||
local resttime = receiveData.readDword();
|
||
obj.getVar("resttime").clear_vector();
|
||
obj.getVar("resttime").push_vector(resttime);
|
||
local bullet_number = receiveData.readDword();
|
||
obj.getVar("bullet_number").clear_vector();
|
||
obj.getVar("bullet_number").push_vector(bullet_number);
|
||
local dsp_number = sqrChr.getVar("Exs_OBJ").get_obj_vector_size();
|
||
if(dsp_number > 0){
|
||
sqrChr.getVar("Exs_OBJ").push_obj_vector(obj);
|
||
}
|
||
else{
|
||
sqrChr.getVar("Exs_OBJ").clear_obj_vector();
|
||
sqrChr.getVar("Exs_OBJ").push_obj_vector(obj);
|
||
}
|
||
break;
|
||
case 5:
|
||
local lifetime = receiveData.readDword();
|
||
obj.getVar("lifetime").clear_vector();
|
||
obj.getVar("lifetime").push_vector(lifetime);
|
||
local resttime = receiveData.readDword();
|
||
obj.getVar("resttime").clear_vector();
|
||
obj.getVar("resttime").push_vector(resttime);
|
||
local bullet_number = receiveData.readDword();
|
||
obj.getVar("bullet_number").clear_vector();
|
||
obj.getVar("bullet_number").push_vector(bullet_number);
|
||
local totalDamage2 = receiveData.readDword();
|
||
obj.getVar("totalDamage2").clear_vector();
|
||
obj.getVar("totalDamage2").push_vector(totalDamage2);
|
||
local dsp_number = sqrChr.getVar("ExsEx_OBJ").get_obj_vector_size();
|
||
if(dsp_number > 0){
|
||
sqrChr.getVar("ExsEx_OBJ").push_obj_vector(obj);
|
||
}
|
||
else{
|
||
sqrChr.getVar("ExsEx_OBJ").clear_obj_vector();
|
||
sqrChr.getVar("ExsEx_OBJ").push_obj_vector(obj);
|
||
}
|
||
break;
|
||
}
|
||
if(subtype == 3 || subtype == 4 || subtype == 5){
|
||
obj.setMapFollowParent(obj.getParent());
|
||
obj.setMapFollowType(1);
|
||
}
|
||
break;
|
||
case 59:
|
||
switch(subtype){
|
||
case 1:
|
||
local XPos = receiveData.readDword();
|
||
local YPos = receiveData.readDword();
|
||
obj.getVar("basepos").clear_vector();
|
||
obj.getVar("basepos").push_vector(XPos);
|
||
obj.getVar("basepos").push_vector(YPos);
|
||
break;
|
||
case 2:
|
||
local type = receiveData.readDword();
|
||
obj.getVar("type").clear_vector();
|
||
obj.getVar("type").push_vector(type);
|
||
break;
|
||
}
|
||
break;
|
||
case 63://风暴
|
||
local totalDamage = receiveData.readDword();
|
||
obj.getVar("totalDamage").clear_vector();
|
||
obj.getVar("totalDamage").push_vector(totalDamage);
|
||
switch(subtype){
|
||
case 1://子弹
|
||
local angleX = receiveData.readDword();
|
||
local angleZ = receiveData.readDword();
|
||
obj.getVar("angle").clear_vector();
|
||
obj.getVar("angle").push_vector(angleX);
|
||
obj.getVar("angle").push_vector(angleZ);
|
||
break;
|
||
case 2://导弹
|
||
local group = receiveData.readDword();
|
||
local uniqueId = receiveData.readDword();
|
||
local targetObj = sq_GetObject(obj, group, uniqueId);
|
||
if(targetObj){
|
||
obj.getVar("targetObj").clear_obj_vector();
|
||
obj.getVar("targetObj").push_obj_vector(targetObj)
|
||
}
|
||
else sq_SendDestroyPacketPassiveObject(obj);
|
||
break;
|
||
case 3://更新子弹
|
||
local hitMax = receiveData.readDword();
|
||
obj.getVar("custom").setInt(10, totalDamage);
|
||
obj.getVar("custom").setInt(11, hitMax);
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_G1://G1
|
||
switch(subtype){
|
||
case 1:
|
||
sqrChr.getVar("G1_obj").clear_obj_vector();
|
||
sqrChr.getVar("G1_obj").push_obj_vector(obj);
|
||
local totalDamage = receiveData.readDword();
|
||
local lifeTime = receiveData.readDword();
|
||
local stunTime = receiveData.readDword();
|
||
local hitCoolTime = receiveData.readDword();
|
||
local sizeRate = receiveData.readDword();
|
||
obj.getVar("custom").setInt(10, totalDamage);
|
||
obj.getVar("custom").setInt(11, lifeTime);
|
||
obj.getVar("custom").setInt(12, stunTime);
|
||
obj.getVar("custom").setInt(13, hitCoolTime);
|
||
obj.getVar("custom").setInt(14, sizeRate);
|
||
obj.setMapFollowParent(sqrChr);
|
||
obj.setMapFollowType(1);
|
||
// print("hitCoolTime = "+hitCoolTime);
|
||
break;
|
||
case 2:
|
||
local totalDamage = receiveData.readDword();
|
||
local stunTime = receiveData.readDword();
|
||
local sizeRate = receiveData.readDword();
|
||
obj.getVar("custom").setInt(10, totalDamage);
|
||
obj.getVar("custom").setInt(11, stunTime);
|
||
obj.getVar("custom").setInt(12, sizeRate);
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_G2://G2
|
||
if(sqrChr.getVar("G2_obj").get_obj_vector_size() < 0) sqrChr.getVar("G2_obj").clear_obj_vector();
|
||
sqrChr.getVar("G2_obj").push_obj_vector(obj);
|
||
local totalDamage = receiveData.readDword();
|
||
local totalDamage2 = receiveData.readDword();
|
||
local chargeTime = receiveData.readDword();
|
||
local hitCoolTime = receiveData.readDword();
|
||
local sub = receiveData.readDword();
|
||
local lifeTime = receiveData.readDword();
|
||
obj.getVar("custom").setInt(10, totalDamage);
|
||
obj.getVar("custom").setInt(11, totalDamage2);
|
||
obj.getVar("custom").setInt(12, chargeTime);
|
||
obj.getVar("custom").setInt(13, hitCoolTime);
|
||
obj.getVar("custom").setInt(14, sub);
|
||
obj.getVar("custom").setInt(15, lifeTime);
|
||
obj.setMapFollowParent(sqrChr);
|
||
obj.setMapFollowType(1);
|
||
break;
|
||
case SKILL_GUNNER_G3://G3
|
||
switch(subtype){
|
||
case 1:
|
||
if(sqrChr.getVar("G3_obj").get_obj_vector_size() < 0) sqrChr.getVar("G3_obj").clear_obj_vector();
|
||
sqrChr.getVar("G3_obj").push_obj_vector(obj);
|
||
local totalDamage = receiveData.readDword();
|
||
local hitCoolTime = receiveData.readDword();
|
||
local sub = receiveData.readDword();
|
||
local lifeTime = receiveData.readDword();
|
||
obj.getVar("custom").setInt(10, totalDamage);
|
||
obj.getVar("custom").setInt(11, hitCoolTime);
|
||
obj.getVar("custom").setInt(12, sub);
|
||
obj.getVar("custom").setInt(13, lifeTime);
|
||
if(obj.getDirection() != ENUM_DIRECTION_RIGHT) sq_SetCurrentDirection(obj, ENUM_DIRECTION_RIGHT);
|
||
obj.setMapFollowParent(sqrChr);
|
||
obj.setMapFollowType(1);
|
||
break;
|
||
case 2:
|
||
if(sqrChr.getVar("G3_att_obj").get_obj_vector_size() < 0) sqrChr.getVar("G3_att_obj").clear_obj_vector();
|
||
sqrChr.getVar("G3_att_obj").push_obj_vector(obj);
|
||
local totalDamage = receiveData.readDword();
|
||
local hitCoolTime = receiveData.readDword();
|
||
obj.getVar("custom").setInt(10, totalDamage);
|
||
obj.getVar("custom").setInt(11, hitCoolTime);
|
||
local group = receiveData.readDword();
|
||
local uniqueId = receiveData.readDword();
|
||
local targetObj = sq_GetObject(obj, group, uniqueId);
|
||
if(targetObj){
|
||
obj.getVar("target").clear_obj_vector();
|
||
obj.getVar("target").push_obj_vector(targetObj);
|
||
sq_moveWithParent(targetObj, obj);
|
||
}
|
||
local sub = receiveData.readDword();
|
||
local sub2 = receiveData.readDword();
|
||
obj.getVar("custom").setInt(12, sub);
|
||
obj.getVar("custom").setInt(13, sub2);
|
||
break;
|
||
}
|
||
break;
|
||
case 83:
|
||
switch(subtype){
|
||
case 1:
|
||
local vtr_number = sqrChr.getVar("SPAFACOBJ").get_obj_vector_size();
|
||
if(vtr_number > 0){
|
||
sqrChr.getVar("SPAFACOBJ").push_obj_vector(obj);
|
||
}
|
||
else{
|
||
sqrChr.getVar("SPAFACOBJ").clear_obj_vector();
|
||
sqrChr.getVar("SPAFACOBJ").push_obj_vector(obj);
|
||
}
|
||
break;
|
||
case 2:
|
||
local vtr_number = sqrChr.getVar("SPARROWOBJ").get_obj_vector_size();
|
||
if(vtr_number > 0){
|
||
sqrChr.getVar("SPARROWOBJ").push_obj_vector(obj);
|
||
}
|
||
else{
|
||
sqrChr.getVar("SPARROWOBJ").clear_obj_vector();
|
||
sqrChr.getVar("SPARROWOBJ").push_obj_vector(obj);
|
||
}
|
||
break;
|
||
case 3:
|
||
local totalDamage = receiveData.readDword();
|
||
obj.getVar("totalDamage").clear_vector();
|
||
obj.getVar("totalDamage").push_vector(totalDamage);
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_VIRTUALRUSH:
|
||
switch(subtype){
|
||
case 1:
|
||
local vtr_number = sqrChr.getVar("VIRTUALRUSH_SUB1").get_obj_vector_size();
|
||
if(vtr_number > 0){
|
||
sqrChr.getVar("VIRTUALRUSH_SUB1").push_obj_vector(obj);
|
||
}
|
||
else{
|
||
sqrChr.getVar("VIRTUALRUSH_SUB1").clear_obj_vector();
|
||
sqrChr.getVar("VIRTUALRUSH_SUB1").push_obj_vector(obj);
|
||
}
|
||
break;
|
||
case 2:
|
||
local vtr_number = sqrChr.getVar("VIRTUALRUSH_SUB2").get_obj_vector_size();
|
||
if(vtr_number > 0){
|
||
sqrChr.getVar("VIRTUALRUSH_SUB2").push_obj_vector(obj);
|
||
}
|
||
else{
|
||
sqrChr.getVar("VIRTUALRUSH_SUB2").clear_obj_vector();
|
||
sqrChr.getVar("VIRTUALRUSH_SUB2").push_obj_vector(obj);
|
||
}
|
||
local totalDamage = receiveData.readDword();
|
||
local skillIndex_sub1 = receiveData.readDword();
|
||
local skillIndex_sub2 = receiveData.readDword();
|
||
obj.getVar("skillIndex_sub1").clear_vector();
|
||
obj.getVar("skillIndex_sub1").push_vector(skillIndex_sub1);
|
||
obj.getVar("skillIndex_sub2").clear_vector();
|
||
obj.getVar("skillIndex_sub2").push_vector(skillIndex_sub2);
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_ROBOTRX60:
|
||
switch(subtype){
|
||
case 1:
|
||
local range = receiveData.readDword();
|
||
obj.getVar("range").clear_vector();
|
||
obj.getVar("range").push_vector(range);
|
||
local parentObj = obj.getParent();
|
||
sq_moveWithParent(parentObj, obj);
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_DIMENSIONRUNNER:
|
||
switch(subtype){
|
||
case 1://T80本体
|
||
local totalDamage = receiveData.readDword();
|
||
local missile_number = receiveData.readDword();
|
||
local missile_totalDamage = receiveData.readDword();
|
||
obj.getVar("totalDamage").clear_vector();
|
||
obj.getVar("totalDamage").push_vector(totalDamage);
|
||
obj.getVar("totalDamage").push_vector(missile_totalDamage);
|
||
obj.getVar("missile_number").clear_vector();
|
||
obj.getVar("missile_number").push_vector(missile_number);
|
||
break;
|
||
case 2://导弹
|
||
local totalDamage = receiveData.readDword();
|
||
local angle = receiveData.readDword();
|
||
obj.getVar("custom").clear_vector();
|
||
obj.getVar("custom").push_vector(totalDamage);
|
||
obj.getVar("custom").push_vector(obj.getXPos());
|
||
obj.getVar("custom").push_vector(obj.getYPos());
|
||
obj.getVar("custom").push_vector(obj.getZPos());
|
||
obj.getVar("custom").push_vector(sq_getRandom(250,500));
|
||
obj.getVar("custom").push_vector(sq_getRandom(-20,20));
|
||
obj.getVar("custom").push_vector(angle);
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_HELLMARCH:
|
||
switch(subtype){
|
||
case 1://门
|
||
case 2://门
|
||
local totalDamage = receiveData.readDword();
|
||
local time = receiveData.readDword();
|
||
obj.setTimeEvent(0,time,1,false);
|
||
break;
|
||
case 3:
|
||
case 4:
|
||
case 5:
|
||
local totalDamage = receiveData.readDword();
|
||
local moveX = receiveData.readDword();
|
||
local number = receiveData.readDword();
|
||
obj.getVar("custom").clear_vector();
|
||
obj.getVar("custom").push_vector(obj.getXPos());
|
||
obj.getVar("custom").push_vector(moveX);
|
||
if(subtype == 5){
|
||
obj.getVar("custom").push_vector(number);
|
||
obj.setTimeEvent(3,2250 - 450 * number,1,false);
|
||
}
|
||
break;
|
||
case 6:
|
||
local totalDamage = receiveData.readDword();
|
||
local totalDamage2 = receiveData.readDword();
|
||
obj.getVar("custom").clear_vector();
|
||
obj.getVar("custom").push_vector(totalDamage);
|
||
obj.getVar("custom").push_vector(totalDamage2);
|
||
break;
|
||
}
|
||
break;
|
||
case 200:
|
||
local sizeRate = receiveData.readDword();
|
||
local totalDamage = receiveData.readDword();
|
||
obj.getVar("sizeRate").clear_vector();
|
||
obj.getVar("sizeRate").push_vector(sizeRate);
|
||
obj.getVar("totalDamage").clear_vector();
|
||
obj.getVar("totalDamage").push_vector(totalDamage);
|
||
//printp("sizeRate="+sizeRate.tostring()+" ,totalDamage="+totalDamage.tostring()+"\n");
|
||
break;
|
||
case 201://12
|
||
//设置ATK,百分比
|
||
local sizeRate = receiveData.readDword();
|
||
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 12));
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/explosion/fireexplosion.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
//大小
|
||
local currentAni = obj.getCurrentAnimation();//得到当前ani
|
||
sizeRate = sizeRate.tofloat() / 100.0;
|
||
sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate);//攻击框,x y z比率
|
||
return;
|
||
break;
|
||
}
|
||
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
if(attackInfo){
|
||
local element_kk_fire = sqrChr.getVar("element_kk").getInt(0);
|
||
local element_kk_water = sqrChr.getVar("element_kk").getInt(1);
|
||
local element_kk_dark = sqrChr.getVar("element_kk").getInt(2);
|
||
local element_kk_light = sqrChr.getVar("element_kk").getInt(3);
|
||
if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE) && element_kk_fire > 0) attackInfo.setElement(ENUM_ELEMENT_FIRE);
|
||
if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER) && element_kk_water > 0) attackInfo.setElement(ENUM_ELEMENT_WATER);
|
||
if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK) && element_kk_dark > 0) attackInfo.setElement(ENUM_ELEMENT_DARK);
|
||
if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT) && element_kk_light > 0) attackInfo.setElement(ENUM_ELEMENT_LIGHT);
|
||
}
|
||
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
|
||
}
|
||
|
||
function setState_po_nanjixie_bykk(obj, state, datas)
|
||
{
|
||
if(!obj) return;
|
||
|
||
local skillIndex = obj.getVar("skillIndex").get_vector(0);
|
||
local subtype = obj.getVar("subtype").get_vector(0);
|
||
local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter());
|
||
//把state存入数组
|
||
obj.getVar("state").clear_vector();
|
||
obj.getVar("state").push_vector(state);
|
||
|
||
switch(skillIndex){
|
||
case 29://毒蛇炮
|
||
switch(subtype){
|
||
case 1://子弹
|
||
switch(state){
|
||
case 20:
|
||
//设置ATK,百分比
|
||
local bonusrater = obj.getVar("totalDamage").get_vector(0);
|
||
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 5));
|
||
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), bonusrater);
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/exs/exsviperbulletnormal.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
//设置PTL
|
||
obj.sq_SetMoveParticle("particle/exsviperbullet.ptl", 0.0, 0.0);
|
||
//Z轴放大攻击框
|
||
local currentAni = obj.getCurrentAnimation();
|
||
sq_SetAttackBoundingBoxSizeRate(currentAni, 1.0, 1.0, 5.0);//攻击框,x y z比率
|
||
currentAni.addLayerAnimation(-10,sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/exs/exsviperbulletdodge.ani"),true);
|
||
// currentAni.addLayerAnimation(1000,sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/exs/exsviperbullet.ani"),true);//增加层ani
|
||
currentAni.setRGBA(255, 255, 0, 255);
|
||
break;
|
||
}
|
||
break;
|
||
case 2://激光
|
||
switch(state){
|
||
case 20:
|
||
//设置ATK,百分比
|
||
local bonusrater = obj.getVar("totalDamage").get_vector(0);
|
||
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 5));
|
||
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), bonusrater);
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/exs/exslaser/laserfire.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
//设置效果
|
||
local currentAni = obj.getCurrentAnimation();
|
||
sq_SetAttackBoundingBoxSizeRate(currentAni, 1.0, 1.0, 2.0);//攻击框,x y z比率
|
||
currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/exs/exslaser/lasertile.ani"),true);
|
||
obj.setTimeEvent(0,70,3,true);
|
||
break;
|
||
}
|
||
break;
|
||
case 3://sophia毒蛇炮
|
||
switch(state){
|
||
case 20:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","monster/character/gunner/robot_by_kk/exssophia_ani/sophia_robot3_tel_out.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local lifetime = obj.getVar("lifetime").get_vector(0);
|
||
obj.setTimeEvent(1001,lifetime,1,false);
|
||
break;
|
||
case 21:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","monster/character/gunner/robot_by_kk/exssophia_ani/sophia_body.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
sq_AddDrawOnlyAniFromParent(obj,"monster/character/gunner/robot_by_kk/exssophia_ani/sophia_smoke.ani", 0, 1, 50);
|
||
local resttime = obj.getVar("resttime").get_vector(0);
|
||
if(sqrChr.getVar("holdandgo").getBool(0) == false) obj.setTimeEvent(0,resttime,1,false);
|
||
break;
|
||
case 22:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","monster/character/gunner/robot_by_kk/exssophia_ani/sophia_attack.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local bullet_number = obj.getVar("bullet_number").get_vector(0);
|
||
local bullet_time = 1000 / bullet_number;
|
||
obj.setTimeEvent(1,bullet_time,bullet_number,true);
|
||
break;
|
||
case 23:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","monster/character/gunner/robot_by_kk/exssophia_ani/sophia_robot3_tel_on.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
obj.setTimeEvent(1002,250,1,false);
|
||
break;
|
||
case 24:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","monster/character/gunner/robot_by_kk/exssophia_ani/sophia_robot3_tel_on.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
obj.setTimeEvent(1003,250,1,false);
|
||
break;
|
||
case 25:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","monster/character/gunner/robot_by_kk/exssophia_ani/sophia_robot3_tel_out.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
obj.setTimeEvent(1004,200,1,false);
|
||
break;
|
||
}
|
||
break;
|
||
case 4://普通毒蛇炮
|
||
switch(state){
|
||
case 20:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","monster/character/gunner/robot_by_kk/exs_ani/body.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local currentAni = obj.getCurrentAnimation();
|
||
currentAni.addLayerAnimation(1,sq_CreateAnimation("","monster/character/gunner/robot_by_kk/exs_ani/cannonstand.ani"),true);
|
||
currentAni.addLayerAnimation(1,sq_CreateAnimation("","monster/character/gunner/robot_by_kk/exs_ani/bodyback.ani"),true);
|
||
currentAni.addLayerAnimation(1,sq_CreateAnimation("","monster/character/gunner/robot_by_kk/exs_ani/robot1.ani"),true);
|
||
local lifetime = obj.getVar("lifetime").get_vector(0);
|
||
obj.setTimeEvent(1001,lifetime,1,false);
|
||
if(sqrChr.getVar("holdandgo").getBool(0) == false) obj.setTimeEvent(0,100,1,false);
|
||
break;
|
||
case 21:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","monster/character/gunner/robot_by_kk/exs_ani/body.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local currentAni = obj.getCurrentAnimation();
|
||
currentAni.addLayerAnimation(1,sq_CreateAnimation("","monster/character/gunner/robot_by_kk/exs_ani/cannonstand.ani"),true);
|
||
currentAni.addLayerAnimation(1,sq_CreateAnimation("","monster/character/gunner/robot_by_kk/exs_ani/bodyback.ani"),true);
|
||
currentAni.addLayerAnimation(1,sq_CreateAnimation("","monster/character/gunner/robot_by_kk/exs_ani/robot1.ani"),true);
|
||
sq_AddDrawOnlyAniFromParent(obj,"monster/character/gunner/robot_by_kk/exssophia_ani/sophia_smoke.ani", 0, 1, 50);
|
||
local resttime = obj.getVar("resttime").get_vector(0);
|
||
if(sqrChr.getVar("holdandgo").getBool(0) == false) obj.setTimeEvent(0,resttime,1,false);
|
||
break;
|
||
case 22:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","monster/character/gunner/robot_by_kk/exs_ani/attack.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local currentAni = obj.getCurrentAnimation();
|
||
currentAni.addLayerAnimation(1,sq_CreateAnimation("","monster/character/gunner/robot_by_kk/exs_ani/bodyback.ani"),true);
|
||
currentAni.addLayerAnimation(1,sq_CreateAnimation("","monster/character/gunner/robot_by_kk/exs_ani/robot2.ani"),true);
|
||
local bullet_number = obj.getVar("bullet_number").get_vector(0);
|
||
local bullet_time = 1000 / bullet_number;
|
||
obj.setTimeEvent(1,bullet_time,bullet_number,true);
|
||
break;
|
||
}
|
||
break;
|
||
case 5://EX毒蛇炮
|
||
switch(state){
|
||
case 20:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","monster/character/gunner/robot_by_kk/exsex_ani/body.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local currentAni = obj.getCurrentAnimation();
|
||
local lifetime = obj.getVar("lifetime").get_vector(0);
|
||
obj.setTimeEvent(1001,lifetime,1,false);
|
||
if(sqrChr.getVar("holdandgo").getBool(0) == false) obj.setTimeEvent(0,100,1,false);
|
||
break;
|
||
case 21:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","monster/character/gunner/robot_by_kk/exsex_ani/body.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local currentAni = obj.getCurrentAnimation();
|
||
sq_AddDrawOnlyAniFromParent(obj,"monster/character/gunner/robot_by_kk/exssophia_ani/sophia_smoke.ani", 0, 1, 50);
|
||
local resttime = obj.getVar("resttime").get_vector(0);
|
||
if(sqrChr.getVar("holdandgo").getBool(0) == false) obj.setTimeEvent(0,resttime,1,false);
|
||
break;
|
||
case 22:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","monster/character/gunner/robot_by_kk/exsex_ani/attack.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local currentAni = obj.getCurrentAnimation();
|
||
currentAni.setLoop(true);
|
||
currentAni.addLayerAnimation(1,sq_CreateAnimation("","monster/character/gunner/robot_by_kk/exsex_ani/bodyback.ani"),true);
|
||
currentAni.addLayerAnimation(10003,sq_CreateAnimation("","monster/character/gunner/robot_by_kk/exsex_ani/robot2.ani"),true);
|
||
local bullet_number = obj.getVar("bullet_number").get_vector(0);
|
||
local bullet_time = 1000 / bullet_number;
|
||
obj.setTimeEvent(1,bullet_time,-1,true);
|
||
obj.setTimeEvent(2,300,-1,true);
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case 59://空投支援
|
||
switch(subtype){
|
||
case 1:
|
||
switch(state){
|
||
case 20:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","passiveobject/character/gunner/animation/mechadropappear.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
if(obj.getDirection() == ENUM_DIRECTION_LEFT){
|
||
sq_SetVelocity(obj, 0, -400.0);
|
||
}
|
||
else{
|
||
sq_SetVelocity(obj, 0, 400.0);
|
||
}
|
||
obj.setTimeEvent(0,200,1,false);
|
||
break;
|
||
case 21:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","passiveobject/character/gunner/animation/mechadropmove.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
if(obj.getDirection() == ENUM_DIRECTION_LEFT){
|
||
sq_SetVelocity(obj, 0, -400.0);
|
||
}
|
||
else{
|
||
sq_SetVelocity(obj, 0, 400.0);
|
||
}
|
||
break;
|
||
case 22:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","passiveobject/character/gunner/animation/mechadropdisappear.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
if(obj.getDirection() == ENUM_DIRECTION_LEFT){
|
||
sq_SetVelocity(obj, 0, -400.0);
|
||
}
|
||
else{
|
||
sq_SetVelocity(obj, 0, 400.0);
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case 2:
|
||
switch(state){
|
||
case 20:
|
||
//设置ANI
|
||
local anipath = "";
|
||
local type = obj.getVar("type").get_vector(0);
|
||
switch(type){
|
||
case 1:
|
||
case 2:
|
||
anipath = "monster/character/gunner/robot_by_kk/healrx78_ani/drop.ani";
|
||
break;
|
||
case 3:
|
||
anipath = "monster/character/gunner/robot_by_kk/headingrx78_ani/drop.ani";
|
||
break;
|
||
case 4:
|
||
case 5:
|
||
anipath = "monster/character/gunner/robot_by_kk/firerx78_ani/drop.ani";
|
||
break;
|
||
}
|
||
local ani = sq_CreateAnimation("", anipath);
|
||
obj.setCurrentAnimation(ani);
|
||
//
|
||
local currentAni = obj.getCurrentAnimation();
|
||
switch(type){
|
||
case 1:
|
||
case 2:
|
||
currentAni.addLayerAnimation(6,sq_CreateAnimation("","monster/character/gunner/robot_by_kk/healrx78_ani/dropeffect.ani"),true);
|
||
break;
|
||
case 3:
|
||
currentAni.addLayerAnimation(6,sq_CreateAnimation("","monster/character/gunner/robot_by_kk/headingrx78_ani/dropeffect.ani"),true);
|
||
break;
|
||
case 4:
|
||
case 5:
|
||
currentAni.addLayerAnimation(6,sq_CreateAnimation("","monster/character/gunner/robot_by_kk/firerx78_ani/dropeffect.ani"),true);
|
||
break;
|
||
}
|
||
obj.sq_SetMoveParticle("particle/mechadrop.ptl", 0.0, 0.0);
|
||
break;
|
||
case 21:
|
||
//设置ANI
|
||
local anipath = "";
|
||
local type = obj.getVar("type").get_vector(0);
|
||
switch(type){
|
||
case 1:
|
||
case 2:
|
||
anipath = "monster/character/gunner/robot_by_kk/healrx78_ani/land.ani";
|
||
break;
|
||
case 3:
|
||
anipath = "monster/character/gunner/robot_by_kk/headingrx78_ani/land.ani";
|
||
break;
|
||
case 4:
|
||
case 5:
|
||
anipath = "monster/character/gunner/robot_by_kk/firerx78_ani/land.ani";
|
||
break;
|
||
}
|
||
local ani = sq_CreateAnimation("", anipath);
|
||
obj.setCurrentAnimation(ani);
|
||
//
|
||
local currentAni = obj.getCurrentAnimation();
|
||
switch(type){
|
||
case 1:
|
||
case 2:
|
||
currentAni.addLayerAnimation(6,sq_CreateAnimation("","monster/character/gunner/robot_by_kk/healrx78_ani/dropeffect.ani"),true);
|
||
break;
|
||
case 3:
|
||
currentAni.addLayerAnimation(6,sq_CreateAnimation("","monster/character/gunner/robot_by_kk/headingrx78_ani/dropeffect.ani"),true);
|
||
break;
|
||
case 4:
|
||
case 5:
|
||
currentAni.addLayerAnimation(6,sq_CreateAnimation("","monster/character/gunner/robot_by_kk/firerx78_ani/dropeffect.ani"),true);
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case 63://暴风
|
||
switch(subtype){
|
||
case 1://子弹
|
||
switch(state){
|
||
case 20:
|
||
//设置ATK,百分比
|
||
local bonusrater = obj.getVar("totalDamage").get_vector(0);
|
||
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 7));
|
||
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), bonusrater);
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/tempester/gunbullet.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
//设置PTL
|
||
local angleX = obj.getVar("angle").get_vector(0);
|
||
local angleZ = obj.getVar("angle").get_vector(1);
|
||
//printp("angleX="+angleX.tostring()+"angleZ="+angleZ.tostring()+"\n");
|
||
//printp(sq_ToDegree(sq_Atan2(angleX.tofloat(),angleZ.tofloat())).tostring()+"\n");
|
||
local angle = sq_ToDegree(sq_Atan2(angleX.tofloat(), angleZ.tofloat()));//sq_ToDegree(sq_Atan2(angleX.tofloat(), angleZ.tofloat()));
|
||
obj.sq_SetMoveParticle("particle/tempestergunbullet.ptl", 0.0, angle);
|
||
sq_SetCustomRotate(obj, sq_ToRadian(angle - 90).tofloat());
|
||
break;
|
||
}
|
||
break;
|
||
case 2://导弹
|
||
switch(state){
|
||
case 20:
|
||
//设置ATK,百分比
|
||
local bonusrater = (obj.getVar("totalDamage").get_vector(0).tofloat() * 0.3).tointeger();
|
||
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 8));
|
||
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), bonusrater);
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/tempester/missile.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
//设置PTL
|
||
local number = sq_getRandom(1,4);
|
||
obj.getVar().clear_vector();
|
||
obj.getVar().push_vector(number);
|
||
local ptlPath = getMissilePtl_bykk(number);
|
||
obj.sq_SetMoveParticle(ptlPath, 0.0, 0.0);
|
||
//烟雾时钟
|
||
obj.setTimeEvent(0,50,-1,true);
|
||
break;
|
||
case 21:
|
||
case 22:
|
||
obj.stopTimeEvent(0);
|
||
obj.sq_RemoveMoveParticle();
|
||
//设置ATK,百分比
|
||
local bonusrater = (obj.getVar("totalDamage").get_vector(0).tofloat() * 1.0).tointeger();
|
||
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 9));
|
||
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), bonusrater);
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/tempester/expairdodge.ani");
|
||
if(state == 22) ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/tempester/explanddodge.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
//效果
|
||
if(state == 21){
|
||
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/tempester/expairnormal.ani",0,-1,-1);
|
||
}
|
||
else if(state == 22){
|
||
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/tempester/explandnormal.ani",0,-1,-1);
|
||
}
|
||
//设置旋转
|
||
sq_SetCustomRotate(obj, sq_ToRadian(0.0));
|
||
break;
|
||
}
|
||
break;
|
||
case 3:
|
||
local totalDamage = obj.getVar("custom").getInt(10);
|
||
local hitMax = obj.getVar("custom").getInt(11);
|
||
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/tempester/dummy.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 7));
|
||
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
local pAni = obj.getCurrentAnimation();
|
||
local delaySum = pAni.getDelaySum(false);
|
||
obj.setTimeEvent(0, delaySum / (hitMax + 1),hitMax, true);
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_G1://G1
|
||
switch(subtype){
|
||
case 1:
|
||
switch(state){
|
||
case 20://出现
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g1/joint.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local pAni = obj.getCurrentAnimation();
|
||
pAni.addLayerAnimation(10001,sq_CreateAnimation("","passiveobject/character/gunner/animation/g1/transformeffect.ani"),true);
|
||
break;
|
||
case 21://持续
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g1/staynormal.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local pAni = obj.getCurrentAnimation();
|
||
pAni.addLayerAnimation(10001,sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g1/staydodge.ani"),true);
|
||
if(!obj.isExistTimeEvent(0)) obj.setTimeEvent(0, obj.getVar("custom").getInt(11), 1, false);
|
||
obj.setTimeEvent(10, obj.getVar("custom").getInt(13), 1, false);
|
||
break;
|
||
case 22://攻击
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g1/staynormal.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local pAni = obj.getCurrentAnimation();
|
||
sq_SetFrameDelayTime(pAni, 0, 180);
|
||
pAni.addLayerAnimation(10001,sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g1/staydodge.ani"),true);
|
||
pAni.addLayerAnimation(10002,sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g1/firevolt/attack1.ani"),true);
|
||
local pooledObj2 = sq_AddDrawOnlyAniFromParent(obj, "passiveobject/mechanic_bykk/animation/g1/firevolt/attack2.ani", 30, 1, 10);
|
||
sq_moveWithParent(obj, pooledObj2);
|
||
obj.setTimeEvent(1, 120, 1, false);
|
||
obj.getVar("move").setInt(10, sq_GetXPos(obj));
|
||
obj.setTimeEvent(2, 10, 12, true);
|
||
break;
|
||
case 23://消失
|
||
obj.removeAllTimeEvent();
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g1/disjoint.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local pAni = obj.getCurrentAnimation();
|
||
pAni.addLayerAnimation(10001,sq_CreateAnimation("","passiveobject/character/gunner/animation/g1/transformeffect.ani"),true);
|
||
break;
|
||
}
|
||
break;
|
||
case 2:
|
||
switch(state){
|
||
case 20:
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g1/firevolt/bullet.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 20));
|
||
obj.sq_SetMoveParticle("particle/g1.ptl", 0.0, 0.0);
|
||
break;
|
||
case 21:
|
||
case 22:
|
||
obj.sq_RemoveMoveParticle();
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g1/firevolt/expair.ani");
|
||
if(state == 22) ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g1/firevolt/expland.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local bonusrater = obj.getVar("custom").getInt(10);
|
||
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 21));
|
||
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), bonusrater);
|
||
local hitDelayRate = obj.getVar("custom").getInt(11) / 50;
|
||
print("hitDelayRate = "+hitDelayRate);
|
||
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
sq_SetAttackInfoHitDelayRateDamager(attackInfo, hitDelayRate.tofloat());
|
||
local sizeRate = obj.getVar("custom").getInt(12);
|
||
if(sizeRate > 100){
|
||
local currentAni = obj.getCurrentAnimation();
|
||
sizeRate = sizeRate.tofloat() / 100.0;
|
||
currentAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
|
||
sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate);
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_G2://G2
|
||
switch(state){
|
||
case 20://开始
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g2/joint.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local pAni = obj.getCurrentAnimation();
|
||
pAni.addLayerAnimation(10001,sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g2/firevolt/effect.ani"),true);
|
||
obj.setTimeEvent(8,50,1,false);
|
||
break;
|
||
case 21://持续
|
||
obj.stopTimeEvent(1);
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g2/staynormal.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local pAni = obj.getCurrentAnimation();
|
||
pAni.addLayerAnimation(10001,sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g2/firevolt/staydodge.ani"),true);
|
||
local chargeTime = obj.getVar("custom").getInt(12) * (1 + obj.getVar("custom").getInt(14));
|
||
obj.setTimeEvent(0, chargeTime, 1, false);
|
||
local lifeTime = obj.getVar("custom").getInt(15);
|
||
if(!obj.isExistTimeEvent(3)) obj.setTimeEvent(3, lifeTime, 1, false);
|
||
break;
|
||
case 22://充能
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g2/staychargenormal.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local pAni = obj.getCurrentAnimation();
|
||
pAni.addLayerAnimation(10001,sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g2/firevolt/staychargedodge.ani"),true);
|
||
local bonusrater = obj.getVar("custom").getInt(10);
|
||
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 22));
|
||
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), bonusrater);
|
||
obj.setTimeEvent(1, obj.getVar("custom").getInt(13), -1 ,false);
|
||
break;
|
||
case 23://充能攻击
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g2/attacknormal.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local pAni = obj.getCurrentAnimation();
|
||
pAni.addLayerAnimation(10001,sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g2/firevolt/attackdodge.ani"),true);
|
||
pAni.addLayerAnimation(10001,sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g2/firevolt/spark.ani"),true);
|
||
local bonusrater = obj.getVar("custom").getInt(11);
|
||
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 23));
|
||
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), bonusrater);
|
||
break;
|
||
case 24://结束
|
||
obj.removeAllTimeEvent();
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g2/disjoint.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local pAni = obj.getCurrentAnimation();
|
||
pAni.addLayerAnimation(10001,sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g2/firevolt/effect.ani"),true);
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_G3://G3
|
||
switch(subtype){
|
||
case 1:
|
||
switch(state){
|
||
case 20://生成
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g3/move1.ani");
|
||
if(obj.getVar("custom").getInt(12) % 2 == 0) ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g3/move2.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
obj.setTimeEvent(0, 150, 1, false);
|
||
break;
|
||
case 21://移动
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g3/move1.ani");
|
||
if(obj.getVar("custom").getInt(12) % 2 == 0) ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g3/move2.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
break;
|
||
case 22://环绕
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g3/round.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local pAni = obj.getCurrentAnimation();
|
||
if(!obj.isExistTimeEvent(3)) obj.setTimeEvent(3, obj.getVar("custom").getInt(13), 1, false);
|
||
break;
|
||
case 23://攻击
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g3/round.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local pAni = obj.getCurrentAnimation();
|
||
sq_SetFrameDelayTime(pAni, 9, 999999);
|
||
pAni.setCurrentFrameWithChildLayer(9);
|
||
pAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g3/firevolt/spark.ani"),true);
|
||
pAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g3/firevolt/beam3.ani"),true);
|
||
|
||
local targetObj = sq_GetCNRDObjectToActiveObject(obj.getVar("target").get_obj_vector(0));
|
||
if(targetObj){
|
||
local totalDamage = obj.getVar("custom").getInt(10);
|
||
local hitCoolTime = obj.getVar("custom").getInt(11);
|
||
local group = sq_GetGroup(targetObj);
|
||
local uniqueId = sq_GetUniqueId(targetObj);
|
||
sq_BinaryStartWrite();
|
||
sq_BinaryWriteDword(SKILL_GUNNER_G3);//skillIndex
|
||
sq_BinaryWriteDword(2);//subtype
|
||
sq_BinaryWriteDword(totalDamage);
|
||
sq_BinaryWriteDword(hitCoolTime);
|
||
sq_BinaryWriteDword(group);
|
||
sq_BinaryWriteDword(uniqueId);
|
||
sq_BinaryWriteDword(obj.getVar("custom").getInt(12));
|
||
sq_BinaryWriteDword(obj.getVar("custom").getInt(12) + 3);
|
||
sq_SendCreatePassiveObjectPacketPos(sqrChr, NUM_BYKK_PASSIVEOBJECT, 0, sq_GetXPos(targetObj), sq_GetYPos(targetObj), targetObj.getZPos() + sq_GetObjectHeight(targetObj) + 40 - 60);
|
||
}
|
||
break;
|
||
case 24://消失
|
||
obj.removeAllTimeEvent();
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g3/broken.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local pAni = obj.getCurrentAnimation();
|
||
pAni.setLoop(false);
|
||
// local loadSlot = sqrChr.sq_GetSkillLoad(SKILL_GUNNER_G1);
|
||
// if(loadSlot){
|
||
// sqrChr.sq_RemoveSkillLoad(SKILL_GUNNER_G1);
|
||
// sqrChr.startSkillCoolTime(SKILL_GUNNER_G1, sq_GetSkillLevel(sqrChr), -1);
|
||
// }
|
||
local size2 = sqrChr.getVar("G3_att_obj").get_obj_vector_size();
|
||
if(size2 > 0){
|
||
for(local ui = 0; ui < size2; ui++){
|
||
local G3_att_obj = sqrChr.getVar("G3_att_obj").get_obj_vector(ui);
|
||
if(G3_att_obj){
|
||
local colObj = sq_GetCNRDObjectToCollisionObject(G3_att_obj);
|
||
colObj.setValid(false);
|
||
}
|
||
}
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case 2:
|
||
switch(state){
|
||
case 20:
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/g3/firevolt/hit.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local pAni = obj.getCurrentAnimation();
|
||
local bonusrater = obj.getVar("custom").getInt(10);
|
||
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 24));
|
||
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), bonusrater);
|
||
obj.setTimeEvent(100, obj.getVar("custom").getInt(11), -1, true);
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case 83://拦截机工厂
|
||
switch(subtype){
|
||
case 1://二觉后工厂
|
||
switch(state){
|
||
case 20://召唤效果
|
||
//设置ANI
|
||
local anipath = "passiveobject/mechanic_bykk/animation/sparrowfactory/appearbody.ani";
|
||
local skill_level = sq_GetSkillLevel(sqrChr, SKILL_GUNNER_HS1);
|
||
if(skill_level > 0) anipath = "passiveobject/mechanic_bykk/animation/sparrowfactory/teleportsparrowfactorystart_00.ani";
|
||
local ani = sq_CreateAnimation("", anipath);
|
||
obj.setCurrentAnimation(ani);
|
||
if(skill_level <= 0){
|
||
//增加效果
|
||
local currentAni = obj.getCurrentAnimation();
|
||
currentAni.addLayerAnimation(10001,sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/sparrowfactory/appeareffect.ani"),true);
|
||
}
|
||
//音效
|
||
obj.sq_PlaySound("SPARROW_FACTORY");
|
||
//设置跟随
|
||
obj.setMapFollowParent(sqrChr);
|
||
obj.setMapFollowType(1);
|
||
break;
|
||
case 21://持续效果
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/sparrowfactory/body.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
//修改持续时间
|
||
local currentAni = obj.getCurrentAnimation();
|
||
local skill_level = sq_GetSkillLevel(sqrChr, 83);
|
||
local lifetime = sqrChr.sq_GetLevelData(83, 0, skill_level);
|
||
sq_SetFrameDelayTime(currentAni, 0, lifetime);
|
||
//增加效果
|
||
currentAni.addLayerAnimation(1001,sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/sparrowfactory/effect.ani"),true);
|
||
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/sparrowfactory/summoneffect1.ani", 0, 0, 0);
|
||
//判断是否为单HIT,否则召唤飞机
|
||
local skill = sq_GetSkill(sqrChr, 98);
|
||
local skill_level02 = sq_GetSkillLevel(sqrChr, 98);
|
||
if(skill_level02 > 0){
|
||
if(!skill.isSealFunction()){
|
||
obj.setTimeEvent(3, 620, 1, false);
|
||
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/sparrowfactory/solarlight01_02.ani", 0, 0, 0);
|
||
}
|
||
else{
|
||
obj.setTimeEvent(0, 160, 1, false);
|
||
obj.setTimeEvent(2, 960, 1, false);
|
||
}
|
||
}
|
||
else{
|
||
obj.setTimeEvent(0, 160, 1, false);
|
||
obj.setTimeEvent(2, 960, 1, false);
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case 2://拦截机
|
||
switch(state){
|
||
case 20://起飞
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/sparrowboom/body1.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
//设置跟随
|
||
obj.setMapFollowParent(sqrChr);
|
||
obj.setMapFollowType(1);
|
||
break;
|
||
case 21://飞行
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/sparrowboom/sparrow_sparrow.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
break;
|
||
case 22://传送开始
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/sparrowboom/teleportsparrowstart_00.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
break;
|
||
case 23://传送结束
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/sparrowboom/teleportsparrowend_00.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
break;
|
||
case 24://发射
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/sparrowboom/body3.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
//增加效果
|
||
local currentAni = obj.getCurrentAnimation();
|
||
currentAni.addLayerAnimation(1001,sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/sparrowfactory/sparrowmove3.ani"),true);
|
||
//音效
|
||
obj.getVar().setBool(10,true);
|
||
break;
|
||
}
|
||
break;
|
||
case 3://模块单HIT
|
||
switch(state){
|
||
case 20:
|
||
//设置ATK,百分比
|
||
local bonusrater = obj.getVar("totalDamage").get_vector(0);
|
||
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 10));
|
||
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), bonusrater);
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/sparrowfactory/solarlight02_03.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_VIRTUALRUSH://全息机械猎手
|
||
switch(subtype){
|
||
case 1://光效
|
||
switch(state){
|
||
case 20:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", "passiveobject/mechanic_bykk/animation/dummy.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
//效果
|
||
sq_AddDrawOnlyAniFromParent(obj,"character/gunner/effect/animation/virtualrush/hologramstartfront_00.ani", 0, -1, -1);
|
||
sq_AddDrawOnlyAniFromParent(obj,"character/gunner/effect/animation/virtualrush/hologramstartbottom_00.ani", 0, -1, -1);
|
||
sq_AddDrawOnlyAniFromParent(obj,"character/gunner/effect/animation/virtualrush/hologramstartback_00.ani", 0, -1, -1);
|
||
//LOOP时钟
|
||
obj.setTimeEvent(0, 600, 1, false);
|
||
break;
|
||
case 21:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", "passiveobject/mechanic_bykk/animation/dummy.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
//效果
|
||
local pAni = obj.getCurrentAnimation();
|
||
local ani1 = sq_CreateAnimation("","character/gunner/effect/animation/virtualrush/hologramloopfront_00.ani");
|
||
local ani2 = sq_CreateAnimation("","character/gunner/effect/animation/virtualrush/hologramloopbottom_00.ani");
|
||
local ani3 = sq_CreateAnimation("","character/gunner/effect/animation/virtualrush/hologramloopback_00.ani");
|
||
pAni.addLayerAnimation(-10,ani1,true);
|
||
pAni.addLayerAnimation(-10,ani2,true);
|
||
pAni.addLayerAnimation(-10,ani3,true);
|
||
break;
|
||
case 22:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", "passiveobject/mechanic_bykk/animation/dummy.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
//设置帧延时
|
||
local pAni = obj.getCurrentAnimation();
|
||
sq_SetFrameDelayTime(pAni, 0, 100);
|
||
sq_SetFrameDelayTime(pAni, 1, 1000);
|
||
//效果
|
||
sq_AddDrawOnlyAniFromParent(obj,"character/gunner/effect/animation/virtualrush/hologramendfront_00.ani", 0, -1, -1);
|
||
sq_AddDrawOnlyAniFromParent(obj,"character/gunner/effect/animation/virtualrush/hologramendbottom_00.ani", 0, -1, -1);
|
||
sq_AddDrawOnlyAniFromParent(obj,"character/gunner/effect/animation/virtualrush/hologramendback_00.ani", 0, -1, -1);
|
||
//爆炸时钟
|
||
if(sqrChr.getVar("VIRTUALRUSH_SUB2").get_obj_vector_size() > 0){
|
||
obj.setTimeEvent(1, 650, 1, false);
|
||
}
|
||
break;
|
||
case 23:
|
||
//设置ATK,百分比
|
||
local bonusrater = sq_GetBonusRateWithPassive(sqrChr, SKILL_GUNNER_VIRTUALRUSH, STATE_GUNNER_VIRTUALRUSH, 0, 1.0);
|
||
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 0));
|
||
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), bonusrater);
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", "passiveobject/mechanic_bykk/animation/explosion/fireexplosion.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
//设置帧延时
|
||
local pAni = obj.getCurrentAnimation();
|
||
sq_SetAttackBoundingBoxSizeRate(pAni, 4.0, 4.0, 4.0);//攻击框,x y z比率
|
||
sq_SetFrameDelayTime(pAni, 0, 50);
|
||
sq_SetFrameDelayTime(pAni, 1, 50);
|
||
//效果
|
||
sq_AddDrawOnlyAniFromParent(obj,"character/gunner/effect/animation/virtualrush/hologramboomfront_00.ani", 0, -1, -1);
|
||
sq_AddDrawOnlyAniFromParent(obj,"character/gunner/effect/animation/virtualrush/hologramboombottom_00.ani", 0, -1, -1);
|
||
break;
|
||
|
||
}
|
||
break;
|
||
case 2://召唤效果
|
||
switch(state){
|
||
case 20://普通开始
|
||
//根据技能选择不同ANI地址
|
||
local anipath;
|
||
local skillIndex_sub1 = obj.getVar("skillIndex_sub1").get_vector(0);
|
||
local skillIndex_sub2 = obj.getVar("skillIndex_sub2").get_vector(0);
|
||
switch(skillIndex_sub1){
|
||
case SKILL_GUNNER_ATEAM:
|
||
switch(skillIndex_sub2){
|
||
case 1:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramd1start_01.ani";
|
||
break;
|
||
case 2:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramg1start_01.ani";
|
||
break;
|
||
case 3:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramh1start_01.ani";
|
||
break;
|
||
case 4:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/holograms1start_01.ani";
|
||
break;
|
||
case 5:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramt1start_01.ani";
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_ROBOTRX60:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramrx60start_01.ani";
|
||
break;
|
||
case 27:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramrx78start_01.ani";
|
||
break;
|
||
case 28:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramez8start_01.ani";
|
||
break;
|
||
case 59:
|
||
switch(skillIndex_sub2){
|
||
case 1:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramhealrx78start_01.ani";
|
||
break;
|
||
case 2:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramheadingrx78start_00.ani";
|
||
break;
|
||
case 3:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramfirerx78start_01.ani";
|
||
break;
|
||
}
|
||
break;
|
||
case 83:
|
||
switch(skillIndex_sub2){
|
||
case 1:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramsparrowfactorystart_00.ani";
|
||
break;
|
||
case 2:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramsparrowstart_01.ani";
|
||
break;
|
||
}
|
||
break;
|
||
case 105:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramez8exstart_01.ani";
|
||
break;
|
||
}
|
||
local ani = sq_CreateAnimation("", anipath);
|
||
obj.setCurrentAnimation(ani);
|
||
break;
|
||
case 21://普通过程
|
||
//根据技能选择不同ANI地址
|
||
local anipath;
|
||
local skillIndex_sub1 = obj.getVar("skillIndex_sub1").get_vector(0);
|
||
local skillIndex_sub2 = obj.getVar("skillIndex_sub2").get_vector(0);
|
||
switch(skillIndex_sub1){
|
||
case SKILL_GUNNER_ATEAM:
|
||
switch(skillIndex_sub2){
|
||
case 1:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramd1loop_00.ani";
|
||
break;
|
||
case 2:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramg1loop_00.ani";
|
||
break;
|
||
case 3:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramh1loop_00.ani";
|
||
break;
|
||
case 4:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/holograms1loop_00.ani";
|
||
break;
|
||
case 5:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramt1loop_00.ani";
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_ROBOTRX60:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramrx60loop_00.ani";
|
||
break;
|
||
case 27:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramrx78loop_00.ani";
|
||
break;
|
||
case 28:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramez8loop_00.ani";
|
||
break;
|
||
case 59:
|
||
switch(skillIndex_sub2){
|
||
case 1:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramhealrx78loop_00.ani";
|
||
break;
|
||
case 2:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramheadingrx78loop_00.ani";
|
||
break;
|
||
case 3:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramfirerx78loop_00.ani";
|
||
break;
|
||
}
|
||
break;
|
||
case 83:
|
||
switch(skillIndex_sub2){
|
||
case 1:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramsparrowfactoryloop_00.ani";
|
||
break;
|
||
case 2:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramsparrowloop_00.ani";
|
||
break;
|
||
}
|
||
break;
|
||
case 105:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramez8exloop_00.ani";
|
||
break;
|
||
}
|
||
local ani = sq_CreateAnimation("", anipath);
|
||
obj.setCurrentAnimation(ani);
|
||
break;
|
||
case 22://普通结束
|
||
//根据技能选择不同ANI地址
|
||
local anipath;
|
||
local skillIndex_sub1 = obj.getVar("skillIndex_sub1").get_vector(0);
|
||
local skillIndex_sub2 = obj.getVar("skillIndex_sub2").get_vector(0);
|
||
switch(skillIndex_sub1){
|
||
case SKILL_GUNNER_ATEAM:
|
||
switch(skillIndex_sub2){
|
||
case 1:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramd1end_00.ani";
|
||
break;
|
||
case 2:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramg1end_00.ani";
|
||
break;
|
||
case 3:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramh1end_00.ani";
|
||
break;
|
||
case 4:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/holograms1end_00.ani";
|
||
break;
|
||
case 5:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramt1end_00.ani";
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_ROBOTRX60:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramrx60end_02.ani";
|
||
break;
|
||
case 27:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramrx78end_02.ani";
|
||
break;
|
||
case 28:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramez8end_02.ani";
|
||
break;
|
||
case 59:
|
||
switch(skillIndex_sub2){
|
||
case 1:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramheadingrx78end_02.ani";
|
||
break;
|
||
case 2:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramheadingrx78start_00.ani";
|
||
break;
|
||
case 3:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramfirerx78end_02.ani";
|
||
break;
|
||
}
|
||
break;
|
||
case 83:
|
||
switch(skillIndex_sub2){
|
||
case 1:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramsparrowfactoryend_02.ani";
|
||
break;
|
||
case 2:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramsparrowend_02.ani";
|
||
break;
|
||
}
|
||
break;
|
||
case 105:
|
||
anipath = "character/gunner/effect/animation/virtualrush/hologram/hologramez8exend_02.ani";
|
||
break;
|
||
}
|
||
local ani = sq_CreateAnimation("", anipath);
|
||
obj.setCurrentAnimation(ani);
|
||
break;
|
||
case 23://传送开始
|
||
//根据技能选择不同ANI地址
|
||
local anipath;
|
||
local skillIndex_sub1 = obj.getVar("skillIndex_sub1").get_vector(0);
|
||
local skillIndex_sub2 = obj.getVar("skillIndex_sub2").get_vector(0);
|
||
switch(skillIndex_sub1){
|
||
case SKILL_GUNNER_ATEAM:
|
||
switch(skillIndex_sub2){
|
||
case 1:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleportd1start_00.ani";
|
||
break;
|
||
case 2:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleportg1start_00.ani";
|
||
break;
|
||
case 3:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleporth1start_00.ani";
|
||
break;
|
||
case 4:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleports1start_00.ani";
|
||
break;
|
||
case 5:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleportt1start_00.ani";
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_ROBOTRX60:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleportrx60start_00.ani";
|
||
break;
|
||
case 27:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleportrx78start_00.ani";
|
||
break;
|
||
case 28:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleportez8start_00.ani";
|
||
break;
|
||
case 59:
|
||
switch(skillIndex_sub2){
|
||
case 1:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleporthealrx78start_00.ani";
|
||
break;
|
||
case 2:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleportheadingrx78start_00.ani";
|
||
break;
|
||
case 3:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleportfirerx78start_00.ani";
|
||
break;
|
||
}
|
||
break;
|
||
case 83:
|
||
switch(skillIndex_sub2){
|
||
case 1:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleportsparrowfactorystart_00.ani";
|
||
break;
|
||
case 2:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleportsparrowstart_00.ani";
|
||
break;
|
||
}
|
||
break;
|
||
case 105:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleportez8exstart_00.ani";
|
||
break;
|
||
}
|
||
local ani = sq_CreateAnimation("", anipath);
|
||
obj.setCurrentAnimation(ani);
|
||
// local pAni = obj.getCurrentAnimation();//得到ani
|
||
// local fireT = pAni.getDelaySum(false);
|
||
// printp("skillIndex_sub1="+skillIndex_sub1.tostring()+" skillIndex_sub2="+skillIndex_sub2.tostring()+" fireT="+fireT.tostring()+"\n");
|
||
break;
|
||
case 24://传送结束
|
||
//根据技能选择不同ANI地址
|
||
local anipath;
|
||
local skillIndex_sub1 = obj.getVar("skillIndex_sub1").get_vector(0);
|
||
local skillIndex_sub2 = obj.getVar("skillIndex_sub2").get_vector(0);
|
||
switch(skillIndex_sub1){
|
||
case SKILL_GUNNER_ATEAM:
|
||
switch(skillIndex_sub2){
|
||
case 1:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleportd1end_00.ani";
|
||
break;
|
||
case 2:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleportg1end_00.ani";
|
||
break;
|
||
case 3:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleporth1end_00.ani";
|
||
break;
|
||
case 4:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleports1end_00.ani";
|
||
break;
|
||
case 5:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleportt1end_00.ani";
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_ROBOTRX60:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleportrx60end_00.ani";
|
||
break;
|
||
case 27:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleportrx78end_00.ani";
|
||
break;
|
||
case 28:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleportez8end_00.ani";
|
||
break;
|
||
case 59:
|
||
switch(skillIndex_sub2){
|
||
case 1:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleporthealrx78end_00.ani";
|
||
break;
|
||
case 2:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleportheadingrx78end_00.ani";
|
||
break;
|
||
case 3:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleportfirerx78end_00.ani";
|
||
break;
|
||
}
|
||
break;
|
||
case 83:
|
||
switch(skillIndex_sub2){
|
||
case 1:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleportsparrowfactoryend_00.ani";
|
||
break;
|
||
case 2:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleportsparrowend_00.ani";
|
||
break;
|
||
}
|
||
break;
|
||
case 105:
|
||
anipath = "character/gunner/effect/animation/virtualrush/teleport/teleportez8exend_00.ani";
|
||
break;
|
||
}
|
||
local ani = sq_CreateAnimation("", anipath);
|
||
obj.setCurrentAnimation(ani);
|
||
//
|
||
local aimPosX = sqrChr.getVar("virtualrush").get_vector(0);
|
||
local aimPosY = sqrChr.getVar("virtualrush").get_vector(1);
|
||
sq_setCurrentAxisPos(obj, 0, aimPosX);
|
||
sq_setCurrentAxisPos(obj, 1, aimPosY);
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_ROBOTRX60:
|
||
switch(subtype){
|
||
case 1:
|
||
switch(state){
|
||
case 20:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","character/gunner/effect/animation/rx-60/rx-60_ground_a.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
//修改范围
|
||
local range = 250;
|
||
local recive_range = obj.getVar("range").get_vector(0);
|
||
local sizeRate = recive_range.tofloat() / range;
|
||
local currentAni = obj.getCurrentAnimation();
|
||
currentAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
|
||
//设置ap
|
||
local parentObj = obj.getParent();
|
||
local appendage = CNSquirrelAppendage.sq_AppendAppendage(parentObj, obj, SKILL_GUNNER_ROBOTRX60, false, "character/gunner/madeby_kak_mechanic/ap2/ap_virtualrush.nut", false);
|
||
|
||
if(appendage){
|
||
CNSquirrelAppendage.sq_Append(appendage, parentObj, obj);
|
||
|
||
local auraAppendage = appendage.sq_getAuraMaster("auraMaster");
|
||
if(!auraAppendage) auraAppendage = appendage.sq_AddAuraMaster("auraMaster", parentObj, obj, 1200, 18, 5, 0);
|
||
if(auraAppendage){
|
||
auraAppendage.setAttractionInfo(250, 250, recive_range, 100);//300,300,150,100
|
||
}
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_DIMENSIONRUNNER://TN80
|
||
switch(subtype){
|
||
case 1://本体
|
||
switch(state){
|
||
case 20://出场
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", "passiveobject/mechanic_bykk/animation/dimensionrunner/new/dimensionrunnerready_body.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/dimensionrunner/dimensionrunner_a.ani",0,0,0);
|
||
obj.setTimeEvent(0,800,1,false);
|
||
local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/dimensionrunner/dimensionrunner_c.ani",0,0,0);
|
||
local pAni = pooledObj.getCurrentAnimation();
|
||
pAni.setSpeedRate(150.0);
|
||
break;
|
||
case 21://导弹
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", "passiveobject/mechanic_bykk/animation/dimensionrunner/new/dimensionrunnerfire_body.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local totalDamage = obj.getVar("totalDamage").get_vector(1);
|
||
createSkillPassiveObj_nanjixie(sqrChr, obj, SKILL_GUNNER_DIMENSIONRUNNER, 2, totalDamage, 60, 0, -50, 4, 134);
|
||
createSkillPassiveObj_nanjixie(sqrChr, obj, SKILL_GUNNER_DIMENSIONRUNNER, 2, totalDamage, 60, 0, 65, 1, 126);
|
||
if(sq_getRandom(0,99) > 33) createSkillPassiveObj_nanjixie(sqrChr, obj, SKILL_GUNNER_DIMENSIONRUNNER, 2, totalDamage, 30, 0, -16, 3, 153);
|
||
if(sq_getRandom(0,99) > 33) createSkillPassiveObj_nanjixie(sqrChr, obj, SKILL_GUNNER_DIMENSIONRUNNER, 2, totalDamage, 30, 0, 25, 2, 157);
|
||
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/dimensionrunner/new/dimensionrunnerfirea_00.ani",0,-1,-1);
|
||
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/dimensionrunner/new/dimensionrunnerfireb_00.ani",0,-1,-1);
|
||
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/dimensionrunner/new/dimensionrunnerfirec_00.ani",0,-1,-1);
|
||
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/dimensionrunner/new/dimensionrunnerfired_00.ani",0,-1,-1);
|
||
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/dimensionrunner/new/missilefireglow_a.ani",0,0,0);
|
||
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/dimensionrunner/new/missilefireglow_b.ani",0,0,0);
|
||
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/dimensionrunner/new/missilefireglow_c.ani",0,0,0);
|
||
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/dimensionrunner/new/missilefireglow_d.ani",0,0,0);
|
||
break;
|
||
case 22://是否抓人
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", "passiveobject/mechanic_bykk/animation/dimensionrunner/new/dimensionrunnersuicideready_body.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
break;
|
||
case 23://抓人
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", "passiveobject/mechanic_bykk/animation/dimensionrunner/new/dimensionrunnersuicide_body.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/dimensionrunner/new/suicidedust_00.ani",0,0,0);
|
||
break;
|
||
case 24://抓住
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", "passiveobject/mechanic_bykk/animation/dimensionrunner/new/suisideexplosiona_body.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
break;
|
||
case 25://爆炸
|
||
//设置ATK,百分比
|
||
local bonusrater = obj.getVar("totalDamage").get_vector(0);
|
||
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 16));
|
||
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), bonusrater);
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", "passiveobject/mechanic_bykk/animation/dimensionrunner/new/suisideexplosionb_04.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
obj.setTimeEvent(2,800,1,false);
|
||
break;
|
||
}
|
||
break;
|
||
case 2://导弹
|
||
switch(state){
|
||
case 20:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", "passiveobject/mechanic_bykk/animation/dimensionrunner/new/missile_01.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local angle = obj.getVar("custom").get_vector(6).tofloat();
|
||
sq_SetCustomRotate(obj, sq_ToRadian(-angle));
|
||
// if(obj.getDirection() == ENUM_DIRECTION_LEFT) sq_SetCustomRotate(obj, sq_ToRadian(45.0));
|
||
obj.setTimeEvent(10,100,-1,false);
|
||
break;
|
||
case 21:
|
||
obj.stopTimeEvent(10);
|
||
sq_SetCustomRotate(obj, sq_ToRadian(0.0));
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", "passiveobject/mechanic_bykk/animation/dimensionrunner/new/missileexplosiontalisman_03.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
//设置ATK,百分比
|
||
local bonusrater = obj.getVar("custom").get_vector(0);
|
||
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 13));
|
||
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), bonusrater);
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_HELLMARCH:
|
||
switch(subtype){
|
||
case 1:
|
||
switch(state){
|
||
case 20:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", "character/gunner/effect/animation/hellmarch/gate/front/gatestart_dot2.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
// local currentAni = obj.getCurrentAnimation();
|
||
// currentAni.addLayerAnimation(-1,sq_CreateAnimation("",""),true);
|
||
sq_AddDrawOnlyAniFromParent(obj,"character/gunner/effect/animation/hellmarch/gate/laser_electric02.ani",0,0,0);
|
||
obj.setTimeEvent(1,880,1,false);
|
||
obj.setTimeEvent(2,1000,1,false);
|
||
break;
|
||
case 21:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", "character/gunner/effect/animation/hellmarch/gate/front/gateloop_dot2.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local currentAni = obj.getCurrentAnimation();
|
||
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","character/gunner/effect/animation/hellmarch/gate/gateground_03.ani"),true);
|
||
sq_AddDrawOnlyAniFromParent(obj,"character/gunner/effect/animation/hellmarch/gate/laser_attack.ani",0,0,0);
|
||
sq_AddDrawOnlyAniFromParent(obj,"character/gunner/effect/animation/hellmarch/gate/laser_direct01.ani",0,0,0);
|
||
sq_AddDrawOnlyAniFromParent(obj,"character/gunner/effect/animation/hellmarch/gate/laser_direct02.ani",0,0,0);
|
||
obj.setTimeEvent(9,150,1,false);
|
||
break;
|
||
case 22:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", "character/gunner/effect/animation/hellmarch/gate/front/gateend_dot2.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
break;
|
||
}
|
||
break;
|
||
case 2:
|
||
switch(state){
|
||
case 20:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", "character/gunner/effect/animation/hellmarch/gate/back/gatestart_dot4.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
break;
|
||
case 21:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", "character/gunner/effect/animation/hellmarch/gate/back/gateloop_dot4.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
break;
|
||
case 22:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", "character/gunner/effect/animation/hellmarch/gate/back/gateend_dot4.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
break;
|
||
}
|
||
break;
|
||
case 3://蓝色队长
|
||
case 4://红色队长
|
||
case 5://红色队长
|
||
local anipath = "passiveobject/mechanic_bykk/animation/hellmarch/leaderblue/leader_";
|
||
if(subtype == 4) anipath = "passiveobject/mechanic_bykk/animation/hellmarch/leaderred/leader_";
|
||
if(subtype == 5) anipath = "passiveobject/mechanic_bykk/animation/hellmarch/soldier/soldier_";
|
||
switch(state){
|
||
case 20:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", anipath + "appear_leftfootmove1.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
if(subtype == 5) obj.sq_PlaySound("R_HELLMARCH_SOLDIERS");
|
||
break;
|
||
case 21:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", anipath + "appear_rightfootmove1.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
if(subtype == 5) obj.sq_PlaySound("R_HELLMARCH_SOLDIERS");
|
||
break;
|
||
case 22:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", anipath + "leftfootmove.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local pooledObj = sq_AddDrawOnlyAniFromParent(obj,anipath + "appear_leftfootmove1.ani",0,1,1);
|
||
sq_moveWithParent(obj, pooledObj);
|
||
if(subtype == 5) obj.sq_PlaySound("R_HELLMARCH_SOLDIERS");
|
||
break;
|
||
case 23:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", anipath + "rightfootmove.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local pooledObj = sq_AddDrawOnlyAniFromParent(obj,anipath + "appear_rightfootmove1.ani",0,1,1);
|
||
sq_moveWithParent(obj, pooledObj);
|
||
if(subtype == 5) obj.sq_PlaySound("R_HELLMARCH_SOLDIERS");
|
||
break;
|
||
case 24:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", anipath + "leftfootmove.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local currentAni = obj.getCurrentAnimation();
|
||
sq_SetFrameDelayTime(currentAni, 0, 50);
|
||
sq_SetFrameDelayTime(currentAni, 1, 50);
|
||
if(subtype == 5) obj.sq_PlaySound("R_HELLMARCH_SOLDIERS");
|
||
break;
|
||
case 25:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", anipath + "rightfootmove.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
local currentAni = obj.getCurrentAnimation();
|
||
sq_SetFrameDelayTime(currentAni, 0, 50);
|
||
sq_SetFrameDelayTime(currentAni, 1, 50);
|
||
if(subtype == 5) obj.sq_PlaySound("R_HELLMARCH_SOLDIERS");
|
||
break;
|
||
case 26:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", anipath + "sir.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
break;
|
||
case 27:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", anipath + "readytoexplosion.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
break;
|
||
case 28:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", "passiveobject/mechanic_bykk/animation/hellmarch/bombnew/explosion_04.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
if(subtype == 3 || subtype == 4){
|
||
local currentAni = obj.getCurrentAnimation();
|
||
currentAni.addLayerAnimation(1001,sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/hellmarch/bombnew/hellboom_dodge.ani"),true);
|
||
currentAni.addLayerAnimation(1001,sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/hellmarch/bombnew/hellboom01_dodge.ani"),true);
|
||
currentAni.addLayerAnimation(1001,sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/hellmarch/bombnew/hellboom02_dodge.ani"),true);
|
||
currentAni.addLayerAnimation(1001,sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/hellmarch/bombnew/hellboom03_dodge.ani"),true);
|
||
}
|
||
sq_setCurrentAxisPos(obj, 2, 75);
|
||
break;
|
||
}
|
||
if(subtype == 5){
|
||
local currentAni = obj.getCurrentAnimation();
|
||
currentAni.setImageRateFromOriginal(0.95, 0.95);
|
||
currentAni.setAutoLayerWorkAnimationAddSizeRate(0.95);
|
||
}
|
||
break;
|
||
case 6://攻击主体
|
||
switch(state){
|
||
case 20:
|
||
//设置ATK,百分比
|
||
local bonusrater = obj.getVar("custom").get_vector(0);
|
||
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 19));
|
||
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), bonusrater);
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("", "passiveobject/mechanic_bykk/animation/hellmarch/hellmarchdummyexplosion.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
obj.setTimeEvent(21,450,3,false);
|
||
|
||
local currentAni = obj.getCurrentAnimation();
|
||
sq_SetFrameDelayTime(currentAni, 0, 3340);
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case 200:
|
||
switch(state){
|
||
case 20:
|
||
//设置ATK,百分比
|
||
local bonusrater = obj.getVar("totalDamage").get_vector(0);
|
||
//printp("bonusrater="+bonusrater.tostring()+"\n");
|
||
if(subtype == 1){
|
||
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 0));
|
||
}
|
||
else if(subtype == 2){
|
||
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 11));
|
||
}
|
||
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), bonusrater);
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/explosion/fireexplosion.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
//大小
|
||
local currentAni = obj.getCurrentAnimation();//得到当前ani
|
||
local sizeRate = obj.getVar("sizeRate").get_vector(0).tofloat() / 100;
|
||
sizeRate = sizeRate.tofloat();
|
||
sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate);//攻击框,x y z比率
|
||
|
||
// local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
// if (attackInfo){
|
||
// attackInfo.setElement(ENUM_ELEMENT_WATER);
|
||
// attackInfo.setElement(ENUM_ELEMENT_LIGHT);
|
||
// attackInfo.setElement(ENUM_ELEMENT_FIRE);
|
||
// attackInfo.setElement(ENUM_ELEMENT_DARK);
|
||
// }
|
||
//声音
|
||
obj.sq_PlaySound("B_FIRE_EXPLOSION");
|
||
//特效
|
||
if(subtype == 1){
|
||
obj.setTimeEvent(1, 200, 2, true);
|
||
obj.setTimeEvent(2, 50, 4, true);
|
||
obj.setTimeEvent(3, 15, 16, true);
|
||
obj.setTimeEvent(4, 100, 2, true);
|
||
}
|
||
else if(subtype == 2){
|
||
obj.setTimeEvent(1, 100, 4, true);
|
||
obj.setTimeEvent(2, 25, 8, true);
|
||
obj.setTimeEvent(3, 7, 32, true);
|
||
obj.setTimeEvent(4, 50, 4, true);
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case 250:
|
||
//设置ANI
|
||
local ani = sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/dummy.ani");
|
||
obj.setCurrentAnimation(ani);
|
||
obj.setTimeEvent(0,200,4,true);
|
||
break;
|
||
}
|
||
|
||
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
if(attackInfo){
|
||
local element_kk_fire = sqrChr.getVar("element_kk").getInt(0);
|
||
local element_kk_water = sqrChr.getVar("element_kk").getInt(1);
|
||
local element_kk_dark = sqrChr.getVar("element_kk").getInt(2);
|
||
local element_kk_light = sqrChr.getVar("element_kk").getInt(3);
|
||
if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE) && element_kk_fire > 0) attackInfo.setElement(ENUM_ELEMENT_FIRE);
|
||
if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER) && element_kk_water > 0) attackInfo.setElement(ENUM_ELEMENT_WATER);
|
||
if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK) && element_kk_dark > 0) attackInfo.setElement(ENUM_ELEMENT_DARK);
|
||
if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT) && element_kk_light > 0) attackInfo.setElement(ENUM_ELEMENT_LIGHT);
|
||
}
|
||
}
|
||
|
||
function onTimeEvent_po_nanjixie_bykk(obj, timeEventIndex, timeEventCount)
|
||
{
|
||
if(!obj) return;
|
||
local skillIndex = obj.getVar("skillIndex").get_vector(0);
|
||
local subtype = obj.getVar("subtype").get_vector(0);
|
||
local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter());
|
||
local state = obj.getVar("state").get_vector(0);
|
||
|
||
switch(skillIndex){
|
||
case 29:
|
||
switch(subtype){
|
||
case 2:
|
||
switch(timeEventIndex){
|
||
case 0:
|
||
switch(timeEventCount){
|
||
case 1:
|
||
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/exs/exslaser/lasersub1.ani", 0, 1, 1);
|
||
break;
|
||
case 2:
|
||
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/exs/exslaser/lasersub2.ani", 0, 1, 1);
|
||
break;
|
||
case 3:
|
||
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/exs/exslaser/lasersub3.ani", 0, 1, 1);
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case 3:
|
||
case 4:
|
||
case 5:
|
||
switch(timeEventIndex){
|
||
case 0:
|
||
obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, "");
|
||
break;
|
||
case 1:
|
||
local bullet_number = obj.getVar("bullet_number").get_vector(0);
|
||
if(sqrChr.getVar("holdandgo").getBool(0)){
|
||
obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
|
||
if(subtype == 5){
|
||
obj.stopTimeEvent(1);
|
||
obj.stopTimeEvent(2);
|
||
}
|
||
}
|
||
if(timeEventCount >= bullet_number && subtype != 5) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
|
||
local speedRate = (bullet_number.tofloat() * 180.0 / 1000.0) * 100.0;
|
||
local anipath1 = "monster/character/gunner/robot_by_kk/exssophia_ani/sophia_cannonattack.ani";
|
||
local anipath2 = "monster/character/gunner/robot_by_kk/exssophia_ani/sophia_cannonattackglow.ani";
|
||
local anipath3 = "monster/character/gunner/robot_by_kk/exssophia_ani/sophia_attackglow.ani";
|
||
local anipath4 = "monster/character/gunner/robot_by_kk/exssophia_ani/sophia_shoot.ani";
|
||
if(subtype == 4){
|
||
anipath1 = "monster/character/gunner/robot_by_kk/exs_ani/cannonattack.ani";
|
||
anipath2 = "monster/character/gunner/robot_by_kk/exs_ani/cannonattackglow.ani";
|
||
anipath3 = "monster/character/gunner/robot_by_kk/exs_ani/attackglow.ani";
|
||
anipath4 = "monster/character/gunner/robot_by_kk/exssophia_ani/sophia_shoot.ani";
|
||
}
|
||
else if(subtype == 5){
|
||
anipath1 = "monster/character/gunner/robot_by_kk/exsex_ani/cannonattack.ani";
|
||
anipath2 = "monster/character/gunner/robot_by_kk/exsex_ani/cannonattackglow.ani";
|
||
anipath3 = "monster/character/gunner/robot_by_kk/exsex_ani/attackglow.ani";
|
||
anipath4 = "monster/character/gunner/robot_by_kk/exssophia_ani/sophia_shoot.ani";
|
||
}
|
||
local pooledObj1 = sq_AddDrawOnlyAniFromParent(obj, anipath1, 0, -1, -1);
|
||
local pooledObj2 = sq_AddDrawOnlyAniFromParent(obj, anipath2, 0, 1, 1);
|
||
local pooledObj3 = sq_AddDrawOnlyAniFromParent(obj, anipath3, 0, 1, 1);
|
||
local pooledObj4 = sq_AddDrawOnlyAniFromParent(obj, anipath4, 50, 1, 74);
|
||
local pAni1 = pooledObj1.getCurrentAnimation();
|
||
local pAni2 = pooledObj2.getCurrentAnimation();
|
||
local pAni3 = pooledObj3.getCurrentAnimation();
|
||
local pAni4 = pooledObj3.getCurrentAnimation();
|
||
pAni1.setSpeedRate(speedRate.tofloat());
|
||
pAni2.setSpeedRate(speedRate.tofloat());
|
||
pAni3.setSpeedRate(speedRate.tofloat());
|
||
pAni4.setSpeedRate(speedRate.tofloat());
|
||
local totalDamage = obj.getVar("totalDamage").get_vector(0);
|
||
createSkillPassiveObj_nanjixie(sqrChr, obj, 29, 1, totalDamage, 0, 0, 88, 0, 70);
|
||
obj.sq_PlaySound("P_VIPER_SHOT_02");
|
||
break;
|
||
case 2:
|
||
sq_AddDrawOnlyAniFromParent(obj, "monster/character/gunner/robot_by_kk/exsex_ani/ex_body_light.ani", 0, 2, 52);
|
||
sq_AddDrawOnlyAniFromParent(obj, "monster/character/gunner/robot_by_kk/exsex_ani/ex_laser_attack_front.ani", 0, 1, 1);
|
||
sq_AddDrawOnlyAniFromParent(obj, "monster/character/gunner/robot_by_kk/exsex_ani/ex_laser_attack_back.ani", 0, 1, 1);
|
||
sq_AddDrawOnlyAniFromParent(obj, "monster/character/gunner/robot_by_kk/exsex_ani/ex_laser_attack_flash.ani", 30, 1, 66);
|
||
local totalDamage2 = obj.getVar("totalDamage2").get_vector(0);
|
||
createSkillPassiveObj_nanjixie(sqrChr, obj, 29, 2, totalDamage2, 0, 0, 50, 1, 66);
|
||
break;
|
||
case 1001:
|
||
if(sqrChr.getVar("holdandgo").getBool(0) == false){
|
||
local sizeRate = 150;
|
||
local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 29, 29, 2, 1.0) + 100;
|
||
createFireExplosion_nanjixie(sqrChr,obj,sizeRate,totalDamage, 20, false);
|
||
sq_CreateParticle("monster/character/gunner/robot_by_kk/particle/exs_robotboom.ptl", obj, 0, 1, 20, true, 30, 0, 1);
|
||
sq_CreateParticle("monster/character/gunner/robot_by_kk/particle/exs_boom.ptl", obj, 0, 1, 20, true, 30, 0, 1);
|
||
sq_CreateParticle("monster/character/gunner/robot_by_kk/particle/exs_bullet.ptl", obj, 0, 1, 20, true, 30, 0, 1);
|
||
}
|
||
sq_SendDestroyPacketPassiveObject(obj);
|
||
break;
|
||
case 1002:
|
||
local moveX = obj.getVar("move").get_vector(0);
|
||
local moveY = obj.getVar("move").get_vector(1);
|
||
sq_setCurrentAxisPos(obj, 0, moveX);//设置当前x坐标
|
||
sq_setCurrentAxisPos(obj, 1, moveY);//设置当前y坐标
|
||
sq_SetCurrentDirection(obj, sqrChr.getDirection());
|
||
break;
|
||
case 1003:
|
||
local moveX = sqrChr.getVar("robotsexplosion").get_vector(0);
|
||
local moveY = sqrChr.getVar("robotsexplosion").get_vector(1);
|
||
sq_setCurrentAxisPos(obj, 0, moveX);//设置当前x坐标
|
||
sq_setCurrentAxisPos(obj, 1, moveY);//设置当前y坐标
|
||
sq_SetCurrentDirection(obj, sqrChr.getDirection());
|
||
obj.addSetStatePacket(25, null, STATE_PRIORITY_AUTO, false, "");
|
||
break;
|
||
case 1004:
|
||
sq_SendDestroyPacketPassiveObject(obj);
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case 59:
|
||
switch(subtype){
|
||
case 1:
|
||
switch(timeEventIndex){
|
||
case 0:
|
||
local skill_level = sq_GetSkillLevel(sqrChr, 59);
|
||
local number = sqrChr.sq_GetLevelData(59, 3, skill_level);
|
||
obj.getVar().clear_vector();
|
||
obj.getVar().push_vector(number);
|
||
local sperobot_number = sqrChr.sq_GetLevelData(59, 4, skill_level);
|
||
obj.getVar("sperobot").clear_vector();
|
||
for(local io = 0; io < sperobot_number; io ++){
|
||
local numberlen = (number / sperobot_number).tointeger();
|
||
local random_number = sq_getRandom(0 + io * numberlen, (io + 1) * numberlen - 1);
|
||
obj.getVar("sperobot").push_vector(random_number);
|
||
}
|
||
obj.setTimeEvent(1, 5, number,true);
|
||
break;
|
||
case 1:
|
||
local basexpos = obj.getVar("basepos").get_vector(0);
|
||
local baseypos = obj.getVar("basepos").get_vector(1);
|
||
local number = obj.getVar().get_vector(0);
|
||
local level = sq_GetSkillLevel(sqrChr, 174);
|
||
local distanceX = 50;
|
||
if(number >= 30) distanceX = 40;
|
||
if(number >= 50) distanceX = 30;
|
||
local rebotnumer = 77634;
|
||
timeEventCount = timeEventCount - 1;
|
||
for(local ui = 0; ui < obj.getVar("sperobot").size_vector(); ui++){
|
||
if(timeEventCount == obj.getVar("sperobot").get_vector(ui)){
|
||
rebotnumer = sq_getRandom(77631,77633).tointeger();
|
||
break;
|
||
}
|
||
}
|
||
local destX_01 = 0;
|
||
local destY_01 = baseypos - sqrChr.getYPos();
|
||
if(obj.getDirection() == ENUM_DIRECTION_RIGHT){
|
||
destX_01 = basexpos - sqrChr.getXPos();
|
||
}
|
||
else if(obj.getDirection() == ENUM_DIRECTION_LEFT){
|
||
destX_01 = sqrChr.getXPos() - basexpos;
|
||
}
|
||
if(timeEventCount % 3 == 1){
|
||
//createSkillPassiveObj_nanjixie(sqrChr,obj,59,2,rebotnumer,0,0,-400+sq_getRandom(-5,5),0 - 40 + sq_getRandom(-8,8),400);
|
||
summonmonster_mechanic(sqrChr, destX_01 + (timeEventCount/3).tointeger()*distanceX + sq_getRandom(-5,5), destY_01 - 40 + sq_getRandom(-8,8), 600, 0, rebotnumer, 600000, level, 0);
|
||
}
|
||
else if(timeEventCount % 3 == 2){
|
||
//createSkillPassiveObj_nanjixie(sqrChr,obj,59,2,rebotnumer,0,0,-400+sq_getRandom(-5,5),0 + sq_getRandom(-8,8),400);
|
||
summonmonster_mechanic(sqrChr, destX_01 + (timeEventCount/3).tointeger()*distanceX + sq_getRandom(-5,5), destY_01 + sq_getRandom(-8,8), 600, 0, rebotnumer, 600000, level, 0);
|
||
}
|
||
else if(timeEventCount % 3 == 0){
|
||
//createSkillPassiveObj_nanjixie(sqrChr,obj,59,2,rebotnumer,0,0,-400+sq_getRandom(-5,5),0 + 40 + sq_getRandom(-8,8),400);
|
||
summonmonster_mechanic(sqrChr, destX_01 + (timeEventCount/3).tointeger()*distanceX + sq_getRandom(-5,5), destY_01 + 40 + sq_getRandom(-8,8), 600, 0, rebotnumer, 600000, level, 0);
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case 63:
|
||
switch(subtype){
|
||
case 2:
|
||
switch(timeEventIndex){
|
||
case 0:
|
||
local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/tempester/missilesmoke"+sq_getRandom(1,3)+".ani", 0, -1, -1);
|
||
break;
|
||
}
|
||
break;
|
||
case 3:
|
||
switch(timeEventIndex){
|
||
case 0: obj.resetHitObjectList(); break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_G1://G1
|
||
switch(timeEventIndex){
|
||
case 0: obj.addSetStatePacket(23, null, STATE_PRIORITY_IGNORE_FORCE, false, ""); break;
|
||
case 1:
|
||
local totalDamage = obj.getVar("custom").getInt(10);
|
||
local stunTime = obj.getVar("custom").getInt(12);
|
||
local sizeRate = obj.getVar("custom").getInt(14);
|
||
sq_BinaryStartWrite();
|
||
sq_BinaryWriteDword(SKILL_GUNNER_G1);//skillIndex
|
||
sq_BinaryWriteDword(2);//subtype
|
||
sq_BinaryWriteDword(totalDamage);
|
||
sq_BinaryWriteDword(stunTime);
|
||
sq_BinaryWriteDword(sizeRate);
|
||
sq_SendCreatePassiveObjectPacket(obj, NUM_BYKK_PASSIVEOBJECT, 0, 30, 0, 10, obj.getDirection());
|
||
obj.sq_PlaySound("G1_SHOT");
|
||
break;
|
||
case 2:
|
||
local vx = sq_GetUniformVelocity(0, -12, timeEventCount, 12);
|
||
local dstX = sq_GetDistancePos(obj.getVar("move").getInt(10), obj.getDirection(), vx);
|
||
sq_setCurrentAxisPos(obj, 0, dstX);
|
||
break;
|
||
case 10:
|
||
obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, "");
|
||
break;
|
||
case 100://判斷距離
|
||
local base_X = -75;
|
||
local disX = sq_Abs(sq_GetXPos(obj) - sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),base_X));
|
||
local disY = sq_Abs(sq_GetYPos(obj) - sq_GetYPos(sqrChr));
|
||
local disZ = sq_Abs(sq_GetZPos(obj) - sq_GetZPos(sqrChr) - 60);
|
||
local direction = sqrChr.getDirection();
|
||
if(obj.getDirection() != direction) obj.setDirection(direction);
|
||
if(disX > 10){
|
||
local baseM = 30;
|
||
local moveX = disX / baseM + 2;
|
||
if(sq_GetXPos(obj) > sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),base_X)) sq_setCurrentAxisPos(obj, 0, sq_GetXPos(obj) - moveX);
|
||
else sq_setCurrentAxisPos(obj, 0, sq_GetXPos(obj) + moveX);
|
||
}
|
||
if(disY > 10){
|
||
local baseM = 30;
|
||
local moveY = disY / baseM + 1;
|
||
if(sq_GetYPos(obj) > sq_GetYPos(sqrChr)) sq_setCurrentAxisPos(obj, 1, sq_GetYPos(obj) - moveY);
|
||
else sq_setCurrentAxisPos(obj, 1, sq_GetYPos(obj) + moveY);
|
||
}
|
||
if(disZ > 5){
|
||
local baseM = 30;
|
||
local moveZ = disZ / baseM + 1;
|
||
if(sq_GetZPos(obj) - 60 > sq_GetZPos(sqrChr)) sq_setCurrentAxisPos(obj, 2, sq_GetZPos(obj) - moveZ);
|
||
else sq_setCurrentAxisPos(obj, 2, sq_GetZPos(obj) + moveZ);
|
||
}
|
||
if(disX <= 10 && disY <= 10 && disZ <= 5){
|
||
obj.stopTimeEvent(100);
|
||
obj.setTimeEvent(101,300,-1,false);
|
||
}
|
||
break;
|
||
case 101://移動
|
||
local base_X = -75;
|
||
local disX = sq_Abs(sq_GetXPos(obj) - sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),base_X));
|
||
local disY = sq_Abs(sq_GetYPos(obj) - sq_GetYPos(sqrChr));
|
||
local disZ = sq_Abs(sq_GetZPos(obj) - sq_GetZPos(sqrChr) - 60);
|
||
if(disX > 10 || disY > 10 || disZ > 5){
|
||
obj.stopTimeEvent(101);
|
||
obj.setTimeEvent(100,15,-1,false);
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_G2://G2
|
||
switch(timeEventIndex){
|
||
case 0:
|
||
obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, "");
|
||
break;
|
||
case 1:
|
||
obj.resetHitObjectList();
|
||
break;
|
||
case 2:
|
||
obj.setTimeEvent(10,5,-1,false);
|
||
break;
|
||
case 3:
|
||
obj.sq_PlaySound("G2_CHARGE");
|
||
obj.addSetStatePacket(24, null, STATE_PRIORITY_AUTO, false, "");
|
||
break;
|
||
case 8:
|
||
obj.getVar("move").setInt(10, sq_GetXPos(obj));
|
||
obj.getVar("move").setInt(11, sq_GetDistancePos(sq_GetXPos(sqrChr), sqrChr.getDirection(), 50));
|
||
obj.setTimeEvent(9, 5, 30, true);
|
||
break;
|
||
case 9:
|
||
local v = sq_GetUniformVelocity(obj.getVar("move").getInt(10), obj.getVar("move").getInt(11), timeEventCount, 30);
|
||
sq_setCurrentAxisPos(obj, 0, v);
|
||
if(timeEventCount >= 30) obj.setTimeEvent(10,5,-1,false);
|
||
break;
|
||
case 10:
|
||
if(timeEventCount % 30 == 0) obj.sq_PlaySound("G2_LOOP");
|
||
local time = timeEventCount * 5;
|
||
local hitCoolTime = obj.getVar("custom").getInt(13);
|
||
local sub = obj.getVar("custom").getInt(14);
|
||
local roundTime = hitCoolTime * 1;
|
||
local direction = sqrChr.getDirection();
|
||
if(obj.getDirection() != direction) obj.setDirection(direction);
|
||
|
||
local base100Angle = 36000 / 3 * (sub + 1);
|
||
local baseY = sqrChr.getYPos();
|
||
local baseZ = sqrChr.getZPos() + 75;
|
||
local current100Angle = (base100Angle + (36000 * time / roundTime)) % 36000;
|
||
local angle = (current100Angle.tofloat() / 100.0);
|
||
local disMovLen = 35 * sq_CosTable(angle.tointeger());
|
||
if(direction == ENUM_DIRECTION_LEFT) disMovLen = -disMovLen;
|
||
local upMovLen = 50 * sq_SinTable(angle.tointeger());
|
||
local mov_x = sq_GetDistancePos(sq_GetXPos(sqrChr), sqrChr.getDirection(), disMovLen.tointeger() + 60);
|
||
local mov_z = baseZ + upMovLen.tointeger();
|
||
sq_setCurrentAxisPos(obj, 0, mov_x);
|
||
sq_setCurrentAxisPos(obj, 1, baseY + 1);
|
||
sq_setCurrentAxisPos(obj, 2, mov_z);
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_G3://G3
|
||
switch(timeEventIndex){
|
||
case 0:
|
||
obj.getVar("move").setInt(10, sq_GetXPos(obj));
|
||
obj.getVar("move").setInt(11, sq_GetYPos(obj));
|
||
obj.getVar("move").setInt(12, sq_GetZPos(obj));
|
||
obj.getVar("move").setInt(13, sq_GetXPos(sqrChr));
|
||
obj.getVar("move").setInt(14, sq_GetYPos(sqrChr));
|
||
obj.getVar("move").setInt(15, sq_GetZPos(sqrChr) + sq_GetObjectHeight(sqrChr) + 60);
|
||
obj.setTimeEvent(1, 5, 30, true);
|
||
break;
|
||
case 1:
|
||
local vx = sq_GetUniformVelocity(obj.getVar("move").getInt(10), obj.getVar("move").getInt(13), timeEventCount, 30);
|
||
local vy = sq_GetUniformVelocity(obj.getVar("move").getInt(11), obj.getVar("move").getInt(14), timeEventCount, 30);
|
||
local vz = sq_GetUniformVelocity(obj.getVar("move").getInt(12), obj.getVar("move").getInt(15), timeEventCount, 30);
|
||
sq_setCurrentAxisPos(obj, 0, vx);
|
||
sq_setCurrentAxisPos(obj, 1, vy);
|
||
sq_setCurrentAxisPos(obj, 2, vz);
|
||
if(timeEventCount >= 30){
|
||
obj.getVar("target").clear_obj_vector();
|
||
obj.getVar("target").push_obj_vector(sqrChr);
|
||
obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, "");
|
||
if(!obj.isExistTimeEvent(10)) obj.setTimeEvent(10, 20, -1, true);
|
||
}
|
||
break;
|
||
case 3:
|
||
obj.removeAllTimeEvent();
|
||
obj.addSetStatePacket(24, null, STATE_PRIORITY_IGNORE_FORCE, false, "");
|
||
break;
|
||
case 10:
|
||
if(state != 22) break;
|
||
if(timeEventCount % 10 == 0) obj.sq_PlaySound("G3_LOOP");
|
||
local targetObj = sq_GetCNRDObjectToActiveObject(obj.getVar("target").get_obj_vector(0));
|
||
local pAni = obj.getCurrentAnimation();
|
||
local currentT = (timeEventCount - 1) * 20;
|
||
local defaultRoundTime = 1800;
|
||
local base100Angle = 36000 / 6 * (obj.getVar("custom").getInt(12) + 0);
|
||
local baseX = sq_GetXPos(targetObj);
|
||
local baseY = sq_GetYPos(targetObj)
|
||
local current100Angle = (base100Angle + (36000 * currentT / defaultRoundTime)) % 36000;
|
||
local angle = (current100Angle.tofloat() / 100.0);
|
||
if(angle >= 345 && angle < 15 && sq_GetAnimationFrameIndex(pAni) != 0){pAni.setCurrentFrameWithChildLayer(0);}
|
||
if(angle >= 15 && angle < 45 && sq_GetAnimationFrameIndex(pAni) != 1){pAni.setCurrentFrameWithChildLayer(1);}
|
||
if(angle >= 45 && angle < 75 && sq_GetAnimationFrameIndex(pAni) != 2){pAni.setCurrentFrameWithChildLayer(2);}
|
||
if(angle >= 75 && angle < 105 && sq_GetAnimationFrameIndex(pAni) != 3){pAni.setCurrentFrameWithChildLayer(3);}
|
||
if(angle >= 105 && angle < 135 && sq_GetAnimationFrameIndex(pAni) != 4){pAni.setCurrentFrameWithChildLayer(4);}
|
||
if(angle >= 135 && angle < 165 && sq_GetAnimationFrameIndex(pAni) != 5){pAni.setCurrentFrameWithChildLayer(5);}
|
||
if(angle >= 165 && angle < 195 && sq_GetAnimationFrameIndex(pAni) != 6){pAni.setCurrentFrameWithChildLayer(6);}
|
||
if(angle >= 195 && angle < 225 && sq_GetAnimationFrameIndex(pAni) != 7){pAni.setCurrentFrameWithChildLayer(7);}
|
||
if(angle >= 225 && angle < 255 && sq_GetAnimationFrameIndex(pAni) != 8){pAni.setCurrentFrameWithChildLayer(8);}
|
||
if(angle >= 255 && angle < 285 && sq_GetAnimationFrameIndex(pAni) != 9){pAni.setCurrentFrameWithChildLayer(9);}
|
||
if(angle >= 285 && angle < 315 && sq_GetAnimationFrameIndex(pAni) != 10){pAni.setCurrentFrameWithChildLayer(10);}
|
||
if(angle >= 315 && angle < 345 && sq_GetAnimationFrameIndex(pAni) != 11){pAni.setCurrentFrameWithChildLayer(11);}
|
||
|
||
local disMovLen = 80 * sq_CosTable(angle.tointeger());
|
||
local upMovLen = 40 * sq_SinTable(angle.tointeger());
|
||
|
||
local mov_x = sq_GetDistancePos(baseX, ENUM_DIRECTION_RIGHT, disMovLen.tointeger());
|
||
local mov_y = baseY + upMovLen.tointeger();
|
||
|
||
sq_setCurrentAxisPos(obj, 0, mov_x);
|
||
sq_setCurrentAxisPos(obj, 1, mov_y);
|
||
sq_setCurrentAxisPos(obj, 2, targetObj.getZPos() + sq_GetObjectHeight(targetObj) + 40);
|
||
// print("mov_x = "+mov_x+",,mov_y = "+mov_y);
|
||
break;
|
||
case 11:
|
||
obj.setTimeEvent(13, 20, -1, true);
|
||
obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, "");
|
||
break;
|
||
case 12:
|
||
local vx = sq_GetUniformVelocity(obj.getVar("move").getInt(10), obj.getVar("move").getInt(13), timeEventCount, 30);
|
||
local vy = sq_GetUniformVelocity(obj.getVar("move").getInt(11), obj.getVar("move").getInt(14), timeEventCount, 30);
|
||
local vz = sq_GetUniformVelocity(obj.getVar("move").getInt(12), obj.getVar("move").getInt(15), timeEventCount, 30);
|
||
sq_setCurrentAxisPos(obj, 0, vx);
|
||
sq_setCurrentAxisPos(obj, 1, vy);
|
||
sq_setCurrentAxisPos(obj, 2, vz);
|
||
break;
|
||
case 13:
|
||
local targetObj = sq_GetCNRDObjectToActiveObject(obj.getVar("target").get_obj_vector(0));
|
||
if(targetObj && targetObj.getState() != STATE_DIE){
|
||
sq_setCurrentAxisPos(obj, 0, sq_GetXPos(targetObj));
|
||
sq_setCurrentAxisPos(obj, 1, sq_GetYPos(targetObj));
|
||
sq_setCurrentAxisPos(obj, 2, sq_GetZPos(targetObj) + sq_GetObjectHeight(targetObj) + 60);
|
||
}
|
||
else{
|
||
obj.stopTimeEvent(13);
|
||
if(obj.getState() != 24) obj.addSetStatePacket(20, null, STATE_PRIORITY_IGNORE_FORCE, false, "");
|
||
}
|
||
break;
|
||
case 100:
|
||
local targetObj = obj.getVar("target").get_obj_vector(0);
|
||
if(targetObj && targetObj.getState() != STATE_DIE){
|
||
obj.sq_PlaySound("G3_SHOT_LOOP");
|
||
sq_SendHitObjectPacket(obj,targetObj, 0, 0, targetObj.getZPos() + sq_GetObjectHeight(targetObj) + 40 - 60);
|
||
}
|
||
else{
|
||
sq_SendDestroyPacketPassiveObject(obj);
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case 83:
|
||
switch(subtype){
|
||
case 1:
|
||
switch(timeEventIndex){
|
||
case 0:
|
||
local number = sqrChr.sq_GetIntData(83, 2);
|
||
obj.setTimeEvent(1, 250, number, false);
|
||
break;
|
||
case 1:
|
||
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/sparrowfactory/sparrowcreate.ani", -10, 0, 40);
|
||
createSkillPassiveObj_nanjixie(sqrChr,obj,83,2,0,0,0,0,0,30);
|
||
break;
|
||
case 2:
|
||
local currentAni = obj.getCurrentAnimation();
|
||
currentAni.addLayerAnimation(1001, sq_CreateAnimation("","passiveobject/mechanic_bykk/animation/sparrowfactory/summoneffect1_loop.ani"), true);
|
||
break;
|
||
case 3:
|
||
local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 83, 29, 6, 1.0) + 100;
|
||
// print("totalDamage = "+totalDamage);
|
||
createSkillPassiveObj_nanjixie(sqrChr,obj,83,3,totalDamage,0,0,0,0,0);
|
||
obj.setTimeEvent(4, 1000, 1, false);
|
||
obj.setTimeEvent(5, 320, 1, false);
|
||
break;
|
||
case 4:
|
||
local sizeRate = sqrChr.sq_GetIntData(83, 7);
|
||
local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 83, 29, 4, 1.0) + 100;
|
||
createFireExplosion_nanjixie(sqrChr,obj,sizeRate,totalDamage, 0, false);
|
||
sq_CreateParticle("passiveobject/character/gunner/particle/sparrowfactorydestroy.ptl", obj, 0, 1, 0, true, 30, 0, 1);
|
||
sq_SendDestroyPacketPassiveObject(obj);
|
||
break;
|
||
case 5:
|
||
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/sparrowfactory/solarlight02_11.ani", 0, 1, 101);
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_VIRTUALRUSH:
|
||
switch(subtype){
|
||
case 1:
|
||
switch(timeEventIndex){
|
||
case 0:
|
||
obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
|
||
break;
|
||
case 1:
|
||
sqrChr.getVar("virtualrush").setBool(0,false);
|
||
sqrChr.getVar("VIRTUALRUSH_SUB1").clear_obj_vector();
|
||
if(sq_GetIntData(sqrChr, SKILL_GUNNER_VIRTUALRUSH, 20) > 0){
|
||
sq_SendDestroyPacketPassiveObject(obj);
|
||
break;
|
||
}
|
||
obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, "");
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_DIMENSIONRUNNER:
|
||
switch(timeEventIndex){
|
||
case 0:
|
||
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/dimensionrunner/new/targetarea.ani",100,0,0);
|
||
break;
|
||
case 1:
|
||
obj.addSetStatePacket(25, null, STATE_PRIORITY_AUTO, false, "");
|
||
break;
|
||
case 2:
|
||
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/dimensionrunner/last/dimensionrunnerfinishhand.ani",0,0,0);
|
||
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/dimensionrunner/last/dimensionrunnerfinishhandeff_hand_dodge.ani",0,0,0);
|
||
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/dimensionrunner/last/dimensionrunnerfinishhandeff_ground_normal.ani",0,-1,-1);
|
||
break;
|
||
case 10:
|
||
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/dimensionrunner/new/missilesmoke_00.ani",0,-1,-1);
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_HELLMARCH:
|
||
switch(timeEventIndex){
|
||
case 0:
|
||
obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, "");
|
||
break;
|
||
case 1:
|
||
sq_SetMyShake(obj,2,1000);
|
||
break;
|
||
case 2:
|
||
sq_flashScreen(obj,0,0,160,178, sq_RGB(255,255,255), GRAPHICEFFECT_LINEARDODGE, ENUM_DRAWLAYER_BOTTOM);
|
||
break;
|
||
case 3:
|
||
obj.addSetStatePacket(26, null, STATE_PRIORITY_AUTO, false, "");
|
||
break;
|
||
case 9:
|
||
local direction = obj.getDirection();
|
||
if(direction == ENUM_DIRECTION_RIGHT) createSkillPassiveObj_hellmarch_bykk(obj,3,0,300,0,20,-75,0,direction);
|
||
else createSkillPassiveObj_hellmarch_bykk(obj,4,0,300,0,20,-75,0,direction);
|
||
local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_GUNNER_HELLMARCH, SKILL_GUNNER_HELLMARCH, 2, 1.0) + 100;
|
||
local totalDamage2 = sq_GetBonusRateWithPassive(sqrChr, SKILL_GUNNER_HELLMARCH, SKILL_GUNNER_HELLMARCH, 3, 1.0) + 100;
|
||
if(sqrChr.getVar("hellmarch").getBool(0)){
|
||
sqrChr.getVar("hellmarch").setBool(0, false);
|
||
createSkillPassiveObj_nanjixie(sqrChr, obj, SKILL_GUNNER_HELLMARCH, 6, totalDamage, totalDamage2, 0, 0, 0, 0);
|
||
}
|
||
obj.setTimeEvent(10,450,3,false);
|
||
break;
|
||
case 10:
|
||
local direction = obj.getDirection();
|
||
for(local i = 0; i < 6; i++){
|
||
createSkillPassiveObj_hellmarch_bykk(obj,5,0,300 - 100 * timeEventCount,timeEventCount,100 - 35 * i,-155 + 30 * i,0,direction);
|
||
}
|
||
break;
|
||
case 20:
|
||
obj.resetHitObjectList();
|
||
break;
|
||
case 21:
|
||
obj.setTimeEvent(20,10,3,false);
|
||
break;
|
||
}
|
||
break;
|
||
case 200:
|
||
local sizeRate = obj.getVar("sizeRate").get_vector(0).tofloat() / 100;
|
||
sizeRate = sizeRate.tofloat();
|
||
switch(timeEventIndex){
|
||
case 1:
|
||
local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/explosion/fireexplosionparticle1.ani", sq_getRandom(-10,10), sq_getRandom(-10,10), sq_getRandom(-10,10));
|
||
local currentAni = pooledObj.getCurrentAnimation();
|
||
currentAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
break;
|
||
case 2:
|
||
local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/explosion/fireexplosionparticle2.ani", 0, 2, 0);
|
||
local currentAni = pooledObj.getCurrentAnimation();
|
||
currentAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
break;
|
||
case 3:
|
||
local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/explosion/fireexplosionparticle3.ani", 0, 1, 1);
|
||
local currentAni = pooledObj.getCurrentAnimation();
|
||
local angle = sq_ToRadian(360.0 * timeEventCount / 16);
|
||
sq_SetfRotateAngle(currentAni, angle);
|
||
currentAni.setImageRateFromOriginal(sizeRate * 2.0, sizeRate * 2.0);
|
||
break;
|
||
case 4:
|
||
local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/explosion/fireexplosionparticle4.ani", sq_getRandom(-30,30), sq_getRandom(-30,30), sq_getRandom(-30,30));
|
||
local currentAni = pooledObj.getCurrentAnimation();
|
||
currentAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
break;
|
||
}
|
||
break;
|
||
case 250:
|
||
if(timeEventIndex == 0){
|
||
switch(timeEventCount){
|
||
case 1:
|
||
sqrChr.sq_IntVectClear();
|
||
sqrChr.sq_IntVectPush(0);
|
||
sqrChr.sq_IntVectPush(0);
|
||
sqrChr.sq_IntVectPush(75);
|
||
sqrChr.sq_IntVectPush(100);
|
||
sqrChr.sq_IntVectPush(450);
|
||
sqrChr.sq_IntVectPush(0);
|
||
sqrChr.sq_IntVectPush(4);
|
||
sqrChr.sq_IntVectPush(0);
|
||
sqrChr.sq_AddSetStatePacket(13, STATE_PRIORITY_USER, true);
|
||
break;
|
||
case 2:
|
||
local posX = sqrChr.getXPos() + 125;
|
||
sq_SendCreatePassiveObjectPacketPos(sqrChr,20011, sq_GetSkillLevel(sqrChr, 25) ,posX,sqrChr.getYPos(), 0);
|
||
break;
|
||
case 3:
|
||
local posX = sqrChr.getXPos() + 125;
|
||
sq_SendCreatePassiveObjectPacketPos(sqrChr,20013, sq_GetSkillLevel(sqrChr, 41) ,posX,sqrChr.getYPos(), 0);
|
||
break;
|
||
case 4:
|
||
local posX = sqrChr.getXPos() + 125;
|
||
sq_SendCreatePassiveObjectPacketPos(sqrChr,20012, sq_GetSkillLevel(sqrChr, 36) ,posX,sqrChr.getYPos(), 0);
|
||
break;
|
||
|
||
}
|
||
}
|
||
break;
|
||
}
|
||
|
||
}
|
||
|
||
function onAttack_po_nanjixie_bykk(obj, damager, boundingBox, isStuck)
|
||
{
|
||
if(!obj) return;
|
||
local skillIndex = obj.getVar("skillIndex").get_vector(0);
|
||
local subtype = obj.getVar("subtype").get_vector(0);
|
||
local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter());
|
||
local state = obj.getVar("state").get_vector(0);
|
||
|
||
switch(skillIndex){
|
||
case 63:
|
||
switch(subtype){
|
||
case 1:
|
||
switch(state){
|
||
case 20:
|
||
sq_SendDestroyPacketPassiveObject(obj);
|
||
break;
|
||
}
|
||
break;
|
||
case 2:
|
||
switch(state){
|
||
case 20:
|
||
obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
|
||
break;
|
||
case 21:
|
||
case 22:
|
||
//sq_SendDestroyPacketPassiveObject(obj);
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_G1://G1
|
||
switch(subtype){
|
||
case 2:
|
||
if(isStuck) break;
|
||
if(state != 20) break;
|
||
if(damager.isObjectType(OBJECTTYPE_ACTIVE)){
|
||
obj.addSetStatePacket(21, null, STATE_PRIORITY_IGNORE_FORCE, false, "");
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_G2://G2
|
||
break;
|
||
case SKILL_GUNNER_G3://G3
|
||
break;
|
||
case SKILL_GUNNER_DIMENSIONRUNNER:
|
||
break;
|
||
case SKILL_GUNNER_HELLMARCH:
|
||
break;
|
||
}
|
||
}
|
||
|
||
function onEndCurrentAni_po_nanjixie_bykk(obj)
|
||
{
|
||
if(!obj) return;
|
||
local skillIndex = obj.getVar("skillIndex").get_vector(0);
|
||
local subtype = obj.getVar("subtype").get_vector(0);
|
||
local state = obj.getVar("state").get_vector(0);
|
||
local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter());
|
||
|
||
|
||
switch(skillIndex){
|
||
case 29:
|
||
switch(subtype){
|
||
case 3:
|
||
switch(state){
|
||
case 20:
|
||
if(sqrChr.getVar("holdandgo").getBool(0) == false) obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, "");
|
||
else obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
|
||
return;
|
||
break;
|
||
case 23:
|
||
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
|
||
return;
|
||
break;
|
||
case 25:
|
||
sq_SendDestroyPacketPassiveObject(obj);
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case 59:
|
||
switch(subtype){
|
||
case 1:
|
||
switch(state){
|
||
case 20:
|
||
obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
|
||
return;
|
||
break;
|
||
case 21:
|
||
obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, "");
|
||
return;
|
||
break;
|
||
}
|
||
break;
|
||
case 2:
|
||
switch(state){
|
||
case 20:
|
||
obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
|
||
return;
|
||
break;
|
||
case 21:
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case 63:
|
||
switch(subtype){
|
||
case 2:
|
||
switch(state){
|
||
case 20:
|
||
return;
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_G1://G1
|
||
switch(subtype){
|
||
case 1:
|
||
switch(state){
|
||
case 20:
|
||
obj.setTimeEvent(100,15,-1,false);
|
||
obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
|
||
break;
|
||
case 22: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break;
|
||
case 23:
|
||
local loadSlot = sqrChr.sq_GetSkillLoad(SKILL_GUNNER_G1);
|
||
if(loadSlot){
|
||
sqrChr.sq_RemoveSkillLoad(SKILL_GUNNER_G1);
|
||
//sqrChr.startSkillCoolTime(SKILL_GUNNER_G1, sq_GetSkillLevel(sqrChr), -1);
|
||
}
|
||
sq_SendDestroyPacketPassiveObject(obj);
|
||
break;
|
||
}
|
||
return;
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_G2://G2
|
||
switch(state){
|
||
case 20:
|
||
obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, "");
|
||
break;
|
||
case 23:
|
||
obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
|
||
break;
|
||
case 24:
|
||
local loadSlot = sqrChr.sq_GetSkillLoad(SKILL_GUNNER_G2);
|
||
if(loadSlot){
|
||
sqrChr.sq_RemoveSkillLoad(SKILL_GUNNER_G2);
|
||
// sqrChr.startSkillCoolTime(SKILL_GUNNER_G3, sq_GetSkillLevel(sqrChr), -1);
|
||
}
|
||
sq_SendDestroyPacketPassiveObject(obj);
|
||
break;
|
||
}
|
||
return;
|
||
break;
|
||
case SKILL_GUNNER_G3://G3
|
||
switch(subtype){
|
||
case 1:
|
||
switch(state){
|
||
case 24:
|
||
local loadSlot = sqrChr.sq_GetSkillLoad(SKILL_GUNNER_G3);
|
||
if(loadSlot){
|
||
sqrChr.sq_RemoveSkillLoad(SKILL_GUNNER_G3);
|
||
// sqrChr.startSkillCoolTime(SKILL_GUNNER_G3, sq_GetSkillLevel(sqrChr), -1);
|
||
}
|
||
sq_SendDestroyPacketPassiveObject(obj);
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
return;
|
||
break;
|
||
case 83:
|
||
switch(subtype){
|
||
case 1:
|
||
switch(state){
|
||
case 20:
|
||
obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
|
||
return;
|
||
break;
|
||
case 21:
|
||
local sizeRate = sqrChr.sq_GetIntData(83, 7);
|
||
local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 83, 29, 4, 1.0) + 100;
|
||
createFireExplosion_nanjixie(sqrChr,obj,sizeRate,totalDamage, 0, false);
|
||
sq_CreateParticle("passiveobject/character/gunner/particle/sparrowfactorydestroy.ptl", obj, 0, 1, 0, true, 30, 0, 1);
|
||
sq_SendDestroyPacketPassiveObject(obj);
|
||
break;
|
||
}
|
||
break;
|
||
case 2:
|
||
switch(state){
|
||
case 20:
|
||
obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
|
||
return;
|
||
break;
|
||
case 22:
|
||
obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, "");
|
||
return;
|
||
break;
|
||
case 24:
|
||
local sizeRate = sq_GetIntData(sqrChr, 83, 11);
|
||
local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 83, 29, 4, 1.0) + 100;
|
||
createFireExplosion_nanjixie(sqrChr, obj, sizeRate, totalDamage, obj.getZPos(), true);
|
||
sq_SendDestroyPacketPassiveObject(obj);
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_VIRTUALRUSH:
|
||
switch(subtype){
|
||
case 1:
|
||
switch(state){
|
||
case 21:
|
||
obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, "");
|
||
return;
|
||
break;
|
||
case 22:
|
||
sqrChr.getVar("virtualrush").setBool(0,false);
|
||
sqrChr.getVar("VIRTUALRUSH_SUB1").clear_obj_vector();
|
||
break;
|
||
case 23:
|
||
sq_SendDestroyPacketPassiveObject(obj);
|
||
break;
|
||
}
|
||
break;
|
||
case 2:
|
||
switch(state){
|
||
case 20:
|
||
obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
|
||
return;
|
||
break;
|
||
case 22:
|
||
case 24:
|
||
local skillIndex_sub1 = obj.getVar("skillIndex_sub1").get_vector(0);
|
||
local skillIndex_sub2 = obj.getVar("skillIndex_sub2").get_vector(0);
|
||
local skill_level = sq_GetSkillLevel(sqrChr,skillIndex_sub1);
|
||
// local pAni = obj.getCurrentAnimation();//得到ani
|
||
// local currentT = sq_GetCurrentTime(pAni);//当前时间
|
||
local sizeRate;
|
||
local totalDamage;
|
||
switch(skillIndex_sub1){
|
||
case SKILL_GUNNER_ATEAM:
|
||
switch(skillIndex_sub2){
|
||
case 1:
|
||
sizeRate = sq_GetIntData(sqrChr,skillIndex_sub1,6);
|
||
totalDamage = sq_GetBonusRateWithPassive(sqrChr, skillIndex_sub1, 29, 4, 1.0) + 100;
|
||
break;
|
||
case 2:
|
||
sizeRate = sq_GetIntData(sqrChr,skillIndex_sub1,7);
|
||
totalDamage = sq_GetBonusRateWithPassive(sqrChr, skillIndex_sub1, 29, 5, 1.0) + 100;
|
||
break;
|
||
case 3:
|
||
sizeRate = sq_GetIntData(sqrChr,skillIndex_sub1,8);
|
||
totalDamage = sq_GetBonusRateWithPassive(sqrChr, skillIndex_sub1, 29, 6, 1.0) + 100;
|
||
break;
|
||
case 4:
|
||
sizeRate = sq_GetIntData(sqrChr,skillIndex_sub1,9);
|
||
totalDamage = sq_GetBonusRateWithPassive(sqrChr, skillIndex_sub1, 29, 3, 1.0) + 100;
|
||
break;
|
||
case 5:
|
||
sizeRate = sq_GetIntData(sqrChr,skillIndex_sub1,10);
|
||
totalDamage = sq_GetBonusRateWithPassive(sqrChr, skillIndex_sub1, 29, 2, 1.0) + 100;
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_ROBOTRX60:
|
||
sizeRate = sq_GetIntData(sqrChr, SKILL_GUNNER_ROBOTRX60, 1);
|
||
totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_GUNNER_ROBOTRX60, 29, 1, 1.0) + 100;
|
||
break;
|
||
case 27:
|
||
sizeRate = sq_GetIntData(sqrChr, 27, 1);
|
||
totalDamage = sq_GetBonusRateWithPassive(sqrChr, 27, 29, 1, 1.0) + 100;
|
||
break;
|
||
case 28:
|
||
sizeRate = sqrChr.sq_GetLevelData(28, 3, skill_level);
|
||
totalDamage = sq_GetBonusRateWithPassive(sqrChr, 28, 29, 1, 1.0) + 100;
|
||
break;
|
||
case 59:
|
||
sizeRate = sq_GetIntData(sqrChr, 59, 14);
|
||
switch(skillIndex_sub2){
|
||
case 1:
|
||
case 2:
|
||
totalDamage = sq_GetBonusRateWithPassive(sqrChr, 59, 29, 7, 1.0) + sq_GetBonusRateWithPassive(sqrChr, 59, -1, 19, 1.0) + 200;
|
||
break;
|
||
case 3:
|
||
totalDamage = sq_GetBonusRateWithPassive(sqrChr, 59, 29, 9, 1.0) + sq_GetBonusRateWithPassive(sqrChr, 59, -1, 19, 1.0) + 200;
|
||
break;
|
||
}
|
||
break;
|
||
case 83:
|
||
sizeRate = sq_GetIntData(sqrChr, 83, 11);
|
||
totalDamage = sq_GetBonusRateWithPassive(sqrChr, 83, 29, 4, 1.0) + 100;
|
||
break;
|
||
case 105:
|
||
sizeRate = sqrChr.sq_GetLevelData(105, 3, skill_level);
|
||
totalDamage = sq_GetBonusRateWithPassive(sqrChr, 105, 29, 1, 1.0) + 100;
|
||
break;
|
||
}
|
||
if(state == 22){
|
||
createFireExplosion_nanjixie(sqrChr, obj, sizeRate, totalDamage, 50, false);
|
||
}
|
||
break;
|
||
case 23:
|
||
obj.addSetStatePacket(24, null, STATE_PRIORITY_AUTO, false, "");
|
||
return;
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_DIMENSIONRUNNER:
|
||
switch(subtype){
|
||
case 1:
|
||
switch(state){
|
||
case 20:
|
||
case 22:
|
||
case 24:
|
||
if(state == 22){
|
||
local boss_number = 0;
|
||
local nameed_number = 0;
|
||
local targetObj;
|
||
local objectManager = sqrChr.getObjectManager();
|
||
local objectNumber = objectManager.getCollisionObjectNumber();
|
||
for (local i = 0; i < objectNumber; i++){
|
||
local object = objectManager.getCollisionObject(i);
|
||
if(object.isObjectType(OBJECTTYPE_ACTIVE)){
|
||
local activeObj = sq_GetCNRDObjectToActiveObject(object);
|
||
if(sq_IsBoss(activeObj)){
|
||
boss_number = boss_number + 1;
|
||
targetObj = activeObj;
|
||
break;
|
||
}
|
||
else if(sq_IsNamed(activeObj)){
|
||
nameed_number = nameed_number + 1;
|
||
targetObj = activeObj;
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
if(boss_number <= 0 || nameed_number <= 0){
|
||
targetObj = sq_FindTarget(sqrChr, 0, 1500, 500, 500);
|
||
}
|
||
if(!targetObj){
|
||
obj.setTimeEvent(1,1000,1,false);
|
||
return;
|
||
}
|
||
else{
|
||
obj.getVar().clear_obj_vector();
|
||
obj.getVar().push_obj_vector(targetObj);
|
||
}
|
||
}
|
||
obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, "");
|
||
return;
|
||
break;
|
||
case 21:
|
||
local missile_number = obj.getVar("missile_number").get_vector(0);
|
||
if(missile_number - 1 > 0){
|
||
obj.getVar("missile_number").set_vector(0,missile_number - 1);
|
||
obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
|
||
return;
|
||
}
|
||
else{
|
||
obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, "");
|
||
return;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_HELLMARCH:
|
||
switch(subtype){
|
||
case 1:
|
||
case 2:
|
||
switch(state){
|
||
case 20:
|
||
obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
|
||
return;
|
||
break;
|
||
}
|
||
break;
|
||
case 3:
|
||
case 4:
|
||
case 5:
|
||
switch(state){
|
||
case 20:
|
||
case 21:
|
||
case 22:
|
||
case 23:
|
||
case 24:
|
||
case 25:
|
||
case 26:
|
||
case 27:
|
||
obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, "");
|
||
return;
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
sq_SendDestroyPacketPassiveObject(obj);
|
||
|
||
}
|
||
|
||
function onKeyFrameFlag_po_nanjixie_bykk(obj, flagIndex)
|
||
{
|
||
if(!obj) return false;
|
||
local skillIndex = obj.getVar("skillIndex").get_vector(0);
|
||
local subtype = obj.getVar("subtype").get_vector(0);
|
||
local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter());
|
||
local state = obj.getVar("state").get_vector(0);
|
||
|
||
switch(skillIndex){
|
||
case SKILL_GUNNER_G1://G1
|
||
break;
|
||
case SKILL_GUNNER_G2://G2
|
||
break;
|
||
case SKILL_GUNNER_G3://G3
|
||
break;
|
||
case 83:
|
||
switch(subtype){
|
||
case 2:
|
||
switch(flagIndex){
|
||
case 1:
|
||
local moveX = sqrChr.getVar("robotsexplosion").get_vector(0);
|
||
local moveY = sqrChr.getVar("robotsexplosion").get_vector(1);
|
||
sq_setCurrentAxisPos(obj, 0, moveX);
|
||
sq_setCurrentAxisPos(obj, 1, moveY);
|
||
sq_setCurrentAxisPos(obj, 2, 0);
|
||
sq_SetCurrentDirection(obj, sqrChr.getDirection());
|
||
obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, "");
|
||
break;
|
||
case 2:
|
||
// local sizeRate = sq_GetIntData(sqrChr, 83, 11);
|
||
// local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 83, 29, 4, 1.0) + 100;
|
||
// createFireExplosion_nanjixie(sqrChr, obj, sizeRate, totalDamage, obj.getZPos(), true);
|
||
sq_SendDestroyPacketPassiveObject(obj);
|
||
break;
|
||
case 1001:
|
||
local randomX = sq_getRandom(-300,300);
|
||
local randomY = sq_getRandom(-60,60);
|
||
obj.getVar().clear_vector();
|
||
obj.getVar().push_vector(randomX);
|
||
obj.getVar().push_vector(randomY);
|
||
sq_SetVelocity(obj, 0, randomX.tofloat());
|
||
sq_SetVelocity(obj, 1, randomY.tofloat());
|
||
break;
|
||
case 1002:
|
||
local randomX = obj.getVar().get_vector(0);
|
||
local randomY = obj.getVar().get_vector(1);
|
||
sq_SetVelocity(obj, 0, -randomX.tofloat());
|
||
sq_SetVelocity(obj, 1, -randomY.tofloat());
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_DIMENSIONRUNNER:
|
||
break;
|
||
case SKILL_GUNNER_HELLMARCH:
|
||
if(subtype == 6 && flagIndex == 1){
|
||
//设置ATK,百分比
|
||
local bonusrater = obj.getVar("custom").get_vector(1);
|
||
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 18));
|
||
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), bonusrater);
|
||
local count = sqrChr.sq_GetBonusRateWithPassive(SKILL_GUNNER_HELLMARCH, SKILL_GUNNER_HELLMARCH, 5, 1.0) + 100;
|
||
obj.setTimeEvent(20,100,count - 1,false);
|
||
}
|
||
break;
|
||
}
|
||
return true;
|
||
}
|
||
|
||
function procAppend_po_nanjixie_bykk(obj)
|
||
{
|
||
if(!obj) return;
|
||
local skillIndex = obj.getVar("skillIndex").get_vector(0);
|
||
local subtype = obj.getVar("subtype").get_vector(0);
|
||
local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter());
|
||
local state = obj.getVar("state").get_vector(0);
|
||
|
||
switch(skillIndex){
|
||
case 29:
|
||
switch(subtype){
|
||
case 3:
|
||
case 4:
|
||
case 5:
|
||
switch(state){
|
||
case 20:
|
||
if(sqrChr.getVar("holdandgo").getBool(0) == false && subtype == 5){
|
||
obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, "");
|
||
return;
|
||
}
|
||
case 21:
|
||
if(sqrChr.getVar("holdandgo").getBool(0) == false){
|
||
obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, "");
|
||
return;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
if(sqrChr.getState() == STATE_DIE) {
|
||
sq_SendDestroyPacketPassiveObject(obj);
|
||
}
|
||
break;
|
||
case 59:
|
||
switch(subtype){
|
||
case 2:
|
||
if(obj.getZPos() <= 0 && obj.getVar().getBool(0) == false){
|
||
obj.getVar().setBool(0,true);
|
||
local level = sq_GetSkillLevel(sqrChr, 174);
|
||
local destX_01 = 0;
|
||
local destY_01 = obj.getYPos() - sqrChr.getYPos();
|
||
if(obj.getDirection() == ENUM_DIRECTION_RIGHT){
|
||
destX_01 = obj.getXPos() - sqrChr.getXPos();
|
||
}
|
||
else if(obj.getDirection() == ENUM_DIRECTION_LEFT){
|
||
destX_01 = sqrChr.getXPos() - obj.getXPos();
|
||
}
|
||
local type = obj.getVar("type").get_vector(0);
|
||
switch(type){
|
||
case 1:
|
||
summonmonster_mechanic(sqrChr,destX_01,destY_01,0,0,77631,600000,level,0);
|
||
break;
|
||
case 2:
|
||
summonmonster_mechanic(sqrChr,destX_01,destY_01,0,0,77632,600000,level,0);
|
||
break;
|
||
case 3:
|
||
summonmonster_mechanic(sqrChr,destX_01,destY_01,0,0,77633,600000,level,0);
|
||
break;
|
||
case 4:
|
||
case 5:
|
||
summonmonster_mechanic(sqrChr,destX_01,destY_01,0,0,77634,600000,level,0);
|
||
break;
|
||
}
|
||
sq_SendDestroyPacketPassiveObject(obj);
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case 63:
|
||
switch(subtype){
|
||
case 1:
|
||
switch(state){
|
||
case 20:
|
||
if(obj.getZPos() <= 0){
|
||
sq_SendDestroyPacketPassiveObject(obj);
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case 2:
|
||
switch(state){
|
||
case 20:
|
||
local currentT = sq_GetObjectTime(obj);
|
||
local object = obj.getVar("targetObj").get_obj_vector(0);
|
||
local fireT = 8000;
|
||
if(object){
|
||
if(sq_GetDistanceObject(obj, object, false) < 5){
|
||
obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
|
||
}
|
||
local X1 = sq_GetUniformVelocity(obj.getXPos(), object.getXPos(), currentT, fireT);
|
||
local Y1 = sq_GetUniformVelocity(obj.getYPos(), object.getYPos(), currentT, fireT);
|
||
sq_setCurrentAxisPos(obj, 0, X1);
|
||
sq_setCurrentAxisPos(obj, 1, Y1);
|
||
local angle = sq_GetUniformVelocity(45, -45, currentT, 500);
|
||
sq_SetCustomRotate(obj, sq_ToRadian(angle.tofloat()));
|
||
}
|
||
if(obj.getZPos() <= 0){
|
||
obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, "");
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_G1://G1
|
||
switch(subtype){
|
||
case 2:
|
||
switch(state){
|
||
case 20:
|
||
if(sq_GetZPos(obj) <= 0) obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, "");
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_G2://G2
|
||
// switch(state){
|
||
// case 21:
|
||
// case 22:
|
||
// case 23:
|
||
// break;
|
||
// }
|
||
break;
|
||
case SKILL_GUNNER_G3://G3
|
||
break;
|
||
case 83:
|
||
switch(subtype){
|
||
case 2:
|
||
switch(state){
|
||
case 20:
|
||
local pAni = obj.getCurrentAnimation();//得到ani
|
||
local currentT = sq_GetCurrentTime(pAni);//当前时间
|
||
local fireT = pAni.getDelaySum(false);//总时间
|
||
local vz = sq_GetUniformVelocity(30, 120, currentT, fireT);
|
||
sq_setCurrentAxisPos(obj, 2, vz);//设置当前z坐标
|
||
break;
|
||
case 21:
|
||
local pAni = obj.getCurrentAnimation();//得到ani
|
||
local currentT = sq_GetCurrentTime(pAni);//当前时间
|
||
local skill_level = sq_GetSkillLevel(sqrChr, 83);
|
||
local lifetime = sqrChr.sq_GetLevelData(83, 0, skill_level);
|
||
local target_range = sqrChr.sq_GetLevelData(83, 0, skill_level);
|
||
if(currentT >= lifetime){
|
||
local targetObj = sq_FindTarget(sqrChr, -target_range, target_range, target_range, target_range);
|
||
if(targetObj){
|
||
local distance = sq_GetDistance(obj.getXPos(), obj.getYPos(), targetObj.getXPos(), targetObj.getYPos(), true);
|
||
if(distance <= target_range){
|
||
obj.getVar("tar").clear_obj_vector();
|
||
obj.getVar("tar").push_obj_vector(targetObj);
|
||
obj.addSetStatePacket(24, null, STATE_PRIORITY_AUTO, false, "");
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
break;
|
||
case 24:
|
||
local targetObj = sq_GetCNRDObjectToActiveObject(obj.getVar("tar").get_obj_vector(0));
|
||
local pAni = obj.getCurrentAnimation();//得到ani
|
||
local currentT = sq_GetCurrentTime(pAni);//当前时间
|
||
local fireT = pAni.getDelaySum(false);//总时间
|
||
local skill_level = sq_GetSkillLevel(sqrChr, 83);
|
||
local target_range = sqrChr.sq_GetLevelData(83, 0, skill_level);
|
||
if(!targetObj){
|
||
targetObj = sq_GetCNRDObjectToActiveObject(sq_FindTarget(sqrChr, -target_range, target_range, target_range, target_range));
|
||
}
|
||
if(targetObj){
|
||
if(obj.getVar().getBool(10) == true){
|
||
obj.sq_PlaySound("R_SPARROW_SUICIDE");
|
||
obj.getVar().setBool(10,false);
|
||
}
|
||
if(sq_GetDistanceObject(obj, targetObj, false) < 10){
|
||
local sizeRate = sq_GetIntData(sqrChr, 83, 7);
|
||
local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 83, 29, 4, 1.0) + 100;
|
||
createFireExplosion_nanjixie(sqrChr, obj, sizeRate, totalDamage, obj.getZPos(), true);
|
||
sq_SendDestroyPacketPassiveObject(obj);
|
||
}
|
||
local X1 = sq_GetUniformVelocity(obj.getXPos(), targetObj.getXPos(), currentT, fireT);
|
||
local Y1 = sq_GetUniformVelocity(obj.getYPos(), targetObj.getYPos(), currentT, fireT);
|
||
local Z1 = sq_GetUniformVelocity(120, 0, currentT, fireT);
|
||
sq_setCurrentAxisPos(obj, 0, X1);
|
||
sq_setCurrentAxisPos(obj, 1, Y1);
|
||
sq_setCurrentAxisPos(obj, 2, Z1);
|
||
}
|
||
else{
|
||
local sizeRate = sq_GetIntData(sqrChr, 83, 11);
|
||
local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 83, 29, 4, 1.0) + 100;
|
||
createFireExplosion_nanjixie(sqrChr, obj, sizeRate, totalDamage, obj.getZPos(), true);
|
||
sq_SendDestroyPacketPassiveObject(obj);
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_VIRTUALRUSH:
|
||
if(!sqrChr || sqrChr.getState() == STATE_DIE) sq_SendDestroyPacketPassiveObject(obj);
|
||
switch(subtype){
|
||
case 1:
|
||
switch(state){
|
||
case 21:
|
||
break;
|
||
}
|
||
break;
|
||
case 2:
|
||
switch(state){
|
||
case 21:
|
||
if(sqrChr.getVar("VIRTUALRUSH_SUB1").get_obj_vector_size() <= 0){
|
||
obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, "");
|
||
return;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_ROBOTRX60:
|
||
switch(subtype){
|
||
case 1:
|
||
local parentObj = obj.getParent();
|
||
if(!parentObj || parentObj.getState() == STATE_DIE){
|
||
CNSquirrelAppendage.sq_RemoveAppendage(parentObj, "character/gunner/mechanic_bykk/ap2/ap_virtualrush.nut");
|
||
sq_SendDestroyPacketPassiveObject(obj);
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_DIMENSIONRUNNER:
|
||
switch(subtype){
|
||
case 1:
|
||
switch(state){
|
||
case 23:
|
||
local time = sq_GetObjectTime(obj);
|
||
local targetObj = sq_GetCNRDObjectToActiveObject(obj.getVar().get_obj_vector(0));
|
||
if(targetObj){
|
||
if(sq_GetDistanceObject(obj, targetObj, false) < 10){
|
||
obj.addSetStatePacket(24, null, STATE_PRIORITY_AUTO, false, "");
|
||
return;
|
||
}
|
||
local pAni = obj.getCurrentAnimation();
|
||
local currentT = sq_GetCurrentTime(pAni);
|
||
local fireT = 1000;//pAni.getDelaySum(0,3);
|
||
local X1 = sq_GetAccel(obj.getXPos(), targetObj.getXPos(), currentT, fireT, false);
|
||
local Y1 = sq_GetAccel(obj.getYPos(), targetObj.getYPos(), currentT, fireT, false);
|
||
if(sqrChr.isMovablePos(X1, Y1)){
|
||
sq_setCurrentAxisPos(obj, 0, X1);
|
||
sq_setCurrentAxisPos(obj, 1, Y1);
|
||
}
|
||
else{
|
||
obj.addSetStatePacket(25, null, STATE_PRIORITY_AUTO, false, "");
|
||
}
|
||
if((obj.getXPos() > targetObj.getXPos() && obj.getDirection() == ENUM_DIRECTION_RIGHT) || (obj.getXPos() < targetObj.getXPos() && obj.getDirection() == ENUM_DIRECTION_LEFT)) sq_SetCurrentDirection(obj, sq_GetOppositeDirection(sq_GetDirection(obj)));
|
||
}
|
||
else obj.addSetStatePacket(25, null, STATE_PRIORITY_AUTO, false, "");
|
||
break;
|
||
}
|
||
break;
|
||
case 2:
|
||
switch(state){
|
||
case 20:
|
||
local time = sq_GetObjectTime(obj);
|
||
local fireT = 1200;
|
||
local srcX = obj.getVar("custom").get_vector(1);
|
||
local srcY = obj.getVar("custom").get_vector(2);
|
||
local srcZ = obj.getVar("custom").get_vector(3);
|
||
local MoveX = obj.getVar("custom").get_vector(4);
|
||
local MoveY = obj.getVar("custom").get_vector(5);
|
||
local angle1 = obj.getVar("custom").get_vector(6);
|
||
local vx = sq_GetUniformVelocity(0, MoveX, time, fireT)
|
||
local vy = sq_GetUniformVelocity(0, MoveY, time, fireT);
|
||
local vz = 0;
|
||
if(time <= 400) vz = sq_GetUniformVelocity(0, 100, time, fireT);
|
||
else vz = sq_GetUniformVelocity(0, srcZ + 100, time - 400, fireT) * -1;
|
||
local angle = sq_GetAccel(-angle1, -135, time, fireT * 80 / 100, true);
|
||
local dstX = sq_GetDistancePos(srcX, obj.getDirection(), vx);
|
||
sq_setCurrentAxisPos(obj, 0, dstX);
|
||
sq_setCurrentAxisPos(obj, 1, srcY + vy);
|
||
sq_setCurrentAxisPos(obj, 2, srcZ + vz);
|
||
sq_SetCustomRotate(obj, sq_ToRadian(angle.tofloat()));
|
||
if(obj.getZPos() <= 0) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
break;
|
||
case SKILL_GUNNER_HELLMARCH:
|
||
switch(subtype){
|
||
case 3:
|
||
case 4:
|
||
case 5:
|
||
local time = sq_GetObjectTime(obj);
|
||
local fireT = 2150;
|
||
if(subtype == 5){
|
||
local number = obj.getVar("custom").get_vector(2);
|
||
fireT = 2100 - 450 * number;
|
||
}
|
||
local srcX = obj.getVar("custom").get_vector(0);
|
||
local MoveX = obj.getVar("custom").get_vector(1);
|
||
local vx = sq_GetUniformVelocity(0, MoveX, time, fireT);
|
||
local dstX = sq_GetDistancePos(srcX, obj.getDirection(), vx);
|
||
if(time <= fireT) sq_setCurrentAxisPos(obj, 0, dstX);
|
||
break;
|
||
}
|
||
break;
|
||
}
|
||
|
||
if(obj.getZPos() >= 1000){
|
||
local parentObj = obj.getParent();
|
||
local pChr = obj.getTopCharacter();
|
||
local id = parentObj.getCollisionObjectIndex();
|
||
if(!id || !pChr) return;
|
||
if(pChr.isMyControlObject()) {
|
||
sq_BinaryStartWrite();
|
||
sq_BinaryWriteDword(1);
|
||
sq_BinaryWriteDword(id);
|
||
sq_BinaryWriteDword(sq_GetGroup(parentObj));
|
||
sq_BinaryWriteDword(sq_GetUniqueId(parentObj));
|
||
sq_SendChangeSkillEffectPacket(pChr, SKILL_GUNNER_HS1);
|
||
sq_SendDestroyPacketPassiveObject(obj);
|
||
}
|
||
sq_SendDestroyPacketPassiveObject(obj);
|
||
}
|
||
}
|
||
|