function setCustomData_po_elementalmaster_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 ELEMENTALMASTER_SKILL_ARCTICPISTE://極冰綻放 switch(subtype){ case 1: case 2://totalDamage,sizeRate,hitMax,hitTime,speedRate local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local hitMax = receiveData.readDword(); local hitTime = receiveData.readDword(); local speedRate = receiveData.readDword(); local sub = receiveData.readDword(); obj.getVar("custom").clear_vector(); obj.getVar("custom").push_vector(sizeRate); obj.getVar("custom").push_vector(hitMax); obj.getVar("custom").push_vector(hitTime); obj.getVar("custom").push_vector(speedRate); obj.getVar("custom").push_vector(sub); local attackIndex = 20; if(subtype == 2) attackIndex = 8; sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, attackIndex)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); if(subtype == 2){ local attackInfo = sq_GetCurrentAttackInfo(obj); if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); } local skill_level = sq_GetSkillLevel(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE); local prob = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 5, skill_level); local level = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 6, skill_level); local time = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 7, skill_level); local minus_Rate = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 4, skill_level); obj.getVar("custom").push_vector(minus_Rate); local attackInfo = sq_GetCurrentAttackInfo(obj); if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_FREEZE, prob, level, time); sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); break; case 3: case 4: local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local speedRate = receiveData.readDword(); local isBig = receiveData.readDword(); obj.getVar("custom").setInt(10, sizeRate); local aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/new/icearea_att_3.ani"; if(sq_getRandom(1, 100) > 50) aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/new/icearea_att2_3.ani"; if(subtype == 3){ aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/new/icefieldnormal1.ani"; if(sq_getRandom(1, 100) > 50) aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/new/icefieldnormal2.ani"; } local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); sizeRate = sizeRate.tofloat() / 100.0; local pAni = obj.getCurrentAnimation(); pAni.setImageRateFromOriginal(sizeRate, sizeRate); pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); if(isBig > 300) sizeRate = sizeRate * 2.0; sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); pAni.setSpeedRate(speedRate.tofloat()); local attackIndex = 20; if(subtype == 2) attackIndex = 8; sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, attackIndex)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); if(subtype == 2){ local attackInfo = sq_GetCurrentAttackInfo(obj); if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); } local skill_level = sq_GetSkillLevel(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE); local prob = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 5, skill_level); local level = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 6, skill_level); local time = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 7, skill_level); local attackInfo = sq_GetCurrentAttackInfo(obj); if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_FREEZE, prob, level, time); break; } break; case ELEMENTALMASTER_SKILL_BLACKHOLE://黑洞 if(sqrChr.getVar("blackhole").get_obj_vector_size() < 1){ sqrChr.getVar("blackhole").clear_obj_vector(); sqrChr.getVar("blackhole").push_obj_vector(obj); } if(!sqrChr.getVar("blackhole").is_obj_vector(obj)) sqrChr.getVar("blackhole").push_obj_vector(obj); switch(subtype){ case 1: case 2://totalDamage,sizeRate,lifeTime,damageRate,attractPower,hitTime local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local lifeTime = receiveData.readDword(); local damageRate = receiveData.readDword(); local attractPower = receiveData.readDword(); local range = receiveData.readDword(); local sub = receiveData.readDword(); local hitTime = receiveData.readDword(); local totalDamage2 = totalDamage * damageRate / 100; obj.getVar("custom").clear_vector(); obj.getVar("custom").push_vector(sizeRate); obj.getVar("custom").push_vector(attractPower); obj.getVar("custom").push_vector(range); obj.getVar("custom").push_vector(totalDamage2); obj.getVar("custom").push_vector(lifeTime); obj.getVar("custom").push_vector(totalDamage); obj.getVar("custom").push_vector(sub); obj.getVar("custom").push_vector(hitTime); local attackIndex = 37; if(subtype == 2) attackIndex = 38; sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, attackIndex)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); if(subtype == 2){ local attackInfo = sq_GetCurrentAttackInfo(obj); if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); } if(sq_GetLevelData(sqrChr, 58, 10, sq_GetSkillLevel(sqrChr, 58)) < 1) obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); else obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); break; case 3: local lifeTime = receiveData.readDword(); local sub = receiveData.readDword(); local sizeRate = receiveData.readDword(); local aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/normal/shockwave1_dodge.ani"; if(sub == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/elementalpotential/shockwave2_dodge.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); obj.setTimeEvent(0,lifeTime,1,false); sizeRate = sizeRate.tofloat() / 100.0; local pAni = obj.getCurrentAnimation(); pAni.setImageRateFromOriginal(sizeRate, sizeRate); pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); break; } break; case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND://聖靈水晶 switch(subtype){ case 1: if(sqrChr.getVar("crystal").get_obj_vector_size() > 0) sqrChr.getVar("crystal").push_obj_vector(obj); else{ sqrChr.getVar("crystal").clear_obj_vector(); sqrChr.getVar("crystal").push_obj_vector(obj); } local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local sub = receiveData.readDword(); obj.getVar("custom").setInt(1,sizeRate); obj.getVar("custom").setInt(2,totalDamage); if(sub > 0){ obj.setTimeEvent(2, 2600, 1, false); obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, ""); } else obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); break; case 2: case 3: case 4: if(sqrChr.getVar("crystal_effect" + subtype.tostring()).get_obj_vector_size() > 0) sqrChr.getVar("crystal_effect" + subtype.tostring()).push_obj_vector(obj); else{ sqrChr.getVar("crystal_effect" + subtype.tostring()).clear_obj_vector(); sqrChr.getVar("crystal_effect" + subtype.tostring()).push_obj_vector(obj); } local sizeRate = receiveData.readDword(); obj.getVar("custom").setInt(1,sizeRate); if(subtype == 4){sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM);}//obj.setTimeEvent(1,3300,1,false); // else{obj.setTimeEvent(1,3000,1,false);} obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); break; } break; case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN://元素點燃 switch(subtype){ case 1: sqrChr.getVar("elementalchain_light").clear_obj_vector();sqrChr.getVar("elementalchain_light").push_obj_vector(obj); case 2: sqrChr.getVar("elementalchain_ice").clear_obj_vector();sqrChr.getVar("elementalchain_ice").push_obj_vector(obj); case 3: sqrChr.getVar("elementalchain_fire").clear_obj_vector();sqrChr.getVar("elementalchain_fire").push_obj_vector(obj); case 4: if(subtype == 4){sqrChr.getVar("elementalchain_dark").clear_obj_vector();sqrChr.getVar("elementalchain_dark").push_obj_vector(obj);} local lightTime = receiveData.readDword(); local sub = receiveData.readDword(); obj.getVar("custom").clear_vector(); obj.getVar("custom").push_vector(lightTime); obj.getVar("custom").push_vector(sub); obj.setDirection(ENUM_DIRECTION_RIGHT); obj.setMapFollowParent(sqrChr); obj.setMapFollowType(1); if(sub <= 1) sq_moveWithParent(sqrChr, obj); if(sub == 1) obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, ""); else if(sub == 2) obj.addSetStatePacket(28, null, STATE_PRIORITY_AUTO, false, ""); else obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); break; case 15: local totalDamage = receiveData.readDword(); local powerDamage = receiveData.readDword(); local normal_rate = receiveData.readDword(); local exp_rate = receiveData.readDword(); local shoot_range = receiveData.readDword(); obj.getVar("custom").clear_vector(); obj.getVar("custom").push_vector(normal_rate); obj.getVar("custom").push_vector(exp_rate); obj.getVar("custom").push_vector(shoot_range); obj.getVar("custom").push_vector(sq_GetXPos(obj)); obj.getVar("custom").push_vector(totalDamage); obj.getVar("custom").push_vector(powerDamage); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 24)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); sq_SetCurrentAttackPower(sq_GetCurrentAttackInfo(obj), powerDamage); obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); break; case 150: local ani = sq_CreateAnimation("","passiveobject/common/animation/fireexplosion.ani"); obj.setCurrentAnimation(ani); local totalDamage = receiveData.readDword(); local powerDamage = receiveData.readDword(); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 14)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); sq_SetCurrentAttackPower(sq_GetCurrentAttackInfo(obj), powerDamage); local currentAni = obj.getCurrentAnimation();//得到當前ani local sizeRate = receiveData.readDword(); obj.getVar("custom").clear_vector(); obj.getVar("custom").push_vector(sizeRate); sizeRate = sizeRate.tofloat() / 1000.0; sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); obj.setTimeEvent(1, 200, 2, true); obj.setTimeEvent(2, 50, 2, true); obj.setTimeEvent(3, 15, 4, true); obj.setTimeEvent(4, 100, 2, true); break; case 16: local totalDamage = receiveData.readDword(); local powerDamage = receiveData.readDword(); local normal_rate = receiveData.readDword(); local lifeTime = receiveData.readDword(); obj.setTimeEvent(0,lifeTime,1,false); obj.getVar("custom").clear_vector(); obj.getVar("custom").push_vector(normal_rate); 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.getVar("custom").push_vector(80); obj.getVar("custom").push_vector(0); obj.getVar("custom").push_vector(0); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 23)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); sq_SetCurrentAttackPower(sq_GetCurrentAttackInfo(obj), powerDamage); local skill_level = sq_GetSkillLevel(sqrChr, 16); local prob = sq_GetLevelData(sqrChr, 16, 11, skill_level); local level = sq_GetLevelData(sqrChr, 16, 12, skill_level); local time = sq_GetLevelData(sqrChr, 16, 13, skill_level); local speed_level = sq_GetLevelData(sqrChr, 16, 7, skill_level); local speed_time = sq_GetLevelData(sqrChr, 16, 8, skill_level); local movespeed_rate = sq_GetLevelData(sqrChr, 16, 9, skill_level); local attackspeed_rate = sq_GetLevelData(sqrChr, 16, 10, skill_level); obj.getVar("custom").push_vector(speed_level); obj.getVar("custom").push_vector(speed_time); obj.getVar("custom").push_vector(movespeed_rate); obj.getVar("custom").push_vector(attackspeed_rate); local attackInfo = sq_GetCurrentAttackInfo(obj); if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_FREEZE, prob, level, time); obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); break; case 17: local totalDamage = receiveData.readDword(); local powerDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local lifeTime = receiveData.readDword(); local angle = receiveData.readDword(); local baseX = receiveData.readDword(); local baseY = receiveData.readDword(); obj.setTimeEvent(0,lifeTime,1,false); obj.getVar("custom").clear_vector(); obj.getVar("custom").push_vector(angle); obj.getVar("custom").push_vector(baseX); obj.getVar("custom").push_vector(baseY); local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchfluorescent1.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchfluorescent2.ani"),true); currentAni.addLayerAnimation(3,sq_CreateAnimation("","passiveobject/character/mage/animation/launchfluorescent3.ani"),true); currentAni.addLayerAnimation(2,sq_CreateAnimation("","passiveobject/character/mage/animation/launchfluorescent4.ani"),true); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 22)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); sq_SetCurrentAttackPower(sq_GetCurrentAttackInfo(obj), powerDamage); sizeRate = sizeRate.tofloat() / 1000.0; local pAni = obj.getCurrentAnimation(); pAni.setImageRateFromOriginal(sizeRate, sizeRate); pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); break; case 18: local totalDamage = receiveData.readDword(); local powerDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local speed_rate = receiveData.readDword(); local shoot_range = receiveData.readDword(); obj.getVar("custom").clear_vector(); obj.getVar("custom").push_vector(sizeRate); obj.getVar("custom").push_vector(speed_rate); obj.getVar("custom").push_vector(shoot_range); obj.getVar("custom").push_vector(sq_GetXPos(obj)); obj.getVar("custom").push_vector(sq_GetZPos(obj)); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 21)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); sq_SetCurrentAttackPower(sq_GetCurrentAttackInfo(obj), powerDamage); obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); break; } break; case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN://元素之幕 local sizeRate = 100; switch(subtype){ case 1: //totalDamage,sizeRate,lifeTime,damageRate,hitTime,hitMax local totalDamage = receiveData.readDword(); sizeRate = receiveData.readDword(); local lifeTime = receiveData.readDword(); local damageRate = receiveData.readDword(); local hitTime = receiveData.readDword(); local hitMax = receiveData.readDword(); local istalisman = receiveData.readDword(); local totalDamage2 = totalDamage * damageRate / 100; obj.getVar("custom").clear_vector(); obj.getVar("custom").push_vector(sizeRate); obj.getVar("custom").push_vector(totalDamage2); obj.getVar("custom").push_vector(hitMax); obj.getVar("custom").push_vector(totalDamage); obj.getVar("custom").push_vector(istalisman); obj.getVar("target").clear_obj_vector(); local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalcurtain/blankwallhorizonbottom.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(10001,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalcurtain/elementalcurtain_aurora.ani"),true); currentAni.addLayerAnimation(-1000,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalcurtain/elementalcurtain_aurorabehind_aurora1.ani"),true); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 3)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); local attackInfo = sq_GetCurrentAttackInfo(obj); if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); obj.setTimeEvent(0,hitTime,-1,true); obj.setTimeEvent(1,lifeTime,1,false); cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj) + 400,obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN,2,lifeTime,sizeRate,0,0,0,0,0,0,0,0); cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj),obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN,3,lifeTime,sizeRate,0,0,0,0,0,0,0,0); break; case 2: local lifeTime = receiveData.readDword(); sizeRate = receiveData.readDword(); obj.setTimeEvent(1,lifeTime + 300,1,false); local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalcurtain/elementalcurtain_aurorafront_sky1.ani"); obj.setCurrentAnimation(ani); break; case 3: local lifeTime = receiveData.readDword(); sizeRate = receiveData.readDword(); obj.setTimeEvent(1,lifeTime + 300,1,false); local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalcurtain/elementalcurtain_groundcircle.ani"); obj.setCurrentAnimation(ani); sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); break; case 4: local totalDamage = receiveData.readDword(); sizeRate = receiveData.readDword(); local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalcurtain/elementalcurtain_auroraend_broken.ani"); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 4)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); local attackInfo = sq_GetCurrentAttackInfo(obj); if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); sq_flashScreen(obj,720,0,200,51, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); obj.setTimeEvent(1,1000,1,false); break; } sizeRate = sizeRate.tofloat() / 100.0; local pAni = obj.getCurrentAnimation(); pAni.setImageRateFromOriginal(sizeRate, sizeRate); pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); break; case ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL://元素奧義 break; case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE://元素震蕩 switch(subtype){ case 1: local totalDamage = receiveData.readDword(); local damageRate = receiveData.readDword(); local sizeRate = receiveData.readDword(); local istalisman = receiveData.readDword(); obj.getVar("custom").clear_vector(); obj.getVar("custom").push_vector(totalDamage); obj.getVar("custom").push_vector(damageRate); obj.getVar("custom").push_vector(sizeRate); obj.getVar("custom").push_vector(istalisman); sizeRate = sizeRate.tofloat() / 100.0; local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalquake/magiccircle.ani",0,0,0); local pooledObj2 = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalquake/quake_glowbeam.ani",0,0,0); local effectObj = [pooledObj,pooledObj2]; for(local i = 0; i < effectObj.len(); i++){ local pAni = effectObj[i].getCurrentAnimation(); pAni.setImageRateFromOriginal(sizeRate, sizeRate); pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); } obj.setTimeEvent(1,400,1,false); if(istalisman > 0) obj.setTimeEvent(2,120,20,false); break; case 2: local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalquake/elementalquakefireexpdummy.ani"); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 13)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); local attackInfo = sq_GetCurrentAttackInfo(obj); if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); sizeRate = sizeRate.tofloat() / 100.0; local pAni = obj.getCurrentAnimation(); pAni.setLoop(false); sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); local randomnumber = sq_getRandom(1,100); local pooledObj; if(randomnumber > 67) pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalquake/flamestrike_blast_front02.ani",sq_getRandom(-350,350),sq_getRandom(-40,40),0); else if(randomnumber > 33 && randomnumber <= 67) pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalquake/flamestrike_blast_front02.ani",sq_getRandom(-233,233),sq_getRandom(-80,80),0); else pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalquake/flamestrike_blast_front02.ani",sq_getRandom(-115,115),sq_getRandom(-120,120),0); local currentAni = pooledObj.getCurrentAnimation(); currentAni.setImageRateFromOriginal(0.4, 0.4); currentAni.setAutoLayerWorkAnimationAddSizeRate(0.4); break; } break; case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER://隕星幻滅 switch(subtype){ case 1: local totalDamage = receiveData.readDword(); local totalDamage2 = receiveData.readDword(); obj.getVar("custom").setInt(10, totalDamage2); local randomnumber = sq_getRandom(1, 4); obj.getVar("custom").setInt(11, randomnumber); obj.getVar("custom").setInt(12, sq_GetZPos(obj)); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 41)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); break; } break; case ELEMENTALMASTER_SKILL_FLAMESTRIKE://烈焰沖擊 switch(subtype){ case 1: local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 15)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); obj.getVar("custom").clear_vector(); obj.getVar("custom").push_vector(sizeRate); obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); break; case 2: local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local etcTime = receiveData.readDword(); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 15)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); local attackInfo = sq_GetCurrentAttackInfo(obj); if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/flamestrike/lv95assimilate/flamestrikebottoma_00.ani"); obj.setCurrentAnimation(ani); obj.getVar("custom").clear_vector(); obj.getVar("custom").push_vector(sizeRate); obj.getVar("custom").push_vector(totalDamage); obj.getVar("custom").push_vector(etcTime); local sizeRate = obj.getVar("custom").get_vector(0); sizeRate = sizeRate.tofloat() / 100.0; local pAni = obj.getCurrentAnimation(); pAni.setImageRateFromOriginal(sizeRate, sizeRate); pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); obj.getVar("targetObj").clear_obj_vector(); obj.setTimeEvent(0,600,1,false); sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); break; case 3: local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local group = receiveData.readDword(); local uniqueId = receiveData.readDword(); obj.getVar("custom").clear_vector(); obj.getVar("custom").push_vector(sizeRate); obj.getVar("custom").push_vector(group); obj.getVar("custom").push_vector(uniqueId); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 15)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); local attackInfo = sq_GetCurrentAttackInfo(obj); if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); break; } break; case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER://傑克降臨 switch(subtype){ case 0: local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local sizeRate2 = receiveData.readDword(); local damageRate = receiveData.readDword(); local sub = receiveData.readDword(); local typesub = receiveData.readDword(); local number = receiveData.readDword(); obj.getVar("custom").clear_vector(); obj.getVar("custom").push_vector(sizeRate); obj.getVar("custom").push_vector(sizeRate2); obj.getVar("custom").push_vector(damageRate); obj.getVar("custom").push_vector(totalDamage); obj.getVar("custom").push_vector(sub); obj.getVar("custom").push_vector(typesub); obj.getVar("custom").push_vector(number); obj.setTimeEvent(3,1000+220 * number,1,false); obj.setTimeEvent(4,800,1,false); sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalpotential/magictargetwarningterrible.ani",0,0,0); break; case 1: case 2: local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local sizeRate2 = receiveData.readDword(); local damageRate = receiveData.readDword(); local sub = receiveData.readDword(); print("sub = "+sub); local totalDamage2 = totalDamage * damageRate / 100; if(sub > 0){sizeRate = sizeRate * 166 / 100;sizeRate2 = sizeRate2 * 166 / 100;totalDamage = totalDamage * 10 / 100;totalDamage2 = totalDamage2 * 154 / 100;} obj.getVar("custom").clear_vector(); obj.getVar("custom").push_vector(sizeRate); obj.getVar("custom").push_vector(sizeRate2); obj.getVar("custom").push_vector(totalDamage2); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 18)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); if(subtype == 2){ local attackInfo = sq_GetCurrentAttackInfo(obj); if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); } local time = 1000; if(sub > 0) time = 1500; local speedRate = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_HALLOWEENBUSTER, 8, sq_GetSkillLevel(sqrChr, ELEMENTALMASTER_SKILL_HALLOWEENBUSTER)); if(speedRate > 0){ time = time / (100 + speedRate) * 100; } obj.getVar("move").setInt(10, sq_GetXPos(obj)); obj.getVar("move").setInt(11, sq_GetZPos(obj)); obj.setTimeEvent(5, time / 40, 40, true); obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); break; } break; case ELEMENTALMASTER_SKILL_MIGHTYRUNE://聖靈符文 break; case ELEMENTALMASTER_SKILL_SESTOELEMENTO://第六元素 switch(subtype){ case 1: local totalDamage = receiveData.readDword(); local hitMax = receiveData.readDword(); local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/sestoelemento/start_main.ani"); obj.setCurrentAnimation(ani); obj.sq_PlaySound("SESTOELEMENTO"); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 26)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); local attackInfo = sq_GetCurrentAttackInfo(obj); if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); obj.setTimeEvent(1,3000/(hitMax+1),hitMax,true); sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); local appendage = CNSquirrelAppendage.sq_AppendAppendage(sqrChr, obj, -1, false, "appendage/character/ap_common_suck.nut", false); if(appendage){ CNSquirrelAppendage.sq_Append(appendage, sqrChr, obj); local auraAppendage = appendage.sq_getAuraMaster("auraMaster"); if(!auraAppendage) auraAppendage = appendage.sq_AddAuraMaster("auraMaster", sqrChr, obj, 1200, 18, 5, 0); if(auraAppendage) auraAppendage.setAttractionInfo(600, 600, 800, 100); } break; case 2: local totalDamage = receiveData.readDword(); local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/sestoelemento/explosion_main.ani"); obj.setCurrentAnimation(ani); obj.sq_PlaySound("SESTOELEMENTO_EXP"); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 25)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); local attackInfo = sq_GetCurrentAttackInfo(obj); if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); if(!sqrChr) break; CNSquirrelAppendage.sq_RemoveAppendage(sqrChr, "appendage/character/ap_common_suck.nut"); break; } break; case ELEMENTALMASTER_SKILL_SUNBURST://雷旋 switch(subtype){ case 1:// local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/sunburst/sunburst.ani"); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 27)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); sizeRate = sizeRate.tofloat() / 100.0; local pAni = obj.getCurrentAnimation(); sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); break; case 2: local time = receiveData.readDword(); obj.setTimeEvent(1, time, 1, false); break; } break; case ELEMENTALMASTER_SKILL_THEGATE://元素之門 switch(subtype){ case 1: local totalDamage = receiveData.readDword(); local create_number = receiveData.readDword(); local create_time = receiveData.readDword(); local sub = receiveData.readDword(); local group = receiveData.readDword(); local uniqueId = receiveData.readDword(); local targetObj = sq_GetObject(obj, group, uniqueId); sq_moveWithParent(targetObj, obj); obj.getVar().clear_obj_vector(); obj.getVar().push_obj_vector(targetObj); obj.getVar("custom").clear_vector(); obj.getVar("custom").push_vector(totalDamage); obj.getVar("custom").push_vector(create_number); obj.getVar("custom").push_vector(create_time); obj.getVar("custom").push_vector(sub); obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); break; case 2: local totalDamage = receiveData.readDword(); local sub = receiveData.readDword(); local aniPath1 = "passiveobject/elementalmaster_bykk/animation/thegate/"; local aniPath2 = "light"; switch(sub){ case 2: aniPath2 = "ice"; break; case 3: aniPath2 = "fire"; break; case 4: aniPath2 = "dark"; break; } local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/" + aniPath2 + "_crystal.ani"); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 28)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); sq_CreateParticle("passiveobject/elementalmaster_bykk/particle/thegate"+aniPath2+"tail.ptl", obj, 0, 0, 0, true, 10, 0, 3); local attackInfo = sq_GetCurrentAttackInfo(obj); switch(sub){ case 1: if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); break; case 2: if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); break; case 3: if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); break; case 4: if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); break; } obj.getVar("custom").clear_vector(); obj.getVar("custom").push_vector(sq_GetZPos(obj)); obj.getVar("custom").push_vector(sub); break; case 10: local totalDamage = receiveData.readDword(); local sub = receiveData.readDword(); local group = receiveData.readDword(); local uniqueId = receiveData.readDword(); local targetObj = sq_GetObject(obj, group, uniqueId); if(targetObj){ obj.getVar("custom").setInt(0, totalDamage); obj.getVar("custom").setInt(1, sub); obj.getVar("custom").setInt(2, group); obj.getVar("custom").setInt(3, uniqueId); local aniPath0 = "passiveobject/elementalmaster_bykk/animation/thegate/talisman/"; local aniPath1 = ["magiccircleblue","magiccirclepurple","magiccirclered","magiccircleyellow"]; local aniPath2 = [["/magiccircleblue_01.ani","/magiccirclepurple_01.ani","/magiccirclered_01.ani","/magiccircleyellow_01.ani"], ["/magiccircleblue_line_00.ani","/magiccirclepurple_line_00.ani","/magiccirclered_line_00.ani","/magiccircleyellow_line_00.ani"]]; local ani = sq_CreateAnimation("",aniPath0 + aniPath1[sub] + aniPath2[0][sub]); obj.setCurrentAnimation(ani); local pAni = obj.getCurrentAnimation(); pAni.addLayerAnimation(-1,sq_CreateAnimation("",aniPath0 + aniPath1[sub] + aniPath2[1][sub]),true); local activeObj = sq_GetCNRDObjectToActiveObject(targetObj); if(!CNSquirrelAppendage.sq_IsAppendAppendage(activeObj, "character/mage/elementalmaster_bykk/ap_mage_hold.nut")){ CNSquirrelAppendage.sq_RemoveAppendage(activeObj, "character/mage/elementalmaster_bykk/ap_mage_hold.nut"); } local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(activeObj, obj, -1, false, "character/mage/elementalmaster_bykk/ap_mage_hold.nut", true); sq_HoldAndDelayDie(activeObj, obj, true, true, true, 200, 200, ENUM_DIRECTION_NEUTRAL , AddAppendage); } else sq_SendDestroyPacketPassiveObject(obj); break; case 11: local totalDamage = receiveData.readDword(); local sub = receiveData.readDword(); local group = receiveData.readDword(); local uniqueId = receiveData.readDword(); local targetObj = sq_GetObject(obj, group, uniqueId); if(targetObj){ obj.getVar("tar").clear_obj_vector(); obj.getVar("tar").push_obj_vector(targetObj); local aniPath0 = "passiveobject/elementalmaster_bykk/animation/thegate/talisman/"; local aniPath1 = ["magiccircleblue","magiccirclepurple","magiccirclered","magiccircleyellow"]; local aniPath2 = ["/explosionblue_04.ani","/explosionpurple_05.ani","/explosionred_04.ani","/explosionyellow_04.ani"]; // print("path = "+aniPath0 + aniPath1[sub] + aniPath2[sub]); local ani = sq_CreateAnimation("",aniPath0 + aniPath1[sub] + aniPath2[sub]); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 28)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); local attackInfo = sq_GetCurrentAttackInfo(obj); attackInfo.setElement(ENUM_ELEMENT_FIRE); attackInfo.setElement(ENUM_ELEMENT_WATER); attackInfo.setElement(ENUM_ELEMENT_DARK); attackInfo.setElement(ENUM_ELEMENT_LIGHT); obj.setTimeEvent(2,50,1,false); sq_SetShake(obj, 15, 300); } else sq_SendDestroyPacketPassiveObject(obj); break; } break; case ELEMENTALMASTER_SKILL_THUNDERCALLING://天雷 switch(subtype){ case 0://totalDamage,sizeRate,countMax,hitTime,range,2 local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local countMax = receiveData.readDword(); local hitTime = receiveData.readDword(); local range = receiveData.readDword(); local sub = receiveData.readDword(); obj.getVar("custom").clear_vector(); obj.getVar("custom").push_vector(totalDamage); obj.getVar("custom").push_vector(sizeRate); obj.getVar("custom").push_vector(countMax); obj.getVar("custom").push_vector(range); obj.getVar("custom").push_vector(sub); obj.getVar("custom").push_vector(hitTime); local skill_level = sq_GetSkillLevel(sqrChr, ELEMENTALMASTER_SKILL_THUNDERCALLING); local prob = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_THUNDERCALLING, 4, skill_level); local level = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_THUNDERCALLING, 5, skill_level); local time = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_THUNDERCALLING, 6, skill_level); obj.getVar("custom").push_vector(prob); obj.getVar("custom").push_vector(level); obj.getVar("custom").push_vector(time); if((countMax * hitTime) > 4000){ local pAni = obj.getCurrentAnimation(); sq_SetFrameDelayTime(pAni, 0, countMax * hitTime); } obj.setTimeEvent(3,1000+(hitTime + 20) * countMax,1,false); obj.setTimeEvent(4,800,1,false); sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalpotential/magictargetwarningterrible.ani",0,0,0); break; case 1: case 2: local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local range = receiveData.readDword(); local prob = receiveData.readDword(); local level = receiveData.readDword(); local time = receiveData.readDword(); local aniPath = "passiveobject/elementalmaster_bykk/animation/thunderstrike/thunderstrike_lightning01.ani"; if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalpotential/thunderstrike/epthunderstrike_lightning01.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); local attackIndex = 29; if(subtype == 2) attackIndex = 11; sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, attackIndex)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); local attackInfo = sq_GetCurrentAttackInfo(obj); if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_STUN, prob, level, time); if(subtype == 1){ sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/thunderstrike/thunderstrike_hit01.ani",0,0,0); sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/thunderstrike/thunderstrike_floor.ani",0,0,0); } else if(subtype == 2){ sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalpotential/thunderstrike/epthunderstrike_hit01.ani",0,0,0); local attackInfo = sq_GetCurrentAttackInfo(obj); if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); } sizeRate = sizeRate.tofloat() / 100.0; local pAni = obj.getCurrentAnimation(); pAni.setImageRateFromOriginal(sizeRate, sizeRate); pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); obj.sq_PlaySound("THUNDERC_LIGHTNING"); obj.setTimeEvent(1,200,1,false); break; case 3: local totalDamage = receiveData.readDword(); print("totalDamage = "+totalDamage); local aniPath = "passiveobject/character/mage/animation/thunderstrike.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); sq_AddDrawOnlyAniFromParent(obj, "passiveobject/character/mage/animation/thunderstrikeeffect.ani", 0, -1, 0); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 29)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); break; } break; case ELEMENTALMASTER_SKILL_THUNDERRAGE://光與暗的交響 switch(subtype){ case 1: local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local hitMax = receiveData.readDword(); local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/thunderrage/thunderrage_cast_end_shot_back_05.ani"); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 30)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); local attackInfo = sq_GetCurrentAttackInfo(obj); if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); sizeRate = sizeRate.tofloat() / 1000.0; local pAni = obj.getCurrentAnimation(); local delaySum = pAni.getDelaySum(0,13); obj.setTimeEvent(1,delaySum/(hitMax + 1),hitMax,true); pAni.setImageRateFromOriginal(sizeRate, sizeRate); pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); break; } break; case ELEMENTALMASTER_SKILL_VOID://虛無之球 switch(subtype){ case 1: local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local shoot_range = receiveData.readDword(); local hittime = receiveData.readDword(); obj.getVar("custom").clear_vector(); obj.getVar("custom").push_vector(shoot_range); obj.getVar("custom").push_vector(sq_GetXPos(obj)); obj.getVar("custom").push_vector(sizeRate); obj.setTimeEvent(0,hittime,-1,false); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 31)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); obj.sq_SetMoveParticle("particle/void.ptl", 0.0, 0.0); // sq_SetSpeedToMoveParticle(obj,0,speed); obj.setTimeEvent(1,20,-1,false); obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); break; case 2: local totalDamage = receiveData.readDword(); local hittime = receiveData.readDword(); local timeMax = receiveData.readDword(); local damageRate = receiveData.readDword(); local damageRate2 = receiveData.readDword(); local sizeRate = receiveData.readDword(); local isExp = 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(hittime); obj.getVar("custom").push_vector(timeMax); obj.getVar("custom").push_vector(totalDamage3); obj.getVar("custom").push_vector(sizeRate); obj.getVar("custom").push_vector(isExp); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 32)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage2); local attackInfo = sq_GetCurrentAttackInfo(obj); if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); break; } break; case ELEMENTALMASTER_SKILL_WALLOFICE://冰牆 break; case 38://移動施法 sqrChr.getVar("moveoncast").clear_obj_vector(); sqrChr.getVar("moveoncast").push_obj_vector(obj); local chargeTime = receiveData.readDword(); local sub = receiveData.readDword(); local fullcharge = receiveData.readDword(); obj.setTimeEvent(0,chargeTime,1,false); obj.getVar("custom").clear_vector(); obj.getVar("custom").push_vector(sub); obj.setMapFollowParent(obj.getParent()); obj.setMapFollowType(1); sq_moveWithParent(sqrChr, obj); if(fullcharge > 0) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); else obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); 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 setState_po_elementalmaster_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 ELEMENTALMASTER_SKILL_ARCTICPISTE://極冰綻放 switch(subtype){ case 1: case 2: switch(state){ case 20: local aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/icefieldfloorappear.ani"; if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/field2floorappear.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); local speedRate = obj.getVar("custom").get_vector(3); local pAni = obj.getCurrentAnimation(); sq_SetFrameDelayTime(pAni, 0, 300); pAni.setSpeedRate(speedRate.tofloat()); break; case 21: local aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/icefield.ani"; if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/field2.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); local hitTime = obj.getVar("custom").get_vector(2); local sub = obj.getVar("custom").get_vector(4); obj.setTimeEvent(1,hitTime,-1,false); if(sub == 0) obj.setTimeEvent(2,hitTime / 2,-1,false); else if(sub == 1) obj.setTimeEvent(3,900,-1,true); break; case 22: obj.stopTimeEvent(1); local aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/icefieldfloordisappear.ani"; if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/field2disappear.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); break; } local sizeRate = obj.getVar("custom").get_vector(0); sizeRate = sizeRate.tofloat() / 100.0; local pAni = obj.getCurrentAnimation(); pAni.setImageRateFromOriginal(sizeRate, sizeRate); pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); break; } break; case ELEMENTALMASTER_SKILL_BLACKHOLE://黑洞 switch(subtype){ case 1: case 2: switch(state){ case 20: local aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/normal/nighthollow1_start_dodge.ani"; if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/elementalpotential/nighthollow2_start_dodge.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); obj.sq_PlaySound("NIGHTH_IN") break; case 21: local aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/normal/nighthollow1_loop_dodge.ani"; if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/elementalpotential/nighthollow2_loop_dodge.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); local lifeTime = obj.getVar("custom").get_vector(4); local sizeRate = obj.getVar("custom").get_vector(0); cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,0,obj.getDirection(),ELEMENTALMASTER_SKILL_BLACKHOLE,3,lifeTime,subtype,sizeRate,0,0,0,0,0,0,0); local hitTime = obj.getVar("custom").get_vector(7); obj.setTimeEvent(1,hitTime,-1,false); obj.setTimeEvent(0,lifeTime,1,false); obj.setTimeEvent(3,1800,-1,true); if(!sqrChr) break; local attractPower = obj.getVar("custom").get_vector(1); local range = obj.getVar("custom").get_vector(2); if(CNSquirrelAppendage.sq_IsAppendAppendage(sqrChr, "appendage/character/ap_common_suck.nut")) CNSquirrelAppendage.sq_RemoveAppendage(sqrChr, "appendage/character/ap_common_suck.nut"); local appendage = CNSquirrelAppendage.sq_AppendAppendage(sqrChr, obj, -1, false, "appendage/character/ap_common_suck.nut", false); if(appendage){ CNSquirrelAppendage.sq_Append(appendage, sqrChr, obj); local auraAppendage = appendage.sq_getAuraMaster("auraMaster"); if(!auraAppendage) auraAppendage = appendage.sq_AddAuraMaster("auraMaster", sqrChr, obj, 1200, 18, 5, 0); if(auraAppendage) auraAppendage.setAttractionInfo(attractPower, attractPower, range, 100); } break; case 22: obj.stopTimeEvent(1); obj.stopTimeEvent(3); local aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/normal/nighthollow1_exp_dodge.ani"; if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/elementalpotential/nighthollow2_exp_dodge.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); obj.sq_PlaySound("NIGHTH_OUT"); obj.setTimeEvent(2,400,1,false); local totalDamage = obj.getVar("custom").get_vector(3); local attackIndex = 40; if(subtype == 2) attackIndex = 39; sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, attackIndex)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); if(subtype == 2){ local attackInfo = sq_GetCurrentAttackInfo(obj); if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); } if(!sqrChr) break; CNSquirrelAppendage.sq_RemoveAppendage(sqrChr, "appendage/character/ap_common_suck.nut"); break; } local sizeRate = obj.getVar("custom").get_vector(0); sizeRate = sizeRate.tofloat() / 100.0; local pAni = obj.getCurrentAnimation(); pAni.setImageRateFromOriginal(sizeRate, sizeRate); pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); break; } break; case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND://聖靈水晶 switch(subtype){ case 1: switch(state){ case 20: local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/crystalofovermind/crystalofovermind_grow01_loop.ani");// obj.setCurrentAnimation(ani); sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/groweffect/crystalofovermind_grow01_start.ani",0,0,50); obj.setTimeEvent(2,650,4,false); break; case 21: local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/crystalofovermind/crystalofovermind_grow02_loop.ani");// obj.setCurrentAnimation(ani); sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/groweffect/crystalofovermind_grow02_start.ani",0,0,50); break; case 22: local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/crystalofovermind/crystalofovermind_grow03_loop.ani");// obj.setCurrentAnimation(ani); sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/groweffect/crystalofovermind_grow03_start.ani",0,0,50); break; case 23: local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/crystalofovermind/crystalofovermind_grow04_loop.ani");// obj.setCurrentAnimation(ani); sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/groweffect/crystalofovermind_grow04_start_back.ani",0,0,50); sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/groweffect/crystalofovermind_grow04_start.ani",0,0,50); break; case 24: obj.stopTimeEvent(2); local effectObj2 = sqrChr.getVar("crystal_effect2").get_obj_vector(0); if(effectObj2){local colObj = sq_GetCNRDObjectToCollisionObject(effectObj2);colObj.setTimeEvent(1,100,1,true);} local effectObj3 = sqrChr.getVar("crystal_effect3").get_obj_vector(0); if(effectObj3){local colObj = sq_GetCNRDObjectToCollisionObject(effectObj3);colObj.setTimeEvent(1,100,1,true);} local effectObj4 = sqrChr.getVar("crystal_effect4").get_obj_vector(0); if(effectObj4){local colObj = sq_GetCNRDObjectToCollisionObject(effectObj4);colObj.setTimeEvent(1,500,1,false);} local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/crystalofovermind/finish/front/crystalofovermind_finish_front_00.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/crystalofovermind/finish/back/crystalofovermind_finish_back_00.ani"),true); local totalDamage = obj.getVar("custom").getInt(2); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 2)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); local attackInfo = sq_GetCurrentAttackInfo(obj); if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); break; } local sizeRate = obj.getVar("custom").getInt(1); sizeRate = sizeRate.tofloat() / 100.0; local pAni = obj.getCurrentAnimation(); pAni.setImageRateFromOriginal(sizeRate, sizeRate); pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); break; case 2: case 3: case 4: local aniPath1 = "character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/"; switch(state){ case 20: local aniPath2 = "crystalofmind_side_back01_start.ani"; if(subtype == 3) aniPath2 = "crystalofmind_side_front_start.ani"; if(subtype == 4) aniPath2 = "crystalofovermind_background_01.ani"; local ani = sq_CreateAnimation("",aniPath1 + "start/" + aniPath2); obj.setCurrentAnimation(ani); break; case 21: local aniPath2 = "crystalofmind_side_back01.ani"; if(subtype == 3) aniPath2 = "crystalofmind_side_front_loop01.ani"; if(subtype == 4) aniPath2 = "crystalofovermind_background_01.ani"; local ani = sq_CreateAnimation("",aniPath1 + "loop/" + aniPath2); obj.setCurrentAnimation(ani); break; case 22: local aniPath2 = "crystalofmind_side_back01_finish.ani"; if(subtype == 3) aniPath2 = "crystalofmind_side_front_finish.ani"; if(subtype == 4) {sq_SendDestroyPacketPassiveObject(obj);return;} local ani = sq_CreateAnimation("",aniPath1 + "end/" + aniPath2); obj.setCurrentAnimation(ani); break; } local sizeRate = obj.getVar("custom").getInt(1); sizeRate = sizeRate.tofloat() / 100.0; local pAni = obj.getCurrentAnimation(); pAni.setImageRateFromOriginal(sizeRate, sizeRate); pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); break; } break; case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN://元素點燃 switch(subtype){ case 1: case 2: case 3: case 4: local aniPath1 = "character/mage/effect/animation/elementalmaster_bykk/elementalchain/mark"; local aniPath2 = "light"; if(subtype == 2) aniPath2 = "ice"; if(subtype == 3) aniPath2 = "fire"; if(subtype == 4) aniPath2 = "dark"; if(obj.getVar("custom").get_vector(1) == 1) aniPath1 = "character/mage/effect/animation/elementalmaster_bykk/mightyrune/"; if(obj.getVar("custom").get_vector(1) == 2) aniPath1 = "character/mage/effect/animation/elementalmaster_bykk/mightyrune/lv95assimilate/"; switch(state){ case 20: local ani = sq_CreateAnimation("",aniPath1 + "appear_" + aniPath2 + "_1.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(-1,sq_CreateAnimation("",aniPath1 + "appear_" + aniPath2 + "_2.ani"),true); break; case 21: local ani = sq_CreateAnimation("",aniPath1 + "stay_" + aniPath2 + "_1.ani"); obj.setCurrentAnimation(ani); if(subtype == 1) sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr) + 23); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(-1,sq_CreateAnimation("",aniPath1 + "stay_" + aniPath2 + "_2.ani"),true); break; case 22: if(obj.isExistTimeEvent(1)) obj.stopTimeEvent(1); local ani = sq_CreateAnimation("",aniPath1 + "activate_" + aniPath2 + "_1.ani"); obj.setCurrentAnimation(ani); local lifeTime = obj.getVar("custom").get_vector(0); obj.setTimeEvent(1,lifeTime,1,false); if(subtype == 1) sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr) + 30); if(subtype == 4) sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr) + 35); break; case 23: local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/rune" + aniPath2 + "cast.ani"); obj.setCurrentAnimation(ani); break; case 24: local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/rune" + aniPath2 + "off_02.ani"); obj.setCurrentAnimation(ani); break; case 25: local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/rune" + aniPath2 + "changeon_02.ani"); obj.setCurrentAnimation(ani); break; case 26: if(obj.isExistTimeEvent(2)) obj.stopTimeEvent(2); local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/rune" + aniPath2 + "on_02.ani"); obj.setCurrentAnimation(ani); local lightTime = obj.getVar("custom").get_vector(0); obj.setTimeEvent(1,lightTime,1,false); break; case 27: local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/rune" + aniPath2 + "changeoff.ani"); obj.setCurrentAnimation(ani); break; case 28: local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "spherestart_00.ani "); obj.setCurrentAnimation(ani); break; case 29: local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "sphereloop_00.ani"); obj.setCurrentAnimation(ani); break; } break; case 15: switch(state){ case 20: local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchjolstart.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchjolfirestart.ani"),true); break; case 21: local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchjolmove.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchjolfiremove.ani"),true); break; } local sizeRate = obj.getVar("custom").get_vector(0); sizeRate = sizeRate.tofloat() / 1000.0; local pAni = obj.getCurrentAnimation(); pAni.setImageRateFromOriginal(sizeRate, sizeRate); pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); break; case 16: switch(state){ case 20: local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchfrosthead.ani"); obj.setCurrentAnimation(ani); local pAni = obj.getCurrentAnimation(); pAni.setLoop(true); break; case 21: local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchfrostheadjump.ani"); obj.setCurrentAnimation(ani); obj.getVar("custom").set_vector(1,sq_GetXPos(obj)); obj.getVar("custom").set_vector(2,sq_GetYPos(obj)); obj.getVar("custom").set_vector(3,sq_GetZPos(obj)); local targetObj = obj.sq_FindFirstTarget(-9999, 19998, 9999, 9999); if(targetObj){ local targetObj_y = sq_GetYPos(targetObj) - sq_GetYPos(obj); obj.getVar("custom").set_vector(5,targetObj_y); if(sq_GetXPos(targetObj) > sq_GetXPos(obj) && obj.getDirection() == ENUM_DIRECTION_LEFT) sq_SetCurrentDirection(obj, ENUM_DIRECTION_RIGHT); else if(sq_GetXPos(targetObj) < sq_GetXPos(obj) && obj.getDirection() == ENUM_DIRECTION_RIGHT) sq_SetCurrentDirection(obj, ENUM_DIRECTION_LEFT); } obj.getVar("custom").set_vector(6,130); sq_AddDrawOnlyAniFromParent(obj,"passiveobject/character/mage/animation/launchfrostheadjumpeffect.ani",0,-1,-1); break; case 22: local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchfrostheadhit.ani"); obj.setCurrentAnimation(ani); break; case 23: local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchfrostheaddisappear.ani"); obj.setCurrentAnimation(ani); break; } local sizeRate = obj.getVar("custom").get_vector(0); sizeRate = sizeRate.tofloat() / 1000.0; local pAni = obj.getCurrentAnimation(); pAni.setImageRateFromOriginal(sizeRate, sizeRate); pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); break; case 18: switch(state){ case 20: local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatshoot1.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatshoot2.ani"),true); break; case 21: local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatmovego1.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatmovego2.ani"),true); break; case 22: local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatturn1.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatturn2.ani"),true); obj.getVar("custom").set_vector(3,sq_GetXPos(obj)); break; case 23: local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatmovereturn1.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatmovereturn2.ani"),true); obj.resetHitObjectList(); break; case 24: local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatreturn1.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatreturn2.ani"),true); break; } local sizeRate = obj.getVar("custom").get_vector(0); sizeRate = sizeRate.tofloat() / 1000.0; local pAni = obj.getCurrentAnimation(); pAni.setImageRateFromOriginal(sizeRate, sizeRate); pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); break; } break; case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN://元素之幕 break; case ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL://元素奧義 break; case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE://元素震蕩 break; case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER://隕星幻滅 switch(subtype){ case 1: switch(state){ case 20: local randomnumber = obj.getVar("custom").getInt(11); local aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/darkdrop.ani"; if(randomnumber == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/firedrop.ani"; if(randomnumber == 3) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/lightdrop.ani"; if(randomnumber == 4) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/waterdrop.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); local pAni = obj.getCurrentAnimation(); sq_SetFrameDelayTime(pAni, 0, 100); local sizeRate = 2.5; pAni.setImageRateFromOriginal(sizeRate, sizeRate); pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); obj.setTimeEvent(1, 10, 13, true); obj.sq_PlaySound("COLORLESS_CHASER"); break; case 21: local randomnumber = obj.getVar("custom").getInt(11); local aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/darkexp.ani"; if(randomnumber == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/fireexp.ani"; if(randomnumber == 3) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/lightexp.ani"; if(randomnumber == 4) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/waterexp.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); switch(randomnumber){ case 1: currentAni.addLayerAnimation(6,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalshower/darkexplayer.ani"),true); obj.sq_PlaySound("DARK_BOMB"); break; case 2: currentAni.addLayerAnimation(6,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalshower/fireexplayer.ani"),true); obj.sq_PlaySound("FIRE_BOMB"); break; case 3: currentAni.addLayerAnimation(6,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalshower/lightexplayer.ani"),true); obj.sq_PlaySound("LIGHT_BOMB"); break; case 4: currentAni.addLayerAnimation(6,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalshower/waterexplayer.ani"),true); obj.sq_PlaySound("WATER_BOMB"); break; } local sizeRate = 2.5; currentAni.setImageRateFromOriginal(sizeRate, sizeRate); currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); local totalDamage = obj.getVar("custom").getInt(10); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 42)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); //obj.sq_PlaySound("CHASER_EXPLOSION"); break; } break; } break; case ELEMENTALMASTER_SKILL_FLAMESTRIKE://烈焰沖擊 switch(subtype){ case 1: switch(state){ case 20: local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/flamestrike/new/flamestrike_start_floor01.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(10001,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/flamestrike/new/flamestrike_start_floor03.ani"),true); break; case 21: local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/flamestrike/new/flamestrike_blast_front02.ani"); obj.setCurrentAnimation(ani); sq_CreateParticle("passiveobject/character/mage/particle/flamestrikeparticle-1.ptl", obj, 0, 0, 0, true, 1, 0, 1); sq_CreateParticle("passiveobject/character/mage/particle/flamestrikeparticle-2.ptl", obj, 0, 0, 0, true, 1, 0, 1); sq_SetMyShake(obj, 10, 150); break; } local sizeRate = obj.getVar("custom").get_vector(0); sizeRate = sizeRate.tofloat() / 100.0; local pAni = obj.getCurrentAnimation(); pAni.setImageRateFromOriginal(sizeRate, sizeRate); pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); break; case 3: switch(state){ case 20: local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/flamestrike/lv95assimilate/flamestrikea_00.ani"); obj.setCurrentAnimation(ani); break; case 21: local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/flamestrike/lv95assimilate/flamestrikeb_02.ani"); obj.setCurrentAnimation(ani); local group = obj.getVar("custom").get_vector(1); local uniqueId = obj.getVar("custom").get_vector(2); local targetObj = sq_GetObject(obj, group, uniqueId); if(targetObj) sq_SendHitObjectPacket(obj,targetObj,0,0,0); sq_CreateParticle("passiveobject/elementalmaster_bykk/particle/flamestrikeparticlenew1.ptl", obj, 0, 0, 0, true, 1, 0, 1); sq_CreateParticle("passiveobject/elementalmaster_bykk/particle/flamestrikeparticlenew2.ptl", obj, 0, 0, 0, true, 1, 0, 1); sq_SetMyShake(obj, 10, 150); break; } local sizeRate = obj.getVar("custom").get_vector(0); sizeRate = sizeRate.tofloat() / 100.0; local pAni = obj.getCurrentAnimation(); pAni.setImageRateFromOriginal(sizeRate, sizeRate); pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); break; } break; case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER://傑克降臨 switch(subtype){ case 1: case 2: switch(state){ case 20: local aniPath = "passiveobject/elementalmaster_bykk/animation/halloweenbuster/halloweenbustera_meteor_base01.ani"; if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalpotential/halloweenbuster/ep_halloweenbustera_meteor_base01.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); if(subtype == 2){ sq_CreateParticle("passiveobject/elementalmaster_bykk/particle/elementalpotentialhalloweenbursterexp.ptl", obj, 0, 0, 0, true, 30, 0, 1); sq_CreateParticle("passiveobject/elementalmaster_bykk/particle/elementalpotentialhalloweenbursterexpsmoke.ptl", obj, 0, 0, 0, true, 10, 0, 1); } break; case 21: obj.sq_RemoveMoveParticle(); obj.stopTimeEvent(0); obj.stopTimeEvent(1); local aniPath = "passiveobject/elementalmaster_bykk/animation/halloweenbuster/halloweenbuster_explosion_04.ani"; if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalpotential/halloweenbuster/ep_halloweenbuster_explosion_04.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); local totalDamage = obj.getVar("custom").get_vector(2); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 19)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); if(subtype == 2){ local attackInfo = sq_GetCurrentAttackInfo(obj); if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); sq_AddDrawOnlyAniFromParent(obj,"passiveobject/character/mage/animation/elementalpotential/halloweenbuster/ep_halloweenbuster_particle01.ani",0,0,0); } break; } local sizeRate = obj.getVar("custom").get_vector(0); if(state == 21) sizeRate = obj.getVar("custom").get_vector(1); sizeRate = sizeRate.tofloat() / 1000.0; local pAni = obj.getCurrentAnimation(); pAni.setImageRateFromOriginal(sizeRate, sizeRate); pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); break; } break; case ELEMENTALMASTER_SKILL_MIGHTYRUNE://聖靈符文 break; case ELEMENTALMASTER_SKILL_SESTOELEMENTO://第六元素 break; case ELEMENTALMASTER_SKILL_SUNBURST://雷旋 break; case ELEMENTALMASTER_SKILL_THEGATE://元素之門 switch(subtype){ case 1: local aniPath1 = "passiveobject/elementalmaster_bykk/animation/thegate/"; local aniPath2 = "light"; switch(obj.getVar("custom").get_vector(3)){ case 2: aniPath2 = "ice"; break; case 3: aniPath2 = "fire"; break; case 4: aniPath2 = "dark"; break; } switch(state){ case 20: local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/start/" + aniPath2 + "_magic.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath1 + aniPath2 + "/start/" + aniPath2 + "_aura.ani"),true); local pAni = obj.getCurrentAnimation(); pAni.setSpeedRate(200.0); break; case 21: local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/loop/" + aniPath2 + "_magic.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath1 + aniPath2 + "/loop/" + aniPath2 + "_aura.ani"),true); local create_time = obj.getVar("custom").get_vector(2); obj.setTimeEvent(1,create_time,-1,true); break; case 22: obj.stopTimeEvent(1); local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/end/" + aniPath2 + "_magic.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath1 + aniPath2 + "/end/" + aniPath2 + "_aura.ani"),true); break; } break; } break; case ELEMENTALMASTER_SKILL_THUNDERCALLING://天雷 break; case ELEMENTALMASTER_SKILL_THUNDERRAGE://光與暗的交響 break; case ELEMENTALMASTER_SKILL_VOID://虛無之球 switch(subtype){ case 1: switch(state){ case 20: local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/void/void1_start.ani"); obj.setCurrentAnimation(ani); break; case 21: local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/void/void1_loop.ani"); obj.setCurrentAnimation(ani); break; case 22: local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/void/void1_end.ani"); obj.setCurrentAnimation(ani); break; } local sizeRate = obj.getVar("custom").get_vector(2); sizeRate = sizeRate.tofloat() / 100.0; local pAni = obj.getCurrentAnimation(); pAni.setImageRateFromOriginal(sizeRate, sizeRate); pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); break; case 2: switch(state){ case 20: local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/void/lv95assimilate/start_00.ani"); obj.setCurrentAnimation(ani); sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/void/lv95assimilate/start_06.ani",0,0,0); sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/void/lv95assimilate/start_07.ani",0,0,0); break; case 21: local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/void/lv95assimilate/loop_00.ani"); obj.setCurrentAnimation(ani); local timeMax = obj.getVar("custom").get_vector(1); print("timemax = "+timeMax); obj.setTimeEvent(1, timeMax, 1, false); break; case 22: obj.stopTimeEvent(0); local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/void/lv95assimilate/end_04.ani"); obj.setCurrentAnimation(ani); local totalDamage = obj.getVar("custom").get_vector(2); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 33)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); break; } local sizeRate = obj.getVar("custom").get_vector(3); sizeRate = sizeRate.tofloat() / 230.0; local pAni = obj.getCurrentAnimation(); pAni.setImageRateFromOriginal(sizeRate, sizeRate); pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); break; } break; case ELEMENTALMASTER_SKILL_WALLOFICE://冰牆 break; case 38://移動施法 local aniPath1 = "character/mage/effect/animation/magic"; local sub = obj.getVar("custom").get_vector(0); if(sub == 4){ switch(state){ case 20: local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/magiconcharge2_1.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/magiconcharge2_2.ani"),true); break; case 21: local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/magicfullcharge2_1.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/magicfullcharge22_1.ani"),true); break; } return; } switch(state){ case 20: local ani = sq_CreateAnimation("",aniPath1 + "oncharge" + sub.tostring() + "1.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(-1,sq_CreateAnimation("",aniPath1 + "oncharge" + sub.tostring() + "2.ani"),true); break; case 21: local ani = sq_CreateAnimation("",aniPath1 + "fullcharge" + sub + "1.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(-1,sq_CreateAnimation("",aniPath1 + "oncharge" + sub.tostring() + "2.ani"),true); 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_elementalmaster_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 ELEMENTALMASTER_SKILL_ARCTICPISTE://極冰綻放 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; case 3: case 4: sq_SendDestroyPacketPassiveObject(obj); break; } break; case ELEMENTALMASTER_SKILL_BLACKHOLE://黑洞 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 ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND://聖靈水晶 switch(subtype){ case 1: switch(state){ case 20: case 21: case 22: case 23: obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); break; case 24: sq_SendDestroyPacketPassiveObject(obj); break; } break; case 2: case 3: case 4: switch(state){ case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; case 22: sq_SendDestroyPacketPassiveObject(obj); break; } break; } break; case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN://元素點燃 switch(subtype){ case 1: case 2: case 3: case 4: switch(state){ case 20: case 22: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; case 23: case 25: case 28: obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); break; case 27: obj.addSetStatePacket(24, null, STATE_PRIORITY_AUTO, false, ""); break; } break; case 15: if(state == 20) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; case 150: sq_SendDestroyPacketPassiveObject(obj); break; case 16: if(state == 21) obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); else if(state == 22 || state == 23) sq_SendDestroyPacketPassiveObject(obj); break; case 18: switch(state){ case 20: case 21: case 22: case 23: obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); break; case 24: sq_SendDestroyPacketPassiveObject(obj); break } break; } break; case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN://元素之幕 break; case ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL://元素奧義 break; case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE://元素震蕩 switch(subtype){ case 1: sq_SendDestroyPacketPassiveObject(obj); break; case 2: sq_SendDestroyPacketPassiveObject(obj); break; } break; case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER://隕星幻滅 switch(subtype){ case 1: switch(state){ case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; case 21: sq_SendDestroyPacketPassiveObject(obj); break; } break; } break; case ELEMENTALMASTER_SKILL_FLAMESTRIKE://烈焰沖擊 switch(subtype){ case 1: case 3: if(state == 20) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); else sq_SendDestroyPacketPassiveObject(obj); break; case 2: sq_SendDestroyPacketPassiveObject(obj); break; } break; case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER://傑克降臨 if(subtype == 0 || state == 21) sq_SendDestroyPacketPassiveObject(obj); break; case ELEMENTALMASTER_SKILL_MIGHTYRUNE://聖靈符文 break; case ELEMENTALMASTER_SKILL_SESTOELEMENTO://第六元素 sq_SendDestroyPacketPassiveObject(obj); break; case ELEMENTALMASTER_SKILL_SUNBURST://雷旋 sq_SendDestroyPacketPassiveObject(obj); break; case ELEMENTALMASTER_SKILL_THEGATE://元素之門 switch(subtype){ case 1: switch(state){ case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; case 22: sq_SendDestroyPacketPassiveObject(obj); break; } break; case 2: sq_SendDestroyPacketPassiveObject(obj); break; case 10: sq_SendDestroyPacketPassiveObject(obj); break; case 11: sq_SendDestroyPacketPassiveObject(obj); break; } break; case ELEMENTALMASTER_SKILL_THUNDERCALLING://天雷 sq_SendDestroyPacketPassiveObject(obj); break; case ELEMENTALMASTER_SKILL_THUNDERRAGE://光與暗的交響 sq_SendDestroyPacketPassiveObject(obj); break; case ELEMENTALMASTER_SKILL_VOID://虛無之球 switch(subtype){ case 1: case 2: switch(state){ case 20: if(obj.getVar("custom").get_vector(4) > 0) obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); else obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; case 22: sq_SendDestroyPacketPassiveObject(obj); break; } break; } break; case ELEMENTALMASTER_SKILL_WALLOFICE://冰牆 break; case 38://移動施法 if(state == 21) sq_SendDestroyPacketPassiveObject(obj); break; } } function onTimeEvent_po_elementalmaster_bykk_kak(obj, timeEventIndex, timeEventCount) { 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 ELEMENTALMASTER_SKILL_ARCTICPISTE://極冰綻放 switch(timeEventIndex){ case 1: if(timeEventCount >= obj.getVar("custom").get_vector(1)){ obj.stopTimeEvent(1); obj.stopTimeEvent(2); obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); return; } obj.resetHitObjectList(); obj.sq_PlaySound("ARCTICF_MCIRCLE"); break; case 2: local aniPath = ["passiveobject/elementalmaster_bykk/animation/icefield/icefieldnormal1.ani","passiveobject/elementalmaster_bykk/animation/icefield/icefieldnormal2.ani"]; if(subtype == 2) aniPath = ["passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/icearea_att_3.ani","passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/icearea_att2_3.ani"]; local sizeRate = obj.getVar("custom").get_vector(0); local sizeRate_balance = 120; local randomnumber = sq_getRandom(1,100); if(randomnumber > 75) sq_AddDrawOnlyAniFromParent(obj,aniPath[sq_getRandom(0,1)],sq_getRandom(-113,113)*sizeRate/sizeRate_balance,sq_getRandom(-71,71)*sizeRate/sizeRate_balance,0); else if(randomnumber <= 75 && randomnumber > 50) sq_AddDrawOnlyAniFromParent(obj,aniPath[sq_getRandom(0,1)],sq_getRandom(-250,250)*sizeRate/sizeRate_balance,sq_getRandom(-20,20)*sizeRate/sizeRate_balance,0); else if(randomnumber <= 50 && randomnumber > 25) sq_AddDrawOnlyAniFromParent(obj,aniPath[sq_getRandom(0,1)],sq_getRandom(-172,172)*sizeRate/sizeRate_balance,sq_getRandom(-30,30)*sizeRate/sizeRate_balance,0); else sq_AddDrawOnlyAniFromParent(obj,aniPath[sq_getRandom(0,1)],sq_getRandom(-217,217)*sizeRate/sizeRate_balance,sq_getRandom(-43,43)*sizeRate/sizeRate_balance,0); obj.sq_PlaySound("ARCTICF_ICE_OUT"); break; case 3: local pooledObj = createOnlyDrawObject_elementalmaster_bykk(obj,"passiveobject/elementalmaster_bykk/animation/flamestrike/lv95assimilate/flamestrikebottoma_00.ani",true,obj.getDirection(),sq_GetXPos(obj),sq_GetYPos(obj),sq_GetZPos(obj),ENUM_DRAWLAYER_BOTTOM); local sizeRate = obj.getVar("custom").get_vector(0); sizeRate = sizeRate.tofloat() / 100.0; local pAni = pooledObj.getCurrentAnimation(); pAni.setImageRateFromOriginal(sizeRate, sizeRate); pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); break; } break; case ELEMENTALMASTER_SKILL_BLACKHOLE://黑洞 switch(timeEventIndex){ case 0: switch(subtype){ case 1: case 2: obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); break; case 3: sq_SendDestroyPacketPassiveObject(obj); break; } break; case 1: obj.resetHitObjectList(); break; case 2: local sub = obj.getVar("custom").get_vector(6); if(sub > 0){ local sizeRate = obj.getVar("custom").get_vector(0) / 2; local attractPower = obj.getVar("custom").get_vector(1) * 150 / 100; local range = obj.getVar("custom").get_vector(2); local totalDamage2 = obj.getVar("custom").get_vector(3) * 25 / 100; local lifeTime = obj.getVar("custom").get_vector(4) / 2; local totalDamage = obj.getVar("custom").get_vector(5) * 25 / 100; local hitTime = obj.getVar("custom").get_vector(7); local damageRate = totalDamage2 / totalDamage * 100; cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj),obj.getDirection(),ELEMENTALMASTER_SKILL_BLACKHOLE,subtype,totalDamage,sizeRate,lifeTime,damageRate,attractPower,range,0,hitTime,0,0); } break; case 3: obj.stopSound(20); obj.sq_PlaySound("NIGHTH_LOOP",20); break; } break; case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND://聖靈水晶 switch(timeEventIndex){ case 1: obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); break; case 2: obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); break; } break; case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN://元素點燃 switch(subtype){ case 1: case 2: case 3: case 4: switch(timeEventIndex){ case 0: sqrChr.getVar("elementalchain").setBool(0, false); sq_SendDestroyPacketPassiveObject(obj); break; case 1: local addAppendage = CNSquirrelAppendage.sq_GetAppendage(sqrChr,"character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut"); if(!addAppendage) return; addAppendage.getVar().setBool(subtype, false); setElementalChainBuff_bykk(sqrChr,ELEMENTALMASTER_SKILL_ELEMENTALCHAIN,addAppendage); if(obj.getVar("custom").get_vector(1) > 0) obj.addSetStatePacket(27, null, STATE_PRIORITY_AUTO, false, ""); else obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; } break; case 150: local sizeRate = obj.getVar("custom").get_vector(0); sizeRate = sizeRate.tofloat() / 1000.0; switch(timeEventIndex){ case 1: local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/common/animation/fireexplosionparticle1.ani", sq_getRandom(-10,10), sq_getRandom(-10,10), sq_getRandom(-10,10)); local currentAni = pooledObj.getCurrentAnimation(); currentAni.setImageRateFromOriginal(sizeRate, sizeRate); break; case 2: local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/common/animation/fireexplosionparticle2.ani", 0, 2, 0); local currentAni = pooledObj.getCurrentAnimation(); currentAni.setImageRateFromOriginal(sizeRate, sizeRate); break; case 3: local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/common/animation/fireexplosionparticle3.ani", 0, 1, 1); local currentAni = pooledObj.getCurrentAnimation(); local angle = sq_ToRadian(360.0 * timeEventCount / 16); sq_SetfRotateAngle(currentAni, angle); currentAni.setImageRateFromOriginal(sizeRate * 2.0, sizeRate * 2.0); break; case 4: local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/common/animation/fireexplosionparticle4.ani", sq_getRandom(-30,30), sq_getRandom(-30,30), sq_getRandom(-30,30)); local currentAni = pooledObj.getCurrentAnimation(); currentAni.setImageRateFromOriginal(sizeRate, sizeRate); break; } break; case 16: switch(timeEventIndex){ case 0: obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, ""); break; case 1: obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); break; } break; case 17: sq_SendDestroyPacketPassiveObject(obj); break; } break; case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN://元素之幕 switch(timeEventIndex){ case 0: local hitMax = obj.getVar("custom").get_vector(2); if(timeEventCount >= hitMax - 2 && obj.getVar().getBool(0) == false){ obj.getVar().setBool(0,true); local totalDamage = obj.getVar("custom").get_vector(1); local sizeRate = obj.getVar("custom").get_vector(0); cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj),obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN,4,totalDamage,sizeRate,0,0,0,0,0,0,0,0); } if(timeEventCount >= hitMax){obj.stopTimeEvent(0);return;} obj.resetHitObjectList(); break; case 1: if(subtype == 1 && obj.getVar("custom").get_vector(4) > 0){ local size = obj.getVar("targetObj").get_obj_vector_size(); if(size > 0){ for(local i = 0; i < size; i++){ local targetObj = obj.getVar("targetObj").get_obj_vector(i); if(targetObj){ local activeObj = sq_GetCNRDObjectToActiveObject(targetObj); if(activeObj.getVar("elementalcurtain").getBool(0) == true) activeObj.getVar("elementalcurtain").setBool(0, false); } } } } if(subtype == 1){ local size = obj.getVar("target").get_obj_vector_size(); if(size > 0){ for(local i = 0; i < size; i++){ local targetObj = obj.getVar("target").get_obj_vector(i); if(targetObj) CNSquirrelAppendage.sq_RemoveAppendage(targetObj, "character/mage/elementalmaster_bykk/ap/ap_elementalcurtain.nut"); } } } sq_SendDestroyPacketPassiveObject(obj); break; } break; case ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL://元素奧義 break; case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE://元素震蕩 switch(timeEventIndex){ case 1: local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalquake/quakebottom_crack.ani"); obj.setCurrentAnimation(ani); local totalDamage = obj.getVar("custom").get_vector(0); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 12)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); local attackInfo = sq_GetCurrentAttackInfo(obj); if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); local sizeRate = obj.getVar("custom").get_vector(2); sizeRate = sizeRate.tofloat() / 100.0; local pAni = obj.getCurrentAnimation(); pAni.setImageRateFromOriginal(sizeRate, sizeRate); pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); break; case 2: local totalDamage = obj.getVar("custom").get_vector(0) * 10 / 100; local sizeRate = obj.getVar("custom").get_vector(2); cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj),obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALQUAKE,2,totalDamage,sizeRate,0,0,0,0,0,0,0,0); break; } break; case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER://隕星幻滅 switch(timeEventIndex){ case 1: local baseZ = obj.getVar("custom").getInt(12); local MoveZ = sq_GetUniformVelocity(baseZ, 0, timeEventCount, 13); sq_setCurrentAxisPos(obj, 2, MoveZ); if(timeEventCount >= 13){ sq_SetMyShake(obj, 20, 200); local randomnumber = obj.getVar("custom").getInt(11); switch(randomnumber){ case 1: obj.sq_PlaySound("DARK_CHASER"); break; case 1: obj.sq_PlaySound("FIRE_CHASER"); break; case 1: obj.sq_PlaySound("LIGHT_CHASER"); break; case 1: obj.sq_PlaySound("WATER_CHASER"); break; } } break; } break; case ELEMENTALMASTER_SKILL_FLAMESTRIKE://烈焰沖擊 break; case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER://傑克降臨 switch(timeEventIndex){ case 0: obj.resetHitObjectList(); break; case 1: if(sq_GetZPos(obj) <= 0) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; case 2: local sizeRate = obj.getVar("custom").get_vector(0); local sizeRate2 = obj.getVar("custom").get_vector(1); local damageRate = obj.getVar("custom").get_vector(2); local totalDamage = obj.getVar("custom").get_vector(3); local sub = obj.getVar("custom").get_vector(4); local typesub = obj.getVar("custom").get_vector(5); cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,-500,0,sq_GetZPos(obj) + 400,obj.getDirection(),ELEMENTALMASTER_SKILL_HALLOWEENBUSTER,typesub,totalDamage,sizeRate,sizeRate2,damageRate,sub,0,0,0,0,0); break; case 3: sq_SendDestroyPacketPassiveObject(obj); break; case 4: obj.setTimeEvent(2,200,obj.getVar("custom").get_vector(6),true); break; case 5: local x = sq_GetUniformVelocity(0, 500, timeEventCount, 40); local moveX = sq_GetDistancePos(obj.getVar("move").getInt(10), obj.getDirection(), x); local moveZ = sq_GetUniformVelocity(obj.getVar("move").getInt(11), 0, timeEventCount, 40); sq_setCurrentAxisPos(obj, 0, moveX); sq_setCurrentAxisPos(obj, 2, moveZ); if(timeEventCount >= 40) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; } break; case ELEMENTALMASTER_SKILL_MIGHTYRUNE://聖靈符文 break; case ELEMENTALMASTER_SKILL_SESTOELEMENTO://第六元素 if(timeEventIndex == 1) obj.resetHitObjectList(); break; case ELEMENTALMASTER_SKILL_SUNBURST://雷旋 switch(timeEventIndex){ case 1: sqrChr.sq_IntVectClear(); sqrChr.sq_IntVectPush(21); sqrChr.sq_IntVectPush(31); sqrChr.sq_IntVectPush(3); sqrChr.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_ELEMENTALCHAIN, STATE_PRIORITY_IGNORE_FORCE, true); sq_SendDestroyPacketPassiveObject(obj); break; } break; case ELEMENTALMASTER_SKILL_THEGATE://元素之門 switch(timeEventIndex){ case 1: local create_number = obj.getVar("custom").get_vector(1); local totalDamage = obj.getVar("custom").get_vector(0); local sub = obj.getVar("custom").get_vector(3); cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj) - 20,obj.getDirection(),ELEMENTALMASTER_SKILL_THEGATE,2,totalDamage,sub,0,0,0,0,0,0,0,0); if(timeEventCount >= create_number){ obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); return; } break; case 2: local targetObj = obj.getVar("tar").get_obj_vector(0); if(targetObj) sq_SendHitObjectPacket(obj,targetObj,0,0,33); break; } break; case ELEMENTALMASTER_SKILL_THUNDERCALLING://天雷 switch(timeEventIndex){ case 0: break; case 1: sq_SetMyShake(obj,2,100); break; case 2: local totalDamage = obj.getVar("custom").get_vector(0); local sizeRate = obj.getVar("custom").get_vector(1); local range = obj.getVar("custom").get_vector(3); local sub = obj.getVar("custom").get_vector(4); local prob = obj.getVar("custom").get_vector(6); local level = obj.getVar("custom").get_vector(7); local time = obj.getVar("custom").get_vector(8); cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj),obj.getDirection(),ELEMENTALMASTER_SKILL_THUNDERCALLING,sub,totalDamage,sizeRate,range,prob,level,time,0,0,0,0); if(obj.getVar().getBool(0) == false && sub == 2){ if(range <= 0) return; monsterpulled_elementalmaster_bykk(sqrChr,obj,0,0,0,200,range); } break; case 3: sq_SendDestroyPacketPassiveObject(obj); break; case 4: local hitTime = obj.getVar("custom").get_vector(5); local countMax = obj.getVar("custom").get_vector(2); obj.setTimeEvent(2,hitTime,countMax,true); break; } break; case ELEMENTALMASTER_SKILL_THUNDERRAGE://光與暗的交響 if(timeEventIndex == 1) obj.resetHitObjectList(); break; case ELEMENTALMASTER_SKILL_VOID://虛無之球 switch(subtype){ case 1: switch(timeEventIndex){ case 0: obj.resetHitObjectList(); break; case 1: local shoot_range = obj.getVar("custom").get_vector(0); local baseX = obj.getVar("custom").get_vector(1); if(sq_Abs(sq_GetXPos(obj) - baseX) > shoot_range){ obj.stopTimeEvent(0); sq_SendDestroyPacketPassiveObject(obj); } break; } break; case 2: if(timeEventIndex == 0) obj.resetHitObjectList(); else if(timeEventIndex == 1) obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); break; } break; case ELEMENTALMASTER_SKILL_WALLOFICE://冰牆 break; case 38://移動施法 if(timeEventIndex == 0) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; } } function onAttack_po_elementalmaster_bykk_kak(obj, damager, boundingBox, isStuck) { if(!obj) return; //enableClearDeadEnemies(obj, damager); 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 ELEMENTALMASTER_SKILL_ARCTICPISTE://極冰綻放 if(damager.isObjectType(OBJECTTYPE_ACTIVE) && damager.getState() != STATE_DIE){ local activeObj = sq_GetCNRDObjectToActiveObject(damager); local minus_Rate = obj.getVar("custom").get_vector(4); if(!sq_IsFixture(activeObj) && activeObj.getVar().getInt(100) < 1){ activeObj.getVar().setInt(100,100); local ap = sq_CreateChangeStatus(CHANGE_STATUS_TYPE_MOVE_SPEED, true, -minus_Rate.tofloat(), 0); if(ap){ ap.getAppendageInfo().setValidTime(3000); ap.sq_Append(activeObj, obj); } } } break; case ELEMENTALMASTER_SKILL_BLACKHOLE://黑洞 break; case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND://聖靈水晶 break; case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN://元素點燃 switch(subtype){ case 15: switch(state){ case 21: local totalDamage = obj.getVar("custom").get_vector(4); local powerDamage = obj.getVar("custom").get_vector(5); local sizeRate = obj.getVar("custom").get_vector(1); cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj),obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALCHAIN,150,totalDamage,powerDamage,sizeRate,0,0,0,0,0,0,0); sq_SendDestroyPacketPassiveObject(obj); break; } break; case 16: obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); break; case 17: local speed_time = obj.getVar("custom").get_vector(8); local movespeed_rate = obj.getVar("custom").get_vector(9); local attackspeed_rate = obj.getVar("custom").get_vector(10); local ap = sq_CreateChangeStatus(CHANGE_STATUS_TYPE_MOVE_SPEED, true, -(movespeed_rate * 0.1).tofloat(), speed_time); local ap2 = sq_CreateChangeStatus(CHANGE_STATUS_TYPE_ATTACK_SPEED, true, -(attackspeed_rate * 0.1).tofloat(), speed_time); if(ap && damager.getVar().getBool(0) == false) {damager.getVar().setBool(0,true);ap.sq_Append(damager, obj);} if(ap2 && damager.getVar().getBool(1) == false) {damager.getVar().setBool(1,true);ap2.sq_Append(damager, obj);} sq_SendDestroyPacketPassiveObject(obj); break; } break; case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN://元素之幕 if(damager.isObjectType(OBJECTTYPE_ACTIVE)){ damager = sq_GetCNRDObjectToActiveObject(damager); if(damager.getState() == STATE_DIE) return; switch(subtype){ case 1: sq_AddDrawOnlyAniFromParent(damager,"passiveobject/elementalmaster_bykk/animation/elementalcurtain/elementalcurtain_hit.ani",0,0,sq_GetCenterZPos(boundingBox)); if(damager.getVar("elementalcurtain").getBool(0) == false && obj.getVar("custom").get_vector(4) > 0){ damager.getVar("elementalcurtain").setBool(0, true); obj.getVar("targetObj").push_obj_vector(damager); local totalDamage = obj.getVar("custom").get_vector(3) * 45 / 100; cearteSkillPassive_Elementalmaster_bykk(sqrChr,damager,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj) + 380,obj.getDirection(),ELEMENTALMASTER_SKILL_THEGATE,1,totalDamage,20,100,sq_getRandom(1,4),sq_GetGroup(damager),sq_GetUniqueId(damager),0,0,0,0); } if(damager.isObjectType(OBJECTTYPE_ACTIVE) && !CNSquirrelAppendage.sq_IsAppendAppendage(damager, "character/mage/elementalmaster_bykk/ap/ap_elementalcurtain.nut")){ obj.getVar("target").push_obj_vector(damager); local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(damager, obj, -1, false, "character/mage/elementalmaster_bykk/ap/ap_elementalcurtain.nut", true); sq_HoldAndDelayDie(damager, obj, true, false, false, 200, 200, ENUM_DIRECTION_NEUTRAL , AddAppendage); } break; case 2: sq_AddDrawOnlyAniFromParent(damager,"passiveobject/elementalmaster_bykk/animation/elementalcurtain/elementalcurtain_finishhit.ani",0,0,sq_GetCenterZPos(boundingBox)); break; } } break; case ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL://元素奧義 break; case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE://元素震蕩 if(damager.isObjectType(OBJECTTYPE_ACTIVE)){ if(!CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/elementalmaster_bykk/skillnut/ap_elementalquake.nut")){ local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(damager, obj, -1, false, "character/mage/elementalmaster_bykk/skillnut/ap_elementalquake.nut", true); sq_HoldAndDelayDie(damager, obj, true, true, true, 200, 200, ENUM_DIRECTION_NEUTRAL , AddAppendage); } } break; case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER://隕星幻滅 break; case ELEMENTALMASTER_SKILL_FLAMESTRIKE://烈焰沖擊 switch(subtype){ case 2: if(damager.isObjectType(OBJECTTYPE_ACTIVE)){ damager = sq_GetCNRDObjectToActiveObject(damager); if(CNSquirrelAppendage.sq_IsAppendAppendage(damager, "character/mage/elementalmaster_bykk/ap/ap_flamestrike.nut")) CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_flamestrike.nut"); local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(damager, obj, -1, false, "character/mage/elementalmaster_bykk/ap/ap_flamestrike.nut", true); local time = 600 + obj.getVar("custom").get_vector(2); AddAppendage.sq_SetValidTime(time); sq_HoldAndDelayDie(damager, obj, true, true, true, 50, 300, ENUM_DIRECTION_NEUTRAL , AddAppendage); local sizeRate = obj.getVar("custom").get_vector(0); local totalDamage = obj.getVar("custom").get_vector(1); local group = sq_GetGroup(damager); local uniqueId = sq_GetUniqueId(damager); cearteSkillPassive_Elementalmaster_bykk(sqrChr,damager,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj),ENUM_DIRECTION_RIGHT,ELEMENTALMASTER_SKILL_FLAMESTRIKE,3,totalDamage,sizeRate,group,uniqueId,0,0,0,0,0,0); } break; } break; case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER://傑克降臨 break; case ELEMENTALMASTER_SKILL_MIGHTYRUNE://聖靈符文 break; case ELEMENTALMASTER_SKILL_SESTOELEMENTO://第六元素 break; case ELEMENTALMASTER_SKILL_SUNBURST://雷旋 break; case ELEMENTALMASTER_SKILL_THEGATE://元素之門 switch(subtype){ case 2: local sub = obj.getVar("custom").get_vector(1); local aniPath2 = "light"; switch(sub){ case 2: aniPath2 = "ice"; break; case 3: aniPath2 = "fire"; break; case 4: aniPath2 = "dark"; break; } sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/thegate/"+aniPath2+"/"+aniPath2+"_shock.ani",0,0,0); sq_SendDestroyPacketPassiveObject(obj); break; } break; case ELEMENTALMASTER_SKILL_THUNDERCALLING://天雷 break; case ELEMENTALMASTER_SKILL_THUNDERRAGE://光與暗的交響 break; case ELEMENTALMASTER_SKILL_VOID://虛無之球 break; case ELEMENTALMASTER_SKILL_WALLOFICE://冰牆 break; case 38://移動施法 break; } } function onKeyFrameFlag_po_elementalmaster_bykk_kak(obj, flagIndex) { 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 ELEMENTALMASTER_SKILL_ARCTICPISTE://極冰綻放 if(flagIndex == 1){ local sizeRate = obj.getVar("custom").getInt(10); sizeRate = sizeRate.tofloat() / 100.0; local pooledObj = sq_AddDrawOnlyAniFromParent(obj, "passiveobject/elementalmaster_bykk/animation/icefield/new/icefielddisappear1.ani", 0, 0, 0); local pAni = pooledObj.getCurrentAnimation(); pAni.setImageRateFromOriginal(sizeRate, sizeRate); pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); } break; case ELEMENTALMASTER_SKILL_BLACKHOLE://黑洞 break; case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND://聖靈水晶 break; case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN://元素點燃 break; case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN://元素之幕 switch(flagIndex){ case 1: sq_SetMyShake(obj,8,200); break; } break; case ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL://元素奧義 break; case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE://元素震蕩 switch(flagIndex){ case 1: sq_flashScreen(obj,0, 50, 150, 51, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); sq_SetMyShake(obj,6,360); break; case 2: obj.resetHitObjectList(); break; case 3: sq_flashScreen(obj,0, 50, 200, 76, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); sq_SetMyShake(obj,7,360); break; case 4: sq_flashScreen(obj,0, 300, 300, 102, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); sq_SetMyShake(obj,8,500); break; case 5: local totalDamage = obj.getVar("custom").get_vector(0); local damageRate = obj.getVar("custom").get_vector(1); totalDamage = totalDamage * damageRate / 100; sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 12)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); if(obj.getVar("custom").get_vector(3) < 1){ if(sqrChr){ sqrChr.sq_IntVectClear(); sqrChr.sq_IntVectPush(3); sqrChr.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, STATE_PRIORITY_USER, true); } } break; case 6: sq_flashScreen(obj,0, 60, 500, 127, sq_RGB(255,255,255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); sq_SetMyShake(obj,10,500); break; } break; case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER://隕星幻滅 break; case ELEMENTALMASTER_SKILL_FLAMESTRIKE://烈焰沖擊 break; case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER://傑克降臨 break; case ELEMENTALMASTER_SKILL_MIGHTYRUNE://聖靈符文 break; case ELEMENTALMASTER_SKILL_SESTOELEMENTO://第六元素 break; case ELEMENTALMASTER_SKILL_SUNBURST://雷旋 break; case ELEMENTALMASTER_SKILL_THEGATE://元素之門 switch(flagIndex){ case 25: local totalDamage = obj.getVar("custom").getInt(0); local sub = obj.getVar("custom").getInt(1); local group = obj.getVar("custom").getInt(2); local uniqueId = obj.getVar("custom").getInt(3); local targetObj = sq_GetObject(obj, group, uniqueId); if(targetObj && targetObj.getState() != STATE_DIE){ cearteSkillPassive_Elementalmaster_bykk(obj,targetObj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,0,obj.getDirection(),ELEMENTALMASTER_SKILL_THEGATE,11,totalDamage,sub,group,uniqueId,0,0,0,0,0,0); } break; } break; case ELEMENTALMASTER_SKILL_THUNDERCALLING://天雷 break; case ELEMENTALMASTER_SKILL_THUNDERRAGE://光與暗的交響 break; case ELEMENTALMASTER_SKILL_VOID://虛無之球 if(subtype == 1 && flagIndex == 1){ local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(3,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/void/void4.ani"),true); } if(subtype == 2 && flagIndex == 1){ local hitTime = obj.getVar("custom").get_vector(0); print("hittime = "+hitTime); obj.setTimeEvent(0,hitTime,-1,false); } break; case ELEMENTALMASTER_SKILL_WALLOFICE://冰牆 break; case 38://移動施法 break; } } function procAppend_po_elementalmaster_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 ELEMENTALMASTER_SKILL_ARCTICPISTE://極冰綻放 break; case ELEMENTALMASTER_SKILL_BLACKHOLE://黑洞 break; case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND://聖靈水晶 break; case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN://元素點燃 switch(subtype){ case 1: case 2: case 3: case 4: if(!sqrChr || sqrChr.getState() == STATE_DIE){sq_SendDestroyPacketPassiveObject(obj); break;} switch(state){ case 28: case 29: local currentT = sq_GetObjectTime(obj); local currentSpeedRate = 1.0 ; local defaultRoundTime = 5120; local radius = 50; local base100Angle = 0; switch(subtype){ case 1: base100Angle = 4500; break; case 2: base100Angle = 13500; break; case 3: base100Angle = 22500; break; case 4: base100Angle = 31500; break; } local baseX = sqrChr.getXPos(); local baseY = sqrChr.getYPos(); local current100Angle = (base100Angle + (36000 * currentSpeedRate * currentT / defaultRoundTime)) % 36000; local angle = (current100Angle.tofloat() / 100.0); local disMovLen = radius * sq_CosTable(angle.tointeger()); local mov_x = sq_GetDistancePos(baseX, ENUM_DIRECTION_LEFT, disMovLen.tointeger()); local axisMagnifyRate = 50 * 0.5; local upMovLen = radius * sq_SinTable(angle.tointeger()) * axisMagnifyRate / 100; local mov_y = baseY + upMovLen.tointeger(); local mov_z = sq_GetZPos(sqrChr) + 35; local offset_z = 13; if(subtype == 2 || subtype == 4) offset_z = -13; if(currentT % defaultRoundTime <= 1280 && currentT % defaultRoundTime > 0) mov_z = mov_z + sq_GetUniformVelocity(0, offset_z, currentT % defaultRoundTime, 1280); else if(currentT % defaultRoundTime <= 2560 && currentT % defaultRoundTime > 1280) mov_z = mov_z + sq_GetUniformVelocity(offset_z, 0, currentT % defaultRoundTime - 1280, 1280); else if(currentT % defaultRoundTime <= 3840 && currentT % defaultRoundTime > 2560) mov_z = mov_z + sq_GetUniformVelocity(0, -offset_z, currentT % defaultRoundTime - 2560, 1280); else if(currentT % defaultRoundTime <= 5120 && currentT % defaultRoundTime > 3840) mov_z = mov_z + sq_GetUniformVelocity(-offset_z, 0, currentT % defaultRoundTime - 3840, 1280); sq_setCurrentAxisPos(obj, 0, mov_x); sq_setCurrentAxisPos(obj, 1, mov_y); sq_setCurrentAxisPos(obj, 2, mov_z);//sqrChr.getZPos() + 30); break; } break; case 15: switch(state){ case 21: local pAni = obj.getCurrentAnimation(); local currentT = sq_GetCurrentTime(pAni); local fireT = 800; local srcX = obj.getVar("custom").get_vector(3); local MoveX = obj.getVar("custom").get_vector(2) * 4 / 10; local v = sq_GetUniformVelocity(0, MoveX, currentT, fireT); local dstX = sq_GetDistancePos(srcX, obj.getDirection(), v); sq_setCurrentAxisPos(obj, 0, dstX); if(currentT > fireT) sq_SendDestroyPacketPassiveObject(obj); break; } break; case 16: switch(state){ case 20: local pAni = obj.getCurrentAnimation(); local currentT = sq_GetCurrentTime(pAni); local fireT = 500; local srcX = obj.getVar("custom").get_vector(1); local srcY = obj.getVar("custom").get_vector(2); local srcZ = obj.getVar("custom").get_vector(3); local MoveX = obj.getVar("custom").get_vector(4); local MoveY = obj.getVar("custom").get_vector(5); local MoveZ = obj.getVar("custom").get_vector(6); if(MoveY != 0){ if(MoveY > 8) MoveY = 8; else if(MoveY < -8) MoveY = -8; local vy = sq_GetUniformVelocity(0, MoveY, currentT, fireT); sq_setCurrentAxisPos(obj, 1, srcY + vy); } local vx = sq_GetUniformVelocity(0, MoveX, currentT, fireT); local dstX = sq_GetDistancePos(srcX, obj.getDirection(), vx);//根據方向運算當前數值 sq_setCurrentAxisPos(obj, 0, dstX);//設置當前x坐標 local vz = 0; if(MoveZ > 0){ vz = sq_GetAccel(0, MoveZ, currentT, fireT, true); if(currentT > 250) vz = sq_GetAccel(MoveZ, 0, currentT, fireT, false); } else{ vz = sq_GetAccel(sq_GetZPos(obj), 0, currentT, fireT, false); currentT = currentT + 250; } sq_setCurrentAxisPos(obj, 2, vz);//設置當前x坐標 if(currentT >= fireT) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; } break; case 17: local currentT = sq_GetObjectTime(obj); local currentSpeedRate = 1.0 ; local defaultRoundTime = 1200; local radius = 65; local base100Angle = obj.getVar("custom").get_vector(0) * 100; local baseX = obj.getVar("custom").get_vector(1); local baseY = obj.getVar("custom").get_vector(2); local current100Angle = (base100Angle + (36000 * currentSpeedRate * currentT / defaultRoundTime)) % 36000; local angle = (current100Angle.tofloat() / 100.0); local disMovLen = radius * sq_CosTable(angle.tointeger()); local mov_x = sq_GetDistancePos(baseX, ENUM_DIRECTION_LEFT, disMovLen.tointeger()); local axisMagnifyRate = radius * 0.5; local upMovLen = radius * sq_SinTable(angle.tointeger()) * axisMagnifyRate / 100; local mov_y = baseY + upMovLen.tointeger(); sq_setCurrentAxisPos(obj, 0, mov_x); sq_setCurrentAxisPos(obj, 1, mov_y); break; case 18: switch(state){ case 21: local pAni = obj.getCurrentAnimation(); local currentT = sq_GetCurrentTime(pAni); local fireT = 300; local speed_rate = obj.getVar("custom").get_vector(1); if(speed_rate > 0) fireT = fireT * (1000 - speed_rate) / 1000; local srcX = obj.getVar("custom").get_vector(3); local srcZ = obj.getVar("custom").get_vector(4); local MoveX = obj.getVar("custom").get_vector(2); local v = sq_GetUniformVelocity(0, MoveX, currentT, fireT); local vz = sq_GetUniformVelocity(srcZ, 0, currentT, fireT); local dstX = sq_GetDistancePos(srcX, obj.getDirection(), v); sq_setCurrentAxisPos(obj, 0, dstX); sq_setCurrentAxisPos(obj, 2, vz); if(currentT > fireT) obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); break; case 23: if(!sqrChr) sq_SendDestroyPacketPassiveObject(obj); local pAni = obj.getCurrentAnimation(); local currentT = sq_GetCurrentTime(pAni); local fireT = 400; local speed_rate = obj.getVar("custom").get_vector(1); if(speed_rate > 0) fireT = fireT * (1000 - speed_rate) / 1000; if(sq_GetDistanceObject(obj, sqrChr, false) < 20){ obj.addSetStatePacket(24, null, STATE_PRIORITY_AUTO, false, ""); } local srcZ = obj.getVar("custom").get_vector(4); local X1 = sq_GetAccel(obj.getXPos(), sqrChr.getXPos(), currentT, fireT, true); local Y1 = sq_GetAccel(obj.getYPos(), sqrChr.getYPos(), currentT, fireT, true); local vz = sq_GetAccel(0, srcZ * 2, currentT, fireT, true); sq_setCurrentAxisPos(obj, 0, X1); sq_setCurrentAxisPos(obj, 1, Y1); sq_setCurrentAxisPos(obj, 2, vz); break; } break; } break; case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN://元素之幕 break; case ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL://元素奧義 break; case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE://元素震蕩 break; case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER://隕星幻滅 break; case ELEMENTALMASTER_SKILL_FLAMESTRIKE://烈焰沖擊 break; case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER://傑克降臨 break; case ELEMENTALMASTER_SKILL_MIGHTYRUNE://聖靈符文 break; case ELEMENTALMASTER_SKILL_SESTOELEMENTO://第六元素 break; case ELEMENTALMASTER_SKILL_SUNBURST://雷旋 break; case ELEMENTALMASTER_SKILL_THEGATE://元素之門 switch(subtype){ case 1: switch(state){ case 20: case 21: local targetObj = obj.getVar().get_obj_vector(0); if(!targetObj || targetObj.getState() == STATE_DIE) obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); break; } break; case 2: local pAni = obj.getCurrentAnimation(); local currentT = sq_GetCurrentTime(pAni); local fireT = pAni.getDelaySum(false); local srcZ = obj.getVar("custom").get_vector(0); local v = sq_GetUniformVelocity(srcZ, 0, currentT, fireT); sq_setCurrentAxisPos(obj, 2, v); break; } break; case ELEMENTALMASTER_SKILL_THUNDERCALLING://天雷 break; case ELEMENTALMASTER_SKILL_THUNDERRAGE://光與暗的交響 break; case ELEMENTALMASTER_SKILL_VOID://虛無之球 break; case ELEMENTALMASTER_SKILL_WALLOFICE://冰牆 break; case 38://移動施法 break; } }