function createOnlyDrawObject_Swordman_bykk(obj,aniPath,isTrue,direction,x,y,z,drawlayer) { local ani = sq_CreateAnimation("",aniPath); local pooledObj = sq_CreatePooledObject(ani,isTrue); sq_SetCurrentDirection(pooledObj, direction); pooledObj.setCurrentPos(x,y,z); pooledObj = sq_SetEnumDrawLayer(pooledObj, drawlayer); sq_AddObject(obj, pooledObj, OBJECTTYPE_DRAWONLY, false); return pooledObj; } function createOnlyDrawObjectEX_Swordman_bykk(obj,aniPath,isTrue,direction,x,y,z,drawlayer,sizeRateX,sizeRateY) { local ani = sq_CreateAnimation("",aniPath); local pooledObj = sq_CreatePooledObject(ani,isTrue); sq_SetCurrentDirection(pooledObj, direction); pooledObj.setCurrentPos(x,y,z); local currentAni = pooledObj.getCurrentAnimation(); sizeRateX = sizeRateX.tofloat() / 100.0; sizeRateY = sizeRateY.tofloat() / 100.0; currentAni.setImageRateFromOriginal(sizeRateX, sizeRateY); pooledObj = sq_SetEnumDrawLayer(pooledObj, drawlayer); sq_AddObject(obj, pooledObj, OBJECTTYPE_DRAWONLY, false); return pooledObj; } function createSkillPassive_Swordman_bykk(obj,passiveObj,objnum,x,y,z,direction,job,skillIndex,subtype,pushv1,pushv2,pushv3,pushv4,pushv5,pushv6,pushv7,pushv8) { if(!obj || !passiveObj || obj.getState() == STATE_DIE) return; local destX_01 = 0; local destY_01 = 0; if(!isSameObject(obj, passiveObj)){ destX_01 = passiveObj.getXPos() - obj.getXPos(); destY_01 = passiveObj.getYPos() - obj.getYPos(); if(direction == ENUM_DIRECTION_LEFT) destX_01 = obj.getXPos() - passiveObj.getXPos(); } sq_BinaryStartWrite(); sq_BinaryWriteDword(job); sq_BinaryWriteDword(skillIndex); sq_BinaryWriteDword(subtype); sq_BinaryWriteDword(pushv1); sq_BinaryWriteDword(pushv2); sq_BinaryWriteDword(pushv3); sq_BinaryWriteDword(pushv4); sq_BinaryWriteDword(pushv5); sq_BinaryWriteDword(pushv6); sq_BinaryWriteDword(pushv7); sq_BinaryWriteDword(pushv8); sq_SendCreatePassiveObjectPacket(obj, objnum, 0, destX_01 + x, destY_01 + y, z, direction); } //obj function setCustomData_po_swordman_bykk(obj, receiveData) { if(!obj) return; local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); if(!sqrChr) return; local job = receiveData.readDword(); local skillIndex = receiveData.readDword(); local subtype = receiveData.readDword(); obj.getVar("job").setInt(0, job); obj.getVar("skillIndex").setInt(0, skillIndex); obj.getVar("subtype").setInt(0, subtype); switch(job){ case 0: break; case 1: switch(skillIndex){ case SKILL_SMBYKK_ASHENFORK: switch(subtype){ case 1: local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); print("sizeRate = "+sizeRate); local ani = sq_CreateAnimation("","passiveobject/0_swordman_bykk/1weaponmaster/animation/ashenforksub.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/0_swordman_bykk/1weaponmaster/animation/ashenforksubflash.ani"),true); sq_AddDrawOnlyAniFromParent(obj, "passiveobject/0_swordman_bykk/1weaponmaster/animation/ashenforksubdust.ani", 0, 0, 0); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 0)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); if(sizeRate > 100){ local currentAni = obj.getCurrentAnimation(); sizeRate = sizeRate.tofloat() / 100.0; currentAni.setImageRateFromOriginal(sizeRate, sizeRate); currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); } sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); break; case 2: local totalDamage = receiveData.readDword(); local hitMax = receiveData.readDword(); local sizeRate = receiveData.readDword(); local currentAni = obj.getCurrentAnimation(); sq_AddAttackBox(currentAni, -110, -40, -17, 220, 80, 40); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 0)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); obj.sq_SetMaxHitCounterPerObject(hitMax); sq_SetFrameDelayTime(currentAni, 0, 165); sq_SetFrameDelayTime(currentAni, 1, 165); obj.setTimeEvent(0, 17, -1, true); if(sizeRate > 100){ local currentAni = obj.getCurrentAnimation(); sizeRate = sizeRate.tofloat() / 100.0; sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); } break; } break; case SKILL_SMBYKK_WEAPONCOMBO: switch(subtype){ case 1: local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local subState = receiveData.readDword(); local aniPath = ["passiveobject/0_swordman_bykk/1weaponmaster/animation/weaponshortswordsub/short_new_01_wave.ani","passiveobject/0_swordman_bykk/1weaponmaster/animation/weaponshortswordsub/short_new_03_wave.ani","passiveobject/0_swordman_bykk/1weaponmaster/animation/weaponshortswordsub/short_new_01_wave.ani"]; local ani = sq_CreateAnimation("",aniPath[subState]); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 49)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); if(sizeRate > 100){ local currentAni = obj.getCurrentAnimation(); sizeRate = sizeRate.tofloat() / 800.0; currentAni.setImageRateFromOriginal(sizeRate, sizeRate); currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); } break; case 2: local totalDamage = receiveData.readDword(); local ani = sq_CreateAnimation("", "passiveobject/0_swordman_bykk/1weaponmaster/animation/weaponcomboheavywind/ura_ls_wind_05.ani"); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 33)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); break; } break; case SKILL_SMBYKK_CHARGECRASH: switch(subtype){ case 1: local totalDamage = receiveData.readDword(); local ani = sq_CreateAnimation("", "passiveobject/0_swordman_bykk/1weaponmaster/animation/chargecrash/damage-back.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(6,sq_CreateAnimation("","passiveobject/0_swordman_bykk/1weaponmaster/animation/chargecrash/damage-front.ani"),true); currentAni.setSpeedRate(130.0); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 1)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); break; } break; case SKILL_SMBYKK_FLOWMINDTWO: switch(subtype){ case 1: local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local ani = sq_CreateAnimation("", "passiveobject/character/swordman/animation/bluntmasterysub/hit.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(5,sq_CreateAnimation("","passiveobject/character/swordman/animation/bluntmasterysub/sub1.ani"),true); currentAni.addLayerAnimation(6,sq_CreateAnimation("","passiveobject/character/swordman/animation/bluntmasterysub/sub2.ani"),true); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 3)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); local attackInfo = sq_GetCurrentAttackInfo(obj); sq_SetAddWeaponDamage(attackInfo, true); if(sizeRate > 100){ local currentAni = obj.getCurrentAnimation(); sizeRate = sizeRate.tofloat() / 100.0; currentAni.setImageRateFromOriginal(sizeRate, sizeRate); currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); } sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); sq_SetMyShake(obj, 2, 120); break; } break; case SKILL_SMBYKK_FLOWMINDTHREE: switch(subtype){ case 1: local totalDamage = receiveData.readDword(); local group = receiveData.readDword(); local uniqueId = receiveData.readDword(); local targetObj = sq_GetObject(obj, group, uniqueId); if(targetObj && targetObj.getState() != STATE_DIE){ obj.getVar("custom").setInt(0, totalDamage); obj.getVar("tar").clear_obj_vector(); obj.getVar("tar").push_obj_vector(targetObj); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 50)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); obj.setTimeEvent(1, 50, 1, false); local currentAni = obj.getCurrentAnimation(); sq_SetFrameDelayTime(currentAni, 0, 100); sq_SetFrameDelayTime(currentAni, 1, 100); } break; } break; case SKILL_SMBYKK_MOMENTARYSLASH: switch(subtype){ case 1: local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local speedRate = receiveData.readDword(); local weaponSubType = receiveData.readDword(); local sub = receiveData.readDword(); obj.getVar("custom").setInt(0, totalDamage); obj.getVar("custom").setInt(1, weaponSubType); obj.getVar("custom").setInt(2, sq_GetIntData(sqrChr, SKILL_SMBYKK_MOMENTARYSLASH, 5)); obj.getVar("custom").setInt(3, sq_GetIntData(sqrChr, SKILL_SMBYKK_MOMENTARYSLASH, 6)); obj.getVar("custom").setInt(4, sub); local baseAniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/"; local aniPath = ["momentaryslash/momentaryslash_0.ani", "momentaryslash/momentaryslash_1.ani", "momentaryslash/momentaryslash_2.ani", "momentaryslash/momentaryslash_3.ani", "momentaryslash/momentaryslash_4.ani", "momentaryslash/momentaryslash_5.ani"]; local atkIndex = [57,52,53,54,0,56]; local ani = sq_CreateAnimation("", baseAniPath + aniPath[weaponSubType]); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, atkIndex[weaponSubType] - sub)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); local currentAni = obj.getCurrentAnimation(); currentAni.setSpeedRate(speedRate.tofloat()); if(sizeRate > 100){ sizeRate = sizeRate.tofloat() / 100.0; sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); } if(weaponSubType == 5 && sq_GetSkillLevel(sqrChr, SKILL_SMBYKK_LIGHTSWORDMASTERY) >= 7){ local attackInfo = sq_GetCurrentAttackInfo(obj); local skillLevel = sq_GetSkillLevel(sqrChr, SKILL_SMBYKK_LIGHTSWORDMASTERY); local proc = sq_GetLevelData(sqrChr, SKILL_SMBYKK_LIGHTSWORDMASTERY, 9, skillLevel); local time = sq_GetLevelData(sqrChr, SKILL_SMBYKK_LIGHTSWORDMASTERY, 11, skillLevel); local level = sq_GetSkillLevel(sqrChr, 174) + 5; sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_LIGHTNING, proc, level, time); } break; case 2: local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); obj.getVar("custom").setInt(0, sizeRate); local ani = sq_CreateAnimation("", "passiveobject/0_swordman_bykk/1weaponmaster/animation/momentaryslash/start.ani"); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 20)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); obj.sq_SetMoveParticle("particle/1weaponmaster/momentaryslash.ptl", 0.0, 0.0); sq_SetSpeedToMoveParticle(obj, 0, 300); break; case 3: local totalDamage = receiveData.readDword(); local group = receiveData.readDword(); local uniqueId = receiveData.readDword(); local targetObj = sq_GetObject(obj, group, uniqueId); if(targetObj && targetObj.getState() != STATE_DIE){ obj.getVar("tar").clear_obj_vector(); obj.getVar("tar").push_obj_vector(targetObj); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 53)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); obj.setTimeEvent(10, 10, 1, false); local currentAni = obj.getCurrentAnimation(); sq_SetFrameDelayTime(currentAni, 0, 50); sq_SetFrameDelayTime(currentAni, 1, 50); } break; case 4: local totalDamage = receiveData.readDword(); local group = receiveData.readDword(); local uniqueId = receiveData.readDword(); local targetObj = sq_GetObject(obj, group, uniqueId); if(targetObj && targetObj.getState() != STATE_DIE){ obj.getVar("tar").clear_obj_vector(); obj.getVar("tar").push_obj_vector(targetObj); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 53)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); obj.getVar("custom").setInt(0, sq_GetZPos(targetObj)); obj.getVar("custom").setInt(1, sq_GetZPos(obj)); local ani = sq_CreateAnimation("", "character/swordman/effect/animation/1_swordman_bykk/momentaryslash/rorate.ani"); obj.setCurrentAnimation(ani); if(!CNSquirrelAppendage.sq_IsAppendAppendage(targetObj, "character/swordman/1weaponmaster_bykk/ap_momentaryslash_blunt.nut")){ local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(targetObj, obj, -1, false, "character/swordman/1weaponmaster_bykk/ap_momentaryslash_blunt.nut", true); sq_HoldAndDelayDie(targetObj, obj, true, true, true, 200, 200, ENUM_DIRECTION_NEUTRAL, AddAppendage); } obj.setTimeEvent(11, 1, 60, true); } break; case 5:// local group = receiveData.readDword(); local uniqueId = receiveData.readDword(); break; } break; case SKILL_SMBYKK_ILLUSIONSLASH: switch(subtype){ case 0: local subState = receiveData.readDword(); local speedRate = receiveData.readDword(); local ani = sq_GetCustomAni(sqrChr, ANI_SMBYKK_ILLUSIONSLASH1_SHADOW + subState); sq_Rewind(ani); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.setSpeedRate(speedRate.tofloat()); break; case 1: local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local sub = receiveData.readDword() - 1000; local weaponSubType = receiveData.readDword(); local ani = sq_CreateAnimation("","passiveobject/0_swordman_bykk/1weaponmaster/animation/illusionslashmelee"+sub.tostring()+".ani"); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 11)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); local speed = 100.0; if(weaponSubType == 0){ speed = 60.0; local currentAni = obj.getCurrentAnimation(); currentAni.setSpeedRate(60.0); } // if(sq_GetDirection(obj) == ENUM_DIRECTION_RIGHT) sq_SetVelocity(obj, 0, 100.0); // else sq_SetVelocity(obj, 0, -100.0); obj.sq_SetMoveParticle("particle/1weaponmaster/illusionslashmelee.ptl", 0.0, 0.0); if(sizeRate > 100){ local currentAni = obj.getCurrentAnimation(); sizeRate = sizeRate.tofloat() / 100.0; currentAni.setImageRateFromOriginal(sizeRate, sizeRate); currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); } break; case 2: local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local weaponSubType = receiveData.readDword(); local bonusGet = receiveData.readDword(); local speedRate = receiveData.readDword(); local aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/illusionslashwave.ani"; if(weaponSubType == 2) aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/illusionslashsub/1_shockwave_dodge.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, weaponSubType==2?13:12)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); local currentAni = obj.getCurrentAnimation(); if(weaponSubType != 2){ currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/0_swordman_bykk/1weaponmaster/animation/illusionslashwavebottom1.ani"),true); currentAni.addLayerAnimation(-2,sq_CreateAnimation("","passiveobject/0_swordman_bykk/1weaponmaster/animation/illusionslashwavebottom2.ani"),true); sq_CreateParticle("passiveobject/0_swordman_bykk/particle/1weaponmaster/illusionslash.ptl", obj, 0, -30, 0, true, 30, 0, 1); sq_CreateParticle("passiveobject/0_swordman_bykk/particle/1weaponmaster/illusionslash.ptl", obj, 0, 30, 0, true, 30, 0, 1); obj.sq_SetMoveParticle("particle/1weaponmaster/illusionslash_move.ptl", 0.0, 0.0); sq_SetSpeedToMoveParticle(obj, 0, weaponSubType==0?300:375); local hitMax = sq_GetIntData(sqrChr, SKILL_SMBYKK_ILLUSIONSLASH, 16); if(weaponSubType == 0) hitMax = 3; if(bonusGet > 0) { hitMax = sq_GetIntData(sqrChr, SKILL_SMBYKK_ILLUSIONSLASH, 17); if(weaponSubType == 0) hitMax = 4; } obj.sq_SetMaxHitCounterPerObject(hitMax); obj.setTimeEvent(0, 12000 / speedRate, -1, true); } else{ local aniSet = ["passiveobject/0_swordman_bykk/1weaponmaster/animation/illusionslashsub/2_ground_dodge .ani", "passiveobject/0_swordman_bykk/1weaponmaster/animation/illusionslashsub/3_sword_dodge.ani", "passiveobject/0_swordman_bykk/1weaponmaster/animation/illusionslashsub/4_attackt_dodge.ani", "passiveobject/0_swordman_bykk/1weaponmaster/animation/illusionslashsub/5_light_dodge.ani"]; local direction = sq_GetDirection(obj), xPos = sq_GetXPos(obj), yPos = sq_GetYPos(obj); for(local i = 0; i < aniSet.len(); i++){ createOnlyDrawObjectEX_Swordman_bykk(obj,aniSet[i],true,direction,xPos,yPos,0,ENUM_DRAWLAYER_NORMAL,sizeRate,sizeRate); } sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); sq_SetMyShake(obj, 5, 120); sq_CreateParticle("passiveobject/0_swordman_bykk/particle/1weaponmaster/illusionslashsub.ptl", obj, 20, 0, 20, true, 30, 0, 1); } if(sizeRate > 100){ sizeRate = sizeRate.tofloat() / 100.0; currentAni.setImageRateFromOriginal(sizeRate, sizeRate); currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); } break; case 10: local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local sub = receiveData.readDword() % 3 + 1; local weaponSubType = receiveData.readDword(); obj.getVar("custom").setInt(0, totalDamage); obj.getVar("custom").setInt(1, sizeRate); obj.getVar("custom").setInt(2, sub); obj.getVar("custom").setInt(3, weaponSubType); local ani = sq_CreateAnimation("","character/swordman/effect/animation/1_swordman_bykk/stateoflimit/state_of_limit_illusion_"+sub.tostring()+".ani"); obj.setCurrentAnimation(ani); break; case 20: local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local weaponSubType = receiveData.readDword(); local bonusGet = receiveData.readDword(); local speedRate = receiveData.readDword(); obj.getVar("custom").setInt(0, totalDamage); obj.getVar("custom").setInt(1, sizeRate); obj.getVar("custom").setInt(2, weaponSubType); obj.getVar("custom").setInt(3, bonusGet); obj.getVar("custom").setInt(4, speedRate); local ani = sq_CreateAnimation("","character/swordman/effect/animation/1_swordman_bykk/stateoflimit/state_of_limit_illusion_4.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); if(weaponSubType == 2){ sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 12)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); } else sq_ClearAttackBox(currentAni); currentAni.setSpeedRate(speedRate.tofloat()); break; case 11: local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local sub = receiveData.readDword(); local weaponSubType = receiveData.readDword(); local ani = sq_CreateAnimation("","passiveobject/0_swordman_bykk/1weaponmaster/animation/stateoflimit/illusionslash/state_of_limit_illusion_wind_meele_0"+(sub - 1).tostring()+".ani"); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 11)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); local speed = 50.0; if(weaponSubType == 0){ speed = 60.0; local currentAni = obj.getCurrentAnimation(); currentAni.setSpeedRate(30.0); } obj.sq_SetMoveParticle("particle/1weaponmaster/illusionslashmelee.ptl", 0.0, 0.0); if(sizeRate > 100){ local currentAni = obj.getCurrentAnimation(); sizeRate = sizeRate.tofloat() / 100.0; currentAni.setImageRateFromOriginal(sizeRate, sizeRate); currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); } break; case 12: local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local weaponSubType = receiveData.readDword(); local bonusGet = receiveData.readDword(); local speedRate = receiveData.readDword(); local aniPath = 0; local ani = sq_CreateAnimation("", "passiveobject/0_swordman_bykk/1weaponmaster/animation/stateoflimit/illusionslash/state_of_limit_illusion_wave_shadow.ani"); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 22)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); local speed = weaponSubType==0?300:375; if(sq_GetDirection(obj) == ENUM_DIRECTION_RIGHT) sq_SetVelocity(obj, 0, speed.tofloat()); else sq_SetVelocity(obj, 0, -speed.tofloat()); local hitMax = sq_GetIntData(sqrChr, SKILL_SMBYKK_ILLUSIONSLASH, 16); if(weaponSubType == 0) hitMax = 3; if(bonusGet > 0) { hitMax = sq_GetIntData(sqrChr, SKILL_SMBYKK_ILLUSIONSLASH, 17); if(weaponSubType == 0) hitMax = 4; } obj.sq_SetMaxHitCounterPerObject(hitMax); obj.setTimeEvent(0, 12000 / speedRate, -1, true); obj.setTimeEvent(255, 1000, -1, false); if(sizeRate > 100){ local currentAni = obj.getCurrentAnimation(); sizeRate = sizeRate.tofloat() / 100.0; currentAni.setImageRateFromOriginal(sizeRate, sizeRate); currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); } sq_CreateParticle("passiveobject/0_swordman_bykk/particle/1weaponmaster/illusionslash_shadow.ptl", obj, 0, -1, 0, false, 200, 0, 4); break; case 13: local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local ani = sq_CreateAnimation("","passiveobject/0_swordman_bykk/1weaponmaster/animation/stateoflimit/illusionslash/state_of_limit_illusion_wind_meele_03.ani"); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 11)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); if(sizeRate > 100){ local currentAni = obj.getCurrentAnimation(); sizeRate = sizeRate.tofloat() / 100.0; currentAni.setImageRateFromOriginal(sizeRate, sizeRate); currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); } break; } break; case SKILL_SMBYKK_HUNDREDSWORD: switch(subtype){ case 1: local delay = receiveData.readDword(); local addDamageRate = receiveData.readDword(); local xPos = sq_GetXPos(obj), yPos = sq_GetYPos(obj); local objectManager = obj.getObjectManager();//得到對象管理器 for (local i = 0; i < objectManager.getCollisionObjectNumber(); i++){ local object = objectManager.getCollisionObject(i);//得到控制類對象 if (object && object.isObjectType(OBJECTTYPE_ACTIVE) && obj.isEnemy(object) && object.isInDamagableState(obj)){ local xDis = sq_Abs(sq_GetXPos(object) - xPos), yDis = sq_Abs(sq_GetYPos(object) - yPos); if((xDis <= 275 && yDis <= 15) || (xDis <= 220 && yDis <= 30) || (xDis <= 165 && yDis <= 45) || (xDis <= 110 && yDis <= 60) || (xDis <= 55 && yDis <= 75)){ local activeObj = sq_GetCNRDObjectToActiveObject(object); if(!CNSquirrelAppendage.sq_IsAppendAppendage(activeObj, APDPATH_SM_HUNDREDSWORD_HOLD)){ local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(activeObj, sqrChr, -1, false, APDPATH_SM_HUNDREDSWORD_HOLD, true); sq_HoldAndDelayDie(activeObj, sqrChr, true, true, true, 200, 200, ENUM_DIRECTION_NEUTRAL, AddAppendage); if(addDamageRate > 0){ AddAppendage.getVar().setBool(0, true); AddAppendage.getVar("custom").setInt(0, addDamageRate); } if(!sq_IsFixture(activeObj) && sq_IsHoldable(obj, activeObj) && sq_IsGrabable(obj, activeObj)){ local zPos = sq_GetZPos(activeObj); sq_MoveToAppendageForce(activeObj, sqrChr, activeObj, 0, 0, zPos>0?0:60, delay, true, AddAppendage); } } } } } obj.setTimeEvent(255, 1000, 1, false); break; } break; case SKILL_SMBYKK_METEORSWORD: switch(subtype){ case 1: local sub = receiveData.readDword(); obj.getVar("custom").setInt(0, sub); local aniPath = "character/swordman/effect/animation/1_swordman_bykk/meteorsword/meteorsword_target.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); obj.setTimeEvent(1, 3, -1, true); sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); break; case 2: local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/meteorsword/up_meteorsword_shock1.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 18)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); if(sizeRate > 100){ local currentAni = obj.getCurrentAnimation(); sizeRate = sizeRate.tofloat() / 100.0; currentAni.setImageRateFromOriginal(sizeRate, sizeRate); currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); } break; case 3: local sub = receiveData.readDword(); local isTrue = receiveData.readDword(); obj.getVar("custom").setInt(100, sub); obj.getVar("custom").setInt(101, isTrue); local delayTime = 500; if(sub < 1) delayTime = 300; obj.setTimeEvent(6, delayTime, 1, false); local flashScreenObj = sq_flashScreen(obj,delayTime,999999999,240,150, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); local size = sqrChr.getVar("flashobj").get_obj_vector_size(); if(size > 0){ for(local i = 0; i < size; i++){ local flashScreenObj = sqrChr.getVar("flashobj").get_obj_vector(i); local pflashScreen = sq_GetCNRDObjectToFlashScreen(flashScreenObj); if(pflashScreen) pflashScreen.fadeOut(); } } sqrChr.getVar("flashobj").clear_obj_vector();//清除 sqrChr.getVar("flashobj").push_obj_vector(flashScreenObj);//加入 local currentAni = obj.getCurrentAnimation(); sq_SetFrameDelayTime(currentAni, 1, 5000); break; case 4: local totalDamage = receiveData.readDword(); local sub = receiveData.readDword(); local sizeRate = receiveData.readDword(); local aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/meteorsword/dropsword"+sub.tostring()+"_meteorsword_swords.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 17)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); sq_SetMyShake(obj, 2, 50); if(sizeRate > 100){ local currentAni = obj.getCurrentAnimation(); sizeRate = sizeRate.tofloat() / 100.0; currentAni.setImageRateFromOriginal(sizeRate, sizeRate); currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); } break; case 5://totalDamage,holdTime,weaponSubType local totalDamage = receiveData.readDword(); local holdTime = receiveData.readDword(); local weaponSubType = receiveData.readDword(); local sizeRate = receiveData.readDword(); local sub = receiveData.readDword(); obj.getVar("custom").setInt(0, totalDamage); obj.getVar("custom").setInt(1, holdTime); obj.getVar("custom").setInt(2, weaponSubType); obj.getVar("custom").setInt(3, sizeRate); obj.getVar("custom").setInt(4, sub); local sub = [1,3,4,2,0,5]; local aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/stateoflimit/meteorsword/bigswordboom"+sub[weaponSubType].tostring()+"_sword_inner.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); obj.sq_SetMoveParticle("particle/1weaponmaster/meteorsword.ptl", 0.0, 0.0); sq_SetSpeedToMoveParticle(obj,2,-3000); local currentAni = obj.getCurrentAnimation(); sizeRate = sizeRate.tofloat() / 75.0; currentAni.setImageRateFromOriginal(sizeRate, sizeRate); currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); break; case 15: local totalDamage = receiveData.readDword(); local holdTime = receiveData.readDword(); local weaponSubType = receiveData.readDword(); local sizeRate = receiveData.readDword(); local subSet = receiveData.readDword(); obj.getVar("custom").setInt(1, holdTime); local skillLevel = sq_GetSkillLevel(sqrChr, SKILL_SMBYKK_STATEOFLIMIT); local heavy_addRate = sq_GetLevelData(sqrChr, SKILL_SMBYKK_STATEOFLIMIT, 19, skillLevel); local short_proc = sq_GetLevelData(sqrChr, SKILL_SMBYKK_STATEOFLIMIT, 20, skillLevel); local short_time = sq_GetLevelData(sqrChr, SKILL_SMBYKK_STATEOFLIMIT, 22, skillLevel); local blun_proc = sq_GetLevelData(sqrChr, SKILL_SMBYKK_STATEOFLIMIT, 23, skillLevel); local blun_time = sq_GetLevelData(sqrChr, SKILL_SMBYKK_STATEOFLIMIT, 25, skillLevel); local blun_totalDamage = sq_GetLevelData(sqrChr, SKILL_SMBYKK_STATEOFLIMIT, 26, skillLevel) - 100; local light_proc = sq_GetLevelData(sqrChr, SKILL_SMBYKK_STATEOFLIMIT, 30, skillLevel); local light_time = sq_GetLevelData(sqrChr, SKILL_SMBYKK_STATEOFLIMIT, 32, skillLevel); local light_damge = sq_GetLevelData(sqrChr, SKILL_SMBYKK_STATEOFLIMIT, 33, skillLevel); local light_totalDamage = sq_GetLevelData(sqrChr, SKILL_SMBYKK_STATEOFLIMIT, 34, skillLevel) - 100; local level = sq_GetSkillLevel(sqrChr, 174) + 5 if(weaponSubType == 2) totalDamage = totalDamage + heavy_addRate; local sub = [1,3,4,2,0,5]; local aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/stateoflimit/meteorsword/bigswordboom"+sub[weaponSubType].tostring()+"_sword.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/0_swordman_bykk/1weaponmaster/animation/stateoflimit/meteorsword/dropsword1_meteorsword_crack.ani"),true); createOnlyDrawObject_Swordman_bykk(obj,"passiveobject/0_swordman_bykk/1weaponmaster/animation/stateoflimit/meteorsword/bigswordboom_01.ani",true,sq_GetDirection(obj),sq_GetXPos(obj),sq_GetYPos(obj),0,ENUM_DRAWLAYER_NORMAL); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 23)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); local attackInfo = sq_GetCurrentAttackInfo(obj); switch(weaponSubType){ case 0: sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_HOLD, short_proc, level,short_time); break; case 2: sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_STUN, blun_proc, level, blun_time); break; case 5: sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_LIGHTNING, light_proc, level, light_time, light_damge); break; } if(weaponSubType == 2) createSkillPassive_Swordman_bykk(obj,obj,PASSIVEOBJ_BYKK_SWORDMAN,0,0,0,sq_GetDirection(obj),1,SKILL_SMBYKK_METEORSWORD,6,blun_totalDamage,sizeRate,0,0,0,0,0,0); else if(weaponSubType == 5) createSkillPassive_Swordman_bykk(obj,obj,PASSIVEOBJ_BYKK_SWORDMAN,0,0,0,sq_GetDirection(obj),1,SKILL_SMBYKK_METEORSWORD,7,light_totalDamage,sizeRate,0,0,0,0,0,0); local pAni = obj.getCurrentAnimation(); pAni.setSpeedRate(75.0); if(subSet > 0){ sq_flashScreen(obj,80,300,80, 205, sq_RGB(255, 255, 255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); local aniSet = [["character/swordman/effect/animation/meteorsword/exp_meteorsword_exp_dust1.ani", ENUM_DRAWLAYER_NORMAL], ["character/swordman/effect/animation/meteorsword/exp_meteorsword_exp_dust2.ani", ENUM_DRAWLAYER_NORMAL], ["character/swordman/effect/animation/meteorsword/exp_meteorsword_shock.ani", ENUM_DRAWLAYER_BOTTOM], ["character/swordman/effect/animation/meteorsword/exp_meteorsword_crack.ani", ENUM_DRAWLAYER_BOTTOM]]; local direction = sq_GetDirection(obj), x = sq_GetXPos(obj), y = sq_GetYPos(obj); for(local i = 0; i < aniSet.len(); i++){ createOnlyDrawObjectEX_Swordman_bykk(obj,aniSet[i][0],true,direction,x,y,0,aniSet[i][1],sizeRate,sizeRate); } sq_SetMyShake(obj, 15, 300); } else sq_SetMyShake(obj, 8, 300); local currentAni = obj.getCurrentAnimation(); sizeRate = sizeRate.tofloat() / 75.0; currentAni.setImageRateFromOriginal(sizeRate, sizeRate); currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sizeRate = sizeRate * 1.3; sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); break; case 6: local totalDamage = receiveData.readDword(); local sub = receiveData.readDword(); local sizeRate = receiveData.readDword(); local aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/chargecrash/damage-back.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(6,sq_CreateAnimation("","passiveobject/0_swordman_bykk/1weaponmaster/animation/chargecrash/damage-front.ani"),true); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 24)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); if(sizeRate > 100){ local currentAni = obj.getCurrentAnimation(); sizeRate = sizeRate.tofloat() / 100.0; currentAni.setImageRateFromOriginal(sizeRate, sizeRate); currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); } break; case 7: local totalDamage = receiveData.readDword(); local sub = receiveData.readDword(); local sizeRate = receiveData.readDword(); local aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/stateoflimit/meteorsword/lightswordshockwave.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 24)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); if(sizeRate > 100){ local currentAni = obj.getCurrentAnimation(); sizeRate = sizeRate.tofloat() / 100.0; currentAni.setImageRateFromOriginal(sizeRate, sizeRate); currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); } break; } break; case SKILL_SMBYKK_MOMENTARYSLASHEX: switch(subtype){ case 1: local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local moveX = receiveData.readDword(); obj.getVar("custom").setInt(0, sizeRate); obj.getVar("custom").setInt(1, moveX); obj.getVar("custom").setInt(2, sq_GetXPos(obj)); local ani = sq_CreateAnimation("", "passiveobject/0_swordman_bykk/1weaponmaster/animation/momentaryslashex/new_bigwave.ani"); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 19)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); obj.setTimeEvent(42, 10, 250, true); break; } break; case SKILL_SMBYKK_SWORDOFMIND: switch(subtype){ case 1: sqrChr.getVar("SwordOfMindObj").push_obj_vector(obj); local ani = sq_CreateAnimation("", "character/swordman/effect/animation/1_swordman_bykk/swordofmind/charge_spin_eff.ani"); obj.setCurrentAnimation(ani); local pAni = obj.getCurrentAnimation(); pAni.setLoop(true); sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); break; case 2: sqrChr.getVar("SwordOfMindObj").push_obj_vector(obj); local chargeTime = receiveData.readDword(); obj.setTimeEvent(1, chargeTime, 1, false); obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; case 3://totalDamage,totalDamageExp,hitMax,weaponSubType,group,uniqueId local totalDamage = receiveData.readDword(); local totalDamageExp = receiveData.readDword(); local hitMax = receiveData.readDword(); local weaponSubType = receiveData.readDword(); local group = receiveData.readDword(); local uniqueId = receiveData.readDword(); local stateoflimitSet = receiveData.readDword(); local targetObj = sq_GetObject(obj, group, uniqueId); if(targetObj){ obj.getVar("tar").clear_obj_vector(); obj.getVar("tar").push_obj_vector(targetObj); obj.getVar("custom").setInt(0, totalDamage); obj.getVar("custom").setInt(1, totalDamageExp); obj.getVar("custom").setInt(2, weaponSubType); obj.getVar("custom").setInt(3, hitMax); obj.getVar("custom").setInt(9, stateoflimitSet); switch(weaponSubType){ case 2: local skillLevel = sq_GetSkillLevel(sqrChr, SKILL_SMBYKK_SWORDOFMIND); local proc = sq_GetLevelData(sqrChr, SKILL_SMBYKK_SWORDOFMIND, 6, skillLevel); local time = sq_GetLevelData(sqrChr, SKILL_SMBYKK_SWORDOFMIND, 8, skillLevel); obj.getVar("custom").setInt(10, proc); obj.getVar("custom").setInt(11, time); obj.getVar("custom").setInt(12, sq_GetSkillLevel(sqrChr, 174) + 5); break; case 5: obj.getVar("custom").setInt(3, hitMax + 1); local skillLevel = sq_GetSkillLevel(sqrChr, SKILL_SMBYKK_SWORDOFMIND); local proc = sq_GetLevelData(sqrChr, SKILL_SMBYKK_SWORDOFMIND, 13, skillLevel); local time = sq_GetLevelData(sqrChr, SKILL_SMBYKK_SWORDOFMIND, 16, skillLevel); obj.getVar("custom").setInt(10, proc); obj.getVar("custom").setInt(11, time); obj.getVar("custom").setInt(12, sq_GetSkillLevel(sqrChr, 174) + 5); break; } obj.setTimeEvent(2, 50, -1, true); obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); } else sq_SendDestroyPacketPassiveObject(obj); break; case 4: local totalDamage = receiveData.readDword(); local ani = sq_CreateAnimation("", "character/swordman/effect/animation/1_swordman_bykk/swordofmind/cross_eff.ani"); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 32)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); break; } break; case SKILL_SMBYKK_FLASHCUT: switch(subtype){ case 1: local totalDamage = receiveData.readDword(); local totalDamageExp = receiveData.readDword(); local hitMax = 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); obj.getVar("custom").setInt(0, totalDamage); obj.getVar("custom").setInt(1, totalDamageExp); obj.getVar("custom").setInt(2, hitMax); obj.setTimeEvent(2, 50, -1, true); obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); } else sq_SendDestroyPacketPassiveObject(obj); break; case 2: local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local speedRate = receiveData.readDword(); local aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/flashcut/flashcutcut.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 2)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); local currentAni = obj.getCurrentAnimation(); currentAni.setSpeedRate(speedRate.tofloat()); if(sizeRate > 100){ sizeRate = sizeRate.tofloat() / 100.0; sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); } break; } break; case SKILL_SMBYKK_INVISIBLESWORDCUT: switch(subtype){ case 1: local totalDamage = receiveData.readDword(); local totalDamageExp = receiveData.readDword(); local hitMax = receiveData.readDword(); local speedRate = receiveData.readDword(); obj.getVar("custom").setInt(0, totalDamageExp); obj.getVar("custom").setInt(1, speedRate); obj.getVar("custom").setInt(2, hitMax); local aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/invisibleswordcut/slasheffecta_67.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 15)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); // local currentAni = obj.getCurrentAnimation(); // currentAni.setSpeedRate(speedRate.tofloat()); break; case 2: local totalDamage = receiveData.readDword(); local speedRate = receiveData.readDword(); local aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/invisibleswordcut/slasheffectb_00.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 16)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); // local currentAni = obj.getCurrentAnimation(); // currentAni.setSpeedRate(speedRate.tofloat()); sq_flashScreen(obj,40,80,520,127, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); sq_SetMyShake(obj, 10, 400); break; } break; case SKILL_SMBYKK_HANDLINGSWORD: switch(subtype){ case 1: sqrChr.getVar("handlingsword_mainAtkObj").push_obj_vector(obj); local totalDamage = receiveData.readDword(); obj.getVar("custom").setInt(0, totalDamage); obj.getVar("custom").setInt(1, 5); obj.setMapFollowParent(obj.getParent()); obj.setMapFollowType(1); obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); break; case 2: local totalDamage = receiveData.readDword(); local group = receiveData.readDword(); local uniqueId = receiveData.readDword(); obj.getVar("custom").setInt(0, totalDamage); obj.getVar("custom").setInt(1, group); obj.getVar("custom").setInt(2, uniqueId); print("group = "+group); print("uniqueId = "+uniqueId); local ani = sq_CreateAnimation("","passiveobject/0_swordman_bykk/1weaponmaster/animation/handlingsword/handlingsword_launch_eff_g.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); break; case 3: local totalDamage = receiveData.readDword(); local group = receiveData.readDword(); local uniqueId = receiveData.readDword(); local set = receiveData.readDword(); if(set > 0){ obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); break; } local targetObj = sq_GetObject(obj, group, uniqueId); if(targetObj && targetObj.getState() != STATE_DIE){ obj.getVar("tar").clear_obj_vector(); obj.getVar("tar").push_obj_vector(targetObj); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 8)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); } else obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); break; case 4://totalDamage,totalDamageExp,14,group,uniqueId local totalDamage = receiveData.readDword(); local totalDamageExp = receiveData.readDword(); local hitMax = receiveData.readDword(); local group = receiveData.readDword(); local uniqueId = receiveData.readDword(); obj.getVar("custom").setInt(0, totalDamageExp); obj.getVar("custom").setInt(1, hitMax); obj.getVar("custom").setInt(4, totalDamage); local targetObj = sq_GetObject(obj, group, uniqueId); if(targetObj && targetObj.getState() != STATE_DIE){ obj.getVar("tar").clear_obj_vector(); obj.getVar("tar").push_obj_vector(targetObj); obj.getVar("custom").setInt(2, group); obj.getVar("custom").setInt(3, uniqueId); if(!CNSquirrelAppendage.sq_IsAppendAppendage(targetObj, APDPATH_SM_HANDLINGSWORD_HOLD)){ local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(targetObj, obj, -1, true, APDPATH_SM_HANDLINGSWORD_HOLD, true); sq_HoldAndDelayDie(targetObj, obj, true, true, true, 200, 200, ENUM_DIRECTION_NEUTRAL , AddAppendage); if(!sq_IsFixture(targetObj) && sq_IsHoldable(obj, targetObj) && sq_IsGrabable(obj, targetObj) && targetObj.getZPos() == 0){ sq_MoveToAppendageForce(targetObj, obj, targetObj, 0, 0, 30, 500, true, AddAppendage); } obj.setTimeEvent(43, 100, -1, false); } } sq_AddDrawOnlyAniFromParent(sqrChr, "passiveobject/0_swordman_bykk/1weaponmaster/animation/handlingsword/handlingsword_finish_start_sword_normal_a.ani", 0, -1, 0); local mainAtkObj = sqrChr.getVar("handlingsword_mainAtkObj").get_obj_vector(0); if(mainAtkObj){ local colObj = sq_GetCNRDObjectToCollisionObject(mainAtkObj); colObj.getVar("custom").setInt(1, 0); colObj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); } obj.setTimeEvent(25, 500, 1, false); break; case 5: local totalDamage = receiveData.readDword(); local group = receiveData.readDword(); local uniqueId = receiveData.readDword(); obj.getVar("custom").setInt(0, totalDamage); local ani = sq_CreateAnimation("","passiveobject/0_swordman_bykk/1weaponmaster/animation/handlingsword/handlingsword_finish_b_atkeff_a.ani"); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 5)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); if(group == 0 && uniqueId == 0) break; local targetObj = sq_GetObject(obj, group, uniqueId); if(targetObj && targetObj.getState() != STATE_DIE){ obj.getVar("tar").clear_obj_vector(); obj.getVar("tar").push_obj_vector(targetObj); local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(targetObj, obj, -1, true, APDPATH_SM_HANDLINGSWORD_HOLD, true); sq_HoldAndDelayDie(targetObj, obj, true, true, true, 200, 200, ENUM_DIRECTION_NEUTRAL , AddAppendage); } break; } break; case SKILL_SMBYKK_STATEOFINVISIBLESWORD: switch(subtype){ case 1: local totalDamage = receiveData.readDword(); local weaponSubType = receiveData.readDword(); local subState = receiveData.readDword(); local speedRate = receiveData.readDword(); local aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/stateofinvisiblesword/flowmindone/flowmindlv95shortswordone_stswslashonel.ani", atkIndex = 36; switch(weaponSubType){ case 0: switch(subState){ case 1: aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/stateofinvisiblesword/flowmindone/flowmindlv95shortswordoneadd_oneslashadd.ani"; atkIndex = 37; break; case 10: aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/stateofinvisiblesword/flowmindone/flowmindlv95shortswordonefallstart_onefallslash.ani"; atkIndex = 38; break; } break; case 2: aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/stateofinvisiblesword/flowmindone/flowmindlv95maceone_maceswing.ani"; atkIndex = 35; break; case 3: switch(subState){ case 0: aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/stateofinvisiblesword/flowmindone/flowmindlv95longswordone_weapon.ani"; atkIndex = 44; break; case 1: aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/stateofinvisiblesword/flowmindone/flowmindlv95longswordoneadd_slashl.ani"; atkIndex = 45; break; case 10: aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/stateofinvisiblesword/flowmindone/flowmindlv95longswordonefallstart_fxbodyl.ani"; atkIndex = 46; break; } break; } local ani = sq_CreateAnimation("", aniPath); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, atkIndex)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); if((weaponSubType == 0 && subState != 10) || (weaponSubType == 3 && subState == 10)) sq_moveWithParent(sqrChr, obj); local currentAni = obj.getCurrentAnimation(); currentAni.setSpeedRate(speedRate.tofloat()); currentAni = obj.getCurrentAnimation(); if(weaponSubType == 0 && subState == 10){ local hitMax = receiveData.readDword(); obj.getVar("custom").setInt(0, hitMax); obj.setTimeEvent(30, currentAni.getDelaySum(0, 2), 1, false); } break; case 2: local totalDamage = receiveData.readDword(); local weaponSubType = receiveData.readDword(); local subState = receiveData.readDword(); local speedRate = receiveData.readDword(); local aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/stateofinvisiblesword/flowmindtwo/flowmindlv95shortswordtwo_twoslash.ani", atkIndex = 43; switch(weaponSubType){ case 1: aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/stateofinvisiblesword/flowmindtwo/flowmindlv95katanatwo_katanatwoslash.ani"; atkIndex = 41; break; case 2: aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/stateofinvisiblesword/flowmindone/flowmindlv95maceone_maceswing.ani"; atkIndex = 42; break; case 5: aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/stateofinvisiblesword/flowmindtwo/flowmindlv95beamswordtwo_beamswordtwoslashl.ani"; atkIndex = 48; break; } local ani = sq_CreateAnimation("", aniPath); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, atkIndex)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); if(weaponSubType != 2) sq_moveWithParent(sqrChr, obj); if(weaponSubType == 1){ local hitMax = receiveData.readDword(); obj.getVar("custom").setInt(0, hitMax); local currentAni = obj.getCurrentAnimation(); obj.setTimeEvent(31, currentAni.getDelaySum(0, 1), 1, false); } break; case 3: local totalDamage = receiveData.readDword(); local weaponSubType = receiveData.readDword(); local subState = receiveData.readDword(); local speedRate = receiveData.readDword(); local aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/stateofinvisiblesword/flowmindthree/flowmindlv95katanathree_katanathreeslashl.ani", atkIndex = 39; switch(weaponSubType){ case 3: aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/stateofinvisiblesword/flowmindthree/flowmindlv95longswordthree_weapon.ani"; atkIndex = 47; break; case 5: aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/stateofinvisiblesword/flowmindthree/flowmindlv95beamswordthree_beamswordthreeslashl.ani"; atkIndex = 40; break; } local ani = sq_CreateAnimation("", aniPath); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, atkIndex)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); sq_moveWithParent(sqrChr, obj); if(weaponSubType == 1){ local hitMax = receiveData.readDword(); obj.getVar("custom").setInt(0, hitMax); local currentAni = obj.getCurrentAnimation(); obj.setTimeEvent(32, currentAni.getDelaySum(0, 1), 1, false); } break; case 4: local totalDamage = receiveData.readDword(); local weaponSubType = receiveData.readDword(); local subState = receiveData.readDword(); local speedRate = receiveData.readDword(); local hitMax = receiveData.readDword(); local aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/stateofinvisiblesword/flowmindlv95longswordoneadd_tornado.ani"; local ani = sq_CreateAnimation("", aniPath); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 45)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); obj.getVar("custom").setInt(0, hitMax); local currentAni = obj.getCurrentAnimation(); obj.setTimeEvent(33, currentAni.getDelaySum(0, 4), 1, false); break; } break; case SKILL_SMBYKK_STATEOFLIMIT: switch(subtype){ case 1: local totalDamage = receiveData.readDword(); local ani = sq_CreateAnimation("", "passiveobject/0_swordman_bykk/1weaponmaster/animation/stateoflimit/state_of_limit_crash_05.ani"); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 27)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); break; case 2: local totalDamage = receiveData.readDword(); local hitMax = receiveData.readDword(); local sub = receiveData.readDword(); local sizeRate = receiveData.readDword(); obj.getVar("custom").setInt(0, hitMax); obj.getVar("custom").setInt(1, sub); obj.getVar("custom").setInt(2, sq_GetXPos(obj)); obj.getVar("custom").setInt(3, sq_GetYPos(obj)); obj.getVar("custom").setInt(4, sizeRate); local target = sqrChr; if(sub > 0){ obj.getVar("setTar_boss").clear_obj_vector(); obj.getVar("setTar_named").clear_obj_vector(); obj.getVar("setTar_normal").clear_obj_vector(); obj.getVar("setTar").clear_obj_vector(); obj.getVar("setTar_Shoot").clear_obj_vector(); local rangeX = 1000, rangeY = 300; local objectManager = obj.getObjectManager();//得到對象管理器 for (local i = 0; i < objectManager.getCollisionObjectNumber(); i++){ local object = objectManager.getCollisionObject(i);//得到控制類對象 if (object && object.isObjectType(OBJECTTYPE_ACTIVE) && obj.isEnemy(object) && object.isInDamagableState(obj) && sq_Abs(sq_GetXPos(obj) - sq_GetXPos(object)) <= rangeX && sq_Abs(sq_GetYPos(obj) - sq_GetYPos(object)) <= rangeY){ local activeObj = sq_GetCNRDObjectToActiveObject(object); if(sq_IsBoss(activeObj)){ obj.getVar("setTar_boss").push_obj_vector(activeObj); continue; } else if(sq_IsNamed(activeObj)){ obj.getVar("setTar_named").push_obj_vector(activeObj); continue; } else{ obj.getVar("setTar_normal").push_obj_vector(activeObj); continue; } } } local bossSize = obj.getVar("setTar_boss").get_obj_vector_size(); local namedSize = obj.getVar("setTar_named").get_obj_vector_size(); local normalSize = obj.getVar("setTar_normal").get_obj_vector_size(); if(bossSize > 0){ for(local i = 0; i < bossSize; i++){ local targetObj = obj.getVar("setTar_boss").get_obj_vector(i); if(targetObj) obj.getVar("setTar").push_obj_vector(targetObj); } } if(namedSize > 0){ for(local i = 0; i < namedSize; i++){ local targetObj = obj.getVar("setTar_named").get_obj_vector(i); if(targetObj) obj.getVar("setTar").push_obj_vector(targetObj); } } if(normalSize > 0){ for(local i = 0; i < normalSize; i++){ local targetObj = obj.getVar("setTar_normal").get_obj_vector(i); if(targetObj) obj.getVar("setTar").push_obj_vector(targetObj); } } local sizeTar = obj.getVar("setTar").get_obj_vector_size(); if(sizeTar > 0){ local targetObj = obj.getVar("setTar").get_obj_vector(0); if(targetObj && targetObj.getState() != STATE_DIE){ target = targetObj; } } else obj.getVar("custom").setInt(1, 0); } obj.getVar("tar").clear_obj_vector(); obj.getVar("tar").push_obj_vector(target); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 27)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); break; case 3: local totalDamage = receiveData.readDword(); local ani = sq_CreateAnimation("", "passiveobject/0_swordman_bykk/1weaponmaster/animation/stateoflimit/state_of_limit_backstep_01.ani"); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 24)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); if(sq_GetDirection(obj) == ENUM_DIRECTION_RIGHT) sq_SetVelocity(obj, 0, 700.0); else sq_SetVelocity(obj, 0, -700.0); break; } break; case SKILL_SMBYKK_SHORTSWORDMASTERY: switch(subtype){ case 1://totalDamage,proc,time,level local totalDamage = receiveData.readDword(); local proc = receiveData.readDword(); local time = receiveData.readDword(); local level = receiveData.readDword(); local ani = sq_CreateAnimation("", "passiveobject/0_swordman_bykk/1weaponmaster/animation/guardwave.ani"); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 61)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); local attackInfo = sq_GetCurrentAttackInfo(obj); sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_STUN, proc, level, time); break; } break; case SKILL_SMBYKK_BLUNTMASTERY: switch(subtype){ case 1: local totalDamage = receiveData.readDword(); local sizeRate = receiveData.readDword(); local upForceSet = receiveData.readDword(); local ani = sq_CreateAnimation("", "passiveobject/character/swordman/animation/bluntmasterysub/hit.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(5,sq_CreateAnimation("","passiveobject/character/swordman/animation/bluntmasterysub/sub1.ani"),true); currentAni.addLayerAnimation(6,sq_CreateAnimation("","passiveobject/character/swordman/animation/bluntmasterysub/sub2.ani"),true); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 3)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); local attackInfo = sq_GetCurrentAttackInfo(obj); sq_SetAddWeaponDamage(attackInfo, true); sq_SetCurrentAttacknUpForce(attackInfo, upForceSet); if(sizeRate > 100){ local currentAni = obj.getCurrentAnimation(); sizeRate = sizeRate.tofloat() / 100.0; currentAni.setImageRateFromOriginal(sizeRate, sizeRate); currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); } sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); sq_SetMyShake(obj, 3, 120); break; case 2: local totalDamage = receiveData.readDword(); local group = receiveData.readDword(); local uniqueId = receiveData.readDword(); local targetObj = sq_GetObject(obj, group, uniqueId); if(targetObj && targetObj.getState() != STATE_DIE){ sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 35)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); local attackInfo = sq_GetCurrentAttackInfo(obj); sq_SetCurrentAttacknUpForce(attackInfo, 0); sq_SendHitObjectPacket(obj,targetObj,0,0,sq_GetObjectHeight(targetObj) / 2); obj.setTimeEvent(255, 200, 1, false); } break; } break; case SKILL_SMBYKK_BLADEMASTERY: switch(subtype){ case 1: case 2: local totalDamage = receiveData.readDword(); local group = receiveData.readDword(); local uniqueId = receiveData.readDword(); local sizeRate = receiveData.readDword(); local targetObj = sq_GetObject(obj, group, uniqueId); if(subtype == 1){ local ani = sq_CreateAnimation("", "character/swordman/effect/animation/1_swordman_bykk/overbleed/atk.ani"); obj.setCurrentAnimation(ani); obj.sq_PlaySound("R_FLASHCUT_HIT"); } else{ local ani = sq_CreateAnimation("", "character/swordman/effect/animation/1_swordman_bykk/overbleed/overbleed.ani"); obj.setCurrentAnimation(ani); // obj.sq_PlaySound("R_FLASHCUT_HIT"); obj.sq_PlaySound("UNLIMITEDSPEEDSLASH_FINISH"); local currentAni = obj.getCurrentAnimation(); sizeRate = sizeRate.tofloat() / 100.0; currentAni.setImageRateFromOriginal(sizeRate, sizeRate); currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetCustomRotate(obj, sq_ToRadian(sq_getRandom(0, 90).tofloat())); } if(targetObj && targetObj.getState() != STATE_DIE){ sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 41)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); local attackInfo = sq_GetCurrentAttackInfo(obj); sq_SetCurrentAttackeDamageAct(attackInfo, DAMAGEACT_NONE); sq_SendHitObjectPacket(obj,targetObj,0,0,sq_GetObjectHeight(targetObj) / 2); } break; } break; case SKILL_SMBYKK_MYSTICEQUIP: local totalDamage = receiveData.readDword(); local sub = receiveData.readDword(); local aniSet = ANI_SMBYKK_MYSTICEQUIP_BODY; if(sub > 0) aniSet = ANI_SMBYKK_MYSTICEQUIPJUMP_BODY; local ani = sq_GetCustomAni(sqrChr, aniSet); sq_Rewind(ani); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 21)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); switch(sub){ case 0: sq_AddDrawOnlyAniFromParent(obj, "passiveobject/0_swordman_bykk/1weaponmaster/animation/mysticequip/mysticequip_shockwave00.ani", 0, 0, 0); break; case 1: sq_AddDrawOnlyAniFromParent(obj, "passiveobject/0_swordman_bykk/1weaponmaster/animation/mysticequip/mysticequipjump_shockwave.ani", 0, 0, 0); break; } break; } break; case 2: break; case 3: break; case 4: break; case 5: switch(skillIndex){ case 231: switch(subtype){ case 1: local totalDamage = receiveData.readDword(); local sub = receiveData.readDword(); local aniPath = "passiveobject/0_swordman_bykk/5_ghost/animation/unlimitedspeedslashbvs/swordmanslash/ultimatespeedslashb_slash1.ani"; switch(sub){ case 2: aniPath = "passiveobject/0_swordman_bykk/5_ghost/animation/unlimitedspeedslashbvs/swordmanslash/ultimatespeedslashb_slash2.ani"; break; case 3: aniPath = "passiveobject/0_swordman_bykk/5_ghost/animation/unlimitedspeedslashbvs/swordmanslash/ultimatespeedslashb_slash3.ani"; break; case 4: aniPath = "passiveobject/0_swordman_bykk/5_ghost/animation/unlimitedspeedslashbvs/swordmanslash/ultimatespeedslashb_slash4.ani"; break; case 5: aniPath = "passiveobject/0_swordman_bykk/5_ghost/animation/unlimitedspeedslashbvs/swordmanslash/ultimatespeedslashb_slash5.ani"; break; } local ani = sq_CreateAnimation("", aniPath); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 61 + sub)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); local attackInfo = sq_GetCurrentAttackInfo(obj); sq_SetAddWeaponDamage(attackInfo, true); break; case 2: local size = obj.getVar("VSObj").get_obj_vector_size(); if(size <= 0) obj.getVar("VSObj").clear_obj_vector(); sqrChr.getVar("VSObj").push_obj_vector(obj); obj.getVar("set").setInt(0, 100); if(sq_Abs(sq_GetXPos(obj) - sq_GetXPos(sqrChr)) > 50) sq_SetCurrentDirection(obj, sq_GetOppositeDirection(sq_GetDirection(obj))); local totalDamage = receiveData.readDword(); local sub = receiveData.readDword(); obj.getVar("custom").setInt(0, totalDamage); local aniPath = "passiveobject/0_swordman_bykk/5_ghost/animation/unlimitedspeedslashbvs/ultimatespeedslashvs_00.ani"; local ani = sq_CreateAnimation("", aniPath); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 67)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); if(sq_getRandom(1, 100) > 50) obj.sq_PlaySound("SM_UNLIMITEDSPEEDSLASH_VS_01_1"); else obj.sq_PlaySound("SM_UNLIMITEDSPEEDSLASH_VS_01_1"); break; case 3: local size = obj.getVar("VSObj").get_obj_vector_size(); if(size <= 0) obj.getVar("VSObj").clear_obj_vector(); sqrChr.getVar("VSObj").push_obj_vector(obj); obj.getVar("set").setInt(0, 100); if(sq_Abs(sq_GetXPos(obj) - sq_GetXPos(sqrChr)) > 50) sq_SetCurrentDirection(obj, sq_GetOppositeDirection(sq_GetDirection(obj))); local totalDamage = receiveData.readDword(); local aniPath = "passiveobject/0_swordman_bykk/5_ghost/animation/unlimitedspeedslashbvs/vsfinish/ultimatespeedslashvs_finish.ani"; local ani = sq_CreateAnimation("", aniPath); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 72)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); if(sq_getRandom(1, 100) > 50) obj.sq_PlaySound("SM_UNLIMITEDSPEEDSLASH_VS_02_1"); else obj.sq_PlaySound("SM_UNLIMITEDSPEEDSLASH_VS_02_2"); break; case 4: local size = obj.getVar("VSObj").get_obj_vector_size(); if(size <= 0) obj.getVar("VSObj").clear_obj_vector(); sqrChr.getVar("VSObj").push_obj_vector(obj); obj.getVar("set").setInt(0, 100); if(sq_Abs(sq_GetXPos(obj) - sq_GetXPos(sqrChr)) > 50) sq_SetCurrentDirection(obj, sq_GetOppositeDirection(sq_GetDirection(obj))); local totalDamage = receiveData.readDword(); local totalDamageFinish = receiveData.readDword(); obj.getVar("custom").setInt(0, totalDamage); obj.getVar("custom").setInt(1, totalDamageFinish); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 67)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); break; } break; } break; } } function setState_po_swordman_bykk(obj, state, datas) { if(!obj) return; local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); local job = obj.getVar("job").getInt(0); local skillIndex = obj.getVar("skillIndex").getInt(0); local subtype = obj.getVar("subtype").getInt(0); obj.getVar("state").setInt(0, state); switch(job){ case 0: break; case 1: switch(skillIndex){ case SKILL_SMBYKK_SWORDOFMIND: switch(subtype){ case 2: local aniPath = "character/swordman/effect/animation/1_swordman_bykk/swordofmind/charge_ani.ani"; if(state == 21) aniPath = "character/swordman/effect/animation/1_swordman_bykk/swordofmind/charge_repeat.ani"; local ani = sq_CreateAnimation("", aniPath); obj.setCurrentAnimation(ani); if(state == 21){ local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(-1,sq_CreateAnimation("","character/swordman/effect/animation/1_swordman_bykk/swordofmind/charging.ani"),true); } break; case 3: local aniPath = ["character/swordman/effect/animation/1_swordman_bykk/swordofmind/normalhit/hit1_smoke.ani", "character/swordman/effect/animation/1_swordman_bykk/swordofmind/normalhit/hit2_smoke.ani", "character/swordman/effect/animation/1_swordman_bykk/swordofmind/normalhit/hit3_smoke.ani", "character/swordman/effect/animation/1_swordman_bykk/swordofmind/last_hit.ani"]; local weaponSubType = obj.getVar("custom").getInt(2); if(weaponSubType == 2){ aniPath = ["character/swordman/effect/animation/1_swordman_bykk/swordofmind/dunhit/dunhit1_hit_smoke.ani", "character/swordman/effect/animation/1_swordman_bykk/swordofmind/dunhit/dunhit2_hit_smoke.ani", "character/swordman/effect/animation/1_swordman_bykk/swordofmind/dunhit/dunhit3_hit_smoke.ani", "character/swordman/effect/animation/1_swordman_bykk/swordofmind/dunhit/dunhit_finish_last_hit.ani"]; } local ani = sq_CreateAnimation("", aniPath[state - 20]); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); if(state == 23){ currentAni.addLayerAnimation(-1,sq_CreateAnimation("","character/swordman/effect/animation/1_swordman_bykk/swordofmind/cross_eff.ani"),true); if(obj.getVar("custom").getInt(9) > 0){ currentAni.addLayerAnimation(6,sq_CreateAnimation("","passiveobject/0_swordman_bykk/1weaponmaster/animation/stateoflimit/state_of_limit_draw_02.ani"),true); local totalDamage = obj.getVar("custom").getInt(1) * obj.getVar("custom").getInt(9) / 100; createSkillPassive_Swordman_bykk(obj,obj,PASSIVEOBJ_BYKK_SWORDMAN,0,0,0,sq_GetDirection(obj),1,SKILL_SMBYKK_SWORDOFMIND,4,totalDamage,0,0,0,0,0,0,0); } sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 31)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), obj.getVar("custom").getInt(1)); sq_SetMyShake(obj, 10, 120); } else{ sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 30)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), obj.getVar("custom").getInt(0)); currentAni.setSpeedRate(200.0); } switch(weaponSubType){ case 2: local attackInfo = sq_GetCurrentAttackInfo(obj); sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_STUN, obj.getVar("custom").getInt(10), obj.getVar("custom").getInt(12), obj.getVar("custom").getInt(11)); break; case 5: local attackInfo = sq_GetCurrentAttackInfo(obj); sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_LIGHTNING, obj.getVar("custom").getInt(10), obj.getVar("custom").getInt(12), obj.getVar("custom").getInt(11)); break; } obj.setTimeEvent(3, 50, 1, false); break; } break; case SKILL_SMBYKK_FLASHCUT: switch(subtype){ case 1: local aniPath = ["character/swordman/effect/animation/1_swordman_bykk/flashcut/fcfinish01_eff_00.ani", "character/swordman/effect/animation/1_swordman_bykk/flashcut/fcfinish02_eff_00.ani", "character/swordman/effect/animation/1_swordman_bykk/flashcut/fcfinish03_eff_00.ani", "character/swordman/effect/animation/1_swordman_bykk/flashcut/fcfinish04_eff_00.ani", "character/swordman/effect/animation/1_swordman_bykk/flashcut/fcfinish05_eff_00.ani"]; local ani = sq_CreateAnimation("", aniPath[state - 20]); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); if(state < 24) currentAni.setSpeedRate(300.0); if(state != 24){ sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 59)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), obj.getVar("custom").getInt(0)); } else{ sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 60)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), obj.getVar("custom").getInt(1)); } obj.setTimeEvent(3, 50, 1, false); break; } break; case SKILL_SMBYKK_HANDLINGSWORD: switch(subtype){ case 1: local baseAniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/handlingsword/"; local aniPathSet = [ ["handlingsword_stand_sword_normal_a.ani","handlingsword_stand_sword_normal_b.ani","handlingsword_stand_sword_normal_c.ani","handlingsword_stand_sword_normal_d.ani","handlingsword_stand_sword_normal_e.ani"],//phase_stand ["handlingsword_lifting_sword_normal_b.ani","handlingsword_lifting_sword_normal_c.ani","handlingsword_lifting_sword_normal_d.ani","handlingsword_lifting_sword_normal_e.ani"],//lifting ["handlingsword_returning_sword_normal_e.ani"]//return ]; switch(state){ case 20: local aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/handlingsword/dummy_loop.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); local swordCount = obj.getVar("custom").getInt(1); if(swordCount < 1) break; local currentAni = obj.getCurrentAnimation(); switch(swordCount){ case 5: currentAni.addLayerAnimation(-1,sq_CreateAnimation("",baseAniPath + aniPathSet[0][4]),true); case 4: currentAni.addLayerAnimation(-1,sq_CreateAnimation("",baseAniPath + aniPathSet[0][3]),true); case 3: currentAni.addLayerAnimation(-1,sq_CreateAnimation("",baseAniPath + aniPathSet[0][2]),true); case 2: currentAni.addLayerAnimation(-1,sq_CreateAnimation("",baseAniPath + aniPathSet[0][1]),true); case 1: currentAni.addLayerAnimation(-1,sq_CreateAnimation("",baseAniPath + aniPathSet[0][0]),true); break; } break; case 21: local aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/handlingsword/dummy.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); local swordCount = obj.getVar("custom").getInt(1); if(swordCount < 1) break; local currentAni = obj.getCurrentAnimation(); switch(swordCount){ case 1: currentAni.addLayerAnimation(-1,sq_CreateAnimation("",baseAniPath + aniPathSet[2][0]),true); case 5: currentAni.addLayerAnimation(-1,sq_CreateAnimation("",baseAniPath + aniPathSet[1][3]),true); case 4: currentAni.addLayerAnimation(-1,sq_CreateAnimation("",baseAniPath + aniPathSet[1][2]),true); case 3: currentAni.addLayerAnimation(-1,sq_CreateAnimation("",baseAniPath + aniPathSet[1][1]),true); case 2: currentAni.addLayerAnimation(-1,sq_CreateAnimation("",baseAniPath + aniPathSet[1][0]),true); break; } currentAni.setSpeedRate(300.0); break; case 22: local aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/handlingsword/dummy.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); local swordCount = obj.getVar("custom").getInt(1); if(swordCount < 1) break; local currentAni = obj.getCurrentAnimation(); switch(swordCount - 1){ case 4: currentAni.addLayerAnimation(-1,sq_CreateAnimation("",baseAniPath + aniPathSet[0][3]),true); case 3: currentAni.addLayerAnimation(-1,sq_CreateAnimation("",baseAniPath + aniPathSet[0][2]),true); case 2: currentAni.addLayerAnimation(-1,sq_CreateAnimation("",baseAniPath + aniPathSet[0][1]),true); case 1: currentAni.addLayerAnimation(-1,sq_CreateAnimation("",baseAniPath + aniPathSet[0][0]),true); break; } switch(swordCount){ case 5: currentAni.addLayerAnimation(-1,sq_CreateAnimation("",baseAniPath + aniPathSet[2][0]),true); case 4: currentAni.addLayerAnimation(-1,sq_CreateAnimation("",baseAniPath + aniPathSet[1][3]),true); case 3: currentAni.addLayerAnimation(-1,sq_CreateAnimation("",baseAniPath + aniPathSet[1][2]),true); case 2: currentAni.addLayerAnimation(-1,sq_CreateAnimation("",baseAniPath + aniPathSet[1][1]),true); case 1: currentAni.addLayerAnimation(-1,sq_CreateAnimation("",baseAniPath + aniPathSet[1][0]),true); break; } currentAni.setSpeedRate(300.0); break; } break; case 3: switch(state){ case 20: local aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/handlingsword/dummy.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.setSpeedRate(400.0); break; case 21: local aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/handlingsword/dummy.ani"; local targetObj = obj.getVar("tar").get_obj_vector(0); if(targetObj && targetObj.getState() != STATE_DIE){ sq_setCurrentAxisPos(obj, 0, sq_GetXPos(targetObj)); sq_setCurrentAxisPos(obj, 1, sq_GetYPos(targetObj) + 1); sq_setCurrentAxisPos(obj, 2, sq_GetZPos(targetObj) + sq_GetHeightObject(targetObj) / 2); aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/handlingsword/handlingsword_flyingsword_eff_b.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); local angle = sq_getRandom(0, 360); obj.getVar("custom").setInt(10, angle); sq_SetCustomRotate(obj, sq_ToRadian(angle.tofloat())); sq_SetMyShake(obj, 3, 30); local currentAni = obj.getCurrentAnimation(); currentAni.setSpeedRate(150.0); } else{ local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.setSpeedRate(400.0); } break; case 22: local aniPath = "passiveobject/0_swordman_bykk/1weaponmaster/animation/handlingsword/ballhead.ani"; local ani = sq_CreateAnimation("",aniPath); obj.setCurrentAnimation(ani); obj.getVar("move").setInt(0, sq_GetXPos(obj)); obj.getVar("move").setInt(1, sq_GetYPos(obj)); obj.getVar("move").setInt(2, sq_GetZPos(obj)); obj.getVar("move").setInt(3, sq_GetDistancePos(sq_GetXPos(sqrChr), sq_GetDirection(sqrChr), sq_getRandom(-200, -100))); obj.getVar("move").setInt(4, sq_GetYPos(sqrChr) + sq_getRandom(-100, 100)); obj.setTimeEvent(22, 5, 50, true); break; } break; } break; case SKILL_SMBYKK_STATEOFLIMIT: switch(subtype){ case 2: switch(state){ case 20: local ani = sq_CreateAnimation("", "passiveobject/0_swordman_bykk/1weaponmaster/animation/stateoflimit/rapidmoveslash/tornado_start.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/0_swordman_bykk/1weaponmaster/animation/stateoflimit/state_of_limit_dragon_04.ani"),true); currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/0_swordman_bykk/1weaponmaster/animation/stateoflimit/state_of_limit_dragon_01.ani"),true); currentAni.setSpeedRate(200.0); obj.sq_PlaySound("MENGRYONG_TORNADO"); break; case 21: local ani = sq_CreateAnimation("", "passiveobject/0_swordman_bykk/1weaponmaster/animation/stateoflimit/rapidmoveslash/tornado_loop.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/0_swordman_bykk/1weaponmaster/animation/stateoflimit/rapidmoveslash/tornado_loopb.ani"),true); currentAni.addLayerAnimation(2,sq_CreateAnimation("","passiveobject/0_swordman_bykk/1weaponmaster/animation/stateoflimit/rapidmoveslash/tornado_loopc.ani"),true); currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/0_swordman_bykk/1weaponmaster/animation/stateoflimit/state_of_limit_dragon_04.ani"),true); currentAni.addLayerAnimation(5,sq_CreateAnimation("","passiveobject/0_swordman_bykk/1weaponmaster/animation/stateoflimit/state_of_limit_dragon_01.ani"),true); currentAni.setSpeedRate(200.0); obj.setTimeEvent(40, 2, 50, true); obj.sq_PlaySound("MENGRYONG_TORNADO"); break; case 22: local ani = sq_CreateAnimation("", "passiveobject/0_swordman_bykk/1weaponmaster/animation/stateoflimit/rapidmoveslash/tornado_end.ani"); obj.setCurrentAnimation(ani); local currentAni = obj.getCurrentAnimation(); currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/0_swordman_bykk/1weaponmaster/animation/stateoflimit/rapidmoveslash/tornado_endb.ani"),true); currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/0_swordman_bykk/1weaponmaster/animation/stateoflimit/rapidmoveslash/state_of_limit_dragon_vanish_03.ani"),true); currentAni.addLayerAnimation(5,sq_CreateAnimation("","passiveobject/0_swordman_bykk/1weaponmaster/animation/stateoflimit/rapidmoveslash/state_of_limit_dragon_vanish_01.ani"),true); break; } local sizeRate = obj.getVar("custom").getInt(4); if(sizeRate > 100){ local currentAni = obj.getCurrentAnimation(); sizeRate = sizeRate.tofloat() / 100.0; currentAni.setImageRateFromOriginal(sizeRate, sizeRate); currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); } break; } break; } break; case 2: break; case 3: break; case 4: break; case 5: switch(skillIndex){ case 231: switch(subtype){ case 4: switch(state){ case 20: local ani = sq_CreateAnimation("", "passiveobject/0_swordman_bykk/5_ghost/animation/unlimitedspeedslashbvs/ultimatespeedslashvs_00.ani"); obj.setCurrentAnimation(ani); if(sq_getRandom(1, 100) > 50) obj.sq_PlaySound("SM_UNLIMITEDSPEEDSLASH_VS_01_1"); else obj.sq_PlaySound("SM_UNLIMITEDSPEEDSLASH_VS_01_1"); break; case 21: local ani = sq_CreateAnimation("", "passiveobject/0_swordman_bykk/5_ghost/animation/unlimitedspeedslashbvs/vsfinish/ultimatespeedslashvs_finish.ani"); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 72)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), obj.getVar("custom").getInt(1)); if(sq_getRandom(1, 100) > 50) obj.sq_PlaySound("SM_UNLIMITEDSPEEDSLASH_VS_02_1"); else obj.sq_PlaySound("SM_UNLIMITEDSPEEDSLASH_VS_02_2"); break; } break; } break; } break; } } function onEndCurrentAni_po_swordman_bykk(obj) { if(!obj) return; local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); local job = obj.getVar("job").getInt(0); local skillIndex = obj.getVar("skillIndex").getInt(0); local subtype = obj.getVar("subtype").getInt(0); local state = obj.getVar("state").getInt(0); switch(job){ case 0: break; case 1: switch(skillIndex){ case SKILL_SMBYKK_ASHENFORK: sq_SendDestroyPacketPassiveObject(obj); break; case SKILL_SMBYKK_WEAPONCOMBO: sq_SendDestroyPacketPassiveObject(obj); break; case SKILL_SMBYKK_CHARGECRASH: sq_SendDestroyPacketPassiveObject(obj); break; case SKILL_SMBYKK_FLOWMINDTWO: sq_SendDestroyPacketPassiveObject(obj); break; case SKILL_SMBYKK_FLOWMINDTHREE: sq_SendDestroyPacketPassiveObject(obj); break; case SKILL_SMBYKK_MOMENTARYSLASH: sq_SendDestroyPacketPassiveObject(obj); break; case SKILL_SMBYKK_ILLUSIONSLASH: sq_SendDestroyPacketPassiveObject(obj); break; case SKILL_SMBYKK_METEORSWORD: sq_SendDestroyPacketPassiveObject(obj); break; case SKILL_SMBYKK_SWORDOFMIND: switch(subtype){ case 2: switch(state){ case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; } break; case 3: switch(state){ case 20: case 21: case 22: if(obj.getVar("custom").getInt(4) + 1 >= obj.getVar("custom").getInt(3)){ obj.getVar("custom").setInt(5, sq_GetXPos(obj)); obj.getVar("custom").setInt(6, sq_GetYPos(obj)); obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, ""); } else{ obj.getVar("custom").setInt(4, obj.getVar("custom").getInt(4) + 1); if(state == 22) obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); else obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); } break; case 23: sq_SendDestroyPacketPassiveObject(obj); break; } break; case 4: sq_SendDestroyPacketPassiveObject(obj); break; } break; case SKILL_SMBYKK_FLASHCUT: switch(subtype){ case 1: switch(state){ case 20: case 21: case 22: case 23: if(obj.getVar("custom").getInt(3) + 1 >= obj.getVar("custom").getInt(2)){ obj.addSetStatePacket(24, null, STATE_PRIORITY_AUTO, false, ""); } else{ obj.getVar("custom").setInt(3, obj.getVar("custom").getInt(3) + 1); if(state == 23) obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); else obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); } break; case 24: sq_SendDestroyPacketPassiveObject(obj); break; } break; case 2: sq_SendDestroyPacketPassiveObject(obj); break; } break; case SKILL_SMBYKK_INVISIBLESWORDCUT: sq_SendDestroyPacketPassiveObject(obj); break; case SKILL_SMBYKK_HANDLINGSWORD: switch(subtype){ case 1: switch(state){ case 21: obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); break; case 22: obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); break; } break; case 2: local totalDamage = obj.getVar("custom").getInt(0); local group = obj.getVar("custom").getInt(1); local uniqueId = obj.getVar("custom").getInt(2); createSkillPassive_Swordman_bykk(obj,obj,PASSIVEOBJ_BYKK_SWORDMAN,0,0,0,sq_GetDirection(obj),1,SKILL_SMBYKK_HANDLINGSWORD,3,totalDamage,group,uniqueId,0,0,0,0,0); sq_SendDestroyPacketPassiveObject(obj); break; case 3: switch(state){ case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; case 21: print("testendani"); obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); break; } break; case 4: sq_SendDestroyPacketPassiveObject(obj); break; case 5: if(sqrChr && sqrChr.getState() != STATE_DIE && CNSquirrelAppendage.sq_IsAppendAppendage(sqrChr, APDPATH_SM_HANDLINGSWORD_BUFF)){ obj.setTimeEvent(26, 50, 5, true); } else sq_SendDestroyPacketPassiveObject(obj); break; } break; case SKILL_SMBYKK_STATEOFINVISIBLESWORD: switch(subtype){ case 1: sq_SendDestroyPacketPassiveObject(obj); break; case 2: sq_SendDestroyPacketPassiveObject(obj); break; case 3: sq_SendDestroyPacketPassiveObject(obj); break; case 4: sq_SendDestroyPacketPassiveObject(obj); break; } break; case SKILL_SMBYKK_STATEOFLIMIT: switch(subtype){ case 1: sq_SendDestroyPacketPassiveObject(obj); break; case 2: switch(state){ case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; case 22: sq_SendDestroyPacketPassiveObject(obj); break; } break; } break; case SKILL_SMBYKK_SHORTSWORDMASTERY: sq_SendDestroyPacketPassiveObject(obj); break; case SKILL_SMBYKK_BLUNTMASTERY: sq_SendDestroyPacketPassiveObject(obj); break; case SKILL_SMBYKK_BLADEMASTERY: sq_SendDestroyPacketPassiveObject(obj); break; case SKILL_SMBYKK_MYSTICEQUIP: sq_SendDestroyPacketPassiveObject(obj); break; } break; case 2: break; case 3: break; case 4: break; case 5: switch(skillIndex){ case 231: if(subtype == 4 && state == 20){ obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; } sq_SendDestroyPacketPassiveObject(obj); break; } break; } } function onTimeEvent_po_swordman_bykk(obj, timeEventIndex, timeEventCount) { if(!obj) return; local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); local job = obj.getVar("job").getInt(0); local skillIndex = obj.getVar("skillIndex").getInt(0); local subtype = obj.getVar("subtype").getInt(0); local state = obj.getVar("state").getInt(0); switch(job){ case 0: break; case 1: switch(timeEventIndex){ case 0: obj.resetHitObjectList(); break; case 1: switch(skillIndex){ case SKILL_SMBYKK_FLOWMINDTHREE: local targetObj = obj.getVar("tar").get_obj_vector(0); if(targetObj && targetObj.getState() != STATE_DIE){ sq_SendHitObjectPacket(obj,targetObj,0,0,sq_GetObjectHeight(targetObj) / 2); } break; case SKILL_SMBYKK_METEORSWORD: if(sq_IsMyControlObject(obj)){ if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_RIGHT, ENUM_SUBKEY_TYPE_ALL)){ if(sqrChr.isMovablePos(sq_GetXPos(obj) + 4, sq_GetYPos(obj))) sq_setCurrentAxisPos(obj, 0, sq_GetXPos(obj) + 4); if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_UP, ENUM_SUBKEY_TYPE_ALL)){ if(sqrChr.isMovablePos(sq_GetXPos(obj), sq_GetYPos(obj) - 2)) sq_setCurrentAxisPos(obj, 1, sq_GetYPos(obj) - 2); } else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_DOWN, ENUM_SUBKEY_TYPE_ALL)){ if(sqrChr.isMovablePos(sq_GetXPos(obj), sq_GetYPos(obj) + 2)) sq_setCurrentAxisPos(obj, 1, sq_GetYPos(obj) + 2); } } else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_LEFT, ENUM_SUBKEY_TYPE_ALL)){ if(sqrChr.isMovablePos(sq_GetXPos(obj) - 4, sq_GetYPos(obj))) sq_setCurrentAxisPos(obj, 0, sq_GetXPos(obj) - 4); if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_UP, ENUM_SUBKEY_TYPE_ALL)){ if(sqrChr.isMovablePos(sq_GetXPos(obj), sq_GetYPos(obj) - 2)) sq_setCurrentAxisPos(obj, 1, sq_GetYPos(obj) - 2); } else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_DOWN, ENUM_SUBKEY_TYPE_ALL)){ if(sqrChr.isMovablePos(sq_GetXPos(obj), sq_GetYPos(obj) + 2)) sq_setCurrentAxisPos(obj, 1, sq_GetYPos(obj) + 2); } } else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_UP, ENUM_SUBKEY_TYPE_ALL)){ if(sqrChr.isMovablePos(sq_GetXPos(obj), sq_GetYPos(obj) - 2)) sq_setCurrentAxisPos(obj, 1, sq_GetYPos(obj) - 2); } else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_DOWN, ENUM_SUBKEY_TYPE_ALL)){ if(sqrChr.isMovablePos(sq_GetXPos(obj), sq_GetYPos(obj) + 2)) sq_setCurrentAxisPos(obj, 1, sq_GetYPos(obj) + 2); } } break; case SKILL_SMBYKK_SWORDOFMIND: sq_AddDrawOnlyAniFromParent(obj, "character/swordman/effect/animation/1_swordman_bykk/swordofmind/charge_fin.ani", 0, 0, 0); break; } break; case 2: switch(skillIndex){ case SKILL_SMBYKK_METEORSWORD: local totalDamage = obj.getVar("custom").getInt(0); local rangeX = 140 * obj.getVar("custom").getInt(2) / 100; local rangeY = 40 * obj.getVar("custom").getInt(2) / 100; createSkillPassive_Swordman_bykk(obj,obj,PASSIVEOBJ_BYKK_SWORDMAN,sq_getRandom(-rangeX, rangeX),sq_getRandom(-rangeY, rangeY),0,sq_GetDirection(obj),1,SKILL_SMBYKK_METEORSWORD,4,totalDamage,sq_getRandom(1, 7),0,0,0,0,0,0); if(timeEventCount >= obj.getVar("custom").getInt(1)){ if(obj.getVar("custom").getInt(100) < 1) obj.setTimeEvent(5, 600, 1, false); else obj.setTimeEvent(255, 750, 1, false); } break; case SKILL_SMBYKK_SWORDOFMIND: case SKILL_SMBYKK_FLASHCUT: local targetObj = obj.getVar("tar").get_obj_vector(0); if(targetObj && targetObj.getState() != STATE_DIE){ sq_setCurrentAxisPos(obj, 0, sq_GetXPos(targetObj)); sq_setCurrentAxisPos(obj, 1, sq_GetYPos(targetObj) + 1); } else sq_SendDestroyPacketPassiveObject(obj); break; } break; case 3: switch(skillIndex){ case SKILL_SMBYKK_METEORSWORD: local totalDamage = obj.getVar("custom").getInt(10); local holdTime = obj.getVar("custom").getInt(11); local weaponSubType = obj.getVar("custom").getInt(12); local sizeRate = obj.getVar("custom").getInt(2); local sub = 0; if(timeEventCount >= obj.getVar("custom").getInt(13)){ sub = 1; local flashScreenObj = sqrChr.getVar("flashobj").get_obj_vector(0); local pflashScreen = sq_GetCNRDObjectToFlashScreen(flashScreenObj); if(pflashScreen) pflashScreen.fadeOut(); sq_flashScreen(obj,0,0,300,150, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); } local rangeX = 130 * sizeRate / 100; local rangeY = 40 * sizeRate / 100; createSkillPassive_Swordman_bykk(obj,obj,PASSIVEOBJ_BYKK_SWORDMAN,0,0,300,sq_GetDirection(obj),1,SKILL_SMBYKK_METEORSWORD,5,totalDamage,holdTime,weaponSubType,sizeRate,sub,0,0,0); break; case SKILL_SMBYKK_SWORDOFMIND: case SKILL_SMBYKK_FLASHCUT: if(skillIndex == SKILL_SMBYKK_SWORDOFMIND && obj.getVar("custom").getInt(2) == 2 && state == 23) break; local targetObj = obj.getVar("tar").get_obj_vector(0); if(targetObj && targetObj.getState() != STATE_DIE){ local activeObj = sq_GetCNRDObjectToActiveObject(targetObj); sq_SendHitObjectPacket(obj,activeObj,0,0,sq_GetObjectHeight(activeObj) / 2); } break; } break; case 4: local vz = sq_GetUniformVelocity(obj.getVar("custom").getInt(50), 0, timeEventCount, 20); sq_setCurrentAxisPos(obj, 2, vz); if(timeEventCount >= 20 && state != 21) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; case 5: obj.getVar("set").setBool(0, true); break; case 6: local isTrue = obj.getVar("custom").getInt(101); local totalDamage = sqrChr.sq_GetBonusRateWithPassive(SKILL_SMBYKK_METEORSWORD, -1, 3, isTrue==1?1.1:1.0); local skillLevel = sq_GetSkillLevel(sqrChr, SKILL_SMBYKK_METEORSWORD); local createMax = sq_GetLevelData(sqrChr, SKILL_SMBYKK_METEORSWORD, 4, skillLevel); local createTime = sq_GetLevelData(sqrChr, SKILL_SMBYKK_METEORSWORD, 5, skillLevel); local sizeRate = sq_GetIntData(sqrChr, SKILL_SMBYKK_METEORSWORD, 4); obj.getVar("custom").setInt(0, totalDamage); obj.getVar("custom").setInt(1, createMax); obj.getVar("custom").setInt(2, sizeRate); if(sq_GetSkillLevel(sqrChr, SKILL_SMBYKK_STATEOFLIMIT) > 0){ local totalDamage = sqrChr.sq_GetBonusRateWithPassive(SKILL_SMBYKK_STATEOFLIMIT, -1, 7, isTrue==1?1.1:1.0); local skillLevel = sq_GetSkillLevel(sqrChr, SKILL_SMBYKK_STATEOFLIMIT); local cMax = sq_GetIntData(sqrChr, SKILL_SMBYKK_STATEOFLIMIT, 28); local holdTime = sq_GetIntData(sqrChr, SKILL_SMBYKK_STATEOFLIMIT, 29); if(obj.getVar("custom").getInt(100) > 0) holdTime = 0; local weaponSubType = sqrChr.getWeaponSubType(); obj.getVar("custom").setInt(10, totalDamage); obj.getVar("custom").setInt(11, holdTime); obj.getVar("custom").setInt(12, weaponSubType); obj.getVar("custom").setInt(13, cMax); obj.setTimeEvent(3, (createTime * createMax + 1200) / (cMax + 1), cMax, false); } obj.setTimeEvent(2, createTime, createMax, false); break; case 10: local targetObj = obj.getVar("tar").get_obj_vector(0); if(targetObj && targetObj.getState() != STATE_DIE){ sq_SendHitObjectPacket(obj,targetObj,0,0,sq_GetObjectHeight(targetObj) / 2); } break; case 11: local targetObj = obj.getVar("tar").get_obj_vector(0); if(targetObj && targetObj.getState() != STATE_DIE){ local v = sq_GetAccel(0, 120, timeEventCount, 50, true); local angle = sq_GetUniformVelocity(0, 2160, timeEventCount, 60); sq_SetCustomRotate(targetObj, sq_ToRadian(angle.tofloat())); sq_setCurrentAxisPos(obj, 2, obj.getVar("custom").getInt(1) + v); sq_setCurrentAxisPos(targetObj, 2, obj.getVar("custom").getInt(0) + v); if(timeEventCount >= 60){ // obj.getVar("custom").setInt(0, sq_GetZPos(targetObj)); obj.setTimeEvent(12, 1, 60, true); } } else sq_SendDestroyPacketPassiveObject(obj); break; case 12: local targetObj = obj.getVar("tar").get_obj_vector(0); if(targetObj && targetObj.getState() != STATE_DIE){ local v = sq_GetAccel(120, 0, timeEventCount, 50, false); local angle = sq_GetUniformVelocity(0, 2160, timeEventCount, 60); sq_SetCustomRotate(targetObj, sq_ToRadian(angle.tofloat())); sq_setCurrentAxisPos(obj, 2, obj.getVar("custom").getInt(1) + v); sq_setCurrentAxisPos(targetObj, 2, obj.getVar("custom").getInt(0) + v); if(timeEventCount >= 55){ local targetObj = obj.getVar("tar").get_obj_vector(0); if(targetObj && targetObj.getState() != STATE_DIE){ if(obj.getVar().getBool(0) == false){ obj.getVar().setBool(0, true); sq_SendHitObjectPacket(obj,targetObj,0,0,sq_GetObjectHeight(targetObj) / 2); } } } if(timeEventCount >= 60) sq_SendDestroyPacketPassiveObject(obj); } else sq_SendDestroyPacketPassiveObject(obj); break; case 20: obj.getVar("custom").setInt(1, obj.getVar("custom").getInt(1) - 1); local totalDamage = obj.getVar("custom").getInt(0); local group = obj.getVar("custom").getInt(2); local uniqueId = obj.getVar("custom").getInt(3); createSkillPassive_Swordman_bykk(sqrChr,obj,PASSIVEOBJ_BYKK_SWORDMAN,0,0,0,sq_GetDirection(obj),1,SKILL_SMBYKK_HANDLINGSWORD,2,totalDamage,group,uniqueId,0,0,0,0,0); //obj.sq_PlaySound("CONTROLBLADE_THROW"); obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; case 21: local targetObj = obj.getVar("tar").get_obj_vector(0); if(targetObj && targetObj.getState() != STATE_DIE){ sq_SendHitObjectPacket(obj,targetObj,0,0,sq_GetObjectHeight(targetObj) / 2); } break; case 22: if(!sqrChr || sqrChr.getState() == STATE_DIE){ sq_SendDestroyPacketPassiveObject(obj); break; } local vx = sq_GetUniformVelocity(obj.getVar("move").getInt(0), obj.getVar("move").getInt(3), timeEventCount, 25); local vy = sq_GetUniformVelocity(obj.getVar("move").getInt(1), obj.getVar("move").getInt(4), timeEventCount, 25); local vz = sq_GetUniformVelocity(obj.getVar("move").getInt(2), sq_GetZPos(sqrChr) + sq_GetHeightObject(sqrChr) / 2, timeEventCount, 50); if(timeEventCount == 25){ obj.getVar("move").setInt(0, sq_GetXPos(obj)); obj.getVar("move").setInt(1, sq_GetYPos(obj)); } if(timeEventCount > 25){ vx = sq_GetUniformVelocity(obj.getVar("move").getInt(0), sq_GetXPos(sqrChr), timeEventCount - 24, 25); vy = sq_GetUniformVelocity(obj.getVar("move").getInt(1), sq_GetYPos(sqrChr), timeEventCount - 24, 25); } sq_setCurrentAxisPos(obj, 0, vx); sq_setCurrentAxisPos(obj, 1, vy); sq_setCurrentAxisPos(obj, 2, vz); if(timeEventCount >= 50){ local mainAtkObj = sqrChr.getVar("handlingsword_mainAtkObj").get_obj_vector(0); if(mainAtkObj){ local colObj = sq_GetCNRDObjectToCollisionObject(mainAtkObj); local swordCount = colObj.getVar("custom").getInt(1); if(swordCount < 5) colObj.getVar("custom").setInt(1, swordCount + 1); colObj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); } sq_SendDestroyPacketPassiveObject(obj); } break; case 23: local currentAni = obj.getCurrentAnimation(); local hitMax = obj.getVar("custom").getInt(1); obj.setTimeEvent(24, currentAni.getDelaySum(10, 32) / hitMax, hitMax, true); break; case 24: obj.resetHitObjectList(); sq_SetMyShake(obj, 5, 80); break; case 25: local ani = sq_CreateAnimation("","passiveobject/0_swordman_bykk/1weaponmaster/animation/handlingsword/handlingsword_finish_a_swordnormal_p.ani"); obj.setCurrentAnimation(ani); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 4)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), obj.getVar("custom").getInt(4)); local currentAni = obj.getCurrentAnimation(); obj.setTimeEvent(23, currentAni.getDelaySum(0, 9), 1, false); local flashScreenObj = sqrChr.getVar("flashobj_handlingsowrd").get_obj_vector(0); local pflashScreen = sq_GetCNRDObjectToFlashScreen(flashScreenObj); if(pflashScreen){ pflashScreen.fadeOut(); } local flashScreenObj = sq_flashScreen(sqrChr,200,999990,0,204, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); sqrChr.getVar("flashobj_handlingsowrd").clear_obj_vector();//清除 sqrChr.getVar("flashobj_handlingsowrd").push_obj_vector(flashScreenObj);//加入 break; case 26: local mainAtkObj = sqrChr.getVar("handlingsword_mainAtkObj").get_obj_vector(0); if(mainAtkObj){ local colObj = sq_GetCNRDObjectToCollisionObject(mainAtkObj); local swordCount = colObj.getVar("custom").getInt(1); if(swordCount == 5) sq_SendDestroyPacketPassiveObject(obj); } createSkillPassive_Swordman_bykk(sqrChr,obj,PASSIVEOBJ_BYKK_SWORDMAN,0,0,0,sq_GetDirection(obj),1,SKILL_SMBYKK_HANDLINGSWORD,3,0,0,0,1,0,0,0,0); if(timeEventCount >= 5) sq_SendDestroyPacketPassiveObject(obj); break; case 30: local currentAni = obj.getCurrentAnimation(); local hitMax = obj.getVar("custom").getInt(0); obj.setTimeEvent(0, currentAni.getDelaySum(3, 7) / hitMax, hitMax, true); break; case 31: local currentAni = obj.getCurrentAnimation(); local hitMax = obj.getVar("custom").getInt(0); obj.setTimeEvent(0, currentAni.getDelaySum(2, 6) / hitMax, hitMax, true); break; case 32: local currentAni = obj.getCurrentAnimation(); local hitMax = obj.getVar("custom").getInt(0); print("hitMax = "+hitMax); obj.setTimeEvent(0, currentAni.getDelaySum(2, 7) / hitMax, hitMax, true); break; case 33: local currentAni = obj.getCurrentAnimation(); local hitMax = obj.getVar("custom").getInt(0); obj.setTimeEvent(0, currentAni.getDelaySum(5, 20) / hitMax, hitMax, true); break; case 40: local targetObj = obj.getVar("tar").get_obj_vector(0); if(targetObj && targetObj.getState() != STATE_DIE){ local moveX = sq_GetXPos(targetObj), moveY = sq_GetYPos(targetObj); if(obj.getVar("custom").getInt(1) < 1) moveX = sq_GetDistancePos(moveX, sq_GetDirection(targetObj), 75); local vx = sq_GetAccel(obj.getVar("custom").getInt(2), moveX, timeEventCount, 50, true); local vy = sq_GetAccel(obj.getVar("custom").getInt(3), moveY, timeEventCount, 50, true); sq_setCurrentAxisPos(obj, 0, vx); sq_setCurrentAxisPos(obj, 1, vy); } if(timeEventCount >= 50){ local hitMax = obj.getVar("custom").getInt(0); obj.setTimeEvent(0, 100, hitMax - 1, true); obj.setTimeEvent(41, 120 * hitMax, 1, false); } break; case 41: obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); break; case 42: local v = sq_GetUniformVelocity(0, obj.getVar("custom").getInt(1), timeEventCount, 250); local dstX = sq_GetDistancePos(obj.getVar("custom").getInt(2), obj.getDirection(), v); sq_setCurrentAxisPos(obj, 0, dstX); break; case 43: local targetObj = obj.getVar("tar").get_obj_vector(0); if(targetObj && targetObj.getState() != STATE_DIE){ if(!CNSquirrelAppendage.sq_IsAppendAppendage(targetObj, APDPATH_SM_HANDLINGSWORD_HOLD)){ local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(targetObj, obj, -1, true, APDPATH_SM_HANDLINGSWORD_HOLD, true); sq_HoldAndDelayDie(targetObj, obj, true, true, true, 200, 200, ENUM_DIRECTION_NEUTRAL , AddAppendage); if(!sq_IsFixture(targetObj) && sq_IsHoldable(obj, targetObj) && sq_IsGrabable(obj, targetObj)){ sq_MoveToAppendageForce(targetObj, obj, obj, 0, 0, 30, 100, true, AddAppendage); } } } break; case 255: sq_SendDestroyPacketPassiveObject(obj); break; } break; case 2: break; case 3: break; case 4: break; case 5: switch(skillIndex){ case 231: switch(timeEventIndex){ case 10: sq_SendDestroyPacketPassiveObject(obj); break; } break; } break; } } function onAttack_po_swordman_bykk(obj, damager, boundingBox, isStuck) { if(!obj) return; local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); local job = obj.getVar("job").getInt(0); local skillIndex = obj.getVar("skillIndex").getInt(0); local subtype = obj.getVar("subtype").getInt(0); local state = obj.getVar("state").getInt(0); switch(job){ case 0: break; case 1: if(isStuck) break; if(damager.isObjectType(OBJECTTYPE_ACTIVE) && sqrChr.getVar("handlingsword_canShoot").getBool(0) && sqrChr.getState() != STATE_DIE){ local group = sq_GetGroup(damager); local uniqueId = sq_GetUniqueId(damager); shootHandlingSword_bykk(sqrChr, group, uniqueId); } switch(skillIndex){ case SKILL_SMBYKK_MOMENTARYSLASH: switch(subtype){ case 1: if(obj.getVar("custom").getInt(1) == 2 && damager.isObjectType(OBJECTTYPE_ACTIVE)){ local totalDamage = obj.getVar("custom").getInt(0); local group = sq_GetGroup(damager); local uniqueId = sq_GetUniqueId(damager); if(sq_IsFixture(damager)){ totalDamage = totalDamage * obj.getVar("custom").getInt(2) / 100; createSkillPassive_Swordman_bykk(obj,obj,PASSIVEOBJ_BYKK_SWORDMAN,0,0,0,sq_GetDirection(obj),1,SKILL_SMBYKK_MOMENTARYSLASH,3,totalDamage,group,uniqueId,0,0,0,0,0); } else if(sq_IsHoldable(obj, damager) && sq_IsGrabable(obj, damager)) { totalDamage = totalDamage * obj.getVar("custom").getInt(3) / 100; createSkillPassive_Swordman_bykk(obj,damager,PASSIVEOBJ_BYKK_SWORDMAN,0,1,sq_GetZPos(damager),sq_GetDirection(obj),1,SKILL_SMBYKK_MOMENTARYSLASH,4,totalDamage,group,uniqueId,0,0,0,0,0); } } break; } break; case SKILL_SMBYKK_METEORSWORD: switch(subtype){ case 5: case 15: local holdTime = obj.getVar("custom").getInt(1); print("holdTime = "+holdTime); if(holdTime == 0) break; if(damager.isObjectType(OBJECTTYPE_ACTIVE)){ local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(damager, obj, -1, true, APDPATH_SM_STATEOFLIMITMETEORSWORD, true); AddAppendage.sq_SetValidTime(holdTime); sq_HoldAndDelayDie(damager, obj, true, true, true, 200, 200, ENUM_DIRECTION_NEUTRAL, AddAppendage); } break; } break; case SKILL_SMBYKK_FLASHCUT: switch(subtype){ case 2: if(damager.isObjectType(OBJECTTYPE_ACTIVE) && damager.isInDamagableState(obj)){ if(!sqrChr.getVar("flashCutTar").is_obj_vector(damager)) sqrChr.getVar("flashCutTar").push_obj_vector(damager); } break; } break; case SKILL_SMBYKK_INVISIBLESWORDCUT: switch(subtype){ case 2: sq_AddDrawOnlyAniFromParent(damager, "passiveobject/0_swordman_bykk/1weaponmaster/animation/invisibleswordcut/hiteffectb_00.ani", 0, 0, sq_GetCenterZPos(boundingBox)); break; } break; case SKILL_SMBYKK_HANDLINGSWORD: switch(subtype){ case 3: local pooledObj = sq_AddDrawOnlyAniFromParent(damager, "passiveobject/0_swordman_bykk/1weaponmaster/animation/handlingsword/handlingsword_atk_eff_a.ani", 0, 0, sq_GetCenterZPos(boundingBox)); local angle = obj.getVar("custom").getInt(10); print("angle = "+angle); sq_SetCustomRotate(pooledObj, sq_ToRadian(angle.tofloat())); break; } break; } break; case 2: break; case 3: break; case 4: break; } } function onKeyFrameFlag_po_swordman_bykk(obj, flagIndex) { if(!obj) return; local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); local job = obj.getVar("job").getInt(0); local skillIndex = obj.getVar("skillIndex").getInt(0); local subtype = obj.getVar("subtype").getInt(0); local state = obj.getVar("state").getInt(0); switch(job){ case 0: break; case 1: switch(skillIndex){ case SKILL_SMBYKK_ILLUSIONSLASH: switch(subtype){ case 10: switch(flagIndex){ case 3: local totalDamage = obj.getVar("custom").getInt(0); local sizeRate = obj.getVar("custom").getInt(1) * 120 / 100; local sub = obj.getVar("custom").getInt(2); local weaponSubType = obj.getVar("custom").getInt(3); createSkillPassive_Swordman_bykk(sqrChr,obj,PASSIVEOBJ_BYKK_SWORDMAN,0,-1,-1,sq_GetDirection(obj),1,SKILL_SMBYKK_ILLUSIONSLASH,11,totalDamage,sizeRate,sub,weaponSubType,0,0,0,0); break; } break; case 20: switch(flagIndex){ case 3: local totalDamage = obj.getVar("custom").getInt(0); local sizeRate = obj.getVar("custom").getInt(1); local weaponSubType = obj.getVar("custom").getInt(2); local bonusGet = obj.getVar("custom").getInt(3); local speedRate = obj.getVar("custom").getInt(4); if(weaponSubType != 2) createSkillPassive_Swordman_bykk(sqrChr,obj,PASSIVEOBJ_BYKK_SWORDMAN,75,-1,-1,sq_GetDirection(obj),1,SKILL_SMBYKK_ILLUSIONSLASH,12,totalDamage,sizeRate,weaponSubType,bonusGet,speedRate,0,0,0); // else createSkillPassive_Swordman_bykk(sqrChr,obj,PASSIVEOBJ_BYKK_SWORDMAN,0,-1,-1,sq_GetDirection(obj),1,SKILL_SMBYKK_ILLUSIONSLASH,13,totalDamage,sizeRate,0,0,0,0,0,0); break; case 1: local weaponSubType = obj.getVar("custom").getInt(2); if(weaponSubType != 2) break; local sizeRate = obj.getVar("custom").getInt(1); local aniPath = "character/swordman/effect/animation/1_swordman_bykk/illusionslash/smash_shadow.ani"; createOnlyDrawObjectEX_Swordman_bykk(obj,aniPath,true,sq_GetDirection(obj),sq_GetXPos(obj),sq_GetYPos(obj),0,ENUM_DRAWLAYER_NORMAL,sizeRate,sizeRate); break; } break; } break; case SKILL_SMBYKK_INVISIBLESWORDCUT: switch(flagIndex){ case 1002: local currentAni = obj.getCurrentAnimation(); local delay = currentAni.getDelaySum(2, 31); local hitMax = obj.getVar("custom").getInt(2); obj.setTimeEvent(0, delay / hitMax, hitMax, true); break; case 1032: //`CreateFinish` local totalDamageExp = obj.getVar("custom").getInt(0); local speedRate = obj.getVar("custom").getInt(1); createSkillPassive_Swordman_bykk(obj,obj,PASSIVEOBJ_BYKK_SWORDMAN,0,0,0,sq_GetDirection(obj),1,SKILL_SMBYKK_INVISIBLESWORDCUT,2,totalDamageExp,speedRate,0,0,0,0,0,0); break; } break; case SKILL_SMBYKK_HANDLINGSWORD: switch(flagIndex){ case 1: if(subtype == 5) obj.sq_PlaySound("CONTROLBLADE_THROW"); if(subtype != 4) break; local totalDamageExp = obj.getVar("custom").getInt(0); local group = obj.getVar("custom").getInt(2); local uniqueId = obj.getVar("custom").getInt(3); if(sqrChr && sqrChr.getState() != STATE_DIE) createSkillPassive_Swordman_bykk(obj,obj,PASSIVEOBJ_BYKK_SWORDMAN,0,0,0,sq_GetDirection(obj),1,SKILL_SMBYKK_HANDLINGSWORD,5,totalDamageExp,group,uniqueId,0,0,0,0,0); break; case 1003: local totalDamage = obj.getVar("custom").getInt(0); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 6)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); sq_SetMyShake(obj, 20, 500); local flashScreenObj = sqrChr.getVar("flashobj_handlingsowrd").get_obj_vector(0); local pflashScreen = sq_GetCNRDObjectToFlashScreen(flashScreenObj); if(pflashScreen){ pflashScreen.fadeOut(); sq_flashScreen(sqrChr,0,0,500,204, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); } local size = obj.getVar("tar").get_obj_vector_size(); if(size < 1) break; local targetObj = obj.getVar("tar").get_obj_vector(0); if(targetObj && targetObj.getState() != STATE_DIE){ local activeObj = sq_GetCNRDObjectToActiveObject(targetObj); if(activeObj) //activeObj.getVar("handlingsword_unhold").setBool(0, true); CNSquirrelAppendage.sq_RemoveAppendage(obj, APDPATH_SM_HANDLINGSWORD_HOLD); } break; } break; } break; case 2: break; case 3: break; case 4: break; case 5: switch(skillIndex){ case 231: switch(flagIndex){ case 8: sq_SetMyShake(obj, 5, 80); sq_AddDrawOnlyAniFromParent(obj, "passiveobject/0_swordman_bykk/5_ghost/animation/unlimitedspeedslashbvs/ultimatespeedslashvss1_04.ani", 177, 0, 91); break; case 13: sq_SetMyShake(obj, 5, 80); sq_AddDrawOnlyAniFromParent(obj, "passiveobject/0_swordman_bykk/5_ghost/animation/unlimitedspeedslashbvs/ultimatespeedslashvss2_03.ani", 162, 0, 77); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 68)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), obj.getVar("custom").getInt(0)); break; case 17: sq_SetMyShake(obj, 5, 80); sq_AddDrawOnlyAniFromParent(obj, "passiveobject/0_swordman_bykk/5_ghost/animation/unlimitedspeedslashbvs/ultimatespeedslashvss3_03.ani", 213, 0, 58); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 69)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), obj.getVar("custom").getInt(0)); break; case 21: sq_SetMyShake(obj, 5, 80); sq_AddDrawOnlyAniFromParent(obj, "passiveobject/0_swordman_bykk/5_ghost/animation/unlimitedspeedslashbvs/ultimatespeedslashvss4_03.ani", 157, 0, 141); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 70)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), obj.getVar("custom").getInt(0)); break; case 25: sq_SetMyShake(obj, 5, 80); sq_AddDrawOnlyAniFromParent(obj, "passiveobject/0_swordman_bykk/5_ghost/animation/unlimitedspeedslashbvs/ultimatespeedslashvss5_04.ani", 294, 0, 35); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 71)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), obj.getVar("custom").getInt(0)); break; } break; } break; } return true; } function procAppend_po_swordman_bykk(obj) { if(!obj) return; local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); local job = obj.getVar("job").getInt(0); local skillIndex = obj.getVar("skillIndex").getInt(0); local subtype = obj.getVar("subtype").getInt(0); local state = obj.getVar("state").getInt(0); switch(job){ case 0: break; case 1: switch(skillIndex){ case SKILL_SMBYKK_MOMENTARYSLASH: switch(subtype){ case 2: local sizeRate = obj.getVar("custom").getInt(0); local time = sq_GetObjectTime(obj); local sizeRateSet = sq_GetUniformVelocity(sizeRate, sizeRate * 2, time, 400); local alphaSet = sq_GetUniformVelocity(255, 100, time, 400); local currentAni = obj.getCurrentAnimation(); currentAni.setRGBA(255, 255, 255, alphaSet); sizeRateSet = sizeRateSet.tofloat() / 100.0; currentAni.setImageRateFromOriginal(sizeRateSet, sizeRateSet); currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRateSet); sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRateSet, sizeRateSet, sizeRateSet); break; } break; case SKILL_SMBYKK_METEORSWORD: if(obj.getVar("set").getBool(0)){ if(sqrChr && sqrChr.getState() != STATE_DIE){ obj.getVar("set").setBool(0, false); sqrChr.sq_IntVectClear(); sqrChr.sq_IntVectPush(2); sqrChr.sq_AddSetStatePacket(STATE_SMBYKK_METEORSWORD, STATE_PRIORITY_AUTO, true); sq_SendDestroyPacketPassiveObject(obj); } } switch(subtype){ case 1: if(!sqrChr || sqrChr.getState() != STATE_SMBYKK_METEORSWORD){sq_SendDestroyPacketPassiveObject(obj);return;} if(sqrChr.getSkillSubState() == 1 || sqrChr.getSkillSubState() == 10){ local offsetX = sq_GetXPos(obj), offsetY = sq_GetYPos(obj); sqrChr.getVar("meteorSwordSet").setInt(1, offsetX); sqrChr.getVar("meteorSwordSet").setInt(2, offsetY); sqrChr.setSkillCommandEnable(SKILL_SMBYKK_METEORSWORD, true); local b_useskill = sqrChr.sq_IsEnterSkill(SKILL_SMBYKK_METEORSWORD); if(sq_GetObjectTime(obj) >= 600){ if(obj.getVar().getBool(0) == false){ obj.getVar().setBool(0, true); local sub = obj.getVar("custom").getInt(0); if(sub > 0){ sqrChr.sq_IntVectClear(); sqrChr.sq_IntVectPush(11); sqrChr.sq_AddSetStatePacket(STATE_SMBYKK_METEORSWORD, STATE_PRIORITY_AUTO, true); } createSkillPassive_Swordman_bykk(sqrChr,obj,PASSIVEOBJ_BYKK_SWORDMAN,0,0,-sq_GetZPos(sqrChr),sq_GetDirection(obj),1,SKILL_SMBYKK_METEORSWORD,3,sub,0,0,0,0,0,0,0); } sq_SendDestroyPacketPassiveObject(obj); return; } else if(b_useskill != -1){ if(obj.getVar().getBool(0) == false){ obj.getVar().setBool(0, true); local sub = obj.getVar("custom").getInt(0); if(sub > 0){ sqrChr.sq_IntVectClear(); sqrChr.sq_IntVectPush(11); sqrChr.sq_AddSetStatePacket(STATE_SMBYKK_METEORSWORD, STATE_PRIORITY_AUTO, true); } createSkillPassive_Swordman_bykk(sqrChr,obj,PASSIVEOBJ_BYKK_SWORDMAN,0,0,-sq_GetZPos(sqrChr),sq_GetDirection(obj),1,SKILL_SMBYKK_METEORSWORD,3,sub,0,0,0,0,0,0,0); } sq_SendDestroyPacketPassiveObject(obj); return; } } break; case 5: if(sq_GetZPos(obj) <= 0 && obj.getVar().getBool(0) == false){ obj.getVar().setBool(0, true); local totalDamage = obj.getVar("custom").getInt(0); local holdTime = obj.getVar("custom").getInt(1); local weaponSubType = obj.getVar("custom").getInt(2); local sizeRate = obj.getVar("custom").getInt(3); local sub = obj.getVar("custom").getInt(4); createSkillPassive_Swordman_bykk(obj,obj,PASSIVEOBJ_BYKK_SWORDMAN,0,0,0,sq_GetDirection(obj),1,SKILL_SMBYKK_METEORSWORD,15,totalDamage,holdTime,weaponSubType,sizeRate,sub,0,0,0); sq_SendDestroyPacketPassiveObject(obj); } break; } break; case SKILL_SMBYKK_MOMENTARYSLASHEX: switch(subtype){ case 1: local sizeRate = obj.getVar("custom").getInt(0); local time = sq_GetObjectTime(obj); local targetSizeRate = obj.getVar("custom").getInt(1).tofloat() / 125.0; local sizeRateSet = sq_GetUniformVelocity(sizeRate, (sizeRate * targetSizeRate).tointeger(), time, 2500); local alphaSet = sq_GetUniformVelocity(255, 100, time, 800); local currentAni = obj.getCurrentAnimation(); currentAni.setRGBA(255, 255, 255, alphaSet); sizeRateSet = sizeRateSet.tofloat() / 100.0; currentAni.setImageRateFromOriginal(sizeRateSet, sizeRateSet); currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRateSet); sq_SetAttackBoundingBoxSizeRate(currentAni, 1.018, 1.018, 1.0); if(time >= 2500) sq_SendDestroyPacketPassiveObject(obj); break; } break; case SKILL_SMBYKK_HANDLINGSWORD: switch(subtype){ case 1: if(!sqrChr || sqrChr.getState() == STATE_DIE || !CNSquirrelAppendage.sq_IsAppendAppendage(sqrChr, APDPATH_SM_HANDLINGSWORD_BUFF)){ sq_SendDestroyPacketPassiveObject(obj); return; } local direction = sq_GetDirection(obj), xPos = sq_GetXPos(obj), yPos = sq_GetYPos(obj), zPos = sq_GetZPos(obj); local directionSet = sq_GetDirection(sqrChr), xPosSet = sq_GetXPos(sqrChr), yPosSet = sq_GetYPos(sqrChr) - 1, zPosSet = sq_GetZPos(sqrChr); if(direction != directionSet) sq_SetCurrentDirection(obj, directionSet); if(xPos != xPosSet) sq_setCurrentAxisPos(obj, 0, xPosSet); if(yPos != yPosSet) sq_setCurrentAxisPos(obj, 1, yPosSet); if(zPos != zPosSet) sq_setCurrentAxisPos(obj, 2, zPosSet); break; case 2: local mainAtkObj = sqrChr.getVar("handlingsword_mainAtkObj").get_obj_vector(0); if(!mainAtkObj) sq_SendDestroyPacketPassiveObject(obj); break; } break; case SKILL_SMBYKK_STATEOFLIMIT: switch(subtype){ case 3: if(sq_GetObjectTime(obj) >= 2500) sq_SendDestroyPacketPassiveObject(obj); break; } break; } break; case 2: break; case 3: break; case 4: break; } }