Rindro-Sqr/user/114.66.45.221/6_mage_10.c

2863 lines
141 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

function setCustomData_po_witch_bykk_kak(obj, receiveData)
{
if(!obj) return;
local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter());
if(!sqrChr) return;
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 SKILL_BYKK_ACIDCLOUD://魔道酸雨雲
switch(subtype){
case 1://雲
local totalDamage = receiveData.readDword();
local lifeTime = receiveData.readDword();
local hitTime = receiveData.readDword();
local successType = receiveData.readDword();
local totalDamage2 = receiveData.readDword();
local sizeRate = 100 + sq_GetLevelData(sqrChr, SKILL_BYKK_ACIDCLOUD, 6, sq_GetSkillLevel(sqrChr, SKILL_BYKK_ACIDCLOUD));
obj.getVar("custom").clear_vector();
obj.getVar("custom").push_vector(successType);
obj.getVar("custom").push_vector(lifeTime);
local lightningtime = sq_GetLevelData(sqrChr, SKILL_BYKK_ACIDCLOUD, 9, sq_GetSkillLevel(sqrChr, SKILL_BYKK_ACIDCLOUD));
if(successType >= 3){
local speedRate = sq_GetLevelData(sqrChr, SKILL_BYKK_LAPISPHILOSOPHORUM, 3, sq_GetSkillLevel(sqrChr, SKILL_BYKK_LAPISPHILOSOPHORUM));
lightningtime = (lightningtime.tofloat() * (1000.0 - speedRate.tofloat()) / 1000.0).tointeger();
}
obj.getVar("custom").push_vector(lightningtime);
obj.getVar("custom").push_vector(sizeRate);
obj.getVar("custom").push_vector(totalDamage2);
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 0));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
obj.setTimeEvent(0,lifeTime,1,false);
if(successType >= 1) obj.setTimeEvent(1,hitTime,-1,false);
else obj.setTimeEvent(1,hitTime * 2,-1,false);
obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, "");
break;
case 2://冰雨雲
local totalDamage = receiveData.readDword();
local lifeTime = receiveData.readDword();
local hitTime = receiveData.readDword();
local successType = receiveData.readDword();
local prob = receiveData.readDword();0
local level = receiveData.readDword();
local time = receiveData.readDword();
local damageRate = receiveData.readDword();
local totalDamage2 = totalDamage * damageRate / 100;
obj.getVar("custom").clear_vector();
obj.getVar("custom").push_vector(lifeTime);
obj.getVar("custom").push_vector(0);
obj.getVar("custom").push_vector(totalDamage2);
obj.getVar("custom").push_vector(prob);
obj.getVar("custom").push_vector(level);
obj.getVar("custom").push_vector(time);
obj.getVar("custom").push_vector(totalDamage);
obj.getVar("custom").push_vector(hitTime);
if(sq_GetLevelData(sqrChr, SKILL_BYKK_ACIDCLOUD, 8, sq_GetSkillLevel(sqrChr, SKILL_BYKK_ACIDCLOUD)) > 0) obj.getVar("custom").push_vector(1);
//obj.setTimeEvent(0,lifeTime,1,false);
obj.setTimeEvent(1,hitTime,-1,false);
obj.setMapFollowParent(obj.getParent());
obj.setMapFollowType(1);
sq_SetCurrentDirection(obj, ENUM_DIRECTION_RIGHT);
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
break;
case 3://雷電
local totalDamage = receiveData.readDword();
local sizeRate = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 3));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/acidcloud/thunder.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
sizeRate = sizeRate.tofloat() / 100.0;
currentAni.setImageRateFromOriginal(sizeRate, sizeRate);
currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate);
break;
case 4:
case 5:
case 6:
case 7:
if(subtype == 7){
local totalDamage = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 2));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
}
obj.getVar("custom").clear_vector();
obj.getVar("custom").push_vector(obj.getZPos());
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
break;
}
break;
case SKILL_BYKK_ANTIGRAVITYSTARTER://反重力裝置
switch(subtype){
case 1:
local totalDamage = receiveData.readDword();
local range = receiveData.readDword();
local successType = receiveData.readDword();
local totalDamage2 = receiveData.readDword();
obj.getVar("custom").clear_vector();
obj.getVar("custom").push_vector(range);
obj.getVar("custom").push_vector(successType);
obj.getVar("custom").push_vector(totalDamage2);
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 6));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
obj.setTimeEvent(1,333,1,false);
obj.setTimeEvent(2,800,1,false);
break;
case 2:
local range = receiveData.readDword();
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/magiccircle.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(10002,sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/magiccircle-aura-up1.ani"),true);
currentAni.addLayerAnimation(10002,sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/magiccircle-aura-up2.ani"),true);
currentAni.addLayerAnimation(10002,sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/magiccircle-aura-up3.ani"),true);
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/magiccircle-aura-down1.ani"),true);
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/magiccircle-aura-down2.ani"),true);
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/magiccircle-aura-down3.ani"),true);
local sizeRate = range.tofloat() / 400.0;
currentAni.setImageRateFromOriginal(sizeRate, sizeRate);//增加ani 寬度跟高度率
currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);//增加ani als附加 ani大小比例
sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM);
break;
case 3:
local totalDamage = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 7));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/antigravitystartersub.ani");
obj.setCurrentAnimation(ani);
break;
case 4:
local successType = receiveData.readDword();
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/tube-normal.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
switch(successType){
case 0:
currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/tube-failed.ani"),true);
break;
case 1:
currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/tube-success.ani"),true);
break;
case 2:
case 3:
currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/tube-success.ani"),true);
currentAni.addLayerAnimation(0,sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/tube-great.ani"),true);
break;
}
sq_SetCurrentDirection(obj, ENUM_DIRECTION_RIGHT);
break;
}
break;
case SKILL_BYKK_BLACKMANTLE://暗影鬥篷
switch(subtype){
case 1:
local ani = sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/blackmantle/001_down_n.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/blackmantle/001_up_d.ani"),true);
sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/blackmantle/002_up_n.ani",0,-1,-1);
sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/blackmantle/002_down_d.ani",0,-1,-1);
sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_COVER);
break;
case 2:
local totalDamage = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 8));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local lifeTime = receiveData.readDword();
local prob = receiveData.readDword();
local level = receiveData.readDword();
local time = receiveData.readDword();
local attackInfo = sq_GetCurrentAttackInfo(obj);
if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_BLIND, prob, level, time);
obj.setTimeEvent(0,lifeTime,1,false);
obj.setTimeEvent(1,lifeTime - 1500,1,false);
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
break;
case 3:
local lifeTime = receiveData.readDword();
obj.setTimeEvent(3,lifeTime + 480,1,false);
local totalDamage = receiveData.readDword();
local prob = receiveData.readDword();
local level = receiveData.readDword();
local time = receiveData.readDword();
local speedRate = receiveData.readDword();
obj.getVar("custom").clear_vector();
obj.getVar("custom").push_vector(totalDamage);
obj.getVar("custom").push_vector(prob);
obj.getVar("custom").push_vector(level);
obj.getVar("custom").push_vector(time);
obj.getVar("custom").push_vector(lifeTime);
obj.getVar("custom").push_vector(speedRate);
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
break;
}
break;
case SKILL_BYKK_BROOMSPIN://旋轉掃把
switch(subtype){
case 1:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/dummy.ani");
obj.setCurrentAnimation(ani);
local time = receiveData.readDword();
obj.setTimeEvent(0,time,1,false);
obj.setTimeEvent(1,50,-1,false);
sqrChr.getVar("broomspinObj").clear_obj_vector();
sqrChr.getVar("broomspinObj").push_obj_vector(obj);
local parentObj = obj.getParent();
local appendage = CNSquirrelAppendage.sq_AppendAppendage(parentObj, obj, SKILL_BYKK_BROOMSPIN, false,"Appendage/Character/ap_common_suck.nut", false);
if(appendage){
appendage.sq_SetValidTime(time);
CNSquirrelAppendage.sq_Append(appendage, parentObj, obj);
local auraAppendage = appendage.sq_getAuraMaster("broonspinAura");
if(!auraAppendage) auraAppendage = appendage.sq_AddAuraMaster("broonspinAura",parentObj, obj, 1200, 18, 5, 0);
if(auraAppendage) auraAppendage.setAttractionInfo(450, 450, 100, 100);
}
break;
case 2:
local totalDamage = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 9));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/broomspincrash/floor.ani");
obj.setCurrentAnimation(ani);
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/broomspincrash/crash.ani",0,0,0);
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/broomspincrash/over.ani",0,0,0);
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/broomspincrash/under.ani",0,0,0);
break;
}
break;
case SKILL_BYKK_ELECTRICRABBIT://光電兔
switch(subtype){
case 1:
case 4:
local successType = receiveData.readDword();
local totalDamage = receiveData.readDword();
local prob = receiveData.readDword();
local time = receiveData.readDword();
local damage = receiveData.readDword();
local level = receiveData.readDword();
local damageRate = receiveData.readDword();
obj.getVar("custom").clear_vector();
obj.getVar("custom").push_vector(successType);
obj.getVar("custom").push_vector(totalDamage);
obj.getVar("custom").push_vector(prob);
obj.getVar("custom").push_vector(time);
obj.getVar("custom").push_vector(damage);
obj.getVar("custom").push_vector(level);
obj.getVar("custom").push_vector(damageRate);
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
break;
case 2:
local successType = receiveData.readDword();
obj.getVar("custom").clear_vector();
obj.getVar("custom").push_vector(successType);
sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM);
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
break;
case 3:
local sub = receiveData.readDword();
local totalDamage = receiveData.readDword();
local aniPath = "passiveobject/witch_bykk/animation/elecrabbit/explosion/explosion_dodge.ani";
if(sub >= 1) aniPath = "passiveobject/witch_bykk/animation/elecrabbit/talisman/explosion/explosion_dodge.ani";
local ani = sq_CreateAnimation("",aniPath);
obj.setCurrentAnimation(ani);
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 10));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
obj.sq_AddObjectParticleCreater("particle/electricrabbitdestroy1.ptl");
obj.sq_AddObjectParticleCreater("particle/electricrabbitdestroy2.ptl");
obj.sq_AddObjectParticleCreater("particle/electricrabbitdestroy3.ptl");
obj.sq_AddObjectParticleCreater("particle/electricrabbitdestroy4.ptl");
obj.sq_AddObjectParticleCreater("particle/electricrabbitdestroy5.ptl");
obj.sq_AddObjectParticleCreater("particle/electricrabbitdestroy6.ptl");
obj.sq_SetObjectParticlePos(0, 0, 50);
obj.sq_PlaySound("ELETRIC_RABBIT_EXP");
break;
}
break;
case SKILL_BYKK_ENHANCEDMAGICMISSILE://改良魔法星彈
switch(subtype){
case 1:
local totalDamage = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 12));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local successType = receiveData.readDword();
local prob = receiveData.readDword();
local time = receiveData.readDword();
local damage = receiveData.readDword();
local damageRate = receiveData.readDword();
local level = receiveData.readDword();
local sub = sq_GetIntData(sqrChr, SKILL_BYKK_ENHANCEDMAGICMISSILE, 11);
obj.getVar("custom").clear_vector();
obj.getVar("custom").push_vector(successType);
obj.getVar("custom").push_vector(prob);
obj.getVar("custom").push_vector(time);
obj.getVar("custom").push_vector(damage);
obj.getVar("custom").push_vector(damageRate);
obj.getVar("custom").push_vector(level);
if(sub > 0){
obj.getVar("custom").push_vector(2);
obj.getVar("custom").push_vector(1);
}
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
break;
}
break;
case SKILL_BYKK_FLUORECOLLIDER://電鳗碰撞機
switch(subtype){
case 1:
sqrChr.getVar("fluorecollider").clear_obj_vector();
sqrChr.getVar("fluorecollider").push_obj_vector(obj);
local sub = receiveData.readDword();
local lifeTime = receiveData.readDword();
local successType = receiveData.readDword();
local hitTime = receiveData.readDword();
local totalDamage = receiveData.readDword();
local damageRate = receiveData.readDword();
local range = receiveData.readDword();
obj.getVar("custom").clear_vector();
obj.getVar("custom").push_vector(successType);
obj.getVar("custom").push_vector(range);
obj.getVar("custom").push_vector(sub);
local totalDamage2 = (totalDamage.tofloat() * damageRate.tofloat() / 100.0).tointeger();
obj.getVar("custom").push_vector(totalDamage2);
obj.getVar("custom").push_vector(lifeTime);
local friendlyfa_level = sq_GetSkillLevel(sqrChr, SKILL_BYKK_FRIENDLYFAMILIAR);
if(friendlyfa_level > 0){
local speedRate = sq_GetLevelData(sqrChr, SKILL_BYKK_FRIENDLYFAMILIAR, 8, friendlyfa_level);
obj.getVar("custom").push_vector(speedRate);
}
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 13));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
if(successType >= 2){
local skill_level = sq_GetSkillLevel(sqrChr, SKILL_BYKK_FLUORECOLLIDER);
local level = sq_GetSkillLevel(sqrChr, 174) + 20;
local prob = sq_GetLevelData(sqrChr,SKILL_BYKK_FLUORECOLLIDER, 6, skill_level) / 10;
local time = sq_GetLevelData(sqrChr,SKILL_BYKK_FLUORECOLLIDER, 8, skill_level);
local damage = sq_GetLevelData(sqrChr,SKILL_BYKK_FLUORECOLLIDER, 9, skill_level);
local attackInfo = sq_GetCurrentAttackInfo(obj);
if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_LIGHTNING, prob, level, time,damage);
}
obj.setTimeEvent(1,hitTime / 2,-1,false);
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
break;
}
break;
case SKILL_BYKK_FUSIONCRAFT://技藝融合
break;
case SKILL_BYKK_HEATINGFURNACE://爆炎加熱爐
switch(subtype){
case 1:
sqrChr.getVar("heatingfurnace").clear_obj_vector();
sqrChr.getVar("heatingfurnace").push_obj_vector(obj);
obj.getVar("custom").clear_vector();
for(local i = 0;i < 10; i++){
obj.getVar("custom").push_vector(0);
}
local Delay = receiveData.readDword();
local successType = receiveData.readDword();
local homunculus = receiveData.readDword();
obj.getVar("custom").set_vector(0,Delay);
obj.getVar("custom").set_vector(1,successType);
obj.getVar("custom").set_vector(2,homunculus);
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
break;
case 2://失敗
local aniPath = "passiveobject/witch_bykk/animation/heatingfurnace/fail_new/";//
local ani = sq_CreateAnimation("",aniPath + "heatingfurnacenewnew_39.ani");
obj.setCurrentAnimation(ani);//
local pooledObj = createOnlyDrawObject_witch_bykk(obj,aniPath + "heatingfurnacenewnew_33.ani",true,obj.getDirection(),sq_GetXPos(obj),sq_GetYPos(obj) + 1,70,ENUM_DRAWLAYER_NORMAL);
obj.setTimeEvent(0,720,1,false);
local totalDamage = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 19));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local add_hitMax = receiveData.readDword();
obj.getVar("custom").setInt(10, add_hitMax);
break;
case 3://石塊
local totalDamage = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 24));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local successType = receiveData.readDword();
obj.getVar("custom").clear_vector();
obj.getVar("custom").push_vector(successType);
local aniPath1 = "passiveobject/character/mage/animation/heatingfurnace/stone_piece_collision.ani";
if(successType >= 1) aniPath1 = "passiveobject/character/mage/animation/heatingfurnace/stone_piece_none.ani";
local ani = sq_CreateAnimation("",aniPath1);
obj.setCurrentAnimation(ani);//
local currentAni = obj.getCurrentAnimation();
local aniPath = "passiveobject/character/mage/animation/heatingfurnace/";
switch(successType){//根據生成類型附加效果
case 0:
if(sq_getRandom(1,100) >= 50) currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "stone_piece_failed1.ani"),true);
else currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "stone_piece_failed2.ani"),true);
break;
case 1:
if(sq_getRandom(1,100) >= 50){
currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "stone_piece_failed1.ani"),true);
currentAni.addLayerAnimation(2,sq_CreateAnimation("",aniPath + "stone_piece_normal1.ani"),true);
}
else{
currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "stone_piece_failed2.ani"),true);
currentAni.addLayerAnimation(2,sq_CreateAnimation("",aniPath + "stone_piece_normal2.ani"),true);
}
break;
case 2:
case 3:
if(sq_getRandom(1,100) >= 50){
currentAni.addLayerAnimation(2,sq_CreateAnimation("",aniPath + "stone_piece_great1.ani"),true);
currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "stone_piece_normal1.ani"),true);
}
else{
currentAni.addLayerAnimation(2,sq_CreateAnimation("",aniPath + "stone_piece_great2.ani"),true);
currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "stone_piece_normal2.ani"),true);
}
break;
}
local angle = receiveData.readDword();
local angleMax = receiveData.readDword();
local sub = receiveData.readDword();
local damageRate = receiveData.readDword();
local sizeRate = receiveData.readDword();
local totalDamage2 = (totalDamage.tofloat() * damageRate.tofloat() / 100.0).tointeger();
obj.getVar("custom").push_vector(totalDamage2);
obj.getVar("custom").push_vector(sizeRate);
obj.getVar("custom").push_vector(angle);
obj.getVar("custom").push_vector(angleMax);
obj.getVar("custom").push_vector(sub);
local anglea = 360 / angleMax * angle;
local speed_X = 110 + sq_getRandom(0,40);
local speed_Z = 250 + sq_getRandom(0,100);
local direction = obj.getDirection();
local tiaozheng = 0;
local tiaozheng2 = angleMax * 5;
if(sub > 0){
switch(sub){
case 1: anglea = 45;if(angle > angleMax / 4 * 3) tiaozheng = 100; break;
case 2: anglea = 90;if(angle > angleMax / 2) tiaozheng = 100; break;
case 3: anglea = 135;if(angle > angleMax / 2 && angle < angleMax / 4 * 3) tiaozheng = 100; break;
case 4: anglea = 0;if(angle < angleMax / 2 || angle > angleMax / 4 * 3) tiaozheng = 100; break;
case 6: anglea = 180;if(angle > angleMax / 2 && angle < angleMax / 4 * 3) tiaozheng = 100; break;
case 7: anglea = -45;if(angle < angleMax / 4) tiaozheng = 100; break;
case 8: anglea = -90;if(angle < angleMax / 2) tiaozheng = 100; break;
case 9: anglea = -135;if(angle > angleMax / 4 && angle < angleMax / 2) tiaozheng = 100; break;
}
}
// obj.getVar("custom").push_vector(anglea);
// obj.getVar("custom").push_vector(speed_X);
// obj.getVar("custom").push_vector(speed_Z);
// obj.getVar("custom").push_vector(sq_GetXPos(obj));
// obj.getVar("custom").push_vector(sq_GetYPos(obj));
// obj.getVar("custom").push_vector(sq_GetZPos(obj));
obj.sq_SetMoveParticle("particle/heatingfurnace_stone.ptl", (anglea).tofloat(), 0.0);
sq_SetSpeedToMoveParticle(obj,0,speed_X + tiaozheng + tiaozheng2);
sq_SetSpeedToMoveParticle(obj,1,tiaozheng * 15 / 10);
sq_SetSpeedToMoveParticle(obj,2,speed_Z);
// obj.setTimeEvent(0,10,4,false);
break;
case 4://爆炸
local ani = sq_CreateAnimation("","passiveobject/common/animation/fireexplosion.ani");
obj.setCurrentAnimation(ani);
local totalDamage = receiveData.readDword();
local successType = receiveData.readDword();
obj.sq_PlaySound("B_FIRE_EXPLOSION");
local currentAni = obj.getCurrentAnimation();//得到當前ani
local sizeRate = receiveData.readDword();
local angle = receiveData.readDword();
local angleMax = receiveData.readDword();
local sub = receiveData.readDword();
obj.getVar("custom").clear_vector();
obj.getVar("custom").push_vector(sizeRate);
if(sub > 0){
if(angle == 0){
if(successType >= 1) sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 25));
else sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 26));
totalDamage = totalDamage * angleMax;
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
obj.setTimeEvent(1, 200, 1, true);
obj.setTimeEvent(2, 50, 1, true);
obj.setTimeEvent(3, 15, 2, true);
obj.setTimeEvent(4, 100, 1, true);
}
else{
sq_SetFrameDelayTime(currentAni, 0, 50);
}
}
else if(sub == 0){
if(successType >= 1) sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 25));
else sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 26));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
obj.setTimeEvent(1, 200, 1, true);
if(successType <= 1) obj.setTimeEvent(2, 50, 1, true);
if(successType <= 1) obj.setTimeEvent(3, 15, 1, true);
if(successType <= 2) obj.setTimeEvent(4, 100, 1, true);
}
sizeRate = sizeRate.tofloat() / 100.0;
sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate);//攻擊框x y z比率
break;
case 5://尾巴
local anglea = receiveData.readDword();
local speed_X = receiveData.readDword();
local speed_Z = receiveData.readDword();
local sub = receiveData.readDword();
local aniPath1 = "passiveobject/witch_bykk/animation/heatingfurnace/",aniPath2 = "stone_tail1.ani";
switch(sub){
case 2:aniPath2 = "stone_tail2.ani"; break;
case 3:aniPath2 = "stone_tail3.ani"; break;
case 4:aniPath2 = "stone_tail4.ani"; break;
}
local ani = sq_CreateAnimation("",aniPath1 + aniPath2);
obj.setCurrentAnimation(ani);
obj.sq_SetMoveParticle("particle/heatingfurnace_stone_effcet.ptl", (anglea).tofloat(), 0.0);
sq_SetSpeedToMoveParticle(obj,0,speed_X);
sq_SetSpeedToMoveParticle(obj,2,speed_Z);
break;
case 6://護石爆炸
local totalDamage = receiveData.readDword();
totalDamage = totalDamage / 8;
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 20));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/heatingfurnace/heatburst/mk2heatburstfront_01.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/heatingfurnace/heatburst/mk2heatburstback_01.ani"),true);
obj.setTimeEvent(0,180,1,false);
break;
case 7://護石爆炸
local totalDamage = receiveData.readDword();
local sizeRate = receiveData.readDword();
local number_max = receiveData.readDword();
local speedRate = receiveData.readDword();
obj.getVar("custom").setInt(10, number_max);
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 20));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/heatingfurnace/heatburst/mk2heatburstfront_01.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/heatingfurnace/heatburst/mk2heatburstback_01.ani"),true);
obj.setTimeEvent(0,180 / speedRate * 100,1,false);
local pAni = obj.getCurrentAnimation();
sizeRate = sizeRate.tofloat() / 100.0;
pAni.setImageRateFromOriginal(sizeRate, sizeRate);//增加ani 宽度跟高度率
pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);//增加ani als附加 ani大小比例
sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate);//攻击框x y z比率
pAni.setSpeedRate(speedRate.tofloat());
break;
}
break;
case SKILL_BYKK_HOMUNCULUS://魔道學助手
switch(subtype){
case 11://光電鳗電1
local totalDamage = receiveData.readDword();
local hitMax = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 48));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local group = receiveData.readDword();
local uniqueId = receiveData.readDword();
local targetObj = sq_GetObject(sqrChr, group, uniqueId);
obj.getVar().clear_obj_vector();
obj.getVar().push_obj_vector(targetObj);
obj.setTimeEvent(0,50,hitMax,true);
break;
case 12://光電鳗電2
local totalDamage = receiveData.readDword();
local hitMax = receiveData.readDword();
local prob = receiveData.readDword();
local level = receiveData.readDword();
local time = receiveData.readDword();
local damage = receiveData.readDword();
obj.getVar().clear_vector();
obj.getVar().push_vector(totalDamage);
obj.getVar().push_vector(prob);
obj.getVar().push_vector(level);
obj.getVar().push_vector(time);
obj.getVar().push_vector(damage);
obj.setTimeEvent(1,150,hitMax,true);
break;
case 13://光電鳗電3
local ani = sq_CreateAnimation("","monster/character/mage/witch_bykk/fluore/animation/b/fluore_blightning"+sq_getRandom(1,3).tostring()+".ani");
obj.setCurrentAnimation(ani);
local totalDamage = receiveData.readDword();
local prob = receiveData.readDword();
local level = receiveData.readDword();
local time = receiveData.readDword();
local damage = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 48));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local attackInfo = sq_GetCurrentAttackInfo(obj);
if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_LIGHTNING, prob, level, time, damage);
break;
case 21://暗影夜貓攻擊1
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/fluto/skilla_attackloop_fluto.ani");
obj.setCurrentAnimation(ani);
local totalDamage = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 49));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
obj.setTimeEvent(2,50,3,false);
break;
case 22://暗影夜貓攻擊2
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/fluto/skilla_lastattack_fluto.ani");
obj.setCurrentAnimation(ani);
local totalDamage = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 50));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
break;
case 23://暗影夜貓攻擊3
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/fluto/skillb_pluto.ani");
obj.setCurrentAnimation(ani);
local totalDamage = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 52));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local prob = receiveData.readDword();
local level = receiveData.readDword();
local time = receiveData.readDword();
local attackInfo = sq_GetCurrentAttackInfo(obj);
if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_HOLD, prob, level, time);
break;
case 24:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/fluto/skilla_attackloop_fluto.ani");
obj.setCurrentAnimation(ani);
local totalDamage = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 49));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
obj.setTimeEvent(2,120,-1,false);
local group = receiveData.readDword();
local uniqueId = receiveData.readDword();
local targetObj = sq_GetObject(sqrChr, group, uniqueId);
sq_moveWithParent(targetObj, obj);
break;
case 31://冰霜雪人雲
local totalDamage = receiveData.readDword();
local hitMax = receiveData.readDword();
obj.getVar("custom").clear_vector();
obj.getVar("custom").push_vector(hitMax);
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 53));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
break;
case 32://冰霜雪人風暴
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/jackfrostaskill/skillbloop_11.ani");
obj.setCurrentAnimation(ani);
local totalDamage = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 54));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local hitMax = receiveData.readDword();
obj.getVar("custom").clear_vector();
obj.getVar("custom").push_vector(hitMax);
local prob = receiveData.readDword();
local level = receiveData.readDword();
local time = receiveData.readDword();
local attackInfo = sq_GetCurrentAttackInfo(obj);
if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_FREEZE, prob, level, time);
local group = receiveData.readDword();
local uniqueId = receiveData.readDword();
local targetObj = sq_GetObject(sqrChr, group, uniqueId);
sq_moveWithParent(targetObj, obj);
obj.setTimeEvent(2,100,-1,false);
break;
case 41://傑克爆彈
local totalDamage = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 55));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
break;
case 42:
local ani = sq_CreateAnimation("","passiveobject/common/animation/fireexplosion.ani");
obj.setCurrentAnimation(ani);
local totalDamage = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 55));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local currentAni = obj.getCurrentAnimation();
sq_SetAttackBoundingBoxSizeRate(currentAni, 1.5, 1.5, 1.5);
break;
}
break;
case SKILL_BYKK_JACKFROSTICEWATER://雪人刨冰
switch(subtype){
case 1:
local totalDamage = receiveData.readDword();
local damageRate = receiveData.readDword();
local damageRate2 = receiveData.readDword();
local sub = receiveData.readDword();
local totalDamage2 = (totalDamage.tofloat() * damageRate.tofloat() / 100.0).tointeger();
local totalDamage3 = (totalDamage.tofloat() * damageRate2.tofloat() / 100.0).tointeger();
obj.getVar("custom").clear_vector();
obj.getVar("custom").push_vector(totalDamage2);
obj.getVar("custom").push_vector(totalDamage3);
obj.getVar("custom").push_vector(sub);
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 27));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
break;
case 2:
local totalDamage = receiveData.readDword();
local sub = receiveData.readDword();
obj.getVar("custom").clear_vector();
obj.getVar("custom").push_vector(0);
obj.getVar("custom").push_vector(0);
obj.getVar("custom").push_vector(sub);
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 29));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
break;
}
break;
case SKILL_BYKK_JACKOHALLOWEEN://搗蛋傑克
switch(subtype){
case 1:
local castTime = receiveData.readDword();
obj.getVar("custom").clear_vector();
obj.getVar("custom").push_vector(castTime);
sqrChr.getVar("jackohalloween_pumpkin").clear_obj_vector();
sqrChr.getVar("jackohalloween_pumpkin").push_obj_vector(obj);
// obj.setMapFollowParent(sqrChr);
// obj.setMapFollowType(1);
local totalDamage = receiveData.readDword();
local hitTime = receiveData.readDword();
local lifeTime = receiveData.readDword();
local hitMax = receiveData.readDword();
obj.getVar("custom").setInt(11, lifeTime);
cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,0,1,0,obj.getDirection(),SKILL_BYKK_JACKOHALLOWEEN,2,totalDamage,hitTime,hitMax,0,0,0,0,0,0);
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
break;
case 2:
local parentObj = obj.getParent();
parentObj.getVar("jackohalloween_lava").clear_obj_vector();
parentObj.getVar("jackohalloween_lava").push_obj_vector(obj);
sq_moveWithParent(parentObj, obj);
// obj.setMapFollowParent(sqrChr);
// obj.setMapFollowType(1);
local totalDamage = receiveData.readDword();
local hitTime = receiveData.readDword();
local hitMax = receiveData.readDword();
obj.sq_SetMaxHitCounterPerObject(hitMax);
obj.getVar("custom").clear_vector();
obj.getVar("custom").push_vector(totalDamage);
obj.getVar("custom").push_vector(hitTime);
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
break;
}
break;
case SKILL_BYKK_LAVAPOTION://熔岩藥瓶
switch(subtype){
case 1://石塊
local totalDamage = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 33));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/lapisphilosophorumexplosion.ani");
obj.setCurrentAnimation(ani);
local sizeRate_rec = receiveData.readDword();
local currentAni = obj.getCurrentAnimation();
local sizeRate = sizeRate_rec.tofloat() / 100.0 * 1.35;
currentAni.setImageRateFromOriginal(sizeRate, sizeRate);
currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate);
break;
case 2://必定失敗爆炸
local totalDamage = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 33));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
obj.setTimeEvent(1,240,1,false);
break;
case 3://成功
local totalDamage = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 32));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local lifeTime = receiveData.readDword();
local hitTime = receiveData.readDword();
obj.setTimeEvent(2,lifeTime,1,false);
obj.setTimeEvent(3,hitTime,-1,false);
local skill_level = sq_GetSkillLevel(sqrChr, SKILL_BYKK_LAVAPOTION);
local totalDamage2 = sq_GetLevelData(sqrChr,SKILL_BYKK_LAVAPOTION, 13, skill_level);
local prob = sq_GetLevelData(sqrChr,SKILL_BYKK_LAVAPOTION, 4, skill_level) / 10;
local time = sq_GetLevelData(sqrChr,SKILL_BYKK_LAVAPOTION, 6, skill_level);
local damage = sq_GetLevelData(sqrChr,SKILL_BYKK_LAVAPOTION, 7, skill_level);
local speedRate = sq_GetLevelData(sqrChr,SKILL_BYKK_LAVAPOTION, 11, skill_level);
local jumpRate = sq_GetLevelData(sqrChr,SKILL_BYKK_LAVAPOTION, 12, skill_level);
local attackInfo = sq_GetCurrentAttackInfo(obj);
if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_BURN, prob, sq_GetSkillLevel(sqrChr, 174), time,damage);
local sizeRate = receiveData.readDword();
local successType = receiveData.readDword();
obj.getVar("custom").clear_vector();
obj.getVar("custom").push_vector(sizeRate);
obj.getVar("custom").push_vector(successType);
obj.getVar("custom").push_vector(speedRate);
obj.getVar("custom").push_vector(jumpRate);
obj.getVar("custom").push_vector(totalDamage2);
obj.getVar("targetObj").clear_obj_vector();
if(sq_GetZPos(obj) > 0){
obj.getVar("move").clear_vector();
obj.getVar("move").push_vector(sq_GetXPos(obj));
obj.getVar("move").push_vector(sq_GetZPos(obj));
obj.getVar("move").push_vector(100);
}
sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM);
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
break;
case 4:
obj.getVar("move").clear_vector();
obj.getVar("move").push_vector(sq_GetXPos(obj));
obj.getVar("move").push_vector(sq_GetYPos(obj));
obj.getVar("move").push_vector(sq_GetZPos(obj));
obj.getVar("move").push_vector(sq_getRandom(0,180));
obj.getVar("move").push_vector(sq_getRandom(0,30));
obj.getVar("move").push_vector(sq_getRandom(70,150));
obj.getVar("move").push_vector(sq_getRandom(0,1));
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
break;
}
break;
case SKILL_BYKK_LOLLIPOPCRUSH://超級棒棒糖
switch(subtype){
case 0:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/lollipopcrush/lollipopcrush.ani");
obj.setCurrentAnimation(ani);
obj.setTimeEvent(0,200,1,false);
break;
case 1:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/lollipopcrush/lollipopcrushaircast_body.ani");
obj.setCurrentAnimation(ani);
break;
case 9:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/lollipopcrush/lollipopcrushtalismanlandattack_body.ani");
obj.setCurrentAnimation(ani);
break;
case 10:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/lollipopcrush/lollipopcrushtalismanready_body.ani");
obj.setCurrentAnimation(ani);
obj.setTimeEvent(0,100,1,false);
break;
case 11:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/lollipopcrush/lollipopcrushtalismanattack_body.ani");
obj.setCurrentAnimation(ani);
break;
case 20:
local sub = receiveData.readDword();
local totalDamage = receiveData.readDword();
local level = receiveData.readDword();
local prob = receiveData.readDword();
local time = receiveData.readDword();
local damage = receiveData.readDword();
obj.getVar("custom").clear_vector();
obj.getVar("custom").push_vector(sub);
obj.getVar("custom").push_vector(totalDamage);
obj.getVar("custom").push_vector(level);
obj.getVar("custom").push_vector(prob);
obj.getVar("custom").push_vector(time);
obj.getVar("custom").push_vector(damage);
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
break;
}
if(subtype == 0 || subtype == 1 || subtype == 9 || subtype == 10 || subtype == 11){
local delayTime = receiveData.readDword();
local speedRate = 12000.0 / delayTime.tofloat();
if(subtype == 1) speedRate = 6000.0 / delayTime.tofloat();
if(subtype == 9) speedRate = 12000.0 / delayTime.tofloat();
if(subtype == 10) speedRate = 5000.0 / delayTime.tofloat();
if(subtype == 11) speedRate = 12000.0 / delayTime.tofloat();
local currentAni = obj.getCurrentAnimation();
currentAni.setSpeedRate(speedRate);
local totalDamage = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 56));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local extra_num = receiveData.readDword();
local damageRate = receiveData.readDword();
local damageRate2 = receiveData.readDword();
local sizeRate = receiveData.readDword();
print(sizeRate);
local totalDamage2 = (totalDamage.tofloat() * damageRate.tofloat() / 100.0).tointeger();
local totalDamage3 = (totalDamage.tofloat() * damageRate2.tofloat() / 100.0).tointeger();
local skill_level = sq_GetSkillLevel(sqrChr,SKILL_BYKK_LOLLIPOPCRUSH);
local blind_prob = sq_GetLevelData(sqrChr,SKILL_BYKK_LOLLIPOPCRUSH,4,skill_level);
local blind_level = sq_GetLevelData(sqrChr,SKILL_BYKK_LOLLIPOPCRUSH,5,skill_level);
local blind_time = sq_GetLevelData(sqrChr,SKILL_BYKK_LOLLIPOPCRUSH,6,skill_level);
local blind_stuckrate = sq_GetLevelData(sqrChr,SKILL_BYKK_LOLLIPOPCRUSH,8,skill_level);
local lightning_prob = sq_GetLevelData(sqrChr,SKILL_BYKK_LOLLIPOPCRUSH,10,skill_level);
local lightning_time = sq_GetLevelData(sqrChr,SKILL_BYKK_LOLLIPOPCRUSH,11,skill_level);
local lightning_damage = sq_GetLevelData(sqrChr,SKILL_BYKK_LOLLIPOPCRUSH,12,skill_level);
obj.getVar("custom").clear_vector();
obj.getVar("custom").push_vector(extra_num);
obj.getVar("custom").push_vector(totalDamage2);
obj.getVar("custom").push_vector(totalDamage3);
obj.getVar("custom").push_vector(blind_prob);
obj.getVar("custom").push_vector(blind_level);
obj.getVar("custom").push_vector(blind_time);
obj.getVar("custom").push_vector(blind_stuckrate);
obj.getVar("custom").push_vector(lightning_prob);
obj.getVar("custom").push_vector(lightning_time);
obj.getVar("custom").push_vector(lightning_damage);
local currentAni = obj.getCurrentAnimation();
sizeRate = sizeRate.tofloat() / 100.0;
sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate);
}
break;
case SKILL_BYKK_MEGADRILL://冰霜鑽孔車
switch(subtype){
case 1://失敗形態
local totalDamage = receiveData.readDword();
local damageRate = receiveData.readDword();
local sub = receiveData.readDword();
local totalDamage2 = totalDamage * damageRate / 100;
obj.getVar("custom").clear_vector();
obj.getVar("custom").push_vector(totalDamage);
obj.getVar("custom").push_vector(totalDamage2);
obj.getVar("custom").push_vector(sub);
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
break;
case 2://普通形態
case 12://普通形態
local successType = receiveData.readDword();
local moveX = receiveData.readDword();
local totalDamage = receiveData.readDword();
obj.getVar("custom").clear_vector();
obj.getVar("custom").push_vector(successType);
obj.getVar("custom").push_vector(sq_GetXPos(obj));
obj.getVar("custom").push_vector(sq_GetZPos(obj));
obj.getVar("custom").push_vector(moveX);
obj.getVar("custom").push_vector(totalDamage);
sqrChr.getVar("megadrill").clear_obj_vector();
sqrChr.getVar("megadrill").push_obj_vector(obj);
obj.setMapFollowParent(sqrChr);
obj.setMapFollowType(1);
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
break;
case 3://震蕩波
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/crashfloor.ani");
obj.setCurrentAnimation(ani);
local totalDamage = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 34));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM);
local sub = receiveData.readDword();
if(sub > 1){
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/crashcrash.ani"),true);
currentAni.addLayerAnimation(0,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/crashdust.ani"),true);
}
break;
case 4:
local Delay = receiveData.readDword();
obj.setTimeEvent(0,Delay,1,false);
break;
}
break;
case SKILL_BYKK_TRANSFORMFLAPPER://變異蒼蠅拍
switch(subtype){
case 1:
local ani = sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/transformflapper/flyflap_d1.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/transformflapper/flyflap_n1.ani"),true);
local delayTime = receiveData.readDword();
for(local i = 0; i < 11; i++){
sq_SetFrameDelayTime(currentAni, i, delayTime);
}
return;
break;
case 2:
local ani = sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/transformflapper/flyflap_d2.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/transformflapper/flyflap_n2.ani"),true);
local delayTime = receiveData.readDword();
for(local i = 0; i < 4; i++){
sq_SetFrameDelayTime(currentAni, i, delayTime);
}
return;
break;
case 3:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/transformflapperex/transformflapper.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
local delayTime = receiveData.readDword();
for(local i = 0; i < 11; i++){
sq_SetFrameDelayTime(currentAni, i, delayTime);
}
sq_moveWithParent(sqrChr, obj);
break;
case 4:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/transformflapperex/transformflapperjump.ani");
obj.setCurrentAnimation(ani);
local delayTime = receiveData.readDword();
local currentAni = obj.getCurrentAnimation();
for(local i = 0; i < 4; i++){
sq_SetFrameDelayTime(currentAni, i, delayTime);
}
sq_moveWithParent(sqrChr, obj);
break;
case 10:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/summonmonster_tau/attack1.ani");
obj.setCurrentAnimation(ani);
local delayTime = receiveData.readDword();
local totalDamage = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 42));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
return;
break;
case 11:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/summonmonster_tau/attack2.ani");
obj.setCurrentAnimation(ani);
local totalDamage = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 43));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
return;
break;
case 12:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/summonmonster_tau/tacklerun.ani");
obj.setCurrentAnimation(ani);
local totalDamage = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 44));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local group = receiveData.readDword();
local uniqueId = receiveData.readDword();
local targetObj = sq_GetObject(sqrChr, group, uniqueId);
sq_moveWithParent(targetObj, obj);
obj.setTimeEvent(0,1000,1,false);
obj.setTimeEvent(1,300,-1,false);
return;
break;
case 13:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/summonmonster_tau/earthbreakout.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(0,sq_CreateAnimation("","passiveobject/witch_bykk/animation/summonmonster_tau/earthbreakout1.ani"),true);
currentAni.addLayerAnimation(0,sq_CreateAnimation("","passiveobject/witch_bykk/animation/summonmonster_tau/earthbreakout2.ani"),true);
currentAni.addLayerAnimation(0,sq_CreateAnimation("","passiveobject/witch_bykk/animation/summonmonster_tau/earthbreakout3.ani"),true);
local totalDamage = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 45));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
return;
break;
case 14:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/summonmonster_goblin/goblin_arrow10.ani");
obj.setCurrentAnimation(ani);
obj.sq_SetMoveParticle("particle/goblin_fastthrowstone.ptl", 0.0, 0.0);
local totalDamage = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 46));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
return;
break;
case 15:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/summonmonster_goblin/dark_effect1.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(-17,sq_CreateAnimation("","passiveobject/witch_bykk/animation/summonmonster_goblin/dark_effect2.ani"),true);
local totalDamage = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 47));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local sub = receiveData.readDword();
switch(sub){
case 0: obj.sq_SetMoveParticle("particle/goblin_dagger.ptl", 0.0, 0.0); break;
case 1: obj.sq_SetMoveParticle("particle/goblin_daggerdown.ptl", 0.0, 0.0); break;
case 2: obj.sq_SetMoveParticle("particle/goblin_daggerup.ptl", 0.0, 0.0); break;
}
return;
break;
}
local totalDamage = receiveData.readDword();
local prob = receiveData.readDword();
local level = receiveData.readDword();
local time = receiveData.readDword();
local successType = receiveData.readDword();
local isSeal = receiveData.readDword();
local sizeRate = receiveData.readDword();
obj.getVar("custom").clear_vector();
obj.getVar("custom").push_vector(prob);
obj.getVar("custom").push_vector(level);
obj.getVar("custom").push_vector(time);
obj.getVar("custom").push_vector(successType);
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 41));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local attackInfo = sq_GetCurrentAttackInfo(obj);
if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_CURSE, prob, level, time);
local pAni = obj.getCurrentAnimation();
local sizeSet = (1.0+successType*0.1)*(100.0+sizeRate.tofloat())/100.0;
sq_SetAttackBoundingBoxSizeRate(pAni, sizeSet, sizeSet, sizeSet);
local skill_level = sq_GetSkillLevel(sqrChr,SKILL_BYKK_TRANSFORMFLAPPER);
local monsterprob = sq_GetLevelData(sqrChr,SKILL_BYKK_TRANSFORMFLAPPER,5,skill_level);
local monstertime = sq_GetLevelData(sqrChr,SKILL_BYKK_TRANSFORMFLAPPER,7,skill_level);
local sub_number1 = sq_GetLevelData(sqrChr,SKILL_BYKK_TRANSFORMFLAPPER,9,skill_level);
local sub_number2 = sq_GetLevelData(sqrChr,SKILL_BYKK_TRANSFORMFLAPPER,10,skill_level);
local monsterlevel = sq_GetSkillLevel(sqrChr, 174);
obj.getVar("custom").push_vector(monsterprob);
obj.getVar("custom").push_vector(monstertime);
obj.getVar("custom").push_vector(monsterlevel);
obj.getVar("custom").push_vector(isSeal);
obj.getVar("custom").push_vector(sub_number1);
obj.getVar("custom").push_vector(sub_number2);
obj.getVar("custom").push_vector(0);
break;
case SKILL_BYKK_TRANSFORMFLAPPEREX://超級蒼蠅拍
switch(subtype){
case 1:
local ani = sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/transformflapperex/flyflapex_landn.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/transformflapperex/flyflapex_landd.ani"),true);
break;
case 2:
local ani = sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/transformflapperex/flyflapex_jumpn.ani");
obj.setCurrentAnimation(ani);
// local currentAni = obj.getCurrentAnimation();
// currentAni.addLayerAnimation(-1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/transformflapperex/flyflapex_jumpd.ani"),true);
break;
case 3:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/transformflapperex/transformflapperex.ani");
obj.setCurrentAnimation(ani);
sq_moveWithParent(sqrChr, obj);
break;
case 4:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/transformflapperex/transformflapperjumpex.ani");
obj.setCurrentAnimation(ani);
sq_moveWithParent(sqrChr, obj);
break;
case 5:
local totalDamage = receiveData.readDword();
obj.getVar("custom").clear_vector();
obj.getVar("custom").push_vector(totalDamage);
obj.setTimeEvent(0,50,5,true);
local currentAni = obj.getCurrentAnimation();
sq_SetFrameDelayTime(currentAni, 0, 100);
sq_SetFrameDelayTime(currentAni, 1, 300);
return;
break;
case 6:
local totalDamage = receiveData.readDword();
//sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 41));
//sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/transformflapperex/flyflapex_land_ground_crack.ani");
obj.setCurrentAnimation(ani);
local sizeRate = receiveData.readDword();
sizeRate = sizeRate.tofloat() / 100.0;
local currentAni = obj.getCurrentAnimation();
sq_ClearAttackBox(currentAni);
currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/transformflapperex/flyflapex_land_front.ani"),true);
currentAni.setImageRateFromOriginal(sizeRate, sizeRate);//增加ani 寬度跟高度率
currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);//增加ani als附加 ani大小比例
sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate);
return;
break;
case 7:
local totalDamage = receiveData.readDword();
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 41));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/transformflapperex/flyflapex_land_ground_crack_dummy.ani");
obj.setCurrentAnimation(ani);
return;
break;
}
local delayTime = receiveData.readDword();
local totalDamage = receiveData.readDword();
local successType = receiveData.readDword();
local isSeal = receiveData.readDword();
local sizeRate = receiveData.readDword();
obj.getVar("custom").clear_vector();
obj.getVar("custom").push_vector(0);
obj.getVar("custom").push_vector(0);
obj.getVar("custom").push_vector(0);
obj.getVar("custom").push_vector(successType);
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 41));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local pAni = obj.getCurrentAnimation();
local speedRate = 98000.0 / delayTime.tofloat();
if(subtype == 2) speedRate = 36000.0 / delayTime.tofloat();
pAni.setSpeedRate(speedRate);
local sizeSet = (1.0+successType*0.1)*(100.0+sizeRate.tofloat())/100.0;
sq_SetAttackBoundingBoxSizeRate(pAni, sizeSet, sizeSet, sizeSet);
local skill_level = sq_GetSkillLevel(sqrChr,SKILL_BYKK_TRANSFORMFLAPPER);
local monsterprob = sq_GetLevelData(sqrChr,SKILL_BYKK_TRANSFORMFLAPPER,5,skill_level);
local monstertime = sq_GetLevelData(sqrChr,SKILL_BYKK_TRANSFORMFLAPPER,7,skill_level);
local sub_number1 = sq_GetLevelData(sqrChr,SKILL_BYKK_TRANSFORMFLAPPER,9,skill_level);
local sub_number2 = sq_GetLevelData(sqrChr,SKILL_BYKK_TRANSFORMFLAPPER,10,skill_level);
local monstertime = sq_GetLevelData(sqrChr,SKILL_BYKK_TRANSFORMFLAPPER,7,skill_level);
local monsterlevel = sq_GetSkillLevel(sqrChr, 174);
obj.getVar("custom").push_vector(monsterprob);
obj.getVar("custom").push_vector(monstertime);
obj.getVar("custom").push_vector(monsterlevel);
obj.getVar("custom").push_vector(isSeal);
obj.getVar("custom").push_vector(sub_number1);
obj.getVar("custom").push_vector(sub_number2);
obj.getVar("custom").push_vector(0);
break;
case SKILL_BYKK_UROBOROS://二覺
switch(subtype){
case 1://結束爆炸
local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/uroboros/explosion/disappear_body_front01.ani",0,-1,-1);
local pAni = pooledObj.getCurrentAnimation();
pAni.setSpeedRate(400.0);
obj.setTimeEvent(0,210,1,false);
local totalDamage = receiveData.readDword();
obj.getVar("custom").clear_vector();
obj.getVar("custom").push_vector(totalDamage);
break;
case 2:
local ani = sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/uroboros/attack/attackset02_center.ani");
obj.setCurrentAnimation(ani);
sqrChr.getVar("uroboros").clear_obj_vector();
sqrChr.getVar("uroboros").push_obj_vector(obj);
sq_moveWithParent(sqrChr, obj);
obj.setMapFollowParent(sqrChr);
obj.setMapFollowType(1);
local totalDamage = receiveData.readDword();
obj.getVar("custom").clear_vector();
obj.getVar("custom").push_vector(totalDamage);
local hitTime = receiveData.readDword();
obj.setTimeEvent(1,hitTime,-1,false);
break;
case 3:
local sub = receiveData.readDword();
local aniPath = "passiveobject/witch_bykk/animation/uroboros/explosion_dark_dodge.ani";
if(sub == 2) aniPath = "passiveobject/witch_bykk/animation/uroboros/explosion_fire_dodge.ani";
if(sub == 3) aniPath = "passiveobject/witch_bykk/animation/uroboros/explosion_ice_dodge.ani";
if(sub == 0) aniPath = "passiveobject/witch_bykk/animation/uroboros/explosion_light_dodge.ani";
local ani = sq_CreateAnimation("",aniPath);
obj.setCurrentAnimation(ani);
local totalDamage = receiveData.readDword();
print("totalDamage1111 = "+totalDamage);
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 40));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
obj.sq_PlaySound("R_UROBOROS_SPARK_EXP");
break;
case 4:
local Delay = receiveData.readDword();
obj.setTimeEvent(2,Delay,1,false);
break;
}
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);
//print(element_kk_fire+","+element_kk_water+","+element_kk_dark+","+element_kk_light);
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 setState_po_witch_bykk_kak(obj, state, datas)
{
if(!obj) return;
local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter());
local skillIndex = obj.getVar("skillIndex").get_vector(0);
local subtype = obj.getVar("subtype").get_vector(0);
obj.getVar("state").clear_vector();
obj.getVar("state").push_vector(state);
switch(skillIndex){
case SKILL_BYKK_ACIDCLOUD://魔道酸雨雲
switch(subtype){
case 1:
switch(state){
case 20:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/acidcloud/start_cloud.ani");
obj.setCurrentAnimation(ani);
break;
case 21:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/acidcloud/cloud.ani");
obj.setCurrentAnimation(ani);
local successType = obj.getVar("custom").get_vector(0);
local lifeTime = obj.getVar("custom").get_vector(1) - 480;
switch(successType){
case 0://失敗
sq_CreateParticle("passiveobject/witch_bykk/particle/acidrain.ptl", obj, 0, 0, 0, true, 80, 0, lifeTime / 80);
obj.setTimeEvent(3,800,1,false);
break;
case 1://成功
case 2://大成功
sq_CreateParticle("passiveobject/witch_bykk/particle/acidrain.ptl", obj, 0, 0, 0, true, 20, 0, lifeTime / 20);
obj.setTimeEvent(3,800,1,false);
if(successType >= 2) obj.setTimeEvent(2,obj.getVar("custom").get_vector(2),-1,false);
break;
}
local sizeRate = obj.getVar("custom").get_vector(3);
local currentAni = obj.getCurrentAnimation();
sizeRate = sizeRate.tofloat() / 100.0;
sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate);
break;
case 22:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/acidcloud/start.ani");
obj.setCurrentAnimation(ani);
obj.sq_PlaySound("ACIDCLOUD_CREATE");
break;
}
break;
case 2:
//sqrChr.getVar("Debug_SubState").set_vector(9,state);
switch(state){
case 20://開始
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/acidcloud/redcandy/acidcloudstart_body.ani");
obj.setCurrentAnimation(ani);
obj.sq_PlaySound("ACIDCLOUD_CREATE");
if(obj.getVar("custom").get_vector(7) > 0) obj.setTimeEvent(6, obj.getVar("custom").get_vector(0), 1, false);
break;
case 21://靜止
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/acidcloud/redcandy/acidcloudstay_body.ani");
obj.setCurrentAnimation(ani);
obj.setTimeEvent(2,100,-1,false);
break;
case 22://右移動
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/acidcloud/redcandy/acidcloudmovea_body.ani");
obj.setCurrentAnimation(ani);
obj.setTimeEvent(3,35,-1,false);
break;
case 23://左移動
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/acidcloud/redcandy/acidcloudmoveb_body.ani");
obj.setCurrentAnimation(ani);
obj.setTimeEvent(3,35,-1,false);
break;
case 24://開始攻擊
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/acidcloud/redcandy/acidcloudattackstart_body.ani");
obj.setCurrentAnimation(ani);
obj.setTimeEvent(5,obj.getVar("custom").get_vector(7) * 3,-1,false);
obj.setTimeEvent(7, obj.getVar("custom").get_vector(7), -1, false);
break;
case 25://持續攻擊
local totalDamage = obj.getVar("custom").get_vector(6);
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 1));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/acidcloud/redcandy/hailloop_00.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(10002,sq_CreateAnimation("","passiveobject/witch_bykk/animation/acidcloud/redcandy/acidcloudattackloop_body.ani"),true);
//obj.setTimeEvent(4,100,-1,false);
local prob = obj.getVar("custom").get_vector(3);
local level = obj.getVar("custom").get_vector(4);
local time = obj.getVar("custom").get_vector(5);
local attackInfo = sq_GetCurrentAttackInfo(obj);
if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_FREEZE, prob, level, time);
if(obj.getVar("custom").get_vector(7) > 0) return;
local timer = obj.getVar().get_ct_vector(0);
if(!timer){
obj.getVar().clear_ct_vector();
obj.getVar().push_ct_vector();
timer = obj.getVar().get_ct_vector(0);
}
timer.Reset();//初始化
timer.Start(10000,0);//計時開始
break;
case 26://結束攻擊
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/acidcloud/redcandy/acidcloudattackend_body.ani");
obj.setCurrentAnimation(ani);
obj.stopTimeEvent(5);
obj.stopTimeEvent(7);
if(obj.getVar("custom").get_vector(7) > 0) return;
local timer = obj.getVar().get_ct_vector(0);
if(timer){
local currentT = timer.Get();
local savetime = obj.getVar("custom").get_vector(1);
obj.getVar("custom").set_vector(1, savetime + currentT);
}
break;
case 27://結束
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/acidcloud/redcandy/acidcloudend_body.ani");
obj.setCurrentAnimation(ani);
obj.sq_PlaySound("ACIDCLOUD_DISAPPEARANCE");
break;
}
break;
case 4:
case 5:
case 6:
case 7:
switch(state){
case 20:
local aniPath = "character/mage/effect/animation/witch_bykk/acidcloud/redcandy/hailobjecta_00.ani";
if(subtype == 5) aniPath = "character/mage/effect/animation/witch_bykk/acidcloud/redcandy/hailobjectb_00.ani";
if(subtype == 6) aniPath = "character/mage/effect/animation/witch_bykk/acidcloud/redcandy/hailobjectc_00.ani";
if(subtype == 7) aniPath = "passiveobject/witch_bykk/animation/acidcloud/redcandy/hailstoneattack.ani";
local ani = sq_CreateAnimation("",aniPath);
obj.setCurrentAnimation(ani);
if(subtype == 7){
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(10002,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/acidcloud/redcandy/icefrag_00.ani"),true);
}
obj.setTimeEvent(1, 10, 35, true);
break;
case 21:
local aniPath = "character/mage/effect/animation/witch_bykk/acidcloud/redcandy/hailobjectgrounda_00.ani";
if(subtype == 5) aniPath = "character/mage/effect/animation/witch_bykk/acidcloud/redcandy/hailobjectgroundb_00.ani";
if(subtype == 6) aniPath = "character/mage/effect/animation/witch_bykk/acidcloud/redcandy/hailobjectgroundc_00.ani";
if(subtype == 7) aniPath = "character/mage/effect/animation/witch_bykk/acidcloud/redcandy/iceexplosion_01.ani";
local ani = sq_CreateAnimation("",aniPath);
obj.setCurrentAnimation(ani);
if(subtype == 4 || subtype == 5 || subtype == 6) sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/acidcloud/redcandy/hailobjectbottom_00.ani",0,-1,-1);
if(subtype == 7) sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/acidcloud/redcandy/iceexplosionbottom_00.ani",0,-1,-1);
break;
}
break;
}
break;
case SKILL_BYKK_ANTIGRAVITYSTARTER://反重力裝置
switch(subtype){
case 1:
switch(state){
case 20:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/pluto.ani");
obj.setCurrentAnimation(ani);
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/antigravity/pluto-eye.ani",0,1,1);
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/antigravity/pluto-light.ani",0,1,1);
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/antigravity/pluto-spark.ani",0,1,1);
obj.setTimeEvent(0,800,1,false);
local range = obj.getVar("custom").get_vector(0);
local sizeRate = range.tofloat() / 600.0;
local pAni = obj.getCurrentAnimation();
sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, 1.0);
pAni.setSpeedRate(150.0);
break;
case 21:
// obj.sq_PlaySound("ANTIGRAVITY_EXP");
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/endpluto_06.ani");
obj.setCurrentAnimation(ani);
local pAni = obj.getCurrentAnimation();
pAni.setSpeedRate(150.0);
// obj.sq_AddObjectParticleCreater("particle/antigravitystarterparticle-1.ptl");
// obj.sq_AddObjectParticleCreater("particle/antigravitystarterparticle-2.ptl");
break;
}
break;
}
break;
case SKILL_BYKK_BLACKMANTLE://暗影鬥篷
switch(subtype){
case 2:
switch(state){
case 20://開始
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/blackmantle/redcandy/blackmantleneofront_neonewcapefrontnormal.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/blackmantle/redcandy/blackmantleneoback_neonewcapebacknormal.ani"),true);
sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_COVER);
break;
case 21://持續
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/blackmantle/redcandy/blackmantleneofrontloop_neonewcapefrontnormal.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/blackmantle/redcandy/blackmantleneobackloop_neonewcapebacknormal.ani"),true);
break;
case 22://結束
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/blackmantle/redcandy/blackmantleneoendfrontfail_neonewcapefrontnormal.ani");
if(obj.getVar().getBool(0)) ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/blackmantle/redcandy/blackmantleneoendfrontsuccess_neonewcapefrontnormal.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
if(obj.getVar().getBool(0)) currentAni.addLayerAnimation(-1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/blackmantle/redcandy/blackmantleneoendbacksuccess_neonewcapebacknormal_02.ani"),true);
else currentAni.addLayerAnimation(-1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/blackmantle/redcandy/blackmantleneoendbackfail_neonewcapebacknormal_01.ani"),true);
break;
case 23://持續
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/blackmantle/redcandy/blackmantleneofrontloop_neonewcapefrontnormal.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
sq_ClearAttackBox(currentAni);
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/blackmantle/redcandy/blackmantleneobackloop_neonewcapebacknormal.ani"),true);
break;
}
break;
case 3:
switch(state){
case 20:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/blackmantle/redcandy/homunculus/blackmantleneohomonclouscast_fluto.ani");
obj.setCurrentAnimation(ani);
break;
case 21:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/blackmantle/redcandy/homunculus/blackmantleneohomonclousstart_fluto.ani");
obj.setCurrentAnimation(ani);
local totalDamage = obj.getVar("custom").get_vector(0);
local prob = obj.getVar("custom").get_vector(1);
local level = obj.getVar("custom").get_vector(2);
local time = obj.getVar("custom").get_vector(3);
local lifeTime = obj.getVar("custom").get_vector(4);
cearteSkillPassive_Witch_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_BLACKMANTLE,2,totalDamage,lifeTime,prob,level,time,0,0,0,1);
break;
case 22:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/blackmantle/redcandy/homunculus/blackmantleneohomonclousloop_fluto.ani");
obj.setCurrentAnimation(ani);
break;
case 23:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/blackmantle/redcandy/homunculus/blackmantleneohomonclousend_newsparkle.ani");
obj.setCurrentAnimation(ani);
break;
case 24:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/blackmantle/redcandy/homunculus/blackmantleneohomonclousdisappear_fluto.ani");
obj.setCurrentAnimation(ani);
break;
}
local pAni = obj.getCurrentAnimation();
local speedRate = obj.getVar("custom").get_vector(5);
pAni.setSpeedRate(speedRate.tofloat());
break;
}
break;
case SKILL_BYKK_BROOMSPIN://旋轉掃把
break;
case SKILL_BYKK_ELECTRICRABBIT://光電兔
switch(subtype){
case 1:
switch(state){
case 20:
local aniPath1 = "passiveobject/witch_bykk/animation/elecrabbit/start/";
local successType = obj.getVar("custom").get_vector(0);
local aniPath2 = "fail_start_elecrabbit.ani"
if(successType == 1) aniPath2 = "success_start_elecrabbit.ani";
if(successType >= 2) aniPath2 = "great_start_elecrabbit.ani";
local ani = sq_CreateAnimation("",aniPath1 + aniPath2);
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
if(successType >= 1){
switch(successType){
case 1: currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath1 + "success_thunder_02.ani"),true); break;
case 2: currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath1 + "great_thunder_02.ani"),true); break;
}
}
break;
case 21:
local aniPath1 = "passiveobject/witch_bykk/animation/elecrabbit/loop/";
local successType = obj.getVar("custom").get_vector(0);
local aniPath2 = "fail_loop_elecrabbit.ani"
if(successType == 1) aniPath2 = "success_loop_elecrabbit.ani";
if(successType >= 2) aniPath2 = "great_loop_elecrabbit.ani";
local ani = sq_CreateAnimation("",aniPath1 + aniPath2);
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
switch(successType){
case 0: currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath1 + "fail_thunder_01.ani"),true); break;
case 1: currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath1 + "success_thunder_01.ani"),true); break;
case 2: currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath1 + "great_thunder_01.ani"),true); break;
}
local totalDamage = obj.getVar("custom").get_vector(1);
local prob = obj.getVar("custom").get_vector(2);
local time = obj.getVar("custom").get_vector(3);
local damage = obj.getVar("custom").get_vector(4);
local level = obj.getVar("custom").get_vector(5);
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 9));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local attackInfo = sq_GetCurrentAttackInfo(obj);
if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_LIGHTNING, prob, level, time, damage);
obj.setTimeEvent(0,200,3,false);
obj.sq_PlaySound("ELETRIC_RABBIT_SHOCK");
break;
case 22:
local aniPath1 = "passiveobject/witch_bykk/animation/elecrabbit/end/";
local successType = obj.getVar("custom").get_vector(0);
local aniPath2 = "fail_elecrabbit.ani"
if(successType == 1) aniPath2 = "success_elecrabbit.ani";
if(successType >= 2) aniPath2 = "great_elecrabbit.ani";
local ani = sq_CreateAnimation("",aniPath1 + aniPath2);
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
switch(successType){
case 0: currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath1 + "fail_thunder_03.ani"),true); break;
case 1: currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath1 + "success_thunder_03.ani"),true); break;
case 2: currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath1 + "great_thunder_03.ani"),true); break;
}
break;
}
break;
case 2:
switch(state){
case 20:
local aniPath1 = "passiveobject/witch_bykk/animation/elecrabbit/start/";
local successType = obj.getVar("custom").get_vector(0);
local aniPath2 = "fail_ground_03.ani"
if(successType == 1) aniPath2 = "success_ground_03.ani";
if(successType >= 2) aniPath2 = "great_ground_03.ani";
local ani = sq_CreateAnimation("",aniPath1 + aniPath2);
obj.setCurrentAnimation(ani);
break;
case 21:
local aniPath1 = "passiveobject/witch_bykk/animation/elecrabbit/loop/";
local successType = obj.getVar("custom").get_vector(0);
local aniPath2 = "fail_ground_01.ani"
if(successType == 1) aniPath2 = "success_ground_01.ani";
if(successType >= 2) aniPath2 = "great_ground_01.ani";
local ani = sq_CreateAnimation("",aniPath1 + aniPath2);
obj.setCurrentAnimation(ani);
break;
case 22:
local aniPath1 = "passiveobject/witch_bykk/animation/elecrabbit/end/";
local successType = obj.getVar("custom").get_vector(0);
local aniPath2 = "fail_ground_02.ani"
if(successType == 1) aniPath2 = "success_ground_02.ani";
if(successType >= 2) aniPath2 = "great_ground_02.ani";
local ani = sq_CreateAnimation("",aniPath1 + aniPath2);
obj.setCurrentAnimation(ani);
break;
}
break;
case 4:
switch(state){
case 20:
local aniPath1 = "passiveobject/witch_bykk/animation/elecrabbit/talisman/start/";
local successType = obj.getVar("custom").get_vector(0);
local ani = sq_CreateAnimation("",aniPath1 + "success_start_elecrabbit.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath1 + "success_thunder_02.ani"),true);
break;
case 21:
local aniPath1 = "passiveobject/witch_bykk/animation/elecrabbit/talisman/loop/";
local successType = obj.getVar("custom").get_vector(0);
local ani = sq_CreateAnimation("",aniPath1 + "success_loop_elecrabbit.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath1 + "success_thunder_01.ani"),true);
local totalDamage = obj.getVar("custom").get_vector(1);
local prob = obj.getVar("custom").get_vector(2);
local time = obj.getVar("custom").get_vector(3);
local damage = obj.getVar("custom").get_vector(4);
local level = obj.getVar("custom").get_vector(5);
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 9));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local attackInfo = sq_GetCurrentAttackInfo(obj);
if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_LIGHTNING, prob, level, time, damage);
obj.setTimeEvent(0,200,3,false);
obj.sq_PlaySound("ELETRIC_RABBIT_SHOCK");
break;
case 22:
local aniPath1 = "passiveobject/witch_bykk/animation/elecrabbit/talisman/end/";
local successType = obj.getVar("custom").get_vector(0);
local ani = sq_CreateAnimation("",aniPath1 + "success_elecrabbit.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath1 + "success_thunder_03.ani"),true);
break;
}
break;
}
break;
case SKILL_BYKK_ENHANCEDMAGICMISSILE://改良魔法星彈
switch(subtype){
case 1:
switch(state){
case 20:
local aniPath = "passiveobject/witch_bykk/animation/enhancedmagicmissile/new/success_n.ani";
if(obj.getVar("custom").get_vector(0) >= 2) aniPath = "passiveobject/witch_bykk/animation/enhancedmagicmissile/new/great_n.ani";
local ani = sq_CreateAnimation("",aniPath);
obj.setCurrentAnimation(ani);
if(obj.getVar("custom").get_vector(0) >= 2)obj.getVar("targetObj").clear_obj_vector();
break;
case 21:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/enhancedmagicmissile/new/dummy.ani");
obj.setCurrentAnimation(ani);
local sub = obj.getVar("custom").get_vector(6);
obj.setTimeEvent(0,150 * (2 / (sub + 2)),2 + sub,false);
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/enhancedmagicmissile/new/bluelight_dodge0.ani",10,0,0);
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/enhancedmagicmissile/new/bluelight_dodge1.ani",10,0,0);
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/enhancedmagicmissile/new/bluelight_dodge2.ani",10,0,0);
if(obj.getVar("custom").get_vector(0) >= 2){
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/enhancedmagicmissile/new/bluelight_dodge3.ani",10,0,0);
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/enhancedmagicmissile/new/bluelight_dodge4.ani",10,0,0);
}
break;
case 22:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/enhancedmagicmissile/new/dummy.ani");
obj.setCurrentAnimation(ani);
sq_SetCustomRotate(obj, sq_ToRadian(71.08));
break;
case 23:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/enhancedmagicmissile/familiar/endfamiliar_03.ani");
obj.setCurrentAnimation(ani);
local totalDamage = sq_GetCurrentAttackBonusRate(obj);
local prob = obj.getVar("custom").get_vector(1);
local time = obj.getVar("custom").get_vector(2);
local damage = obj.getVar("custom").get_vector(3);
local damageRate = obj.getVar("custom").get_vector(4);
local level = obj.getVar("custom").get_vector(5);
totalDamage = totalDamage * damageRate / 100;
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 12));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local attackInfo = sq_GetCurrentAttackInfo(obj);
if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_LIGHTNING, prob, level, time,damage);
sq_SetCustomRotate(obj, sq_ToRadian(0.0));
local sub = obj.getVar("custom").get_vector(7);
obj.setTimeEvent(1,200 * (2/ (2 + sub)),2 + sub,false);
break;
case 24:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/enhancedmagicmissile/familiar/fail_n.ani");
obj.setCurrentAnimation(ani);
sq_SetCustomRotate(obj, sq_ToRadian(0.0));
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/enhancedmagicmissile/familiar/fail_d.ani"),true);
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/enhancedmagicmissile/familiar/fail1.ani",0,0,0);
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/enhancedmagicmissile/familiar/fail2.ani",0,0,0);
break;
}
break;
}
break;
case SKILL_BYKK_FLUORECOLLIDER://電鳗碰撞機
switch(subtype){
case 1:
local aniPath = "passiveobject/witch_bykk/animation/fluorecollider/";
switch(state){
case 20://start
local ani = sq_CreateAnimation("",aniPath + "create_body.ani");
obj.setCurrentAnimation(ani);//
local speedRate = obj.getVar("custom").get_vector(5);
local pooledObj = createOnlyDrawObject_witch_bykk(obj,aniPath + "create_area.ani",false,obj.getDirection(),sq_GetXPos(obj),sq_GetYPos(obj),0,ENUM_DRAWLAYER_BOTTOM);
local range = obj.getVar("custom").get_vector(1);
local pAni = pooledObj.getCurrentAnimation();
local sizeRate = range.tofloat() / 300.0;
pAni.setImageRateFromOriginal(sizeRate, sizeRate);
obj.getVar("effect").clear_obj_vector();
obj.getVar("effect").push_obj_vector(pooledObj);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "create_body_glow.ani"),true);
currentAni.addLayerAnimation(-1,sq_CreateAnimation("",aniPath + "create_wheel.ani"),true);
if(speedRate > 0) currentAni.setSpeedRate(100000.0 / (1000.0 - speedRate.tofloat()));
break;
case 21://loop
local ani = sq_CreateAnimation("",aniPath + "stay_body.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "stay_body_glow.ani"),true);
local successType = obj.getVar("custom").get_vector(0);
local sub = obj.getVar("custom").get_vector(2);
if(sub >= 1) currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/fluorecollider/stay_wheel_under.ani"),true);
else currentAni.addLayerAnimation(-1,sq_CreateAnimation("",aniPath + "stay_wheel_under.ani"),true);
currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "stay_wheel_over1.ani"),true);
currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "stay_wheel_over2.ani"),true);
currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "stay_wheel_spark1.ani"),true);
currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "stay_wheel_spark2.ani"),true);
currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "stay_needle1.ani"),true);
currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "stay_needle2.ani"),true);
currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "stay_needle3.ani"),true);
currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "stay_needle4.ani"),true);
currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "stay_lightning_rod.ani"),true);
currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "stay_electric.ani"),true);
switch(successType){
case 0:
if(sub == 0){
local pooledObj = createOnlyDrawObject_witch_bykk(obj,aniPath + "shock.ani",false,obj.getDirection(),sq_GetDistancePos(sq_GetXPos(obj),obj.getDirection(),-70),sq_GetYPos(obj) + 2,32,ENUM_DRAWLAYER_NORMAL);
obj.getVar("effect").push_obj_vector(pooledObj);
}
break;
case 2:
case 3:
currentAni.addLayerAnimation(2,sq_CreateAnimation("",aniPath + "stay_bulb_great.ani"),true);
currentAni.addLayerAnimation(2,sq_CreateAnimation("",aniPath + "stay_electric_great.ani"),true);
case 1:
currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "stay_bulb_success1.ani"),true);
currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "stay_bulb_success2.ani"),true);
currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "stay_electric_success.ani"),true);
break;
}
local pooledObj = createOnlyDrawObject_witch_bykk(obj,aniPath + "thunder_spark.ani",false,obj.getDirection(),sq_GetDistancePos(sq_GetXPos(obj),obj.getDirection(),10),sq_GetYPos(obj) + 1,195,ENUM_DRAWLAYER_NORMAL);
obj.getVar("effect").push_obj_vector(pooledObj);
local lifeTime = obj.getVar("custom").get_vector(4);
obj.setTimeEvent(0,lifeTime,1,false);
obj.getVar("targetObj").clear_obj_vector();
obj.setTimeEvent(2,180,-1,false);
local range = obj.getVar("custom").get_vector(1);
local sizeRate = range.tofloat() / 300.0;
sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate);
break;
case 22://end
obj.stopTimeEvent(1);
obj.stopTimeEvent(2);
local ani = sq_CreateAnimation("",aniPath + "exp.ani");
obj.setCurrentAnimation(ani);
local totalDamage = obj.getVar("custom").get_vector(3);
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 14));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
obj.sq_AddObjectParticleCreater("particle/fluorecolliderdestroy1.ptl");
obj.sq_AddObjectParticleCreater("particle/fluorecolliderdestroy2.ptl");
obj.sq_AddObjectParticleCreater("particle/fluorecolliderdestroy3.ptl");
obj.sq_SetObjectParticlePos(0, 1, 50);
local size = obj.getVar("effect").get_obj_vector_size();
for(local i = 0; i < size; i++){
local pooledObj = obj.getVar("effect").get_obj_vector(i);
if(pooledObj) pooledObj.setValid(false);
}
sq_CreateParticle("passiveobject/common/particle/lightexplosionparticle1.ptl", obj, 0, -1, 50, true, 5, 0, 2);
sq_CreateParticle("passiveobject/common/particle/lightexplosionparticle2.ptl", obj, 0, -1, 50, true, 20, 0, 4);
sq_CreateParticle("passiveobject/common/particle/lightexplosionparticle3.ptl", obj, 0, -1, 50, true, 100, 0, 16);
sq_CreateParticle("passiveobject/common/particle/lightexplosionparticle4.ptl", obj, 0, -1, 50, true, 10, 0, 2);
break;
}
break;
}
break;
case SKILL_BYKK_FUSIONCRAFT://技藝融合
break;
case SKILL_BYKK_HEATINGFURNACE://爆炎加熱爐
switch(subtype){
case 1:
local aniPath = "passiveobject/witch_bykk/animation/heatingfurnace/";
switch(state){
case 20://cast
local ani = sq_CreateAnimation("",aniPath + "body_n_startup.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "foot_n_startup.ani"),true);
if(true) currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "homunculus/foot_n_startup.ani"),true);
local Delay = obj.getVar("custom").get_vector(0);
local speedRate = 800.0 / Delay.tofloat() * 100.0;
currentAni.setSpeedRate(200.0);
break;
case 21://loop
local ani = sq_CreateAnimation("",aniPath + "body_n_loop.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "eye_n_loop.ani"),true);
currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "normal_d_up.ani"),true);
currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "foot_n_loop.ani"),true);
currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "dust.ani"),true);
if(obj.getVar("custom").get_vector(2) > 0){//助手鼓風機
currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "homunculus/foot_n_loop.ani"),true);
currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "homunculus/lanternjump.ani"),true);
}
local successType = obj.getVar("custom").get_vector(1);
if(successType >= 2){//大成功、超大成功時
currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "great_bulb.ani"),true);
currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "great_d_up_fire.ani"),true);
currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "great_d_up.ani"),true);
}
// obj.getVar("effect").clear_obj_vector();
// for(local i = 1; i < 5; i++){
// local pooledObj = createOnlyDrawObject_witch_bykk(obj,aniPath + "smoke"+i.tostring()+".ani",true,obj.getDirection(),sq_GetXPos(obj),sq_GetYPos(obj),0,ENUM_DRAWLAYER_NORMAL);
// obj.getVar("effect").push_obj_vector(pooledObj);
// }
//obj.setTimeEvent(0,6000,1,false);
break;
case 22://end
local ani = sq_CreateAnimation("","passiveobject/common/animation/fireexplosion.ani");
obj.setCurrentAnimation(ani);//
obj.sq_AddObjectParticleCreater("particle/heatingfurnacefail1.ptl");
obj.sq_AddObjectParticleCreater("particle/heatingfurnacefail2.ptl");
obj.sq_AddObjectParticleCreater("particle/heatingfurnacefail3.ptl");
obj.sq_SetObjectParticlePos(0, 1, 50);
// local size = obj.getVar("effect").get_obj_vector_size();
// for(local i = 0; i < size; i++){
// local pooledObj = obj.getVar("effect").get_obj_vector(i);
// if(pooledObj) pooledObj.setValid(false);
// }
break;
}
break;
}
break;
case SKILL_BYKK_HOMUNCULUS://魔道學助手
switch(subtype){
case 31:
switch(state){
case 20:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/jackfrostaskill/start_cloud.ani");
obj.setCurrentAnimation(ani);
break;
case 21:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/jackfrostaskill/cloud.ani");
obj.setCurrentAnimation(ani);
local hitMax = obj.getVar("custom").get_vector(0);
obj.setTimeEvent(2,150,hitMax,true);
obj.setTimeEvent(3,150*hitMax+100,1,false);
sq_CreateParticle("passiveobject/witch_bykk/particle/acidrain.ptl", obj, 0, 0, 0, true, 80, 0, (150*hitMax+100) / 80);
obj.setTimeEvent(4,800,1,false);
break;
}
break;
case 41:
switch(state){
case 20:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/lantern/launchjolstart.ani");
obj.setCurrentAnimation(ani);
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/homonculous/lantern/launchjolfirestart.ani",0,0,0);
break;
case 21:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/lantern/launchjolmove.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/lantern/launchjolfiremove.ani"),true);
obj.sq_SetMoveParticle("particle/goblin_fastthrowstone.ptl", 0.0, 0.0);
break;
}
break;
}
break;
case SKILL_BYKK_JACKFROSTICEWATER://雪人刨冰
local aniPath = "passiveobject/witch_bykk/animation/jackfrosticewater/";
local effect_aniPath = "character/mage/effect/animation/witch_bykk/jackfrosticewater/";
switch(subtype){
case 1:
switch(state){
case 20:
local aniPath1 = "start/jackfrosticewaterstartback_03.ani";
if(obj.getVar("custom").get_vector(2) > 0) aniPath1 = "start/talisman/jackfrosticewaterstartback_03.ani";
local ani = sq_CreateAnimation("",aniPath + aniPath1);
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
if(obj.getVar("custom").get_vector(2) > 0){
currentAni.addLayerAnimation(-1,sq_CreateAnimation("",effect_aniPath + "start/talisman/jackfrosticewaterstartfloor_03.ani"),true);
currentAni.addLayerAnimation(-2,sq_CreateAnimation("",effect_aniPath + "start/talisman/jackfrosticewaterstartfloortwister_01.ani"),true);
}
else{
currentAni.addLayerAnimation(-1,sq_CreateAnimation("",effect_aniPath + "start/jackfrosticewaterstartfloor_03.ani"),true);
currentAni.addLayerAnimation(-2,sq_CreateAnimation("",effect_aniPath + "start/jackfrosticewaterstartfloortwister_01.ani"),true);
}
obj.setTimeEvent(3,150,1,false);
obj.sq_PlaySound("JACKFROST_ICEWATER_START");
break;
case 21:
local aniPath1 = "loop/jackfrosticewaterloopback_01.ani";
if(obj.getVar("custom").get_vector(2) > 0) aniPath1 = "loop/talisman/jackfrosticewaterloopback_01.ani";
local ani = sq_CreateAnimation("",aniPath + aniPath1);
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(-1,sq_CreateAnimation("",effect_aniPath + "loop/jackfrosticewaterloopfloor_01.ani"),true);
if(obj.getVar("custom").get_vector(2) > 0){
currentAni.addLayerAnimation(-2,sq_CreateAnimation("",effect_aniPath + "loop/talisman/jackfrosticewaterloopfloortwister_01.ani"),true);
currentAni.addLayerAnimation(1001,sq_CreateAnimation("",effect_aniPath + "loop/talisman/jackfrosticewaterloopfront_06.ani"),true);
}
else{
currentAni.addLayerAnimation(-2,sq_CreateAnimation("",effect_aniPath + "loop/jackfrosticewaterloopfloortwister_01.ani"),true);
currentAni.addLayerAnimation(1001,sq_CreateAnimation("",effect_aniPath + "loop/jackfrosticewaterloopfront_06.ani"),true);
}
obj.setTimeEvent(0,5000,1,false);
if(obj.getVar("custom").get_vector(2) > 0) obj.setTimeEvent(4,250,-1,false);
else obj.setTimeEvent(4,500,-1,false);
break;
case 22:
obj.removeAllTimeEvent();
local totalDamage = obj.getVar("custom").get_vector(1);
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 28));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local aniPath1 = "end/jackfrosticewaterendback_03.ani";
if(obj.getVar("custom").get_vector(2) > 0) aniPath1 = "end/talisman/jackfrosticewaterendback_03.ani";
local ani = sq_CreateAnimation("",aniPath + aniPath1);
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(-1,sq_CreateAnimation("",effect_aniPath + "end/jackfrosticewaterendfloor_01.ani"),true);
currentAni.addLayerAnimation(-2,sq_CreateAnimation("",effect_aniPath + "end/jackfrosticewaterendfloortwister_01.ani"),true);
currentAni.addLayerAnimation(1001,sq_CreateAnimation("",effect_aniPath + "end/jackfrosticewaterendfront_10.ani"),true);
local parentObj = obj.getParent();
if(!parentObj) break;
CNSquirrelAppendage.sq_RemoveAppendage(parentObj, "appendage/character/ap_common_suck.nut");
//obj.sq_PlaySound("JACKFROST_ICEWATER_EXP");
break;
}
break;
case 2:
switch(state){
case 20:
local aniPath1 = "start/jackfrosticewaterstartparticle_08.ani";
if(obj.getVar("custom").get_vector(2) > 0) aniPath1 = "start/talisman/jackfrosticewaterstartparticle_08.ani";
local ani = sq_CreateAnimation("",aniPath + aniPath1);
obj.setCurrentAnimation(ani);
obj.setTimeEvent(3,150,1,false);
local currentAni = obj.getCurrentAnimation();
break;
case 21:
local aniPath1 = "loop/jackfrosticewaterloopparticle_01.ani";
if(obj.getVar("custom").get_vector(2) > 0) aniPath1 = "loop/talisman/jackfrosticewaterloopparticle_01.ani";
local ani = sq_CreateAnimation("",aniPath + aniPath1);
obj.setCurrentAnimation(ani);
obj.setTimeEvent(0,4500,1,false);
local currentAni = obj.getCurrentAnimation();
break;
case 22:
local aniPath1 = "end/jackfrosticewaterendparticle_12.ani";
if(obj.getVar("custom").get_vector(2) > 0) aniPath1 = "end/talisman/jackfrosticewaterendparticle_12.ani";
local ani = sq_CreateAnimation("",aniPath + aniPath1);
obj.setCurrentAnimation(ani);
break;
}
break;
}
break;
case SKILL_BYKK_JACKOHALLOWEEN://搗蛋傑克
local aniPath = "passiveobject/witch_bykk/animation/jackohalloween/";
local effect_aniPath = "character/mage/effect/animation/witch_bykk/jackohalloween/";
switch(subtype){
case 1:
switch(state){
case 20:
local ani = sq_CreateAnimation("",aniPath + "jackohalloweenready.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
local castAniTime = currentAni.getDelaySum(false);
local castTime = obj.getVar("custom").get_vector(0);
local speedRate = castAniTime.tofloat() / castTime.tofloat() * 100.0;
//print(speedRate);
currentAni.setSpeedRate(speedRate);
break;
case 21:
if(obj.isExistTimeEvent(3)) obj.stopTimeEvent(3);
local ani = sq_CreateAnimation("",aniPath + "jackohalloweenstart_12.ani");
obj.setCurrentAnimation(ani);
sq_AddDrawOnlyAniFromParent(obj,aniPath + "jackohalloweenstart_00.ani",0,-1,0);
sq_AddDrawOnlyAniFromParent(obj,aniPath + "jackohalloweenstart_13.ani",0,1,0);
sq_AddDrawOnlyAniFromParent(obj,aniPath + "jackohalloweenstart_14.ani",0,1,0);
sq_AddDrawOnlyAniFromParent(obj,aniPath + "jackohalloweenstart_20.ani",0,1,0);
sq_AddDrawOnlyAniFromParent(obj,aniPath + "jackohalloweenstart_21.ani",0,1,0);
sq_AddDrawOnlyAniFromParent(obj,aniPath + "jackohalloweenstart_30.ani",0,1,0);
sq_AddDrawOnlyAniFromParent(obj,aniPath + "jackohalloweenstart_31.ani",0,1,0);
sq_AddDrawOnlyAniFromParent(obj,aniPath + "jackohalloweenstart_32.ani",0,1,0);
sq_AddDrawOnlyAniFromParent(obj,aniPath + "jackohalloweenstart_33.ani",0,1,0);
sq_AddDrawOnlyAniFromParent(obj,aniPath + "jackohalloweenstart_37.ani",0,1,0);
sq_AddDrawOnlyAniFromParent(obj,aniPath + "jackohalloweenstart_38.ani",0,1,0);
break;
case 22:
local ani = sq_CreateAnimation("",aniPath + "jackohalloweenlavaspitstarta_jackohollween.ani");
obj.setCurrentAnimation(ani);
obj.setTimeEvent(0, obj.getVar("custom").getInt(11), 1, false);
if(obj.getVar().getBool(0)){
local lava_Obj = obj.getVar("jackohalloween_lava").get_obj_vector(0);
if(lava_Obj){
local colObj = sq_GetCNRDObjectToCollisionObject(lava_Obj);
colObj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
}
}
break;
case 23:
local ani = sq_CreateAnimation("",aniPath + "jackohalloweenlavaspitstartb_jackohollween.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "jackohalloweenlavaspitstartb_fire015_01.ani"),true);
local lava_Obj = obj.getVar("jackohalloween_lava").get_obj_vector(0);
if(lava_Obj){
local colObj = sq_GetCNRDObjectToCollisionObject(lava_Obj);
colObj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
}
break;
case 24:
local ani = sq_CreateAnimation("",aniPath + "jackohalloweenlavaspitloop_00.ani");
obj.setCurrentAnimation(ani);
obj.setTimeEvent(3,1000,1,false);
break;
case 25:
if(obj.isExistTimeEvent(3)) obj.stopTimeEvent(3);
local ani = sq_CreateAnimation("",aniPath + "jackohalloweenlavaspitend_jackohollween.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "jackohalloweenlavaspitend_fire015_01.ani"),true);
local lava_Obj = obj.getVar("jackohalloween_lava").get_obj_vector(0);
if(lava_Obj){
local colObj = sq_GetCNRDObjectToCollisionObject(lava_Obj);
colObj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, "");
}
break;
case 26:
local ani = sq_CreateAnimation("",aniPath + "jackoholloweenend_jackohollween.ani");
obj.setCurrentAnimation(ani);
break;
}
break;
case 2:
switch(state){
case 20://wait
obj.removeAllTimeEvent();
local ani = sq_CreateAnimation("",aniPath + "magma/jackohalloweenlava_wait.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.setLoop(true);
local parentObj = obj.getParent();
sq_SetCurrentDirection(obj, parentObj.getDirection());
sq_setCurrentAxisPos(obj, 1, sq_GetYPos(parentObj));
obj.sq_PlaySound("JACKOHALLOWEEN_FIRE");
break;
case 21://start
local ani = sq_CreateAnimation("",aniPath + "magma/jackohalloweenlava_start.ani");
obj.setCurrentAnimation(ani);
obj.setTimeEvent(1,300,1,false);
local totalDamage = obj.getVar("custom").get_vector(0);
local hitTime = obj.getVar("custom").get_vector(1);
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 30));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
obj.setTimeEvent(4,hitTime,-1,false);
obj.sq_PlaySound("JACKOHALLOWEEN_FIRE_LOOP_START");
break;
case 22://loop
local ani = sq_CreateAnimation("",aniPath + "magma/jackohalloweenlava_loop.ani");
obj.setCurrentAnimation(ani);
obj.setTimeEvent(5,500,-1,true);
break;
case 23://end
obj.removeAllTimeEvent();
local ani = sq_CreateAnimation("",aniPath + "magma/jackohalloweenlava_end.ani");
obj.setCurrentAnimation(ani);
obj.sq_PlaySound("JACKOHALLOWEEN_FIRE_LOOP_END");
break;
}
break;
}
break;
case SKILL_BYKK_LAVAPOTION://熔岩藥瓶
switch(subtype){
case 4:
switch(state){
case 20:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/heatingfurnace/stone_piece_normal2.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(2,sq_CreateAnimation("","passiveobject/witch_bykk/animation/heatingfurnace/stone_piece_great2.ani"),true);
break;
case 21:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/heatingfurnace/stone_piece_normal2.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(2,sq_CreateAnimation("","passiveobject/witch_bykk/animation/heatingfurnace/stone_piece_great2.ani"),true);
break;
case 22:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/heatingfurnace/stone_piece_normal_break.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(2,sq_CreateAnimation("","passiveobject/witch_bykk/animation/heatingfurnace/stone_piece_great_break.ani"),true);
sq_CreateParticle("passiveobject/character/mage/particle/lavapotionfireexplosionparticle1.ptl", obj, 0, 1, 1, true, 5, 0, 2);
sq_CreateParticle("passiveobject/character/mage/particle/lavapotionfireexplosionparticle2.ptl", obj, 0, 1, 1, true, 20, 0, 4);
sq_CreateParticle("passiveobject/character/mage/particle/lavapotionfireexplosionparticle3.ptl", obj, 0, 1, 1, true, 100, 0, 16);
sq_CreateParticle("passiveobject/character/mage/particle/lavapotionfireexplosionparticle4.ptl", obj, 0, 1, 1, true, 10, 0, 2);
break;
}
break;
case 3:
switch(state){
case 20:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/lavapotionair_fall.ani");
obj.setCurrentAnimation(ani);
break;
case 21:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/start_d_up.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/start_n_down.ani"),true);
currentAni.addLayerAnimation(0,sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/02_d_up.ani"),false);
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/02_n_down.ani"),false);
break;
case 22:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/loop_n_down.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/loop_d_up.ani"),true);
currentAni.addLayerAnimation(0,sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/loop_02_d_up.ani"),true);
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/loop_02_n_down.ani"),true);
if(obj.getVar("custom").get_vector(1) >= 3) obj.setTimeEvent(4,300,-1,false);
break;
case 23:
if(obj.isExistTimeEvent(4)) obj.stopTimeEvent(4);
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/end_d_up.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/end_n_down.ani"),true);
currentAni.addLayerAnimation(0,sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/end_02_d_up.ani"),true);
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/end_02_n_down.ani"),true);
break;
}
if(state != 20){
local currentAni = obj.getCurrentAnimation();
local tiaozheng = 1.0;
if(obj.getVar("custom").get_vector(1) >= 2) tiaozheng = 1.35
local sizeRate = obj.getVar("custom").get_vector(0).tofloat() / 100.0 * tiaozheng;
currentAni.setImageRateFromOriginal(sizeRate, sizeRate);
currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate);
}
break;
}
break;
case SKILL_BYKK_MEGADRILL://冰霜鑽孔車
switch(subtype){
case 1://失敗形態
switch(state){
case 20:
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/dummy.ani");
obj.setCurrentAnimation(ani);
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/megadrill/familiar/fail_n.ani",-150,0,180);
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/megadrill/familiar/fail_d.ani",-150,-1,179);
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/megadrill/familiar/fail1.ani",-150,2,182);
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/megadrill/familiar/fail2.ani",-150,1,181);
local currentAni = obj.getCurrentAnimation();
sq_SetFrameDelayTime(currentAni, 0, 230);
sq_SetFrameDelayTime(currentAni, 1, 230);
break;
case 21://35
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/fail/megadrillfailstart_57.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/fail/megadrillfailstart_48.ani"),true);
// print(currentAni.getDelaySum(false));
local totalDamage = obj.getVar("custom").get_vector(0);
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 35));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
obj.setTimeEvent(0,1400,1,false);
obj.setTimeEvent(1,500,1,false);
obj.setTimeEvent(2,50,-1,false);
obj.setTimeEvent(3,300,1,false);
break;
case 22://36
obj.stopTimeEvent(2);
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/fail/megadrillfailend_07.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/fail/megadrillfailendbttom_01.ani"),true);
local totalDamage = obj.getVar("custom").get_vector(1);
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 36));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
if(obj.getVar("custom").get_vector(2) > 0){
local parentObj = obj.getParent();
if(!parentObj) break;
CNSquirrelAppendage.sq_RemoveAppendage(parentObj, "appendage/character/ap_common_suck.nut");
}
break;
}
break;
case 2://普通形態
switch(state){
case 20://動畫
local successType = obj.getVar("custom").get_vector(0);
local aniPath = "passiveobject/witch_bykk/animation/megadrill/familiar/success_n.ani";
if(successType >= 2) aniPath = "passiveobject/witch_bykk/animation/megadrill/familiar/great_n.ani";
local ani = sq_CreateAnimation("",aniPath);
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
if(successType == 1) currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/familiar/success_d.ani"),true);
else{
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/familiar/great_d.ani"),true);
currentAni.addLayerAnimation(2,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/familiar/great1.ani"),true);
currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/familiar/great2.ani"),true);
}
break;
case 21://生成
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/appear.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
local successType = obj.getVar("custom").get_vector(0);
switch(successType){
case 1:
currentAni.addLayerAnimation(0,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/appeardrillsuccess.ani"),true);
currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/appearglowsuccess.ani"),true);
break;
case 2:
currentAni.addLayerAnimation(0,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/appeardrillgreat.ani"),true);
currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/appearglowgreat.ani"),true);
break;
}
break;
case 22://停止狀態
case 23://前進狀態
case 24://後退狀態
obj.getVar().setBool(0,false);
obj.sq_PlaySound("MEGA_DRILL_LOOP",1001);
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/move.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.setLoop(true);
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/body.ani"),true);
currentAni.addLayerAnimation(10,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/bodycover.ani"),true);
local successType = obj.getVar("custom").get_vector(0);
switch(successType){
case 1:
currentAni.addLayerAnimation(1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/drillsuccess.ani"),true);
currentAni.addLayerAnimation(1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/pistonsuccess.ani"),true);
currentAni.addLayerAnimation(3,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/glowsuccess.ani"),true);
break;
case 2:
currentAni.addLayerAnimation(1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/drillgreat1.ani"),true);
currentAni.addLayerAnimation(2,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/drillgreat2.ani"),true);
currentAni.addLayerAnimation(3,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/drillgreat3.ani"),true);
currentAni.addLayerAnimation(1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/pistongreat.ani"),true);
currentAni.addLayerAnimation(3,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/glowgreat.ani"),true);
break;
}
switch(state){
case 22:
currentAni.addLayerAnimation(10001,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/stop_wheel1.ani"),true);
currentAni.addLayerAnimation(10002,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/stop_wheel2.ani"),true);
currentAni.addLayerAnimation(10001,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/stop_wheel3.ani"),true);
obj.stopTimeEvent(0);
break;
case 23:
currentAni.addLayerAnimation(10001,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/wheel1.ani"),true);
currentAni.addLayerAnimation(10002,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/wheel2.ani"),true);
currentAni.addLayerAnimation(10001,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/wheel3.ani"),true);
obj.setTimeEvent(0,400,-1,true);
break;
case 24:
currentAni.addLayerAnimation(10001,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/backwheel1.ani"),true);
currentAni.addLayerAnimation(10002,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/backwheel2.ani"),true);
currentAni.addLayerAnimation(10001,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/backwheel3.ani"),true);
obj.setTimeEvent(0,400,-1,true);
break;
}
break;
case 25://爆炸
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/explosion.ani");
obj.setCurrentAnimation(ani);
obj.removeAllTimeEvent();
obj.stopSound(1001);
obj.sq_PlaySound("MEGA_DRILL_ICEEXP");
local totalDamage = obj.getVar("custom").get_vector(4);
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 37));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
obj.setTimeEvent(3,80,2,false);
obj.setTimeEvent(4,80,1,true);
obj.setTimeEvent(5,80,1,true);
obj.setTimeEvent(6,80,1,true);
obj.setTimeEvent(7,80,1,true);
sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy0.ptl", obj, -50,0,20, true, 30, 0, 1);
sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy1.ptl", obj, 0,0,50, true, 30, 0, 1);
sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy2.ptl", obj, 0,0,50, true, 30, 0, 1);
sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy3.ptl", obj, 0,0,50, true, 30, 0, 1);
sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy4.ptl", obj, 0,0,50, true, 30, 0, 1);
sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy5.ptl", obj, 0,0,50, true, 30, 0, 2);
sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy6.ptl", obj, 0,0,50, true, 30, 0, 2);
break;
}
break;
case 12://助手形態
switch(state){
case 20://動畫
local successType = obj.getVar("custom").get_vector(0);
local aniPath = "passiveobject/witch_bykk/animation/megadrill/familiar/success_n.ani";
if(successType >= 2) aniPath = "passiveobject/witch_bykk/animation/megadrill/familiar/great_n.ani";
local ani = sq_CreateAnimation("",aniPath);
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
if(successType == 1) currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/familiar/success_d.ani"),true);
else{
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/familiar/great_d.ani"),true);
currentAni.addLayerAnimation(2,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/familiar/great1.ani"),true);
currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/familiar/great2.ani"),true);
}
break;
case 21://生成
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/appear.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
local successType = obj.getVar("custom").get_vector(0);
switch(successType){
case 1:
currentAni.addLayerAnimation(0,sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/appeardrillsuccess.ani"),true);
currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/appearglowsuccess.ani"),true);
break;
case 2:
currentAni.addLayerAnimation(0,sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/appeardrillgreat.ani"),true);
currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/appearglowgreat.ani"),true);
break;
}
obj.setTimeEvent(1,500,-1,false);
break;
case 22://停止狀態
case 23://前進狀態
case 24://後退狀態
obj.getVar().setBool(0,false);
obj.sq_PlaySound("MEGA_DRILL_LOOP",1001);
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/move.ani");
obj.setCurrentAnimation(ani);
local currentAni = obj.getCurrentAnimation();
currentAni.setLoop(true);
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/body.ani"),true);
currentAni.addLayerAnimation(10,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/bodycover.ani"),true);
//
local successType = obj.getVar("custom").get_vector(0);
switch(successType){
case 1:
currentAni.addLayerAnimation(1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/drillsuccess.ani"),true);
currentAni.addLayerAnimation(1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/pistonsuccess.ani"),true);
currentAni.addLayerAnimation(3,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/glowsuccess.ani"),true);
break;
case 2:
currentAni.addLayerAnimation(1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/drillgreat1.ani"),true);
currentAni.addLayerAnimation(2,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/drillgreat2.ani"),true);
currentAni.addLayerAnimation(3,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/drillgreat3.ani"),true);
currentAni.addLayerAnimation(1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/pistongreat.ani"),true);
currentAni.addLayerAnimation(3,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/glowgreat.ani"),true);
currentAni.addLayerAnimation(4,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/lightgreat1.ani"),true);
currentAni.addLayerAnimation(5,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/lightgreat2.ani"),true);
break;
}
switch(state){
case 22:
currentAni.addLayerAnimation(10001,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/stop_wheel1.ani"),true);
currentAni.addLayerAnimation(10002,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/stop_wheel2.ani"),true);
currentAni.addLayerAnimation(10001,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/stop_wheel3.ani"),true);
obj.stopTimeEvent(0);
break;
case 23:
currentAni.addLayerAnimation(10001,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/wheel1.ani"),true);
currentAni.addLayerAnimation(10002,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/wheel2.ani"),true);
currentAni.addLayerAnimation(10001,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/wheel3.ani"),true);
obj.setTimeEvent(0,400,-1,true);
break;
case 24:
currentAni.addLayerAnimation(10001,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/backwheel1.ani"),true);
currentAni.addLayerAnimation(10002,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/backwheel2.ani"),true);
currentAni.addLayerAnimation(10001,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/backwheel3.ani"),true);
obj.setTimeEvent(0,400,-1,true);
break;
}
break;
case 25://爆炸
local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/explosion.ani");
obj.setCurrentAnimation(ani);
obj.removeAllTimeEvent();
obj.stopSound(1001);
obj.sq_PlaySound("MEGA_DRILL_ICEEXP");
local totalDamage = obj.getVar("custom").get_vector(4);
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 37));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
obj.setTimeEvent(3,80,2,false);
obj.setTimeEvent(4,80,1,true);
obj.setTimeEvent(5,80,1,true);
obj.setTimeEvent(6,80,1,true);
obj.setTimeEvent(7,80,1,true);
sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy0.ptl", obj, -50,0,20, true, 30, 0, 1);
sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy1.ptl", obj, 0,0,50, true, 30, 0, 1);
sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy2.ptl", obj, 0,0,50, true, 30, 0, 1);
sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy3.ptl", obj, 0,0,50, true, 30, 0, 1);
sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy4.ptl", obj, 0,0,50, true, 30, 0, 1);
sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy5.ptl", obj, 0,0,50, true, 30, 0, 2);
sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy6.ptl", obj, 0,0,50, true, 30, 0, 2);
sq_CreateParticle("character/mage/effect/animation/witch_bykk/homonculous/megadrill/jackfrost/megadrilldestroy0.ptl", obj, 0,0,75, true, 30, 0, 1);
break;
}
break;
}
break;
case SKILL_BYKK_UROBOROS://二覺
break;
case SKILL_BYKK_LOLLIPOPCRUSH://超級棒棒糖
switch(subtype){
case 20:
switch(state){
case 20:
local aniPath1 = "passiveobject/witch_bykk/animation/lollipopcrush/";
local aniPath2 = "whitestart_dw_start.ani";
local sub = obj.getVar("custom").get_vector(0);
if(sub == 1) aniPath2 = "blackstart_d_start.ani";
else if(sub == 2) aniPath2 = "bosestart_start.ani";
local ani = sq_CreateAnimation("",aniPath1 + aniPath2);
obj.setCurrentAnimation(ani);
break;
case 21:
local aniPath1 = "passiveobject/witch_bykk/animation/lollipopcrush/";
local aniPath2 = "whiteloop_dw_body.ani";
local sub = obj.getVar("custom").get_vector(0);
if(sub == 1) aniPath2 = "blackloop_db_body.ani";
else if(sub == 2) aniPath2 = "boseloop_body.ani";
local ani = sq_CreateAnimation("",aniPath1 + aniPath2);
obj.setCurrentAnimation(ani);
obj.setTimeEvent(0,1000,1,false);
obj.setTimeEvent(1,500,1,false);
break;
case 22:
obj.stopTimeEvent(0);
local aniPath1 = "passiveobject/witch_bykk/animation/lollipopcrush/";
local aniPath2 = "whiteend_dw_boom.ani",attackIndex = 57;
local sub = obj.getVar("custom").get_vector(0);
if(sub == 1){aniPath2 = "blackend_db_boomback.ani";attackIndex = 58;}
else if(sub == 2){aniPath2 = "boseend_back.ani";attackIndex = 58;}
local ani = sq_CreateAnimation("",aniPath1 + aniPath2);
obj.setCurrentAnimation(ani);
local totalDamage = obj.getVar("custom").get_vector(1);
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, attackIndex));
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
local level = obj.getVar("custom").get_vector(2);
local prob = obj.getVar("custom").get_vector(3);
local time = obj.getVar("custom").get_vector(4);
local damage = obj.getVar("custom").get_vector(5);
switch(sub){
case 0:
local attackInfo = sq_GetCurrentAttackInfo(obj);
if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_LIGHTNING, prob, level, time, damage);
break;
case 1:
case 2:
local attackInfo = sq_GetCurrentAttackInfo(obj);
if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_BLIND, prob, level, time);
break;
}
break;
}
break;
}
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 onEndCurrentAni_po_witch_bykk_kak(obj)
{
if(!obj) return;
local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter());
local skillIndex = obj.getVar("skillIndex").get_vector(0);
local subtype = obj.getVar("subtype").get_vector(0);
local state = obj.getVar("state").get_vector(0);
switch(skillIndex){
case SKILL_BYKK_ACIDCLOUD://魔道酸雨雲
switch(subtype){
case 1:
switch(state){
case 20:
obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
break;
case 22:
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
break;
}
break;
case 2:
switch(state){
case 20:
case 24:
obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, "");
break;
case 26:
if(obj.getVar().getBool(0)) obj.addSetStatePacket(27, null, STATE_PRIORITY_AUTO, false, "");
else obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
break;
case 27:
sq_SendDestroyPacketPassiveObject(obj);
break;
}
break;
case 3:
sq_SendDestroyPacketPassiveObject(obj);
break;
case 4:
case 5:
case 6:
case 7:
switch(state){
case 21:
sq_SendDestroyPacketPassiveObject(obj);
break;
}
break;
}
break;
case SKILL_BYKK_ANTIGRAVITYSTARTER://反重力裝置
switch(subtype){
case 1:
switch(state){
case 20:
obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
break;
case 21:
obj.removeAllTimeEvent();
local size = obj.getVar("targetObj").get_obj_vector_size();
for(local i = 0; i < size; i++){
local damager = sq_GetCNRDObjectToActiveObject(obj.getVar("targetObj").get_obj_vector(i));
if(damager || damager.getState() != STATE_DIE) damager.getVar("anti").setBool(0,false);
}
sq_SendDestroyPacketPassiveObject(obj);
break;
}
break;
case 2:
case 3:
case 4:
sq_SendDestroyPacketPassiveObject(obj);
break;
}
break;
case SKILL_BYKK_BLACKMANTLE://暗影鬥篷
switch(subtype){
case 1:
sq_SendDestroyPacketPassiveObject(obj);
break;
case 2:
switch(state){
case 20:
obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, "");
break;
case 22:
sq_SendDestroyPacketPassiveObject(obj);
break;
}
break;
case 3:
switch(state){
case 20:
case 21:
case 23:
obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, "");
break;
case 24:
sq_SendDestroyPacketPassiveObject(obj);
break;
}
break;
}
break;
case SKILL_BYKK_BROOMSPIN://旋轉掃把
break;
case SKILL_BYKK_ELECTRICRABBIT://光電兔
switch(subtype){
case 1:
case 4:
switch(state){
case 20:
case 21:
obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, "");
break;
case 22:
local totalDamage = obj.getVar("custom").get_vector(1);
local damageRate = obj.getVar("custom").get_vector(6);
totalDamage = (totalDamage.tofloat() * damageRate.tofloat() / 100.0).tointeger();
if(subtype == 1) cearteSkillPassive_Witch_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_ELECTRICRABBIT,3,0,totalDamage,0,0,0,0,0,0,2);
if(subtype == 4) cearteSkillPassive_Witch_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_ELECTRICRABBIT,3,1,totalDamage,0,0,0,0,0,0,2);
sq_SendDestroyPacketPassiveObject(obj);
break;
}
break;
case 2:
switch(state){
case 20:
case 21:
obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, "");
break;
case 22:
sq_SendDestroyPacketPassiveObject(obj);
break;
}
break;
}
break;
case SKILL_BYKK_ENHANCEDMAGICMISSILE://改良魔法星彈
switch(subtype){
case 1:
switch(state){
case 20:
case 22:
obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, "");
break;
case 21:
if(obj.getVar("custom").get_vector(0) >= 2){
if(obj.getVar("targetObj").get_obj_vector_size() > 0){
obj.getVar("move").clear_vector();
obj.getVar("move").push_vector(sq_GetXPos(obj));
obj.getVar("move").push_vector(sq_GetZPos(obj));
obj.getVar("move").push_vector(100);
obj.getVar("move").push_vector(300);
obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, "");
}
else obj.addSetStatePacket(24, null, STATE_PRIORITY_AUTO, false, "");
}
else sq_SendDestroyPacketPassiveObject(obj);
break;
case 23:
case 24:
sq_SendDestroyPacketPassiveObject(obj);
break;
}
break;
}
break;
case SKILL_BYKK_FLUORECOLLIDER://電鳗碰撞機
switch(subtype){
case 1:
switch(state){
case 20:
obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
break;
case 22:
sq_SendDestroyPacketPassiveObject(obj);
break;
}
break;
}
break;
case SKILL_BYKK_FUSIONCRAFT://技藝融合
break;
case SKILL_BYKK_HEATINGFURNACE://爆炎加熱爐
switch(subtype){
case 1:
switch(state){
case 20:
obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
break;
case 22:
case 23:
sq_SendDestroyPacketPassiveObject(obj);
break;
}
break;
case 2:
case 4:
case 6:
case 7:
sq_SendDestroyPacketPassiveObject(obj);
break;
}
break;
case SKILL_BYKK_HOMUNCULUS://魔道學助手
if((subtype == 31 && state == 20) || (subtype == 41 && state == 20)){obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");return;}
sq_SendDestroyPacketPassiveObject(obj);
break;
case SKILL_BYKK_JACKFROSTICEWATER://雪人刨冰
switch(subtype){
case 1:
case 2:
switch(state){
case 20:
obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
break;
case 22:
sq_SendDestroyPacketPassiveObject(obj);
break;
}
break;
}
break;
case SKILL_BYKK_JACKOHALLOWEEN://搗蛋傑克
switch(subtype){
case 1:
switch(state){
case 20:
case 21:
case 22:
case 23:
case 25:
// if(state == 21){
// obj.getVar().clear_ct_vector();
// obj.getVar().push_ct_vector();
// local timer = obj.getVar().get_ct_vector(0);
// timer.Reset();
// timer.Start(10000,0);
// }
obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, "");
break;
case 26:
sqrChr.getVar("jackohalloween_pumpkin").clear_obj_vector();
local lava_Obj = obj.getVar("jackohalloween_lava").get_obj_vector(0);
if(lava_Obj){
local colObj = sq_GetCNRDObjectToCollisionObject(lava_Obj);
sq_SendDestroyPacketPassiveObject(colObj);
}
sq_SendDestroyPacketPassiveObject(obj);
break;
}
break;
case 2:
switch(state){
case 21:
obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, "");
break;
case 23:
sq_SendDestroyPacketPassiveObject(obj);
break;
}
break;
}
break;
case SKILL_BYKK_LAVAPOTION://熔岩藥瓶
switch(subtype){
case 4:
if(state == 22) sq_SendDestroyPacketPassiveObject(obj);
break;
case 1:
case 2:
sq_SendDestroyPacketPassiveObject(obj);
break;
case 3:
if(state == 21) obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, "");
else if(state == 23){
local size = obj.getVar("targetObj").get_obj_vector_size();
for(local i = 0; i < size; i++){
local targetObj = sq_GetCNRDObjectToActiveObject(obj.getVar("targetObj").get_obj_vector(i));
if(targetObj || targetObj.getState() != STATE_DIE) targetObj.getVar("lavapotion").setBool(0,false);
}
sq_SendDestroyPacketPassiveObject(obj);
}
break;
}
break;
case SKILL_BYKK_MEGADRILL://冰霜鑽孔車
switch(subtype){
case 1:
switch(state){
case 20:
obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
break;
case 21:
obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, "");
break;
case 22:
sq_SendDestroyPacketPassiveObject(obj);
break;
}
break;
case 2:
case 12:
switch(state){
case 20:
case 21:
if(state == 20) obj.sq_PlaySound("MEGA_DRILL_STARTING");
obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, "");
break;
case 25:
sq_SendDestroyPacketPassiveObject(obj);
break;
}
break;
case 3:
sq_SendDestroyPacketPassiveObject(obj);
break;
}
break;
case SKILL_BYKK_UROBOROS://二覺
break;
case SKILL_BYKK_LOLLIPOPCRUSH://超級棒棒糖
if(subtype == 0 || subtype == 1 || subtype == 9 || subtype == 10 || subtype == 11) sq_SendDestroyPacketPassiveObject(obj);
if(subtype == 20){
if(state == 20) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
else if(state == 22) sq_SendDestroyPacketPassiveObject(obj);
}
break;
case SKILL_BYKK_TRANSFORMFLAPPER://變異蒼蠅拍
case SKILL_BYKK_TRANSFORMFLAPPEREX://超級蒼蠅拍
switch(subtype){
case 3:
case 4:
if(!sqrChr || sqrChr.getState() == STATE_DIE) break;
if(sq_GetLevelData(sqrChr, SKILL_BYKK_TRANSFORMFLAPPER, 11, sq_GetSkillLevel(sqrChr, SKILL_BYKK_TRANSFORMFLAPPER)) > 0) break;
if(obj.getVar("custom").get_vector(10) < 1){
local isSeal = obj.getVar("custom").get_vector(7);
if(isSeal == 1){
local monsterId = [GOBLIN_BYKK_ID,TAU_BYKK_ID];
local homunculus_skill = sq_GetSkill(sqrChr, SKILL_BYKK_HOMUNCULUS)
if(sq_GetSkillLevel(sqrChr, SKILL_BYKK_HOMUNCULUS) > 0 && !homunculus_skill.isSealFunction()) monsterId = [LANTERN_BYKK_ID,FLUORE_BYKK_ID,FLUTO_BYKK_ID,JACKFROST_BYKK_ID];
local monstertime = obj.getVar("custom").get_vector(5);
local monsterlevel = obj.getVar("custom").get_vector(6);
for(local i = 0; i < obj.getVar("custom").get_vector(9); i++){
if(sqrChr.getVar("countofhomunculus").getInt(11) < sq_GetIntData(sqrChr, SKILL_BYKK_HOMUNCULUS, 45)){
summonmonster_witch_bykk(sqrChr,sqrChr,200,0,-sq_GetZPos(sqrChr),0,monsterId[sq_getRandom(0,(monsterId.len()-1))],monstertime,monsterlevel,0);
sqrChr.getVar("countofhomunculus").setInt(11, sqrChr.getVar("countofhomunculus").getInt(11) + 1);
print("number = "+sqrChr.getVar("countofhomunculus").getInt(11));
}
}
}
}
break;
}
sq_SendDestroyPacketPassiveObject(obj);
break;
}
}