1971 lines
71 KiB
C
1971 lines
71 KiB
C
|
|
function getMissilePtl_bykk(number)
|
|
{
|
|
local ptlPath;
|
|
switch(number){
|
|
case 1:
|
|
ptlPath = "particle/tempestermissile1.ptl";
|
|
break;
|
|
case 2:
|
|
ptlPath = "particle/tempestermissile2.ptl";
|
|
break;
|
|
case 3:
|
|
ptlPath = "particle/tempestermissile3.ptl";
|
|
break;
|
|
case 4:
|
|
ptlPath = "particle/tempestermissile4.ptl";
|
|
break;
|
|
}
|
|
return ptlPath;
|
|
}
|
|
|
|
function checkExecutableSkill_RobotRX78_bykk(obj)
|
|
{
|
|
if(!obj) return false;
|
|
if(obj.getVar("virtualrush").getBool(0) == true && !sq_GetSkill(obj, 27).isInCoolTime()){
|
|
local effect_obj = sq_GetCNRDObjectToCollisionObject(obj.getVar("VIRTUALRUSH_SUB1").get_obj_vector(0));
|
|
local offsetX = sq_getRandom(-240,240);
|
|
local offsetY = sq_getRandom(-30,60);
|
|
createSkillPassiveObj_nanjixie(obj,effect_obj,SKILL_GUNNER_VIRTUALRUSH,2,0,27,1,offsetX,offsetY,0);
|
|
if(sq_GetSkillLevel(obj, 42) > 0) createSkillPassiveObj_nanjixie(obj,effect_obj,SKILL_GUNNER_VIRTUALRUSH,2,0,27,1,offsetX,offsetY - 30,0);
|
|
sq_AddDrawOnlyAniFromParent(effect_obj,"character/gunner/effect/animation/virtualrush/castrobotafront_00.ani", 0, 1, 1);
|
|
sq_AddDrawOnlyAniFromParent(effect_obj,"character/gunner/effect/animation/virtualrush/castrobotaback_00.ani", 0, 1, 1);
|
|
sq_AddDrawOnlyAniFromParent(effect_obj,"character/gunner/effect/animation/virtualrush/castrobotgunnerback1_00.ani", 0, 1, 1);
|
|
//obj.startSkillCoolTime(27, sq_GetSkillLevel(obj, 27), -1);
|
|
obj.sq_PlaySound("GN_LADNRUNNER");
|
|
if(obj.getState() == 14){
|
|
obj.sq_IntVectClear();
|
|
obj.sq_AddSetStatePacket(14, STATE_PRIORITY_IGNORE_FORCE, true);
|
|
}
|
|
else if(obj.getState() == 0){
|
|
obj.sq_IntVectClear();
|
|
obj.sq_AddSetStatePacket(0, STATE_PRIORITY_IGNORE_FORCE, true);
|
|
}
|
|
return true;
|
|
}
|
|
local b_useskill = obj.sq_IsUseSkill(27);
|
|
if(b_useskill){
|
|
if(sq_getGrowType(obj) == 3){
|
|
local skill_level = sq_GetSkillLevel(obj, SKILL_GUNNER_HS1);
|
|
if(skill_level > 0){
|
|
sendSkillPacket_hs1(obj,27);
|
|
}
|
|
else{
|
|
obj.sq_IntVectClear();
|
|
obj.sq_IntVectPush(5);
|
|
obj.sq_IntVectPush(27);
|
|
obj.sq_AddSetStatePacket(STATE_GUNNER_VIRTUALRUSH, STATE_PRIORITY_IGNORE_FORCE, true);
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
function checkExecutableSkill_RobotEz8_bykk(obj)
|
|
{
|
|
if(!obj) return false;
|
|
local skill = sq_GetSkill(obj, SKILL_GUNNER_HOLDANDGO);
|
|
if(obj.getVar("virtualrush").getBool(0) == true && !sq_GetSkill(obj, 28).isInCoolTime()){
|
|
local effect_obj = sq_GetCNRDObjectToCollisionObject(obj.getVar("VIRTUALRUSH_SUB1").get_obj_vector(0));
|
|
local offsetX = sq_getRandom(-240,240);
|
|
local offsetY = sq_getRandom(-30,60);
|
|
createSkillPassiveObj_nanjixie(obj,effect_obj,SKILL_GUNNER_VIRTUALRUSH,2,0,28,1,offsetX,offsetY,0);
|
|
if(sq_GetLevelData(obj, 28, 6, sq_GetSkillLevel(obj, 28)) > 0) createSkillPassiveObj_nanjixie(obj,effect_obj,SKILL_GUNNER_VIRTUALRUSH,2,0,28,1,offsetX + 5,offsetY - 5,0);
|
|
sq_AddDrawOnlyAniFromParent(effect_obj,"character/gunner/effect/animation/virtualrush/castrobotafront_00.ani", 0, 1, 1);
|
|
sq_AddDrawOnlyAniFromParent(effect_obj,"character/gunner/effect/animation/virtualrush/castrobotaback_00.ani", 0, 1, 1);
|
|
sq_AddDrawOnlyAniFromParent(effect_obj,"character/gunner/effect/animation/virtualrush/castrobotgunnerback1_00.ani", 0, 1, 1);
|
|
//obj.startSkillCoolTime(28, sq_GetSkillLevel(obj, 28), -1);
|
|
if(obj.getState() == 14){
|
|
obj.sq_IntVectClear();
|
|
obj.sq_AddSetStatePacket(14, STATE_PRIORITY_IGNORE_FORCE, true);
|
|
}
|
|
else if(obj.getState() == 0){
|
|
obj.sq_IntVectClear();
|
|
obj.sq_AddSetStatePacket(0, STATE_PRIORITY_IGNORE_FORCE, true);
|
|
}
|
|
obj.sq_PlaySound("R_GN_COUNTDOWN");
|
|
return true;
|
|
}
|
|
local b_useskill = obj.sq_IsUseSkill(28);
|
|
if(b_useskill){
|
|
if(sq_getGrowType(obj) == 3){
|
|
local skill_level = sq_GetSkillLevel(obj, SKILL_GUNNER_HS1);
|
|
if(skill_level > 0){
|
|
sendSkillPacket_hs1(obj,28);
|
|
}
|
|
else{
|
|
obj.sq_IntVectClear();
|
|
obj.sq_IntVectPush(5);
|
|
obj.sq_IntVectPush(28);
|
|
obj.sq_AddSetStatePacket(STATE_GUNNER_VIRTUALRUSH, STATE_PRIORITY_IGNORE_FORCE, true);
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
function checkExecutableSkill_RobotExs_bykk(obj)
|
|
{
|
|
if (!obj){
|
|
return false;
|
|
}
|
|
local size = obj.getVar("ExsS_OBJ").get_obj_vector_size();
|
|
local maxnum = obj.sq_GetIntData(29,6);
|
|
// printp("size="+size.tostring()+", maxnum="+maxnum.tostring()+"\n");
|
|
// if(size > 0){
|
|
// obj.sq_PlaySound("GN_SOPHIA_SYNC");
|
|
// local size = obj.getVar("ExsS_OBJ").get_obj_vector_size();
|
|
// for(local i = 0; i < size; i++){
|
|
// local activeObj = sq_GetCNRDObjectToCollisionObject(obj.getVar("ExsS_OBJ").get_obj_vector(i));
|
|
// if(activeObj){
|
|
// for(local ui = 0; ui < 10; ui++){
|
|
// local moveX = sq_GetDistancePos(obj.getXPos(), obj.getDirection(), 150) + sq_getRandom(-50,60);
|
|
// local moveY = obj.getYPos() + sq_getRandom(-30,30);
|
|
// if(obj.isMovablePos(moveX, moveY)){
|
|
// activeObj.getVar("move").clear_vector();
|
|
// activeObj.getVar("move").push_vector(moveX);
|
|
// activeObj.getVar("move").push_vector(moveY);
|
|
// activeObj.addSetStatePacket(23, null, STATE_PRIORITY_FORCE, false, "");
|
|
// break;
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
if(size >= maxnum){
|
|
if(obj.getState() == 14){
|
|
obj.sq_IntVectClear();
|
|
obj.sq_AddSetStatePacket(14, STATE_PRIORITY_IGNORE_FORCE, true);
|
|
}
|
|
else if(obj.getState() == 0){
|
|
obj.sq_IntVectClear();
|
|
obj.sq_AddSetStatePacket(0, STATE_PRIORITY_IGNORE_FORCE, true);
|
|
}
|
|
return true;
|
|
}
|
|
local b_useskill = obj.sq_IsUseSkill(29);
|
|
if(b_useskill){
|
|
if(sq_getGrowType(obj) == 3){
|
|
local skill_level = sq_GetSkillLevel(obj, SKILL_GUNNER_HS1);
|
|
if(skill_level > 0){
|
|
sendSkillPacket_hs1(obj,29);
|
|
}
|
|
else{
|
|
obj.sq_IntVectClear();
|
|
obj.sq_IntVectPush(5);
|
|
obj.sq_IntVectPush(29);
|
|
obj.sq_AddSetStatePacket(STATE_GUNNER_VIRTUALRUSH, STATE_PRIORITY_IGNORE_FORCE, true);
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
function checkExecutableSkill_RobotExsEx_bykk(obj)
|
|
{
|
|
if (!obj) return false;
|
|
local b_useskill = obj.sq_IsUseSkill(106);
|
|
if(b_useskill){
|
|
if(sq_getGrowType(obj) == 3){
|
|
local skill_level = sq_GetSkillLevel(obj, SKILL_GUNNER_HS1);
|
|
if(skill_level > 0){
|
|
sendSkillPacket_hs1(obj,106);
|
|
}
|
|
else{
|
|
obj.sq_IntVectClear();
|
|
obj.sq_IntVectPush(5);
|
|
obj.sq_IntVectPush(106);
|
|
obj.sq_AddSetStatePacket(STATE_GUNNER_VIRTUALRUSH, STATE_PRIORITY_IGNORE_FORCE, true);
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function checkExecutableSkill_RobotEz8Ex_bykk(obj)
|
|
{
|
|
if(!obj) return false;
|
|
if(obj.getVar("virtualrush").getBool(0) == true && !sq_GetSkill(obj, 105).isInCoolTime()){
|
|
local effect_obj = sq_GetCNRDObjectToCollisionObject(obj.getVar("VIRTUALRUSH_SUB1").get_obj_vector(0));
|
|
local offsetX = sq_getRandom(-240,240);
|
|
local offsetY = sq_getRandom(-30,60);
|
|
createSkillPassiveObj_nanjixie(obj,effect_obj,SKILL_GUNNER_VIRTUALRUSH,2,0,105,1,offsetX,offsetY,0);
|
|
sq_AddDrawOnlyAniFromParent(effect_obj,"character/gunner/effect/animation/virtualrush/castrobotafront_00.ani", 0, 1, 1);
|
|
sq_AddDrawOnlyAniFromParent(effect_obj,"character/gunner/effect/animation/virtualrush/castrobotaback_00.ani", 0, 1, 1);
|
|
sq_AddDrawOnlyAniFromParent(effect_obj,"character/gunner/effect/animation/virtualrush/castrobotgunnerback1_00.ani", 0, 1, 1);
|
|
//obj.startSkillCoolTime(28, sq_GetSkillLevel(obj, 28), -1);
|
|
if(obj.getState() == 14){
|
|
obj.sq_IntVectClear();
|
|
obj.sq_AddSetStatePacket(14, STATE_PRIORITY_IGNORE_FORCE, true);
|
|
}
|
|
else if(obj.getState() == 0){
|
|
obj.sq_IntVectClear();
|
|
obj.sq_AddSetStatePacket(0, STATE_PRIORITY_IGNORE_FORCE, true);
|
|
}
|
|
obj.sq_PlaySound("R_GN_COUNTDOWN");
|
|
return true;
|
|
}
|
|
local b_useskill = obj.sq_IsUseSkill(105);
|
|
if(b_useskill){
|
|
if(sq_getGrowType(obj) == 3){
|
|
local skill_level = sq_GetSkillLevel(obj, SKILL_GUNNER_HS1);
|
|
if(skill_level > 0){
|
|
sendSkillPacket_hs1(obj,105);
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
function checkExecutableSkill_RobotTempester_bykk(obj)
|
|
{
|
|
if (!obj) return false;
|
|
local number = obj.getVar("TEMPObj").get_obj_vector_size();
|
|
local numberMax = sq_GetLevelData(obj, 63, 6, sq_GetSkillLevel(obj, 63));
|
|
if(number >= numberMax){
|
|
local state = obj.getState();
|
|
if(state == 0 || state == 14){
|
|
obj.sq_IntVectClear();
|
|
obj.sq_AddSetStatePacket(state, STATE_PRIORITY_IGNORE_FORCE, true);
|
|
}
|
|
return true;
|
|
}
|
|
// local skillnumber = sq_GetBonusRateWithPassive(obj, 63, 63, 6, 1.0) + 100;
|
|
if(number > 0 && sq_GetSkillLevel(obj, SKILL_GUNNER_VIRTUALRUSH) > 0 && sq_GetLevelData(obj, 63, 7, sq_GetSkillLevel(obj, 63)) > 0 && !sq_GetSkill(obj, 63).isInCoolTime()){
|
|
obj.startSkillCoolTime(63, sq_GetSkillLevel(obj, 63), -1);
|
|
for(local i = 0; i < number; i++){
|
|
local activeObj = sq_GetCNRDObjectToActiveObject(obj.getVar("TEMPObj").get_obj_vector(i));
|
|
if(activeObj){
|
|
local apdPath = "character/gunner/madeby_kak_mechanic/ap/ap_kk_tempester_buff.nut";
|
|
if(CNSquirrelAppendage.sq_IsAppendAppendage(activeObj, apdPath)){
|
|
CNSquirrelAppendage.sq_RemoveAppendage(obj, apdPath);
|
|
}
|
|
local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(activeObj, obj, -1, false, apdPath, true);
|
|
local buffTime = sq_GetLevelData(obj, 63, 8, sq_GetSkillLevel(obj, 63));
|
|
sq_EffectLayerAppendage(activeObj,sq_RGB(250,20,10),150,0,0,buffTime);
|
|
// AddAppendage.sq_AddEffectBack("character/mage/effect/animation/avatar/avatarauraloopbot_eff_01.ani");//背后
|
|
// AddAppendage.sq_AddEffectFront("character/mage/effect/animation/avatar/avatarauralooptop_eff_01.ani");//身前
|
|
AddAppendage.sq_SetValidTime(buffTime);
|
|
local normalAppendage = CNSquirrelAppendage.sq_GetAppendage(activeObj, "character/gunner/madeby_kak_mechanic/ap/ap_kk_tempester.nut");
|
|
local totalDamage = normalAppendage.getVar("custom").get_vector(5);
|
|
local totalDamage2 = normalAppendage.getVar("custom").get_vector(6);
|
|
normalAppendage.getVar("custom").set_vector(5, totalDamage * 150 / 100);
|
|
normalAppendage.getVar("custom").set_vector(6, totalDamage2 * 150 / 100);
|
|
local t_01 = normalAppendage.getVar("skill_1").get_timer_vector(0);
|
|
local t_02 = normalAppendage.getVar("skill_2").get_timer_vector(0);
|
|
local bullet = t_01.getEventTerm();
|
|
local missile = t_02.getEventTerm();
|
|
print(bullet);
|
|
print(missile);
|
|
t_01.setEventTerm(bullet / 2);
|
|
t_02.setEventTerm(missile / 2);
|
|
|
|
local moveX = sq_GetDistancePos(obj.getXPos(), obj.getDirection(), 50);
|
|
local moveY = obj.getYPos();
|
|
if(activeObj.isMovablePos(moveX, moveY)){
|
|
activeObj.getVar("move").clear_vector();
|
|
activeObj.getVar("move").push_vector(moveX);
|
|
activeObj.getVar("move").push_vector(moveY);
|
|
local pIntVec = sq_GetGlobalIntVector();
|
|
sq_IntVectorClear(pIntVec);
|
|
sq_IntVectorPush(pIntVec, 3);
|
|
sq_AddSetStatePacketActiveObject(activeObj, 8, pIntVec, STATE_PRIORITY_USER);
|
|
obj.sq_PlaySound("GN_TRMPESTER");
|
|
if(obj.getState() == 14){
|
|
obj.sq_IntVectClear();
|
|
obj.sq_AddSetStatePacket(14, STATE_PRIORITY_IGNORE_FORCE, true);
|
|
}
|
|
else if(obj.getState() == 0){
|
|
obj.sq_IntVectClear();
|
|
obj.sq_AddSetStatePacket(0, STATE_PRIORITY_IGNORE_FORCE, true);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
local b_useskill = obj.sq_IsUseSkill(63);
|
|
if(b_useskill){
|
|
local chr = sq_GetMyMasterCharacter();
|
|
if(!isSameObject(obj, chr)){
|
|
obj.sq_IntVectClear();
|
|
obj.sq_IntVectPush(5);
|
|
obj.sq_IntVectPush(63);
|
|
obj.sq_AddSetStatePacket(STATE_GUNNER_VIRTUALRUSH, STATE_PRIORITY_IGNORE_FORCE, true);
|
|
return true;
|
|
}
|
|
if(sq_getGrowType(obj) == 3){
|
|
local skill_level = sq_GetSkillLevel(obj, SKILL_GUNNER_HS1);
|
|
if(skill_level > 0){
|
|
sendSkillPacket_hs1(obj,63);
|
|
}
|
|
else{
|
|
obj.sq_IntVectClear();
|
|
obj.sq_IntVectPush(5);
|
|
obj.sq_IntVectPush(63);
|
|
obj.sq_AddSetStatePacket(STATE_GUNNER_VIRTUALRUSH, STATE_PRIORITY_IGNORE_FORCE, true);
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
function checkExecutableSkill_MechaDrop_bykk(obj)
|
|
{
|
|
if(!obj) return false;
|
|
if(obj.getVar("virtualrush").getBool(0) == true && !sq_GetSkill(obj, 59).isInCoolTime()){
|
|
local effect_obj = sq_GetCNRDObjectToCollisionObject(obj.getVar("VIRTUALRUSH_SUB1").get_obj_vector(0));
|
|
local offsetX = sq_getRandom(-50,50);
|
|
local offsetY = sq_getRandom(-40,40);
|
|
local skill_level = sq_GetSkillLevel(obj, 59);
|
|
local number = obj.sq_GetLevelData(59, 3, skill_level);
|
|
local distanceX = 50;
|
|
if(number >= 30) distanceX = 40;
|
|
if(number >= 50) distanceX = 30;
|
|
local sperobot_number = obj.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);
|
|
}
|
|
for(local i = 1; i < number + 1; i++){
|
|
local rebotnumer = 3;
|
|
for(local ui = 0; ui < obj.getVar("sperobot").size_vector(); ui++){
|
|
if((i - 1) == obj.getVar("sperobot").get_vector(ui)){
|
|
rebotnumer = sq_getRandom(1,2).tointeger();
|
|
break;
|
|
}
|
|
}
|
|
//printp("i="+i.tostring()+",,"+((i/3).tointeger()*24).tostring()+"\n");
|
|
if(i % 3 == 1){
|
|
createSkillPassiveObj_nanjixie(obj,effect_obj,SKILL_GUNNER_VIRTUALRUSH,2,0,59,rebotnumer,offsetX-150+(i/3).tointeger()*distanceX+sq_getRandom(-5,5),offsetY - 40 + sq_getRandom(-8,8),0);
|
|
}
|
|
else if(i % 3 == 2){
|
|
createSkillPassiveObj_nanjixie(obj,effect_obj,SKILL_GUNNER_VIRTUALRUSH,2,0,59,rebotnumer,offsetX-150+(i/3).tointeger()*distanceX+sq_getRandom(-5,5),offsetY + sq_getRandom(-8,8),0);
|
|
}
|
|
else if(i % 3 == 0){
|
|
createSkillPassiveObj_nanjixie(obj,effect_obj,SKILL_GUNNER_VIRTUALRUSH,2,0,59,rebotnumer,offsetX-175+(i/3).tointeger()*distanceX+sq_getRandom(-5,5),offsetY + 40 + sq_getRandom(-8,8),0);
|
|
}
|
|
}
|
|
sq_AddDrawOnlyAniFromParent(effect_obj,"character/gunner/effect/animation/virtualrush/castrobotafront_00.ani", 0, 1, 1);
|
|
sq_AddDrawOnlyAniFromParent(effect_obj,"character/gunner/effect/animation/virtualrush/castrobotaback_00.ani", 0, 1, 1);
|
|
sq_AddDrawOnlyAniFromParent(effect_obj,"character/gunner/effect/animation/virtualrush/castrobotgunnerback1_00.ani", 0, 1, 1);
|
|
//obj.startSkillCoolTime(59, sq_GetSkillLevel(obj, 59), -1);
|
|
if(obj.getState() == 14){
|
|
obj.sq_IntVectClear();
|
|
obj.sq_AddSetStatePacket(14, STATE_PRIORITY_IGNORE_FORCE, true);
|
|
}
|
|
else if(obj.getState() == 0){
|
|
obj.sq_IntVectClear();
|
|
obj.sq_AddSetStatePacket(0, STATE_PRIORITY_IGNORE_FORCE, true);
|
|
}
|
|
obj.sq_PlaySound("DROPSHIP_PASSING");
|
|
obj.sq_PlaySound("DROPSHIP_RADIO_01");
|
|
return true;
|
|
}
|
|
local b_useskill = obj.sq_IsUseSkill(59);
|
|
if(b_useskill){
|
|
obj.sq_IntVectClear();
|
|
obj.sq_IntVectPush(4);
|
|
obj.sq_AddSetStatePacket(STATE_GUNNER_VIRTUALRUSH, STATE_PRIORITY_IGNORE_FORCE, true);
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function checkExecutableSkill_SparrowFactory_bykk(obj)
|
|
{
|
|
if(!obj) return false;
|
|
if(obj.getVar("virtualrush").getBool(0) == true && !sq_GetSkill(obj, 83).isInCoolTime()){
|
|
local effect_obj = sq_GetCNRDObjectToCollisionObject(obj.getVar("VIRTUALRUSH_SUB1").get_obj_vector(0));
|
|
local offsetX = sq_getRandom(-50,50);
|
|
local offsetY = sq_getRandom(-30,60);
|
|
createSkillPassiveObj_nanjixie(obj,effect_obj,SKILL_GUNNER_VIRTUALRUSH,2,0,83,1,offsetX,offsetY,0);
|
|
local number = obj.sq_GetIntData(83, 2);
|
|
for(local i = 0; i < number; i++){
|
|
createSkillPassiveObj_nanjixie(obj,effect_obj,SKILL_GUNNER_VIRTUALRUSH,2,0,83,2,offsetX+sq_getRandom(-100,100),offsetY+sq_getRandom(-20,20),120);
|
|
}
|
|
sq_AddDrawOnlyAniFromParent(effect_obj,"character/gunner/effect/animation/virtualrush/castrobotafront_00.ani", 0, 1, 1);
|
|
sq_AddDrawOnlyAniFromParent(effect_obj,"character/gunner/effect/animation/virtualrush/castrobotaback_00.ani", 0, 1, 1);
|
|
sq_AddDrawOnlyAniFromParent(effect_obj,"character/gunner/effect/animation/virtualrush/castrobotgunnerback1_00.ani", 0, 1, 1);
|
|
//obj.startSkillCoolTime(83, sq_GetSkillLevel(obj, 83), -1);
|
|
if(obj.getState() == 14){
|
|
obj.sq_IntVectClear();
|
|
obj.sq_AddSetStatePacket(14, STATE_PRIORITY_IGNORE_FORCE, true);
|
|
}
|
|
else if(obj.getState() == 0){
|
|
obj.sq_IntVectClear();
|
|
obj.sq_AddSetStatePacket(0, STATE_PRIORITY_IGNORE_FORCE, true);
|
|
}
|
|
obj.sq_PlaySound("GN_SPARROW_FACTORY");
|
|
return true;
|
|
}
|
|
local b_useskill = obj.sq_IsUseSkill(83);
|
|
if(b_useskill){
|
|
if(sq_getGrowType(obj) == 3){
|
|
local skill_level = sq_GetSkillLevel(obj, SKILL_GUNNER_HS1);
|
|
if(skill_level > 0){
|
|
sendSkillPacket_hs1(obj,83);
|
|
}
|
|
else{
|
|
obj.sq_IntVectClear();
|
|
obj.sq_IntVectPush(5);
|
|
obj.sq_IntVectPush(83);
|
|
obj.sq_AddSetStatePacket(STATE_GUNNER_VIRTUALRUSH, STATE_PRIORITY_IGNORE_FORCE, true);
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
function checkExecutableSkill_robotsexplosion_bykk(obj)
|
|
{
|
|
if (!obj) return false;
|
|
local isUse = obj.sq_IsUseSkill(SKILL_GUNNER_ROBOTSEXPLOSION);
|
|
if (isUse)
|
|
{
|
|
obj.sq_IsEnterSkillLastKeyUnits(SKILL_GUNNER_ROBOTSEXPLOSION);
|
|
obj.sq_AddSetStatePacket(SKILL_GUNNER_ROBOTSEXPLOSION, STATE_PRIORITY_USER, false);
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
function onSetState_robotsexplosion_bykk(obj, state, datas, isResetTimer)
|
|
{
|
|
if(!obj) return;
|
|
obj.sq_StopMove();
|
|
obj.sq_SetCurrentAnimation(CUSTOM_ANI_GUNNER_COMMAND);
|
|
local skill_level = sq_GetSkillLevel(obj, SKILL_GUNNER_ROBOTSEXPLOSION);//技能等级
|
|
local castTime = sq_GetCastTime(obj, SKILL_GUNNER_ROBOTSEXPLOSION, skill_level) / 3;//得到技能里面的施放时间
|
|
sq_StartDrawCastGauge(obj, castTime, true);
|
|
obj.getVar("robotsexplosion").setBool(0,true);
|
|
}
|
|
|
|
function onEndCurrentAni_robotsexplosion_bykk(obj)
|
|
{
|
|
obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false);
|
|
}
|
|
|
|
function onProcCon_robotsexplosion_bykk(obj)
|
|
{
|
|
if(!obj) return;
|
|
local stateTime = obj.sq_GetStateTimer();
|
|
local bDownKey = obj.isDownSkillLastKey();
|
|
|
|
local posX = obj.getXPos();
|
|
local posY = obj.getYPos();
|
|
|
|
local skill_level = sq_GetSkillLevel(obj, SKILL_GUNNER_ROBOTSEXPLOSION);
|
|
local size = obj.sq_GetLevelData(SKILL_GUNNER_ROBOTSEXPLOSION, 0, skill_level) / 2;
|
|
local sizeRate = size.tofloat() / 210;
|
|
|
|
if(!bDownKey && stateTime < 250 && obj.getVar("robotsexplosion").getBool(0) == true){
|
|
for(local i =1; i < 4; i++){
|
|
local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"character/gunner/effect/animation/robotsexplosion"+i.tostring()+".ani", 0, 0, 0);
|
|
local pAni = pooledObj.getCurrentAnimation();
|
|
pAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
|
}
|
|
obj.getVar("robotsexplosion").setBool(0,false);
|
|
obj.getVar("robotsexplosion").clear_vector();
|
|
obj.setTimeEvent(0, 350 - stateTime, 1, false);
|
|
if(obj.getVar("virtualrush").getBool(0) == true){
|
|
sendrobotstate_byKK(obj,3);
|
|
local hs1_obj01 = sq_GetCNRDObjectToCollisionObject(obj.getVar("hs1_obj").get_obj_vector(0));
|
|
local hs1_obj02 = sq_GetCNRDObjectToCollisionObject(obj.getVar("hs1_obj").get_obj_vector(1));
|
|
if(hs1_obj01.getZPos() > 200 && hs1_obj01.getState() == 27){
|
|
hs1_obj01.addSetStatePacket(sq_getRandom(20,25).tointeger(), null, STATE_PRIORITY_AUTO, false, "");
|
|
}
|
|
else if(hs1_obj02.getZPos() > 200 && hs1_obj02.getState() == 27){
|
|
hs1_obj02.addSetStatePacket(sq_getRandom(20,25).tointeger(), null, STATE_PRIORITY_AUTO, false, "");
|
|
}
|
|
obj.sq_PlaySound("GN_VIRTUALRUSH_02");
|
|
}
|
|
else{
|
|
sendrobotstate_byKK(obj,1);
|
|
obj.sq_PlaySound("GN_FIRE");
|
|
}
|
|
}
|
|
else if((!bDownKey && stateTime >= 250 && obj.getVar("robotsexplosion").getBool(0) == true) || (bDownKey && stateTime >= 1200 && obj.getVar("robotsexplosion").getBool(0) == true)){
|
|
for(local i =1; i < 4; i++){
|
|
local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"character/gunner/effect/animation/robotsexplosion"+i.tostring()+".ani", 0, 0, 0);
|
|
local pAni = pooledObj.getCurrentAnimation();
|
|
pAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
|
}
|
|
local aimPosX = obj.sq_GetAimPosX(posX, posY, false);
|
|
local aimPosY = obj.sq_GetAimPosY(posX, posY, false);
|
|
// printp("aimPosX="+aimPosX.tostring()+" aimPosY="+aimPosY.tostring()+"\n");
|
|
obj.getVar("robotsexplosion").clear_vector();
|
|
obj.getVar("robotsexplosion").push_vector(aimPosX);
|
|
obj.getVar("robotsexplosion").push_vector(aimPosY);
|
|
obj.getVar("robotsexplosion").setBool(0,false);
|
|
obj.setTimeEvent(0, 100, 1, false);
|
|
if(obj.getVar("virtualrush").getBool(0) == true){
|
|
sendrobotstate_byKK(obj,5);
|
|
local hs1_obj01 = sq_GetCNRDObjectToCollisionObject(obj.getVar("hs1_obj").get_obj_vector(0));
|
|
local hs1_obj02 = sq_GetCNRDObjectToCollisionObject(obj.getVar("hs1_obj").get_obj_vector(1));
|
|
if(hs1_obj01.getZPos() > 200 && hs1_obj01.getState() == 27){
|
|
hs1_obj01.addSetStatePacket(sq_getRandom(20,25).tointeger(), null, STATE_PRIORITY_AUTO, false, "");
|
|
}
|
|
else if(hs1_obj02.getZPos() > 200 && hs1_obj02.getState() == 27){
|
|
hs1_obj02.addSetStatePacket(sq_getRandom(20,25).tointeger(), null, STATE_PRIORITY_AUTO, false, "");
|
|
}
|
|
obj.sq_PlaySound("GN_VIRTUALRUSH_02");
|
|
}
|
|
else{
|
|
sendrobotstate_byKK(obj,2);
|
|
obj.sq_PlaySound("GN_FALLDOWN");
|
|
}
|
|
}
|
|
}
|
|
|
|
function onKeyFrameFlag_robotsexplosion_bykk(obj, flagIndex)
|
|
{
|
|
if(!obj) return false;
|
|
if(flagIndex == 1){
|
|
//
|
|
if(obj.getVar("robotsexplosion").getBool(0) == true){
|
|
local posX = obj.getXPos();
|
|
local posY = obj.getYPos();
|
|
local posZ = obj.getZPos();
|
|
|
|
local offsetX = 130;
|
|
offsetX = obj.sq_GetDistancePos(posX, obj.sq_GetDirection(), offsetX);
|
|
|
|
local vX = 800;
|
|
local vY = 300;
|
|
|
|
obj.sq_AddAimPointMark(offsetX, posY, vX, vY);
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
function onTimeEvent_robotsexplosion_bykk(obj, timeEventIndex, timeEventCount)
|
|
{
|
|
if(!obj) return false;
|
|
|
|
switch(timeEventIndex){
|
|
case 0:
|
|
obj.sq_RemoveAimPointMark();
|
|
if(obj.getVar("virtualrush").getBool(0) == true){
|
|
createPointFireExplosion_byKK(obj,3);
|
|
obj.getVar("VIRTUALRUSH_SUB1").clear_obj_vector();
|
|
obj.getVar("VIRTUALRUSH_SUB2").clear_obj_vector();
|
|
obj.getVar("virtualrush").setBool(0,false);
|
|
}
|
|
else{
|
|
createPointFireExplosion_byKK(obj,1);
|
|
}
|
|
obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false);
|
|
break;
|
|
}
|
|
}
|
|
|
|
function onEndState_robotsexplosion_bykk(obj, new_state)
|
|
{
|
|
if(!obj) return;
|
|
if(new_state != SKILL_GUNNER_ROBOTSEXPLOSION){
|
|
obj.sq_RemoveAimPointMark();
|
|
}
|
|
}
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
function checkExecutableSkill_robotrx60_bykk(obj)
|
|
{
|
|
if (!obj) return false;
|
|
if(obj.getVar("virtualrush").getBool(0) == true && !sq_GetSkill(obj, SKILL_GUNNER_ROBOTRX60).isInCoolTime()){
|
|
local effect_obj = sq_GetCNRDObjectToCollisionObject(obj.getVar("VIRTUALRUSH_SUB1").get_obj_vector(0));
|
|
local offsetX = sq_getRandom(-150,150);
|
|
local offsetY = sq_getRandom(-30,30);
|
|
createSkillPassiveObj_nanjixie(obj,effect_obj,SKILL_GUNNER_VIRTUALRUSH,2,0,SKILL_GUNNER_ROBOTRX60,1,offsetX,offsetY,0);
|
|
sq_AddDrawOnlyAniFromParent(effect_obj,"character/gunner/effect/animation/virtualrush/castrobotafront_00.ani", 0, 1, 1);
|
|
sq_AddDrawOnlyAniFromParent(effect_obj,"character/gunner/effect/animation/virtualrush/castrobotaback_00.ani", 0, 1, 1);
|
|
sq_AddDrawOnlyAniFromParent(effect_obj,"character/gunner/effect/animation/virtualrush/castrobotgunnerback1_00.ani", 0, 1, 1);
|
|
obj.startSkillCoolTime(SKILL_GUNNER_ROBOTRX60, sq_GetSkillLevel(obj, SKILL_GUNNER_ROBOTRX60), -1);
|
|
obj.sq_PlaySound("GN_LADNRUNNER");
|
|
return true;
|
|
}
|
|
local isUse = obj.sq_IsUseSkill(SKILL_GUNNER_ROBOTRX60);
|
|
if (isUse)
|
|
{
|
|
local skill_level = sq_GetSkillLevel(obj, SKILL_GUNNER_HS1);
|
|
if(skill_level > 0){
|
|
sendSkillPacket_hs1(obj,SKILL_GUNNER_ROBOTRX60);
|
|
}
|
|
else{
|
|
obj.sq_AddSetStatePacket(STATE_GUNNER_ROBOTRX60, STATE_PRIORITY_USER, false);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
function onSetState_robotrx60_bykk(obj, state, datas, isResetTimer)
|
|
{
|
|
if(!obj) return;
|
|
obj.sq_StopMove();
|
|
obj.sq_SetCurrentAnimation(CUSTOM_ANI_SETROBOT);
|
|
local skill_level = sq_GetSkillLevel(obj, SKILL_GUNNER_ROBOTRX60);
|
|
local level = obj.sq_GetLevelData(SKILL_GUNNER_ROBOTRX60, 0, skill_level);
|
|
summonmonster_mechanic(obj,100,0,0,0,77630,600000,level,0);
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
function checkExecutableSkill_ateam_bykk(obj)
|
|
{
|
|
if (!obj) return false;
|
|
if(obj.getVar("virtualrush").getBool(0) == true && !sq_GetSkill(obj, SKILL_GUNNER_ATEAM).isInCoolTime()){
|
|
local effect_obj = sq_GetCNRDObjectToCollisionObject(obj.getVar("VIRTUALRUSH_SUB1").get_obj_vector(0));
|
|
local offsetX = sq_getRandom(-150,150);
|
|
local offsetY = sq_getRandom(-30,30);
|
|
createSkillPassiveObj_nanjixie(obj,effect_obj,SKILL_GUNNER_VIRTUALRUSH,2,0,SKILL_GUNNER_ATEAM,1,offsetX,offsetY-25,0);
|
|
createSkillPassiveObj_nanjixie(obj,effect_obj,SKILL_GUNNER_VIRTUALRUSH,2,0,SKILL_GUNNER_ATEAM,2,offsetX,offsetY+25,0);
|
|
createSkillPassiveObj_nanjixie(obj,effect_obj,SKILL_GUNNER_VIRTUALRUSH,2,0,SKILL_GUNNER_ATEAM,3,offsetX+60,offsetY-1,0);
|
|
createSkillPassiveObj_nanjixie(obj,effect_obj,SKILL_GUNNER_VIRTUALRUSH,2,0,SKILL_GUNNER_ATEAM,4,offsetX-50,offsetY-50,0);
|
|
createSkillPassiveObj_nanjixie(obj,effect_obj,SKILL_GUNNER_VIRTUALRUSH,2,0,SKILL_GUNNER_ATEAM,5,offsetX-50,offsetY+50,0);
|
|
sq_AddDrawOnlyAniFromParent(effect_obj,"character/gunner/effect/animation/virtualrush/castrobotafront_00.ani", 0, 1, 1);
|
|
sq_AddDrawOnlyAniFromParent(effect_obj,"character/gunner/effect/animation/virtualrush/castrobotaback_00.ani", 0, 1, 1);
|
|
sq_AddDrawOnlyAniFromParent(effect_obj,"character/gunner/effect/animation/virtualrush/castrobotgunnerback1_00.ani", 0, 1, 1);
|
|
obj.startSkillCoolTime(SKILL_GUNNER_ATEAM, sq_GetSkillLevel(obj, SKILL_GUNNER_ATEAM), -1);
|
|
obj.sq_PlaySound("GN_LADNRUNNER");
|
|
return true;
|
|
}
|
|
|
|
local isUse = obj.sq_IsUseSkill(SKILL_GUNNER_ATEAM);
|
|
if (isUse)
|
|
{
|
|
local skill_level = sq_GetSkillLevel(obj, SKILL_GUNNER_HS1);
|
|
if(skill_level > 0){
|
|
sendSkillPacket_hs1(obj,SKILL_GUNNER_ATEAM);
|
|
}
|
|
else{
|
|
obj.sq_AddSetStatePacket(STATE_GUNNER_ATEAM, STATE_PRIORITY_USER, false);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
function onSetState_ateam_bykk(obj, state, datas, isResetTimer)
|
|
{
|
|
if(!obj) return;
|
|
obj.sq_StopMove();
|
|
obj.sq_SetCurrentAnimation(CUSTOM_ANI_SETROBOT);
|
|
local skill_level = sq_GetSkillLevel(obj, SKILL_GUNNER_ATEAM);
|
|
local level = obj.sq_GetLevelData(SKILL_GUNNER_ATEAM, 0, skill_level);
|
|
summonmonster_mechanic(obj,150, -25, 0, 0, 77625, 600000, level, 0);
|
|
summonmonster_mechanic(obj,150, 25, 0, 0, 77626, 600000, level, 0);
|
|
summonmonster_mechanic(obj,210, 0, 0, 0, 77627, 600000, level, 0);
|
|
summonmonster_mechanic(obj,100, -50, 0, 0, 77628, 600000, level, 0);
|
|
summonmonster_mechanic(obj,100, 50, 0, 0, 77629, 600000, level, 0);
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
function checkExecutableSkill_virtualrush_bykk(obj)
|
|
{
|
|
if (!obj) return false;
|
|
if(obj.getVar("virtualrush").getBool(0) == true){
|
|
obj.sq_IsEnterSkillLastKeyUnits(SKILL_GUNNER_VIRTUALRUSH);
|
|
obj.sq_IntVectClear();
|
|
obj.sq_IntVectPush(2);
|
|
obj.sq_AddSetStatePacket(STATE_GUNNER_VIRTUALRUSH, STATE_PRIORITY_USER, true);
|
|
return true;
|
|
}
|
|
|
|
local isUse = obj.sq_IsUseSkill(SKILL_GUNNER_VIRTUALRUSH);
|
|
if (isUse){
|
|
sendSkillPacket_hs1(obj,SKILL_GUNNER_VIRTUALRUSH);
|
|
obj.sq_IntVectClear();
|
|
obj.sq_IntVectPush(1);
|
|
obj.sq_AddSetStatePacket(STATE_GUNNER_VIRTUALRUSH, STATE_PRIORITY_USER, true);
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
function onSetState_virtualrush_bykk(obj, state, datas, isResetTimer)
|
|
{
|
|
if(!obj) return;
|
|
|
|
local substate = obj.sq_GetVectorData(datas, 0);
|
|
obj.setSkillSubState(substate);
|
|
switch(substate){
|
|
case 1:
|
|
obj.sq_StopMove();
|
|
obj.sq_SetCurrentAnimation(CUSTOM_ANI_VIRTUALRUSH_BODY);
|
|
obj.sq_PlaySound("GN_VIRTUALRUSH_01");
|
|
obj.getVar("virtualrush").setBool(0,true);
|
|
break;
|
|
case 2:
|
|
obj.sq_StopMove();
|
|
obj.sq_SetCurrentAnimation(CUSTOM_ANI_VIRTUALRUSH_EXPLOSION1);
|
|
obj.sq_PlaySound("GN_VIRTUALRUSH_02");
|
|
obj.getVar("virtualrush").setBool(1,true);
|
|
break;
|
|
case 3:
|
|
obj.sq_StopMove();
|
|
obj.sq_SetCurrentAnimation(CUSTOM_ANI_VIRTUALRUSH_EXPLOSION2);
|
|
//obj.sq_PlaySound("GN_VIRTUALRUSH_03");
|
|
local hs1_obj01 = sq_GetCNRDObjectToCollisionObject(obj.getVar("hs1_obj").get_obj_vector(0));
|
|
local hs1_obj02 = sq_GetCNRDObjectToCollisionObject(obj.getVar("hs1_obj").get_obj_vector(1));
|
|
if(hs1_obj01.getZPos() > 200 && hs1_obj01.getState() == 27){
|
|
hs1_obj01.addSetStatePacket(sq_getRandom(20,25).tointeger(), null, STATE_PRIORITY_AUTO, false, "");
|
|
}
|
|
else if(hs1_obj02.getZPos() > 200 && hs1_obj02.getState() == 27){
|
|
hs1_obj02.addSetStatePacket(sq_getRandom(20,25).tointeger(), null, STATE_PRIORITY_AUTO, false, "");
|
|
}
|
|
break;
|
|
case 4://空投支援
|
|
obj.sq_StopMove();
|
|
obj.sq_SetCurrentAnimation(CUSTOM_ANI_GUNNER_COMMAND);
|
|
obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0);
|
|
local currentAni = obj.getCurrentAnimation();
|
|
local delaySum = currentAni.getDelaySum(0, 0);
|
|
local speedRate = delaySum.tofloat() / 90.0;
|
|
local castTime = (1000.0 * speedRate).tointeger();
|
|
sq_StartDrawCastGauge(obj, 100, true);
|
|
obj.setTimeEvent(1, castTime, 1, false);
|
|
obj.setTimeEvent(2, 100, 1, false);
|
|
obj.sq_PlaySound("DROPSHIP_PASSING");
|
|
obj.sq_PlaySound("DROPSHIP_RADIO_01");
|
|
break;
|
|
case 5://拦截机工厂
|
|
obj.sq_StopMove();
|
|
obj.sq_SetCurrentAnimation(CUSTOM_ANI_SETROBOT);
|
|
sq_StartDrawCastGauge(obj, 100, true);
|
|
local skillIndex = sq_GetVectorData(datas, 1);
|
|
switch(skillIndex){
|
|
case 83:
|
|
sq_BinaryStartWrite();
|
|
sq_BinaryWriteDword(83);//skillIndex
|
|
sq_BinaryWriteDword(1);//subtype
|
|
sq_SendCreatePassiveObjectPacket(obj, NUM_BYKK_PASSIVEOBJECT , 0, 150, 0, 0, obj.getDirection());
|
|
obj.sq_PlaySound("GN_SPARROW_FACTORY");
|
|
break;
|
|
case 29:
|
|
local skill_level = sq_GetSkillLevel(obj, skillIndex);
|
|
local bonusrate = sq_GetBonusRateWithPassive(obj, skillIndex, 29, 1, 1.0) + 100;
|
|
local lifetime = obj.sq_GetLevelData(skillIndex, 3, skill_level);
|
|
local resttime = obj.sq_GetIntData(skillIndex, 2);
|
|
local bullet_number = obj.sq_GetIntData(skillIndex, 1);
|
|
sq_BinaryStartWrite();
|
|
sq_BinaryWriteDword(29);//skillIndex
|
|
sq_BinaryWriteDword(4);//subtype
|
|
sq_BinaryWriteDword(bonusrate);
|
|
sq_BinaryWriteDword(lifetime);
|
|
sq_BinaryWriteDword(resttime);
|
|
sq_BinaryWriteDword(bullet_number);
|
|
sq_SendCreatePassiveObjectPacket(obj, NUM_BYKK_PASSIVEOBJECT , 0, 80, 0, 0, obj.getDirection());
|
|
obj.sq_PlaySound("GN_VIPER");
|
|
break;
|
|
case 106:
|
|
local skill_level = sq_GetSkillLevel(obj, skillIndex);
|
|
local bonusrate = sq_GetBonusRateWithPassive(obj, skillIndex, -1, 1, 1.0) + 100;
|
|
local bonusrate2 = sq_GetBonusRateWithPassive(obj, skillIndex, -1, 4, 1.0) + 100;
|
|
local lifetime = obj.sq_GetLevelData(skillIndex, 3, skill_level);
|
|
local resttime = obj.sq_GetIntData(skillIndex, 2);
|
|
local bullet_number = obj.sq_GetIntData(skillIndex, 1);
|
|
sq_BinaryStartWrite();
|
|
sq_BinaryWriteDword(29);//skillIndex
|
|
sq_BinaryWriteDword(5);//subtype
|
|
sq_BinaryWriteDword(bonusrate);
|
|
sq_BinaryWriteDword(lifetime);
|
|
sq_BinaryWriteDword(resttime);
|
|
sq_BinaryWriteDword(bullet_number);
|
|
sq_BinaryWriteDword(bonusrate2);
|
|
if(sq_GetLevelData(obj, skillIndex, 8, skill_level) > 0){
|
|
sq_SendCreatePassiveObjectPacket(obj, NUM_BYKK_PASSIVEOBJECT , 0, 80, -5, 0, obj.getDirection());
|
|
sq_SendCreatePassiveObjectPacket(obj, NUM_BYKK_PASSIVEOBJECT , 0, 80, 5, 0, obj.getDirection());
|
|
}
|
|
else sq_SendCreatePassiveObjectPacket(obj, NUM_BYKK_PASSIVEOBJECT , 0, 80, 0, 0, obj.getDirection());
|
|
obj.sq_PlaySound("GN_VIPER");
|
|
break;
|
|
case 28:
|
|
local skill_level = sq_GetSkillLevel(obj, 28);
|
|
local level = obj.sq_GetLevelData(28, 0, skill_level);
|
|
summonmonster_mechanic(obj, 50, 0, 0, 0, 77621, 600000, level, 0);
|
|
if(sq_GetLevelData(obj, 28, 6, skill_level) > 0) summonmonster_mechanic(obj, 55, 0, -5, 0, 77621, 600000, level, 0);
|
|
obj.sq_PlaySound("R_GN_COUNTDOWN");
|
|
break;
|
|
case 27:
|
|
local skill_level = sq_GetSkillLevel(obj, 27);
|
|
local level = obj.sq_GetLevelData(27, 0, skill_level);
|
|
local skill_level02 = sq_GetSkillLevel(obj, 42);
|
|
if(skill_level02 > 0){
|
|
summonmonster_mechanic(obj, 50, -10, 0, 0, 77620, 600000, level, 0);
|
|
summonmonster_mechanic(obj, 50, 20, 0, 0, 77620, 600000, level, 0);
|
|
}
|
|
else{
|
|
summonmonster_mechanic(obj, 50, 0, 0, 0, 77620, 600000, level, 0);
|
|
}
|
|
obj.sq_PlaySound("GN_LADNRUNNER");
|
|
break;
|
|
case 63:
|
|
local skill_level = sq_GetSkillLevel(obj, skillIndex);
|
|
local level = obj.sq_GetLevelData(skillIndex, 0, skill_level);
|
|
local number = obj.sq_GetLevelData(skillIndex, 6, skill_level);
|
|
local time = obj.sq_GetLevelData(skillIndex, 5, skill_level);
|
|
for(local i = 0; i < number; i++){
|
|
summonmonster_mechanic(obj,100 + i * 30,0,150,0,77623,time,level,0);//GN_TRMPESTER 60018
|
|
}
|
|
obj.sq_PlaySound("GN_TRMPESTER");
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
function onEndCurrentAni_virtualrush_bykk(obj)
|
|
{
|
|
if(!obj) return;
|
|
if(!obj.sq_IsMyControlObject()) return;
|
|
|
|
local substate = obj.getSkillSubState();
|
|
switch(substate){
|
|
case 1:
|
|
obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false);
|
|
break;
|
|
case 2:
|
|
obj.sq_IntVectClear();
|
|
obj.sq_IntVectPush(3);
|
|
obj.sq_AddSetStatePacket(STATE_GUNNER_VIRTUALRUSH, STATE_PRIORITY_USER, true);
|
|
break;
|
|
case 3:
|
|
// for(local i = 0; i < obj.getVar("VIRTUALRUSH_SUB1").get_obj_vector_size(); i++){
|
|
// local effect_obj = sq_GetCNRDObjectToCollisionObject(obj.getVar("VIRTUALRUSH_SUB1").get_obj_vector(i));
|
|
// effect_obj.setValid(false);
|
|
// }
|
|
obj.getVar("VIRTUALRUSH_SUB1").clear_obj_vector();
|
|
obj.getVar("VIRTUALRUSH_SUB2").clear_obj_vector();
|
|
obj.getVar("virtualrush").setBool(0,false);
|
|
obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false);
|
|
break;
|
|
case 5:
|
|
obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false);
|
|
break;
|
|
}
|
|
|
|
}
|
|
|
|
function onProcCon_virtualrush_bykk(obj)
|
|
{
|
|
if(!obj) return;
|
|
local stateTime = obj.sq_GetStateTimer();
|
|
local substate = obj.getSkillSubState();
|
|
local bDownKey = obj.isDownSkillLastKey();
|
|
switch(substate){
|
|
case 2:
|
|
if(!bDownKey && stateTime < 250 && obj.getVar("virtualrush").getBool(1) == true){
|
|
obj.getVar("virtualrush").setBool(1,false);
|
|
obj.getVar("virtualrush").clear_vector();
|
|
obj.setTimeEvent(0, 350 - stateTime, 1, false);
|
|
sendrobotstate_byKK(obj,3);
|
|
}
|
|
else if((!bDownKey && stateTime >= 250 && obj.getVar("virtualrush").getBool(1) == true) || (bDownKey && stateTime >= 1200 && obj.getVar("virtualrush").getBool(1) == true)){
|
|
local aimPosX = obj.sq_GetAimPosX(obj.getXPos(), obj.getYPos(), false);
|
|
local aimPosY = obj.sq_GetAimPosY(obj.getXPos(), obj.getYPos(), false);
|
|
// printp("aimPosX="+aimPosX.tostring()+" aimPosY="+aimPosY.tostring()+"\n");
|
|
obj.getVar("virtualrush").clear_vector();
|
|
obj.getVar("virtualrush").push_vector(aimPosX);
|
|
obj.getVar("virtualrush").push_vector(aimPosY);
|
|
obj.getVar("virtualrush").setBool(1,false);
|
|
obj.setTimeEvent(0, 200, 1, false);
|
|
sendrobotstate_byKK(obj,4);
|
|
local hs1_obj01 = sq_GetCNRDObjectToCollisionObject(obj.getVar("hs1_obj").get_obj_vector(0));
|
|
local hs1_obj02 = sq_GetCNRDObjectToCollisionObject(obj.getVar("hs1_obj").get_obj_vector(1));
|
|
if(hs1_obj01.getZPos() > 200 && hs1_obj01.getState() == 27){
|
|
sq_setCurrentAxisPos(hs1_obj01, 0, aimPosX);
|
|
sq_setCurrentAxisPos(hs1_obj01, 1, aimPosY);
|
|
}
|
|
else if(hs1_obj02.getZPos() > 200 && hs1_obj02.getState() == 27){
|
|
sq_setCurrentAxisPos(hs1_obj02, 0, aimPosX);
|
|
sq_setCurrentAxisPos(hs1_obj02, 1, aimPosY);
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
function onKeyFrameFlag_virtualrush_bykk(obj, flagIndex)
|
|
{
|
|
if(!obj) return false;
|
|
if(flagIndex == 1){
|
|
if(obj.getVar("virtualrush").getBool(1) == true){
|
|
local posX = obj.getXPos();
|
|
local posY = obj.getYPos();
|
|
|
|
local offsetX = 130;
|
|
offsetX = obj.sq_GetDistancePos(posX, obj.sq_GetDirection(), offsetX);
|
|
|
|
local vX = 800;
|
|
local vY = 300;
|
|
|
|
obj.sq_AddAimPointMark(offsetX, posY, vX, vY);
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
function onTimeEvent_virtualrush_bykk(obj, timeEventIndex, timeEventCount)
|
|
{
|
|
if(!obj) return false;
|
|
|
|
switch(timeEventIndex){
|
|
case 0:
|
|
createPointFireExplosion_byKK(obj,2);
|
|
obj.sq_RemoveAimPointMark();
|
|
obj.sq_IntVectClear();
|
|
obj.sq_IntVectPush(3);
|
|
obj.sq_AddSetStatePacket(STATE_GUNNER_VIRTUALRUSH, STATE_PRIORITY_USER, true);
|
|
break;
|
|
case 1:
|
|
obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false);
|
|
break;
|
|
case 2:
|
|
local baseX = sq_GetDistancePos(obj.getXPos(), obj.getDirection(), -150);
|
|
if(!obj.isMovablePos(baseX, obj.getYPos())) baseX = sq_GetDistancePos(obj.getXPos(), obj.getDirection(), -100);
|
|
if(!obj.isMovablePos(baseX, obj.getYPos())) baseX = sq_GetDistancePos(obj.getXPos(), obj.getDirection(), -50);
|
|
if(!obj.isMovablePos(baseX, obj.getYPos())) baseX = sq_GetDistancePos(obj.getXPos(), obj.getDirection(), 0);
|
|
sq_BinaryStartWrite();
|
|
sq_BinaryWriteDword(59);//skillIndex
|
|
sq_BinaryWriteDword(1);//subtype
|
|
sq_BinaryWriteDword(baseX);//subtype
|
|
sq_BinaryWriteDword(obj.getYPos());//subtype
|
|
sq_SendCreatePassiveObjectPacket(obj, NUM_BYKK_PASSIVEOBJECT , 0, -300, 0, 0, obj.getDirection());
|
|
break;
|
|
case 3:
|
|
|
|
break;
|
|
}
|
|
}
|
|
|
|
function onEndState_virtualrush_bykk(obj, new_state)
|
|
{
|
|
if(!obj) return;
|
|
if(new_state != STATE_GUNNER_VIRTUALRUSH){
|
|
obj.sq_RemoveAimPointMark();
|
|
}
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
function checkExecutableSkill_holdandgo_bykk(obj)
|
|
{
|
|
if (!obj) return false;
|
|
local isUse = obj.sq_IsUseSkill(SKILL_GUNNER_HOLDANDGO);
|
|
if (isUse){
|
|
obj.sq_AddSetStatePacket(STATE_GUNNER_HOLDANDGO, STATE_PRIORITY_USER, false);
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
function onSetState_holdandgo_bykk(obj, state, datas, isResetTimer)
|
|
{
|
|
if(!obj) return;
|
|
obj.sq_StopMove();
|
|
obj.sq_SetCurrentAnimation(CUSTOM_ANI_GUNNER_COMMAND);
|
|
local skill_level = sq_GetSkillLevel(obj, SKILL_GUNNER_HOLDANDGO);
|
|
local castTime = sq_GetCastTime(obj, SKILL_GUNNER_HOLDANDGO, skill_level) / 3;
|
|
sq_StartDrawCastGauge(obj, castTime, true);
|
|
// local skill = sq_GetSkill(obj, SKILL_GUNNER_HOLDANDGO);
|
|
// if(skill.isSealActiveFunction()){
|
|
// skill.setSealActiveFunction(false);//?
|
|
// // if(!CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/gunner/z_nanjixie/ap2/ap_holdandgo.nut")){
|
|
// // CNSquirrelAppendage.sq_AppendAppendage(obj, obj, SKILL_GUNNER_HOLDANDGO, false, "character/gunner/z_nanjixie/ap2/ap_holdandgo.nut", true);
|
|
// // }
|
|
// obj.getVar("holdandgo").setBool(0,true);
|
|
// obj.sq_PlaySound("HOLD_GO_CAST");
|
|
// }
|
|
// else{
|
|
// skill.setSealActiveFunction(true);//?
|
|
// // if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/gunner/z_nanjixie/ap2/ap_holdandgo.nut")){
|
|
// // CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/gunner/z_nanjixie/ap2/ap_holdandgo.nut");
|
|
// // }
|
|
// obj.getVar("holdandgo").setBool(0,false);
|
|
// obj.sq_PlaySound("HOLD_GO_FINGER");
|
|
// }
|
|
if(obj.getVar("holdandgo").getBool(0)){
|
|
obj.getVar("holdandgo").setBool(0,false);
|
|
obj.sq_PlaySound("HOLD_GO_FINGER");
|
|
}
|
|
else{
|
|
obj.getVar("holdandgo").setBool(0,true);
|
|
obj.sq_PlaySound("HOLD_GO_CAST");
|
|
}
|
|
// print(obj.getVar("holdandgo").getBool(0));
|
|
}
|
|
|
|
function onEndCurrentAni_holdandgo_bykk(obj)
|
|
{
|
|
obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false);
|
|
}
|
|
|
|
function onKeyFrameFlag_holdandgo_bykk(obj, flagIndex)
|
|
{
|
|
if(!obj) return false;
|
|
if(flagIndex == 1){
|
|
obj.setTimeEvent(0, 100, 1, false);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
|
|
function onTimeEvent_holdandgo_bykk(obj, timeEventIndex, timeEventCount)
|
|
{
|
|
if(!obj) return false;
|
|
|
|
switch(timeEventIndex){
|
|
case 0:
|
|
obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false);
|
|
break;
|
|
}
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
function checkExecutableSkill_dimensionrunner_bykk(obj)
|
|
{
|
|
if (!obj) return false;
|
|
local isUse = obj.sq_IsUseSkill(SKILL_GUNNER_DIMENSIONRUNNER);
|
|
if (isUse)
|
|
{
|
|
obj.sq_IsEnterSkillLastKeyUnits(SKILL_GUNNER_DIMENSIONRUNNER);
|
|
obj.sq_AddSetStatePacket(STATE_GUNNER_DIMENSIONRUNNER, STATE_PRIORITY_USER, false);
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
function onSetState_dimensionrunner_bykk(obj, state, datas, isResetTimer)
|
|
{
|
|
if(!obj) return;
|
|
obj.sq_StopMove();
|
|
obj.sq_SetCurrentAnimation(CUSTOM_ANI_GUNNER_COMMAND);
|
|
obj.getVar("dimensionrunner").setBool(0,true);
|
|
//sq_AddDrawOnlyAniFromParent(obj,"passiveobject/mechanic_bykk/animation/dimensionrunner/new/missileexplosiontalisman_03.ani",150,0,0);
|
|
}
|
|
|
|
function onEndCurrentAni_dimensionrunner_bykk(obj)
|
|
{
|
|
if(!obj) return;
|
|
obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false);
|
|
}
|
|
|
|
function onKeyFrameFlag_dimensionrunner_bykk(obj, flagIndex)
|
|
{
|
|
if(!obj) return false;
|
|
if(flagIndex == 1 && obj.getVar("dimensionrunner").getBool(0) == true){
|
|
local posX = obj.getXPos();
|
|
local posY = obj.getYPos();
|
|
|
|
local vX = 500;
|
|
local vY = 250;
|
|
|
|
obj.sq_AddAimPointMark(posX, posY, vX, vY);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
function onProcCon_dimensionrunner_bykk(obj)
|
|
{
|
|
if(!obj) return;
|
|
local stateTime = obj.sq_GetStateTimer();
|
|
local bDownKey = obj.isDownSkillLastKey();
|
|
|
|
local posX = obj.getXPos();
|
|
local posY = obj.getYPos();
|
|
|
|
if(!bDownKey && stateTime < 250 && obj.getVar("dimensionrunner").getBool(0) == true){//原地生成
|
|
obj.getVar("dimensionrunner").setBool(0,false);
|
|
obj.setTimeEvent(0, 350 - stateTime, 1, false);
|
|
local totalDamage = sq_GetBonusRateWithPassive(obj, SKILL_GUNNER_DIMENSIONRUNNER, SKILL_GUNNER_DIMENSIONRUNNER, 1, 1.0) + 100;
|
|
local totalDamage2 = sq_GetBonusRateWithPassive(obj, SKILL_GUNNER_DIMENSIONRUNNER, SKILL_GUNNER_DIMENSIONRUNNER, 0, 1.0) + 100;
|
|
createSkillPassiveObj_nanjixie(obj,obj,SKILL_GUNNER_DIMENSIONRUNNER,1,totalDamage,6,totalDamage2,0,0,0);
|
|
}
|
|
else if((!bDownKey && stateTime >= 250 && obj.getVar("dimensionrunner").getBool(0) == true) || (bDownKey && stateTime >= 1200 && obj.getVar("dimensionrunner").getBool(0) == true)){//定点生成
|
|
obj.getVar("dimensionrunner").setBool(0,false);
|
|
local aimPosX = obj.sq_GetAimPosX(posX, posY, false);
|
|
local aimPosY = obj.sq_GetAimPosY(posX, posY, false);
|
|
local offsetX = aimPosX - posX;
|
|
local offsetY = aimPosY - posY;
|
|
if(obj.getDirection() == ENUM_DIRECTION_LEFT) offsetX = posX - aimPosX;
|
|
local totalDamage = sq_GetBonusRateWithPassive(obj, SKILL_GUNNER_DIMENSIONRUNNER, SKILL_GUNNER_DIMENSIONRUNNER, 1, 1.0) + 100;
|
|
local totalDamage2 = sq_GetBonusRateWithPassive(obj, SKILL_GUNNER_DIMENSIONRUNNER, SKILL_GUNNER_DIMENSIONRUNNER, 0, 1.0) + 100;
|
|
createSkillPassiveObj_nanjixie(obj,obj,SKILL_GUNNER_DIMENSIONRUNNER,1,totalDamage,6,totalDamage2,offsetX,offsetY,0);
|
|
obj.setTimeEvent(0, 100, 1, false);
|
|
}
|
|
}
|
|
|
|
|
|
function onTimeEvent_dimensionrunner_bykk(obj, timeEventIndex, timeEventCount)
|
|
{
|
|
if(!obj) return false;
|
|
|
|
switch(timeEventIndex){
|
|
case 0:
|
|
obj.sq_RemoveAimPointMark();
|
|
obj.getVar("dimensionrunner").setBool(0, false);
|
|
obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false);
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
function onEndState_dimensionrunner_bykk(obj, new_state)
|
|
{
|
|
if(!obj) return;
|
|
if(new_state != SKILL_GUNNER_DIMENSIONRUNNER){
|
|
obj.sq_RemoveAimPointMark();
|
|
obj.getVar("dimensionrunner").setBool(0, false);
|
|
}
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
function checkExecutableSkill_hellmarch_bykk(obj)
|
|
{
|
|
if (!obj) return false;
|
|
local isUse = obj.sq_IsUseSkill(SKILL_GUNNER_HELLMARCH);
|
|
if (isUse){
|
|
obj.sq_IntVectClear();
|
|
obj.sq_IntVectPush(0);
|
|
obj.sq_AddSetStatePacket(STATE_GUNNER_HELLMARCH, STATE_PRIORITY_USER, true);
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
function onSetState_hellmarch_bykk(obj, state, datas, isResetTimer)
|
|
{
|
|
if(!obj) return;
|
|
local substate = obj.sq_GetVectorData(datas, 0);
|
|
obj.setSkillSubState(substate);
|
|
switch(substate){
|
|
case 0:
|
|
obj.sq_StopMove();
|
|
obj.sq_SetCurrentAnimation(CUSTOM_ANI_VIRTUALRUSH_BODY);
|
|
obj.sq_PlaySound("GN_HELLMARCH");
|
|
local direction = obj.getDirection();
|
|
createSkillPassiveObj_hellmarch_bykk(obj,1,0,4000,0,-150,0,-75,direction);
|
|
createSkillPassiveObj_hellmarch_bykk(obj,2,0,4000,0,-150,-175,-75,direction);
|
|
createSkillPassiveObj_hellmarch_bykk(obj,1,0,4000,0,-750,0,-75,sq_GetOppositeDirection(direction));
|
|
createSkillPassiveObj_hellmarch_bykk(obj,2,0,4000,0,-750,-175,-75,sq_GetOppositeDirection(direction));
|
|
obj.getVar("hellmarch").setBool(0, true);
|
|
print("set hellmarch");
|
|
break;
|
|
case 1:
|
|
obj.sq_StopMove();
|
|
obj.sq_SetCurrentAnimation(CUSTOM_ANI_VIRTUALRUSH_EXPLOSION1);
|
|
break;
|
|
}
|
|
}
|
|
|
|
function onEndCurrentAni_hellmarch_bykk(obj)
|
|
{
|
|
if(!obj) return;
|
|
local substate = obj.getSkillSubState();
|
|
switch(substate){
|
|
case 0:
|
|
obj.sq_IntVectClear();
|
|
obj.sq_IntVectPush(1);
|
|
obj.sq_AddSetStatePacket(STATE_GUNNER_HELLMARCH, STATE_PRIORITY_USER, true);
|
|
break;
|
|
case 1:
|
|
obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false);
|
|
break;
|
|
}
|
|
}
|
|
|
|
function onKeyFrameFlag_hellmarch_bykk(obj, flagIndex)
|
|
{
|
|
if(!obj) return false;
|
|
obj.setTimeEvent(0, 100, 1, false);
|
|
return true;
|
|
}
|
|
|
|
function onTimeEvent_hellmarch_bykk(obj, timeEventIndex, timeEventCount)
|
|
{
|
|
if(!obj) return false;
|
|
|
|
switch(timeEventIndex){
|
|
case 0:
|
|
obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false);
|
|
break;
|
|
}
|
|
}
|
|
|
|
function createSkillPassiveObj_hellmarch_bykk(obj,subtype,totalDamage,etc_num1,etc_num2,x,y,z,direction)
|
|
{
|
|
sq_BinaryStartWrite();
|
|
sq_BinaryWriteDword(SKILL_GUNNER_HELLMARCH);
|
|
sq_BinaryWriteDword(subtype);//subtype
|
|
sq_BinaryWriteDword(totalDamage);
|
|
sq_BinaryWriteDword(etc_num1);
|
|
sq_BinaryWriteDword(etc_num2);
|
|
sq_SendCreatePassiveObjectPacket(obj, NUM_BYKK_PASSIVEOBJECT , 0, x, y, z, direction);
|
|
}
|
|
|
|
|
|
function checkExecutableSkill_G1(obj)
|
|
{
|
|
if (!obj) return false;
|
|
local isUse = obj.sq_IsUseSkill(SKILL_GUNNER_G1);
|
|
if (isUse){
|
|
obj.sq_IntVectClear();
|
|
obj.sq_IntVectPush(0);
|
|
obj.sq_AddSetStatePacket(SKILL_GUNNER_G1, STATE_PRIORITY_USER, true);
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function checkCommandEnable_G1(obj)
|
|
{
|
|
if (!obj) return false;
|
|
return true;
|
|
}
|
|
|
|
function onSetState_G1(obj, state, datas, isResetTimer)
|
|
{
|
|
if(!obj) return;
|
|
local substate = obj.sq_GetVectorData(datas, 0);
|
|
obj.setSkillSubState(substate);
|
|
switch(substate){
|
|
case 0:
|
|
obj.sq_StopMove();
|
|
obj.sq_SetCurrentAnimation(CUSTOM_ANI_GUNNER_COMMAND);
|
|
obj.sq_PlaySound("GN_G1");
|
|
obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0);
|
|
local castTime = sq_GetCastTime(obj, SKILL_GUNNER_G1, sq_GetSkillLevel(obj, SKILL_GUNNER_G1));
|
|
obj.setTimeEvent(0, castTime, 1, false);
|
|
sq_StartDrawCastGauge(obj, castTime, true);
|
|
break;
|
|
}
|
|
}
|
|
|
|
function onEndCurrentAni_G1(obj)
|
|
{
|
|
if(!obj) return;
|
|
local substate = obj.getSkillSubState();
|
|
switch(substate){
|
|
case 1:
|
|
obj.sq_IntVectClear();
|
|
obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false);
|
|
break;
|
|
}
|
|
}
|
|
|
|
function onProcCon_G1(obj)
|
|
{
|
|
if(!obj) return;
|
|
}
|
|
|
|
function onKeyFrameFlag_G1(obj, flagIndex)
|
|
{
|
|
if(!obj) return false;
|
|
switch(flagIndex){
|
|
case 1:
|
|
local skillLevel = sq_GetSkillLevel(obj, SKILL_GUNNER_G1);
|
|
local totalDamage = sq_GetLevelData(obj, SKILL_GUNNER_G1, 0, skillLevel);
|
|
local lifeTime = sq_GetLevelData(obj, SKILL_GUNNER_G1, 1, skillLevel) + 150;
|
|
local hitDelayRate = sq_GetLevelData(obj, SKILL_GUNNER_G1, 2, skillLevel);
|
|
local hitCoolTime = sq_GetIntData(obj, SKILL_GUNNER_G1, 4);
|
|
local sizeRate = sq_GetIntData(obj, SKILL_GUNNER_G1, 7);
|
|
local offset = [-75,0,60];
|
|
local Gset = obj.getVar("Gset").getInt(10);
|
|
switch(Gset){
|
|
case SKILL_GUNNER_G2:
|
|
local size = obj.getVar("G2_obj").get_obj_vector_size();
|
|
if(size > 0){
|
|
local g2_addRate = sq_GetLevelData(obj, SKILL_GUNNER_G1, 3, skillLevel);
|
|
totalDamage = totalDamage * (100 + g2_addRate) / 100;
|
|
local loadSlot = obj.sq_GetSkillLoad(Gset);
|
|
if(loadSlot){
|
|
local allCoolTime = loadSlot.getEndCoolTime();
|
|
local nowCoolTime = loadSlot.getCurrentCoolTime();
|
|
lifeTime = allCoolTime - nowCoolTime + sq_GetIntData(obj, SKILL_GUNNER_G1, 2) + 150;
|
|
}
|
|
offset = [50, 0, 60];
|
|
obj.sq_RemoveSkillLoad(Gset);
|
|
for(local i = 0; i < size; i++){
|
|
local G2_obj = obj.getVar("G2_obj").get_obj_vector(i);
|
|
if(G2_obj){
|
|
local colObj = sq_GetCNRDObjectToCollisionObject(G2_obj);
|
|
colObj.addSetStatePacket(24, null, STATE_PRIORITY_IGNORE_FORCE, false, "");
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
case SKILL_GUNNER_G3:
|
|
local size = obj.getVar("G3_obj").get_obj_vector_size();
|
|
if(size > 0){
|
|
local g3_addRate = sq_GetLevelData(obj, SKILL_GUNNER_G1, 4, skillLevel);
|
|
totalDamage = totalDamage * (100 + g3_addRate) / 100;
|
|
local loadSlot = obj.sq_GetSkillLoad(Gset);
|
|
if(loadSlot){
|
|
local allCoolTime = loadSlot.getEndCoolTime();
|
|
local nowCoolTime = loadSlot.getCurrentCoolTime();
|
|
lifeTime = allCoolTime - nowCoolTime + sq_GetIntData(obj, SKILL_GUNNER_G1, 2) + 150;
|
|
}
|
|
obj.sq_RemoveSkillLoad(Gset);
|
|
for(local i = 0; i < size; i++){
|
|
local G3_obj = obj.getVar("G3_obj").get_obj_vector(i);
|
|
if(G3_obj){
|
|
local colObj = sq_GetCNRDObjectToCollisionObject(G3_obj);
|
|
colObj.addSetStatePacket(24, null, STATE_PRIORITY_IGNORE_FORCE, false, "");
|
|
}
|
|
}
|
|
}
|
|
size = obj.getVar("G3_att_obj").get_obj_vector_size();
|
|
if(size > 0){
|
|
for(local i = 0; i < size; i++){
|
|
local G3_obj = obj.getVar("G3_att_obj").get_obj_vector(i);
|
|
if(G3_obj){
|
|
local colObj = sq_GetCNRDObjectToCollisionObject(G3_obj);
|
|
colObj.setValid(false);
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
|
|
sq_BinaryStartWrite();
|
|
sq_BinaryWriteDword(SKILL_GUNNER_G1);//skillIndex
|
|
sq_BinaryWriteDword(1);//subtype
|
|
sq_BinaryWriteDword(totalDamage);
|
|
sq_BinaryWriteDword(lifeTime);
|
|
sq_BinaryWriteDword(hitDelayRate);
|
|
sq_BinaryWriteDword(hitCoolTime);
|
|
sq_BinaryWriteDword(sizeRate);
|
|
sq_SendCreatePassiveObjectPacket(obj, NUM_BYKK_PASSIVEOBJECT, 0, offset[0], offset[1], offset[2], obj.getDirection());
|
|
obj.sq_AddSkillLoad(SKILL_GUNNER_G1, 16, 1, lifeTime);
|
|
local loadSlot = obj.sq_GetSkillLoad(SKILL_GUNNER_G1);
|
|
obj.getVar("Gset").setInt(10, SKILL_GUNNER_G1);
|
|
loadSlot.setStartCool();
|
|
break;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
function onTimeEvent_G1(obj, timeEventIndex, timeEventCount)
|
|
{
|
|
if(!obj) return false;
|
|
switch(timeEventIndex){
|
|
case 0:
|
|
obj.sq_IntVectClear();
|
|
obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false);
|
|
break;
|
|
}
|
|
}
|
|
|
|
function onEndState_G1(obj, new_state)
|
|
{
|
|
if(!obj) return;
|
|
if(new_state != SKILL_GUNNER_G1){
|
|
sq_EndDrawCastGauge(obj);
|
|
}
|
|
}
|
|
|
|
|
|
function checkExecutableSkill_G2(obj)
|
|
{
|
|
if (!obj) return false;
|
|
local size = obj.getVar("G2_obj").get_obj_vector_size();
|
|
if(size > 0){
|
|
for(local i = 0; i < size; i++){
|
|
local G2_obj = obj.getVar("G2_obj").get_obj_vector(i);
|
|
if(G2_obj){
|
|
local colObj = sq_GetCNRDObjectToCollisionObject(G2_obj);
|
|
colObj.stopTimeEvent(10);
|
|
colObj.setTimeEvent(2, 625, 1 ,false);
|
|
if(G2_obj.getState() == 22) colObj.addSetStatePacket(23, null, STATE_PRIORITY_IGNORE_FORCE, false, "");
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
if(obj.getVar("G1_obj").get_obj_vector_size() < 1 && obj.getVar("G3_obj").get_obj_vector_size() < 1) return false;
|
|
// local Gset = obj.getVar("Gset").getInt(10);
|
|
// local loadSlot = obj.sq_GetSkillLoad(SKILL_GUNNER_G1);
|
|
// local nowCoolTime = loadSlot.getCurrentCoolTime();
|
|
// if(nowCoolTime <= sq_GetIntData(obj, SKILL_GUNNER_G1, 3)) return false;
|
|
local isUse = obj.sq_IsUseSkill(SKILL_GUNNER_G2);
|
|
if (isUse){
|
|
obj.sq_IntVectClear();
|
|
obj.sq_IntVectPush(0);
|
|
obj.sq_AddSetStatePacket(SKILL_GUNNER_G2, STATE_PRIORITY_USER, true);
|
|
return true;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
function checkCommandEnable_G2(obj)
|
|
{
|
|
if (!obj) return false;
|
|
return true;
|
|
}
|
|
|
|
function onSetState_G2(obj, state, datas, isResetTimer)
|
|
{
|
|
if(!obj) return;
|
|
local substate = obj.sq_GetVectorData(datas, 0);
|
|
obj.setSkillSubState(substate);
|
|
switch(substate){
|
|
case 0:
|
|
obj.sq_StopMove();
|
|
obj.sq_SetCurrentAnimation(CUSTOM_ANI_GUNNER_COMMAND);
|
|
obj.sq_PlaySound("GN_G2");
|
|
obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0);
|
|
local castTime = sq_GetCastTime(obj, SKILL_GUNNER_G2, sq_GetSkillLevel(obj, SKILL_GUNNER_G2));
|
|
obj.setTimeEvent(0, castTime, 1, false);
|
|
sq_StartDrawCastGauge(obj, castTime, true);
|
|
break;
|
|
}
|
|
}
|
|
|
|
function onEndCurrentAni_G2(obj)
|
|
{
|
|
if(!obj) return;
|
|
local substate = obj.getSkillSubState();
|
|
switch(substate){
|
|
case 1:
|
|
obj.sq_IntVectClear();
|
|
obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false);
|
|
break;
|
|
}
|
|
}
|
|
|
|
function onProcCon_G2(obj)
|
|
{
|
|
if(!obj) return;
|
|
}
|
|
|
|
function onKeyFrameFlag_G2(obj, flagIndex)
|
|
{
|
|
if(!obj) return false;
|
|
switch(flagIndex){
|
|
case 1:
|
|
local skillLevel = sq_GetSkillLevel(obj, SKILL_GUNNER_G2);
|
|
local totalDamage = sq_GetLevelData(obj, SKILL_GUNNER_G2, 0, skillLevel);
|
|
local totalDamage2 = sq_GetLevelData(obj, SKILL_GUNNER_G2, 1, skillLevel);
|
|
local chargeTime = sq_GetIntData(obj, SKILL_GUNNER_G2, 1);
|
|
local hitCoolTime = sq_GetIntData(obj, SKILL_GUNNER_G2, 3);
|
|
local Gset = obj.getVar("Gset").getInt(10);
|
|
local loadSlot = obj.sq_GetSkillLoad(Gset);
|
|
if(!loadSlot) return true;
|
|
local allCoolTime = loadSlot.getEndCoolTime();
|
|
local nowCoolTime = loadSlot.getCurrentCoolTime();
|
|
local lifeTime = allCoolTime - nowCoolTime + sq_GetIntData(obj, SKILL_GUNNER_G2, 2) + 150;
|
|
obj.sq_RemoveSkillLoad(Gset);
|
|
switch(Gset){
|
|
case SKILL_GUNNER_G1:
|
|
totalDamage = totalDamage * (100 + sq_GetLevelData(obj, SKILL_GUNNER_G2, 2, skillLevel)) / 100;
|
|
totalDamage2 = totalDamage * (100 + sq_GetLevelData(obj, SKILL_GUNNER_G2, 2, skillLevel)) / 100;
|
|
local G1_obj = obj.getVar("G1_obj").get_obj_vector(0);
|
|
if(G1_obj){
|
|
local colObj = sq_GetCNRDObjectToCollisionObject(G1_obj);
|
|
colObj.addSetStatePacket(23, null, STATE_PRIORITY_IGNORE_FORCE, false, "");
|
|
}
|
|
break;
|
|
case SKILL_GUNNER_G3:
|
|
totalDamage = totalDamage * (100 + sq_GetLevelData(obj, SKILL_GUNNER_G2, 3, skillLevel)) / 100;
|
|
totalDamage2 = totalDamage * (100 + sq_GetLevelData(obj, SKILL_GUNNER_G2, 3, skillLevel)) / 100;
|
|
local size = obj.getVar("G3_obj").get_obj_vector_size();
|
|
if(size > 0){
|
|
for(local i = 0; i < size; i++){
|
|
local G3_obj = obj.getVar("G3_obj").get_obj_vector(i);
|
|
if(G3_obj){
|
|
local colObj = sq_GetCNRDObjectToCollisionObject(G3_obj);
|
|
colObj.addSetStatePacket(24, null, STATE_PRIORITY_IGNORE_FORCE, false, "");
|
|
}
|
|
}
|
|
}
|
|
size = obj.getVar("G3_att_obj").get_obj_vector_size();
|
|
if(size > 0){
|
|
for(local i = 0; i < size; i++){
|
|
local G3_obj = obj.getVar("G3_att_obj").get_obj_vector(i);
|
|
if(G3_obj){
|
|
local colObj = sq_GetCNRDObjectToCollisionObject(G3_obj);
|
|
colObj.setValid(false);
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
|
|
obj.sq_AddSkillLoad(SKILL_GUNNER_G2, 18, 1, lifeTime);
|
|
loadSlot = obj.sq_GetSkillLoad(SKILL_GUNNER_G2);
|
|
obj.getVar("Gset").setInt(10, SKILL_GUNNER_G2);
|
|
loadSlot.setStartCool();
|
|
for(local i = 0; i < 3; i++){
|
|
sq_BinaryStartWrite();
|
|
sq_BinaryWriteDword(SKILL_GUNNER_G2);//skillIndex
|
|
sq_BinaryWriteDword(1);//subtype
|
|
sq_BinaryWriteDword(totalDamage);
|
|
sq_BinaryWriteDword(totalDamage2);
|
|
sq_BinaryWriteDword(chargeTime);
|
|
sq_BinaryWriteDword(hitCoolTime);
|
|
sq_BinaryWriteDword(i);
|
|
sq_BinaryWriteDword(lifeTime);
|
|
sq_SendCreatePassiveObjectPacket(obj, NUM_BYKK_PASSIVEOBJECT, 0, -75, 0, 60, obj.getDirection());
|
|
}
|
|
break;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
function onTimeEvent_G2(obj, timeEventIndex, timeEventCount)
|
|
{
|
|
if(!obj) return false;
|
|
switch(timeEventIndex){
|
|
case 0:
|
|
obj.sq_IntVectClear();
|
|
obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false);
|
|
break;
|
|
}
|
|
}
|
|
|
|
function onEndState_G2(obj, new_state)
|
|
{
|
|
if(!obj) return;
|
|
if(new_state != SKILL_GUNNER_G2){
|
|
sq_EndDrawCastGauge(obj);
|
|
}
|
|
}
|
|
|
|
|
|
function checkExecutableSkill_G3(obj)
|
|
{
|
|
if (!obj) return false;
|
|
local size = obj.getVar("G3_obj").get_obj_vector_size();
|
|
if(size > 0){
|
|
if(obj.getVar("G3_Bool").getBool(0)){
|
|
obj.getVar("G3_Bool").setBool(0, false);
|
|
obj.getVar("G3_count").setInt(10, 0);
|
|
for(local i = 0; i < size; i++){
|
|
local G3_obj = obj.getVar("G3_obj").get_obj_vector(i);
|
|
if(G3_obj){
|
|
local colObj = sq_GetCNRDObjectToCollisionObject(G3_obj);
|
|
if(colObj.getState() == 22){
|
|
obj.getVar("G3_count").setInt(10, obj.getVar("G3_count").getInt(10) + 1);
|
|
continue;
|
|
}
|
|
colObj.stopTimeEvent(13);
|
|
colObj.sq_PlaySound("G3_MOVE");
|
|
if(colObj.getState() != 24) colObj.addSetStatePacket(20, null, STATE_PRIORITY_IGNORE_FORCE, false, "");
|
|
}
|
|
}
|
|
local size2 = obj.getVar("G3_att_obj").get_obj_vector_size();
|
|
if(size2 > 0){
|
|
for(local ui = 0; ui < size2; ui++){
|
|
local G3_att_obj = obj.getVar("G3_att_obj").get_obj_vector(ui);
|
|
if(G3_att_obj){
|
|
local colObj = sq_GetCNRDObjectToCollisionObject(G3_att_obj);
|
|
colObj.setValid(false);
|
|
}
|
|
}
|
|
}
|
|
if(obj.getVar("G3_count").getInt(10) == 6){
|
|
local range = sq_GetIntData(obj, SKILL_GUNNER_G3, 4);
|
|
obj.getVar("G3_bosstar").clear_obj_vector();
|
|
obj.getVar("G3_namedtar").clear_obj_vector();
|
|
obj.getVar("G3_normaltar").clear_obj_vector();
|
|
obj.getVar("G3_tar").clear_obj_vector();
|
|
local objectManager = obj.getObjectManager();//得到對象管理器
|
|
for (local i = 0; i < objectManager.getCollisionObjectNumber(); i++){
|
|
local object = objectManager.getCollisionObject(i);//得到控制類對象
|
|
if (object && object.isObjectType(OBJECTTYPE_ACTIVE) && obj.isEnemy(object) && object.isInDamagableState(obj) && sq_Abs(sq_GetXPos(obj) - sq_GetXPos(object)) <= range && sq_Abs(sq_GetYPos(obj) - sq_GetYPos(object)) <= range / 2){
|
|
local activeObj = sq_GetCNRDObjectToActiveObject(object);
|
|
if(sq_IsBoss(activeObj)){obj.getVar("G3_bosstar").push_obj_vector(activeObj);}
|
|
else if(sq_IsNamed(activeObj)){obj.getVar("G3_namedtar").push_obj_vector(activeObj);}
|
|
else{obj.getVar("G3_normaltar").push_obj_vector(activeObj);}
|
|
}
|
|
}
|
|
if(obj.getVar("G3_bosstar").get_obj_vector_size() > 0){
|
|
for(local i = 0; i < obj.getVar("G3_bosstar").get_obj_vector_size(); i++){
|
|
local targetObj = obj.getVar("G3_bosstar").get_obj_vector(i);
|
|
obj.getVar("G3_tar").push_obj_vector(targetObj);
|
|
}
|
|
}
|
|
if(obj.getVar("G3_namedtar").get_obj_vector_size() > 0){
|
|
for(local i = 0; i < obj.getVar("G3_namedtar").get_obj_vector_size(); i++){
|
|
local targetObj = obj.getVar("G3_namedtar").get_obj_vector(i);
|
|
obj.getVar("G3_tar").push_obj_vector(targetObj);
|
|
}
|
|
}
|
|
if(obj.getVar("G3_normaltar").get_obj_vector_size() > 0){
|
|
for(local i = 0; i < obj.getVar("G3_normaltar").get_obj_vector_size(); i++){
|
|
local targetObj = obj.getVar("G3_normaltar").get_obj_vector(i);
|
|
obj.getVar("G3_tar").push_obj_vector(targetObj);
|
|
}
|
|
}
|
|
if(obj.getVar("G3_tar").get_obj_vector_size() < 1) return false;
|
|
obj.getVar("G3_Bool").setBool(0, true);
|
|
for(local i = 0; i < 6; i++){
|
|
local sub = i;
|
|
if(sq_GetLevelData(obj, SKILL_GUNNER_G3, 8, sq_GetSkillLevel(obj, SKILL_GUNNER_G3)) > 0) sub = 0;
|
|
local targetObj = obj.getVar("G3_tar").get_obj_vector(sub);
|
|
if(!targetObj) continue;
|
|
local G3_obj = obj.getVar("G3_obj").get_obj_vector(i);
|
|
if(G3_obj){
|
|
local colObj = sq_GetCNRDObjectToCollisionObject(G3_obj);
|
|
if(colObj.getState() != 22){
|
|
if(obj.getVar("G3_Bool").getBool(0) == false) obj.getVar("G3_Bool").setBool(0, true);
|
|
continue;
|
|
}
|
|
colObj.setTimeEvent(11, 400, 1, false);
|
|
colObj.sq_PlaySound("G3_MOVE");
|
|
colObj.getVar("move").setInt(10, sq_GetXPos(colObj));
|
|
colObj.getVar("move").setInt(11, sq_GetYPos(colObj));
|
|
colObj.getVar("move").setInt(12, sq_GetZPos(colObj));
|
|
colObj.getVar("move").setInt(13, sq_GetXPos(targetObj));
|
|
colObj.getVar("move").setInt(14, sq_GetYPos(targetObj));
|
|
colObj.getVar("move").setInt(15, sq_GetZPos(targetObj) + sq_GetObjectHeight(targetObj) + 60);
|
|
colObj.setTimeEvent(12, 10, 30, false);
|
|
colObj.addSetStatePacket(21, null, STATE_PRIORITY_IGNORE_FORCE, false, "");
|
|
colObj.getVar("target").clear_obj_vector();
|
|
colObj.getVar("target").push_obj_vector(targetObj);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else{
|
|
local range = sq_GetIntData(obj, SKILL_GUNNER_G3, 4);
|
|
obj.getVar("G3_bosstar").clear_obj_vector();
|
|
obj.getVar("G3_namedtar").clear_obj_vector();
|
|
obj.getVar("G3_normaltar").clear_obj_vector();
|
|
obj.getVar("G3_tar").clear_obj_vector();
|
|
local objectManager = obj.getObjectManager();//得到對象管理器
|
|
for (local i = 0; i < objectManager.getCollisionObjectNumber(); i++){
|
|
local object = objectManager.getCollisionObject(i);//得到控制類對象
|
|
if (object && object.isObjectType(OBJECTTYPE_ACTIVE) && obj.isEnemy(object) && object.isInDamagableState(obj) && sq_Abs(sq_GetXPos(obj) - sq_GetXPos(object)) <= range && sq_Abs(sq_GetYPos(obj) - sq_GetYPos(object)) <= range / 2){
|
|
local activeObj = sq_GetCNRDObjectToActiveObject(object);
|
|
if(sq_IsBoss(activeObj)){obj.getVar("G3_bosstar").push_obj_vector(activeObj);}
|
|
else if(sq_IsNamed(activeObj)){obj.getVar("G3_namedtar").push_obj_vector(activeObj);}
|
|
else{obj.getVar("G3_normaltar").push_obj_vector(activeObj);}
|
|
}
|
|
}
|
|
if(obj.getVar("G3_bosstar").get_obj_vector_size() > 0){
|
|
for(local i = 0; i < obj.getVar("G3_bosstar").get_obj_vector_size(); i++){
|
|
local targetObj = obj.getVar("G3_bosstar").get_obj_vector(i);
|
|
obj.getVar("G3_tar").push_obj_vector(targetObj);
|
|
}
|
|
}
|
|
if(obj.getVar("G3_namedtar").get_obj_vector_size() > 0){
|
|
for(local i = 0; i < obj.getVar("G3_namedtar").get_obj_vector_size(); i++){
|
|
local targetObj = obj.getVar("G3_namedtar").get_obj_vector(i);
|
|
obj.getVar("G3_tar").push_obj_vector(targetObj);
|
|
}
|
|
}
|
|
if(obj.getVar("G3_normaltar").get_obj_vector_size() > 0){
|
|
for(local i = 0; i < obj.getVar("G3_normaltar").get_obj_vector_size(); i++){
|
|
local targetObj = obj.getVar("G3_normaltar").get_obj_vector(i);
|
|
obj.getVar("G3_tar").push_obj_vector(targetObj);
|
|
}
|
|
}
|
|
if(obj.getVar("G3_tar").get_obj_vector_size() < 1) return false;
|
|
obj.getVar("G3_Bool").setBool(0, true);
|
|
for(local i = 0; i < 6; i++){
|
|
local sub = i;
|
|
if(sq_GetLevelData(obj, SKILL_GUNNER_G3, 8, sq_GetSkillLevel(obj, SKILL_GUNNER_G3)) > 0) sub = 0;
|
|
local targetObj = obj.getVar("G3_tar").get_obj_vector(sub);
|
|
if(!targetObj) continue;
|
|
local G3_obj = obj.getVar("G3_obj").get_obj_vector(i);
|
|
if(G3_obj){
|
|
local colObj = sq_GetCNRDObjectToCollisionObject(G3_obj);
|
|
if(colObj.getState() != 22){
|
|
if(obj.getVar("G3_Bool").getBool(0) == false) obj.getVar("G3_Bool").setBool(0, true);
|
|
continue;
|
|
}
|
|
colObj.setTimeEvent(11, 400, 1, false);
|
|
colObj.sq_PlaySound("G3_MOVE");
|
|
colObj.getVar("move").setInt(10, sq_GetXPos(colObj));
|
|
colObj.getVar("move").setInt(11, sq_GetYPos(colObj));
|
|
colObj.getVar("move").setInt(12, sq_GetZPos(colObj));
|
|
colObj.getVar("move").setInt(13, sq_GetXPos(targetObj));
|
|
colObj.getVar("move").setInt(14, sq_GetYPos(targetObj));
|
|
colObj.getVar("move").setInt(15, sq_GetZPos(targetObj) + sq_GetObjectHeight(targetObj) + 60);
|
|
colObj.setTimeEvent(12, 10, 30, false);
|
|
colObj.addSetStatePacket(21, null, STATE_PRIORITY_IGNORE_FORCE, false, "");
|
|
colObj.getVar("target").clear_obj_vector();
|
|
colObj.getVar("target").push_obj_vector(targetObj);
|
|
}
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
if(obj.getVar("G1_obj").get_obj_vector_size() < 1 && obj.getVar("G2_obj").get_obj_vector_size() < 1) return false;
|
|
// local Gset = obj.getVar("Gset").getInt(10);
|
|
// local loadSlot = obj.sq_GetSkillLoad(Gset);
|
|
// local nowCoolTime = loadSlot.getCurrentCoolTime();
|
|
// if(nowCoolTime <= sq_GetIntData(obj, SKILL_GUNNER_G1, 3)) return false;
|
|
local isUse = obj.sq_IsUseSkill(SKILL_GUNNER_G3);
|
|
if (isUse){
|
|
obj.sq_IntVectClear();
|
|
obj.sq_IntVectPush(0);
|
|
obj.sq_AddSetStatePacket(SKILL_GUNNER_G3, STATE_PRIORITY_USER, true);
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function checkCommandEnable_G3(obj)
|
|
{
|
|
if (!obj) return false;
|
|
return true;
|
|
}
|
|
|
|
function onSetState_G3(obj, state, datas, isResetTimer)
|
|
{
|
|
if(!obj) return;
|
|
local substate = obj.sq_GetVectorData(datas, 0);
|
|
obj.setSkillSubState(substate);
|
|
switch(substate){
|
|
case 0:
|
|
obj.sq_StopMove();
|
|
obj.sq_SetCurrentAnimation(CUSTOM_ANI_GUNNER_COMMAND);
|
|
obj.sq_PlaySound("GN_G3");
|
|
obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0);
|
|
local castTime = sq_GetCastTime(obj, SKILL_GUNNER_G3, sq_GetSkillLevel(obj, SKILL_GUNNER_G3));
|
|
obj.setTimeEvent(0, castTime, 1, false);
|
|
break;
|
|
}
|
|
}
|
|
|
|
function onEndCurrentAni_G3(obj)
|
|
{
|
|
if(!obj) return;
|
|
local substate = obj.getSkillSubState();
|
|
switch(substate){
|
|
case 1:
|
|
obj.sq_IntVectClear();
|
|
obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false);
|
|
break;
|
|
}
|
|
}
|
|
|
|
function onProcCon_G3(obj)
|
|
{
|
|
if(!obj) return;
|
|
}
|
|
|
|
function onKeyFrameFlag_G3(obj, flagIndex)
|
|
{
|
|
if(!obj) return false;
|
|
switch(flagIndex){
|
|
case 1:
|
|
local offset = [-75,0,60];
|
|
local Gset = obj.getVar("Gset").getInt(10);
|
|
local loadSlot = obj.sq_GetSkillLoad(Gset);
|
|
if(!loadSlot) return true;
|
|
local allCoolTime = loadSlot.getEndCoolTime();
|
|
local nowCoolTime = loadSlot.getCurrentCoolTime();
|
|
local lifeTime = allCoolTime - nowCoolTime + sq_GetIntData(obj, SKILL_GUNNER_G3, 2) + 150;
|
|
local skillLevel = sq_GetSkillLevel(obj, SKILL_GUNNER_G3);
|
|
local totalDamage = sq_GetLevelData(obj, SKILL_GUNNER_G3, 0, skillLevel) * (100 + sq_GetLevelData(obj, SKILL_GUNNER_G3, 2, skillLevel)) / 100;
|
|
local hitCoolTime = sq_GetIntData(obj, SKILL_GUNNER_G3, 1);
|
|
if(sq_GetLevelData(obj, SKILL_GUNNER_G3, 4, skillLevel) > 0) hitCoolTime = sq_GetLevelData(obj, SKILL_GUNNER_G3, 4, skillLevel);
|
|
switch(Gset){
|
|
case SKILL_GUNNER_G1:
|
|
if(Gset == SKILL_GUNNER_G1){
|
|
local G1_obj = obj.getVar("G1_obj").get_obj_vector(0);
|
|
if(G1_obj){
|
|
local colObj = sq_GetCNRDObjectToCollisionObject(G1_obj);
|
|
colObj.addSetStatePacket(23, null, STATE_PRIORITY_IGNORE_FORCE, false, "");
|
|
}
|
|
}
|
|
break;
|
|
case SKILL_GUNNER_G2:
|
|
offset = [50,0,75];
|
|
local size = obj.getVar("G2_obj").get_obj_vector_size();
|
|
if(size > 0){
|
|
for(local i = 0; i < size; i++){
|
|
local G2_obj = obj.getVar("G2_obj").get_obj_vector(i);
|
|
if(G2_obj){
|
|
local colObj = sq_GetCNRDObjectToCollisionObject(G2_obj);
|
|
colObj.addSetStatePacket(24, null, STATE_PRIORITY_IGNORE_FORCE, false, "");
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
obj.sq_RemoveSkillLoad(Gset);
|
|
obj.sq_AddSkillLoad(SKILL_GUNNER_G3, 20, 1, lifeTime);
|
|
loadSlot = obj.sq_GetSkillLoad(SKILL_GUNNER_G3);
|
|
obj.getVar("Gset").setInt(10, SKILL_GUNNER_G3);
|
|
loadSlot.setStartCool();
|
|
for(local i = 0; i < 6; i++){
|
|
sq_BinaryStartWrite();
|
|
sq_BinaryWriteDword(SKILL_GUNNER_G3);//skillIndex
|
|
sq_BinaryWriteDword(1);//subtype
|
|
sq_BinaryWriteDword(totalDamage);
|
|
sq_BinaryWriteDword(hitCoolTime);
|
|
sq_BinaryWriteDword(i);
|
|
sq_BinaryWriteDword(allCoolTime - nowCoolTime + sq_GetIntData(obj, SKILL_GUNNER_G3, 2) + 150);
|
|
sq_SendCreatePassiveObjectPacket(obj, NUM_BYKK_PASSIVEOBJECT, 0, offset[0], offset[1], offset[2], obj.getDirection());
|
|
}
|
|
break;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
function onTimeEvent_G3(obj, timeEventIndex, timeEventCount)
|
|
{
|
|
if(!obj) return false;
|
|
switch(timeEventIndex){
|
|
case 0:
|
|
obj.sq_IntVectClear();
|
|
obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false);
|
|
break;
|
|
}
|
|
}
|
|
|
|
function onEndState_G3(obj, new_state)
|
|
{
|
|
if(!obj) return;
|
|
if(new_state != SKILL_GUNNER_G3){
|
|
sq_EndDrawCastGauge(obj);
|
|
}
|
|
}
|
|
|
|
//男机械结束
|
|
|
|
|
|
function setCustomData_po_msc7bullet_bykk(obj, receiveData)
|
|
{
|
|
if(!obj) return;
|
|
local totalDamage = receiveData.readDword();
|
|
local sizeRate = receiveData.readDword() * 120 / 100;
|
|
local speed = receiveData.readDword();
|
|
obj.getVar("custom").setInt(1, totalDamage);
|
|
obj.getVar("custom").setInt(2, sizeRate);
|
|
obj.getVar("custom").setInt(3, speed);
|
|
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
|
|
}
|
|
|
|
function setState_po_msc7bullet_bykk(obj, state, datas)
|
|
{
|
|
if(!obj) return;
|
|
obj.getVar("state").setInt(0, state);
|
|
switch(state){
|
|
case 20:
|
|
local aniPath = "passiveobject/gunner_skl95_bykk/animation/msc7/talisman/missile_01.ani";
|
|
local ani = sq_CreateAnimation("", aniPath);
|
|
obj.setCurrentAnimation(ani);
|
|
// obj.sq_SetMoveParticle("particle/standbyreadygrenade.ptl", 0.0, 25.0);
|
|
sq_SetCustomRotate(obj, sq_ToRadian(25.0));
|
|
local speed = obj.getVar("custom").getInt(3) * 130 / 100;
|
|
local timeMax = 10 * 1300 / speed;
|
|
obj.getVar("move").setInt(0, sq_GetXPos(obj));
|
|
obj.getVar("move").setInt(1, sq_GetZPos(obj));
|
|
obj.setTimeEvent(1, timeMax, 20, true);
|
|
// if(sq_GetDirection(obj) == ENUM_DIRECTION_RIGHT) sq_SetVelocity(obj, 0, speed.tofloat());
|
|
// else sq_SetVelocity(obj, 0, -speed.tofloat());
|
|
// sq_SetVelocity(obj, 2, speed.tofloat() * 0.4);
|
|
// sq_SetSpeedToMoveParticle(obj,0,speed);
|
|
// sq_SetSpeedToMoveParticle(obj,2,0);
|
|
break;
|
|
case 21:
|
|
// sq_SetVelocity(obj, 0, 0.0);
|
|
// sq_SetVelocity(obj, 2, 0.0);
|
|
local aniPath = "passiveobject/gunner_skl95_bykk/animation/msc7/talisman/explosion_08.ani";
|
|
local ani = sq_CreateAnimation("", aniPath);
|
|
obj.setCurrentAnimation(ani);
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), obj.getVar("custom").getInt(1));
|
|
local currentAni = obj.getCurrentAnimation();
|
|
local sizeRate = obj.getVar("custom").getInt(2).tofloat() / 100.0;
|
|
currentAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
|
currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
|
|
sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate);
|
|
local pooledObj = sq_AddDrawOnlyAniFromParent(obj, "passiveobject/gunner_skl95_bykk/animation/msc7/talisman/explosion_mldrs-95missilebboombottom_00.ani", 0, 0, -sq_GetZPos(obj));
|
|
sq_ChangeDrawLayer(pooledObj, ENUM_DRAWLAYER_BOTTOM);
|
|
break;
|
|
}
|
|
}
|
|
|
|
function onEndCurrentAni_po_msc7bullet_bykk(obj)
|
|
{
|
|
if(!obj) return;
|
|
local state = obj.getVar("state").getInt(0);
|
|
if(state == 20) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
|
|
else if(state == 21) sq_SendDestroyPacketPassiveObject(obj);
|
|
}
|
|
|
|
function onTimeEvent_po_msc7bullet_bykk(obj, timeEventIndex, timeEventCount)
|
|
{
|
|
if(!obj) return;
|
|
switch(timeEventIndex){
|
|
case 1:
|
|
local base_X = obj.getVar("move").getInt(0);
|
|
local base_Z = obj.getVar("move").getInt(1);
|
|
local dstX = sq_GetDistancePos(base_X, obj.getDirection(), timeEventCount * 18);
|
|
sq_setCurrentAxisPos(obj, 0, dstX);
|
|
sq_setCurrentAxisPos(obj, 2, base_Z + timeEventCount * 7);
|
|
if(timeEventCount >= 20) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
|
|
break;
|
|
}
|
|
}
|
|
|
|
function procAppend_po_msc7bullet_bykk(obj)
|
|
{
|
|
if(!obj) return;
|
|
return;
|
|
local state = obj.getVar("state").getInt(0);
|
|
switch(state){
|
|
case 20:
|
|
local time = sq_GetObjectTime(obj);
|
|
if(time > 200 && obj.getVar().getBool(0) == false){
|
|
obj.getVar().setBool(0, true);
|
|
obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
function setCustomData_po_msc7knockbackobject(obj, receiveData)
|
|
{
|
|
if(!obj) return;
|
|
local totalDamage = receiveData.readDword();
|
|
local rateDamagerAdd = receiveData.readDword();
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
|
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
|
local rateDamager = sq_GetAttackInfoHitDelayRateDamager(attackInfo);
|
|
rateDamager = rateDamager.tofloat() * (100 + rateDamagerAdd).tofloat() / 100.0;
|
|
sq_SetAttackInfoHitDelayRateDamager(attackInfo, rateDamager);
|
|
// sq_SetCurrentAttacknBackForce(attackInfo, 1200);
|
|
}
|
|
|
|
function onEndCurrentAni_po_msc7knockbackobject(obj)
|
|
{
|
|
if(!obj) return;
|
|
sq_SendDestroyPacketPassiveObject(obj);
|
|
}
|