From 6e0cf5f1212835fc2b455fc460e96fd602071c1f Mon Sep 17 00:00:00 2001 From: Lenheart <947330670@qq.com> Date: Tue, 4 Nov 2025 21:22:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=80=E6=96=B0=E5=90=8C=E6=AD=A5=E7=89=88?= =?UTF-8?q?=E6=9C=AC=20=E6=B7=BB=E5=8A=A0=E4=BA=86=E5=BE=88=E5=A4=9Ajson?= =?UTF-8?q?=E5=92=8Ccsbase=E5=B7=B2=E7=BB=8Fuser=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CSBase/CallBack/DrawHudMain.nut | 37 + CSBase/CallBack/DrawMain.nut | 231 + CSBase/CallBack/GetDamageRate.nut | 84 + CSBase/CallBack/PackControl.nut | 183 + CSBase/CallBack/PushDamage.nut | 32 + CSBase/Interface.nut | 30 + CSBase/UI/Lenheart_Ani_Class.nut | 85 + CSBase/UI/Lenheart_Character_Info_Class.nut | 512 + CSBase/UI/Lenheart_Cursor_Class.nut | 57 + CSBase/UI/Lenheart_Each_Class.nut | 418 + CSBase/UI/Lenheart_Event_Class.nut | 374 + CSBase/UI/Lenheart_UI_Class.nut | 1456 + CSBase/UI/OldWindowsMap.nut | 52 + CSBase/_ENUM/_ENUM_.nut | 426 + CSBase/_Tool/Animation_Class.nut | 545 + CSBase/_Tool/BaseTool_Class.nut | 516 + CSBase/_Tool/Hacker_Class.nut | 60 + CSBase/_Tool/Hacker_RegApi.nut | 301 + CSBase/_Tool/Image_Class.nut | 80 + CSBase/_Tool/Json_Class.nut | 661 + CSBase/_Tool/MemoryClass.nut | 204 + CSBase/_Tool/Packet_Class.nut | 61 + CSBase/_Tool/Script_Class.nut | 713 + CSBase/_Z_Data/CharacterInfoData.nut | 113 + user/116.205.165.25/6_mage.c | 35144 ++++++++++++++++++ user/116.205.165.25/config | 2 + user/116.205.165.25/test1.nut | 3009 ++ user/116.205.165.25/test2.nut | 2679 ++ user/43.249.195.64/a.nut | 0 user/43.249.195.64/config | 1 + 30 files changed, 48066 insertions(+) create mode 100644 CSBase/CallBack/DrawHudMain.nut create mode 100644 CSBase/CallBack/DrawMain.nut create mode 100644 CSBase/CallBack/GetDamageRate.nut create mode 100644 CSBase/CallBack/PackControl.nut create mode 100644 CSBase/CallBack/PushDamage.nut create mode 100644 CSBase/Interface.nut create mode 100644 CSBase/UI/Lenheart_Ani_Class.nut create mode 100644 CSBase/UI/Lenheart_Character_Info_Class.nut create mode 100644 CSBase/UI/Lenheart_Cursor_Class.nut create mode 100644 CSBase/UI/Lenheart_Each_Class.nut create mode 100644 CSBase/UI/Lenheart_Event_Class.nut create mode 100644 CSBase/UI/Lenheart_UI_Class.nut create mode 100644 CSBase/UI/OldWindowsMap.nut create mode 100644 CSBase/_ENUM/_ENUM_.nut create mode 100644 CSBase/_Tool/Animation_Class.nut create mode 100644 CSBase/_Tool/BaseTool_Class.nut create mode 100644 CSBase/_Tool/Hacker_Class.nut create mode 100644 CSBase/_Tool/Hacker_RegApi.nut create mode 100644 CSBase/_Tool/Image_Class.nut create mode 100644 CSBase/_Tool/Json_Class.nut create mode 100644 CSBase/_Tool/MemoryClass.nut create mode 100644 CSBase/_Tool/Packet_Class.nut create mode 100644 CSBase/_Tool/Script_Class.nut create mode 100644 CSBase/_Z_Data/CharacterInfoData.nut create mode 100644 user/116.205.165.25/6_mage.c create mode 100644 user/116.205.165.25/config create mode 100644 user/116.205.165.25/test1.nut create mode 100644 user/116.205.165.25/test2.nut create mode 100644 user/43.249.195.64/a.nut create mode 100644 user/43.249.195.64/config diff --git a/CSBase/CallBack/DrawHudMain.nut b/CSBase/CallBack/DrawHudMain.nut new file mode 100644 index 0000000..96437c1 --- /dev/null +++ b/CSBase/CallBack/DrawHudMain.nut @@ -0,0 +1,37 @@ +/* +文件名:DrawHudMain.nut +路径:Base/CallBack/DrawHudMain.nut +创建日期:2024-08-29 09:39 +文件用途: +*/ +//血槽背景 +function L_HUD_BloodBackground() { + local RootTab = getroottable(); + local obj = sq_getMyCharacter(); + if (!obj) return; + if (RootTab.rawin("HudUi_Obj")) { + RootTab.HudUi_Obj.BottomShow(obj); + } + if (RootTab.rawin("EventList_Obj")) { + foreach(win in EventList_Obj.Events) { + win.EventShow(obj); + } + } + +} + +getroottable().Camera_Pos <- {}; + +//城镇摄像机 +function L_Sync_Camera_Pos(Camera_Object) { + // print(Camera_Object); + // print(Camera_Object); + getroottable().Camera_Pos.X <- L_sq_RA(Camera_Object + 0x638); + getroottable().Camera_Pos.Y <- L_sq_RA(Camera_Object + 0x63C); +} + + +function Sq_DrawChannel() { + // L_sq_DrawImg("interface2/cs_shop/cs_packageevent/2021_summer/hearoursummer_calendarui.img", 0, 0, 0); +} + diff --git a/CSBase/CallBack/DrawMain.nut b/CSBase/CallBack/DrawMain.nut new file mode 100644 index 0000000..98dd929 --- /dev/null +++ b/CSBase/CallBack/DrawMain.nut @@ -0,0 +1,231 @@ +/* +文件名:DrawMain.nut +路径:Base/CallBack/DrawMain.nut +创建日期:2024-08-06 18:58 +文件用途:绘制回调 +*/ +//在DrawMain后面调用 +function L_drawMainCustomUI_All() { + + local obj = sq_getMyCharacter(); + if (!obj) return; + + local RootTab = getroottable(); + + //获取与上一帧的dt + if (!(RootTab.rawin("Rindro_DurationFlag"))) { + Rindro_DurationFlag <- L_Getmicroseconds(); + Rindro_Duration <- 0; + } else { + local NowM = L_Getmicroseconds(); + Rindro_Duration = (NowM - Rindro_DurationFlag); + Rindro_DurationFlag = NowM; + } + + //下帧执行任务事件 + if (RootTab.rawin("LenheartNextFrameFuncTab")) { + foreach(Func in RootTab["LenheartNextFrameFuncTab"]) { + Func(); + } + RootTab["LenheartNextFrameFuncTab"] = []; + } else { + RootTab.LenheartNextFrameFuncTab <- []; + } + + //重载逻辑 + Sq_ReloadLogic(); + + //初始化活动图标 + Lenheart_EventList_Fun(obj); + + //加载注册Base函数窗口 + if (RootTab.rawin("LenheartBaseFuncTab")) { + local LenheartFunc = RootTab["LenheartBaseFuncTab"]; + foreach(Func in LenheartFunc) { + Func(obj); + } + } + + //加载注册Ex函数窗口 + if (RootTab.rawin("LenheartFuncTab")) { + local LenheartFunc = RootTab["LenheartFuncTab"]; + foreach(name,Func in LenheartFunc) { + + if(name = "GetDamageRateFuncN"){ + print(name); + Func(obj); + } + + } + } + + //所有插件初始化完毕 + if (!getroottable().rawin("LenheartPluginsInitFlag")) { + local T = { + op = 25001021, + } + Rindro_BaseToolClass.SendPackEx(T); + getroottable().LenheartPluginsInitFlag <- true; + } + + // for (local i = 0; i< 100; i++) { + // for (local z = 0; z < 100; z++) { + // sq_PutPixel(sq_RGBA(230, 200, 155, 255), 200 + i, 200 + z); + // } + // } + + // sq_DrawBox(100, 100, 100, 100, 0xffffffff); + + + // L_Sq_CallFunc(0x11E86C0, "char", FFI_STDCALL, ["int", "int", "int", "int", "int"], 10, 10, 750, 350, 0xffffffff); + + // for (local i = 0; i< 100; i++) { + // for (local z = 0; z< 100; z++) { + // sq_PutPixel(sq_RGBA(230, 200, 155, 255), 200 + i, 200 + z); + // } + // } + + // L_sq_Test(0x11A7B65); + // local Device = NativePointer(0x1B45AB8).readInt(); + // print(format("Device:0x%02x", Device)); + // L_sq_Test(Device); + + // if (!TTTAAA) TTTAAA = Rindro_Draw_Character(0, [601590000, 1751501, 601500069], "rest.ani", null); + // if (TTTAAA) TTTAAA.Draw(120, 200); +} + + + + +// for (local i = 0; i < 42; i++) { +// local Value = MemoryTool.DecodeMemoryData(0x394e8c00+0x1050 + (i * 4)); +// if(Value == 151)print("Value :" + i * 4); +// } +// print(MemoryTool.DecodeMemoryData(0x1DFFB240)); +// MemoryTool.EncodeMemoryData(0x304bdc00+0x1054,7); +// TTTAAA <- null; + +// L_NewWindows("Lenheart", 56, 0x1); +// L_Sq_CallFunc(0xE6E070, "int", FFI_THISCALL, ["int", "int", "int", "int"], 0x01ADE090, 56, 0, 0); +// getroottable().Lsnzz <- Clock(); + +// dofile("sqr/Base/_Tool/Json.nut"); + +// print(T); + + + +// Register_DPS_Pack(1, function(Jso) { +// printT(Jso); +// }); + +// for (local i = 0; i< 50; i++) { +// local asos = sq_CreateCharacter(0,0); +// // asos.setValid(false); +// // local obj = sq_GetCNRDObjectToActiveObject(asos); +// // sq_SendDestroyPacketPassiveObject(obj); +// // sendDestroyPacket(obj); + +// // sq_SendDestroyPacketPassiveObject(asos); + +// // sq_AddObject(sq_getMyCharacter(), asos, OBJECTTYPE_VIRTUALCHARACTER, false); +// // asos.setValid(false); +// // L_sq_Test(L_Sq_GetObjectAddress(asos)); +// L_Sq_CallFunc(0x5A44B0, "void", FFI_MS_CDECL, ["int"], L_Sq_GetObjectAddress(asos)); +// } + + + + +// local asos = sq_CreateAICharacter(900); + + + +// // sq_DeleteParticleCreater(asos); +// local asos = sq_CreateAICharacter(419); +// asos.setCurrentPos(sq_getMyCharacter().getXPos() + 100, sq_getMyCharacter().getYPos(), 0); +// sq_AddObject(sq_getMyCharacter(), asos, OBJECTTYPE_VIRTUALCHARACTER, false); +// sq_ChangeDrawLayer(asos, ENUM_DRAWLAYER_CLOSEBACK); + + +// L_sq_GoDungeon(1504); + +// CargoType <- 0; +// Sq_GetExeStr_Map[21910] <- function(Index) { +// CargoType = 0; +// return 21910; +// } +// Sq_GetExeStr_Map[21911] <- function(Index) { +// CargoType = 1; +// return 21911; +// } +// Rindro_Haker.LoadHook(0xE67800, ["int", "int"], +// function(args) { +// //点击了仓库转移物品 +// if (args[0] == 0x2B) { +// if (CargoType == 0) { +// printf("点击个人仓库转移物品"); +// local T = { +// op = 21091001, +// type = 0, +// } +// Rindro_BaseToolClass.SendPackEx(T); +// return [0]; +// } +// if (CargoType == 1) { +// printf("点击账号仓库转移物品"); +// local T = { +// op = 21091001, +// type = 1, +// } +// Rindro_BaseToolClass.SendPackEx(T); +// return [0]; +// } +// } +// return null; +// }, +// function(args) { +// // print(666); +// // print(format("%02x", args.pop())); +// // TTTAni <- args.pop(); +// return null; +// }); + + + +// function onAttack_Swordman(obj, damager, boundingBox, isStuck) +// { +// local Mon = sq_GetCNRDObjectToActiveObject(damager); +// Mon.setHp(0, null, true); +// } + +// function getCurrentModuleDamageRate(obj) { +// local LLJob = sq_getJob(obj); +// local LLGrowT = sq_getGrowType(obj); +// if (LLJob == 0 && LLGrowT == 2) +// return 2100000000.0; + +// return 1.0; +// } + +// function onStartDungeon_Swordman(obj) { +// print(666); +// obj.setEnableDamageBox(false); +// } + + +// local chrobj = sq_CreateCharacter(0, 4); + +// print("-----------------------------------------------/"); +// foreach(member, val in chrobj.getclass()) { +// ::print(member + "\n"); +// local attr; +// if ((attr = chrobj.getclass().getattributes(member)) != null) { +// foreach(i, v in attr) { +// ::print("\t" + i + " = " + (typeof v) + "\n"); +// } +// } else { +// ::print("\t\n") +// } + +// } \ No newline at end of file diff --git a/CSBase/CallBack/GetDamageRate.nut b/CSBase/CallBack/GetDamageRate.nut new file mode 100644 index 0000000..8f6bcce --- /dev/null +++ b/CSBase/CallBack/GetDamageRate.nut @@ -0,0 +1,84 @@ +/* +文件名:GetDamageRate.nut +路径:Base/CallBack/GetDamageRate.nut +创建日期:2024-08-09 14:10 +文件用途:获取伤害倍率 +*/ +RindroDamageRate <- 1.0; + +function L_getCurrentModuleDamageRate(obj) { + if (!obj) + return 1.0; + + local ClientRat = 1.0; + try { + ClientRat = getCurrentModuleDamageRate(obj).tofloat(); + } catch (exception) { + ClientRat = 1.0; + } + + return (RindroDamageRate * ClientRat); +} + + +function Lenheart_GetDamageRate_Fun(obj) { + //在城镇时 + if (sq_GetCurrentModuleType() == 1) { + RindroDamageRate = 1.0; + } +} + +//修改伤害回调 +function SetDamageRateCallBack(Chunk) { + local Jso = Json.Decode(Chunk); + RindroDamageRate = Jso.rate; +} +Pack_Control.rawset(2024110902, SetDamageRateCallBack); + +getroottable()["LenheartFuncTab"].rawset("GetDamageRateFuncN", Lenheart_GetDamageRate_Fun); + + +// ModuleDamageTable <- { +// //这个1是 副本编号 +// [1] = { +// //这个0是大职业编号 比如说鬼剑士就是 0 女格斗家就是 1 在character/character.lst 这个文件里可以看 +// [0] = { +// //这个0 和 1 是转职编号 0就是未转职 1 就是转了剑魂 +// [0] = 1.0, +// [1] = 3.0 +// } +// }, +// //2号副本 +// [2] ={ +// //女格斗家职业 +// [1] = { +// [0] = 1.0, +// [1] = 3.0 +// } +// } +// } + + +// function getCurrentModuleDamageRate(obj) +// { +// local Rate = 1.0; +// local stage = sq_GetGlobaludpModuleStage(); +// local dungeon = sq_GetDungeonByStage(stage); +// local dungeonIndex = sq_GetDuegonIndex(dungeon); + +// local LLJob = sq_getJob(obj); +// local LLGrowT = sq_getGrowType(obj); + +// //处于生效副本中 +// if(ModuleDamageTable.rawin(dungeonIndex)){ +// //自己是生效职业 +// if(ModuleDamageTable[dungeonIndex].rawin(LLJob)){ +// //是生效转职 +// if(ModuleDamageTable[dungeonIndex][LLJob].rawin(LLGrowT)){ +// Rate += ModuleDamageTable[dungeonIndex][LLJob][LLGrowT].tofloat(); +// } +// } +// } + +// return Rate; +// } \ No newline at end of file diff --git a/CSBase/CallBack/PackControl.nut b/CSBase/CallBack/PackControl.nut new file mode 100644 index 0000000..60a2430 --- /dev/null +++ b/CSBase/CallBack/PackControl.nut @@ -0,0 +1,183 @@ +/* +文件名:PackControl.nut +路径:Base/PackControl/PackControl.nut +创建日期:2024-08-06 22:13 +文件用途: +*/ +Pack_Control <- {} +Pack_Hex_Control <- {} +Pack_DPS_Control <- {} + +function Register_DPS_Pack(Id, Func) { + Pack_DPS_Control.rawset(Id, Func); +} + +function Sq_Pack_Control(Chunk) { + try { + local Pack_Json = Json.Decode(Chunk); + if (Pack_Json.op == 2147483646) { + if (Pack_DPS_Control.rawin(Pack_Json.dps_id)) { + local Jso = Json.Decode(Chunk); + Jso.rawdelete("op"); + Pack_DPS_Control[Pack_Json.dps_id](Jso); + } + } else { + if (Pack_Control.rawin(Pack_Json.op)) { + try { + Pack_Control[Pack_Json.op](Chunk); + } catch (exception) { + print("error pack: " + Pack_Json.op); + } + } + } + } catch (exception) { + // print("error packmsg: " + Pack_Json.op); + print(exception); + } + +} + +function Sq_Pack_ControlLocal(Chunk) { + local Pack_Json = Json.Decode(Chunk); + if (Pack_Json.op == 2147483646) { + if (Pack_DPS_Control.rawin(Pack_Json.dps_id)) { + local Jso = Json.Decode(Chunk); + Jso.rawdelete("op"); + Pack_DPS_Control[Pack_Json.dps_id](Jso); + } + } else { + if (Pack_Control.rawin(Pack_Json.op)) { + Pack_Control[Pack_Json.op](Chunk); + } + } +} + +//字节流包 +function Sq_BlobPack_Control(Size, Pointer) { + local Pack = Packet(); + Pack.Load(Pointer, Size); + local Op = Pack.GetInt(); + //读取位置回到原点 + // Pack.Seek(0); + + if (Pack_Hex_Control.rawin(Op)) { + Pack_Hex_Control[Op](Pack); + } +} + + +function SendPackToDP_S(Id, T) { + T.op <- 2147483646; + T.dps_id <- Id; + Rindro_BaseToolClass.SendPackEx(T); +} + + +//进入副本回调 +function LenheartGotoDgnCallBack(Chunk) { + local Jso = Json.Decode(Chunk); + local DgnId = Jso.map.id; + local DgnRate = Jso.map.ra; + L_sq_GoDungeon(DgnId); +} +Pack_Control.rawset(2024041602, LenheartGotoDgnCallBack); + + +//进入副本增加属性 +function LenheartAdditionalAttributes(obj) { + obj = sq_ObjectToSQRCharacter(obj); + //在副本中 + if (sq_GetCurrentModuleType() == 3) { + if (!CNSquirrelAppendage.sq_IsAppendAppendage(obj, "appendage/lenheartap.nut")) { + if ("LenheartAttributesTable" in getroottable()) { + local Abarr = {}; + foreach(AtObj in getroottable()["LenheartAttributesTable"]) { + foreach(Apos, At in AtObj) { + if (!Abarr.rawin(Apos)) Abarr[Apos] <- At; + else Abarr[Apos] += At; + } + } + + local appendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, -1, false, "appendage/lenheartap.nut", true); + + CNSquirrelAppendage.sq_Append(appendage, obj, obj); + local change_appendage = appendage.sq_getChangeStatus("Yosin_LenheartDgnBuff"); + if (!change_appendage) { + change_appendage = appendage.sq_AddChangeStatusAppendageID(obj, obj, 0, + CHANGE_STATUS_TYPE_COOLTIME_DECLINE, + false, 0, 115514); + } + if (change_appendage) { + change_appendage.clearParameter(); + + foreach(Key, Value in Abarr) { + if (Key == 0) change_appendage.addParameter(13, false, Value.tofloat()); //HP + else if (Key == 1) change_appendage.addParameter(48, false, Value.tofloat()); //MP + else if (Key == "strength") change_appendage.addParameter(0, false, Value.tofloat()); //力量 + else if (Key == "intelligence") change_appendage.addParameter(1, false, Value.tofloat()); //智力 + else if (Key == "vitality") change_appendage.addParameter(2, false, Value.tofloat()); //体力 + else if (Key == "spirit") change_appendage.addParameter(3, false, Value.tofloat()); //精神 + else if (Key == "physicalAttack") change_appendage.addParameter(4, false, Value.tofloat()); //物攻 + else if (Key == "magicAttack") change_appendage.addParameter(31, false, Value.tofloat()); //魔攻 + else if (Key == "independentAttack") { + change_appendage.addParameter(53, false, Value.tofloat()); //独立 + change_appendage.addParameter(54, false, Value.tofloat()); //独立 + } else if (Key == "physicalDefense") change_appendage.addParameter(5, false, Value.tofloat()); //物理防御 + else if (Key == "magicDefense") change_appendage.addParameter(32, false, Value.tofloat()); //魔法防御 + else if (Key == "physicalCritical") change_appendage.addParameter(15, false, Value.tofloat() / 10.0); //物理暴击 + else if (Key == "magicCritical") change_appendage.addParameter(16, false, Value.tofloat() / 10.0); //魔法暴击 + else if (Key == "attackSpeed") change_appendage.addParameter(10, false, Value.tofloat()); //攻速 + else if (Key == "releaseSpeed") change_appendage.addParameter(12, false, Value.tofloat()); //释放 + else if (Key == "moveSpeed") change_appendage.addParameter(11, false, Value.tofloat()); //移速 + else if (Key == "resistance") change_appendage.addParameter(39, false, Value.tofloat()); //抗磨 + else if (Key == "hitRate") change_appendage.addParameter(33, false, Value.tofloat()); //命中 + else if (Key == "avoidance") change_appendage.addParameter(27, false, Value.tofloat()); //闪避 + else if (Key == "hpRecovery") change_appendage.addParameter(14, false, Value.tofloat()); //HP恢复 + else if (Key == "mpRecovery") change_appendage.addParameter(29, false, Value.tofloat()); //MP恢复 + else if (Key == "stun") change_appendage.addParameter(41, false, Value.tofloat()); //僵直 + else if (Key == "hardStun") change_appendage.addParameter(34, false, Value.tofloat()); //硬直 + else if (Key == "fire") change_appendage.addParameter(42, false, Value.tofloat()); //火强 + else if (Key == "fireResistance") change_appendage.addParameter(20, false, Value.tofloat()); //火抗 + else if (Key == "water") change_appendage.addParameter(43, false, Value.tofloat()); //冰强 + else if (Key == "waterResistance") change_appendage.addParameter(21, false, Value.tofloat()); //冰抗 + else if (Key == "light") change_appendage.addParameter(45, false, Value.tofloat()); //光强 + else if (Key == "lightResistance") change_appendage.addParameter(23, false, Value.tofloat()); //光抗 + else if (Key == "dark") change_appendage.addParameter(44, false, Value.tofloat()); //暗强 + else if (Key == "darkResistance") change_appendage.addParameter(22, false, Value.tofloat()); //暗抗 + } + } + } + } + } +} + +if (getroottable().rawin("LenheartFuncTab")) { + getroottable()["LenheartFuncTab"].rawset("LenheartAdditionalAttributesFunc", LenheartAdditionalAttributes); +} else { + local T = {}; + T.rawset("LenheartAdditionalAttributesFunc", LenheartAdditionalAttributes); + getroottable().rawset("LenheartFuncTab", T); +} + + +//进入副本增加属性 +function LenheartAdditionalCallBack(Chunk) { + local Jso = Json.Decode(Chunk); + if ("LenheartAttributesTable" in getroottable()) { + local T = getroottable()["LenheartAttributesTable"]; + T.rawset("LenheartCollectBoxAb", Jso.Attribute); + } else { + local T = {}; + T.rawset("LenheartCollectBoxAb", Jso.Attribute); + getroottable().rawset("LenheartAttributesTable", T); + } +} +Pack_Control.rawset(20069016, LenheartAdditionalCallBack); + + +getroottable().PluginsCompatibilityModeCallBack <- false; +//兼容模式 +function CompatibilityModeCallBack(Chunk) { + getroottable().PluginsCompatibilityModeCallBack <- true; +} +Pack_Control.rawset(30004, CompatibilityModeCallBack); \ No newline at end of file diff --git a/CSBase/CallBack/PushDamage.nut b/CSBase/CallBack/PushDamage.nut new file mode 100644 index 0000000..b65c7c6 --- /dev/null +++ b/CSBase/CallBack/PushDamage.nut @@ -0,0 +1,32 @@ +/* +文件名:PushDamage.nut +路径:Base/CallBack/PushDamage.nut +创建日期:2024-08-30 14:41 +文件用途:发生伤害时 +*/ +PushDamageFontDataFuncTab <- {}; +PushDamageFontFuncTab <- {}; + +function Sq_PushDamageData(ObjAddress, MySelfAddress, Value) { + // print("MyCharacter: " + format("%02x", L_sq_RA(0x1AB7CDC))); + // print("ObjAddress: " + format("%02x", ObjAddress)); + // print("A1: " + format("%02x", A1)); + // print("A2: " + format("%02x", A2)); + // print(" "); + foreach(Func in PushDamageFontFuncTab) { + Func(ObjAddress, MySelfAddress, Value); + } +} + +function Sq_PushDamageFontData(ObjAddress, X, Y, Z, Value, Type, A1, A2) { + + local Flag = true; + foreach(Func in PushDamageFontDataFuncTab) { + local Ret = Func(ObjAddress, X, Y, Z, Value, Type, A1, A2); + if (Ret == false) { + Flag = false; + } + } + + return Flag; +} \ No newline at end of file diff --git a/CSBase/Interface.nut b/CSBase/Interface.nut new file mode 100644 index 0000000..0f5c9a2 --- /dev/null +++ b/CSBase/Interface.nut @@ -0,0 +1,30 @@ +/* +文件名:Interface.nut +路径:Base/Interface.nut +创建日期:2025-05-01 07:39 +文件用途:所有基础文件加载以后 将会执行的逻辑 用于初始化一些接口和默认设置 +*/ + +//消息框黏贴 +NativePointer(0x011C53B0).writeShort(0x1B0); + +//修复233号弹窗 +NativePointer(0x00727017).writeByteArray([0xEB, 0x11, 0x90, 0x90, 0x90, 0x90, 0x90]); + +//反遍历函数 +NativePointer(0x1370FD7).writeInt(0); + +//全局的道具信息 +if (!getroottable().rawin("Rindro_ItemInfoObject")) Rindro_ItemInfoObject <- {}; + +//开启热重载目录 +if(getroottable().rawin("RINDROLOCAL") && RINDROLOCAL == true)Sq_AutoReload("sqr"); + + +print("cs base "); +print("cs base "); +print("cs base "); +print("cs base "); +print("cs base "); +print("cs base "); +print("cs base "); \ No newline at end of file diff --git a/CSBase/UI/Lenheart_Ani_Class.nut b/CSBase/UI/Lenheart_Ani_Class.nut new file mode 100644 index 0000000..a501dbd --- /dev/null +++ b/CSBase/UI/Lenheart_Ani_Class.nut @@ -0,0 +1,85 @@ +/* +文件名:Lenheart_Ani_Class.nut +路径:Base/UI/Lenheart_Ani_Class.nut +创建日期:2024-08-06 18:56 +文件用途:Ani +*/ +class Lenheart_Ani { + + X = 0; + Y = 0; + + ImgPath = null; + ImgFrame = null; + + + //播放状态 + State = 0; + //循环 + LoopFlag = true; + + //当前帧数 + CurFrame = 0; + //初始化时间 + InitTime = 0; + //Ani当前帧播放时间 + PlayCurTime = 0; + + + //img 路径 调用帧数组 + constructor(path, frame, Pos) { + ImgPath = ("Character/" + path + ".img").tolower(); + ImgFrame = frame; + InitTime = Clock(); + State = 1; + X = Pos[0]; + Y = Pos[1]; + } + + + function Show(dt) { + if (State == 1) { + if (ImgFrame) { + local NowFrameObj = ImgFrame[CurFrame]; + PlayCurTime += dt; + L_sq_DrawImg(ImgPath, NowFrameObj.ImgIndex, NowFrameObj.Pos[0] + X, NowFrameObj.Pos[1] + Y); + if (PlayCurTime >= NowFrameObj.Delay) { + CurFrame++; + //播放完成 + if (CurFrame >= ImgFrame.len()) { + if (LoopFlag) CurFrame = 0; + else State = 0; + } + InitTime = Clock(); + PlayCurTime = 0; + } + } + } + } + + function ShowEx(dt,gRgba,rate_x,rate_y) { + if (State == 1) { + if (ImgFrame) { + local NowFrameObj = ImgFrame[CurFrame]; + PlayCurTime += dt; + L_sq_DrawImg(ImgPath, NowFrameObj.ImgIndex, NowFrameObj.Pos[0] + X, NowFrameObj.Pos[1] + Y,1,gRgba,rate_x,rate_y); + if (PlayCurTime >= NowFrameObj.Delay) { + CurFrame++; + //播放完成 + if (CurFrame >= ImgFrame.len()) { + if (LoopFlag) CurFrame = 0; + else State = 0; + } + InitTime = Clock(); + PlayCurTime = 0; + } + } + } + } + + function Reset() + { + CurFrame = 0; + State = 1; + } +} \ No newline at end of file diff --git a/CSBase/UI/Lenheart_Character_Info_Class.nut b/CSBase/UI/Lenheart_Character_Info_Class.nut new file mode 100644 index 0000000..018e9f7 --- /dev/null +++ b/CSBase/UI/Lenheart_Character_Info_Class.nut @@ -0,0 +1,512 @@ +/* +文件名:Lenheart_Character_Info_Class.nut +路径:Base/UI/Lenheart_Character_Info_Class.nut +创建日期:2024-08-27 12:13 +文件用途:个人信息属性面板 +*/ +return; +class Lenheart_Character_Info_ClassC extends LenheartNewUI_Windows { + //调试模式 + // DeBugMode = true; + + //不是窗口 + NoWindow = true; + + //是否可见 + Visible = false; + + //图标路径 + IconPath = "interface2/profile/profile_icon1.img"; + + //我的信息 + MyInfo = null; + + //滚轮偏移值 + YOffset = 0; + + + function My_GetCharacterInfoCallBack(Chunk) { + local Jso = Json.Decode(Chunk); + MyInfo = Jso.Attribute; + } + + //初始化 + constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) { + Childrens = []; + //注册控件 + RegisterWidget(); + + LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH); + Pack_Control.rawset(20069014, My_GetCharacterInfoCallBack.bindenv(this)); + } + + function RegisterWidget() { + // //关闭按钮 + // local CloseButton = LenheartNewUI_BaseButton(278, 0, 11, 12, "interface/lenheartwindowcommon.img", 276); + // CloseButton.OnClick = function() { + // this.Visible = false; + // }.bindenv(this); + // Childrens.append(CloseButton); + } + + //绘制主界面 + function DrawMain(obj) { + DrawInfo(obj); + } + + function CheckPosInDrawBox(PosY) { + if ((PosY + YOffset) >= 0 && (PosY + YOffset)< 144) return true; + return false; + } + + //绘制信息 + function DrawInfo(obj) { + if (MyInfo) { + + //生命魔法值 + local PosOffset = 0; + if (CheckPosInDrawBox(PosOffset)) { + L_sq_DrawImg(IconPath, 0, X + 4, Y + 3 + YOffset); + L_sq_DrawCode("HP", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local HpStr = MyInfo.CurHp.tostring() + "/" + MyInfo.MaxHp.tostring(); + L_sq_DrawCode(HpStr, X + 128 - LenheartTextClass.GetStringLength(HpStr), Y + 4 + (0 * 18) + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1); + + L_sq_DrawImg(IconPath, 1, X + 130, Y + 3 + YOffset); + L_sq_DrawCode("MP", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local HpStr = MyInfo.CurMp.tostring() + "/" + MyInfo.MaxMp.tostring(); + L_sq_DrawCode(HpStr, X + 248 - LenheartTextClass.GetStringLength(HpStr), Y + 4 + (0 * 18) + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1); + } + + //力量智力 + PosOffset += 18; + if (CheckPosInDrawBox(PosOffset)) { + L_sq_DrawImg(IconPath, 2, X + 4, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("力量", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str = MyInfo.Strength.tostring(); + L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1); + + L_sq_DrawImg(IconPath, 3, X + 130, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("智力", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str2 = MyInfo.Intellect.tostring(); + L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1); + } + + //体力精神 + PosOffset += 18; + if (CheckPosInDrawBox(PosOffset)) { + L_sq_DrawImg(IconPath, 4, X + 4, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("体力", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str = MyInfo.Vitality.tostring(); + L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1); + + L_sq_DrawImg(IconPath, 5, X + 130, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("精神", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str2 = MyInfo.Spirit.tostring(); + L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1); + } + + //物理攻击魔法攻击 + PosOffset += 18; + if (CheckPosInDrawBox(PosOffset)) { + L_sq_DrawImg(IconPath, 6, X + 4, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("物理攻击", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str = MyInfo.PhysicalAttack.tostring(); + L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1); + + L_sq_DrawImg(IconPath, 7, X + 130, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("魔法攻击", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str2 = MyInfo.MagicalAttack.tostring(); + L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1); + } + + //独立攻击力 + PosOffset += 18; + if (CheckPosInDrawBox(PosOffset)) { + L_sq_DrawImg(IconPath, 31, X + 4, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("独立攻击力(物理/魔法)", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str = MyInfo.IndependentAttack.tostring(); + L_sq_DrawCode(Str, X + 248 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1); + } + + //物理防御魔法防御 + PosOffset += 18; + if (CheckPosInDrawBox(PosOffset)) { + L_sq_DrawImg(IconPath, 8, X + 4, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("物理防御", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str = MyInfo.PhysicalDefend.tostring(); + L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1); + + L_sq_DrawImg(IconPath, 9, X + 130, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("魔法防御", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str2 = MyInfo.MagicalDefend.tostring(); + L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(150, 255, 30, 250), 0, 1); + } + + //物理暴击 魔法暴击 + PosOffset += 18; + if (CheckPosInDrawBox(PosOffset)) { + L_sq_DrawImg(IconPath, 10, X + 4, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("物理暴击", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str = format("%0.1f%%", MyInfo.PhysicalCrit); + L_sq_DrawCode(Str, X + 133 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1); + + L_sq_DrawImg(IconPath, 11, X + 130, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("魔法暴击", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str2 = format("%0.1f%%", MyInfo.MagicalCrit); + L_sq_DrawCode(Str2, X + 253 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1); + } + + //攻击速度 释放速度 + PosOffset += 18; + if (CheckPosInDrawBox(PosOffset)) { + L_sq_DrawImg(IconPath, 12, X + 4, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("攻击速度", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str = format("%0.1f%%", MyInfo.AttackSpeed); + L_sq_DrawCode(Str, X + 133 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1); + + L_sq_DrawImg(IconPath, 13, X + 130, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("释放速度", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str2 = format("%0.1f%%", MyInfo.ReleaseSpeed); + L_sq_DrawCode(Str2, X + 253 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1); + } + + //移动速度 抗魔 + PosOffset += 18; + if (CheckPosInDrawBox(PosOffset)) { + L_sq_DrawImg(IconPath, 14, X + 4, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("移动速度", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str = format("%0.1f%%", MyInfo.MoveSpeed); + L_sq_DrawCode(Str, X + 133 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1); + + L_sq_DrawImg(IconPath, 15, X + 130, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("抗魔", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str2 = MyInfo.AntiMagic.tostring(); + L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1); + } + + //命中率 回避率 + PosOffset += 18; + if (CheckPosInDrawBox(PosOffset)) { + L_sq_DrawImg(IconPath, 16, X + 4, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("命中率", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str = format("%0.1f%%", MyInfo.HitRate); + L_sq_DrawCode(Str, X + 133 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1); + + L_sq_DrawImg(IconPath, 17, X + 130, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("回避率", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str2 = format("%0.1f%%", MyInfo.DodgeRate); + L_sq_DrawCode(Str2, X + 253 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1); + } + + //HP恢复量 MP恢复量 + PosOffset += 18; + if (CheckPosInDrawBox(PosOffset)) { + L_sq_DrawImg(IconPath, 18, X + 4, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("HP恢复量", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str = MyInfo.HPRecovery.tostring(); + L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1); + + L_sq_DrawImg(IconPath, 19, X + 130, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("MP恢复量", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str2 = MyInfo.MPRecovery.tostring(); + L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1); + } + + //僵直度 硬直 + PosOffset += 18; + if (CheckPosInDrawBox(PosOffset)) { + L_sq_DrawImg(IconPath, 20, X + 4, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("僵直度", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str = MyInfo.StunRate.tostring(); + L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1); + + L_sq_DrawImg(IconPath, 21, X + 130, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("硬直", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str2 = MyInfo.StunResist.tostring(); + L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1); + } + + //火属性强化 火属性抗性 + PosOffset += 18; + if (CheckPosInDrawBox(PosOffset)) { + L_sq_DrawImg(IconPath, 22, X + 4, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("火属性强化", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str = MyInfo.FireStrength.tostring(); + L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1); + + L_sq_DrawImg(IconPath, 23, X + 130, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("火属性抗性", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str2 = MyInfo.FireResist.tostring(); + L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1); + } + + //冰属性强化 冰属性抗性 + PosOffset += 18; + if (CheckPosInDrawBox(PosOffset)) { + L_sq_DrawImg(IconPath, 24, X + 4, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("冰属性强化", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str = MyInfo.IceStrength.tostring(); + L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1); + + L_sq_DrawImg(IconPath, 25, X + 130, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("冰属性抗性", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str2 = MyInfo.IceResist.tostring(); + L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1); + } + + //光属性强化 光属性抗性 + PosOffset += 18; + if (CheckPosInDrawBox(PosOffset)) { + L_sq_DrawImg(IconPath, 26, X + 4, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("光属性强化", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str = MyInfo.LightStrength.tostring(); + L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1); + + L_sq_DrawImg(IconPath, 27, X + 130, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("光属性抗性", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str2 = MyInfo.LightResist.tostring(); + L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1); + } + + //暗属性强化 暗属性抗性 + PosOffset += 18; + if (CheckPosInDrawBox(PosOffset)) { + L_sq_DrawImg(IconPath, 28, X + 4, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("暗属性强化", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str = MyInfo.DarkStrength.tostring(); + L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1); + + L_sq_DrawImg(IconPath, 29, X + 130, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("暗属性抗性", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str2 = MyInfo.DarkResist.tostring(); + L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1); + } + + //名望值 罪恶值 + PosOffset += 18; + if (CheckPosInDrawBox(PosOffset)) { + L_sq_DrawImg(IconPath, 53, X + 4, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("名望值", X + 20, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str = MyInfo.Fame.tostring(); + L_sq_DrawCode(Str, X + 128 - LenheartTextClass.GetStringLength(Str), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1); + + L_sq_DrawImg(IconPath, 45, X + 130, Y + 3 + PosOffset + YOffset); + L_sq_DrawCode("最终伤害", X + 148, Y + 4 + PosOffset + YOffset, sq_RGBA(255, 255, 255, 250), 0, 1); + local Str2 = MyInfo.FinalDamage.tostring(); + L_sq_DrawCode(Str2, X + 248 - LenheartTextClass.GetStringLength(Str2), Y + 4 + PosOffset + YOffset, sq_RGBA(251, 251, 251, 250), 0, 1); + } + } + } + + function Show(obj) { + + } + + function RealShow(obj) { + + DrawMain(obj); + LenheartNewUI_Windows.Show(obj); + } + + //override + //鼠标滚轮事件回调 + function OnMouseWheel(Flag, MousePos_X, MousePos_Y) { + if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X, Y, Width, Height)) { + if (Flag) { + if (YOffset< 0) YOffset += 18; + } + if (!Flag) { + if (YOffset > (-145)) YOffset -= 18; + } + } + + //调用原生方法 + LenheartNewUI_Windows.OnMouseWheel(Flag, MousePos_X, MousePos_Y); + } + + GetMyInfoFlag = false; + + //逻辑入口 + function Proc(obj) { + Visible = false; + LenheartNewUI_Windows.SyncPos(X, Y); + + local WindowX = sq_GetPopupWindowMainCotrol(74); + + if (!WindowX) { + GetMyInfoFlag = false; + } + + if (!WindowX) return; + + if (!GetMyInfoFlag) { + GetMyInfoFlag = true; + local T = { + op = 20069013, + Info = Lenheart_Character_GetAttribute(null) + } + SendPackEx(T); + } + + X = Base_X; + Y = Base_Y; + } + + Base_X = 0; + Base_Y = 0; + + function SyncState(Args) { + Base_X = Args[0] + 800; + Base_Y = Args[1] - 174; + local obj = sq_getMyCharacter(); + RealShow(obj); + Visible = true; + } + +} +DrawCodeCallBackFunc.Rindro_Character_Info <- function(Args) { + if (getroottable().rawin("Lenheart_Character_Info_Class_Obj")) { + local MyWindow = getroottable().rawget("Lenheart_Character_Info_Class_Obj"); + MyWindow.SyncState(Args); + } +} + +//个人信息窗口逻辑 +function L_Character_Info_Window(WindowObject) { + return false; + // //返回Flase 原逻辑继续执行 返回Tue 原逻辑终止执行 + // local Flag = false; + // if (getroottable().rawin("Lenheart_Character_Info_Class_Obj")) { + // local MyWindow = getroottable().rawget("Lenheart_Character_Info_Class_Obj"); + // local Ret = MyWindow.SyncState(WindowObject); + // if (Ret) Flag = true; + // } + // return Flag; +} + +getroottable().rawdelete("Lenheart_Character_Info_Class_Obj"); + +function Lenheart_Character_Info_Class_Fun(obj) { + local RootTab = getroottable(); + if (!RootTab.rawin("Lenheart_Character_Info_Class_Obj")) { + RootTab.rawset("Lenheart_Character_Info_Class_Obj", LenheartNewUI_CreateWindow(Lenheart_Character_Info_ClassC, "个人信息属性面板窗口", 0, 0, 263, 146, 0)); + } +} + +getroottable()["LenheartFuncTab"].rawset("Lenheart_Character_Info_ClassFuncN", Lenheart_Character_Info_Class_Fun); + + + +class Lenheart_Other_Character_Info_ClassC extends Lenheart_Character_Info_ClassC { + //调试模式 + // DeBugMode = true; + + //不是窗口 + NoWindow = true; + + //是否可见 + Visible = false; + + //图标路径 + IconPath = "interface2/profile/profile_icon1.img"; + + //我的信息 + MyInfo = null; + + //滚轮偏移值 + YOffset = 0; + + function Other_GetCharacterInfoCallBack(Chunk) { + local Jso = Json.Decode(Chunk); + MyInfo = Jso.Attribute; + } + + constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) { + Childrens = []; + //注册控件 + RegisterWidget(); + + LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH); + Pack_Control.rawset(20069012, Other_GetCharacterInfoCallBack.bindenv(this)); + } + + function RegisterWidget() { + + } + + function Show(obj) { + + } + + function DrawMain(obj) { + DrawInfo(obj); + } + + function RealShow(obj) { + DrawMain(obj); + LenheartNewUI_Windows.Show(obj); + } + + + //override + //鼠标滚轮事件回调 + function OnMouseWheel(Flag, MousePos_X, MousePos_Y) { + + if (Flag) { + if (YOffset< 0) YOffset += 18; + } + if (!Flag) { + if (YOffset > (-145)) YOffset -= 18; + } + + //调用原生方法 + LenheartNewUI_Windows.OnMouseWheel(Flag, MousePos_X, MousePos_Y); + } + + //逻辑入口 + function Proc(obj) { + Visible = false; + LenheartNewUI_Windows.SyncPos(X, Y); + + local WindowX = sq_GetPopupWindowMainCotrol(74); + if (!WindowX || !OldWindowAddress) return; + X = L_sq_RA(OldWindowAddress + 0x14); + Y = L_sq_RA(OldWindowAddress + 0x18) + 154; + + } + + OldWindowAddress = null; + + function SyncState(Address) { + OldWindowAddress = Address; + local obj = sq_getMyCharacter(); + RealShow(obj); + Visible = true; + return true; + } + +} + +//他人信息窗口逻辑 +function L_Other_Character_Info_Window(WindowObject) { + return false; + //返回Flase 原逻辑继续执行 返回Tue 原逻辑终止执行 + local Flag = false; + if (getroottable().rawin("Lenheart_Other_Character_Info_Class_Obj")) { + local MyWindow = getroottable().rawget("Lenheart_Other_Character_Info_Class_Obj"); + local Ret = MyWindow.SyncState(WindowObject); + if (Ret) Flag = true; + } + return Flag; +} + +getroottable().rawdelete("Lenheart_Other_Character_Info_Class_Obj"); + +function Lenheart_Other_Character_Info_Class_Fun(obj) { + local RootTab = getroottable(); + if (!RootTab.rawin("Lenheart_Other_Character_Info_Class_Obj")) { + RootTab.rawset("Lenheart_Other_Character_Info_Class_Obj", LenheartNewUI_CreateWindow(Lenheart_Other_Character_Info_ClassC, "他人信息属性面板窗口", 0, 0, 263, 146, 0)); + } +} + +getroottable()["LenheartFuncTab"].rawset("Lenheart_Other_Character_Info_ClassFuncN", Lenheart_Other_Character_Info_Class_Fun); \ No newline at end of file diff --git a/CSBase/UI/Lenheart_Cursor_Class.nut b/CSBase/UI/Lenheart_Cursor_Class.nut new file mode 100644 index 0000000..7f2fdad --- /dev/null +++ b/CSBase/UI/Lenheart_Cursor_Class.nut @@ -0,0 +1,57 @@ +/* +文件名:Lenheart_Cursor_Class.nut +路径:Base/UI/Lenheart_Cursor_Class.nut +创建日期:2024-09-25 19:23 +文件用途:鼠标绘制逻辑 +*/ +class Rindro_Cursor { + + //强制锁 + ForceLockState = false; + + + //是否启用 + UseState = 0; + + TypeState = 0; + SubState = 0; + + constructor() { + + } + + function Proc(Xpos, Ypos) { + + //使用自建的鼠标绘制函数 + if (UseState) { + //工作类型为0 + if (TypeState == 0) { + //常规状态 + if (SubState == 0) { + L_sq_DrawImg("interface/newstyle/windows/cursor.img", 0, Xpos, Ypos); + } + //按下状态 + else if (SubState == 1) { + L_sq_DrawImg("interface/newstyle/windows/cursor.img", 1, Xpos, Ypos); + } + } else { + L_sq_DrawImg("interface/newstyle/windows/cursor.img", TypeState, Xpos, Ypos); + } + + } + } + + function Sync(Xpos, Ypos) { + Proc(Xpos, Ypos); + return UseState; + } +} +_Rindro_Cusor_ <- Rindro_Cursor(); + +function SyncRindro_Cursor(Xpos, Ypos) { + if (getroottable().rawin("_Rindro_Cusor_")) { + local Ret = _Rindro_Cusor_.Sync(Xpos, Ypos); + return Ret; + } + return false; +} \ No newline at end of file diff --git a/CSBase/UI/Lenheart_Each_Class.nut b/CSBase/UI/Lenheart_Each_Class.nut new file mode 100644 index 0000000..7a48928 --- /dev/null +++ b/CSBase/UI/Lenheart_Each_Class.nut @@ -0,0 +1,418 @@ +/* +文件名:Lenheart_Each_Class.nut +路径:Base/UI/Lenheart_Each_Class.nut +创建日期:2024-09-30 14:46 +文件用途:交互界面类 +*/ +class LenheartNewUI_Each_BaseButton extends LenheartNewUI_CommonUi { + State = 0; + BaseIdx = 29; + DWidth = null; + Path = null; + Idx = null; + SetFlag = null; + SetIndex = null; + + Icon = null; + IconIdx = null; + Str = null; + StrColor = sq_RGBA(189, 159, 126, 250); + + constructor(X, Y, W, H, Path, Idx) { + this.DWidth = W; + this.Path = Path; + this.Idx = Idx; + LenheartNewUI_CommonUi.constructor(X, Y, W, H); + + } + + function SetFrame(gPath, gIdx) { + if (gPath) Path = gPath; + Idx = gIdx; + } + + function Show(obj) { + //不可用 + if (State == 8) { + // L_sq_DrawImg(Path, Idx + 3, X, Y); + } else { + //按下 + if (isLBDown) { + L_sq_DrawImg(Path, Idx + 1, X, Y); + if (Icon) L_sq_DrawImg(Icon, IconIdx, X + 3, Y + 2); + if (Str) L_sq_DrawCode(Str, X + 60 - LenheartTextClass.GetStringLength(Str) / 2, Y + 5, StrColor, 0, 1); + } + //悬停 + else if (isInRect) { + L_sq_DrawImg(Path, Idx, X, Y); + if (Icon) L_sq_DrawImg(Icon, IconIdx, X + 3, Y + 1); + if (Str) L_sq_DrawCode(Str, X + 60 - LenheartTextClass.GetStringLength(Str) / 2, Y + 4, StrColor, 0, 1); + } + //普通 + else { + L_sq_DrawImg(Path, 0, X, Y); + if (Icon) L_sq_DrawImg(Icon, IconIdx, X + 3, Y + 1); + if (Str) L_sq_DrawCode(Str, X + 60 - LenheartTextClass.GetStringLength(Str) / 2, Y + 4, StrColor, 0, 1); + } + } + } + + //鼠标左键弹起回调 + function OnMouseLbUp(MousePos_X, MousePos_Y) { + if (isLBDown && OnClick) { + OnClick(this); + } + isLBDown = false; + } +} + +class Lenheart_EachC extends LenheartNewUI_Windows { + //调试模式 + // DeBugMode = true; + + //不是窗口 + NoWindow = true; + + //是否可见 + // Visible = false; + + Info = null; + + NPC_Index = null; + NPC_Flag = false; + NPC_ButtonMap = null; + + constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) { + Childrens = []; + NPC_ButtonMap = {}; + //注册控件 + RegisterWidget(); + + LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH); + + } + + function RegisterWidget() { + + } + + function Show(obj) { + + } + + function TopShow(obj) { + if (NPC_Index) { + SyncPos(); + LenheartNewUI_Windows.Show(obj); + } + } + + function DrawMain(obj) { + // if (Info) { + // local NPC_Index = Rindro_BaseToolClass.GetEachNpcId(); + // } + + + } + + + // function BottomShow() {} + + //初始化NPC按钮 + function InitNpcButton() { + Childrens = []; + if (NPC_ButtonMap.rawin(NPC_Index)) { + foreach(Func in NPC_ButtonMap[NPC_Index]) { + Func(this); + } + } + this.Visible = true; + } + + function AddEachForNpc(Index, Func) { + if (NPC_ButtonMap.rawin(Index)) { + NPC_ButtonMap[Index].append(Func); + return; + } + NPC_ButtonMap.rawset(Index, [Func]); + } + + function RemoveEachForNpc(Index) { + NPC_ButtonMap.rawdelete(Index); + } + + //逻辑入口 + function Proc(obj) { + LenheartNewUI_Windows.SyncPos(X, Y); + + NPC_Index = Rindro_BaseToolClass.GetEachNpcId(); + if (NPC_Index) { + if (!NPC_Flag) { + NPC_Flag = true; + InitNpcButton(); + } + } else { + NPC_Flag = false; + } + } + + function CloseAllEach() { + local EachClassObject = L_sq_RA(0x1ADE0E0); + if (EachClassObject) { + local FristChildOffset = (EachClassObject + 0x68); + for (local i = 0; i< 74; i++) { + local AddressBuf = FristChildOffset + (4 * i); + local ChildAddress = L_sq_RA(AddressBuf); + if (ChildAddress) { + local OpenFlag = L_sq_RA(ChildAddress + 0xC); + if (OpenFlag = 257) L_sq_WA(ChildAddress + 0xC, 256); + } + } + } + } + + function Lenheart_Get_Each_Info() { + local EachCount = 0; + local Xpos = 0; + local Ypos = 0; + local EachClassObject = L_sq_RA(0x1ADE0E0); + if (EachClassObject) { + local FristChildOffset = (EachClassObject + 0x68); + for (local i = 0; i< 74; i++) { + local AddressBuf = FristChildOffset + (4 * i); + local ChildAddress = L_sq_RA(AddressBuf); + if (ChildAddress) { + local OpenFlag = L_sq_RA(ChildAddress + 0xC); + if (OpenFlag == 257) EachCount++; + } + //第0个的时候记录一下坐标 + if (i == 0) { + Xpos = L_sq_RA(ChildAddress + 0x14); + Ypos = L_sq_RA(ChildAddress + 0x18); + } + } + } + return { + Count = EachCount, + X = Xpos, + Y = Ypos + }; + } + + //override + //鼠标左键弹起回调 + function OnMouseLbUp(MousePos_X, MousePos_Y) { + //调用原生方法 + LenheartNewUI_Windows.OnMouseLbUp(MousePos_X, MousePos_Y); + + + } + + function SyncPos() { + //读取交互坐标数据 + Info = Lenheart_Get_Each_Info(); + + X = Info.X; + Y = Info.Y + (21 * Info.Count); + //宽度 + Width = 100; + //高度 + Height = (21 * Childrens.len()); + //同步子对象坐标 + foreach(pos, winobj in Childrens) { + winobj.X = Info.X; + winobj.Y = Info.Y + (21 * (Info.Count + pos)); + + } + } +} + + +function Lenheart_Each_Fun(obj) { + local RootTab = getroottable(); + if (!RootTab.rawin("L_Each_Obj")) { + RootTab.rawset("L_Each_Obj", LenheartNewUI_CreateWindow(Lenheart_EachC, "玩家与NPC交互界面窗口", 0, 0, 0, 0, 0)); + } +} + +getroottable()["LenheartFuncTab"].rawset("Lenheart_EachN", Lenheart_Each_Fun); + + + + + +class Lenheart_PlayerEachC extends LenheartNewUI_Windows { + //调试模式 + // DeBugMode = true; + + //不是窗口 + NoWindow = true; + + //是否可见 + // Visible = false; + + Info = null; + Basic = null; + + //当前交互角色姓名 + PlayerEach_Name = null; + PlayerEach_Flag = false; + PlayerEach_ButtonMap = null; + + //通用按钮 + PlayerEach_CommonButtonMap = null; + + constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) { + Childrens = []; + PlayerEach_ButtonMap = {}; + PlayerEach_CommonButtonMap = {}; + //注册控件 + RegisterWidget(); + + LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH); + + } + + function RegisterWidget() {} + + function Show(obj) {} + + function TopShow(obj) {} + + function DrawMain(obj) {} + + function MySelfShow() { + if (PlayerEach_Name) { + local obj = sq_getMyCharacter(); + LenheartNewUI_Windows.Show(obj); + } + } + + + //初始化NPC按钮 + function InitNpcButton() { + Childrens = []; + if (PlayerEach_ButtonMap.rawin(PlayerEach_Name)) { + foreach(Func in PlayerEach_ButtonMap[PlayerEach_Name]) { + Func(this); + } + } + foreach(Func in PlayerEach_CommonButtonMap) { + Func(this); + } + this.Visible = true; + } + + function AddEachForCommon(Index, Func) { + PlayerEach_CommonButtonMap.rawset(Index, Func); + } + + function RemoveEachForCommon(Index) { + PlayerEach_CommonButtonMap.rawdelete(Index); + } + + function AddEachForPlayerName(Index, Func) { + if (PlayerEach_ButtonMap.rawin(Index)) { + PlayerEach_ButtonMap[Index].append(Func); + return; + } + PlayerEach_ButtonMap.rawset(Index, [Func]); + } + + function RemoveEachForPlayerName(Index) { + PlayerEach_ButtonMap.rawdelete(Index); + } + + function CloseAllEach() { + if (Basic) { + L_sq_WA(L_sq_P2I(Basic) + 0xC, 256); + } + } + + //逻辑入口 + function Proc(obj) { + LenheartNewUI_Windows.SyncPos(X, Y); + + local Str = L_Sq_GetPlayerEachName(); + if (Str.len() > 0) { + PlayerEach_Name = Str; + } + if (PlayerEach_Name) { + if (!PlayerEach_Flag) { + PlayerEach_Flag = true; + InitNpcButton(); + } + } else { + PlayerEach_Flag = false; + } + } + + //override + //鼠标左键弹起回调 + function OnMouseLbUp(MousePos_X, MousePos_Y) { + LenheartNewUI_Windows.OnMouseLbUp(MousePos_X, MousePos_Y); + } + + function SelfSyncPos(gInfo) { + //读取交互坐标数据 + Info = gInfo; + Basic = gInfo.BasicAdd; + + X = Info.X; + Y = Info.Y + (21 * Info.Count); + //宽度 + Width = 100; + //高度 + Height = (21 * Childrens.len()); + //同步子对象坐标 + foreach(pos, winobj in Childrens) { + winobj.X = Info.X; + winobj.Y = Info.Y + (21 * (Info.Count + pos)); + } + } +} + + +RindroPlayerEachDrawFlag <- false; +RindroPlayerEachDrawCountBuffer <- 0; +RindroPlayerEachDrawCount <- 0; +Rindro_Haker.LoadHook(0x10002A0, ["pointer", "int", "int"], + function(args) { + if (L_Sq_GetPlayerEachName().len() <= 0) return; + local Xpos = L_sq_RA(L_sq_P2I(args[0]) + 0x14); + local Ypos = L_sq_RA(L_sq_P2I(args[0]) + 0x18); + + if (!RindroPlayerEachDrawFlag) { + local RootTab = getroottable(); + RindroPlayerEachDrawFlag = true; + if (RootTab.rawin("L_PlayerEach_Obj")) { + RootTab["L_PlayerEach_Obj"].SelfSyncPos({ + X = Xpos, + Y = Ypos, + Count = RindroPlayerEachDrawCount, + BasicAdd = args[0] + }); + RootTab["L_PlayerEach_Obj"].MySelfShow(); + } + } + RindroPlayerEachDrawCountBuffer++; + // print(args[0]); + return null; + + }, + function(args) { + return null; + }); + + +function Lenheart_PlayerEach_Fun(obj) { + local RootTab = getroottable(); + RindroPlayerEachDrawFlag = false; + RindroPlayerEachDrawCount = RindroPlayerEachDrawCountBuffer; + RindroPlayerEachDrawCountBuffer = 0; + if (!RootTab.rawin("L_PlayerEach_Obj")) { + RootTab.rawset("L_PlayerEach_Obj", LenheartNewUI_CreateWindow(Lenheart_PlayerEachC, "玩家与玩家交互界面窗口", 0, 0, 0, 0, 0)); + } +} + +getroottable()["LenheartFuncTab"].rawset("Lenheart_PlayerEachN", Lenheart_PlayerEach_Fun); \ No newline at end of file diff --git a/CSBase/UI/Lenheart_Event_Class.nut b/CSBase/UI/Lenheart_Event_Class.nut new file mode 100644 index 0000000..9aed30d --- /dev/null +++ b/CSBase/UI/Lenheart_Event_Class.nut @@ -0,0 +1,374 @@ +/* +文件名:Lenheart_Event_Class.nut +路径:Base/UI/Lenheart_Event_Class.nut +创建日期:2024-08-11 09:47 +文件用途:活动图标 +*/ + + +class LenheartNewUI_EventButton extends LenheartNewUI_CommonUi { + State = 0; + BaseIdx = 29; + DWidth = null; + Path = null; + Idx = null; + BindObj = null; + Timer = 0; + EffFlag = true; + ShowName = null; + + constructor(X, Y, Path, Idx) { + this.DWidth = 20; + this.Path = Path; + this.Idx = Idx; + LenheartNewUI_CommonUi.constructor(X, Y, 20, 20); + Timer = Clock(); + } + + function SetFrame(gPath, gIdx) { + if (gPath) Path = gPath; + Idx = gIdx; + } + + function Show(obj) { + T_DrawDynamicAni(obj, "common/yosinevent/eventsystemeff.ani", X, Y, "EventIcon" + ObjectId); + //不可用 + if (State == 8) { + L_sq_DrawImg(Path, Idx + 3, X, Y + 1); + } else { + //按下 + if (isLBDown) { + L_sq_DrawImg(Path, Idx + 1, X, Y); + } + //悬停 + else if (isInRect) { + L_sq_DrawImg(Path, Idx, X, Y); + } + //普通 + else { + L_sq_DrawImg(Path, Idx, X, Y); + } + } + } + + //鼠标左键按下回调 + function OnMouseLbDown(MousePos_X, MousePos_Y) { + if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X, Y, Width, Height)) isLBDown = true; + } + + //鼠标左键弹起回调 overr + function OnMouseLbUp(MousePos_X, MousePos_Y) { + if (isLBDown && OnClick) { + local obj = sq_getMyCharacter(); + obj.sq_PlaySound("CLICK_BUTTON1"); + OnClick(this); + } + isLBDown = false; + } +} + + +class Rindro_Event extends LenheartNewUI_Windows { + //调试模式 + // DeBugMode = true; + + EventFlag = true; + //不是窗口 + NoWindow = true; + //显示标志位 + PosIdx = null; + + //闪烁透明度 + Alpha = 250; + //闪烁模式 + BlinkMode = false; + //时间 + Timer = 0; + + //是否可见 + Visible = true; + + //主要Button + MainButton = null; + + constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) { + Childrens = []; + LenheartNewUI_Windows.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH); + + Timer = Clock(); + } + + //绘制主界面 + function DrawMain(obj) { + local RT = Clock() - Timer; + + //根据模式调整透明度 + if (!BlinkMode) Alpha = sq_GetUniformVelocity(250, 130, RT, 500); + else Alpha = sq_GetUniformVelocity(130, 250, RT, 500); + //转换模式 + if (RT >= 500) { + Timer = Clock(); + BlinkMode = !BlinkMode; + } + + + L_sq_SetDrawImgModel(2, 0); + L_sq_DrawImg("interface2/yosin/eventsystemeff.img", 0, X, Y, 1, sq_RGBA(255, 255, 255, Alpha), 1.0, 1.0); + L_sq_ReleaseDrawImgModel(); + } + + function Show(obj) { + // DrawMain(obj); + // LenheartNewUI_Windows.Show(obj); + } + + function EventShow(obj) { + DrawMain(obj); + LenheartNewUI_Windows.Show(obj); + } + + function TopShow(obj) { + if (sq_IsIntersectRect(IMouse.GetXPos(), IMouse.GetYPos(), 1, 1, X, Y, 20, 20)) { + local XposOffset = 0; + local Len = LenheartTextClass.GetStringLength(MainButton.ShowName); + local Count = ((Len - 10) / 15) + 1; + XposOffset = (-(10 + Count * 15) / 2) + 10; + + L_sq_DrawImg("interface2/yosin/eventsystem.img", 0, X + XposOffset, Y - 24); + for (local i = 0; i< Count; i++) { + L_sq_DrawImg("interface2/yosin/eventsystem.img", 1, X + XposOffset + 5 + (15 * i), Y - 24); + } + L_sq_DrawImg("interface2/yosin/eventsystem.img", 2, X + XposOffset + 5 + (15 * Count), Y - 24); + L_sq_DrawCode(MainButton.ShowName, X - Len / 2 + 12, Y - 17, sq_RGBA(255, 255, 255, 250), 0, 1); + } + } + + function SyncEventIcon() { + local Count = L_sq_RA(L_sq_RA(0x1A39C2C) + 0x6c); + X = EventList_Obj.X + (((Count + PosIdx) % 8) * 20); + Y = EventList_Obj.Y - ((Count + PosIdx) / 8) * 20; + } + + //逻辑入口 + function Proc(obj) { + //同步图标位置 + SyncEventIcon(); + LenheartNewUI_Windows.SyncPos(X, Y); + } +} + +class Rindro_EventList { + + X = 0; + Y = 0; + + //活动数组 + Events = null; + EventsMap = null; + + function YosinEventIconInfoCallBack(Chunk) { + local Jso = Json.Decode(Chunk); + X = Jso.YosinEventIconInfoXpos; + Y = Jso.YosinEventIconInfoYpos; + + + getroottable()["LenheartEventOffset"] <- { + x = X - 456, + y = Y + }; + + L_sq_RefreshEventIcon(); + } + + constructor() { + + Events = []; + EventsMap = {}; + Pack_Control.rawset(30002, YosinEventIconInfoCallBack.bindenv(this)); + + } + + //添加活动 + function AddEvent(Name, Idx, WindowObject, ...) { + if (EventsMap.rawin(Name)) return EventsMap.rawget(Name); + local Window = LenheartNewUI_CreateWindow(Rindro_Event, Name, 0, 0, 20, 20, 0) + local Flag = Events.len(); + local ImgPath = "interface2/yosin/eventsystemlist.img"; + if (vargc == 1) ImgPath = vargv[0]; + local ButtonBuf = LenheartNewUI_EventButton(0, 0, ImgPath, Idx); + ButtonBuf.BindObj = WindowObject; + ButtonBuf.ShowName = Name; + ButtonBuf.OnClick = function(B_obj) { + if (B_obj.BindObj) B_obj.BindObj.OpenCallBack(); + }.bindenv(this); + Window.AddChild(ButtonBuf); + Window.PosIdx = Events.len(); + Window.MainButton = ButtonBuf; + Events.append(Window); + EventsMap.rawset(Name, Window); + return Window; + } + + //检测是否悬停活动图标 + function CheckInEvent(MousePos_X, MousePos_Y) { + if (sq_GetPopupWindowMainCotrol(244)) return; + foreach(Window in Events) { + if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, Window.X, Window.Y, Window.Width, Window.Height)) { + getroottable().WindowsShowABFlag <- true; + } + } + } +} + +getroottable().rawdelete("EventList_Obj") + +function Lenheart_EventList_Fun(obj) { + local RootTab = getroottable(); + if (!RootTab.rawin("EventList_Obj")) { + RootTab.rawset("EventList_Obj", Rindro_EventList()); + } +} + +//获取活动图标坐标 在活动图标变动时会被调用 +function Sq_Get_Event_Pos_X() { + if (getroottable().rawin("LenheartEventOffset")) { + return getroottable()["LenheartEventOffset"].x; + } else { + getroottable()["LenheartEventOffset"] <- { + x = 277, + y = 530 + }; + return getroottable()["LenheartEventOffset"].x; + } +} + +function Sq_Get_Event_Pos_Y() { + if (getroottable().rawin("LenheartEventOffset")) { + return getroottable()["LenheartEventOffset"].y; + } else { + getroottable()["LenheartEventOffset"] <- { + x = 277, + y = 530 + }; + return getroottable()["LenheartEventOffset"].y; + } +} + + + +/* +//活动图标类 +class Rindro_EventIcon extends LenheartNewUI_CommonUi { + //Key + Key = null; + //活动图标文字 + EventStr = null; + //活动图标Ani编号 + EventFrame = null; + //绑定对象 + BandObject = null; + + //图标img路径 + ImgPath = "interface2/yosin/eventsystemlist.img"; + + x = null; + y = null; + + constructor(gEventStr, gEventFrame, gKey, gBandObject) { + this.EventStr = gEventStr; + this.EventFrame = gEventFrame; + this.Key = gKey; + this.BandObject = gBandObject; + + local RootTab = getroottable(); + if (RootTab.rawin("YosinEventSystem")) { + local Arr = RootTab["YosinEventSystem"]; + local TryAppend = true; + local wpos; + foreach(pos, value in Arr) { + if (value.Key == this.Key) { + TryAppend = false; + wpos = pos; + } + } + if (TryAppend) { + Arr.append(this); + RootTab.rawset("YosinEventSystem", Arr); + } else { + Arr[wpos] = this; + RootTab.rawset("YosinEventSystem", Arr); + } + } else { + local Arr = []; + Arr.append(this); + RootTab.rawset("YosinEventSystem", Arr); + } + } + + function Show(obj, X, Y) { + x = X; + y = Y; + + //绘制框 + T_DrawDynamicAni(obj, "common/yosinevent/eventsystemeff.ani", X, Y, "YosinEventIconEffA"); + + try { + if (isLBDown()) { + //绘制活动图标 + L_sq_DrawImg(ImgPath, EventFrame, X, Y + 1); + //T_DrawStayAni(obj, "common/yosinevent/eventsystemlist.ani", X, Y + 1, EventFrame, "YosinEventIconKey" + Key); + } else { + //绘制活动图标 + L_sq_DrawImg(ImgPath, EventFrame, X, Y); + } + } catch (exception) { + if (isLBDown()) { + //绘制活动图标 + T_DrawStayAni(obj, "common/yosinevent/eventsystemlist.ani", X, Y + 1, EventFrame, "YosinEventIconKey" + Key); + } else { + //绘制活动图标 + T_DrawStayAni(obj, "common/yosinevent/eventsystemlist.ani", X, Y, EventFrame, "YosinEventIconKey" + Key); + } + } + } + + function StrShow(obj, X, Y) { + //悬停 + if (isInRect() && EventStr) { + local count = EventStr.len() / 3; + T_DrawStayAni(obj, "common/yosinevent/eventsystem.ani", X - (count * 7), Y - 24, 0, "YosinEventIconStrEffL"); + for (local i = 0; i< count; i++) { + T_DrawStayAni(obj, "common/yosinevent/eventsystem.ani", X - (count * 7) + 5 + (i * 15), Y - 24, 1, "YosinEventIconStrEffZ"); + } + T_DrawStayAni(obj, "common/yosinevent/eventsystem.ani", X - (count * 7) + 5 + (count * 15), Y - 24, 2, "YosinEventIconStrEffR"); + L_sq_DrawCode(EventStr, X - (count * 4), Y - 17, sq_RGBA(255, 255, 255, 250), 0, 1); + } + if (isLBActive()) { + BandObject.MainState = true; + BandObject.OpenClassCallBack(); + } + } + + //悬停状态 + function isInRect() { + if (sq_IsIntersectRect(IMouse.GetXPos(), IMouse.GetYPos(), 1, 1, x, y, 20, 20)) return true; + else return false; + } + //左键按下状态 + function isLBDown() { + if (isInRect() && Mobj.Lb == 1) return true; + else return false; + } + //左键弹起状态 + function isLBUp() { + if (isInRect() && Mobj.Lb == 0) return true; + else return false; + } + + //左键单击状态 + function isLBActive() { + if (isInRect() && Mobj.LbEvent) return true; + else return false; + } +} +*/ \ No newline at end of file diff --git a/CSBase/UI/Lenheart_UI_Class.nut b/CSBase/UI/Lenheart_UI_Class.nut new file mode 100644 index 0000000..fac5ab1 --- /dev/null +++ b/CSBase/UI/Lenheart_UI_Class.nut @@ -0,0 +1,1456 @@ +/* +文件名:Lenheart_UI_Class.nut +路径:Base/UI/Lenheart_UI_Class.nut +创建日期:2024-08-06 18:56 +文件用途:UI +*/ + +//新窗口队列 +L_Windows_List <- []; +//渲染窗口的默认层在下层 即A层 +WindowsShowABFlag <- false; +//左键单击过的Flag 因为要模拟左键单击还原鼠标状态如果存在这个Flag将不响应鼠标消息一次 +Rindro_MouseClickFlag <- false; + + +//鼠标类 +class R_Mouse { + //是否锁定鼠标 + function IsLock() { + return L_sq_RAB(0x1B46886); + } + //锁定鼠标 + function Lock() { + + _Rindro_Cusor_.UseState = 1; + L_sq_WAB(0x1B46886, 1); + //技能描述窗口 + Sq_Memory_WriteByteArr(L_sq_I2P(0x4CC47E), [0xE9, 0xA0, 0x00, 0x00, 0x00, 0x90]); + //物品描述窗口 + // Sq_Memory_WriteByteArr(L_sq_I2P(0xF63DDA), [0x90, 0x90, 0x90, 0x90, 0x90, 0x90]); + //buff信息描述窗口 + Sq_Memory_WriteByteArr(L_sq_I2P(0x4BF532), [0x90, 0x90, 0x90, 0x90]); + //原生商城 个人信息等按钮的悬停 + L_sq_WAB(0x4C4690, 0xC3); + //活动图标的悬停 + L_sq_WAB(0x11C6510, 0xC3); + } + //解锁鼠标 + function UnLock() { + + _Rindro_Cusor_.UseState = 0; + L_sq_WAB(0x1B46886, 0); + Sq_Memory_WriteByteArr(L_sq_I2P(0x4CC47E), [0x39, 0x05, 0xE0, 0xF6, 0xA3, 0x01]); + // Sq_Memory_WriteByteArr(L_sq_I2P(0xF63DDA), [0x56, 0xE8, 0x10, 0xFE, 0xFF, 0xFF]); + Sq_Memory_WriteByteArr(L_sq_I2P(0x4BF532), [0x75, 0x07, 0x32, 0xC0]); + L_sq_WAB(0x4C4690, 0x55); + L_sq_WAB(0x11C6510, 0x55); + } + //获取鼠标工作类型 + function GetType() { + return _Rindro_Cusor_.TypeState; + // return L_sq_RAB(0x1b46898); + } + //设置鼠标工作类型 + function SetType(Type) { + + _Rindro_Cusor_.TypeState = Type; + // L_sq_WAB(0x1b46898, Type); + } + //鼠标0状态下是否按下 + function GetBaseState() { + return _Rindro_Cusor_.SubState; + // return L_sq_RAB(0x1B46874); + } + //鼠标0状态设置是否按下 + function SetBaseState(Flag) { + + _Rindro_Cusor_.SubState = Flag; + // return L_sq_WAB(0x1B46874, Flag); + } + + //还原鼠标 + function Restore() { + //这里判断是否有锁定鼠标 如果有就解锁 + if (R_Mouse.IsLock()) R_Mouse.UnLock(); + //如果鼠标工作类型不是0则设置为0 + if (R_Mouse.GetType() != 0) R_Mouse.SetType(0); + //如果鼠标是按下状态则设置为未按下 + if (R_Mouse.GetBaseState() != 0) R_Mouse.SetBaseState(0); + } +} +//基础窗口类 所有UI类继承与本类 +class LenheartNewUI_BaseWindow extends Rindro_BaseToolClass { + //父控件 + Parent = null; + //子控件 + Childrens = null; + //回调事件 + CallBackFunc = null; + + constructor() { + + } + + //鼠标事件回调 + function OnMouseProc(Flag, MousePos_X, MousePos_Y) { + foreach(Window in Childrens) { + Window.OnMouseProc(Flag, MousePos_X, MousePos_Y); + } + } + //鼠标左键按下回调 + function OnMouseLbDown(MousePos_X, MousePos_Y) { + foreach(Window in Childrens) { + Window.OnMouseLbDown(MousePos_X, MousePos_Y); + } + } + //鼠标左键弹起回调 + function OnMouseLbUp(MousePos_X, MousePos_Y) { + foreach(Window in Childrens) { + Window.OnMouseLbUp(MousePos_X, MousePos_Y); + } + } + //鼠标右键按下回调 + function OnMouseRbDown(MousePos_X, MousePos_Y) { + foreach(Window in Childrens) { + Window.OnMouseRbDown(MousePos_X, MousePos_Y); + } + } + //鼠标右键弹起回调 + function OnMouseRbUp(MousePos_X, MousePos_Y) { + foreach(Window in Childrens) { + Window.OnMouseRbUp(MousePos_X, MousePos_Y); + } + } + //鼠标滚轮时间回调 + function OnMouseWheel(Flag, MousePos_X, MousePos_Y) { + foreach(Window in Childrens) { + Window.OnMouseWheel(Flag, MousePos_X, MousePos_Y); + } + } + //设置回调事件 + function SetCallBackFunc(Func) { + CallBackFunc = Func; + } + //显示 + function Show(obj) { + foreach(Window in Childrens) { + if (Window.CallBackFunc) Window.CallBackFunc(Window); + if (!Window.rawin("Visible")) print(Window.ObjectId + " 显示失败"); + if (Window.Visible) { + Window.Show(obj); + Window.TopShow(obj); + } + } + } + //同步坐标 + function SyncPos(X, Y) { + foreach(Window in Childrens) { + Window.SyncPos(X, Y); + } + } + + /* + * @函数作用: 添加子对象 + * @参数 name + */ + function AddChild(gChild) { + this.Childrens.append(gChild); + gChild.Parent = this; + } +} + +//游戏窗口类 +class LenheartNewUI_Windows extends LenheartNewUI_BaseWindow { + //窗口名称 + ObjectId = null; + //可用性 + Visible = true; + //宽度 + Width = null; + //高度 + Height = null; + //标题高度 + TitleH = null; + + //调试模式 + DeBugMode = false; + + //X坐标 + X = null; + B_X = null; + //Y坐标 + Y = null; + B_Y = null; + + M_Xpos = null; + M_Ypos = null; + //移动Flag + MoveFlag = false; + + //时间片段 + Duration = 0.0; + DurationFlag = 0.0; + + //是否是焦点 + IsFocus = false; + + constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) { + ObjectId = gObjectId; + //宽度 + Width = gWidth; + //高度 + Height = gHeight; + //标题高度 + TitleH = gTitleH; + + //X坐标 + X = gX; + //Y坐标 + Y = gY; + + ResetFocus(); + + //调用原生方法 + LenheartNewUI_BaseWindow.constructor(); + } + + + //切换到最上层窗口 即得到焦点时 + function ResetFocus() { + //遍历全局窗口数组将自己移除重新添加在末尾 + foreach(Index, WindowObj in L_Windows_List) { + if (WindowObj.ObjectId == this.ObjectId) L_Windows_List.remove(Index); + } + for (local i = L_Windows_List.len() - 1; i >= 0; i--) { + if (L_Windows_List[i].ObjectId == this.ObjectId) { + L_Windows_List.remove(i); + }else{ + L_Windows_List[i].IsFocus = false; + } + } + L_Windows_List.append(this); + //切换上层显示 + getroottable().WindowsShowABFlag <- true; + IsFocus = true; + } + + /* + * @函数作用: 移除子对象 + * @参数 子对象名称 + */ + function RemoveChild(ChildName) { + foreach(_Index, _Child in Childrens) { + if (_Child.ObjectId == ChildName) { + Childrens.remove(_Index); + return; + } + } + } + /* + * @函数作用: 移除子对象类 + * @参数 类 如果传入第二个参数false 则移除所有非该类的子对象 + * @返回值 + */ + function RemoveChilds(ClassName, ...) { + local RemoveIndexArr = []; + if (vargc == 1 && vargv[0] == false) { + foreach(_Index, _Child in Childrens) { + if (!(_Child instanceof ClassName)) { + RemoveIndexArr.append(_Index - RemoveIndexArr.len()); + } + } + } else { + foreach(_Index, _Child in Childrens) { + if (_Child instanceof ClassName) { + RemoveIndexArr.append(_Index - RemoveIndexArr.len()); + } + } + } + foreach(SaveIndex in RemoveIndexArr) { + Childrens.remove(SaveIndex); + } + } + + /* + * @函数作用: 添加子对象 + * @参数 name + */ + function AddChild(gChild) { + this.Childrens.append(gChild); + gChild.Parent = this; + } + + //关闭窗口 -并没有销毁只是隐藏 + function CloseWindow() { + this.Visible = false; + //还原鼠标 + R_Mouse.Restore(); + //左键单击还原游戏状态 + // L_sq_MouseClick(); + } + //销毁窗口 + function DestroyWindow() { + foreach(Index, WindowObj in L_Windows_List) { + if (WindowObj.ObjectId == this.ObjectId) L_Windows_List.remove(Index); + } + //还原鼠标 + R_Mouse.Restore(); + //左键单击还原游戏状态 + // L_sq_MouseClick(); + } + + //道具信息窗口地址 + ItemInfoDrawS = null; + //绘制道具相信信息 + ItemObject = null; + + //获取道具信息并生成缓存 + function GetItemInfo(Id) { + if (!Rindro_ItemInfoObject.rawin(Id)) { + local ItemObject = L_sq_GetItem(Id); + if (!ItemObject) ItemObject = L_sq_GetItem(3037); + Rindro_ItemInfoObject.rawset(Id, ItemObject); + } + } + //绘制道具带道具信息 带道具边框 + function DrawItemEx(X, Y, Id, Count) { + GetItemInfo(Id); + local Rarity = L_sq_RA(Rindro_ItemInfoObject[Id] + 0xF4); + L_sq_DrawImg("interface2/rindro_reward.img", Rarity, X - 3, Y - 3); + DrawItemBase(X, Y, Id, Count); + } + //绘制道具带道具信息 + function DrawItemBase(X, Y, Id, Count) { + GetItemInfo(Id); + L_Sq_DrawItem(X, Y, Id, Count, 0, 0, 0); + if (sq_IsIntersectRect(IMouse.GetXPos(), IMouse.GetYPos(), 1, 1, X, Y, 24, 24)) { + //打开道具信息窗口 + if (!ItemInfoDrawS) { + ItemInfoDrawS = L_Sq_CallFunc(0xE6E070, "int", FFI_THISCALL, ["int", "int", "int", "int"], L_sq_RA(0x1A5FB20), 275, Rindro_ItemInfoObject[Id], 41); + //校准道具信息窗口位置 + L_Sq_CallFunc(0xF3B3B0, "int", FFI_THISCALL, ["int", "int", "int", "int", "int"], ItemInfoDrawS, IMouse.GetXPos(), IMouse.GetYPos(), 28, 28); + //我自己UI打开的道具信息窗口需要把渲染队列改为下层 以显示我打开的道具 + getroottable().WindowsShowABFlag <- false; + } + } else { + if (ItemInfoDrawS) { + L_Sq_CallFunc(0xE6B2B0, "int", FFI_THISCALL, ["int", "int", "int", "char"], 0x1ADE090, 0x113, 0xFFFFFFFF, 0x0); + ItemInfoDrawS = null; + } + } + } + + //绘制标题 + function DrawWindowTitle(Width) { + //绘制标题 + DrawTriptych(X - 1, Y, Width, "interface/lenheartwindowcommon.img", 9); + if (IsFocus) { + L_sq_SetDrawImgModel(2, 0); + DrawTriptychDetail(X - 1, Y , Width, "interface/lenheartwindowcommon.img", 109, 114, 115); + L_sq_ReleaseDrawImgModel(); + } + } + + //生成DT + function GenerateDt() { + try { + local CurT = L_Getmicroseconds(); + Duration = (CurT - DurationFlag); + DurationFlag = CurT; + } catch (exception) { + + } + } + + function Show(obj) { + GenerateDt(); + if (!Visible) return; + + //调用原生方法 + LenheartNewUI_BaseWindow.Show(obj); + if (DeBugMode) DeBug(obj); + + //初始化绘制道具 + // ItemInfoDrawS = null; + } + + function TopShow(obj) { + + } + + function DeBug(obj) { + sq_DrawBox(X, Y, Width, Height, 0xffffffff); + sq_DrawBox(X, Y, Width, TitleH, 0xffffffff); + } + + //override + function OnMouseProc(Flag, MousePos_X, MousePos_Y) { + if (!Visible) return; + //设定拖动逻辑 + if (Flag == 1) { + if (MoveFlag) { + //左键拖动 + X = B_X - (M_Xpos - MousePos_X); + Y = B_Y - (M_Ypos - MousePos_Y); + } + } + //调用原生方法 + LenheartNewUI_BaseWindow.OnMouseProc(Flag, MousePos_X, MousePos_Y); + } + + //override + //鼠标左键按下回调 + function OnMouseLbDown(MousePos_X, MousePos_Y) { + if (!Visible) return; + //如果点击事件在窗口内 + if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X, Y, Width, Height)) { + ResetFocus(); + //如果点下去在标题栏 + if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X, Y, Width, TitleH)) { + MoveFlag = true; + M_Xpos = MousePos_X; //原始鼠标位置数据 + M_Ypos = MousePos_Y; + B_X = X; //原始窗口位置 + B_Y = Y; + } + } + //调用原生方法 + LenheartNewUI_BaseWindow.OnMouseLbDown(MousePos_X, MousePos_Y); + } + //override + //鼠标左键弹起回调 + function OnMouseLbUp(MousePos_X, MousePos_Y) { + if (!Visible) return; + if (MoveFlag) { + MoveFlag = false; + M_Xpos = null; + M_Ypos = null; + B_X = null; + B_Y = null; + } + //调用原生方法 + LenheartNewUI_BaseWindow.OnMouseLbUp(MousePos_X, MousePos_Y); + } + //override + //鼠标右键按下回调 + function OnMouseRbDown(MousePos_X, MousePos_Y) { + if (!Visible) return; + //调用原生方法 + LenheartNewUI_BaseWindow.OnMouseRbDown(MousePos_X, MousePos_Y); + } + //override + //鼠标右键弹起回调 + function OnMouseRbUp(MousePos_X, MousePos_Y) { + if (!Visible) return; + //调用原生方法 + LenheartNewUI_BaseWindow.OnMouseRbUp(MousePos_X, MousePos_Y); + } + //override + //鼠标滚轮事件回调 + function OnMouseWheel(Flag, MousePos_X, MousePos_Y) { + if (!Visible) return; + //调用原生方法 + LenheartNewUI_BaseWindow.OnMouseWheel(Flag, MousePos_X, MousePos_Y); + } +} + + +//创建窗口 如果已存在则返回窗口 +function LenheartNewUI_CreateWindow(ClassName, gObjectId, gX, gY, gWidth, gHeight, gTitleH) { + foreach(Index, WindowObj in L_Windows_List) { + if (WindowObj.ObjectId == gObjectId) { + return WindowObj; + } + } + return ClassName(gObjectId, gX, gY, gWidth, gHeight, gTitleH); +} +//销毁窗口 +function LenheartNewUI_DestoryWindow(gObjectId) { + foreach(Index, WindowObj in L_Windows_List) { + if (WindowObj.ObjectId == gObjectId) { + L_Windows_List.remove(Index); + return true; + } + } + return false; +} + + +//遍历窗口查询是否有悬停在新窗口中 +function CheackMouseInNewWindows(MousePos_X, MousePos_Y) { + local Flag = false; + foreach(Window in L_Windows_List) { + if (!Window.Visible) continue; + if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, Window.X, Window.Y, Window.Width, Window.Height)) { + Flag = true; + // print(Window.ObjectId); + // Sout("%L",Window.ObjectId); + return Flag; + } + } + return Flag; +} +//遍历是否悬停在原生窗口上 +function CheackMouseInOldWindows() { + // if (!NotOldWindowsMap.rawin(L_sq_RA(0x1A32950)) && (L_sq_RA(0x1A32950) <= 2390 || L_sq_RA(0x1A32950) >= 2500) && (L_sq_RA(0x1A32950) <= 120 || L_sq_RA(0x1A32950) >= 140)) { + // return true; + // } + // local Id = L_sq_RA(0x1A32950); + // if (Id == Rindro_Info_Base_Nowindow || Id <= 300) return false; + // return true; + + + //城镇基础背景窗口 副本背景 城镇背景 拓展技能按钮 切换技能页按钮 + local OldBaseWindowArr = [0x184D0C4, 0x0184CF6C, 0x15A249C, 0x184D174]; + local WindowAddress = L_sq_RA(0x1B474D4); + if (WindowAddress) { + local Flag = L_sq_RA(WindowAddress); + foreach(value in OldBaseWindowArr) { + if (Flag == value) { + //空地 + if (Flag == 0x184D0C4 || Flag == 0x0184CF6C) { + //都为0的时候城镇背景 508是血槽那一块的逻辑 坐标Y是508 + if ((L_sq_RA(WindowAddress + 0x14) == 0 && (L_sq_RA(WindowAddress + 0x18) == 0 || L_sq_RA(WindowAddress + 0x18) == 508))) { + return false; + } + } else { + //原生窗口里的按钮 + if (Flag == 0x184D174) return true; + return false; + } + } + } + } + return true; +} + +//设定鼠标逻辑 +function RunMouseLogic(MousePos_X, MousePos_Y) { + //解锁鼠标 如果鼠标已处于锁定状态 并且没有悬停在任何窗口上 解锁鼠标 + if (R_Mouse.IsLock()) { + //不在任何新窗口上 + if (!CheackMouseInNewWindows(MousePos_X, MousePos_Y)) { + //还原鼠标 + R_Mouse.Restore(); + } + //在任何老窗口上 并且渲染层为A层 也就是下层渲染 + else if (CheackMouseInOldWindows() && !getroottable().WindowsShowABFlag) { + //还原鼠标 + R_Mouse.Restore(); + } + } + //锁定鼠标 如果鼠标处于未锁定状态 并且悬停在任意一个窗口上 + else if (!R_Mouse.IsLock() && CheackMouseInNewWindows(MousePos_X, MousePos_Y)) { + //如果没有悬停任何原生窗口直接锁 + if (!CheackMouseInOldWindows()) { + //锁定鼠标 + R_Mouse.Lock(); + //设置鼠标模式 + R_Mouse.SetType(1); + } + //如果有悬停原生窗口 就要判断AB层 + else { + if (getroottable().WindowsShowABFlag) { + //锁定鼠标 + R_Mouse.Lock(); + //设置鼠标模式 + R_Mouse.SetType(1); + } + } + } +} + +//鼠标消息回调 +function L_MouseCallBack(MouseState, MouseFlag, MousePos_X, MousePos_Y) { + + // //获取基础无窗口的位置的值 + // if (!Rindro_Info_Base_Nowindow) { + // if (!sq_getMyCharacter()) return; + // if (!Rindro_Info_Base_Nowindow) { + // IMouse.SetPos((800 * 0.45).tointeger(), (600 * 0.1).tointeger()); + // if (MousePos_X == (getroottable().Rindro_Scr_Width * 0.45).tointeger() && MousePos_Y == (getroottable().Rindro_Scr_High * 0.1).tointeger()) { + // Rindro_Info_Base_Nowindow = L_sq_RA(0x1A32950); + // } + // } + // } + //用于抵消Esc造成的点击事件 + // if (Rindro_MouseClickFlag) { + // Rindro_MouseClickFlag--; + // return; + // } + if (MouseState == 0x200) { + //常规事件就要设定鼠标是否锁定逻辑 + if (_Rindro_Cusor_.ForceLockState == false) + RunMouseLogic(MousePos_X, MousePos_Y); + } + + //判断是否悬停活动图标 没悬停在老窗口上 没在选图界面 + if (getroottable().rawin("EventList_Obj") && !CheackMouseInOldWindows() && sq_GetCurrentModuleType() != 2) EventList_Obj.CheckInEvent(MousePos_X, MousePos_Y); + + + //如果渲染层级在下级 即A层 或者是 鼠标没有悬停在任何新窗口上时 执行判断 如果悬停在原生窗口 就解除鼠标锁定 如果点击 就改变渲染层级 + if (!getroottable().WindowsShowABFlag || !CheackMouseInNewWindows(MousePos_X, MousePos_Y)) { + if (CheackMouseInOldWindows()) { + //如果点击了原生窗口 或者使用了滚轮 就把渲染队列改成下 + if (MouseState == 0x201 || MouseState == 0x20a) { + getroottable().WindowsShowABFlag <- false; + } + if (MouseState != 0x20a) return; + } + } + + //克隆一遍窗口列表 + local WindowListF = clone(L_Windows_List); + WindowListF.reverse(); + //判断滚轮是向上还是向下的 + local Flag = MouseFlag == 0xff880000 ? 0 : 1; + foreach(Window in WindowListF) { + if (Window.Visible) { + switch (MouseState) { + //常规或者拖动事件 + case 0x200: { + Window.OnMouseProc(MouseFlag, MousePos_X, MousePos_Y); + break; + } + //左键点击 + case 0x201: { + //如果点击了新窗口就把渲染队列改成上 + getroottable().WindowsShowABFlag <- true; + Window.OnMouseLbDown(MousePos_X, MousePos_Y); + break; + + } + //左键松开 + case 0x202: { + if (getroottable().WindowsShowABFlag) L_sq_WA(0x1B46874, 0); + Window.OnMouseLbUp(MousePos_X, MousePos_Y); + break; + } + //右键点击 + case 0x204: { + Window.OnMouseRbDown(MousePos_X, MousePos_Y); + break; + } + //右键松开 + case 0x205: { + Window.OnMouseRbUp(MousePos_X, MousePos_Y); + break; + } + //滚轮事件 + case 0x20a: { + Window.OnMouseWheel(Flag, MousePos_X, MousePos_Y); + break; + } + } + if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, Window.X, Window.Y, Window.Width, Window.Height)) return; + } + } +} +//打开原生窗口回调 +function L_OpenOldWindowCallBack(WindowIndex) { + //将新窗口渲染队列改为下层 抵消窗口 Esc窗口 登录可能显示的任务窗口 + if (WindowIndex != 170 && WindowIndex != 176 && WindowIndex != 276 && WindowIndex != 275 && WindowIndex != 278 && WindowIndex != 279 && WindowIndex != 283 && WindowIndex != 36) { + + getroottable().WindowsShowABFlag <- false; + } +} + +//窗口逻辑入口 +function L_WindowsLogic(obj) { + //是否存在一个窗口Flag + local WindowExistence = false; + //遍历窗口队列 如果可见则调用Show 只要有一个可见就写入Flag + foreach(Window in L_Windows_List) { + if (sq_GetCurrentModuleType() != 2) Window.Proc(obj); + if (Window.Visible) { + if (sq_GetCurrentModuleType() != 2) Window.Show(obj); + if (sq_GetCurrentModuleType() != 2) Window.TopShow(obj); + if (!Window.rawin("NoWindow")) { + WindowExistence = true; + } + } + } + + //如果可见 需要调用一个原生窗口抵消ESC + if (WindowExistence) { + local W = sq_GetPopupWindowMainCotrol(170); + if (!W) L_NewWindows("Lenheart", 170, 0x65535); + else { + W.SetVisible(false); + W.SetEnable(false); + } + } + //没有任何新窗口打开 并且原生窗口开启者 + else { + local W = sq_GetPopupWindowMainCotrol(170); + if (W) { + L_sq_UseSkill(DIK_ESCAPE); + } + } + //如果按下ESC键要将所有的窗口关闭 + if (WindowExistence) { + if (KeyPressNB.isKeyPress(48, "AllLenheartWindows") || sq_GetCurrentModuleType() == 2) { + local Flag = false; + foreach(Window in L_Windows_List) { + if (!Window.rawin("NoWindow")) { + Flag = true; + Window.CloseWindow(); + } + } + if (Flag) { + getroottable().WindowsShowABFlag <- false; + //还原鼠标 + R_Mouse.Restore(); + L_Sq_CallFunc(0x11A8B60, "void", FFI_MS_CDECL, []); + // L_sq_MouseClick(); + Rindro_MouseClickFlag = 5; + } + } + } + +} +//绘制下层回调 +function L_DrawWindow_A() { + local obj = sq_getMyCharacter(); + if (!obj) return; + + //A层只在下层渲染 + if (getroottable().WindowsShowABFlag == false) L_WindowsLogic(obj); +} +//绘制上层回调 +function L_DrawWindow_B() { + local obj = sq_getMyCharacter(); + if (!obj) return; + + //B层只在上层渲染 + if (getroottable().WindowsShowABFlag) L_WindowsLogic(obj); + + local RootTab = getroottable(); + if (RootTab.rawin("LenheartTopFuncTab")) { + local LenheartFunc = RootTab["LenheartTopFuncTab"]; + foreach(Func in LenheartFunc) { + Func(obj); + } + } +} + + + + +class LenheartNewUI_CommonUi extends LenheartNewUI_BaseWindow { + X = 0; + Y = 0; + Localtion_X = 0; + Localtion_Y = 0; + Width = null; + Height = null; + isLBDown = false; + isInRect = false; + + OnClick = null; + OnClickEx = null; + OnClickSound = null; + ObjectId = null; + + Visible = true; + + TopCallBackFunc = null; + + Data = null; + DeBugMode = false; + + constructor(x, y, width, height) { + this.Localtion_X = x; + this.Localtion_Y = y; + this.Width = width; + this.Height = height; + + ObjectId = Clock(); + } + + //同步坐标 + function SyncPos(x, y) { + this.X = Localtion_X + x; + this.Y = Localtion_Y + y; + } + + //鼠标事件回调 + function OnMouseProc(Flag, MousePos_X, MousePos_Y) { + if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X, Y, Width, Height)) isInRect = true; + else isInRect = false; + } + //鼠标左键按下回调 + function OnMouseLbDown(MousePos_X, MousePos_Y) { + if (sq_IsIntersectRect(MousePos_X, MousePos_Y, 1, 1, X, Y, Width, Height)) { + isLBDown = true; + if (!OnClickSound) { + R_Utils.PlaySound("CLICK_BUTTON1"); + } else { + R_Utils.PlaySound(OnClickSound); + } + } + } + //鼠标左键弹起回调 + function OnMouseLbUp(MousePos_X, MousePos_Y) { + if (isLBDown) { + if (OnClick) OnClick(); + if (OnClickEx) OnClickEx(this); + } + isLBDown = false; + } + + //鼠标右键按下回调 + function OnMouseRbDown(MousePos_X, MousePos_Y) { + + } + //鼠标右键弹起回调 + function OnMouseRbUp(MousePos_X, MousePos_Y) { + + } + //鼠标滚轮时间回调 + function OnMouseWheel(Flag, MousePos_X, MousePos_Y) { + + } + + function TopShow(obj) { + if (TopCallBackFunc) TopCallBackFunc(obj, this); + if (DeBugMode) DeBug(obj); + } + + function DeBug(obj) { + sq_DrawBox(X, Y, Width, Height, 0xffffffff); + } + +} + +class LenheartNewUI_BaseButton extends LenheartNewUI_CommonUi { + State = 0; + BaseIdx = 29; + DWidth = null; + Path = null; + Idx = null; + + + constructor(X, Y, W, H, Path, Idx) { + this.DWidth = W; + this.Path = Path; + this.Idx = Idx; + LenheartNewUI_CommonUi.constructor(X, Y, W, H); + + } + + function SetFrame(gPath, gIdx) { + if (gPath) Path = gPath; + Idx = gIdx; + } + + function Show(obj) { + //不可用 + if (State == 8) { + L_sq_DrawImg(Path, Idx + 3, X, Y + 1); + } else { + //按下 + if (isLBDown) { + L_sq_DrawImg(Path, Idx + 2, X, Y + 1); + } + //悬停 + else if (isInRect) { + L_sq_DrawImg(Path, Idx + 1, X, Y); + } + //普通 + else { + L_sq_DrawImg(Path, Idx, X, Y); + } + } + } +} + +class LenheartNewUI_Button extends LenheartNewUI_CommonUi { + State = 0; + BaseIdx = 29; + DWidth = null; + Path = "interface/lenheartwindowcommon.img"; + Idx = 172; + FillWidth = 2; + FirstWidth = 28; + + + + constructor(X, Y, W) { + this.DWidth = W; + LenheartNewUI_CommonUi.constructor(X, Y, W + 28 * 2, 24); + } + + function SetFrame(gPath, gIdx) { + if (gPath) Path = gPath; + Idx = gIdx; + } + + function Show(obj) { + //不可用 + if (State == 8) { + L_sq_DrawButton(X, Y + 1, this.DWidth, Path, Idx + 9, FillWidth, FirstWidth); + } else { + //按下 + if (isLBDown) { + L_sq_DrawButton(X, Y + 1, this.DWidth, Path, Idx + 3, FillWidth, FirstWidth); + } + //悬停 + else if (isInRect) { + L_sq_DrawButton(X, Y, this.DWidth, Path, Idx + 3, FillWidth, FirstWidth); + } + //普通 + else { + L_sq_DrawButton(X, Y, this.DWidth, Path, Idx, FillWidth, FirstWidth); + } + } + } +} + +class LenheartNewUI_VerticalButton extends LenheartNewUI_CommonUi { + State = 0; + BaseIdx = 29; + DHeight = null; // 改为高度 + Path = "interface/lenheartwindowcommon.img"; + Idx = 172; + FillHeight = 2; // 改为填充高度 + FirstHeight = 28; // 改为首节高度 + Width = 24; // 固定宽度,垂直按钮宽度通常是固定的 + + constructor(X, Y, H) { + this.DHeight = H; + LenheartNewUI_CommonUi.constructor(X, Y, 24, H + 28 * 2); // 宽度固定,高度动态 + } + + function SetFrame(gPath, gIdx) { + if (gPath) Path = gPath; + Idx = gIdx; + } + + function Show(obj) { + //不可用 + if (State == 8) { + L_sq_Draw3Image_Vertical(X + 1, Y, this.Width, this.DHeight, Path, Idx + 9, FillHeight, FirstHeight); + } else { + //按下 + if (isLBDown) { + L_sq_Draw3Image_Vertical(X + 1, Y, this.Width, this.DHeight, Path, Idx + 3, FillHeight, FirstHeight); + } + //悬停 + else if (isInRect) { + L_sq_Draw3Image_Vertical(X, Y, this.Width, this.DHeight, Path, Idx + 3, FillHeight, FirstHeight); + } + //普通 + else { + L_sq_Draw3Image_Vertical(X, Y, this.Width, this.DHeight, Path, Idx, FillHeight, FirstHeight); + } + } + } +} + + +class LenheartNewUI_ButtonText extends LenheartNewUI_Button { + TextStr = null; + TextX = null; + TextY = null; + TextColor = null; + TextRColor = null; + + TextXoffset = null; + TextYoffset = null; + + constructor(X, Y, W, Str) { + LenheartNewUI_Button.constructor(X, Y, W); + this.TextStr = Str; + TextColor = sq_RGBA(185, 148, 96, 255); + TextRColor = sq_RGBA(227, 212, 154, 255); + + TextXoffset = 19; + TextYoffset = 3; + } + + function SetTextColor(RGBA) { + TextColor = RGBA; + } + + function SetTextOffset(gX, gY) { + TextXoffset = gX; + TextYoffset = gY; + } + + function Show(obj) { + LenheartNewUI_Button.Show(obj); + local Color = TextColor; + local SY = Y + TextYoffset; + if (State != 8) { + if (isLBDown) { + SY = Y + TextYoffset + 1; + } + if (isInRect || State == 1) { + Color = TextRColor; + } + } + L_sq_DrawCode(TextStr, X + TextXoffset + 19, SY + 5, Color, 0, 1); + } +} + +class LenheartNewUI_BaseInput extends LenheartNewUI_CommonUi { + State = 0; + InputState = 0; + DWidth = null; + str = ""; + sliceCode = "|"; + BaseTime = 0; + InputController = null; + CallBack = null; + + constructor(X, Y, W, H) { + this.DWidth = W; + LenheartNewUI_CommonUi.constructor(X, Y, W, H); + } + + function sliceCodeFlicker() { + local T = Clock(); + if ((T - 500) >= BaseTime) { + BaseTime = T; + if (sliceCode.len() > 0) sliceCode = ""; + else if (sliceCode.len() == 0) sliceCode = "|"; + } + } + + function Show(obj) { + //光标闪烁 + if (InputState == 1) sliceCodeFlicker(); + else sliceCode = ""; + + L_sq_DrawImg("interface/lenheartwindowcommon.img", 63, this.X, this.Y); + for (local i = 0; i< this.Width; i++) { + L_sq_DrawImg("interface/lenheartwindowcommon.img", 64, this.X + 3 + i, this.Y); + } + L_sq_DrawImg("interface/lenheartwindowcommon.img", 65, this.X + 3 + this.Width, this.Y); + L_sq_DrawCode(str + sliceCode, this.X + 4, this.Y + 3, sq_RGBA(179, 169, 135, 255), 0, 1); + this.OnClick = function() { + InputController = L_sq_NewInputBox(this.X, this.Y, this.Width, this.Height, str); + InputState = 1; + } + + + if (InputController) { + local StrBuf = L_sq_GetInputBoxStr(InputController); + if (StrBuf != "LenheartNULL") { + local oldStr = str; + str = StrBuf; + if (CallBack) CallBack(this, oldStr); + } else { + InputController = null; + InputState = 0; + } + } + } + + function SetStr(Value) { + L_sq_SetInputBoxStr(InputController, Value); + } +} + +//复选框 +class LenheartNewUI_SwitchButton extends LenheartNewUI_CommonUi { + State = 0; + ImgIndex = null; + ImgPath = "interface/lenheartwindowcommon.img"; + + constructor(X, Y) { + LenheartNewUI_CommonUi.constructor(X, Y, 14, 15); + } + + function Show(obj) { + //不可用 + if (State == 8) { + L_sq_DrawImg(ImgPath, ImgIndex ? ImgIndex + 3 : 141, X, Y + 1); + } else { + //悬停 + if (isLBDown) { + L_sq_DrawImg(ImgPath, ImgIndex ? ImgIndex + 2 : 140, X, Y + 1); + } + //按下 + else if (isInRect) { + if (State == 0) + L_sq_DrawImg(ImgPath, ImgIndex ? ImgIndex + 1 : 139, X, Y); + if (State == 1) + L_sq_DrawImg(ImgPath, ImgIndex ? ImgIndex + 2 : 140, X, Y); + } + //普通 + else { + if (State == 0) + L_sq_DrawImg(ImgPath, ImgIndex ? ImgIndex : 138, X, Y); + if (State == 1) + L_sq_DrawImg(ImgPath, ImgIndex ? ImgIndex + 2 : 140, X, Y); + + } + } + } +} + +class LenheartNewUI_SwitchButtonText extends LenheartNewUI_SwitchButton { + + TextStr = null; + TextX = 0; + TextY = 0; + TextColor = null; + TextRColor = null; + + + constructor(X, Y, Str) { + LenheartNewUI_SwitchButton.constructor(X, Y); + this.TextStr = Str; + TextColor = sq_RGBA(221, 197, 147, 250); + TextRColor = sq_RGBA(255, 255, 184, 250); + } + + function SetTextColor(RGBA) { + TextColor = RGBA; + } + + function SetTextPos(gX, gY) { + TextX = gX; + TextY = gY; + } + + function Show(obj) { + LenheartNewUI_SwitchButton.Show(obj); + local Color = TextColor; + local SY = Y; + if (State != 8) { + if (isLBDown) { + SY = Y + 1; + } + if (isInRect || State == 1) { + Color = TextRColor; + } + } + L_sq_DrawCode(TextStr, X + 16 + TextX, SY + 1 + TextY, Color, 0, 1); + } +} + +class LenheartNewUI_Tabbars extends LenheartNewUI_CommonUi { + State = 0; + Path = "interface/lenheartwindowcommon.img"; + Idx = 29; + + constructor(X, Y, ...) { + if (vargc == 2) { + LenheartNewUI_CommonUi.constructor(X, Y, vargv[0], vargv[1]); + } else { + LenheartNewUI_CommonUi.constructor(X, Y, 61, 19); + } + } + + function SetFrame(gPath, gIdx) { + if (gPath) Path = gPath; + Idx = gIdx; + } + + function Show(obj) { + //不可用 + if (State == 8) { + L_sq_DrawImg(Path, Idx + 3, X, Y); + } else { + //按下 + if (isLBDown) { + L_sq_DrawImg(Path, Idx + 1, X, Y + 1); + } + //悬停 + else if (isInRect) { + if (State == 0) + L_sq_DrawImg(Path, Idx + 1, X, Y); + if (State == 1) + L_sq_DrawImg(Path, Idx + 2, X, Y); + } + //普通 + else { + if (State == 0) + L_sq_DrawImg(Path, Idx, X, Y); + if (State == 1) + L_sq_DrawImg(Path, Idx + 2, X, Y); + } + } + } +} + +class LenheartNewUI_TabbarsText extends LenheartNewUI_Tabbars { + TextStr = null; + TextX = null; + TextY = null; + TextColor = null; + TextRColor = null; + + TextXoffset = null; + TextYoffset = null; + + constructor(X, Y, Str, ...) { + if (vargc == 2) { + LenheartNewUI_Tabbars.constructor(X, Y, vargv[0], vargv[1]); + } else { + LenheartNewUI_Tabbars.constructor(X, Y); + } + this.TextStr = Str; + TextColor = sq_RGBA(124, 110, 82, 255); + TextRColor = sq_RGBA(185, 172, 145, 255); + + TextXoffset = 19; + TextYoffset = 3; + } + + function SetTextColor(RGBA) { + TextColor = RGBA; + } + + function SetTextOffset(gX, gY) { + TextXoffset = gX; + TextYoffset = gY; + } + + function Show(obj) { + LenheartNewUI_Tabbars.Show(obj); + local Color = TextColor; + local SY = Y + TextYoffset; + if (State != 8) { + if (isLBDown) { + SY = Y + TextYoffset + 1; + } + if (isInRect || State == 1) { + Color = TextRColor; + } + } + if (State == 1) + L_sq_DrawCode(TextStr, X + TextXoffset, SY, Color, 0, 1); + if (State == 0 || State == 8) + L_sq_DrawCode(TextStr, X + TextXoffset, SY + 2, Color, 0, 1); + } +} + + +class Yosin_DragButton extends LenheartNewUI_CommonUi { + State = 0; + DHeight = null; // 改为高度 + Path = "interface/lenheartwindowcommon.img"; + Idx = 172; + FillHeight = 2; // 改为填充高度 + FirstHeight = 7; // 改为首节高度 + Width = 9; // 固定宽度,垂直按钮宽度通常是固定的 + Visible = true; + DeBugMode = false; + + BasePos = null; + MoveFlag = false; + //鼠标相对位置 + M_Xpos = null; + M_Ypos = null; + B_X = null; + B_Y = null; + Move_Value = 0; + Max_Move_Value = 0; + + CurrentMovePosY = 0; + + //当前滚动值 + CurrentScrollValue = 0.0; + + OnChange = null; + + constructor(X, Y, H) { + this.DHeight = H; + LenheartNewUI_CommonUi.constructor(X, Y, Width, H + 7 * 2); // 宽度固定,高度动态 + + BasePos = { + x = X, + y = Y + } + + } + + function SetFrame(gPath, gIdx) { + if (gPath) Path = gPath; + Idx = gIdx; + } + + function Show(obj) { + //不可用 + if (State == 8) { + L_sq_Draw3Image_Vertical(X + 1, Y, this.DHeight, Path, Idx + 9, FillHeight, FirstHeight); + } else { + //按下 + if (isLBDown) { + L_sq_Draw3Image_Vertical(X, Y + 1, this.DHeight, Path, Idx + 3, FillHeight, FirstHeight); + } + //悬停 + else if (isInRect) { + L_sq_Draw3Image_Vertical(X, Y, this.DHeight, Path, Idx + 3, FillHeight, FirstHeight); + } + //普通 + else { + L_sq_Draw3Image_Vertical(X, Y, this.DHeight, Path, Idx, FillHeight, FirstHeight); + } + } + } + + + //鼠标左键按下回调 + function OnMouseLbDown(MousePos_X, MousePos_Y) { + LenheartNewUI_CommonUi.OnMouseLbDown(MousePos_X, MousePos_Y); + + if (isInRect) { + MoveFlag = true; + M_Xpos = MousePos_X; //原始鼠标位置数据 + M_Ypos = MousePos_Y; + B_X = X; //原始窗口位置 + B_Y = Y; + } + } + + //鼠标事件回调 + function OnMouseProc(Flag, MousePos_X, MousePos_Y) { + LenheartNewUI_CommonUi.OnMouseProc(Flag, MousePos_X, MousePos_Y); + + //移动 + if (MoveFlag) { + Move_Value = MousePos_Y - M_Ypos + CurrentMovePosY; + if (Move_Value > 0 && Move_Value <= Max_Move_Value) { + Y = (Move_Value); + Localtion_Y = (BasePos.y + Move_Value); + if (OnChange) { + local Rate = Move_Value.tofloat() / Max_Move_Value.tofloat(); + CurrentScrollValue = format("%.2f", Rate).tofloat(); + OnChange(CurrentScrollValue); + } + } + } + } + + //鼠标左键弹起回调 + function OnMouseLbUp(MousePos_X, MousePos_Y) { + LenheartNewUI_CommonUi.OnMouseLbUp(MousePos_X, MousePos_Y); + MoveFlag = false; + if (Move_Value< 0) Move_Value = 0; + if (Move_Value > Max_Move_Value) Move_Value = Max_Move_Value; + CurrentMovePosY = Move_Value; //记录当前移动位置 + } + + //设置最大移动值 + function SetMaxMoveValue(Value) { + Max_Move_Value = Value; + } + + //设置滚动回调函数 + function SetOnChange(OnChange) { + this.OnChange = OnChange; + } + + //设置滚动步进 + function SetStep(Step) { + // 计算新的移动值 + local newValue = CurrentMovePosY + (Step * Max_Move_Value).tointeger(); + + // 边界检查 + if (newValue< 0) newValue = 0; + if (newValue > Max_Move_Value) newValue = Max_Move_Value; + + // 更新位置 + Move_Value = newValue; + CurrentMovePosY = newValue; + Localtion_Y = BasePos.y + newValue; + // 更新并回调滚动值 + if (OnChange) { + local Rate = Move_Value.tofloat() / Max_Move_Value.tofloat(); + CurrentScrollValue = format("%.2f", Rate).tofloat(); + OnChange(CurrentScrollValue); + } + } + + //重置 + function Reset() { + Move_Value = 0; + CurrentMovePosY = 0; + Localtion_Y = BasePos.y; + // 更新并回调滚动值 + if (OnChange) { + local Rate = Move_Value.tofloat() / Max_Move_Value.tofloat(); + CurrentScrollValue = format("%.2f", Rate).tofloat(); + OnChange(CurrentScrollValue); + } + } +} + +class Yosin_ScrollBar { + + //上按钮 + UpButton = null; + //下按钮 + DownButton = null; + //滑动按钮 + ScrollButton = null; + //点击时步进的Y轴值 + Step = 0.0; + + Parent = null; + + constructor(X, Y, H, Sbtn_H) { + + + ScrollButton = Yosin_DragButton(X, Y + 13, Sbtn_H); + ScrollButton.SetFrame("interface/lenheartwindowcommon.img", 184); + //减去按钮高度 加滚动条长度加滚动条上下拼接长度15 加滚动条最大高度 + ScrollButton.SetMaxMoveValue(H - 26 - ScrollButton.Height); + + UpButton = LenheartNewUI_BaseButton(X, Y, 9, 13, "interface/lenheartwindowcommon.img", 16); + UpButton.OnClick = function() { + DoStep(-1); + }.bindenv(this); + + DownButton = LenheartNewUI_BaseButton(X, Y + H - 13, 9, 13, "interface/lenheartwindowcommon.img", 22); + DownButton.OnClick = function() { + DoStep(1); + }.bindenv(this); + } + + function DoStep(Flag) { + ScrollButton.SetStep(Step * Flag); + } + + function SetParent(Ui) { + Parent = Ui; + Ui.AddChild(UpButton); + Ui.AddChild(ScrollButton); + Ui.AddChild(DownButton); + } + + function RemoveSelf() { + for (local i = 0; i< Parent.Childrens.len(); i++) { + local obj = Parent.Childrens[i]; + if (obj == UpButton || obj == ScrollButton || obj == DownButton) { + Parent.Childrens.remove(i); + i--; + } + } + } + + function SetDebugModel(Flag) { + UpButton.DeBugMode = Flag; + ScrollButton.DeBugMode = Flag; + DownButton.DeBugMode = Flag; + } + + function SetOnChange(Func) { + ScrollButton.SetOnChange(Func); + } + + function SetStep(value) { + Step = value; + } + + function Reset() { + ScrollButton.Reset(); + } + +} \ No newline at end of file diff --git a/CSBase/UI/OldWindowsMap.nut b/CSBase/UI/OldWindowsMap.nut new file mode 100644 index 0000000..80f1567 --- /dev/null +++ b/CSBase/UI/OldWindowsMap.nut @@ -0,0 +1,52 @@ +/* +文件名:OldWindowsMap.nut +路径:Base/UI/OldWindowsMap.nut +创建日期:2024-08-06 18:56 +文件用途:用于查询是否鼠标悬停在原生窗口上的Flag 以下编号代表着没有悬停其他均为悬停在原生窗口 +*/ +NotOldWindowsMap <- {} +NotOldWindowsMap.rawset(92, 1); +NotOldWindowsMap.rawset(79, 1); +NotOldWindowsMap.rawset(2395, 1); +NotOldWindowsMap.rawset(2396, 1); +NotOldWindowsMap.rawset(3877, 1); +NotOldWindowsMap.rawset(3878, 1); +NotOldWindowsMap.rawset(3873, 1); +NotOldWindowsMap.rawset(3874, 1); +NotOldWindowsMap.rawset(3858, 1); +NotOldWindowsMap.rawset(3871, 1); +NotOldWindowsMap.rawset(3857, 1); +NotOldWindowsMap.rawset(3861, 1); +NotOldWindowsMap.rawset(3862, 1); +NotOldWindowsMap.rawset(93, 1); +NotOldWindowsMap.rawset(94, 1); +NotOldWindowsMap.rawset(95, 1); +NotOldWindowsMap.rawset(96, 1); +NotOldWindowsMap.rawset(97, 1); +NotOldWindowsMap.rawset(98, 1); +NotOldWindowsMap.rawset(99, 1); +NotOldWindowsMap.rawset(100, 1); +NotOldWindowsMap.rawset(101, 1); +NotOldWindowsMap.rawset(114, 1); +NotOldWindowsMap.rawset(88, 1); +NotOldWindowsMap.rawset(102, 1); +NotOldWindowsMap.rawset(108, 1); +NotOldWindowsMap.rawset(109, 1); +NotOldWindowsMap.rawset(103, 1); +NotOldWindowsMap.rawset(104, 1); +NotOldWindowsMap.rawset(110, 1); +NotOldWindowsMap.rawset(111, 1); +NotOldWindowsMap.rawset(105, 1); +NotOldWindowsMap.rawset(106, 1); +NotOldWindowsMap.rawset(112, 1); +NotOldWindowsMap.rawset(113, 1); +NotOldWindowsMap.rawset(107, 1); +NotOldWindowsMap.rawset(87, 1); +NotOldWindowsMap.rawset(86, 1); +NotOldWindowsMap.rawset(80, 1); +NotOldWindowsMap.rawset(81, 1); +NotOldWindowsMap.rawset(82, 1); +NotOldWindowsMap.rawset(83, 1); +NotOldWindowsMap.rawset(4067, 1); +NotOldWindowsMap.rawset(122, 1); +NotOldWindowsMap.rawset(120, 1); \ No newline at end of file diff --git a/CSBase/_ENUM/_ENUM_.nut b/CSBase/_ENUM/_ENUM_.nut new file mode 100644 index 0000000..0aadf47 --- /dev/null +++ b/CSBase/_ENUM/_ENUM_.nut @@ -0,0 +1,426 @@ +/* +文件名:_ENUM_KEY.nut +路径:Base/_ENUM/_ENUM_KEY.nut +创建日期:2024-08-06 22:09 +文件用途:按键枚举类 +*/ +DIK_ESCAPE <- 0x01 +DIK_1 <- 0x02 +DIK_2 <- 0x03 +DIK_3 <- 0x04 +DIK_4 <- 0x05 +DIK_5 <- 0x06 +DIK_6 <- 0x07 +DIK_7 <- 0x08 +DIK_8 <- 0x09 +DIK_9 <- 0x0A +DIK_0 <- 0x0B +DIK_MINUS <- 0x0C /* - on main keyboard */ +DIK_EQUALS <- 0x0D +DIK_BACK <- 0x0E /* backspace */ +DIK_TAB <- 0x0F +DIK_Q <- 0x10 +DIK_W <- 0x11 +DIK_E <- 0x12 +DIK_R <- 0x13 +DIK_T <- 0x14 +DIK_Y <- 0x15 +DIK_U <- 0x16 +DIK_I <- 0x17 +DIK_O <- 0x18 +DIK_P <- 0x19 +DIK_LBRACKET <- 0x1A +DIK_RBRACKET <- 0x1B +DIK_RETURN <- 0x1C /* Enter on main keyboard */ +DIK_LCONTROL <- 0x1D +DIK_A <- 0x1E +DIK_S <- 0x1F +DIK_D <- 0x20 +DIK_F <- 0x21 +DIK_G <- 0x22 +DIK_H <- 0x23 +DIK_J <- 0x24 +DIK_K <- 0x25 +DIK_L <- 0x26 +DIK_SEMICOLON <- 0x27 +DIK_APOSTROPHE <- 0x28 +DIK_GRAVE <- 0x29 /* accent grave */ +DIK_LSHIFT <- 0x2A +DIK_BACKSLASH <- 0x2B +DIK_Z <- 0x2C +DIK_X <- 0x2D +DIK_C <- 0x2E +DIK_V <- 0x2F +DIK_B <- 0x30 +DIK_N <- 0x31 +DIK_M <- 0x32 +DIK_COMMA <- 0x33 +DIK_PERIOD <- 0x34 /* . on main keyboard */ +DIK_SLASH <- 0x35 /* / on main keyboard */ +DIK_RSHIFT <- 0x36 +DIK_MULTIPLY <- 0x37 /* * on numeric keypad */ +DIK_LMENU <- 0x38 /* left Alt */ +DIK_SPACE <- 0x39 +DIK_CAPITAL <- 0x3A +DIK_F1 <- 0x3B +DIK_F2 <- 0x3C +DIK_F3 <- 0x3D +DIK_F4 <- 0x3E +DIK_F5 <- 0x3F +DIK_F6 <- 0x40 +DIK_F7 <- 0x41 +DIK_F8 <- 0x42 +DIK_F9 <- 0x43 +DIK_F10 <- 0x44 +DIK_NUMLOCK <- 0x45 +DIK_SCROLL <- 0x46 /* Scroll Lock */ +DIK_NUMPAD7 <- 0x47 +DIK_NUMPAD8 <- 0x48 +DIK_NUMPAD9 <- 0x49 +DIK_SUBTRACT <- 0x4A /* - on numeric keypad */ +DIK_NUMPAD4 <- 0x4B +DIK_NUMPAD5 <- 0x4C +DIK_NUMPAD6 <- 0x4D +DIK_ADD <- 0x4E /* + on numeric keypad */ +DIK_NUMPAD1 <- 0x4F +DIK_NUMPAD2 <- 0x50 +DIK_NUMPAD3 <- 0x51 +DIK_NUMPAD0 <- 0x52 +DIK_DECIMAL <- 0x53 /* . on numeric keypad */ +DIK_OEM_102 <- 0x56 /* <> or \| on RT 102-key keyboard (Non-U.S.) */ +DIK_F11 <- 0x57 +DIK_F12 <- 0x58 +DIK_F13 <- 0x64 /* (NEC PC98) */ +DIK_F14 <- 0x65 /* (NEC PC98) */ +DIK_F15 <- 0x66 /* (NEC PC98) */ +DIK_KANA <- 0x70 /* (Japanese keyboard) */ +DIK_ABNT_C1 <- 0x73 /* /? on Brazilian keyboard */ +DIK_CONVERT <- 0x79 /* (Japanese keyboard) */ +DIK_NOCONVERT <- 0x7B /* (Japanese keyboard) */ +DIK_YEN <- 0x7D /* (Japanese keyboard) */ +DIK_ABNT_C2 <- 0x7E /* Numpad . on Brazilian keyboard */ +DIK_NUMPADEQUALS <- 0x8D /* = on numeric keypad (NEC PC98) */ +DIK_PREVTRACK <- 0x90 /* Previous Track (DIK_CIRCUMFLEX on Japanese keyboard) */ +DIK_AT <- 0x91 /* (NEC PC98) */ +DIK_COLON <- 0x92 /* (NEC PC98) */ +DIK_UNDERLINE <- 0x93 /* (NEC PC98) */ +DIK_KANJI <- 0x94 /* (Japanese keyboard) */ +DIK_STOP <- 0x95 /* (NEC PC98) */ +DIK_AX <- 0x96 /* (Japan AX) */ +DIK_UNLABELED <- 0x97 /* (J3100) */ +DIK_NEXTTRACK <- 0x99 /* Next Track */ +DIK_NUMPADENTER <- 0x9C /* Enter on numeric keypad */ +DIK_RCONTROL <- 0x9D +DIK_MUTE <- 0xA0 /* Mute */ +DIK_CALCULATOR <- 0xA1 /* Calculator */ +DIK_PLAYPAUSE <- 0xA2 /* Play / Pause */ +DIK_MEDIASTOP <- 0xA4 /* Media Stop */ +DIK_VOLUMEDOWN <- 0xAE /* Volume - */ +DIK_VOLUMEUP <- 0xB0 /* Volume + */ +DIK_WEBHOME <- 0xB2 /* Web home */ +DIK_NUMPADCOMMA <- 0xB3 /* , on numeric keypad (NEC PC98) */ +DIK_DIVIDE <- 0xB5 /* / on numeric keypad */ +DIK_SYSRQ <- 0xB7 +DIK_RMENU <- 0xB8 /* right Alt */ +DIK_PAUSE <- 0xC5 /* Pause */ +DIK_HOME <- 0xC7 /* Home on arrow keypad */ +DIK_UP <- 0xC8 /* UpArrow on arrow keypad */ +DIK_PRIOR <- 0xC9 /* PgUp on arrow keypad */ +DIK_LEFT <- 0xCB /* LeftArrow on arrow keypad */ +DIK_RIGHT <- 0xCD /* RightArrow on arrow keypad */ +DIK_END <- 0xCF /* End on arrow keypad */ +DIK_DOWN <- 0xD0 /* DownArrow on arrow keypad */ +DIK_NEXT <- 0xD1 /* PgDn on arrow keypad */ +DIK_INSERT <- 0xD2 /* Insert on arrow keypad */ +DIK_DELETE <- 0xD3 /* Delete on arrow keypad */ +DIK_LWIN <- 0xDB /* Left Windows key */ +DIK_RWIN <- 0xDC /* Right Windows key */ +DIK_APPS <- 0xDD /* AppMenu key */ +DIK_POWER <- 0xDE /* System Power */ +DIK_SLEEP <- 0xDF /* System Sleep */ +DIK_WAKE <- 0xE3 /* System Wake */ +DIK_WEBSEARCH <- 0xE5 /* Web Search */ +DIK_WEBFAVORITES <- 0xE6 /* Web Favorites */ +DIK_WEBREFRESH <- 0xE7 /* Web Refresh */ +DIK_WEBSTOP <- 0xE8 /* Web Stop */ +DIK_WEBFORWARD <- 0xE9 /* Web Forward */ +DIK_WEBBACK <- 0xEA /* Web Back */ +DIK_MYCOMPUTER <- 0xEB /* My Computer */ +DIK_MAIL <- 0xEC /* Mail */ +DIK_MEDIASELECT <- 0xED /* Media Select */ +FFI_FIRST_ABI <- 0; +FFI_SYSV <- 1; +FFI_STDCALL <- 2; +FFI_THISCALL <- 3; +FFI_FASTCALL <- 4; +FFI_MS_CDECL <- 5; +FFI_PASCAL <- 6; +FFI_REGISTER <- 7; + + +function Sq_L_Medal(x, y) {} + +function Sq_SettingWindowCallBack(x, y) {} + +function Sq_BuffSwitchingCallBack(x, y) {} + +function Sq_SwitchingCallBack(x, y) {} + +function Sq_UpgradeCallBack(x, y) {} + +function Sq_RecoveryCallBack(x, y) {} + +function Sq_RecoveryTypeSetCallBack(Type) {} + +function Sq_DrawMainMaxLayerCustomUI(pack) {} + +function Lenheart(VmTop) {} + +function Sq_MouseEventCallBack(Lb, Rb, Mb) {} + +function Sq_SelectCharacter(Chunk) {} + +function Sq_DrawMainTopLayerCustomUI(pack) {} + +function Sq_GetExeStr_Event(StrIndex) { + return StrIndex; +} + +function Sq_CreatChr(chunk) {} + +function Sq_SendPackType_Event(Type) {} + +function Sq_SendPackByte_Event(Parm) {} + +function Sq_SendPackWord_Event(Parm) {} + +function Sq_SendPackDWord_Event(Parm) {} + +function Sq_SendPackChar_Event(Parm) {} + +function Sq_SendPack_Event() {} + +function Sq_DrawItemBack(Xpos, Ypos, Image) {} + +function Sq_DrawItemFront(Xpos, Ypos, Image) {} + +function Sq_GetDrawMonBloodSw() { + return false; +} + +function Sq_DrawMonsterBlood(Object, X, Y) {} + +function Sq_Set_Inventory_M_Pos(This) {} + +function Sq_Get_Ex_IntData(SkillAddress, Idx, objAddress) { + return 0; +} + +function Sq_Get_Ex_SkillCoolTime(SkillAddress, Idx, objAddress) { + return 0; +} + +function Sq_Get_Ex_LevelData(SkillAddress, Idx, objAddress) { + return 0; +} + +function Sq_PlayerEachPos(x, y) {} + +function Sq_DrawMainMaxLayerCustomUI(pack) {} + +function Sq_PushDamageFontData(ObjAddress, X, Y, Z, Value, Type, A8, A9) { + return true; +} + +function Sq_PushDamageData(ObjAddress, MySelfAddress, Value); + +function Sq_Pack_Control(chunk) {} + +function Sq_MessageWindowDraw(a, c) {} + +function Sq_Get_Event_Pos_X() { + return 1; +} + +function Sq_Get_Event_Pos_Y() { + return 1; +} + +function Sq_L_OtherPlayerInfo(x, y, Type, Value, ImgBuf) { + local str = Value.tostring(); + local lenght = L_sq_GetStringDrawLength(str); + L_sq_DrawImg(ImgBuf, x + 70 - lenght, y + 5); + return Value; +} + +function Sq_DrawMiniMapUI(a) {} + +function Sq_CompleteTask(a1, a2, a3) {} + +function L_drawMainCustomUI_All() {} + +function L_MouseCallBack(a, b, c, d) {} + +function L_DrawWindow_A() {} + +function L_DrawWindow_B() {} + +function L_OpenOldWindowCallBack(WindowIndex) {} + +function L_Old_Window_Get(WindowObject) {} + +function L_Character_Info_Window(WindowObject) { + return false; +} + +function L_Other_Character_Info_Window(WindowObject) { + return false; +} + +function L_Old_Window_Visible(WindowObject, Flag) {} + + +getroottable().LenheartBaseFuncTab <- {}; +getroottable().LenheartFuncTab <- {}; +getroottable().Rindro_Scr_Width <- L_sq_RA(0x4D848E); +getroottable().Rindro_Scr_High <- L_sq_RA(0x4D8495); + +//获取装备偏移 +function Rindro_GetEquAddr(addr) { + switch (addr) { + case 1: + return 0x3038; + break; + case 2: + return 0x304C; + break; + case 3: + return 0x3048; + break; + case 4: + return 0x3050; + break; + case 5: + return 0x3044; + break; + case 6: + return 0x3040; + break; + case 7: + return 0x3058; + break; + case 8: + return 0x305C; + break; + case 9: + return 0x3054; + break; + case 10: + return 0x3060; + break; + case 11: + return 0x3064; + break; + case 12: + return 0x303c; + break; + + + case 13: //帽子 + return 0x3010; + break; + case 14: //头部 + return 0x3014; + break; + case 15: //脸 + return 0x3018; + break; + case 16: + return 0x301c; + break; + case 17: + return 0x3020; + break; + case 18: + return 0x3024; + break; + case 19: + return 0x3028; + break; + case 20: + return 0x302c; + break; + case 21: + return 0x3030; + break; + case 22: + return 0x3034; + break; + case 23: + return 0x3030; + break; + case 24: + return 0x3068; + break; + case 25: + return 0x306C; + break; + case 26: + return 0x3070; + break; + case 27: + return 0x3074; + break; + } + return -1; +} + +//本地模式 +if(!getroottable().rawin("RINDROLOCAL"))RINDROLOCAL <- false; + +function deepcopy(obj) { + local copies = {}; // 用于跟踪已拷贝对象的表 + return _deepcopy(obj, copies); +} + +function _deepcopy(obj, copies) { + local type = typeof obj; + + // 处理基本类型 + if (type != "table" && type != "array" && type != "class" && type != "instance") { + return obj; + } + + // 处理循环引用 + if (obj in copies) { + return copies[obj]; + } + + // 创建新容器 + local newObj; + if (type == "array") { + newObj = array(obj.len()); + copies[obj] <- newObj; // 在拷贝前记录 + + for (local i = 0; i < obj.len(); i++) { + newObj[i] = _deepcopy(obj[i], copies); + } + } + else if (type == "table") { + newObj = {}; + copies[obj] <- newObj; // 在拷贝前记录 + + foreach(key, val in obj) { + // 键也需要深拷贝 + local newKey = _deepcopy(key, copies); + local newVal = _deepcopy(val, copies); + newObj[newKey] <- newVal; + } + } + else { // 类和实例(浅拷贝) + newObj = obj; + copies[obj] <- newObj; + } + + return newObj; +} \ No newline at end of file diff --git a/CSBase/_Tool/Animation_Class.nut b/CSBase/_Tool/Animation_Class.nut new file mode 100644 index 0000000..f28252d --- /dev/null +++ b/CSBase/_Tool/Animation_Class.nut @@ -0,0 +1,545 @@ +/* +文件名:Animation_Class.nut +路径:Base/_Tool/Animation_Class.nut +创建日期:2024-10-21 16:57 +文件用途:动画类 +*/ +class Rindro_Animation { + + //Ani是否可用 + IsUsability = true; + + //当前帧数 + CurrentFrameIndex = 0; + //当前帧时间 + CurrentIndexT = 0; + //当前帧 + CurrentFrame = null; + + //Ani的标签 + AnimationFlag = null; + //图片对象数组 + PngList = null; + //帧对象数组 + FrameList = null; + + //附加选项 + AdditionalOptions = null; + + //角度 + Angle = 0; + + + constructor(Data, ...) { + PngList = []; + FrameList = []; + + //附加选项 + if (vargc > 0) AdditionalOptions = vargv[0]; + + //初始化数据 + InitData(Data); + } + + + function InitData(Data) { + local Buf; + + if (type(Data) == "table") { + Buf = Data; + } + //从PVF数据加载 + else if (type(Data) == "string") { + local ReadObject = R_Utils.GetScriptFileReader(Data); + if (ReadObject) { + Buf = Rindro_Script.ReadAnimation(ReadObject); + } + } + + if (Buf) { + AnimationFlag = Buf.Flag; + FrameList = Buf.Frame; + foreach(FrameObj in FrameList) { + //如果有附加处理 格式化 + if (AdditionalOptions && AdditionalOptions.rawin("ImgFormat")) FrameObj.Img_Path = AdditionalOptions["ImgFormat"](FrameObj.Img_Path); + local Png = Rindro_Image.Load(FrameObj.Img_Path); + // Png.Draw(-500, -500); + + //如果有附加处理 坐标 + if (AdditionalOptions && AdditionalOptions.rawin("Pos")) { + FrameObj.Pos.x += AdditionalOptions["Pos"].x; + FrameObj.Pos.y += AdditionalOptions["Pos"].y; + } + // Spritebuf.SetPosition(FrameObj.Pos); + + PngList.append(Png); + } + } else { + AnimationFlag = {}; + FrameList.append({ + AttackBox = [], + DamageBox = [], + Delay = 800, + Flag = {}, + Img_Index = 0, + Img_Path = "", + Pos = { + x = -248, + y = -331 + } + }) + + // print(Data); + // print("创建Ani失败,找不到Ani数据"); + } + } + + + //重置Ani + function Reset() { + IsUsability = true; + FlushFrame(0); + } + + //获取当前帧信息 + function GetCurrentFrameInfo() { + return FrameList[CurrentFrameIndex]; + } + + function FlushFrame(Index) { + if (PngList.len() <= 0) return; + //同步当前帧 + CurrentFrameIndex = Index; + //当前帧更换为本帧 + CurrentFrame = PngList[CurrentFrameIndex]; + + local FlagBuf = FrameList[CurrentFrameIndex].Flag; + //关键帧 + if ("SET_FLAG" in FlagBuf) { + // if (StateMachine && StateMachine.State != -1) StateMachine.ChangeAniKeyFlag(FlagBuf.SET_FLAG); + } + //播放音效 + if ("PLAY_SOUND" in FlagBuf) { + R_Utils.PlaySound(FlagBuf.PLAY_SOUND); + } + } + + //绘制 + function DrawFrame(X, Y) { + + // local NowDrawPng = CurrentFrame; + if (FrameList.len() <= 0) return; + local FrameObj = FrameList[CurrentFrameIndex]; + // printT(FrameObj); + + + //坐标偏移 + local XOffset = FrameObj.Pos.x; + local YOffset = FrameObj.Pos.y; + + //染色 + local RGBA = sq_RGBA(255, 255, 255, 255); + if ("RGBA" in FrameObj.Flag) { + local Fbuf = FrameObj.Flag.RGBA; + RGBA = sq_RGBA(Fbuf[0].tointeger(), Fbuf[1].tointeger(), Fbuf[2].tointeger(), Fbuf[3].tointeger()); + } + + //缩放 + local XRate = 1.0; + local YRate = 1.0; + if ("IMAGE_RATE" in FrameObj.Flag) { + local Fbuf = FrameObj.Flag.IMAGE_RATE; + XRate = Fbuf.x; + YRate = Fbuf.y; + } + + //线性减淡 + if ("GRAPHIC_EFFECT_LINEARDODGE" in FrameObj.Flag) { + L_sq_SetDrawImgModel(2, 0); + } + + if (CurrentFrame) CurrentFrame.DrawExPng(FrameObj.Img_Index, X + XOffset, Y + YOffset, Angle, RGBA, XRate, YRate); + + //线性减淡 + if ("GRAPHIC_EFFECT_LINEARDODGE" in FrameObj.Flag) { + L_sq_ReleaseDrawImgModel(); + } + } + + + function Draw(X, Y) { + //可用性检查 + if (IsUsability) { + DrawFrame(X, Y); + //累加当前帧时间 + CurrentIndexT += Rindro_Duration; + + //当前帧时间 超过 当前帧延迟就需要切换帧了 + if ("Delay" in FrameList[CurrentFrameIndex] && CurrentIndexT >= FrameList[CurrentFrameIndex].Delay) { + CurrentIndexT = 0; + //如果当前帧小于总帧数就切换 + if (CurrentFrameIndex<(FrameList.len() - 1)) { + FlushFrame(CurrentFrameIndex + 1); + } + //说明播放完毕了 + else { + //如果有循环 + if ("LOOP" in AnimationFlag) { + FlushFrame(0); + } + //没有循环触发状态机回调 + else { + //将不再可用 + IsUsability = false; + } + } + } + } + } + + function DrawIndex(X, Y, Index) { + // return; + if (IsUsability) { + FlushFrame(Index); + DrawFrame(X, Y); + } + } +} + + +//绘制角色类 +class Rindro_Draw_Character { + + //名字 + Name = null; + //职业 + Job = null; + + //绘制体信息 + DrawInfo = null; + + //隐藏图层Map + HideMap = null; + + + ENUM_RINDRO_JOB_NAME = ["swordman", "fighter", "gunner", "mage", "priest", "atgunner", "thief", "atfighter", "atmage", "demonicswordman", "creatormage"]; + ENUM_RINDRO_JOB_TITLE_HEIGHT = [ + //男鬼剑士 + { + x = -42, + y = -154 + }, + //女格斗 + { + x = -42, + y = -140 + }, + //男神枪手 + { + x = -44, + y = -168 + }, + //女魔法师 + { + x = -46, + y = -126 + }, + //男圣职者 + { + x = -46, + y = -166 + }, + //女神枪手 + { + x = -42, + y = -156 + }, + //女暗夜使者 + { + x = -44, + y = -154 + }, + //男格斗家 + { + x = -45, + y = -160 + }, + //男魔法师 + { + x = -45, + y = -140 + }, + //黑暗武士 + { + x = -42, + y = -154 + }, + //缔造者 + { + x = -46, + y = -126 + }, + ]; + + ENUM_RINDRO_JOB_FACE_HEIGHT = [ + //男鬼剑士 + { + x = 11, + y = 111 + }, + //女格斗 + { + x = 9, + y = 103 + }, + //男神枪手 + { + x = 13, + y = 131 + }, + //女魔法师 + { + x = 14, + y = 87 + }, + //男圣职者 + { + x = 16, + y = 126 + }, + //女神枪手 + { + x = 11, + y = 119 + }, + + //女暗夜使者 + { + x = 12, + y = 115 + }, + //男格斗家 + { + x = 13, + y = 119 + }, + //男魔法师 + { + x = 13, + y = 101 + }, + //黑暗武士 + { + x = -42, + y = -154 + }, + //缔造者 + { + x = -46, + y = -126 + }, + ]; + + + //获取角色AniBy装备 + function GetCharacAniByEqu(Job, Equ, AniName) { + local AniList = []; + foreach(value in Equ) { + if (value > 0) { + local ListBuf = CreateEquipmentAni(value, Job, AniName); + AniList.extend(ListBuf); + } + } + local n = AniList.len(); + for (local i = 0; i< n - 1; i++) { + for (local j = i + 1; j< n; j++) { + if (AniList[i].Layer > AniList[j].Layer) { + // 交换两个元素 + local temp = AniList[i]; + AniList[i] = AniList[j]; + AniList[j] = temp; + } + } + } + return AniList; + } + + function CreateEquipmentAni(Index, Job, AniName) { + local AniList = []; + //获取装备或时装的文件路径 + local FilePath = R_Utils.GetEquPath(Index); + if (FilePath) { + local ReadObject = R_Utils.GetScriptFileReader("equipment/" + FilePath); + if (ReadObject) { + local Equ = Rindro_Script.ReadEquipment(ReadObject); + //职业名字 + local JobName = ENUM_RINDRO_JOB_NAME[Job]; + //没有装备类型 + if (!(Equ.rawin("equipment_type"))) Equ.equipment_type <- "normal"; + //光环单独处理 其他的在下面处理 + if (Equ.equipment_type == "aurora avatar") { + foreach(Path in Equ.Aurora.Back) { + // local AniBuf = Rindro_Animation(Path); + AniList.append({ + Ani = Path, + AniName = Path + Clock(), + Layer = -10000, + DrawType = "Native" + }); + } + foreach(Path in Equ.Aurora.Front) { + // local AniBuf = Rindro_Animation(Path); + AniList.append({ + Ani = Path, + AniName = Path + Clock(), + Layer = 10000, + DrawType = "Native" + }); + } + } + //称号 + else if (Equ.equipment_type == "title name") { + local PathBuf = "equipment/" + FilePath; + PathBuf = PathBuf.slice(0, R_Utils.String.FindLastSubstring(PathBuf, "/")); + local Path = PathBuf + "/" + Equ.custom_animation; + local Ao = { + Pos = ENUM_RINDRO_JOB_TITLE_HEIGHT[Job] + } + local AniBuf = Rindro_Animation(Path, Ao); + AniList.append({ + Ani = AniBuf, + Layer = 10001, + }); + } + + //没有Ani 就那种透明时装 + if (!(Equ.rawin("Ani_" + JobName))) return AniList; + + //记录时装的隐藏图层值 + if (Equ.rawin("hidelayer")) { + foreach(value in Equ["hidelayer"]) { + HideMap.rawset(value, true); + } + } + + //读取Ani配置 + local AniScript = Equ["Ani_" + JobName]; + // printT(AniScript); + if (Equ.equipment_type == "skin avatar") { + local Path; + if (JobName.find("at") >= 0) { + Path = format("character/%s/atanimation/%s", JobName.slice(2), AniName); + } else Path = format("character/%s/animation/%s", JobName, AniName); + local Ao = { + ImgVariation = AniScript.variation, + ImgFormat = function(ImgPath) { + if (ImgVariation[0] > 0) { + local Pos = ImgPath.find("%04d"); + ImgPath = ImgPath.slice(0, Pos) + "%02d%02d" + ImgPath.slice(Pos + 4); + return format(ImgPath, ImgVariation[0], ImgVariation[1]); + } else { + return format(ImgPath, ImgVariation[1]); + } + } + } + local AniBuf = Rindro_Animation(Path, Ao); + AniList.append({ + Ani = AniBuf, + Layer = -1, + }); + } else { + foreach(Info in AniScript.layer_variation) { + local PathBuf = "equipment/" + FilePath; + PathBuf = PathBuf.slice(0, R_Utils.String.FindLastSubstring(PathBuf, "/")); + local Path = PathBuf + "/" + Info.Path + "/" + AniName; + local Ao = { + ImgVariation = AniScript.variation, + ImgFormat = function(ImgPath) { + return format(ImgPath, ImgVariation[0], ImgVariation[1]); + } + } + local AniBuf = Rindro_Animation(Path, Ao); + AniList.append({ + Ani = AniBuf, + Layer = Info.Zorder, + }); + } + } + } + } + return AniList; + } + + constructor(Job, EquipmentArr, Action, Name) { + HideMap = {}; + DrawInfo = GetCharacAniByEqu(Job, EquipmentArr, Action); + this.Job = Job; + this.Name = Name; + } + + function Draw(X, Y) { + foreach(AniInfo in DrawInfo) { + // print(AniInfo.Layer); + if (!HideMap.rawin(AniInfo.Layer)) { + if (!AniInfo.rawin("DrawType") || AniInfo["DrawType"] != "Native") { + AniInfo.Ani.Draw(X, Y); + } else { + Rindro_BaseToolClass.DrawAniEx(X, Y, AniInfo.Ani, AniInfo.AniName); + } + } + } + + if (Name) { + L_sq_DrawCode(Name, 44 + X + ENUM_RINDRO_JOB_TITLE_HEIGHT[Job].x - (LenheartTextClass.GetStringLength(Name) / 2), Y + ENUM_RINDRO_JOB_TITLE_HEIGHT[Job].y + 24, sq_RGBA(255, 255, 255, 250), 1, 1); + } + } + + function DrawFace(X, Y) { + //兼容模式 + if (getroottable().PluginsCompatibilityModeCallBack){ + return; + } + setClip(X, Y, X + 22, Y + 18); //开始裁切 + foreach(AniInfo in DrawInfo) { + try { + AniInfo.Ani.DrawIndex(X + ENUM_RINDRO_JOB_FACE_HEIGHT[Job].x, Y + ENUM_RINDRO_JOB_FACE_HEIGHT[Job].y, 0); + } catch (exception) { + + } + } + releaseClip(); //裁切结束 + } +} +//鬼剑士 +//601580026 101550559 +// Sassq <- {}; +// Sassq[0] <- Rindro_Draw_Character(0, [ +// 601550071, +// 601560067, +// 601570062, +// 601500069, +// 601510068, +// 601540069, +// 601520061, +// 601530060, +// 601580026, +// 0, +// 27610, +// 26058 +// ], "rest.ani", "鬼剑士-Kina") +// //格斗家 +// Sassq[1] <- Rindro_Draw_Character(1, [26373, 102550540, 102560700, 102570504, 102520514, 102500742, 102510739, 102540664, 102580139, 102530474], "rest.ani", "Kina") +// //神枪手 +// Sassq[2] <- Rindro_Draw_Character(2, [26373, 104550553, 104560725, 104570492, 104520541, 104500750, 104510913, 104540671, 104580148, 104530494], "rest.ani", "Kina") +// //魔法师 +// Sassq[3] <- Rindro_Draw_Character(3, [26373, 106550521, 106560580, 106570446, 106520529, 106500603, 106510607, 106540583, 106580143, 106530461], "rest.ani", "Kina") +// //圣职者 +// Sassq[4] <- Rindro_Draw_Character(4, [26373, 108550600, 108560591, 108570687, 108520580, 108500587, 108510590, 108540562, 108580138, 108530560], "rest.ani", "Kina") +// //女枪 +// Sassq[5] <- Rindro_Draw_Character(5, [26373, 105550431, 105560424, 105570386, 105520415, 105500424, 105510429, 105540408, 105580144, 105530361], "rest.ani", "Kina") +// //暗夜 +// Sassq[6] <- Rindro_Draw_Character(6, [26373, 109550385, 109560393, 109570369, 109520406, 109500402, 109510414, 109540389, 109580134, 109530355], "rest.ani", "Kina") +// //男格斗 +// Sassq[7] <- Rindro_Draw_Character(7, [26373, 103550302, 103560311, 103570274, 103520297, 103500297, 103510301, 103540284, 103580128, 103530246], "rest.ani", "Kina") +// //男法 +// Sassq[8] <- Rindro_Draw_Character(8, [26373, 107550220, 107560223, 107570188, 107520224, 107500233, 107510231, 107540209, 107580129, 107530192], "rest.ani", "Kina") \ No newline at end of file diff --git a/CSBase/_Tool/BaseTool_Class.nut b/CSBase/_Tool/BaseTool_Class.nut new file mode 100644 index 0000000..20e9fe9 --- /dev/null +++ b/CSBase/_Tool/BaseTool_Class.nut @@ -0,0 +1,516 @@ +/* +文件名:BaseTool_Class.nut +路径:Base/_Tool/BaseTool_Class.nut +创建日期:2024-08-06 23:49 +文件用途:基础工具类 +*/ + +function printT(T) { + Sq_OutPutTable(Json.Encode(T)); +} +//Json类 +class Json { + function Encode(Table) { + + local JsonObj = JSONEncoder(); + return JsonObj.encode(Table); + + local Size = Table.len(); + local Pos = 0; + local Str = "{"; + foreach(Key, Value in Table) { + ++Pos; + Str += "\""; + Str += Key.tostring(); + Str += "\""; + Str += ":"; + if (typeof(Value) == "string") { + Str += "\""; + Str += Value; + Str += "\""; + } else if (typeof(Value) == "table") { + Str += Json.Encode(Value); + } else if (typeof(Value) == "array") { + Str += "["; + foreach(ArrObj in Value) { + if (typeof(ArrObj) == "table") Str += Json.Encode(Value); + else { + Str += ArrObj; + Str += ","; + } + } + Str = Str.slice(0, Str.len() - 1); + Str += "]"; + } else Str += Value; + if (Pos != Size) Str += ","; + } + Str += "}"; + return Str; + } + + function Decode(Str) { + // Str = L_sq_DecondeJson(Str); + // local Str = "local _M = " + Str + ";\n return _M;\n"; + // local Func = compilestring(Str); + // return Func(); + + local JsonObj = JSONParser(); + return JsonObj.parse(Str); + } +} +//Key 键盘按键类 +class KeyPress { + function KeyDown(obj, KeyValue) { + local KeyEvent = obj.getVar(KeyValue.tostring()); //声明储存器 + KeyEvent.clear_vector(); //清空储存器的向量位 + if (sq_IsKeyDown(KeyValue, ENUM_SUBKEY_TYPE_ALL) && KeyEvent.getInt(0) == 0) { + KeyEvent.setInt(0, 1); + return true; + } + } + + function KeyUp(obj, KeyValue) { + local KeyEvent = obj.getVar(KeyValue.tostring()); //声明储存器 + if (sq_IsKeyUp(KeyValue, ENUM_SUBKEY_TYPE_ALL)) { + KeyEvent.setInt(0, 0); + } + } + + function isKeyPress(KeyValue) { + local obj = sq_getMyCharacter(); + if (KeyPress.KeyDown(obj, KeyValue)) { + return true; + } + KeyPress.KeyUp(obj, KeyValue); + } +} +//Key 键盘按键类 +class KeyPressNB { + function KeyDown(obj, KeyValue, VarKey) { + local KeyEvent = obj.getVar(VarKey); //声明储存器 + KeyEvent.clear_vector(); //清空储存器的向量位 + if (sq_IsKeyDown(KeyValue, ENUM_SUBKEY_TYPE_ALL) && KeyEvent.getInt(0) == 0) { + KeyEvent.setInt(0, 1); + return true; + } + } + + function KeyUp(obj, KeyValue, VarKey) { + local KeyEvent = obj.getVar(VarKey); //声明储存器 + if (sq_IsKeyUp(KeyValue, ENUM_SUBKEY_TYPE_ALL)) { + KeyEvent.setInt(0, 0); + } + } + + function isKeyPress(KeyValue, VarKey) { + local obj = sq_getMyCharacter(); + obj = sq_GetCNRDObjectToActiveObject(obj); + if (KeyPressNB.KeyDown(obj, KeyValue, VarKey)) { + return true; + } + KeyPressNB.KeyUp(obj, KeyValue, VarKey); + } +} +//基础工具类 +class Rindro_BaseToolClass { + + function IsNumber(value) { + try { + local Buffer = value.tointeger(); + return true; + } catch (exception) { + return false; + } + } + + function GetItemNameById(ItemId) { + local ItemObject = L_sq_GetItem(ItemId); + local NamePointer = L_sq_RA(ItemObject + 0x20); + local ItemName = NativePointer(L_sq_I2P(NamePointer)).readUnicodeString(); + return ItemName; + } + + function SendPack(T) { + local str = Json.Encode(T); + L_sq_SendPackType(130); + L_sq_SendPackWChar(str); + L_sq_SendPack(); + } + + function SendPackEx(T) { + local str = L_sq_EncondeJson(T); + L_sq_SendPackType(130); + L_sq_SendPackWChar(str); + L_sq_SendPack(); + } + + function RegisterPack(Id, CallBack) { + Pack_Control.rawset(Id, CallBack); + } + + function RegisterHexPack(Id, CallBack) + { + Pack_Hex_Control.rawset(Id, CallBack); + } + + //绘制简易静态Ani // obj -- ani路径 -- X -- Y -- 第几帧 -- ani名字 + function T_DrawStayAni(obj, aniFileName, x, y, index, aniname) { + local SelectAni = obj.getVar().GetAnimationMap(aniname, aniFileName); + //sq_AnimationProc(SelectAni); + sq_DrawSpecificFrame(SelectAni, x, y, false, index, false, 1.0); + return SelectAni; + } + + //绘制简易静态Ani // obj -- ani路径 -- X -- Y -- 第几帧 -- ani名字 + function T_DrawStayAniRate(obj, aniFileName, x, y, index, aniname, rate) { + local SelectAni = obj.getVar().GetAnimationMap(aniname, aniFileName); + SelectAni.setImageRateFromOriginal(rate, rate); + //sq_AnimationProc(SelectAni); + sq_DrawSpecificFrame(SelectAni, x, y, false, index, false, 1.0); + return SelectAni; + } + + //绘制简易动态Ani // obj -- ani路径 -- X -- Y -- ani名字 + function T_DrawDynamicAni(obj, aniFileName, x, y, aniname) { + local ani = obj.getVar().GetAnimationMap(aniname, aniFileName); + sq_AnimationProc(ani); + sq_drawCurrentFrame(ani, x, y, true); + return ani; + } + + //超简易绘制动态Ani + function DrawAniEx(X, Y, AniPath, ...) { + local AniName = "简易播放Ani:" + AniPath; + if (vargc > 0) AniName = vargv[0]; + local obj = sq_getMyCharacter(); + local ani = obj.getVar().GetAnimationMap(AniName, AniPath); + sq_AnimationProc(ani); + sq_drawCurrentFrame(ani, X, Y, true); + return ani; + } + + + + //初始化根表成员 + function InitClass(Name) { + local RootTab = getroottable(); + if (RootTab.rawin(Name) == true) { + RootTab.rawdelete(Name); + } + } + + //获取交互Npc名称 + function GetEachNpcId() { + local OneAddress = L_sq_RA(0x1ADE0E0); + if (OneAddress) { + local TowAddress = L_sq_RA(OneAddress + 8); + if (TowAddress) { + local Id = L_sq_RA(TowAddress + 0x210); + return Id; + } + } + return null; + } + + function DrawTriptych(X, Y, Width, Img, StartIndex) { + //如果没有载入img就载入 + if (!Rindro_Image_GlobalMap.rawin(Img)) { + Rindro_Image_GlobalMap[Img] <- Rindro_Image(Img); + } + Rindro_Image_GlobalMap[Img].DrawPng(StartIndex, X, Y); + //获取第一张图片的宽 + local FirstW = Rindro_Image_GlobalMap[Img].GetPng(StartIndex).GetWidth(); + //获取中间的图片宽 + local MiddleW = Rindro_Image_GlobalMap[Img].GetPng(StartIndex + 1).GetWidth(); + //获得最后一张图片的宽 + local LastW = Rindro_Image_GlobalMap[Img].GetPng(StartIndex + 2).GetWidth(); + //绘制中间 + Rindro_Image_GlobalMap[Img].DrawExPng(StartIndex + 1, X + FirstW, Y, 0, sq_RGBA(255, 255, 255, 250), (Width - LastW - FirstW).tofloat() / MiddleW, 1.0); + //绘制最后一张 + Rindro_Image_GlobalMap[Img].DrawPng(StartIndex + 2, X + Width - LastW, Y); + } + + function DrawTriptychDetail(X, Y, Width, Img, Fi, Mi, La) { + //如果没有载入img就载入 + if (!Rindro_Image_GlobalMap.rawin(Img)) { + Rindro_Image_GlobalMap[Img] <- Rindro_Image(Img); + } + Rindro_Image_GlobalMap[Img].DrawPng(Fi, X, Y); + //获取第一张图片的宽 + local FirstW = Rindro_Image_GlobalMap[Img].GetPng(Fi).GetWidth(); + //获取中间的图片宽 + local MiddleW = Rindro_Image_GlobalMap[Img].GetPng(Mi).GetWidth(); + //获得最后一张图片的宽 + local LastW = Rindro_Image_GlobalMap[Img].GetPng(La).GetWidth(); + //绘制中间 + Rindro_Image_GlobalMap[Img].DrawExPng(Mi, X + FirstW, Y, 0, sq_RGBA(255, 255, 255, 250), (Width - LastW - FirstW).tofloat() / MiddleW, 1.0); + //绘制最后一张 + Rindro_Image_GlobalMap[Img].DrawPng(La, X + Width - LastW, Y); + } + + function DrawNineBox(X, Y, Width, Height, Img, StartIndex) { + //如果没有载入img就载入 + if (!Rindro_Image_GlobalMap.rawin(Img)) { + Rindro_Image_GlobalMap[Img] <- Rindro_Image(Img); + } + //绘制左上角 + Rindro_Image_GlobalMap[Img].DrawPng(StartIndex, X, Y); + //获取左上角的图片宽高 + local LeftTopW = Rindro_Image_GlobalMap[Img].GetPng(StartIndex).GetWidth(); + local LeftTopH = Rindro_Image_GlobalMap[Img].GetPng(StartIndex).GetHeight(); + + //绘制上边 + //获取上边的宽 + local TopW = Rindro_Image_GlobalMap[Img].GetPng(StartIndex + 1).GetWidth(); + Rindro_Image_GlobalMap[Img].DrawExPng(StartIndex + 1, X + LeftTopW, Y, 0, sq_RGBA(255, 255, 255, 250), (Width - LeftTopW * 2).tofloat() / TopW, 1.0); + + //绘制右上角 + Rindro_Image_GlobalMap[Img].DrawPng(StartIndex + 2, X + Width - LeftTopW, Y); + + //绘制左边 + //获取左边的高 + local LeftH = Rindro_Image_GlobalMap[Img].GetPng(StartIndex + 3).GetHeight(); + Rindro_Image_GlobalMap[Img].DrawExPng(StartIndex + 3, X, Y + LeftTopH, 0, sq_RGBA(255, 255, 255, 250), 1.0, (Height - LeftTopH * 2).tofloat() / LeftH); + + //绘制中间 + //获取中间的宽高 + local MiddleW = Rindro_Image_GlobalMap[Img].GetPng(StartIndex + 4).GetWidth(); + local MiddleH = Rindro_Image_GlobalMap[Img].GetPng(StartIndex + 4).GetHeight(); + Rindro_Image_GlobalMap[Img].DrawExPng(StartIndex + 4, X + LeftTopW, Y + LeftTopH, 0, sq_RGBA(255, 255, 255, 250), (Width - LeftTopW * 2).tofloat() / MiddleW, (Height - LeftTopH * 2).tofloat() / MiddleH); + + //绘制右边 + Rindro_Image_GlobalMap[Img].DrawExPng(StartIndex + 5, X + Width - LeftTopW, Y + LeftTopH, 0, sq_RGBA(255, 255, 255, 250), 1.0, (Height - LeftTopH * 2).tofloat() / LeftH); + + //绘制左下角 + Rindro_Image_GlobalMap[Img].DrawPng(StartIndex + 6, X, Y + Height - LeftTopH); + + //绘制下边 + Rindro_Image_GlobalMap[Img].DrawExPng(StartIndex + 7, X + LeftTopW, Y + Height - LeftTopH, 0, sq_RGBA(255, 255, 255, 250), (Width - LeftTopW * 2).tofloat() / TopW, 1.0); + + //绘制右下角 + Rindro_Image_GlobalMap[Img].DrawPng(StartIndex + 8, X + Width - LeftTopW, Y + Height - LeftTopH); + } + + +} +//获取文字绘制长度 +class LenheartTextClass { + function GetStringLength(str) { + if (typeof str != "string") str = "无字符"; + return L_sq_GetStringDrawLength(str); + } +} + +class MemoryTool { + //给指定地址写入字节数组 + function WirteByteArr(Address, ByteArr) { + for (local i = 0; i< ByteArr.len(); i++) { + L_sq_WAB(Address + i, ByteArr[i]); + } + } + + + //解密读取内存地址的数据 + function DecodeMemoryData(Address) { + local nEax, nEcx8, nEsi, nEdx, nTmp; + nEax = NativePointer(L_sq_I2P(Address)).readInt(); + if (nEax == -1) return nEax; + nEcx8 = NativePointer(L_sq_I2P(Address + 8)).readInt(); + if (nEcx8 == -1) return nEcx8; + nEsi = NativePointer(L_sq_I2P(0x1AF8D78)).readInt(); + if (nEsi == -1) return nEdx; + nEdx = nEax >> 16; + nTmp = (nEdx << 2) + nEsi + 36; + nEdx = NativePointer(L_sq_I2P(nTmp)).readInt(); + if (nEdx == -1) return nEdx; + nEax = nEax & 65535; + nTmp = (nEax << 2) + nEdx + 8468; + nEax = NativePointer(L_sq_I2P(nTmp)).readInt(); + if (nEax == -1) return nEax; + nEdx = nEax & 0xFFFF; + nEsi = nEdx << 16; + nEsi = nEsi | nEdx; + nEax = nEsi ^ nEcx8; + return nEax; + } + + //加密写入内存地址数据 + function EncodeMemoryData(AddreSs, Data) { + local JEdi, JEcx, JEax, JEsi, JEdx, JSs; + JEcx = AddreSs; + JEax = L_sq_RA(0x1AF8DB8); + JEax = JEax + 1; + L_sq_WA(0x1AF8DB8, JEax); + JEdx = JEax; + JEdx = JEdx >> 8; + JEdx = JEdx << 24; + JEdx = JEdx >> 24; + JEdx = L_sq_RA(JEdx * 2 + 0x1843F58); + JEdx = JEdx & 0xFFFF; + JEax = JEax << 24; + JEax = JEax >> 24; + JSs = L_sq_RA(JEax * 2 + 0x1844158); + JSs = JSs & 0xFFFF; + JEdx = JEdx ^ JSs; + JEax = JEdx; + JEax = JEax & 0xFFFF; + JEsi = Data; + JEdx = JEsi >> 16; + + JSs = JEsi & 0xFFFF; + JEdx = JEdx + JSs; + JEdx = JEdx ^ JEax; + JEdi = JEdx; + JEdx = JEax; + JEax = JEax << 16; + JEax = JEax + JEdx; + JEsi = Data; + JEax = JEax ^ JEsi; + JEsi = AddreSs + 8; + L_sq_WA(JEsi, JEax); + JEax = L_sq_RA(AddreSs); + JEsi = L_sq_RA(0x1AF8D78); + + JEcx = JEdi; + JEcx = JEcx << 16; + JEcx = JEcx + JEdx; + JEdx = JEax; + JEdx = JEdx >> 16; + JEdx = L_sq_RA(JEsi + JEdx * 4 + 36); + JEax = JEax & 0xFFFF; + L_sq_WA(JEdx + JEax * 4 + 8468, JEcx); + } + + function DecodeMemoryDataF(Address) { + local Value = MemoryTool.DecodeMemoryData(Address); + local Bl = blob(); + Bl.writen(Value, 'i'); + Bl.seek(0); + return Bl.readn('f'); + } + + function ReadFloat(Address) { + local Arr = []; + for (local i = 0; i< 4; i++) { + Arr.append(L_sq_RAB(Address + i)); + } + // local Value = L_sq_RAB(Address); + // print(Value); + local Bl = blob(); + foreach(intvalue in Arr) { + Bl.writen(intvalue, 'c'); + } + // Bl.writen(Value, 'i'); + Bl.seek(0); + return Bl.readn('f'); + } +} + +//大数字 +class longlong { + Value = null; + //构造函数 不管是不是string类型都要转成string类型 + constructor(StrValue) { + Value = StrValue.tostring(); + } + + function _add(other) { + return longlong(L_sq_LongLongOperation(this.Value, other.Value, "+")); + } + + function _sub(other) { + return longlong(L_sq_LongLongOperation(this.Value, other.Value, "-")); + } + + function _mul(other) { + return longlong(L_sq_LongLongOperation(this.Value, other.Value, "*")); + } + + function _div(other) { + return L_sq_LongLongOperation(this.Value, other.Value, "/"); + } + + function _unm() { + return longlong(L_sq_LongLongOperation(longlong("0"), this.Value, "-")); + } + + function _modulo(other) { + return longlong(L_sq_LongLongOperation(this.Value, other.Value, "%")); + } + + function GetFormat(FType) { + local Buf = L_sq_LongLongOperation(this.Value, FType, "format"); + if (Buf.len()< 2) return Buf + ".0"; + local Value = Buf.slice(0, -1); + local Unit = Buf.slice(-1); + local RetStr = format(FType + Unit, Value.tofloat()); + return RetStr; + } + +} + + + +//任务队列 +class QuestQueue { + //队列 + Queue = null; + + constructor() { + Queue = {}; + } + + //添加任务 + function AddQuest(QuestName, QuestLogic, ...) { + local args = null; + if (vargc > 0) { + args = []; + for (local i = 0; i< vargc; i++) { + args.append(vargv[i]); + } + } + Queue[QuestName] <- { + Logic = QuestLogic, + InseartTime = Clock(), + arg = args + }; + } + + //移除任务 + function RemoveQuest(QuestName) { + if (Queue) { + Queue.rawdelete(QuestName); + } + } + + //执行任务 + function Run() { + if (Queue) { + local NowTime = Clock(); + foreach(QuestName, QuestInfo in Queue) { + if (QuestInfo.arg && QuestInfo.arg.len() > 0) { + local Arr = []; + Arr.append(getroottable()); + Arr.append(QuestName); + Arr.append(NowTime); + foreach(value in QuestInfo.arg) { + Arr.append(value); + } + QuestInfo.Logic.acall(Arr); + // QuestInfo.Logic(QuestName, NowTime - QuestInfo.InseartTime, QuestInfo.arg); + } else QuestInfo.Logic(QuestName, NowTime - QuestInfo.InseartTime); + } + } + } + + + //示例 + + /* + Obj.AddQuest("测试任务",function (Name,Time) + { + print(Time); + if(Time >= 2000)Obj.RemoveQuest(Name); + }.bindenv(this)); + */ +} \ No newline at end of file diff --git a/CSBase/_Tool/Hacker_Class.nut b/CSBase/_Tool/Hacker_Class.nut new file mode 100644 index 0000000..672c352 --- /dev/null +++ b/CSBase/_Tool/Hacker_Class.nut @@ -0,0 +1,60 @@ +/* +文件名:Hacker_Class.nut +路径:Base/_Tool/Hacker_Class.nut +创建日期:2024-09-24 06:25 +文件用途: +*/ +class _Rindro_Hacker { + HookTable = null; + + constructor() { + HookTable = {}; + } + + function UnLoadHook(AddressStr) { + Sq_DeHookFunc(HookTable[AddressStr]); + } + + function LoadHook(AddressStr, ArgumentArr, EnterFunc, LeaveFunc) { + //如果已经HOOK过 需要先卸载原来的HOOK + if (HookTable.rawin(AddressStr)) { + UnLoadHook(AddressStr); + print("地址: " + AddressStr + " 已经装载了Hook,本次操作将会卸载之前的Hook在执行。") + } + + local Controler = Sq_HookFunc(AddressStr, ArgumentArr, EnterFunc, LeaveFunc); + HookTable.rawset(AddressStr, Controler); + } +} +//初始化Hacker +if (!(getroottable().rawin("Rindro_Haker"))) Rindro_Haker <- _Rindro_Hacker(); + + +//重选角色时触发的回调函数(进入赛利亚房间) +OnSetCharacter_Control <- {} +Rindro_Haker.LoadHook(0x674350, ["pointer", "int"], + function(args) { + foreach(Func in OnSetCharacter_Control) { + Func(); + } + return null; + }, + function(args) { + + return null; + }); + +OnSetCharacter_Control.MarrySystem <- function() { + if (getroottable().rawin("Yosin_14SkillXpos1") && + getroottable().rawin("Yosin_14SkillXpos2") && + getroottable().rawin("Yosin_14SkillYpos1") && + getroottable().rawin("Yosin_14SkillYpos2") + ) { + for (local i = 6; i< 7; i++) { + L_sq_WA(L_sq_RA(L_sq_RA(0x01ADE0CC) + 0x30 + (i * 0x4)) + 0x14, Yosin_14SkillXpos1 + (i * 31)); + L_sq_WA(L_sq_RA(L_sq_RA(0x01ADE0CC) + 0x30 + (i * 0x4)) + 0x18, Yosin_14SkillYpos1); + L_sq_WA(L_sq_RA(L_sq_RA(0x01ADE0CC) + 0x60 + (i * 0x4)) + 0x14, Yosin_14SkillXpos2 + (i * 31)); + L_sq_WA(L_sq_RA(L_sq_RA(0x01ADE0CC) + 0x60 + (i * 0x4)) + 0x18, Yosin_14SkillYpos2); + } + } +}; \ No newline at end of file diff --git a/CSBase/_Tool/Hacker_RegApi.nut b/CSBase/_Tool/Hacker_RegApi.nut new file mode 100644 index 0000000..2b861f5 --- /dev/null +++ b/CSBase/_Tool/Hacker_RegApi.nut @@ -0,0 +1,301 @@ +/* +文件名:Hacker_RegApi.nut +路径:Base/_Tool/Hacker_RegApi.nut +创建日期:2024-09-25 18:31 +文件用途:注册API +*/ +//工具类 +class R_Utils { + + String = { + FindLastSubstring = function(str, substring) { + local strLen = str.len(); + local subLen = substring.len(); + local lastIndex = -1; + for (local i = 0; i <= strLen - subLen; i++) { + local found = true; + for (local j = 0; j< subLen; j++) { + if (str[i + j] != substring[j]) { + found = false; + break; + } + } + if (found) { + lastIndex = i; + } + } + return lastIndex; + } + } + //播放音效 + function PlaySound(SoundName) { + L_Sq_CallFunc(0x75BD70, "void", FFI_MS_CDECL, ["pointer", "int", "int", "int"], Memory.allocUtf8String(SoundName).C_Object, -1, 0, 0); + } + + //读取文件内容 + function ReadScript(Path, Size, CodePage) { + local ReadPath = L_sq_P2I(Memory.allocUtf8String(Path).C_Object); + local Reader = Memory.alloc(Size); + local ReadBuffer = L_sq_P2I(Reader.C_Object); + L_Sq_CallFunc(0x11A2030, "int", FFI_FASTCALL, ["int", "int", "int", "int", "int", "int"], 0x1D17638, 0, ReadPath, ReadBuffer, 0x100000, 0x19DAF4); + + + if (CodePage == "utf8") + return Reader.readUtf8String(); + if (CodePage == "unicode") + return Reader.readUnicodeString(); + if (CodePage == "big5") + return Reader.readBig5String(); + } + + //读取文件 + function GetScriptFileReader(Path, ...) { + local AllocSize = 102400; + if (vargc > 0) AllocSize = vargv[0]; + //读取路径 + local ReadPath = L_sq_P2I(Memory.allocUtf8String(Path).C_Object); + //读取缓存 + local Reader = Memory.alloc(AllocSize); + local ReadBuffer = L_sq_P2I(Reader.C_Object); + //实际读取大小 + local ReadSizeer = Memory.alloc(4); + local ReadSizeBuffer = L_sq_P2I(ReadSizeer.C_Object); + + local Flag = L_Sq_CallFunc(0x59E3D0, "bool", FFI_MS_CDECL, ["int", "int", "int", "int"], ReadPath, ReadBuffer, AllocSize, ReadSizeBuffer); + if (Flag) { + return { + Buffer = Reader, + Size = ReadSizeer.readInt() + }; + } else return null; + } + + //读取配置表 + function ReadScriptConfig(Path, Size, ...) { + local CodePage = "utf8"; + if (vargc > 0) CodePage = vargv[0]; + local Script = R_Utils.ReadScript(Path, Size, CodePage); + local Func = compilestring("return " + Script); + local Ret = Func(); + return Ret; + } + + //获取一个指定装备的角色对象 + function GetCharacByEqu(Job, GrowType, Equ) { + local Obj = sq_CreateCharacter(Job, GrowType); + local ObjAddress = L_Sq_GetObjectAddress(Obj); + foreach(value in Equ) { + local ItemObject = L_sq_GetItem(value); + // L_Sq_CallFunc(0x825570, "void", FFI_THISCALL, ["int", "int"], ObjAddress, ItemObject); + L_Sq_CallFunc(0x8265A0, "void", FFI_THISCALL, ["int", "int", "int"], ObjAddress, ItemObject, -1); + } + return sq_GetCNRDObjectToSQRCharacter(Obj); + } + + //获取装备编号的得文件路径 + function GetEquPath(Equ) { + local EquPathAddress = L_Sq_CallFunc(0x1219E80, "int", FFI_THISCALL, ["int", "int"], 0x1d7993c, Equ); + if (EquPathAddress) { + return NativePointer(EquPathAddress).readUnicodeString(); + } + return null; + } + + //获取Lst文件的返回Array + function GetLstArr(Path, Header) { + local Arr = []; + local LstBuf = R_Utils.GetScriptFileReader(Path); + if (LstBuf) { + local IO = Sq_Point2Blob(L_sq_P2I(LstBuf.Buffer.C_Object), LstBuf.Size); + local i = 2; + while (i< LstBuf.Size) { + if ((LstBuf.Size - i) >= 10) { + IO.seek(i + 6); //内容指示位 + local FindKey = IO.readn('i'); + local Key = Rindro_Script.GetBinString(FindKey); + if (Key) { + local StrFilePath = Header + Key.tolower(); + Arr.append(StrFilePath); + } + } else break; + i += 10; + } + } + return Arr; + } + + //通过处理函数获取文件Table + function GetFileTableByHandle(Path, Func) { + local Data = {}; + local FileData = R_Utils.GetScriptFileReader(Path); + if (FileData) { + if (FileData.Size >= 7) { + //创建Blob对象 + local IO = Sq_Point2Blob(L_sq_P2I(FileData.Buffer.C_Object), FileData.Size); + //以5为单步从第二位开始遍历字节 + local i = 2; + while (true) { + if (i< FileData.Size && FileData.Size - i >= 5) { + i = Func(Data, IO, i); + } else break; + } + } + } + return Data; + } +} + + + + + + +//根据List读取文件地址 +// Rindro_Haker.LoadHook(0x1219E80, ["int", "int", "int"], +// function(args) { +// // print(format("%02x", args[0])); + +// // print(args[2]); +// return null; +// }, +// function(args) { +// // print(666); +// // print(format("%02x", args.pop())); +// // TTTAni <- args.pop(); + + +// // local Path = NativePointer(L_sq_I2P(args.pop())).readUnicodeString(); +// // if (Path != "character/swordman/weapon/katana/kat_lowkogaras.equ" && Path != "new_elvengard.twn") { +// // print(args[0]); +// // print(args[1]); +// // // print(format("%02x", args[1])); +// // print(Path); +// // } +// return null; +// }); + +//可能是构造装备以及构造其他东西 +// Rindro_Haker.LoadHook(0x972220, ["int", "int", "int", "int"], +// function(args) { +// // print(format("%02x", args[0])); +// // local AniPath = NativePointer(L_sq_I2P(args[0])).readUnicodeString(); +// if (args[0] == 10402) { +// print(args[0]); +// print(args[1]); +// print(args[2]); +// } +// // print(args[2]); +// return null; +// }, +// function(args) { +// // print(666); +// // print(format("%02x", args.pop())); +// // TTTAni <- args.pop(); +// return null; +// }); + +//绘制字符 +getroottable().DrawCodeCallBackFunc <- {}; +// Rindro_Haker.LoadHook(0x1206BD0, ["int", "int", "int", "pointer", "int", "void"], +// function(args) { +// // print("nut:" + format("%02x", args[3])); + +// if (args[3]) { +// // for (local i = 0; i< 10000; i++) { +// local DrawCode = NativePointer((args[3])).readUnicodeString(); +// if (DrawCode in DrawCodeCallBackFunc) +// DrawCodeCallBackFunc[DrawCode](args); +// // } +// } +// return null; +// }, +// function(args) { +// // print(666); +// // print(format("%02x", args.pop())); +// // TTTAni <- args.pop(); +// return null; +// }); + + +//绘制城镇回调 +getroottable().DrawTownCallBackFunc <- {}; +Rindro_Haker.LoadHook(0x1108700, ["int", "void"], + function(args) { + // print("nut:" + format("%02x", args[3])); + // print(format("%02x", args[0])); + foreach(Func in DrawTownCallBackFunc) { + Func(); + } + return null; + }, + function(args) { + // print(666); + // print(format("%02x", args.pop())); + // TTTAni <- args.pop(); + return null; + }); + + +//顺图 +function Rindro_Gm_MoveMap(obj) { + if (sq_IsKeyDown(OPTION_HOTKEY_PAUSE_IN_TOWER, ENUM_SUBKEY_TYPE_ALL) && RINDROLOCAL) { + if (KeyPress.isKeyPress(0)) L_sq_MoveMap(2); + if (KeyPress.isKeyPress(1)) L_sq_MoveMap(0); + if (KeyPress.isKeyPress(2)) L_sq_MoveMap(3); + if (KeyPress.isKeyPress(3)) L_sq_MoveMap(1); + } +} +getroottable()["LenheartFuncTab"].rawset("Rindro_Gm_MoveMapFuncN", Rindro_Gm_MoveMap); + + +//丢弃物品回调 +getroottable().DiscardItemCallBackFunc <- {}; + +function Sq_DiscardItem(Item) { + local Flag = true; + foreach(Func in DiscardItemCallBackFunc) { + local Ret = Func(Item); + if (!Ret) Flag = false; + } + return Flag; +} + +//从exe获取字符串 +getroottable()["Sq_GetExeStr_Map"] <- {}; +function Sq_GetExeStr_Event(Index) +{ + if(Index in getroottable()["Sq_GetExeStr_Map"]){ + return getroottable()["Sq_GetExeStr_Map"][Index](Index); + } + return Index; +} + + +// //hook打开窗口 +// Rindro_Haker.LoadHook(0xE6E070, ["int","int","int","int","void"], +// function(args) { + +// return null; +// }, +// function(args) { +// // print(666); +// // print(format("%02x", args.pop())); +// // TTTAni <- args.pop(); +// return null; +// }); + + +// Rindro_Haker.LoadHook(0xE6E070, ["int", "int", "int", "int", "int"], +// function(args) { +// print("nut:" + format("%02x", args[0])); +// print("nut:" + format("%02x", args[1])); +// print("nut:" + format("%02x", args[2])); +// print("nut:" + format("%02x", args[3])); +// return null; +// }, +// function(args) { +// // print(666); +// // print(format("%02x", args.pop())); +// // TTTAni <- args.pop(); +// return null; +// }); \ No newline at end of file diff --git a/CSBase/_Tool/Image_Class.nut b/CSBase/_Tool/Image_Class.nut new file mode 100644 index 0000000..064e40e --- /dev/null +++ b/CSBase/_Tool/Image_Class.nut @@ -0,0 +1,80 @@ +/* +文件名:Image_Class.nut +路径:Base/_Tool/Image_Class.nut +创建日期:2024-10-21 16:58 +文件用途: 图片类 +*/ +class Rindro_Png { + C_Object = null; + Path = null; + Idx = null; + + constructor(Object, Path, Idx) { + this.Path = Path; + this.Idx = Idx; + this.C_Object = Object; + } + + function Draw(X, Y) { + L_Sq_CallFunc(0x11A8F60, "int", FFI_THISCALL, ["int", "int", "int", "int"], NativePointer(0x1B45B94).readInt(), X, Y, this.C_Object); + } + + function DrawEx(X, Y, Model, Rgba, Xrate, Yrate) { + L_Sq_CallFunc(0x11A97E0, "int", FFI_THISCALL, ["int", "int", "int", "int", "float", "float", "float", "int", "float", "float"], NativePointer(0x1B45B94).readInt(), X, Y, this.C_Object, Xrate, Yrate, Model, Rgba, 0, 0); + } + + function GetWidth() + { + return NativePointer(this.C_Object + 0x1C).readShort(); + } + + function GetHeight() + { + return NativePointer(this.C_Object + 0x1E).readShort(); + } +} +class Rindro_Image { + + Img = null; + Path = null; + + constructor(Path) { + this.Path = Path; + //读取Img + Img = L_Sq_CallFunc(0x11C0410, "int", FFI_THISCALL, ["int", "int", "int"], NativePointer(0x1B4684C).readInt(), 0, L_sq_P2I(Memory.allocUtf8String(Path).C_Object)); + } + + function GetPng(Idx) { + if (Img) { + local PngObject = L_Sq_CallFunc(0x11AA190, "int", FFI_THISCALL, ["int", "int"], Img, Idx); + return Rindro_Png(PngObject, Path, Idx); + } + } + + function DrawPng(Idx, X, Y) { + local Buffer = GetPng(Idx); + Buffer.Draw(X, Y); + } + + function DrawExPng(Idx, X, Y, Model, Rgba, Xrate, Yrate) { + local Buffer = GetPng(Idx); + Buffer.DrawEx(X, Y, Model, Rgba, Xrate, Yrate) + } + + //加载 + function Load(Path) { + if (!(getroottable().rawin("Rindro_Image_Map"))) getroottable().Rindro_Image_Map <- {}; + if (getroottable().Rindro_Image_Map.rawin(Path)) return getroottable().Rindro_Image_Map[Path]; + else { + getroottable().Rindro_Image_Map[Path] <- Rindro_Image(Path); + return getroottable().Rindro_Image_Map[Path]; + } + } +} +Rindro_Image_GlobalMap <- {}; +Rindro_Image_GlobalMap["lenheartui"] <- Rindro_Image("interface/lenheartwindowcommon.img"); +/* + local Png = TestImg.GetPng(0); + Png.Draw(200, 200); + Png.DrawEx(100, 400, 0, sq_RGBA(255, 255, 255, 255), 1.5, 1.5); +*/ \ No newline at end of file diff --git a/CSBase/_Tool/Json_Class.nut b/CSBase/_Tool/Json_Class.nut new file mode 100644 index 0000000..681c086 --- /dev/null +++ b/CSBase/_Tool/Json_Class.nut @@ -0,0 +1,661 @@ +/* +文件名:Json_Class.nut +路径:Base/_Tool/Json_Class.nut +创建日期:2024-09-27 23:54 +文件用途:Json类 +*/ + +class JSONParser { + + + static version = "1.0.1"; + + + state = ""; + stack = null; + container = null; + key = ""; + value = ""; + converter = null; + + constructor() { + stack = []; + container = {}; + } + + function parse(str, ...) { + if (vargc > 0) converter = vargc[0]; + + + + local string = { + go = function() { + state = "ok"; + }.bindenv(this), + firstokey = function() { + key = value; + state = "colon"; + }.bindenv(this), + okey = function() { + key = value; + state = "colon"; + }.bindenv(this), + ovalue = function() { + value = this._convert(value, "string", converter); + state = "ocomma"; + }.bindenv(this), + firstavalue = function() { + value = this._convert(value, "string", converter); + state = "acomma"; + }.bindenv(this), + avalue = function() { + value = value; + this._convert(value, "string", converter); + state = "acomma"; + }.bindenv(this) + }; + + + local number = { + go = function() { + state = "ok"; + }.bindenv(this), + ovalue = function() { + value = this._convert(value, "number", converter); + state = "ocomma"; + }.bindenv(this), + firstavalue = function() { + value = this._convert(value, "number", converter); + state = "acomma"; + }.bindenv(this), + avalue = function() { + value = this._convert(value, "number", converter); + state = "acomma"; + }.bindenv(this) + }; + + + + + local action = {}; + + + action["{"] <- { + go = function() { + stack.push({ + state = "ok" + }); + container = {}; + state = "firstokey"; + }.bindenv(this), + ovalue = function() { + stack.push({ + container = container, + state = "ocomma", + key = key + }); + container = {}; + state = "firstokey"; + }.bindenv(this), + firstavalue = function() { + stack.push({ + container = container, + state = "acomma" + }); + container = {}; + state = "firstokey"; + }.bindenv(this), + avalue = function() { + stack.push({ + container = container, + state = "acomma" + }); + container = {}; + state = "firstokey"; + }.bindenv(this) + }, + + action["}"] <- { + firstokey = function() { + local pop = stack.pop(); + value = container; + container = ("container" in pop) ? pop.container : null; + key = ("key" in pop) ? pop.key : null; + state = pop.state; + }.bindenv(this), + ocomma = function() { + local pop = stack.pop(); + container[key] <- value; + value = container; + container = ("container" in pop) ? pop.container : null; + key = ("key" in pop) ? pop.key : null; + state = pop.state; + }.bindenv(this) + }, + + action["["] <- { + go = function() { + stack.push({ + state = "ok" + }); + container = []; + state = "firstavalue"; + }.bindenv(this), + ovalue = function() { + stack.push({ + container = container, + state = "ocomma", + key = key + }); + container = []; + state = "firstavalue"; + }.bindenv(this), + firstavalue = function() { + stack.push({ + container = container, + state = "acomma" + }); + container = []; + state = "firstavalue"; + }.bindenv(this), + avalue = function() { + stack.push({ + container = container, + state = "acomma" + }); + container = []; + state = "firstavalue"; + }.bindenv(this) + }, + + action["]"] <- { + firstavalue = function() { + local pop = stack.pop(); + value = container; + container = ("container" in pop) ? pop.container : null; + key = ("key" in pop) ? pop.key : null; + state = pop.state; + }.bindenv(this), + acomma = function() { + local pop = stack.pop(); + container.push(value); + value = container; + container = ("container" in pop) ? pop.container : null; + key = ("key" in pop) ? pop.key : null; + state = pop.state; + }.bindenv(this) + }, + + action[":"] <- { + colon = function() { + + + + local err = false; + foreach(akey, avalue in container) { + if (akey == key) err = true; + break + } + if (err) throw "Duplicate key \"" + key + "\""; + state = "ovalue"; + }.bindenv(this) + }, + + action[","] <- { + ocomma = function() { + container[key] <- value; + state = "okey"; + }.bindenv(this), + acomma = function() { + container.push(value); + state = "avalue"; + }.bindenv(this) + }, + + action["true"] <- { + go = function() { + value = true; + state = "ok"; + }.bindenv(this), + ovalue = function() { + value = true; + state = "ocomma"; + }.bindenv(this), + firstavalue = function() { + value = true; + state = "acomma"; + }.bindenv(this), + avalue = function() { + value = true; + state = "acomma"; + }.bindenv(this) + }, + + action["false"] <- { + go = function() { + value = false; + state = "ok"; + }.bindenv(this), + ovalue = function() { + value = false; + state = "ocomma"; + }.bindenv(this), + firstavalue = function() { + value = false; + state = "acomma"; + }.bindenv(this), + avalue = function() { + value = false; + state = "acomma"; + }.bindenv(this) + }, + + action["null"] <- { + go = function() { + value = null; + state = "ok"; + }.bindenv(this), + ovalue = function() { + value = null; + state = "ocomma"; + }.bindenv(this), + firstavalue = function() { + value = null; + state = "acomma"; + }.bindenv(this), + avalue = function() { + value = null; + state = "acomma"; + }.bindenv(this) + } + + + + + state = "go"; + stack = []; + + + local start = 0; + + try { + + local result, token, tokenizer = _JSONTokenizer(); + + while (token = tokenizer.nextToken(str, start)) { + + if ("ptfn" == token.type) { + + action[token.value][state](); + } else if ("number" == token.type) { + + value = token.value; + number[state](); + } else if ("string" == token.type) { + + value = tokenizer.unescape(token.value); + string[state](); + } + + start += token.length; + } + + } catch (e) { + state = e; + } + + + if (state != "ok" || regexp("[^\\s]").capture(str, start)) { + local near = str.slice(start, GetMin(str.len(), start + 10)); + throw "JSON Syntax Error near `" + near + "`"; + } + + + return value; + } + + function GetMin(a, b) { + return a< b ? a : b; + } + + + function _convert(value, type, converter) { + if ("function" == typeof converter) { + + + + local parametercCount = 2; + + + if ("getinfos" in converter) { + parametercCount = converter.getinfos().parameters.len() - + 1; + } + + if (parametercCount == 1) { + return converter(value); + } else if (parametercCount == 2) { + return converter(value, type); + } else { + throw "Error: converter function must take 1 or 2 parameters" + } + + } else if ("number" == type) { + local Ret = (value.find(".") == null && value.find("e") == null && value.find("E") == null) ? value.tointeger() : value.tofloat(); + return Ret; + } else { + return value; + } + + } +} + + + +class _JSONTokenizer { + + _ptfnRegex = null; + _numberRegex = null; + _stringRegex = null; + _ltrimRegex = null; + _unescapeRegex = null; + + constructor() { + + this._ptfnRegex = regexp("^(?:\\,|\\:|\\[|\\]|\\{|\\}|true|false|null)"); + + + this._numberRegex = regexp("^(?:\\-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)"); + + + this._stringRegex = regexp("^(?:\\\"((?:[^\\r\\n\\t\\\\\\\"]|\\\\(?:[\"\\\\\\/trnfb]|u[0-9a-fA-F]{4}))*)\\\")"); + + + this._ltrimRegex = regexp("^[\\s\\t\\n\\r]*"); + + + this._unescapeRegex = regexp("\\\\(?:(?:u\\d{4})|[\\\"\\\\/bfnrt])"); + } + + + function nextToken(str, ...) { + local start = 0; + if (vargc > 0) start = vargv[0]; + local + m, + type, + token, + value, + length, + whitespaces; + + + whitespaces = this._leadingWhitespaces(str, start); + start += whitespaces; + + if (m = this._ptfnRegex.capture(str, start)) { + + value = str.slice(m[0].begin, m[0].end); + type = "ptfn"; + } else if (m = this._numberRegex.capture(str, start)) { + + value = str.slice(m[0].begin, m[0].end); + type = "number"; + } else if (m = this._stringRegex.capture(str, start)) { + + value = str.slice(m[1].begin, m[1].end); + type = "string"; + } else { + return null; + } + + token = { + type = type, + value = value, + length = m[0].end - m[0].begin + whitespaces + }; + + return token; + } + + + function _leadingWhitespaces(str, start) { + local r = this._ltrimRegex.capture(str, start); + + if (r) { + return r[0].end - r[0].begin; + } else { + return 0; + } + } + + + _unescapeReplacements = { + b = "\b", + f = "\f", + n = "\n", + r = "\r", + t = "\t" + }; + + function unescape(str) { + + local start = 0; + local res = ""; + + while (start< str.len()) { + local m = this._unescapeRegex.capture(str, start); + + if (m) { + local token = str.slice(m[0].begin, m[0].end); + + + local pre = str.slice(start, m[0].begin); + res += pre; + + if (token.len() == 6) { + res += token; + } else { + local char = token.slice(1); + + if (char in this._unescapeReplacements) { + res += this._unescapeReplacements[char]; + } else { + res += char; + } + } + + } else { + res += str.slice(start); + break; + } + + start = m[0].end; + } + + return res; + } +} + + +class JSONEncoder { + + static VERSION = "2.0.0"; + + + + static _maxDepth = 32; + + + function encode(value) { + return this._encode(value); + } + + + function _encode(val, ...) { + local depth = 0; + if (vargc > 0) depth = vargv[0]; + + if (depth > this._maxDepth) { + throw "Possible cyclic reference"; + } + + local + r = "", + s = "", + i = 0; + + switch (typeof val) { + + case "table": + case "class": + s = ""; + + + foreach(k, v in val) { + if (typeof v != "function") { + s += ",\"" + k + "\":" + this._encode(v, depth + 1); + } + } + + s = s.len() > 0 ? s.slice(1) : s; + r += "{" + s + "}"; + break; + + case "array": + s = ""; + + for (i = 0; i< val.len(); i++) { + s += "," + this._encode(val[i], depth + 1); + } + + s = (i > 0) ? s.slice(1) : s; + r += "[" + s + "]"; + break; + + case "integer": + case "float": + case "bool": + r += val; + break; + + case "null": + r += "null"; + break; + + case "instance": + + if ("_serializeRaw" in val && typeof val._serializeRaw == "function") { + + + r += val._serializeRaw().tostring(); + + } else if ("_serialize" in val && typeof val._serialize == "function") { + + + r += this._encode(val._serialize(), depth + 1); + + } else { + + s = ""; + + try { + + + foreach(k, v in val) { + s += ",\"" + k + "\":" + this._encode(v, depth + 1); + } + + } catch (e) { + + + + foreach(k, v in val.getclass()) { + if (typeof v != "function") { + s += ",\"" + k + "\":" + this._encode(val[k], depth + 1); + } + } + + } + + s = s.len() > 0 ? s.slice(1) : s; + r += "{" + s + "}"; + } + + break; + + case "blob": + + + + r += "\"" + (val.len() ? this._escape(val.tostring()) : "") + "\""; + break; + + + default: + r += "\"" + this._escape(val.tostring()) + "\""; + break; + } + + return r; + } + + function _escape(str) { + local res = ""; + + for (local i = 0; i< str.len(); i++) { + + local ch1 = (str[i] & 0xFF); + + if ((ch1 & 0x80) == 0x00) { + + + ch1 = format("%c", ch1); + + if (ch1 == "\"") { + res += "\\\""; + } else if (ch1 == "\\") { + res += "\\\\"; + } else if (ch1 == "/") { + res += "\\/"; + } else if (ch1 == "\b") { + res += "\\b"; + } else if (ch1 == "\f") { + res += "\\f"; + } else if (ch1 == "\n") { + res += "\\n"; + } else if (ch1 == "\r") { + res += "\\r"; + } else if (ch1 == "\t") { + res += "\\t"; + } else if (ch1 == "\0") { + res += "\\u0000"; + } else { + res += ch1; + } + + } else { + + if ((ch1 & 0xE0) == 0xC0) { + + local ch2 = (str[++i] & 0xFF); + res += format("%c%c", ch1, ch2); + } else if ((ch1 & 0xF0) == 0xE0) { + + local ch2 = (str[++i] & 0xFF); + local ch3 = (str[++i] & 0xFF); + res += format("%c%c%c", ch1, ch2, ch3); + } else if ((ch1 & 0xF8) == 0xF0) { + + local ch2 = (str[++i] & 0xFF); + local ch3 = (str[++i] & 0xFF); + local ch4 = (str[++i] & 0xFF); + res += format("%c%c%c%c", ch1, ch2, ch3, ch4); + } + + } + } + + return res; + } +} \ No newline at end of file diff --git a/CSBase/_Tool/MemoryClass.nut b/CSBase/_Tool/MemoryClass.nut new file mode 100644 index 0000000..9e4bef3 --- /dev/null +++ b/CSBase/_Tool/MemoryClass.nut @@ -0,0 +1,204 @@ +/* +文件名:MemoryClass.nut +路径:Base/_Tool/MemoryClass.nut +创建日期:2024-09-24 08:22 +文件用途: +*/ + +class Memory { + + function alloc(Size) { + return NativePointer(Size.tostring()); + } + + function allocUtf8String(Str) { + return NativePointer(Str_Ptr(Str)); + } +} + +class NativePointer { + //大小 + Size = -1; + + C_Object = null; + + constructor(T) { + if (type(T) == "integer") { + C_Object = L_sq_I2P(T); + } else if (type(T) == "userdata") { + C_Object = T; + } else if (type(T) == "string") { + C_Object = Sq_New_Point(T.tointeger()); + Size = T; + //注册销毁伪析构 + Register_Destruction(C_Object, this); + } + } + + function add(intoffset) { + return NativePointer(L_sq_I2P(L_sq_P2I(this.C_Object) + intoffset)); + } + + function sub(intoffset) { + return NativePointer(L_sq_I2P(L_sq_P2I(this.C_Object) - intoffset)); + } + + function writeByteArray(arr) { + Sq_Memory_WriteByteArr(this.C_Object, arr); + } + + function readByteArray(size) { + local PointB = Sq_Point2Blob(this.C_Object, size); + local arr = []; + foreach(value in PointB) { + arr.append(value); + } + return arr; + } + + + function write(value, type) { + local Buf = blob(0); + Buf.writen(value, type); + local arr = []; + foreach(value in Buf) { + arr.append(value); + } + writeByteArray(arr); + } + + function writeS8(value) { + write(value, 'c'); + } + + function writeU8(value) { + write(value, 'b'); + } + + function writeS16(value) { + write(value, 's'); + } + + function writeU16(value) { + write(value, 'w'); + } + + function writeS32(value) { + write(value, 'i'); + } + + function writeU32(value) { + write(value, 'i'); + } + + function writeShort(value) { + write(value, 's'); + } + + function writeUShort(value) { + write(value, 'w'); + } + + function writeInt(value) { + write(value, 'i'); + } + + function writeUInt(value) { + write(value, 'i'); + } + + function writeFloat(value) { + write(value, 'f'); + } + + function writeDouble(value) { + write(value, 'd'); + } + + + function read(type) { + local Buf = Sq_Point2Blob(L_sq_P2I(this.C_Object), 4); + return Buf.readn(type); + } + + function readS8() { + return read('c'); + } + + function readU8() { + return read('b'); + } + + function readS16() { + return read('s'); + } + + function readU16() { + return read('w'); + } + + function readS32() { + return read('i'); + } + + function readU32() { + return read('i'); + } + + function readShort() { + return read('s'); + } + + function readUShort() { + return read('w'); + } + + function readInt() { + return read('i'); + } + + function readUInt() { + return read('i'); + } + + function readFloat() { + return read('f'); + } + + function readDouble() { + return read('d'); + } + + + function readUnicodeString(...) { + if (vargc > 0) { + return Sq_Memory_ReadString(this.C_Object, vargv[0]); + } else { + return Sq_Memory_ReadString(this.C_Object); + } + } + + function readUtf8String(...) { + if (vargc > 0) { + return Sq_Memory_ReadStringByUtf8(this.C_Object, vargv[0]); + } else { + return Sq_Memory_ReadStringByUtf8(this.C_Object); + } + } + + function readBig5String(...) { + if (vargc > 0) { + return Sq_Memory_ReadStringByBig5(this.C_Object, vargv[0]); + } else { + return Sq_Memory_ReadStringByBig5(this.C_Object); + } + } + + function readPointer() { + return Sq_ReadPoint(this.C_Object); + } + + function tostring() { + return this.C_Object.tostring(); + } +} \ No newline at end of file diff --git a/CSBase/_Tool/Packet_Class.nut b/CSBase/_Tool/Packet_Class.nut new file mode 100644 index 0000000..61c4b47 --- /dev/null +++ b/CSBase/_Tool/Packet_Class.nut @@ -0,0 +1,61 @@ +/* +文件名:Pack_Class.nut +路径:Base/_Tool/Pack_Class.nut +创建日期:2025-06-30 09:24 +文件用途:字节包 +*/ +class Packet { + + //读取指针位置 + Index = 0; + + //内存数据 + Pointer = null; + //包大小 + Size = 0; + + + //加载包 + function Load(P, S) { + Pointer = P; + Size = S; + } + + //读取指针跳转 + function Seek(...) { + local Pos = vargv[0]; + local Mode = 0; + if(vargc > 1) Mode = vargv[1]; + if (Mode == 0) { + Index = Pos; + } else if (Mode == 1) { + Index += Pos; + } else if (Mode == 2) { + Index -= Pos; + } + } + + //读取整形 + function GetInt() { + local Size_t = 4; + if (Index + Size_t > Size) { + print("读取包越界!"); + return; + } + local Buf = NativePointer(Pointer).add(Index).readInt(); + Index += Size_t; + return Buf; + } + + //读取流 + function GetStream(Size_t) { + if (Index + Size_t > Size) { + print("读取包越界!"); + return; + } + local Np = NativePointer(Pointer).add(Index); + Np.Size = Size_t; + Index += Size_t; + return Np; + } +} diff --git a/CSBase/_Tool/Script_Class.nut b/CSBase/_Tool/Script_Class.nut new file mode 100644 index 0000000..41704de --- /dev/null +++ b/CSBase/_Tool/Script_Class.nut @@ -0,0 +1,713 @@ +/* +文件名:Script_Class.nut +路径:Base/_Tool/Script_Class.nut +创建日期:2024-10-21 14:49 +文件用途:PVF读取类 +*/ +class BlobEx extends blob { + + constructor(BaseBlob) { + blob.constructor(BaseBlob.len()); + writeblob(BaseBlob); + } + + function writeblob(B) { + blob.writeblob(B); + seek(0); + } + + function GetUShort() { + return readn('s'); + } + + function GetShort() { + return readn('w'); + } + + function charPtrToInt(arr) { + local value = ((arr[0]) << 0) | + ((arr[1]) << 8) | + ((arr[2]) << 16) | + ((arr[3]) << 24); + return value; + } + + function GetInt() { + local CurTPos = tell(); + local Ret = charPtrToInt([this[CurTPos], this[CurTPos + 1], this[CurTPos + 2], this[CurTPos + 3]]); + seek(4, 'c'); + return Ret; + } + + function Get256() { + local Buf = readn('c'); + return (256.0 + Buf.tofloat()) % 256.0; + } + + function GetFloat() { + return readn('f'); + } + + function GetString(count) { + local MBuf = Memory.alloc(count); + local BlobBuf = readblob(count); + local arr = []; + foreach(value in BlobBuf) { + arr.append(value); + } + MBuf.writeByteArray(arr); + + return MBuf.readUtf8String(count); + } +} + +Rindro_Script_Bin_Data <- []; + +class _PVF_Data_ { + //数据 + Data = null; + //位置 + Pos = 0; + //最大值 + Max = 0; + + function _typeof() { + return "pvf_data"; + } + + constructor(gData) { + Data = gData; + Max = gData.len(); + } + + function Last() { + if (Pos > 0) { + Pos--; + return Get(); + } + return null; + } + + function Seek(i) { + if (Pos > 0 && Pos<(Max - 1)) { + Pos = i; + } + } + + function Get() { + local Ret = Data[Pos]; + if (Pos<(Max - 1)) { + Pos++; + } + return Ret; + } + + function Eof() { + if (Pos == Max - 1) + return true; + } + + function Next() { + if (Pos<(Max - 1)) { + Pos++; + return Get(); + } + return null; + } +} + +class Rindro_Script { + + function Get_Ani_Flip_Type(data) { + switch (data) { + case 1: + return "HORIZON"; + case 2: + return "VERTICAL"; + case 3: + return "ALL"; + default: + return ""; + } + } + + + function Get_Ani_Effect_Type(data) { + switch (data) { + case 0: + return "NONE"; + case 1: + return "DODGE"; + case 2: + return "LINEARDODGE"; + case 3: + return "DARK"; + case 4: + return "XOR"; + case 5: + return "MONOCHROME"; + case 6: + return "SPACEDISTORT"; + default: + return ""; + } + } + + function Get_Ani_Damage_Type(data) { + switch (data) { + case 0: + return "NORMAL"; + case 1: + return "SUPERARMOR"; + case 2: + return "UNBREAKABLE"; + default: + return ""; + } + } + + function Get_Ani_Flag(data) { + switch (data) { + case 0: + return "LOOP"; + case 1: + return "SHADOW"; + case 3: + return "COORD"; + case 7: + return "IMAGE_RATE"; + case 8: + return "IMAGE_ROTATE"; + case 9: + return "RGBA"; + case 10: + return "INTERPOLATION"; + case 11: + return "GRAPHIC_EFFECT"; + case 12: + return "DELAY"; + case 13: + return "DAMAGE_TYPE"; + case 14: + return "DAMAGE_BOX"; + case 15: + return "ATTACK_BOX"; + case 16: + return "PLAY_SOUND"; + case 17: + return "PRELOAD"; + case 18: + return "SPECTRUM"; + case 23: + return "SET_FLAG"; + case 24: + return "FLIP_TYPE"; + case 25: + return "LOOP_START"; + case 26: + return "LOOP_END"; + case 27: + return "CLIP"; + case 28: + return "OPERATION"; + default: + return ""; + } + } + + + function endswith(Str, cmp) { + local len = cmp.len(); + local EndStr = Str.slice(-len); + if (EndStr == cmp) + return true; + return false; + + } + + function InitLoad_String() { + if (getroottable().rawin("RindroLoadStringTable")) return; + getroottable().RindroLoadStringTable <- {}; + local N_String = R_Utils.GetScriptFileReader("n_string.lst"); + if (N_String) { + local IO = Sq_Point2Blob(L_sq_P2I(N_String.Buffer.C_Object), N_String.Size); + local i = 2; + while (i< N_String.Size) { + if ((N_String.Size - i) >= 10) { + IO.seek(i + 6); //内容指示位 + local FindKey = IO.readn('i'); + local Key = Rindro_Script.GetBinString(FindKey); + if (Key) { + local StrFilePath = Key.tolower(); + local StrFile = R_Utils.GetScriptFileReader(StrFilePath, 10240000); + if (StrFile) { + local StrBuffer = StrFile.Buffer.readUtf8String(StrFile.Size); + local StrArr = split(StrBuffer, "\r\n"); + foreach(index, strobj in StrArr) { + if (strobj.find(">") != null) { + local strobjarr = split(strobj, ">"); + if (strobjarr.len() > 1) { + getroottable().RindroLoadStringTable.rawset(strobjarr[0], Sq_ConvertWideChar(strobjarr[1], "big5")); + } + } + } + } + } + } else break; + i += 10; + } + } + } + + function GetBin() { + local BinFile = R_Utils.GetScriptFileReader("stringtable.bin", 40960000); + if (BinFile) { + local Ro = Sq_Point2Blob(L_sq_P2I(BinFile.Buffer.C_Object), BinFile.Size); + Ro = BlobEx(Ro.readblob(Ro.len())); + local Count = Ro.readn('i'); + + local CurrentIndex = 0; + for (local i = 0; i< Count; i++) { + Ro.seek(CurrentIndex * 4 + 4); + local StartPos = Ro.readn('i'); + local EndPos = Ro.readn('i'); + local Len = EndPos - StartPos; + Ro.seek(StartPos + 4); + if (Len > 0) { + local Str = Ro.GetString(Len); + Rindro_Script_Bin_Data.append(Str); + } else { + Rindro_Script_Bin_Data.append(""); + } + CurrentIndex++; + } + } + } + + function GetBinString(Index) { + if (!(getroottable().rawin("ENUM_TW_GROWTYPE_VERS")) || ENUM_TW_GROWTYPE_VERS >= 24112901) //24112901更新了新的读取bin文件的方式 + return L_sq_StringBinById(Index); + else { + if (Index< Rindro_Script_Bin_Data.len()) return Rindro_Script_Bin_Data[Index]; + return ""; + } + } + + function GetLoadString(Key) { + if (getroottable().RindroLoadStringTable.rawin(Key)) return getroottable().RindroLoadStringTable[Key]; + else return ""; + } + + function UnpackData(IO, i) { + local out = ""; + IO.seek(i); //内容指示位 + local currentByte = IO.readn('c'); //内容指示位 + local after = IO.GetInt(); + switch (currentByte) { + case 10: { + IO.seek(i - 4); + local Before = IO.readn('i'); + local Buf = Rindro_Script.GetBinString(after); + if (!Buf) { + Buf = ""; + } else { + Buf = "<" + Before + "::" + Buf + "`" + Rindro_Script.GetLoadString(Buf) + "`>"; + } + Buf = Buf + "\r\n"; + out += Buf; + break; + } + case 2: { + IO.seek(-4, 'c'); + local ret = IO.readn('i'); + return ret; + } + case 4: { + local Bbuf = blob(4); + Bbuf.writen(after, 'i'); + Bbuf.seek(0); + local Buf = Bbuf.readn('f'); + out += after + '\t'; + break; + } + case 6: + case 8: + case 7: + case 5: { + local Buf = Rindro_Script.GetBinString(after); + if (!Buf) Buf = ""; + return Buf; + } + case 9: { + IO.seek(i + 6); + local Before = IO.readn('i'); + local Buf = Rindro_Script.GetBinString(Before); + out += Rindro_Script.GetLoadString(Buf); + } + default: + out += ""; + break; + } + + return out; + } + + + function ReadEquipment(ReadObject) { + local EquipmentAtt = {}; + if (ReadObject.Size >= 7) { + //创建Blob对象 + local IOBUF = Sq_Point2Blob(L_sq_P2I(ReadObject.Buffer.C_Object), ReadObject.Size); + local IO = BlobEx(IOBUF.readblob(IOBUF.len())); + //以5为单步从第二位开始遍历字节 + local i = 2; + while (true) { + if (i< ReadObject.Size && ReadObject.Size - i >= 5) { + local str = Rindro_Script.UnpackData(IO, i); + i += 5; + + //名称 + if (str == "[name]") { + local RealKey = str.slice(1, str.len() - 1); + EquipmentAtt[RealKey] <- Rindro_Script.UnpackData(IO, i); + i += 5; + } + //装备类型 + else if (str == "[equipment type]") { + local Buf = Rindro_Script.UnpackData(IO, i); + EquipmentAtt["equipment_type"] <- Buf.slice(1, -1); + i += 5; + } + //称号动画 + else if (str == "[custom animation]") { + local Buf = Rindro_Script.UnpackData(IO, i).tolower(); + EquipmentAtt["custom_animation"] <- Buf; + i += 5; + } + //光环生成效果 + else if (str == "[aurora graphic effects]") { + EquipmentAtt["Aurora"] <- {}; + EquipmentAtt["Aurora"].Back <- []; + EquipmentAtt["Aurora"].Front <- []; + local Count = Rindro_Script.UnpackData(IO, i); + i += 5; + for (local z = 0; z< Count; z++) { + local Layer = Rindro_Script.UnpackData(IO, i); + i += 5; + local Path = Rindro_Script.UnpackData(IO, i).tolower(); + i += 5; + if (Layer == 0) EquipmentAtt["Aurora"].Back.append(Path); + if (Layer == 1) EquipmentAtt["Aurora"].Front.append(Path); + } + i += 5; + } + //隐藏图层 + else if (str == "[hide layer]") { + EquipmentAtt["hidelayer"] <- []; + while (true) { + local Buffer = Rindro_Script.UnpackData(IO, i); + i += 5; + if (Buffer == "[/hide layer]") { + break; + } + EquipmentAtt["hidelayer"].append(Buffer); + } + } + //Ani + else if (str == "[animation job]") { + local Job = Rindro_Script.UnpackData(IO, i).slice(1, -1); + local SpacePos = Job.find(" "); + if (SpacePos) { + Job = Job.slice(0, SpacePos) + Job.slice(SpacePos + 1); + } + i += 5; + EquipmentAtt["Ani_" + Job] <- {}; + i += 5; + + local Index1 = Rindro_Script.UnpackData(IO, i); + i += 5; + local Index2 = Rindro_Script.UnpackData(IO, i); + i += 5; + EquipmentAtt["Ani_" + Job].variation <- [Index1, Index2]; + EquipmentAtt["Ani_" + Job].layer_variation <- []; + while (true) { + try { + local Ret = Rindro_Script.UnpackData(IO, i); + i += 5; + if (Ret == "[animation job]" || (Rindro_Script.endswith(Ret, "]") && Ret != "[equipment ani script]" && Ret != "[layer variation]")) { + i -= 5; + break; + } else if (Ret == "[layer variation]") { + local InfoBuf = {}; + InfoBuf.Zorder <- Rindro_Script.UnpackData(IO, i); + i += 5; + InfoBuf.Path <- Rindro_Script.UnpackData(IO, i); + i += 5; + EquipmentAtt["Ani_" + Job].layer_variation.append(InfoBuf); + } + } catch (exception) { + break; + } + } + } + } else break; + } + } + return EquipmentAtt; + } + + + function ReadAnimation(ReadObject) { + local Ro = Sq_Point2Blob(L_sq_P2I(ReadObject.Buffer.C_Object), ReadObject.Size); + Ro = BlobEx(Ro.readblob(Ro.len())); + local AniObject = { + Img_List = [], + Frame = [], + Flag = {} + }; + + local Frame_Max = Ro.readn('s'); + local Img_Count = Ro.readn('s'); + + //Img的路径读取 存入数组 + for (local index = 0; index< Img_Count; index++) { + local Buf = Ro.readn('i'); + local ImgPath = Ro.GetString(Buf); + //有可能Img有空路径 + AniObject.Img_List.append(ImgPath); + } + //Ani头部标签数量 + local Ani_H_Item_Count = Ro.readn('s'); + + //处理标签 + for (local index = 0; index< Ani_H_Item_Count; index++) { + //标签类型 + local Type = Ro.readn('s'); + + switch (Type) { + case 0: + case 1: { + local Key = Rindro_Script.Get_Ani_Flag(Type); + local Value = Ro.readn('c'); + AniObject.Flag.rawset(Key, Value); + break; + } + case 3: + case 28: { + local Key = Rindro_Script.Get_Ani_Flag(Type); + local Value = Ro.readn('s'); + AniObject.Flag.rawset(Key, Value); + break; + } + case 18: + // print("残影解析"); + //此处无解析 暂时先保证运行 残影功能暂时用不上 + Ro.readn('c'); + Ro.readn('i'); + Ro.readn('i'); + Ro.readn('i'); + Ro.Get256(); + Ro.Get256(); + Ro.Get256(); + Ro.Get256(); + Ro.readn('s'); + break; + default: + break; + } + } + + //读取每一个Img + for (local index = 0; index< Frame_Max; index++) { + //帧结构体对象 + local FrameObject = { + AttackBox = [], + DamageBox = [], + Flag = {}, + }; + + //碰撞框项目数量 + local Ani_Box_Item_Count = Ro.readn('s'); + for (local _i = 0; _i< Ani_Box_Item_Count; _i++) { + local Box_Type = Ro.readn('s'); + local D_Box_b = []; + for (local _k = 0; _k< 6; _k++) { + D_Box_b.append(Ro.readn('i')); + } + if (Box_Type == 15) { + FrameObject.AttackBox.append(D_Box_b); + } else { + FrameObject.DamageBox.append(D_Box_b); + } + // //0是攻击框 1是受击框 + // FrameObject.Box.rawset(15 - Box_Type, D_Box_b); + } + + //调用的第几个Img + local Index_Buf = Ro.GetShort(); + //如果等于-1说明是img路径为空 + if (Index_Buf != 65535) { + FrameObject.Img_Path <- AniObject.Img_List[Index_Buf].tolower(); + //Img中的PNG下标 + FrameObject.Img_Index <- Ro.readn('s'); + } else { + FrameObject.Img_Path <- ""; + FrameObject.Img_Index <- 0; + } + + //坐标 + FrameObject.Pos <- { + x = Ro.readn('i'), + y = Ro.readn('i'), + }; + + //Img中的项目数量 + local Img_Flag_Count = Ro.readn('s'); + for (local _o = 0; _o< Img_Flag_Count; _o++) { + local Img_Flag_Type = Ro.readn('s'); + local Key; + local Value; + switch (Img_Flag_Type) { + case 0: + case 1: + case 10: + Key = Rindro_Script.Get_Ani_Flag(Img_Flag_Type); + Value = Ro.readn('c'); + FrameObject.Flag.rawset(Key, Value); + break; + case 3: + Key = "COORD"; + Value = Ro.readn('s'); + FrameObject.Flag.rawset(Key, Value); + break; + case 17: + Key = "PRELOAD"; + Value = 1; + FrameObject.Flag.rawset(Key, Value); + break; + case 7: + Key = "IMAGE_RATE"; + Value = { + x = Ro.GetFloat(), + y = Ro.GetFloat() + }; + FrameObject.Flag.rawset(Key, Value); + break; + case 8: + Key = "IMAGE_ROTATE"; + Value = Ro.GetFloat(); + FrameObject.Flag.rawset(Key, Value); + break; + case 9: + Key = "RGBA"; + Value = [ + Ro.Get256(), + Ro.Get256(), + Ro.Get256(), + Ro.Get256(), + ]; + FrameObject.Flag.rawset(Key, Value); + break; + case 11: + local Effect_Type = Ro.readn('s'); + Key = "GRAPHIC_EFFECT_" + Rindro_Script.Get_Ani_Effect_Type(Effect_Type); + switch (Effect_Type) { + case 5: + Value = [Ro.Get256(), Ro.Get256(), Ro.Get256()]; + break; + case 6: + Value = [Ro.GetShort(), Ro.GetShort()]; + break; + } + FrameObject.Flag.rawset(Key, Value); + break; + case 12: + Value = Ro.readn('i'); + FrameObject.Delay <- Value; + break; + case 13: + Key = "DAMAGE_TYPE"; + Value = Rindro_Script.Get_Ani_Damage_Type(Ro.readn('s')); + FrameObject.Flag.rawset(Key, Value); + break; + case 16: + local SoundTempSize = Ro.readn('i'); + Key = "PLAY_SOUND"; + Value = Ro.GetString(SoundTempSize); + FrameObject.Flag.rawset(Key, Value); + break; + case 23: + Key = "SET_FLAG"; + Value = Ro.readn('i'); + FrameObject.Flag.rawset(Key, Value); + break; + case 24: + Key = "FLIP_TYPE"; + Value = Rindro_Script.Get_Ani_Flip_Type(Ro.readn('s')); + FrameObject.Flag.rawset(Key, Value); + break; + case 25: + Key = "LOOP_START"; + FrameObject.Flag.rawset(Key, 1); + break; + case 26: + Key = "LOOP_END"; + Value = Ro.readn('i'); + FrameObject.Flag.rawset(Key, Value); + break; + case 27: + Key = "CLIP"; + Value = [ + Ro.GetShort(), + Ro.GetShort(), + Ro.GetShort(), + Ro.GetShort(), + ]; + FrameObject.Flag.rawset(Key, Value); + break; + default: + break; + } + } + + //每一帧都是一个结构体 存入数组中 + AniObject.Frame.append(FrameObject); + } + return AniObject; + } + + //获取文件并处理 + function GetFileData(Path, Func) { + local N_Buffer = R_Utils.GetScriptFileReader(Path); + if (N_Buffer) { + local IO = Sq_Point2Blob(L_sq_P2I(N_Buffer.Buffer.C_Object), N_Buffer.Size); + IO = BlobEx(IO.readblob(IO.len())); + return Rindro_Script.ResolvingData(IO, Func, Path); + } else { + print(Path + "找不到文件!"); + return null; + } + } + + function ResolvingData(IO, Func, Path) { + local DataTable = {}; + DataTable.filepath <- Path; + local DataArr = []; + local Length = IO.len(); + if (Length >= 7) { + local i = 2; + while (true) { + if (i< Length && Length - i >= 5) { + local str = Rindro_Script.UnpackData(IO, i); + i += 5; + DataArr.push(str); + } else break; + } + Func(DataTable, _PVF_Data_(DataArr)); + return DataTable; + } + return null; + } +} +// Rindro_Script.GetBin(); +Rindro_Script.InitLoad_String(); \ No newline at end of file diff --git a/CSBase/_Z_Data/CharacterInfoData.nut b/CSBase/_Z_Data/CharacterInfoData.nut new file mode 100644 index 0000000..8571a01 --- /dev/null +++ b/CSBase/_Z_Data/CharacterInfoData.nut @@ -0,0 +1,113 @@ +/* +文件名:CharacterInfoData.nut +路径:Base/_Z_Data/CharacterInfoData.nut +创建日期:2024-09-03 11:34 +文件用途:角色信息数据 +*/ + +//读取属性数据 +function Lenheart_Character_GetAttribute(Address) { + //传入读传入不传读自己 + local ObjectAddress = Address; + if (ObjectAddress == null) + ObjectAddress = L_sq_RA(0x1AB7CDC); + if (!ObjectAddress) return; + + local Info = {}; + //当前HP + Info.CurHp <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x2BEC); + //总HP + Info.MaxHp <- L_sq_RA(ObjectAddress + 0x36A0); + //当前MP + Info.CurMp <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x2BF8); + //总MP + Info.MaxMp <- L_sq_RA(ObjectAddress + 0x36A4); + + //力量 + Info.Strength <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x2364); + //智力 + Info.Intellect <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x2394); + //体力 + Info.Vitality <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x237C); + //精神 + Info.Spirit <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x23AC); + //物理攻击 (没读武器精通) + Info.PhysicalAttack <- (MemoryTool.DecodeMemoryData(ObjectAddress + 0x1E54) * (Info.Strength.tofloat() * 0.004 + 1)).tointeger() + MemoryTool.DecodeMemoryData(ObjectAddress + 0x1EB4); + //魔法攻击 + Info.MagicalAttack <- (MemoryTool.DecodeMemoryData(ObjectAddress + 0x1E84) * (Info.Intellect.tofloat() * 0.004 + 1)).tointeger() + MemoryTool.DecodeMemoryData(ObjectAddress + 0x1ED8); + //独立攻击力 //TODO 需要加上成长独立攻击力 需要服务端发送给我 + Info.IndependentAttack <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x22C8) + MemoryTool.DecodeMemoryData(ObjectAddress + 0x22F8); + + //物理防御 + Info.PhysicalDefend <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x273C); + //魔法防御 + Info.MagicalDefend <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x276C); + //物理暴击 + Info.PhysicalCrit <- MemoryTool.DecodeMemoryDataF(ObjectAddress + 0x1F14); + //魔法暴击 + Info.MagicalCrit <- MemoryTool.DecodeMemoryDataF(ObjectAddress + 0x1F20); + + //攻击速度 + Info.AttackSpeed <- (MemoryTool.DecodeMemoryDataF(ObjectAddress + 0x2688) - 1.0) * 100.0; + //释放速度 + Info.ReleaseSpeed <- (MemoryTool.DecodeMemoryDataF(ObjectAddress + 0x26A0) - 1.0) * 100.0; + //移动速度 + Info.MoveSpeed <- (MemoryTool.DecodeMemoryDataF(ObjectAddress + 0x2670) - 1.0) * 100.0; + + //抗魔值 + local Kbuf = 0; + for (local i = 1; i< 13; ++i) { + local EquOffset = Rindro_GetEquAddr(i); + local AbAddress = L_sq_RA(ObjectAddress + EquOffset); + if (AbAddress) { + Kbuf += MemoryTool.DecodeMemoryData(AbAddress + 0xAD4); + } + } + Info.AntiMagic <- Kbuf; + + + //命中率 + Info.HitRate <- MemoryTool.DecodeMemoryDataF(ObjectAddress + 0x1F50); + //闪避率 + Info.DodgeRate <- MemoryTool.DecodeMemoryDataF(ObjectAddress + 0x1C50); + //HP回复量 + Info.HPRecovery <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1D64) * 1.6; + //MP回复量 + Info.MPRecovery <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1D7C) * 7.2; + //僵直度 + Info.StunRate <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1DF4); + //硬直 + Info.StunResist <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1DDC); + + //火属性强化 + Info.FireStrength <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1B54); + //冰属性强化 + Info.IceStrength <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1B60); + //光属性强化 + Info.LightStrength <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1B78); + //暗属性强化 + Info.DarkStrength <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1B6C); + //火属性抗性 + Info.FireResist <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1AF4); + //冰属性抗性 + Info.IceResist <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1B00); + //光属性抗性 + Info.LightResist <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1B18); + //暗属性抗性 + Info.DarkResist <- MemoryTool.DecodeMemoryData(ObjectAddress + 0x1B0C); + + //名望值 + Info.Fame <- 0; + //最终伤害 + Info.FinalDamage <- 0; + + return Info; +} + +// function Rindro_GetCharacterInfoCallBack(Chunk) { +// local Jso = Json.Decode(Chunk); +// Jso.op <- 20069011; +// Jso.Info <- Lenheart_Character_GetAttribute(null); +// Rindro_BaseToolClass.SendPackEx(Jso); +// } +// Pack_Control.rawset(20069010, Rindro_GetCharacterInfoCallBack); \ No newline at end of file diff --git a/user/116.205.165.25/6_mage.c b/user/116.205.165.25/6_mage.c new file mode 100644 index 0000000..a0407d7 --- /dev/null +++ b/user/116.205.165.25/6_mage.c @@ -0,0 +1,35144 @@ + +//Battlemage_skill + + +function setState_Mage_battlemage_bykk(obj, state, datas, isResetTimer) +{ + if(state == 17){ + switch(sq_GetVectorData(datas, 0)){ + case 2: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(20); + obj.sq_AddSetStatePacket(SKILL_BYKK_PRECENCIA, STATE_PRIORITY_IGNORE_FORCE, true); + break; + } + } + else if(state == 8){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(10); + obj.sq_IntVectPush(sq_GetVectorData(datas, 0)); + obj.sq_AddSetStatePacket(SKILL_BYKK_PRECENCIA, STATE_PRIORITY_IGNORE_FORCE, true); + } +} + +function onEndCurrentAni_mage_buff_bykk(obj) +{ + if(sq_getGrowType(obj) == 3){ + local SkillIndex = obj.getBuffSkillIndex(); + if(SkillIndex != 40) return; + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_CHASERAUTOCREATE); + local apdPath = "character/mage/battlemage_bykk/ap/ap_chaserautocreate.nut"; + local addAppendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, SKILL_BYKK_CHASERAUTOCREATE, false, apdPath, true); + local buffTime = sq_GetLevelData(obj, SKILL_BYKK_CHASERAUTOCREATE, 0, skill_level); + if(buffTime > 0) addAppendage.sq_SetValidTime(buffTime); + addAppendage.setEnableIsBuff(true); + addAppendage.setAppendCauseSkill(BUFF_CAUSE_SKILL, sq_getJob(obj), SKILL_BYKK_CHASERAUTOCREATE, skill_level); + CNSquirrelAppendage.sq_Append(addAppendage, obj, obj, true); + } +} + +function createOnlyDrawObject_Battlemage_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_Battlemage_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 cearteSkillPassive_Battlemage_bykk(obj,passiveObj,objnum,x,y,z,direction,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(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); +} + +function createBattlemageChaser(obj) +{ + local baseX = [-50,-75,-100,-125,-150,-175,-200], baseZ = [50,75,50,75,50,75,50]; + local count = obj.getVar("kksChaser").get_obj_vector_size() % 7; + local ycount = (obj.getVar("kksChaser").get_obj_vector_size() / 7).tointeger(); + local bX = -sq_getRandom(50,120), bY = -ycount, bZ = sq_getRandom(50,100) - (ycount * 3); + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_CHASER); + local totalDamage = sq_GetLevelData(obj, SKILL_BYKK_CHASER, 1, skill_level); + local sub = 0; + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_chaserevolution.nut")) sub = 1; + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) sub = 2; + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) sub = 3; + local sizeRateSet = 0; + if(sq_getRandom(1, 1000) > 500) sizeRateSet = 1; + local prob = sq_GetLevelData(obj, SKILL_BYKK_CHASERAUTOCREATE, 1, sq_GetSkillLevel(obj, SKILL_BYKK_CHASERAUTOCREATE)); + if(sq_getRandom(1, 1000) > (1000 - prob) || sq_GetSkillLevel(obj, SKILL_BYKK_ARMONIA) > 0) sizeRateSet = 2; + switch(sizeRateSet){ + case 1: totalDamage = totalDamage * (1000 + sq_GetIntData(obj, SKILL_BYKK_CHASER, 7)) / 1000; break; + case 2: totalDamage = totalDamage * (1000 + sq_GetIntData(obj, SKILL_BYKK_CHASER, 8)) / 1000; break; + } + local addRate = sq_GetLevelData(obj, SKILL_BYKK_CHASER, 23, skill_level); + local addRate2 = sq_GetLevelData(obj, SKILL_BYKK_CHASER, 22, skill_level); + if(addRate > 0 && sub >= 2) totalDamage = totalDamage * (100 + addRate) / 100; + else if(addRate2 > 0 && sub == 1) totalDamage = totalDamage * (100 + addRate2) / 100; + local lifeTime = sq_GetLevelData(obj, SKILL_BYKK_CHASER, 18, skill_level); + local movespeedRate = sq_GetLevelData(obj, SKILL_BYKK_CHASER, 6, skill_level); + local attackspeedRate = sq_GetLevelData(obj, SKILL_BYKK_CHASER, 5, skill_level); + local decreasespeedLevel = sq_GetLevelData(obj, SKILL_BYKK_CHASER, 7, skill_level); + local decreasespeedProb = sq_GetLevelData(obj, SKILL_BYKK_CHASER, 10, skill_level); + local decreasespeedRate = sq_GetLevelData(obj, SKILL_BYKK_CHASER, 8, skill_level); + local decreasespeedTime = sq_GetLevelData(obj, SKILL_BYKK_CHASER, 11, skill_level); + local attackbonusRate = sq_GetLevelData(obj, SKILL_BYKK_CHASER, 2, skill_level); + local criticaldamageRate = sq_GetLevelData(obj, SKILL_BYKK_CHASER, 3, skill_level); + local buffTime = sq_GetLevelData(obj, SKILL_BYKK_CHASER, 0, skill_level); + local expsizeRate = 100 + sq_GetLevelData(obj, SKILL_BYKK_CHASER, 19, skill_level); + //print("expsizeRate = "+expsizeRate); + sq_BinaryStartWrite(); + sq_BinaryWriteDword(SKILL_BYKK_CHASER); + sq_BinaryWriteDword(0); + sq_BinaryWriteDword(totalDamage); + sq_BinaryWriteDword(sub); + sq_BinaryWriteDword(sizeRateSet); + sq_BinaryWriteDword(lifeTime); + sq_BinaryWriteDword(movespeedRate); + sq_BinaryWriteDword(attackspeedRate); + sq_BinaryWriteDword(decreasespeedLevel); + sq_BinaryWriteDword(decreasespeedProb); + sq_BinaryWriteDword(decreasespeedRate); + sq_BinaryWriteDword(decreasespeedTime); + sq_BinaryWriteDword(attackbonusRate); + sq_BinaryWriteDword(criticaldamageRate); + sq_BinaryWriteDword(buffTime); + sq_BinaryWriteDword(bX); + sq_BinaryWriteDword(bY); + sq_BinaryWriteDword(bZ); + sq_BinaryWriteDword(expsizeRate); + sq_SendCreatePassiveObjectPacket(obj, PASSIVEOBJECT_BYKK_BATTLEMAGE, 0, bX, bY, bZ, obj.getDirection()); +} + +function shootBattlemageChaser(obj, damager, number) +{ + local activeObj = sq_GetCNRDObjectToActiveObject(damager); + local size = obj.getVar("kksChaser").get_obj_vector_size(); + if(size < number) number = size; + for(local i = 0; i < number; i++){ + local chaserObj = obj.getVar("kksChaser").get_obj_vector(i); + if(chaserObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(chaserObj); + if(colObj.getState() <= 21){ + colObj.getVar("target").clear_obj_vector(); + colObj.getVar("target").push_obj_vector(activeObj); + if(colObj.isExistTimeEvent(10)) colObj.stopTimeEvent(10); + if(colObj.isExistTimeEvent(11)) colObj.stopTimeEvent(11); + if(colObj.isExistTimeEvent(12)) colObj.stopTimeEvent(12); + colObj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, ""); + obj.getVar("kksChaser").remove_obj_vector(colObj); + } + } + } +} + +function changeBattlemageChaser(obj, sub) +{ + local size = obj.getVar("kksChaser").get_obj_vector_size(); + if(size < 1) return; + local addRate = sq_GetLevelData(obj, SKILL_BYKK_CHASER, 23, sq_GetSkillLevel(obj, SKILL_BYKK_CHASER)); + for(local i = 0; i < size; i++){ + local chaserObj = obj.getVar("kksChaser").get_obj_vector(i); + if(chaserObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(chaserObj); + if(colObj.getState() <= 21){ + local lifeTime = colObj.getVar("custom").getInt(13); + if(sub == 1) lifeTime = sq_GetLevelData(obj, SKILL_BYKK_CHASEREVOLUTION, 0, sq_GetSkillLevel(obj, SKILL_BYKK_CHASEREVOLUTION)); + if(colObj.isExistTimeEvent(13)) colObj.stopTimeEvent(13); + colObj.setTimeEvent(13, lifeTime, 1, false); + colObj.getVar("custom").setInt(11, sub); + if(addRate > 0){ + switch(sub){ + case 0: + case 1: + local totalDamage = colObj.getVar("custom").getInt(10); + totalDamage = totalDamage / (100 + addRate) * 100; + colObj.getVar("custom").setInt(10, totalDamage); + break; + case 2: + case 3: + local totalDamage = colObj.getVar("custom").getInt(10); + totalDamage = totalDamage * (100 + addRate) / 100; + colObj.getVar("custom").setInt(10, totalDamage); + break; + } + } + colObj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + } + } + } +} + + +function setDamageRate_BattleMage_bykk(obj) +{ + local bonusRate = 1000; + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_chaser.nut") && sq_GetSkillLevel(obj, 174) <= 60) bonusRate = bonusRate * (1000 + sq_GetLevelData(obj, SKILL_BYKK_CHASER, 2, sq_GetSkillLevel(obj, SKILL_BYKK_CHASER))) / 1000; + print("bonusRate1 = "+bonusRate); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_goddnessofwar.nut")) bonusRate = bonusRate * (1000 + sq_GetLevelData(obj, SKILL_BYKK_GODDNESSOFWAR, 1, sq_GetSkillLevel(obj, SKILL_BYKK_GODDNESSOFWAR))) / 1000; + print("bonusRate2 = "+bonusRate); + if(sq_GetSkillLevel(obj, SKILL_BYKK_ARMONIA) > 0) bonusRate = bonusRate * (1000 + sq_GetLevelData(obj, SKILL_BYKK_ARMONIA, 0, sq_GetSkillLevel(obj, SKILL_BYKK_ARMONIA))) / 1000; + print("bonusRate3 = "+bonusRate); + if(sq_GetSkillLevel(obj, SKILL_BYKK_COMBOMASTERY) > 0) bonusRate = bonusRate * (1000 + sq_GetLevelData(obj, SKILL_BYKK_COMBOMASTERY, 18, sq_GetSkillLevel(obj, SKILL_BYKK_COMBOMASTERY))) / 1000; + print("bonusRate4 = "+bonusRate); + if(sq_GetSkillLevel(obj, SKILL_BYKK_POLEMASTERY) > 0 && obj.getWeaponSubType() == 1) bonusRate = bonusRate * (1000 + sq_GetLevelData(obj, SKILL_BYKK_POLEMASTERY, 5, sq_GetSkillLevel(obj, SKILL_BYKK_POLEMASTERY))) / 1000; + print("bonusRate = "+bonusRate); + obj.getVar("setSkillBonusRate").setInt(0, bonusRate.tointeger()); + //sq_SetSkillAttackBonus(obj, bonusRate); +} + +function onEnd_appendage_battlemage_chaser_bykk(appendage) +{ + local parentObj = appendage.getParent(); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(parentObj); + setDamageRate_BattleMage_bykk(sqrChr); +} + +function getAttackAni_Mage(obj, index) +{ + if(!obj) return null; + local ani = obj.sq_GetAttackAni(index); + if(index == 4){ + ani = obj.sq_getCustomAni(ANIMATION_ATTACK_SETCUSTOM); + return ani; + } + if(sq_GetSkillLevel(obj, SKILL_BYKK_ENABLEFINISHATTACK) > 0) ani = obj.sq_getCustomAni(10 + index); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + local aniName = ["Attack1","Attack2","Attack3"]; + print(aniName[index]); + ani = getCurrentAnimation_precencia(obj, aniName[index], false, false); + } + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + local aniName = ["Attack1_00","Attack2_00","Attack3_00"]; + print(aniName[index]); + ani = getCurrentAnimation_precencia(obj, aniName[index], false, true); + } + return ani; +} + +function getStayAni_Mage(obj) +{ + if(!obj) return null; + local ani = obj.sq_GetStayAni(); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + ani = getCurrentAnimation_precencia(obj, "Stay", false, false); + return ani; + } + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + ani = sq_GetCustomAni(obj, 257); + return ani; + } + return ani; +} + +function getMoveAni_Mage(obj) +{ + if(!obj) return null; + local ani = obj.sq_GetMoveAni(); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + ani = getCurrentAnimation_precencia(obj, "Move", false, false); + return ani; + } + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + // ani = getCurrentAnimation_precencia(obj, "Move", false, true); + ani = sq_GetCustomAni(obj, 243); + return ani; + } + return ani; +} + +function getSitAni_Mage(obj) +{ + if(!obj) return null; + local ani = obj.sq_GetSitAni(); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + ani = getCurrentAnimation_precencia(obj, "Sit", false, false); + return ani; + } + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + ani = getCurrentAnimation_precencia(obj, "Sit", false, true); + return ani; + } + return ani; +} + +function getDamageAni_Mage(obj, index) +{ + if(!obj) return null; + local ani = obj.sq_GetDamageAni(index); + local aniName = ["Damage1","Damage2"]; + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + ani = getCurrentAnimation_precencia(obj, aniName[index], false, false); + return ani; + } + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + ani = getCurrentAnimation_precencia(obj, aniName[index], false, true); + return ani; + } + return ani; +} + +function getDownAni_Mage(obj) +{ + if(!obj) return null; + local ani = obj.sq_GetDownAni(); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + ani = getCurrentAnimation_precencia(obj, "Damage2", false, false); + return ani; + } + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + ani = getCurrentAnimation_precencia(obj, "Down", false, true); + return ani; + } + return ani; +} + +function getOverturnAni_Mage(obj) +{ + if(!obj) return null; + local ani = obj.sq_GetOverturnAni(); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + ani = getCurrentAnimation_precencia(obj, "Overturn", false, false); + return ani; + } + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + ani = getCurrentAnimation_precencia(obj, "Overturn", false, true); + return ani; + } + return ani; +} + +function getJumpAni_Mage(obj) +{ + if(!obj) return null; + local ani = obj.sq_GetJumpAni(); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + ani = getCurrentAnimation_precencia(obj, "Jump", false, false); + return ani; + } + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + ani = getCurrentAnimation_precencia(obj, "Jump", false, true); + return ani; + } + return ani; +} + +function getJumpAttackAni_Mage(obj) +{ + if(!obj) return null; + local ani = obj.sq_GetJumpAttackAni(); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + ani = getCurrentAnimation_precencia(obj, "JumpAttack", false, false); + return ani; + } + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + ani = getCurrentAnimation_precencia(obj, "Jumpattack_01", false, true); + return ani; + } + return ani; +} + +function getRestAni_Mage(obj) +{ + if(!obj) return null; + local ani = obj.sq_GetRestAni(); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + ani = getCurrentAnimation_precencia(obj, "Rest", false, false); + return ani; + } + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + ani = getCurrentAnimation_precencia(obj, "Rest", false, true); + return ani; + } + if(sq_getGrowType(obj) == 1) ani = getElementalMaster_RestAni(obj); + return ani; +} + +function getThrowChargeAni_Mage(obj, index) +{ + if(!obj) return null; + local ani = obj.sq_GetThrowChargeAni(index); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + local aniName = ["OneHandThrow1","TwoHandThrow1","Cast1","Wink1"]; + ani = getCurrentAnimation_precencia(obj, aniName[index], false, false); + return ani; + } + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + ani = getCurrentAnimation_precencia(obj, "Throw", false, true); + return ani; + } + return ani; +} + +function getThrowShootAni_Mage(obj, index) +{ + if(!obj) return null; + local ani = obj.sq_GetThrowShootAni(index); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + local aniName = ["OneHandThrow2","TwoHandThrow2","Cast2","Wink2"]; + ani = getCurrentAnimation_precencia(obj, aniName[index], false, false); + return ani; + } + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + ani = getCurrentAnimation_precencia(obj, "Throwshoot", false, true); + return ani; + } + return ani; +} + +function getDashAni_Mage(obj) +{ + if(!obj) return null; + local ani = obj.sq_GetDashAni(); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + ani = getCurrentAnimation_precencia(obj, "Dash", false, false); + return ani; + } + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + ani = sq_GetCustomAni(obj, 224); + return ani; + } + return ani; +} + +function getDashAttackAni_Mage(obj) +{ + if(!obj) return null; + local ani = obj.sq_GetDashAttackAni(); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + ani = getCurrentAnimation_precencia(obj, "Dashattack", false, false); + } + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + ani = getCurrentAnimation_precencia(obj, "Dashattack_00", false, true); + } + return ani; +} + +function getGetItemAni_Mage(obj) +{ + if(!obj) return null; + local ani = obj.sq_GetGetItemAni(); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + ani = getCurrentAnimation_precencia(obj, "GetItem", false, false); + } + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + ani = getCurrentAnimation_precencia(obj, "GetItem", false, true); + } + return ani; +} + +function getBuffAni_Mage(obj) +{ + if(!obj) return null; + local ani = obj.sq_GetBuffAni(); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + ani = getCurrentAnimation_precencia(obj, "Buff", false, false); + } + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + ani = getCurrentAnimation_precencia(obj, "Buff", false, true); + } + return ani; +} + +function getCurrentAnimation_precencia(obj, aniName, isRewind, isSeal) +{ + local ani = null; + local aniPath_01 = "character/mage/effect/animation/avatar/change_skin/", aName = "mage_precencia_off_" + aniName; + if(isSeal == true){aniPath_01 = "character/mage/animation/battlemage_bykk/precencia/"; aName = "mage_precencia_on_" + aniName;} + else{ + local skill = sq_GetSkill(obj, SKILL_BYKK_ARMONIA); + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_ARMONIA); + if(skillLevel > 0 && !skill.isSealFunction()){ + aniPath_01 = "character/mage/effect/animation/battlemage_bykk/exticion_newbody/change_skin/"; aName = "mage_exticion_New_" + aniName; + } + } + ani = obj.getVar().GetAnimationMap(aName, aniPath_01 + aniName + ".ani"); + if(ani && isRewind) sq_Rewind(ani); + return ani; +} + +function onattack_Battlemage_k_k(obj, damager, bounding_box, is_stuck) +{ + if(is_stuck) return; + if(!obj || obj.getState() == STATE_DIE) return; + if(!damager.isObjectType(OBJECTTYPE_ACTIVE)) return; + if(!CNSquirrelAppendage.sq_IsAppendAppendage(obj, CHASERLAUNCH_APDPATH)) CNSquirrelAppendage.sq_AppendAppendage(obj, obj, -1, false, CHASERLAUNCH_APDPATH, true); + local addAppendage = CNSquirrelAppendage.sq_GetAppendage(obj, CHASERLAUNCH_APDPATH); + if(addAppendage){ + local buffTime = sq_GetLevelData(obj, SKILL_BYKK_CHASERLAUNCH, 0, sq_GetSkillLevel(obj, SKILL_BYKK_CHASERLAUNCH)); + addAppendage.sq_SetValidTime(buffTime); + addAppendage.getVar("target").clear_obj_vector(); + addAppendage.getVar("target").push_obj_vector(damager); + } +} + +function procSkill_Battlemage_bykk(obj) +{ + if(obj.getVar("kksChaser").get_obj_vector_size() < 1 || !CNSquirrelAppendage.sq_IsAppendAppendage(obj, CHASERLAUNCH_APDPATH)){ + obj.setSkillCommandEnable(SKILL_BYKK_CHASERLAUNCH, false); + return; + } + if(sq_GetSkill(obj, SKILL_BYKK_CHASERLAUNCH).isInCoolTime()) return; + obj.setSkillCommandEnable(SKILL_BYKK_CHASERLAUNCH,true); + local stateNow = obj.getState(); + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_CHASERLAUNCH); + if(stateNow == STATE_BYKK_RANDOMPIERCESTRIKEEX || stateNow == SKILL_BYKK_RANDOMPIERCESTRIKE || stateNow == SKILL_BYKK_DRAGONSPEAR){ + local number = sq_GetLevelData(obj, SKILL_BYKK_CHASERLAUNCH, 2, skillLevel); + obj.sq_IsEnterSkillLastKeyUnits(SKILL_BYKK_CHASERLAUNCH); + local bDownKey = obj.isDownSkillLastKey(); + if(bDownKey){ + local addAppendage = CNSquirrelAppendage.sq_GetAppendage(obj, CHASERLAUNCH_APDPATH); + if(addAppendage){ + local targetObj = addAppendage.getVar("target").get_obj_vector(0); + if(targetObj && targetObj.getState() != STATE_DIE){ + shootBattlemageChaser(obj, targetObj, number); + obj.startSkillCoolTime(SKILL_BYKK_CHASERLAUNCH, skillLevel, -1); + } + } + } + } + else{ + local b_useskill = obj.sq_IsEnterSkill(SKILL_BYKK_CHASERLAUNCH); + if(b_useskill != -1){ + local number = sq_GetLevelData(obj, SKILL_BYKK_CHASERLAUNCH, 2, skillLevel); + local addAppendage = CNSquirrelAppendage.sq_GetAppendage(obj, CHASERLAUNCH_APDPATH); + if(addAppendage){ + local targetObj = addAppendage.getVar("target").get_obj_vector(0); + if(targetObj && targetObj.getState() != STATE_DIE){ + shootBattlemageChaser(obj, targetObj, number); + obj.startSkillCoolTime(SKILL_BYKK_CHASERLAUNCH, skillLevel, -1); + } + } + } + } +} + +function onStart_appendage_battlemage_chaserautocreate(appendage) +{ + local parentObj = appendage.getParent(); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(parentObj); + local skill_level = sq_GetSkillLevel(sqrChr, SKILL_BYKK_CHASERAUTOCREATE); + local createTime = sq_GetLevelData(sqrChr, SKILL_BYKK_CHASERAUTOCREATE, 5, skill_level); + appendage.getVar("time").clear_timer_vector(); + appendage.getVar("time").push_timer_vector(); + local t_01 = appendage.getVar("time").get_timer_vector(0); + t_01.setParameter(createTime, -1); + t_01.resetInstant(0); + return; +} + +function proc_appendage_battlemage_chaserautocreate(appendage) +{ + local parentObj = appendage.getParent(); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(parentObj); + if(!sqrChr || sqrChr.getState() == STATE_DIE){ + appendage.setValid(false); + return; + } + local t_01 = appendage.getVar("time").get_timer_vector(0); + local currentT = appendage.getTimer().Get(); + if(t_01 && t_01.isOnEvent(currentT)){ + local createMax = sq_GetIntData(sqrChr, SKILL_BYKK_CHASER, 0); + if(sqrChr.getVar("kksChaser").get_obj_vector_size() < createMax) createBattlemageChaser(sqrChr); + } + return; +} + +function onAttackParent_appendage_battlemage_chaserautocreate(appendage, realAttacker, damager, boundingBox, isStuck) +{ + + if(isStuck) return; + if(!damager.isObjectType(OBJECTTYPE_ACTIVE)) return; + local parentObj = appendage.getParent(); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(parentObj); + if(!sqrChr || sqrChr.getState() == STATE_DIE){ + appendage.setValid(false); + return; + } + if(realAttacker.isObjectType(OBJECTTYPE_PASSIVE)){ + if(realAttacker.getVar("skillIndex").getInt(0) == SKILL_BYKK_CHASER) return; + } + local skillLevel = sq_GetSkillLevel(sqrChr, SKILL_BYKK_CHASERAUTOCREATE); + switch(sqrChr.getState()){ + case SKILL_BYKK_PRECENCIA: + switch(sqrChr.getSkillSubState()){ + case 10: + case 11: + case 12: + local prob = sq_GetLevelData(sqrChr, SKILL_BYKK_CHASERAUTOCREATE, 2, skillLevel); + if(sq_getRandom(1,1000) > (1000 - prob)){ + local createMax = sq_GetIntData(sqrChr, SKILL_BYKK_CHASER, 0); + if(sqrChr.getVar("kksChaser").get_obj_vector_size() < createMax) createBattlemageChaser(sqrChr); + } + break; + } + break; + default: + local prob = sq_GetLevelData(sqrChr, SKILL_BYKK_CHASERAUTOCREATE, 3, skillLevel); + if(sq_getRandom(1,1000) > (1000 - prob)){ + local createMax = sq_GetIntData(sqrChr, SKILL_BYKK_CHASER, 0); + if(sqrChr.getVar("kksChaser").get_obj_vector_size() < createMax) createBattlemageChaser(sqrChr); + } + break; + } +} + +function onEnd_appendage_battlemage_precenciaoff(appendage) +{ + local spectrumAppendage = appendage.sq_GetOcularSpectrum("ocularSpectrum");//得到殘影 + if(spectrumAppendage) spectrumAppendage.endCreateSpectrum();//清除 + + local parentObj = appendage.getParent(); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(parentObj); + sqrChr.stopSound(2333);//停止光環聲音 + + local goddAppendage = CNSquirrelAppendage.sq_GetAppendage(sqrChr, "character/mage/battlemage_bykk/ap/ap_goddnessofwar.nut"); + if(goddAppendage) goddAppendage.getVar().setBool(100, false); + + if(sqrChr.getState() == 0 || sqrChr.getState() == 8 || sqrChr.getState() == 14){ + sqrChr.sq_IntVectClear(); + sqrChr.sq_IntVectPush(1); + sqrChr.sq_IntVectPush(0); + sqrChr.sq_AddSetStatePacket(SKILL_BYKK_PRECENCIA, STATE_PRIORITY_USER, true); + } +} + +function onEnd_appendage_battlemage_precenciaon(appendage) +{ + local spectrumAppendage = appendage.sq_GetOcularSpectrum("ocularSpectrum");//得到殘影 + if(spectrumAppendage) spectrumAppendage.endCreateSpectrum();//清除 + + local parentObj = appendage.getParent(); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(parentObj); + sqrChr.setObjectHeight(-1); + sqrChr.stopSound(2333);//停止光環聲音 + + local goddAppendage = CNSquirrelAppendage.sq_GetAppendage(sqrChr, "character/mage/battlemage_bykk/ap/ap_goddnessofwar.nut"); + if(goddAppendage) goddAppendage.getVar().setBool(100, false); + + if(sqrChr.getState() == 0 || sqrChr.getState() == 8 || sqrChr.getState() == 14){ + sqrChr.sq_IntVectClear(); + sqrChr.sq_IntVectPush(1); + sqrChr.sq_IntVectPush(1); + sqrChr.sq_AddSetStatePacket(SKILL_BYKK_PRECENCIA, STATE_PRIORITY_USER, true); + } +} + +function drawAppend_appendage_battlemage_precenciaoff(appendage, isOver, x, y, isFlip) +{ + if(!appendage) return; + if(!appendage.isValid()) return; + local parentObj = appendage.getParent(); + if(!parentObj || parentObj.getState() == STATE_DIE){ + appendage.setValid(false); + return; + } + + if(appendage.getVar("setFail").getBool(0)){ + local sqrChr = sq_GetCNRDObjectToSQRCharacter(parentObj); + if(sq_GetIntData(sqrChr, SKILL_BYKK_PRECENCIA, 15) < 1){ + appendage.setValid(false); + return; + } + } + + local var = appendage.getVar(); + local backAni = var.GetAnimationMap("precenciabackAni_01", "character/mage/effect/animation/avatar/avatarauraloopbot_eff_01.ani"); + local backAni2 = var.GetAnimationMap("precenciabackAni_02", "character/mage/effect/animation/avatar/avataraurabody_eff_00.ani"); + local frontAni = var.GetAnimationMap("precenciafrontAni_01", "character/mage/effect/animation/avatar/avatarauralooptop_eff_01.ani"); + if (frontAni && isOver){ + sq_AnimationProc(frontAni); + sq_drawCurrentFrame(frontAni, x, y, isFlip); + } + else if(backAni && !isOver){ + sq_AnimationProc(backAni); + sq_AnimationProc(backAni2); + sq_drawCurrentFrame(backAni, x, y, isFlip); + sq_drawCurrentFrame(backAni2, x, y, isFlip); + } + return; +} + +function drawAppend_appendage_battlemage_precenciaon(appendage, isOver, x, y, isFlip) +{ + if(!appendage) return; + if(!appendage.isValid()) return; + local parentObj = appendage.getParent(); + if(!parentObj || parentObj.getState() == STATE_DIE){ + appendage.setValid(false); + return; + } + + if(appendage.getVar("setFail").getBool(0)){ + local sqrChr = sq_GetCNRDObjectToSQRCharacter(parentObj); + if(sq_GetIntData(sqrChr, SKILL_BYKK_PRECENCIA, 15) < 1){ + appendage.setValid(false); + return; + } + } + + local var = appendage.getVar(); + local backAni = var.GetAnimationMap("precenciabackAni_01", "character/mage/effect/animation/avatar/avatarauraloopbot_eff_01.ani"); + local backAni2 = var.GetAnimationMap("precenciabackAni_02", "character/mage/effect/animation/avatar/avataraurabody_eff_00.ani"); + local frontAni = var.GetAnimationMap("precenciafrontAni_01", "character/mage/effect/animation/avatar/avatarauralooptop_eff_01.ani"); + if (frontAni && isOver){ + sq_AnimationProc(frontAni); + sq_drawCurrentFrame(frontAni, x, y, isFlip); + } + else if(backAni && !isOver){ + sq_AnimationProc(backAni); + sq_AnimationProc(backAni2); + sq_drawCurrentFrame(backAni, x, y, isFlip); + sq_drawCurrentFrame(backAni2, x, y - 50, isFlip); + } + return; +} + +function onEnd_appendage_battlemage_pokethrow(appendage) +{ + if(!appendage) return; + local parentObj = appendage.getParent(); + if(!parentObj){ + appendage.setValid(false); + return; + } +} + +function drawAppend_appendage_battlemage_goddnessofwar(appendage, isOver, x, y, isFlip) +{ + // local parentObj = appendage.getParent(); + // local sqrChr = sq_GetCNRDObjectToSQRCharacter(parentObj); + local var = appendage.getVar(); + local frontAni = var.GetAnimationMap("godfrontAni_01", "character/mage/effect/animation/battlemage_bykk/goddnessofwar/goddnessofwar_loop.ani"); + local frontAni2 = var.GetAnimationMap("godfrontAni_02", "character/mage/effect/animation/battlemage_bykk/goddnessofwar/goddnessofwar_loop_avatar.ani"); + if (frontAni && isOver){ + if(var.getBool(100)){ + sq_AnimationProc(frontAni2); + sq_drawCurrentFrame(frontAni2, x, y, isFlip); + } + else{ + sq_AnimationProc(frontAni); + sq_drawCurrentFrame(frontAni, x, y, isFlip); + } + } + return; +} + +function onEnd_appendage_battlemage_goddnessofwar(appendage) +{ + local parentObj = appendage.getParent(); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(parentObj); + setDamageRate_BattleMage_bykk(sqrChr); + return; +} + +function drawAppend_appendage_battlemage_randompiercestrikeex(appendage, isOver, x, y, isFlip) +{ + local var = appendage.getVar(); + local frontAni = var.GetAnimationMap("randompiercestrikeex_01", "character/mage/effect/animation/battlemage_bykk/randompiercestrikeex/talisman/holdeffect/hold_lightning.ani"); + if (frontAni && isOver){ + sq_AnimationProc(frontAni); + sq_drawCurrentFrame(frontAni, x, y, isFlip); + } + return; +} + +function onStart_appendage_battlemage_weaponmastery(appendage) +{ + local parentObj = appendage.getParent(); + local obj = sq_GetCNRDObjectToSQRCharacter(parentObj); + + local criticalRate_1 = sq_GetLevelData(obj, SKILL_BYKK_ENABLEFINISHATTACK, 2, sq_GetSkillLevel(obj, SKILL_BYKK_ENABLEFINISHATTACK)); + local change_appendage = appendage.sq_getChangeStatus("enablefinishattack"); + if(!change_appendage) change_appendage = appendage.sq_AddChangeStatus("enablefinishattack",obj, obj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK, true, 100); + if(change_appendage){ + change_appendage.clearParameter(); + change_appendage.addParameter(CHANGE_STATUS_TYPE_PHYSICAL_CRITICAL_HIT_RATE, false, (criticalRate_1 * 0.1).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_MAGICAL_CRITICAL_HIT_RATE, false, (criticalRate_1 * 0.1).tofloat()); + } + + local weaponType = obj.getWeaponSubType(); + switch(weaponType){ + case 1: + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_POLEMASTERY); + if(skill_level > 0){ + local attackRate = sq_GetLevelData(obj, SKILL_BYKK_POLEMASTERY, 10, skill_level); + local stuckRate = sq_GetLevelData(obj, SKILL_BYKK_POLEMASTERY, 6, skill_level); + local cooltime = sq_GetIntData(obj, SKILL_BYKK_POLEMASTERY, 4) / 10; + local change_appendage = appendage.sq_getChangeStatus("weaponMastery"); + if(!change_appendage) change_appendage = appendage.sq_AddChangeStatus("weaponMastery",obj, obj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK, true, attackRate); + if(change_appendage){ + change_appendage.clearParameter(); + change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_PHYSICAL_ATTACK, true, (attackRate * 0.1).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_STUCK, false, (stuckRate * -0.1).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_COOLTIME_DECLINE, true, (cooltime * -1).tofloat()); + } + } + break; + case 0: + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_SPEARMASTERY); + if(skill_level > 0){ + local bonusRate = sq_GetLevelData(obj, SKILL_BYKK_SPEARMASTERY, 4, skill_level); + local criticalRate = sq_GetLevelData(obj, SKILL_BYKK_SPEARMASTERY, 5, skill_level); + local stuckRate = sq_GetLevelData(obj, SKILL_BYKK_SPEARMASTERY, 7, skill_level); + local change_appendage = appendage.sq_getChangeStatus("weaponMastery"); + if(!change_appendage) change_appendage = appendage.sq_AddChangeStatus("weaponMastery",obj, obj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK, true, bonusRate); + if(change_appendage){ + change_appendage.clearParameter(); + change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_PHYSICAL_ATTACK, true, (bonusRate * 0.1).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_MAGICAL_ATTACK, true, (bonusRate * 0.1).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_PHYSICAL_CRITICAL_HIT_RATE, false, (criticalRate * 0.1).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_STUCK, false, (stuckRate * -0.1).tofloat()); + } + } + break; + } + return; +} + +function onAttackParent_appendage_battlemage_weaponmastery(appendage, realAttacker, damager, boundingBox, isStuck) +{ + if(!appendage) return; + if(!damager.isObjectType(OBJECTTYPE_ACTIVE)) return; + if(isStuck) return; + local parentObj = appendage.getParent(); + local obj = sq_GetCNRDObjectToSQRCharacter(parentObj); + if(!obj || obj.getState() == STATE_DIE) return; + if(realAttacker.isObjectType(OBJECTTYPE_PASSIVE)){ + local colObj = sq_GetCNRDObjectToCollisionObject(realAttacker); + if(colObj.getVar("skillIndex").getInt(0) == SKILL_BYKK_CHASER){ + return; + } + } + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_CHASERLAUNCH); + local isAutoFire = sq_GetLevelData(obj, SKILL_BYKK_CHASERLAUNCH, 5, skillLevel); + if(isAutoFire > 0){ + local number = sq_GetLevelData(obj, SKILL_BYKK_CHASERLAUNCH, 2, skillLevel); + local addAppendage = CNSquirrelAppendage.sq_GetAppendage(obj, CHASERLAUNCH_APDPATH); + if(addAppendage){ + local targetObj = addAppendage.getVar("target").get_obj_vector(0); + if(targetObj && targetObj.getState() != STATE_DIE){ + shootBattlemageChaser(obj, targetObj, number); + } + } + } +} + + + +function onStart_appendage_battlemage_multirole(appendage) +{ + local parentObj = appendage.getParent(); + local obj = sq_GetCNRDObjectToSQRCharacter(parentObj); + + local criticaldRate = sq_GetLevelData(obj, SKILL_BYKK_MULTIROLE, 0, sq_GetSkillLevel(obj, SKILL_BYKK_MULTIROLE)); + local change_appendage = appendage.sq_getChangeStatus("multirole"); + if(!change_appendage) change_appendage = appendage.sq_AddChangeStatus("multirole", obj, obj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK, true, 100); + if(change_appendage){ + change_appendage.clearParameter(); + change_appendage.addParameter(CHANGE_STATUS_TYPE_PHYSICAL_CRITICAL_DAMAGE_RATE, false, (criticaldRate * 0.1 / 0.667).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_MAGICAL_CRITICAL_DAMAGE_RATE, false, (criticaldRate * 0.1 / 0.667).tofloat()); + } +} + + +function onStart_appendage_battlemage_combomastery(appendage) +{ + local parentObj = appendage.getParent(); + if(!parentObj){appendage.setValid(false); return;} + local obj = sq_GetCNRDObjectToSQRCharacter(parentObj); + + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_COMBOMASTERY); + local phase1Count = sq_GetLevelData(obj, SKILL_BYKK_COMBOMASTERY, 30, skillLevel); + local phase2Count = sq_GetLevelData(obj, SKILL_BYKK_COMBOMASTERY, 31, skillLevel); + local phase3Count = sq_GetLevelData(obj, SKILL_BYKK_COMBOMASTERY, 32, skillLevel); + + local phase1attackSpeed = sq_GetLevelData(obj, SKILL_BYKK_COMBOMASTERY, 19, skillLevel); + local phase1moveSpeed = sq_GetLevelData(obj, SKILL_BYKK_COMBOMASTERY, 20, skillLevel); + local phase2attackSpeed = sq_GetLevelData(obj, SKILL_BYKK_COMBOMASTERY, 23, skillLevel); + local phase2moveSpeed = sq_GetLevelData(obj, SKILL_BYKK_COMBOMASTERY, 24, skillLevel); + local phase3attackSpeed = sq_GetLevelData(obj, SKILL_BYKK_COMBOMASTERY, 27, skillLevel); + local phase3moveSpeed = sq_GetLevelData(obj, SKILL_BYKK_COMBOMASTERY, 28, skillLevel); + + appendage.getVar("custom").setInt(101, phase1Count); + appendage.getVar("custom").setInt(102, phase2Count); + appendage.getVar("custom").setInt(103, phase3Count); + appendage.getVar("custom").setInt(104, phase1attackSpeed); + appendage.getVar("custom").setInt(105, phase1moveSpeed); + appendage.getVar("custom").setInt(106, phase2attackSpeed); + appendage.getVar("custom").setInt(107, phase2moveSpeed); + appendage.getVar("custom").setInt(108, phase3attackSpeed); + appendage.getVar("custom").setInt(109, phase3moveSpeed); + appendage.getVar("combomastery_phase").setInt(10, 0); + appendage.getVar("combomastery_phase").setInt(11, 0); + + appendage.getVar("combomastery_count").setInt(10, 0); + appendage.getVar("combomastery_time").clear_ct_vector(); + appendage.getVar("combomastery_time").push_ct_vector(); + + obj.sq_AddSkillLoad(84, 62, 0, 500); +} + +function proc_appendage_battlemage_combomastery(appendage) +{ + local parentObj = appendage.getParent(); + if(!parentObj){appendage.setValid(false); return;} + local obj = sq_GetCNRDObjectToSQRCharacter(parentObj); + + local timer = appendage.getVar("combomastery_time").get_ct_vector(0); + if(!timer){ + appendage.getVar("combomastery_time").clear_ct_vector(); + appendage.getVar("combomastery_time").push_ct_vector(); + return; + } + local currentT = timer.Get(); + local combomTime = 1300 + sq_GetIntData(obj, SKILL_BYKK_COMBOINSTINCT, 0); + if(currentT > combomTime){ + if(appendage.getVar("combomastery_phase").getInt(10) >= 3 && (CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut") || CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut"))) return; + timer.Reset(); + timer.Start(10000,0); + appendage.getVar("combomastery_count").setInt(10, 0); + appendage.getVar("combomastery_phase").setInt(10, 0); + appendage.getVar("combomastery_phase").setInt(11, 0); + local change_appendage = appendage.sq_getChangeStatus("battlemage_combomastery"); + if(change_appendage) change_appendage.clearParameter(); + + local loadSlot = obj.sq_GetSkillLoad(84); + if(loadSlot){ + local number = loadSlot.getRemainLoadNumber(); + loadSlot.decreaseLoadCount(number); + } + } + else{ + local combomCount = appendage.getVar("combomastery_count").getInt(10); + local phase1Count = appendage.getVar("custom").getInt(101); + local phase2Count = appendage.getVar("custom").getInt(102); + local phase3Count = appendage.getVar("custom").getInt(103); + if(combomCount >= phase3Count) appendage.getVar("combomastery_phase").setInt(10, 3); + else if(combomCount >= phase2Count) appendage.getVar("combomastery_phase").setInt(10, 2); + else if(combomCount >= phase1Count) appendage.getVar("combomastery_phase").setInt(10, 1); + + if(appendage.getVar("combomastery_phase").getInt(10) != appendage.getVar("combomastery_phase").getInt(11)){ + appendage.getVar("combomastery_phase").setInt(11, appendage.getVar("combomastery_phase").getInt(10)); + local loadSlot = obj.sq_GetSkillLoad(84); + if(loadSlot){ + local number = loadSlot.getRemainLoadNumber(); + loadSlot.decreaseLoadCount(number); + loadSlot.increaseLoadCount(110 + appendage.getVar("combomastery_phase").getInt(10)); + } + local attackspeedRate = 0, movespeedRate = 0; + switch(appendage.getVar("combomastery_phase").getInt(11)){ + case 1: attackspeedRate = appendage.getVar("custom").getInt(104); movespeedRate = appendage.getVar("custom").getInt(105); break; + case 2: attackspeedRate = appendage.getVar("custom").getInt(106); movespeedRate = appendage.getVar("custom").getInt(107); break; + case 3: attackspeedRate = appendage.getVar("custom").getInt(108); movespeedRate = appendage.getVar("custom").getInt(109); break; + } + + local change_appendage = appendage.sq_getChangeStatus("battlemage_combomastery"); + if(!change_appendage) change_appendage = appendage.sq_AddChangeStatus("battlemage_combomastery",obj, obj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK, true, 1000); + if(change_appendage){ + change_appendage.clearParameter(); + change_appendage.addParameter(10, false, (attackspeedRate).tofloat()); + change_appendage.addParameter(11, false, (movespeedRate).tofloat()); + } + } + } +} + +function onAttackParent_appendage_battlemage_combomastery(appendage, realAttacker, damager, boundingBox, isStuck) +{ + if(isStuck) return; + local parentObj = appendage.getParent(); + if(!parentObj){appendage.setValid(false); return;} + local obj = sq_GetCNRDObjectToSQRCharacter(parentObj); + + if(!damager.isObjectType(OBJECTTYPE_ACTIVE)) return; + appendage.getVar("combomastery_count").setInt(10, appendage.getVar("combomastery_count").getInt(10) + 1); + local combomCount = appendage.getVar("combomastery_count").getInt(10); + print("COMBOM = "+combomCount); + local timer = appendage.getVar("combomastery_time").get_ct_vector(0); + if(timer){ + timer.Reset(); + timer.Start(10000,0); + } +} + + + +function onStartDungeon_Battlemage_bykk(obj) +{ + if(sq_GetSkillLevel(obj, SKILL_BYKK_ARMONIA) > 0){ + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_CHASERAUTOCREATE); + local apdPath = "character/mage/battlemage_bykk/ap/ap_chaserautocreate.nut"; + local addAppendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, SKILL_BYKK_CHASERAUTOCREATE, false, apdPath, true); + local buffTime = sq_GetLevelData(obj, SKILL_BYKK_CHASERAUTOCREATE, 0, skill_level); + if(buffTime > 0) addAppendage.sq_SetValidTime(buffTime); + addAppendage.setEnableIsBuff(true); + addAppendage.setAppendCauseSkill(BUFF_CAUSE_SKILL, sq_getJob(obj), SKILL_BYKK_CHASERAUTOCREATE, skill_level); + CNSquirrelAppendage.sq_Append(addAppendage, obj, obj, true); + } + if(sq_GetSkillLevel(obj, SKILL_BYKK_COMBOMASTERY) > 0){ + CNSquirrelAppendage.sq_AppendAppendage(obj, obj, SKILL_BYKK_CHASERAUTOCREATE, false, "character/mage/battlemage_bykk/ap/ap_battlemage_combomastery.nut", true); + } + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut"); + } + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut"); + } + setDamageRate_BattleMage_bykk(obj); +} + +function procSkill_Battlemage(obj) +{ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut") || CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + obj.setSkillCommandEnable(15, false); + obj.setSkillCommandEnable(16, false); + obj.setSkillCommandEnable(17, false); + obj.setSkillCommandEnable(18, false); + obj.setSkillCommandEnable(20, false); + obj.setSkillCommandEnable(11, false); + obj.setSkillCommandEnable(25, false); + } + if(obj.getVar("chaserClusterObj01").get_obj_vector_size() > 0){ + if(obj.getState() != STATE_STAND || obj.getState() != STATE_DASH){ + obj.setSkillCommandEnable(SKILL_BYKK_CHASERCLUSTER,true); + local b_useskill = obj.sq_IsEnterSkill(SKILL_BYKK_CHASERCLUSTER); + if(b_useskill != -1){ + obj.sq_PlaySound("WZ_CHASER_EXPLOSION"); + local attackObj = obj.getVar("chaserClusterObj01").get_obj_vector(0); + if(attackObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(attackObj); + if(colObj.getState() != 21) colObj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + } + local size = obj.getVar("chaserClusterObj02").get_obj_vector_size(); + for(local i = 0; i < size; i++){ + local effectObj = obj.getVar("chaserClusterObj02").get_obj_vector(i); + if(effectObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(effectObj); + if(colObj.isExistTimeEvent(0)) colObj.stopTimeEvent(0); + if(colObj.getState() <= 21) colObj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + } + } + } + } + } + procSkill_Battlemage_bykk(obj); +} + +function reset_battlemage_bykk(obj) +{ + if(sq_GetSkillLevel(obj, SKILL_BYKK_ARMONIA) > 0){ + if(!CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_chaserautocreate.nut")){ + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_CHASERAUTOCREATE); + local apdPath = "character/mage/battlemage_bykk/ap/ap_chaserautocreate.nut"; + local addAppendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, SKILL_BYKK_CHASERAUTOCREATE, false, apdPath, true); + local buffTime = sq_GetLevelData(obj, SKILL_BYKK_CHASERAUTOCREATE, 0, skill_level); + if(buffTime > 0) addAppendage.sq_SetValidTime(buffTime); + addAppendage.setEnableIsBuff(true); + addAppendage.setAppendCauseSkill(BUFF_CAUSE_SKILL, sq_getJob(obj), SKILL_BYKK_CHASERAUTOCREATE, skill_level); + CNSquirrelAppendage.sq_Append(addAppendage, obj, obj, true); + } + } + if(sq_GetSkillLevel(obj, SKILL_BYKK_COMBOMASTERY) > 0){ + if(!CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_battlemage_combomastery.nut")) CNSquirrelAppendage.sq_AppendAppendage(obj, obj, SKILL_BYKK_CHASERAUTOCREATE, false, "character/mage/battlemage_bykk/ap/ap_battlemage_combomastery.nut", true); + } +} + + +function setCustomData_po_battlemage_bykk(obj, receiveData) +{ + if(!obj) return; + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + if(!sqrChr) return; + local skillIndex = receiveData.readDword(); + local subtype = receiveData.readDword(); + + obj.getVar("skillIndex").setInt(0, skillIndex); + obj.getVar("subtype").setInt(0, subtype); + + switch(skillIndex){ + case SKILL_BYKK_THRUST://龍牙 + break; + case SKILL_BYKK_CHASER://炫紋 + if(sqrChr.getVar("kksChaser").get_obj_vector_size() < 0) sqrChr.getVar("kksChaser").clear_obj_vector(); + if(!sqrChr.getVar("kksChaser").is_obj_vector(obj)) sqrChr.getVar("kksChaser").push_obj_vector(obj); + obj.setMapFollowParent(sqrChr); + obj.setMapFollowType(1); + local totalDamage = receiveData.readDword(); + local sub = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local lifeTime = receiveData.readDword(); + local movespeedRate = receiveData.readDword(); + local attackspeedRate = receiveData.readDword(); + local decreasespeedLevel = receiveData.readDword(); + local decreasespeedProb = receiveData.readDword(); + local decreasespeedRate = receiveData.readDword(); + local decreasespeedTime = receiveData.readDword(); + local attackbonusRate = receiveData.readDword(); + local criticaldamageRate = receiveData.readDword(); + local buffTime = receiveData.readDword(); + local baseX = receiveData.readDword(); + local baseY = receiveData.readDword(); + local baseZ = receiveData.readDword(); + local expsizeRate = receiveData.readDword(); + + obj.getVar("custom").setInt(10, totalDamage); + obj.getVar("custom").setInt(11, sub); + obj.getVar("custom").setInt(12, sizeRate); + obj.getVar("custom").setInt(13, lifeTime); + obj.getVar("custom").setInt(14, baseX); + obj.getVar("custom").setInt(15, baseY); + obj.getVar("custom").setInt(16, baseZ); + obj.getVar("custom").setInt(17, expsizeRate); + obj.getVar("buff").setInt(10, movespeedRate); + obj.getVar("buff").setInt(11, attackspeedRate); + obj.getVar("buff").setInt(12, decreasespeedLevel); + obj.getVar("buff").setInt(13, decreasespeedProb); + obj.getVar("buff").setInt(14, decreasespeedRate); + obj.getVar("buff").setInt(15, decreasespeedTime); + obj.getVar("buff").setInt(16, attackbonusRate); + obj.getVar("buff").setInt(17, criticaldamageRate); + obj.getVar("buff").setInt(18, buffTime); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case SKILL_BYKK_CHASERSEXPLOSION://炫紋強壓 + switch(subtype){ + case 1: + local delay = receiveData.readDword(); + local ani = sq_CreateAnimation("","character/mage/effect/animation/battlemage_bykk/chasersexplosion/charge.ani"); + obj.setCurrentAnimation(ani); + obj.setTimeEvent(0, delay, 1, false); + break; + case 2:// + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local sub = receiveData.readDword(); + local ani = sq_CreateAnimation("","passiveobject/battlemage_bykk/animation/chasersexplosion/floor.ani"); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 11)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + sq_SetAddWeaponDamage(attackInfo, true); + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); + if(sub < 1) createOnlyDrawObjectEX_Battlemage_bykk(obj,"passiveobject/battlemage_bykk/animation/chasersexplosion/exp.ani",true,obj.getDirection(),sq_GetXPos(obj),sq_GetYPos(obj),sq_GetZPos(obj),ENUM_DRAWLAYER_NORMAL,sizeRate,sizeRate); + 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_BYKK_UPPERSWING://天擊 + break; + case SKILL_BYKK_SWING://碎霸 + switch(subtype){ + case 1: + local sub = receiveData.readDword(); + local totalDamage = receiveData.readDword(); + local delay = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local speedRate = 5000 / delay; + local aniPath = "passiveobject/battlemage_bykk/animation/swing/swingarmonia_shoot.ani" + if(sub > 0) aniPath = "passiveobject/battlemage_bykk/animation/swing/swingarmonia_shoot_precencia.ani" + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 38)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local pAni = obj.getCurrentAnimation(); + pAni.setSpeedRate(speedRate.tofloat()); + 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_BYKK_HANDSTRIKE://落花掌 + 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){ + obj.getVar("target").clear_obj_vector(); + obj.getVar("target").push_obj_vector(targetObj); + sq_moveWithParent(targetObj, obj); + } + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 31)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + + local attackInfo = sq_GetCurrentAttackInfo(obj); + sq_SetCurrentAttacknBackForce(attackInfo, 1500); + obj.getVar("move").setInt(10, sq_GetXPos(obj)); + obj.getVar("move").setInt(11, obj.getDirection()); + obj.setTimeEvent(0, 50, -1, false); + break; + } + break; + case SKILL_BYKK_POKETHROW://圓舞棍 + switch(subtype){ + case 1: + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local ani = sq_CreateAnimation("","passiveobject/battlemage_bykk/animation/pokethrowsub1.ani"); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 14)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); + sq_AddDrawOnlyAniFromParent(obj, "passiveobject/battlemage_bykk/animation/pokethrowsub2.ani", 0, 0, 0); + 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_BYKK_RANDOMPIERCESTRIKE://流星閃影擊 + break; + case SKILL_BYKK_STRENGTHHANDSTRIKE://強襲流星打 + switch(subtype){ + case 1: + case 2: + case 3: + case 4: + case 11: + case 12: + case 13: + case 14: + if(sqrChr.getVar("kksshs").get_obj_vector_size() < 0) sqrChr.getVar("kksshs").clear_obj_vector(); + if(!sqrChr.getVar("kksshs").is_obj_vector(obj)) sqrChr.getVar("kksshs").push_obj_vector(obj); + if(subtype < 3 || subtype == 11 || subtype == 12) obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + else{ + local aniPath = "character/mage/effect/animation/battlemage_bykk/strengthhandstrike/fullcharge_front.ani"; + if(subtype == 4) aniPath = "character/mage/effect/animation/battlemage_bykk/strengthhandstrike/fullcharge_back.ani"; + else if(subtype == 13) aniPath = "character/mage/effect/animation/battlemage_bykk/strengthhandstrike/precencia/fullcharge_aura.ani"; + else if(subtype == 14) aniPath = "character/mage/effect/animation/battlemage_bykk/strengthhandstrike/precencia/precencia_fullcharge_back.ani"; + local ani = sq_CreateAnimation("", aniPath); + obj.setCurrentAnimation(ani); + } + break; + case 20: + local totalDamage = receiveData.readDword(); + local upForce = receiveData.readDword(); + local ani = sq_CreateAnimation("", "passiveobject/battlemage_bykk/animation/strengthhandstrike/shootingstar.ani"); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 36)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + sq_SetCurrentAttacknUpForce(attackInfo, upForce); + sq_moveWithParent(sqrChr, obj); + break; + case 21: + local totalDamage = receiveData.readDword(); + obj.getVar("custom").setInt(10, totalDamage); + local sizeRate = receiveData.readDword(); + local ani = sq_CreateAnimation("", "passiveobject/battlemage_bykk/animation/strengthhandstrike/shootingstar.ani"); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 36)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local currentAni = obj.getCurrentAnimation(); + sizeRate = sizeRate.tofloat() / 100.0; + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + obj.getVar("move").setInt(10, sq_GetXPos(obj)); + local delay = currentAni.getDelaySum(false); + obj.setTimeEvent(0, delay / 50, 40, true); + break; + case 22: + local totalDamage = receiveData.readDword(); + local ani = sq_CreateAnimation("", "passiveobject/battlemage_bykk/animation/strengthhandstrike/shootingstarexplosion_04.ani"); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 37)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local currentAni = obj.getCurrentAnimation(); + sq_AddAttackBox(currentAni, -50, -20, -50, 100, 40, 100); + break; + } + break; + case SKILL_BYKK_DRAGONSPEAR://煌龍偃月 + switch(subtype){ + case 1: + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local ani = sq_CreateAnimation("","passiveobject/battlemage_bykk/animation/dragondance/dragonspear_exp_03.ani"); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 15)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + 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 sub = receiveData.readDword(); + local zpos = receiveData.readDword(); + local speedRate = receiveData.readDword(); + obj.getVar("custom").setInt(10, totalDamage); + obj.getVar("custom").setInt(11, sizeRate); + obj.getVar("custom").setInt(12, sub); + obj.getVar("custom").setInt(13, zpos); + obj.getVar("custom").setInt(14, speedRate); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 3: + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local ani = sq_CreateAnimation("","passiveobject/battlemage_bykk/animation/dragonspearfinal.ani"); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 15)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/battlemage_bykk/animation/dragonspearfinalnone.ani"),true); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/battlemage_bykk/animation/dragonspearfinalxor.ani"),true); + sizeRate = sizeRate.tofloat() / 100.0; + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + break; + } + break; + case SKILL_BYKK_QUASAREXPLOSION://星紋隕爆 + switch(subtype){ + case 1: + local totalDamage = receiveData.readDword(); + local speedRate = receiveData.readDword(); + local ani = sq_CreateAnimation("","passiveobject/battlemage_bykk/animation/quasarexplosion/precencia/precencia_quasarexplosion_boom.ani"); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 35)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local pAni = obj.getCurrentAnimation(); + pAni.setSpeedRate(speedRate.tofloat()); + break; + } + break; + case SKILL_BYKK_CHASERCLUSTER://炫紋簇 + switch(subtype){ + case 1: + if(sqrChr.getVar("chaserClusterObj01").get_obj_vector_size() < 0) sqrChr.getVar("chaserClusterObj01").clear_obj_vector(); + if(!sqrChr.getVar("chaserClusterObj01").is_obj_vector(obj)) sqrChr.getVar("chaserClusterObj01").push_obj_vector(obj); + local totalDamage = receiveData.readDword(); + local createMax = receiveData.readDword(); + local lifeTime = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + print("lifeTime2 ="+lifeTime); + obj.getVar("custom").setInt(10, totalDamage); + obj.getVar("custom").setInt(11, createMax); + obj.getVar("custom").setInt(12, sizeRate); + obj.setTimeEvent(0, lifeTime, 1, false); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 2: + if(sqrChr.getVar("chaserClusterObj02").get_obj_vector_size() < 0) sqrChr.getVar("chaserClusterObj02").clear_obj_vector(); + if(!sqrChr.getVar("chaserClusterObj02").is_obj_vector(obj)) sqrChr.getVar("chaserClusterObj02").push_obj_vector(obj); + local lifeTime = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + obj.getVar("custom").setInt(12, sizeRate); + obj.setTimeEvent(0, lifeTime, 1, false); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case SKILL_BYKK_RANDOMPIERCESTRIKEEX://流星雷連擊 + 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){ + obj.getVar("tar").clear_obj_vector(); + obj.getVar("tar").push_obj_vector(targetObj); + local aniPath = [ + "character/mage/effect/animation/battlemage_bykk/randompiercestrikeex/talisman/finishthunder/a_thunder_a.ani", + "character/mage/effect/animation/battlemage_bykk/randompiercestrikeex/talisman/finishthunder/b_thunder_b.ani", + "character/mage/effect/animation/battlemage_bykk/randompiercestrikeex/talisman/finishthunder/c_thunder_c.ani" + ]; + local ani = sq_CreateAnimation("",aniPath[sq_getRandom(0,2)]); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 9)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.setTimeEvent(0, 80, 1, false); + } + break; + } + break; + case SKILL_BYKK_SWINGEX://閃擊碎霸 + switch(subtype){ + case 1:// + local totalDamage = receiveData.readDword(); + local delay = receiveData.readDword(); + local speedRate = 12000.0 / delay.tofloat(); + local sizeRate = receiveData.readDword(); + local ani = sq_CreateAnimation("", "character/mage/effect/animation/battlemage_bykk/swingex/precencia/swingeffect_twinkle_04.ani"); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 38)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local currentAni = obj.getCurrentAnimation(); + currentAni.setSpeedRate(speedRate); + sizeRate = sizeRate.tofloat() / 100.0; + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + break; + case 2: + local delay = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local speedRate = 7000.0 / delay.tofloat(); + local totalDamage = receiveData.readDword(); + local ani = sq_CreateAnimation("", "character/mage/effect/animation/battlemage_bykk/swingex/newswingeff_eff_08.ani"); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 38)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local currentAni = obj.getCurrentAnimation(); + currentAni.setSpeedRate(speedRate); + sizeRate = sizeRate.tofloat() / 100.0; + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + break; + } + break; + case SKILL_BYKK_FUSIONCHASER://炫紋融合 + switch(subtype){ + case 1: + if(sqrChr.getVar("kksfsChaser").get_obj_vector_size() < 0) sqrChr.getVar("kksfsChaser").clear_obj_vector(); + if(!sqrChr.getVar("kksfsChaser").is_obj_vector(obj)) sqrChr.getVar("kksfsChaser").push_obj_vector(obj); + local sub = receiveData.readDword(); + obj.getVar("custom").setInt(10, sub); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 2: + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local ani = sq_CreateAnimation("", "passiveobject/battlemage_bykk/animation/fusionchaser/precencia/explosion/fusionchaseree_00.ani"); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 26)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + 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: + case 4: + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local ani = sq_CreateAnimation("", "passiveobject/battlemage_bykk/animation/fusionchaser/fw.ani"); + if(subtype == 4) ani = sq_CreateAnimation("", "passiveobject/battlemage_bykk/animation/fusionchaser/dl.ani"); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 26)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local currentAni = obj.getCurrentAnimation(); + sizeRate = sizeRate.tofloat() / 100.0; + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + local delay = currentAni.getDelaySum(0, 1); + obj.setTimeEvent(3, delay, 1, false); + break; + } + break; + case SKILL_BYKK_CHASEREVOLUTION://炫紋進化 + break; + case SKILL_BYKK_DOUBLESWING://雙重錘擊 + switch(subtype){ + case 1: + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + createOnlyDrawObjectEX_Battlemage_bykk(obj,"passiveobject/battlemage_bykk/animation/doubleswing/double_swing_sub_down_dodge.ani",true,obj.getDirection(),sq_GetXPos(obj),sq_GetYPos(obj),0,ENUM_DRAWLAYER_BOTTOM,sizeRate,sizeRate); + local ani = sq_CreateAnimation("","passiveobject/battlemage_bykk/animation/doubleswing/double_swing_sub_up_dodge.ani"); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 32)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + 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_BYKK_TIMERBOMB://炫紋爆彈 + switch(subtype){ + case 1: + local totalDamage = receiveData.readDword(); + local totalDamage2 = receiveData.readDword(); + local lifeTime = receiveData.readDword(); + local hitTime = receiveData.readDword(); + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + local sub = receiveData.readDword(); + local sub2 = receiveData.readDword(); + local targetObj = sq_GetObject(obj, group, uniqueId); + if(targetObj){ + obj.getVar("target").clear_obj_vector(); + obj.getVar("target").push_obj_vector(targetObj); + sq_moveWithParent(targetObj, obj); + if(sub2 > 0) totalDamage2 = (lifeTime / hitTime) * totalDamage + totalDamage2; + obj.getVar("custom").setInt(10, totalDamage2); + local ani = sq_CreateAnimation("","passiveobject/battlemage_bykk/animation/timerbomb/1_monmu_dodge.ani"); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 39)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + if(sub > 0) obj.setTimeEvent(1, 50, 1, false); + else{ + obj.setTimeEvent(0, hitTime, -1, true); + obj.setTimeEvent(1, lifeTime, 1, false); + } + } + else sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case SKILL_BYKK_AVATARDANCE://使徒之舞 + break; + case SKILL_BYKK_AVATARFINISH://一騎當千碎霸 + switch(subtype){ + case 1: + local totalDamage = receiveData.readDword(); + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + local targetObj = sq_GetObject(obj, group, uniqueId); + obj.getVar("tar").clear_obj_vector(); + obj.getVar("tar").push_obj_vector(targetObj); + local ani = sq_CreateAnimation("","character/mage/effect/animation/battlemage_bykk/avatar/avataratkfinishtop_eff_j.ani"); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 0)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","character/mage/effect/animation/battlemage_bykk/avatar/avataratkfinishbot_eff_t.ani"),true); + obj.setTimeEvent(1, 1000, 1, false); + break; + case 2: + local totalDamage = receiveData.readDword(); + local speedRate = receiveData.readDword(); + local ani = sq_CreateAnimation("","passiveobject/battlemage_bykk/animation/avatar/avatarfinish_star_b.ani"); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 0)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local pAni = obj.getCurrentAnimation(); + pAni.setSpeedRate(speedRate.tofloat()); + break; + } + break; + case SKILL_BYKK_CHASERLAUNCHPOWERED://炫紋聚合 + break; + case SKILL_BYKK_PRECENCIA://太古化身 + break; + case SKILL_BYKK_LAYOFPRIMITIVE://炫紋之源:太古神光 + break; + } + + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo){ + attackInfo.setAttackType(ATTACKTYPE_PHYSICAL); + sq_SetAddWeaponDamage(attackInfo, true); + local element_kk_fire = sqrChr.getVar("element_kk").getInt(0); + local element_kk_water = sqrChr.getVar("element_kk").getInt(1); + local element_kk_dark = sqrChr.getVar("element_kk").getInt(2); + local element_kk_light = sqrChr.getVar("element_kk").getInt(3); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE) && element_kk_fire > 0) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER) && element_kk_water > 0) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK) && element_kk_dark > 0) attackInfo.setElement(ENUM_ELEMENT_DARK); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT) && element_kk_light > 0) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + } +} + + +function setState_po_battlemage_bykk(obj, state, datas) +{ + if(!obj) return; + + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").getInt(0); + local subtype = obj.getVar("subtype").getInt(0); + obj.getVar("state").setInt(0, state); + + switch(skillIndex){ + case SKILL_BYKK_THRUST://龍牙 + break; + case SKILL_BYKK_CHASER://炫紋 + local chaser_aniPath = [ + ["passiveobject/battlemage_bykk/animation/chaserdefaultappear.ani","passiveobject/battlemage_bykk/animation/evolutionchaser/evolutionchaserstart01_02.ani","passiveobject/battlemage_bykk/animation/chaseravatar/defaultchaserstart_03.ani","passiveobject/battlemage_bykk/animation/precencia/primitivechaser/start/ccon_00.ani"], + ["passiveobject/battlemage_bykk/animation/chaserdefaultstay.ani","passiveobject/battlemage_bykk/animation/evolutionchaser/evolutionchaserloop_02.ani","passiveobject/battlemage_bykk/animation/chaseravatar/defaultchaserloop_02.ani","passiveobject/battlemage_bykk/animation/precencia/primitivechaser/loop/cc_00.ani"], + ["passiveobject/battlemage_bykk/animation/chaserdefaultdisappear.ani","passiveobject/battlemage_bykk/animation/evolutionchaser/evolutionchaserend_00.ani","passiveobject/battlemage_bykk/animation/chaseravatar/defaultchaserend_00.ani","passiveobject/battlemage_bykk/animation/precencia/primitivechaser/end/ccoff_00.ani"], + ["passiveobject/battlemage_bykk/animation/chaserdefaultattack.ani","passiveobject/battlemage_bykk/animation/evolutionchaser/evolutionchaserspinsawloop_02.ani","passiveobject/battlemage_bykk/animation/chaseravatar/defaultchaserend_00.ani","passiveobject/battlemage_bykk/animation/precencia/primitivechaser/attack/attack_00.ani"], + ["passiveobject/battlemage_bykk/animation/chaserbomb.ani","passiveobject/battlemage_bykk/animation/chaserlaunchpowered/explosionevo_04.ani","passiveobject/battlemage_bykk/animation/chaserlaunchpowered/explosion_01.ani","passiveobject/battlemage_bykk/animation/precencia/primitivechaser/explosion/ccpp_00.ani"] + ]; + local sub = obj.getVar("custom").getInt(11); + local ani = sq_CreateAnimation("",chaser_aniPath[state - 20][sub]); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + local sizeRateSet = obj.getVar("custom").getInt(12); + local sizeRate_all = [[100,60,125,125],[150,80,125,125],[250,120,125,125]]; + local sizeRate = sizeRate_all[sizeRateSet][sub].tofloat() / 100.0; + if(state != 23){ + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + } + switch(state){ + case 20://開始 + if(!obj.isExistTimeEvent(10)) obj.setTimeEvent(10, 15, -1, true); + break; + case 21://持續 + local lifeTime = obj.getVar("custom").getInt(13); + obj.setTimeEvent(13, lifeTime, 1, false); + break; + case 22://結束 + break; + case 23://攻擊 + if(obj.getVar("target").get_obj_vector_size() > 0){ + local pAni = obj.getCurrentAnimation(); + local delaySum = pAni.getDelaySum(false); + if(delaySum > 300) delaySum = 300; + obj.setTimeEvent(14, delaySum / 20, 20, true); + } + break; + case 24://爆炸 + local hitMax = 1; + if(sub == 1) hitMax = sq_GetIntData(sqrChr, SKILL_BYKK_CHASEREVOLUTION, 7); + if(hitMax > 1){ + local pAni = obj.getCurrentAnimation(); + local delaySum = pAni.getDelaySum(false); + obj.setTimeEvent(0, delaySum / hitMax, hitMax - 1, false); + } + local atkIndex = [5,6,5,34]; + local totalDamage = obj.getVar("custom").getInt(10); + if(sub == 1){ + totalDamage = totalDamage * (65 + sq_GetLevelData(sqrChr, SKILL_BYKK_CHASER, 5, sq_GetSkillLevel(sqrChr, 22))) / 100; + } + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, atkIndex[sub])); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local decreasespeedLevel = obj.getVar("buff").getInt(12); + local decreasespeedProb = obj.getVar("buff").getInt(13); + local decreasespeedRate = obj.getVar("buff").getInt(14); + local decreasespeedTime = obj.getVar("buff").getInt(15); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_SLOW,decreasespeedProb,decreasespeedLevel,decreasespeedTime,decreasespeedRate); + switch(sub){ + case 0: sq_CreateParticle("passiveobject/battlemage_bykk/animation/chaserlaunchpowered/avatarchaserlaunchpowered.ptl", obj, 0, 0, 0, true, 30, 0, 1); break; + case 1: sq_CreateParticle("passiveobject/battlemage_bykk/animation/evolutionchaser/starparticle.ptl", obj, 0, 0, 0, true, 30, 0, 1); break; + case 2: sq_CreateParticle("passiveobject/battlemage_bykk/animation/chaseravatar/boomdefaultparticle.ptl", obj, 0, 0, 0, true, 30, 0, 1); break; + } + local expsizeRate = obj.getVar("custom").getInt(17); + print("obj-expsizeRate = "+expsizeRate); + local currentAni = obj.getCurrentAnimation(); + local sizeRate = expsizeRate.tofloat() / 100.0; + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + break; + } + break; + case SKILL_BYKK_CHASERSEXPLOSION://炫紋強壓 + break; + case SKILL_BYKK_UPPERSWING://天擊 + break; + case SKILL_BYKK_SWING://碎霸 + break; + case SKILL_BYKK_HANDSTRIKE://落花掌 + break; + case SKILL_BYKK_POKETHROW://圓舞棍 + break; + case SKILL_BYKK_RANDOMPIERCESTRIKE://流星閃影擊 + break; + case SKILL_BYKK_STRENGTHHANDSTRIKE://強襲流星打 + switch(subtype){ + case 1: + case 2: + case 11: + case 12: + local aniPath = [ + ["character/mage/effect/animation/battlemage_bykk/strengthhandstrike/start_front.ani","character/mage/effect/animation/battlemage_bykk/strengthhandstrike/loop_front.ani"], + ["character/mage/effect/animation/battlemage_bykk/strengthhandstrike/start_back.ani","character/mage/effect/animation/battlemage_bykk/strengthhandstrike/loop_back.ani"], + ["character/mage/effect/animation/battlemage_bykk/strengthhandstrike/precencia/start_front.ani","character/mage/effect/animation/battlemage_bykk/strengthhandstrike/precencia/precencia_loop_front.ani"], + ["character/mage/effect/animation/battlemage_bykk/strengthhandstrike/precencia/start_back.ani","character/mage/effect/animation/battlemage_bykk/strengthhandstrike/precencia/precencia_loop_back.ani"] + ]; + local tz = 1; + if(subtype > 10) tz = 9; + local ani = sq_CreateAnimation("",aniPath[subtype - tz][state - 20]); + obj.setCurrentAnimation(ani); + break; + } + break; + case SKILL_BYKK_DRAGONSPEAR://煌龍偃月 + switch(subtype){ + case 2: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","character/mage/effect/animation/avatar/dragonspear/chaser2.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(10001,sq_CreateAnimation("","character/mage/effect/animation/avatar/dragonspear/chaser1.ani"),true); + local delay = (obj.getVar("custom").getInt(12) * 200 + 1200) / obj.getVar("custom").getInt(14) * 100; + obj.setTimeEvent(0, delay, 1, false); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/battlemage_bykk/animation/dragonspearexplosion.ani"); + obj.setCurrentAnimation(ani); + local totalDamage = obj.getVar("custom").getInt(10); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 16)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local sizeRate = obj.getVar("custom").getInt(11); + local currentAni = obj.getCurrentAnimation(); + sizeRate = sizeRate.tofloat() / 100.0; + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + break; + } + break; + } + break; + case SKILL_BYKK_QUASAREXPLOSION://星紋隕爆 + break; + case SKILL_BYKK_CHASERCLUSTER://炫紋簇 + switch(subtype){ + case 1: + local aniPath = ["passiveobject/battlemage_bykk/animation/chasercluster/chaserclustermainloop.ani","passiveobject/battlemage_bykk/animation/chasercluster/chaserclustermainexplosion.ani"]; + local ani = sq_CreateAnimation("", aniPath[state - 20]); + obj.setCurrentAnimation(ani); + if(state > 20){ + local totalDamage = obj.getVar("custom").getInt(10); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 10)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local hitMax = obj.getVar("custom").getInt(11); + obj.setTimeEvent(1, 600 / hitMax, hitMax, true); + } + break; + case 2: + local aniPath = ["passiveobject/battlemage_bykk/animation/chasercluster/chaserclusterstart_00.ani","passiveobject/battlemage_bykk/animation/chasercluster/chaserclusterloop_00.ani","passiveobject/battlemage_bykk/animation/chasercluster/chaserclusterend_00.ani"]; + local ani = sq_CreateAnimation("", aniPath[state - 20]); + obj.setCurrentAnimation(ani); + break; + } + + local sizeRate = obj.getVar("custom").getInt(12); + local currentAni = obj.getCurrentAnimation(); + sizeRate = sizeRate.tofloat() / 100.0; + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + break; + case SKILL_BYKK_RANDOMPIERCESTRIKEEX://流星雷連擊 + break; + case SKILL_BYKK_SWINGEX://閃擊碎霸 + break; + case SKILL_BYKK_FUSIONCHASER://炫紋融合 + switch(subtype){ + case 1: + local sub = obj.getVar("custom").getInt(10); + local aniPath = [ + ["character/mage/effect/animation/battlemage_bykk/fusionchaser/nn_cast.ani","character/mage/effect/animation/battlemage_bykk/fusionchaser/a/nnfusionchaserfull_loop.ani","character/mage/effect/animation/battlemage_bykk/fusionchaser/precencia/pp_cast.ani"], + ["passiveobject/battlemage_bykk/animation/fusionchaser/full/normalspin_fcspin_normal.ani","passiveobject/battlemage_bykk/animation/fusionchaser/full/icespin_fcspin_normal.ani","passiveobject/battlemage_bykk/animation/fusionchaser/precencia/spin/fcspin2_00.ani"], + ["passiveobject/battlemage_bykk/animation/fusionchaser/full/normalspin_r_fcspin_normal.ani","passiveobject/battlemage_bykk/animation/fusionchaser/full/icespin_r_fcspin_normal.ani","passiveobject/battlemage_bykk/animation/fusionchaser/precencia/spin/fcspin2_r_00.ani"] + ]; + local ani = sq_CreateAnimation("", aniPath[state - 20][sub]); + obj.setCurrentAnimation(ani); + if(state == 21){ + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath[state - 19][sub]),true); + } + break; + } + break; + case SKILL_BYKK_CHASEREVOLUTION://炫紋進化 + break; + case SKILL_BYKK_DOUBLESWING://雙重錘擊 + break; + case SKILL_BYKK_TIMERBOMB://炫紋爆彈 + break; + case SKILL_BYKK_AVATARDANCE://使徒之舞 + break; + case SKILL_BYKK_AVATARFINISH://一騎當千碎霸 + break; + case SKILL_BYKK_CHASERLAUNCHPOWERED://炫紋聚合 + break; + case SKILL_BYKK_PRECENCIA://太古化身 + break; + case SKILL_BYKK_LAYOFPRIMITIVE://炫紋之源:太古神光 + break; + } + + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo){ + attackInfo.setAttackType(ATTACKTYPE_PHYSICAL); + sq_SetAddWeaponDamage(attackInfo, true); + local element_kk_fire = sqrChr.getVar("element_kk").getInt(0); + local element_kk_water = sqrChr.getVar("element_kk").getInt(1); + local element_kk_dark = sqrChr.getVar("element_kk").getInt(2); + local element_kk_light = sqrChr.getVar("element_kk").getInt(3); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE) && element_kk_fire > 0) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER) && element_kk_water > 0) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK) && element_kk_dark > 0) attackInfo.setElement(ENUM_ELEMENT_DARK); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT) && element_kk_light > 0) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + } +} + +function onEndCurrentAni_po_battlemage_bykk(obj) +{ + if(!obj) return; + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").getInt(0); + local subtype = obj.getVar("subtype").getInt(0); + local state = obj.getVar("state").getInt(0); + + switch(skillIndex){ + case SKILL_BYKK_THRUST://龍牙 + break; + case SKILL_BYKK_CHASER://炫紋 + switch(state){ + case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; + case 22: sq_SendDestroyPacketPassiveObject(obj); break; + case 23: obj.addSetStatePacket(24, null, STATE_PRIORITY_AUTO, false, ""); break; + case 24: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + case SKILL_BYKK_CHASERSEXPLOSION://炫紋強壓 + sq_SendDestroyPacketPassiveObject(obj); + break; + case SKILL_BYKK_UPPERSWING://天擊 + break; + case SKILL_BYKK_SWING://碎霸 + sq_SendDestroyPacketPassiveObject(obj); + break; + case SKILL_BYKK_HANDSTRIKE://落花掌 + break; + case SKILL_BYKK_POKETHROW://圓舞棍 + sq_SendDestroyPacketPassiveObject(obj); + break; + case SKILL_BYKK_RANDOMPIERCESTRIKE://流星閃影擊 + break; + case SKILL_BYKK_STRENGTHHANDSTRIKE://強襲流星打 + switch(subtype){ + case 1: + case 2: + case 11: + case 12: + switch(state){ + case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; + } + break; + case 3: + case 4: + case 13: + case 14: + case 20: + case 21: + case 22: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case SKILL_BYKK_DRAGONSPEAR://煌龍偃月 + switch(subtype){ + case 1: sq_SendDestroyPacketPassiveObject(obj); break; + case 2: + switch(state){ + case 21: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + case 3: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + case SKILL_BYKK_QUASAREXPLOSION://星紋隕爆 + sq_SendDestroyPacketPassiveObject(obj); + break; + case SKILL_BYKK_CHASERCLUSTER://炫紋簇 + switch(subtype){ + case 2: + switch(state){ + case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; + case 22: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + } + break; + case SKILL_BYKK_RANDOMPIERCESTRIKEEX://流星雷連擊 + sq_SendDestroyPacketPassiveObject(obj); + break; + case SKILL_BYKK_SWINGEX://閃擊碎霸 + sq_SendDestroyPacketPassiveObject(obj); + break; + case SKILL_BYKK_FUSIONCHASER://炫紋融合 + switch(subtype){ + case 1: + switch(state){ + case 22: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + case 2: sq_SendDestroyPacketPassiveObject(obj); break; + case 3: sq_SendDestroyPacketPassiveObject(obj); break; + case 4: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + case SKILL_BYKK_CHASEREVOLUTION://炫紋進化 + break; + case SKILL_BYKK_DOUBLESWING://雙重錘擊 + sq_SendDestroyPacketPassiveObject(obj); + break; + case SKILL_BYKK_TIMERBOMB://炫紋爆彈 + sq_SendDestroyPacketPassiveObject(obj); + break; + case SKILL_BYKK_AVATARDANCE://使徒之舞 + break; + case SKILL_BYKK_AVATARFINISH://一騎當千碎霸 + sq_SendDestroyPacketPassiveObject(obj); + break; + case SKILL_BYKK_CHASERLAUNCHPOWERED://炫紋聚合 + break; + case SKILL_BYKK_PRECENCIA://太古化身 + break; + case SKILL_BYKK_LAYOFPRIMITIVE://炫紋之源:太古神光 + break; + } +} + +function onTimeEvent_po_battlemage_bykk(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return; + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").getInt(0); + local subtype = obj.getVar("subtype").getInt(0); + local state = obj.getVar("state").getInt(0); + + switch(skillIndex){ + case SKILL_BYKK_THRUST://龍牙 + break; + case SKILL_BYKK_CHASER://炫紋 + switch(timeEventIndex){ + case 0: obj.resetHitObjectList(); break; + case 10://判斷距離 + if(sqrChr.getState() == STATE_DIE) sq_SendDestroyPacketPassiveObject(obj); + local baseX = obj.getVar("custom").getInt(14), baseY = obj.getVar("custom").getInt(15), baseZ = obj.getVar("custom").getInt(16); + local disX = sq_Abs(sq_GetXPos(obj) - sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),baseX)); + local disY = sq_Abs(sq_GetYPos(obj) - sq_GetYPos(sqrChr) - baseY); + local disZ = sq_Abs(sq_GetZPos(obj) - sq_GetZPos(sqrChr) - baseZ); + local direction = sqrChr.getDirection(); + if(obj.getDirection() != direction) obj.setDirection(direction); + if(disX > 10){ + local baseM = 25; + local moveX = disX / baseM + 1; + if(sq_GetXPos(obj) > sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),baseX)) sq_setCurrentAxisPos(obj, 0, sq_GetXPos(obj) - moveX); + else sq_setCurrentAxisPos(obj, 0, sq_GetXPos(obj) + moveX); + } + if(disY > 0){ + local baseM = 25; + local moveY = disY / baseM + 1; + if(sq_GetYPos(obj) > sq_GetYPos(sqrChr)) sq_setCurrentAxisPos(obj, 1, sq_GetYPos(obj) - moveY); + else sq_setCurrentAxisPos(obj, 1, sq_GetYPos(obj) + moveY); + } + if(disZ > 0){ + local baseM = 25; + local moveZ = disZ / baseM + 1; + if(sq_GetZPos(obj) - baseZ > sq_GetZPos(sqrChr)) sq_setCurrentAxisPos(obj, 2, sq_GetZPos(obj) - moveZ); + else sq_setCurrentAxisPos(obj, 2, sq_GetZPos(obj) + moveZ); + } + if(disX <= 10 && disY <= 0 && disZ <= 0){ + obj.stopTimeEvent(10); + obj.setTimeEvent(11,300,-1,false); + } + break; + case 11://移動 + local baseX = obj.getVar("custom").getInt(14), baseY = obj.getVar("custom").getInt(15), baseZ = obj.getVar("custom").getInt(16); + local disX = sq_Abs(sq_GetXPos(obj) - sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),baseX)); + local disY = sq_Abs(sq_GetYPos(obj) - sq_GetYPos(sqrChr) - baseY); + local disZ = sq_Abs(sq_GetZPos(obj) - sq_GetZPos(sqrChr) - baseZ); + if(disX > 10 || disY > 0 || disZ > 5){ + obj.stopTimeEvent(11); + obj.stopTimeEvent(12); + obj.setTimeEvent(10,15,-1,false); + } + else{ + if(!obj.isExistTimeEvent(12)) obj.setTimeEvent(12, 100, -1, true); + } + break; + case 12: + local v = sq_GetUniformVelocity(0, 2, timeEventCount % 20, 5); + if(timeEventCount % 20 > 5) v = sq_GetUniformVelocity(2, 0, timeEventCount % 20 - 5, 5); + if(timeEventCount % 20 > 10) v = sq_GetUniformVelocity(0, -2, timeEventCount % 20 - 10, 5); + if(timeEventCount % 20 > 15) v = sq_GetUniformVelocity(-2, 0, timeEventCount % 20 - 15, 5); + sq_setCurrentAxisPos(obj, 2, sq_GetZPos(obj) + v); + break; + case 13://轉至結束 + if(obj.getState() < 22) obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 14://移動到目標 + local targetObj = obj.getVar("target").get_obj_vector(0); + if(targetObj && targetObj.getState() != STATE_DIE){ + local moveX = sq_GetUniformVelocity(sq_GetXPos(obj), sq_GetXPos(targetObj), timeEventCount, 20); + local moveY = sq_GetUniformVelocity(sq_GetYPos(obj), sq_GetYPos(targetObj), timeEventCount, 20); + local moveZ = sq_GetUniformVelocity(sq_GetZPos(obj), sq_GetZPos(targetObj) + sq_GetObjectHeight(targetObj) / 2, timeEventCount, 20); + sq_setCurrentAxisPos(obj, 0, moveX); + sq_setCurrentAxisPos(obj, 1, moveY); + sq_setCurrentAxisPos(obj, 2, moveZ); + } + if(timeEventCount >= 20) obj.addSetStatePacket(24, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 15: + local moveX = sq_GetUniformVelocity(sq_GetXPos(obj), obj.getVar("moveSet").getInt(10), timeEventCount, 15); + local moveZ = sq_GetUniformVelocity(sq_GetZPos(obj), obj.getVar("moveSet").getInt(11), timeEventCount, 15); + sq_setCurrentAxisPos(obj, 0, moveX); + sq_setCurrentAxisPos(obj, 2, moveZ); + if(timeEventCount >= 15){ + obj.setTimeEvent(16, obj.getVar("moveSet").getInt(14) / 3, 1, false); + } + break; + case 16: + obj.setTimeEvent(17, obj.getVar("moveSet").getInt(14) / 45, 15, true); + break; + case 17: + local moveX = sq_GetUniformVelocity(sq_GetXPos(obj), obj.getVar("moveSet").getInt(12), timeEventCount, 15); + local moveZ = sq_GetUniformVelocity(sq_GetZPos(obj), obj.getVar("moveSet").getInt(13), timeEventCount, 15); + sq_setCurrentAxisPos(obj, 0, moveX); + sq_setCurrentAxisPos(obj, 2, moveZ); + if(timeEventCount >= 15){ + sq_SendDestroyPacketPassiveObject(obj); + } + break; + + } + break; + case SKILL_BYKK_CHASERSEXPLOSION://炫紋強壓 + switch(timeEventIndex){ + case 0: + sq_AddDrawOnlyAniFromParent(sqrChr, "character/mage/effect/animation/battlemage_bykk/chasersexplosion/smash.ani", 0,0,0); + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case SKILL_BYKK_UPPERSWING://天擊 + break; + case SKILL_BYKK_SWING://碎霸 + break; + case SKILL_BYKK_HANDSTRIKE://落花掌 + switch(timeEventIndex){ + case 0: + local targetObj = obj.getVar("target").get_obj_vector(0); + if(!targetObj || targetObj.getState() == STATE_DIE || timeEventCount >= 30) sq_SendDestroyPacketPassiveObject(obj); + local baseX = obj.getVar("move").getInt(10); + local direction = obj.getVar("move").getInt(11); + if(direction == ENUM_DIRECTION_LEFT){ + local nowX = sq_GetXPos(obj); + if(nowX < baseX){ + sq_SendHitObjectPacket(obj,targetObj,0,0,sq_GetObjectHeight(targetObj) / 2); + obj.stopTimeEvent(0); + obj.setTimeEvent(1, 50, 1, false); + } + else obj.getVar("move").setInt(10, nowX); + } + else if(direction == ENUM_DIRECTION_RIGHT){ + local nowX = sq_GetXPos(obj); + if(nowX > baseX){ + sq_SendHitObjectPacket(obj,targetObj,0,0,sq_GetObjectHeight(targetObj) / 2); + obj.stopTimeEvent(0); + obj.setTimeEvent(1, 50, 1, false); + } + else obj.getVar("move").setInt(10, nowX); + } + break; + case 1: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + case SKILL_BYKK_POKETHROW://圓舞棍 + break; + case SKILL_BYKK_RANDOMPIERCESTRIKE://流星閃影擊 + break; + case SKILL_BYKK_STRENGTHHANDSTRIKE://強襲流星打 + switch(timeEventIndex){ + case 0: + local v = sq_GetUniformVelocity(0, 500, timeEventCount, 40); + local dstX = sq_GetDistancePos(obj.getVar("move").getInt(10), obj.getDirection(), v); + sq_setCurrentAxisPos(obj, 0, dstX); + break; + } + break; + case SKILL_BYKK_DRAGONSPEAR://煌龍偃月 + switch(timeEventIndex){ + case 0: + obj.getVar("move").setInt(10, sq_GetXPos(obj)); + obj.getVar("move").setInt(11, sq_GetZPos(obj)); + local speedRate = obj.getVar("custom").getInt(14); + local delay = 4 / speedRate * 100; + obj.setTimeEvent(1, delay, 30, true); + break; + case 1: + local moveX = sq_GetDistancePos(sq_GetXPos(sqrChr), sqrChr.getDirection(), 300); + local moveZ = obj.getVar("custom").getInt(13); + local vx = sq_GetUniformVelocity(obj.getVar("move").getInt(10), moveX, timeEventCount, 30); + local vz = sq_GetUniformVelocity(obj.getVar("move").getInt(11), moveZ, timeEventCount, 30); + sq_setCurrentAxisPos(obj, 0, vx); + sq_setCurrentAxisPos(obj, 2, vz); + if(timeEventCount >= 30) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case SKILL_BYKK_QUASAREXPLOSION://星紋隕爆 + break; + case SKILL_BYKK_CHASERCLUSTER://炫紋簇 + switch(timeEventIndex){ + case 0: + if(subtype == 1) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + else obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 1: + obj.resetHitObjectList(); + if(timeEventCount >= obj.getVar("custom").getInt(11)){ + if(obj.getVar("custom").getInt(11) != 1) sq_SendDestroyPacketPassiveObject(obj); + else obj.setTimeEvent(2, 100, 1, false); + } + break; + case 2: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + case SKILL_BYKK_RANDOMPIERCESTRIKEEX://流星雷連擊 + switch(timeEventIndex){ + case 0: + local targetObj = obj.getVar("tar").get_obj_vector(0); + if(targetObj) sq_SendHitObjectPacket(obj,targetObj,0,0,sq_GetObjectHeight(targetObj)); + break; + } + break; + case SKILL_BYKK_SWINGEX://閃擊碎霸 + break; + case SKILL_BYKK_FUSIONCHASER://炫紋融合 + switch(timeEventIndex){ + case 0: + if(sqrChr){ + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(sqrChr), sqrChr.getDirection(), 80)); + if(timeEventCount >= 30 && state == 20) sq_SendDestroyPacketPassiveObject(obj); + } + else sq_SendDestroyPacketPassiveObject(obj); + break; + case 1: sq_SendDestroyPacketPassiveObject(obj); break; + case 2: + local targetObj = obj.getVar("tar").get_obj_vector(0); + if(targetObj && targetObj.getState() != STATE_DIE){ + sq_SendHitObjectPacket(obj,targetObj,0,0,sq_GetZPos(obj)); + } + else sq_SendDestroyPacketPassiveObject(obj); + break; + case 3: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + case SKILL_BYKK_CHASEREVOLUTION://炫紋進化 + break; + case SKILL_BYKK_DOUBLESWING://雙重錘擊 + break; + case SKILL_BYKK_TIMERBOMB://炫紋爆彈 + switch(timeEventIndex){ + case 0: + local targetObj = obj.getVar("target").get_obj_vector(0); + if(targetObj && targetObj.getState() != STATE_DIE){ + sq_SendHitObjectPacket(obj,targetObj,0,0,sq_GetZPos(obj)); + } + else sq_SendDestroyPacketPassiveObject(obj); + break; + case 1: + obj.stopTimeEvent(0); + local totalDamage = obj.getVar("custom").getInt(10); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 40)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local targetObj = obj.getVar("target").get_obj_vector(0); + if(targetObj && targetObj.getState() != STATE_DIE){ + sq_SendHitObjectPacket(obj,targetObj,0,0,sq_GetZPos(obj)); + obj.setTimeEvent(2, 100, 1, false); + } + else sq_SendDestroyPacketPassiveObject(obj); + break; + case 2: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + case SKILL_BYKK_AVATARDANCE://使徒之舞 + break; + case SKILL_BYKK_AVATARFINISH://一騎當千碎霸 + switch(timeEventIndex){ + case 1: + local targetObj = obj.getVar("tar").get_obj_vector(0); + if(targetObj) sq_SendHitObjectPacket(obj,targetObj,0,0,sq_GetObjectHeight(targetObj) / 2); + break; + } + break; + case SKILL_BYKK_CHASERLAUNCHPOWERED://炫紋聚合 + break; + case SKILL_BYKK_PRECENCIA://太古化身 + break; + case SKILL_BYKK_LAYOFPRIMITIVE://炫紋之源:太古神光 + break; + } +} + +function onAttack_po_battlemage_bykk(obj, damager, boundingBox, isStuck) +{ + if(!obj) return; + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").getInt(0); + local subtype = obj.getVar("subtype").getInt(0); + local state = obj.getVar("state").getInt(0); + + switch(skillIndex){ + case SKILL_BYKK_THRUST://龍牙 + break; + case SKILL_BYKK_CHASER://炫紋 + if(!sqrChr || sqrChr.getState() == STATE_DIE) break; + if(sq_GetSkillLevel(sqrChr, SKILL_BYKK_ARMONIA) > 0 && CNSquirrelAppendage.sq_IsAppendAppendage(sqrChr, CHASER_APDPATH)) break; + local addAppendage = CNSquirrelAppendage.sq_GetAppendage(sqrChr, CHASER_APDPATH); + if(!addAppendage){ + addAppendage = CNSquirrelAppendage.sq_AppendAppendage(sqrChr, sqrChr, -1, false, CHASER_APDPATH, true); + // setDamageRate_BattleMage_bykk(obj); + } + local buffTime = obj.getVar("buff").getInt(18); + if(sq_GetSkillLevel(sqrChr, SKILL_BYKK_ARMONIA) < 1) addAppendage.sq_SetValidTime(buffTime); + else addAppendage.sq_SetValidTime(0); + addAppendage.setEnableIsBuff(true); + addAppendage.setAppendCauseSkill(BUFF_CAUSE_SKILL, sq_getJob(sqrChr), SKILL_BYKK_CHASER, sq_GetSkillLevel(sqrChr, SKILL_BYKK_CHASER)); + CNSquirrelAppendage.sq_Append(addAppendage, sqrChr, sqrChr, true); + + local movespeedRate = obj.getVar("buff").getInt(10); + local attackspeedRate = obj.getVar("buff").getInt(11); + local criticaldamageRate = obj.getVar("buff").getInt(17); + local change_appendage = addAppendage.sq_getChangeStatus("kkschaser"); + if(!change_appendage) change_appendage = addAppendage.sq_AddChangeStatus("kkschaser",sqrChr, sqrChr, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK, true, 1000); + if(change_appendage){ + change_appendage.clearParameter(); + change_appendage.addParameter(CHANGE_STATUS_TYPE_MOVE_SPEED, false, (movespeedRate).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_ATTACK_SPEED, false, (attackspeedRate).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_PHYSICAL_CRITICAL_HIT_RATE, false, (criticaldamageRate*0.1).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_MAGICAL_CRITICAL_HIT_RATE, false, (criticaldamageRate*0.1).tofloat()); + } + break; + case SKILL_BYKK_CHASERSEXPLOSION://炫紋強壓 + break; + case SKILL_BYKK_UPPERSWING://天擊 + break; + case SKILL_BYKK_SWING://碎霸 + break; + case SKILL_BYKK_HANDSTRIKE://落花掌 + break; + case SKILL_BYKK_POKETHROW://圓舞棍 + break; + case SKILL_BYKK_RANDOMPIERCESTRIKE://流星閃影擊 + break; + case SKILL_BYKK_STRENGTHHANDSTRIKE://強襲流星打 + switch(subtype){ + case 21: + if(damager.isObjectType(OBJECTTYPE_ACTIVE)){ + local totalDamage = obj.getVar("custom").getInt(10) * 22 / 100; + cearteSkillPassive_Battlemage_bykk(sqrChr,damager,PASSIVEOBJECT_BYKK_BATTLEMAGE,0,0, sq_GetCenterZPos(boundingBox) - 10,obj.getDirection(),SKILL_BYKK_STRENGTHHANDSTRIKE,22,totalDamage,0,0,0,0,0,0,0); + } + break; + } + break; + case SKILL_BYKK_DRAGONSPEAR://煌龍偃月 + break; + case SKILL_BYKK_QUASAREXPLOSION://星紋隕爆 + break; + case SKILL_BYKK_CHASERCLUSTER://炫紋簇 + if(damager.isObjectType(OBJECTTYPE_ACTIVE)) sq_SetShake(obj, 5, 50); + break; + case SKILL_BYKK_RANDOMPIERCESTRIKEEX://流星雷連擊 + break; + case SKILL_BYKK_SWINGEX://閃擊碎霸 + break; + case SKILL_BYKK_FUSIONCHASER://炫紋融合 + break; + case SKILL_BYKK_CHASEREVOLUTION://炫紋進化 + break; + case SKILL_BYKK_DOUBLESWING://雙重錘擊 + break; + case SKILL_BYKK_TIMERBOMB://炫紋爆彈 + break; + case SKILL_BYKK_AVATARDANCE://使徒之舞 + break; + case SKILL_BYKK_AVATARFINISH://一騎當千碎霸 + switch(subtype){ + case 2: + if(isStuck) return; + if(!damager.isObjectType(OBJECTTYPE_ACTIVE)) return; + obj.sq_PlaySound("AVATAR_FINISH_EFFECT"); + local apdPath = "character/mage/battlemage_bykk/ap/ap_avatarfinish.nut"; + local addAppendage = CNSquirrelAppendage.sq_AppendAppendage(damager, sqrChr, SKILL_BYKK_AVATARFINISH, false, apdPath, true); + sq_HoldAndDelayDie(damager, sqrChr, true, true, true, 200, 200, ENUM_DIRECTION_NEUTRAL, addAppendage); + addAppendage.sq_SetValidTime(2000); + local totalDamage = sqrChr.sq_GetBonusRateWithPassive(SKILL_BYKK_AVATARFINISH, -1, 1, 1.0) + 100; + local group = sq_GetGroup(damager); + local uniqueId = sq_GetUniqueId(damager); + cearteSkillPassive_Battlemage_bykk(sqrChr,damager,PASSIVEOBJECT_BYKK_BATTLEMAGE,0,0,sq_GetObjectHeight(damager) / 2,sqrChr.getDirection(),SKILL_BYKK_AVATARFINISH,1,totalDamage,group,uniqueId,0,0,0,0,0); + break; + } + break; + case SKILL_BYKK_CHASERLAUNCHPOWERED://炫紋聚合 + break; + case SKILL_BYKK_PRECENCIA://太古化身 + break; + case SKILL_BYKK_LAYOFPRIMITIVE://炫紋之源:太古神光 + break; + } + + if(skillIndex != SKILL_BYKK_CHASER){ + if(isStuck) return; + if(!sqrChr || sqrChr.getState() == STATE_DIE) return; + if(!damager.isObjectType(OBJECTTYPE_ACTIVE)) return; + if(!CNSquirrelAppendage.sq_IsAppendAppendage(obj, CHASERLAUNCH_APDPATH)) CNSquirrelAppendage.sq_AppendAppendage(sqrChr, sqrChr, -1, false, CHASERLAUNCH_APDPATH, true); + local addAppendage = CNSquirrelAppendage.sq_GetAppendage(sqrChr, CHASERLAUNCH_APDPATH); + if(addAppendage){ + local buffTime = sq_GetLevelData(sqrChr, SKILL_BYKK_CHASERLAUNCH, 0, sq_GetSkillLevel(sqrChr, SKILL_BYKK_CHASERLAUNCH)); + addAppendage.sq_SetValidTime(buffTime); + addAppendage.getVar("target").clear_obj_vector(); + addAppendage.getVar("target").push_obj_vector(damager); + } + } +} + +function onKeyFrameFlag_po_battlemage_bykk(obj, flagIndex) +{ + if(!obj) return; + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").getInt(0); + local subtype = obj.getVar("subtype").getInt(0); + local state = obj.getVar("state").getInt(0); + + switch(skillIndex){ + case SKILL_BYKK_THRUST://龍牙 + break; + case SKILL_BYKK_CHASER://炫紋 + break; + case SKILL_BYKK_CHASERSEXPLOSION://炫紋強壓 + break; + case SKILL_BYKK_UPPERSWING://天擊 + break; + case SKILL_BYKK_SWING://碎霸 + break; + case SKILL_BYKK_HANDSTRIKE://落花掌 + break; + case SKILL_BYKK_POKETHROW://圓舞棍 + break; + case SKILL_BYKK_RANDOMPIERCESTRIKE://流星閃影擊 + break; + case SKILL_BYKK_STRENGTHHANDSTRIKE://強襲流星打 + break; + case SKILL_BYKK_DRAGONSPEAR://煌龍偃月 + break; + case SKILL_BYKK_QUASAREXPLOSION://星紋隕爆 + break; + case SKILL_BYKK_CHASERCLUSTER://炫紋簇 + break; + case SKILL_BYKK_RANDOMPIERCESTRIKEEX://流星雷連擊 + break; + case SKILL_BYKK_SWINGEX://閃擊碎霸 + break; + case SKILL_BYKK_FUSIONCHASER://炫紋融合 + break; + case SKILL_BYKK_CHASEREVOLUTION://炫紋進化 + break; + case SKILL_BYKK_DOUBLESWING://雙重錘擊 + break; + case SKILL_BYKK_TIMERBOMB://炫紋爆彈 + break; + case SKILL_BYKK_AVATARDANCE://使徒之舞 + break; + case SKILL_BYKK_AVATARFINISH://一騎當千碎霸 + break; + case SKILL_BYKK_CHASERLAUNCHPOWERED://炫紋聚合 + break; + case SKILL_BYKK_PRECENCIA://太古化身 + break; + case SKILL_BYKK_LAYOFPRIMITIVE://炫紋之源:太古神光 + break; + } +} + +function procAppend_po_battlemage_bykk(obj) +{ + if(!obj) return; + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").getInt(0); + local subtype = obj.getVar("subtype").getInt(0); + local state = obj.getVar("state").getInt(0); + + switch(skillIndex){ + case SKILL_BYKK_THRUST://龍牙 + break; + case SKILL_BYKK_CHASER://炫紋 + break; + case SKILL_BYKK_CHASERSEXPLOSION://炫紋強壓 + break; + case SKILL_BYKK_UPPERSWING://天擊 + break; + case SKILL_BYKK_SWING://碎霸 + break; + case SKILL_BYKK_HANDSTRIKE://落花掌 + break; + case SKILL_BYKK_POKETHROW://圓舞棍 + break; + case SKILL_BYKK_RANDOMPIERCESTRIKE://流星閃影擊 + break; + case SKILL_BYKK_STRENGTHHANDSTRIKE://強襲流星打 + break; + case SKILL_BYKK_DRAGONSPEAR://煌龍偃月 + break; + case SKILL_BYKK_QUASAREXPLOSION://星紋隕爆 + break; + case SKILL_BYKK_CHASERCLUSTER://炫紋簇 + break; + case SKILL_BYKK_RANDOMPIERCESTRIKEEX://流星雷連擊 + break; + case SKILL_BYKK_SWINGEX://閃擊碎霸 + break; + case SKILL_BYKK_FUSIONCHASER://炫紋融合 + break; + case SKILL_BYKK_CHASEREVOLUTION://炫紋進化 + break; + case SKILL_BYKK_DOUBLESWING://雙重錘擊 + break; + case SKILL_BYKK_TIMERBOMB://炫紋爆彈 + break; + case SKILL_BYKK_AVATARDANCE://使徒之舞 + break; + case SKILL_BYKK_AVATARFINISH://一騎當千碎霸 + break; + case SKILL_BYKK_CHASERLAUNCHPOWERED://炫紋聚合 + break; + case SKILL_BYKK_PRECENCIA://太古化身 + break; + case SKILL_BYKK_LAYOFPRIMITIVE://炫紋之源:太古神光 + break; + } +} + + + + +function onSetState_mage_attack(obj, state, datas, isResetTimer) +{ + if(!obj) return; + local index = obj.sq_GetVectorData(datas, 0); + // if(index == 0){ + // local set = obj.sq_GetVectorData(datas, 1); + // print("test :"+set); + // if(set == 100){ + // obj.setTimeEvent(1, 10, 1, false); + // } + // } + // print("index = "+index); + if(index == 50){ + obj.sq_SetCurrentAnimation(205); + obj.getVar("setattack").setInt(0, index); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 1)); + // sq_SetVelocity(obj, 0, 0.0); + return; + } + if(sq_GetSkillLevel(obj, SKILL_BYKK_ENABLEFINISHATTACK) > 0){ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + local aniName = ["Attack1","Attack2","Attack3"]; + local ani = getCurrentAnimation_precencia(obj, aniName[index], false, false); + obj.setCurrentAnimation(ani); + } + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + local aniName = [206,207,208]; + obj.sq_SetCurrentAnimation(aniName[index]); + } + else obj.sq_SetCurrentAnimation(10 + index); + local atkIndex = [9,10,11], speedRate = [20,50,20]; + local totalDamage = sq_GetLevelData(obj, 174, 0, sq_GetSkillLevel(obj, 174)) + 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, atkIndex[index])); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + sq_SetVelocity(obj, 0, speedRate[index].tofloat()); + } +} + +function onEndCurrentAni_mage_attack(obj) +{ + local substate = obj.getVar("setattack").getInt(0) + if(substate == 50){ + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + } + return; +} + +function onTimeEvent_mage_attack(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + switch(timeEventIndex){ + case 1: + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onAttack_mage_dashattack(obj, damager, boundingBox, isStuck) +{ + if(!obj) return; +} + +function onAttack_mage_jumpattack(obj, damager, boundingBox, isStuck) +{ + if(!obj) return; +} + +function onAfterSetState_mage_dashattack(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.applyBasicAttackUp(sq_GetCurrentAttackInfo(obj),obj.getState()); + sq_SetCurrentAttackInfo(obj,sq_GetCurrentAttackInfo(obj)); + local speed = 1.0; + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) speed = 1.3; + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) speed = 1.6; + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, speed, speed); +} + +function onAfterSetState_mage_jumpattack(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.applyBasicAttackUp(sq_GetCurrentAttackInfo(obj),obj.getState()); + sq_SetCurrentAttackInfo(obj,sq_GetCurrentAttackInfo(obj)); + local speed = 1.0; + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) speed = 1.3; + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) speed = 1.6; + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, speed, speed); +} + + + +function checkExecutableSkill_Avatardance(obj) +{ + if (!obj) return false; + if(obj.getState() == SKILL_BYKK_PRECENCIA && obj.getSkillSubState() < 10) return false; + local isUse = obj.sq_IsUseSkill(SKILL_BYKK_AVATARDANCE); + if (isUse){ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) obj.getVar("skillSub").setInt(100, 2); + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) obj.getVar("skillSub").setInt(100, 1); + else obj.getVar("skillSub").setInt(100, 0); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_AVATARDANCE, STATE_PRIORITY_IGNORE_FORCE, true); + return true; + } + return false; +} + +function checkCommandEnable_Avatardance(obj) +{ + if (!obj) return false; + return true; +} + +function onSetState_Avatardance(obj, state, datas, isResetTimer) +{ + if(!obj) return; + local subState = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(subState); + obj.sq_StopMove(); + obj.sq_ZStop(); + local aniSet = [ + [84,85,86,87,88,89,90,91,297], + ["AvatarDance_A","AvatarDance_B","AvatarDance_C","AvatarDance_D","AvatarDance_E01","AvatarDance_E02","AvatarDance_F01","AvatarDance_F02","AvatarDance_ChaserPush"], + [212,213,214,216,217,215] + ]; + switch(obj.getVar("skillSub").getInt(100)){ + case 0: obj.sq_SetCurrentAnimation(aniSet[0][subState]); break; + case 1: + local Ani = getCurrentAnimation_precencia(obj, aniSet[1][subState], false, false); + obj.setCurrentAnimation(Ani); + break; + case 2: + obj.sq_SetCurrentAnimation(aniSet[2][subState]); + switch(subState){ + case 1: obj.sq_PlaySound("WZ_PRECENCIA_AVATARDANCE_1_0"+sq_getRandom(1, 2).tostring()); obj.sq_PlaySound("PRECENCIA_AVATARDANCE_1"); obj.sq_PlaySound("PRECENCIA_AVATARDANCE_2"); break; + case 2: obj.sq_PlaySound("WZ_PRECENCIA_AVATARDANCE_1_0"+sq_getRandom(3, 4).tostring()); obj.sq_PlaySound("PRECENCIA_AVATARDANCE_3"); obj.sq_PlaySound("PRECENCIA_AVATARDANCE_4"); break; + case 3: obj.sq_PlaySound("R_WZ_PRECENCIA_AVATARDANCE_2"); obj.sq_PlaySound("PRECENCIA_AVATARDANCE_5"); break; + case 4: obj.sq_PlaySound("WZ_PRECENCIA_AVATARDANCE_3"); obj.sq_PlaySound("PRECENCIA_AVATARDANCE_6"); break; + } + break; + } + local speedRate = 1.0; + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) speedRate = 1.3; + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) speedRate = 1.5; + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, speedRate, speedRate); + + if(subState == 6 && obj.getVar("skillSub").getInt(100) < 2){ + local currentAni = obj.getCurrentAnimation(); + local delay = currentAni.getDelaySum(false); + obj.getVar("avatardance_move").setInt(11, sq_GetZPos(obj)); + if(obj.isExistTimeEvent(1)) obj.stopTimeEvent(1); + obj.setTimeEvent(2, delay / 60, 30, true); + } + else if(subState == 4 && obj.getVar("skillSub").getInt(100) == 2){ + local currentAni = obj.getCurrentAnimation(); + local delay = currentAni.getDelaySum(0, 4); + obj.getVar("avatardance_move").setInt(11, sq_GetZPos(obj)); + if(obj.isExistTimeEvent(1)) obj.stopTimeEvent(1); + obj.setTimeEvent(2, delay / 60, 30, true); + } + else if(subState == 7 && obj.getVar("skillSub").getInt(100) < 2){ + obj.sq_AddStateLayerAnimation(1,obj.sq_CreateCNRDAnimation("effect/animation/avatardance/avatardance_d_eff03.ani"), 0, 0); + } +} + +function onEndCurrentAni_Avatardance(obj) +{ + if(!obj) return; + local subState = obj.getSkillSubState(); + local sub = sq_GetLevelData(obj, SKILL_BYKK_AVATARDANCE, 13, sq_GetSkillLevel(obj, SKILL_BYKK_AVATARDANCE)); + local stateMax = 7; + if(obj.getVar("skillSub").getInt(100) == 2){ + stateMax = 4; + } + if(sub > 0 && ((subState == 3 && obj.getVar("skillSub").getInt(100) < 2) || (subState == 2 && obj.getVar("skillSub").getInt(100) == 2))){ + obj.sq_IntVectClear(); + if(obj.getVar("skillSub").getInt(100) < 2) obj.sq_IntVectPush(8); + else obj.sq_IntVectPush(5); + obj.sq_AddSetStatePacket(SKILL_BYKK_AVATARDANCE, STATE_PRIORITY_AUTO, true); + } + else{ + if(subState < stateMax){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(subState + 1); + obj.sq_AddSetStatePacket(SKILL_BYKK_AVATARDANCE, STATE_PRIORITY_AUTO, true); + } + else{ + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_AUTO, true); + } + } +} + +function onProcCon_Avatardance(obj) +{ + if(!obj) return; +} + +function onKeyFrameFlag_Avatardance(obj, flagIndex) +{ + if(!obj) return false; + switch(flagIndex){ + case 101: + obj.sq_PlaySound("AVATAR_DANCE_SUMMONSPEAR"); + sq_flashScreen(obj, 180, 0, 0, 102, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_CLOSEBACK); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/avatardance/avatardance_a_eff01.ani", 0, 1, 0); + break; + case 102: sq_flashScreen(obj, 0, 0, 60, 76, sq_RGB(255,255,255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); break; + case 103: + obj.sq_PlaySound("R_WZ_ATK"); + obj.sq_PlaySound("AVATAR_DANCE_01"); + sq_SetMyShake(obj, 6, 150); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/avatardance/avatardance_b_back_eff01.ani", 0, -1, 0); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/avatardance/avatardance_b_eff01.ani", 0, 1, 0); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_AVATARDANCE, -1, 0, 1.0) + 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 39)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + break; + case 104: + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/avatardance/avatardance_c_eff01.ani", 0, 1, 0); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_AVATARDANCE, -1, 1, 1.0) + 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 40)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + break; + case 105: obj.sq_PlaySound("AVATAR_DANCE_02"); sq_SetMyShake(obj, 6, 150); break; + case 106: sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/avatardance/avatardance_d_eff03.ani", 0, 1, 0); break; + case 107: + obj.sq_PlaySound("R_WZ_ATK"); + obj.sq_PlaySound("AVATAR_DANCE_03"); + sq_SetMyShake(obj, 6, 150); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_AVATARDANCE, -1, 2, 1.0) + 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 41)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + break; + case 108: + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/avatardance/avatardance_e01_moveeff01.ani", 0, -1, 0); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/avatardance/avatardance_e01_eff01.ani", 0, 1, 0); + break; + case 109: + local speed = 100.0; + if(obj.getDirection() == ENUM_DIRECTION_LEFT) speed = -speed; + sq_SetVelocity(obj, 0, speed); + break; + case 110: + obj.sq_PlaySound("AVATAR_DANCE_04"); + sq_SetMyShake(obj, 5, 120); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/avatardance/avatardance_e02_backeff03.ani", 0, -1, 0); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/avatardance/avatardance_e02_eff03.ani", 0, 1, 0); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_AVATARDANCE, -1, 3, 1.0) + 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 42)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local currentAni = obj.getCurrentAnimation(); + local delay = currentAni.getDelaySum(false); + obj.getVar("avatardance_move").setInt(10, sq_GetXPos(obj)); + obj.getVar("avatardance_move").setInt(11, sq_GetZPos(obj)); + obj.setTimeEvent(1, delay / 80, 40, true); + break; + case 111: + if(obj.getVar("skillSub").getInt(100) == 1) break; + obj.sq_PlaySound("R_WZ_AVATAR_DANCE_FIN"); + sq_SetMyShake(obj, 8, 400); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/avatardance/avatardance_f02_flooreff01.ani", 0, -1, 0); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/avatardance/avatardance_f02_eff05.ani", 0, 1, 0); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_AVATARDANCE, -1, 4, 1.0) + 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 43)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + break; + case 112: + obj.sq_PlaySound("AVATAR_DANCE_FINISH"); + if(obj.getVar("skillSub").getInt(100) == 1){ + obj.sq_PlaySound("R_WZ_AVATAR_DANCE_FIN"); + sq_SetMyShake(obj, 8, 400); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/avatardance/avatardance_f02_flooreff01.ani", 0, -1, 0); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/avatardance/avatardance_f02_eff05.ani", 0, 1, 0); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_AVATARDANCE, -1, 4, 1.0) + 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 43)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + } + break; + case 201: + obj.sq_PlaySound("PRECENCIA_AVATARDANCE_1"); + sq_SetMyShake(obj, 6, 150); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_AVATARDANCE, -1, 0, 1.0) + 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 39)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + break; + case 202: + obj.sq_PlaySound("PRECENCIA_AVATARDANCE_2"); + sq_SetMyShake(obj, 6, 150); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_AVATARDANCE, -1, 1, 1.0) + 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 40)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + break; + case 203: + obj.sq_PlaySound("PRECENCIA_AVATARDANCE_3"); + sq_SetMyShake(obj, 6, 150); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_AVATARDANCE, -1, 2, 1.0) + 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 41)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/avatardance/precencia/avatardance_c_04.ani", 0, 1, 0); + break; + case 204: + obj.sq_PlaySound("PRECENCIA_AVATARDANCE_4"); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_AVATARDANCE, -1, 3, 1.0) + 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 42)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local currentAni = obj.getCurrentAnimation(); + local delay = currentAni.getDelaySum(3, 5); + obj.getVar("avatardance_move").setInt(10, sq_GetXPos(obj)); + obj.getVar("avatardance_move").setInt(11, sq_GetZPos(obj)); + obj.setTimeEvent(3, delay / 10, 10, true); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/avatardance/precencia/avatardance_d_08.ani", 0, 1, 0); + break; + case 205: + obj.sq_PlaySound("PRECENCIA_AVATARDANCE_5"); + break; + case 206: + obj.sq_PlaySound("PRECENCIA_AVATARDANCE_6"); + sq_SetMyShake(obj, 8, 400); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_AVATARDANCE, -1, 4, 1.0) + 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 43)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + break; + case 207: + if(obj.getVar("skillSub").getInt(100) == 2){ + obj.sq_PlaySound("PRECENCIA_AVATARDANCE_3"); + obj.sq_PlaySound("R_WZ_ATK"); + } + else{ + obj.sq_PlaySound("AVATAR_DANCE_03"); + obj.sq_PlaySound("R_WZ_AVATAR_DANCE_FIN"); + } + sq_SetMyShake(obj, 6, 150); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_AVATARDANCE, -1, 3, 1.0) + obj.sq_GetBonusRateWithPassive(SKILL_BYKK_AVATARDANCE, -1, 4, 1.0) + 200; + totalDamage = totalDamage * 130 / 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 41)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + sq_flashScreen(obj, 20, 90, 20, 127, sq_RGB(255,255,255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + sq_SetMyShake(obj, 20, 150); + break; + case 208: obj.sq_PlaySound("AVATAR_DANCE_CHARGE_TALISMAN"); break; + } + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo){ + attackInfo.setAttackType(ATTACKTYPE_PHYSICAL); + sq_SetAddWeaponDamage(attackInfo, true); + } + return true; +} + +function onTimeEvent_Avatardance(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + switch(timeEventIndex){ + case 1: + local vx = sq_GetUniformVelocity(0, 200, timeEventCount, 40); + local vz = sq_GetUniformVelocity(0, 200, timeEventCount, 40); + local dstX = sq_GetDistancePos(obj.getVar("avatardance_move").getInt(10), obj.getDirection(), vx); + if(obj.isMovablePos(dstX, sq_GetYPos(obj))) sq_setCurrentAxisPos(obj, 0, dstX); + sq_setCurrentAxisPos(obj, 2, vz); + break; + case 2: + local vz = sq_GetUniformVelocity(obj.getVar("avatardance_move").getInt(11), 0, timeEventCount, 10); + sq_setCurrentAxisPos(obj, 2, vz); + break; + case 3: + local vx = sq_GetUniformVelocity(0, 200, timeEventCount, 10); + local vz = sq_GetUniformVelocity(0, 100, timeEventCount, 10); + local dstX = sq_GetDistancePos(obj.getVar("avatardance_move").getInt(10), obj.getDirection(), vx); + if(obj.isMovablePos(dstX, sq_GetYPos(obj))) sq_setCurrentAxisPos(obj, 0, dstX); + sq_setCurrentAxisPos(obj, 2, vz); + break; + } +} + +function onEndState_Avatardance(obj, new_state) +{ + if(!obj) return; + if(new_state != SKILL_BYKK_AVATARDANCE){ + sq_SimpleMoveToNearMovablePos(obj,1200); + } +} + + +function checkExecutableSkill_Avatarfinish(obj) +{ + if (!obj) return false; + if(obj.getState() == SKILL_BYKK_PRECENCIA && obj.getSkillSubState() < 10) return false; + local isUse = obj.sq_IsUseSkill(SKILL_BYKK_AVATARFINISH); + if (isUse){ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) obj.getVar("skillSub").setInt(100, 2); + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) obj.getVar("skillSub").setInt(100, 1); + else obj.getVar("skillSub").setInt(100, 0); + obj.sq_IntVectClear(); + if(obj.getVar("skillSub").getInt(100) == 0) obj.sq_IntVectPush(0); + else obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_AVATARFINISH, STATE_PRIORITY_IGNORE_FORCE, true); + return true; + } + return false; +} + +function checkCommandEnable_Avatarfinish(obj) +{ + if (!obj) return false; + return true; +} + +function onSetState_Avatarfinish(obj, state, datas, isResetTimer) +{ + if(!obj) return; + local subState = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(subState); + obj.sq_StopMove(); + obj.sq_ZStop(); + switch(subState){ + case 0: + obj.sq_SetCurrentAnimation(295); + obj.sq_PlaySound("AVATAR_FINISH_CAST"); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + local currentAni = obj.getCurrentAnimation(); + local delay = currentAni.getDelaySum(0, 0); + local speedRate = 5900 / delay; + local aniPath = ["character/mage/effect/animation/battlemage_bykk/avatar/avatarfinish_normal_ready_02.ani","character/mage/effect/animation/battlemage_bykk/avatar/avatarfinish_normal_ready_03.ani","character/mage/effect/animation/battlemage_bykk/avatar/avatarfinish_normal_ready_04.ani"]; + for(local i = 0; i < aniPath.len(); i++){ + local ypos = 1; + if(i > 1) ypos = -1; + local pooledObj = sq_AddDrawOnlyAniFromParent(obj, aniPath[i], 0, ypos, 0); + local pAni = pooledObj.getCurrentAnimation(); + pAni.setSpeedRate(speedRate.tofloat()); + } + break; + case 1: + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "AvatarFinish_Body", false, false); + obj.setCurrentAnimation(Ani); + obj.sq_PlaySound("WZ_AVATAR_FINISH"); + obj.sq_PlaySound("AVATAR_FINISH"); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + local currentAni = obj.getCurrentAnimation(); + local delay = currentAni.getDelaySum(0, 0); + local speedRate = 8000 / delay; + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_AVATARFINISH, -1, 0, 1.0) + 100; + if(sq_GetSkillLevel(obj, SKILL_BYKK_SPEARMASTERY) > 0 && obj.getWeaponSubType() == 0) totalDamage = totalDamage * (1000 + sq_GetIntData(obj, SKILL_BYKK_SPEARMASTERY, 4)) / 1000; + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,0,0,0,obj.getDirection(),SKILL_BYKK_AVATARFINISH,2,totalDamage,speedRate,0,0,0,0,0,0); + obj.setTimeEvent(0, 1000 / speedRate, 1, false); + } + else{ + obj.sq_SetCurrentAnimation(211); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + local currentAni = obj.getCurrentAnimation(); + local delay = currentAni.getDelaySum(0, 0); + local speedRate = 8700 / delay; + for(local i = 18; i < 27; i++){ + local pooledObj = sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/avatar/precencia/avatar_inishxx1_"+i.tostring()+".ani", 0, 1, 0); + local pAni = pooledObj.getCurrentAnimation(); + pAni.setSpeedRate(speedRate.tofloat()); + } + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_AVATARFINISH, -1, 0, 1.0) + 100; + if(sq_GetSkillLevel(obj, SKILL_BYKK_SPEARMASTERY) > 0 && obj.getWeaponSubType() == 0) totalDamage = totalDamage * (1000 + sq_GetIntData(obj, SKILL_BYKK_SPEARMASTERY, 4)) / 1000; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 66)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo){ + attackInfo.setAttackType(ATTACKTYPE_PHYSICAL); + sq_SetAddWeaponDamage(attackInfo, true); + } + } + sq_flashScreen(obj,650,150,80,204, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + break; + case 2: + obj.sq_SetCurrentAnimation(296); + break; + } +} + +function onEndCurrentAni_Avatarfinish(obj) +{ + if(!obj) return; + local subState = obj.getSkillSubState(); + switch(subState){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_AVATARFINISH, STATE_PRIORITY_AUTO, true); + break; + case 1: + if(obj.getVar("skillSub").getInt(100) == 0){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(SKILL_BYKK_AVATARFINISH, STATE_PRIORITY_AUTO, true); + break; + } + case 2: + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_AUTO, true); + break; + } +} + +function onProcCon_Avatarfinish(obj) +{ + if(!obj) return; +} + +function onKeyFrameFlag_Avatarfinish(obj, flagIndex) +{ + if(!obj) return false; + switch(flagIndex){ + case 111: + obj.sq_PlaySound("PRCENCIA_AVATAR_CAST"); + break; + case 301: + obj.sq_PlaySound("AVATAR_FINISH_CAST"); + sq_flashScreen(obj,0,80,80,255, sq_RGB(255,255,255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + break; + case 303: + obj.sq_PlaySound("AVATAR_FINISH"); + sq_flashScreen(obj,60,60,420,204, sq_RGB(255,255,255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_COVER); + sq_SetMyShake(obj, 8, 160); + break; + } + return true; +} + +function onTimeEvent_Avatarfinish(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + switch(timeEventIndex){ + case 0: + sq_flashScreen(obj,60,60,420,204, sq_RGB(255,255,255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_COVER); + sq_SetMyShake(obj, 8, 160); + break; + } +} + +function onEndState_Avatarfinish(obj, new_state) +{ + if(!obj) return; +} + +function onAttack_Avatarfinish(obj, damager, boundingBox, isStuck) +{ + if(isStuck) return; + if(!damager.isObjectType(OBJECTTYPE_ACTIVE)) return; + obj.sq_PlaySound("AVATAR_FINISH_EFFECT"); + local apdPath = "character/mage/battlemage_bykk/ap/ap_avatarfinish.nut"; + local addAppendage = CNSquirrelAppendage.sq_AppendAppendage(damager, obj, SKILL_BYKK_AVATARFINISH, false, apdPath, true); + sq_HoldAndDelayDie(damager, obj, true, true, true, 200, 200, ENUM_DIRECTION_NEUTRAL, addAppendage); + addAppendage.sq_SetValidTime(2000); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_AVATARFINISH, -1, 1, 1.0) + 100; + if(sq_GetSkillLevel(obj, SKILL_BYKK_SPEARMASTERY) > 0 && obj.getWeaponSubType() == 0) totalDamage = totalDamage * (1000 + sq_GetIntData(obj, SKILL_BYKK_SPEARMASTERY, 4)) / 1000; + local group = sq_GetGroup(damager); + local uniqueId = sq_GetUniqueId(damager); + cearteSkillPassive_Battlemage_bykk(obj,damager,PASSIVEOBJECT_BYKK_BATTLEMAGE,0,0,sq_GetObjectHeight(damager) / 2,obj.getDirection(),SKILL_BYKK_AVATARFINISH,1,totalDamage,group,uniqueId,0,0,0,0,0); +} + + + + +function checkExecutableSkill_ChaserAutoCreate(obj) +{ + // if (!obj) return false; + // local isUse = obj.sq_IsUseSkill(SKILL_BYKK_CHASERAUTOCREATE); + // if (isUse){ + // obj.sq_IntVectClear(); + // obj.sq_IntVectPush(0); + // obj.sq_AddSetStatePacket(SKILL_BYKK_CHASERAUTOCREATE, STATE_PRIORITY_IGNORE_FORCE, true); + // return true; + // } + // return false; +} + +function checkCommandEnable_ChaserAutoCreate(obj) +{ + if (!obj) return false; + return true; +} + +function onSetState_ChaserAutoCreate(obj, state, datas, isResetTimer) +{ + if(!obj) return; + local subState = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(subState); + obj.sq_StopMove(); + switch(subState){ + case 0: + local Ani = obj.sq_GetThrowChargeAni(3); + obj.setCurrentAnimation(Ani); + break; + case 1: + local Ani = obj.sq_GetThrowShootAni(3); + obj.setCurrentAnimation(Ani); + break; + } +} + +function onEndCurrentAni_ChaserAutoCreate(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_CHASERAUTOCREATE, STATE_PRIORITY_USER, true); + break; + case 1: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_ChaserAutoCreate(obj) +{ + if(!obj) return; +} + +function onKeyFrameFlag_ChaserAutoCreate(obj, flagIndex) +{ + if(!obj) return false; + return true; +} + +function onTimeEvent_ChaserAutoCreate(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; +} + +function onEndState_ChaserAutoCreate(obj, new_state) +{ + if(!obj) return; +} + +function checkExecutableSkill_Chasercluster(obj) +{ + if (!obj) return false; + if(obj.getVar("chaserClusterObj01").get_obj_vector_size() > 0){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_CHASERCLUSTER, STATE_PRIORITY_IGNORE_FORCE, true); + return true; + } + if(obj.getState() == SKILL_BYKK_PRECENCIA && obj.getSkillSubState() < 10) return false; + local isUse = obj.sq_IsUseSkill(SKILL_BYKK_CHASERCLUSTER); + if (isUse){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_CHASERCLUSTER, STATE_PRIORITY_IGNORE_FORCE, true); + return true; + } + return false; +} + +function checkCommandEnable_Chasercluster(obj) +{ + if (!obj) return false; + return true; +} + +function onSetState_Chasercluster(obj, state, datas, isResetTimer) +{ + if(!obj) return; + local subState = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(subState); + obj.sq_StopMove(); + switch(subState){ + case 0: + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + obj.sq_SetCurrentAnimation(219); + } + else{ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + local Ani = getCurrentAnimation_precencia(obj, "ChaserClusterBodyStart_09", false, false); + obj.setCurrentAnimation(Ani); + } + else obj.sq_SetCurrentAnimation(82); + } + local flashScreenObj = sq_flashScreen(obj,80,1300,240,150, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + obj.getVar("flashobj").clear_obj_vector(); + obj.getVar("flashobj").push_obj_vector(flashScreenObj); + break; + case 1: + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + obj.sq_SetCurrentAnimation(220); + } + else{ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + local Ani = getCurrentAnimation_precencia(obj, "ChaserClusterBodyEnd_06", false, false); + obj.setCurrentAnimation(Ani); + } + else obj.sq_SetCurrentAnimation(83); + } + break; + } + local currentAni = obj.getCurrentAnimation(); + sq_ClearAttackBox(currentAni); + + local speed = 1.0; + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) speed = 0.3 + speed; + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) speed = 0.5 + speed; + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, speed, speed); +} + +function onEndCurrentAni_Chasercluster(obj) +{ + if(!obj) return; + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_AUTO, true); +} + +function onProcCon_Chasercluster(obj) +{ + if(!obj) return; +} + +function onKeyFrameFlag_Chasercluster(obj, flagIndex) +{ + if(!obj) return false; + switch(flagIndex){ + case 1: + obj.sq_PlaySound("CHASER_CLUSTER_SWISH"); + obj.sq_PlaySound("R_WZ_CHASER_CLUSTER"); + sq_SetMyShake(obj, 5, 100); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/chasercluster/chaserclusterbodystartobj_07.ani", 0, 1, 0); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_CHASERCLUSTER, -1, 0, 1.0) + 100; + local createMax = sq_GetIntData(obj, SKILL_BYKK_CHASERCLUSTER, 2); + if(sq_GetLevelData(obj, SKILL_BYKK_CHASERCLUSTER, 1, sq_GetSkillLevel(obj, SKILL_BYKK_CHASERCLUSTER)) > 0) createMax = 1; + local lifeTime = sq_GetIntData(obj, SKILL_BYKK_CHASERCLUSTER, 0); + if(sq_GetLevelData(obj, SKILL_BYKK_CHASERCLUSTER, 3, sq_GetSkillLevel(obj, SKILL_BYKK_CHASERCLUSTER)) > 0) lifeTime = 100; + local sizeRate = sq_GetIntData(obj, SKILL_BYKK_CHASERCLUSTER, 13); + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,232,0,50,obj.getDirection(),SKILL_BYKK_CHASERCLUSTER,1,totalDamage,createMax,lifeTime,sizeRate,0,0,0,0); + local xpos = [140,180,240,303,325,310,370,365], zpos = [45,140,75,130,95,40,70,150], size = [130,95,150,100,60,105,110,75]; + if(sq_GetLevelData(obj, SKILL_BYKK_CHASERCLUSTER, 2, sq_GetSkillLevel(obj, SKILL_BYKK_CHASERCLUSTER)) > 0){ + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,232,0,100,obj.getDirection(),SKILL_BYKK_CHASERCLUSTER,2,lifeTime,300,0,0,0,0,0,0); + } + else{ + for(local i = 0; i < 8; i++){ + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,xpos[i],0,zpos[i],obj.getDirection(),SKILL_BYKK_CHASERCLUSTER,2,lifeTime,size[i],0,0,0,0,0,0); + } + } + break; + case 2://引爆 + case 13://引爆 + //if(flagIndex == 2) obj.sq_PlaySound("WZ_CHASER_EXPLOSION"); + local attackObj = obj.getVar("chaserClusterObj01").get_obj_vector(0); + if(attackObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(attackObj); + colObj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + } + local size = obj.getVar("chaserClusterObj02").get_obj_vector_size(); + for(local i = 0; i < size; i++){ + local effectObj = obj.getVar("chaserClusterObj02").get_obj_vector(i); + if(effectObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(effectObj); + if(colObj.isExistTimeEvent(0)) colObj.stopTimeEvent(0); + if(colObj.getState() <= 21) colObj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + } + } + break; + case 11: sq_flashScreen(obj, 350, 150, 100, 255, sq_RGB(0, 0, 0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); break; + case 12: + obj.sq_PlaySound("WZ_PRECENCIA_CHASERCLUSTER_1"); + sq_SetMyShake(obj, 5, 120); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/chasercluster/precencia/chasercluster_13.ani", 0, 1, 0); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/chasercluster/precencia/chasercluster_12.ani", 0, 1, 0); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/chasercluster/precencia/chasercluster_11.ani", 0, 1, 0); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/chasercluster/precencia/chasercluster_10.ani", 0, 1, 0); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/chasercluster/precencia/chasercluster_09.ani", 0, 1, 0); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/chasercluster/precencia/chasercluster_08.ani", 0, 1, 0); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_CHASERCLUSTER, -1, 0, 1.0) + 100; + local createMax = sq_GetIntData(obj, SKILL_BYKK_CHASERCLUSTER, 2); + local lifeTime = sq_GetIntData(obj, SKILL_BYKK_CHASERCLUSTER, 0); + local sizeRate = sq_GetIntData(obj, SKILL_BYKK_CHASERCLUSTER, 13); + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,232,0,50,obj.getDirection(),SKILL_BYKK_CHASERCLUSTER,1,totalDamage,createMax,lifeTime,sizeRate,0,0,0,0); + local xpos = [140,180,240,303,325,310,370,365], zpos = [45,140,75,130,95,40,70,175], size = [150,75,175,100,80,120,125,60]; + for(local i = 0; i < 8; i++){ + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,xpos[i],0,20 + zpos[i],obj.getDirection(),SKILL_BYKK_CHASERCLUSTER,2,lifeTime,size[i],0,0,0,0,0,0); + } + break; + } + return true; +} + +function onTimeEvent_Chasercluster(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; +} + +function onEndState_Chasercluster(obj, new_state) +{ + if(!obj) return; +} + +function checkExecutableSkill_Chaserevolution(obj) +{ + if (!obj) return false; + if(obj.getState() == SKILL_BYKK_PRECENCIA && obj.getSkillSubState() < 10) return false; + local isUse = obj.sq_IsUseSkill(SKILL_BYKK_CHASEREVOLUTION); + if (isUse){ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) obj.getVar("skillSub").setInt(100, 2); + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) obj.getVar("skillSub").setInt(100, 1); + else obj.getVar("skillSub").setInt(100, 0); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(3); + obj.sq_AddSetStatePacket(STATE_BYKK_GODDNESSOFWAR, STATE_PRIORITY_IGNORE_FORCE, true); + return true; + } + return false; +} + +function checkCommandEnable_Chaserevolution(obj) +{ + if (!obj) return false; + return true; +} + +function onSetState_Chaserevolution(obj, state, datas, isResetTimer) +{ + if(!obj) return; +} + +function onEndCurrentAni_Chaserevolution(obj) +{ + if(!obj) return; +} + +function onProcCon_Chaserevolution(obj) +{ + if(!obj) return; +} + +function onKeyFrameFlag_Chaserevolution(obj, flagIndex) +{ + if(!obj) return false; + return true; +} + +function onTimeEvent_Chaserevolution(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; +} + +function onEndState_Chaserevolution(obj, new_state) +{ + if(!obj) return; +} + + + +function checkExecutableSkill_ChaserLaunch(obj) +{ + if (!obj) return false; + // local addAppendage = CNSquirrelAppendage.sq_GetAppendage(obj, CHASERLAUNCH_APDPATH); + // if(addAppendage){ + // local targetObj = addAppendage.getVar("target").get_obj_vector(0); + // if(targetObj){ + // shootBattlemageChaser(obj, targetObj); + // obj.startSkillCoolTime(SKILL_BYKK_CHASERLAUNCH, sq_GetSkillLevel(obj, SKILL_BYKK_CHASERLAUNCH), -1); + // return true; + // } + // else return false; + // } + // else return false; + return true; +} + +function checkCommandEnable_ChaserLaunch(obj) +{ + if (!obj) return false; + // if(obj.getVar("kksChaser").get_obj_vector_size() < 1) return false; + // if(!CNSquirrelAppendage.sq_IsAppendAppendage(obj, CHASERLAUNCH_APDPATH)) return false; + return true; +} + +function onSetState_ChaserLaunch(obj, state, datas, isResetTimer) +{ + if(!obj) return; +} + +function onEndCurrentAni_ChaserLaunch(obj) +{ + if(!obj) return; +} + +function onProcCon_ChaserLaunch(obj) +{ + if(!obj) return; +} + +function onKeyFrameFlag_ChaserLaunch(obj, flagIndex) +{ + if(!obj) return false; + return true; +} + +function onTimeEvent_ChaserLaunch(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; +} + +function onEndState_ChaserLaunch(obj, new_state) +{ + if(!obj) return; +} + + +function checkExecutableSkill_ChasersExplosion(obj) +{ + if (!obj) return false; + local size = obj.getVar("kksChaser").get_obj_vector_size(); + if(size < 1){ + if (obj.isMessage()) sq_AddMessage(3573); + return false; + } + if(obj.getState() == SKILL_BYKK_PRECENCIA && obj.getSkillSubState() < 10) return false; + local isUse = obj.sq_IsUseSkill(SKILL_BYKK_CHASERSEXPLOSION); + if (isUse){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(STATE_BYKK_CHASERSEXPLOSION, STATE_PRIORITY_IGNORE_FORCE, true); + return true; + } + return false; +} + +function checkCommandEnable_ChasersExplosion(obj) +{ + if (!obj) return false; + return true; +} + +function onSetState_ChasersExplosion(obj, state, datas, isResetTimer) +{ + if(!obj) return; + local subState = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(subState); + obj.sq_StopMove(); + obj.sq_ZStop(); + switch(subState){ + case 0: + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + obj.sq_SetCurrentAnimation(221); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.5, 1.5); + obj.sq_PlaySound("WZ_PRECENCIA_CHASERPRESS_1"); + obj.sq_PlaySound("PRECENCIA_CHASERPRESS_1_CAST"); + } + else{ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + local Ani = getCurrentAnimation_precencia(obj, "ChasersExplosion", false, false); + obj.setCurrentAnimation(Ani); + } + else obj.sq_SetCurrentAnimation(8); + obj.sq_PlaySound("WZ_CHASERP_02"); + } + + local speed = 1.0; + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) speed = 0.3 + speed; + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) speed = 0.5 + speed; + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, speed, speed); + local size = obj.getVar("kksChaser").get_obj_vector_size(); + obj.getVar("chasersexp").setInt(10, size); + local delaySum = 300; + local currentAni = obj.getCurrentAnimation(); + local delay = currentAni.getDelaySum(0, 2); + if(!CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + obj.setTimeEvent(0, delay / 10, 10, true); + obj.setTimeEvent(1, delay, 1, false); + } + else{ + obj.setTimeEvent(10, delay, 1, false); + } + sq_SetFrameDelayTime(currentAni, 6, delaySum); + obj.getVar("ChasersExplosion_damage").setInt(10, 0); + break; + } +} + +function onEndCurrentAni_ChasersExplosion(obj) +{ + if(!obj) return; + if(sq_GetZPos(obj) > 0){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_IntVectPush(0); + obj.sq_IntVectPush(100); + obj.sq_AddSetStatePacket(STATE_JUMP, STATE_PRIORITY_AUTO, true); + } + else{ + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_AUTO, true); + } +} + +function onProcCon_ChasersExplosion(obj) +{ + if(!obj) return; + local subState = obj.getSkillSubState(); + switch(subState){ + case 0: + break; + } +} + +function onKeyFrameFlag_ChasersExplosion(obj, flagIndex) +{ + if(!obj) return false; + switch(flagIndex){ + case 11: + obj.sq_PlaySound("R_WZ_PRECENCIA_CHASERPRESS_2"); + obj.sq_PlaySound("PRECENCIA_CHASERPRESS_2_CHASER"); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_CHASERSEXPLOSION, -1, 0, 1.0); + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_CHASERSEXPLOSION); + local baseSRate = sq_GetIntData(obj, SKILL_BYKK_CHASERSEXPLOSION, 0); + print("baseSRate = "+baseSRate); + local addSRate = sq_GetIntData(obj, SKILL_BYKK_CHASERSEXPLOSION, 2) / 10; + // if(sq_GetSkillLevel(obj, SKILL_BYKK_POLEMASTERY) > 0 && obj.getWeaponSubType() == 1) baseSRate = baseSRate + sq_GetIntData(obj, SKILL_BYKK_POLEMASTERY, 2) / 10; + baseSRate = baseSRate + obj.getVar("chasersexp").getInt(10) * addSRate; + + print("test1 = "+obj.getVar("chasersexp").getInt(10)); + print("test2 = "+addSRate); + print("test3 = "+baseSRate); + // if(sq_GetSkillLevel(obj, SKILL_BYKK_POLEMASTERY) > 0 && obj.getWeaponSubType() == 1) baseSRate = baseSRate * (100 + sq_GetIntData(obj, SKILL_BYKK_SPEARMASTERY, 2)) / 100; + // totalDamage = totalDamage * obj.getVar("ChasersExplosion_damage").getInt(10) / 100; + print("totalDamage = "+totalDamage); + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,0,1,0,obj.getDirection(),SKILL_BYKK_CHASERSEXPLOSION,2,totalDamage,baseSRate,1,0,0,0,0,0); + break; + case 12: + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_CHASERSEXPLOSION); + local baseSRate = sq_GetLevelData(obj, SKILL_BYKK_CHASERSEXPLOSION, 1, skillLevel); + local addSRate = sq_GetLevelData(obj, SKILL_BYKK_CHASERSEXPLOSION, 3, skillLevel) / 10; + // if(sq_GetSkillLevel(obj, SKILL_BYKK_POLEMASTERY) > 0 && obj.getWeaponSubType() == 1) baseSRate = baseSRate + sq_GetIntData(obj, SKILL_BYKK_POLEMASTERY, 2) / 10; + baseSRate = baseSRate + obj.getVar("chasersexp").getInt(10) * addSRate; + createOnlyDrawObjectEX_Battlemage_bykk(obj,"character/mage/effect/animation/battlemage_bykk/chasersexplosion/precencia/chaserexplosionbottom_09.ani",true,obj.getDirection(),sq_GetXPos(obj),sq_GetYPos(obj),sq_GetZPos(obj)*0,ENUM_DRAWLAYER_BOTTOM,baseSRate,baseSRate); + createOnlyDrawObjectEX_Battlemage_bykk(obj,"character/mage/effect/animation/battlemage_bykk/chasersexplosion/precencia/chaserexplosionfront_07.ani",true,obj.getDirection(),sq_GetXPos(obj),sq_GetYPos(obj) + 1,sq_GetZPos(obj)*0,ENUM_DRAWLAYER_NORMAL,baseSRate,baseSRate); + sq_SetMyShake(obj, 8, 160); + break; + case 13: obj.sq_PlaySound("PRECENCIA_CHASERPRESS_3_FINISH"); break; + } + return true; +} + +function onTimeEvent_ChasersExplosion(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + switch(timeEventIndex){ + case 0: + local vz = sq_GetUniformVelocity(0, 50, timeEventCount, 10); + sq_setCurrentAxisPos(obj, 2, vz); + break; + case 1: + local currentAni = obj.getCurrentAnimation(); + local delay = currentAni.getDelaySum(3, 6); + local delay2 = currentAni.getDelaySum(3, 9); + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,-70,0,50,obj.getDirection(),SKILL_BYKK_CHASERSEXPLOSION,1,delay,0,0,0,0,0,0,0); + obj.setTimeEvent(2, delay2, 1, false); + local baseX = sq_GetDistancePos(sq_GetXPos(obj), obj.getDirection(), -75); + local baseZ = 88; + local size = obj.getVar("kksChaser").get_obj_vector_size(); + for(local i = 0; i < size; i++){ + local chaserObj = obj.getVar("kksChaser").get_obj_vector(i); + if(chaserObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(chaserObj); + if(colObj.getState() > 22) colObj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + colObj.removeAllTimeEvent(); + local angle = 360 / size * i; + local x = (sq_Cos(sq_ToRadian(angle.tofloat())) * 60.0).tointeger(); + local z = (sq_Sin(sq_ToRadian(angle.tofloat())) * 60.0).tointeger(); + colObj.getVar("moveSet").setInt(10, baseX + x); + colObj.getVar("moveSet").setInt(11, baseZ + z); + colObj.getVar("moveSet").setInt(12, baseX); + colObj.getVar("moveSet").setInt(13, baseZ); + colObj.getVar("moveSet").setInt(14, delay); + colObj.setTimeEvent(15, delay / 45, 15, true); + // local totalDamage = obj.getVar("ChasersExplosion_damage").getInt(10) + colObj.getVar("custom").getInt(10); + // obj.getVar("ChasersExplosion_damage").setInt(10, totalDamage); + // print(obj.getVar("ChasersExplosion_damage").getInt(10)); + } + } + break; + case 2: + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_CHASERSEXPLOSION, -1, 0, 1.0); + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_CHASERSEXPLOSION); + local baseSRate = sq_GetIntData(obj, SKILL_BYKK_CHASERSEXPLOSION, 0); + print("baseSRate = "+baseSRate); + local addSRate = sq_GetIntData(obj, SKILL_BYKK_CHASERSEXPLOSION, 2) / 10; + // if(sq_GetSkillLevel(obj, SKILL_BYKK_POLEMASTERY) > 0 && obj.getWeaponSubType() == 1) baseSRate = baseSRate + sq_GetIntData(obj, SKILL_BYKK_POLEMASTERY, 2) / 10; + baseSRate = baseSRate + obj.getVar("chasersexp").getInt(10) * addSRate; + // if(sq_GetSkillLevel(obj, SKILL_BYKK_POLEMASTERY) > 0 && obj.getWeaponSubType() == 1) baseSRate = baseSRate * (100 + sq_GetIntData(obj, SKILL_BYKK_SPEARMASTERY, 2)) / 100; + // totalDamage = totalDamage * obj.getVar("ChasersExplosion_damage").getInt(10) / 100; + + print("test1 = "+obj.getVar("chasersexp").getInt(10)); + print("test2 = "+addSRate); + print("test3 = "+baseSRate); + print("totalDamage = "+totalDamage); + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,75,1,0,obj.getDirection(),SKILL_BYKK_CHASERSEXPLOSION,2,totalDamage,baseSRate,0,0,0,0,0,0); + break; + case 10: + local currentAni = obj.getCurrentAnimation(); + local delay = currentAni.getDelaySum(3, 6); + local baseX = sq_GetDistancePos(sq_GetXPos(obj), obj.getDirection(), 5); + local baseZ = 240; + local size = obj.getVar("kksChaser").get_obj_vector_size(); + for(local i = 0; i < size; i++){ + local chaserObj = obj.getVar("kksChaser").get_obj_vector(i); + if(chaserObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(chaserObj); + if(colObj.getState() > 22) colObj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + colObj.removeAllTimeEvent(); + local angle = 360 / size * i; + local x = (sq_Cos(sq_ToRadian(angle.tofloat())) * 80.0).tointeger(); + local z = (sq_Sin(sq_ToRadian(angle.tofloat())) * 80.0).tointeger(); + colObj.getVar("moveSet").setInt(10, baseX + x); + colObj.getVar("moveSet").setInt(11, baseZ + z); + colObj.getVar("moveSet").setInt(12, baseX); + colObj.getVar("moveSet").setInt(13, baseZ); + colObj.getVar("moveSet").setInt(14, delay); + colObj.setTimeEvent(15, delay / 45, 15, true); + // local totalDamage = obj.getVar("ChasersExplosion_damage").getInt(10) + colObj.getVar("custom").getInt(10); + // obj.getVar("ChasersExplosion_damage").setInt(10, totalDamage); + // print(obj.getVar("ChasersExplosion_damage").getInt(10)); + } + } + break; + } +} + +function onEndState_ChasersExplosion(obj, new_state) +{ + if(!obj) return; + if(new_state != STATE_BYKK_CHASERSEXPLOSION && new_state != STATE_DIE){ + local createMax = sq_GetLevelData(obj, SKILL_BYKK_CHASERSEXPLOSION, 16, sq_GetSkillLevel(obj, SKILL_BYKK_CHASERSEXPLOSION)); + for(local i = 0; i < createMax; i++){ + createBattlemageChaser(obj); + } + } +} + + + + +function checkExecutableSkill_DoubleSwing(obj) +{ + if (!obj) return false; + if(obj.getState() == SKILL_BYKK_PRECENCIA && obj.getSkillSubState() < 10) return false; + local isUse = obj.sq_IsUseSkill(SKILL_BYKK_DOUBLESWING); + if (isUse){ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) obj.getVar("skillSub").setInt(100, 2); + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) obj.getVar("skillSub").setInt(100, 1); + else obj.getVar("skillSub").setInt(100, 0); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_DOUBLESWING, STATE_PRIORITY_IGNORE_FORCE, true); + return true; + } + return false; +} + +function checkCommandEnable_DoubleSwing(obj) +{ + if (!obj) return false; + return true; +} + +function onSetState_DoubleSwing(obj, state, datas, isResetTimer) +{ + if(!obj) return; + local subState = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(subState); + obj.sq_StopMove(); + switch(subState){ + case 0: + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "Doubleswing1", false, false); + obj.setCurrentAnimation(Ani); + } + else if(obj.getVar("skillSub").getInt(100) == 2) obj.sq_SetCurrentAnimation(226); + else obj.sq_SetCurrentAnimation(65); + break; + case 1: + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "Doubleswing2", false, false); + obj.setCurrentAnimation(Ani); + } + else if(obj.getVar("skillSub").getInt(100) == 2) obj.sq_SetCurrentAnimation(227); + else obj.sq_SetCurrentAnimation(66); + break; + } + local speed = 1.0; + if(obj.getVar("skillSub").getInt(100) == 1) speed = 0.3 + speed; + else if(obj.getVar("skillSub").getInt(100) == 2) speed = 0.5 + speed; + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, speed, speed); + local atkIndex = [35,36]; + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_DOUBLESWING); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_DOUBLESWING, -1, subState, 1.0) + 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, atkIndex[subState])); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo){ + attackInfo.setAttackType(ATTACKTYPE_PHYSICAL); + sq_SetAddWeaponDamage(attackInfo, true); + } +} + +function onEndCurrentAni_DoubleSwing(obj) +{ + if(!obj) return; + local subState = obj.getSkillSubState(); + switch(subState){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_DOUBLESWING, STATE_PRIORITY_AUTO, true); + break; + case 1: + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_AUTO, true); + break; + } +} + +function onProcCon_DoubleSwing(obj) +{ + if(!obj) return; +} + +function onKeyFrameFlag_DoubleSwing(obj, flagIndex) +{ + if(!obj) return false; + if(flagIndex == 1){ + sq_SetMyShake(obj, 5, 100); + switch(obj.getSkillSubState()){ + case 0: + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/doubleswing/doubleswing1_02.ani", 0, 1, 0); + obj.sq_PlaySound("R_WZ_PRECENCIA_DOUBLESWING_1"); + obj.sq_PlaySound("PRECENCIA_DOUBLESWING_1"); + } + else obj.sq_PlaySound("WZ_DOUBLE_SWING_01"); + break; + case 1: + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + obj.sq_PlaySound("R_WZ_PRECENCIA_DOUBLESWING_2"); + obj.sq_PlaySound("PRECENCIA_DOUBLESWING_2"); + } + else obj.sq_PlaySound("R_WZ_DOUBLE_SWING_02"); + + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_DOUBLESWING, -1, 2, 1.0) + 100; + local sizeRate = sq_GetLevelData(obj, SKILL_BYKK_DOUBLESWING, 3, sq_GetSkillLevel(obj, SKILL_BYKK_DOUBLESWING)); + if(sq_GetSkillLevel(obj, SKILL_BYKK_SPEARMASTERY) > 0) sizeRate = sizeRate * (100 + sq_GetIntData(obj, SKILL_BYKK_SPEARMASTERY, 2)) / 100; + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,150,0,0,obj.getDirection(),SKILL_BYKK_DOUBLESWING,1,totalDamage,sizeRate,0,0,0,0,0,0); + break; + } + } + return true; +} + +function onTimeEvent_DoubleSwing(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; +} + +function onEndState_DoubleSwing(obj, new_state) +{ + if(!obj) return; +} + + + + +function checkExecutableSkill_DragonSpear(obj) +{ + if (!obj) return false; + if(obj.getState() == SKILL_BYKK_PRECENCIA && obj.getSkillSubState() < 10) return false; + local isUse = obj.sq_IsUseSkill(SKILL_BYKK_DRAGONSPEAR); + if (isUse){ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) obj.getVar("skillSub").setInt(100, 2); + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) obj.getVar("skillSub").setInt(100, 1); + else obj.getVar("skillSub").setInt(100, 0); + obj.getVar("dragonspearTar").clear_obj_vector(); + obj.getVar("dragonspearTar_fix").clear_obj_vector(); + if(sq_GetSkillLevel(obj, SKILL_BYKK_DRAGONDANCE) > 0 && !sq_GetSkill(obj, SKILL_BYKK_DRAGONDANCE).isSealFunction()){ + obj.sq_IntVectClear(); + if(obj.getVar("skillSub").getInt(100) == 2) obj.sq_IntVectPush(12); + else{ + if(DRAGONSPEAR_STONE > 0 || sq_GetLevelData(obj, SKILL_BYKK_DRAGONSPEAR, 15, sq_GetSkillLevel(obj, SKILL_BYKK_DRAGONSPEAR)) > 0) obj.sq_IntVectPush(2); + else obj.sq_IntVectPush(1); + } + obj.sq_AddSetStatePacket(SKILL_BYKK_DRAGONSPEAR, STATE_PRIORITY_IGNORE_FORCE, true); + } + else{ + obj.sq_IntVectClear(); + if(obj.getVar("skillSub").getInt(100) == 2) obj.sq_IntVectPush(10); + else obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_DRAGONSPEAR, STATE_PRIORITY_IGNORE_FORCE, true); + } + return true; + } + return false; +} + + +function checkCommandEnable_DragonSpear(obj) +{ + if (!obj) return false; + return true; +} + +function onSetState_DragonSpear(obj, state, datas, isResetTimer) +{ + if(!obj) return; + local subState = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(subState); + obj.sq_StopMove(); + switch(subState){ + case 0://普通形態 + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "DragonSpear", false, false); + obj.setCurrentAnimation(Ani); + } + else obj.sq_SetCurrentAnimation(17); + obj.sq_AddStateLayerAnimation(10002,obj.sq_CreateCNRDAnimation("effect/animation/avatar/dragonspear/spearattack1.ani"), 0, 0); + obj.sq_AddStateLayerAnimation(10001,obj.sq_CreateCNRDAnimation("effect/animation/avatar/dragonspear/spearattack2.ani"), 0, 0); + obj.sq_AddStateLayerAnimation(10000,obj.sq_CreateCNRDAnimation("effect/animation/avatar/dragonspear/spearattack3.ani"), 0, 0); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_DRAGONSPEAR, -1, 0, 1.0) + 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 15)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + break; + case 1://煌龍亂舞普通形態 + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "DragonSpearNew_Body", false, false); + obj.setCurrentAnimation(Ani); + } + else obj.sq_SetCurrentAnimation(99); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_DRAGONSPEAR, -1, 7, 1.0) + 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 58)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.getVar("DragonSpearBool").setBool(0, true); + break; + case 2://煌龍亂舞護石形態 + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "DragonSpearNew_Body_Talisman", false, false); + obj.setCurrentAnimation(Ani); + } + else obj.sq_SetCurrentAnimation(284); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_DRAGONSPEAR, -1, 7, 1.0) + 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 58)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.getVar("DragonSpearBool").setBool(0, true); + break; + case 10://三覺形態準備 + obj.sq_SetCurrentAnimation(234); + break; + case 11://三覺形態釋放 + obj.sq_SetCurrentAnimation(233); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_DRAGONSPEAR, -1, 0, 1.0) + 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 15)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + break; + case 12://三覺形態煌龍亂舞開始 + obj.sq_SetCurrentAnimation(232); + obj.getVar("DragonSpearBool").setBool(0, true); + break; + case 13://三覺形態煌龍亂舞過程 + obj.sq_SetCurrentAnimation(231); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_DRAGONSPEAR, -1, 7, 1.0) + 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 61)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + break; + case 14://三覺形態煌龍亂舞過程(護石) + obj.sq_SetCurrentAnimation(230); + break; + case 15://三覺形態煌龍亂舞結束 + obj.sq_SetCurrentAnimation(229); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_DRAGONSPEAR, -1, 7, 1.0) + 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 60)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + break; + } + + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo){ + attackInfo.setAttackType(ATTACKTYPE_PHYSICAL); + sq_SetAddWeaponDamage(attackInfo, true); + } + local speedRate = 1.0 + sq_GetLevelData(obj, SKILL_BYKK_DRAGONSPEAR, 2, sq_GetSkillLevel(obj, SKILL_BYKK_DRAGONSPEAR)).tofloat() / 100; + if(obj.getVar("skillSub").getInt(100) == 1) speedRate = 0.3 + speedRate; + else if(obj.getVar("skillSub").getInt(100) == 2) speedRate = 0.5 + speedRate; + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, speedRate, speedRate); + if(subState == 0 || subState == 11 && sq_GetLevelData(obj, SKILL_BYKK_DRAGONSPEAR, 15, sq_GetSkillLevel(obj, SKILL_BYKK_DRAGONSPEAR)) < 1){ + local currentAni = obj.getCurrentAnimation(); + obj.sq_SetXScrollStart(300, currentAni.getDelaySum(0, 6)); + } +} + +function onEndCurrentAni_DragonSpear(obj) +{ + if(!obj) return; + local subState = obj.getSkillSubState(); + switch(subState){ + case 0: + case 1: + case 2: + case 11: + case 15: + obj.sq_SetXScrollStop(0); + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_AUTO, true); + if(subState == 0){ + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/avatar/dragonspear/speardisappear1.ani", 0, 0, 0); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/avatar/dragonspear/speardisappear2.ani", 0, 1, 0); + } + break; + case 10: + case 12: + case 14: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(subState + 1); + obj.sq_AddSetStatePacket(SKILL_BYKK_DRAGONSPEAR, STATE_PRIORITY_AUTO, true); + break; + case 13: + obj.sq_IntVectClear(); + if(DRAGONSPEAR_STONE > 0 || sq_GetLevelData(obj, SKILL_BYKK_DRAGONSPEAR, 15, sq_GetSkillLevel(obj, SKILL_BYKK_DRAGONSPEAR)) > 0) obj.sq_IntVectPush(subState + 1); + else obj.sq_IntVectPush(subState + 2); + obj.sq_AddSetStatePacket(SKILL_BYKK_DRAGONSPEAR, STATE_PRIORITY_AUTO, true); + break; + } +} + +function onProcCon_DragonSpear(obj) +{ + if(!obj) return; + local subState = obj.getSkillSubState(); + switch(subState){ + case 1: + case 2: + case 12: + case 13: + if(obj.getVar("DragonSpearBool").getBool(0)){ + if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_LEFT, ENUM_SUBKEY_TYPE_ALL) && obj.getDirection() == ENUM_DIRECTION_RIGHT || sq_IsKeyDown(OPTION_HOTKEY_MOVE_RIGHT, ENUM_SUBKEY_TYPE_ALL) && obj.getDirection() == ENUM_DIRECTION_LEFT){ + obj.getVar("DragonSpearBool").setBool(0, false); + } + } + break; + } +} + +function onKeyFrameFlag_DragonSpear(obj, flagIndex) +{ + if(!obj) return false; + switch(flagIndex){ + case 1000: + obj.sq_PlaySound("YELLOWD_CHARGE"); + obj.sq_PlaySound("R_WZ_DRAGONDANCE"); + break; + case 1001://生成龍刀 + break; + case 1002://生成龍珠後攻擊 + if(obj.getVar("dragonspearTar_fix").get_obj_vector_size() < 1 && obj.getVar("dragonspearTar").get_obj_vector_size() < 1 || sq_GetLevelData(obj, SKILL_BYKK_DRAGONSPEAR, 15, sq_GetSkillLevel(obj, SKILL_BYKK_DRAGONSPEAR)) > 0){ + obj.setTimeEvent(1, 300, 1, false); + break; + } + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_DRAGONSPEAR, -1, 1, 1.0) + 100; + local sizeRate = (obj.sq_GetBonusRateWithPassive(SKILL_BYKK_DRAGONSPEAR, -1, 3, 1.0) + 100) * 83 / 100; + local currentAni = obj.getCurrentAnimation(); + local speedRate = 72000 / currentAni.getDelaySum(0, 0); + local createMax = sq_GetIntData(obj, SKILL_BYKK_DRAGONSPEAR, 0); + local baseAngle = sq_getRandom(0, 90); + for(local i = 0; i < createMax; i++){ + local angle = 360 / createMax * i + baseAngle; + local x = (sq_Cos(sq_ToRadian(angle.tofloat())) * 90.0).tointeger(); + local z = (sq_Sin(sq_ToRadian(angle.tofloat())) * 90.0).tointeger(); + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,300+x,0,50+z,obj.getDirection(),SKILL_BYKK_DRAGONSPEAR,2,totalDamage,sizeRate,i,50,speedRate,0,0,0); + } + local delay = (2300 + createMax * 200) / speedRate * 100; + obj.setTimeEvent(0, delay, 1, false); + break; + case 2001: + case 3001: + obj.sq_PlaySound("YELLOWD_CHARGE"); + obj.sq_PlaySound("R_WZ_DRAGONDANCE"); + break; + case 2002: + case 3002: + obj.sq_PlaySound("DRAGONDANCE_STAB"); + sq_flashScreen(obj, 0, 30, 30, 7, sq_RGB(255, 255, 255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + sq_SetMyShake(obj, 4, 80); + break; + case 2003: + case 2007: + case 3003: + case 3008: + obj.sq_PlaySound("DRAGONDANCE_SWISH"); + sq_flashScreen(obj, 0, 30, 30, 7, sq_RGB(255, 255, 255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + sq_SetMyShake(obj, 4, 100); + obj.resetHitObjectList(); + if(obj.getVar("DragonSpearBool").getBool(0) == false) {sq_SetVelocity(obj, 0, 0.0);break;} + local speed = 300.0; + if(obj.getDirection() == ENUM_DIRECTION_LEFT) speed = -speed; + if(flagIndex == 2003 || flagIndex == 3003) sq_SetVelocity(obj, 0, speed); + else sq_SetVelocity(obj, 0, 0.0); + break; + case 2004: + case 2005: + case 3004: + obj.sq_PlaySound("DRAGONDANCE_SWISH"); + sq_flashScreen(obj, 0, 30, 30, 7, sq_RGB(255, 255, 255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + sq_SetMyShake(obj, 4, 80); + obj.resetHitObjectList(); + if(obj.getVar("DragonSpearBool").getBool(0) == false) {sq_SetVelocity(obj, 0, 0.0);break;} + local speed = 300.0; + if(obj.getDirection() == ENUM_DIRECTION_LEFT) speed = -speed; + if(flagIndex == 2004 || flagIndex == 3004) sq_SetVelocity(obj, 0, speed); + else sq_SetVelocity(obj, 0, 0.0); + break; + case 2006: + case 3006: + obj.resetHitObjectList(); + if(obj.getVar("DragonSpearBool").getBool(0) == false) {sq_SetVelocity(obj, 0, 0.0);break;} + local speed = 300.0; + if(obj.getDirection() == ENUM_DIRECTION_LEFT) speed = -speed; + sq_SetVelocity(obj, 0, speed); + break; + case 2007: + case 3007: + obj.resetHitObjectList(); + sq_SetVelocity(obj, 0, 0.0); + break; + case 2008: + case 3009: + if(obj.getVar("DragonSpearBool").getBool(0) == false) {sq_SetVelocity(obj, 0, 0.0);break;} + local speed = 300.0; + if(obj.getDirection() == ENUM_DIRECTION_LEFT) speed = -speed; + sq_SetVelocity(obj, 0, speed); + break; + case 2009: + case 3010: + obj.sq_PlaySound("DRAGONDANCE_FINISH"); + sq_flashScreen(obj, 0, 80, 100, 51, sq_RGB(255, 255, 255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + sq_SetMyShake(obj, 15, 180); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_DRAGONSPEAR, -1, 8, 1.0) + 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 59)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + break; + case 2010: + case 3011: + sq_SetVelocity(obj, 0, 0.0); + break; + case 3012: + obj.sq_PlaySound("R_WZ_DRAGONDANCE_FIN"); + obj.sq_PlaySound("DRAGONDANCE_FINISH"); + obj.sq_PlaySound("BLAST_SWORD_EXP"); + sq_flashScreen(obj, 10, 100, 10, 51, sq_RGB(255, 255, 255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + sq_SetMyShake(obj, 20, 120); + //`add finish exp` 149 1 -7 + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_DRAGONSPEAR, -1, 8, 1.0) + 100; + totalDamage = totalDamage * 18 / 100; + local sizeRate = 100; + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,149,1,-7,obj.getDirection(),SKILL_BYKK_DRAGONSPEAR,1,totalDamage,sizeRate,0,0,0,0,0,0); + break; + case 1101: + obj.sq_PlaySound("YELLOWD_CHARGE"); + obj.sq_PlaySound("R_WZ_PRECENCIA_DRAGONSPEAR_1"); + break; + case 1102://生成龍珠後攻擊 + if(obj.getVar("dragonspearTar_fix").get_obj_vector_size() < 1 && obj.getVar("dragonspearTar").get_obj_vector_size() < 1 || sq_GetLevelData(obj, SKILL_BYKK_DRAGONSPEAR, 15, sq_GetSkillLevel(obj, SKILL_BYKK_DRAGONSPEAR)) > 0){ + obj.setTimeEvent(1, 300, 1, false); + break; + } + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_DRAGONSPEAR, -1, 1, 1.0) + 100; + local sizeRate = (obj.sq_GetBonusRateWithPassive(SKILL_BYKK_DRAGONSPEAR, -1, 3, 1.0) + 100) * 83 / 100; + local currentAni = obj.getCurrentAnimation(); + local speedRate = 5100 / currentAni.getDelaySum(0, 0); + local createMax = sq_GetIntData(obj, SKILL_BYKK_DRAGONSPEAR, 0); + local baseAngle = sq_getRandom(0, 90); + for(local i = 0; i < createMax; i++){ + local angle = 360 / createMax * i + baseAngle; + local x = (sq_Cos(sq_ToRadian(angle.tofloat())) * 90.0).tointeger(); + local z = (sq_Sin(sq_ToRadian(angle.tofloat())) * 90.0).tointeger(); + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,300+x,0,100+z,obj.getDirection(),SKILL_BYKK_DRAGONSPEAR,2,totalDamage,sizeRate,i,100,speedRate,0,0,0); + } + local delay = (2000 + createMax * 200) / speedRate * 100; + obj.setTimeEvent(0, delay, 1, false); + break; + case 1201: obj.sq_PlaySound("YELLOWD_CHARGE"); break; + case 1202: obj.sq_PlaySound("R_WZ_PRECENCIA_DRAGONDANCE_1"); break; + case 1301: + case 1303: + case 1305: + obj.sq_PlaySound("PRECENCIA_DRAGONDANCE_1"); + sq_flashScreen(obj, 0, 30, 30, 20, sq_RGB(255, 255, 255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + sq_SetMyShake(obj, 3, 80); + if(flagIndex > 1301) obj.resetHitObjectList(); + if(obj.getVar("DragonSpearBool").getBool(0) == false) {sq_SetVelocity(obj, 0, 0.0);break;} + local speed = 300.0; + if(obj.getDirection() == ENUM_DIRECTION_LEFT) speed = -speed; + sq_SetVelocity(obj, 0, speed); + break; + case 1302: sq_SetVelocity(obj, 0, 0.0); break; + case 1304: + case 1306: + case 1307: + if(flagIndex == 1306) obj.sq_PlaySound("PRECENCIA_DRAGONDANCE_2"); + else if(flagIndex == 1307) obj.resetHitObjectList(); + if(obj.getVar("DragonSpearBool").getBool(0) == false) {sq_SetVelocity(obj, 0, 0.0);break;} + local speed = 300.0; + if(obj.getDirection() == ENUM_DIRECTION_LEFT) speed = -speed; + sq_SetVelocity(obj, 0, speed); + break; + case 1308: + obj.sq_PlaySound("R_WZ_PRECENCIA_DRAGONDANCE_2"); + obj.sq_PlaySound("PRECENCIA_DRAGONDANCE_3"); + sq_flashScreen(obj, 0, 80, 200, 76, sq_RGB(255, 255, 255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + sq_SetMyShake(obj, 20, 150); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_DRAGONSPEAR, -1, 8, 1.0) + 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 59)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + if(sq_GetLevelData(obj, SKILL_BYKK_DRAGONSPEAR, 15, sq_GetSkillLevel(obj, SKILL_BYKK_DRAGONSPEAR)) < 1) break; + totalDamage = totalDamage * 18 / 100; + local sizeRate = 130; + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,220,0,-2,obj.getDirection(),SKILL_BYKK_DRAGONSPEAR,1,totalDamage,sizeRate,0,0,0,0,0,0); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/dragonspear/precencia/dragondance_finish_25.ani", 0, 1, -1); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/dragonspear/precencia/dragondance_finish_24.ani", 0, 1, -1); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/dragonspear/precencia/dragondance_finish_00.ani", 0, 1, -1000); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/dragonspear/precencia/dragondance_finish_01.ani", 0, 1, -1000); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/dragonspear/precencia/dragondance_finish_05.ani", 0, 1, 0); + break; + case 1401: + obj.sq_PlaySound("PRECENCIA_DRAGONDANCE_1"); + sq_flashScreen(obj, 0, 30, 30, 20, sq_RGB(255, 255, 255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + sq_SetMyShake(obj, 3, 80); + if(obj.getSkillSubState() == 14) obj.resetHitObjectList(); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/dragonspear/precencia/talisman/talisman_mid_14.ani", 0, -1, 0); + if(obj.getVar("DragonSpearBool").getBool(0) == false) {sq_SetVelocity(obj, 0, 0.0);break;} + local speed = 300.0; + if(obj.getDirection() == ENUM_DIRECTION_LEFT) speed = -speed; + sq_SetVelocity(obj, 0, speed); + break; + case 1402: + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/dragonspear/precencia/talisman/talisman_mid_13.ani", 0, -1, 0); + break; + case 1403: + obj.sq_PlaySound("PRECENCIA_DRAGONDANCE_1"); + obj.resetHitObjectList(); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/dragonspear/precencia/talisman/talisman_mid_22.ani", 0, -1, 0); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/dragonspear/precencia/talisman/talisman_mid_23.ani", 0, -1, 0); + sq_flashScreen(obj, 0, 30, 30, 20, sq_RGB(255, 255, 255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + sq_SetMyShake(obj, 3, 80); + if(obj.getVar("DragonSpearBool").getBool(0) == false) {sq_SetVelocity(obj, 0, 0.0);break;} + local speed = 300.0; + if(obj.getDirection() == ENUM_DIRECTION_LEFT) speed = -speed; + sq_SetVelocity(obj, 0, speed); + break; + case 1404: + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/dragonspear/precencia/talisman/talisman_mid_24.ani", 0, -1, 0); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/dragonspear/precencia/talisman/talisman_mid_25.ani", 0, -1, 0); + break; + case 1405: + obj.resetHitObjectList(); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/dragonspear/precencia/talisman/talisman_mid_24.ani", 0, -1, 0); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/dragonspear/precencia/talisman/talisman_mid_25.ani", 0, -1, 0); + if(obj.getVar("DragonSpearBool").getBool(0) == false) {sq_SetVelocity(obj, 0, 0.0);break;} + local speed = 300.0; + if(obj.getDirection() == ENUM_DIRECTION_LEFT) speed = -speed; + sq_SetVelocity(obj, 0, speed); + break; + case 4001: + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/dragonspear/precencia/dragonspear_06.ani", 0, 1, 0); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/dragonspear/precencia/dragonspear_07.ani", 0, 1, 0); + break; + } + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo){ + attackInfo.setAttackType(ATTACKTYPE_PHYSICAL); + sq_SetAddWeaponDamage(attackInfo, true); + } + return true; +} + +function onTimeEvent_DragonSpear(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + switch(timeEventIndex){ + case 0: + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_DRAGONSPEAR, -1, 4, 1.0) + 100; + local sizeRate = (obj.sq_GetBonusRateWithPassive(SKILL_BYKK_DRAGONSPEAR, -1, 3, 1.0) + 100) * 83 / 100; + local zpos = 50; + if(obj.getSkillSubState() == 11) zpos = 100; + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,300,0,zpos,obj.getDirection(),SKILL_BYKK_DRAGONSPEAR,3,totalDamage,sizeRate,0,0,0,0,0,0); + case 1: + if(obj.getSkillSubState() == 0){ + obj.sq_SetXScrollStop(0); + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_AUTO, true); + } + else{ + local currentAni = obj.getCurrentAnimation(); + currentAni.setCurrentFrameWithChildLayer(15); + } + break; + } +} + +function onEndState_DragonSpear(obj, new_state) +{ + if(!obj) return; + if(new_state != SKILL_BYKK_DRAGONSPEAR){ + local size = obj.getVar("dragonspearTar").get_obj_vector_size(); + if(size > 0){ + for(local i = 0; i < size; i++){ + local targetObj = obj.getVar("dragonspearTar").get_obj_vector(i); + if(targetObj) CNSquirrelAppendage.sq_RemoveAppendage(targetObj, DRAGONSPEAR_APDPATH); + } + } + } +} + + +function onAttack_DragonSpear(obj, damager, boundingBox, isStuck) +{ + if(!obj) return; + if(!damager.isObjectType(OBJECTTYPE_ACTIVE)) return; + local frameIndex = sq_GetCurrentFrameIndex(obj); + if(frameIndex >= 10) return; + local subState = obj.getSkillSubState(); + switch(subState){ + case 0: + case 11: + if(sq_IsHoldable(obj,damager) && sq_IsGrabable(obj,damager) && !sq_IsFixture(damager)){ + if(!obj.getVar("dragonspearTar").is_obj_vector(damager)) obj.getVar("dragonspearTar").push_obj_vector(damager); + local addAppendage = CNSquirrelAppendage.sq_AppendAppendage(damager, obj, -1, false, DRAGONSPEAR_APDPATH, true); + sq_HoldAndDelayDie(damager, obj, true, true, true, 200, 200, ENUM_DIRECTION_NEUTRAL , addAppendage); + local zpos = 0; + if(subState == 11) zpos = 50; + local currentAni = obj.getCurrentAnimation();; + local delay = currentAni.getDelaySum(frameIndex, 10); + sq_MoveToAppendageForce(damager, obj, obj, 300, 0, zpos, delay / 2, true, addAppendage); + } + else if(sq_IsFixture(damager) || !sq_IsHoldable(obj,damager) || !sq_IsGrabable(obj,damager)){ + if(!obj.getVar("dragonspearTar_fix").is_obj_vector(damager)) obj.getVar("dragonspearTar_fix").push_obj_vector(damager); + } + break; + } +} + + +function checkExecutableSkill_FusionChaser(obj) +{ + if (!obj) return false; + local size = obj.getVar("kksChaser").get_obj_vector_size(); + if(size < 2){ + if (obj.isMessage()) sq_AddMessage(3573); + return false; + } + if(obj.getState() == SKILL_BYKK_PRECENCIA && obj.getSkillSubState() < 10) return false; + local isUse = obj.sq_IsUseSkill(SKILL_BYKK_FUSIONCHASER); + if (isUse){ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) obj.getVar("skillSub").setInt(100, 2); + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) obj.getVar("skillSub").setInt(100, 1); + else obj.getVar("skillSub").setInt(100, 0); + obj.sq_IsEnterSkillLastKeyUnits(SKILL_BYKK_FUSIONCHASER); + obj.getVar("fusionchaser").setBool(0, false); + obj.getVar("fusionchaser").setBool(10, false); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_FUSIONCHASER, STATE_PRIORITY_IGNORE_FORCE, true); + return true; + } + return false; +} + +function checkCommandEnable_FusionChaser(obj) +{ + if (!obj) return false; + return true; +} + +function onSetState_FusionChaser(obj, state, datas, isResetTimer) +{ + if(!obj) return; + local subState = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(subState); + obj.sq_StopMove(); + switch(subState){ + case 0: + obj.getVar("fusioncs").setInt(10, 0); + if(obj.getVar("skillSub").getInt(100) == 2){ + obj.sq_SetCurrentAnimation(235); + obj.sq_PlaySound("R_WZ_PRECENCIA_FUSIONCHASER_1"); + obj.sq_PlaySound("PRECENCIA_FUSIONCHASER_CAST"); + } + else{ + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "Fusionchaser", false, false); + obj.setCurrentAnimation(Ani); + } + else obj.sq_SetCurrentAnimation(64); + obj.sq_PlaySound("WZ_FUSION"); + } + break; + } + local sub = 2; + for(local i = 0; i < sub; i++){ + local chaserObj = obj.getVar("kksChaser").get_obj_vector(i); + if(!chaserObj){ + sub = sub + 1; + continue; + } + chaserObj.setValid(false); + } + local speed = 1.0; + if(obj.getVar("skillSub").getInt(100) == 1) speed = 0.3 + speed; + else if(obj.getVar("skillSub").getInt(100) == 2) speed = 0.5 + speed; + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, speed, speed); + // local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_TIMERBOMB); + // local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_TIMERBOMB, -1, 0, 1.0) + 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 3)); + // sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local currentAni = obj.getCurrentAnimation(); + sq_SetFrameDelayTime(currentAni, 6, 100000); +} + +function onEndCurrentAni_FusionChaser(obj) +{ + if(!obj) return; + if(obj.getVar("fusioncs").getInt(10) == 0 && sq_GetLevelData(obj, SKILL_BYKK_FUSIONCHASER, 9, sq_GetSkillLevel(obj, SKILL_BYKK_FUSIONCHASER)) > 0){ + local sub = 2,sizeRate = sq_GetIntData(obj, SKILL_BYKK_FUSIONCHASER, 4) / 2; + if(obj.getVar("skillSub").getInt(100) < 2){ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_chaserevolution.nut")) sub = 4; + else sub = 3; + sizeRate = sizeRate * 2; + } + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_FUSIONCHASER, -1, 0, 1.0) + 100; + sizeRate = sizeRate * (100 + sq_GetLevelData(obj, SKILL_BYKK_FUSIONCHASER, 8, sq_GetSkillLevel(obj, SKILL_BYKK_FUSIONCHASER))) / 100; + if(obj.getWeaponSubType() == 1 && sq_GetSkillLevel(obj, SKILL_BYKK_POLEMASTERY) > 0) sizeRate = sizeRate * (100 + sq_GetIntData(obj, SKILL_BYKK_POLEMASTERY, 1)) / 100; + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,50,1,75,obj.getDirection(),SKILL_BYKK_FUSIONCHASER,sub,totalDamage,sizeRate,0,0,0,0,0,0); + } + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_AUTO, true); +} + + +function onProcCon_FusionChaser(obj) +{ + if(!obj) return; + local frameIndex = sq_GetCurrentFrameIndex(obj); + if(frameIndex == 6){ + if(obj.getVar("fusionchaser").getBool(0) == false){ + obj.getVar("fusionchaser").setBool(0, true); + local sub = 0,xpos = -10, zpos = 120; + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_chaserevolution.nut")) sub = 1; + else if(obj.getVar("skillSub").getInt(100) == 2){ + sub = 2; xpos = 0; zpos = 160; + } + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,xpos,0,zpos,obj.getDirection(),SKILL_BYKK_FUSIONCHASER,1,sub,0,0,0,0,0,0,0); + } + local bDownKey = obj.isDownSkillLastKey(); + if(!bDownKey){ + local stateTime = obj.sq_GetStateTimer(); + if(stateTime <= 500 || sq_GetLevelData(obj, SKILL_BYKK_FUSIONCHASER, 7, sq_GetSkillLevel(obj, SKILL_BYKK_FUSIONCHASER)) > 0) obj.getVar("fusionchaser").setBool(10, true); + local currentAni = obj.getCurrentAnimation(); + currentAni.setCurrentFrameWithChildLayer(7); + if(obj.getVar("skillSub").getInt(100) == 2){ + obj.sq_PlaySound("PRECENCIA_FUSIONCHASER_SHOT"); + obj.sq_PlaySound("WZ_PRECENCIA_FUSIONCHASER_2"); + } + } + else{ + if(obj.getVar("skillSub").getInt(100) == 2){ + local currentAni = obj.getCurrentAnimation(); + currentAni.setCurrentFrameWithChildLayer(4); + } + } + } +} + +function onKeyFrameFlag_FusionChaser(obj, flagIndex) +{ + if(!obj) return false; + switch(flagIndex){ + case 1: + obj.getVar("fusionChaser_move").setInt(10, sq_GetXPos(obj)); + local currentAni = obj.getCurrentAnimation(); + local poleAniFrameNumber = sq_GetAniFrameNumber(currentAni, 0); + local delay = currentAni.getDelaySum(9, poleAniFrameNumber); + obj.setTimeEvent(0, delay / 30, 30, true); + local atkObj = obj.getVar("kksfsChaser").get_obj_vector(0); + if(atkObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(atkObj); + local zpos = 65; + if(obj.getVar("skillSub").getInt(100) == 2) zpos = 80; + sq_setCurrentAxisPos(colObj, 2, zpos); + colObj.setTimeEvent(0, delay / 30, 30, true); + } + break; + } + return true; +} + +function onTimeEvent_FusionChaser(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + switch(timeEventIndex){ + case 0: + local baseX = obj.getVar("fusionChaser_move").getInt(10); + local v = sq_GetUniformVelocity(0, 200, timeEventCount, 30); + local dstX = sq_GetDistancePos(baseX, obj.getDirection(), v); + if(obj.isMovablePos(dstX, sq_GetYPos(obj))) sq_setCurrentAxisPos(obj, 0, dstX); + break; + } +} + +function onEndState_FusionChaser(obj, new_state) +{ + if(!obj) return; + local size = obj.getVar("kksfsChaser").get_obj_vector_size(); + if(size > 0){ + for(local i = 0; i < size; i++){ + local atkObj = obj.getVar("kksfsChaser").get_obj_vector(i); + if(atkObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(atkObj); + if(colObj.getState() == 20) colObj.setValid(false); + } + } + } +} + +function onAttack_FusionChaser(obj, damager, boundingBox, isStuck) +{ + if(!obj) return; + if(!damager.isObjectType(OBJECTTYPE_ACTIVE)) return; + obj.getVar("fusioncs").setInt(10, obj.getVar("fusioncs").getInt(10) + 1); + if(obj.getVar("fusionchaser").getBool(10)){ + obj.getVar("fusionchaser").setBool(10, false); + local sub = 2,sizeRate = sq_GetIntData(obj, SKILL_BYKK_FUSIONCHASER, 4) / 2; + if(obj.getVar("skillSub").getInt(100) < 2){ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_chaserevolution.nut")) sub = 4; + else sub = 3; + sizeRate = sizeRate * 2; + } + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_FUSIONCHASER, -1, 0, 1.0) + 100; + if(sq_GetLevelData(obj, SKILL_BYKK_FUSIONCHASER, 10, sq_GetSkillLevel(obj, SKILL_BYKK_FUSIONCHASER)) > 0){ + local sub = 2; + for(local i = 0; i < sub; i++){ + local chaserObj = obj.getVar("kksChaser").get_obj_vector(i); + if(!chaserObj){ + sub = sub + 1; + continue; + } + chaserObj.setValid(false); + } + totalDamage = totalDamage * 2; + } + sizeRate = sizeRate * (100 + sq_GetLevelData(obj, SKILL_BYKK_FUSIONCHASER, 8, sq_GetSkillLevel(obj, SKILL_BYKK_FUSIONCHASER))) / 100; + if(obj.getWeaponSubType() == 1 && sq_GetSkillLevel(obj, SKILL_BYKK_POLEMASTERY) > 0) sizeRate = sizeRate * (100 + sq_GetIntData(obj, SKILL_BYKK_POLEMASTERY, 1)) / 100; + cearteSkillPassive_Battlemage_bykk(obj,damager,PASSIVEOBJECT_BYKK_BATTLEMAGE,0,1,sq_GetCenterZPos(boundingBox),obj.getDirection(),SKILL_BYKK_FUSIONCHASER,sub,totalDamage,sizeRate,0,0,0,0,0,0); + return; + } + local atkObj = obj.getVar("kksfsChaser").get_obj_vector(0); + if(atkObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(atkObj); + if(colObj.getState() == 20){ + obj.getVar("kksfsChaser").remove_obj_vector(colObj); + colObj.removeAllTimeEvent(); + colObj.getVar("tar").clear_obj_vector(); + colObj.getVar("tar").push_obj_vector(damager); + sq_setCurrentAxisPos(colObj, 0, sq_GetXPos(damager)); + sq_setCurrentAxisPos(colObj, 1, sq_GetYPos(damager) + 1); + sq_setCurrentAxisPos(colObj, 2, sq_GetCenterZPos(boundingBox)); + sq_moveWithParent(damager, colObj); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_FUSIONCHASER, -1, 4, 1.0) + 100; + if(sq_GetLevelData(obj, SKILL_BYKK_FUSIONCHASER, 10, sq_GetSkillLevel(obj, SKILL_BYKK_FUSIONCHASER)) > 0){ + local sub = 2; + for(local i = 0; i < sub; i++){ + local chaserObj = obj.getVar("kksChaser").get_obj_vector(i); + if(!chaserObj){ + sub = sub + 1; + continue; + } + chaserObj.setValid(false); + } + totalDamage = totalDamage * 2; + } + local hitTime = sq_GetIntData(obj, SKILL_BYKK_FUSIONCHASER, 7); + local lifeTime = sq_GetIntData(obj, SKILL_BYKK_FUSIONCHASER, 8); + colObj.setTimeEvent(2, hitTime, -1, true); + colObj.setTimeEvent(3, lifeTime, 1, false); + sq_SetCurrentAttackInfo(colObj, sq_GetCustomAttackInfo(colObj, 24)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(colObj), totalDamage); + colObj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + } + } +} + +function checkExecutableSkill_Goddnessofwar(obj) +{ + if (!obj) return false; + if(obj.getState() == SKILL_BYKK_PRECENCIA && obj.getSkillSubState() < 10) return false; + local isUse = obj.sq_IsUseSkill(SKILL_BYKK_GODDNESSOFWAR); + if (isUse){ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) obj.getVar("skillSub").setInt(100, 2); + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) obj.getVar("skillSub").setInt(100, 1); + else obj.getVar("skillSub").setInt(100, 0); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(STATE_BYKK_GODDNESSOFWAR, STATE_PRIORITY_IGNORE_FORCE, true); + return true; + } + return false; +} + +function checkCommandEnable_Goddnessofwar(obj) +{ + if (!obj) return false; + return true; +} + +function onSetState_Goddnessofwar(obj, state, datas, isResetTimer) +{ + if(!obj) return; + local subState = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(subState); + obj.sq_StopMove(); + switch(subState){ + case 0: + if(obj.getVar("skillSub").getInt(100) == 2){ + obj.sq_SetCurrentAnimation(237); + obj.sq_PlaySound("R_WZ_PRECENCIA_GODDNESSOFWAR"); + obj.sq_PlaySound("PRECENCIA_GODDNESSOFWAR"); + } + else{ + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "Goddnessofwar_Body", false, false); + obj.setCurrentAnimation(Ani); + } + else obj.sq_SetCurrentAnimation(273); + + obj.sq_PlaySound("TEANA_CHANGE_CAST"); + obj.sq_PlaySound("GODDESWAR"); + obj.sq_PlaySound("R_WZ_GODDNESSOFWAR"); + } + break; + case 3: + if(obj.getVar("skillSub").getInt(100) == 2){ + obj.sq_SetCurrentAnimation(218); + obj.sq_PlaySound("R_WZ_PRECENCIA_CHASER_EVOLUTION"); + } + else{ + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "Wink1", false, false); + obj.setCurrentAnimation(Ani); + } + else{ + local Ani = obj.sq_GetThrowChargeAni(3); + obj.setCurrentAnimation(Ani); + } + obj.sq_PlaySound("WZ_EVOLUTIONCHASER_START"); + } + break; + case 4: + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "Wink2", false, false); + obj.setCurrentAnimation(Ani); + } + else{ + local Ani = obj.sq_GetThrowShootAni(3); + obj.setCurrentAnimation(Ani); + } + obj.sq_PlaySound("WZ_EVOLUTIONCHASER_LAUNCH"); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_chaserevolution.nut")){ + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/battlemage_bykk/ap/ap_chaserevolution.nut"); + changeBattlemageChaser(obj, 0); + } + else{ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut") || CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) return; + local addAppendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, SKILL_BYKK_CHASEREVOLUTION, false, "character/mage/battlemage_bykk/ap/ap_chaserevolution.nut", true); + addAppendage.setEnableIsBuff(true); + addAppendage.setBuffIconImage(74); + addAppendage.setAppendCauseSkill(BUFF_CAUSE_SKILL, sq_getJob(obj), SKILL_BYKK_CHASEREVOLUTION, sq_GetSkillLevel(obj, SKILL_BYKK_CHASEREVOLUTION)); + CNSquirrelAppendage.sq_Append(addAppendage, obj, obj, true); + changeBattlemageChaser(obj, 1); + } + break; + } +} + +function onEndCurrentAni_Goddnessofwar(obj) +{ + if(!obj) return; + local subState = obj.getSkillSubState(); + switch(subState){ + case 0: + local apdPath = "character/mage/battlemage_bykk/ap/ap_goddnessofwar.nut"; + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, apdPath)) CNSquirrelAppendage.sq_RemoveAppendage(obj, apdPath); + local addAppendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, SKILL_BYKK_GODDNESSOFWAR, false, apdPath, true); + setDamageRate_BattleMage_bykk(obj); + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_GODDNESSOFWAR); + local buffTime = sq_GetLevelData(obj, SKILL_BYKK_GODDNESSOFWAR, 0, skill_level); + if(buffTime > 0) addAppendage.sq_SetValidTime(buffTime); + addAppendage.setEnableIsBuff(true); + addAppendage.setAppendCauseSkill(BUFF_CAUSE_SKILL, sq_getJob(obj), SKILL_BYKK_GODDNESSOFWAR, skill_level); + CNSquirrelAppendage.sq_Append(addAppendage, obj, obj, true); + + local rad = sq_GetLevelData(obj, 7, 1, sq_GetSkillLevel(obj, 7)) / 10; + obj.getVar("apGetSetbyKK").setInt(0, rad); + + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_AUTO, true); + break; + case 3: + if(obj.getVar("skillSub").getInt(100) == 2){ + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_AUTO, true); + } + else{ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(4); + obj.sq_AddSetStatePacket(STATE_BYKK_GODDNESSOFWAR, STATE_PRIORITY_AUTO, true); + } + break; + case 4: + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_AUTO, true); + break; + } + +} + +function onProcCon_Goddnessofwar(obj) +{ + if(!obj) return; +} + +function onKeyFrameFlag_Goddnessofwar(obj, flagIndex) +{ + if(!obj) return false; + switch(flagIndex){ + case 101: + if(obj.getVar("skillSub").getInt(100) == 2){ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_chaserevolution.nut")){ + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/battlemage_bykk/ap/ap_chaserevolution.nut"); + changeBattlemageChaser(obj, 0); + } + else{ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut") || CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) return; + local addAppendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, SKILL_BYKK_CHASEREVOLUTION, false, "character/mage/battlemage_bykk/ap/ap_chaserevolution.nut", true); + addAppendage.setEnableIsBuff(true); + addAppendage.setBuffIconImage(74); + addAppendage.setAppendCauseSkill(BUFF_CAUSE_SKILL, sq_getJob(obj), SKILL_BYKK_CHASEREVOLUTION, sq_GetSkillLevel(obj, SKILL_BYKK_CHASEREVOLUTION)); + CNSquirrelAppendage.sq_Append(addAppendage, obj, obj, true); + changeBattlemageChaser(obj, 1); + } + } + break; + } + return true; +} + +function onTimeEvent_Goddnessofwar(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; +} + +function onEndState_Goddnessofwar(obj, new_state) +{ + if(!obj) return; +} + + + + + +function checkExecutableSkill_HandStrike(obj) +{ + if (!obj) return false; + if(obj.getState() == SKILL_BYKK_PRECENCIA && obj.getSkillSubState() < 10) return false; + local isUse = obj.sq_IsUseSkill(SKILL_BYKK_HANDSTRIKE); + if (isUse){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(STATE_BYKK_HANDSTRIKE, STATE_PRIORITY_IGNORE_FORCE, true); + return true; + } + return false; +} + +function checkCommandEnable_HandStrike(obj) +{ + if (!obj) return false; + return true; +} + +function onSetState_HandStrike(obj, state, datas, isResetTimer) +{ + if(!obj) return; + local subState = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(subState); + obj.sq_StopMove(); + switch(subState){ + case 0: + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) obj.getVar("skillSub").setInt(100, 2); + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) obj.getVar("skillSub").setInt(100, 1); + else obj.getVar("skillSub").setInt(100, 0); + obj.sq_IsEnterSkillLastKeyUnits(SKILL_BYKK_HANDSTRIKE); + obj.getVar("handstrike_move").setBool(100, false); + obj.getVar("handstrike_bool").setBool(0, true); + obj.getVar("handstrike_bool").setBool(1, true); + if(obj.getVar("skillSub").getInt(100) == 2){ + obj.sq_SetCurrentAnimation(240); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.5, 1.5); + } + else{ + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "Handstrike", false, false); + obj.setCurrentAnimation(Ani); + } + else obj.sq_SetCurrentAnimation(4); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_HANDSTRIKE); + local totalDamage = sq_GetLevelData(obj, SKILL_BYKK_HANDSTRIKE, 1, skillLevel); + local change = sq_GetLevelData(obj, SKILL_BYKK_HANDSTRIKE, 10, skillLevel); + if(change > 0) totalDamage = (obj.sq_GetBonusRateWithPassive(174, -1, 0, 1.0) + 200) * change / 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 3)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + + local attackInfo = sq_GetCurrentAttackInfo(obj); + local bForce = sq_GetLevelData(obj, SKILL_BYKK_HANDSTRIKE, 2, skillLevel); + sq_SetCurrentAttacknBackForce(attackInfo, bForce); + sq_SetCurrentAttacknUpForce(attackInfo, 600); + + attackInfo.setAttackType(ATTACKTYPE_PHYSICAL); + sq_SetAddWeaponDamage(attackInfo, true); + } + break; + case 1: + obj.sq_SetCurrentAnimation(239); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.5, 1.5); + break; + case 2: + obj.sq_SetCurrentAnimation(238); + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_HANDSTRIKE); + local totalDamage = sq_GetLevelData(obj, SKILL_BYKK_HANDSTRIKE, 1, skillLevel); + local change = sq_GetLevelData(obj, SKILL_BYKK_HANDSTRIKE, 10, skillLevel); + if(change > 0) totalDamage = (obj.sq_GetBonusRateWithPassive(174, -1, 0, 1.0) + 200) * change / 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 1)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + + local attackInfo = sq_GetCurrentAttackInfo(obj); + local bForce = sq_GetLevelData(obj, SKILL_BYKK_HANDSTRIKE, 2, skillLevel); + sq_SetCurrentAttacknBackForce(attackInfo, bForce); + sq_SetCurrentAttacknUpForce(attackInfo, 600); + attackInfo.setAttackType(ATTACKTYPE_PHYSICAL); + sq_SetAddWeaponDamage(attackInfo, true); + + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.5, 1.5); + local currentAni = obj.getCurrentAnimation(); + local delay = currentAni.getDelaySum(false); + local stateTime = obj.sq_GetVectorData(datas, 1); + print("stateTime = "+stateTime); + local speedRate = stateTime.tofloat() * 1.5; + if(speedRate <= 1000) speedRate = 1000.0; + else if(speedRate >= 2000) speedRate = 2000.0; + speedRate = 410.0 / delay * speedRate; + print("speedRate = "+speedRate); + if(sq_GetDirection(obj) == ENUM_DIRECTION_RIGHT) sq_SetVelocity(obj, 0, speedRate); + else sq_SetVelocity(obj, 0, -speedRate); + // obj.getVar("handstrike_move").setInt(10, sq_GetXPos(obj)); + // obj.setTimeEvent(1, delay / 20, 20, true); + break; + } +} + +function onEndCurrentAni_HandStrike(obj) +{ + if(!obj) return; + local subState = obj.getSkillSubState(); + switch(subState){ + case 0: + if(obj.getVar("skillSub").getInt(100) == 2){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(STATE_BYKK_HANDSTRIKE, STATE_PRIORITY_AUTO, true); + } + else{ + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_AUTO, true); + } + break; + case 1: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(STATE_BYKK_HANDSTRIKE, STATE_PRIORITY_AUTO, true); + break; + case 2: + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_AUTO, true); + break; + } +} + +function onProcCon_HandStrike(obj) +{ + if(!obj) return; + local subState = obj.getSkillSubState(); + switch(subState){ + case 0: + if(obj.getVar("skillSub").getInt(100) == 2) break; + local bDownKey = obj.isDownSkillLastKey(); + local frameIndex = sq_GetCurrentFrameIndex(obj); + local stateTime = obj.sq_GetStateTimer(); + if(!bDownKey && obj.getVar("handstrike_bool").getBool(1)){ + obj.getVar("handstrike_bool").setBool(1, false); + obj.getVar("handstrike_move").setInt(10, sq_GetXPos(obj)); + obj.getVar("handstrike_move").setInt(11, 200); + local currentAni = obj.getCurrentAnimation(); + currentAni.setCurrentFrameWithChildLayer(9); + local delay = currentAni.getDelaySum(9, 13); + //obj.setTimeEvent(0, delay / 30, 20, true); + print("stateTime = "+stateTime); + local speedRate = stateTime.tofloat() * 1.5; + if(speedRate <= 1000) speedRate = 1000.0; + else if(speedRate >= 2000) speedRate = 2000.0; + speedRate = 410.0 / delay * speedRate; + print("speedRate = "+speedRate); + if(sq_GetDirection(obj) == ENUM_DIRECTION_RIGHT) sq_SetVelocity(obj, 0, speedRate); + else sq_SetVelocity(obj, 0, -speedRate); + obj.sq_PlaySound("WZ_DASH_HIT"); + return; + } + if(frameIndex == 7){ + if(stateTime >= sq_GetIntData(obj, SKILL_BYKK_HANDSTRIKE, 2) && obj.getVar("handstrike_bool").getBool(0)){ + obj.getVar("handstrike_bool").setBool(0, false); + obj.getVar("handstrike_move").setBool(100, true); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/magicfullcharge31.ani", 0, 1, 50); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/magicfullcharge32.ani", 0, 1, 50); + obj.sq_PlaySound("YELLOWD_CHARGE"); + } + } + break; + case 1: + local bDownKey = obj.isDownSkillLastKey(); + local stateTime = obj.sq_GetStateTimer(); + //if(stateTime < 200) break; + if(!bDownKey){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_IntVectPush(stateTime); + obj.sq_AddSetStatePacket(STATE_BYKK_HANDSTRIKE, STATE_PRIORITY_AUTO, true); + break; + } + else{ + local fullchargeTime = sq_GetIntData(obj, SKILL_BYKK_HANDSTRIKE, 2); + if(sq_GetSkillLevel(obj, SKILL_BYKK_SPEARMASTERY) > 0 && obj.getWeaponSubType() == 0) fullchargeTime = fullchargeTime * (100 - sq_GetIntData(obj, SKILL_BYKK_SPEARMASTERY, 0)) / 100; + if(stateTime >= fullchargeTime && obj.getVar("handstrike_bool").getBool(0)){ + obj.getVar("handstrike_bool").setBool(0, false); + obj.getVar("handstrike_move").setBool(100, true); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/magicfullcharge31.ani", 0, 1, 75); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/magicfullcharge32.ani", 0, 1, 75); + obj.sq_PlaySound("YELLOWD_CHARGE"); + } + } + break; + } +} + + +function onKeyFrameFlag_HandStrike(obj, flagIndex) +{ + if(!obj) return false; + return true; +} + +function onTimeEvent_HandStrike(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + switch(timeEventIndex){ + case 0: + local baseX = obj.getVar("handstrike_move").getInt(10); + local moveX = obj.getVar("handstrike_move").getInt(11); + if(obj.getVar("handstrike_move").getBool(100)) moveX = moveX * 150 / 100; + if(obj.getVar("skillSub").getInt(100) == 2) moveX = moveX * 150 / 100; + local v = sq_GetUniformVelocity(0, moveX, timeEventCount, 20); + local dstX = sq_GetDistancePos(baseX, obj.getDirection(), v); + if(obj.isMovablePos(dstX, sq_GetYPos(obj))) sq_setCurrentAxisPos(obj, 0, dstX); + else{ + obj.getVar("handstrike_move").setInt(10, sq_GetXPos(obj)); + obj.getVar("handstrike_move").setInt(11, 0); + } + break; + case 1: + local baseX = obj.getVar("handstrike_move").getInt(10); + local moveX = obj.getVar("handstrike_move").getInt(11); + if(obj.getVar("handstrike_move").getBool(100)) moveX = moveX * 150 / 100; + local v = sq_GetUniformVelocity(0, moveX, timeEventCount, 20); + local dstX = sq_GetDistancePos(baseX, obj.getDirection(), v); + if(obj.isMovablePos(dstX, sq_GetYPos(obj))) sq_setCurrentAxisPos(obj, 0, dstX); + else{ + obj.getVar("handstrike_move").setInt(10, sq_GetXPos(obj)); + obj.getVar("handstrike_move").setInt(11, 0); + } + break; + } +} + +function onEndState_HandStrike(obj, new_state) +{ + if(!obj) return; +} + + +function onAttack_HandStrike(obj, damager, boundingBox, isStuck) +{ + if(!obj) return; + if(obj.getVar("handstrike_move").getBool(100) == false) return; + if(!damager.isObjectType(OBJECTTYPE_ACTIVE)) return; + if(sq_getGrowType(obj) != 3) return; + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_HANDSTRIKE, -1, 6, 1.0); + local group = sq_GetGroup(damager); + local uniqueId = sq_GetUniqueId(damager); + cearteSkillPassive_Battlemage_bykk(obj,damager,PASSIVEOBJECT_BYKK_BATTLEMAGE,0,0,sq_GetZPos(damager),damager.getDirection(),SKILL_BYKK_HANDSTRIKE,1,totalDamage,group,uniqueId,0,0,0,0,0); + + local createMax = sq_GetIntData(obj, SKILL_BYKK_CHASER, 0); + if(obj.getVar("kksChaser").get_obj_vector_size() < createMax) createBattlemageChaser(obj); +} + + +function checkExecutableSkill_Layofprimitive(obj) +{ + if (!obj) return false; + if(obj.getState() == SKILL_BYKK_PRECENCIA && obj.getSkillSubState() < 10) return false; + local isUse = obj.sq_IsUseSkill(SKILL_BYKK_LAYOFPRIMITIVE); + if (isUse){ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) obj.getVar("skillSub").setInt(100, 2); + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) obj.getVar("skillSub").setInt(100, 1); + else obj.getVar("skillSub").setInt(100, 0); + obj.sq_IntVectClear(); + if(obj.getVar("skillSub").getInt(100) == 2) obj.sq_IntVectPush(1); + else obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_LAYOFPRIMITIVE, STATE_PRIORITY_IGNORE_FORCE, true); + return true; + } + return false; +} + +function checkCommandEnable_Layofprimitive(obj) +{ + if (!obj) return false; + return true; +} + +function onSetState_Layofprimitive(obj, state, datas, isResetTimer) +{ + if(!obj) return; + local subState = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(subState); + obj.sq_StopMove(); + switch(subState){ + case 0://start + obj.sq_SetCurrentAnimation(288); + // sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/layofprimitive/layofprimitive_start_front_03.ani", 0, 1, 0); + // sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/layofprimitive/layofprimitive_start_back_08.ani", 0, -1, 0); + obj.sq_AddStateLayerAnimation(-1,obj.sq_CreateCNRDAnimation("effect/animation/battlemage_bykk/layofprimitive/layofprimitive_start_front_03.ani"), 0, 0); + obj.sq_AddStateLayerAnimation(10001,obj.sq_CreateCNRDAnimation("effect/animation/battlemage_bykk/layofprimitive/layofprimitive_start_back_08.ani"), 0, 0); + obj.sq_PlaySound("PRECENCIA_CHANGE_SHORT"); + break; + case 1://summon + obj.sq_SetCurrentAnimation(289); + sq_flashScreen(obj, 30, 1100, 180, 204, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + obj.sq_PlaySound("PRECENCIA_LAYOFPRIMITIVE_1_CAST"); + obj.sq_PlaySound("WZ_PRECENCIA_LAYOFPRIMITIVE_1_1"); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 63)); + break; + case 2://loop + obj.sq_SetCurrentAnimation(287); + // sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/layofprimitive/layofprimitive_loop_rune_00.ani", 175, 1, 75); + obj.sq_AddStateLayerAnimation(10001,obj.sq_CreateCNRDAnimation("effect/animation/battlemage_bykk/layofprimitive/layofprimitive_loop_rune_00.ani"), 175, -75); + obj.sq_PlaySound("PRECENCIA_LAYOFPRIMITIVE_2_SPEAR"); + obj.sq_PlaySound("R_WZ_PRECENCIA_LAYOFPRIMITIVE_1_2"); + obj.getVar("Layofprimitive_chaser").setInt(10, 0); + obj.getVar("Layofprimitive_chaser").setInt(11, 0); + local size = obj.getVar("kksChaser").get_obj_vector_size(); + if(size > 0){ + for(local i = 0; i < size; i++){ + local chaserObj = obj.getVar("kksChaser").get_obj_vector(i); + if(!chaserObj) continue; + local colObj = sq_GetCNRDObjectToCollisionObject(chaserObj); + local totalDamage = colObj.getVar("custom").getInt(10); + obj.getVar("Layofprimitive_chaser").setInt(10, obj.getVar("Layofprimitive_chaser").getInt(10) + 1); + obj.getVar("Layofprimitive_chaser").setInt(11, obj.getVar("Layofprimitive_chaser").getInt(11) + totalDamage); + colObj.setValid(false); + } + } + break; + case 3://end + obj.sq_SetCurrentAnimation(286); + obj.sq_PlaySound("PRECENCIA_LAYOFPRIMITIVE_3_SHOT"); + obj.sq_PlaySound("R_WZ_PRECENCIA_LAYOFPRIMITIVE_2_1"); + // sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/layofprimitive/layofprimitive_end_rune_06.ani", 175, 1, 75); + obj.sq_AddStateLayerAnimation(10001,obj.sq_CreateCNRDAnimation("effect/animation/battlemage_bykk/layofprimitive/layofprimitive_end_rune_06.ani"), 175, -75); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_LAYOFPRIMITIVE, -1, 0, 1.0) + 100; + totalDamage = totalDamage + obj.getVar("Layofprimitive_chaser").getInt(11); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 65)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + break; + case 4://dis + obj.sq_SetCurrentAnimation(285); + // sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/layofprimitive/layofprimitive_dissolution_front_03.ani", 0, 1, 0); + // sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/layofprimitive/layofprimitive_dissolution_back_08.ani", 0, -1, 0); + obj.sq_AddStateLayerAnimation(-1,obj.sq_CreateCNRDAnimation("effect/animation/battlemage_bykk/layofprimitive/layofprimitive_dissolution_back_08.ani"), 0, 0); + obj.sq_AddStateLayerAnimation(10001,obj.sq_CreateCNRDAnimation("effect/animation/battlemage_bykk/layofprimitive/layofprimitive_dissolution_front_03.ani"), 0, 0); + obj.sq_PlaySound("PRECENCIA_CHANGE_END"); + break; + } + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo){ + attackInfo.setAttackType(ATTACKTYPE_PHYSICAL); + sq_SetAddWeaponDamage(attackInfo, true); + } + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + local currentAni = obj.getCurrentAnimation(); + local speedRate = 4000 / currentAni.getDelaySum(0, 0); + switch(subState){ + case 1: speedRate = 2900 / currentAni.getDelaySum(0, 0); break; + case 2: speedRate = 5500 / currentAni.getDelaySum(0, 0); break; + case 3: speedRate = 6000 / currentAni.getDelaySum(0, 0); break; + case 4: speedRate = 4300 / currentAni.getDelaySum(0, 0); break; + } + print("speedRate = "+speedRate); + if(speedRate > 200){ + currentAni.setSpeedRate(200.0); + } + if(subState == 2){ + local currentAni = obj.getCurrentAnimation(); + obj.sq_SetXScrollStart(300, currentAni.getDelaySum(false)); + } +} + +function onEndCurrentAni_Layofprimitive(obj) +{ + if(!obj) return; + local subState = obj.getSkillSubState(); + switch(subState){ + case 0: + case 1: + case 2: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(subState + 1); + obj.sq_AddSetStatePacket(SKILL_BYKK_LAYOFPRIMITIVE, STATE_PRIORITY_AUTO, true); + break; + case 3: + if(obj.getVar("skillSub").getInt(100) != 2){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(subState + 1); + obj.sq_AddSetStatePacket(SKILL_BYKK_LAYOFPRIMITIVE, STATE_PRIORITY_AUTO, true); + break; + } + case 4: + obj.sq_SetXScrollStop(0); + local chaserNum = obj.getVar("Layofprimitive_chaser").getInt(10); + if(chaserNum > 0){ + for(local i = 0; i < chaserNum; i++){ + createBattlemageChaser(obj); + } + } + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_AUTO, true); + break; + } +} + +function onProcCon_Layofprimitive(obj) +{ + if(!obj) return; +} + +function onKeyFrameFlag_Layofprimitive(obj, flagIndex) +{ + if(!obj) return false; + switch(flagIndex){ + case 1001: + sq_flashScreen(obj, 50, 100, 100, 255, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + break; + case 1002: + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/layofprimitive/layofprimitive_summon_attack_15.ani", 0, 1, 0); + break; + case 1003: + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/layofprimitive/layofprimitive_summon_attack_16.ani", 0, 1, 0); + break; + case 1004: + sq_SetMyShake(obj, 3, 100); + break; + case 1005: + sq_flashScreen(obj, 30, 60, 120, 204, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + sq_flashScreen(obj, 30, 90, 30, 127, sq_RGB(255,255,255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + sq_SetMyShake(obj, 30, 200); + break; + } + return true; +} + +function onTimeEvent_Layofprimitive(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; +} + +function onEndState_Layofprimitive(obj, new_state) +{ + if(!obj) return; +} + + + +function checkExecutableSkill_PokeThrow(obj) +{ + if (!obj) return false; + if(obj.getState() == SKILL_BYKK_PRECENCIA && obj.getSkillSubState() < 10) return false; + local isUse = obj.sq_IsUseSkill(SKILL_BYKK_POKETHROW); + if (isUse){ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) obj.getVar("skillSub").setInt(100, 2); + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) obj.getVar("skillSub").setInt(100, 1); + else obj.getVar("skillSub").setInt(100, 0); + obj.getVar("dirBool").setBool(0, false); + obj.getVar("pokethrowTar").clear_obj_vector(); + obj.getVar("pokethrowTar_fix").clear_obj_vector(); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(STATE_BYKK_POKETHROW, STATE_PRIORITY_IGNORE_FORCE, true); + return true; + } + return false; +} + +function checkCommandEnable_PokeThrow(obj) +{ + if (!obj) return false; + return true; +} + +function onSetState_PokeThrow(obj, state, datas, isResetTimer) +{ + if(!obj) return; + local subState = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(subState); + obj.sq_StopMove(); + switch(subState){ + case 0: + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "Pokethrowtry", false, false); + obj.setCurrentAnimation(Ani); + } + else if(obj.getVar("skillSub").getInt(100) == 2){ + obj.sq_SetCurrentAnimation(246); + } + else{ + obj.sq_SetCurrentAnimation(6); + } + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_POKETHROW); + local totalDamage = sq_GetLevelData(obj, SKILL_BYKK_POKETHROW, 0, skillLevel); + local change = sq_GetLevelData(obj, SKILL_BYKK_POKETHROW, 5, skillLevel); + if(change > 0) totalDamage = (obj.sq_GetBonusRateWithPassive(174, -1, 0, 1.0) + 200) * change / 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 8)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo){ + attackInfo.setAttackType(ATTACKTYPE_PHYSICAL); + sq_SetAddWeaponDamage(attackInfo, true); + } + local speed = 2.0; + if(obj.getVar("skillSub").getInt(100) == 1) speed = 0.3 + speed; + else if(obj.getVar("skillSub").getInt(100) == 2) speed = 0.5 + speed; + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, speed, speed); + break; + case 1: + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "Pokethrowsmash", false, false); + obj.setCurrentAnimation(Ani); + } + else if(obj.getVar("skillSub").getInt(100) == 2){ + obj.sq_SetCurrentAnimation(245); + } + else{ + obj.sq_SetCurrentAnimation(7); + } + if(obj.getVar("dirBool").getBool(0) == false) sq_SetCurrentDirection(obj, sq_GetOppositeDirection(sq_GetDirection(obj))); + local speed = 2.0; + if(obj.getVar("skillSub").getInt(100) == 1) speed = 0.3 + speed; + else if(obj.getVar("skillSub").getInt(100) == 2) speed = 0.5 + speed; + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, speed, speed); + local pAni = obj.getCurrentAnimation(); + local delay = pAni.getDelaySum(false) / 3; + obj.setTimeEvent(0, delay, 1, false); + obj.setTimeEvent(1, delay * 2, 1, false); + local size = obj.getVar("pokethrowTar").get_obj_vector_size(); + for(local i = 0; i < size; i++){ + local targetObj = obj.getVar("pokethrowTar").get_obj_vector(i); + if(targetObj){ + local addAppendage = CNSquirrelAppendage.sq_GetAppendage(targetObj, "character/mage/battlemage_bykk/ap/ap_pokethrow.nut"); + if(!addAppendage) continue; + sq_MoveToAppendageForce(targetObj, obj, obj, 0, 0, 100, delay, true, addAppendage); + } + } + break; + case 2: + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "Pokethrowsmashfront", false, false); + obj.setCurrentAnimation(Ani); + } + else if(obj.getVar("skillSub").getInt(100) == 2){ + obj.sq_SetCurrentAnimation(244); + } + else{ + obj.sq_SetCurrentAnimation(272); + } + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_POKETHROW); + local speed = (1000 + sq_GetLevelData(obj, SKILL_BYKK_POKETHROW, 2, skillLevel)) / 1000.0; + if(obj.getVar("skillSub").getInt(100) == 1) speed = 0.3 + speed; + else if(obj.getVar("skillSub").getInt(100) == 2) speed = 0.5 + speed; + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, speed, speed); + local pAni = obj.getCurrentAnimation(); + local delay = pAni.getDelaySum(false) / 3 * 2; + obj.setTimeEvent(1, delay, 1, false); + break; + } +} + +function onEndCurrentAni_PokeThrow(obj) +{ + if(!obj) return; + local subState = obj.getSkillSubState(); + switch(subState){ + case 0: + if(obj.getVar("pokethrowTar_fix").get_obj_vector_size() > 0){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(STATE_BYKK_POKETHROW, STATE_PRIORITY_AUTO, true); + } + else if(obj.getVar("pokethrowTar").get_obj_vector_size() > 0){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(STATE_BYKK_POKETHROW, STATE_PRIORITY_AUTO, true); + } + else{ + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_AUTO, true); + } + break; + case 1: + case 2: + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_AUTO, true); + break; + } +} + +function onProcCon_PokeThrow(obj) +{ + if(!obj) return; + local subState = obj.getSkillSubState(); + if(subState == 0){ + if(obj.getVar("dirBool").getBool(0) == false){ + if((sq_IsKeyDown(OPTION_HOTKEY_MOVE_LEFT, ENUM_SUBKEY_TYPE_ALL) && obj.getDirection()== ENUM_DIRECTION_LEFT) || (sq_IsKeyDown(OPTION_HOTKEY_MOVE_RIGHT, ENUM_SUBKEY_TYPE_ALL) && obj.getDirection() == ENUM_DIRECTION_RIGHT)) obj.getVar("dirBool").setBool(0, true); + } + } +} + +function onKeyFrameFlag_PokeThrow(obj, flagIndex) +{ + if(!obj) return false; + return true; +} + +function onTimeEvent_PokeThrow(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + switch(timeEventIndex){ + case 0: + local pAni = obj.getCurrentAnimation(); + local delay = pAni.getDelaySum(false) / 3; + local size = obj.getVar("pokethrowTar").get_obj_vector_size(); + for(local i = 0; i < size; i++){ + local targetObj = obj.getVar("pokethrowTar").get_obj_vector(i); + if(targetObj){ + local addAppendage = CNSquirrelAppendage.sq_GetAppendage(targetObj, "character/mage/battlemage_bykk/ap/ap_pokethrow.nut"); + if(!addAppendage) continue; + sq_MoveToAppendageForce(targetObj, obj, obj, 125, 0, 0, delay, true, addAppendage); + } + } + break; + case 1: + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_POKETHROW); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_POKETHROW, -1, 1, 1.0) + 100; + local change = sq_GetLevelData(obj, SKILL_BYKK_POKETHROW, 5, skillLevel); + if(change > 0) totalDamage = (obj.sq_GetBonusRateWithPassive(174, -1, 0, 1.0) + 200) * change / 100; + local sizeRate = sq_GetLevelData(obj, SKILL_BYKK_POKETHROW, 3, skillLevel); + if(sq_GetSkillLevel(obj, SKILL_BYKK_SPEARMASTERY) > 0 && obj.getWeaponSubType() == 0) sizeRate = sizeRate + sq_GetIntData(obj, SKILL_BYKK_SPEARMASTERY, 1); + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,125,0,0,obj.getDirection(),SKILL_BYKK_POKETHROW,1,totalDamage,sizeRate,0,0,0,0,0,0); + break; + case 2: + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_POKETHROW); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_POKETHROW, -1, 4, 1.0) + 100; + local change = sq_GetLevelData(obj, SKILL_BYKK_POKETHROW, 5, skillLevel); + if(change > 0) totalDamage = (obj.sq_GetBonusRateWithPassive(174, -1, 0, 1.0) + 200) * change / 100; + local sizeRate = sq_GetLevelData(obj, SKILL_BYKK_POKETHROW, 3, skillLevel); + if(sq_GetSkillLevel(obj, SKILL_BYKK_SPEARMASTERY) > 0 && obj.getWeaponSubType() == 0) sizeRate = sizeRate + sq_GetIntData(obj, SKILL_BYKK_SPEARMASTERY, 1); + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,125,0,0,obj.getDirection(),SKILL_BYKK_POKETHROW,1,totalDamage,sizeRate,0,0,0,0,0,0); + break; + } +} + +function onEndState_PokeThrow(obj, new_state) +{ + if(!obj) return; + if(new_state != STATE_BYKK_POKETHROW){ + local size = obj.getVar("pokethrowTar").get_obj_vector_size(); + if(size > 0){ + for(local i = 0; i < size; i++){ + local targetObj = obj.getVar("pokethrowTar").get_obj_vector(i); + if(targetObj) CNSquirrelAppendage.sq_RemoveAppendage(targetObj, "character/mage/battlemage_bykk/ap/ap_pokethrow.nut"); + } + } + } +} + +function onAttack_PokeThrow(obj, damager, boundingBox, isStuck) +{ + if(!obj) return; + local subState = obj.getSkillSubState(); + switch(subState){ + case 0: + if(damager.isObjectType(OBJECTTYPE_ACTIVE)){ + if(sq_IsHoldable(obj,damager) && !sq_IsFixture(damager) && sq_IsGrabable(obj,damager)){ + if(!CNSquirrelAppendage.sq_IsAppendAppendage(damager, "character/mage/battlemage_bykk/ap/ap_pokethrow.nut")){ + if(!obj.getVar("pokethrowTar").is_obj_vector(damager)) obj.getVar("pokethrowTar").push_obj_vector(damager); + local addAppendage = CNSquirrelAppendage.sq_AppendAppendage(damager, obj, -1, false, "character/mage/battlemage_bykk/ap/ap_pokethrow.nut", true); + sq_HoldAndDelayDie(damager, obj, true, true, true, 200, 200, ENUM_DIRECTION_NEUTRAL, addAppendage); + } + } + else{ + if(!obj.getVar("pokethrowTar_fix").is_obj_vector(damager)) obj.getVar("pokethrowTar_fix").push_obj_vector(damager); + } + + if(sq_getGrowType(obj) != 3) break; + local createMax = sq_GetIntData(obj, SKILL_BYKK_CHASER, 0); + if(obj.getVar("kksChaser").get_obj_vector_size() < createMax) createBattlemageChaser(obj); + } + break; + } +} + + + +function checkExecutableSkill_Precencia(obj) +{ + if (!obj) return false; + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut") || CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) return false; + local isUse = obj.sq_IsUseSkill(SKILL_BYKK_PRECENCIA); + if (isUse){ + local subState = 0; + local skill = sq_GetSkill(obj, SKILL_BYKK_PRECENCIA); + if(!skill.isSealFunction()) subState = 2; + obj.sq_IntVectClear(); + obj.sq_IntVectPush(subState); + obj.sq_AddSetStatePacket(SKILL_BYKK_PRECENCIA, STATE_PRIORITY_IGNORE_FORCE, true); + obj.startSkillCoolTime(SKILL_BYKK_PRECENCIA, sq_GetSkillLevel(obj, SKILL_BYKK_PRECENCIA), -1); + return true; + } + return false; +} + +function checkCommandEnable_Precencia(obj) +{ + if (!obj) return false; + return true; +} + +function onSetState_Precencia(obj, state, datas, isResetTimer) +{ + if(!obj) return; + local subState = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(subState); + obj.sq_StopMove(); + switch(subState){ + case 0://二覺化身 + obj.sq_SetCurrentAnimation(93); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_chaserevolution.nut")){ + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/battlemage_bykk/ap/ap_chaserevolution.nut"); + } + changeBattlemageChaser(obj, 2); + break; + case 2://三覺化身 + obj.sq_SetCurrentAnimation(210); + obj.sq_PlaySound("PRECENCIA_CHANGE_SHORT"); + obj.sq_PlaySound("R_WZ_PRECENCIA_CHANGE"); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_chaserevolution.nut")){ + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/battlemage_bykk/ap/ap_chaserevolution.nut"); + } + changeBattlemageChaser(obj, 3); + obj.setObjectHeight(10); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/avatar/precencia/realease/avatar_release_back_08.ani", 0, -1, 0); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/avatar/precencia/realease/avatar_release_front_03.ani", 0, 1, 0); + break; + case 1://解除化身 + local sub = obj.sq_GetVectorData(datas, 1); + switch(sub){ + case 0://二覺 + local Ani = getCurrentAnimation_precencia(obj, "avatarend_body", false, false); + obj.setCurrentAnimation(Ani); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/avatar/avatarend_eff_00.ani", 0, 1, 0); + sq_flashScreen(obj,700,100,300,255, sq_RGB(255,255,255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_COVER); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut"); + } + break; + case 1://三覺主動解除 + obj.sq_SetCurrentAnimation(209); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/avatar/precencia/realease/avatar_finish_return_back_08.ani", 0, 1, 0); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/avatar/precencia/realease/avatar_finish_return_front_03.ani", 0, 1, 0); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut"); + } + break; + } + changeBattlemageChaser(obj, 0); + break; + case 10: + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + obj.sq_SetCurrentAnimation(206); + // for(local i = 0; i < 20000; i++){ + // obj.stopSound(i); + // } + obj.sq_PlaySound("R_WZ_PRECENCIA_ATK_1"); + } + else{ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + local Ani = getCurrentAnimation_precencia(obj, "battlemageattack1", false, false); + obj.setCurrentAnimation(Ani); + } + else{ + obj.sq_SetCurrentAnimation(9); + } + } + obj.getVar("attackBool").setBool(10, false); + obj.getVar("attackBool").setBool(12, false); + break; + case 11: + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + obj.sq_SetCurrentAnimation(207); + obj.sq_PlaySound("R_WZ_PRECENCIA_ATK_2"); + } + else{ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + local Ani = getCurrentAnimation_precencia(obj, "battlemageattack2", false, false); + obj.setCurrentAnimation(Ani); + } + else{ + obj.sq_SetCurrentAnimation(10); + } + obj.sq_PlaySound("R_WZ_ATK"); + } + obj.getVar("attackBool").setBool(10, false); + obj.getVar("attackBool").setBool(13, false); + break; + case 12: + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + obj.sq_SetCurrentAnimation(208); + obj.sq_PlaySound("R_WZ_PRECENCIA_ATK_3"); + } + else{ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + local Ani = getCurrentAnimation_precencia(obj, "battlemageattack3", false, false); + obj.setCurrentAnimation(Ani); + } + else{ + obj.sq_SetCurrentAnimation(11); + } + obj.sq_PlaySound("R_WZ_ATK"); + } + break; + case 20: + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + obj.sq_SetCurrentAnimation(218); + } + else{ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + local Ani = getCurrentAnimation_precencia(obj, "Buff", false, false); + obj.setCurrentAnimation(Ani); + } + else{ + local Ani = obj.sq_GetThrowChargeAni(3); + obj.setCurrentAnimation(Ani); + } + } + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + local currentAni = obj.getCurrentAnimation(); + local castTime = currentAni.getDelaySum(false); + sq_StartDrawCastGauge(obj, castTime, true); + break; + case 21: + local Ani = obj.sq_GetThrowShootAni(3); + obj.setCurrentAnimation(Ani); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + break; + } + if(subState >= 10 && subState <= 12){ + local speed = 1.3; + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) speed = 2.5; + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, speed, speed); + local atkIndex = [53,54,55]; + local totalDamage = sq_GetLevelData(obj, 174, 0, sq_GetSkillLevel(obj, 174)) + 100; + if(sq_GetSkillLevel(obj, SKILL_BYKK_ENABLEFINISHATTACK) > 0) totalDamage = totalDamage * (1000 + sq_GetLevelData(obj, SKILL_BYKK_ENABLEFINISHATTACK, 2, sq_GetSkillLevel(obj, SKILL_BYKK_ENABLEFINISHATTACK))) / 1000; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, atkIndex[subState - 10])); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo){ + attackInfo.setAttackType(ATTACKTYPE_PHYSICAL); + sq_SetAddWeaponDamage(attackInfo, true); + } + } +} + + +function onEndCurrentAni_Precencia(obj) +{ + if(!obj) return; + //if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + obj.sq_PlaySound("AVATAR_AURA_LOOP", 2333); + local apdPath = "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut"; + local addAppendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, SKILL_BYKK_PRECENCIA, false, apdPath, true); + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_PRECENCIA); + local buffTime = sq_GetLevelData(obj, SKILL_BYKK_PRECENCIA, 0, skillLevel); + addAppendage.sq_SetValidTime(buffTime); + addAppendage.setEnableIsBuff(true); + addAppendage.setAppendCauseSkill(BUFF_CAUSE_SKILL, sq_getJob(obj), SKILL_BYKK_PRECENCIA, skillLevel); + CNSquirrelAppendage.sq_Append(addAppendage, obj, obj, true); + local hpMax = sq_GetLevelData(obj, SKILL_BYKK_PRECENCIA, 1, skillLevel); + local allDefense = sq_GetLevelData(obj, SKILL_BYKK_PRECENCIA, 2, skillLevel); + local attackspeedRate = sq_GetLevelData(obj, SKILL_BYKK_PRECENCIA, 3, skillLevel); + local movespeedRate = sq_GetLevelData(obj, SKILL_BYKK_PRECENCIA, 4, skillLevel); + local allactTolerance = sq_GetLevelData(obj, SKILL_BYKK_PRECENCIA, 5, skillLevel); + local change_appendage = addAppendage.sq_getChangeStatus("precencia"); + if(!change_appendage) change_appendage = addAppendage.sq_AddChangeStatus("precencia",obj, obj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK, true, 1000); + if(change_appendage){ + change_appendage.clearParameter(); + change_appendage.addParameter(CHANGE_STATUS_TYPE_HP_MAX, false, (hpMax).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_PHYSICAL_DEFENSE, false, (allDefense).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_MAGICAL_DEFENSE, false, (allDefense).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_ATTACK_SPEED, false, (attackspeedRate).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_MOVE_SPEED, false, (movespeedRate).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_ACTIVESTATUS_TOLERANCE_ALL, false, (allactTolerance).tofloat()); + } + obj.sq_SetSuperArmorUntilTime(obj, buffTime); + if(sq_GetIntData(obj, SKILL_BYKK_PRECENCIA, 15) > 0) addAppendage.getVar("setFail").setBool(0, true); + + local spectrumAppendage = addAppendage.sq_GetOcularSpectrum("ocularSpectrum");//得到殘影 + if(!spectrumAppendage) spectrumAppendage = addAppendage.sq_AddOcularSpectrum("ocularSpectrum", obj, obj, 100);//設置殘影 + sq_SetParameterOcularSpectrum(spectrumAppendage, 300, 75, true, sq_RGBA(255, 244, 77, 75), sq_RGBA(255, 244, 77, 0), 2, 2, 2);//設置效果 + + local goddAppendage = CNSquirrelAppendage.sq_GetAppendage(obj, "character/mage/battlemage_bykk/ap/ap_goddnessofwar.nut"); + if(goddAppendage) goddAppendage.getVar().setBool(100, true); + + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + case 2: + obj.sq_PlaySound("AVATAR_AURA_LOOP", 2333); + local apdPath = "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut"; + local addAppendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, SKILL_BYKK_PRECENCIA, false, apdPath, true); + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_PRECENCIA); + local buffTime = sq_GetLevelData(obj, SKILL_BYKK_PRECENCIA, 0, skillLevel); + addAppendage.sq_SetValidTime(buffTime); + addAppendage.setEnableIsBuff(true); + addAppendage.setAppendCauseSkill(BUFF_CAUSE_SKILL, sq_getJob(obj), SKILL_BYKK_PRECENCIA, skillLevel); + CNSquirrelAppendage.sq_Append(addAppendage, obj, obj, true); + local hpMax = sq_GetLevelData(obj, SKILL_BYKK_PRECENCIA, 1, skillLevel); + local allDefense = sq_GetLevelData(obj, SKILL_BYKK_PRECENCIA, 2, skillLevel); + local attackspeedRate = sq_GetLevelData(obj, SKILL_BYKK_PRECENCIA, 3, skillLevel); + local movespeedRate = sq_GetLevelData(obj, SKILL_BYKK_PRECENCIA, 4, skillLevel); + local allactTolerance = sq_GetLevelData(obj, SKILL_BYKK_PRECENCIA, 5, skillLevel); + local change_appendage = addAppendage.sq_getChangeStatus("precencia"); + if(!change_appendage) change_appendage = addAppendage.sq_AddChangeStatus("precencia",obj, obj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK, true, 1000); + if(change_appendage){ + change_appendage.clearParameter(); + change_appendage.addParameter(CHANGE_STATUS_TYPE_HP_MAX, false, (hpMax).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_PHYSICAL_DEFENSE, false, (allDefense).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_MAGICAL_DEFENSE, false, (allDefense).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_ATTACK_SPEED, false, (attackspeedRate).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_MOVE_SPEED, false, (movespeedRate).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_ACTIVESTATUS_TOLERANCE_ALL, false, (allactTolerance).tofloat()); + } + obj.sq_SetSuperArmorUntilTime(obj, buffTime); + if(sq_GetIntData(obj, SKILL_BYKK_PRECENCIA, 15) > 0) addAppendage.getVar("setFail").setBool(0, true); + + local spectrumAppendage = addAppendage.sq_GetOcularSpectrum("ocularSpectrum");//得到殘影 + if(!spectrumAppendage) spectrumAppendage = addAppendage.sq_AddOcularSpectrum("ocularSpectrum", obj, obj, 100);//設置殘影 + sq_SetParameterOcularSpectrum(spectrumAppendage, 300, 75, true, sq_RGBA(255, 244, 77, 75), sq_RGBA(255, 244, 77, 0), 2, 2, 2);//設置效果 + + local goddAppendage = CNSquirrelAppendage.sq_GetAppendage(obj, "character/mage/battlemage_bykk/ap/ap_goddnessofwar.nut"); + if(goddAppendage) goddAppendage.getVar().setBool(100, true); + + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + case 1: + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut"); + } + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut"); + } + case 10: + case 11: + case 12: + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + case 20: + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut") || CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + local apdPath = "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut"; + local addAppendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, SKILL_BYKK_PRECENCIA, false, apdPath, true); + local skillLevel = sq_GetSkillLevel(obj, 2); + local buffTime = sq_GetLevelData(obj, 2, 0, 2); + addAppendage.sq_SetValidTime(buffTime); + addAppendage.setEnableIsBuff(true); + addAppendage.setAppendCauseSkill(BUFF_CAUSE_SKILL, sq_getJob(obj), 2, skillLevel); + CNSquirrelAppendage.sq_Append(addAppendage, obj, obj, true); + + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + } + else{ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(21); + obj.sq_AddSetStatePacket(SKILL_BYKK_PRECENCIA, STATE_PRIORITY_USER, true); + } + break; + case 21: + local apdPath = "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut"; + local addAppendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, SKILL_BYKK_PRECENCIA, false, apdPath, true); + local skillLevel = sq_GetSkillLevel(obj, 2); + local buffTime = sq_GetLevelData(obj, 2, 0, 2); + addAppendage.sq_SetValidTime(buffTime); + addAppendage.setEnableIsBuff(true); + addAppendage.setAppendCauseSkill(BUFF_CAUSE_SKILL, sq_getJob(obj), 2, skillLevel); + CNSquirrelAppendage.sq_Append(addAppendage, obj, obj, true); + + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_Precencia(obj) +{ + if(!obj) return; + local subState = obj.getSkillSubState(); + switch(subState){ + case 10: + case 11: + if(obj.getVar("attackBool").getBool(subState) == false){ + sq_SetKeyxEnable(obj, E_ATTACK_COMMAND, true); + if(sq_IsEnterCommand(obj, E_ATTACK_COMMAND)) obj.getVar("attackBool").setBool(subState, true); + } + if(obj.getVar("attackBool").getBool(subState)){ + local pAni = obj.getCurrentAnimation(); + local delaySum = pAni.getDelaySum(false); + local currentT = sq_GetCurrentTime(pAni); + if(currentT >= delaySum * 90 / 100){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(subState + 1); + obj.sq_AddSetStatePacket(SKILL_BYKK_PRECENCIA, STATE_PRIORITY_USER, true); + } + } + case 12: + if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_DOWN, ENUM_SUBKEY_TYPE_ALL) && sq_IsKeyDown(OPTION_HOTKEY_JUMP, ENUM_SUBKEY_TYPE_ALL)){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_IntVectPush(1); + obj.sq_IntVectPush(200); + obj.sq_AddSetStatePacket(6, STATE_PRIORITY_IGNORE_FORCE, true); + break; + } + local speedRate = [0,300,30]; + if((obj.getVar("attackBool").getBool(12) && subState >= 10) || (obj.getVar("attackBool").getBool(13) && subState >= 11)) break; + if((sq_IsKeyDown(OPTION_HOTKEY_MOVE_LEFT, ENUM_SUBKEY_TYPE_ALL) && obj.getDirection() == ENUM_DIRECTION_RIGHT) || (sq_IsKeyDown(OPTION_HOTKEY_MOVE_RIGHT, ENUM_SUBKEY_TYPE_ALL) && obj.getDirection() == ENUM_DIRECTION_LEFT)){ + if(obj.getVar("attackBool").getBool(12) == false) obj.getVar("attackBool").setBool(12, true); + if(obj.getVar("attackBool").getBool(13) == false) obj.getVar("attackBool").setBool(13, true); + } + else if((sq_IsKeyDown(OPTION_HOTKEY_MOVE_RIGHT, ENUM_SUBKEY_TYPE_ALL) && obj.getDirection() == ENUM_DIRECTION_RIGHT) || (sq_IsKeyDown(OPTION_HOTKEY_MOVE_LEFT, ENUM_SUBKEY_TYPE_ALL) && obj.getDirection() == ENUM_DIRECTION_LEFT)) speedRate = [0, 500, 80]; + if(obj.getDirection() == ENUM_DIRECTION_RIGHT && speedRate[subState - 10] > 0) sq_SetVelocity(obj, 0, speedRate[subState - 10].tofloat()); + else if(obj.getDirection() == ENUM_DIRECTION_LEFT && speedRate[subState - 10] > 0) sq_SetVelocity(obj, 0, -speedRate[subState - 10].tofloat()); + break; + } +} + +function onKeyFrameFlag_Precencia(obj, flagIndex) +{ + if(!obj) return false; + local subState = obj.getSkillSubState(); + switch(subState){ + case 0: + sq_flashScreen(obj, 100, 0, 50, 178, sq_RGB(255,255,255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + sq_SetMyShake(obj, 5, 100); + break; + case 1: + switch(flagIndex){ + case 111: obj.sq_PlaySound("PRCENCIA_AVATAR_CAST"); break; + case 201: obj.sq_PlaySound("AVATAR_FINISH_CAST"); break; + case 202: sq_flashScreen(obj, 0, 80, 80, 255, sq_RGB(255,255,255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); break; + case 203: + obj.sq_PlaySound("WZ_AVATAR_FINISH"); + obj.sq_PlaySound("AVATAR_FINISH"); + sq_flashScreen(obj, 80, 0, 166, 255, sq_RGB(255,255,255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_COVER); + sq_SetMyShake(obj, 5, 240); + break; + case 301: sq_flashScreen(obj, 0, 80, 80, 255, sq_RGB(255,255,255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); obj.sq_PlaySound("AVATAR_FINISH_CAST"); break; + case 302: sq_flashScreen(obj, 60, 60, 420, 204, sq_RGB(255,255,255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_COVER); sq_SetMyShake(obj, 8, 160); obj.sq_PlaySound("AVATAR_FINISH"); break; + case 303: obj.sq_PlaySound("AVATAR_FINISH"); break; + } + break; + case 2: + switch(flagIndex){ + case 101: sq_flashScreen(obj, 150, 0, 0, 76, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); break; + } + break; + case 10: obj.sq_PlaySound("R_PRECENCIA_WEAPONSWING"); break; + case 11: obj.sq_PlaySound("PRECENCIA_WEAPONSWING"); break; + case 12: obj.sq_PlaySound("PRECENCIA_WEAPONSWING"); break; + } + return true;// +} + +function onTimeEvent_Precencia(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + switch(timeEventIndex){ + case 0: + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/avatar/precencia/avatar_inishxx1_26.ani", 0, 1, 0); + break; + } +} + +function onEndState_Precencia(obj, new_state) +{ + if(!obj) return; + if(new_state != SKILL_BYKK_PRECENCIA){ + sq_EndDrawCastGauge(obj); + } +} + +function onAttack_Precencia(obj, damager, boundingBox, isStuck) +{ + if(!obj) return; + if(isStuck) return; + if(!damager.isObjectType(OBJECTTYPE_ACTIVE)) return; + if(obj.getSkillSubState() != 12) return; + local createMax = sq_GetIntData(obj, SKILL_BYKK_CHASER, 0); + if(obj.getVar("kksChaser").get_obj_vector_size() < createMax) createBattlemageChaser(obj); +} + + +function checkExecutableSkill_Quasarexplosion(obj) +{ + if (!obj) return false; + if(obj.getState() == SKILL_BYKK_PRECENCIA && obj.getSkillSubState() < 10) return false; + local isUse = obj.sq_IsUseSkill(SKILL_BYKK_QUASAREXPLOSION); + if (isUse){ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) obj.getVar("skillSub").setInt(100, 2); + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) obj.getVar("skillSub").setInt(100, 1); + else obj.getVar("skillSub").setInt(100, 0); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_QUASAREXPLOSION, STATE_PRIORITY_IGNORE_FORCE, true); + return true; + } + return false; +} + +function checkCommandEnable_Quasarexplosion(obj) +{ + if (!obj) return false; + return true; +} + +function onSetState_Quasarexplosion(obj, state, datas, isResetTimer) +{ + if(!obj) return; + local subState = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(subState); + obj.sq_StopMove(); + obj.sq_ZStop(); + switch(subState){ + case 0: + if(obj.getVar("skillSub").getInt(100) == 0){ + obj.sq_SetCurrentAnimation(290); + obj.sq_PlaySound("WZ_QUASAR_EXPLOSION_READY"); + } + else if(obj.getVar("skillSub").getInt(100) == 2) obj.sq_SetCurrentAnimation(292); + else if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "QuasarExplosionPrecencia_Start_Normal", false, false); + obj.setCurrentAnimation(Ani); + } + obj.sq_PlaySound("PRECENCIA_QUASAR_1_CAST"); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + break; + case 1: + obj.sq_SetCurrentAnimation(294); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + local currentAni = obj.getCurrentAnimation(); + local delay = currentAni.getDelaySum(0, 0); + local speedRate = 6000 / delay; + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_QUASAREXPLOSION, -1, 0, 1.0) + 100; + if(obj.getWeaponSubType() == 1 && sq_GetSkillLevel(obj, SKILL_BYKK_POLEMASTERY) > 0) totalDamage = totalDamage * (1000 + sq_GetIntData(obj, SKILL_BYKK_POLEMASTERY, 4)) / 1000; + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,0,0,0,obj.getDirection(),SKILL_BYKK_QUASAREXPLOSION,1,totalDamage,speedRate,0,0,0,0,0,0); + obj.sq_PlaySound("WZ_PRECENCIA_QUASAR_1_01"); + obj.setTimeEvent(0, 500 / speedRate, 1, false); + break; + case 2: + if(obj.getVar("skillSub").getInt(100) == 0){ + obj.sq_SetCurrentAnimation(291); + } + else if(obj.getVar("skillSub").getInt(100) == 2){ + obj.sq_SetCurrentAnimation(293); + } + else if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "QuasarExplosionPrecencia_Normal_End", false, false); + obj.setCurrentAnimation(Ani); + } + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + if(obj.getVar("skillSub").getInt(100) < 2){ + local currentAni = obj.getCurrentAnimation(); + local delay = currentAni.getDelaySum(0, 0); + local speedRate = 6100 / delay; + local aniPath = ["character/mage/effect/animation/battlemage_bykk/quasarexplosion/precencia/quasarexplosion_normal_end_00.ani","character/mage/effect/animation/battlemage_bykk/quasarexplosion/precencia/quasarexplosion_normal_end_01.ani","character/mage/effect/animation/battlemage_bykk/quasarexplosion/precencia/quasarexplosion_normal_end_02.ani","character/mage/effect/animation/battlemage_bykk/quasarexplosion/precencia/quasarexplosion_normal_end_03.ani"]; + for(local i = 0; i < aniPath.len(); i++){ + local pooledObj = sq_AddDrawOnlyAniFromParent(obj, aniPath[i], 0, 1, 0); + local pAni = pooledObj.getCurrentAnimation(); + pAni.setSpeedRate(speedRate.tofloat()); + } + } + break; + } +} + +function onEndCurrentAni_Quasarexplosion(obj) +{ + if(!obj) return; + local subState = obj.getSkillSubState(); + switch(subState){ + case 0: + case 1: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(subState + 1); + obj.sq_AddSetStatePacket(SKILL_BYKK_QUASAREXPLOSION, STATE_PRIORITY_AUTO, true); + break; + case 2: + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_AUTO, true); + break; + } +} + +function onProcCon_Quasarexplosion(obj) +{ + if(!obj) return; +} + +function onKeyFrameFlag_Quasarexplosion(obj, flagIndex) +{ + if(!obj) return false; + switch(flagIndex){ + case 101: sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/quasarexplosion/precencia/quasarexplosion_start_normal_02.ani", 0, 1, 0); break; + case 102: sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/quasarexplosion/precencia/quasarexplosion_start_normal_03.ani", 0, 1, 0); break; + } + return true; +} + +function onTimeEvent_Quasarexplosion(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + switch(timeEventIndex){ + case 0: + switch(obj.getVar("skillSub").getInt(100)){ + case 0: obj.sq_PlaySound("WZ_QUASAR_EXPLOSION_FIN"); break; + case 2: obj.sq_PlaySound("WZ_PRECENCIA_QUASAR_2_01"); break; + } + break; + } +} + +function onEndState_Quasarexplosion(obj, new_state) +{ + if(!obj) return; +} + + + + +function checkExecutableSkill_RandomPierceStrike(obj) +{ + if (!obj) return false; + if(obj.getState() == SKILL_BYKK_PRECENCIA && obj.getSkillSubState() < 10) return false; + local isUse = obj.sq_IsUseSkill(SKILL_BYKK_RANDOMPIERCESTRIKE); + if (isUse){ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) obj.getVar("skillSub").setInt(100, 2); + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) obj.getVar("skillSub").setInt(100, 1); + else obj.getVar("skillSub").setInt(100, 0); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_RANDOMPIERCESTRIKE, STATE_PRIORITY_IGNORE_FORCE, true); + return true; + } + return false; +} + +function checkCommandEnable_RandomPierceStrike(obj) +{ + if (!obj) return false; + return true; +} + +function onSetState_RandomPierceStrike(obj, state, datas, isResetTimer) +{ + if(!obj) return; + local subState = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(subState); + obj.sq_StopMove(); + switch(subState){ + case 0: + if(obj.getVar("skillSub").getInt(100) == 2){ + obj.sq_SetCurrentAnimation(249); + } + else{ + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "RandomPierceStrikeTry", false, false); + obj.setCurrentAnimation(Ani); + } + else{ + obj.sq_SetCurrentAnimation(12); + } + obj.sq_PlaySound("WZ_THUNDER_01", 2333); + } + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_RANDOMPIERCESTRIKE); + local hitMax = sq_GetLevelData(obj, SKILL_BYKK_RANDOMPIERCESTRIKE, 6, skillLevel); + obj.getVar("rdps").setInt(10, hitMax); + obj.getVar("rdps").setInt(11, 0); + local totalDamage = sq_GetLevelData(obj, SKILL_BYKK_RANDOMPIERCESTRIKE, 0, skillLevel); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 12)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + break; + case 1: + if(obj.getVar("skillSub").getInt(100) == 2){ + obj.sq_SetCurrentAnimation(248); + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_RANDOMPIERCESTRIKE); + local hitTime = sq_GetLevelData(obj, SKILL_BYKK_RANDOMPIERCESTRIKE, 9, skillLevel); + obj.setTimeEvent(0, hitTime, -1, false); + } + else{ + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "RandomPierceStrikeLoop", false, false); + obj.setCurrentAnimation(Ani); + } + else{ + obj.sq_SetCurrentAnimation(13); + } + obj.sq_AddStateLayerAnimation(1,obj.sq_CreateCNRDAnimation("effect/animation/randompiercestrike/hit.ani"), 200, -40); + } + break; + case 2: + obj.removeAllTimeEvent(); + if(obj.getVar("skillSub").getInt(100) == 2){ + obj.sq_SetCurrentAnimation(247); + obj.sq_PlaySound("PRECENCIA_PIERCESTRIKE_2_FINISH"); + obj.sq_PlaySound("R_WZ_PRECENCIA_PIERCESTRIKE_2"); + } + else{ + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "RandomPierceStrikeFinish", false, false); + obj.setCurrentAnimation(Ani); + } + else{ + obj.sq_SetCurrentAnimation(14); + } + obj.sq_AddStateLayerAnimation(1,obj.sq_CreateCNRDAnimation("effect/animation/randompiercestrike/swing.ani"), 0, 0); + obj.stopSound(2333); + obj.sq_PlaySound("WZ_THUNDER_02"); + obj.setTimeEvent(1, 100, 1, false); + } + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_RANDOMPIERCESTRIKE); + local totalDamage = sq_GetLevelData(obj, SKILL_BYKK_RANDOMPIERCESTRIKE, 2, skillLevel); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 13)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + break; + } + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo){ + attackInfo.setAttackType(ATTACKTYPE_PHYSICAL); + sq_SetAddWeaponDamage(attackInfo, true); + } + + local speed = 1.35; + if(obj.getVar("skillSub").getInt(100) == 1) speed = 0.3 + speed; + else if(obj.getVar("skillSub").getInt(100) == 2) speed = 0.5 + speed; + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, speed, speed); +} + +function onEndCurrentAni_RandomPierceStrike(obj) +{ + if(!obj) return; + local subState = obj.getSkillSubState(); + switch(subState){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_RANDOMPIERCESTRIKE, STATE_PRIORITY_AUTO, true); + break; + case 1: + obj.resetHitObjectList(); + obj.sq_IntVectClear(); + if(obj.getVar("rdps").getInt(11) >= obj.getVar("rdps").getInt(10) - 1 || sq_GetLevelData(obj, SKILL_BYKK_RANDOMPIERCESTRIKE, 11, sq_GetSkillLevel(obj, SKILL_BYKK_RANDOMPIERCESTRIKE)) > 0) obj.sq_IntVectPush(2); + else{ + obj.sq_IntVectPush(1); + obj.getVar("rdps").setInt(11, obj.getVar("rdps").getInt(11) + 1); + } + obj.sq_AddSetStatePacket(SKILL_BYKK_RANDOMPIERCESTRIKE, STATE_PRIORITY_AUTO, true); + break; + case 2: + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_AUTO, true); + break; + } +} + +function onProcCon_RandomPierceStrike(obj) +{ + if(!obj) return; + local subState = obj.getSkillSubState(); + switch(subState){ + case 0: + case 1: + // sq_SetKeyxEnable(obj, E_SKILL_COMMAND, true); + // sq_SetKeyxEnable(obj, E_JUMP_COMMAND, true); + if(sq_IsKeyDown(OPTION_HOTKEY_SKILL, ENUM_SUBKEY_TYPE_ALL)){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(SKILL_BYKK_RANDOMPIERCESTRIKE, STATE_PRIORITY_AUTO, true); + } + if(sq_IsKeyDown(OPTION_HOTKEY_JUMP, ENUM_SUBKEY_TYPE_ALL)){ + obj.stopSound(2333); + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_AUTO, true); + } + break; + } +} + +function onKeyFrameFlag_RandomPierceStrike(obj, flagIndex) +{ + if(!obj) return false; + switch(flagIndex){ + case 1001: + sq_SetMyShake(obj, 8, 80); + break; + } + return true; +} + +function onTimeEvent_RandomPierceStrike(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + switch(timeEventIndex){ + case 0: + if(timeEventCount >= obj.getVar("rdps").getInt(10) - 1){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(SKILL_BYKK_RANDOMPIERCESTRIKE, STATE_PRIORITY_AUTO, true); + } + else obj.resetHitObjectList(); + break; + case 1: + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/randompiercestrike/dust.ani", 0, 0, 0); + break; + } +} + +function onEndState_RandomPierceStrike(obj, new_state) +{ + if(!obj) return; +} + + + + +function checkExecutableSkill_RandomPierceStrikeEx(obj) +{ + if (!obj) return false; + if(obj.getState() == SKILL_BYKK_PRECENCIA && obj.getSkillSubState() < 10) return false; + local isUse = obj.sq_IsUseSkill(SKILL_BYKK_RANDOMPIERCESTRIKEEX); + if (isUse){ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) obj.getVar("skillSub").setInt(100, 2); + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) obj.getVar("skillSub").setInt(100, 1); + else obj.getVar("skillSub").setInt(100, 0); + if(RANDOMPIERCESTRIKEEX_STONE > 0 || sq_GetLevelData(obj, SKILL_BYKK_RANDOMPIERCESTRIKEEX, 8, sq_GetSkillLevel(obj, SKILL_BYKK_RANDOMPIERCESTRIKEEX)) > 0) obj.getVar("RandomPierceStrikeEx_tar").clear_obj_vector(); + obj.sq_IntVectClear(); + if(obj.getVar("skillSub").getInt(100) == 2) obj.sq_IntVectPush(10); + else obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(STATE_BYKK_RANDOMPIERCESTRIKEEX, STATE_PRIORITY_IGNORE_FORCE, true); + return true; + } + return false; +} + +function checkCommandEnable_RandomPierceStrikeEx(obj) +{ + if (!obj) return false; + return true; +} + +function onSetState_RandomPierceStrikeEx(obj, state, datas, isResetTimer) +{ + if(!obj) return; + local subState = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(subState); + obj.sq_StopMove(); + switch(subState){ + case 0: + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "RandomPierceStrikeTry", false, false); + obj.setCurrentAnimation(Ani); + } + else obj.sq_SetCurrentAnimation(12); + obj.sq_PlaySound("WZ_THUNDER_01", 2333); + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_RANDOMPIERCESTRIKEEX); + local hitMax = sq_GetLevelData(obj, SKILL_BYKK_RANDOMPIERCESTRIKEEX, 7, skillLevel); + obj.getVar("rdpsex").setInt(10, hitMax); + obj.getVar("rdpsex").setInt(11, 0); + local totalDamage = sq_GetLevelData(obj, SKILL_BYKK_RANDOMPIERCESTRIKEEX, 3, skillLevel); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 29)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + break; + case 1: + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "RandomPierceStrikeLoopEx", false, false); + obj.setCurrentAnimation(Ani); + } + else obj.sq_SetCurrentAnimation(56); + obj.setTimeEvent(2, 100, -1, false); + break; + case 2: + if(obj.isExistTimeEvent(2)) obj.stopTimeEvent(2); + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "RandomPierceStrikeChargeEx", false, false); + obj.setCurrentAnimation(Ani); + } + else obj.sq_SetCurrentAnimation(57); + obj.sq_AddStateLayerAnimation(1,obj.sq_CreateCNRDAnimation("effect/animation/battlemage_bykk/randompiercestrikeex/charge_dodge.ani"), 0, 0); + obj.sq_AddStateLayerAnimation(2,obj.sq_CreateCNRDAnimation("effect/animation/battlemage_bykk/randompiercestrikeex/charge_light_dodge.ani"), 0, 0); + break; + case 3: + if(obj.isExistTimeEvent(2)) obj.stopTimeEvent(2); + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "RandomPierceStrikeFinishEx", false, false); + obj.setCurrentAnimation(Ani); + } + else obj.sq_SetCurrentAnimation(58); + obj.removeAllTimeEvent(); + obj.stopSound(2333); + obj.sq_PlaySound("WZ_THUNDER_02"); + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_RANDOMPIERCESTRIKEEX); + local totalDamage = sq_GetLevelData(obj, SKILL_BYKK_RANDOMPIERCESTRIKEEX, 5, skillLevel); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 30)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + + obj.sq_AddStateLayerAnimation(1,obj.sq_CreateCNRDAnimation("effect/animation/battlemage_bykk/randompiercestrikeex/bluelight_dodge1.ani"), 180, -40); + obj.sq_AddStateLayerAnimation(1,obj.sq_CreateCNRDAnimation("effect/animation/battlemage_bykk/randompiercestrikeex/bluelight_dodge2.ani"), 180, -40); + obj.sq_AddStateLayerAnimation(1,obj.sq_CreateCNRDAnimation("effect/animation/battlemage_bykk/randompiercestrikeex/end_dodge.ani"), 180, -40); + obj.sq_AddStateLayerAnimation(1,obj.sq_CreateCNRDAnimation("effect/animation/battlemage_bykk/randompiercestrikeex/glow_dodge.ani"), 180, -40); + obj.sq_AddStateLayerAnimation(1,obj.sq_CreateCNRDAnimation("effect/animation/battlemage_bykk/randompiercestrikeex/redlight_dodge.ani"), 180, -40); + obj.sq_AddStateLayerAnimation(1,obj.sq_CreateCNRDAnimation("effect/animation/battlemage_bykk/randompiercestrikeex/shadow_dodge.ani"), 180, -40); + obj.sq_AddStateLayerAnimation(1,obj.sq_CreateCNRDAnimation("effect/animation/battlemage_bykk/randompiercestrikeex/shadow_normal.ani"), 180, -40); + break; + case 10: + obj.sq_SetCurrentAnimation(251); + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_RANDOMPIERCESTRIKEEX); + local hitMax = sq_GetLevelData(obj, SKILL_BYKK_RANDOMPIERCESTRIKEEX, 7, skillLevel); + obj.getVar("rdpsex").setInt(10, hitMax); + obj.getVar("rdpsex").setInt(11, 0); + local totalDamage = sq_GetLevelData(obj, SKILL_BYKK_RANDOMPIERCESTRIKEEX, 3, skillLevel); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 29)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local hitTime = sq_GetIntData(obj, SKILL_BYKK_RANDOMPIERCESTRIKEEX, 8); + obj.setTimeEvent(1, hitTime, -1, false); + break; + case 11: + obj.sq_SetCurrentAnimation(252); + obj.sq_AddStateLayerAnimation(1,obj.sq_CreateCNRDAnimation("effect/animation/battlemage_bykk/randompiercestrikeex/precencia/sinrairenloop_10.ani"), 0, 0); + break; + case 12: + obj.sq_SetCurrentAnimation(253); + obj.sq_AddStateLayerAnimation(1,obj.sq_CreateCNRDAnimation("effect/animation/battlemage_bykk/randompiercestrikeex/precencia/sinrairenloop_10.ani"), 0, 0); + break; + case 13: + obj.sq_SetCurrentAnimation(254); + obj.sq_AddStateLayerAnimation(1,obj.sq_CreateCNRDAnimation("effect/animation/battlemage_bykk/randompiercestrikeex/precencia/sinrairenloop_10.ani"), 0, 0); + break; + case 14: + obj.removeAllTimeEvent(); + obj.sq_SetCurrentAnimation(250); + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_RANDOMPIERCESTRIKEEX); + local totalDamage = sq_GetLevelData(obj, SKILL_BYKK_RANDOMPIERCESTRIKEEX, 5, skillLevel); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 30)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + break; + } + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo){ + attackInfo.setAttackType(ATTACKTYPE_PHYSICAL); + sq_SetAddWeaponDamage(attackInfo, true); + } + + local speed = 1.35; + if(obj.getVar("skillSub").getInt(100) == 1) speed = 0.3 + speed; + else if(obj.getVar("skillSub").getInt(100) == 2) speed = 0.5 + speed; + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, speed, speed); + if(subState == 1){ + local currentAni = obj.getCurrentAnimation(); + obj.setTimeEvent(1, currentAni.getDelaySum(false), -1, false); + local speedRate = 4000.0 / currentAni.getDelaySum(0, 0); + local pooledObj = sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/randompiercestrikeex/pierce_dodge.ani", 200, 1, 40); + local pAni = pooledObj.getCurrentAnimation(); + pAni.setSpeedRate(speedRate); + } +} + +function onEndCurrentAni_RandomPierceStrikeEx(obj) +{ + if(!obj) return; + local subState = obj.getSkillSubState(); + switch(subState){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(STATE_BYKK_RANDOMPIERCESTRIKEEX, STATE_PRIORITY_AUTO, true); + break; + case 1: + obj.resetHitObjectList(); + obj.sq_IntVectClear(); + if(obj.getVar("rdpsex").getInt(11) >= obj.getVar("rdpsex").getInt(10) - 1 || sq_GetLevelData(obj, SKILL_BYKK_RANDOMPIERCESTRIKEEX, 14, sq_GetSkillLevel(obj, SKILL_BYKK_RANDOMPIERCESTRIKEEX)) > 0) obj.sq_IntVectPush(2); + else{ + obj.sq_IntVectPush(1); + obj.getVar("rdpsex").setInt(11, obj.getVar("rdpsex").getInt(11) + 1); + } + obj.sq_AddSetStatePacket(STATE_BYKK_RANDOMPIERCESTRIKEEX, STATE_PRIORITY_AUTO, true); + break; + case 2: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(3); + obj.sq_AddSetStatePacket(STATE_BYKK_RANDOMPIERCESTRIKEEX, STATE_PRIORITY_AUTO, true); + break; + case 3: + case 14: + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_AUTO, true); + break; + case 10: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(11); + obj.sq_AddSetStatePacket(STATE_BYKK_RANDOMPIERCESTRIKEEX, STATE_PRIORITY_AUTO, true); + break; + case 11: + case 12: + case 13: + local pushstate = subState + 1; + if(subState == 13) pushstate = 11; + obj.sq_IntVectClear(); + obj.sq_IntVectPush(pushstate); + obj.sq_AddSetStatePacket(STATE_BYKK_RANDOMPIERCESTRIKEEX, STATE_PRIORITY_AUTO, true); + break; + } +} + +function onProcCon_RandomPierceStrikeEx(obj) +{ + if(!obj) return; + local subState = obj.getSkillSubState(); + switch(subState){ + case 0: + case 1: + case 10: + case 11: + case 12: + case 13: + if(sq_IsKeyDown(OPTION_HOTKEY_SKILL, ENUM_SUBKEY_TYPE_ALL)){ + obj.sq_IntVectClear(); + if(subState < 10) obj.sq_IntVectPush(2); + else obj.sq_IntVectPush(14); + obj.sq_AddSetStatePacket(STATE_BYKK_RANDOMPIERCESTRIKEEX, STATE_PRIORITY_AUTO, true); + } + if(sq_IsKeyDown(OPTION_HOTKEY_JUMP, ENUM_SUBKEY_TYPE_ALL)){ + obj.stopSound(2333); + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_AUTO, true); + } + break; + } +} + +function onKeyFrameFlag_RandomPierceStrikeEx(obj, flagIndex) +{ + if(!obj) return false; + switch(flagIndex){ + case 1001: + print("test"); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/randompiercestrikeex/precencia/randompiercestrikeex_finish_02.ani", 0, 1, 0); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/randompiercestrikeex/precencia/randompiercestrikeex_finish_01.ani", 0, 1, 0); + sq_SetMyShake(obj, 20, 150); + break; + case 1002: + obj.sq_PlaySound("R_WZ_PRECENCIA_PIERCESTRIKE_EX_2"); + obj.sq_PlaySound("PRECENCIA_PIERCESTRIKE_EX_2_FINISH"); + break; + } + return true; +} + +function onTimeEvent_RandomPierceStrikeEx(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + switch(timeEventIndex){ + case 0: + if(timeEventCount >= obj.getVar("rdpsex").getInt(10) - 1){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(STATE_BYKK_RANDOMPIERCESTRIKEEX, STATE_PRIORITY_AUTO, true); + } + else obj.resetHitObjectList(); + break; + case 1: + if(timeEventCount >= obj.getVar("rdpsex").getInt(10) - 1){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(14); + obj.sq_AddSetStatePacket(STATE_BYKK_RANDOMPIERCESTRIKEEX, STATE_PRIORITY_AUTO, true); + } + else obj.resetHitObjectList(); + break; + case 2: obj.sq_PlaySound("R_P_THUNDER_ATK"); break; + } +} + +function onEndState_RandomPierceStrikeEx(obj, new_state) +{ + if(!obj) return; + if(new_state != STATE_BYKK_RANDOMPIERCESTRIKEEX){ + + local size = obj.getVar("RandomPierceStrikeEx_tar").get_obj_vector_size(); + if(size > 0){ + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_RANDOMPIERCESTRIKEEX); + local totalDamage = sq_GetLevelData(obj, SKILL_BYKK_RANDOMPIERCESTRIKEEX, 5, skillLevel) * 19 / 100; + for(local i = 0; i < size; i++){ + local targetObj = obj.getVar("RandomPierceStrikeEx_tar").get_obj_vector(i); + if(targetObj){ + local group = sq_GetGroup(targetObj); + local uniqueId = sq_GetUniqueId(targetObj); + cearteSkillPassive_Battlemage_bykk(obj,targetObj,PASSIVEOBJECT_BYKK_BATTLEMAGE,0,0,0,obj.getDirection(),SKILL_BYKK_RANDOMPIERCESTRIKEEX,1,totalDamage,group,uniqueId,0,0,0,0,0); + local addAppendage = CNSquirrelAppendage.sq_GetAppendage(targetObj, "character/mage/battlemage_bykk/ap/ap_randompiercestrikeex.nut"); + addAppendage.sq_SetValidTime(1000); + } + } + } + } +} + +function onAttack_RandomPierceStrikeEx(obj, damager, boundingBox, isStuck) +{ + if(!obj) return; + if(!damager.isObjectType(OBJECTTYPE_ACTIVE)) return; + if(RANDOMPIERCESTRIKEEX_STONE < 1 && sq_GetLevelData(obj, SKILL_BYKK_RANDOMPIERCESTRIKEEX, 8, sq_GetSkillLevel(obj, SKILL_BYKK_RANDOMPIERCESTRIKEEX)) < 1) return; + if(CNSquirrelAppendage.sq_IsAppendAppendage(damager, "character/mage/battlemage_bykk/ap/ap_randompiercestrikeex.nut")) return; + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(damager, obj, -1, false, "character/mage/battlemage_bykk/ap/ap_randompiercestrikeex.nut", true); + sq_HoldAndDelayDie(damager, obj, true, true, true, 200, 200, ENUM_DIRECTION_NEUTRAL , AddAppendage); + if(!obj.getVar("RandomPierceStrikeEx_tar").is_obj_vector(damager)) obj.getVar("RandomPierceStrikeEx_tar").push_obj_vector(damager); +} + +function checkExecutableSkill_Returntobm(obj) +{ + if (!obj) return false; + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")){ + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut"); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_PRECENCIA, STATE_PRIORITY_USER, true); + } + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")){ + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut"); + // obj.sq_SendCreatePassiveObjectPacket(1008605, 0, 0, 1, 200); + obj.setObjectHeight(-1); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_PRECENCIA, STATE_PRIORITY_USER, true); + } + return true; +} + +function checkCommandEnable_Returntobm(obj) +{ + if (!obj) return false; + return true; +} + +function onSetState_Returntobm(obj, state, datas, isResetTimer) +{ + if(!obj) return; +} + +function onEndCurrentAni_Returntobm(obj) +{ + if(!obj) return; +} + +function onProcCon_Returntobm(obj) +{ + if(!obj) return; +} + +function onKeyFrameFlag_Returntobm(obj, flagIndex) +{ + if(!obj) return false; + return true; +} + +function onTimeEvent_Returntobm(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; +} + +function onEndState_Returntobm(obj, new_state) +{ + if(!obj) return; +} + + + +function checkExecutableSkill_StrengthHandStrike(obj) +{ + if (!obj) return false; + if(obj.getState() == SKILL_BYKK_PRECENCIA && obj.getSkillSubState() < 10) return false; + local isUse = obj.sq_IsUseSkill(SKILL_BYKK_STRENGTHHANDSTRIKE); + if (isUse){ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) obj.getVar("skillSub").setInt(100, 2); + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) obj.getVar("skillSub").setInt(100, 1); + else obj.getVar("skillSub").setInt(100, 0); + obj.sq_IsEnterSkillLastKeyUnits(SKILL_BYKK_STRENGTHHANDSTRIKE); + obj.getVar("shsBool").setBool(0, true); + if(STRENGTHHANDSTRIKE_STONE > 0 || sq_GetLevelData(obj, SKILL_BYKK_STRENGTHHANDSTRIKE, 12, sq_GetSkillLevel(obj, SKILL_BYKK_STRENGTHHANDSTRIKE)) > 0){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(21); + obj.sq_AddSetStatePacket(SKILL_BYKK_STRENGTHHANDSTRIKE, STATE_PRIORITY_IGNORE_FORCE, true); + } + else{ + obj.sq_IntVectClear(); + if(obj.getVar("skillSub").getInt(100) == 2) obj.sq_IntVectPush(10); + else obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_STRENGTHHANDSTRIKE, STATE_PRIORITY_IGNORE_FORCE, true); + } + return true; + } + return false; +} + +function checkCommandEnable_StrengthHandStrike(obj) +{ + if (!obj) return false; + return true; +} + +function onSetState_StrengthHandStrike(obj, state, datas, isResetTimer) +{ + if(!obj) return; + local subState = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(subState); + obj.sq_StopMove(); + switch(subState){ + case 0: + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "StrengthHandStrike", false, false); + obj.setCurrentAnimation(Ani); + } + else obj.sq_SetCurrentAnimation(15); + obj.sq_PlaySound("WZ_RAIDP_01", 2332); + obj.sq_PlaySound("RAIDP_CHARGE_LOOP", 2333); + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,0,1,0,obj.getDirection(),SKILL_BYKK_STRENGTHHANDSTRIKE,1,0,0,0,0,0,0,0,0); + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,0,-1,0,obj.getDirection(),SKILL_BYKK_STRENGTHHANDSTRIKE,2,0,0,0,0,0,0,0,0); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_STRENGTHHANDSTRIKE, -1, 1, 1.0) + 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 14)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo){ + attackInfo.setAttackType(ATTACKTYPE_PHYSICAL); + sq_SetAddWeaponDamage(attackInfo, true); + } + break; + case 1: + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "StrengthHandStrikeReturn", false, false); + obj.setCurrentAnimation(Ani); + } + else obj.sq_SetCurrentAnimation(16); + local currentAni = obj.getCurrentAnimation(); + local delay = currentAni.getDelaySum(false); + obj.setTimeEvent(2, delay / 21, 6, true); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/strengthhandstrike/end_body_fade.ani", 0, 0, 0); + break; + case 10: + obj.sq_SetCurrentAnimation(261); + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,0,1,0,obj.getDirection(),SKILL_BYKK_STRENGTHHANDSTRIKE,11,0,0,0,0,0,0,0,0); + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,0,-1,0,obj.getDirection(),SKILL_BYKK_STRENGTHHANDSTRIKE,12,0,0,0,0,0,0,0,0); + obj.sq_PlaySound("R_WZ_PRECENCIA_STRENGTHHANDSTRIKE_1", 2332); + obj.sq_PlaySound("RAIDP_CHARGE_LOOP", 2333); + break; + case 11: + obj.sq_SetCurrentAnimation(258); + break; + case 12: + obj.sq_SetCurrentAnimation(259); + local currentAni = obj.getCurrentAnimation(); + local delay = currentAni.getDelaySum(false); + obj.setTimeEvent(2, delay / 21, 6, true); + break; + case 21: + if(obj.getVar("skillSub").getInt(100) == 2){ + obj.sq_SetCurrentAnimation(262); + obj.sq_PlaySound("R_WZ_PRECENCIA_STRENGTHHANDSTRIKE_1", 2332); + obj.sq_PlaySound("RAIDP_CHARGE_LOOP", 2333); + } + else{ + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "StrengthHandStrikeShootCharge", false, false); + obj.setCurrentAnimation(Ani); + } + else obj.sq_SetCurrentAnimation(277); + obj.sq_PlaySound("WZ_RAIDP_01", 2332); + obj.sq_PlaySound("RAIDP_CHARGE_LOOP", 2333); + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,0,1,0,obj.getDirection(),SKILL_BYKK_STRENGTHHANDSTRIKE,1,0,0,0,0,0,0,0,0); + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,0,-1,0,obj.getDirection(),SKILL_BYKK_STRENGTHHANDSTRIKE,2,0,0,0,0,0,0,0,0); + } + break; + case 22: + if(obj.getVar("skillSub").getInt(100) == 2){ + obj.sq_SetCurrentAnimation(260); + obj.stopSound(2332); + obj.stopSound(2333); + obj.sq_PlaySound("WZ_PRECENCIA_STRENGTHHANDSTRIKE_2"); + } + else{ + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "StrengthHandStrikeShoot", false, false); + obj.setCurrentAnimation(Ani); + } + else obj.sq_SetCurrentAnimation(276); + obj.stopSound(2332); + obj.stopSound(2333); + obj.sq_PlaySound("WZ_RAIDP_02"); + local size = obj.getVar("kksshs").get_obj_vector_size(); + if(size > 0){ + for(local i = 0; i < size; i++){ + local shsObj = obj.getVar("kksshs").get_obj_vector(i); + if(shsObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(shsObj); + colObj.setValid(false); + } + } + } + } + break; + } + if(subState < 10){ + local speedRate = 1.0; + if(obj.getVar("skillSub").getInt(100) == 1) speedRate = 1.3; + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, speedRate, speedRate); + } +} + +function onEndCurrentAni_StrengthHandStrike(obj) +{ + if(!obj) return; + local subState = obj.getSkillSubState(); + switch(subState){ + case 0: + case 10: + case 11: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(subState + 1); + obj.sq_AddSetStatePacket(SKILL_BYKK_STRENGTHHANDSTRIKE, STATE_PRIORITY_AUTO, true); + break; + case 1: + case 12: + case 22: + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_AUTO, true); + break; + } +} + +function onProcCon_StrengthHandStrike(obj) +{ + if(!obj) return; + local subState = obj.getSkillSubState(); + switch(subState){ + case 0: + case 10: + case 21: + local bDownKey = obj.isDownSkillLastKey(); + if(!bDownKey){ + if(subState == 0 || subState == 10){ + local frameIndex = sq_GetCurrentFrameIndex(obj); + if((frameIndex == 7 && subState == 0) || (frameIndex == 2 && subState == 10)){ + local currentAni = obj.getCurrentAnimation(); + local setFrame = 8; + if(subState == 10) setFrame = 3; + currentAni.setCurrentFrameWithChildLayer(setFrame); + local size = obj.getVar("kksshs").get_obj_vector_size(); + if(size > 0){ + for(local i = 0; i < size; i++){ + local shsObj = obj.getVar("kksshs").get_obj_vector(i); + if(shsObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(shsObj); + colObj.setValid(false); + } + } + } + local currentAni = obj.getCurrentAnimation(); + local delay = currentAni.getDelaySum(setFrame, setFrame); + obj.getVar("shs_move").setInt(10, sq_GetXPos(obj)); + obj.getVar("shs_move").setInt(11, 400); + obj.setTimeEvent(0, delay, 1, false); + obj.stopSound(2332); + obj.stopSound(2333); + if(subState == 0){ + obj.sq_AddStateLayerAnimation(1,obj.sq_CreateCNRDAnimation("effect/animation/battlemage_bykk/strengthhandstrike/attack_short.ani"), 0, 0); + obj.sq_AddStateLayerAnimation(1,obj.sq_CreateCNRDAnimation("effect/animation/battlemage_bykk/strengthhandstrike/attack_long.ani"), 0, 0); + obj.sq_PlaySound("WZ_RAIDP_02"); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/strengthhandstrike/start_body_fade.ani", 0, 0, 0); + + local attackInfo = sq_GetCurrentAttackInfo(obj); + local upForce = sq_GetLevelData(obj, SKILL_BYKK_STRENGTHHANDSTRIKE, 2, sq_GetSkillLevel(obj, SKILL_BYKK_STRENGTHHANDSTRIKE)); + if(obj.getVar("shsBool").getBool(0)) upForce = sq_GetLevelData(obj, SKILL_BYKK_UPPERSWING, 3, sq_GetSkillLevel(obj, SKILL_BYKK_STRENGTHHANDSTRIKE)); + sq_SetCurrentAttacknUpForce(attackInfo, upForce); + } + else{ + obj.sq_PlaySound("WZ_PRECENCIA_STRENGTHHANDSTRIKE_2"); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_STRENGTHHANDSTRIKE, -1, 1, 1.0) + 100; + local upForce = sq_GetLevelData(obj, SKILL_BYKK_STRENGTHHANDSTRIKE, 2, sq_GetSkillLevel(obj, SKILL_BYKK_STRENGTHHANDSTRIKE)); + if(obj.getVar("shsBool").getBool(0)) upForce = sq_GetLevelData(obj, SKILL_BYKK_UPPERSWING, 3, sq_GetSkillLevel(obj, SKILL_BYKK_STRENGTHHANDSTRIKE)); + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,170,1,120,obj.getDirection(),SKILL_BYKK_STRENGTHHANDSTRIKE,20,totalDamage,upForce,0,0,0,0,0,0); + } + } + } + else{ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(subState + 1); + obj.sq_AddSetStatePacket(SKILL_BYKK_STRENGTHHANDSTRIKE, STATE_PRIORITY_AUTO, true); + } + } + else{ + local stateTime = obj.sq_GetStateTimer(); + local fullchargeTime = sq_GetIntData(obj, SKILL_BYKK_STRENGTHHANDSTRIKE, 2); + if(sq_GetSkillLevel(obj, SKILL_BYKK_SPEARMASTERY) > 0 && obj.getWeaponSubType() == 0) fullchargeTime = fullchargeTime * ( 100 - sq_GetIntData(obj, SKILL_BYKK_SPEARMASTERY, 4)) / 100; + if(stateTime >= fullchargeTime && obj.getVar("shsBool").getBool(0)){ + obj.getVar("shsBool").setBool(0, false); + obj.sq_PlaySound("RAIDP_FULL"); + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,0,1,0,obj.getDirection(),SKILL_BYKK_STRENGTHHANDSTRIKE,3,0,0,0,0,0,0,0,0); + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,0,-1,0,obj.getDirection(),SKILL_BYKK_STRENGTHHANDSTRIKE,4,0,0,0,0,0,0,0,0); + obj.sq_SetSuperArmor(POD_VAR_SUPERARMOR); + } + } + break; + } +} + +function onKeyFrameFlag_StrengthHandStrike(obj, flagIndex) +{ + if(!obj) return false; + switch(flagIndex){ + case 1001: + sq_SetShake(obj, 10, 150); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_STRENGTHHANDSTRIKE, -1, 1, 1.0) + 100; + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,56,0,63,obj.getDirection(),SKILL_BYKK_STRENGTHHANDSTRIKE,21,totalDamage,100,0,0,0,0,0,0); + break; + case 2001: + sq_SetShake(obj, 10, 150); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_STRENGTHHANDSTRIKE, -1, 1, 1.0) + 100; + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,170,1,120,obj.getDirection(),SKILL_BYKK_STRENGTHHANDSTRIKE,21,totalDamage,150,0,0,0,0,0,0); + break; + } + return true; +} + +function onTimeEvent_StrengthHandStrike(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + switch(timeEventIndex){ + case 0: + local currentAni = obj.getCurrentAnimation(); + local poleAniFrameNumber = sq_GetAniFrameNumber(currentAni, 0); + local startFrame = 9; + if(obj.getSkillSubState() == 10) startFrame = 4; + local delay = currentAni.getDelaySum(startFrame, poleAniFrameNumber); + obj.setTimeEvent(1, delay / 50, 30, true); + break; + case 1: + local v = sq_GetUniformVelocity(0, 400, timeEventCount, 30); + local dstX = sq_GetDistancePos(obj.getVar("shs_move").getInt(10), obj.getDirection(), v); + sq_setCurrentAxisPos(obj, 0, dstX); + // obj.sq_SetXScrollStop(0); + if(timeEventCount >= 30){ + obj.getVar("shs_move").setInt(12, sq_GetXPos(obj)); + obj.sq_PlaySound("RAIDP_ATK"); + if(obj.getSkillSubState() == 0) sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/strengthhandstrike/damage.ani", 50, 0, 10); + } + break; + case 2: + local v = sq_GetUniformVelocity(obj.getVar("shs_move").getInt(12), obj.getVar("shs_move").getInt(10), timeEventCount, 5); + sq_setCurrentAxisPos(obj, 0, v); + // obj.sq_SetXScrollStop(0); + break; + } +} + +function onEndState_StrengthHandStrike(obj, new_state) +{ + if(!obj) return; + if(new_state != SKILL_BYKK_STRENGTHHANDSTRIKE){ + local size = obj.getVar("kksshs").get_obj_vector_size(); + if(size > 0){ + for(local i = 0; i < size; i++){ + local shsObj = obj.getVar("kksshs").get_obj_vector(i); + if(shsObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(shsObj); + colObj.setValid(false); + } + } + } + obj.stopSound(2332); + obj.stopSound(2333); + obj.sq_RemoveSuperArmor(POD_VAR_SUPERARMOR); + } +} + +function onAttack_StrengthHandStrike(obj, damager, boundingBox, isStuck) +{ + if(!obj) return; + if(!damager.isObjectType(OBJECTTYPE_ACTIVE)) return; + sq_SetMyShake(obj, 12, 80); +} + + + + +function checkExecutableSkill_Swing(obj) +{ + if (!obj) return false; + if(obj.getState() == SKILL_BYKK_PRECENCIA && obj.getSkillSubState() < 10) return false; + local isUse = obj.sq_IsUseSkill(SKILL_BYKK_SWING); + if (isUse){ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) obj.getVar("skillSub").setInt(100, 2); + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) obj.getVar("skillSub").setInt(100, 1); + else obj.getVar("skillSub").setInt(100, 0); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(STATE_BYKK_SWING, STATE_PRIORITY_IGNORE_FORCE, true); + return true; + } + return false; +} + +function checkCommandEnable_Swing(obj) +{ + if (!obj) return false; + return true; +} + +function onSetState_Swing(obj, state, datas, isResetTimer) +{ + if(!obj) return; + local subState = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(subState); + obj.sq_StopMove(); + switch(subState){ + case 0: + if(sq_GetSkillLevel(obj, SKILL_BYKK_ARMONIA) > 0 && obj.getVar("kksChaser").get_obj_vector_size() > 0){//太古之力 + if(obj.getVar("skillSub").getInt(100) == 2) obj.sq_SetCurrentAnimation(264); + else if(obj.getVar("skillSub").getInt(100) == 0) obj.sq_SetCurrentAnimation(275); + else{ + local Ani = getCurrentAnimation_precencia(obj, "SwingArmonia_Body", false, false); + obj.setCurrentAnimation(Ani); + } + if(obj.getVar("skillSub").getInt(100) < 2) obj.sq_PlaySound("WZ_SWING"); + print(sq_GetLevelData(obj, SKILL_BYKK_SWING, 6, sq_GetSkillLevel(obj, SKILL_BYKK_SWING))); + print(sq_GetLevelData(obj, SKILL_BYKK_SWING, 5, sq_GetSkillLevel(obj, SKILL_BYKK_SWING))); + if(sq_GetLevelData(obj, SKILL_BYKK_SWING, 6, sq_GetSkillLevel(obj, SKILL_BYKK_SWING)) < 1){ + local chaserObj = obj.getVar("kksChaser").get_obj_vector(0); + if(chaserObj) chaserObj.setValid(false); + } + } + else{//普通形態 + if(obj.getVar("skillSub").getInt(100) == 2) obj.sq_SetCurrentAnimation(265); + else if(obj.getVar("skillSub").getInt(100) == 0) obj.sq_SetCurrentAnimation(3); + else{ + local Ani = getCurrentAnimation_precencia(obj, "Swing", false, false); + obj.setCurrentAnimation(Ani); + } + if(obj.getVar("skillSub").getInt(100) < 2) obj.sq_PlaySound("WZ_SWING"); + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_SWING); + local totalDamage = sq_GetLevelData(obj, SKILL_BYKK_SWING, 0, skillLevel); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 2)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo){ + attackInfo.setAttackType(ATTACKTYPE_PHYSICAL); + sq_SetAddWeaponDamage(attackInfo, true); + } + if(obj.getVar("skillSub").getInt(100) == 2) obj.sq_AddStateLayerAnimation(10001,obj.sq_CreateCNRDAnimation("effect/animation/battlemage_bykk/swing/precencia/swing_05.ani"), 0, 0); + else obj.sq_AddStateLayerAnimation(10001,obj.sq_CreateCNRDAnimation("effect/animation/battlemage_bykk/swing.ani"), -50, 0); + } + local speed = 1.0 + (sq_GetIntData(obj, SKILL_BYKK_SWING, 0).tofloat()) / 200.0; + if(obj.getVar("skillSub").getInt(100) == 1) speed = 0.3 + speed; + else if(obj.getVar("skillSub").getInt(100) == 2) speed = 0.5 + speed; + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, speed, speed); + break; + } +} + +function onEndCurrentAni_Swing(obj) +{ + if(!obj) return; + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_AUTO, true); +} + +function onProcCon_Swing(obj) +{ + if(!obj) return; +} + +function onKeyFrameFlag_Swing(obj, flagIndex) +{ + if(!obj) return false; + switch(flagIndex){ + case 1: + obj.sq_PlaySound("PRECENCIA_ARMONIA_1_CAST"); + break; + case 2: + obj.sq_PlaySound("PRECENCIA_ARMONIA_2_SMASH"); + break; + case 3: + local sub = 0; + if(obj.getVar("skillSub").getInt(100) == 2){ + obj.sq_PlaySound("R_WZ_PRECENCIA_SMASH"); + sq_SetMyShake(obj, 3, 80); + sub = 1; + } + local currentAni = obj.getCurrentAnimation(); + local delay = currentAni.getDelaySum(5, 5); + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_SWING); + local totalDamage = sq_GetLevelData(obj, SKILL_BYKK_SWING, 0, skillLevel); + local sizeRate = 100 + sq_GetLevelData(obj, SKILL_BYKK_SWING, 7, skillLevel); + if(sq_GetLevelData(obj, SKILL_BYKK_SWING, 5, sq_GetSkillLevel(obj, SKILL_BYKK_SWING)) > 0 && obj.getVar("kksChaser").get_obj_vector_size() > 0){ + local chaserObj = obj.getVar("kksChaser").get_obj_vector(0); + if(chaserObj) chaserObj.setValid(false); + sizeRate = sizeRate + 150; + } + if(sq_GetSkillLevel(obj, SKILL_BYKK_SPEARMASTERY) > 0 && obj.getWeaponSubType() == 0) sizeRate = sizeRate + sq_GetIntData(obj, SKILL_BYKK_SPEARMASTERY, 3); + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,0,1,0,obj.getDirection(),SKILL_BYKK_SWING,1,sub,totalDamage,delay,sizeRate,0,0,0,0); + break; + case 4://`CancelFrame` 17 0 121 + break; + } + return true; +} + +function onTimeEvent_Swing(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; +} + +function onEndState_Swing(obj, new_state) +{ + if(!obj) return; +} + + +function checkExecutableSkill_SwingEx(obj) +{ + if (!obj) return false; + if(obj.getState() == SKILL_BYKK_PRECENCIA && obj.getSkillSubState() < 10) return false; + local isUse = obj.sq_IsUseSkill(SKILL_BYKK_SWINGEX); + if (isUse){ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) obj.getVar("skillSub").setInt(100, 2); + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) obj.getVar("skillSub").setInt(100, 1); + else obj.getVar("skillSub").setInt(100, 0); + obj.getVar("CancelBool").setBool(0, false); + if(sq_GetLevelData(obj, SKILL_BYKK_SWING, 5, sq_GetSkillLevel(obj, SKILL_BYKK_SWING)) > 0 && sq_GetSkill(obj, SKILL_BYKK_SWING).isInCoolTime()) obj.endSkillCoolTime(SKILL_BYKK_SWING); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(STATE_BYKK_SWINGEX, STATE_PRIORITY_IGNORE_FORCE, true); + return true; + } + return false; +} + +function checkCommandEnable_SwingEx(obj) +{ + if (!obj) return false; + return true; +} + +function onSetState_SwingEx(obj, state, datas, isResetTimer) +{ + if(!obj) return; + local subState = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(subState); + obj.sq_StopMove(); + switch(subState){ + case 0: + if(obj.getVar("skillSub").getInt(100) == 2){ + obj.sq_SetCurrentAnimation(264); + } + else{ + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "SwingEx", false, false); + obj.setCurrentAnimation(Ani); + } + else obj.sq_SetCurrentAnimation(63); + obj.sq_PlaySound("WZ_SWING"); + } + break; + } + + local speed = 1.0 + (sq_GetLevelData(obj, SKILL_BYKK_SWINGEX, 18, sq_GetSkillLevel(obj, SKILL_BYKK_SWINGEX)).tofloat()) / 200.0; + if(obj.getVar("skillSub").getInt(100) == 1) speed = 0.3 + speed; + else if(obj.getVar("skillSub").getInt(100) == 2) speed = 0.5 + speed; + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, speed, speed); + + if(obj.getVar("skillSub").getInt(100) != 2){ + local currentAni = obj.getCurrentAnimation(); + obj.setTimeEvent(0, currentAni.getDelaySum(0, 3), 1, false); + } +} + +function onEndCurrentAni_SwingEx(obj) +{ + if(!obj) return; + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_AUTO, true); +} + +function onProcCon_SwingEx(obj) +{ + if(!obj) return; + if(obj.getVar("CancelBool").getBool(0)){ + local skillIndex = [SKILL_BYKK_DOUBLESWING,SKILL_BYKK_SWING,SKILL_BYKK_RANDOMPIERCESTRIKE, SKILL_BYKK_RANDOMPIERCESTRIKEEX, SKILL_BYKK_CHASERSEXPLOSION,SKILL_BYKK_STRENGTHHANDSTRIKE,SKILL_BYKK_DRAGONSPEAR]; + for(local i = 0; i < skillIndex.len(); i++){ + if(sq_GetSkill(obj, skillIndex[i]).isInCoolTime()) continue; + obj.setSkillCommandEnable(skillIndex[i], true); + local b_useskill = obj.sq_IsEnterSkill(skillIndex[i]); + if(b_useskill != -1){ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) obj.getVar("skillSub").setInt(100, 2); + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) obj.getVar("skillSub").setInt(100, 1); + else obj.getVar("skillSub").setInt(100, 0); + switch(skillIndex[i]){ + case SKILL_BYKK_DOUBLESWING: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_DOUBLESWING, STATE_PRIORITY_IGNORE_FORCE, true); + break; + case SKILL_BYKK_SWING: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(STATE_BYKK_SWING, STATE_PRIORITY_IGNORE_FORCE, true); + break; + case SKILL_BYKK_RANDOMPIERCESTRIKE: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_RANDOMPIERCESTRIKE, STATE_PRIORITY_IGNORE_FORCE, true); + break; + case SKILL_BYKK_RANDOMPIERCESTRIKEEX: + if(RANDOMPIERCESTRIKEEX_STONE > 0 || sq_GetLevelData(obj, SKILL_BYKK_RANDOMPIERCESTRIKEEX, 8, sq_GetSkillLevel(obj, SKILL_BYKK_RANDOMPIERCESTRIKEEX)) > 0) obj.getVar("RandomPierceStrikeEx_tar").clear_obj_vector(); + obj.sq_IntVectClear(); + if(obj.getVar("skillSub").getInt(100) == 2) obj.sq_IntVectPush(10); + else obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(STATE_BYKK_RANDOMPIERCESTRIKEEX, STATE_PRIORITY_IGNORE_FORCE, true); + break; + case SKILL_BYKK_CHASERSEXPLOSION: + local size = obj.getVar("kksChaser").get_obj_vector_size(); + if(size < 2){ + if (obj.isMessage()) sq_AddMessage(3573); + continue; + } + else{ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(STATE_BYKK_CHASERSEXPLOSION, STATE_PRIORITY_IGNORE_FORCE, true); + } + break; + case SKILL_BYKK_STRENGTHHANDSTRIKE: + obj.sq_IsEnterSkillLastKeyUnits(SKILL_BYKK_STRENGTHHANDSTRIKE); + obj.getVar("shsBool").setBool(0, true); + if(STRENGTHHANDSTRIKE_STONE > 0 || sq_GetLevelData(obj, SKILL_BYKK_STRENGTHHANDSTRIKE, 12, sq_GetSkillLevel(obj, SKILL_BYKK_STRENGTHHANDSTRIKE)) > 0){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(21); + obj.sq_AddSetStatePacket(SKILL_BYKK_STRENGTHHANDSTRIKE, STATE_PRIORITY_IGNORE_FORCE, true); + } + else{ + obj.sq_IntVectClear(); + if(obj.getVar("skillSub").getInt(100) == 2) obj.sq_IntVectPush(10); + else obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_STRENGTHHANDSTRIKE, STATE_PRIORITY_IGNORE_FORCE, true); + } + break; + case SKILL_BYKK_DRAGONSPEAR: + obj.getVar("dragonspearTar").clear_obj_vector(); + obj.getVar("dragonspearTar_fix").clear_obj_vector(); + if(sq_GetSkillLevel(obj, SKILL_BYKK_DRAGONDANCE) > 0 && !sq_GetSkill(obj, SKILL_BYKK_DRAGONDANCE).isSealFunction()){ + obj.sq_IntVectClear(); + if(obj.getVar("skillSub").getInt(100) == 2) obj.sq_IntVectPush(12); + else{ + if(DRAGONSPEAR_STONE > 0 || sq_GetLevelData(obj, SKILL_BYKK_DRAGONSPEAR, 15, sq_GetSkillLevel(obj, SKILL_BYKK_DRAGONSPEAR)) > 0) obj.sq_IntVectPush(2); + else obj.sq_IntVectPush(1); + } + obj.sq_AddSetStatePacket(SKILL_BYKK_DRAGONSPEAR, STATE_PRIORITY_IGNORE_FORCE, true); + } + else{ + obj.sq_IntVectClear(); + if(obj.getVar("skillSub").getInt(100) == 2) obj.sq_IntVectPush(10); + else obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_DRAGONSPEAR, STATE_PRIORITY_IGNORE_FORCE, true); + } + break; + } + } + } + } +} + +function onKeyFrameFlag_SwingEx(obj, flagIndex) +{ + if(!obj) return false; + switch(flagIndex){ + case 1: + obj.sq_PlaySound("PRECENCIA_ARMONIA_1_CAST"); + break; + case 2: + obj.sq_PlaySound("PRECENCIA_ARMONIA_2_SMASH"); + break; + case 3: + obj.sq_PlaySound("R_WZ_PRECENCIA_SMASH"); + // sq_flashScreen(obj,100,20,80,102, sq_RGB(255,255,255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + // sq_SetMyShake(obj, 5, 200); + local currentAni = obj.getCurrentAnimation(); + local delay = currentAni.getDelaySum(0, 0); + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_SWINGEX); + local totalDamage = sq_GetLevelData(obj, SKILL_BYKK_SWINGEX, 0, skillLevel); + local sizeRate = 100 + sq_GetLevelData(obj, SKILL_BYKK_SWINGEX, 5, skillLevel); + if(obj.getWeaponSubType() == 0 && sq_GetSkillLevel(obj, SKILL_BYKK_SPEARMASTERY) > 0) sizeRate = sizeRate + sq_GetIntData(obj, SKILL_BYKK_SPEARMASTERY, 3); + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,0,1,0,obj.getDirection(),SKILL_BYKK_SWINGEX,1,totalDamage,delay,sizeRate,0,0,0,0,0); + local time = 200 * delay / 70; + obj.setTimeEvent(1, time, 1, false); + break; + case 4://`CancelFrame` 17 0 121 + obj.getVar("CancelBool").setBool(0, true); + break; + } + return true; +} + +function onTimeEvent_SwingEx(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + switch(timeEventIndex){ + case 0: + local currentAni = obj.getCurrentAnimation(); + local delay = currentAni.getDelaySum(0, 0); + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_SWINGEX); + local totalDamage = sq_GetLevelData(obj, SKILL_BYKK_SWINGEX, 0, skillLevel); + local sizeRate = 120 + sq_GetLevelData(obj, SKILL_BYKK_SWINGEX, 5, skillLevel); + if(obj.getWeaponSubType() == 0 && sq_GetSkillLevel(obj, SKILL_BYKK_SPEARMASTERY) > 0) sizeRate = sizeRate * (100 + sq_GetIntData(obj, SKILL_BYKK_SPEARMASTERY, 3)) / 100; + cearteSkillPassive_Battlemage_bykk(obj,obj,PASSIVEOBJECT_BYKK_BATTLEMAGE,0,1,0,obj.getDirection(),SKILL_BYKK_SWINGEX,2,delay,sizeRate,totalDamage,0,0,0,0,0); + local time = 300 * delay / 70; + obj.setTimeEvent(1, time, 1, false); + break; + case 1: + sq_SetShake(obj, 5, 200); + break; + } +} + +function onEndState_SwingEx(obj, new_state) +{ + if(!obj) return; + if(new_state != STATE_BYKK_SWINGEX){ + obj.getVar("CancelBool").setBool(0, false); + } +} + + + +function checkExecutableSkill_Thrust(obj) +{ + if (!obj) return false; + if(obj.getState() == SKILL_BYKK_PRECENCIA && obj.getSkillSubState() < 10) return false; + local isUse = obj.sq_IsUseSkill(SKILL_BYKK_THRUST); + if (isUse){ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) obj.getVar("skillSub").setInt(100, 2); + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) obj.getVar("skillSub").setInt(100, 1); + else obj.getVar("skillSub").setInt(100, 0); + obj.getVar("CancelBool").setBool(0, false); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(STATE_BYKK_THRUST, STATE_PRIORITY_IGNORE_FORCE, true); + return true; + } + return false; +} + +function checkCommandEnable_Thrust(obj) +{ + if (!obj) return false; + return true; +} + +function onSetState_Thrust(obj, state, datas, isResetTimer) +{ + if(!obj) return; + local subState = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(subState); + obj.sq_StopMove(); + switch(subState){ + case 0: + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "Thrust", false, false); + obj.setCurrentAnimation(Ani); + obj.sq_PlaySound("WZ_LEAP"); + } + else if(obj.getVar("skillSub").getInt(100) == 2){ + obj.sq_SetCurrentAnimation(268); + } + else{ + obj.sq_SetCurrentAnimation(1); + obj.sq_PlaySound("WZ_LEAP"); + } + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_THRUST); + local totalDamage = sq_GetLevelData(obj, SKILL_BYKK_THRUST, 0, skillLevel); + local change = sq_GetLevelData(obj, SKILL_BYKK_THRUST, 3, skillLevel); + if(change > 0) totalDamage = (obj.sq_GetBonusRateWithPassive(174, -1, 0, 1.0) + 200) * change / 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 0)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo){ + attackInfo.setAttackType(ATTACKTYPE_PHYSICAL); + sq_SetAddWeaponDamage(attackInfo, true); + } + local speed = (1000 + sq_GetLevelData(obj, SKILL_BYKK_THRUST, 1, skillLevel)) / 1000.0; + if(obj.getVar("skillSub").getInt(100) == 1) speed = 0.3 + speed; + else if(obj.getVar("skillSub").getInt(100) == 2) speed = 0.5 + speed; + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, speed, speed); + local pAni = obj.getCurrentAnimation(); + if(obj.getVar("skillSub").getInt(100) == 2) obj.setTimeEvent(0, pAni.getDelaySum(0,3), 1, false); + else obj.setTimeEvent(1, 100, 1, true); + break; + } +} + +function onEndCurrentAni_Thrust(obj) +{ + if(!obj) return; + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_IGNORE_FORCE, true); +} + +function onProcCon_Thrust(obj) +{ + if(!obj) return; + if(obj.getVar("CancelBool").getBool(0)){ + local skillIndex = [SKILL_BYKK_UPPERSWING, SKILL_BYKK_HANDSTRIKE, SKILL_BYKK_POKETHROW, SKILL_BYKK_DOUBLESWING,SKILL_BYKK_SWING,SKILL_BYKK_RANDOMPIERCESTRIKE, SKILL_BYKK_RANDOMPIERCESTRIKEEX,SKILL_BYKK_STRENGTHHANDSTRIKE,SKILL_BYKK_DRAGONSPEAR, SKILL_BYKK_AVATARDANCE]; + for(local i = 0; i < skillIndex.len(); i++){ + if(sq_GetSkill(obj, skillIndex[i]).isInCoolTime()) continue; + obj.setSkillCommandEnable(skillIndex[i], true); + local b_useskill = obj.sq_IsEnterSkill(skillIndex[i]); + if(b_useskill != -1){ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) obj.getVar("skillSub").setInt(100, 2); + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) obj.getVar("skillSub").setInt(100, 1); + else obj.getVar("skillSub").setInt(100, 0); + switch(skillIndex[i]){ + case SKILL_BYKK_UPPERSWING: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(STATE_BYKK_UPPERSWING, STATE_PRIORITY_IGNORE_FORCE, true); + break; + case SKILL_BYKK_HANDSTRIKE: + obj.sq_IsEnterSkillLastKeyUnits(SKILL_BYKK_HANDSTRIKE); + obj.getVar("handstrike_move").setBool(100, false); + obj.getVar("handstrike_bool").setBool(0, true); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(STATE_BYKK_HANDSTRIKE, STATE_PRIORITY_IGNORE_FORCE, true); + break; + case SKILL_BYKK_POKETHROW: + obj.getVar("dirBool").setBool(0, false); + obj.getVar("pokethrowTar").clear_obj_vector(); + obj.getVar("pokethrowTar_fix").clear_obj_vector(); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(STATE_BYKK_POKETHROW, STATE_PRIORITY_IGNORE_FORCE, true); + break; + case SKILL_BYKK_DOUBLESWING: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_DOUBLESWING, STATE_PRIORITY_IGNORE_FORCE, true); + break; + case SKILL_BYKK_SWING: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(STATE_BYKK_SWING, STATE_PRIORITY_IGNORE_FORCE, true); + break; + case SKILL_BYKK_RANDOMPIERCESTRIKE: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_RANDOMPIERCESTRIKE, STATE_PRIORITY_IGNORE_FORCE, true); + break; + case SKILL_BYKK_RANDOMPIERCESTRIKEEX: + if(RANDOMPIERCESTRIKEEX_STONE > 0 || sq_GetLevelData(obj, SKILL_BYKK_RANDOMPIERCESTRIKEEX, 8, sq_GetSkillLevel(obj, SKILL_BYKK_RANDOMPIERCESTRIKEEX)) > 0) obj.getVar("RandomPierceStrikeEx_tar").clear_obj_vector(); + obj.sq_IntVectClear(); + if(obj.getVar("skillSub").getInt(100) == 2) obj.sq_IntVectPush(10); + else obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(STATE_BYKK_RANDOMPIERCESTRIKEEX, STATE_PRIORITY_IGNORE_FORCE, true); + break; + case SKILL_BYKK_STRENGTHHANDSTRIKE: + obj.sq_IsEnterSkillLastKeyUnits(SKILL_BYKK_STRENGTHHANDSTRIKE); + obj.getVar("shsBool").setBool(0, true); + if(STRENGTHHANDSTRIKE_STONE > 0 || sq_GetLevelData(obj, SKILL_BYKK_STRENGTHHANDSTRIKE, 12, sq_GetSkillLevel(obj, SKILL_BYKK_STRENGTHHANDSTRIKE)) > 0){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(21); + obj.sq_AddSetStatePacket(SKILL_BYKK_STRENGTHHANDSTRIKE, STATE_PRIORITY_IGNORE_FORCE, true); + } + else{ + obj.sq_IntVectClear(); + if(obj.getVar("skillSub").getInt(100) == 2) obj.sq_IntVectPush(10); + else obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_STRENGTHHANDSTRIKE, STATE_PRIORITY_IGNORE_FORCE, true); + } + break; + case SKILL_BYKK_DRAGONSPEAR: + obj.getVar("dragonspearTar").clear_obj_vector(); + obj.getVar("dragonspearTar_fix").clear_obj_vector(); + if(sq_GetSkillLevel(obj, SKILL_BYKK_DRAGONDANCE) > 0 && !sq_GetSkill(obj, SKILL_BYKK_DRAGONDANCE).isSealFunction()){ + obj.sq_IntVectClear(); + if(obj.getVar("skillSub").getInt(100) == 2) obj.sq_IntVectPush(12); + else{ + if(DRAGONSPEAR_STONE > 0 || sq_GetLevelData(obj, SKILL_BYKK_DRAGONSPEAR, 15, sq_GetSkillLevel(obj, SKILL_BYKK_DRAGONSPEAR)) > 0) obj.sq_IntVectPush(2); + else obj.sq_IntVectPush(1); + } + obj.sq_AddSetStatePacket(SKILL_BYKK_DRAGONSPEAR, STATE_PRIORITY_IGNORE_FORCE, true); + } + else{ + obj.sq_IntVectClear(); + if(obj.getVar("skillSub").getInt(100) == 2) obj.sq_IntVectPush(10); + else obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_DRAGONSPEAR, STATE_PRIORITY_IGNORE_FORCE, true); + } + break; + case SKILL_BYKK_AVATARDANCE: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_AVATARDANCE, STATE_PRIORITY_IGNORE_FORCE, true); + break; + } + } + } + } +} + +function onKeyFrameFlag_Thrust(obj, flagIndex) +{ + if(!obj) return false; + return true; +} + +function onTimeEvent_Thrust(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + switch(timeEventIndex){ + case 0: + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/thrust/thrust_04.ani", 0, 1, 0); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/battlemage_bykk/thrust/thrust_05.ani", 0, 1, 0); + break; + case 1: + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/thrustover.ani", 200, 1, 50); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/thrustunder.ani", 200, 1, 50); + break; + } +} + +function onEndState_Thrust(obj, new_state) +{ + if(!obj) return; + if(new_state != STATE_BYKK_THRUST){ + obj.getVar("CancelBool").setBool(0, false); + } +} + +function onAttack_Thrust(obj, damager, boundingBox, isStuck) +{ + if(!obj) return; + if(sq_getGrowType(obj) != 3) return; + obj.getVar("CancelBool").setBool(0, true); + local createMax = sq_GetIntData(obj, SKILL_BYKK_CHASER, 0); + if(obj.getVar("kksChaser").get_obj_vector_size() < createMax) createBattlemageChaser(obj); +} + +function checkExecutableSkill_TimerBomb(obj) +{ + if (!obj) return false; + if(obj.getState() == SKILL_BYKK_PRECENCIA && obj.getSkillSubState() < 10) return false; + local isUse = obj.sq_IsUseSkill(SKILL_BYKK_TIMERBOMB); + if (isUse){ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) obj.getVar("skillSub").setInt(100, 2); + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) obj.getVar("skillSub").setInt(100, 1); + else obj.getVar("skillSub").setInt(100, 0); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(STATE_BYKK_TIMERBOMB, STATE_PRIORITY_IGNORE_FORCE, true); + obj.startSkillCoolTime(SKILL_BYKK_TIMERBOMB, sq_GetSkillLevel(obj, SKILL_BYKK_TIMERBOMB), -1); + return true; + } + return false; +} + +function checkCommandEnable_TimerBomb(obj) +{ + if (!obj) return false; + return true; +} + +function onSetState_TimerBomb(obj, state, datas, isResetTimer) +{ + if(!obj) return; + local subState = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(subState); + obj.sq_StopMove(); + switch(subState){ + case 0: + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "Timerbomb", false, false); + obj.setCurrentAnimation(Ani); + } + else if(obj.getVar("skillSub").getInt(100) == 2) obj.sq_SetCurrentAnimation(269); + else obj.sq_SetCurrentAnimation(67); + break; + } + local speed = 1.0; + if(obj.getVar("skillSub").getInt(100) == 1) speed = 0.3 + speed; + else if(obj.getVar("skillSub").getInt(100) == 2) speed = 0.5 + speed; + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, speed, speed); + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_TIMERBOMB); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_TIMERBOMB, -1, 0, 1.0) + 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 37)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo){ + attackInfo.setAttackType(ATTACKTYPE_PHYSICAL); + sq_SetAddWeaponDamage(attackInfo, true); + } +} + +function onEndCurrentAni_TimerBomb(obj) +{ + if(!obj) return; + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_AUTO, true); +} + +function onProcCon_TimerBomb(obj) +{ + if(!obj) return; +} + +function onKeyFrameFlag_TimerBomb(obj, flagIndex) +{ + if(!obj) return false; + return true; +} + +function onTimeEvent_TimerBomb(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; +} + +function onEndState_TimerBomb(obj, new_state) +{ + if(!obj) return; +} + +function onAttack_TimerBomb(obj, damager, boundingBox, isStuck) +{ + if(!obj) return; + if(damager.isObjectType(OBJECTTYPE_ACTIVE)){ + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_DOUBLESWING, -1, 3, 1.0) + 100; + local totalDamage2 = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_DOUBLESWING, -1, 4, 1.0) + 100; + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_DOUBLESWING); + local lifeTime = sq_GetLevelData(obj, SKILL_BYKK_TIMERBOMB, 1, skillLevel); + local hitTime = sq_GetIntData(obj, SKILL_BYKK_TIMERBOMB, 0); + local group = sq_GetGroup(damager); + local uniqueId = sq_GetUniqueId(damager); + local sub = sq_GetLevelData(obj, SKILL_BYKK_TIMERBOMB, 5, skillLevel); + local sub2 = sq_GetLevelData(obj, SKILL_BYKK_TIMERBOMB, 6, skillLevel); + cearteSkillPassive_Battlemage_bykk(obj,damager,PASSIVEOBJECT_BYKK_BATTLEMAGE,0,1,sq_GetCenterZPos(boundingBox),obj.getDirection(),SKILL_BYKK_TIMERBOMB,1,totalDamage,totalDamage2,lifeTime,hitTime,group,uniqueId,sub,sub2); + } +} + +function checkExecutableSkill_UpperSwing(obj) +{ + if (!obj) return false; + local isUse = obj.sq_IsUseSkill(SKILL_BYKK_UPPERSWING); + if (isUse){ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealon.nut")) obj.getVar("skillSub").setInt(100, 2); + else if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_precencia_sealoff.nut")) obj.getVar("skillSub").setInt(100, 1); + else obj.getVar("skillSub").setInt(100, 0); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(STATE_BYKK_UPPERSWING, STATE_PRIORITY_IGNORE_FORCE, true); + return true; + } + return false; +} + +function checkCommandEnable_UpperSwing(obj) +{ + if (!obj) return false; + return true; +} + +function onSetState_UpperSwing(obj, state, datas, isResetTimer) +{ + if(!obj) return; + local subState = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(subState); + obj.sq_StopMove(); + switch(subState){ + case 0: + if(obj.getVar("skillSub").getInt(100) == 1){ + local Ani = getCurrentAnimation_precencia(obj, "upperswing", false, false); + obj.setCurrentAnimation(Ani); + obj.sq_PlaySound("WZ_HEAVEN_HIT"); + } + else if(obj.getVar("skillSub").getInt(100) == 2) obj.sq_SetCurrentAnimation(271); + else{ + obj.sq_SetCurrentAnimation(2); + obj.sq_PlaySound("WZ_HEAVEN_HIT"); + } + local skillLevel = sq_GetSkillLevel(obj, SKILL_BYKK_UPPERSWING); + local totalDamage = sq_GetLevelData(obj, SKILL_BYKK_UPPERSWING, 0, skillLevel); + local change = sq_GetLevelData(obj, SKILL_BYKK_UPPERSWING, 5, skillLevel); + if(change > 0) totalDamage = (obj.sq_GetBonusRateWithPassive(174, -1, 0, 1.0) + 200) * change / 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 1)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + + local attackInfo = sq_GetCurrentAttackInfo(obj); + local upForce = sq_GetLevelData(obj, SKILL_BYKK_UPPERSWING, 2, skillLevel); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/battlemage_bykk/ap/ap_chaser.nut")) upForce = (upForce * sq_GetLevelData(obj, SKILL_BYKK_CHASER, 17, sq_GetSkillLevel(obj, SKILL_BYKK_CHASER)) * 0.4 / 100).tointeger(); + print("upForce = "+upForce); + sq_SetCurrentAttacknUpForce(attackInfo, upForce); + + attackInfo.setAttackType(ATTACKTYPE_PHYSICAL); + sq_SetAddWeaponDamage(attackInfo, true); + + local speed = (1000 + sq_GetLevelData(obj, SKILL_BYKK_UPPERSWING, 1, skillLevel)) / 1000.0; + if(obj.getVar("skillSub").getInt(100) == 1) speed = 0.3 + speed; + else if(obj.getVar("skillSub").getInt(100) == 2) speed = 0.5 + speed; + print(speed); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, speed, speed); + local pAni = obj.getCurrentAnimation(); + local delaySum = pAni.getDelaySum(false); + obj.setTimeEvent(0, delaySum / 50, 50, true); + obj.getVar("upswing_move").setInt(0, 0); + if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_UP, ENUM_SUBKEY_TYPE_ALL)) obj.getVar("upswing_move").setInt(0, 1); + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_DOWN, ENUM_SUBKEY_TYPE_ALL)) obj.getVar("upswing_move").setInt(0, 2); + obj.getVar("upswing_move").setInt(10, sq_GetXPos(obj)); + obj.getVar("upswing_move").setInt(11, sq_GetYPos(obj)); + obj.getVar("upswing_move").setInt(12, 200); + break; + } +} + +function onEndCurrentAni_UpperSwing(obj) +{ + if(!obj) return; + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_IGNORE_FORCE, true); +} + +function onProcCon_UpperSwing(obj) +{ + if(!obj) return; +} + +function onKeyFrameFlag_UpperSwing(obj, flagIndex) +{ + if(!obj) return false; + return true; +} + +function onTimeEvent_UpperSwing(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + switch(timeEventIndex){ + case 0: + local baseX = obj.getVar("upswing_move").getInt(10); + local baseY = obj.getVar("upswing_move").getInt(11); + local v = sq_GetUniformVelocity(0, obj.getVar("upswing_move").getInt(12), timeEventCount, 50); + local vy = 0; + if(obj.getVar("upswing_move").getInt(0) == 1) vy = sq_GetUniformVelocity(0, -30, timeEventCount, 25); + else if(obj.getVar("upswing_move").getInt(0) == 2) vy = sq_GetUniformVelocity(0, 30, timeEventCount, 25); + if(timeEventCount > 25){ + if(obj.getVar("upswing_move").getInt(0) == 1) vy = sq_GetUniformVelocity(0, 40, timeEventCount - 25, 25); + else if(obj.getVar("upswing_move").getInt(0) == 2) vy = sq_GetUniformVelocity(0, -40, timeEventCount - 25, 25); + } + local dstX = sq_GetDistancePos(baseX, obj.getDirection(), v); + if(obj.isMovablePos(dstX, sq_GetYPos(obj))){ + sq_setCurrentAxisPos(obj, 0, dstX); + sq_setCurrentAxisPos(obj, 1, baseY + vy); + } + else{ + obj.getVar("upswing_move").setInt(12, v); + } + break; + } +} + +function onEndState_UpperSwing(obj, new_state) +{ + if(!obj) return; + if(new_state != STATE_BYKK_UPPERSWING){ + sq_SimpleMoveToNearMovablePos(obj, 1200); + } +} + +function onAttack_UpperSwing(obj, damager, boundingBox, isStuck) +{ + if(!obj) return; + if(isStuck) return; + if(sq_getGrowType(obj) != 3) return; + if(!damager.isObjectType(OBJECTTYPE_ACTIVE)) return; + local createMax = sq_GetIntData(obj, SKILL_BYKK_CHASER, 0); + if(obj.getVar("kksChaser").get_obj_vector_size() < createMax) createBattlemageChaser(obj); +} + + +/////////////////////////battlemage_end/////////////////////// + + + + +/////////////////////////elementalmaster////////////////////// + + +function setState_elementalmaster_bykk(obj, state, datas, isResetTimer) +{ + if(state == 17 && sq_GetVectorData(datas, 0) == 29){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_ELEMENTALCHAIN, STATE_PRIORITY_IGNORE_FORCE, true); + } + else if(state == 17 && sq_GetVectorData(datas, 0) == 2){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ASSIMILATE, STATE_PRIORITY_IGNORE_FORCE, true); + } +} + +function onAfterSetState_Throw_elementalmaster_bykk(obj, state, datas, isResetTimer) +{ + local ThrowIndex = obj.getThrowIndex(); + local throwState = obj.getThrowState(); + + local Mightyrune_T = + {//light,ice,fire,dark + [15] = [0,0,1,0], + [16] = [0,1,0,0], + [18] = [0,0,0,1], + [17] = [1,0,0,0], + [57] = [0,0,1,0], + [56] = [0,1,0,0], + [26] = [0,0,0,1], + [31] = [1,0,0,0], + [27] = [0,0,1,0], + [59] = [0,1,0,0], + [55] = [1,0,0,0], + [58] = [0,0,0,1] + } + + if(throwState == 0 && Mightyrune_T.rawin(ThrowIndex)){ + switch(ThrowIndex){ + case 15: + case 26: + case 58: + case 59: + case 27: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(10); + obj.sq_IntVectPush(ThrowIndex); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_ELEMENTALCHAIN, STATE_PRIORITY_IGNORE_FORCE, true); + break; + case 16: + case 31: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(20); + obj.sq_IntVectPush(ThrowIndex); + obj.sq_IntVectPush(3); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_ELEMENTALCHAIN, STATE_PRIORITY_IGNORE_FORCE, true); + break; + case 17: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(30); + obj.sq_IntVectPush(ThrowIndex); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_ELEMENTALCHAIN, STATE_PRIORITY_IGNORE_FORCE, true); + break; + case 18: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(40); + obj.sq_IntVectPush(ThrowIndex); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_ELEMENTALCHAIN, STATE_PRIORITY_IGNORE_FORCE, true); + break; + case 57: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_FLAMESTRIKE, STATE_PRIORITY_IGNORE_FORCE, true); + break; + case 55: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_THUNDERCALLING, STATE_PRIORITY_IGNORE_FORCE, true); + break; + } + return; + } + + if(throwState == 1 && Mightyrune_T.rawin(ThrowIndex)){ + sq_BinaryStartWrite(); + foreach(elsement in Mightyrune_T[ThrowIndex]){ + sq_BinaryWriteDword(elsement); + } + sq_SendChangeSkillEffectPacket(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN); + if(ThrowIndex == 56){ + elementalmaster_setelementSkillBonusRate(obj, 56); + } + else if(ThrowIndex == 74){ + elementalmaster_setelementSkillBonusRate(obj, 74); + } + } +} + +function onEndCurrentAni_Mage_Throw_elementalmaster(obj) +{ +} + +function reset_elementalmaster_bykk(obj) +{ + local addAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"appendage/character/ap_common_suck.nut"); + if(!addAppendage) return; + CNSquirrelAppendage.sq_RemoveAppendage(obj, "appendage/character/ap_common_suck.nut"); + local size = obj.getVar("blackhole").get_obj_vector_size(); + if(size > 0){ + for(local i = 0; i < size; i++){ + local bhObj = obj.getVar("blackhole").get_obj_vector(i); + if(bhObj) bhObj.setValid(false); + } + } + obj.getVar("blackhole").clear_obj_vector(); +} + +function onChangeSkillEffect_Mage_elementalmaster(obj, skillIndex, reciveData) +{ + switch(skillIndex){ + case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN: + local addAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut"); + if(!addAppendage) return; + local pushstate = 22; + if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_MIGHTYRUNE) > 0) pushstate = 25; + local assimilate_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ASSIMILATE); + local buff1 = reciveData.readDword(); + local buff2 = reciveData.readDword(); + local buff3 = reciveData.readDword(); + local buff4 = reciveData.readDword(); + local buffnum = []; + local buffname = ["","light","ice","fire","dark"]; + if(buff1 > 0) buffnum.push(1); + if(buff2 > 0) buffnum.push(2); + if(buff3 > 0) buffnum.push(3); + if(buff4 > 0) buffnum.push(4); + for(local i = 0; i < buffnum.len(); i++){ + local anum = buffnum[i]; + addAppendage.getVar().setBool(anum, true); + local effectObj = obj.getVar("elementalchain_"+buffname[anum]).get_obj_vector(0); + if(effectObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(effectObj); + if(assimilate_level > 0){ + local pooledObj = createOnlyDrawObject_elementalmaster_bykk(obj,"character/mage/effect/animation/elementalmaster_bykk/mightyrune/lv95assimilate/"+buffname[anum]+"activate_00.ani",true,colObj.getDirection(),sq_GetXPos(colObj),sq_GetYPos(colObj) + 1,sq_GetZPos(colObj) + 1,ENUM_DRAWLAYER_NORMAL); + sq_moveWithParent(colObj, pooledObj); + } + else colObj.addSetStatePacket(pushstate, null, STATE_PRIORITY_AUTO, false, ""); + } + } + setElementalChainBuff_bykk(obj,skillIndex,addAppendage); + break; + } +} + +function onStartDungeon_Elementalmaster_bykk(obj) +{ + local loadSlot = obj.sq_GetSkillLoad(ELEMENTALMASTER_SKILL_ELEMENTMASTERY); + if(loadSlot) obj.sq_RemoveSkillLoad(ELEMENTALMASTER_SKILL_ELEMENTMASTERY); + local addAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut"); + if(!addAppendage) return; + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut"); + local addAppendage2 = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_moveoncast.nut"); + if(!addAppendage2) return; + addAppendage2.getVar().setBool(0, false); +} + +function setElementalChainBuff_bykk(obj,skillIndex,addAppendage) +{ + return; + // local skillLevel = sq_GetSkillLevel(obj, skillIndex); + // local buff_num = []; + // if(addAppendage.getVar().getBool(1)) buff_num.push(1); + // if(addAppendage.getVar().getBool(2)) buff_num.push(1); + // if(addAppendage.getVar().getBool(3)) buff_num.push(1); + // if(addAppendage.getVar().getBool(4)) buff_num.push(1); + // local value1 = 0; + // switch(buff_num.len()){ + // case 1: value1 = sq_GetLevelData(obj, skillIndex, 6, skillLevel); break; + // case 2: value1 = sq_GetLevelData(obj, skillIndex, 7, skillLevel); break; + // case 3: value1 = sq_GetLevelData(obj, skillIndex, 8, skillLevel); break; + // case 4: value1 = sq_GetLevelData(obj, skillIndex, 9, skillLevel); break; + // } + // local change_appendage = addAppendage.sq_getChangeStatus("elementalchain"); + // if(!change_appendage) change_appendage = addAppendage.sq_AddChangeStatus("elementalchain",obj, obj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK,true, value1); + // if(change_appendage){ + // change_appendage.clearParameter(); + // if(value1 > 0){ + // change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_MAGICAL_ATTACK, true, (value1 * 0.01).tofloat()); + // change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_PHYSICAL_ATTACK, true, (value1 * 0.01).tofloat()); + // } + // } +} + +function onStart_appendage_elementmastery_bykk(appendage) +{ + local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent()); + if(!parentObj || parentObj.getState() == STATE_DIE){appendage.setValid(false);return;} + + local skillLevel = parentObj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_ELEMENTMASTERY); + local value1 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTMASTERY, 4, skillLevel); + local value2 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTMASTERY, 5, skillLevel); + local mightyrune_level = parentObj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_MIGHTYRUNE); + if(mightyrune_level > 0){ + local add_Rate = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_MIGHTYRUNE, 3, mightyrune_level); + value1 = value1 * (1000 + add_Rate) / 1000; + } + local change_appendage = appendage.sq_getChangeStatus("elementmastery"); + if(!change_appendage) change_appendage = appendage.sq_AddChangeStatus("elementmastery",parentObj, parentObj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK, true, value1); + if(change_appendage){ + change_appendage.clearParameter(); + //change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_MAGICAL_ATTACK, true, (value1 * 0.1).tofloat()); + //change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_PHYSICAL_ATTACK, true, (value1 * 0.1).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_ELEMENT_TOLERANCE_ALL, false, (value2).tofloat()); + } +} + +function onStart_appendage_assimilate_bykk(appendage) +{ + local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent()); + if(!parentObj || parentObj.getState() == STATE_DIE){appendage.setValid(false);return;} + + // local skillLevel = parentObj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_ASSIMILATE); + // local value1 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ASSIMILATE, 0, skillLevel); + // local change_appendage = appendage.sq_getChangeStatus("assimilate"); + // if(!change_appendage) change_appendage = appendage.sq_AddChangeStatus("assimilate",parentObj, parentObj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK, true, value1); + // if(change_appendage){ + // change_appendage.clearParameter(); + // change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_MAGICAL_ATTACK, true, (value1 * 0.1).tofloat()); + // change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_PHYSICAL_ATTACK, true, (value1 * 0.1).tofloat()); + // } +} + +function onStart_appendage_elementalpotential_bykk(appendage) +{ + local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent()); + if(!parentObj || parentObj.getState() == STATE_DIE){appendage.setValid(false);return;} + + local skillLevel = parentObj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL); + local value1 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 7, skillLevel); + local change_appendage = appendage.sq_getChangeStatus("elementalpotential"); + if(!change_appendage) change_appendage = appendage.sq_AddChangeStatus("elementalpotential",parentObj, parentObj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK, true, value1); + if(change_appendage){ + change_appendage.clearParameter(); + change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_MAGICAL_ATTACK, true, (value1 * 0.1).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_PHYSICAL_ATTACK, true, (value1 * 0.1).tofloat()); + } +} + +function onStart_appendage_elementalweak_bykk(appendage) +{ + local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent()); + if(!parentObj || parentObj.getState() == STATE_DIE){appendage.setValid(false);return;} + + local skillLevel = parentObj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_ELEMENTALWEAK); + local value1 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTALWEAK, 5, skillLevel); + local value2 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTALWEAK, 6, skillLevel); + local mightyrune_level = parentObj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_MIGHTYRUNE); + if(mightyrune_level > 0){ + local add_Rate = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_MIGHTYRUNE, 2, mightyrune_level); + value2 = value2 * (1000 + add_Rate) / 1000; + } + local change_appendage = appendage.sq_getChangeStatus("elementalweak"); + if(!change_appendage) change_appendage = appendage.sq_AddChangeStatus("elementalweak",parentObj, parentObj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK, true, value1); + if(change_appendage){ + change_appendage.clearParameter(); + change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_MAGICAL_ATTACK, true, (value1 * 0.1).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_PHYSICAL_ATTACK, true, (value1 * 0.1).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_MAGICAL_CRITICAL_HIT_RATE, false, (value2 * 0.1).tofloat()); + } +} + +function onAttackParent_appendage_elementalweak(appendage, realAttacker, damager, boundingBox, isStuck) +{ + if(!appendage) return; + return; + if(isStuck) return; + local parentObj = appendage.getParent(); + local obj = sq_GetCNRDObjectToSQRCharacter(parentObj); + if(!obj || obj.getState() == STATE_DIE) return; + if(!damager.isObjectType(OBJECTTYPE_ACTIVE)) return; + local activeObj = sq_GetCNRDObjectToActiveObject(damager); + local maxLoad = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALWEAK, 0); + local skillLevel = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALWEAK); + local decrease = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALWEAK, 0, skillLevel); + local time = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALWEAK, 2, skillLevel); + local attackInfo = sq_GetCurrentAttackInfo(realAttacker); + local element = [ENUM_ELEMENT_FIRE,ENUM_ELEMENT_WATER,ENUM_ELEMENT_DARK,ENUM_ELEMENT_LIGHT]; + local element2 = ["attack_fire","attack_ice","attack_dark","attack_light"]; + for(local i = 0; i < 4; i++){ + if(attackInfo.isValidElement(element[i])){ + local addAppendage = CNSquirrelAppendage.sq_GetAppendage(activeObj, ELEMENTALWEAKDEBUFF_APDPATH); + if(!addAppendage){ + addAppendage = CNSquirrelAppendage.sq_AppendAppendage(activeObj, obj, -1, false, ELEMENTALWEAKDEBUFF_APDPATH, true); + addAppendage.getVar("custom").setInt(10, maxLoad); + addAppendage.getVar("custom").setInt(11, decrease); + addAppendage.getVar("custom").setInt(12, time); + } + for(local ui = 10; ui < 10 + maxLoad; ui++){ + if(addAppendage.getVar(element2[i]).getBool(ui) == false){ + addAppendage.getVar(element2[i]).setBool(ui, true); + } + } + } + } +} + +function proc_appendage_elementalweakdebuff(appendage) +{ + if(!appendage) return; + local targetObj = appendage.getParent(); + local sqrChr = appendage.getSource(); + targetObj = sq_GetCNRDObjectToActiveObject(targetObj); + sqrChr = sq_GetCNRDObjectToSQRCharacter(sqrChr); + if(!targetObj || targetObj.getState() == STATE_DIE){ + appendage.setValid(false); + return; + } + + local maxLoad = appendage.getVar("custom").getInt(10); + local decrease = appendage.getVar("custom").getInt(11); + local time = appendage.getVar("custom").getInt(12); + + local element = ["attack_fire","attack_ice","attack_dark","attack_light"]; + for(local i = 0; i < element.len(); i++){ + local timer = appendage.getVar(element[i]).get_ct_vector(0); + if(!timer){ + appendage.getVar(element[i]).clear_ct_vector(); + appendage.getVar(element[i]).push_ct_vector(); + timer = appendage.getVar(element[i]).get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); + } + local currentT = timer.Get(); + if(currentT >= time){ + for(local oi = 0; oi < maxLoad; oi++){ + appendage.getVar(element[i]).setBool(10 + oi, false); + appendage.getVar(element[i]).setBool(20 + oi, false); + } + timer.Reset(); + timer.Start(10000,0); + } + for(local ui = 0; ui < maxLoad; ui++){ + if(appendage.getVar(element[i]).getBool(10 + ui) && appendage.getVar(element[i]).getBool(20 + ui) == false){ + appendage.getVar(element[i]).setBool(20 + ui, true); + local ap = sq_CreateChangeStatus(20 + i, false, -decrease.tofloat() , 0); + if (ap){ + ap.getAppendageInfo().setValidTime(time); + ap.sq_Append(targetObj, sqrChr); + } + } + } + } + + +} + +function useSkill_before_Mage_elementalmaster_bykk(obj, skillIndex, consumeMp, consumeItem, oldSkillMpRate) +{ + //printp(" consumpMp:" + consumeMp + " oldSkillMpRate:" + oldSkillMpRate); + local skillLevel = obj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_ELEMENTMASTERY); + if(skillLevel > 0){ + local mpComsumeRate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTMASTERY, 3, skillLevel); + if(oldSkillMpRate != 1.0) oldSkillMpRate = 1.0; + local newMpRate = oldSkillMpRate.tofloat() * (100 - mpComsumeRate.tofloat()) / 100; + // print(" newMpRate:" + newMpRate); + obj.setSkillMpRate(skillIndex, newMpRate.tofloat()); + } + //print(" now consumpMp:" + obj.getSkillMpRate(skillIndex)); + return true; +} + +function cearteSkillPassive_Elementalmaster_bykk(obj,passiveObj,objnum,x,y,z,direction,skillIndex,subtype,pushv1,pushv2,pushv3,pushv4,pushv5,pushv6,pushv7,pushv8,bonusnum,powernum) +{ + if(!obj || !passiveObj) return; + if(pushv1 == null) pushv1 = 0; + if(pushv2 == null) pushv2 = 0; + if(pushv3 == null) pushv3 = 0; + if(pushv4 == null) pushv4 = 0; + if(pushv5 == null) pushv5 = 0; + if(pushv6 == null) pushv6 = 0; + if(pushv7 == null) pushv7 = 0; + if(pushv8 == null) pushv8 = 0; + if(bonusnum > 0){ + local bonusRate = 1.0;//obj.getVar("witchs_bonusRate").get_vector(0).tofloat() / 1000.0; + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL); + if(skill_level > 0){ + local add_Rate = 0.0; + switch(skillIndex){ + case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN: add_Rate = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 7, skill_level); + case ELEMENTALMASTER_SKILL_FLAMESTRIKE: + case ELEMENTALMASTER_SKILL_VOID: + case ELEMENTALMASTER_SKILL_SUNBURST: + add_Rate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 8, skill_level); + break; + case ELEMENTALMASTER_SKILL_THUNDERCALLING: add_Rate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 12, skill_level); break; + case ELEMENTALMASTER_SKILL_ARCTICPISTE: add_Rate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 15, skill_level); break; + case ELEMENTALMASTER_SKILL_BLACKHOLE: add_Rate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 14, skill_level); break; + case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER: add_Rate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 13, skill_level); break; + case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND: + case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN: + case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE: + case ELEMENTALMASTER_SKILL_THEGATE: + case ELEMENTALMASTER_SKILL_SESTOELEMENTO: + case ELEMENTALMASTER_SKILL_THUNDERRAGE: + add_Rate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 16, skill_level); + break; + } + bonusRate += add_Rate.tofloat() / 1000.0; + } + switch (bonusnum) { + case 1: pushv1 = (pushv1.tofloat() * bonusRate).tointeger(); break; + case 2: pushv2 = (pushv2.tofloat() * bonusRate).tointeger(); break; + case 3: pushv3 = (pushv3.tofloat() * bonusRate).tointeger(); break; + case 4: pushv4 = (pushv4.tofloat() * bonusRate).tointeger(); break; + case 5: pushv5 = (pushv5.tofloat() * bonusRate).tointeger(); break; + case 6: pushv6 = (pushv6.tofloat() * bonusRate).tointeger(); break; + case 7: pushv7 = (pushv7.tofloat() * bonusRate).tointeger(); break; + case 8: pushv8 = (pushv8.tofloat() * bonusRate).tointeger(); break; + } + } + if(powernum > 0){ + local bonusRate = 1.0;//obj.getVar("witchs_bonusRate").get_vector(0).tofloat() / 1000.0; + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL); + if(skill_level > 0){ + local add_Rate = 0.0; + if(skillIndex == ELEMENTALMASTER_SKILL_ELEMENTALCHAIN) add_Rate = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 7, skill_level); + bonusRate += add_Rate.tofloat() / 1000.0; + } + switch (powernum) { + case 1: pushv1 = (pushv1.tofloat() * bonusRate).tointeger(); break; + case 2: pushv2 = (pushv2.tofloat() * bonusRate).tointeger(); break; + case 3: pushv3 = (pushv3.tofloat() * bonusRate).tointeger(); break; + case 4: pushv4 = (pushv4.tofloat() * bonusRate).tointeger(); break; + case 5: pushv5 = (pushv5.tofloat() * bonusRate).tointeger(); break; + case 6: pushv6 = (pushv6.tofloat() * bonusRate).tointeger(); break; + case 7: pushv7 = (pushv7.tofloat() * bonusRate).tointeger(); break; + case 8: pushv8 = (pushv8.tofloat() * bonusRate).tointeger(); break; + } + } + + local destX_01 = 0; + local destY_01 = 0; + if(!isSameObject(obj, passiveObj)){ + destX_01 = passiveObj.getXPos() - obj.getXPos(); + destY_01 = passiveObj.getYPos() - obj.getYPos(); + z = z - obj.getZPos(); + if(direction == ENUM_DIRECTION_LEFT) destX_01 = obj.getXPos() - passiveObj.getXPos(); + } + sq_BinaryStartWrite(); + 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); +} + +function createOnlyDrawObject_elementalmaster_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 onStart_appendage_elementalchain_bykk(appendage) +{ + local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent()); + + local skillLevel = sq_GetSkillLevel(parentObj,ELEMENTALMASTER_SKILL_ELEMENTALCHAIN); + local lightTime = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, 1, skillLevel); + + appendage.setAppendCauseSkill(BUFF_CAUSE_SKILL, ENUM_CHARACTERJOB_MAGE, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, skillLevel); + appendage.setEnableIsBuff(true); + appendage.setBuffIconImage(28); + + local value0 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, 6, skillLevel) + local value1 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, 7, skillLevel); + local value2 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, 8, skillLevel); + local value3 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, 9, skillLevel); + appendage.getVar("custom").setInt(0, value0); + appendage.getVar("custom").setInt(1, value1); + appendage.getVar("custom").setInt(2, value2); + appendage.getVar("custom").setInt(3, value3); + + appendage.getVar().setBool(1,false); + appendage.getVar().setBool(2,false); + appendage.getVar().setBool(3,false); + appendage.getVar().setBool(4,false); + + local offset_x = [35,35,-35,-35]; + local offset_y = [-20,20,20,-20]; + local offset_z = [23,30,30,30]; + local sub = 0; + local mightyrune_level = sq_GetSkillLevel(parentObj, ELEMENTALMASTER_SKILL_MIGHTYRUNE); + if(mightyrune_level > 0){ + sub = 1; + offset_z = [30,30,30,30]; + lightTime = lightTime * (1000 + sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_MIGHTYRUNE, 0, mightyrune_level)) / 1000; + } + local assimilate_level = sq_GetSkillLevel(parentObj, ELEMENTALMASTER_SKILL_ASSIMILATE); + if(assimilate_level > 0){ + sub = 2; + offset_z = [30,30,30,30]; + appendage.getVar().setBool(1,true); + appendage.getVar().setBool(2,true); + appendage.getVar().setBool(3,true); + appendage.getVar().setBool(4,true); + setElementalChainBuff_bykk(parentObj,ELEMENTALMASTER_SKILL_ELEMENTALCHAIN,appendage); + } + for(local i = 1; i < 5; i++){ + cearteSkillPassive_Elementalmaster_bykk(parentObj,parentObj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,offset_x[i-1],offset_y[i-1],offset_z[i-1],ENUM_DIRECTION_RIGHT,ELEMENTALMASTER_SKILL_ELEMENTALCHAIN,i,lightTime,sub,0,0,0,0,0,0,0,0); + } +} + +function onEnd_appendage_elementalchain_bykk(appendage) +{ + local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent()); + local name = ["elementalchain_light","elementalchain_ice","elementalchain_fire","elementalchain_dark"]; + for(local i = 0; i < name.len(); i++){ + local size = parentObj.getVar(name[i]).get_obj_vector_size(); + for(local ui = 0; ui < size; ui++){ + local effectObj = parentObj.getVar(name[i]).get_obj_vector(ui); + if(effectObj) effectObj.setValid(false); + } + } +} + +function onStart_appendage_magicaltempoup_bykk(appendage) +{ + local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent()); + + local skillLevel = sq_GetSkillLevel(parentObj,ELEMENTALMASTER_SKILL_MAGICALTEMPOUP); + appendage.setAppendCauseSkill(BUFF_CAUSE_SKILL, ENUM_CHARACTERJOB_MAGE, ELEMENTALMASTER_SKILL_MAGICALTEMPOUP, skillLevel); + appendage.setEnableIsBuff(true); + appendage.setBuffIconImage(34); + + local lifeTime = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_MAGICALTEMPOUP, 0, skillLevel); + local value1 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_MAGICALTEMPOUP, 1, skillLevel); + local value2 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_MAGICALTEMPOUP, 2, skillLevel); + local mightyrune_level = parentObj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_MIGHTYRUNE); + if(mightyrune_level > 0){ + appendage.getAppendageInfo().setValidTime(0); + local add_Rate = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_MIGHTYRUNE, 4, mightyrune_level); + value1 = value1 * (1000 + add_Rate) / 1000; + value2 = value2 * (1000 + add_Rate) / 1000; + } + else if((sq_getGrowType(parentObj) == 4 && sq_GetSkillLevel(parentObj, SKILL_BYKK_LAPISPHILOSOPHORUM) > 0) || (sq_getGrowType(parentObj) == 2 && parentObj.getVar("eclipsehive_select").getBool(0))){ + appendage.getAppendageInfo().setValidTime(0); + } + else appendage.getAppendageInfo().setValidTime(lifeTime); + + local change_appendage = appendage.sq_getChangeStatus("magicaltempoup"); + if(!change_appendage) change_appendage = appendage.sq_AddChangeStatus("magicaltempoup",parentObj, parentObj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK, true, value1); + if(change_appendage){ + change_appendage.clearParameter(); + change_appendage.addParameter(CHANGE_STATUS_TYPE_CAST_SPEED, false, (value2 * 1).tofloat()); + } +} + +function onStart_appendage_mightyrune_bykk(appendage) +{ + local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent()); + + local skillLevel = sq_GetSkillLevel(parentObj,ELEMENTALMASTER_SKILL_MIGHTYRUNE); + appendage.setAppendCauseSkill(BUFF_CAUSE_SKILL, ENUM_CHARACTERJOB_MAGE, ELEMENTALMASTER_SKILL_MIGHTYRUNE, skillLevel); +} + +function onStart_appendage_moveoncast_bykk(appendage) +{ + // +} + +function proc_appendage_moveoncast_bykk(appendage) +{ + if(!appendage) return; + local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent()); + + if(parentObj.getState() == 13 && parentObj.getThrowIndex() == 74){ + sq_SetKeyxEnable(parentObj, E_JUMP_COMMAND, true); + if(sq_IsEnterCommand(parentObj, E_JUMP_COMMAND)){ + parentObj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + } + } + + if(appendage.getVar().getBool(0)){ + for(local i = 1; i < 255; i++){ + parentObj.setSkillCommandEnable(i, false); + } + if(parentObj.getState() == 0 || parentObj.getState() == 14){ + local bDownKey = parentObj.isDownSkillLastKey(); + if(!bDownKey){ + appendage.getVar().setBool(0, false); + if(appendage.getVar().getInt(1) == ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN){ + parentObj.sq_IntVectClear(); + parentObj.sq_IntVectPush(1); + parentObj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, STATE_PRIORITY_USER, true); + return; + } + else if(appendage.getVar().getInt(1) == ELEMENTALMASTER_SKILL_ELEMENTALQUAKE){ + parentObj.sq_IntVectClear(); + parentObj.sq_IntVectPush(1); + parentObj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, STATE_PRIORITY_USER, true); + return; + } + else if(appendage.getVar().getInt(1) == ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND){ + parentObj.sq_IntVectClear(); + parentObj.sq_IntVectPush(1); + parentObj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND, STATE_PRIORITY_USER, true); + return; + } + else if(appendage.getVar().getInt(1) == ELEMENTALMASTER_SKILL_THUNDERRAGE){ + parentObj.sq_IntVectClear(); + parentObj.sq_IntVectPush(2); + parentObj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_THUNDERRAGE, STATE_PRIORITY_USER, true); + return; + } + else if(appendage.getVar().getInt(1) == ELEMENTALMASTER_SKILL_SESTOELEMENTO){ + parentObj.sq_IntVectClear(); + parentObj.sq_IntVectPush(0); + parentObj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_SESTOELEMENTO, STATE_PRIORITY_USER, true); + return; + } + parentObj.sq_IntVectClear(); + parentObj.sq_IntVectPush(appendage.getVar().getInt(3) + 1); + parentObj.sq_IntVectPush(appendage.getVar().getInt(1)); + parentObj.sq_IntVectPush(appendage.getVar().getInt(2)); + // print(appendage.getVar().getInt(3)+" && "+appendage.getVar().getInt(1)+" && "+appendage.getVar().getInt(2)); + parentObj.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_ELEMENTALCHAIN, STATE_PRIORITY_USER, true); + } + } + } +} + +function onEnd_appendage_moveoncast_bykk(appendage) +{ + // +} + +function monsterpulled_elementalmaster_bykk(obj,monsterobj,x,y,z,time,range) +{ + if(!obj.isMovablePos(sq_GetXPos(monsterobj), sq_GetYPos(monsterobj))) return; + local objectManager = obj.getObjectManager(); + local objectNumber = objectManager.getCollisionObjectNumber(); + for(local i = 0; i < objectNumber; i++){ + local targetObj = objectManager.getCollisionObject(i); + if(targetObj && targetObj.isObjectType(OBJECTTYPE_ACTIVE) && targetObj.isEnemy(obj) && !CNSquirrelAppendage.sq_IsAppendAppendage(targetObj, "character/mage/k_k_made/appendage/aptomonster/debuff/ap_pulledmonster.nut") && sq_GetDistanceObject(monsterobj, targetObj, true) <= range){ + local appendagePath = "character/mage/k_k_made/appendage/aptomonster/debuff/ap_pulledmonster.nut"; + local MasterAppendage = CNSquirrelAppendage.sq_AppendAppendage(targetObj, obj, -1, false, appendagePath, true); + if(MasterAppendage){ + sq_AccelMoveToAppendageForce(targetObj, obj, monsterobj, x, y, z, time, true, MasterAppendage, true); + local validT = MasterAppendage.getAppendageInfo() + validT.setValidTime(2000); + } + } + } +} + +function elementalmaster_setbonusRate(obj) +{ + local bonusRate = 1000; + if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ASSIMILATE) > 0) bonusRate = bonusRate * (1000 + sq_GetLevelData(obj,ELEMENTALMASTER_SKILL_ASSIMILATE, 0, sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ASSIMILATE))) / 1000; + if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALWEAK) > 0) bonusRate = bonusRate * (1000 + sq_GetLevelData(obj,ELEMENTALMASTER_SKILL_ELEMENTALWEAK, 5, sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALWEAK))) / 1000; + if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTMASTERY) > 0) bonusRate = bonusRate * (1000 + sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTMASTERY, 4, sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTMASTERY))) / 1000; + if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL) > 0){ + if(obj.sq_GetState() == 13){ + switch(obj.getThrowIndex()){ + case 56: + bonusRate = bonusRate * (1000 + sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 8, sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL))) / 1000; + break; + case 74: + bonusRate = bonusRate * (1000 + sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 16, sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL))) / 1000; + break; + } + } + } + + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, APDPATH_ELEMENTMASTERYBUFF)){ + local addAppendage = CNSquirrelAppendage.sq_GetAppendage(obj, APDPATH_ELEMENTMASTERYBUFF); + if(!addAppendage){ + obj.getVar("setSkillBonusRate").setInt(0, bonusRate.tointeger()); + return; + } + local addRate = addAppendage.getVar("custom").getInt(10); + bonusRate = bonusRate * (1000 + addRate) / 1000; + } + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut")){ + local addAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut"); + if(!addAppendage){ + obj.getVar("setSkillBonusRate").setInt(0, bonusRate.tointeger()); + return; + } + local skillLevel = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN); + local buff_num = []; + if(addAppendage.getVar().getBool(1)) buff_num.push(1); + if(addAppendage.getVar().getBool(2)) buff_num.push(1); + if(addAppendage.getVar().getBool(3)) buff_num.push(1); + if(addAppendage.getVar().getBool(4)) buff_num.push(1); + local value1 = 0; + switch(buff_num.len()){ + case 1: value1 = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, 6, skillLevel); break; + case 2: value1 = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, 7, skillLevel); break; + case 3: value1 = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, 8, skillLevel); break; + case 4: value1 = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, 9, skillLevel); break; + } + bonusRate = bonusRate * (10000 + value1) / 10000; + } + obj.getVar("setSkillBonusRate").setInt(0, bonusRate.tointeger()); +} + +function getElementalMaster_RestAni(obj) +{ + local animation = obj.sq_GetRestAni(); + if(obj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_ASSIMILATE) > 0) animation = obj.sq_GetCustomAni(ANIMATION_ELEMENTALMASTER_ELEMENTALMASTER_3RD_BODY); + return animation; +} + + + +function elementalmaster_setelementSkillBonusRate(obj, skillIndex) +{ + if(sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTMASTERY, 10, sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTMASTERY)) > 0){ + local AddAppendage; + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, APDPATH_ELEMENTMASTERYBUFF)){ + AddAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,APDPATH_ELEMENTMASTERYBUFF); + AddAppendage.sq_SetValidTime(8000); + AddAppendage.setAppendCauseSkill(BUFF_CAUSE_SKILL, sq_getJob(obj), ELEMENTALMASTER_SKILL_ELEMENTMASTERY, sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTMASTERY)); + CNSquirrelAppendage.sq_Append(AddAppendage, obj, obj, true); + } + else{ + AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, -1, false, APDPATH_ELEMENTMASTERYBUFF, true); + AddAppendage.getVar("custom").setInt(10, 0); + obj.sq_AddSkillLoad(ELEMENTALMASTER_SKILL_ELEMENTMASTERY, 64, 0, 500); + } + local now_BonusRate = AddAppendage.getVar("custom").getInt(10); + local new_BonusRate = 0; + switch(skillIndex){ + case 15: + case 16: + case 17: + case 18: + new_BonusRate = now_BonusRate + 30; + break; + case ELEMENTALMASTER_SKILL_VOID: + case ELEMENTALMASTER_SKILL_SUNBURST: + case ELEMENTALMASTER_SKILL_WALLOFICE: + case ELEMENTALMASTER_SKILL_FLAMESTRIKE: + new_BonusRate = now_BonusRate + 30; + break; + case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER: + case ELEMENTALMASTER_SKILL_BLACKHOLE: + case ELEMENTALMASTER_SKILL_THUNDERCALLING: + case ELEMENTALMASTER_SKILL_ARCTICPISTE: + new_BonusRate = now_BonusRate + 50; + break; + case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER: + case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE: + case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN: + case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND: + case ELEMENTALMASTER_SKILL_THEGATE: + case ELEMENTALMASTER_SKILL_SESTOELEMENTO: + case ELEMENTALMASTER_SKILL_THUNDERRAGE: + new_BonusRate = now_BonusRate + 80; + break; + } + if(new_BonusRate > 500) new_BonusRate = 500; + AddAppendage.getVar("custom").setInt(10, new_BonusRate); + local loadSlot = obj.sq_GetSkillLoad(ELEMENTALMASTER_SKILL_ELEMENTMASTERY); + if(loadSlot){ + local getload = loadSlot.getRemainLoadNumber(); + if(new_BonusRate / 10 + getload > 50) loadSlot.increaseLoadCount(50 - getload); + else loadSlot.increaseLoadCount(new_BonusRate / 10); + } + } + else{ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, APDPATH_ELEMENTMASTERYBUFF)) CNSquirrelAppendage.sq_RemoveAppendage(obj, APDPATH_ELEMENTMASTERYBUFF); + } +} + +function onEnd_appendage_elementmastery_buff(appendage) +{ + if(!appendage) return; +} + + +function proc_appendage_elementmastery_buff(appendage) +{ + if(!appendage) return; + if(!appendage.isValid()) return; + local parentObj = appendage.getParent(); + if(!parentObj || parentObj.getState() == STATE_DIE){ + appendage.setValid(false); + return; + } +} + +function onStart_appendage_elementmastery_buff(appendage) +{ + if(!appendage) return; +} + +function onVaildTimeEnd_appendage_elementmastery_buff(appendage) +{ + if(!appendage) return; + local parentObj = appendage.getParent(); + if(!parentObj || parentObj.getState() == STATE_DIE){ + appendage.setValid(false); + return; + } + local obj = sq_GetCNRDObjectToSQRCharacter(parentObj); + local loadSlot = obj.sq_GetSkillLoad(ELEMENTALMASTER_SKILL_ELEMENTMASTERY); + if(loadSlot) obj.sq_RemoveSkillLoad(ELEMENTALMASTER_SKILL_ELEMENTMASTERY); +} + + +function setCustomData_po_elementalmaster_bykk_kak(obj, receiveData) +{ + if(!obj) return; + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + if(!sqrChr) return; + local skillIndex = receiveData.readDword(); + local subtype = receiveData.readDword(); + + obj.getVar("skillIndex").clear_vector(); + obj.getVar("skillIndex").push_vector(skillIndex); + obj.getVar("subtype").clear_vector(); + obj.getVar("subtype").push_vector(subtype); + + switch(skillIndex){ + case ELEMENTALMASTER_SKILL_ARCTICPISTE://極冰綻放 + switch(subtype){ + case 1: + case 2://totalDamage,sizeRate,hitMax,hitTime,speedRate + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local hitMax = receiveData.readDword(); + local hitTime = receiveData.readDword(); + local speedRate = receiveData.readDword(); + local sub = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(sizeRate); + obj.getVar("custom").push_vector(hitMax); + obj.getVar("custom").push_vector(hitTime); + obj.getVar("custom").push_vector(speedRate); + obj.getVar("custom").push_vector(sub); + local attackIndex = 20; + if(subtype == 2) attackIndex = 8; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, attackIndex)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + if(subtype == 2){ + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + } + local skill_level = sq_GetSkillLevel(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE); + local prob = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 5, skill_level); + local level = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 6, skill_level); + local time = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 7, skill_level); + local minus_Rate = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 4, skill_level); + obj.getVar("custom").push_vector(minus_Rate); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_FREEZE, prob, level, time); + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 3: + case 4: + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local speedRate = receiveData.readDword(); + local isBig = receiveData.readDword(); + obj.getVar("custom").setInt(10, sizeRate); + + local aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/new/icearea_att_3.ani"; + if(sq_getRandom(1, 100) > 50) aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/new/icearea_att2_3.ani"; + if(subtype == 3){ + aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/new/icefieldnormal1.ani"; + if(sq_getRandom(1, 100) > 50) aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/new/icefieldnormal2.ani"; + } + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + if(isBig > 300) sizeRate = sizeRate * 2.0; + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + pAni.setSpeedRate(speedRate.tofloat()); + + local attackIndex = 20; + if(subtype == 2) attackIndex = 8; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, attackIndex)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + if(subtype == 2){ + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + } + local skill_level = sq_GetSkillLevel(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE); + local prob = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 5, skill_level); + local level = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 6, skill_level); + local time = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 7, skill_level); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_FREEZE, prob, level, time); + break; + } + break; + case ELEMENTALMASTER_SKILL_BLACKHOLE://黑洞 + if(sqrChr.getVar("blackhole").get_obj_vector_size() < 1){ + sqrChr.getVar("blackhole").clear_obj_vector(); + sqrChr.getVar("blackhole").push_obj_vector(obj); + } + if(!sqrChr.getVar("blackhole").is_obj_vector(obj)) sqrChr.getVar("blackhole").push_obj_vector(obj); + switch(subtype){ + case 1: + case 2://totalDamage,sizeRate,lifeTime,damageRate,attractPower,hitTime + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local lifeTime = receiveData.readDword(); + local damageRate = receiveData.readDword(); + local attractPower = receiveData.readDword(); + local range = receiveData.readDword(); + local sub = receiveData.readDword(); + local hitTime = receiveData.readDword(); + local totalDamage2 = totalDamage * damageRate / 100; + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(sizeRate); + obj.getVar("custom").push_vector(attractPower); + obj.getVar("custom").push_vector(range); + obj.getVar("custom").push_vector(totalDamage2); + obj.getVar("custom").push_vector(lifeTime); + obj.getVar("custom").push_vector(totalDamage); + obj.getVar("custom").push_vector(sub); + obj.getVar("custom").push_vector(hitTime); + local attackIndex = 37; + if(subtype == 2) attackIndex = 38; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, attackIndex)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + if(subtype == 2){ + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + } + if(sq_GetLevelData(sqrChr, 58, 10, sq_GetSkillLevel(sqrChr, 58)) < 1) obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + else obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 3: + local lifeTime = receiveData.readDword(); + local sub = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/normal/shockwave1_dodge.ani"; + if(sub == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/elementalpotential/shockwave2_dodge.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + obj.setTimeEvent(0,lifeTime,1,false); + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); + break; + } + break; + case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND://聖靈水晶 + switch(subtype){ + case 1: + if(sqrChr.getVar("crystal").get_obj_vector_size() > 0) sqrChr.getVar("crystal").push_obj_vector(obj); + else{ + sqrChr.getVar("crystal").clear_obj_vector(); + sqrChr.getVar("crystal").push_obj_vector(obj); + } + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local sub = receiveData.readDword(); + obj.getVar("custom").setInt(1,sizeRate); + obj.getVar("custom").setInt(2,totalDamage); + if(sub > 0){ + obj.setTimeEvent(2, 2600, 1, false); + obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, ""); + } + else obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 2: + case 3: + case 4: + if(sqrChr.getVar("crystal_effect" + subtype.tostring()).get_obj_vector_size() > 0) sqrChr.getVar("crystal_effect" + subtype.tostring()).push_obj_vector(obj); + else{ + sqrChr.getVar("crystal_effect" + subtype.tostring()).clear_obj_vector(); + sqrChr.getVar("crystal_effect" + subtype.tostring()).push_obj_vector(obj); + } + local sizeRate = receiveData.readDword(); + obj.getVar("custom").setInt(1,sizeRate); + if(subtype == 4){sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM);}//obj.setTimeEvent(1,3300,1,false); + // else{obj.setTimeEvent(1,3000,1,false);} + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN://元素點燃 + switch(subtype){ + case 1: + sqrChr.getVar("elementalchain_light").clear_obj_vector();sqrChr.getVar("elementalchain_light").push_obj_vector(obj); + case 2: + sqrChr.getVar("elementalchain_ice").clear_obj_vector();sqrChr.getVar("elementalchain_ice").push_obj_vector(obj); + case 3: + sqrChr.getVar("elementalchain_fire").clear_obj_vector();sqrChr.getVar("elementalchain_fire").push_obj_vector(obj); + case 4: + if(subtype == 4){sqrChr.getVar("elementalchain_dark").clear_obj_vector();sqrChr.getVar("elementalchain_dark").push_obj_vector(obj);} + local lightTime = receiveData.readDword(); + local sub = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(lightTime); + obj.getVar("custom").push_vector(sub); + obj.setDirection(ENUM_DIRECTION_RIGHT); + obj.setMapFollowParent(sqrChr); + obj.setMapFollowType(1); + if(sub <= 1) sq_moveWithParent(sqrChr, obj); + if(sub == 1) obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, ""); + else if(sub == 2) obj.addSetStatePacket(28, null, STATE_PRIORITY_AUTO, false, ""); + else obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 15: + local totalDamage = receiveData.readDword(); + local powerDamage = receiveData.readDword(); + local normal_rate = receiveData.readDword(); + local exp_rate = receiveData.readDword(); + local shoot_range = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(normal_rate); + obj.getVar("custom").push_vector(exp_rate); + obj.getVar("custom").push_vector(shoot_range); + obj.getVar("custom").push_vector(sq_GetXPos(obj)); + obj.getVar("custom").push_vector(totalDamage); + obj.getVar("custom").push_vector(powerDamage); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 24)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + sq_SetCurrentAttackPower(sq_GetCurrentAttackInfo(obj), powerDamage); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 150: + local ani = sq_CreateAnimation("","passiveobject/common/animation/fireexplosion.ani"); + obj.setCurrentAnimation(ani); + local totalDamage = receiveData.readDword(); + local powerDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 14)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + sq_SetCurrentAttackPower(sq_GetCurrentAttackInfo(obj), powerDamage); + local currentAni = obj.getCurrentAnimation();//得到當前ani + local sizeRate = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(sizeRate); + sizeRate = sizeRate.tofloat() / 1000.0; + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + obj.setTimeEvent(1, 200, 2, true); + obj.setTimeEvent(2, 50, 2, true); + obj.setTimeEvent(3, 15, 4, true); + obj.setTimeEvent(4, 100, 2, true); + break; + case 16: + local totalDamage = receiveData.readDword(); + local powerDamage = receiveData.readDword(); + local normal_rate = receiveData.readDword(); + local lifeTime = receiveData.readDword(); + obj.setTimeEvent(0,lifeTime,1,false); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(normal_rate); + obj.getVar("custom").push_vector(sq_GetXPos(obj)); + obj.getVar("custom").push_vector(sq_GetYPos(obj)); + obj.getVar("custom").push_vector(sq_GetZPos(obj)); + obj.getVar("custom").push_vector(80); + obj.getVar("custom").push_vector(0); + obj.getVar("custom").push_vector(0); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 23)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + sq_SetCurrentAttackPower(sq_GetCurrentAttackInfo(obj), powerDamage); + local skill_level = sq_GetSkillLevel(sqrChr, 16); + local prob = sq_GetLevelData(sqrChr, 16, 11, skill_level); + local level = sq_GetLevelData(sqrChr, 16, 12, skill_level); + local time = sq_GetLevelData(sqrChr, 16, 13, skill_level); + local speed_level = sq_GetLevelData(sqrChr, 16, 7, skill_level); + local speed_time = sq_GetLevelData(sqrChr, 16, 8, skill_level); + local movespeed_rate = sq_GetLevelData(sqrChr, 16, 9, skill_level); + local attackspeed_rate = sq_GetLevelData(sqrChr, 16, 10, skill_level); + obj.getVar("custom").push_vector(speed_level); + obj.getVar("custom").push_vector(speed_time); + obj.getVar("custom").push_vector(movespeed_rate); + obj.getVar("custom").push_vector(attackspeed_rate); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_FREEZE, prob, level, time); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 17: + local totalDamage = receiveData.readDword(); + local powerDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local lifeTime = receiveData.readDword(); + local angle = receiveData.readDword(); + local baseX = receiveData.readDword(); + local baseY = receiveData.readDword(); + obj.setTimeEvent(0,lifeTime,1,false); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(angle); + obj.getVar("custom").push_vector(baseX); + obj.getVar("custom").push_vector(baseY); + local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchfluorescent1.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchfluorescent2.ani"),true); + currentAni.addLayerAnimation(3,sq_CreateAnimation("","passiveobject/character/mage/animation/launchfluorescent3.ani"),true); + currentAni.addLayerAnimation(2,sq_CreateAnimation("","passiveobject/character/mage/animation/launchfluorescent4.ani"),true); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 22)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + sq_SetCurrentAttackPower(sq_GetCurrentAttackInfo(obj), powerDamage); + sizeRate = sizeRate.tofloat() / 1000.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + case 18: + local totalDamage = receiveData.readDword(); + local powerDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local speed_rate = receiveData.readDword(); + local shoot_range = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(sizeRate); + obj.getVar("custom").push_vector(speed_rate); + obj.getVar("custom").push_vector(shoot_range); + obj.getVar("custom").push_vector(sq_GetXPos(obj)); + obj.getVar("custom").push_vector(sq_GetZPos(obj)); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 21)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + sq_SetCurrentAttackPower(sq_GetCurrentAttackInfo(obj), powerDamage); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN://元素之幕 + local sizeRate = 100; + switch(subtype){ + case 1: + //totalDamage,sizeRate,lifeTime,damageRate,hitTime,hitMax + local totalDamage = receiveData.readDword(); + sizeRate = receiveData.readDword(); + local lifeTime = receiveData.readDword(); + local damageRate = receiveData.readDword(); + local hitTime = receiveData.readDword(); + local hitMax = receiveData.readDword(); + local istalisman = receiveData.readDword(); + local totalDamage2 = totalDamage * damageRate / 100; + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(sizeRate); + obj.getVar("custom").push_vector(totalDamage2); + obj.getVar("custom").push_vector(hitMax); + obj.getVar("custom").push_vector(totalDamage); + obj.getVar("custom").push_vector(istalisman); + obj.getVar("target").clear_obj_vector(); + + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalcurtain/blankwallhorizonbottom.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(10001,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalcurtain/elementalcurtain_aurora.ani"),true); + currentAni.addLayerAnimation(-1000,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalcurtain/elementalcurtain_aurorabehind_aurora1.ani"),true); + + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 3)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + + obj.setTimeEvent(0,hitTime,-1,true); + obj.setTimeEvent(1,lifeTime,1,false); + + cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj) + 400,obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN,2,lifeTime,sizeRate,0,0,0,0,0,0,0,0); + cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj),obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN,3,lifeTime,sizeRate,0,0,0,0,0,0,0,0); + break; + case 2: + local lifeTime = receiveData.readDword(); + sizeRate = receiveData.readDword(); + obj.setTimeEvent(1,lifeTime + 300,1,false); + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalcurtain/elementalcurtain_aurorafront_sky1.ani"); + obj.setCurrentAnimation(ani); + break; + case 3: + local lifeTime = receiveData.readDword(); + sizeRate = receiveData.readDword(); + obj.setTimeEvent(1,lifeTime + 300,1,false); + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalcurtain/elementalcurtain_groundcircle.ani"); + obj.setCurrentAnimation(ani); + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); + break; + case 4: + local totalDamage = receiveData.readDword(); + sizeRate = receiveData.readDword(); + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalcurtain/elementalcurtain_auroraend_broken.ani"); + obj.setCurrentAnimation(ani); + + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 4)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + + sq_flashScreen(obj,720,0,200,51, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + obj.setTimeEvent(1,1000,1,false); + break; + } + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + case ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL://元素奧義 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE://元素震蕩 + switch(subtype){ + case 1: + local totalDamage = receiveData.readDword(); + local damageRate = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local istalisman = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(totalDamage); + obj.getVar("custom").push_vector(damageRate); + obj.getVar("custom").push_vector(sizeRate); + obj.getVar("custom").push_vector(istalisman); + sizeRate = sizeRate.tofloat() / 100.0; + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalquake/magiccircle.ani",0,0,0); + local pooledObj2 = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalquake/quake_glowbeam.ani",0,0,0); + local effectObj = [pooledObj,pooledObj2]; + for(local i = 0; i < effectObj.len(); i++){ + local pAni = effectObj[i].getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + } + obj.setTimeEvent(1,400,1,false); + if(istalisman > 0) obj.setTimeEvent(2,120,20,false); + break; + case 2: + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalquake/elementalquakefireexpdummy.ani"); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 13)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setLoop(false); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + local randomnumber = sq_getRandom(1,100); + local pooledObj; + if(randomnumber > 67) pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalquake/flamestrike_blast_front02.ani",sq_getRandom(-350,350),sq_getRandom(-40,40),0); + else if(randomnumber > 33 && randomnumber <= 67) pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalquake/flamestrike_blast_front02.ani",sq_getRandom(-233,233),sq_getRandom(-80,80),0); + else pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalquake/flamestrike_blast_front02.ani",sq_getRandom(-115,115),sq_getRandom(-120,120),0); + local currentAni = pooledObj.getCurrentAnimation(); + currentAni.setImageRateFromOriginal(0.4, 0.4); + currentAni.setAutoLayerWorkAnimationAddSizeRate(0.4); + break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER://隕星幻滅 + switch(subtype){ + case 1: + local totalDamage = receiveData.readDword(); + local totalDamage2 = receiveData.readDword(); + obj.getVar("custom").setInt(10, totalDamage2); + local randomnumber = sq_getRandom(1, 4); + obj.getVar("custom").setInt(11, randomnumber); + obj.getVar("custom").setInt(12, sq_GetZPos(obj)); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 41)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case ELEMENTALMASTER_SKILL_FLAMESTRIKE://烈焰沖擊 + switch(subtype){ + case 1: + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 15)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(sizeRate); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 2: + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local etcTime = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 15)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/flamestrike/lv95assimilate/flamestrikebottoma_00.ani"); + obj.setCurrentAnimation(ani); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(sizeRate); + obj.getVar("custom").push_vector(totalDamage); + obj.getVar("custom").push_vector(etcTime); + local sizeRate = obj.getVar("custom").get_vector(0); + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + obj.getVar("targetObj").clear_obj_vector(); + obj.setTimeEvent(0,600,1,false); + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); + break; + case 3: + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(sizeRate); + obj.getVar("custom").push_vector(group); + obj.getVar("custom").push_vector(uniqueId); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 15)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER://傑克降臨 + switch(subtype){ + case 0: + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local sizeRate2 = receiveData.readDword(); + local damageRate = receiveData.readDword(); + local sub = receiveData.readDword(); + local typesub = receiveData.readDword(); + local number = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(sizeRate); + obj.getVar("custom").push_vector(sizeRate2); + obj.getVar("custom").push_vector(damageRate); + obj.getVar("custom").push_vector(totalDamage); + obj.getVar("custom").push_vector(sub); + obj.getVar("custom").push_vector(typesub); + obj.getVar("custom").push_vector(number); + obj.setTimeEvent(3,1000+220 * number,1,false); + obj.setTimeEvent(4,800,1,false); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalpotential/magictargetwarningterrible.ani",0,0,0); + break; + case 1: + case 2: + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local sizeRate2 = receiveData.readDword(); + local damageRate = receiveData.readDword(); + local sub = receiveData.readDword(); + print("sub = "+sub); + local totalDamage2 = totalDamage * damageRate / 100; + if(sub > 0){sizeRate = sizeRate * 166 / 100;sizeRate2 = sizeRate2 * 166 / 100;totalDamage = totalDamage * 10 / 100;totalDamage2 = totalDamage2 * 154 / 100;} + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(sizeRate); + obj.getVar("custom").push_vector(sizeRate2); + obj.getVar("custom").push_vector(totalDamage2); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 18)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + if(subtype == 2){ + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + } + local time = 1000; + if(sub > 0) time = 1500; + local speedRate = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_HALLOWEENBUSTER, 8, sq_GetSkillLevel(sqrChr, ELEMENTALMASTER_SKILL_HALLOWEENBUSTER)); + if(speedRate > 0){ + time = time / (100 + speedRate) * 100; + } + obj.getVar("move").setInt(10, sq_GetXPos(obj)); + obj.getVar("move").setInt(11, sq_GetZPos(obj)); + obj.setTimeEvent(5, time / 40, 40, true); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case ELEMENTALMASTER_SKILL_MIGHTYRUNE://聖靈符文 + break; + case ELEMENTALMASTER_SKILL_SESTOELEMENTO://第六元素 + switch(subtype){ + case 1: + local totalDamage = receiveData.readDword(); + local hitMax = receiveData.readDword(); + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/sestoelemento/start_main.ani"); + obj.setCurrentAnimation(ani); + obj.sq_PlaySound("SESTOELEMENTO"); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 26)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + obj.setTimeEvent(1,3000/(hitMax+1),hitMax,true); + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); + local appendage = CNSquirrelAppendage.sq_AppendAppendage(sqrChr, obj, -1, false, "appendage/character/ap_common_suck.nut", false); + if(appendage){ + CNSquirrelAppendage.sq_Append(appendage, sqrChr, obj); + local auraAppendage = appendage.sq_getAuraMaster("auraMaster"); + if(!auraAppendage) auraAppendage = appendage.sq_AddAuraMaster("auraMaster", sqrChr, obj, 1200, 18, 5, 0); + if(auraAppendage) auraAppendage.setAttractionInfo(600, 600, 800, 100); + } + break; + case 2: + local totalDamage = receiveData.readDword(); + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/sestoelemento/explosion_main.ani"); + obj.setCurrentAnimation(ani); + obj.sq_PlaySound("SESTOELEMENTO_EXP"); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 25)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); + if(!sqrChr) break; + CNSquirrelAppendage.sq_RemoveAppendage(sqrChr, "appendage/character/ap_common_suck.nut"); + break; + } + break; + case ELEMENTALMASTER_SKILL_SUNBURST://雷旋 + switch(subtype){ + case 1:// + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/sunburst/sunburst.ani"); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 27)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + case 2: + local time = receiveData.readDword(); + obj.setTimeEvent(1, time, 1, false); + break; + } + break; + case ELEMENTALMASTER_SKILL_THEGATE://元素之門 + switch(subtype){ + case 1: + local totalDamage = receiveData.readDword(); + local create_number = receiveData.readDword(); + local create_time = receiveData.readDword(); + local sub = receiveData.readDword(); + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + local targetObj = sq_GetObject(obj, group, uniqueId); + sq_moveWithParent(targetObj, obj); + obj.getVar().clear_obj_vector(); + obj.getVar().push_obj_vector(targetObj); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(totalDamage); + obj.getVar("custom").push_vector(create_number); + obj.getVar("custom").push_vector(create_time); + obj.getVar("custom").push_vector(sub); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 2: + local totalDamage = receiveData.readDword(); + local sub = receiveData.readDword(); + local aniPath1 = "passiveobject/elementalmaster_bykk/animation/thegate/"; + local aniPath2 = "light"; + switch(sub){ + case 2: aniPath2 = "ice"; break; + case 3: aniPath2 = "fire"; break; + case 4: aniPath2 = "dark"; break; + } + local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/" + aniPath2 + "_crystal.ani"); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 28)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + sq_CreateParticle("passiveobject/elementalmaster_bykk/particle/thegate"+aniPath2+"tail.ptl", obj, 0, 0, 0, true, 10, 0, 3); + + local attackInfo = sq_GetCurrentAttackInfo(obj); + switch(sub){ + case 1: if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); break; + case 2: if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); break; + case 3: if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); break; + case 4: if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); break; + } + + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(sq_GetZPos(obj)); + obj.getVar("custom").push_vector(sub); + break; + case 10: + local totalDamage = receiveData.readDword(); + local sub = receiveData.readDword(); + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + local targetObj = sq_GetObject(obj, group, uniqueId); + if(targetObj){ + obj.getVar("custom").setInt(0, totalDamage); + obj.getVar("custom").setInt(1, sub); + obj.getVar("custom").setInt(2, group); + obj.getVar("custom").setInt(3, uniqueId); + local aniPath0 = "passiveobject/elementalmaster_bykk/animation/thegate/talisman/"; + local aniPath1 = ["magiccircleblue","magiccirclepurple","magiccirclered","magiccircleyellow"]; + local aniPath2 = [["/magiccircleblue_01.ani","/magiccirclepurple_01.ani","/magiccirclered_01.ani","/magiccircleyellow_01.ani"], + ["/magiccircleblue_line_00.ani","/magiccirclepurple_line_00.ani","/magiccirclered_line_00.ani","/magiccircleyellow_line_00.ani"]]; + local ani = sq_CreateAnimation("",aniPath0 + aniPath1[sub] + aniPath2[0][sub]); + obj.setCurrentAnimation(ani); + local pAni = obj.getCurrentAnimation(); + pAni.addLayerAnimation(-1,sq_CreateAnimation("",aniPath0 + aniPath1[sub] + aniPath2[1][sub]),true); + local activeObj = sq_GetCNRDObjectToActiveObject(targetObj); + if(!CNSquirrelAppendage.sq_IsAppendAppendage(activeObj, "character/mage/elementalmaster_bykk/ap_mage_hold.nut")){ + CNSquirrelAppendage.sq_RemoveAppendage(activeObj, "character/mage/elementalmaster_bykk/ap_mage_hold.nut"); + } + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(activeObj, obj, -1, false, "character/mage/elementalmaster_bykk/ap_mage_hold.nut", true); + sq_HoldAndDelayDie(activeObj, obj, true, true, true, 200, 200, ENUM_DIRECTION_NEUTRAL , AddAppendage); + } + else sq_SendDestroyPacketPassiveObject(obj); + break; + case 11: + local totalDamage = receiveData.readDword(); + local sub = receiveData.readDword(); + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + local targetObj = sq_GetObject(obj, group, uniqueId); + if(targetObj){ + obj.getVar("tar").clear_obj_vector(); + obj.getVar("tar").push_obj_vector(targetObj); + local aniPath0 = "passiveobject/elementalmaster_bykk/animation/thegate/talisman/"; + local aniPath1 = ["magiccircleblue","magiccirclepurple","magiccirclered","magiccircleyellow"]; + local aniPath2 = ["/explosionblue_04.ani","/explosionpurple_05.ani","/explosionred_04.ani","/explosionyellow_04.ani"]; + // print("path = "+aniPath0 + aniPath1[sub] + aniPath2[sub]); + local ani = sq_CreateAnimation("",aniPath0 + aniPath1[sub] + aniPath2[sub]); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 28)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + attackInfo.setElement(ENUM_ELEMENT_FIRE); + attackInfo.setElement(ENUM_ELEMENT_WATER); + attackInfo.setElement(ENUM_ELEMENT_DARK); + attackInfo.setElement(ENUM_ELEMENT_LIGHT); + obj.setTimeEvent(2,50,1,false); + sq_SetShake(obj, 15, 300); + } + else sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case ELEMENTALMASTER_SKILL_THUNDERCALLING://天雷 + switch(subtype){ + case 0://totalDamage,sizeRate,countMax,hitTime,range,2 + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local countMax = receiveData.readDword(); + local hitTime = receiveData.readDword(); + local range = receiveData.readDword(); + local sub = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(totalDamage); + obj.getVar("custom").push_vector(sizeRate); + obj.getVar("custom").push_vector(countMax); + obj.getVar("custom").push_vector(range); + obj.getVar("custom").push_vector(sub); + obj.getVar("custom").push_vector(hitTime); + local skill_level = sq_GetSkillLevel(sqrChr, ELEMENTALMASTER_SKILL_THUNDERCALLING); + local prob = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_THUNDERCALLING, 4, skill_level); + local level = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_THUNDERCALLING, 5, skill_level); + local time = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_THUNDERCALLING, 6, skill_level); + obj.getVar("custom").push_vector(prob); + obj.getVar("custom").push_vector(level); + obj.getVar("custom").push_vector(time); + if((countMax * hitTime) > 4000){ + local pAni = obj.getCurrentAnimation(); + sq_SetFrameDelayTime(pAni, 0, countMax * hitTime); + } + obj.setTimeEvent(3,1000+(hitTime + 20) * countMax,1,false); + obj.setTimeEvent(4,800,1,false); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalpotential/magictargetwarningterrible.ani",0,0,0); + break; + case 1: + case 2: + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local range = receiveData.readDword(); + local prob = receiveData.readDword(); + local level = receiveData.readDword(); + local time = receiveData.readDword(); + local aniPath = "passiveobject/elementalmaster_bykk/animation/thunderstrike/thunderstrike_lightning01.ani"; + if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalpotential/thunderstrike/epthunderstrike_lightning01.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + local attackIndex = 29; + if(subtype == 2) attackIndex = 11; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, attackIndex)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_STUN, prob, level, time); + if(subtype == 1){ + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/thunderstrike/thunderstrike_hit01.ani",0,0,0); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/thunderstrike/thunderstrike_floor.ani",0,0,0); + } + else if(subtype == 2){ + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalpotential/thunderstrike/epthunderstrike_hit01.ani",0,0,0); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + } + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + obj.sq_PlaySound("THUNDERC_LIGHTNING"); + obj.setTimeEvent(1,200,1,false); + break; + case 3: + local totalDamage = receiveData.readDword(); + print("totalDamage = "+totalDamage); + local aniPath = "passiveobject/character/mage/animation/thunderstrike.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + sq_AddDrawOnlyAniFromParent(obj, "passiveobject/character/mage/animation/thunderstrikeeffect.ani", 0, -1, 0); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 29)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + break; + } + break; + case ELEMENTALMASTER_SKILL_THUNDERRAGE://光與暗的交響 + switch(subtype){ + case 1: + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local hitMax = receiveData.readDword(); + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/thunderrage/thunderrage_cast_end_shot_back_05.ani"); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 30)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + + sizeRate = sizeRate.tofloat() / 1000.0; + local pAni = obj.getCurrentAnimation(); + local delaySum = pAni.getDelaySum(0,13); + obj.setTimeEvent(1,delaySum/(hitMax + 1),hitMax,true); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + } + break; + case ELEMENTALMASTER_SKILL_VOID://虛無之球 + switch(subtype){ + case 1: + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local shoot_range = receiveData.readDword(); + local hittime = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(shoot_range); + obj.getVar("custom").push_vector(sq_GetXPos(obj)); + obj.getVar("custom").push_vector(sizeRate); + obj.setTimeEvent(0,hittime,-1,false); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 31)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.sq_SetMoveParticle("particle/void.ptl", 0.0, 0.0); + // sq_SetSpeedToMoveParticle(obj,0,speed); + obj.setTimeEvent(1,20,-1,false); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 2: + local totalDamage = receiveData.readDword(); + local hittime = receiveData.readDword(); + local timeMax = receiveData.readDword(); + local damageRate = receiveData.readDword(); + local damageRate2 = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local isExp = receiveData.readDword(); + local totalDamage2 = (totalDamage.tofloat() * damageRate.tofloat() / 100.0).tointeger(); + local totalDamage3 = (totalDamage.tofloat() * damageRate2.tofloat() / 100.0).tointeger(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(hittime); + obj.getVar("custom").push_vector(timeMax); + obj.getVar("custom").push_vector(totalDamage3); + obj.getVar("custom").push_vector(sizeRate); + obj.getVar("custom").push_vector(isExp); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 32)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage2); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case ELEMENTALMASTER_SKILL_WALLOFICE://冰牆 + break; + case 38://移動施法 + sqrChr.getVar("moveoncast").clear_obj_vector(); + sqrChr.getVar("moveoncast").push_obj_vector(obj); + local chargeTime = receiveData.readDword(); + local sub = receiveData.readDword(); + local fullcharge = receiveData.readDword(); + obj.setTimeEvent(0,chargeTime,1,false); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(sub); + obj.setMapFollowParent(obj.getParent()); + obj.setMapFollowType(1); + sq_moveWithParent(sqrChr, obj); + if(fullcharge > 0) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + else obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo){ + local element_kk_fire = sqrChr.getVar("element_kk").getInt(0); + local element_kk_water = sqrChr.getVar("element_kk").getInt(1); + local element_kk_dark = sqrChr.getVar("element_kk").getInt(2); + local element_kk_light = sqrChr.getVar("element_kk").getInt(3); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE) && element_kk_fire > 0) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER) && element_kk_water > 0) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK) && element_kk_dark > 0) attackInfo.setElement(ENUM_ELEMENT_DARK); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT) && element_kk_light > 0) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + } +} + +function setState_po_elementalmaster_bykk_kak(obj, state, datas) +{ + if(!obj) return; + + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").get_vector(0); + local subtype = obj.getVar("subtype").get_vector(0); + obj.getVar("state").clear_vector(); + obj.getVar("state").push_vector(state); + + switch(skillIndex){ + case ELEMENTALMASTER_SKILL_ARCTICPISTE://極冰綻放 + switch(subtype){ + case 1: + case 2: + switch(state){ + case 20: + local aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/icefieldfloorappear.ani"; + if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/field2floorappear.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + local speedRate = obj.getVar("custom").get_vector(3); + local pAni = obj.getCurrentAnimation(); + sq_SetFrameDelayTime(pAni, 0, 300); + pAni.setSpeedRate(speedRate.tofloat()); + break; + case 21: + local aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/icefield.ani"; + if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/field2.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + local hitTime = obj.getVar("custom").get_vector(2); + local sub = obj.getVar("custom").get_vector(4); + obj.setTimeEvent(1,hitTime,-1,false); + if(sub == 0) obj.setTimeEvent(2,hitTime / 2,-1,false); + else if(sub == 1) obj.setTimeEvent(3,900,-1,true); + break; + case 22: + obj.stopTimeEvent(1); + local aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/icefieldfloordisappear.ani"; + if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/field2disappear.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + break; + } + local sizeRate = obj.getVar("custom").get_vector(0); + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + } + break; + case ELEMENTALMASTER_SKILL_BLACKHOLE://黑洞 + switch(subtype){ + case 1: + case 2: + switch(state){ + case 20: + local aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/normal/nighthollow1_start_dodge.ani"; + if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/elementalpotential/nighthollow2_start_dodge.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + obj.sq_PlaySound("NIGHTH_IN") + break; + case 21: + local aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/normal/nighthollow1_loop_dodge.ani"; + if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/elementalpotential/nighthollow2_loop_dodge.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + local lifeTime = obj.getVar("custom").get_vector(4); + local sizeRate = obj.getVar("custom").get_vector(0); + cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,0,obj.getDirection(),ELEMENTALMASTER_SKILL_BLACKHOLE,3,lifeTime,subtype,sizeRate,0,0,0,0,0,0,0); + local hitTime = obj.getVar("custom").get_vector(7); + obj.setTimeEvent(1,hitTime,-1,false); + obj.setTimeEvent(0,lifeTime,1,false); + obj.setTimeEvent(3,1800,-1,true); + if(!sqrChr) break; + local attractPower = obj.getVar("custom").get_vector(1); + local range = obj.getVar("custom").get_vector(2); + if(CNSquirrelAppendage.sq_IsAppendAppendage(sqrChr, "appendage/character/ap_common_suck.nut")) CNSquirrelAppendage.sq_RemoveAppendage(sqrChr, "appendage/character/ap_common_suck.nut"); + local appendage = CNSquirrelAppendage.sq_AppendAppendage(sqrChr, obj, -1, false, "appendage/character/ap_common_suck.nut", false); + if(appendage){ + CNSquirrelAppendage.sq_Append(appendage, sqrChr, obj); + local auraAppendage = appendage.sq_getAuraMaster("auraMaster"); + if(!auraAppendage) auraAppendage = appendage.sq_AddAuraMaster("auraMaster", sqrChr, obj, 1200, 18, 5, 0); + if(auraAppendage) auraAppendage.setAttractionInfo(attractPower, attractPower, range, 100); + } + break; + case 22: + obj.stopTimeEvent(1); + obj.stopTimeEvent(3); + local aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/normal/nighthollow1_exp_dodge.ani"; + if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/elementalpotential/nighthollow2_exp_dodge.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + obj.sq_PlaySound("NIGHTH_OUT"); + obj.setTimeEvent(2,400,1,false); + local totalDamage = obj.getVar("custom").get_vector(3); + local attackIndex = 40; + if(subtype == 2) attackIndex = 39; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, attackIndex)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + if(subtype == 2){ + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + } + if(!sqrChr) break; + CNSquirrelAppendage.sq_RemoveAppendage(sqrChr, "appendage/character/ap_common_suck.nut"); + break; + } + local sizeRate = obj.getVar("custom").get_vector(0); + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + } + break; + case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND://聖靈水晶 + switch(subtype){ + case 1: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/crystalofovermind/crystalofovermind_grow01_loop.ani");// + obj.setCurrentAnimation(ani); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/groweffect/crystalofovermind_grow01_start.ani",0,0,50); + obj.setTimeEvent(2,650,4,false); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/crystalofovermind/crystalofovermind_grow02_loop.ani");// + obj.setCurrentAnimation(ani); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/groweffect/crystalofovermind_grow02_start.ani",0,0,50); + break; + case 22: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/crystalofovermind/crystalofovermind_grow03_loop.ani");// + obj.setCurrentAnimation(ani); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/groweffect/crystalofovermind_grow03_start.ani",0,0,50); + break; + case 23: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/crystalofovermind/crystalofovermind_grow04_loop.ani");// + obj.setCurrentAnimation(ani); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/groweffect/crystalofovermind_grow04_start_back.ani",0,0,50); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/groweffect/crystalofovermind_grow04_start.ani",0,0,50); + break; + case 24: + obj.stopTimeEvent(2); + local effectObj2 = sqrChr.getVar("crystal_effect2").get_obj_vector(0); + if(effectObj2){local colObj = sq_GetCNRDObjectToCollisionObject(effectObj2);colObj.setTimeEvent(1,100,1,true);} + local effectObj3 = sqrChr.getVar("crystal_effect3").get_obj_vector(0); + if(effectObj3){local colObj = sq_GetCNRDObjectToCollisionObject(effectObj3);colObj.setTimeEvent(1,100,1,true);} + local effectObj4 = sqrChr.getVar("crystal_effect4").get_obj_vector(0); + if(effectObj4){local colObj = sq_GetCNRDObjectToCollisionObject(effectObj4);colObj.setTimeEvent(1,500,1,false);} + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/crystalofovermind/finish/front/crystalofovermind_finish_front_00.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/crystalofovermind/finish/back/crystalofovermind_finish_back_00.ani"),true); + local totalDamage = obj.getVar("custom").getInt(2); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 2)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + break; + } + local sizeRate = obj.getVar("custom").getInt(1); + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + case 2: + case 3: + case 4: + local aniPath1 = "character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/"; + switch(state){ + case 20: + local aniPath2 = "crystalofmind_side_back01_start.ani"; + if(subtype == 3) aniPath2 = "crystalofmind_side_front_start.ani"; + if(subtype == 4) aniPath2 = "crystalofovermind_background_01.ani"; + local ani = sq_CreateAnimation("",aniPath1 + "start/" + aniPath2); + obj.setCurrentAnimation(ani); + break; + case 21: + local aniPath2 = "crystalofmind_side_back01.ani"; + if(subtype == 3) aniPath2 = "crystalofmind_side_front_loop01.ani"; + if(subtype == 4) aniPath2 = "crystalofovermind_background_01.ani"; + local ani = sq_CreateAnimation("",aniPath1 + "loop/" + aniPath2); + obj.setCurrentAnimation(ani); + break; + case 22: + local aniPath2 = "crystalofmind_side_back01_finish.ani"; + if(subtype == 3) aniPath2 = "crystalofmind_side_front_finish.ani"; + if(subtype == 4) {sq_SendDestroyPacketPassiveObject(obj);return;} + local ani = sq_CreateAnimation("",aniPath1 + "end/" + aniPath2); + obj.setCurrentAnimation(ani); + break; + } + local sizeRate = obj.getVar("custom").getInt(1); + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN://元素點燃 + switch(subtype){ + case 1: + case 2: + case 3: + case 4: + local aniPath1 = "character/mage/effect/animation/elementalmaster_bykk/elementalchain/mark"; + local aniPath2 = "light"; + if(subtype == 2) aniPath2 = "ice"; + if(subtype == 3) aniPath2 = "fire"; + if(subtype == 4) aniPath2 = "dark"; + if(obj.getVar("custom").get_vector(1) == 1) aniPath1 = "character/mage/effect/animation/elementalmaster_bykk/mightyrune/"; + if(obj.getVar("custom").get_vector(1) == 2) aniPath1 = "character/mage/effect/animation/elementalmaster_bykk/mightyrune/lv95assimilate/"; + switch(state){ + case 20: + local ani = sq_CreateAnimation("",aniPath1 + "appear_" + aniPath2 + "_1.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("",aniPath1 + "appear_" + aniPath2 + "_2.ani"),true); + break; + case 21: + local ani = sq_CreateAnimation("",aniPath1 + "stay_" + aniPath2 + "_1.ani"); + obj.setCurrentAnimation(ani); + if(subtype == 1) sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr) + 23); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("",aniPath1 + "stay_" + aniPath2 + "_2.ani"),true); + break; + case 22: + if(obj.isExistTimeEvent(1)) obj.stopTimeEvent(1); + local ani = sq_CreateAnimation("",aniPath1 + "activate_" + aniPath2 + "_1.ani"); + obj.setCurrentAnimation(ani); + local lifeTime = obj.getVar("custom").get_vector(0); + obj.setTimeEvent(1,lifeTime,1,false); + if(subtype == 1) sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr) + 30); + if(subtype == 4) sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr) + 35); + break; + case 23: + local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/rune" + aniPath2 + "cast.ani"); + obj.setCurrentAnimation(ani); + break; + case 24: + local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/rune" + aniPath2 + "off_02.ani"); + obj.setCurrentAnimation(ani); + break; + case 25: + local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/rune" + aniPath2 + "changeon_02.ani"); + obj.setCurrentAnimation(ani); + break; + case 26: + if(obj.isExistTimeEvent(2)) obj.stopTimeEvent(2); + local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/rune" + aniPath2 + "on_02.ani"); + obj.setCurrentAnimation(ani); + local lightTime = obj.getVar("custom").get_vector(0); + obj.setTimeEvent(1,lightTime,1,false); + break; + case 27: + local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/rune" + aniPath2 + "changeoff.ani"); + obj.setCurrentAnimation(ani); + break; + case 28: + local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "spherestart_00.ani "); + obj.setCurrentAnimation(ani); + break; + case 29: + local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "sphereloop_00.ani"); + obj.setCurrentAnimation(ani); + break; + } + break; + case 15: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchjolstart.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchjolfirestart.ani"),true); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchjolmove.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchjolfiremove.ani"),true); + break; + } + local sizeRate = obj.getVar("custom").get_vector(0); + sizeRate = sizeRate.tofloat() / 1000.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + case 16: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchfrosthead.ani"); + obj.setCurrentAnimation(ani); + local pAni = obj.getCurrentAnimation(); + pAni.setLoop(true); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchfrostheadjump.ani"); + obj.setCurrentAnimation(ani); + obj.getVar("custom").set_vector(1,sq_GetXPos(obj)); + obj.getVar("custom").set_vector(2,sq_GetYPos(obj)); + obj.getVar("custom").set_vector(3,sq_GetZPos(obj)); + local targetObj = obj.sq_FindFirstTarget(-9999, 19998, 9999, 9999); + if(targetObj){ + local targetObj_y = sq_GetYPos(targetObj) - sq_GetYPos(obj); + obj.getVar("custom").set_vector(5,targetObj_y); + if(sq_GetXPos(targetObj) > sq_GetXPos(obj) && obj.getDirection() == ENUM_DIRECTION_LEFT) sq_SetCurrentDirection(obj, ENUM_DIRECTION_RIGHT); + else if(sq_GetXPos(targetObj) < sq_GetXPos(obj) && obj.getDirection() == ENUM_DIRECTION_RIGHT) sq_SetCurrentDirection(obj, ENUM_DIRECTION_LEFT); + } + obj.getVar("custom").set_vector(6,130); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/character/mage/animation/launchfrostheadjumpeffect.ani",0,-1,-1); + break; + case 22: + local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchfrostheadhit.ani"); + obj.setCurrentAnimation(ani); + break; + case 23: + local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchfrostheaddisappear.ani"); + obj.setCurrentAnimation(ani); + break; + } + local sizeRate = obj.getVar("custom").get_vector(0); + sizeRate = sizeRate.tofloat() / 1000.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + case 18: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatshoot1.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatshoot2.ani"),true); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatmovego1.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatmovego2.ani"),true); + break; + case 22: + local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatturn1.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatturn2.ani"),true); + obj.getVar("custom").set_vector(3,sq_GetXPos(obj)); + break; + case 23: + local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatmovereturn1.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatmovereturn2.ani"),true); + obj.resetHitObjectList(); + break; + case 24: + local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatreturn1.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatreturn2.ani"),true); + break; + } + local sizeRate = obj.getVar("custom").get_vector(0); + sizeRate = sizeRate.tofloat() / 1000.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN://元素之幕 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL://元素奧義 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE://元素震蕩 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER://隕星幻滅 + switch(subtype){ + case 1: + switch(state){ + case 20: + local randomnumber = obj.getVar("custom").getInt(11); + local aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/darkdrop.ani"; + if(randomnumber == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/firedrop.ani"; + if(randomnumber == 3) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/lightdrop.ani"; + if(randomnumber == 4) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/waterdrop.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + local pAni = obj.getCurrentAnimation(); + sq_SetFrameDelayTime(pAni, 0, 100); + local sizeRate = 2.5; + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + obj.setTimeEvent(1, 10, 13, true); + obj.sq_PlaySound("COLORLESS_CHASER"); + break; + case 21: + local randomnumber = obj.getVar("custom").getInt(11); + local aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/darkexp.ani"; + if(randomnumber == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/fireexp.ani"; + if(randomnumber == 3) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/lightexp.ani"; + if(randomnumber == 4) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/waterexp.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + switch(randomnumber){ + case 1: currentAni.addLayerAnimation(6,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalshower/darkexplayer.ani"),true); obj.sq_PlaySound("DARK_BOMB"); break; + case 2: currentAni.addLayerAnimation(6,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalshower/fireexplayer.ani"),true); obj.sq_PlaySound("FIRE_BOMB"); break; + case 3: currentAni.addLayerAnimation(6,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalshower/lightexplayer.ani"),true); obj.sq_PlaySound("LIGHT_BOMB"); break; + case 4: currentAni.addLayerAnimation(6,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalshower/waterexplayer.ani"),true); obj.sq_PlaySound("WATER_BOMB"); break; + } + local sizeRate = 2.5; + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + local totalDamage = obj.getVar("custom").getInt(10); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 42)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //obj.sq_PlaySound("CHASER_EXPLOSION"); + break; + } + break; + } + break; + case ELEMENTALMASTER_SKILL_FLAMESTRIKE://烈焰沖擊 + switch(subtype){ + case 1: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/flamestrike/new/flamestrike_start_floor01.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(10001,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/flamestrike/new/flamestrike_start_floor03.ani"),true); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/flamestrike/new/flamestrike_blast_front02.ani"); + obj.setCurrentAnimation(ani); + sq_CreateParticle("passiveobject/character/mage/particle/flamestrikeparticle-1.ptl", obj, 0, 0, 0, true, 1, 0, 1); + sq_CreateParticle("passiveobject/character/mage/particle/flamestrikeparticle-2.ptl", obj, 0, 0, 0, true, 1, 0, 1); + sq_SetMyShake(obj, 10, 150); + break; + } + local sizeRate = obj.getVar("custom").get_vector(0); + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + case 3: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/flamestrike/lv95assimilate/flamestrikea_00.ani"); + obj.setCurrentAnimation(ani); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/flamestrike/lv95assimilate/flamestrikeb_02.ani"); + obj.setCurrentAnimation(ani); + local group = obj.getVar("custom").get_vector(1); + local uniqueId = obj.getVar("custom").get_vector(2); + local targetObj = sq_GetObject(obj, group, uniqueId); + if(targetObj) sq_SendHitObjectPacket(obj,targetObj,0,0,0); + sq_CreateParticle("passiveobject/elementalmaster_bykk/particle/flamestrikeparticlenew1.ptl", obj, 0, 0, 0, true, 1, 0, 1); + sq_CreateParticle("passiveobject/elementalmaster_bykk/particle/flamestrikeparticlenew2.ptl", obj, 0, 0, 0, true, 1, 0, 1); + sq_SetMyShake(obj, 10, 150); + break; + } + local sizeRate = obj.getVar("custom").get_vector(0); + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + } + break; + case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER://傑克降臨 + switch(subtype){ + case 1: + case 2: + switch(state){ + case 20: + local aniPath = "passiveobject/elementalmaster_bykk/animation/halloweenbuster/halloweenbustera_meteor_base01.ani"; + if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalpotential/halloweenbuster/ep_halloweenbustera_meteor_base01.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + if(subtype == 2){ + sq_CreateParticle("passiveobject/elementalmaster_bykk/particle/elementalpotentialhalloweenbursterexp.ptl", obj, 0, 0, 0, true, 30, 0, 1); + sq_CreateParticle("passiveobject/elementalmaster_bykk/particle/elementalpotentialhalloweenbursterexpsmoke.ptl", obj, 0, 0, 0, true, 10, 0, 1); + } + break; + case 21: + obj.sq_RemoveMoveParticle(); + obj.stopTimeEvent(0); + obj.stopTimeEvent(1); + local aniPath = "passiveobject/elementalmaster_bykk/animation/halloweenbuster/halloweenbuster_explosion_04.ani"; + if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalpotential/halloweenbuster/ep_halloweenbuster_explosion_04.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + local totalDamage = obj.getVar("custom").get_vector(2); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 19)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + if(subtype == 2){ + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/character/mage/animation/elementalpotential/halloweenbuster/ep_halloweenbuster_particle01.ani",0,0,0); + } + break; + } + local sizeRate = obj.getVar("custom").get_vector(0); + if(state == 21) sizeRate = obj.getVar("custom").get_vector(1); + sizeRate = sizeRate.tofloat() / 1000.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + } + break; + case ELEMENTALMASTER_SKILL_MIGHTYRUNE://聖靈符文 + break; + case ELEMENTALMASTER_SKILL_SESTOELEMENTO://第六元素 + break; + case ELEMENTALMASTER_SKILL_SUNBURST://雷旋 + break; + case ELEMENTALMASTER_SKILL_THEGATE://元素之門 + switch(subtype){ + case 1: + local aniPath1 = "passiveobject/elementalmaster_bykk/animation/thegate/"; + local aniPath2 = "light"; + switch(obj.getVar("custom").get_vector(3)){ + case 2: aniPath2 = "ice"; break; + case 3: aniPath2 = "fire"; break; + case 4: aniPath2 = "dark"; break; + } + switch(state){ + case 20: + local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/start/" + aniPath2 + "_magic.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath1 + aniPath2 + "/start/" + aniPath2 + "_aura.ani"),true); + local pAni = obj.getCurrentAnimation(); + pAni.setSpeedRate(200.0); + break; + case 21: + local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/loop/" + aniPath2 + "_magic.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath1 + aniPath2 + "/loop/" + aniPath2 + "_aura.ani"),true); + local create_time = obj.getVar("custom").get_vector(2); + obj.setTimeEvent(1,create_time,-1,true); + break; + case 22: + obj.stopTimeEvent(1); + local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/end/" + aniPath2 + "_magic.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath1 + aniPath2 + "/end/" + aniPath2 + "_aura.ani"),true); + break; + } + break; + } + break; + case ELEMENTALMASTER_SKILL_THUNDERCALLING://天雷 + break; + case ELEMENTALMASTER_SKILL_THUNDERRAGE://光與暗的交響 + break; + case ELEMENTALMASTER_SKILL_VOID://虛無之球 + switch(subtype){ + case 1: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/void/void1_start.ani"); + obj.setCurrentAnimation(ani); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/void/void1_loop.ani"); + obj.setCurrentAnimation(ani); + break; + case 22: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/void/void1_end.ani"); + obj.setCurrentAnimation(ani); + break; + } + local sizeRate = obj.getVar("custom").get_vector(2); + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + case 2: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/void/lv95assimilate/start_00.ani"); + obj.setCurrentAnimation(ani); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/void/lv95assimilate/start_06.ani",0,0,0); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/void/lv95assimilate/start_07.ani",0,0,0); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/void/lv95assimilate/loop_00.ani"); + obj.setCurrentAnimation(ani); + local timeMax = obj.getVar("custom").get_vector(1); + print("timemax = "+timeMax); + obj.setTimeEvent(1, timeMax, 1, false); + break; + case 22: + obj.stopTimeEvent(0); + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/void/lv95assimilate/end_04.ani"); + obj.setCurrentAnimation(ani); + local totalDamage = obj.getVar("custom").get_vector(2); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 33)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + break; + } + local sizeRate = obj.getVar("custom").get_vector(3); + sizeRate = sizeRate.tofloat() / 230.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + } + break; + case ELEMENTALMASTER_SKILL_WALLOFICE://冰牆 + break; + case 38://移動施法 + local aniPath1 = "character/mage/effect/animation/magic"; + local sub = obj.getVar("custom").get_vector(0); + if(sub == 4){ + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/magiconcharge2_1.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/magiconcharge2_2.ani"),true); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/magicfullcharge2_1.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/magicfullcharge22_1.ani"),true); + break; + } + return; + } + switch(state){ + case 20: + local ani = sq_CreateAnimation("",aniPath1 + "oncharge" + sub.tostring() + "1.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("",aniPath1 + "oncharge" + sub.tostring() + "2.ani"),true); + break; + case 21: + local ani = sq_CreateAnimation("",aniPath1 + "fullcharge" + sub + "1.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("",aniPath1 + "oncharge" + sub.tostring() + "2.ani"),true); + break; + } + break; + } + + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo){ + local element_kk_fire = sqrChr.getVar("element_kk").getInt(0); + local element_kk_water = sqrChr.getVar("element_kk").getInt(1); + local element_kk_dark = sqrChr.getVar("element_kk").getInt(2); + local element_kk_light = sqrChr.getVar("element_kk").getInt(3); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE) && element_kk_fire > 0) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER) && element_kk_water > 0) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK) && element_kk_dark > 0) attackInfo.setElement(ENUM_ELEMENT_DARK); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT) && element_kk_light > 0) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + } +} + +function onEndCurrentAni_po_elementalmaster_bykk_kak(obj) +{ + if(!obj) return; + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").get_vector(0); + local subtype = obj.getVar("subtype").get_vector(0); + local state = obj.getVar("state").get_vector(0); + + switch(skillIndex){ + case ELEMENTALMASTER_SKILL_ARCTICPISTE://極冰綻放 + switch(subtype){ + case 1: + case 2: + switch(state){ + case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; + case 22: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + case 3: + case 4: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case ELEMENTALMASTER_SKILL_BLACKHOLE://黑洞 + switch(subtype){ + case 1: + case 2: + switch(state){ + case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; + case 22: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + } + break; + case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND://聖靈水晶 + switch(subtype){ + case 1: + switch(state){ + case 20: + case 21: + case 22: + case 23: + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 24: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 2: + case 3: + case 4: + switch(state){ + case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; + case 22: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN://元素點燃 + switch(subtype){ + case 1: + case 2: + case 3: + case 4: + switch(state){ + case 20: + case 22: + obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 23: + case 25: + case 28: + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 27: + obj.addSetStatePacket(24, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case 15: + if(state == 20) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 150: + sq_SendDestroyPacketPassiveObject(obj); + break; + case 16: + if(state == 21) obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + else if(state == 22 || state == 23) sq_SendDestroyPacketPassiveObject(obj); + break; + case 18: + switch(state){ + case 20: + case 21: + case 22: + case 23: + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 24: sq_SendDestroyPacketPassiveObject(obj); break + } + break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN://元素之幕 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL://元素奧義 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE://元素震蕩 + switch(subtype){ + case 1: sq_SendDestroyPacketPassiveObject(obj); break; + case 2: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER://隕星幻滅 + switch(subtype){ + case 1: + switch(state){ + case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; + case 21: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + } + break; + case ELEMENTALMASTER_SKILL_FLAMESTRIKE://烈焰沖擊 + switch(subtype){ + case 1: + case 3: + if(state == 20) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + else sq_SendDestroyPacketPassiveObject(obj); + break; + case 2: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER://傑克降臨 + if(subtype == 0 || state == 21) sq_SendDestroyPacketPassiveObject(obj); + break; + case ELEMENTALMASTER_SKILL_MIGHTYRUNE://聖靈符文 + break; + case ELEMENTALMASTER_SKILL_SESTOELEMENTO://第六元素 + sq_SendDestroyPacketPassiveObject(obj); + break; + case ELEMENTALMASTER_SKILL_SUNBURST://雷旋 + sq_SendDestroyPacketPassiveObject(obj); + break; + case ELEMENTALMASTER_SKILL_THEGATE://元素之門 + switch(subtype){ + case 1: + switch(state){ + case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; + case 22: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + case 2: sq_SendDestroyPacketPassiveObject(obj); break; + case 10: sq_SendDestroyPacketPassiveObject(obj); break; + case 11: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + case ELEMENTALMASTER_SKILL_THUNDERCALLING://天雷 + sq_SendDestroyPacketPassiveObject(obj); + break; + case ELEMENTALMASTER_SKILL_THUNDERRAGE://光與暗的交響 + sq_SendDestroyPacketPassiveObject(obj); + break; + case ELEMENTALMASTER_SKILL_VOID://虛無之球 + switch(subtype){ + case 1: + case 2: + switch(state){ + case 20: + if(obj.getVar("custom").get_vector(4) > 0) obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + else obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 22: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + } + break; + case ELEMENTALMASTER_SKILL_WALLOFICE://冰牆 + break; + case 38://移動施法 + if(state == 21) sq_SendDestroyPacketPassiveObject(obj); + break; + } + +} + +function onTimeEvent_po_elementalmaster_bykk_kak(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return; + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").get_vector(0); + local subtype = obj.getVar("subtype").get_vector(0); + local state = obj.getVar("state").get_vector(0); + + switch(skillIndex){ + case ELEMENTALMASTER_SKILL_ARCTICPISTE://極冰綻放 + switch(timeEventIndex){ + case 1: + if(timeEventCount >= obj.getVar("custom").get_vector(1)){ + obj.stopTimeEvent(1); + obj.stopTimeEvent(2); + obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + return; + } + obj.resetHitObjectList(); + obj.sq_PlaySound("ARCTICF_MCIRCLE"); + break; + case 2: + local aniPath = ["passiveobject/elementalmaster_bykk/animation/icefield/icefieldnormal1.ani","passiveobject/elementalmaster_bykk/animation/icefield/icefieldnormal2.ani"]; + if(subtype == 2) aniPath = ["passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/icearea_att_3.ani","passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/icearea_att2_3.ani"]; + local sizeRate = obj.getVar("custom").get_vector(0); + local sizeRate_balance = 120; + local randomnumber = sq_getRandom(1,100); + if(randomnumber > 75) sq_AddDrawOnlyAniFromParent(obj,aniPath[sq_getRandom(0,1)],sq_getRandom(-113,113)*sizeRate/sizeRate_balance,sq_getRandom(-71,71)*sizeRate/sizeRate_balance,0); + else if(randomnumber <= 75 && randomnumber > 50) sq_AddDrawOnlyAniFromParent(obj,aniPath[sq_getRandom(0,1)],sq_getRandom(-250,250)*sizeRate/sizeRate_balance,sq_getRandom(-20,20)*sizeRate/sizeRate_balance,0); + else if(randomnumber <= 50 && randomnumber > 25) sq_AddDrawOnlyAniFromParent(obj,aniPath[sq_getRandom(0,1)],sq_getRandom(-172,172)*sizeRate/sizeRate_balance,sq_getRandom(-30,30)*sizeRate/sizeRate_balance,0); + else sq_AddDrawOnlyAniFromParent(obj,aniPath[sq_getRandom(0,1)],sq_getRandom(-217,217)*sizeRate/sizeRate_balance,sq_getRandom(-43,43)*sizeRate/sizeRate_balance,0); + obj.sq_PlaySound("ARCTICF_ICE_OUT"); + break; + case 3: + local pooledObj = createOnlyDrawObject_elementalmaster_bykk(obj,"passiveobject/elementalmaster_bykk/animation/flamestrike/lv95assimilate/flamestrikebottoma_00.ani",true,obj.getDirection(),sq_GetXPos(obj),sq_GetYPos(obj),sq_GetZPos(obj),ENUM_DRAWLAYER_BOTTOM); + local sizeRate = obj.getVar("custom").get_vector(0); + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = pooledObj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + break; + } + break; + case ELEMENTALMASTER_SKILL_BLACKHOLE://黑洞 + switch(timeEventIndex){ + case 0: + switch(subtype){ + case 1: + case 2: + obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 3: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + case 1: obj.resetHitObjectList(); break; + case 2: + local sub = obj.getVar("custom").get_vector(6); + if(sub > 0){ + local sizeRate = obj.getVar("custom").get_vector(0) / 2; + local attractPower = obj.getVar("custom").get_vector(1) * 150 / 100; + local range = obj.getVar("custom").get_vector(2); + local totalDamage2 = obj.getVar("custom").get_vector(3) * 25 / 100; + local lifeTime = obj.getVar("custom").get_vector(4) / 2; + local totalDamage = obj.getVar("custom").get_vector(5) * 25 / 100; + local hitTime = obj.getVar("custom").get_vector(7); + local damageRate = totalDamage2 / totalDamage * 100; + cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj),obj.getDirection(),ELEMENTALMASTER_SKILL_BLACKHOLE,subtype,totalDamage,sizeRate,lifeTime,damageRate,attractPower,range,0,hitTime,0,0); + } + break; + case 3: + obj.stopSound(20); + obj.sq_PlaySound("NIGHTH_LOOP",20); + break; + } + break; + case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND://聖靈水晶 + switch(timeEventIndex){ + case 1: obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); break; + case 2: obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN://元素點燃 + switch(subtype){ + case 1: + case 2: + case 3: + case 4: + switch(timeEventIndex){ + case 0: + sqrChr.getVar("elementalchain").setBool(0, false); + sq_SendDestroyPacketPassiveObject(obj); + break; + case 1: + local addAppendage = CNSquirrelAppendage.sq_GetAppendage(sqrChr,"character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut"); + if(!addAppendage) return; + addAppendage.getVar().setBool(subtype, false); + setElementalChainBuff_bykk(sqrChr,ELEMENTALMASTER_SKILL_ELEMENTALCHAIN,addAppendage); + if(obj.getVar("custom").get_vector(1) > 0) obj.addSetStatePacket(27, null, STATE_PRIORITY_AUTO, false, ""); + else obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case 150: + local sizeRate = obj.getVar("custom").get_vector(0); + sizeRate = sizeRate.tofloat() / 1000.0; + switch(timeEventIndex){ + case 1: + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/common/animation/fireexplosionparticle1.ani", sq_getRandom(-10,10), sq_getRandom(-10,10), sq_getRandom(-10,10)); + local currentAni = pooledObj.getCurrentAnimation(); + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + break; + case 2: + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/common/animation/fireexplosionparticle2.ani", 0, 2, 0); + local currentAni = pooledObj.getCurrentAnimation(); + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + break; + case 3: + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/common/animation/fireexplosionparticle3.ani", 0, 1, 1); + local currentAni = pooledObj.getCurrentAnimation(); + local angle = sq_ToRadian(360.0 * timeEventCount / 16); + sq_SetfRotateAngle(currentAni, angle); + currentAni.setImageRateFromOriginal(sizeRate * 2.0, sizeRate * 2.0); + break; + case 4: + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/common/animation/fireexplosionparticle4.ani", sq_getRandom(-30,30), sq_getRandom(-30,30), sq_getRandom(-30,30)); + local currentAni = pooledObj.getCurrentAnimation(); + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + break; + } + break; + case 16: + switch(timeEventIndex){ + case 0: obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, ""); break; + case 1: obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); break; + } + break; + case 17: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN://元素之幕 + switch(timeEventIndex){ + case 0: + local hitMax = obj.getVar("custom").get_vector(2); + if(timeEventCount >= hitMax - 2 && obj.getVar().getBool(0) == false){ + obj.getVar().setBool(0,true); + local totalDamage = obj.getVar("custom").get_vector(1); + local sizeRate = obj.getVar("custom").get_vector(0); + cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj),obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN,4,totalDamage,sizeRate,0,0,0,0,0,0,0,0); + } + if(timeEventCount >= hitMax){obj.stopTimeEvent(0);return;} + obj.resetHitObjectList(); + break; + case 1: + if(subtype == 1 && obj.getVar("custom").get_vector(4) > 0){ + local size = obj.getVar("targetObj").get_obj_vector_size(); + if(size > 0){ + for(local i = 0; i < size; i++){ + local targetObj = obj.getVar("targetObj").get_obj_vector(i); + if(targetObj){ + local activeObj = sq_GetCNRDObjectToActiveObject(targetObj); + if(activeObj.getVar("elementalcurtain").getBool(0) == true) activeObj.getVar("elementalcurtain").setBool(0, false); + } + } + } + } + if(subtype == 1){ + local size = obj.getVar("target").get_obj_vector_size(); + if(size > 0){ + for(local i = 0; i < size; i++){ + local targetObj = obj.getVar("target").get_obj_vector(i); + if(targetObj) CNSquirrelAppendage.sq_RemoveAppendage(targetObj, "character/mage/elementalmaster_bykk/ap/ap_elementalcurtain.nut"); + } + } + } + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL://元素奧義 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE://元素震蕩 + switch(timeEventIndex){ + case 1: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalquake/quakebottom_crack.ani"); + obj.setCurrentAnimation(ani); + local totalDamage = obj.getVar("custom").get_vector(0); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 12)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + local sizeRate = obj.getVar("custom").get_vector(2); + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); + break; + case 2: + local totalDamage = obj.getVar("custom").get_vector(0) * 10 / 100; + local sizeRate = obj.getVar("custom").get_vector(2); + cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj),obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALQUAKE,2,totalDamage,sizeRate,0,0,0,0,0,0,0,0); + break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER://隕星幻滅 + switch(timeEventIndex){ + case 1: + local baseZ = obj.getVar("custom").getInt(12); + local MoveZ = sq_GetUniformVelocity(baseZ, 0, timeEventCount, 13); + sq_setCurrentAxisPos(obj, 2, MoveZ); + if(timeEventCount >= 13){ + sq_SetMyShake(obj, 20, 200); + local randomnumber = obj.getVar("custom").getInt(11); + switch(randomnumber){ + case 1: obj.sq_PlaySound("DARK_CHASER"); break; + case 1: obj.sq_PlaySound("FIRE_CHASER"); break; + case 1: obj.sq_PlaySound("LIGHT_CHASER"); break; + case 1: obj.sq_PlaySound("WATER_CHASER"); break; + } + } + break; + } + break; + case ELEMENTALMASTER_SKILL_FLAMESTRIKE://烈焰沖擊 + break; + case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER://傑克降臨 + switch(timeEventIndex){ + case 0: obj.resetHitObjectList(); break; + case 1: if(sq_GetZPos(obj) <= 0) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; + case 2: + local sizeRate = obj.getVar("custom").get_vector(0); + local sizeRate2 = obj.getVar("custom").get_vector(1); + local damageRate = obj.getVar("custom").get_vector(2); + local totalDamage = obj.getVar("custom").get_vector(3); + local sub = obj.getVar("custom").get_vector(4); + local typesub = obj.getVar("custom").get_vector(5); + cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,-500,0,sq_GetZPos(obj) + 400,obj.getDirection(),ELEMENTALMASTER_SKILL_HALLOWEENBUSTER,typesub,totalDamage,sizeRate,sizeRate2,damageRate,sub,0,0,0,0,0); + break; + case 3: sq_SendDestroyPacketPassiveObject(obj); break; + case 4: obj.setTimeEvent(2,200,obj.getVar("custom").get_vector(6),true); break; + case 5: + local x = sq_GetUniformVelocity(0, 500, timeEventCount, 40); + local moveX = sq_GetDistancePos(obj.getVar("move").getInt(10), obj.getDirection(), x); + local moveZ = sq_GetUniformVelocity(obj.getVar("move").getInt(11), 0, timeEventCount, 40); + sq_setCurrentAxisPos(obj, 0, moveX); + sq_setCurrentAxisPos(obj, 2, moveZ); + if(timeEventCount >= 40) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case ELEMENTALMASTER_SKILL_MIGHTYRUNE://聖靈符文 + break; + case ELEMENTALMASTER_SKILL_SESTOELEMENTO://第六元素 + if(timeEventIndex == 1) obj.resetHitObjectList(); + break; + case ELEMENTALMASTER_SKILL_SUNBURST://雷旋 + switch(timeEventIndex){ + case 1: + sqrChr.sq_IntVectClear(); + sqrChr.sq_IntVectPush(21); + sqrChr.sq_IntVectPush(31); + sqrChr.sq_IntVectPush(3); + sqrChr.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_ELEMENTALCHAIN, STATE_PRIORITY_IGNORE_FORCE, true); + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case ELEMENTALMASTER_SKILL_THEGATE://元素之門 + switch(timeEventIndex){ + case 1: + local create_number = obj.getVar("custom").get_vector(1); + local totalDamage = obj.getVar("custom").get_vector(0); + local sub = obj.getVar("custom").get_vector(3); + cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj) - 20,obj.getDirection(),ELEMENTALMASTER_SKILL_THEGATE,2,totalDamage,sub,0,0,0,0,0,0,0,0); + if(timeEventCount >= create_number){ + obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + return; + } + break; + case 2: + local targetObj = obj.getVar("tar").get_obj_vector(0); + if(targetObj) sq_SendHitObjectPacket(obj,targetObj,0,0,33); + break; + } + break; + case ELEMENTALMASTER_SKILL_THUNDERCALLING://天雷 + switch(timeEventIndex){ + case 0: break; + case 1: sq_SetMyShake(obj,2,100); break; + case 2: + local totalDamage = obj.getVar("custom").get_vector(0); + local sizeRate = obj.getVar("custom").get_vector(1); + local range = obj.getVar("custom").get_vector(3); + local sub = obj.getVar("custom").get_vector(4); + local prob = obj.getVar("custom").get_vector(6); + local level = obj.getVar("custom").get_vector(7); + local time = obj.getVar("custom").get_vector(8); + cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj),obj.getDirection(),ELEMENTALMASTER_SKILL_THUNDERCALLING,sub,totalDamage,sizeRate,range,prob,level,time,0,0,0,0); + if(obj.getVar().getBool(0) == false && sub == 2){ + if(range <= 0) return; + monsterpulled_elementalmaster_bykk(sqrChr,obj,0,0,0,200,range); + } + break; + case 3: sq_SendDestroyPacketPassiveObject(obj); break; + case 4: + local hitTime = obj.getVar("custom").get_vector(5); + local countMax = obj.getVar("custom").get_vector(2); + obj.setTimeEvent(2,hitTime,countMax,true); + break; + } + break; + case ELEMENTALMASTER_SKILL_THUNDERRAGE://光與暗的交響 + if(timeEventIndex == 1) obj.resetHitObjectList(); + break; + case ELEMENTALMASTER_SKILL_VOID://虛無之球 + switch(subtype){ + case 1: + switch(timeEventIndex){ + case 0: obj.resetHitObjectList(); break; + case 1: + local shoot_range = obj.getVar("custom").get_vector(0); + local baseX = obj.getVar("custom").get_vector(1); + if(sq_Abs(sq_GetXPos(obj) - baseX) > shoot_range){ + obj.stopTimeEvent(0); + sq_SendDestroyPacketPassiveObject(obj); + } + break; + } + break; + case 2: + if(timeEventIndex == 0) obj.resetHitObjectList(); + else if(timeEventIndex == 1) obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case ELEMENTALMASTER_SKILL_WALLOFICE://冰牆 + break; + case 38://移動施法 + if(timeEventIndex == 0) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + +} + +function onAttack_po_elementalmaster_bykk_kak(obj, damager, boundingBox, isStuck) +{ + if(!obj) return; + //enableClearDeadEnemies(obj, damager); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").get_vector(0); + local subtype = obj.getVar("subtype").get_vector(0); + local state = obj.getVar("state").get_vector(0); + + switch(skillIndex){ + case ELEMENTALMASTER_SKILL_ARCTICPISTE://極冰綻放 + if(damager.isObjectType(OBJECTTYPE_ACTIVE) && damager.getState() != STATE_DIE){ + local activeObj = sq_GetCNRDObjectToActiveObject(damager); + local minus_Rate = obj.getVar("custom").get_vector(4); + if(!sq_IsFixture(activeObj) && activeObj.getVar().getInt(100) < 1){ + activeObj.getVar().setInt(100,100); + local ap = sq_CreateChangeStatus(CHANGE_STATUS_TYPE_MOVE_SPEED, true, -minus_Rate.tofloat(), 0); + if(ap){ + ap.getAppendageInfo().setValidTime(3000); + ap.sq_Append(activeObj, obj); + } + } + } + break; + case ELEMENTALMASTER_SKILL_BLACKHOLE://黑洞 + break; + case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND://聖靈水晶 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN://元素點燃 + switch(subtype){ + case 15: + switch(state){ + case 21: + local totalDamage = obj.getVar("custom").get_vector(4); + local powerDamage = obj.getVar("custom").get_vector(5); + local sizeRate = obj.getVar("custom").get_vector(1); + cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj),obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALCHAIN,150,totalDamage,powerDamage,sizeRate,0,0,0,0,0,0,0); + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 16: + obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 17: + local speed_time = obj.getVar("custom").get_vector(8); + local movespeed_rate = obj.getVar("custom").get_vector(9); + local attackspeed_rate = obj.getVar("custom").get_vector(10); + local ap = sq_CreateChangeStatus(CHANGE_STATUS_TYPE_MOVE_SPEED, true, -(movespeed_rate * 0.1).tofloat(), speed_time); + local ap2 = sq_CreateChangeStatus(CHANGE_STATUS_TYPE_ATTACK_SPEED, true, -(attackspeed_rate * 0.1).tofloat(), speed_time); + if(ap && damager.getVar().getBool(0) == false) {damager.getVar().setBool(0,true);ap.sq_Append(damager, obj);} + if(ap2 && damager.getVar().getBool(1) == false) {damager.getVar().setBool(1,true);ap2.sq_Append(damager, obj);} + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN://元素之幕 + if(damager.isObjectType(OBJECTTYPE_ACTIVE)){ + damager = sq_GetCNRDObjectToActiveObject(damager); + if(damager.getState() == STATE_DIE) return; + switch(subtype){ + case 1: + sq_AddDrawOnlyAniFromParent(damager,"passiveobject/elementalmaster_bykk/animation/elementalcurtain/elementalcurtain_hit.ani",0,0,sq_GetCenterZPos(boundingBox)); + if(damager.getVar("elementalcurtain").getBool(0) == false && obj.getVar("custom").get_vector(4) > 0){ + damager.getVar("elementalcurtain").setBool(0, true); + obj.getVar("targetObj").push_obj_vector(damager); + local totalDamage = obj.getVar("custom").get_vector(3) * 45 / 100; + cearteSkillPassive_Elementalmaster_bykk(sqrChr,damager,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj) + 380,obj.getDirection(),ELEMENTALMASTER_SKILL_THEGATE,1,totalDamage,20,100,sq_getRandom(1,4),sq_GetGroup(damager),sq_GetUniqueId(damager),0,0,0,0); + } + if(damager.isObjectType(OBJECTTYPE_ACTIVE) && !CNSquirrelAppendage.sq_IsAppendAppendage(damager, "character/mage/elementalmaster_bykk/ap/ap_elementalcurtain.nut")){ + obj.getVar("target").push_obj_vector(damager); + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(damager, obj, -1, false, "character/mage/elementalmaster_bykk/ap/ap_elementalcurtain.nut", true); + sq_HoldAndDelayDie(damager, obj, true, false, false, 200, 200, ENUM_DIRECTION_NEUTRAL , AddAppendage); + } + break; + case 2: + sq_AddDrawOnlyAniFromParent(damager,"passiveobject/elementalmaster_bykk/animation/elementalcurtain/elementalcurtain_finishhit.ani",0,0,sq_GetCenterZPos(boundingBox)); + break; + } + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL://元素奧義 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE://元素震蕩 + if(damager.isObjectType(OBJECTTYPE_ACTIVE)){ + if(!CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/elementalmaster_bykk/skillnut/ap_elementalquake.nut")){ + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(damager, obj, -1, false, "character/mage/elementalmaster_bykk/skillnut/ap_elementalquake.nut", true); + sq_HoldAndDelayDie(damager, obj, true, true, true, 200, 200, ENUM_DIRECTION_NEUTRAL , AddAppendage); + } + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER://隕星幻滅 + break; + case ELEMENTALMASTER_SKILL_FLAMESTRIKE://烈焰沖擊 + switch(subtype){ + case 2: + if(damager.isObjectType(OBJECTTYPE_ACTIVE)){ + damager = sq_GetCNRDObjectToActiveObject(damager); + if(CNSquirrelAppendage.sq_IsAppendAppendage(damager, "character/mage/elementalmaster_bykk/ap/ap_flamestrike.nut")) CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_flamestrike.nut"); + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(damager, obj, -1, false, "character/mage/elementalmaster_bykk/ap/ap_flamestrike.nut", true); + local time = 600 + obj.getVar("custom").get_vector(2); + AddAppendage.sq_SetValidTime(time); + sq_HoldAndDelayDie(damager, obj, true, true, true, 50, 300, ENUM_DIRECTION_NEUTRAL , AddAppendage); + local sizeRate = obj.getVar("custom").get_vector(0); + local totalDamage = obj.getVar("custom").get_vector(1); + local group = sq_GetGroup(damager); + local uniqueId = sq_GetUniqueId(damager); + cearteSkillPassive_Elementalmaster_bykk(sqrChr,damager,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj),ENUM_DIRECTION_RIGHT,ELEMENTALMASTER_SKILL_FLAMESTRIKE,3,totalDamage,sizeRate,group,uniqueId,0,0,0,0,0,0); + } + break; + } + break; + case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER://傑克降臨 + break; + case ELEMENTALMASTER_SKILL_MIGHTYRUNE://聖靈符文 + break; + case ELEMENTALMASTER_SKILL_SESTOELEMENTO://第六元素 + break; + case ELEMENTALMASTER_SKILL_SUNBURST://雷旋 + break; + case ELEMENTALMASTER_SKILL_THEGATE://元素之門 + switch(subtype){ + case 2: + local sub = obj.getVar("custom").get_vector(1); + local aniPath2 = "light"; + switch(sub){ + case 2: aniPath2 = "ice"; break; + case 3: aniPath2 = "fire"; break; + case 4: aniPath2 = "dark"; break; + } + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/thegate/"+aniPath2+"/"+aniPath2+"_shock.ani",0,0,0); + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case ELEMENTALMASTER_SKILL_THUNDERCALLING://天雷 + break; + case ELEMENTALMASTER_SKILL_THUNDERRAGE://光與暗的交響 + break; + case ELEMENTALMASTER_SKILL_VOID://虛無之球 + break; + case ELEMENTALMASTER_SKILL_WALLOFICE://冰牆 + break; + case 38://移動施法 + break; + } + +} + +function onKeyFrameFlag_po_elementalmaster_bykk_kak(obj, flagIndex) +{ + if(!obj) return; + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").get_vector(0); + local subtype = obj.getVar("subtype").get_vector(0); + local state = obj.getVar("state").get_vector(0); + + switch(skillIndex){ + case ELEMENTALMASTER_SKILL_ARCTICPISTE://極冰綻放 + if(flagIndex == 1){ + local sizeRate = obj.getVar("custom").getInt(10); + sizeRate = sizeRate.tofloat() / 100.0; + local pooledObj = sq_AddDrawOnlyAniFromParent(obj, "passiveobject/elementalmaster_bykk/animation/icefield/new/icefielddisappear1.ani", 0, 0, 0); + local pAni = pooledObj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + } + break; + case ELEMENTALMASTER_SKILL_BLACKHOLE://黑洞 + break; + case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND://聖靈水晶 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN://元素點燃 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN://元素之幕 + switch(flagIndex){ + case 1: sq_SetMyShake(obj,8,200); break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL://元素奧義 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE://元素震蕩 + switch(flagIndex){ + case 1: + sq_flashScreen(obj,0, 50, 150, 51, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + sq_SetMyShake(obj,6,360); + break; + case 2: + obj.resetHitObjectList(); + break; + case 3: + sq_flashScreen(obj,0, 50, 200, 76, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + sq_SetMyShake(obj,7,360); + break; + case 4: + sq_flashScreen(obj,0, 300, 300, 102, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + sq_SetMyShake(obj,8,500); + break; + case 5: + local totalDamage = obj.getVar("custom").get_vector(0); + local damageRate = obj.getVar("custom").get_vector(1); + totalDamage = totalDamage * damageRate / 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 12)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + if(obj.getVar("custom").get_vector(3) < 1){ + if(sqrChr){ + sqrChr.sq_IntVectClear(); + sqrChr.sq_IntVectPush(3); + sqrChr.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, STATE_PRIORITY_USER, true); + } + } + break; + case 6: + sq_flashScreen(obj,0, 60, 500, 127, sq_RGB(255,255,255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + sq_SetMyShake(obj,10,500); + break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER://隕星幻滅 + break; + case ELEMENTALMASTER_SKILL_FLAMESTRIKE://烈焰沖擊 + break; + case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER://傑克降臨 + break; + case ELEMENTALMASTER_SKILL_MIGHTYRUNE://聖靈符文 + break; + case ELEMENTALMASTER_SKILL_SESTOELEMENTO://第六元素 + break; + case ELEMENTALMASTER_SKILL_SUNBURST://雷旋 + break; + case ELEMENTALMASTER_SKILL_THEGATE://元素之門 + switch(flagIndex){ + case 25: + local totalDamage = obj.getVar("custom").getInt(0); + local sub = obj.getVar("custom").getInt(1); + local group = obj.getVar("custom").getInt(2); + local uniqueId = obj.getVar("custom").getInt(3); + local targetObj = sq_GetObject(obj, group, uniqueId); + if(targetObj && targetObj.getState() != STATE_DIE){ + cearteSkillPassive_Elementalmaster_bykk(obj,targetObj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,0,obj.getDirection(),ELEMENTALMASTER_SKILL_THEGATE,11,totalDamage,sub,group,uniqueId,0,0,0,0,0,0); + } + break; + } + break; + case ELEMENTALMASTER_SKILL_THUNDERCALLING://天雷 + break; + case ELEMENTALMASTER_SKILL_THUNDERRAGE://光與暗的交響 + break; + case ELEMENTALMASTER_SKILL_VOID://虛無之球 + if(subtype == 1 && flagIndex == 1){ + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(3,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/void/void4.ani"),true); + } + if(subtype == 2 && flagIndex == 1){ + local hitTime = obj.getVar("custom").get_vector(0); + print("hittime = "+hitTime); + obj.setTimeEvent(0,hitTime,-1,false); + } + break; + case ELEMENTALMASTER_SKILL_WALLOFICE://冰牆 + break; + case 38://移動施法 + break; + } + +} + +function procAppend_po_elementalmaster_bykk_kak(obj) +{ + if(!obj) return; + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").get_vector(0); + local subtype = obj.getVar("subtype").get_vector(0); + local state = obj.getVar("state").get_vector(0); + + switch(skillIndex){ + case ELEMENTALMASTER_SKILL_ARCTICPISTE://極冰綻放 + break; + case ELEMENTALMASTER_SKILL_BLACKHOLE://黑洞 + break; + case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND://聖靈水晶 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN://元素點燃 + switch(subtype){ + case 1: + case 2: + case 3: + case 4: + if(!sqrChr || sqrChr.getState() == STATE_DIE){sq_SendDestroyPacketPassiveObject(obj); break;} + switch(state){ + case 28: + case 29: + local currentT = sq_GetObjectTime(obj); + local currentSpeedRate = 1.0 ; + local defaultRoundTime = 5120; + + local radius = 50; + local base100Angle = 0; + switch(subtype){ + case 1: base100Angle = 4500; break; + case 2: base100Angle = 13500; break; + case 3: base100Angle = 22500; break; + case 4: base100Angle = 31500; break; + } + local baseX = sqrChr.getXPos(); + local baseY = sqrChr.getYPos(); + local current100Angle = (base100Angle + (36000 * currentSpeedRate * currentT / defaultRoundTime)) % 36000; + local angle = (current100Angle.tofloat() / 100.0); + + local disMovLen = radius * sq_CosTable(angle.tointeger()); + local mov_x = sq_GetDistancePos(baseX, ENUM_DIRECTION_LEFT, disMovLen.tointeger()); + + local axisMagnifyRate = 50 * 0.5; + local upMovLen = radius * sq_SinTable(angle.tointeger()) * axisMagnifyRate / 100; + + local mov_y = baseY + upMovLen.tointeger(); + local mov_z = sq_GetZPos(sqrChr) + 35; + local offset_z = 13; + if(subtype == 2 || subtype == 4) offset_z = -13; + if(currentT % defaultRoundTime <= 1280 && currentT % defaultRoundTime > 0) mov_z = mov_z + sq_GetUniformVelocity(0, offset_z, currentT % defaultRoundTime, 1280); + else if(currentT % defaultRoundTime <= 2560 && currentT % defaultRoundTime > 1280) mov_z = mov_z + sq_GetUniformVelocity(offset_z, 0, currentT % defaultRoundTime - 1280, 1280); + else if(currentT % defaultRoundTime <= 3840 && currentT % defaultRoundTime > 2560) mov_z = mov_z + sq_GetUniformVelocity(0, -offset_z, currentT % defaultRoundTime - 2560, 1280); + else if(currentT % defaultRoundTime <= 5120 && currentT % defaultRoundTime > 3840) mov_z = mov_z + sq_GetUniformVelocity(-offset_z, 0, currentT % defaultRoundTime - 3840, 1280); + + sq_setCurrentAxisPos(obj, 0, mov_x); + sq_setCurrentAxisPos(obj, 1, mov_y); + sq_setCurrentAxisPos(obj, 2, mov_z);//sqrChr.getZPos() + 30); + break; + } + break; + case 15: + switch(state){ + case 21: + local pAni = obj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + local fireT = 800; + local srcX = obj.getVar("custom").get_vector(3); + local MoveX = obj.getVar("custom").get_vector(2) * 4 / 10; + local v = sq_GetUniformVelocity(0, MoveX, currentT, fireT); + local dstX = sq_GetDistancePos(srcX, obj.getDirection(), v); + sq_setCurrentAxisPos(obj, 0, dstX); + if(currentT > fireT) sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 16: + switch(state){ + case 20: + local pAni = obj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + local fireT = 500; + local srcX = obj.getVar("custom").get_vector(1); + local srcY = obj.getVar("custom").get_vector(2); + local srcZ = obj.getVar("custom").get_vector(3); + local MoveX = obj.getVar("custom").get_vector(4); + local MoveY = obj.getVar("custom").get_vector(5); + local MoveZ = obj.getVar("custom").get_vector(6); + if(MoveY != 0){ + if(MoveY > 8) MoveY = 8; + else if(MoveY < -8) MoveY = -8; + local vy = sq_GetUniformVelocity(0, MoveY, currentT, fireT); + sq_setCurrentAxisPos(obj, 1, srcY + vy); + } + local vx = sq_GetUniformVelocity(0, MoveX, currentT, fireT); + local dstX = sq_GetDistancePos(srcX, obj.getDirection(), vx);//根據方向運算當前數值 + sq_setCurrentAxisPos(obj, 0, dstX);//設置當前x坐標 + local vz = 0; + if(MoveZ > 0){ + vz = sq_GetAccel(0, MoveZ, currentT, fireT, true); + if(currentT > 250) vz = sq_GetAccel(MoveZ, 0, currentT, fireT, false); + } + else{ + vz = sq_GetAccel(sq_GetZPos(obj), 0, currentT, fireT, false); + currentT = currentT + 250; + } + sq_setCurrentAxisPos(obj, 2, vz);//設置當前x坐標 + if(currentT >= fireT) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case 17: + local currentT = sq_GetObjectTime(obj); + local currentSpeedRate = 1.0 ; + local defaultRoundTime = 1200; + + local radius = 65; + local base100Angle = obj.getVar("custom").get_vector(0) * 100; + + local baseX = obj.getVar("custom").get_vector(1); + local baseY = obj.getVar("custom").get_vector(2); + local current100Angle = (base100Angle + (36000 * currentSpeedRate * currentT / defaultRoundTime)) % 36000; + local angle = (current100Angle.tofloat() / 100.0); + + local disMovLen = radius * sq_CosTable(angle.tointeger()); + local mov_x = sq_GetDistancePos(baseX, ENUM_DIRECTION_LEFT, disMovLen.tointeger()); + + local axisMagnifyRate = radius * 0.5; + local upMovLen = radius * sq_SinTable(angle.tointeger()) * axisMagnifyRate / 100; + + local mov_y = baseY + upMovLen.tointeger(); + + sq_setCurrentAxisPos(obj, 0, mov_x); + sq_setCurrentAxisPos(obj, 1, mov_y); + break; + case 18: + switch(state){ + case 21: + local pAni = obj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + local fireT = 300; + local speed_rate = obj.getVar("custom").get_vector(1); + if(speed_rate > 0) fireT = fireT * (1000 - speed_rate) / 1000; + local srcX = obj.getVar("custom").get_vector(3); + local srcZ = obj.getVar("custom").get_vector(4); + local MoveX = obj.getVar("custom").get_vector(2); + local v = sq_GetUniformVelocity(0, MoveX, currentT, fireT); + local vz = sq_GetUniformVelocity(srcZ, 0, currentT, fireT); + local dstX = sq_GetDistancePos(srcX, obj.getDirection(), v); + sq_setCurrentAxisPos(obj, 0, dstX); + sq_setCurrentAxisPos(obj, 2, vz); + if(currentT > fireT) obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 23: + if(!sqrChr) sq_SendDestroyPacketPassiveObject(obj); + local pAni = obj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + local fireT = 400; + local speed_rate = obj.getVar("custom").get_vector(1); + if(speed_rate > 0) fireT = fireT * (1000 - speed_rate) / 1000; + if(sq_GetDistanceObject(obj, sqrChr, false) < 20){ + obj.addSetStatePacket(24, null, STATE_PRIORITY_AUTO, false, ""); + } + local srcZ = obj.getVar("custom").get_vector(4); + local X1 = sq_GetAccel(obj.getXPos(), sqrChr.getXPos(), currentT, fireT, true); + local Y1 = sq_GetAccel(obj.getYPos(), sqrChr.getYPos(), currentT, fireT, true); + local vz = sq_GetAccel(0, srcZ * 2, currentT, fireT, true); + sq_setCurrentAxisPos(obj, 0, X1); + sq_setCurrentAxisPos(obj, 1, Y1); + sq_setCurrentAxisPos(obj, 2, vz); + break; + } + break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN://元素之幕 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL://元素奧義 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE://元素震蕩 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER://隕星幻滅 + break; + case ELEMENTALMASTER_SKILL_FLAMESTRIKE://烈焰沖擊 + break; + case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER://傑克降臨 + break; + case ELEMENTALMASTER_SKILL_MIGHTYRUNE://聖靈符文 + break; + case ELEMENTALMASTER_SKILL_SESTOELEMENTO://第六元素 + break; + case ELEMENTALMASTER_SKILL_SUNBURST://雷旋 + break; + case ELEMENTALMASTER_SKILL_THEGATE://元素之門 + switch(subtype){ + case 1: + switch(state){ + case 20: + case 21: + local targetObj = obj.getVar().get_obj_vector(0); + if(!targetObj || targetObj.getState() == STATE_DIE) obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case 2: + local pAni = obj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + local fireT = pAni.getDelaySum(false); + local srcZ = obj.getVar("custom").get_vector(0); + local v = sq_GetUniformVelocity(srcZ, 0, currentT, fireT); + sq_setCurrentAxisPos(obj, 2, v); + break; + } + break; + case ELEMENTALMASTER_SKILL_THUNDERCALLING://天雷 + break; + case ELEMENTALMASTER_SKILL_THUNDERRAGE://光與暗的交響 + break; + case ELEMENTALMASTER_SKILL_VOID://虛無之球 + break; + case ELEMENTALMASTER_SKILL_WALLOFICE://冰牆 + break; + case 38://移動施法 + break; + } +} + +function proc_appendage_elementalquake_bykk(appendage) +{ + local sourceObj = appendage.getSource(); + if(!sourceObj){ + appendage.setValid(false); + return; + } +} + +function checkExecutableSkill_Arcticpiste_bykk(obj) +{ + // print("test Arcticpiste"); + return 1; +} + +function onSetState_Arcticpiste_bykk(obj, state, datas, isResetTimer) +{ +} + +function onEndCurrentAni_Arcticpiste_bykk(obj) +{ +} + +function onProcCon_Arcticpiste_bykk(obj) +{ +} + +function onKeyFrameFlag_Arcticpiste_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_Arcticpiste_bykk(obj, timeEventIndex, timeEventCount) +{ +} + +function onEndState_Arcticpiste_bykk(obj, new_state) +{ +} + +function checkExecutableSkill_BlackHole_bykk(obj) +{ + // print("test BlackHole"); + return 1; +} + +function onSetState_BlackHole_bykk(obj, state, datas, isResetTimer) +{ +} + +function onEndCurrentAni_BlackHole_bykk(obj) +{ +} + +function onProcCon_BlackHole_bykk(obj) +{ +} + +function onKeyFrameFlag_BlackHole_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_BlackHole_bykk(obj, timeEventIndex, timeEventCount) +{ +} + +function onEndState_BlackHole_bykk(obj, new_state) +{ +} + +function checkExecutableSkill_Crystalofovermind_bykk(obj) +{ + // print("test Crystalofovermind"); + local istalisman = obj.getVar("crystal_talisman").getInt(0); + if(istalisman > 0){ + local crystalObj = obj.getVar("crystal").get_obj_vector(0); + if(crystalObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(crystalObj); + local state = colObj.getState(); + if(state <= 23){ + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND); + local totalDamage = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND, 0, skill_level); + switch(state){ + case 20: totalDamage = totalDamage * 80 / 100; break; + case 21: totalDamage = totalDamage * 90 / 100; break; + case 22: totalDamage = totalDamage * 100 / 100; break; + case 23: totalDamage = totalDamage * 125 / 100; break; + } + colObj.getVar("custom").setInt(2,totalDamage); + colObj.addSetStatePacket(24, null, STATE_PRIORITY_AUTO, false, ""); + obj.getVar("crystal_talisman").setInt(0,0); + } + } + } + local b_useskill = obj.sq_IsUseSkill(ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND); + if(b_useskill){ + obj.sq_IsEnterSkillLastKeyUnits(ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND, STATE_PRIORITY_USER, true); + return 1; + } + return 0; +} + +function onSetState_Crystalofovermind_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + local Ani = obj.sq_GetThrowChargeAni(1); + obj.setCurrentAnimation(Ani); + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND); + local castTime = sq_GetCastTime(obj, ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND, skill_level); + if(castTime > 1000){local pAni = obj.getCurrentAnimation();sq_SetFrameDelayTime(pAni, 1, castTime);} + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + local pAni = obj.getCurrentAnimation(); + local delaySum = pAni.getDelaySum(false); + sq_StartDrawCastGauge(obj, delaySum, true); + obj.getVar("crystal").setInt(1,delaySum); + //音效 + if(sq_getRandom(1,100) > 50) obj.sq_PlaySound("WZ_CRYSTALOVERMIND_01_1"); + else obj.sq_PlaySound("WZ_CRYSTALOVERMIND_01_2"); + //设置效果 + sq_SetBodyEffect(obj, obj, true, sq_RGB(255, 255, 255), 100, 200, 999000, sq_ALPHA(100)); + //蓄气时钟开启 + obj.getVar("Crystalofovermind").clear_ct_vector(); + obj.getVar("Crystalofovermind").push_ct_vector(); + local timer = obj.getVar("Crystalofovermind").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); + //获取蓄气上限 + local energycharge_Max = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND, 3); + local minus_Rate = 0,minus_Rate2 = 0,minus_Rate3 = 0; + local memorize_level = sq_GetSkillLevel(obj, 19); + if(memorize_level > 0){ + minus_Rate = sq_GetLevelData(obj, 19, 1, memorize_level); + } + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut")){ + local magicaltempoup_level = sq_GetSkillLevel(obj, 2); + minus_Rate3 = sq_GetLevelData(obj, 2, 3, magicaltempoup_level); + } + local minus_Rate4 = 1000 - minus_Rate - minus_Rate3; + local fullcharge = 0; + if(minus_Rate4 > 0) energycharge_Max = energycharge_Max * minus_Rate4 / 1000; + else fullcharge = 1; + obj.getVar("moveoncast").setInt(2,energycharge_Max); + + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,80,obj.getDirection(),38,1,energycharge_Max,4,fullcharge,0,0,0,0,0,0,0); + break; + case 1: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_ELEMENTALQUAKE_CASTINGLOOPA_BODY); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/crystalofovermind_summon_body_front.ani",0,0,0); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/crystalofovermind_side_front_start01.ani",250,0,0); + obj.stopSound(18); + //设置效果 + sq_SetBodyEffect(obj, obj, true, sq_RGB(255, 255, 255), 100, 100, 0, sq_ALPHA(100)); + //声音 + if(sq_getRandom(1,100) > 50) obj.sq_PlaySound("WZ_CRYSTALOVERMIND_02_1"); + else obj.sq_PlaySound("WZ_CRYSTALOVERMIND_02_2"); + + local charge_obj = obj.getVar("moveoncast").get_obj_vector(0); + if(charge_obj) charge_obj.setValid(false); + + local timer = obj.getVar("Crystalofovermind").get_ct_vector(0); + local currentT = 0; + if(timer) currentT = timer.Get(); + local energycharge_Max = obj.getVar("moveoncast").getInt(2); + + local xiuzheng = 1; + if(currentT > energycharge_Max) xiuzheng = 0; + + sq_BinaryStartWrite(); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(1); + sq_SendChangeSkillEffectPacket(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN); + + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND); + local totalDamage = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND, 0, skill_level); + local sizeRate = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND, 3 - xiuzheng); + local istalisman = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND, 9); + + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,300,0,0,obj.getDirection(),ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND,1,totalDamage,sizeRate,istalisman,0,0,0,0,0,1,0); + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,300,0,0,obj.getDirection(),ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND,2,sizeRate,0,0,0,0,0,0,0,0,0); + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,300,0,0,obj.getDirection(),ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND,3,sizeRate,0,0,0,0,0,0,0,0,0); + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,300,0,0,obj.getDirection(),ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND,4,sizeRate,0,0,0,0,0,0,0,0,0); + obj.getVar("crystal_talisman").setInt(0,istalisman); + elementalmaster_setelementSkillBonusRate(obj, ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND); + break; + } +} + +function onEndCurrentAni_Crystalofovermind_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 1: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_Crystalofovermind_bykk(obj) +{ + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + local stateTime = obj.sq_GetStateTimer(); + if(stateTime < obj.getVar("crystal").getInt(1)) return; + local bDownKey = obj.isDownSkillLastKey(); + if(!bDownKey){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND, STATE_PRIORITY_USER, true); + } + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_UP, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_DOWN, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_LEFT, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_RIGHT, ENUM_SUBKEY_TYPE_ALL)){ + //移动施法技能大于0时,获取人物身上移动施法AP,push技能子状态及技能编号等 + if(sq_GetSkillLevel(obj, 38) > 0){ + local mocAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_moveoncast.nut"); + if(mocAppendage){ + mocAppendage.getVar().setInt(1, ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND); + mocAppendage.getVar().setBool(0, true); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + } + } + } + break; + } +} + +function onKeyFrameFlag_Crystalofovermind_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_Crystalofovermind_bykk(obj, timeEventIndex, timeEventCount) +{ +} + +function onEndState_Crystalofovermind_bykk(obj, new_state) +{ + if(!obj) return; + if(new_state != ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN){ + sq_EndDrawCastGauge(obj); + } + if(new_state == STATE_DIE || new_state == STATE_DAMAGE || new_state == STATE_DOWN || new_state == STATE_HOLD){ + if(sq_GetSkillLevel(obj, 38) > 0){ + local mocAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_moveoncast.nut"); + if(mocAppendage) mocAppendage.getVar().setBool(0, false); + } + } +} + +function checkExecutableSkill_ElementalChain_bykk(obj) +{ + return 0; +} + +function onSetState_ElementalChain_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + local Ani = obj.sq_GetThrowChargeAni(3); + obj.setCurrentAnimation(Ani); + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN); + local castTime = sq_GetCastTime(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, skill_level); + if(castTime > 800){local pAni = obj.getCurrentAnimation();sq_SetFrameDelayTime(pAni, 1, castTime);} + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + local pAni = obj.getCurrentAnimation(); + local delaySum = pAni.getDelaySum(false); + sq_StartDrawCastGauge(obj, castTime, true); + break; + case 1: + local Ani = obj.sq_GetThrowShootAni(3); + obj.setCurrentAnimation(Ani); + createOnlyDrawObject_elementalmaster_bykk(obj,"character/mage/effect/animation/elementalmaster_bykk/elementalchain/start.ani",true,obj.getDirection(),sq_GetXPos(obj),sq_GetYPos(obj),sq_GetZPos(obj) + 40,ENUM_DRAWLAYER_NORMAL); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut")) + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut"); + local addAppendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, false, "character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut", true); + break; + case 10: + case 20: + case 30: + case 40: + local skillIndex = obj.sq_GetVectorData(datas, 1); + local sub = obj.sq_GetVectorData(datas, 2); + local Ani = obj.sq_GetThrowChargeAni(sub); + obj.setCurrentAnimation(Ani); + obj.getVar("moveoncast").setInt(0,skillIndex); + obj.getVar("moveoncast").setInt(1,sub); + //移動施法技能大于0時,獲取人物身上移動施法AP,push技能子狀態及技能編號等 + if(sq_GetSkillLevel(obj, 38) > 0){ + obj.sq_IsEnterSkillLastKeyUnits(skillIndex); + local mocAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_moveoncast.nut"); + if(mocAppendage){ + mocAppendage.getVar().setInt(3, obj.sq_GetVectorData(datas, 0)); + mocAppendage.getVar().setInt(1, skillIndex); + mocAppendage.getVar().setInt(2, sub); + mocAppendage.getVar().setBool(0, true); + } + } + if(skillIndex == 31) obj.getVar("sunburst_bool").setBool(0, false); + //蓄氣時鍾開啓 + obj.getVar("ElementalChain").clear_ct_vector(); + obj.getVar("ElementalChain").push_ct_vector(); + local timer = obj.getVar("ElementalChain").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); + //設置效果 + sq_SetBodyEffect(obj, obj, true, sq_RGB(255, 255, 255), 100, 200, 999000, sq_ALPHA(100)); + //獲取蓄氣上限 + local energycharge_Max = 0; + switch(skillIndex){ + case 15: energycharge_Max = sq_GetIntData(obj, skillIndex, 1); break;//傑克爆彈 + case 16: energycharge_Max = sq_GetIntData(obj, skillIndex, 5); break;//冰霜雪人 + case 17: energycharge_Max = sq_GetIntData(obj, skillIndex, 2); break;//光電鳗 + case 18: energycharge_Max = sq_GetIntData(obj, skillIndex, 1); break;//暗影夜貓 + case 26: energycharge_Max = sq_GetIntData(obj, skillIndex, 2); break;//虛無之球 + case 27: energycharge_Max = sq_GetIntData(obj, skillIndex, 2); break;//傑克降臨 + case 31: energycharge_Max = sq_GetIntData(obj, skillIndex, 0); break;//雷旋 + case 58: energycharge_Max = sq_GetIntData(obj, skillIndex, 0); break;//黑洞 + case 59: energycharge_Max = sq_GetIntData(obj, skillIndex, 3); break;//極冰盛宴 + } + local minus_Rate = 0,minus_Rate2 = 0,minus_Rate3 = 0; + local memorize_level = sq_GetSkillLevel(obj, 19); + if(memorize_level > 0){ + minus_Rate = sq_GetLevelData(obj, 19, 1, memorize_level); + minus_Rate2 = sq_GetLevelData(obj, 19, 2, memorize_level); + } + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut")){ + local magicaltempoup_level = sq_GetSkillLevel(obj, 2); + minus_Rate3 = sq_GetLevelData(obj, 2, 3, magicaltempoup_level); + } + local minus_Rate4 = 1000 - minus_Rate - minus_Rate3; + local minus_Rate5 = 1000 - minus_Rate - minus_Rate2 - minus_Rate3; + local fullcharge = 0; + if(minus_Rate5 > 0 && skillIndex <= 20) energycharge_Max = energycharge_Max * minus_Rate5 / 1000; + else if(minus_Rate5 < 0 && skillIndex <= 20){energycharge_Max = 0;fullcharge = 1;} + else if(minus_Rate4 > 0) energycharge_Max = energycharge_Max * minus_Rate4 / 1000; + else fullcharge = 1; + obj.getVar("moveoncast").setInt(2,energycharge_Max); + + if(skillIndex > 20 && sq_GetSkillLevel(obj,ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL) > 0){ + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,80,obj.getDirection(),38,1,energycharge_Max,4,fullcharge,0,0,0,0,0,0,0); + return; + } + + switch(skillIndex){ + case 15: + case 27: + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,80,obj.getDirection(),38,1,energycharge_Max,0,fullcharge,0,0,0,0,0,0,0); + break; + case 16: + case 59: + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,80,obj.getDirection(),38,1,energycharge_Max,1,fullcharge,0,0,0,0,0,0,0); + break; + case 26: + case 18: + case 58: + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,80,obj.getDirection(),38,1,energycharge_Max,2,fullcharge,0,0,0,0,0,0,0); + break; + case 17: + case 31: + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,80,obj.getDirection(),38,1,energycharge_Max,3,fullcharge,0,0,0,0,0,0,0); + if(skillIndex == 31){ + local aniPath = ["character/mage/effect/animation/sunburstcast1.ani","character/mage/effect/animation/sunburstcast2.ani","character/mage/effect/animation/sunburstcast3.ani","character/mage/effect/animation/sunburstfloor1.ani","character/mage/effect/animation/sunburstfloor2.ani"]; + local drawlayer = [ENUM_DRAWLAYER_NORMAL,ENUM_DRAWLAYER_NORMAL,ENUM_DRAWLAYER_NORMAL,ENUM_DRAWLAYER_BOTTOM,ENUM_DRAWLAYER_BOTTOM]; + for(local i = 0; i < aniPath.len(); i++){ + createOnlyDrawObject_elementalmaster_bykk(obj,aniPath[i],true,obj.getDirection(),sq_GetXPos(obj),sq_GetYPos(obj),sq_GetZPos(obj),drawlayer[i]); + } + } + break; + } + break; + case 11: + case 21: + case 31: + case 41: + local skillIndex = obj.sq_GetVectorData(datas, 1); + obj.getVar("skillIndex").setInt(100, skillIndex); + local sub = obj.sq_GetVectorData(datas, 2); + local Ani = obj.sq_GetThrowShootAni(sub); + obj.setCurrentAnimation(Ani); + obj.stopSound(18); + //設置效果 + sq_SetBodyEffect(obj, obj, true, sq_RGB(255, 255, 255), 100, 100, 0, sq_ALPHA(100)); + //聲音 + switch(skillIndex){ + case 26: obj.sq_PlaySound("WZ_VOID"); break; + case 31: obj.sq_PlaySound("WZ_SUNBURST"); break; + case 15: obj.sq_PlaySound("WZ_LANTERN_FIRE"); break; + case 16: obj.sq_PlaySound("WZ_FROSTHEAD"); break; + case 17: obj.sq_PlaySound("WZ_FLUORE"); break; + case 18: obj.sq_PlaySound("WZ_LAUNCH_PLUTO"); break; + case 27: obj.sq_PlaySound("R_WZ_SHOOTING_STAR"); break; + case 58: obj.sq_PlaySound("WZ_NIGHTH_02"); break; + case 59: obj.sq_PlaySound("WZ_MAGIC_MISSILE"); break; + } + local timer = obj.getVar("ElementalChain").get_ct_vector(0); + local currentT = 0; + if(timer) currentT = timer.Get(); + local energycharge_Max = obj.getVar("moveoncast").getInt(2); + obj.getVar("ElementalChain").clear_ct_vector(); + local skill_level = sq_GetSkillLevel(obj, skillIndex); + + local Mightyrune_T = + {//light,ice,fire,dark + [15] = [0,0,1,0], + [16] = [0,1,0,0], + [18] = [0,0,0,1], + [17] = [1,0,0,0], + [26] = [0,0,0,1], + [31] = [1,0,0,0], + [27] = [0,0,1,0], + [59] = [0,1,0,0], + [55] = [1,0,0,0], + [58] = [0,0,0,1] + } + + if(Mightyrune_T.rawin(skillIndex)){ + sq_BinaryStartWrite(); + foreach(elsement in Mightyrune_T[skillIndex]){ + sq_BinaryWriteDword(elsement); + } + sq_SendChangeSkillEffectPacket(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN); + } + + local charge_obj = obj.getVar("moveoncast").get_obj_vector(0); + if(charge_obj) charge_obj.setValid(false); + + local xiuzheng = 1; + if(currentT > energycharge_Max) xiuzheng = 0; + switch(skillIndex){//滿蓄力 + case 15://傑克爆彈 + local totalDamage = sq_GetLevelData(obj, skillIndex, 1 - xiuzheng, skill_level); + local powerDamage = sq_GetLevelData(obj, skillIndex, 9 - xiuzheng, skill_level); + local nurmal_rate = sq_GetLevelData(obj, skillIndex, 5 - xiuzheng, skill_level) * 130 /100; + local exp_rate = sq_GetLevelData(obj, skillIndex, 7 - xiuzheng, skill_level) * 130 /100; + local shoot_range = sq_GetLevelData(obj, skillIndex, 3 - xiuzheng, skill_level); + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,75,0,50,obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALCHAIN,15,totalDamage,powerDamage,nurmal_rate,exp_rate,shoot_range,0,0,0,1,2); + break; + case 16://冰霜雪人 + local totalDamage = sq_GetLevelData(obj, skillIndex, 1 - xiuzheng, skill_level); + local powerDamage = sq_GetLevelData(obj, skillIndex, 15 - xiuzheng, skill_level); + local nurmal_rate = sq_GetLevelData(obj, skillIndex, 6 - xiuzheng, skill_level) * 150 /100; + local lifeTime = sq_GetLevelData(obj, skillIndex, 3 - xiuzheng, skill_level); + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,50,0,80,obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALCHAIN,16,totalDamage,powerDamage,nurmal_rate,lifeTime,0,0,0,0,1,2); + local size = sq_GetLevelData(obj, skillIndex, 20, skill_level); + if(size > 0){ + for(local i = 0; i < size; i++){ + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,50,0,80 + 10 * (i + 1),obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALCHAIN,16,totalDamage,powerDamage,nurmal_rate,lifeTime,0,0,0,0,1,2); + } + } + break; + case 17://光電鳗 + local number = sq_GetIntData(obj, skillIndex, 1); + local totalDamage = sq_GetLevelData(obj, skillIndex, 1 - xiuzheng, skill_level); + local powerDamage = sq_GetLevelData(obj, skillIndex, 7 - xiuzheng, skill_level); + local nurmal_rate = sq_GetLevelData(obj, skillIndex, 5 - xiuzheng, skill_level) * 150 /100; + local lifeTime = sq_GetLevelData(obj, skillIndex, 3 - xiuzheng, skill_level); + for(local i = 0; i < number; i++){ + local angle = 360 / number * i; + local x = (sq_Cos(sq_ToRadian(angle.tofloat())) * 65.0).tointeger(); + local y = (sq_Sin(sq_ToRadian(angle.tofloat())) * 65.0).tointeger(); + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,x,y,40,obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALCHAIN,17,totalDamage,powerDamage,nurmal_rate,lifeTime,angle,sq_GetXPos(obj),sq_GetYPos(obj),0,1,2); + } + break; + case 18://暗影夜貓 + local totalDamage = sq_GetLevelData(obj, skillIndex, 1 - xiuzheng, skill_level); + local powerDamage = sq_GetLevelData(obj, skillIndex, 9 - xiuzheng, skill_level); + local sizeRate = sq_GetLevelData(obj, skillIndex, 7 - xiuzheng, skill_level) * 130 /100; + local speed_rate = sq_GetLevelData(obj, skillIndex, 3 - xiuzheng, skill_level); + local shoot_range = sq_GetLevelData(obj, skillIndex, 5 - xiuzheng, skill_level); + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,75,0,50,obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALCHAIN,18,totalDamage,powerDamage,sizeRate,speed_rate,shoot_range,0,0,0,1,2); + break; + case 26://虛無之球 + local totalDamage = sq_GetLevelData(obj, skillIndex, 1 - xiuzheng, skill_level); + local sizeRate = sq_GetIntData(obj, skillIndex, 7 - xiuzheng) * 230 / 100; + if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_VOIDEX) > 0){ + local prob = 100 - sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_VOIDEX) * 8 - sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_VOID, 9, sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_VOID)); + if(sq_getRandom(1, 100) > prob) sizeRate = sizeRate * 250 / 100; + } + local shoot_range = sq_GetLevelData(obj, skillIndex, 3 - xiuzheng, skill_level) / 20; + local hittime = sq_GetIntData(obj, skillIndex, 1); + if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ASSIMILATE) > 0){ + hittime = hittime / 2; + local timeMax = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ASSIMILATE, 2); + local damageRate = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ASSIMILATE, 4); + local damageRate2 = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ASSIMILATE, 5); + local isExp = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ASSIMILATE, 16); + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,120,0,60,obj.getDirection(),ELEMENTALMASTER_SKILL_VOID,2,totalDamage,hittime,timeMax,damageRate,damageRate2,sizeRate,isExp,0,1,0); + } + else cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,75,0,50,obj.getDirection(),ELEMENTALMASTER_SKILL_VOID,1,totalDamage,sizeRate,shoot_range,hittime,0,0,0,0,1,0); + break; + case 27://傑克降臨 + local sub = sq_GetIntData(obj, skillIndex, 6); + local totalDamage = sq_GetLevelData(obj, skillIndex, 1 - xiuzheng, skill_level); + local totalDamage2 = sq_GetLevelData(obj, skillIndex, 3 - xiuzheng, skill_level); + local sizeRate = sq_GetLevelData(obj, skillIndex, 7 - xiuzheng, skill_level) * 110 / 100; + local sizeRate2 = sq_GetLevelData(obj, skillIndex, 5 - xiuzheng, skill_level) * 110 / 100; + local damageRate = (totalDamage2.tofloat() / totalDamage.tofloat() * 100.0).tointeger(); + local number = sq_GetIntData(obj, skillIndex, 3) + 1; + local x = 150, y = 0, z = 0, targetObj = obj; + if(sq_GetIntData(obj, ELEMENTALMASTER_SKILL_HALLOWEENBUSTER, 4) > 0){ + local bhObj = obj.getVar("blackhole").get_obj_vector(0); + if(bhObj){x = 0; y = 0;targetObj = bhObj;} + else{ + local totalDamage = 100; + local totalDamage2 = 100; + local sizeRate = 40; + local lifeTime = 1200; + local attractPower = 600; + local range = 400; + local damageRate = (totalDamage2.tofloat() / totalDamage.tofloat() * 100.0).tointeger(); + local hitTime = 2000; + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,x,y,80,obj.getDirection(),ELEMENTALMASTER_SKILL_BLACKHOLE,1,totalDamage,sizeRate,lifeTime,damageRate,attractPower,range,0,hitTime,0,0); + } + } + if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL) > 0 && !sq_GetSkill(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL).isSealFunction()){ + local elementalpotential_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL); + local add_sizeRate = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 8); + // local add_damageRate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 13, elementalpotential_level); + // totalDamage = totalDamage * (1000 + add_damageRate) / 1000; + sizeRate = sizeRate * (100 + add_sizeRate) / 100; + sizeRate2 = sizeRate2 * (100 + add_sizeRate) / 100; + cearteSkillPassive_Elementalmaster_bykk(obj,targetObj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,x,y,z,obj.getDirection(),ELEMENTALMASTER_SKILL_HALLOWEENBUSTER,0,totalDamage,sizeRate,sizeRate2,damageRate,sub,2,number,0,1,0); + } + else{ + cearteSkillPassive_Elementalmaster_bykk(obj,targetObj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,x,y,z,obj.getDirection(),ELEMENTALMASTER_SKILL_HALLOWEENBUSTER,0,totalDamage,sizeRate,sizeRate2,damageRate,sub,1,number,0,1,0); + } + break; + case 31://雷旋 + local totalDamage = sq_GetLevelData(obj, skillIndex, 1 - xiuzheng, skill_level); + local sizeRate = sq_GetIntData(obj, skillIndex, 2 - xiuzheng) * 230 /100; + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,50,obj.getDirection(),ELEMENTALMASTER_SKILL_SUNBURST,1,totalDamage,sizeRate,0,0,0,0,0,0,1,0); + + local aniPath = ["passiveobject/elementalmaster_bykk/animation/sunburst/sunburstlayer2.ani","passiveobject/elementalmaster_bykk/animation/sunburst/sunburstlayer1.ani"]; + local offset_y = [1,-1]; + sizeRate = sizeRate.tofloat() / 100.0; + for(local i = 0; i < aniPath.len(); i++){ + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,aniPath[i],0,offset_y[i],50 + offset_y[i]); + local pAni = pooledObj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + } + break; + case 58://黑洞 + local size = obj.getVar("blackhole").get_obj_vector_size(); + if(size > 0){ + for(local i = 0; i < size; i++){ + local bhObj = obj.getVar("blackhole").get_obj_vector(i); + if(bhObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(bhObj); + colObj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + } + } + } + local sub = sq_GetIntData(obj, skillIndex, 6); + local totalDamage = sq_GetLevelData(obj, skillIndex, 7 - xiuzheng, skill_level); + local totalDamage2 = sq_GetLevelData(obj, skillIndex, 9 - xiuzheng, skill_level); + local sizeRate = 100 + sq_GetIntData(obj, skillIndex, 5); + local lifeTime = sq_GetLevelData(obj, skillIndex, 5 - xiuzheng, skill_level); + local attractPower = sq_GetLevelData(obj, skillIndex, 1 - xiuzheng, skill_level); + local range = sq_GetIntData(obj, skillIndex, 2 + xiuzheng); + local damageRate = (totalDamage2.tofloat() / totalDamage.tofloat() * 100.0).tointeger(); + local hitTime = 300; + if(sub > 0){ + lifeTime = lifeTime / 2; + hitTime = hitTime / 3; + } + if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL) > 0 && !sq_GetSkill(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL).isSealFunction()){ + local elementalpotential_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL); + local add_sizeRate = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 0); + local minus_Rate = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 2); + // local add_damageRate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 14, elementalpotential_level); + // totalDamage = totalDamage * (1000 + add_damageRate) / 1000; + sizeRate = sizeRate * (100 + add_sizeRate) / 100; + hitTime = hitTime * (100 - minus_Rate) / 100; + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,150,0,120,obj.getDirection(),ELEMENTALMASTER_SKILL_BLACKHOLE,2,totalDamage,sizeRate,lifeTime,damageRate,attractPower,range,sub,hitTime,1,0); + } + else{ + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,150,0,100,obj.getDirection(),ELEMENTALMASTER_SKILL_BLACKHOLE,1,totalDamage,sizeRate,lifeTime,damageRate,attractPower,range,sub,hitTime,1,0); + } + break; + case 59://極冰盛宴 + local totalDamage = sq_GetLevelData(obj, skillIndex, 1 - xiuzheng, skill_level); + local sizeRate = sq_GetLevelData(obj, skillIndex, 9 - xiuzheng, skill_level) * 160 / 100; + local hitMax = sq_GetIntData(obj, skillIndex, 5); + local hitTime = sq_GetIntData(obj, skillIndex, 2 - xiuzheng); + local offset_x = sq_GetIntData(obj, skillIndex, 4); + local speedRate = 30000 / sq_GetIntData(obj, skillIndex, 0); + if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL) > 0 && !sq_GetSkill(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL).isSealFunction()){ + local elementalpotential_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL); + local speed_rate = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 2); + hitMax = hitMax + sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 16, elementalpotential_level); + // local add_damageRate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 15, elementalpotential_level); + // totalDamage = totalDamage * (1000 + add_damageRate) / 1000; + hitTime = hitTime * (100 - speed_rate) / 100; + local sub = 0; + local isBig = sq_GetLevelData(obj, skillIndex, 11, skill_level); + if(isBig > 0){sub = 2;offset_x = offset_x - 150;} + else if(sq_GetLevelData(obj, skillIndex, 10, skill_level) > 0) sub = 1; + if(sub == 2) cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,offset_x,0,0,obj.getDirection(),ELEMENTALMASTER_SKILL_ARCTICPISTE,4,totalDamage * hitMax,sizeRate * 15 / 10, speedRate, isBig,0,0,0,0,1,0); + else cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,offset_x,0,0,obj.getDirection(),ELEMENTALMASTER_SKILL_ARCTICPISTE,2,totalDamage,sizeRate,hitMax,hitTime,speedRate,sub,0,0,1,0); + obj.setTimeEvent(100,50,1,false); + } + else{ + local sub = 0; + local isBig = sq_GetLevelData(obj, skillIndex, 11, skill_level); + if(isBig > 0){sub = 2;offset_x = offset_x - 150;} + else if(sq_GetLevelData(obj, skillIndex, 10, skill_level) > 0) sub = 1; + if(sub == 2) cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,offset_x,0,0,obj.getDirection(),ELEMENTALMASTER_SKILL_ARCTICPISTE,3,totalDamage * hitMax,sizeRate * 15 / 10, speedRate, isBig,0,0,0,0,1,0); + else cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,offset_x,0,0,obj.getDirection(),ELEMENTALMASTER_SKILL_ARCTICPISTE,1,totalDamage,sizeRate,hitMax,hitTime,speedRate,sub,0,0,1,0); + } + break; + } + elementalmaster_setelementSkillBonusRate(obj, skillIndex); + break; + } +} + +function onEndCurrentAni_ElementalChain_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_ELEMENTALCHAIN, STATE_PRIORITY_USER, true); + break; + case 1: + case 11: + case 21: + case 31: + case 41: + if(obj.getVar("skillIndex").getInt(100) == 31 && sq_GetLevelData(obj, 31, 4, sq_GetSkillLevel(obj, 31)) > 0 && obj.getVar("sunburst_bool").getBool(0) == false){ + if(sq_getRandom(1, 99) > 100 - sq_GetLevelData(obj, 31, 4, sq_GetSkillLevel(obj, 31))){ + obj.getVar("sunburst_bool").setBool(0, true); + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,50,obj.getDirection(),ELEMENTALMASTER_SKILL_SUNBURST,2,200,0,0,0,0,0,0,0,0,0); + } + } + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_ElementalChain_bykk(obj) +{ + if(!obj) return; + + local substate = obj.getSkillSubState(); + switch(substate){ + case 10: + case 20: + case 30: + case 40: + local bDownKey = obj.isDownSkillLastKey(); + if(!bDownKey){ + local mocAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_moveoncast.nut"); + if(mocAppendage) mocAppendage.getVar().setBool(0, false); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(substate + 1); + obj.sq_IntVectPush(obj.getVar("moveoncast").getInt(0)); + obj.sq_IntVectPush(obj.getVar("moveoncast").getInt(1)); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_ELEMENTALCHAIN, STATE_PRIORITY_USER, true); + } + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_UP, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_DOWN, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_LEFT, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_RIGHT, ENUM_SUBKEY_TYPE_ALL)){ + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + } + break; + } +} + +function onKeyFrameFlag_ElementalChain_bykk(obj, flagIndex) +{} + +function onTimeEvent_ElementalChain_bykk(obj, timeEventIndex, timeEventCount) +{ + switch(timeEventIndex){ + case 100: obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); break; + } +} + +function onEndState_ElementalChain_bykk(obj, new_state) +{ + if(!obj) return; + if(new_state != ELEMENTALMASTER_SKILL_ELEMENTALCHAIN){ + sq_EndDrawCastGauge(obj); + } + if(new_state == STATE_DIE || new_state == STATE_DAMAGE || new_state == STATE_DOWN || new_state == STATE_HOLD){ + if(sq_GetSkillLevel(obj, 38) > 0){ + local mocAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_moveoncast.nut"); + if(mocAppendage) mocAppendage.getVar().setBool(0, false); + } + } +} + +function onCreateObject_ElementalChain_bykk(obj, createObject) +{} + +function checkExecutableSkill_Elementalcurtain_bykk(obj) +{ + //print("test Elementalcurtain"); + local b_useskill = obj.sq_IsUseSkill(ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN); + if(b_useskill){ + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN); + obj.startSkillCoolTime(ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, skill_level, -1); + obj.sq_IsEnterSkillLastKeyUnits(ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, STATE_PRIORITY_USER, true); + return 1; + } + return 0; +} + +function onSetState_Elementalcurtain_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_ELEMENTALCURTAIN_CAST_BODY); + obj.getVar("moveoncast").setInt(0,ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN); + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN); + local castTime = sq_GetCastTime(obj, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, skill_level); + if(castTime > 1000){local pAni = obj.getCurrentAnimation();sq_SetFrameDelayTime(pAni, 4, castTime);} + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + local pAni = obj.getCurrentAnimation(); + local delaySum = pAni.getDelaySum(false); + sq_StartDrawCastGauge(obj, delaySum, true); + obj.getVar("elementalcurtain").setInt(1,delaySum); + //音效 + obj.sq_PlaySound("WZ_ELEMENTALCURTAIN_01_1",18);//WZ_ELEMENTALCURTAIN_01_2 + //设置效果 + sq_SetBodyEffect(obj, obj, true, sq_RGB(255, 255, 255), 100, 200, 999000, sq_ALPHA(100)); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/elementalcurtain/elementalcurtain_cast_effect.ani",0,0,0); + + //蓄气时钟开启 + obj.getVar("ElementalChain").clear_ct_vector(); + obj.getVar("ElementalChain").push_ct_vector(); + local timer = obj.getVar("ElementalChain").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); + //获取蓄气上限 + local energycharge_Max = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, 4); + local minus_Rate = 0,minus_Rate2 = 0,minus_Rate3 = 0; + local memorize_level = sq_GetSkillLevel(obj, 19); + if(memorize_level > 0){ + minus_Rate = sq_GetLevelData(obj, 19, 1, memorize_level); + } + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut")){ + local magicaltempoup_level = sq_GetSkillLevel(obj, 2); + minus_Rate3 = sq_GetLevelData(obj, 2, 3, magicaltempoup_level); + } + local minus_Rate4 = 1000 - minus_Rate - minus_Rate3; + local fullcharge = 0; + if(minus_Rate4 > 0) energycharge_Max = energycharge_Max * minus_Rate4 / 1000; + else fullcharge = 1; + obj.getVar("moveoncast").setInt(2,energycharge_Max); + + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,80,obj.getDirection(),38,1,energycharge_Max,4,fullcharge,0,0,0,0,0,0,0); + break; + case 1: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_ELEMENTALCURTAIN_SHOOT_BODY); + obj.stopSound(18); + //设置效果 + sq_SetBodyEffect(obj, obj, true, sq_RGB(255, 255, 255), 100, 100, 0, sq_ALPHA(100)); + //声音 + obj.sq_PlaySound("WZ_ELEMENTALCURTAIN_02_1");//WZ_ELEMENTALCURTAIN_02_2 + + local charge_obj = obj.getVar("moveoncast").get_obj_vector(0); + if(charge_obj) charge_obj.setValid(false); + + local timer = obj.getVar("ElementalChain").get_ct_vector(0); + local currentT = 0; + if(timer) currentT = timer.Get(); + local energycharge_Max = obj.getVar("moveoncast").getInt(2); + + local xiuzheng = 1; + if(currentT > energycharge_Max) xiuzheng = 0; + + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN); + local istalisman = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, 8) + 1; + local totalDamage = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, 0, skill_level); + local totalDamage2 = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, 1, skill_level); + local damageRate = (totalDamage2.tofloat() / totalDamage.tofloat() * 100.0).tointeger(); + local sizeRate = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, 1 - xiuzheng); + local lifeTime = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, 2); + local hitTime = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, 3); + local hitMax = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, 7); + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,300,0,0,obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN,1,totalDamage,sizeRate,lifeTime,damageRate,hitTime,hitMax,istalisman,0,1,0); + + if(istalisman > 0) obj.setTimeEvent(2,660,1,false); + + sq_BinaryStartWrite(); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(1); + sq_SendChangeSkillEffectPacket(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN); + elementalmaster_setelementSkillBonusRate(obj, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN); + break; + } +} + +function onEndCurrentAni_Elementalcurtain_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 1: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_Elementalcurtain_bykk(obj) +{ + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + local stateTime = obj.sq_GetStateTimer(); + if(stateTime < obj.getVar("elementalcurtain").getInt(1)) return; + local bDownKey = obj.isDownSkillLastKey(); + if(!bDownKey){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, STATE_PRIORITY_USER, true); + } + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_UP, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_DOWN, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_LEFT, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_RIGHT, ENUM_SUBKEY_TYPE_ALL)){ + //移动施法技能大于0时,获取人物身上移动施法AP,push技能子状态及技能编号等 + if(sq_GetSkillLevel(obj, 38) > 0){ + local mocAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_moveoncast.nut"); + if(mocAppendage){ + mocAppendage.getVar().setInt(1, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN); + mocAppendage.getVar().setBool(0, true); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + } + } + } + break; + } +} + +function onKeyFrameFlag_Elementalcurtain_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_Elementalcurtain_bykk(obj, timeEventIndex, timeEventCount) +{ + switch(timeEventIndex){ + case 1: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, STATE_PRIORITY_USER, true); + break; + case 2: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onEndState_Elementalcurtain_bykk(obj, new_state) +{ + if(!obj) return; + if(new_state != ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN){ + sq_EndDrawCastGauge(obj); + } + if(new_state == STATE_DIE || new_state == STATE_DAMAGE || new_state == STATE_DOWN || new_state == STATE_HOLD){ + if(sq_GetSkillLevel(obj, 38) > 0){ + local mocAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_moveoncast.nut"); + if(mocAppendage) mocAppendage.getVar().setBool(0, false); + } + } +} + +function onCreateObject_Elementalcurtain_bykk(obj, createObject) +{ +} + + +function checkExecutableSkill_Elementalquake_bykk(obj) +{ + // print("test Elementalquake"); + local b_useskill = obj.sq_IsUseSkill(ELEMENTALMASTER_SKILL_ELEMENTALQUAKE); + if(b_useskill){ + // local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALQUAKE); + // obj.startSkillCoolTime(ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, skill_level, -1); + obj.sq_IsEnterSkillLastKeyUnits(ELEMENTALMASTER_SKILL_ELEMENTALQUAKE); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, STATE_PRIORITY_USER, true); + return 1; + } + return 0; +} + +function onSetState_Elementalquake_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_ELEMENTALQUAKE_CASTINGSTART_BODY); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/elementalquake/castingstart_crack.ani",0,0,0); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/elementalquake/castingstarteffect_stone.ani",0,0,0); + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALQUAKE); + local castTime = sq_GetCastTime(obj, ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, skill_level); + if(castTime > 1000){local pAni = obj.getCurrentAnimation();sq_SetFrameDelayTime(pAni, 1, castTime);} + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + local pAni = obj.getCurrentAnimation(); + local delaySum = pAni.getDelaySum(false); + sq_StartDrawCastGauge(obj, delaySum, true); + obj.getVar("elementalquake").setInt(1,delaySum); + //音效 + if(sq_getRandom(1,100) > 50) obj.sq_PlaySound("WZ_ELEMENTALQUAKE_01_1"); + else obj.sq_PlaySound("WZ_ELEMENTALQUAKE_01_2"); + //设置效果 + sq_SetBodyEffect(obj, obj, true, sq_RGB(255, 255, 255), 100, 200, 999000, sq_ALPHA(100)); + //蓄气时钟开启 + obj.getVar("Elementalquake").clear_ct_vector(); + obj.getVar("Elementalquake").push_ct_vector(); + local timer = obj.getVar("Elementalquake").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); + //获取蓄气上限 + local energycharge_Max = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, 3); + local minus_Rate = 0,minus_Rate2 = 0,minus_Rate3 = 0; + local memorize_level = sq_GetSkillLevel(obj, 19); + if(memorize_level > 0){ + minus_Rate = sq_GetLevelData(obj, 19, 1, memorize_level); + } + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut")){ + local magicaltempoup_level = sq_GetSkillLevel(obj, 2); + minus_Rate3 = sq_GetLevelData(obj, 2, 3, magicaltempoup_level); + } + local minus_Rate4 = 1000 - minus_Rate - minus_Rate3; + local fullcharge = 0; + if(minus_Rate4 > 0) energycharge_Max = energycharge_Max * minus_Rate4 / 1000; + else fullcharge = 1; + obj.getVar("moveoncast").setInt(2,energycharge_Max); + + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,80,obj.getDirection(),38,1,energycharge_Max,4,fullcharge,0,0,0,0,0,0,0); + break; + case 1: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_ELEMENTALQUAKE_CASTINGLOOPA_BODY); + obj.stopSound(18); + //设置效果 + sq_SetBodyEffect(obj, obj, true, sq_RGB(255, 255, 255), 100, 100, 0, sq_ALPHA(100)); + //声音 + if(sq_getRandom(1,100) > 50) obj.sq_PlaySound("WZ_ELEMENTALQUAKE_02_1"); + else obj.sq_PlaySound("WZ_ELEMENTALQUAKE_02_2"); + + local charge_obj = obj.getVar("moveoncast").get_obj_vector(0); + if(charge_obj) charge_obj.setValid(false); + + local timer = obj.getVar("Elementalquake").get_ct_vector(0); + local currentT = 0; + if(timer) currentT = timer.Get(); + local energycharge_Max = obj.getVar("moveoncast").getInt(2); + + local xiuzheng = 1; + if(currentT > energycharge_Max) xiuzheng = 0; + + sq_BinaryStartWrite(); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(1); + sq_SendChangeSkillEffectPacket(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN); + + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALQUAKE); + local totalDamage = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, 0, skill_level); + local totalDamage2 = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, 1, skill_level); + local damageRate = (totalDamage2.tofloat() / totalDamage.tofloat() * 100.0).tointeger(); + local sizeRate = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, 8 - xiuzheng); + local istalisman = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, 9) + 1; + + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,300,0,0,obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALQUAKE,1,totalDamage,damageRate,sizeRate,istalisman,0,0,0,0,1,0); + obj.getVar("elementalquake_talisman").setInt(0,istalisman); + elementalmaster_setelementSkillBonusRate(obj, ELEMENTALMASTER_SKILL_ELEMENTALQUAKE); + break; + case 2: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_ELEMENTALQUAKE_CASTINGLOOPB_BODY); + if(obj.getVar("elementalquake_talisman").getInt(0) > 0) obj.setTimeEvent(1,500,1,false); + break; + case 3: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_ELEMENTALQUAKE_CASTINGEND_BODY); + break; + } +} + +function onEndCurrentAni_Elementalquake_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + // obj.sq_IntVectClear(); + // obj.sq_IntVectPush(1); + // obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, STATE_PRIORITY_USER, true); + break; + case 1: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, STATE_PRIORITY_USER, true); + break; + case 3: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_Elementalquake_bykk(obj) +{ + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + local stateTime = obj.sq_GetStateTimer(); + if(stateTime < obj.getVar("elementalquake").getInt(1)) return; + local bDownKey = obj.isDownSkillLastKey(); + if(!bDownKey){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, STATE_PRIORITY_USER, true); + } + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_UP, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_DOWN, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_LEFT, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_RIGHT, ENUM_SUBKEY_TYPE_ALL)){ + //移动施法技能大于0时,获取人物身上移动施法AP,push技能子状态及技能编号等 + if(sq_GetSkillLevel(obj, 38) > 0){ + local mocAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_moveoncast.nut"); + if(mocAppendage){ + mocAppendage.getVar().setInt(1, ELEMENTALMASTER_SKILL_ELEMENTALQUAKE); + mocAppendage.getVar().setBool(0, true); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + } + } + } + break; + } +} + +function onKeyFrameFlag_Elementalquake_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_Elementalquake_bykk(obj, timeEventIndex, timeEventCount) +{ + switch(timeEventIndex){ + case 1: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(3); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, STATE_PRIORITY_USER, true); + break; + } +} + +function onEndState_Elementalquake_bykk(obj, new_state) +{ + if(!obj) return; + if(new_state != ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN){ + sq_EndDrawCastGauge(obj); + } + if(new_state == STATE_DIE || new_state == STATE_DAMAGE || new_state == STATE_DOWN || new_state == STATE_HOLD){ + if(sq_GetSkillLevel(obj, 38) > 0){ + local mocAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_moveoncast.nut"); + if(mocAppendage) mocAppendage.getVar().setBool(0, false); + } + } +} + +function checkExecutableSkill_ElementalShower_bykk(obj) +{ + //print("test ElementalShower"); + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALSHOWER); + if(sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALSHOWER, 9, skill_level) > 0){ + local b_useskill = obj.sq_IsUseSkill(ELEMENTALMASTER_SKILL_ELEMENTALSHOWER); + if(b_useskill){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALSHOWER, STATE_PRIORITY_IGNORE_FORCE, true); + return 1; + } + } +} + +function onSetState_ElementalShower_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + obj.sq_StopMove(); + switch(substate){ + case 0: + local Ani = obj.sq_GetThrowChargeAni(2); + obj.setCurrentAnimation(Ani); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + // local currentAni = obj.getCurrentAnimation(); + // currentAni.setSpeedRate(80.0); + // local delaySum = currentAni.getDelaySum(false); + // obj.sq_SetXScrollStart(200, delaySum); + //obj.sq_PlaySound("WZ_SHOOTING_STAR_READY", 2000); + break; + case 1: + local Ani = obj.sq_GetThrowShootAni(2); + obj.setCurrentAnimation(Ani); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + // local currentAni = obj.getCurrentAnimation(); + // local delaySum = currentAni.getDelaySum(false); + obj.stopSound(2000); + obj.sq_PlaySound("WZ_SHOOTING_STAR"); + + local skillLevel = sq_GetSkillLevel(obj, 74); + local totalDamage = sq_GetLevelData(obj, 74, 3, skillLevel); + local totalDamage2 = sq_GetLevelData(obj, 74, 4, skillLevel); + local number = sq_GetIntData(obj, 74, 10); + local baseangle = sq_getRandom(0, 90); + for(local i = 0; i < number; i++){ + local angle = 360 / number * i + baseangle; + local x = (sq_Cos(sq_ToRadian(angle.tofloat())) * 130.0).tointeger(); + local y = (sq_Sin(sq_ToRadian(angle.tofloat())) * 65.0).tointeger(); + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,225 + x, y, 300, obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALSHOWER,1,totalDamage,totalDamage2,0,0,0,0,0,0,1,0); + } + elementalmaster_setelementSkillBonusRate(obj, ELEMENTALMASTER_SKILL_ELEMENTALSHOWER); + break; + } +} + +function onEndCurrentAni_ElementalShower_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALSHOWER, STATE_PRIORITY_USER, true); + break; + case 1: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_ElementalShower_bykk(obj) +{ +} + +function onKeyFrameFlag_ElementalShower_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_ElementalShower_bykk(obj, timeEventIndex, timeEventCount) +{ +} + +function onEndState_ElementalShower_bykk(obj, new_state) +{ + if(!obj) return; + if(new_state != ELEMENTALMASTER_SKILL_ELEMENTALCHAIN){ + obj.sq_SetXScrollStop(100); + } +} + + +function checkExecutableSkill_FlameStrike_bykk(obj) +{ + //print("test FlameStrike"); + return 0; +} + +function onSetState_FlameStrike_bykk(obj, state, datas, isResetTimer) +{ + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + obj.sq_RemoveAimPointMark(); + local Ani = obj.sq_GetThrowChargeAni(1); + obj.setCurrentAnimation(Ani); + sq_StartDrawCastGauge(obj, 200, true); + obj.setTimeEvent(0,100,1,true); + break; + case 1: + obj.sq_RemoveAimPointMark(); + local Ani = obj.sq_GetThrowShootAni(1); + obj.setCurrentAnimation(Ani); + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_FLAMESTRIKE); + local totalDamage = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_FLAMESTRIKE, 0, skill_level); + local sizeRate = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_FLAMESTRIKE, 5) * 125 /100; + local etcTime = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_FLAMESTRIKE, 3, skill_level); + local aimPosX = obj.sq_GetVectorData(datas, 1) - sq_GetXPos(obj); + local aimPosY = obj.sq_GetVectorData(datas, 2) - sq_GetYPos(obj); + if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ASSIMILATE) > 0){ + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,aimPosX.tointeger(),aimPosY.tointeger(),0,ENUM_DIRECTION_RIGHT,ELEMENTALMASTER_SKILL_FLAMESTRIKE,2,totalDamage,sizeRate,etcTime,0,0,0,0,0,1,0); + } + else{ + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,aimPosX.tointeger(),aimPosY.tointeger(),0,ENUM_DIRECTION_RIGHT,ELEMENTALMASTER_SKILL_FLAMESTRIKE,1,totalDamage,sizeRate,0,0,0,0,0,0,1,0);} + + // [56] = [0,1,0,0], + + sq_BinaryStartWrite(); + sq_BinaryWriteDword(0); + sq_BinaryWriteDword(0); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(0); + sq_SendChangeSkillEffectPacket(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN); + break; + } + +} + +function onEndCurrentAni_FlameStrike_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + // obj.sq_IntVectClear(); + // obj.sq_IntVectPush(1); + // obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_FLAMESTRIKE, STATE_PRIORITY_USER, true); + break; + case 1: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_FlameStrike_bykk(obj) +{ + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + local stateTime = obj.sq_GetStateTimer(); + if(stateTime <= 200) return; + local bDownKey = obj.isDownSkillLastKey(); + + local posX = obj.getXPos(); + local posY = obj.getYPos(); + + if(!bDownKey || stateTime >= 1000){ + local aimPosX = obj.sq_GetAimPosX(posX, posY, false); + local aimPosY = obj.sq_GetAimPosY(posX, posY, false); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_IntVectPush(aimPosX); + obj.sq_IntVectPush(aimPosY); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_FLAMESTRIKE, STATE_PRIORITY_USER, true); + } + break; + } +} + +function onKeyFrameFlag_FlameStrike_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_FlameStrike_bykk(obj, timeEventIndex, timeEventCount) +{ + switch(timeEventIndex){ + case 0: + local posX = obj.getXPos(); + local posY = obj.getYPos(); + local posZ = obj.getZPos(); + + local offsetX = 150; + offsetX = obj.sq_GetDistancePos(posX, obj.sq_GetDirection(), offsetX); + + local vX = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_FLAMESTRIKE, 2) * 2; + local vY = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_FLAMESTRIKE, 3) * 2; + + obj.sq_AddAimPointMark(offsetX, posY, vX, vY); + break; + } +} + +function onEndState_FlameStrike_bykk(obj, new_state) +{ + if(new_state != ELEMENTALMASTER_SKILL_FLAMESTRIKE) obj.sq_RemoveAimPointMark(); +} + +function checkExecutableSkill_HalloweenBuster_bykk(obj) +{ + // print("test HalloweenBuster"); +} + +function onSetState_HalloweenBuster_bykk(obj, state, datas, isResetTimer) +{ +} + +function onEndCurrentAni_HalloweenBuster_bykk(obj) +{ +} + +function onProcCon_HalloweenBuster_bykk(obj) +{ +} + +function onKeyFrameFlag_HalloweenBuster_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_HalloweenBuster_bykk(obj, timeEventIndex, timeEventCount) +{ +} + +function onEndState_HalloweenBuster_bykk(obj, new_state) +{ +} + + +function checkExecutableSkill_MagicalTempoUp_bykk(obj) +{ + print("test MagicalTempoUp"); +} + +function onSetState_MagicalTempoUp_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + local Ani = obj.sq_GetThrowChargeAni(3); + obj.setCurrentAnimation(Ani); + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_MAGICALTEMPOUP); + local castTime = sq_GetCastTime(obj, ELEMENTALMASTER_SKILL_MAGICALTEMPOUP, skill_level); + if(castTime > 800){local pAni = obj.getCurrentAnimation();sq_SetFrameDelayTime(pAni, 1, castTime);} + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + sq_StartDrawCastGauge(obj, castTime, true); + local pAni = obj.getCurrentAnimation(); + print(pAni.getDelaySum(false)); + break; + case 1: + local Ani = obj.sq_GetThrowShootAni(3); + obj.setCurrentAnimation(Ani); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut")) + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut"); + local addAppendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, ELEMENTALMASTER_SKILL_MAGICALTEMPOUP, false, "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut", true); + break; + } +} + +function onEndCurrentAni_MagicalTempoUp_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ASSIMILATE, STATE_PRIORITY_USER, true); + break; + case 1: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_MagicalTempoUp_bykk(obj) +{ +} + +function onKeyFrameFlag_MagicalTempoUp_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_MagicalTempoUp_bykk(obj, timeEventIndex, timeEventCount) +{ +} + +function onEndState_MagicalTempoUp_bykk(obj, new_state) +{ + if(!obj) return; + if(new_state != ELEMENTALMASTER_SKILL_ASSIMILATE) sq_EndDrawCastGauge(obj); +} + +function checkExecutableSkill_Mightyrune_bykk(obj) +{ + // print("test Mightyrune"); + // if(obj.getVar("elementalchain_light").get_obj_vector_size() > 0){ + // local name = ["elementalchain_light","elementalchain_ice","elementalchain_fire","elementalchain_dark"]; + // for(local i = 0; i < 4; i++){ + // local effectObj = obj.getVar(name[i]).get_obj_vector(0); + // if(effectObj){local colObj = sq_GetCNRDObjectToCollisionObject(effectObj);colObj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, "");} + // } + // } + local b_useskill = obj.sq_IsUseSkill(ELEMENTALMASTER_SKILL_MIGHTYRUNE); + if(b_useskill){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_MIGHTYRUNE, STATE_PRIORITY_USER, true); + return 1; + } + return 0; +} + +function onSetState_Mightyrune_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + local Ani = obj.sq_GetThrowChargeAni(3); + obj.setCurrentAnimation(Ani); + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN); + local castTime = sq_GetCastTime(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, skill_level); + if(castTime > 800){local pAni = obj.getCurrentAnimation();sq_SetFrameDelayTime(pAni, 1, castTime);} + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + local pAni = obj.getCurrentAnimation(); + local delaySum = pAni.getDelaySum(false); + sq_StartDrawCastGauge(obj, delaySum, true); + break; + case 1: + local Ani = obj.sq_GetThrowShootAni(3); + obj.setCurrentAnimation(Ani); + obj.sq_PlaySound("WZ_MIGHTYRUNE"); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/mightyrune/runecast_01.ani",0,0,0); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut")) + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut"); + CNSquirrelAppendage.sq_AppendAppendage(obj, obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, false, "character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut", true); + + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut")) + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut"); + CNSquirrelAppendage.sq_AppendAppendage(obj, obj, ELEMENTALMASTER_SKILL_MAGICALTEMPOUP, false, "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut", true); + + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_mightyrune.nut")) + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_mightyrune.nut"); + CNSquirrelAppendage.sq_AppendAppendage(obj, obj, ELEMENTALMASTER_SKILL_MIGHTYRUNE, false, "character/mage/elementalmaster_bykk/ap/ap_mightyrune.nut", true); + break; + } +} + +function onEndCurrentAni_Mightyrune_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_MIGHTYRUNE, STATE_PRIORITY_USER, true); + break; + case 1: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_Mightyrune_bykk(obj) +{ +} + +function onKeyFrameFlag_Mightyrune_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_Mightyrune_bykk(obj, timeEventIndex, timeEventCount) +{ +} + +function onEndState_Mightyrune_bykk(obj, new_state) +{ + if(!obj) return; + if(new_state != ELEMENTALMASTER_SKILL_ELEMENTALCHAIN) sq_EndDrawCastGauge(obj); +} + + +function checkExecutableSkill_Sestoelemento_bykk(obj) +{ + // print("test Sestoelemento"); + local b_useskill = obj.sq_IsUseSkill(ELEMENTALMASTER_SKILL_SESTOELEMENTO); + if(b_useskill){ + obj.sq_IsEnterSkillLastKeyUnits(ELEMENTALMASTER_SKILL_SESTOELEMENTO); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(10); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_SESTOELEMENTO, STATE_PRIORITY_USER, true); + return 1; + } + return 0; +} + +function onSetState_Sestoelemento_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_SESTOELEMENTOCAST); + obj.setTimeEvent(1,2500,1,false); + // local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/sestoelemento/start_main.ani",350,-1,150); + sq_SetBodyEffect(obj, obj, true, sq_RGB(255, 255, 255), 100, 100, 0, sq_ALPHA(100)); + sq_flashScreen(obj,1000,3500,300,255, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + obj.sq_SetXScroll(350, 300, 3000, 100); + local totalDamage = obj.sq_GetBonusRateWithPassive(ELEMENTALMASTER_SKILL_SESTOELEMENTO, ELEMENTALMASTER_SKILL_SESTOELEMENTO, 0, 1.0) + 100; + local hitMax = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_SESTOELEMENTO, 0); + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,350,0,150,obj.getDirection(),ELEMENTALMASTER_SKILL_SESTOELEMENTO,1,totalDamage,hitMax,0,0,0,0,0,0,1,0); + sq_SendMessage(obj, 0, 1, 0); + elementalmaster_setelementSkillBonusRate(obj, ELEMENTALMASTER_SKILL_SESTOELEMENTO); + break; + case 1: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_SESTOELEMENTOREADY); + break; + case 2: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_SESTOELEMENTOCHARGE); + break; + case 3: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_SESTOELEMENTOEXP); + obj.sq_PlaySound("WZ_SESTOELEMENTO"); + // sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/sestoelemento/explosion_main.ani",350,-1,150); + local totalDamage = obj.sq_GetBonusRateWithPassive(ELEMENTALMASTER_SKILL_SESTOELEMENTO, ELEMENTALMASTER_SKILL_SESTOELEMENTO, 1, 1.0) + 100; + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,350,0,150,obj.getDirection(),ELEMENTALMASTER_SKILL_SESTOELEMENTO,2,totalDamage,0,0,0,0,0,0,0,1,0); + break; + case 10: + local Ani = obj.sq_GetThrowChargeAni(1); + obj.setCurrentAnimation(Ani); + obj.sq_PlaySound("WZ_SESTOELEMENTO_CAST"); + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_SESTOELEMENTO); + local castTime = sq_GetCastTime(obj, ELEMENTALMASTER_SKILL_SESTOELEMENTO, skill_level); + if(castTime > 300){local pAni = obj.getCurrentAnimation();sq_SetFrameDelayTime(pAni, 2, castTime - 200);} + local pAni = obj.getCurrentAnimation(); + local delaySum = pAni.getDelaySum(false); + sq_StartDrawCastGauge(obj, delaySum, true); + obj.sq_IsEnterSkillLastKeyUnits(ELEMENTALMASTER_SKILL_SESTOELEMENTO); + sq_SetBodyEffect(obj, obj, true, sq_RGB(255, 255, 255), 100, 200, 999000, sq_ALPHA(100)); + break; + } +} + +function onEndCurrentAni_Sestoelemento_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_SESTOELEMENTO, STATE_PRIORITY_USER, true); + break; + case 1: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_SESTOELEMENTO, STATE_PRIORITY_USER, true); + break; + case 2: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(3); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_SESTOELEMENTO, STATE_PRIORITY_USER, true); + break; + case 3: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + // case 10: + // obj.sq_IntVectClear(); + // obj.sq_IntVectPush(0); + // obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_SESTOELEMENTO, STATE_PRIORITY_USER, true); + // break; + } +} + +function onProcCon_Sestoelemento_bykk(obj) +{ + local substate = obj.getSkillSubState(); + switch(substate){ + case 10: + local stateTime = obj.sq_GetStateTimer(); + if(stateTime < 200) return; + local bDownKey = obj.isDownSkillLastKey(); + if(!bDownKey){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_SESTOELEMENTO, STATE_PRIORITY_USER, true); + } + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_UP, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_DOWN, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_LEFT, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_RIGHT, ENUM_SUBKEY_TYPE_ALL)){ + //移动施法技能大于0时,获取人物身上移动施法AP,push技能子状态及技能编号等 + if(sq_GetSkillLevel(obj, 38) > 0){ + local mocAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_moveoncast.nut"); + if(mocAppendage){ + mocAppendage.getVar().setInt(1, ELEMENTALMASTER_SKILL_SESTOELEMENTO); + mocAppendage.getVar().setBool(0, true); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + } + } + } + break; + } +} + +function onKeyFrameFlag_Sestoelemento_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_Sestoelemento_bykk(obj, timeEventIndex, timeEventCount) +{ + switch(timeEventIndex){ + case 1: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_SESTOELEMENTO, STATE_PRIORITY_USER, true); + break; + } +} + +function onEndState_Sestoelemento_bykk(obj, new_state) +{ + sq_SendMessage(obj, 0, 0, 0); +} + +function onCreateObject_Sestoelemento_bykk(obj, createObject) +{ +} + +function checkExecutableSkill_SunBurst_bykk(obj) +{ + // print("test SunBurst"); + return 1; +} + +function onSetState_SunBurst_bykk(obj, state, datas, isResetTimer) +{ +} + +function onEndCurrentAni_SunBurst_bykk(obj) +{ +} + +function onProcCon_SunBurst_bykk(obj) +{ +} + +function onKeyFrameFlag_SunBurst_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_SunBurst_bykk(obj, timeEventIndex, timeEventCount) +{ +} + +function onEndState_SunBurst_bykk(obj, new_state) +{ +} + +function checkExecutableSkill_Thegate_bykk(obj) +{ + // print("test Thegate"); + local b_useskill = obj.sq_IsUseSkill(ELEMENTALMASTER_SKILL_THEGATE); + if(b_useskill){ + obj.sq_IsEnterSkillLastKeyUnits(ELEMENTALMASTER_SKILL_THEGATE); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_THEGATE, STATE_PRIORITY_USER, true); + return 1; + } + return 0; +} + +function onSetState_Thegate_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + local Ani = obj.sq_GetThrowChargeAni(1); + obj.setCurrentAnimation(Ani); + break; + case 1: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_THEGATECAST_BODY); + break; + } +} + +function onEndCurrentAni_Thegate_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_THEGATE, STATE_PRIORITY_USER, true); + break; + case 1: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_Thegate_bykk(obj) +{ +} + +function onKeyFrameFlag_Thegate_bykk(obj, flagIndex) +{ + switch(flagIndex){ + case 1: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/thegate/cast_start_maincircle.ani",75,0,60); + break; + case 2: + local target_number = 0; + local target_Max = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_THEGATE, 0); + local create_time = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_THEGATE, 2); + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_THEGATE); + local create_number = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_THEGATE, 0, skill_level); + local totalDamage = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_THEGATE, 1, skill_level); + print("totalDamage = "+totalDamage); + local damageRate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_THEGATE, 2, skill_level); + obj.getVar("thegate_target").clear_obj_vector(); + local objectManager = obj.getObjectManager();//得到对象管理器 + local objectNumber = objectManager.getCollisionObjectNumber();//总数 + for (local i = 0; i < objectNumber; i++){ + local object = objectManager.getCollisionObject(i);//得到控制类对象 + if(object.isObjectType(OBJECTTYPE_ACTIVE) && obj.isEnemy(object) && object.isInDamagableState(obj)){ + target_number = target_number + 1; + obj.getVar("thegate_target").push_obj_vector(object); + } + } + + if(target_number > 0){ + if(target_number.tofloat() / target_Max.tofloat() <= 0.5) totalDamage = totalDamage * damageRate / 100; + print("totalDamage count: "+totalDamage); + //local skill = sq_GetSkill(obj, ELEMENTALMASTER_SKILL_THEGATE); + local sub = sq_getRandom(0,3), isSeal = false; + if(sq_GetIntData(obj, ELEMENTALMASTER_SKILL_THEGATE, 12) > 0){ + isSeal = true; + totalDamage = totalDamage * 15; + print("totalDamage on: "+totalDamage); + } + for(local i = 0; i < target_number; i++){ + local targetObj = obj.getVar("thegate_target").get_obj_vector(i); + if(targetObj){ + local activeObj = sq_GetCNRDObjectToActiveObject(targetObj); + if(isSeal == true){ + cearteSkillPassive_Elementalmaster_bykk(obj,activeObj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,380,obj.getDirection(),ELEMENTALMASTER_SKILL_THEGATE,10,totalDamage,sub,sq_GetGroup(activeObj),sq_GetUniqueId(activeObj),0,0,0,0,1,0); + } + else cearteSkillPassive_Elementalmaster_bykk(obj,activeObj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,380,obj.getDirection(),ELEMENTALMASTER_SKILL_THEGATE,1,totalDamage,create_number,create_time,sq_getRandom(1,4),sq_GetGroup(activeObj),sq_GetUniqueId(activeObj),0,0,1,0); + } + } + } + elementalmaster_setelementSkillBonusRate(obj, ELEMENTALMASTER_SKILL_THEGATE); + break; + case 3: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/thegate/cast_end_maincircle.ani",75,0,60); + break; + } +} + +function onTimeEvent_Thegate_bykk(obj, timeEventIndex, timeEventCount) +{ +} + +function onEndState_Thegate_bykk(obj, new_state) +{ +} + +function onCreateObject_Thegate_bykk(obj, createObject) +{ +} + + +function checkExecutableSkill_ThunderCalling_bykk(obj) +{ + // print("test ThunderCalling"); +} + +function onSetState_ThunderCalling_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + obj.sq_RemoveAimPointMark(); + obj.sq_IsEnterSkillLastKeyUnits(ELEMENTALMASTER_SKILL_THUNDERCALLING); + local Ani = obj.sq_GetThrowChargeAni(3); + obj.setCurrentAnimation(Ani); + obj.setTimeEvent(0,200,1,false); + sq_StartDrawCastGauge(obj, 200, true); + // obj.sq_PlaySound("WZ_THUNDERC_01"); + break; + case 1: + obj.sq_RemoveAimPointMark(); + local Ani = obj.sq_GetThrowShootAni(3); + obj.setCurrentAnimation(Ani); + obj.sq_PlaySound("WZ_THUNDERC_02"); + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_THUNDERCALLING); + local totalDamage = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_THUNDERCALLING, 3, skill_level); + local countMax = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_THUNDERCALLING, 0, skill_level); + if(sq_GetIntData(obj, ELEMENTALMASTER_SKILL_THUNDERCALLING, 11) > 0) countMax = 1; + local sizeRate = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_THUNDERCALLING, 10) * 125 /100; + local hitTime = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_THUNDERCALLING, 2); + local aimPosX = obj.sq_GetVectorData(datas, 1) - sq_GetXPos(obj); + local aimPosY = obj.sq_GetVectorData(datas, 2) - sq_GetYPos(obj); + local thunderstrikeEx_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_THUNDERSTRIKEEX) + if(thunderstrikeEx_level > 0){ + local add_Rate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_THUNDERSTRIKEEX, 0, thunderstrikeEx_level); + totalDamage = totalDamage * (1000 + add_Rate) / 1000; + hitTime = hitTime / 2; + } + if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL) > 0 && !sq_GetSkill(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL).isSealFunction()){ + local range = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 3, sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL)); + local minus_Rate = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 1); + hitTime = hitTime * (100 - minus_Rate) / 100; + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,aimPosX.tointeger(),aimPosY.tointeger(),0,ENUM_DIRECTION_RIGHT,ELEMENTALMASTER_SKILL_THUNDERCALLING,0,totalDamage,sizeRate,countMax,hitTime,range,2,0,0,1,0); + } + else{ + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,aimPosX.tointeger(),aimPosY.tointeger(),0,ENUM_DIRECTION_RIGHT,ELEMENTALMASTER_SKILL_THUNDERCALLING,0,totalDamage,sizeRate,countMax,hitTime,0,1,0,0,1,0); + } + + if(sq_GetIntData(obj, ELEMENTALMASTER_SKILL_THUNDERCALLING, 12) > 1000){ + local objectManager = obj.getObjectManager(); + local objectNumber = objectManager.getCollisionObjectNumber(); + local damage = totalDamage * 33 / 100; + for (local i = 0; i < objectNumber; i++){ + local object = objectManager.getCollisionObject(i); + if(object.isObjectType(OBJECTTYPE_ACTIVE) && obj.isEnemy(object) && object.isInDamagableState(obj) && sq_Abs(sq_GetXPos(obj) - sq_GetXPos(object)) <= 650 && sq_Abs(sq_GetYPos(obj) - sq_GetYPos(object)) <= 325){ + local activeObj = sq_GetCNRDObjectToActiveObject(object); + cearteSkillPassive_Elementalmaster_bykk(obj,activeObj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,0,ENUM_DIRECTION_RIGHT,ELEMENTALMASTER_SKILL_THUNDERCALLING,3,damage,0,0,0,0,0,0,0,1,0); + } + } + } + + + sq_BinaryStartWrite(); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(0); + sq_BinaryWriteDword(0); + sq_BinaryWriteDword(0); + sq_SendChangeSkillEffectPacket(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN); + elementalmaster_setelementSkillBonusRate(obj, ELEMENTALMASTER_SKILL_THUNDERCALLING); + break; + } +} + + +function onEndCurrentAni_ThunderCalling_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 1: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_ThunderCalling_bykk(obj) +{ + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + local stateTime = obj.sq_GetStateTimer(); + if(stateTime <= 200) return; + local bDownKey = obj.isDownSkillLastKey(); + + local posX = obj.getXPos(); + local posY = obj.getYPos(); + + if(!bDownKey || stateTime >= 1200){ + local aimPosX = obj.sq_GetAimPosX(posX, posY, false); + local aimPosY = obj.sq_GetAimPosY(posX, posY, false); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_IntVectPush(aimPosX); + obj.sq_IntVectPush(aimPosY); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_THUNDERCALLING, STATE_PRIORITY_USER, true); + } + break; + } +} + +function onKeyFrameFlag_ThunderCalling_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_ThunderCalling_bykk(obj, timeEventIndex, timeEventCount) +{ + switch(timeEventIndex){ + case 0: + local posX = obj.getXPos(); + local posY = obj.getYPos(); + local posZ = obj.getZPos(); + + local offsetX = 150; + offsetX = obj.sq_GetDistancePos(posX, obj.sq_GetDirection(), offsetX); + + local vX = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_THUNDERCALLING, 5); + local vY = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_THUNDERCALLING, 6); + + // local thunderstrikeEx_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_THUNDERSTRIKEEX) + // if(thunderstrikeEx_level > 0){vX = vX * 2;vY = vY * 2;} + + obj.sq_AddAimPointMark(offsetX, posY, vX, vY); + break; + } +} + +function onEndState_ThunderCalling_bykk(obj, new_state) +{ + if(new_state != ELEMENTALMASTER_SKILL_FLAMESTRIKE) obj.sq_RemoveAimPointMark(); +} + +function checkExecutableSkill_Thunderrage_bykk(obj) +{ + // print("test Thunderrage"); + local b_useskill = obj.sq_IsUseSkill(ELEMENTALMASTER_SKILL_THUNDERRAGE); + if(b_useskill){ + obj.sq_IsEnterSkillLastKeyUnits(ELEMENTALMASTER_SKILL_THUNDERRAGE); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_THUNDERRAGE, STATE_PRIORITY_USER, true); + return 1; + } + return 0; +} + +function onSetState_Thunderrage_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_THUNDERRAGE_CAST_START_00); + + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_THUNDERRAGE); + local castTime = sq_GetCastTime(obj, ELEMENTALMASTER_SKILL_THUNDERRAGE, skill_level); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + local pAni = obj.getCurrentAnimation(); + local delaySum = pAni.getDelaySum(false); + sq_StartDrawCastGauge(obj, delaySum, true); + obj.getVar("thunderrage").setInt(1,delaySum); + //音效 + obj.sq_PlaySound("R_WZ_THUNDER_RAGE_01_1",18); + // else obj.sq_PlaySound("WZ_CRYSTALOVERMIND_01_2"); + //设置效果 + sq_SetBodyEffect(obj, obj, true, sq_RGB(255, 255, 255), 100, 200, 999000, sq_ALPHA(100)); + //蓄气时钟开启 + obj.getVar("Thunderrage").clear_ct_vector(); + obj.getVar("Thunderrage").push_ct_vector(); + local timer = obj.getVar("Thunderrage").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); + //获取蓄气上限 + local energycharge_Max = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_THUNDERRAGE, 4); + local minus_Rate = 0,minus_Rate2 = 0,minus_Rate3 = 0; + local memorize_level = sq_GetSkillLevel(obj, 19); + if(memorize_level > 0){ + minus_Rate = sq_GetLevelData(obj, 19, 1, memorize_level); + } + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut")){ + local magicaltempoup_level = sq_GetSkillLevel(obj, 2); + minus_Rate3 = sq_GetLevelData(obj, 2, 3, magicaltempoup_level); + } + local minus_Rate4 = 1000 - minus_Rate - minus_Rate3; + local fullcharge = 0; + if(minus_Rate4 > 0) energycharge_Max = energycharge_Max * minus_Rate4 / 1000; + else fullcharge = 1; + obj.getVar("moveoncast").setInt(2,energycharge_Max); + + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,80,obj.getDirection(),38,1,energycharge_Max,4,fullcharge,0,0,0,0,0,0,0); + break; + case 1: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_THUNDERRAGE_CAST_LOOP_00); + + break; + case 2: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_THUNDERRAGE_CAST_END_BODY); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/thunderrage/thunderrage_cast_end_shot_front_00.ani",45,0,55); + obj.stopSound(18); + //设置效果 + sq_SetBodyEffect(obj, obj, true, sq_RGB(255, 255, 255), 100, 100, 0, sq_ALPHA(100)); + //声音 + obj.sq_PlaySound("R_WZ_THUNDER_RAGE_01_2"); + // else obj.sq_PlaySound("WZ_CRYSTALOVERMIND_02_2"); + + local charge_obj = obj.getVar("moveoncast").get_obj_vector(0); + if(charge_obj) charge_obj.setValid(false); + + local timer = obj.getVar("Thunderrage").get_ct_vector(0); + local currentT = 0; + if(timer) currentT = timer.Get(); + local energycharge_Max = obj.getVar("moveoncast").getInt(2); + + local xiuzheng = 100; + if(currentT > energycharge_Max) xiuzheng = 120; + + sq_BinaryStartWrite(); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(1); + sq_SendChangeSkillEffectPacket(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN); + + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_THUNDERRAGE); + local totalDamage = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_THUNDERRAGE, 0, skill_level) * xiuzheng / 100; + local hitMax = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_THUNDERRAGE, 0); + local sizeRate = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_THUNDERRAGE, 2); + if(xiuzheng > 100) sizeRate = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_THUNDERRAGE, 3); + + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,45,0,55,obj.getDirection(),ELEMENTALMASTER_SKILL_THUNDERRAGE,1,totalDamage,sizeRate,hitMax,0,0,0,0,0,1,0); + elementalmaster_setelementSkillBonusRate(obj, ELEMENTALMASTER_SKILL_THUNDERRAGE); + break; + } +} + +function onEndCurrentAni_Thunderrage_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_THUNDERRAGE, STATE_PRIORITY_USER, true); + break; + case 2: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_Thunderrage_bykk(obj) +{ + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + case 1: + local timer = obj.getVar("Thunderrage").get_ct_vector(0); + if(!timer) return; + local currentT = timer.Get(); + if(currentT < obj.getVar("thunderrage").getInt(1)) return; + local bDownKey = obj.isDownSkillLastKey(); + if(!bDownKey){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_THUNDERRAGE, STATE_PRIORITY_USER, true); + } + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_UP, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_DOWN, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_LEFT, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_RIGHT, ENUM_SUBKEY_TYPE_ALL)){ + //移动施法技能大于0时,获取人物身上移动施法AP,push技能子状态及技能编号等 + if(sq_GetSkillLevel(obj, 38) > 0){ + local mocAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_moveoncast.nut"); + if(mocAppendage){ + mocAppendage.getVar().setInt(1, ELEMENTALMASTER_SKILL_THUNDERRAGE); + mocAppendage.getVar().setBool(0, true); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + } + } + } + break; + } +} + +function onKeyFrameFlag_Thunderrage_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_Thunderrage_bykk(obj, timeEventIndex, timeEventCount) +{ +} + +function onEndState_Thunderrage_bykk(obj, new_state) +{ + if(!obj) return; + if(new_state != ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN){ + sq_EndDrawCastGauge(obj); + } + if(new_state == STATE_DIE || new_state == STATE_DAMAGE || new_state == STATE_DOWN || new_state == STATE_HOLD){ + if(sq_GetSkillLevel(obj, 38) > 0){ + local mocAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_moveoncast.nut"); + if(mocAppendage) mocAppendage.getVar().setBool(0, false); + } + } +} + +function checkExecutableSkill_Void_bykk(obj) +{ + // print("test Void"); + return 1; +} + +function onSetState_Void_bykk(obj, state, datas, isResetTimer) +{ +} + +function onEndCurrentAni_Void_bykk(obj) +{ +} + +function onProcCon_Void_bykk(obj) +{ +} + +function onKeyFrameFlag_Void_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_Void_bykk(obj, timeEventIndex, timeEventCount) +{ +} + +function onEndState_Void_bykk(obj, new_state) +{ +} + +function checkExecutableSkill_WallOfIce_bykk(obj) +{ + // print("test WallOfIce"); + return 1; +} + +function onSetState_WallOfIce_bykk(obj, state, datas, isResetTimer) +{ +} + +function onEndCurrentAni_WallOfIce_bykk(obj) +{ +} + +function onProcCon_WallOfIce_bykk(obj) +{ +} + +function onKeyFrameFlag_WallOfIce_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_WallOfIce_bykk(obj, timeEventIndex, timeEventCount) +{ +} + +function onEndState_WallOfIce_bykk(obj, new_state) +{ +} + + +//聖靈符文 +function procSkill_Mightyrue(obj) +{ + if(sq_GetSkillLevel(obj, 34) < 1) return; + obj.setSkillCommandEnable(2 , false); + obj.setSkillCommandEnable(29 , false); +} + + +/////////////////////////elementalmaster_end////////////////////// + + +function startSkillCoolTime_mage_bykk(obj, skillIndex, skillLevel, currentCoolTime) +{ + + local nct = currentCoolTime; + if((CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut") || CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/witch_skill_bykk/passiveskill/ap_magicaltempoup.nut")) && nct > 0){ + local value1 = sq_GetLevelData(obj, 2, 1, sq_GetSkillLevel(obj, 2)); + local mightyrune_level = obj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_MIGHTYRUNE); + if(mightyrune_level > 0){ + local add_Rate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_MIGHTYRUNE, 4, mightyrune_level); + value1 = value1 * (1000 + add_Rate) / 1000; + } + // print("value1 = "+value1); + nct = nct * (1000 - value1) / 1000; + } + // print("nct = "+nct); + + local newCoolTime = 0; + switch(skillIndex){ + case SKILL_BYKK_BLACKLUNATIC: + return 40000; + break; + // case 45: + // if(nct < 3500) return 3500; + // else return nct; + // break; + case 46: + if(obj.getVar("eclipsehive_select").getBool(0) && sq_GetIntData(obj, SKILL_BYKK_BLACKLUNATIC, 51) > 0){ + newCoolTime = nct * 50 / 100; + return newCoolTime; + } + else return nct; + break; + case 49: + if(obj.getVar("eclipsehive_select").getBool(0)){ + local decreaseRate = 0; + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 37) > 0) decreaseRate = decreaseRate - 10; + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 38) > 0) decreaseRate = decreaseRate - 10; + if(decreaseRate < 0){ + newCoolTime = nct * (100 + decreaseRate) / 100; + return newCoolTime; + } + else return nct; + } + else return nct; + break; + case 2: + if(currentCoolTime < 40000) return 40000; + break; + case SKILL_BYKK_CHASERLAUNCH: + newCoolTime = 100; + if(sq_isPVPMode()) newCoolTime = 1000; + // switch(obj.getState()){ + // case SKILL_BYKK_DRAGONSPEAR: + // newCoolTime = newCoolTime - sq_GetLevelData(obj, SKILL_BYKK_DRAGONSPEAR, 10, sq_GetSkillLevel(obj, SKILL_BYKK_DRAGONSPEAR)); + // break; + // case SKILL_BYKK_RANDOMPIERCESTRIKE: + // newCoolTime = newCoolTime - sq_GetLevelData(obj, SKILL_BYKK_RANDOMPIERCESTRIKE, 9, sq_GetSkillLevel(obj, SKILL_BYKK_RANDOMPIERCESTRIKE)); + // break; + // case STATE_BYKK_RANDOMPIERCESTRIKEEX: + // newCoolTime = newCoolTime - sq_GetLevelData(obj, SKILL_BYKK_RANDOMPIERCESTRIKEEX, 6, sq_GetSkillLevel(obj, SKILL_BYKK_RANDOMPIERCESTRIKEEX)); + // break; + // } + // print("newCoolTime = "+newCoolTime); + return newCoolTime; + break; + case SKILL_BYKK_CHASERSEXPLOSION: + return nct; + break; + default: + if(sq_getGrowType(obj) == 3) return currentCoolTime; + else return nct; + break; + } +} + + + +/////////////////////////summoner + + +function proc_appendage_summonerwait(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + if(!parentObj || parentObj.getState() == STATE_DIE) + { + appendage.setValid(false); + return; + } + + local monster_Name = ["SandorObj","AuxoObj","AuxooldObj","LuisObj","EcheverraObj","DarkhigherspiritObj","LighthigherspiritObj","WaterhigherspiritObj","FirehigherspiritObj","BabydragonObj","KrutaObj","HeilromObj","CassillasObj","HodorObj","RamosObj"]; + for(local i = 0; i < monster_Name.len(); i++){ + local monster_num = parentObj.getVar(monster_Name[i]).get_obj_vector_size(); + if(monster_num > 0){ + for(local ui = 0; ui < monster_num; ui++){ + local monsterObj = sq_GetCNRDObjectToActiveObject(parentObj.getVar(monster_Name[i]).get_obj_vector(ui)); + if(!CNSquirrelAppendage.sq_IsAppendAppendage(monsterObj, "character/mage/appendage/kks_ap/ap_summonmonsterwait.nut")){ + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(monsterObj, parentObj, 199, false, "character/mage/appendage/kks_ap/ap_summonmonsterwait.nut", true); + } + } + } + } + +} + +function onEnd_appendage_summonerwait(appendage) +{ + if (!appendage) return; + local parentObj = appendage.getParent(); + + local monster_Name = ["SandorObj","AuxoObj","AuxooldObj","LuisObj","EcheverraObj","DarkhigherspiritObj","LighthigherspiritObj","WaterhigherspiritObj","FirehigherspiritObj","BabydragonObj","KrutaObj","HeilromObj","CassillasObj","HodorObj","RamosObj"]; + for(local i = 0; i < monster_Name.len(); i++){ + local monster_num = parentObj.getVar(monster_Name[i]).get_obj_vector_size(); + if(monster_num > 0){ + for(local ui = 0; ui < monster_num; ui++){ + local monsterObj = sq_GetCNRDObjectToActiveObject(parentObj.getVar(monster_Name[i]).get_obj_vector(ui)); + if(CNSquirrelAppendage.sq_IsAppendAppendage(monsterObj, "character/mage/appendage/kks_ap/ap_summonmonsterwait.nut")){ + CNSquirrelAppendage.sq_RemoveAppendage(monsterObj, "character/mage/appendage/kks_ap/ap_summonmonsterwait.nut"); + } + } + } + } +} + +function onSourceKeyFrameFlag_appendage_auxo_bykk(appendage,flagIndex) +{ + if(!appendage) return; + local parentObj = appendage.getParent(); + if(!parentObj){ + appendage.setValid(false); + return true; + } + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if(!sqrChr) return true; + // if(!sq_IsMyControlObject(sqrChr)) return true; + + local eclipsehive_bonus = sqrChr.getVar("eclipsehive_bonus").getInt(10).tofloat() / 100.0; + local eclipsehive_bonus2 = sqrChr.getVar("eclipsehive_bonus").getInt(11).tofloat() / 100.0; + + switch(flagIndex){ + case 101://嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭? + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 45, 45, 7, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,45,1,0,0,0,totalDamage,0,0,0,0); + break; + case 201://?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭? + local targetObj = sq_GetCNRDObjectToActiveObject(parentObj.getVar("targetObj").get_obj_vector(0)); + if(targetObj){ + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 45, 45, 9, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,targetObj,45,2,0,0,0,totalDamage,0,0,0,0); + } + break; + case 301://堋?嚙踝蕭嚙踝蕭?堋? + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 45, 45, 11, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,45,3,0,0,0,totalDamage,0,0,0,0); + break; + case 401://嚙踝蕭嚙踝蕭 + local sizeRate = 100; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 21) > 0){ + sizeRate = sizeRate + 20; + } + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 22) > 0){ + sizeRate = sizeRate + 20; + eclipsehive_bonus2 = eclipsehive_bonus2 + 0.1; + } + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 23) > 0){ + sizeRate = sizeRate + 30; + eclipsehive_bonus2 = eclipsehive_bonus2 + 0.1; + } + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 45, 45, 23, eclipsehive_bonus2) + 100; + if(appendage.getVar("bool").getBool(10)){ + appendage.getVar("bool").setBool(10, false); + totalDamage = totalDamage * 50 / 100; + } + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 23) > 0 && sqrChr.getVar("eclipsehive_select").getBool(0) && parentObj.getVar("ronghe_bool").getBool(0)){ + local number = sqrChr.getVar("AuxoObj").get_obj_vector_size(); + local tz_number = 0; + local max_number = 9; + if(number > max_number) {tz_number = number - max_number; number = max_number;} + print("totalDamage_before = "+totalDamage); + totalDamage = (totalDamage * (number.tofloat() + tz_number.tofloat() / 2.5)).tointeger(); + print("totalDamage_after = "+totalDamage); + parentObj.getVar("ronghe_bool").setBool(0, false); + } + createPassiveObject_k_k(sqrChr,parentObj,45,4,50,0,0,totalDamage,sizeRate,0,0,0); + break; + case 501://嚙踝蕭嚙踝蕭嚙? + local targetObj = sq_GetCNRDObjectToActiveObject(parentObj.getVar("targetObj").get_obj_vector(0)); + if(targetObj){ + local yPos = targetObj.getYPos(); + local xPos = sq_GetDistancePos(targetObj.getXPos(), parentObj.getDirection(), -50); + sq_MoveToNearMovablePos(parentObj, xPos, yPos, 0, xPos, yPos, 0, 100, -1, 5); + } + break; + case 502://嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + appendage.getVar("bool").setBool(1, true); + //monsterattack_ksk(parentObj,0); + break; + case 503://嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 45, 45, 9, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,45,100,0,0,0,totalDamage,0,0,0,0); + break; + case 1001://?嚙踝蕭嚙? + local direction = sqrChr.getDirection(); + local yPos = sqrChr.getYPos(); + local xPos = sq_GetDistancePos(sqrChr.getXPos(), sqrChr.getDirection(), 50); + sq_MoveToNearMovablePos(parentObj, xPos, yPos, 0, xPos, yPos, 0, 100, -1, 5); + sq_SetCurrentDirection(parentObj, direction); + if(!sq_GetSkill(sqrChr, SKILL_BYKK_SUMMONAUXO).isInCoolTime()) sqrChr.startSkillCoolTime(SKILL_BYKK_SUMMONAUXO, sq_GetSkillLevel(sqrChr, SKILL_BYKK_SUMMONAUXO), -1); + break; + case 1002://?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local pIntVec = sq_GetGlobalIntVector(); + sq_IntVectorClear(pIntVec); + sq_IntVectorPush(pIntVec, 3); + sq_AddSetStatePacketActiveObject(parentObj, 8, pIntVec, STATE_PRIORITY_USER); + break; + } + return true; +} + +function proc_appendage_auxo_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if((!sqrChr || sqrChr.getState() == STATE_DIE) || (!parentObj || parentObj.getState() == STATE_DIE)){ + appendage.setValid(false); + return; + } + + if(!sq_IsMyControlObject(sqrChr)) return; + + local t_01 = appendage.getVar("skill_1").get_timer_vector(0); + local t_02 = appendage.getVar("skill_2").get_timer_vector(0); + local t_03 = appendage.getVar("skill_3").get_timer_vector(0); + local t_04 = appendage.getVar("skill_4").get_timer_vector(0); + local currentT = appendage.getTimer().Get(); + + local state = parentObj.getState(); + local attackIndex = parentObj.getAttackIndex(); + + switch(state){ + case STATE_STAND: + if(sqrChr.getVar("summonmonsterwait").getBool(0)) monsterattack_ksk(parentObj,4); + local timer = appendage.getVar("atktime").get_ct_vector(0); + local currentTT = timer.Get(); + local tiaozheng = 0; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 23) > 0) tiaozheng = 200; + if(currentTT < ATK_TIME - tiaozheng) return; + timer.Reset(); + timer.Start(10000,0); + + local targetObj = sq_FindTarget( parentObj, 0, 1000, 800, 350); + if(targetObj){ + parentObj.getVar("targetObj").clear_obj_vector(); + parentObj.getVar("targetObj").push_obj_vector(targetObj); + local skillt = [t_04,t_03,t_02,t_01]; + local attackIndex = [3,2,1,0]; + local distanceX = [80,60,500,60]; + local distanceXmin = [30,0,0,0]; + local distanceY = [10,10,200,10]; + for(local i = 0;i < skillt.len(); i++){ + if(skillt[i] && skillt[i].isOnEvent(currentT)){ + if(sq_IsMyControlObject(parentObj)){ + if(sq_Abs(targetObj.getXPos() - parentObj.getXPos()) <= distanceX[i] && sq_Abs(targetObj.getXPos() - parentObj.getXPos()) >= distanceXmin[i] && sq_Abs(targetObj.getYPos() - parentObj.getYPos()) <= distanceY[i]){ + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 0) < 1 && i == 0) return; + if(i == 0) appendage.getVar("bool").setBool(10, true); + monsterattack_ksk(parentObj,attackIndex[i]); + return; + } + else if(i == 1 || i == 3){ + local prob = 69; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 23) > 0) prob = 20; + if(sq_getRandom(0,99) >= prob && appendage.getVar("bool").getBool(0) == true){ + appendage.getVar("bool").setBool(0,false); + monsterattack_ksk(parentObj,6); + return; + } + } + } + } + } + } + else{ + targetObj = sq_FindTarget( parentObj, -1000, 1000, 800, 350); + if(targetObj){ + sq_SetCurrentDirection(parentObj, sq_GetOppositeDirection(sq_GetDirection(parentObj))); + } + } + break; + case STATE_ATTACK: + appendage.getVar("bool").setBool(0,true); + if(attackIndex == 4){ + if(sqrChr.getVar("summonmonsterwait").getBool(0) == false) parentObj.sendStateOnlyPacket(STATE_STAND); + } + else if(attackIndex == 5 && appendage.getVar("bool").getBool(1) == true){ + appendage.getVar("bool").setBool(1, false); + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 23) > 0){ + local ani = parentObj.getCurrentAnimation(); + ani.setSpeedRate(200.0); + } + } + break; + } +} + +function onStart_appendage_auxo_bykk(appendage) +{ + if (!appendage) return; + + appendage.getVar("atktime").clear_ct_vector(); + appendage.getVar("atktime").push_ct_vector(); + local timer = appendage.getVar("atktime").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); +} + +function onEnd_appendage_auxo_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + if(!parentObj) return; + parentObj.sendDestroyPacket(true); +} + +function onSourceKeyFrameFlag_appendage_auxoex_bykk(appendage,flagIndex) +{ + if(!appendage) return; + local parentObj = appendage.getParent(); + if(!parentObj){ + appendage.setValid(false); + return true; + } + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if(!sqrChr) return true; + // if(!sq_IsMyControlObject(sqrChr)) return true; + + local eclipsehive_bonus = sqrChr.getVar("eclipsehive_bonus").getInt(10).tofloat() / 100.0; + local eclipsehive_bonus2 = sqrChr.getVar("eclipsehive_bonus").getInt(11).tofloat() / 100.0; + + switch(flagIndex){ + case 101: + local targetObj = sq_GetCNRDObjectToActiveObject(parentObj.getVar("targetObj").get_obj_vector(0)); + if(targetObj){ + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 45, 45, 27, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,targetObj,45,11,0,0,0,totalDamage,0,0,0,0); + } + break; + case 201: + local targetObj = sq_GetCNRDObjectToActiveObject(parentObj.getVar("targetObj").get_obj_vector(0)); + if(targetObj){ + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 45, 45, 27, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,targetObj,45,12,0,0,0,totalDamage,0,0,0,0); + } + break; + case 301: + local targetObj = sq_GetCNRDObjectToActiveObject(parentObj.getVar("targetObj").get_obj_vector(0)); + if(targetObj){ + local group = sq_GetGroup(targetObj),uniqueId = sq_GetUniqueId(targetObj); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 45, 45, 28, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr, parentObj, 45, 13, 150, 0, 50, totalDamage * 2, 20, group, uniqueId, 0); + } + break; + case 401: + local sizeRate = 100; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 21) > 0){ + sizeRate = sizeRate + 20; + } + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 22) > 0){ + sizeRate = sizeRate + 20; + eclipsehive_bonus2 = eclipsehive_bonus2 + 0.1; + } + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 23) > 0){ + sizeRate = sizeRate + 30; + eclipsehive_bonus2 = eclipsehive_bonus2 + 0.1; + } + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 45, 45, 29, eclipsehive_bonus2) + 100; + if(appendage.getVar("bool").getBool(10)){ + appendage.getVar("bool").setBool(10, false); + totalDamage = totalDamage * 50 / 100; + } + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 23) > 0 && sqrChr.getVar("eclipsehive_select").getBool(0) && parentObj.getVar("ronghe_bool").getBool(0)){ + totalDamage = totalDamage * sqrChr.getVar("AuxoObj").get_obj_vector_size(); + parentObj.getVar("ronghe_bool").setBool(0, false); + } + createPassiveObject_k_k(sqrChr,parentObj,45,14,155,-1,124,totalDamage,sizeRate,0,0,0); + break; + case 601: + local direction = sqrChr.getDirection(); + local yPos = sqrChr.getYPos(); + local xPos = sq_GetDistancePos(sqrChr.getXPos(), sqrChr.getDirection(), 50); + sq_MoveToNearMovablePos(parentObj, xPos, yPos, 0, xPos, yPos, 0, 100, -1, 5); + sq_SetCurrentDirection(parentObj, direction); + if(!sq_GetSkill(sqrChr, SKILL_BYKK_SUMMONAUXO).isInCoolTime()) sqrChr.startSkillCoolTime(SKILL_BYKK_SUMMONAUXO, sq_GetSkillLevel(sqrChr, SKILL_BYKK_SUMMONAUXO), -1); + + local pIntVec = sq_GetGlobalIntVector(); + sq_IntVectorClear(pIntVec); + sq_IntVectorPush(pIntVec, 6); + sq_AddSetStatePacketActiveObject(parentObj, 8, pIntVec, STATE_PRIORITY_USER); + break; + case 701: + local pIntVec = sq_GetGlobalIntVector(); + sq_IntVectorClear(pIntVec); + sq_IntVectorPush(pIntVec, 3); + sq_AddSetStatePacketActiveObject(parentObj, 8, pIntVec, STATE_PRIORITY_USER); + break; + } + return true; +} + +function proc_appendage_auxoex_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if((!sqrChr || sqrChr.getState() == STATE_DIE) || (!parentObj || parentObj.getState() == STATE_DIE)){ + appendage.setValid(false); + return; + } + + if(!sq_IsMyControlObject(sqrChr)) return; + + local t_01 = appendage.getVar("skill_1").get_timer_vector(0); + local t_02 = appendage.getVar("skill_2").get_timer_vector(0); + local t_03 = appendage.getVar("skill_3").get_timer_vector(0); + local currentT = appendage.getTimer().Get(); + + local state = parentObj.getState(); + local attackIndex = parentObj.getAttackIndex(); + + switch(state){ + case STATE_STAND: + // appendage.getVar("speed").setBool(0,true); + if(sqrChr.getVar("summonmonsterwait").getBool(0)) monsterattack_ksk(parentObj,4); + local timer = appendage.getVar("atktime").get_ct_vector(0); + local currentTT = timer.Get(); + local tiaozheng = 0; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 23) > 0) tiaozheng = 200; + if(currentTT < ATK_TIME - tiaozheng) return; + timer.Reset(); + timer.Start(10000,0); + + local targetObj = sq_FindTarget( parentObj, 0, 1000, 800, 350); + if(targetObj){ + parentObj.getVar("targetObj").clear_obj_vector(); + parentObj.getVar("targetObj").push_obj_vector(targetObj); + local sizeRate = 1; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 23) > 0) sizeRate = 2; + local skillt = [t_03,t_02,t_01]; + local attackIndex = [3,2,0]; + local distanceX = [450,400 * sizeRate,400 * sizeRate]; + local distanceXmin = [200,0,0]; + local distanceY = [50,150,150]; + for(local i = 0;i < skillt.len(); i++){ + if(skillt[i] && skillt[i].isOnEvent(currentT)){ + if(sq_IsMyControlObject(parentObj)){ + if(sq_Abs(targetObj.getXPos() - parentObj.getXPos()) <= distanceX[i] && sq_Abs(targetObj.getXPos() - parentObj.getXPos()) >= distanceXmin[i] && sq_Abs(targetObj.getYPos() - parentObj.getYPos()) <= distanceY[i]){ + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 0) < 1 && i == 0) return; + if(i == 0) appendage.getVar("bool").setBool(10, true); + if(i == 2 && sq_getRandom(0,99) >= 69) attackIndex[i] = 1; + monsterattack_ksk(parentObj,attackIndex[i]); + return; + } + } + } + } + } + else{ + if(sq_FindTarget( parentObj, -1000, 1000, 800, 350)) sq_SetCurrentDirection(parentObj, sq_GetOppositeDirection(sq_GetDirection(parentObj))); + } + break; + case STATE_ATTACK: + appendage.getVar("bool").setBool(0,true); + if(attackIndex == 4){ + if(sqrChr.getVar("summonmonsterwait").getBool(0) == false) parentObj.sendStateOnlyPacket(STATE_STAND); + } + // if(appendage.getVar("speed").getBool(0) == true){ + // appendage.getVar("speed").setBool(0,false); + // parentObj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, eclipsehive_bonus); + // } + break; + } +} + +function onStart_appendage_auxoex_bykk(appendage) +{ + if (!appendage) return; + + appendage.getVar("atktime").clear_ct_vector(); + appendage.getVar("atktime").push_ct_vector(); + local timer = appendage.getVar("atktime").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); +} + +function onEnd_appendage_auxoex_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + if(!parentObj) return; + parentObj.sendDestroyPacket(true); +} + +function onSourceKeyFrameFlag_appendage_babydragon_bykk(appendage,flagIndex) +{ + if(!appendage) return; + local parentObj = appendage.getParent(); + if(!parentObj){ + appendage.setValid(false); + return true; + } + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if(!sqrChr) return true; + // if(!sq_IsMyControlObject(sqrChr)) return true; + + local eclipsehive_bonus = sqrChr.getVar("eclipsehive_bonus").getInt(10).tofloat() / 100.0; + local eclipsehive_bonus2 = sqrChr.getVar("eclipsehive_bonus").getInt(11).tofloat() / 100.0; + + switch(flagIndex){ + case 101://?嚙踝蕭 + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 80, 80, 7, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,80,1,0,0,0,totalDamage,0,0,0,0); + break; + case 201://?嚙踝蕭2 + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 80, 80, 7, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,80,2,0,0,0,totalDamage,0,0,0,0); + break; + case 301://嚙踝蕭牊 + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 80, 80, 9, eclipsehive_bonus) + 100; + local sizeRate = 100; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 28) > 0 && sqrChr.getVar("eclipsehive_select").getBool(0) == false) sizeRate = 250; + createPassiveObject_k_k(sqrChr,parentObj,80,3,80,0,40,totalDamage,sizeRate,0,0,0); + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 29) > 0 && sqrChr.getVar("eclipsehive_select").getBool(0) == false) createPassiveObject_k_k(sqrChr,parentObj,80,3,100,0,40,totalDamage,sizeRate,0,0,0); + break; + case 401://嚙踝蕭嚙踝蕭 + local xpos = 150; + if(parentObj.getDirection() == ENUM_DIRECTION_LEFT) xpos = -150; + local sizeRate = 100; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 29) > 0 && sqrChr.getVar("eclipsehive_select").getBool(0) == false) sizeRate = 150; + sq_CreateParticle("monster/character/mage/madeby_k_k/babydragon/particle/flamethrower.ptl", parentObj, xpos, 0, 30, true, 20, 0, 10); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 80, 80, 10, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,80,4,0,0,0,totalDamage,sizeRate,0,0,0); + break; + case 501://嚙踝蕭? + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 80, 80, 9, eclipsehive_bonus) + 100; + local etcSub = 0; + local sizeRate = 100; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 28) > 0 && sqrChr.getVar("eclipsehive_select").getBool(0) == false) sizeRate = 250; + if(sq_GetBonusRateWithPassive(sqrChr, 80, 80, 11, 1.0) + 100 > 0) etcSub = 1; + createPassiveObject_k_k(sqrChr,parentObj,80,5,80,0,40,totalDamage, etcSub, sizeRate,0,0); + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 29) > 0 && sqrChr.getVar("eclipsehive_select").getBool(0) == false) createPassiveObject_k_k(sqrChr,parentObj,80,5,100,0,40,totalDamage, etcSub, sizeRate,0,0); + break; + case 601://旓?1 + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 80, 80, 18, eclipsehive_bonus2) + 100; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 29) > 0 && sqrChr.getVar("eclipsehive_select").getBool(0) && parentObj.getVar("ronghe_bool").getBool(0)){ + totalDamage = totalDamage * sqrChr.getVar("BabydragonObj").get_obj_vector_size(); + parentObj.getVar("ronghe_bool").setBool(0, false); + } + local ani = parentObj.getCurrentAnimation(); + local delay = ani.getDelaySum(0,0); + local sizeRate = 100; + local hittime = delay * 2; + local add_bonus = 0; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 27) > 0 && sqrChr.getVar("eclipsehive_select").getBool(0)) sizeRate = sizeRate + 10; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 28) > 0 && sqrChr.getVar("eclipsehive_select").getBool(0)){add_bonus = add_bonus + 10; hittime = hittime * 70 /100;} + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 29) > 0 && sqrChr.getVar("eclipsehive_select").getBool(0)){sizeRate = sizeRate + 20; add_bonus = add_bonus + 20;} + if(add_bonus > 0) totalDamage = totalDamage * (100 + add_bonus) / 100; + if(appendage.getVar("bool").getBool(10)){ + appendage.getVar("bool").setBool(10, false); + totalDamage = totalDamage * 50 / 100; + } + createPassiveObject_k_k(sqrChr,parentObj,80,6,0,0,0,totalDamage,delay,sizeRate,hittime,0); + break; + case 1001://?嚙踝蕭嚙踝蕭嚙? + local direction = sqrChr.getDirection(); + local yPos = sqrChr.getYPos(); + local xPos = sq_GetDistancePos(sqrChr.getXPos(), sqrChr.getDirection(), 50); + sq_MoveToNearMovablePos(parentObj, xPos, yPos, 0, xPos, yPos, 0, 100, -1, 5); + sq_SetCurrentDirection(parentObj, direction); + if(!sq_GetSkill(sqrChr, SKILL_BYKK_SUMMONBABYDRAGON).isInCoolTime()) sqrChr.startSkillCoolTime(SKILL_BYKK_SUMMONBABYDRAGON, sq_GetSkillLevel(sqrChr, SKILL_BYKK_SUMMONBABYDRAGON), -1); + break; + case 1002://?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local attackIndex = 5; + if(sqrChr.getVar("eclipsehive_select").getBool(0) && appendage.getVar("custom").getBool(0)) attackIndex = 9; + local pIntVec = sq_GetGlobalIntVector(); + sq_IntVectorClear(pIntVec); + sq_IntVectorPush(pIntVec, attackIndex); + sq_AddSetStatePacketActiveObject(parentObj, 8, pIntVec, STATE_PRIORITY_USER); + break; + case 10001://裁決 + sq_AddDrawOnlyAniFromParent(parentObj, "passiveobject/madeby_k_k/animation/babydragon/newskill/stormbreath/astractransform_starteff05.ani", 0, 0, sq_GetObjectHeight(parentObj) / 2); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 80, 80, 9, 1.0) + 100; + local group = sq_GetGroup(parentObj); + local uniqueId = sq_GetUniqueId(parentObj); + createPassiveObject_k_k(sqrChr,parentObj,80,11,0,0,0,totalDamage,group,uniqueId,0,0); + sq_SendCreatePassiveObjectPacketPos(parentObj, 1008605, 0, 0, 0, 600); + break; + case 10002://嘶吼 + sq_AddDrawOnlyAniFromParent(parentObj, "passiveobject/madeby_k_k/animation/babydragon/newskill/stormbreath/astractransform_starteff05.ani", 0, 0, sq_GetObjectHeight(parentObj) / 2); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 80, 80, 18, 1.0) + 100; + local group = sq_GetGroup(parentObj); + local uniqueId = sq_GetUniqueId(parentObj); + createPassiveObject_k_k(sqrChr,parentObj,80,12,0,0,320,totalDamage,group,uniqueId,0,0); + sq_SendCreatePassiveObjectPacketPos(parentObj, 1008605, 0, 0, 0, 600); + break; + case 10003://龍息 + sq_AddDrawOnlyAniFromParent(parentObj, "passiveobject/madeby_k_k/animation/babydragon/newskill/stormbreath/astractransform_starteff05.ani", 0, 0, sq_GetObjectHeight(parentObj) / 2); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 80, 80, 9, 1.0) + 100; + local group = sq_GetGroup(parentObj); + local uniqueId = sq_GetUniqueId(parentObj); + createPassiveObject_k_k(sqrChr,parentObj,80,13,0,0,320,totalDamage,group,uniqueId,0,0); + sq_SendCreatePassiveObjectPacketPos(parentObj, 1008605, 0, 0, 0, 600); + break; + } + return true; +} + +function proc_appendage_babydragon_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if((!sqrChr || sqrChr.getState() == STATE_DIE) || (!parentObj || parentObj.getState() == STATE_DIE)){ + appendage.setValid(false); + return; + } + + if(!sq_IsMyControlObject(sqrChr)) return; + + local t_01 = appendage.getVar("skill_1").get_timer_vector(0); + local t_02 = appendage.getVar("skill_2").get_timer_vector(0); + local t_03 = appendage.getVar("skill_3").get_timer_vector(0); + local t_04 = appendage.getVar("skill_4").get_timer_vector(0); + local currentT = appendage.getTimer().Get(); + + + local state = parentObj.getState(); + local skill_level = sq_GetSkillLevel(sqrChr, 72); + local attackIndex = parentObj.getAttackIndex(); + + switch(state){ + case STATE_STAND: + if(sqrChr.getVar("summonmonsterwait").getBool(0)) monsterattack_ksk(parentObj,6); + local timer = appendage.getVar("atktime").get_ct_vector(0); + local currentTT = timer.Get(); + local balance = 0; + //if(appendage.getVar("custom").getBool(0)) balance = -100; + if(currentTT < ATK_TIME + balance) return; + timer.Reset(); + timer.Start(10000,0); + local targetObj = sq_FindTarget( parentObj, 0, 1000, 800, 350); + if(targetObj){ + parentObj.getVar("targetObj").clear_obj_vector(); + parentObj.getVar("targetObj").push_obj_vector(targetObj); + local skillt = [t_04,t_03,t_02,t_01]; + local attackIndex = [5,3,2,0]; + local distanceX = [300,300,300,30]; + local distanceXmin = [40,40,40,0]; + local distanceY = [100,10,20,10]; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 28) > 0 && sqrChr.getVar("eclipsehive_select").getBool(0) == false){ + distanceX = [300,500,700,30]; + distanceY = [100,40,60,30]; + } + for(local i = 0;i < skillt.len(); i++){ + if(skillt[i] && skillt[i].isOnEvent(currentT) && sq_Abs(targetObj.getXPos() - parentObj.getXPos()) <= distanceX[i] && sq_Abs(targetObj.getXPos() - parentObj.getXPos()) >= distanceXmin[i] && sq_Abs(targetObj.getYPos() - parentObj.getYPos()) <= distanceY[i]){ + if(i == 3 && sq_getRandom(0,100) >= 50) attackIndex[i] = 1; + if(i == 2 && sq_getRandom(0,100) >= 50) attackIndex[i] = 4; + if(sq_IsMyControlObject(parentObj)){ + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 1) < 1 && i == 0) return; + if(i == 0) appendage.getVar("bool").setBool(10, true); + if(appendage.getVar("custom").getBool(0)){ + if(sq_getRandom(1,10000) > 6666){ + monsterattack_ksk(parentObj,8 + sq_getRandom(0, 1) * 2); + return; + } + } + monsterattack_ksk(parentObj,attackIndex[i]); + return; + } + } + } + } + break; + case STATE_ATTACK: + if(attackIndex == 6){ + if(sqrChr.getVar("summonmonsterwait").getBool(0) == false) parentObj.sendStateOnlyPacket(STATE_STAND); + } + break; + } +} + +function onStart_appendage_babydragon_bykk(appendage) +{ + if (!appendage) return; + + appendage.getVar("atktime").clear_ct_vector(); + appendage.getVar("atktime").push_ct_vector(); + local timer = appendage.getVar("atktime").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); +} + +function onEnd_appendage_babydragon_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + if(!parentObj) return; + parentObj.sendDestroyPacket(true); +} + +function onSourceKeyFrameFlag_appendage_casillas_bykk(appendage,flagIndex) +{ + if(!appendage) return; + local parentObj = appendage.getParent(); + if(!parentObj){ + appendage.setValid(false); + return true; + } + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if(!sqrChr) return true; + // if(!sq_IsMyControlObject(sqrChr)) return true; + + local eclipsehive_bonus = sqrChr.getVar("eclipsehive_bonus").getInt(10).tofloat() / 100.0; + local eclipsehive_bonus2 = sqrChr.getVar("eclipsehive_bonus").getInt(11).tofloat() / 100.0; + + switch(flagIndex){ + case 101://嚙誶g蕭?嚙踝蕭 嚙踝蕭?? + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONCASILLAS, SKILL_BYKK_SUMMONCASILLAS, 8, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONCASILLAS,1,0,0,0,totalDamage,0,0,0,0); + break; + case 201://嚙誶g蕭?嚙踝蕭 嚙踝蕭?? + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONCASILLAS, SKILL_BYKK_SUMMONCASILLAS, 9, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONCASILLAS,2,0,0,0,totalDamage,0,0,0,0); + break; + case 301://嚙誶g蕭?嚙踝蕭 ?嚙踝蕭? + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONCASILLAS, SKILL_BYKK_SUMMONCASILLAS, 10, eclipsehive_bonus) + 100; + local group = sq_GetGroup(parentObj); + local uniqueId = sq_GetUniqueId(parentObj); + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONCASILLAS,3,0,0,0,totalDamage,group,uniqueId,0,0); + break; + case 401://嚙踝蕭?? 嚙踝蕭 嚙踝蕭苤?嚙踝蕭嚙踝蕭嚙踝蕭琲嚙踝蕭 + local direction = sqrChr.getDirection(); + local yPos = sqrChr.getYPos(); + local zPos = parentObj.getZPos(); + local xPos = sq_GetDistancePos(sqrChr.getXPos(), sqrChr.getDirection(), 50); + sq_MoveToNearMovablePos(parentObj, xPos, yPos, zPos, xPos, yPos, zPos, 100, -1, 5); + sq_SetCurrentDirection(parentObj, direction); + if(!sq_GetSkill(sqrChr, SKILL_BYKK_SUMMONCASILLAS).isInCoolTime()) sqrChr.startSkillCoolTime(SKILL_BYKK_SUMMONCASILLAS, sq_GetSkillLevel(sqrChr, SKILL_BYKK_SUMMONCASILLAS), -1); + break; + case 402://嚙踝蕭?? 嚙踝蕭 嚙踝蕭苤?嚙踝蕭嚙?茷 + monsterattack_ksk(parentObj,5); + break; + case 403://嚙踝蕭?? 嚙踝蕭 嚙踝蕭苤? 嚙踝蕭嚙? + local direction = parentObj.getDirection(); + local xPos = parentObj.getXPos(); + local yPos = parentObj.getYPos(); + local xPos_distance = sq_GetDistancePos(xPos, parentObj.getDirection(), 200); + sq_MoveToNearMovablePos(parentObj, xPos_distance, yPos, 0, xPos, yPos, 0, 100, -1, 5); + sq_SetCurrentDirection(parentObj, direction); + break; + case 404://嚙踝蕭?? 嚙踝蕭 嚙踝蕭苤? 嚙踝蕭嚙? + local direction = parentObj.getDirection(); + local xPos = parentObj.getXPos(); + local yPos = parentObj.getYPos(); + local xPos_distance = sq_GetDistancePos(xPos, parentObj.getDirection(), 180); + sq_MoveToNearMovablePos(parentObj, xPos_distance, yPos, 0, xPos, yPos, 0, 100, -1, 5); + sq_SetCurrentDirection(parentObj, direction); + break; + case 405://嚙踝蕭?? 嚙踝蕭 嚙踝蕭苤? 嚙踝蕭嚙? 嚙踝蕭? + local direction = parentObj.getDirection(); + local xPos = parentObj.getXPos(); + local yPos = parentObj.getYPos(); + local xPos_distance = sq_GetDistancePos(xPos, parentObj.getDirection(), 30); + sq_MoveToNearMovablePos(parentObj, xPos_distance, yPos, 0, xPos, yPos, 0, 100, -1, 5); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONCASILLAS, SKILL_BYKK_SUMMONCASILLAS, 11, eclipsehive_bonus2) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONCASILLAS,41,0,0,0,totalDamage,0,0,0,0); + break; + case 406://嚙踝蕭?? 嚙踝蕭 嚙踝蕭苤?嚙踝蕭嚙?茷 + monsterattack_ksk(parentObj,6); + break; + case 407://嚙踝蕭?? 嚙踝蕭 嚙踝蕭苤?嚙?茷 嚙踝蕭? + local pAni = parentObj.getCurrentAnimation(); + local delay = pAni.getDelaySum(2, 2); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONCASILLAS, SKILL_BYKK_SUMMONCASILLAS, 11, eclipsehive_bonus2) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONCASILLAS,42,0,0,0,totalDamage,delay,0,0,0); + break; + } + return true; +} + +function proc_appendage_casillas_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if((!sqrChr || sqrChr.getState() == STATE_DIE) || (!parentObj || parentObj.getState() == STATE_DIE)){ + appendage.setValid(false); + return; + } + + if(!sq_IsMyControlObject(sqrChr)) return; + + local t_01 = appendage.getVar("skill_1").get_timer_vector(0);//嚙誶g蕭?嚙踝蕭 嚙踝蕭?? + local t_02 = appendage.getVar("skill_2").get_timer_vector(0);//嚙誶g蕭?嚙踝蕭 嚙踝蕭?? + local t_03 = appendage.getVar("skill_3").get_timer_vector(0);//嚙誶g蕭?嚙踝蕭 ?嚙踝蕭? + local t_04 = appendage.getVar("skill_4").get_timer_vector(0);//葀?嚙踝蕭? + local currentT = appendage.getTimer().Get(); + + local state = parentObj.getState(); + local attackIndex = parentObj.getAttackIndex(); + + switch(state){ + case STATE_STAND: + // appendage.getVar("speed").setBool(0,true); + if(sqrChr.getVar("summonmonsterwait").getBool(0)) monsterattack_ksk(parentObj,3); + local timer = appendage.getVar("atktime").get_ct_vector(0); + local currentTT = timer.Get(); + if(currentTT < ATK_TIME) return; + timer.Reset(); + timer.Start(10000,0); + + if(t_04 && t_04.isOnEvent(currentT) == true){ + local objectManager = sqrChr.getObjectManager(); + local objectNumber = objectManager.getCollisionObjectNumber(); + for(local i = 0; i < objectNumber; i++){ + local targetObj = objectManager.getCollisionObject(i); + if(targetObj && targetObj.isObjectType(OBJECTTYPE_ACTIVE) && targetObj.isEnemy(sqrChr) && !CNSquirrelAppendage.sq_IsAppendAppendage(targetObj, "character/mage/k_k_made/appendage/aptomonster/skill_ap/ap_casillas_skill.nut")){ + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(targetObj, sqrChr, -1, false, "character/mage/k_k_made/appendage/aptomonster/skill_ap/ap_casillas_skill.nut", true); + targetObj.getVar("casillasatck").clear_vector(); + targetObj.getVar("casillasatck").push_vector(0); + } + } + } + local targetObj = sq_FindTarget( parentObj, 0, 1000, 800, 350); + if(targetObj){ + parentObj.getVar("targetObj").clear_obj_vector(); + parentObj.getVar("targetObj").push_obj_vector(targetObj); + local skillt = [t_03,t_02,t_01]; + local attackIndex = [2,1,0]; + local distanceX = [300,200,200]; + local distanceXmin = [0,0,0]; + local distanceY = [30,30,30]; + for(local i = 0;i < skillt.len(); i++){ + if(skillt[i] && skillt[i].isOnEvent(currentT)){ + if(sq_IsMyControlObject(parentObj)){ + if(sq_Abs(targetObj.getXPos() - parentObj.getXPos()) <= distanceX[i] && sq_Abs(targetObj.getXPos() - parentObj.getXPos()) >= distanceXmin[i] && sq_Abs(targetObj.getYPos() - parentObj.getYPos()) <= distanceY[i]){ + monsterattack_ksk(parentObj,attackIndex[i]); + if(attackIndex[i] == 2){ + parentObj.getVar("move").set_vector(0,parentObj.getXPos()); + parentObj.getVar("move").set_vector(1,150); + } + return; + } + } + } + } + } + else{ + if(sq_FindTarget( parentObj, -1000, 1000, 800, 350)) sq_SetCurrentDirection(parentObj, sq_GetOppositeDirection(sq_GetDirection(parentObj))); + } + break; + case STATE_ATTACK: + switch(attackIndex){ + case 2: + local pAni = parentObj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + local frameIndex = sq_GetAnimationFrameIndex(pAni); + local fireT = pAni.getDelaySum(0, 7); + local srcX = parentObj.getVar("move").get_vector(0); + local MoveX = parentObj.getVar("move").get_vector(1); + local v = sq_GetAccel(0, MoveX, currentT, fireT, false); + local dstX = sq_GetDistancePos(srcX, parentObj.getDirection(), v); + if(frameIndex >= 4 && frameIndex <= 7){ + if(parentObj.isMovablePos(dstX,parentObj.getYPos())) sq_setCurrentAxisPos(parentObj, 0, dstX); + } + break; + case 3: + if(sqrChr.getVar("summonmonsterwait").getBool(0) == false) parentObj.sendStateOnlyPacket(STATE_STAND); + break; + } + break; + } +} + +function onStart_appendage_casillas_bykk(appendage) +{ + if (!appendage) return; + + appendage.getVar("atktime").clear_ct_vector(); + appendage.getVar("atktime").push_ct_vector(); + local timer = appendage.getVar("atktime").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); +} + +function onEnd_appendage_casillas_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + if(!parentObj) return; + + parentObj.sendDestroyPacket(true); + +} + +function onSourceKeyFrameFlag_appendage_darkhigherspirit_bykk(appendage,flagIndex) +{ + if(!appendage) return; + local parentObj = appendage.getParent(); + if(!parentObj){ + appendage.setValid(false); + return true; + } + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if(!sqrChr) return true; + // if(!sq_IsMyControlObject(sqrChr)) return true; + + local eclipsehive_bonus = sqrChr.getVar("eclipsehive_bonus").getInt(10).tofloat() / 100.0; + local eclipsehive_bonus2 = sqrChr.getVar("eclipsehive_bonus").getInt(11).tofloat() / 100.0; + + if(sqrChr.getVar("eclipsehive_select").getBool(0) == true){ + local add_bonus = 0.0; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 24) > 0) add_bonus = add_bonus + 10.0; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 25) > 0) add_bonus = add_bonus + 10.0; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 26) > 0) add_bonus = add_bonus + 20.0; + if(add_bonus > 0) eclipsehive_bonus2 = eclipsehive_bonus2 +add_bonus / 100.0 + } + + switch(flagIndex){ + case 101://嚙踝蕭嚙踝蕭?嚙踝蕭?? + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITDARKHIGHER, SKILL_BYKK_SUMMONSPIRITDARKHIGHER, 6, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITDARKHIGHER,1,0,0,0,totalDamage,0,0,0,0); + break; + case 201://嚙踝蕭嚙踝蕭?嚙踝蕭嚙踝蕭? + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITDARKHIGHER, SKILL_BYKK_SUMMONSPIRITDARKHIGHER, 7, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITDARKHIGHER,2,0,0,0,totalDamage,0,0,0,0); + break; + case 301://嚙踝蕭嚙踝蕭? + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITDARKHIGHER, SKILL_BYKK_SUMMONSPIRITDARKHIGHER, 19, eclipsehive_bonus) + 100; + local time = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITDARKHIGHER, SKILL_BYKK_SUMMONSPIRITDARKHIGHER, 18, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITDARKHIGHER,3,150,0,0,totalDamage,time,0,0,0); + break; + case 401://嚙踝蕭? + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITDARKHIGHER, SKILL_BYKK_SUMMONSPIRITDARKHIGHER, 19, eclipsehive_bonus) + 100; + local time = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITDARKHIGHER, SKILL_BYKK_SUMMONSPIRITDARKHIGHER, 18, eclipsehive_bonus) + 100; + local sub = 1; + if(parentObj.getVar("skill").getBool(0) == true){ + totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITDARKHIGHER, SKILL_BYKK_SUMMONSPIRITDARKHIGHER, 20, eclipsehive_bonus2) + 100; + time = 3500; + sub = 2; + } + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITDARKHIGHER,4,150,0,0,totalDamage,time,sub,0,0); + parentObj.getVar("skill").setBool(0, false); + break; + case 601://晬嚙? + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITDARKHIGHER, SKILL_BYKK_SUMMONSPIRITDARKHIGHER, 23, 1.0) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITDARKHIGHER,62,150,-1,-1,0,3000,0,0,0); + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITDARKHIGHER,61,150,0,0,totalDamage,3000,0,0,0); + break; + case 1001://?嚙踝蕭嚙踝蕭嚙? + local direction = sqrChr.getDirection(); + local yPos = sqrChr.getYPos(); + local zPos = parentObj.getZPos(); + local xPos = sq_GetDistancePos(sqrChr.getXPos(), sqrChr.getDirection(), 50); + sq_MoveToNearMovablePos(parentObj, xPos, yPos, zPos, xPos, yPos, zPos, 100, -1, 5); + sq_SetCurrentDirection(parentObj, direction); + if(!sq_GetSkill(sqrChr, SKILL_BYKK_SUMMONSPIRITDARKHIGHER).isInCoolTime()) sqrChr.startSkillCoolTime(SKILL_BYKK_SUMMONSPIRITDARKHIGHER, sq_GetSkillLevel(sqrChr, SKILL_BYKK_SUMMONSPIRITDARKHIGHER), -1); + break; + case 1002://?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + parentObj.getVar("skill").setBool(0, true); + monsterattack_ksk(parentObj,3); + break; + } + return true; +} + +function proc_appendage_darkhigherspirit_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if((!sqrChr || sqrChr.getState() == STATE_DIE) || (!parentObj || parentObj.getState() == STATE_DIE)){ + appendage.setValid(false); + return; + } + + if(!sq_IsMyControlObject(sqrChr)) return; + + local t_01 = appendage.getVar("skill_1").get_timer_vector(0);//嚙踝蕭嚙踝蕭?嚙踝蕭?? + local t_02 = appendage.getVar("skill_2").get_timer_vector(0);//嚙踝蕭嚙踝蕭?嚙踝蕭嚙踝蕭? + local t_03 = appendage.getVar("skill_3").get_timer_vector(0);//嚙踝蕭嚙踝蕭? + local t_04 = appendage.getVar("skill_4").get_timer_vector(0);//嚙踝蕭? + local currentT = appendage.getTimer().Get(); + + local state = parentObj.getState(); + local attackIndex = parentObj.getAttackIndex(); + + switch(state){ + case STATE_STAND: + if(sqrChr.getVar("summonmonsterwait").getBool(0)) monsterattack_ksk(parentObj,5); + local timer = appendage.getVar("atktime").get_ct_vector(0); + local currentTT = timer.Get(); + if(currentTT < ATK_TIME) return; + timer.Reset(); + timer.Start(10000,0); + + local grant_timer = parentObj.getVar("grant").get_ct_vector(0); + if(grant_timer){ + local grant_time = grant_timer.Get(); + if(grant_timer && grant_time >= 4000 + sq_getRandom(0,4000) && sq_FindTarget( parentObj, 0, 200, 50, 200)){ + grant_timer.Reset(); + grant_timer.Start(10000,0); + monsterattack_ksk(parentObj,6); + return; + } + } + + local targetObj = sq_FindTarget( parentObj, 0, 1000, 800, 350); + if(targetObj){ + parentObj.getVar("targetObj").clear_obj_vector(); + parentObj.getVar("targetObj").push_obj_vector(targetObj); + local skillt = [t_04,t_03,t_02,t_01]; + local attackIndex = [3,2,1,0]; + local distanceX = [300,200,200,100]; + local distanceXmin = [0,0,0,0]; + local distanceY = [50,40,20,10]; + for(local i = 0;i < skillt.len(); i++){ + if(skillt[i] && skillt[i].isOnEvent(currentT)){ + if(sq_IsMyControlObject(parentObj)){ + if(sq_Abs(targetObj.getXPos() - parentObj.getXPos()) <= distanceX[i] && sq_Abs(targetObj.getXPos() - parentObj.getXPos()) >= distanceXmin[i] && sq_Abs(targetObj.getYPos() - parentObj.getYPos()) <= distanceY[i]){ + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 10) < 1 && i == 0) return; + monsterattack_ksk(parentObj,attackIndex[i]); + if(parentObj.getVar("darkaura").size_vector() > 0){ + local attacknum = parentObj.getVar("darkaura").get_vector(0); + parentObj.getVar("darkaura").set_vector(0,attacknum + 1); + } + return; + } + } + } + } + } + else{ + if(sq_FindTarget( parentObj, -1000, 1000, 800, 350)) sq_SetCurrentDirection(parentObj, sq_GetOppositeDirection(sq_GetDirection(parentObj))); + } + break; + case STATE_ATTACK: + if(attackIndex == 5){ + if(sqrChr.getVar("summonmonsterwait").getBool(0) == false) parentObj.sendStateOnlyPacket(STATE_STAND); + } + break; + } +} + +function onStart_appendage_darkhigherspirit_bykk(appendage) +{ + if (!appendage) return; + + appendage.getVar("atktime").clear_ct_vector(); + appendage.getVar("atktime").push_ct_vector(); + local timer = appendage.getVar("atktime").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); +} + +function onEnd_appendage_darkhigherspirit_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + if(!parentObj) return; + parentObj.sendDestroyPacket(true); +} + +function onSourceKeyFrameFlag_appendage_echeverra_bykk(appendage,flagIndex) +{ + if(!appendage) return; + local parentObj = appendage.getParent(); + if(!parentObj){ + appendage.setValid(false); + return true; + } + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if(!sqrChr) return true; + // if(!sq_IsMyControlObject(sqrChr)) return true; + + local eclipsehive_bonus = sqrChr.getVar("eclipsehive_bonus").getInt(10).tofloat() / 100.0; + local eclipsehive_bonus2 = sqrChr.getVar("eclipsehive_bonus").getInt(11).tofloat() / 100.0; + + switch(flagIndex){ + case 101://嚙踝蕭嚙踝蕭嚙? + parentObj.sq_PlaySound("ECHEVERRA_ARM_ATK"); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 47, 47, 13, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,47,1,0,0,0,totalDamage,0,0,0,0); + break; + case 201://嚙踝蕭嚙踝蕭嚙踝蕭? + parentObj.sq_PlaySound("ECHEVERRA_WAVE"); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 47, 47, 10, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,47,2,80,0,100,totalDamage,0,0,0,0); + break; + case 301://阰嚙踝蕭嚙踝蕭? + parentObj.sq_PlaySound("ECHEVERRA_INTENSE_AURA"); + if(CNSquirrelAppendage.sq_IsAppendAppendage(parentObj, "character/mage/k_k_made/appendage/aptomonster/ap_echeverra_buff.nut")){ + CNSquirrelAppendage.sq_RemoveAppendage(parentObj, "character/mage/k_k_made/appendage/aptomonster/ap_echeverra_buff.nut"); + } + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(parentObj, sqrChr, -1, false, "character/mage/k_k_made/appendage/aptomonster/ap_echeverra_buff.nut", true); + AddAppendage.sq_SetValidTime(25000); + break; + case 401://??ECHEVERRA_READY + createPassiveObject_k_k(sqrChr,parentObj,47,4,100,0,0,0,0,0,0,0); + break; + case 501://怑嚙踝蕭 + parentObj.sq_PlaySound("ECHEVERRA_LASER"); + local hit = 3; + if(parentObj.getVar("skill").getBool(0) == true){ + parentObj.getVar("skill").setBool(0, false); + if(sq_getRandom(0,99) >= 49){ + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 47, 47, 25, eclipsehive_bonus2) + 100; + if(appendage.getVar("bool").getBool(10)){ + appendage.getVar("bool").setBool(10, false); + totalDamage = totalDamage * 50 / 100; + } + createPassiveObject_k_k(sqrChr,parentObj,47,51,250,0,0,totalDamage,0,0,0,0); + return true; + } + hit = 8; + } + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 47, 47, 12, eclipsehive_bonus) + 100; + if(hit == 8) totalDamage = sq_GetBonusRateWithPassive(sqrChr, 47, 47, 25, eclipsehive_bonus2) + 100; + if(appendage.getVar("bool").getBool(10)){ + appendage.getVar("bool").setBool(10, false); + totalDamage = totalDamage * 50 / 100; + } + createPassiveObject_k_k(sqrChr,parentObj,47,5,50,0,80,totalDamage,hit,0,0,0); + sq_SendCreatePassiveObjectPacket(parentObj, 30555, 0, 100, 0, 90, parentObj.getDirection()); + break; + case 901: + sq_SendCreatePassiveObjectPacket(parentObj, 1008607, 0, 0, 0, 325, parentObj.getDirection()); + + local number = 0; + if(parentObj.getVar("grant").getBool(1) == true) number = 1; + if(parentObj.getVar("grant").getBool(2) == true) number = 2; + if(parentObj.getVar("grant").getBool(3) == true) number = 3; + local monstername = ["DarkhigherspiritObj","FirehigherspiritObj","LighthigherspiritObj","WaterhigherspiritObj"]; + local monsterObj = sqrChr.getVar(monstername[number]).get_obj_vector(0); + + local group = sq_GetGroup(monsterObj); + local uniqueId = sq_GetUniqueId(monsterObj); + local pAni = parentObj.getCurrentAnimation(); + local Delay = pAni.getDelaySum(0,3); + sq_flashScreen(parentObj,300,Delay - 300,200,230, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + createPassiveObject_k_k(parentObj,parentObj,47,9,-15,0,0,0,group,uniqueId,Delay,0); + for(local i = 0; i < 4; i++){ + parentObj.getVar("grant").setBool(i,false); + } + break; + case 902: + parentObj.sq_PlaySound("SARPOZA_PUNCH_CAST_01"); + local objject = parentObj.getVar("kingsobj").get_obj_vector(0); + if(objject){ + local colObj = sq_GetCNRDObjectToCollisionObject(objject); + colObj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + } + break; + case 903: + parentObj.sq_PlaySound("ECHEVERRA_ARM_ATK"); + local objject = parentObj.getVar("kingsobj").get_obj_vector(0); + if(objject){ + local colObj = sq_GetCNRDObjectToCollisionObject(objject); + colObj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + } + break; + case 1001://?嚙踝蕭嚙踝蕭嚙? + local direction = sqrChr.getDirection(); + local yPos = sqrChr.getYPos(); + local zPos = parentObj.getZPos(); + local xPos = sq_GetDistancePos(sqrChr.getXPos(), sqrChr.getDirection(), 50); + sq_MoveToNearMovablePos(parentObj, xPos, yPos, zPos, xPos, yPos, zPos, 100, -1, 5); + sq_SetCurrentDirection(parentObj, direction); + if(!sq_GetSkill(sqrChr, SKILL_BYKK_SUMMONECHEVERRA).isInCoolTime()) sqrChr.startSkillCoolTime(SKILL_BYKK_SUMMONECHEVERRA, sq_GetSkillLevel(sqrChr, SKILL_BYKK_SUMMONECHEVERRA), -1); + break; + case 1002://?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + parentObj.getVar("skill").setBool(0,true); + local atkIndex = 4; + if(parentObj.getVar("isHighestEcheverra").getBool(0)){ + parentObj.getVar("isHighestEcheverra").setBool(0, false); + atkIndex = 8; + } + monsterattack_ksk(parentObj,atkIndex); + break; + } + return true; +} + +function proc_appendage_echeverra_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if((!sqrChr || sqrChr.getState() == STATE_DIE) || (!parentObj || parentObj.getState() == STATE_DIE)){ + appendage.setValid(false); + return; + } + + if(!sq_IsMyControlObject(sqrChr)) return; + + local activeObj = sq_GetCNRDObjectToActiveObject(parentObj); + if(sq_IsValidActiveStatus(activeObj, ACTIVESTATUS_SLOW)){ + sq_ReleaseActiveStatus(activeObj, ACTIVESTATUS_SLOW); + } + + local t_01 = appendage.getVar("skill_1").get_timer_vector(0);//嚙踝蕭嚙踝蕭嚙? + local t_02 = appendage.getVar("skill_2").get_timer_vector(0);//嚙踝蕭嚙踝蕭嚙踝蕭? + local t_03 = appendage.getVar("skill_3").get_timer_vector(0);//阰嚙踝蕭嚙踝蕭? + local t_04 = appendage.getVar("skill_4").get_timer_vector(0);//?? + local t_05 = appendage.getVar("skill_5").get_timer_vector(0);//怑嚙踝蕭 + local t_06 = appendage.getVar("skill_6").get_timer_vector(0);//怑嚙踝蕭 + local currentT = appendage.getTimer().Get(); + + local state = parentObj.getState(); + local attackIndex = parentObj.getAttackIndex(); + + switch(state){ + case STATE_STAND: + if(sqrChr.getVar("summonmonsterwait").getBool(0)) monsterattack_ksk(parentObj,6); + local objject = parentObj.getVar("kingsobj").get_obj_vector(0); + if(objject && objject.getState() == 20) objject.setValid(false); + local grant_timer = sqrChr.getVar("grant").get_ct_vector(0); + if(grant_timer){ + if(sq_GetIntData(sqrChr, 47, 13) < 1){ + sqrChr.getVar("grant").clear_ct_vector(); + return; + } + //print(sq_GetIntData(sqrChr, 47, 13)); + local grant_time = grant_timer.Get(); + local cooltime = 15000; + local size = sqrChr.getVar("EcheverraObj").get_obj_vector_size(); + if(size > 1) cooltime = cooltime / size + 1000; + if(grant_time >= cooltime){ + grant_timer.Reset(); + grant_timer.Start(10000,0); + local number01 = sqrChr.getVar("DarkhigherspiritObj").get_obj_vector_size(); + local number02 = sqrChr.getVar("FirehigherspiritObj").get_obj_vector_size(); + local number03 = sqrChr.getVar("LighthigherspiritObj").get_obj_vector_size(); + local number04 = sqrChr.getVar("WaterhigherspiritObj").get_obj_vector_size(); + local monstername = []; + if(number01 > 0) monstername.push("DarkhigherspiritObj"); + if(number02 > 0) monstername.push("FirehigherspiritObj"); + if(number03 > 0) monstername.push("LighthigherspiritObj"); + if(number04 > 0) monstername.push("WaterhigherspiritObj"); + if(monstername.len() <= 0) return; + local random_number; + if(monstername.len() == 1){ + random_number = 0; + } + else if(monstername.len() == 2){ + random_number = sq_getRandom(0,1); + } + else{ + random_number = sq_getRandom(0,monstername.len() - 1); + } + // print(random_number); + local monsterObj = sq_GetCNRDObjectToActiveObject(sqrChr.getVar(monstername[random_number]).get_obj_vector(0)); + if(monsterObj && !CNSquirrelAppendage.sq_IsAppendAppendage(monsterObj, "character/mage/k_k_made/appendage/aptomonster/skill_ap/ap_spikeking_grant.nut")){ + switch(monsterObj.getCollisionObjectIndex()){ + case MONSTER_ID_DARKHIGHERSPIRIT: + parentObj.getVar("grant").setBool(0,true); + break; + case MONSTER_ID_FIREHIGHERSPIRIT: + parentObj.getVar("grant").setBool(1,true); + break; + case MONSTER_ID_LIGHTHIGHERSPIRIT: + parentObj.getVar("grant").setBool(2,true); + break; + case MONSTER_ID_WATERHIGHERSPIRIT: + parentObj.getVar("grant").setBool(3,true); + break; + } + } + else{ + if(monstername.len() == 1) return; + local random_number2 = sq_getRandom(0,monstername.len() - 1); + if(random_number2 == random_number && random_number2 != 0) random_number2 = random_number2 - 1; + if(random_number2 == random_number && random_number2 == 0) random_number2 = 1; + local monsterObj = sq_GetCNRDObjectToActiveObject(sqrChr.getVar(monstername[random_number2]).get_obj_vector(0)); + if(monsterObj && !CNSquirrelAppendage.sq_IsAppendAppendage(monsterObj, "character/mage/k_k_made/appendage/aptomonster/skill_ap/ap_spikeking_grant.nut")){ + switch(monsterObj.getCollisionObjectIndex()){ + case MONSTER_ID_DARKHIGHERSPIRIT: + parentObj.getVar("grant").setBool(0,true); + break; + case MONSTER_ID_FIREHIGHERSPIRIT: + parentObj.getVar("grant").setBool(1,true); + break; + case MONSTER_ID_LIGHTHIGHERSPIRIT: + parentObj.getVar("grant").setBool(2,true); + break; + case MONSTER_ID_WATERHIGHERSPIRIT: + parentObj.getVar("grant").setBool(3,true); + break; + } + } + else return; + } + monsterattack_ksk(parentObj,7); + } + } + else{ + if(sq_GetIntData(sqrChr, 47, 13) > 0){ + sqrChr.getVar("grant").clear_ct_vector(); + sqrChr.getVar("grant").push_ct_vector(); + local timer = sqrChr.getVar("grant").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); + } + } + local timer = appendage.getVar("atktime").get_ct_vector(0); + local currentTT = timer.Get(); + if(currentTT < ATK_TIME) return; + timer.Reset(); + timer.Start(10000,0); + + if(t_03 && t_03.isOnEvent(currentT)){ + monsterattack_ksk(parentObj,2); + return; + } + appendage.getVar("speed").setBool(0,true); + local targetObj = sq_FindTarget( parentObj, 0, 1000, 800, 350); + if(targetObj){ + parentObj.getVar("targetObj").clear_obj_vector(); + parentObj.getVar("targetObj").push_obj_vector(targetObj); + local skillt = [t_06,t_05,t_04,t_02,t_01]; + local attackIndex = [4,4,3,1,0]; + local distanceX = [800,800,500,800,150]; + local distanceXmin = [0,0,0,0,0]; + local distanceY = [30,30,10,25,20]; + for(local i = 0;i < skillt.len(); i++){ + if(skillt[i] && skillt[i].isOnEvent(currentT)){ + if(sq_IsMyControlObject(parentObj)){ + if(sq_Abs(targetObj.getXPos() - parentObj.getXPos()) <= distanceX[i] && sq_Abs(targetObj.getXPos() - parentObj.getXPos()) >= distanceXmin[i] && sq_Abs(targetObj.getYPos() - parentObj.getYPos()) <= distanceY[i]){ + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 3) < 1 && i == 0) return; + else parentObj.getVar("skill").setBool(0,true); + if(i == 1) parentObj.getVar("skill").setBool(0,false); + if(i == 0) appendage.getVar("bool").setBool(10, true); + monsterattack_ksk(parentObj,attackIndex[i]); + return; + } + } + } + } + } + break; + case STATE_ATTACK: + if(attackIndex == 6){ + if(sqrChr.getVar("summonmonsterwait").getBool(0) == false) parentObj.sendStateOnlyPacket(STATE_STAND); + } + break; + } +} + +function onStart_appendage_echeverra_bykk(appendage) +{ + if (!appendage) return; + local parentObj = appendage.getParent(); + parentObj.sq_PlaySound("ECHEVERRA_INVOKE"); + if(sq_IsMyControlObject(parentObj)){ + monsterattack_ksk(parentObj,2); + } + + appendage.getVar("atktime").clear_ct_vector(); + appendage.getVar("atktime").push_ct_vector(); + local timer = appendage.getVar("atktime").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); +} + +function onEnd_appendage_echeverra_bykk(appendage) +{ + if(!appendage) return; + + local parentObj = appendage.getParent(); + if(!parentObj) return; + parentObj.sendDestroyPacket(true); +} + +function onSourceKeyFrameFlag_appendage_firehigherspirit_bykk(appendage,flagIndex) +{ + if(!appendage) return; + local parentObj = appendage.getParent(); + if(!parentObj){ + appendage.setValid(false); + return true; + } + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if(!sqrChr) return true; + // if(!sq_IsMyControlObject(sqrChr)) return true; + + local eclipsehive_bonus = sqrChr.getVar("eclipsehive_bonus").getInt(10).tofloat() / 100.0; + local eclipsehive_bonus2 = sqrChr.getVar("eclipsehive_bonus").getInt(11).tofloat() / 100.0; + + if(sqrChr.getVar("eclipsehive_select").getBool(0) == true){ + local add_bonus = 0.0; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 24) > 0) add_bonus = add_bonus + 10.0; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 25) > 0) add_bonus = add_bonus + 10.0; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 26) > 0) add_bonus = add_bonus + 20.0; + if(add_bonus > 0) eclipsehive_bonus2 = eclipsehive_bonus2 +add_bonus / 100.0 + } + + switch(flagIndex){ + case 101: + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, 6, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITFIREHIGHER,1,0,0,0,totalDamage,0,0,0,0); + break; + case 201: + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, 7, eclipsehive_bonus) + 100; + local totalDamage2 = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, 12, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITFIREHIGHER,2,0,0,0,totalDamage,0,0,0,0); + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITFIREHIGHER,21,50,0,0,totalDamage2,0,0,0,0); + break; + case 301: + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, 21, eclipsehive_bonus) + 100; + local group = sq_GetGroup(parentObj); + local uniqueId = sq_GetUniqueId(parentObj); + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITFIREHIGHER,31,0,0,0,totalDamage,group,uniqueId,0,0); + local speed = 75.0; + if(parentObj.getDirection() == ENUM_DIRECTION_LEFT) speed = -75.0; + sq_SetVelocity(parentObj, 0, speed); + break; + case 302: + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, 22, eclipsehive_bonus) + 100; + local group = sq_GetGroup(parentObj); + local uniqueId = sq_GetUniqueId(parentObj); + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITFIREHIGHER,32,0,0,0,totalDamage,group,uniqueId,0,0); + break; + case 303: + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, 22, eclipsehive_bonus) + 100; + local group = sq_GetGroup(parentObj); + local uniqueId = sq_GetUniqueId(parentObj); + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITFIREHIGHER,33,0,0,0,totalDamage,group,uniqueId,0,0); + break; + case 401: + local totalDamage1 = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, 21, eclipsehive_bonus2) + 100; + local totalDamage2 = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, 22, eclipsehive_bonus2) + 100; + local totalDamage3 = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, 23, eclipsehive_bonus2) + 100; + local totalDamage = totalDamage1 + totalDamage2 + totalDamage3; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITFIREHIGHER,4,150,0,0,totalDamage,0,0,0,0); + break; + case 1001://?嚙踝蕭嚙踝蕭嚙? + local direction = sqrChr.getDirection(); + local yPos = sqrChr.getYPos(); + local zPos = parentObj.getZPos(); + local xPos = sq_GetDistancePos(sqrChr.getXPos(), sqrChr.getDirection(), 50); + sq_MoveToNearMovablePos(parentObj, xPos, yPos, zPos, xPos, yPos, zPos, 100, -1, 5); + sq_SetCurrentDirection(parentObj, direction); + if(!sq_GetSkill(sqrChr, SKILL_BYKK_SUMMONSPIRITFIREHIGHER).isInCoolTime()) sqrChr.startSkillCoolTime(SKILL_BYKK_SUMMONSPIRITFIREHIGHER, sq_GetSkillLevel(sqrChr, SKILL_BYKK_SUMMONSPIRITFIREHIGHER), -1); + break; + case 1002://?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + monsterattack_ksk(parentObj,3); + break; + case 1006://嚙踝蕭? + sq_SendCreatePassiveObjectPacket(parentObj, 1008607, 0, 0, 0, 120, parentObj.getDirection()); + local number = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, 27, 1.0) + 100; + for(local i = 0; i < number; i++){ + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, 29, 1.0) + 100; + local group = sq_GetGroup(parentObj);//? + local uniqueId = sq_GetUniqueId(parentObj);//嚙踝蕭嚙踝蕭ID + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITFIREHIGHER,61,0,0,0,totalDamage,number,i + 1,group,uniqueId); + } + break; + } + return true; +} + +function proc_appendage_firehigherspirit_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if((!sqrChr || sqrChr.getState() == STATE_DIE) || (!parentObj || parentObj.getState() == STATE_DIE)){ + appendage.setValid(false); + return; + } + + if(!sq_IsMyControlObject(sqrChr)) return; + + local t_01 = appendage.getVar("skill_1").get_timer_vector(0);//嚙踝蕭嚙踝蕭?葞? + local t_02 = appendage.getVar("skill_2").get_timer_vector(0);//嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭? + local t_03 = appendage.getVar("skill_3").get_timer_vector(0);//嚙踝蕭嚙踝蕭嚙踝蕭?? + local t_04 = appendage.getVar("skill_4").get_timer_vector(0);//嚙踝蕭嚙踝蕭嚙踝蕭? + local t_05 = appendage.getVar("skill_5").get_timer_vector(0);//嚙踝蕭嚙踝蕭嚙踝蕭? + local currentT = appendage.getTimer().Get(); + + local state = parentObj.getState(); + local attackIndex = parentObj.getAttackIndex(); + + switch(state){ + case STATE_STAND: + if(sqrChr.getVar("summonmonsterwait").getBool(0)) monsterattack_ksk(parentObj,5); + local timer = appendage.getVar("atktime").get_ct_vector(0); + local currentTT = timer.Get(); + if(currentTT < ATK_TIME) return; + timer.Reset(); + timer.Start(10000,0); + + local grant_timer = parentObj.getVar("grant").get_ct_vector(0); + if(grant_timer){ + local grant_time = grant_timer.Get(); + if(grant_timer && grant_time >= 4000 + sq_getRandom(0,4000)){ + grant_timer.Reset(); + grant_timer.Start(10000,0); + monsterattack_ksk(parentObj,6); + return; + } + } + + local targetObj = sq_FindTarget( parentObj, 0, 1000, 800, 350); + if(targetObj){ + parentObj.getVar("targetObj").clear_obj_vector(); + parentObj.getVar("targetObj").push_obj_vector(targetObj); + local skillt = [t_04,t_03,t_02,t_01]; + local attackIndex = [3,2,1,0]; + local distanceX = [300,200,200,100]; + local distanceXmin = [50,0,0,0]; + local distanceY = [50,40,20,10]; + for(local i = 0;i < skillt.len(); i++){ + if(skillt[i] && skillt[i].isOnEvent(currentT)){ + if(sq_IsMyControlObject(parentObj)){ + if(sq_Abs(targetObj.getXPos() - parentObj.getXPos()) <= distanceX[i] && sq_Abs(targetObj.getXPos() - parentObj.getXPos()) >= distanceXmin[i] && sq_Abs(targetObj.getYPos() - parentObj.getYPos()) <= distanceY[i]){ + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 11) < 1 && i == 0) return; + monsterattack_ksk(parentObj,attackIndex[i]); + if(parentObj.getVar("firestorm").size_vector() > 0){ + local attacknum = parentObj.getVar("firestorm").get_vector(0); + parentObj.getVar("firestorm").set_vector(0,attacknum + 1); + } + return; + } + } + } + } + } + else{ + if(sq_FindTarget( parentObj, -1000, 1000, 800, 350)) sq_SetCurrentDirection(parentObj, sq_GetOppositeDirection(sq_GetDirection(parentObj))); + } + break; + case STATE_ATTACK: + if(attackIndex == 5){ + if(sqrChr.getVar("summonmonsterwait").getBool(0) == false) parentObj.sendStateOnlyPacket(STATE_STAND); + } + break; + } +} + +function onStart_appendage_firehigherspirit_bykk(appendage) +{ + if (!appendage) return; + + appendage.getVar("atktime").clear_ct_vector(); + appendage.getVar("atktime").push_ct_vector(); + local timer = appendage.getVar("atktime").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); +} + +function onEnd_appendage_firehigherspirit_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + if(!parentObj) return; + parentObj.sendDestroyPacket(true); +} + +function onSourceKeyFrameFlag_appendage_heilrom_bykk(appendage, flagIndex) +{ + if(!appendage) return; + local parentObj = appendage.getParent(); + if(!parentObj){ + appendage.setValid(false); + return true; + } + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if(!sqrChr) return true; + // if(!sq_IsMyControlObject(sqrChr)) return true; + + switch(flagIndex){ + case 101: + sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/heilrom/animation/skill_heilrom_effect_back.ani", 0, -1, 0); + sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/heilrom/animation/skill_heilrom_effect_front.ani", 0, 1, 0); + sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/heilrom/animation/skill_heilrom_effect00.ani", 0, -1, -40); + break; + case 102: + if(!sq_GetSkill(sqrChr, SKILL_BYKK_SUMMONHEILROM).isInCoolTime()) sqrChr.startSkillCoolTime(SKILL_BYKK_SUMMONHEILROM, sq_GetSkillLevel(sqrChr, SKILL_BYKK_SUMMONHEILROM), -1); + local skillLevel = sq_GetSkillLevel(sqrChr, SKILL_BYKK_SUMMONHEILROM); + local HP_heal = sq_GetLevelData(sqrChr, SKILL_BYKK_SUMMONHEILROM, 14, skillLevel); + local objmg = parentObj.getObjectManager(); + for(local i= 0; i < objmg.getCollisionObjectNumber(); i++){ + local object = objmg.getCollisionObject(i); + if(object && object.isObjectType(OBJECTTYPE_ACTIVE) && !parentObj.isEnemy(object)){ + local activeObj = sq_GetCNRDObjectToActiveObject(object); + local hpMax = activeObj.getHpMax(); + local MpMax = activeObj.getMpMax(); + local hp = activeObj.getHp(); + local mp = activeObj.getMp(); + if(!isSameObject(activeObj,sqrChr)){ + activeObj.setHp(hp + hpMax * HP_heal / 1000, null, true); + } + else{ + sqrChr.sq_SendSetHpPacket(hp + hpMax * HP_heal / 1000, false, parentObj); + sqrChr.sq_SendSetMpPacket(mp + MpMax * HP_heal / 1000, false, parentObj); + } + } + } + //printp("111111111111111111"+"\n"); + break; + } + return true; +} + +function proc_appendage_heilrom_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if((!sqrChr || sqrChr.getState() == STATE_DIE) || (!parentObj || parentObj.getState() == STATE_DIE)){ + appendage.setValid(false); + return; + } + + if(!sq_IsMyControlObject(sqrChr)) return; + + local t = appendage.getVar("buff01").get_timer_vector(0); + local t2 = appendage.getVar("buff02").get_timer_vector(0); + local currentT = appendage.getTimer().Get(); + + if(t2 && t2.isOnEvent(currentT) == true){ + monsterattack_ksk(parentObj,0); + return; + } + + if(t && t.isOnEvent(currentT) == true){ + local buff_range = appendage.getVar("buffPx").get_vector(0); + local elementAttack = appendage.getVar("buffPx").get_vector(1); + local attackSpeed = appendage.getVar("buffPx").get_vector(2); + local moveSpeed = appendage.getVar("buffPx").get_vector(3); + local castSpeed = appendage.getVar("buffPx").get_vector(4); + local skillLevel = appendage.getVar("buffPx").get_vector(5); + + local objmg = sqrChr.getObjectManager(); //嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭庢嚙踝蕭嚙踝蕭 + for(local i= 0; i < objmg.getCollisionObjectNumber(); i++){ + local object = objmg.getCollisionObject(i); + if(object.isObjectType(OBJECTTYPE_ACTIVE) && !sqrChr.isEnemy(object)){ + local activeObj = sq_GetCNRDObjectToActiveObject(object); + if(sq_Abs(activeObj.getXPos() - parentObj.getXPos()) <= buff_range && sq_Abs(activeObj.getYPos() - parentObj.getYPos()) <= buff_range / 2){ + if(!CNSquirrelAppendage.sq_IsAppendAppendage(activeObj, "character/mage/k_k_made/appendage/aptomonster/ap_heilrom_normalbuff.nut")){ + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(activeObj, parentObj, SKILL_BYKK_SUMMONHEILROM, false, "character/mage/k_k_made/appendage/aptomonster/ap_heilrom_normalbuff.nut", true); + AddAppendage.getVar().clear_vector(); + AddAppendage.getVar().push_vector(buff_range); + AddAppendage.getVar().push_vector(skillLevel); + + AddAppendage.getVar().clear_timer_vector(); + AddAppendage.getVar().push_timer_vector(); + local t_01 = AddAppendage.getVar().get_timer_vector(0); + t_01.setParameter(1000, -1); + t_01.resetInstant(0); + + AddAppendage.getVar("status").clear_vector(); + AddAppendage.getVar("status").push_vector(elementAttack); + AddAppendage.getVar("status").push_vector(attackSpeed); + AddAppendage.getVar("status").push_vector(moveSpeed); + AddAppendage.getVar("status").push_vector(castSpeed); + } + } + } + } + return; + } +} + +function onEnd_appendage_heilrom_bykk(appendage) +{ + if(!appendage) return; + local parentObj = appendage.getParent(); + parentObj.sendDestroyPacket(true); +} + +function onStart_appendage_heilrom_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + + local pooledObj_01 = sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/heilrom/animation/skill_heilrom_effect_back.ani", 0, -1, 0); + local pooledObj_02 = sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/heilrom/animation/skill_heilrom_effect_front.ani", 0, 1, 0); + local pooledObj_03 = sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/heilrom/animation/skill_heilrom_effect00.ani", 0, -1, -40); +} + +function onSourceKeyFrameFlag_appendage_hodor_bykk(appendage,flagIndex) +{ + if(!appendage) return; + local parentObj = appendage.getParent(); + if(!parentObj){ + appendage.setValid(false); + return true; + } + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if(!sqrChr) return true; + // if(!sq_IsMyControlObject(sqrChr)) return true; + + local eclipsehive_bonus = sqrChr.getVar("eclipsehive_bonus").getInt(10).tofloat() / 100.0; + local eclipsehive_bonus2 = sqrChr.getVar("eclipsehive_bonus").getInt(11).tofloat() / 100.0; + + switch(flagIndex){ + case 101: + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 25, 25, 13, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,25,1,0,0,0,totalDamage,0,0,0,0); + break; + case 201: + local ap = sq_CreateChangeStatus(CHANGE_STATUS_TYPE_MOVE_SPEED, true, 20.0, 20000); + if(ap) ap.sq_Append(parentObj, parentObj); + local ap2 = sq_CreateChangeStatus(CHANGE_STATUS_TYPE_ATTACK_SPEED, true, 20.0, 20000); + if(ap2) ap2.sq_Append(parentObj, parentObj); + break; + case 301: + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 25, 25, 15, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,25,3,0,0,0,totalDamage,0,0,0,0); + break; + case 401: + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 25, 25, 17, eclipsehive_bonus) + 100; + local sub = 0; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 32) > 0 && sqrChr.getVar("eclipsehive_select").getBool(0) == false) sub = 1; + createPassiveObject_k_k(sqrChr,parentObj,25,4,50,0,50,totalDamage,sub,0,0,0); + if(sq_GetIntData(sqrChr, 25, 10) > 0) createPassiveObject_k_k(sqrChr,parentObj,25,4,75,0,50,totalDamage,sub,0,0,0); + break; + case 501: + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 25, 25, 19, eclipsehive_bonus) + 100; + local sub = 0; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 32) > 0 && sqrChr.getVar("eclipsehive_select").getBool(0) == false) sub = 1; + createPassiveObject_k_k(sqrChr,parentObj,25,5,50,0,50,totalDamage,sub,0,0,0); + if(sq_GetIntData(sqrChr, 25, 10) > 0) createPassiveObject_k_k(sqrChr,parentObj,25,5,75,0,50,totalDamage,sub,0,0,0); + break; + case 601: + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 25, 25, 21, eclipsehive_bonus) + 100; + local sub = 0; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 32) > 0 && sqrChr.getVar("eclipsehive_select").getBool(0) == false) sub = 1; + local add_number = sq_GetIntData(sqrChr, 25, 10); + for(local i = 0; i < 5; i++){ + createPassiveObject_k_k(sqrChr,parentObj,25,6,50,0,50,totalDamage,sub,i,0,0); + if(add_number > 0) createPassiveObject_k_k(sqrChr,parentObj,25,6,75,0,50,totalDamage,sub,i,0,0); + } + break; + case 701: + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 25, 25, 23, eclipsehive_bonus) + 100; + local totalDamage2 = sq_GetBonusRateWithPassive(sqrChr, 25, 25, 25, eclipsehive_bonus) + 100; + local targetObj = parentObj.getVar("targetObj").get_obj_vector(0); + local moveX = targetObj.getXPos() - parentObj.getXPos() + sq_getRandom(-10,10); + local moveY = targetObj.getYPos() - parentObj.getYPos() + sq_getRandom(-8,8); + if(parentObj.getDirection() == ENUM_DIRECTION_LEFT) moveX = moveX + 50; + if(parentObj.getDirection() == ENUM_DIRECTION_RIGHT) moveX = moveX - 50; + createPassiveObject_k_k(sqrChr,parentObj,25,7,50,0,50,totalDamage,totalDamage2,moveX,moveY,0); + if(sq_GetIntData(sqrChr, 25, 10) > 0) createPassiveObject_k_k(sqrChr,parentObj,25,7,50,0,55,totalDamage,totalDamage2,moveX,moveY,0); + break; + case 801: + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 25, 25, 27, eclipsehive_bonus2) + 100; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 30) > 0 && sqrChr.getVar("eclipsehive_select").getBool(0)) totalDamage = totalDamage * 110 / 100; + local group = sq_GetGroup(parentObj); + local uniqueId = sq_GetUniqueId(parentObj); + createPassiveObject_k_k(sqrChr,parentObj,25,8,0,0,0,totalDamage,group,uniqueId,0,0); + break; + case 901: + case 902: + case 903: + if(flagIndex == 901) sq_AddDrawOnlyAniFromParent(parentObj, "monster/character/mage/madeby_k_k/hodor/animation/hita_01.ani", 50, 0, 25); + if(flagIndex == 902) sq_AddDrawOnlyAniFromParent(parentObj, "monster/character/mage/madeby_k_k/hodor/animation/hitb_01.ani", 50, 0, 25); + if(flagIndex == 903) sq_AddDrawOnlyAniFromParent(parentObj, "monster/character/mage/madeby_k_k/hodor/animation/hitc_01.ani", 50, 0, 25); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 25, 25, 27, eclipsehive_bonus2) + 100; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 30) > 0 && sqrChr.getVar("eclipsehive_select").getBool(0)) totalDamage = totalDamage * 110 / 100; + if(appendage.getVar("bool").getBool(10)){ + appendage.getVar("bool").setBool(10, false); + totalDamage = totalDamage * 50 / 100; + } + createPassiveObject_k_k(sqrChr,parentObj,25,9,0,0,0,totalDamage,1,0,0,0); + break; + case 904: + sq_AddDrawOnlyAniFromParent(parentObj, "monster/character/mage/madeby_k_k/hodor/animation/hitd_01.ani", 50, 0, 25); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 25, 25, 29, eclipsehive_bonus2) + 100; + local size = 100; + if(sqrChr.getVar("eclipsehive_select").getBool(0)){ + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 30) > 0) totalDamage = totalDamage * 110 / 100; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 31) > 0) totalDamage = totalDamage * 130 / 100; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 32) > 0) size = 200; + } + if(appendage.getVar("bool").getBool(10)){ + appendage.getVar("bool").setBool(10, false); + totalDamage = totalDamage * 50 / 100; + } + createPassiveObject_k_k(sqrChr,parentObj,25,9,0,0,0,totalDamage,2,size,0,0); + break; + case 1001: + local direction = sqrChr.getDirection(); + local yPos = sqrChr.getYPos(); + local xPos = sq_GetDistancePos(sqrChr.getXPos(), sqrChr.getDirection(), 50); + sq_MoveToNearMovablePos(parentObj, xPos, yPos, 0, xPos, yPos, 0, 100, -1, 5); + sq_SetCurrentDirection(parentObj, direction); + if(!sq_GetSkill(sqrChr, SKILL_BYKK_SUMMONHODOR).isInCoolTime()) sqrChr.startSkillCoolTime(SKILL_BYKK_SUMMONHODOR, sq_GetSkillLevel(sqrChr, SKILL_BYKK_SUMMONHODOR), -1); + break; + case 1002: + local targetObj = sq_FindTarget( sqrChr, 0, 500, 500, 350); + if(targetObj){ + parentObj.getVar("targetObj").clear_obj_vector(); + parentObj.getVar("targetObj").push_obj_vector(targetObj); + local pIntVec = sq_GetGlobalIntVector(); + sq_IntVectorClear(pIntVec); + sq_IntVectorPush(pIntVec, 7); + sq_AddSetStatePacketActiveObject(parentObj, 8, pIntVec, STATE_PRIORITY_USER); + } + else{ + local pIntVec = sq_GetGlobalIntVector(); + sq_IntVectorClear(pIntVec); + sq_IntVectorPush(pIntVec, 1); + sq_AddSetStatePacketActiveObject(parentObj, 8, pIntVec, STATE_PRIORITY_USER); + } + break; + } + + return true; +} + +function proc_appendage_hodor_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if((!sqrChr || sqrChr.getState() == STATE_DIE) || (!parentObj || parentObj.getState() == STATE_DIE)){ + appendage.setValid(false); + return; + } + + if(!sq_IsMyControlObject(sqrChr)) return; + + local t_01 = appendage.getVar("skill_1").get_timer_vector(0); + local t_02 = appendage.getVar("skill_2").get_timer_vector(0); + local t_03 = appendage.getVar("skill_3").get_timer_vector(0); + local t_04 = appendage.getVar("skill_4").get_timer_vector(0); + local t_05 = appendage.getVar("skill_5").get_timer_vector(0); + local t_06 = appendage.getVar("skill_6").get_timer_vector(0); + local t_07 = appendage.getVar("skill_7").get_timer_vector(0); + local t_08 = appendage.getVar("skill_8").get_timer_vector(0); + local currentT = appendage.getTimer().Get(); + + local state = parentObj.getState(); + local attackIndex = parentObj.getAttackIndex(); + switch(state){ + case STATE_STAND: + if(sqrChr.getVar("summonmonsterwait").getBool(0)) monsterattack_ksk(parentObj,9); + if(t_02 && t_02.isOnEvent(currentT)){ + if(sq_IsMyControlObject(parentObj)){ + monsterattack_ksk(parentObj,1); + return; + } + } + local targetObj = sq_FindTarget( parentObj, 0, 1000, 800, 350); + if(targetObj){ + parentObj.getVar("targetObj").clear_obj_vector(); + parentObj.getVar("targetObj").push_obj_vector(targetObj); + local skillt = [t_08,t_07,t_06,t_05,t_04,t_03,t_01]; + local attackIndex = [7,6,5,4,3,2,0]; + local distanceX = [300,300,300,300,300,300,30,30]; + local distanceXmin = [40,40,40,40,40,40,0,0]; + local distanceY = [150,150,80,10,10,10,10,10,10]; + for(local i = 0;i < skillt.len(); i++){ + if(skillt[i] && skillt[i].isOnEvent(currentT) && sq_Abs(targetObj.getXPos() - parentObj.getXPos()) <= distanceX[i] && sq_Abs(targetObj.getXPos() - parentObj.getXPos()) >= distanceXmin[i] && sq_Abs(targetObj.getYPos() - parentObj.getYPos()) <= distanceY[i]){ + if(sq_IsMyControlObject(parentObj)){ + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 5) < 1 && i == 0) return; + if(i == 0) appendage.getVar("bool").setBool(10, true); + monsterattack_ksk(parentObj,attackIndex[i]); + return; + } + } + } + } + break; + case STATE_ATTACK: + switch(attackIndex){ + case 7: + local targetObj = sq_GetCNRDObjectToActiveObject(parentObj.getVar("targetObj").get_obj_vector(0)); + if(targetObj){ + if(sq_GetDistanceObject(parentObj, targetObj, false) < 20){ + local pIntVec = sq_GetGlobalIntVector(); + sq_IntVectorClear(pIntVec); + sq_IntVectorPush(pIntVec, 8); + sq_AddSetStatePacketActiveObject(parentObj, 8, pIntVec, STATE_PRIORITY_USER); + return; + } + local pAni = parentObj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + local fireT = pAni.getDelaySum(false); + local X1 = sq_GetUniformVelocity(parentObj.getXPos(), targetObj.getXPos(), currentT, fireT); + local Y1 = sq_GetUniformVelocity(parentObj.getYPos(), targetObj.getYPos(), currentT, fireT); + sq_setCurrentAxisPos(parentObj, 0, X1); + sq_setCurrentAxisPos(parentObj, 1, Y1); + } + break; + case 9: + if(sqrChr.getVar("summonmonsterwait").getBool(0) == false) parentObj.sendStateOnlyPacket(STATE_STAND); + break; + } + break; + } +} + +function onStart_appendage_hodor_bykk(appendage) +{ + if (!appendage) return; + + appendage.getVar("atktime").clear_ct_vector(); + appendage.getVar("atktime").push_ct_vector(); + local timer = appendage.getVar("atktime").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); +} + +function onEnd_appendage_hodor_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + if(!parentObj) return; + parentObj.sendDestroyPacket(true); +} + +function onSourceKeyFrameFlag_appendage_kruta_bykk(appendage, flagIndex) +{ + if(!appendage) return; + local parentObj = appendage.getParent(); + if(!parentObj){ + appendage.setValid(false); + return true; + } + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if(!sqrChr) return true; + // if(!sq_IsMyControlObject(sqrChr)) return true; + + local eclipsehive_bonus = sqrChr.getVar("eclipsehive_bonus").getInt(10).tofloat() / 100.0; + local eclipsehive_bonus2 = sqrChr.getVar("eclipsehive_bonus").getInt(11).tofloat() / 100.0; + + switch(flagIndex){ + case 101: + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONKRUTA, SKILL_BYKK_SUMMONKRUTA, 7, eclipsehive_bonus) + 100; + local sizeRate = 100 + (sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONKRUTA, SKILL_BYKK_SUMMONKRUTA, 15, 1.0) + 100) * 10; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONKRUTA,1,0,0,0,totalDamage,sizeRate,0,0,0); + parentObj.sq_PlaySound("SUMMON_KRUTA_SWISH_01"); + break; + case 201: + local targetObj = sq_GetCNRDObjectToActiveObject(parentObj.getVar("targetObj").get_obj_vector(0)); + if(targetObj){ + parentObj.getVar("skill2").set_vector(0,parentObj.getXPos()); + parentObj.getVar("skill2").set_vector(1,parentObj.getYPos()); + local moveX = sq_Abs(targetObj.getXPos() - parentObj.getXPos()) + sq_getRandom(0,200); + parentObj.getVar("skill2").set_vector(2,moveX); + parentObj.getVar("skill2").set_vector(3,targetObj.getYPos() - parentObj.getYPos()); + } + monsterattack_ksk(parentObj,3); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONKRUTA, SKILL_BYKK_SUMMONKRUTA, 8, eclipsehive_bonus) + 100; + local group = sq_GetGroup(parentObj); + local uniqueId = sq_GetUniqueId(parentObj); + local sizeRate = 100 + (sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONKRUTA, SKILL_BYKK_SUMMONKRUTA, 15, 1.0) + 100) * 10; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONKRUTA,2,0,0,0,totalDamage,group,uniqueId,sizeRate,0); + parentObj.sq_PlaySound("SUMMON_KRUTA_RUSH"); + break; + case 301: + sq_SetMyShake(parentObj,3,720); + parentObj.sq_PlaySound("SUMMON_KRUTA_SCREAM"); + break; + case 302: + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONKRUTA, SKILL_BYKK_SUMMONKRUTA, 9, eclipsehive_bonus) + 100; + local sizeRate = 100 + (sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONKRUTA, SKILL_BYKK_SUMMONKRUTA, 15, 1.0) + 100) * 10; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONKRUTA,3,0,0,0,totalDamage,sizeRate,0,0,0); + break; + case 401: + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONKRUTA, SKILL_BYKK_SUMMONKRUTA, 10, eclipsehive_bonus2) + 100; + local sizeRate = 100 + (sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONKRUTA, SKILL_BYKK_SUMMONKRUTA, 15, 1.0) + 100) * 10; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 30) > 0 && sqrChr.getVar("eclipsehive_select").getBool(0)){ + totalDamage = totalDamage * 110 / 100; + } + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONKRUTA,41,0,0,0,totalDamage,sizeRate,0,0,0); + parentObj.sq_PlaySound("SUMMON_KRUTA_SWISH_02"); + break; + case 402: + monsterattack_ksk(parentObj,5); + break; + case 4022: + parentObj.sq_PlaySound("SUMMON_KRUTA_CHARGE"); + break; + case 403: + monsterattack_ksk(parentObj,6); + break; + case 404: + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONKRUTA, SKILL_BYKK_SUMMONKRUTA, 11, eclipsehive_bonus2) + 100; + local sizeRate = 100 + (sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONKRUTA, SKILL_BYKK_SUMMONKRUTA, 15, 1.0) + 100) * 10; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONKRUTA,42,0,0,0,totalDamage,sizeRate,0,0,0); + sq_SetMyShake(parentObj,3,320); + sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/ragefinisheff_01.ani",375,0,0); + sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/ragefinishfloor_f01.ani",375,-1,-1); + parentObj.sq_PlaySound("SUMMON_KRUTA_SMASH"); + break; + case 501: + monsterattack_ksk(parentObj,8); + parentObj.sq_PlaySound("SUMMON_KRUTA_IMPACT"); + break; + case 502: + monsterattack_ksk(parentObj,9); + break; + case 503: + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_REPEATEDSMASHOFRAGE, SKILL_BYKK_REPEATEDSMASHOFRAGE, 0, eclipsehive_bonus2) + 100; + if(sqrChr.getVar("eclipsehive_select").getBool(0)){ + local add_Rate = 0; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 31) > 0) add_Rate = add_Rate + 20; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 32) > 0) add_Rate = add_Rate + 20; + if(add_Rate > 0) totalDamage = totalDamage * (100 + add_Rate) / 100; + } + local sizeRate = 100 + (sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONKRUTA, SKILL_BYKK_SUMMONKRUTA, 15, 1.0) + 100) * 10; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONKRUTA,52,0,0,0,totalDamage,sizeRate,0,0,0); + local hit = parentObj.getVar("skill").get_vector(0); + local pooledObj1, pooledObj2, pooledObj3, pooledObj4; + switch(hit){ + case 4: + pooledObj1 = sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/atkaxeeffect_dust.ani",200,0,0); + pooledObj2 = sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/atkeffectbottom01_crack.ani",200,-1,-1); + pooledObj3 = sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/atkeffectbottom01_rock.ani",200,-1,-1); + pooledObj4 = sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/atkeffecttop01_crack.ani",200,1,1); + break; + case 3: + pooledObj1 = sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/atkaxeeffect_dust.ani",200,0,0); + pooledObj2 = sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/atkeffectbottom02_crack.ani",200,-1,-1); + pooledObj3 = sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/atkeffectbottom02_rock.ani",200,-1,-1); + pooledObj4 = sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/atkeffecttop02_crack.ani",200,1,1); + break; + case 2: + pooledObj1 = sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/atkaxeeffect_dust.ani",200,0,0); + pooledObj2 = sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/atkeffectbottom03_crack.ani",200,-1,-1); + pooledObj3 = sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/atkeffectbottom03_rock.ani",200,-1,-1); + pooledObj4 = sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/atkeffecttop03_crack.ani",200,1,1); + break; + case 1: + pooledObj1 = sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/atkaxeeffect_dust.ani",200,0,0); + pooledObj2 = sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/atkeffectbottom04_crack.ani",200,-1,-1); + pooledObj3 = sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/atkeffectbottom04_rock.ani",200,-1,-1); + pooledObj4 = sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/atkeffecttop04_crack.ani",200,1,1); + break; + } + if(sizeRate > 100){ + local pooledObj = [pooledObj1, pooledObj2, pooledObj3, pooledObj4]; + sizeRate = sizeRate.tofloat() / 100.0; + for(local i = 0; i < 4; i++){ + local pAni = pooledObj[i].getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + } + } + break; + case 504: + sq_SetMyShake(parentObj,5,90); + parentObj.sq_PlaySound("R_SUMMON_KRUTA_STRIKE"); + break; + case 506: + local hitnumber = parentObj.getVar("skill").get_vector(0); + if(hitnumber <= 1){ + monsterattack_ksk(parentObj,10); + } + else{ + parentObj.getVar("skill").set_vector(0, hitnumber - 1); + monsterattack_ksk(parentObj,9); + } + break; + case 5061: + case 6011: + parentObj.sq_PlaySound("SUMMON_KRUTA_SWISH_03"); + break; + case 507: + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_REPEATEDSMASHOFRAGE, SKILL_BYKK_REPEATEDSMASHOFRAGE, 1, eclipsehive_bonus2) + 100; + local sizeRate = 100 + (sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONKRUTA, SKILL_BYKK_SUMMONKRUTA, 15, 1.0) + 100) * 10; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONKRUTA,53,0,0,0,totalDamage,sizeRate,0,0,0); + sq_SetMyShake(parentObj,3,300); + sq_flashScreen(parentObj,0,100,0,102, sq_RGB(255,255,255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + parentObj.getVar("skill").set_vector(0, 4); + sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/finishaxeeffect_dust.ani",400,0,0); + sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/finisheffectbottom_crack.ani",400,-1,-1); + sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/finisheffectbottom_crackb.ani",400,-1,-1); + sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/finisheffecttop_cracka.ani",400,1,1); + sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/finisheffecttop_rock.ani",400,1,1); + parentObj.sq_PlaySound("SUMMON_KRUTA_STRIKE_FINISH"); + break; + case 600: + local pAni = parentObj.getCurrentAnimation(); + local fireT = pAni.getDelaySum(0,20); + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONKRUTA,10,-135,0,80,fireT,0,0,0,0); + parentObj.sq_PlaySound("SUMMON_KRUTA_CHARGE"); + break; + case 601: + monsterattack_ksk(parentObj,12); + break; + case 602: + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_REPEATEDSMASHOFRAGE, -1, 0, 4.4*eclipsehive_bonus2) + sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_REPEATEDSMASHOFRAGE, -1, 1, 1.1*eclipsehive_bonus2) + 200; + local sizeRate = 100 + (sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONKRUTA, SKILL_BYKK_SUMMONKRUTA, 15, 1.0) + 100) * 10; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONKRUTA,6,0,0,0,totalDamage,sizeRate,0,0,0); + sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/finisheffectbottom_crack.ani",300,-1,-1); + sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/finisheffectbottom_crackb.ani",300,-1,-1); + sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/finisheffecttop_rock.ani",300,1,1); + sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/talisman/landingexplosion_eff_00.ani",300,0,0); + parentObj.sq_PlaySound("SUMMON_KRUTA_STRIKE_FINISH"); + break; + case 603: + sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/kruta/animation/finishaxeeffect_dust.ani",300,-1,-1); + break; + case 1001: + local direction = sqrChr.getDirection(); + local yPos = sqrChr.getYPos(); + local zPos = parentObj.getZPos(); + local xPos = sq_GetDistancePos(sqrChr.getXPos(), sqrChr.getDirection(), 50); + sq_MoveToNearMovablePos(parentObj, xPos, yPos, zPos, xPos, yPos, zPos, 100, -1, 5); + sq_SetCurrentDirection(parentObj, direction); + if(!sq_GetSkill(sqrChr, SKILL_BYKK_SUMMONKRUTA).isInCoolTime()) sqrChr.startSkillCoolTime(SKILL_BYKK_SUMMONKRUTA, sq_GetSkillLevel(sqrChr, SKILL_BYKK_SUMMONKRUTA), -1); + break; + case 1002: + local skillIndex = parentObj.getVar("skillIndex").get_vector(0); + monsterattack_ksk(parentObj,skillIndex); + break; + } + return true; +} + +function proc_appendage_kruta_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if((!sqrChr || sqrChr.getState() == STATE_DIE) || (!parentObj || parentObj.getState() == STATE_DIE)){ + appendage.setValid(false); + return; + } + + if(!sq_IsMyControlObject(sqrChr)) return; + + local t_01 = appendage.getVar("skill_1").get_timer_vector(0); + local t_02 = appendage.getVar("skill_2").get_timer_vector(0); + local t_03 = appendage.getVar("skill_3").get_timer_vector(0); + local t_04 = appendage.getVar("skill_4").get_timer_vector(0); + local currentT = appendage.getTimer().Get(); + + local state = parentObj.getState(); + local attackIndex = parentObj.getAttackIndex(); + + switch(state){ + case STATE_STAND: + // appendage.getVar("speed").setBool(0,true); + if(sqrChr.getVar("summonmonsterwait").getBool(0)) monsterattack_ksk(parentObj,14); + local timer = appendage.getVar("atktime").get_ct_vector(0); + local currentTT = timer.Get(); + if(currentTT < ATK_TIME) return; + timer.Reset(); + timer.Start(10000,0); + + local targetObj = sq_FindTarget( parentObj, 0, 1000, 800, 350); + if(targetObj){ + parentObj.getVar("targetObj").clear_obj_vector(); + parentObj.getVar("targetObj").push_obj_vector(targetObj); + local skillt = [t_04,t_03,t_02,t_01]; + local attackIndex = [4,2,1,0]; + local distanceX = [350,200,600,200]; + local distanceXmin = [50,0,0,0]; + local distanceY = [50,40,400,40]; + for(local i = 0;i < skillt.len(); i++){ + if(skillt[i] && skillt[i].isOnEvent(currentT)){ + if(sq_IsMyControlObject(parentObj)){ + if(sq_Abs(targetObj.getXPos() - parentObj.getXPos()) <= distanceX[i] && sq_Abs(targetObj.getXPos() - parentObj.getXPos()) >= distanceXmin[i] && sq_Abs(targetObj.getYPos() - parentObj.getYPos()) <= distanceY[i]){ + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 6) < 1 && i == 0) return; + monsterattack_ksk(parentObj,attackIndex[i]); + return; + } + } + } + } + } + else{ + if(sq_FindTarget( parentObj, -1000, 1000, 800, 350)) sq_SetCurrentDirection(parentObj, sq_GetOppositeDirection(sq_GetDirection(parentObj))); + } + break; + case STATE_ATTACK: + switch(attackIndex){ + case 3: + local pAni = parentObj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + local fireT = 600; + local srcX = parentObj.getVar("skill2").get_vector(0); + local srcY = parentObj.getVar("skill2").get_vector(1); + local MoveX = parentObj.getVar("skill2").get_vector(2); + local MoveY = parentObj.getVar("skill2").get_vector(3); + local v = sq_GetUniformVelocity(0, MoveX, currentT, fireT); + local vy = sq_GetUniformVelocity(0, MoveY, currentT, fireT); + local dstX = sq_GetDistancePos(srcX, parentObj.getDirection(), v); + if(parentObj.isMovablePos(dstX, srcY + vy)){ + sq_setCurrentAxisPos(parentObj, 0, dstX); + sq_setCurrentAxisPos(parentObj, 1, srcY + vy); + } + else{ + parentObj.getVar("skill2").set_vector(0,parentObj.getXPos()); + parentObj.getVar("skill2").set_vector(1,parentObj.getYPos()); + parentObj.getVar("skill2").set_vector(2,0); + parentObj.getVar("skill2").set_vector(3,0) + } + if(currentT > fireT) parentObj.sendStateOnlyPacket(STATE_STAND); + break; + case 14: + if(sqrChr.getVar("summonmonsterwait").getBool(0) == false) parentObj.sendStateOnlyPacket(STATE_STAND); + break; + } + break; + } +} + +function onStart_appendage_kruta_bykk(appendage) +{ + if (!appendage) return; + + appendage.getVar("atktime").clear_ct_vector(); + appendage.getVar("atktime").push_ct_vector(); + local timer = appendage.getVar("atktime").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); +} + +function onEnd_appendage_kruta_bykk(appendage) +{ + if(!appendage) return; + + local parentObj = appendage.getParent(); + if(!parentObj) return; + parentObj.sendDestroyPacket(true); +} + +function onSourceKeyFrameFlag_appendage_lighthigherspirit_bykk(appendage,flagIndex) +{ + if(!appendage) return; + local parentObj = appendage.getParent(); + if(!parentObj){ + appendage.setValid(false); + return true; + } + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if(!sqrChr) return true; + // if(!sq_IsMyControlObject(sqrChr)) return true; + + local eclipsehive_bonus = sqrChr.getVar("eclipsehive_bonus").getInt(10).tofloat() / 100.0; + local eclipsehive_bonus2 = sqrChr.getVar("eclipsehive_bonus").getInt(11).tofloat() / 100.0; + + if(sqrChr.getVar("eclipsehive_select").getBool(0) == true){ + local add_bonus = 0.0; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 24) > 0) add_bonus = add_bonus + 10.0; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 25) > 0) add_bonus = add_bonus + 10.0; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 26) > 0) add_bonus = add_bonus + 20.0; + if(add_bonus > 0) eclipsehive_bonus2 = eclipsehive_bonus2 +add_bonus / 100.0 + } + + switch(flagIndex){ + case 101: + local targetObj = sq_GetCNRDObjectToActiveObject(parentObj.getVar("targetObj").get_obj_vector(0)); + if(targetObj){ + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITLIGHTHIGHER, SKILL_BYKK_SUMMONSPIRITLIGHTHIGHER, 6, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,targetObj,SKILL_BYKK_SUMMONSPIRITLIGHTHIGHER,1,0,0,0,totalDamage,0,0,0,0); + } + break; + case 201: + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITLIGHTHIGHER,2,0,0,0,5,0,0,0,0); + break; + case 301://??嚙踝蕭 + if(CNSquirrelAppendage.sq_IsAppendAppendage(parentObj, "character/mage/k_k_made/appendage/aptomonster/ap_lighthigherspirit_buff.nut")) CNSquirrelAppendage.sq_RemoveAppendage(parentObj, "character/mage/k_k_made/appendage/aptomonster/ap_lighthigherspirit_buff.nut"); + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(parentObj, sqrChr, 77, false, "character/mage/k_k_made/appendage/aptomonster/ap_lighthigherspirit_buff.nut", true); + AddAppendage.sq_SetValidTime(8000); + break; + case 401: + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITLIGHTHIGHER, SKILL_BYKK_SUMMONSPIRITLIGHTHIGHER, 25, eclipsehive_bonus2) + 100; + local subtype = 41; + if(parentObj.getVar("skill4").getBool(0) == true) subtype = 42; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITLIGHTHIGHER,subtype,150,0,0,totalDamage,0,0,0,0); + parentObj.getVar("skill4").setBool(0,false); + break; + case 1001://?嚙踝蕭嚙踝蕭嚙? + local direction = sqrChr.getDirection(); + local yPos = sqrChr.getYPos(); + local zPos = parentObj.getZPos(); + local xPos = sq_GetDistancePos(sqrChr.getXPos(), sqrChr.getDirection(), 50); + sq_MoveToNearMovablePos(parentObj, xPos, yPos, zPos, xPos, yPos, zPos, 100, -1, 5); + sq_SetCurrentDirection(parentObj, direction); + if(!sq_GetSkill(sqrChr, SKILL_BYKK_SUMMONSPIRITLIGHTHIGHER).isInCoolTime()) sqrChr.startSkillCoolTime(SKILL_BYKK_SUMMONSPIRITLIGHTHIGHER, sq_GetSkillLevel(sqrChr, SKILL_BYKK_SUMMONSPIRITLIGHTHIGHER), -1); + break; + case 1002://?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + parentObj.getVar("skill4").setBool(0,true); + monsterattack_ksk(parentObj,3); + break; + case 1005: + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITLIGHTHIGHER,9,100,0,0,0,15,0,0,0); + sq_SendCreatePassiveObjectPacket(parentObj, 1008607, 0, 0, 0, 60, parentObj.getDirection()); + break; + } + return true; +} + +function proc_appendage_lighthigherspirit_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if((!sqrChr || sqrChr.getState() == STATE_DIE) || (!parentObj || parentObj.getState() == STATE_DIE)){ + appendage.setValid(false); + return; + } + + if(!sq_IsMyControlObject(sqrChr)) return; + + local t_01 = appendage.getVar("skill_1").get_timer_vector(0);//?嚙踝蕭?? + local t_02 = appendage.getVar("skill_2").get_timer_vector(0);//??5?? + local t_03 = appendage.getVar("skill_3").get_timer_vector(0);//??嚙踝蕭 + local t_04 = appendage.getVar("skill_4").get_timer_vector(0);//晡嚙踝蕭 + local currentT = appendage.getTimer().Get(); + + local state = parentObj.getState(); + local attackIndex = parentObj.getAttackIndex(); + + switch(state){ + case STATE_STAND: + if(sqrChr.getVar("summonmonsterwait").getBool(0)) monsterattack_ksk(parentObj,5); + local timer = appendage.getVar("atktime").get_ct_vector(0); + local currentTT = timer.Get(); + if(currentTT < ATK_TIME) return; + timer.Reset(); + timer.Start(10000,0); + + local grant_timer = parentObj.getVar("grant").get_ct_vector(0); + if(grant_timer){ + local grant_time = grant_timer.Get(); + if(grant_timer && grant_time >= 4000 + sq_getRandom(0,4000) && sq_FindTarget( parentObj, 0, 400, 80, 200)){ + grant_timer.Reset(); + grant_timer.Start(10000,0); + monsterattack_ksk(parentObj,6); + return; + } + } + + if(t_03 && t_03.isOnEvent(currentT)){ + monsterattack_ksk(parentObj,2); + return; + } + local targetObj = sq_FindTarget( parentObj, 0, 1000, 800, 350); + if(targetObj){ + parentObj.getVar("targetObj").clear_obj_vector(); + parentObj.getVar("targetObj").push_obj_vector(targetObj); + local skillt = [t_04,t_02,t_01]; + local attackIndex = [3,1,0]; + local distanceX = [300,200,300]; + local distanceXmin = [50,0,0]; + local distanceY = [100,30,100]; + for(local i = 0;i < skillt.len(); i++){ + if(skillt[i] && skillt[i].isOnEvent(currentT)){ + if(sq_IsMyControlObject(parentObj)){ + if(sq_Abs(targetObj.getXPos() - parentObj.getXPos()) <= distanceX[i] && sq_Abs(targetObj.getXPos() - parentObj.getXPos()) >= distanceXmin[i] && sq_Abs(targetObj.getYPos() - parentObj.getYPos()) <= distanceY[i]){ + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 12) < 1 && i == 0) return; + monsterattack_ksk(parentObj,attackIndex[i]); + if(parentObj.getVar("lightning").size_vector() > 0){ + local attacknum = parentObj.getVar("lightning").get_vector(0); + parentObj.getVar("lightning").set_vector(0,attacknum + 1); + } + return; + } + } + } + } + } + else{ + if(sq_FindTarget( parentObj, -1000, 1000, 800, 350)) sq_SetCurrentDirection(parentObj, sq_GetOppositeDirection(sq_GetDirection(parentObj))); + } + break; + case STATE_ATTACK: + if(attackIndex == 5){ + if(sqrChr.getVar("summonmonsterwait").getBool(0) == false) parentObj.sendStateOnlyPacket(STATE_STAND); + } + break; + } +} + +function onStart_appendage_lighthigherspirit_bykk(appendage) +{ + if (!appendage) return; + + appendage.getVar("atktime").clear_ct_vector(); + appendage.getVar("atktime").push_ct_vector(); + local timer = appendage.getVar("atktime").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); +} + +function onEnd_appendage_lighthigherspirit_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + if(!parentObj) return; + + parentObj.sendDestroyPacket(true); +} + + +function onSourceKeyFrameFlag_appendage_luis_bykk(appendage,flagIndex) +{ + if(!appendage) return; + local parentObj = appendage.getParent(); + if(!parentObj){ + appendage.setValid(false); + return true; + } + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if(!sqrChr) return true; + // if(!sq_IsMyControlObject(sqrChr)) return true; + + local eclipsehive_bonus = sqrChr.getVar("eclipsehive_bonus").getInt(10).tofloat() / 100.0; + local eclipsehive_bonus2 = sqrChr.getVar("eclipsehive_bonus").getInt(11).tofloat() / 100.0; + + switch(flagIndex){ + case 101://嚙踝蕭? + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 46, 46, 11, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,46,1,0,0,0,totalDamage,0,0,0,0); + break; + case 201://???嚙踝蕭 + local targetObj = sq_GetCNRDObjectToActiveObject(parentObj.getVar("targetObj").get_obj_vector(0)); + if(targetObj){ + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 46, 46, 12, eclipsehive_bonus) + 100; + local etcSub = sq_GetLevelData(sqrChr, 46, 25, sq_GetSkillLevel(sqrChr, 46)); + createPassiveObject_k_k(sqrChr,targetObj,46,2,0,0,0,totalDamage,etcSub,0,0,0); + } + break; + case 301://嚙踝蕭牊 + sq_AddDrawOnlyAniFromParent(parentObj,"passiveobject/madeby_k_k/animation/luis/fireballstart.ani", 85, 1, 80); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 46, 46, 13, eclipsehive_bonus) + 100; + local etcSub = sq_GetLevelData(sqrChr, 46, 25, sq_GetSkillLevel(sqrChr, 46)); + createPassiveObject_k_k(sqrChr,parentObj,46,3,65,0,100,totalDamage,etcSub,0,0,0); + break; + case 401://嚙??嚙? + local targetObj = sq_GetCNRDObjectToActiveObject(parentObj.getVar("targetObj").get_obj_vector(0)); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 46, 46, 14, eclipsehive_bonus) + 100; + local etcSub = sq_GetLevelData(sqrChr, 46, 25, sq_GetSkillLevel(sqrChr, 46)); + createPassiveObject_k_k(sqrChr,targetObj,46,4,0,0,0,totalDamage,etcSub,0,0,0); + break; + case 501://嚙??嚙? + local etcSub = sq_GetLevelData(sqrChr, 46, 25, sq_GetSkillLevel(sqrChr, 46)), bonusRate = 1; + if(sqrChr.getVar("eclipsehive_select").getBool(0) && parentObj.getVar("ronghe_bool").getBool(0)){//sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 23) > 0 && + bonusRate = sqrChr.getVar("LuisObj").get_obj_vector_size(); + parentObj.getVar("ronghe_bool").setBool(0, false); + } + if(parentObj.getVar("skill").getBool(0) == true){ + parentObj.getVar("skill").setBool(0,false); + local sub = 1; + if(etcSub > 0) sub = 10; + createPassiveObject_k_k(sqrChr,parentObj,46,5,150,0,0,0,sub,etcSub,bonusRate,0); + } + else{ + local targetObj = sq_GetCNRDObjectToActiveObject(parentObj.getVar("targetObj").get_obj_vector(0)); + if(targetObj) createPassiveObject_k_k(sqrChr,targetObj,46,5,0,0,0,0,1,etcSub,bonusRate,0); + } + break; + case 1001://?嚙踝蕭嚙踝蕭嚙? + local direction = sqrChr.getDirection(); + local yPos = sqrChr.getYPos(); + local zPos = parentObj.getZPos(); + local xPos = sq_GetDistancePos(sqrChr.getXPos(), sqrChr.getDirection(), 50); + sq_MoveToNearMovablePos(parentObj, xPos, yPos, zPos, xPos, yPos, zPos, 100, -1, 5); + sq_SetCurrentDirection(parentObj, direction); + if(!sq_GetSkill(sqrChr, SKILL_BYKK_SUMMONLUIS).isInCoolTime()) sqrChr.startSkillCoolTime(SKILL_BYKK_SUMMONLUIS, sq_GetSkillLevel(sqrChr, SKILL_BYKK_SUMMONLUIS), -1); + break; + case 1002://?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + parentObj.getVar("skill").setBool(0,true); + local attackIndex = 4; + if(CNSquirrelAppendage.sq_IsAppendAppendage(parentObj, BLACKLUNATIC_APDPATH)) attackIndex = 10; + local pIntVec = sq_GetGlobalIntVector(); + sq_IntVectorClear(pIntVec); + sq_IntVectorPush(pIntVec, attackIndex); + sq_AddSetStatePacketActiveObject(parentObj, 8, pIntVec, STATE_PRIORITY_USER); + break; + case 2001://月蝕長矛 + local targetObj = sq_GetCNRDObjectToActiveObject(parentObj.getVar("targetObj").get_obj_vector(0)); + if(targetObj){ + parentObj.sq_PlaySound("R_LUIS_ATK"); + parentObj.sq_PlaySound("BLACK_LUNATIC_SPEAR_CAST"); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_BLACKLUNATIC, -1, 3, eclipsehive_bonus) + 100; + local count = sq_GetIntData(sqrChr, SKILL_BYKK_BLACKLUNATIC, 10); + for(local i = 0; i < count; i++){ + local base_X = -200 + i * 50; + local base_Z = 180 + i * 30; + if(i % 2 = 1) base_Z = base_Z + 20; + local angle = sq_ToDegree(sq_Atan2(base_X.tofloat(), (base_Z-30).tofloat())); + local moveX = -base_X; + createPassiveObjectEx_k_k(sqrChr,parentObj,targetObj,SKILL_BYKK_BLACKLUNATIC,1,base_X,0,base_Z,parentObj.getDirection(),totalDamage,angle.tointeger(),moveX,0,0); + } + } + break; + case 2002://月空破碎 + local targetObj = sq_GetCNRDObjectToActiveObject(parentObj.getVar("targetObj").get_obj_vector(0)); + if(targetObj){ + parentObj.sq_PlaySound("R_LUIS_ATK"); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_BLACKLUNATIC, -1, 2, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,targetObj,SKILL_BYKK_BLACKLUNATIC,2,0,0,0,totalDamage,0,0,0,0); + } + break; + case 2003://月光追擊 + local targetObj = sq_GetCNRDObjectToActiveObject(parentObj.getVar("targetObj").get_obj_vector(0)); + if(targetObj){ + parentObj.sq_PlaySound("R_LUIS_ATK"); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_BLACKLUNATIC, -1, 1, eclipsehive_bonus) + 100; + local count = sq_GetIntData(sqrChr, SKILL_BYKK_BLACKLUNATIC, 13); + for(local i = 0; i < count; i++){ + createPassiveObject_k_k(sqrChr,targetObj,SKILL_BYKK_BLACKLUNATIC,3,sq_getRandom(-100,100),sq_getRandom(-50,50),0,totalDamage,0,0,0,0); + } + } + break; + case 2004://黑暗閃電 + parentObj.sq_PlaySound("R_LUIS_ATK"); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_BLACKLUNATIC, -1, 1, eclipsehive_bonus) + 100; + totalDamage = totalDamage * sq_GetIntData(sqrChr, SKILL_BYKK_BLACKLUNATIC, 13) * 110 / 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_BLACKLUNATIC,4,250,0,0,totalDamage,0,0,0,0); + break; + } + return true; +} + +function proc_appendage_luis_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if((!sqrChr || sqrChr.getState() == STATE_DIE) || (!parentObj || parentObj.getState() == STATE_DIE)){ + appendage.setValid(false); + return; + } + + if(!sq_IsMyControlObject(sqrChr)) return; + + local t_01 = appendage.getVar("skill_1").get_timer_vector(0); + local t_02 = appendage.getVar("skill_2").get_timer_vector(0); + local t_03 = appendage.getVar("skill_3").get_timer_vector(0); + local t_04 = appendage.getVar("skill_4").get_timer_vector(0); + local t_05 = appendage.getVar("skill_5").get_timer_vector(0); + local t_06 = appendage.getVar("skill_10").get_timer_vector(0); + local t_07 = appendage.getVar("skill_11").get_timer_vector(0); + local t_08 = appendage.getVar("skill_12").get_timer_vector(0); + local currentT = appendage.getTimer().Get(); + + local state = parentObj.getState(); + local attackIndex = parentObj.getAttackIndex(); + + switch(state){ + case STATE_STAND: + if(sqrChr.getVar("summonmonsterwait").getBool(0)) monsterattack_ksk(parentObj,5); + local timer = appendage.getVar("atktime").get_ct_vector(0); + local currentTT = timer.Get(); + if(currentTT < ATK_TIME) return; + timer.Reset(); + timer.Start(10000,0); + + local targetObj = sq_FindTarget( parentObj, 0, 1000, 800, 350); + if(targetObj){ + parentObj.getVar("targetObj").clear_obj_vector(); + parentObj.getVar("targetObj").push_obj_vector(targetObj); + local skillt = [t_05,t_04,t_03,t_02,t_01]; + local attackIndex = [4,3,2,1,0]; + local distanceX = [800,800,500,800,100]; + local distanceXmin = [0,0,50,0,0]; + local distanceY = [800,800,20,800,20]; + if(CNSquirrelAppendage.sq_IsAppendAppendage(parentObj, BLACKLUNATIC_APDPATH)){ + skillt = [t_08,t_07,t_06]; + attackIndex = [9,8,7]; + distanceX = [600,600,600]; + distanceXmin = [0,0,0]; + distanceY = [200,200,200]; + } + for(local i = 0;i < skillt.len(); i++){ + if(skillt[i] && skillt[i].isOnEvent(currentT)){ + if(sq_IsMyControlObject(parentObj)){ + if(sq_Abs(targetObj.getXPos() - parentObj.getXPos()) <= distanceX[i] && sq_Abs(targetObj.getXPos() - parentObj.getXPos()) >= distanceXmin[i] && sq_Abs(targetObj.getYPos() - parentObj.getYPos()) <= distanceY[i]){ + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 7) < 1 && i == 0 && !CNSquirrelAppendage.sq_IsAppendAppendage(parentObj, BLACKLUNATIC_APDPATH)) return; + monsterattack_ksk(parentObj,attackIndex[i]); + return; + } + } + } + } + } + break; + case STATE_ATTACK: + if(attackIndex == 5){ + if(sqrChr.getVar("summonmonsterwait").getBool(0) == false) parentObj.sendStateOnlyPacket(STATE_STAND); + } + break; + } +} + + +function onStart_appendage_luis_bykk(appendage) +{ + if (!appendage) return; + + appendage.getVar("atktime").clear_ct_vector(); + appendage.getVar("atktime").push_ct_vector(); + local timer = appendage.getVar("atktime").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); +} + +function onEnd_appendage_luis_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + if(!parentObj) return; + parentObj.sendDestroyPacket(true); +} + +function onSourceKeyFrameFlag_appendage_ramos_bykk(appendage,flagIndex) +{ + if(!appendage) return; + local parentObj = appendage.getParent(); + if(!parentObj){ + appendage.setValid(false); + return true; + } + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if(!sqrChr) return true; + // if(!sq_IsMyControlObject(sqrChr)) return true; + + local number = 0; + local bonus = 1.0; + local bonus_Max = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONRAMOS, SKILL_BYKK_SUMMONRAMOS, 23, 1.0) + 1100; + local bonus_deed = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONRAMOS, SKILL_BYKK_SUMMONRAMOS, 24, 1.0) + 100; + local bonus_spirit = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONRAMOS, SKILL_BYKK_SUMMONRAMOS, 25, 1.0) + 100; + local monster_Name_spirit = ["EcheverraObj","DarkhigherspiritObj","LighthigherspiritObj","WaterhigherspiritObj","FirehigherspiritObj","SpiritDarkObj","SpiritFireObj","SpiritLightObj","SpiritWaterObj"]; + local monster_Name_deed = ["SandorObj","AuxoObj","LuisObj","BabydragonObj","KrutaObj","HodorObj"]; + for(local i = 0; i < monster_Name_spirit.len(); i++){ + local monster_num_spirit = sqrChr.getVar(monster_Name_spirit[i]).get_obj_vector_size(); + if(monster_num_spirit > 0) number = number + monster_num_spirit; + } + bonus = bonus + (number * bonus_spirit).tofloat() / 1000.0; + number = 0; + for(local ui = 0; ui < monster_Name_deed.len(); ui++){ + local monster_num_deed = sqrChr.getVar(monster_Name_deed[ui]).get_obj_vector_size(); + if(monster_num_deed > 0) number = number + monster_num_deed; + } + bonus = bonus + (number * bonus_deed).tofloat() / 1000.0; + if(bonus > bonus_Max.tofloat() / 1000.0) bonus = bonus_Max.tofloat() / 1000.0; + + local eclipsehive_bonus = sqrChr.getVar("eclipsehive_bonus").getInt(10).tofloat() / 100.0; + local eclipsehive_bonus2 = sqrChr.getVar("eclipsehive_bonus").getInt(11).tofloat() / 100.0; + + switch(flagIndex){ + case 101://嚙踝蕭? + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONRAMOS, SKILL_BYKK_SUMMONRAMOS, 2, bonus*eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONRAMOS,1,0,0,0,totalDamage,0,0,0,0); + break; + case 201://嚙踝蕭嚙踝蕭1 + local pAni = parentObj.getCurrentAnimation(); + local delay1 = pAni.getDelaySum(0,0); + local delay2 = pAni.getDelaySum(4,4); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONRAMOS, SKILL_BYKK_SUMMONRAMOS, 5, bonus*eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONRAMOS,21,0,0,0,totalDamage,delay1,delay2,0,0); + break; + case 202://嚙踝蕭嚙踝蕭嚙踝蕭2 + monsterattack_ksk(parentObj,2); + break; + case 203://嚙踝蕭嚙踝蕭2 + local pAni = parentObj.getCurrentAnimation(); + local delay1 = pAni.getDelaySum(0,0); + local delay2 = pAni.getDelaySum(1,1); + local delay3 = pAni.getDelaySum(4,4); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONRAMOS, SKILL_BYKK_SUMMONRAMOS, 6, bonus*eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONRAMOS,22,0,0,0,totalDamage,delay1,delay2,delay3,0); + break; + case 301://嚙踝蕭?嚙踝蕭?嚙踝蕭嚙踝蕭嚙踝蕭? + monsterattack_ksk(parentObj,4); + break; + case 302://嚙踝蕭? + local pAni = parentObj.getCurrentAnimation(); + local delay1 = pAni.getDelaySum(0,0); + local delay2 = pAni.getDelaySum(3,3); + local group = sq_GetGroup(parentObj); + local uniqueId = sq_GetUniqueId(parentObj); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONRAMOS, SKILL_BYKK_SUMMONRAMOS, 7, bonus*eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONRAMOS,31,0,0,0,totalDamage,group,uniqueId,delay1,delay2); + break; + case 303://嚙踝蕭?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭?1 + monsterattack_ksk(parentObj,5); + break; + case 304://嚙踝蕭?1 + local pAni = parentObj.getCurrentAnimation(); + local delay1 = pAni.getDelaySum(0,0); + local delay2 = pAni.getDelaySum(4,4); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONRAMOS, SKILL_BYKK_SUMMONRAMOS, 8, bonus*eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONRAMOS,32,0,0,0,totalDamage,delay1,delay2,0,0); + break; + case 305://嚙踝蕭?1嚙踝蕭嚙踝蕭?2 + monsterattack_ksk(parentObj,6); + break; + case 306://嚙踝蕭?2 + local pAni = parentObj.getCurrentAnimation(); + local delay1 = pAni.getDelaySum(0,0); + local delay2 = pAni.getDelaySum(1,1); + local delay3 = pAni.getDelaySum(4,4); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONRAMOS, SKILL_BYKK_SUMMONRAMOS, 9, bonus*eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONRAMOS,33,0,0,0,totalDamage,delay1,delay2,delay3,0); + break; + case 401://嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local pAni = parentObj.getCurrentAnimation(); + local delay = pAni.getDelaySum(0,0); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONRAMOS, SKILL_BYKK_SUMMONRAMOS, 10, bonus*eclipsehive_bonus) + 100; + local totalDamage2 = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONRAMOS, SKILL_BYKK_SUMMONRAMOS, 11, bonus*eclipsehive_bonus) + 100; + local hittime = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONRAMOS, SKILL_BYKK_SUMMONRAMOS, 22, 1.0) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONRAMOS,41,100,0,0,totalDamage,totalDamage2,hittime,delay,0); + break; + case 402://嚙踝蕭?嚙踝蕭 + monsterattack_ksk(parentObj,8); + break; + case 403://嚙踝蕭?嚙踝蕭 + local pAni = parentObj.getCurrentAnimation(); + local delay = pAni.getDelaySum(0,0); + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONRAMOS,42,300,0,75,0,delay,0,0,0); + monsterattack_ksk(parentObj,9); + break; + case 501://?嚙踝蕭 + local pAni = parentObj.getCurrentAnimation(); + local delay = pAni.getDelaySum(0,0); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONRAMOS, SKILL_BYKK_SUMMONRAMOS, 15, bonus*eclipsehive_bonus2) + 100; + local hittime = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONRAMOS, SKILL_BYKK_SUMMONRAMOS, 14, 1.0*eclipsehive_bonus2) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONRAMOS,5,0,0,0,totalDamage,hittime,delay,0,0); + sq_SendCreatePassiveObjectPacket(parentObj, 1008605, 0, 0, 0, 600, parentObj.getDirection()); + break; + case 502: + sq_SendCreatePassiveObjectPacket(parentObj, 1008605, 0, 0, 0, 100, parentObj.getDirection()); + break; + case 601://嚙踝蕭嚙?嚙? + break; + case 602://嚙踝蕭? + local pAni = parentObj.getCurrentAnimation(); + local delay = pAni.getDelaySum(6,6); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONRAMOS, SKILL_BYKK_SUMMONRAMOS, 4, bonus*eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONRAMOS,6,0,0,0,totalDamage,delay,0,0,0); + break; + case 603://嚙踝蕭嚙? + parentObj.sendDestroyPacket(true); + break; + case 701://嚙踝蕭瓊嚙踝蕭?嚙踝蕭嚙? + parentObj.getVar("skill").setBool(0,false); + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONRAMOS,74,0,-1,-1,0,0,0,0,0); + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONRAMOS,75,0,-1,-1,0,0,0,0,0); + sq_SendCreatePassiveObjectPacket(parentObj, 1008605, 0, 0, 0, 600, parentObj.getDirection()); + local objectManager = sqrChr.getObjectManager(); + local objectNumber = objectManager.getCollisionObjectNumber(); + for(local i = 0; i < objectNumber; i++){ + local targetObj = objectManager.getCollisionObject(i); + if(targetObj && targetObj.isObjectType(OBJECTTYPE_ACTIVE) && targetObj.isEnemy(sqrChr)){ + targetObj = sq_GetCNRDObjectToActiveObject(targetObj); + sq_AddDrawOnlyAniFromParent(targetObj,"monster/character/mage/madeby_k_k/ramos/animation/meal/2down_03.ani", 0, 0, 0); + local appendagePath = "character/mage/k_k_made/appendage/aptomonster/debuff/ap_holdedmonster.nut"; + local MasterAppendage = CNSquirrelAppendage.sq_AppendAppendage(targetObj, sqrChr, -1, false, appendagePath, true); + if(MasterAppendage){ + sq_HoldAndDelayDie(targetObj, sqrChr, true, false, false, 100, 5000, ENUM_DIRECTION_NEUTRAL , MasterAppendage); + local validT = MasterAppendage.getAppendageInfo(); + validT.setValidTime(5500); + } + } + } + break; + case 702://嚙踝蕭? + local pAni = parentObj.getCurrentAnimation(); + local delay = pAni.getDelaySum(9,9); + local delay2 = pAni.getDelaySum(10,10); + local delay3 = pAni.getDelaySum(23,23); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_BUGFALL, SKILL_BYKK_BUGFALL, 1, bonus) + 100; + local hittime = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_BUGFALL, SKILL_BYKK_BUGFALL, 2, 1.0) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONRAMOS,71,0,0,0,totalDamage,hittime,delay,delay2,delay3); + break; + case 703://嚙踝蕭??葞?嚙踝蕭?嚙賦ㄛ嚙踝蕭?嚙踝蕭 + local effectObj1 = sqrChr.getVar("RamosEffect1").get_obj_vector(0); + local effectObj2 = sqrChr.getVar("RamosEffect2").get_obj_vector(0); + if(effectObj1) effectObj1.setValid(false); + if(effectObj2) effectObj2.setValid(false); + sq_SendCreatePassiveObjectPacket(parentObj, 1008605, 0, 0, 0, 100, parentObj.getDirection()); + local monsternumber = 0; + local objectManager = sqrChr.getObjectManager(); + local objectNumber = objectManager.getCollisionObjectNumber(); + for(local i = 0; i < objectNumber; i++){ + local targetObj = objectManager.getCollisionObject(i); + if(targetObj && targetObj.isObjectType(OBJECTTYPE_ACTIVE) && targetObj.isEnemy(sqrChr)){ + monsternumber = monsternumber + 1; + } + } + if(monsternumber > 0){ + monsterattack_ksk(parentObj,13); + } + else{ + monsterattack_ksk(parentObj,14); + } + break; + case 704://嚙踝蕭?嚙踝蕭嚙踝蕭? + local pAni = parentObj.getCurrentAnimation(); + local delay = pAni.getDelaySum(0,0); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_BUGFALL, SKILL_BYKK_BUGFALL, 3, bonus) + 100; + local hittime = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_BUGFALL, SKILL_BYKK_BUGFALL, 4, 1.0) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONRAMOS,72,0,0,0,totalDamage,hittime,delay,0,0); + break; + case 705://嚙踝蕭?嚙踝蕭 + monsterattack_ksk(parentObj,15);//14 + break; + case 706://晡嚙踝蕭嚙?+嚙踝蕭嚙踝蕭 + local pAni = parentObj.getCurrentAnimation(); + local delay = pAni.getDelaySum(0,0); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_BUGFALL, SKILL_BYKK_BUGFALL, 5, bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONRAMOS,73,0,0,0,totalDamage,delay,0,0,0); + break; + case 1001://?嚙踝蕭嚙踝蕭嚙? + local direction = sqrChr.getDirection(); + local yPos = sqrChr.getYPos(); + local xPos = sq_GetDistancePos(sqrChr.getXPos(), sqrChr.getDirection(), 50); + sq_MoveToNearMovablePos(parentObj, xPos, yPos, 0, xPos, yPos, 0, 100, -1, 5); + sq_SetCurrentDirection(parentObj, direction); + if(!sq_GetSkill(sqrChr, SKILL_BYKK_SUMMONRAMOS).isInCoolTime()) sqrChr.startSkillCoolTime(SKILL_BYKK_SUMMONRAMOS, sq_GetSkillLevel(sqrChr, SKILL_BYKK_SUMMONRAMOS), -1); + break; + case 1002://?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local attackIndex = 10; + if(parentObj.getVar("skill").getBool(0) == true) attackIndex = 12; + local pIntVec = sq_GetGlobalIntVector(); + sq_IntVectorClear(pIntVec); + sq_IntVectorPush(pIntVec, attackIndex); + sq_AddSetStatePacketActiveObject(parentObj, 8, pIntVec, STATE_PRIORITY_USER); + break; + } + return true; +} + +function proc_appendage_ramos_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if((!sqrChr || sqrChr.getState() == STATE_DIE) || (!parentObj || parentObj.getState() == STATE_DIE)){ + appendage.setValid(false); + return; + } + + if(!sq_IsMyControlObject(sqrChr)) return; + + local t_01 = appendage.getVar("skill_1").get_timer_vector(0);//嚙踝蕭嚙踝蕭嚙踝蕭? + local t_02 = appendage.getVar("skill_2").get_timer_vector(0);//?? + local t_03 = appendage.getVar("skill_3").get_timer_vector(0);//?嚙踝蕭 + local t_04 = appendage.getVar("skill_4").get_timer_vector(0);//?嚙踝蕭 + local currentT = appendage.getTimer().Get(); + + local state = parentObj.getState(); + local attackIndex = parentObj.getAttackIndex(); + + if(sqrChr.getState() == 53){ + monsterattack_ksk(parentObj,11); + return; + } + + switch(state){ + case STATE_STAND: + if(sqrChr.getVar("summonmonsterwait").getBool(0)){ + local pIntVec = sq_GetGlobalIntVector(); + sq_IntVectorClear(pIntVec); + sq_IntVectorPush(pIntVec, 16); + sq_AddSetStatePacketActiveObject(parentObj, 8, pIntVec, STATE_PRIORITY_IGNORE_FORCE); + } + local timer = appendage.getVar("atktime").get_ct_vector(0); + local currentTT = timer.Get(); + if(currentTT < ATK_TIME) return; + timer.Reset(); + timer.Start(10000,0); + + local targetObj = sq_FindTarget( parentObj, 0, 1000, 800, 350); + if(targetObj){ + parentObj.getVar("targetObj").clear_obj_vector(); + parentObj.getVar("targetObj").push_obj_vector(targetObj); + local skillt = [t_04,t_03,t_02,t_01]; + local attackIndex = [10,7,3,1]; + local distanceX = [400,350,800,200]; + local distanceXmin = [0,0,0,0]; + local distanceY = [50,30,600,30]; + for(local i = 0;i < skillt.len(); i++){ + if(skillt[i] && skillt[i].isOnEvent(currentT)){ + if(sq_IsMyControlObject(parentObj)){ + if(sq_Abs(targetObj.getXPos() - parentObj.getXPos()) <= distanceX[i] && sq_Abs(targetObj.getXPos() - parentObj.getXPos()) >= distanceXmin[i] && sq_Abs(targetObj.getYPos() - parentObj.getYPos()) <= distanceY[i]){ + monsterattack_ksk(parentObj,attackIndex[i]); + if(attackIndex[i] == 2){ + parentObj.getVar("move").set_vector(0,parentObj.getXPos()); + parentObj.getVar("move").set_vector(1,150); + } + return; + } + } + } + } + } + else{ + if(sq_FindTarget( parentObj, -1000, 1000, 800, 350)) sq_SetCurrentDirection(parentObj, sq_GetOppositeDirection(sq_GetDirection(parentObj))); + } + break; + case STATE_ATTACK: + switch(attackIndex){ + case 4: + local targetObj = sq_GetCNRDObjectToActiveObject(parentObj.getVar("targetObj").get_obj_vector(0)); + if(targetObj){ + if(sq_GetDistanceObject(parentObj, targetObj, false) < 90){ + monsterattack_ksk(parentObj,5); + return; + } + local pAni = parentObj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + local fireT = 600;//pAni.getDelaySum(0,3); + local X1 = sq_GetAccel(parentObj.getXPos(), targetObj.getXPos(), currentT, fireT, true); + local Y1 = sq_GetAccel(parentObj.getYPos(), targetObj.getYPos(), currentT, fireT, true); + if(parentObj.isMovablePos(X1, Y1)){ + sq_setCurrentAxisPos(parentObj, 0, X1); + sq_setCurrentAxisPos(parentObj, 1, Y1); + } + } + break; + case 16: + if(sqrChr.getVar("summonmonsterwait").getBool(0) == false) parentObj.sendStateOnlyPacket(STATE_STAND); + break; + } + break; + } +} + +function onStart_appendage_ramos_bykk(appendage) +{ + if (!appendage) return; + local parentObj = appendage.getParent(); + if(sq_IsMyControlObject(parentObj)){ + monsterattack_ksk(parentObj,0); + } + + appendage.getVar("atktime").clear_ct_vector(); + appendage.getVar("atktime").push_ct_vector(); + local timer = appendage.getVar("atktime").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); +} + +function onEnd_appendage_ramos_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + if(!parentObj) return; + // parentObj.sendDestroyPacket(true); + parentObj.setValid(false); +} + +function onAttackParent_appendage_ramos_bykk(appendage, realAttacker, damager, boundingBox, isStuck) +{ + if(!appendage) return; + local parentObj = appendage.getParent(); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + local attackIndex = parentObj.getAttackIndex(); + switch(attackIndex){ + case 10: + if(damager && !CNSquirrelAppendage.sq_IsAppendAppendage(damager, "character/mage/k_k_made/appendage/aptomonster/debuff/ap_pulledmonster.nut")){ + local appendagePath = "character/mage/k_k_made/appendage/aptomonster/debuff/ap_pulledmonster.nut"; + damager = sq_GetCNRDObjectToActiveObject(damager); + local MasterAppendage = CNSquirrelAppendage.sq_AppendAppendage(damager, sqrChr, -1, false, appendagePath, true); + if(MasterAppendage){ + sq_AccelMoveToAppendageForce(damager, sqrChr, parentObj, 200, 0, 0, 1000, true, MasterAppendage, true); + local validT = MasterAppendage.getAppendageInfo() + validT.setValidTime(2000); + } + } + break; + } +} + +function onSourceKeyFrameFlag_appendage_sandor_bykk(appendage,flagIndex) +{ + if(!appendage) return; + local parentObj = appendage.getParent(); + if(!parentObj){ + appendage.setValid(false); + return true; + } + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if(!sqrChr) return true; + // if(!sq_IsMyControlObject(sqrChr)) return true; + + local eclipsehive_bonus = sqrChr.getVar("eclipsehive_bonus").getInt(10).tofloat() / 100.0; + local eclipsehive_bonus2 = sqrChr.getVar("eclipsehive_bonus").getInt(11).tofloat() / 100.0; + + switch(flagIndex){ + case 101://?嚙踝蕭 + local pAni = parentObj.getCurrentAnimation(); + local delay1 = pAni.getDelaySum(4,4); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSANDOR, SKILL_BYKK_SUMMONSANDOR, 12, eclipsehive_bonus) + 100; + local group = sq_GetGroup(parentObj); + local uniqueId = sq_GetUniqueId(parentObj); + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 35) > 0 && sqrChr.getVar("eclipsehive_select").getBool(0) == true){ + totalDamage = totalDamage * 70 / 100; + } + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSANDOR,1,0,0,0,totalDamage,delay1,group,uniqueId,0); + break; + case 102: + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 33) > 0 && sqrChr.getVar("eclipsehive_select").getBool(0) == false){ + if(parentObj.getVar("attackbool").getBool(0)){ + parentObj.getVar("attackbool").setBool(0, false); + parentObj.getVar("move").set_vector(0,parentObj.getXPos()); + parentObj.getVar("move").set_vector(1,0); + parentObj.getVar("move").set_vector(2,0); + parentObj.getVar("move").set_vector(3,4); + monsterattack_ksk(parentObj,0); + } + else{ + parentObj.getVar("attackbool").setBool(0, true); + } + } + break; + case 201://嚙踝蕭嚙踝蕭 + local pAni = parentObj.getCurrentAnimation(); + local delay1 = pAni.getDelaySum(4,4); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSANDOR, SKILL_BYKK_SUMMONSANDOR, 14, eclipsehive_bonus) + 100; + local group = sq_GetGroup(parentObj); + local uniqueId = sq_GetUniqueId(parentObj); + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 35) > 0 && sqrChr.getVar("eclipsehive_select").getBool(0) == true){ + totalDamage = totalDamage * 70 / 100; + } + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSANDOR,1,0,0,0,totalDamage,delay1,group,uniqueId,0); + break; + case 202: + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 34) > 0){ + parentObj.getVar("attackbool").setBool(1, true); + parentObj.getVar("move").set_vector(0,parentObj.getXPos()); + parentObj.getVar("move").set_vector(1,0); + parentObj.getVar("move").set_vector(2,0); + parentObj.getVar("move").set_vector(3,4); + monsterattack_ksk(parentObj,0); + } + break; + case 301: + local attackIndex = parentObj.getAttackIndex(); + switch(attackIndex){ + case 2: + local hpMax = parentObj.getHpMax(); + local hp = parentObj.getHp(); + parentObj.setHp((hp + hpMax / 100 * 20).tointeger(), null, true); + break; + case 3: + if(!CNSquirrelAppendage.sq_IsAppendAppendage(parentObj, "character/mage/k_k_made/appendage/aptomonster/skill_ap/ap_sandor_buff.nut")){ + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(parentObj, sqrChr, 44, false, "character/mage/k_k_made/appendage/aptomonster/skill_ap/ap_sandor_buff.nut", true); + AddAppendage.getVar("sqrChr").clear_obj_vector(); + AddAppendage.getVar("sqrChr").push_obj_vector(sqrChr); + AddAppendage.sq_SetValidTime(35000); + AddAppendage.getVar("custominfo").clear_vector(); + AddAppendage.getVar("custominfo").push_vector(300); + AddAppendage.getVar("custominfo").push_vector(20); + AddAppendage.getVar("custominfo").push_vector(20); + local skill_level = sq_GetSkillLevel(sqrChr, 44); + AddAppendage.getVar("custominfo").push_vector(skill_level); + + AddAppendage.getVar("a").clear_timer_vector(); + AddAppendage.getVar("a").push_timer_vector(); + local t = AddAppendage.getVar("a").get_timer_vector(0); + t.setParameter(1500, -1); + t.resetInstant(0); + + } + break; + } + break; + case 401: + local pAni = parentObj.getCurrentAnimation(); + local delay1 = pAni.getDelaySum(7,7); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSANDOR, SKILL_BYKK_SUMMONSANDOR, 16, eclipsehive_bonus2) + 100; + local sizeRate = 100; + local add_Rate = 0; + if(sqrChr.getVar("eclipsehive_select").getBool(0)){ + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 33) > 0){ + sizeRate = sizeRate + 10; add_Rate = add_Rate + 10; + } + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 34) > 0){ + sizeRate = sizeRate + 20; add_Rate = add_Rate + 20; + } + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 35) > 0){ + sizeRate = sizeRate + 20; + } + } + if(add_Rate > 0) totalDamage = totalDamage * (100 + add_Rate) / 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSANDOR,4,25,0,50,totalDamage,delay1,sizeRate,0,0); + break; + case 501: + for(local i = 0; i < 12; i++){ + sq_ReleaseActiveStatus(parentObj, i); + } + break; + case 1001: + local direction = parentObj.getVar("teleport").getInt(10); + local yPos = parentObj.getVar("teleport").getInt(12); + local xPos = parentObj.getVar("teleport").getInt(11); + sq_MoveToNearMovablePos(parentObj, xPos, yPos, 0, xPos, yPos, 0, 100, -1, 5); + sq_SetCurrentDirection(parentObj, direction); + sq_SimpleMoveToNearMovablePos(parentObj,200); + if(!sq_GetSkill(sqrChr, SKILL_BYKK_SUMMONSANDOR).isInCoolTime()) sqrChr.startSkillCoolTime(SKILL_BYKK_SUMMONSANDOR, sq_GetSkillLevel(sqrChr, SKILL_BYKK_SUMMONSANDOR), -1); + break; + case 1002: + parentObj.getVar("move").set_vector(0,parentObj.getXPos()); + parentObj.getVar("move").set_vector(1,80); + parentObj.getVar("move").set_vector(2,7); + parentObj.getVar("move").set_vector(3,16); + monsterattack_ksk(parentObj,4); + break; + } + return true; +} + +function proc_appendage_sandor_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if((!sqrChr || sqrChr.getState() == STATE_DIE) || (!parentObj || parentObj.getState() == STATE_DIE)){ + appendage.setValid(false); + return; + } + + if(!sq_IsMyControlObject(sqrChr)) return; + + local t_01 = appendage.getVar("skill_1").get_timer_vector(0); + local t_02 = appendage.getVar("skill_2").get_timer_vector(0); + local t_03 = appendage.getVar("skill_3").get_timer_vector(0); + local t_04 = appendage.getVar("skill_4").get_timer_vector(0); + local t_05 = appendage.getVar("skill_5").get_timer_vector(0); + local currentT = appendage.getTimer().Get(); + + local state = parentObj.getState(); + local attackIndex = parentObj.getAttackIndex(); + + switch(state){ + case STATE_STAND: + if(sqrChr.getVar("summonmonsterwait").getBool(0)) monsterattack_ksk(parentObj,5); + local timer = appendage.getVar("atktime").get_ct_vector(0); + local currentTT = timer.Get(); + if(currentTT < ATK_TIME) return; + timer.Reset(); + timer.Start(10000,0); + + if(t_03 && t_03.isOnEvent(currentT)){ + monsterattack_ksk(parentObj,2); + return; + } + else if(t_04 && t_04.isOnEvent(currentT)){ + monsterattack_ksk(parentObj,3); + return; + } + local targetObj = sq_FindTarget( parentObj, 0, 1000, 800, 350); + if(targetObj){ + parentObj.getVar("targetObj").clear_obj_vector(); + parentObj.getVar("targetObj").push_obj_vector(targetObj); + local skillt = [t_05,t_02,t_01]; + local attackIndex = [4,1,0]; + local distanceX = [300,200,200]; + local distanceXmin = [0,0,0]; + local distanceY = [30,20,20]; + for(local i = 0;i < skillt.len(); i++){ + if(skillt[i] && skillt[i].isOnEvent(currentT)){ + if(sq_IsMyControlObject(parentObj)){ + if(sq_Abs(targetObj.getXPos() - parentObj.getXPos()) <= distanceX[i] && sq_Abs(targetObj.getXPos() - parentObj.getXPos()) >= distanceXmin[i] && sq_Abs(targetObj.getYPos() - parentObj.getYPos()) <= distanceY[i]){ + if(i == 2){ + parentObj.getVar("move").set_vector(0,parentObj.getXPos()); + parentObj.getVar("move").set_vector(1,30); + parentObj.getVar("move").set_vector(2,0); + parentObj.getVar("move").set_vector(3,4); + } + else if(i == 1){ + parentObj.getVar("move").set_vector(0,parentObj.getXPos()); + parentObj.getVar("move").set_vector(1,60); + parentObj.getVar("move").set_vector(2,4); + parentObj.getVar("move").set_vector(3,6); + } + else if(i == 0){ + parentObj.getVar("move").set_vector(0,parentObj.getXPos()); + parentObj.getVar("move").set_vector(1,60); + parentObj.getVar("move").set_vector(2,7); + parentObj.getVar("move").set_vector(3,16); + } + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 9) < 1 && i == 0) return; + monsterattack_ksk(parentObj,attackIndex[i]); + return; + } + } + } + } + } + else{ + if(sq_FindTarget( parentObj, -1000, 1000, 800, 350)) sq_SetCurrentDirection(parentObj, sq_GetOppositeDirection(sq_GetDirection(parentObj))); + } + break; + case STATE_ATTACK: + switch(attackIndex){ + case 0: + case 1: + case 4: + local pAni = parentObj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + if(attackIndex == 1) currentT = currentT - pAni.getDelaySum(0, 3); + if(attackIndex == 4) currentT = currentT - pAni.getDelaySum(0, 6); + local frameIndex = sq_GetAnimationFrameIndex(pAni); + local framestart = parentObj.getVar("move").get_vector(2); + local frameend = parentObj.getVar("move").get_vector(3); + local fireT = pAni.getDelaySum(framestart, frameend); + local srcX = parentObj.getVar("move").get_vector(0); + local MoveX = parentObj.getVar("move").get_vector(1); + local v = sq_GetAccel(0, MoveX, currentT, fireT, false); + local dstX = sq_GetDistancePos(srcX, parentObj.getDirection(), v); + if(frameIndex >= framestart && frameIndex <= frameend){ + if(parentObj.isMovablePos(dstX,parentObj.getYPos())){ + sq_setCurrentAxisPos(parentObj, 0, dstX); + } + else{ + parentObj.getVar("skill2").set_vector(0,parentObj.getXPos()); + parentObj.getVar("move").set_vector(1,0); + } + } + break; + case 5: + if(sqrChr.getVar("summonmonsterwait").getBool(0) == false) parentObj.sendStateOnlyPacket(STATE_STAND); + break; + } + break; + case STATE_SIT_FOREVER: + case STATE_DAMAGE: + case STATE_HOLD: + local timer = parentObj.getVar().get_ct_vector(0); + local currentT = timer.Get(); + if(currentT > 5000){ + monsterattack_ksk(parentObj,7); + timer.Reset();//嚙踝蕭嚙踝蕭嚙? + timer.Start(10000,0);//???嚙? + return; + } + break; + } +} + +function onStart_appendage_sandor_bykk(appendage) +{ + if (!appendage) return; + //local parentObj = appendage.getParent(); + + appendage.getVar("atktime").clear_ct_vector(); + appendage.getVar("atktime").push_ct_vector(); + local timer = appendage.getVar("atktime").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); +} + +function onEnd_appendage_sandor_bykk(appendage) +{ + if (!appendage) return; + local parentObj = appendage.getParent(); + if(!parentObj) return; + parentObj.sendDestroyPacket(true); +} + +function onSourceKeyFrameFlag_appendage_spirit_bykk(appendage,flagIndex) +{ + if(!appendage) return; + local parentObj = appendage.getParent(); + if(!parentObj){ + appendage.setValid(false); + return true; + } + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if(!sqrChr) return true; + // if(!sq_IsMyControlObject(sqrChr)) return true; + + local eclipsehive_bonus = sqrChr.getVar("eclipsehive_bonus").getInt(10).tofloat() / 100.0; + local eclipsehive_bonus2 = sqrChr.getVar("eclipsehive_bonus").getInt(11).tofloat() / 100.0; + + if(sqrChr.getVar("eclipsehive_select").getBool(0) == false){ + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 36) > 0) eclipsehive_bonus = eclipsehive_bonus + 0.1; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 37) > 0) eclipsehive_bonus = eclipsehive_bonus + 0.1; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 38) > 0){ + if(flagIndex != 201 && flagIndex != 202 && flagIndex != 203 && flagIndex != 1002) eclipsehive_bonus = eclipsehive_bonus + 0.6; + else eclipsehive_bonus = eclipsehive_bonus + 0.1; + } + } + + switch(flagIndex){ + case 101://嚙踝蕭1 + local pAni = parentObj.getCurrentAnimation(); + local delay1 = pAni.getDelaySum(2,2); + local delay2 = pAni.getDelaySum(3,3); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITDARK, SKILL_BYKK_SUMMONSPIRITDARK, 5, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITCOMMON,101,0,0,0,totalDamage,delay1,delay2,0,0); + break; + case 102://嚙踝蕭2 + local pAni = parentObj.getCurrentAnimation(); + local delay1 = pAni.getDelaySum(4,4); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITDARK, SKILL_BYKK_SUMMONSPIRITDARK, 5, 1.2*eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITCOMMON,102,0,0,0,totalDamage,delay1,0,0,0); + break; + case 201://嚙踝蕭1 + case 202://嚙踝蕭1 + local pAni = parentObj.getCurrentAnimation(); + local delay1 = pAni.getDelaySum(1,1); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITFIRE, SKILL_BYKK_SUMMONSPIRITFIRE, 6, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITCOMMON,201,0,0,0,totalDamage,delay1,0,0,0); + break; + case 203: + local targetObj = sq_GetCNRDObjectToActiveObject(parentObj.getVar("targetObj").get_obj_vector(0)); + if(targetObj){ + parentObj.getVar("skill2").set_vector(0,parentObj.getXPos()); + parentObj.getVar("skill2").set_vector(1,parentObj.getYPos()); + local moveX = sq_Abs(targetObj.getXPos() - parentObj.getXPos()) + sq_getRandom(0,60); + parentObj.getVar("skill2").set_vector(2,moveX); + parentObj.getVar("skill2").set_vector(3,targetObj.getYPos() - parentObj.getYPos()); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITFIRE, SKILL_BYKK_SUMMONSPIRITFIRE, 6, 1.2*eclipsehive_bonus) + 100; + local group = sq_GetGroup(parentObj); + local uniqueId = sq_GetUniqueId(parentObj); + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITCOMMON,202,0,0,0,totalDamage,500,group,uniqueId,0); + } + monsterattack_ksk(parentObj,4); + break; + case 301://嚙踝蕭1 + local pAni = parentObj.getCurrentAnimation(); + local delay1 = pAni.getDelaySum(3,3); + local delay2 = pAni.getDelaySum(5,5); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITLIGHT, SKILL_BYKK_SUMMONSPIRITLIGHT, 6, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITCOMMON,301,0,0,0,totalDamage,delay1,delay2,0,0); + break; + case 302://嚙踝蕭2 + local pAni = parentObj.getCurrentAnimation(); + local delay1 = pAni.getDelaySum(2,2); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITLIGHT, SKILL_BYKK_SUMMONSPIRITLIGHT, 6, 1.2*eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITCOMMON,302,0,0,0,totalDamage,delay1,0,0,0); + break; + case 401://?1 + local pAni = parentObj.getCurrentAnimation(); + local delay1 = pAni.getDelaySum(2,2); + local delay2 = pAni.getDelaySum(3,3); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITWATER, SKILL_BYKK_SUMMONSPIRITWATER, 6, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITCOMMON,401,0,0,0,totalDamage,delay1,delay2,0,0); + break; + case 402://?2 + local targetObj = sq_GetCNRDObjectToActiveObject(parentObj.getVar("targetObj").get_obj_vector(0)); + if(targetObj){ + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITWATER, SKILL_BYKK_SUMMONSPIRITWATER, 6, 1.2*eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,targetObj,SKILL_BYKK_SUMMONSPIRITCOMMON,402,0,0,0,totalDamage,0,0,0,0); + } + break; + case 1001://?嚙踝蕭嚙踝蕭嚙? + local direction = sqrChr.getDirection(); + local yPos = sqrChr.getYPos()+sq_getRandom(-10,10); + local xPos = sq_GetDistancePos(sqrChr.getXPos(), sqrChr.getDirection(), 200+sq_getRandom(-20,20)); + sq_MoveToNearMovablePos(parentObj, xPos, yPos, 0, xPos, yPos, 0, 100, -1, 5); + sq_SetCurrentDirection(parentObj, direction); + break; + case 1002://?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local Index = parentObj.getCollisionObjectIndex(); + local skill_level = sq_GetSkillLevel(sqrChr, 49); + switch(Index){ + case MONSTER_ID_SPIRITDARK://嚙踝蕭 + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 49, 49, 20, 1.0) + 100,sizeRate = sq_GetBonusRateWithPassive(sqrChr, 49, 49, 19, 1.0) + 100,prob = sq_GetLevelData(sqrChr,49, 21, skill_level),time = sq_GetLevelData(sqrChr,49, 23, skill_level); + local Ex_level = sq_GetSkillLevel(sqrChr, 53); + if(Ex_level > 0){ + totalDamage = sq_GetBonusRateWithPassive(sqrChr, 53, 53, 1, 1.0) + 100; + sizeRate = sq_GetBonusRateWithPassive(sqrChr, 53, 53, 0, 1.0) + 100; + prob = sq_GetLevelData(sqrChr,53, 2, Ex_level); + time = sq_GetLevelData(sqrChr,53, 4, Ex_level); + } + if(sqrChr.getVar("eclipsehive_select").getBool(0)){ + local add_Rate = 0, add_Rate2 = 0; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 36) > 0){add_Rate = add_Rate + 10; add_Rate2 = add_Rate2 + 10;} + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 37) > 0){add_Rate = add_Rate + 10; add_Rate2 = add_Rate2 + 10;} + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 38) > 0){add_Rate = add_Rate + 30;} + if(add_Rate > 0){ sizeRate = sizeRate * (100 + add_Rate) / 100; totalDamage = totalDamage * (100 + add_Rate2) / 100; } + } + local sub = 1002; + if(sqrChr.getVar("sacrifice").getBool(0)){ + sub = 1001; + sqrChr.getVar("sacrifice").setBool(0, false); + } + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITCOMMON,sub,0,0,20,totalDamage,sizeRate,1,prob,time); + break; + case MONSTER_ID_SPIRITFIRE://嚙踝蕭 + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 49, 49, 7, 1.0) + 100,sizeRate = sq_GetBonusRateWithPassive(sqrChr, 49, 49, 6, 1.0) + 100,prob = sq_GetLevelData(sqrChr,49, 8, skill_level),time = sq_GetLevelData(sqrChr,49, 10, skill_level); + local Ex_level = sq_GetSkillLevel(sqrChr, 51); + if(Ex_level > 0){ + totalDamage = sq_GetBonusRateWithPassive(sqrChr, 51, 51, 1, 1.0) + 100; + sizeRate = sq_GetBonusRateWithPassive(sqrChr, 51, 51, 0, 1.0) + 100; + prob = sq_GetLevelData(sqrChr,51, 2, Ex_level); + time = sq_GetLevelData(sqrChr,51, 4, Ex_level); + } + if(sqrChr.getVar("eclipsehive_select").getBool(0)){ + local add_Rate = 0, add_Rate2 = 0; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 36) > 0){add_Rate = add_Rate + 10; add_Rate2 = add_Rate2 + 10;} + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 37) > 0){add_Rate = add_Rate + 10; add_Rate2 = add_Rate2 + 10;} + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 38) > 0){add_Rate = add_Rate + 30;} + if(add_Rate > 0){ sizeRate = sizeRate * (100 + add_Rate) / 100; totalDamage = totalDamage * (100 + add_Rate2) / 100; } + } + local sub = 1002; + if(sqrChr.getVar("sacrifice").getBool(1)){ + sub = 1001; + sqrChr.getVar("sacrifice").setBool(1, false); + } + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITCOMMON,sub,0,0,35,totalDamage,sizeRate,2,prob,time); + break; + case MONSTER_ID_SPIRITLIGHT://嚙踝蕭 + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 49, 49, 26, 1.0) + 100,sizeRate = sq_GetBonusRateWithPassive(sqrChr, 49, 49, 25, 0.67) + 100,prob = sq_GetLevelData(sqrChr,49, 27, skill_level),time = sq_GetLevelData(sqrChr,49, 29, skill_level); + local Ex_level = sq_GetSkillLevel(sqrChr, 54); + if(Ex_level > 0){ + totalDamage = sq_GetBonusRateWithPassive(sqrChr, 54, 54, 1, 1.0) + 100; + sizeRate = sq_GetBonusRateWithPassive(sqrChr, 54, 54, 0, 0.67) + 100; + prob = sq_GetLevelData(sqrChr,54, 2, Ex_level); + time = sq_GetLevelData(sqrChr,54, 4, Ex_level); + } + if(sqrChr.getVar("eclipsehive_select").getBool(0)){ + local add_Rate = 0, add_Rate2 = 0; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 36) > 0){add_Rate = add_Rate + 10; add_Rate2 = add_Rate2 + 10;} + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 37) > 0){add_Rate = add_Rate + 10; add_Rate2 = add_Rate2 + 10;} + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 38) > 0){add_Rate = add_Rate + 30;} + if(add_Rate > 0){ sizeRate = sizeRate * (100 + add_Rate) / 100; totalDamage = totalDamage * (100 + add_Rate2) / 100; } + } + local sub = 1002; + if(sqrChr.getVar("sacrifice").getBool(2)){ + sub = 1001; + sqrChr.getVar("sacrifice").setBool(2, false); + } + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITCOMMON,sub,0,0,35,totalDamage,sizeRate,3,prob,time); + break; + case MONSTER_ID_SPIRITWATER://? + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 49, 49, 15, 1.0) + 100,sizeRate = sq_GetBonusRateWithPassive(sqrChr, 49, 49, 14, 0.2) + 100,prob = sq_GetLevelData(sqrChr,49, 16, skill_level),time = sq_GetLevelData(sqrChr,49, 18, skill_level); + local Ex_level = sq_GetSkillLevel(sqrChr, 52); + if(Ex_level > 0){ + totalDamage = sq_GetBonusRateWithPassive(sqrChr, 52, 52, 1, 1.0) + 100; + sizeRate = sq_GetBonusRateWithPassive(sqrChr, 52, 52, 0, 0.2) + 100; + prob = sq_GetLevelData(sqrChr,52, 2, Ex_level); + time = sq_GetLevelData(sqrChr,52, 4, Ex_level); + } + if(sqrChr.getVar("eclipsehive_select").getBool(0)){ + local add_Rate = 0, add_Rate2 = 0; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 36) > 0){add_Rate = add_Rate + 10; add_Rate2 = add_Rate2 + 10;} + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 37) > 0){add_Rate = add_Rate + 10; add_Rate2 = add_Rate2 + 10;} + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 38) > 0){add_Rate = add_Rate + 30;} + if(add_Rate > 0){ sizeRate = sizeRate * (100 + add_Rate) / 100; totalDamage = totalDamage * (100 + add_Rate2) / 100; } + } + local sub = 1002; + if(sqrChr.getVar("sacrifice").getBool(3)){ + sub = 1001; + sqrChr.getVar("sacrifice").setBool(3, false); + } + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITCOMMON,sub,0,0,35,totalDamage,sizeRate,4,prob,time); + break; + } + parentObj.setValid(false); + break; + } + return true; +} + +function proc_appendage_spirit_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if((!sqrChr || sqrChr.getState() == STATE_DIE) || (!parentObj || parentObj.getState() == STATE_DIE)){ + appendage.setValid(false); + return; + } + + if(!sq_IsMyControlObject(sqrChr)) return; + + local t_01 = appendage.getVar("skill_1").get_timer_vector(0);//嚙踝蕭嚙踝蕭1 + local t_02 = appendage.getVar("skill_2").get_timer_vector(0);//嚙踝蕭嚙踝蕭2 + local currentT = appendage.getTimer().Get(); + + local state = parentObj.getState(); + local attackIndex = parentObj.getAttackIndex(); + local Index = parentObj.getCollisionObjectIndex(); + + switch(state){ + case STATE_STAND: + if(sqrChr.getVar("summonmonsterwait").getBool(0)) monsterattack_ksk(parentObj,2); + local timer = appendage.getVar("atktime").get_ct_vector(0); + local currentTT = timer.Get(); + local tiaozheng = 0; + if(sqrChr.getVar("eclipsehive_select").getBool(0) == false){ + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 37) > 0) tiaozheng = tiaozheng - 100; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 38) > 0) tiaozheng = tiaozheng - 100; + } + if(currentTT < ATK_TIME + tiaozheng) return; + timer.Reset(); + timer.Start(10000,0); + + local targetObj = sq_FindTarget( parentObj, 0, 1000, 800, 350); + if(targetObj){ + parentObj.getVar("targetObj").clear_obj_vector(); + parentObj.getVar("targetObj").push_obj_vector(targetObj); + local skillt = [t_02,t_01],attackIndex = [1,0],distanceX,distanceY; + switch(Index){ + case MONSTER_ID_SPIRITDARK://嚙踝蕭 + distanceX = [75,50];distanceY = [15,8]; + break; + case MONSTER_ID_SPIRITFIRE://嚙踝蕭 + distanceX = [400,50];distanceY = [300,8]; + break; + case MONSTER_ID_SPIRITLIGHT://嚙踝蕭 + distanceX = [150,100];distanceY = [35,8]; + break; + case MONSTER_ID_SPIRITWATER://? + distanceX = [400,75];distanceY = [400,8]; + break; + } + for(local i = 0;i < skillt.len(); i++){ + if(skillt[i] && skillt[i].isOnEvent(currentT)){ + if(sq_IsMyControlObject(parentObj)){ + if(sq_Abs(targetObj.getXPos() - parentObj.getXPos()) <= distanceX[i] && sq_Abs(targetObj.getYPos() - parentObj.getYPos()) <= distanceY[i]){ + monsterattack_ksk(parentObj,attackIndex[i]); + return; + } + } + } + } + } + else{ + if(sq_FindTarget( parentObj, -1000, 1000, 800, 350)) sq_SetCurrentDirection(parentObj, sq_GetOppositeDirection(sq_GetDirection(parentObj))); + } + break; + case STATE_ATTACK: + if(attackIndex == 2){ + if(sqrChr.getVar("summonmonsterwait").getBool(0) == false) parentObj.sendStateOnlyPacket(STATE_STAND); + return; + } + switch(Index){ + case MONSTER_ID_SPIRITDARK://嚙踝蕭 + break; + case MONSTER_ID_SPIRITFIRE://嚙踝蕭 + switch(attackIndex){ + case 4: + local pAni = parentObj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + local fireT = 500; + local srcX = parentObj.getVar("skill2").get_vector(0); + local srcY = parentObj.getVar("skill2").get_vector(1); + local MoveX = parentObj.getVar("skill2").get_vector(2);//嚙?嚙踝蕭嚙綞嚙踝蕭? + local MoveY = parentObj.getVar("skill2").get_vector(3);//嚙?嚙踝蕭嚙緙嚙踝蕭? + local v = sq_GetUniformVelocity(0, MoveX, currentT, fireT); + local vy = sq_GetUniformVelocity(0, MoveY, currentT, fireT); + local dstX = sq_GetDistancePos(srcX, parentObj.getDirection(), v);//嚙踝蕭嚙踝蕭菾嚙踝蕭?蓱?嚙踝蕭?? + if(parentObj.isMovablePos(dstX, srcY + vy)){ + sq_setCurrentAxisPos(parentObj, 0, dstX);//?嚙踝蕭?嚙踝蕭x嚙? + sq_setCurrentAxisPos(parentObj, 1, srcY + vy);//?嚙踝蕭?嚙踝蕭y嚙? + } + else{ + parentObj.getVar("skill2").set_vector(0,parentObj.getXPos()); + parentObj.getVar("skill2").set_vector(1,parentObj.getYPos()); + parentObj.getVar("skill2").set_vector(2,0); + parentObj.getVar("skill2").set_vector(3,0); + } + if(currentT > fireT) parentObj.sendStateOnlyPacket(STATE_STAND); + break; + } + break; + case MONSTER_ID_SPIRITLIGHT://嚙踝蕭 + break; + case MONSTER_ID_SPIRITWATER://? + break; + } + break; + } +} + +function onStart_appendage_spirit_bykk(appendage) +{ + if (!appendage) return; + + appendage.getVar("atktime").clear_ct_vector(); + appendage.getVar("atktime").push_ct_vector(); + local timer = appendage.getVar("atktime").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); +} + +function onEnd_appendage_spirit_bykk(appendage) +{ + if (!appendage) return; + local parentObj = appendage.getParent(); + if(!parentObj) return; + parentObj.sendDestroyPacket(true); +} + + +function onSourceKeyFrameFlag_appendage_waterhigherspirit_bykk(appendage,flagIndex) +{ + if(!appendage) return; + local parentObj = appendage.getParent(); + if(!parentObj){ + appendage.setValid(false); + return true; + } + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if(!sqrChr) return true; + // if(!sq_IsMyControlObject(sqrChr)) return true; + + local eclipsehive_bonus = sqrChr.getVar("eclipsehive_bonus").getInt(10).tofloat() / 100.0; + local eclipsehive_bonus2 = sqrChr.getVar("eclipsehive_bonus").getInt(11).tofloat() / 100.0; + + if(sqrChr.getVar("eclipsehive_select").getBool(0) == true){ + local add_bonus = 0.0; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 24) > 0) add_bonus = add_bonus + 10.0; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 25) > 0) add_bonus = add_bonus + 10.0; + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 26) > 0) add_bonus = add_bonus + 20.0; + if(add_bonus > 0) eclipsehive_bonus2 = eclipsehive_bonus2 +add_bonus / 100.0 + } + + switch(flagIndex){ + case 101: + local targetObj = sq_GetCNRDObjectToActiveObject(parentObj.getVar("targetObj").get_obj_vector(0)); + if(targetObj) createPassiveObject_k_k(sqrChr,targetObj,SKILL_BYKK_SUMMONSPIRITWATERHIGHER,1,0,0,0,0,0,0,0,0); + break; + case 201: + sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/waterhigherspirit/animation/ice_wind.ani",0,0,0); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITWATERHIGHER, SKILL_BYKK_SUMMONSPIRITWATERHIGHER, 7, eclipsehive_bonus) + 100; + local pAni = parentObj.getCurrentAnimation(); + local delay = pAni.getDelaySum(2, 2); + //printp("delay="+delay.tostring()+"\n"); + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITWATERHIGHER,2,0,0,0,totalDamage,delay,0,0,0); + break; + case 301: + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITWATERHIGHER, SKILL_BYKK_SUMMONSPIRITWATERHIGHER, 14, eclipsehive_bonus) + 100; + for(local i = 0; i < 3; i++){ + local xpos = 50; + local zpos = 75; + if(i % 3 == 1){ + xpos = 60; + zpos = 55; + } + else if(i % 3 == 2){ + xpos = 65; + zpos = 100; + } + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITWATERHIGHER,3,xpos,0,zpos,totalDamage,0,0,0,0); + } + break; + case 401: + if(parentObj.getVar("skill4").getBool(0) == false){ + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITWATERHIGHER, SKILL_BYKK_SUMMONSPIRITWATERHIGHER, 19, eclipsehive_bonus2) + 100; + for(local i = 0; i < 7; i++){ + local xpos = 50; + local zpos = 75; + if(i % 3 == 1){ + xpos = 60; + zpos = 55; + } + else if(i % 3 == 2){ + xpos = 65; + zpos = 100; + } + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITWATERHIGHER,3,xpos,0,zpos,totalDamage,0,0,0,0); + } + } + else{ + local pAni = parentObj.getCurrentAnimation(); + pAni.setSpeedRate(150.0); + } + break; + case 402: + if(parentObj.getVar("skill4").getBool(0) == true){ + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITWATERHIGHER,4,150,0,0,0,0,0,0,0); + parentObj.getVar("skill4").setBool(0, false); + } + break; + case 601: + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONSPIRITWATERHIGHER,9,100,0,0,1,0,0,0,0); + sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/waterhigherspirit/animation/ice_wind.ani",0,0,0); + sq_SendCreatePassiveObjectPacket(parentObj, 1008607, 0, 0, 0, sq_getRandom(201,299), parentObj.getDirection()); + break; + case 1001://?嚙踝蕭嚙踝蕭嚙? + local direction = sqrChr.getDirection(); + local yPos = sqrChr.getYPos(); + local zPos = parentObj.getZPos(); + local xPos = sq_GetDistancePos(sqrChr.getXPos(), sqrChr.getDirection(), 50); + sq_MoveToNearMovablePos(parentObj, xPos, yPos, zPos, xPos, yPos, zPos, 100, -1, 5); + sq_SetCurrentDirection(parentObj, direction); + if(!sq_GetSkill(sqrChr, SKILL_BYKK_SUMMONSPIRITWATERHIGHER).isInCoolTime()) sqrChr.startSkillCoolTime(SKILL_BYKK_SUMMONSPIRITWATERHIGHER, sq_GetSkillLevel(sqrChr, SKILL_BYKK_SUMMONSPIRITWATERHIGHER), -1); + break; + case 1002://?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + parentObj.getVar("skill4").setBool(0, true); + monsterattack_ksk(parentObj,3); + break; + } + return true; +} + +function proc_appendage_waterhigherspirit_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if((!sqrChr || sqrChr.getState() == STATE_DIE) || (!parentObj || parentObj.getState() == STATE_DIE)){ + appendage.setValid(false); + return; + } + + if(!sq_IsMyControlObject(sqrChr)) return; + + local t_01 = appendage.getVar("skill_1").get_timer_vector(0);//晡?嚙踝蕭? + local t_02 = appendage.getVar("skill_2").get_timer_vector(0);//?嚙踝蕭嚙踝蕭? + local t_03 = appendage.getVar("skill_3").get_timer_vector(0);//???嚙踝蕭? + local t_04 = appendage.getVar("skill_4").get_timer_vector(0);//嚙踝蕭嚙踝蕭??? + local currentT = appendage.getTimer().Get(); + + local state = parentObj.getState(); + local attackIndex = parentObj.getAttackIndex(); + + switch(state){ + case STATE_STAND: + if(sqrChr.getVar("summonmonsterwait").getBool(0)) monsterattack_ksk(parentObj,5); + local timer = appendage.getVar("atktime").get_ct_vector(0); + local currentTT = timer.Get(); + if(currentTT < ATK_TIME) return; + timer.Reset(); + timer.Start(10000,0); + + local grant_timer = parentObj.getVar("grant").get_ct_vector(0); + if(grant_timer){ + local grant_time = grant_timer.Get(); + if(grant_timer && grant_time >= 4000 + sq_getRandom(0,4000) && sq_FindTarget( parentObj, 0, 400, 50, 200)){ + grant_timer.Reset(); + grant_timer.Start(10000,0); + monsterattack_ksk(parentObj,6); + return; + } + } + + local targetObj = sq_FindTarget( parentObj, 0, 1000, 800, 350); + if(targetObj){ + parentObj.getVar("targetObj").clear_obj_vector(); + parentObj.getVar("targetObj").push_obj_vector(targetObj); + local skillt = [t_04,t_03,t_02,t_01]; + local attackIndex = [3,2,1,0]; + local distanceX = [400,300,200,300]; + local distanceXmin = [50,50,10,0]; + local distanceY = [20,20,20,100]; + for(local i = 0;i < skillt.len(); i++){ + if(skillt[i] && skillt[i].isOnEvent(currentT)){ + if(sq_IsMyControlObject(parentObj)){ + if(sq_Abs(targetObj.getXPos() - parentObj.getXPos()) <= distanceX[i] && sq_Abs(targetObj.getXPos() - parentObj.getXPos()) >= distanceXmin[i] && sq_Abs(targetObj.getYPos() - parentObj.getYPos()) <= distanceY[i]){ + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 13) < 1 && i == 0) return; + monsterattack_ksk(parentObj,attackIndex[i]); + if(parentObj.getVar("watertornado").size_vector() > 0){ + local attacknum = parentObj.getVar("watertornado").get_vector(0); + parentObj.getVar("watertornado").set_vector(0,attacknum + 1); + } + return; + } + } + } + } + } + else{ + if(sq_FindTarget( parentObj, -1000, 1000, 800, 350)) sq_SetCurrentDirection(parentObj, sq_GetOppositeDirection(sq_GetDirection(parentObj))); + } + break; + case STATE_ATTACK: + if(attackIndex == 5){ + if(sqrChr.getVar("summonmonsterwait").getBool(0) == false) parentObj.sendStateOnlyPacket(STATE_STAND); + } + break; + } +} + +function onStart_appendage_waterhigherspirit_bykk(appendage) +{ + if (!appendage) return; + + appendage.getVar("atktime").clear_ct_vector(); + appendage.getVar("atktime").push_ct_vector(); + local timer = appendage.getVar("atktime").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); +} + +function onEnd_appendage_waterhigherspirit_bykk(appendage) +{ + if (!appendage) return; + local parentObj = appendage.getParent(); + if(!parentObj) return; + parentObj.sendDestroyPacket(true); +} + +function proc_appendage_whipwithsid_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + if(!parentObj || parentObj.getState() == STATE_DIE){ + appendage.setValid(false); + return; + } + + local sourceObj = appendage.getSource(); + local bonusrater = parentObj.getVar("whip_kk").get_vector(1); + local hitr = parentObj.getVar("whip_kk").get_vector(0); + local ptime = parentObj.getVar("whip_kk").get_vector(2); + + local t_01 = appendage.getVar("atktime").get_timer_vector(0); + local currentT = appendage.getTimer().Get(); + if(t_01 && t_01.isOnEvent(currentT) == true){ + local ap = sq_getNewAttackInfoPacket(); + ap.powerRate = bonusrater; + ap.element = ENUM_ELEMENT_NONE ; + ap.useWeapon = true; + ap.eType = ATTACKTYPE_MAGICAL; + ap.backForce = 2; + ap.upForce = 10; + sq_SendHitObjectPacketByAttackInfo(sourceObj, parentObj, ap); + } + + if(currentT >= ptime * hitr+ 200){ + appendage.setValid(false); + } +} + +function onStart_appendage_whipwithsid_bykk(appendage) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + + local hitr = parentObj.getVar("whip_kk").get_vector(0); + local ptime = parentObj.getVar("whip_kk").get_vector(2); + + appendage.getVar("atktime").clear_timer_vector(); + appendage.getVar("atktime").push_timer_vector(); + local t_01 = appendage.getVar("atktime").get_timer_vector(0); + t_01.setParameter(ptime, hitr); + t_01.resetInstant(0); + +} + +function onEnd_appendage_whipwithsid_bykk(appendage) +{ + if (!appendage) return; + local parentObj = appendage.getParent(); + +} + +function drawAppend_appendage_whipwithsid_bykk(appendage, isOver, x, y, isFlip) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + if (!parentObj){ + appendage.setValid(false); + return; + } + + local var = appendage.getVar(); + local Ani = var.GetAnimationMap("animation", "passiveobject/madeby_k_k/animation/dominionpowerup/dominionpowerupawakening_damage.ani"); + if(Ani && isOver){ + sq_AnimationProc(Ani); + sq_drawCurrentFrame(Ani, x, y + 1, isFlip); + } + +} + + +function onStart_appendage_casillas_skill_bykk(appendage) +{ + if (!appendage) return; + local parentObj = appendage.getParent(); + if(!parentObj) appendage.setValid(false); +} + +function onEnd_appendage_casillas_skill_bykk(appendage) +{ + if (!appendage) return; + local parentObj = appendage.getParent(); + local drawnumber = parentObj.getVar("drawobj").get_obj_vector_size(); + for(local i = 0; i < drawnumber; i++){ + local drawObj = parentObj.getVar("drawobj").get_obj_vector(i); + if(drawObj){ + drawObj.setValid(false); + } + } + parentObj.getVar("drawobj").clear_obj_vector(); +} + +function onDamageParent_appendage_casillas_skill_bykk(appendage ,attacker, boundingBox, isStuck) +{ + if (!appendage) return; + local parentObj = appendage.getParent(); + local sourceObj = appendage.getSource(); + if(!parentObj || parentObj.getState() == STATE_DIE) appendage.setValid(false); + + local ring_number = parentObj.getVar("casillasatck").get_vector(0); + if(attacker.isObjectType(OBJECTTYPE_PASSIVE)){ + local colObj = sq_GetCNRDObjectToCollisionObject(attacker); + if(colObj.getCollisionObjectIndex() == 24381 && colObj.getVar("skillIndex").get_vector(0) == 82 && colObj.getVar("subtype").get_vector(0) != 100){ + ring_number = ring_number + 1; + parentObj.getVar("casillasatck").set_vector(0, ring_number); + ring_number = parentObj.getVar("casillasatck").get_vector(0); + if(ring_number >= 3){ + parentObj.getVar("casillasatck").set_vector(0, 0); + local totalDamage = sq_GetBonusRateWithPassive(sourceObj, SKILL_BYKK_SUMMONCASILLAS, SKILL_BYKK_SUMMONCASILLAS, 11, 1.0) + 100; + createPassiveObject_k_k(sourceObj,parentObj,SKILL_BYKK_SUMMONCASILLAS,100,0,0, sq_GetCenterZPos(boundingBox),totalDamage,0,0,0,0); + } + } + + } +} + +function drawAppend_appendage_casillas_skill_bykk(appendage, isOver, x, y, isFlip) +{ + if (!appendage) return; + local parentObj = appendage.getParent(); + if (!parentObj){ + appendage.setValid(false); + return; + } + + local ring_number = parentObj.getVar("casillasatck").get_vector(0); + local size = 1.5; + local var = appendage.getVar(); + local Ani_01 = var.GetAnimationMap("animation_01", "passiveobject/madeby_k_k/animation/casillas/skill/skill01.ani"); + local Ani_02 = var.GetAnimationMap("animation_02", "passiveobject/madeby_k_k/animation/casillas/skill/skill01.ani"); + Ani_02.setImageRateFromOriginal(size, size); + local hight = parentObj.getZPos(); + if(ring_number < 1) return; + if(ring_number >= 1 && Ani_01 && !isOver){ + sq_AnimationProc(Ani_01); + sq_drawCurrentFrame(Ani_01, x, y + hight, isFlip); + } + if(ring_number >= 2 && Ani_01 && !isOver){ + sq_AnimationProc(Ani_02); + sq_drawCurrentFrame(Ani_02, x, y + hight, isFlip); + } +} + + +function onStart_appendage_spikekings_grant_bykk(appendage) +{ + if (!appendage) return; + // print("test"); + local monsterObj = appendage.getParent(); + monsterObj.getVar("grant").clear_ct_vector(); + monsterObj.getVar("grant").push_ct_vector(); + local timer = monsterObj.getVar("grant").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); +} + +function onEnd_appendage_spikekings_grant_bykk(appendage) +{ + if (!appendage) return; + local monsterObj = appendage.getParent(); + monsterObj.getVar("grant").clear_ct_vector(); +} + +function drawAppend_appendage_spikekings_grant_bykk(appendage, isOver, x, y, isFlip) +{ + if (!appendage) return; + + local parentObj = appendage.getParent(); + if (!parentObj){ + appendage.setValid(false); + return; + } + + local monster_id = appendage.getVar().get_vector(0); + if(!monster_id || monster_id <= 0) return; + + local var = appendage.getVar(); + local Ani_01; + local Ani_02; + + switch(monster_id){ + case MONSTER_ID_DARKHIGHERSPIRIT: + case MONSTER_ID_LIGHTHIGHERSPIRIT: + Ani_01 = var.GetAnimationMap("animation_01", "passiveobject/madeby_k_k/animation/spikeking/newskill/buff_animation/loop_circle_element.ani"); + Ani_02 = var.GetAnimationMap("animation_02", "passiveobject/madeby_k_k/animation/spikeking/newskill/buff_animation/loop_energy_element.ani"); + break; + case MONSTER_ID_FIREHIGHERSPIRIT: + Ani_01 = var.GetAnimationMap("animation_01", "passiveobject/madeby_k_k/animation/spikeking/newskill/buff_animation/loop_circle_red.ani"); + Ani_02 = var.GetAnimationMap("animation_02", "passiveobject/madeby_k_k/animation/spikeking/newskill/buff_animation/loop_energy_red.ani"); + break; + case MONSTER_ID_WATERHIGHERSPIRIT: + Ani_01 = var.GetAnimationMap("animation_01", "passiveobject/madeby_k_k/animation/spikeking/newskill/buff_animation/loop_circle_blue.ani"); + Ani_02 = var.GetAnimationMap("animation_02", "passiveobject/madeby_k_k/animation/spikeking/newskill/buff_animation/loop_energy_blue.ani"); + break; + } + local hight = parentObj.getZPos(); + if(Ani_01 && !isOver){ + sq_AnimationProc(Ani_01); + sq_drawCurrentFrame(Ani_01, x, y + hight, isFlip); + } + if(Ani_02 && isOver){ + sq_AnimationProc(Ani_02); + sq_drawCurrentFrame(Ani_02, x, y + hight, isFlip); + } +} + +function whip_bykk(obj,subtype) +{ + local skill_level_01 = sq_GetSkillLevel(obj, SKILL_BYKK_DOMINIONPOWERUP);//??嚙踝蕭嚙踝蕭嚙? + local skill_level_02 = sq_GetSkillLevel(obj, SKILL_BYKK_ECLIPSEHIVE);//?嚙踝蕭旓?嚙踝蕭? + switch(subtype){ + case 1: + if(skill_level_01 > 0){//嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + if(obj.getVar("whip_kk").getBool(0) == true){// + if(skill_level_02 > 0){ + obj.sq_SetCurrentAnimation(ANI_WHIP_AWAKENING_02);//?嚙踝蕭 + } + else{ + obj.sq_SetCurrentAnimation(ANI_WHIP_EX_02);//?嚙踝蕭 + } + /*local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo){ + sq_SetCurrentAttackPower(attackInfo, -1); + sq_SetCurrentAttackBonusRate(attackInfo, 100); + }*/ + obj.getVar("whip_kk").setBool(0,false); + obj.getVar("whip_kk").setBool(1,false); + } + else{//嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭嚙? + if(skill_level_02 > 0){ + obj.sq_SetCurrentAnimation(ANI_WHIP_AWAKENING_01);//?嚙踝蕭 + obj.getVar("whip_kk").setBool(1,true); + } + else{ + obj.sq_SetCurrentAnimation(ANI_WHIP_EX_01);//?嚙踝蕭 + } + /*local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo){ + sq_SetCurrentAttackPower(attackInfo, -1); + sq_SetCurrentAttackBonusRate(attackInfo, 100); + }*/ + obj.getVar("whip_kk").setBool(0,true); + } + } + else{ + //local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/whiptomonsterswing2.ani", 0, 0, 0); + //local animation = pooledObj.getCurrentAnimation(); + //sq_SetFrameDelayTime(animation, 0, 40); + //sq_SetFrameDelayTime(animation, 1, 40); + obj.sq_AddStateLayerAnimation(1,obj.sq_CreateCNRDAnimation("effect/animation/whiptomonsterswing2.ani"), 0, 0); + } + break; + case 2: + if(skill_level_01 > 0){ + if(obj.getVar("whip_kk").getBool(0) == true){ + obj.setSkillCommandEnable(20,true); + local b_useskill = obj.sq_IsEnterSkill(20); + if(b_useskill != -1){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(20); + obj.sq_AddSetStatePacket(24, STATE_PRIORITY_USER, true); + } + } + } + break; + case 3: + local state = obj.sq_GetState(); + if(state == 24){ + if(!obj.isEnemy(damager)){ + local pooledObj = sq_CreateDrawOnlyObject(obj, "passiveobject/madeby_k_k/animation/whip/whiptomonsterhitnewbuff.ani", ENUM_DRAWLAYER_COVER, true); + pooledObj.setCurrentPos(damager.getXPos(),damager.getYPos(), sq_GetCenterZPos(bounding_box)); + } + else{ + if(obj.getVar("whip_kk").getBool(1) == true){ + local hitr = 5; + local totalDamage1 = sq_GetBonusRateWithPassive(obj, 20, 20, 14, 1.0) + 100; + local totalDamage2 = sq_GetBonusRateWithPassive(obj, 20, 20, 16, 1.0) + 100; + local bonusrater = (totalDamage1 + totalDamage2) / 2 / hitr; + local ptime = 500; + damager.getVar("whip_kk").clear_vector(); + damager.getVar("whip_kk").push_vector(hitr); + damager.getVar("whip_kk").push_vector(bonusrater); + damager.getVar("whip_kk").push_vector(ptime); + if(CNSquirrelAppendage.sq_IsAppendAppendage(damager, "character/mage/k_k_made/appendage/aptoemeny/ap_whipwithsid.nut")) CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/k_k_made/appendage/aptoemeny/ap_whipwithsid.nut"); + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(damager, obj, 24, false, "character/mage/k_k_made/appendage/aptoemeny/ap_whipwithsid.nut", true); + } + } + } + break; + } +} + +function onattack_whip_k_k(obj, damager, bounding_box, is_stuck) +{ + local state = obj.sq_GetState(); + if(state == 24){ + if(!obj.isEnemy(damager)){ + local pooledObj = sq_CreateDrawOnlyObject(obj, "passiveobject/madeby_k_k/animation/whip/whiptomonsterhitnewbuff.ani", ENUM_DRAWLAYER_COVER, true); + pooledObj.setCurrentPos(damager.getXPos(),damager.getYPos(), sq_GetCenterZPos(bounding_box)); + if(damager.isObjectType(OBJECTTYPE_ACTIVE)) damager = sq_GetCNRDObjectToActiveObject(damager); + if(sq_GetLevelData(obj, 20, 17, sq_GetSkillLevel(obj, 20)) > 0) obj.sq_SetSuperArmorUntilTime(damager, 40000); + } + else{ + if(obj.getVar("whip_kk").getBool(1) == true){ + local hitr = 5; + local totalDamage1 = sq_GetBonusRateWithPassive(obj, 20, 20, 14, 1.0) + 100; + local totalDamage2 = sq_GetBonusRateWithPassive(obj, 20, 20, 16, 1.0) + 100; + local bonusrater = (totalDamage1 + totalDamage2) / 2 / hitr; + local ptime = 500; + damager.getVar("whip_kk").clear_vector(); + damager.getVar("whip_kk").push_vector(hitr); + damager.getVar("whip_kk").push_vector(bonusrater); + damager.getVar("whip_kk").push_vector(ptime); + if(CNSquirrelAppendage.sq_IsAppendAppendage(damager, "character/mage/k_k_made/appendage/aptoemeny/ap_whipwithsid.nut")) CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/k_k_made/appendage/aptoemeny/ap_whipwithsid.nut"); + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(damager, obj, 24, false, "character/mage/k_k_made/appendage/aptoemeny/ap_whipwithsid.nut", true); + } + if(damager.isObjectType(OBJECTTYPE_ACTIVE)){ + local activeObj = sq_GetCNRDObjectToActiveObject(damager); + if(activeObj.getCollisionObjectIndex() == 66473 || activeObj.getCollisionObjectIndex() == 66467){ + local group = sq_GetGroup(activeObj); + local uniqueId = sq_GetUniqueId(activeObj); + createPassiveObject_k_k(obj,activeObj,SKILL_BYKK_MOONSHADOW,3,0,0,sq_GetObjectHeight(activeObj) / 2,10,group,uniqueId,0,0); + } + } + } + } +} + +function onChangeSkillEffect_Mage_summoner(obj, skillIndex, reciveData) +{ + if(!obj) return; + print("test"); + switch(skillIndex){ + case SKILL_BYKK_COMMUNION: + local subtype = reciveData.readDword(); + switch(subtype){ + case 1: + local id = reciveData.readDword(); + local monster_obj = sq_GetCNRDObjectToActiveObject(sq_GetObject(obj, reciveData.readDword(), reciveData.readDword())); + switch(id){ + case MONSTER_ID_RAMOS: + setMonsterAppendage_Summoner_byKK(obj, monster_obj, "character/mage/k_k_made/appendage/aptomonster/ap_ramos.nut", "RamosObj", 122); + break; + case MONSTER_ID_KRUTA: + setMonsterAppendage_Summoner_byKK(obj, monster_obj, "character/mage/k_k_made/appendage/aptomonster/ap_kruta.nut", "KrutaObj", 121); + break; + case MONSTER_ID_HEILROM: + setMonsterAppendage_Summoner_byKK(obj, monster_obj, "character/mage/k_k_made/appendage/aptomonster/ap_heilrom.nut", "HeilromObj", 119); + break; + case MONSTER_ID_ECHEVERRA: + setMonsterAppendage_Summoner_byKK(obj, monster_obj, "character/mage/k_k_made/appendage/aptomonster/ap_echeverra.nut", "EcheverraObj", 47); + break; + case MONSTER_ID_SANDOR: + setMonsterAppendage_Summoner_byKK(obj, monster_obj, "character/mage/k_k_made/appendage/aptomonster/ap_sandor.nut", "SandorObj", 44); + break; + case MONSTER_ID_AUXO: + setMonsterAppendage_Summoner_byKK(obj, monster_obj, "character/mage/k_k_made/appendage/aptomonster/ap_auxoex.nut", "AuxoObj", 45); + break; + case MONSTER_ID_AUXOOLD: + setMonsterAppendage_Summoner_byKK(obj, monster_obj, "character/mage/k_k_made/appendage/aptomonster/ap_auxo.nut", "AuxoObj", 45); + break; + case MONSTER_ID_LIGHTHIGHERSPIRIT: + setMonsterAppendage_Summoner_byKK(obj, monster_obj, "character/mage/k_k_made/appendage/aptomonster/ap_lighthigherspirit.nut", "LighthigherspiritObj", 77); + break; + case MONSTER_ID_FIREHIGHERSPIRIT: + setMonsterAppendage_Summoner_byKK(obj, monster_obj, "character/mage/k_k_made/appendage/aptomonster/ap_firehigherspirit.nut", "FirehigherspiritObj", 79); + break; + case MONSTER_ID_DARKHIGHERSPIRIT: + setMonsterAppendage_Summoner_byKK(obj, monster_obj, "character/mage/k_k_made/appendage/aptomonster/ap_darkhigherspirit.nut", "DarkhigherspiritObj", 76); + break; + case MONSTER_ID_WATERHIGHERSPIRIT: + setMonsterAppendage_Summoner_byKK(obj, monster_obj, "character/mage/k_k_made/appendage/aptomonster/ap_waterhigherspirit.nut", "WaterhigherspiritObj", 78); + break; + case MONSTER_ID_LUIS: + setMonsterAppendage_Summoner_byKK(obj, monster_obj, "character/mage/k_k_made/appendage/aptomonster/ap_luis.nut", "LuisObj", 46); + break; + case MONSTER_ID_BABYDRAGON: + setMonsterAppendage_Summoner_byKK(obj, monster_obj, "character/mage/k_k_made/appendage/aptomonster/ap_babydragon.nut", "BabydragonObj", 80); + break; + case MONSTER_ID_CASILLAS: + setMonsterAppendage_Summoner_byKK(obj, monster_obj, "character/mage/k_k_made/appendage/aptomonster/ap_casillas.nut", "CassillasObj", 82); + break; + case MONSTER_ID_HODOR: + setMonsterAppendage_Summoner_byKK(obj, monster_obj, "character/mage/k_k_made/appendage/aptomonster/ap_hodor.nut", "HodorObj", 25); + break; + case MONSTER_ID_SPIRITDARK://嚙踝蕭 + setMonsterAppendage_Summoner_byKK(obj, monster_obj, "character/mage/k_k_made/appendage/aptomonster/ap_spirit.nut", "SpiritDarkObj", 23); + break; + case MONSTER_ID_SPIRITFIRE://嚙踝蕭 + setMonsterAppendage_Summoner_byKK(obj, monster_obj, "character/mage/k_k_made/appendage/aptomonster/ap_spirit.nut", "SpiritFireObj", 21); + break; + case MONSTER_ID_SPIRITLIGHT://嚙踝蕭 + setMonsterAppendage_Summoner_byKK(obj, monster_obj, "character/mage/k_k_made/appendage/aptomonster/ap_spirit.nut", "SpiritLightObj", 24); + break; + case MONSTER_ID_SPIRITWATER://? + setMonsterAppendage_Summoner_byKK(obj, monster_obj, "character/mage/k_k_made/appendage/aptomonster/ap_spirit.nut", "SpiritWaterObj", 22); + break; + } + break; + } + break; + } +} + +function setMonsterAppendage_Summoner_byKK(obj, monster_obj, appendagepath, monstername, skill_index) +{ + if(!obj) return; + if(!monster_obj) return; + if(appendagepath == null || monstername == null || skill_index == null) return; + appendagepath = appendagepath.tostring(); + monstername = monstername.tostring(); + local monster_obj = sq_GetCNRDObjectToActiveObject(monster_obj); + if(!CNSquirrelAppendage.sq_IsAppendAppendage(monster_obj, appendagepath)){ + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(monster_obj, monster_obj, skill_index, false, appendagepath, true); + AddAppendage.getVar("sqrChr").clear_obj_vector(); + AddAppendage.getVar("sqrChr").push_obj_vector(obj); + local monsternum = obj.getVar(monstername).get_obj_vector_size(); + if(monsternum > 0){ + obj.getVar(monstername).push_obj_vector(monster_obj); + } + else{ + obj.getVar(monstername).clear_obj_vector(); + obj.getVar(monstername).push_obj_vector(monster_obj); + } + setMonsterInfo_Mage(obj, monster_obj, skill_index, AddAppendage); + if(sq_GetSkill(obj, skill_index).isInCoolTime()) obj.endSkillCoolTime(skill_index); + } +} + +function setMonsterInfo_Mage(obj, monster_obj, skill_index, appendage) +{ + if(!obj) return; + + monster_obj.setMapFollowParent(obj); + monster_obj.setMapFollowType(1); + + local cooltime_Balance = obj.getVar("eclipsehive_cooltime").getInt(10); + + local monster_id = monster_obj.getCollisionObjectIndex(); + switch(monster_id){ + case MONSTER_ID_RAMOS: + + local skill_level = sq_GetSkillLevel(obj, skill_index); + local coolt_01 = obj.sq_GetLevelData(skill_index, 19, skill_level) * cooltime_Balance / 100; + local coolt_02 = obj.sq_GetLevelData(skill_index, 20, skill_level) * cooltime_Balance / 100; + local coolt_03 = obj.sq_GetLevelData(skill_index, 21, skill_level) * cooltime_Balance / 100; + local coolt_04 = 12000 * cooltime_Balance / 100; + + appendage.getVar("skill_1").clear_timer_vector(); + appendage.getVar("skill_1").push_timer_vector(); + local t_01 = appendage.getVar("skill_1").get_timer_vector(0); + t_01.setParameter(coolt_01, -1); + t_01.resetInstant(0); + appendage.getVar("skill_2").clear_timer_vector(); + appendage.getVar("skill_2").push_timer_vector(); + local t_02 = appendage.getVar("skill_2").get_timer_vector(0); + t_02.setParameter(coolt_02, -1); + t_02.resetInstant(0); + appendage.getVar("skill_3").clear_timer_vector(); + appendage.getVar("skill_3").push_timer_vector(); + local t_03 = appendage.getVar("skill_3").get_timer_vector(0); + t_03.setParameter(coolt_03, -1); + t_03.resetInstant(0); + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 8) > 0){ + appendage.getVar("skill_4").clear_timer_vector(); + appendage.getVar("skill_4").push_timer_vector(); + local t_04 = appendage.getVar("skill_4").get_timer_vector(0); + t_04.setParameter(coolt_04, -1); + t_04.resetInstant(0); + } + break; + case MONSTER_ID_KRUTA: + + monster_obj.getVar("skill").clear_vector(); + monster_obj.getVar("skill").push_vector(4); + monster_obj.getVar("skill2").clear_vector(); + monster_obj.getVar("skill2").push_vector(0); + monster_obj.getVar("skill2").push_vector(0); + monster_obj.getVar("skill2").push_vector(0); + monster_obj.getVar("skill2").push_vector(0); + monster_obj.getVar("skillIndex").clear_vector(); + monster_obj.getVar("skillIndex").push_vector(7); + + local skill_level = sq_GetSkillLevel(obj, skill_index); + local coolt_01 = obj.sq_GetLevelData(skill_index, 4, skill_level) * cooltime_Balance / 100; + local coolt_02 = obj.sq_GetLevelData(skill_index, 5, skill_level) * cooltime_Balance / 100; + local coolt_03 = obj.sq_GetLevelData(skill_index, 6, skill_level) * cooltime_Balance / 100; + local coolt_04 = 15000 * cooltime_Balance / 100; + + if(obj.getVar("eclipsehive_select").getBool(0) == false){ + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 30) > 0){ + coolt_02 = coolt_02 - 1000; + } + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 31) > 0){ + coolt_03 = coolt_03 - 1000; + } + } + + appendage.getVar("skill_1").clear_timer_vector(); + appendage.getVar("skill_1").push_timer_vector(); + local t_01 = appendage.getVar("skill_1").get_timer_vector(0); + t_01.setParameter(coolt_01, -1); + t_01.resetInstant(0); + if(skill_level >= 5){ + appendage.getVar("skill_2").clear_timer_vector(); + appendage.getVar("skill_2").push_timer_vector(); + local t_02 = appendage.getVar("skill_2").get_timer_vector(0); + t_02.setParameter(coolt_02, -1); + t_02.resetInstant(0); + } + if(skill_level >= 10){ + appendage.getVar("skill_3").clear_timer_vector(); + appendage.getVar("skill_3").push_timer_vector(); + local t_03 = appendage.getVar("skill_3").get_timer_vector(0); + t_03.setParameter(coolt_03, -1); + t_03.resetInstant(0); + } + appendage.getVar("skill_4").clear_timer_vector(); + appendage.getVar("skill_4").push_timer_vector(); + local t_04 = appendage.getVar("skill_4").get_timer_vector(0); + t_04.setParameter(coolt_04, -1); + t_04.resetInstant(0); + + local sizenum = sq_GetLevelData(obj, SKILL_BYKK_SUMMONKRUTA, 15, sq_GetSkillLevel(obj, SKILL_BYKK_SUMMONKRUTA)); + if(sizenum > 0){ + sq_SendCreatePassiveObjectPacket(monster_obj, 1008606, 0, 0, 0, sizenum * 100 - 10, monster_obj.getDirection()); + } + break; + case MONSTER_ID_HEILROM: + local skill_level = sq_GetSkillLevel(obj, skill_index); + local range = obj.sq_GetLevelData(SKILL_BYKK_SUMMONHEILROM, 8, skill_level); + local elementAttack = obj.sq_GetLevelData(SKILL_BYKK_SUMMONHEILROM, 4, skill_level); + local attackSpeed = obj.sq_GetLevelData(SKILL_BYKK_SUMMONHEILROM, 9, skill_level); + local moveSpeed = obj.sq_GetLevelData(SKILL_BYKK_SUMMONHEILROM, 10, skill_level); + local castSpeed = obj.sq_GetLevelData(SKILL_BYKK_SUMMONHEILROM, 11, skill_level); + appendage.getVar("buffPx").clear_vector(); + appendage.getVar("buffPx").push_vector(range); + appendage.getVar("buffPx").push_vector(elementAttack); + appendage.getVar("buffPx").push_vector(attackSpeed); + appendage.getVar("buffPx").push_vector(moveSpeed); + appendage.getVar("buffPx").push_vector(castSpeed); + appendage.getVar("buffPx").push_vector(skill_level); + appendage.getVar("buff01").clear_timer_vector(); + appendage.getVar("buff01").push_timer_vector(); + local t = appendage.getVar("buff01").get_timer_vector(0); + t.setParameter(1000, -1); + t.resetInstant(0); + appendage.getVar("buff02").push_timer_vector(); + local t2 = appendage.getVar("buff02").get_timer_vector(0); + t2.setParameter(15000, -1); + t2.resetInstant(0); + break; + case MONSTER_ID_ECHEVERRA: + local skill_level = sq_GetSkillLevel(obj, skill_index); + local coolt_01 = obj.sq_GetLevelData(skill_index, 4, skill_level) * cooltime_Balance / 100; + local coolt_02 = obj.sq_GetLevelData(skill_index, 5, skill_level) * cooltime_Balance / 100; + local coolt_03 = obj.sq_GetLevelData(skill_index, 7, skill_level) * cooltime_Balance / 100; + local coolt_04 = obj.sq_GetLevelData(skill_index, 6, skill_level) * cooltime_Balance / 100; + local coolt_05 = obj.sq_GetLevelData(skill_index, 9, skill_level) * cooltime_Balance / 100; + local coolt_06 = 15000 * cooltime_Balance / 100; + + local isBool = obj.sq_GetLevelData(skill_index, 14, skill_level) + if(isBool < 1){ + appendage.getVar("skill_1").clear_timer_vector(); + appendage.getVar("skill_1").push_timer_vector(); + local t_01 = appendage.getVar("skill_1").get_timer_vector(0); + t_01.setParameter(coolt_01, -1); + t_01.resetInstant(0); + } + appendage.getVar("skill_2").clear_timer_vector(); + appendage.getVar("skill_2").push_timer_vector(); + local t_02 = appendage.getVar("skill_2").get_timer_vector(0); + t_02.setParameter(coolt_02, -1); + t_02.resetInstant(0); + appendage.getVar("skill_3").clear_timer_vector(); + appendage.getVar("skill_3").push_timer_vector(); + local t_03 = appendage.getVar("skill_3").get_timer_vector(0); + t_03.setParameter(coolt_03, -1); + t_03.resetInstant(0); + if(skill_level >= 5){ + appendage.getVar("skill_4").clear_timer_vector(); + appendage.getVar("skill_4").push_timer_vector(); + local t_04 = appendage.getVar("skill_4").get_timer_vector(0); + t_04.setParameter(coolt_04, -1); + t_04.resetInstant(0); + } + if(skill_level >= 10){ + appendage.getVar("skill_5").clear_timer_vector(); + appendage.getVar("skill_5").push_timer_vector(); + local t_05 = appendage.getVar("skill_5").get_timer_vector(0); + t_05.setParameter(coolt_05, -1); + t_05.resetInstant(0); + } + appendage.getVar("skill_6").clear_timer_vector(); + appendage.getVar("skill_6").push_timer_vector(); + local t_06 = appendage.getVar("skill_6").get_timer_vector(0); + t_06.setParameter(coolt_06, -1); + t_06.resetInstant(0); + if(sq_GetIntData(obj, 47, 13) > 0 && !obj.getVar("grant").get_ct_vector(0)){ + obj.getVar("grant").clear_ct_vector(); + obj.getVar("grant").push_ct_vector(); + local timer = obj.getVar("grant").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); + } + break; + case MONSTER_ID_SANDOR: + + monster_obj.getVar("move").clear_vector(); + monster_obj.getVar("move").push_vector(0); + monster_obj.getVar("move").push_vector(0); + monster_obj.getVar("move").push_vector(0); + monster_obj.getVar("move").push_vector(0); + + monster_obj.getVar().clear_ct_vector();//?嚙? + monster_obj.getVar().push_ct_vector();//吤嚙踝蕭 + local timer = monster_obj.getVar().get_ct_vector(0);//嚙踝蕭嚙踝蕭 + timer.Reset();//嚙踝蕭嚙踝蕭嚙? + timer.Start(10000,0);//???嚙? + + local skill_level = sq_GetSkillLevel(obj, skill_index); + local coolt_01 = obj.sq_GetLevelData(skill_index, 4, skill_level) * cooltime_Balance / 100; + local coolt_02 = obj.sq_GetLevelData(skill_index, 5, skill_level) * cooltime_Balance / 100; + local coolt_03 = obj.sq_GetLevelData(skill_index, 6, skill_level) * cooltime_Balance / 100; + local coolt_04 = obj.sq_GetLevelData(skill_index, 7, skill_level) * cooltime_Balance / 100; + local coolt_05 = 8000 * cooltime_Balance / 100; + + local speedRate = obj.sq_GetLevelData(skill_index, 13, skill_level); + if(speedRate > 0){ + local ap = sq_CreateChangeStatus(CHANGE_STATUS_TYPE_MOVE_SPEED, true, speedRate.tofloat(), 3600000); + if(ap) ap.sq_Append(monster_obj, monster_obj); + local ap2 = sq_CreateChangeStatus(CHANGE_STATUS_TYPE_ATTACK_SPEED, true, speedRate.tofloat(), 3600000); + if(ap2) ap2.sq_Append(monster_obj, monster_obj); + } + + if(obj.getVar("eclipsehive_select").getBool(0) == false){ + local decreaseRate = 0; + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 34) > 0) decreaseRate = decreaseRate - 20; + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 35) > 0) decreaseRate = decreaseRate - 20; + if(decreaseRate < 0){ + coolt_01 = coolt_01 * (100 - decreaseRate) / 100; + coolt_02 = coolt_02 * (100 - decreaseRate) / 100; + } + } + + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 35) > 0){ + if(!CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/k_k_made/appendage/aptomonster/skill_ap/ap_sandor_protect.nut")){ + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, -1, false, "character/mage/k_k_made/appendage/aptomonster/skill_ap/ap_sandor_protect.nut", true); + AddAppendage.setAppendCauseSkill(BUFF_CAUSE_SKILL, ENUM_CHARACTERJOB_MAGE, 44, sq_GetSkillLevel(obj, 44)); + } + } + //else monsterattack_ksk(monster_obj, 3); + + appendage.getVar("skill_1").clear_timer_vector(); + appendage.getVar("skill_1").push_timer_vector(); + local t_01 = appendage.getVar("skill_1").get_timer_vector(0); + t_01.setParameter(coolt_01, -1); + t_01.resetInstant(0); + if(skill_level >= 5){ + appendage.getVar("skill_2").clear_timer_vector(); + appendage.getVar("skill_2").push_timer_vector(); + local t_02 = appendage.getVar("skill_2").get_timer_vector(0); + t_02.setParameter(coolt_02, -1); + t_02.resetInstant(0); + } + if(skill_level >= 10){ + appendage.getVar("skill_3").clear_timer_vector(); + appendage.getVar("skill_3").push_timer_vector(); + local t_03 = appendage.getVar("skill_3").get_timer_vector(0); + t_03.setParameter(coolt_03, -1); + t_03.resetInstant(0); + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 35) < 1){ + appendage.getVar("skill_4").clear_timer_vector(); + appendage.getVar("skill_4").push_timer_vector(); + local t_04 = appendage.getVar("skill_4").get_timer_vector(0); + t_04.setParameter(coolt_04, -1); + t_04.resetInstant(0); + } + } + appendage.getVar("skill_5").clear_timer_vector(); + appendage.getVar("skill_5").push_timer_vector(); + local t_05 = appendage.getVar("skill_5").get_timer_vector(0); + t_05.setParameter(coolt_05, -1); + t_05.resetInstant(0); + break; + case MONSTER_ID_AUXO: + + local skill_level = sq_GetSkillLevel(obj, skill_index); + local coolt_01 = obj.sq_GetLevelData(skill_index, 30, skill_level) * cooltime_Balance / 100; + local coolt_03 = obj.sq_GetLevelData(skill_index, 31, skill_level) * cooltime_Balance / 100; + local coolt_04 = 10000 * cooltime_Balance / 100; + + if(obj.getVar("eclipsehive_select").getBool(0) == false){ + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 21) > 0){ + coolt_01 = coolt_01 * 90 / 100; + coolt_03 = coolt_03 * 90 / 100; + } + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 22) > 0){ + coolt_03 = coolt_03 - 1000; + } + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 23) > 0){ + coolt_03 = coolt_03 - 1000; + } + } + + appendage.getVar("skill_1").clear_timer_vector(); + appendage.getVar("skill_1").push_timer_vector(); + local t_01 = appendage.getVar("skill_1").get_timer_vector(0); + t_01.setParameter(coolt_01, -1); + t_01.resetInstant(0); + appendage.getVar("skill_2").clear_timer_vector(); + appendage.getVar("skill_2").push_timer_vector(); + local t_02 = appendage.getVar("skill_2").get_timer_vector(0); + t_02.setParameter(coolt_03, -1); + t_02.resetInstant(0); + appendage.getVar("skill_3").clear_timer_vector(); + appendage.getVar("skill_3").push_timer_vector(); + local t_03 = appendage.getVar("skill_3").get_timer_vector(0); + t_03.setParameter(coolt_04, -1); + t_03.resetInstant(0); + monster_obj.getVar("Root").clear_vector(); + monster_obj.getVar("Root").push_vector(0); + break; + case MONSTER_ID_AUXOOLD: + + local skill_level = sq_GetSkillLevel(obj, skill_index); + local coolt_01 = obj.sq_GetLevelData(skill_index, 4, skill_level) * cooltime_Balance / 100; + local coolt_02 = obj.sq_GetLevelData(skill_index, 5, skill_level) * cooltime_Balance / 100; + local coolt_03 = obj.sq_GetLevelData(skill_index, 6, skill_level) * cooltime_Balance / 100; + local coolt_04 = 10000 * cooltime_Balance / 150; + + if(obj.getVar("eclipsehive_select").getBool(0) == false){ + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 21) > 0){ + coolt_01 = coolt_01 * 90 / 100; + coolt_02 = coolt_02 * 90 / 100; + coolt_03 = coolt_03 * 90 / 100; + } + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 22) > 0){ + coolt_03 = coolt_03 - 1000; + } + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 23) > 0){ + coolt_03 = coolt_03 - 1000; + } + } + + appendage.getVar("skill_1").clear_timer_vector(); + appendage.getVar("skill_1").push_timer_vector(); + local t_01 = appendage.getVar("skill_1").get_timer_vector(0); + t_01.setParameter(coolt_01, -1); + t_01.resetInstant(0); + if(skill_level >= 5){ + appendage.getVar("skill_2").clear_timer_vector(); + appendage.getVar("skill_2").push_timer_vector(); + local t_02 = appendage.getVar("skill_2").get_timer_vector(0); + t_02.setParameter(coolt_02, -1); + t_02.resetInstant(0); + } + if(skill_level >= 10){ + appendage.getVar("skill_3").clear_timer_vector(); + appendage.getVar("skill_3").push_timer_vector(); + local t_03 = appendage.getVar("skill_3").get_timer_vector(0); + t_03.setParameter(coolt_03, -1); + t_03.resetInstant(0); + } + appendage.getVar("skill_4").clear_timer_vector(); + appendage.getVar("skill_4").push_timer_vector(); + local t_04 = appendage.getVar("skill_4").get_timer_vector(0); + t_04.setParameter(coolt_04, -1); + t_04.resetInstant(0); + break; + case MONSTER_ID_LIGHTHIGHERSPIRIT: + + local skill_level = sq_GetSkillLevel(obj, skill_index); + local coolt_01 = obj.sq_GetLevelData(skill_index, 4, skill_level) * cooltime_Balance / 100; + local coolt_02 = obj.sq_GetLevelData(skill_index, 5, skill_level) * cooltime_Balance / 100; + local coolt_03 = 10000 * cooltime_Balance / 100; + local coolt_04 = 10000 * cooltime_Balance / 100; + + if(obj.getVar("eclipsehive_select").getBool(0) == false){ + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 25) > 0){ + coolt_01 = coolt_01 * 80 / 100; + coolt_02 = coolt_02 * 80 / 100; + } + else if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 24) > 0){ + coolt_01 = coolt_01 * 90 / 100; + coolt_02 = coolt_02 * 90 / 100; + } + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 26) > 0){ + coolt_03 = coolt_03 * 85 /100; + } + } + + appendage.getVar("skill_1").clear_timer_vector(); + appendage.getVar("skill_1").push_timer_vector(); + local t_01 = appendage.getVar("skill_1").get_timer_vector(0); + t_01.setParameter(coolt_01, -1); + t_01.resetInstant(0); + if(skill_level >= 5){ + appendage.getVar("skill_2").clear_timer_vector(); + appendage.getVar("skill_2").push_timer_vector(); + local t_02 = appendage.getVar("skill_2").get_timer_vector(0); + t_02.setParameter(coolt_02, -1); + t_02.resetInstant(0); + } + if(skill_level >= 10){ + appendage.getVar("skill_3").clear_timer_vector(); + appendage.getVar("skill_3").push_timer_vector(); + local t_03 = appendage.getVar("skill_3").get_timer_vector(0); + t_03.setParameter(coolt_03, -1); + t_03.resetInstant(0); + } + appendage.getVar("skill_4").clear_timer_vector(); + appendage.getVar("skill_4").push_timer_vector(); + local t_04 = appendage.getVar("skill_4").get_timer_vector(0); + t_04.setParameter(coolt_04, -1); + t_04.resetInstant(0); + local timer = obj.getVar("pulled").get_ct_vector(0); + if(!timer){ + obj.getVar("pulled").clear_ct_vector(); + obj.getVar("pulled").push_ct_vector(); + local timer = obj.getVar("pulled").get_ct_vector(0); + timer.Reset(); + timer.Start(1000000,0); + } + else{ + timer.Reset(); + timer.Start(1000000,0); + } + break; + case MONSTER_ID_FIREHIGHERSPIRIT: + local skill_level = sq_GetSkillLevel(obj, skill_index); + local coolt_01 = obj.sq_GetLevelData(skill_index, 4, skill_level) * cooltime_Balance / 100; + local coolt_02 = obj.sq_GetLevelData(skill_index, 5, skill_level) * cooltime_Balance / 100; + local coolt_03 = obj.sq_GetLevelData(skill_index, 16, skill_level) * cooltime_Balance / 100; + local coolt_04 = 10000 * cooltime_Balance / 100; + + if(obj.getVar("eclipsehive_select").getBool(0) == false){ + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 25) > 0){ + coolt_01 = coolt_01 * 80 / 100; + coolt_02 = coolt_02 * 80 / 100; + } + else if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 24) > 0){ + coolt_01 = coolt_01 * 90 / 100; + coolt_02 = coolt_02 * 90 / 100; + } + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 26) > 0){ + coolt_03 = coolt_03 * 85 /100; + } + } + + appendage.getVar("skill_1").clear_timer_vector(); + appendage.getVar("skill_1").push_timer_vector(); + local t_01 = appendage.getVar("skill_1").get_timer_vector(0); + t_01.setParameter(coolt_01, -1); + t_01.resetInstant(0); + if(skill_level >= 5){ + appendage.getVar("skill_2").clear_timer_vector(); + appendage.getVar("skill_2").push_timer_vector(); + local t_02 = appendage.getVar("skill_2").get_timer_vector(0); + t_02.setParameter(coolt_02, -1); + t_02.resetInstant(0); + } + if(skill_level >= 10){ + appendage.getVar("skill_3").clear_timer_vector(); + appendage.getVar("skill_3").push_timer_vector(); + local t_03 = appendage.getVar("skill_3").get_timer_vector(0); + t_03.setParameter(coolt_03, -1); + t_03.resetInstant(0); + } + appendage.getVar("skill_4").clear_timer_vector(); + appendage.getVar("skill_4").push_timer_vector(); + local t_04 = appendage.getVar("skill_4").get_timer_vector(0); + t_04.setParameter(coolt_04, -1); + t_04.resetInstant(0); + local timer = obj.getVar("pulled").get_ct_vector(0); + if(!timer){ + obj.getVar("pulled").clear_ct_vector(); + obj.getVar("pulled").push_ct_vector(); + local timer = obj.getVar("pulled").get_ct_vector(0); + timer.Reset(); + timer.Start(1000000,0); + } + else{ + timer.Reset(); + timer.Start(1000000,0); + } + break; + case MONSTER_ID_DARKHIGHERSPIRIT: + local skill_level = sq_GetSkillLevel(obj, skill_index); + local coolt_01 = obj.sq_GetLevelData(skill_index, 4, skill_level) * cooltime_Balance / 100; + local coolt_02 = obj.sq_GetLevelData(skill_index, 5, skill_level) * cooltime_Balance / 100; + local coolt_03 = obj.sq_GetLevelData(skill_index, 17, skill_level) * cooltime_Balance / 100; + local coolt_04 = 10000 * cooltime_Balance / 100; + + if(obj.getVar("eclipsehive_select").getBool(0) == false){ + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 25) > 0){ + coolt_01 = coolt_01 * 80 / 100; + coolt_02 = coolt_02 * 80 / 100; + } + else if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 24) > 0){ + coolt_01 = coolt_01 * 90 / 100; + coolt_02 = coolt_02 * 90 / 100; + } + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 26) > 0){ + coolt_03 = coolt_03 * 85 /100; + } + } + + appendage.getVar("skill_1").clear_timer_vector(); + appendage.getVar("skill_1").push_timer_vector(); + local t_01 = appendage.getVar("skill_1").get_timer_vector(0); + t_01.setParameter(coolt_01, -1); + t_01.resetInstant(0); + if(skill_level >= 5){ + appendage.getVar("skill_2").clear_timer_vector(); + appendage.getVar("skill_2").push_timer_vector(); + local t_02 = appendage.getVar("skill_2").get_timer_vector(0); + t_02.setParameter(coolt_02, -1); + t_02.resetInstant(0); + } + if(skill_level >= 10){ + appendage.getVar("skill_3").clear_timer_vector(); + appendage.getVar("skill_3").push_timer_vector(); + local t_03 = appendage.getVar("skill_3").get_timer_vector(0); + t_03.setParameter(coolt_03, -1); + t_03.resetInstant(0); + } + appendage.getVar("skill_4").clear_timer_vector(); + appendage.getVar("skill_4").push_timer_vector(); + local t_04 = appendage.getVar("skill_4").get_timer_vector(0); + t_04.setParameter(coolt_04, -1); + t_04.resetInstant(0); + // if(skill_level >= 20){ + // monster_obj.getVar("darkaura").clear_vector(); + // monster_obj.getVar("darkaura").push_vector(0); + // } + break; + case MONSTER_ID_WATERHIGHERSPIRIT: + local skill_level = sq_GetSkillLevel(obj, skill_index); + local coolt_01 = obj.sq_GetLevelData(skill_index, 4, skill_level) * cooltime_Balance / 100; + local coolt_02 = obj.sq_GetLevelData(skill_index, 5, skill_level) * cooltime_Balance / 100; + local coolt_03 = obj.sq_GetLevelData(skill_index, 18, skill_level) * cooltime_Balance / 100; + local coolt_04 = 10000 * cooltime_Balance / 100; + + if(obj.getVar("eclipsehive_select").getBool(0) == false){ + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 25) > 0){ + coolt_01 = coolt_01 * 80 / 100; + coolt_02 = coolt_02 * 80 / 100; + } + else if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 24) > 0){ + coolt_01 = coolt_01 * 90 / 100; + coolt_02 = coolt_02 * 90 / 100; + } + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 26) > 0){ + coolt_03 = coolt_03 * 85 /100; + } + } + + appendage.getVar("skill_1").clear_timer_vector(); + appendage.getVar("skill_1").push_timer_vector(); + local t_01 = appendage.getVar("skill_1").get_timer_vector(0); + t_01.setParameter(coolt_01, -1); + t_01.resetInstant(0); + if(skill_level >= 5){ + appendage.getVar("skill_2").clear_timer_vector(); + appendage.getVar("skill_2").push_timer_vector(); + local t_02 = appendage.getVar("skill_2").get_timer_vector(0); + t_02.setParameter(coolt_02, -1); + t_02.resetInstant(0); + } + if(skill_level >= 10){ + appendage.getVar("skill_3").clear_timer_vector(); + appendage.getVar("skill_3").push_timer_vector(); + local t_03 = appendage.getVar("skill_3").get_timer_vector(0); + t_03.setParameter(coolt_03, -1); + t_03.resetInstant(0); + } + appendage.getVar("skill_4").clear_timer_vector(); + appendage.getVar("skill_4").push_timer_vector(); + local t_04 = appendage.getVar("skill_4").get_timer_vector(0); + t_04.setParameter(coolt_04, -1); + t_04.resetInstant(0); + break; + case MONSTER_ID_LUIS: + local skill_level = sq_GetSkillLevel(obj, skill_index); + local coolt_01 = obj.sq_GetLevelData(skill_index, 4, skill_level) * cooltime_Balance / 100; + local coolt_02 = obj.sq_GetLevelData(skill_index, 5, skill_level) * cooltime_Balance / 100; + local coolt_03 = obj.sq_GetLevelData(skill_index, 6, skill_level) * cooltime_Balance / 100; + local coolt_04 = obj.sq_GetLevelData(skill_index, 7, skill_level) * cooltime_Balance / 100; + // if(coolt_04 < 2500) coolt_04 = 2500; + local coolt_05 = 8000 * cooltime_Balance / 100; + + if(obj.getVar("eclipsehive_select").getBool(0) == false){ + if(sq_GetIntData(obj, SKILL_BYKK_BLACKLUNATIC, 51) > 0){ + coolt_01 = coolt_01 * 50 / 100; + coolt_02 = coolt_02 * 50 / 100; + coolt_03 = coolt_03 * 50 / 100; + coolt_04 = coolt_04 * 50 / 100; + } + } + + if(obj.sq_GetLevelData(skill_index, 24, skill_level) < 1){ + appendage.getVar("skill_1").clear_timer_vector(); + appendage.getVar("skill_1").push_timer_vector(); + local t_01 = appendage.getVar("skill_1").get_timer_vector(0); + t_01.setParameter(coolt_01, -1); + t_01.resetInstant(0); + } + appendage.getVar("skill_2").clear_timer_vector(); + appendage.getVar("skill_2").push_timer_vector(); + local t_02 = appendage.getVar("skill_2").get_timer_vector(0); + t_02.setParameter(coolt_02, -1); + t_02.resetInstant(0); + appendage.getVar("skill_3").clear_timer_vector(); + appendage.getVar("skill_3").push_timer_vector(); + local t_03 = appendage.getVar("skill_3").get_timer_vector(0); + t_03.setParameter(coolt_03, -1); + t_03.resetInstant(0); + if(skill_level >= 10){ + appendage.getVar("skill_4").clear_timer_vector(); + appendage.getVar("skill_4").push_timer_vector(); + local t_04 = appendage.getVar("skill_4").get_timer_vector(0); + t_04.setParameter(coolt_04, -1); + t_04.resetInstant(0); + } + appendage.getVar("skill_5").clear_timer_vector(); + appendage.getVar("skill_5").push_timer_vector(); + local t_05 = appendage.getVar("skill_5").get_timer_vector(0); + t_05.setParameter(coolt_05, -1); + t_05.resetInstant(0); + break; + case MONSTER_ID_BABYDRAGON: + local skill_level = sq_GetSkillLevel(obj, skill_index); + local coolt_01 = obj.sq_GetLevelData(skill_index, 4, skill_level) * cooltime_Balance / 100; + local coolt_02 = (obj.sq_GetLevelData(skill_index, 5, skill_level) * 110 / 100) * cooltime_Balance / 100; + local coolt_03 = (obj.sq_GetLevelData(skill_index, 6, skill_level) * 110 / 100) * cooltime_Balance / 100; + local coolt_04 = 6000 * cooltime_Balance / 100; + + if(obj.sq_GetLevelData(skill_index, 12, skill_level) > 0){ + appendage.getVar("custom").setBool(0, true); + coolt_01 = coolt_01 * 70 / 100; + coolt_02 = coolt_02 * 70 / 100; + coolt_03 = coolt_03 * 70 / 100; + } + + if(obj.getVar("eclipsehive_select").getBool(0) == false){ + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 28) > 0){ + coolt_03 = coolt_03 * 70 / 100; + } + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 29) > 0){ + coolt_01 = coolt_01 * 70 / 100; + coolt_02 = coolt_02 * 70 / 100; + } + } + + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 27) > 0 && obj.getVar("eclipsehive_select").getBool(0) == false){ + appendage.getVar("skill_1").clear_timer_vector(); + appendage.getVar("skill_1").push_timer_vector(); + local t_01 = appendage.getVar("skill_1").get_timer_vector(0); + t_01.setParameter(coolt_01, -1); + t_01.resetInstant(0); + } + if(skill_level >= 5){ + appendage.getVar("skill_2").clear_timer_vector(); + appendage.getVar("skill_2").push_timer_vector(); + local t_02 = appendage.getVar("skill_2").get_timer_vector(0); + t_02.setParameter(coolt_02, -1); + t_02.resetInstant(0); + } + if(skill_level >= 10){ + appendage.getVar("skill_3").clear_timer_vector(); + appendage.getVar("skill_3").push_timer_vector(); + local t_03 = appendage.getVar("skill_3").get_timer_vector(0); + t_03.setParameter(coolt_03, -1); + t_03.resetInstant(0); + } + appendage.getVar("skill_4").clear_timer_vector(); + appendage.getVar("skill_4").push_timer_vector(); + local t_04 = appendage.getVar("skill_4").get_timer_vector(0); + t_04.setParameter(coolt_04, -1); + t_04.resetInstant(0); + + break; + case MONSTER_ID_CASILLAS: + monster_obj.getVar("move").clear_vector(); + monster_obj.getVar("move").push_vector(0); + monster_obj.getVar("move").push_vector(0); + + local skill_level = sq_GetSkillLevel(obj, skill_index); + local coolt_01 = obj.sq_GetLevelData(skill_index, 5, skill_level) * cooltime_Balance / 100; + local coolt_02 = obj.sq_GetLevelData(skill_index, 6, skill_level) * cooltime_Balance / 100; + local coolt_03 = obj.sq_GetLevelData(skill_index, 7, skill_level) * cooltime_Balance / 100; + local coolt_04 = 800 * cooltime_Balance / cooltime_Balance; + + appendage.getVar("skill_1").clear_timer_vector(); + appendage.getVar("skill_1").push_timer_vector(); + local t_01 = appendage.getVar("skill_1").get_timer_vector(0); + t_01.setParameter(coolt_01, -1); + t_01.resetInstant(0); + appendage.getVar("skill_2").clear_timer_vector(); + appendage.getVar("skill_2").push_timer_vector(); + local t_02 = appendage.getVar("skill_2").get_timer_vector(0); + t_02.setParameter(coolt_02, -1); + t_02.resetInstant(0); + appendage.getVar("skill_3").clear_timer_vector(); + appendage.getVar("skill_3").push_timer_vector(); + local t_03 = appendage.getVar("skill_3").get_timer_vector(0); + t_03.setParameter(coolt_03, -1); + t_03.resetInstant(0); + if(obj.sq_GetLevelData(skill_index, 17, skill_level) > 0){ + appendage.getVar("skill_4").clear_timer_vector(); + appendage.getVar("skill_4").push_timer_vector(); + local t_04 = appendage.getVar("skill_4").get_timer_vector(0); + t_04.setParameter(coolt_04, -1); + t_04.resetInstant(0); + } + break; + case MONSTER_ID_HODOR: + local skill_level = sq_GetSkillLevel(obj, skill_index); + local coolt_01 = obj.sq_GetLevelData(skill_index, 4, skill_level) * cooltime_Balance / 100;//嚙踝蕭嚙踝蕭? + local coolt_02 = obj.sq_GetLevelData(skill_index, 5, skill_level) * cooltime_Balance / 100;//吤嚙踝蕭Buff + local coolt_03 = obj.sq_GetLevelData(skill_index, 6, skill_level) * cooltime_Balance / 100;//嚙踝蕭? + local coolt_04 = obj.sq_GetLevelData(skill_index, 7, skill_level) * cooltime_Balance / 100;//嚙踝蕭?嚙? + local coolt_05 = obj.sq_GetLevelData(skill_index, 8, skill_level) * cooltime_Balance / 100;//3?嚙踝蕭 + local coolt_06 = obj.sq_GetLevelData(skill_index, 9, skill_level) * cooltime_Balance / 100;//?艉 + local coolt_07 = obj.sq_GetLevelData(skill_index, 10, skill_level) * cooltime_Balance / 100;//嚙踝蕭?嚙踝蕭? + local coolt_08 = 6000 * cooltime_Balance / 100;//嚙踝蕭?嚙踝蕭? + + if(obj.getVar("eclipsehive_select").getBool(0) == false){ + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 30) > 0){ + coolt_05 = coolt_05 - 500; + coolt_06 = coolt_06 - 500; + } + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 31) > 0){ + coolt_05 = coolt_05 - 500; + coolt_06 = coolt_06 - 500; + } + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 32) > 0){ + coolt_05 = coolt_05 - 1000; + coolt_06 = coolt_06 - 1000; + } + } + + if(obj.sq_GetLevelData(skill_index, 14, skill_level) < 1){ + appendage.getVar("skill_1").clear_timer_vector(); + appendage.getVar("skill_1").push_timer_vector(); + local t_01 = appendage.getVar("skill_1").get_timer_vector(0); + t_01.setParameter(coolt_01, -1); + t_01.resetInstant(0); + } + appendage.getVar("skill_2").clear_timer_vector(); + appendage.getVar("skill_2").push_timer_vector(); + local t_02 = appendage.getVar("skill_2").get_timer_vector(0); + t_02.setParameter(coolt_02, -1); + t_02.resetInstant(0); + if(obj.sq_GetLevelData(skill_index, 16, skill_level) < 1){ + appendage.getVar("skill_3").clear_timer_vector(); + appendage.getVar("skill_3").push_timer_vector(); + local t_03 = appendage.getVar("skill_3").get_timer_vector(0); + t_03.setParameter(coolt_03, -1); + t_03.resetInstant(0); + } + if(skill_level >= 5){ + appendage.getVar("skill_4").clear_timer_vector(); + appendage.getVar("skill_4").push_timer_vector(); + local t_04 = appendage.getVar("skill_4").get_timer_vector(0); + t_04.setParameter(coolt_04, -1); + t_04.resetInstant(0); + appendage.getVar("skill_5").clear_timer_vector(); + appendage.getVar("skill_5").push_timer_vector(); + local t_05 = appendage.getVar("skill_5").get_timer_vector(0); + t_05.setParameter(coolt_05, -1); + t_05.resetInstant(0); + appendage.getVar("skill_6").clear_timer_vector(); + appendage.getVar("skill_6").push_timer_vector(); + local t_06 = appendage.getVar("skill_6").get_timer_vector(0); + t_06.setParameter(coolt_06, -1); + t_06.resetInstant(0); + } + if(skill_level >= 10){ + appendage.getVar("skill_7").clear_timer_vector(); + appendage.getVar("skill_7").push_timer_vector(); + local t_07 = appendage.getVar("skill_7").get_timer_vector(0); + t_07.setParameter(coolt_07, -1); + t_07.resetInstant(0); + } + appendage.getVar("skill_8").clear_timer_vector(); + appendage.getVar("skill_8").push_timer_vector(); + local t_08 = appendage.getVar("skill_8").get_timer_vector(0); + t_08.setParameter(coolt_08, -1); + t_08.resetInstant(0); + break; + case MONSTER_ID_SPIRITDARK: + case MONSTER_ID_SPIRITFIRE: + case MONSTER_ID_SPIRITLIGHT: + case MONSTER_ID_SPIRITWATER: + if(monster_id == MONSTER_ID_SPIRITFIRE){ + monster_obj.getVar("skill2").clear_vector(); + monster_obj.getVar("skill2").push_vector(0); + monster_obj.getVar("skill2").push_vector(0); + monster_obj.getVar("skill2").push_vector(0); + monster_obj.getVar("skill2").push_vector(0); + } + + local skill_level = sq_GetSkillLevel(obj, skill_index); + local coolt_01 = obj.sq_GetLevelData(skill_index, 4, skill_level) * cooltime_Balance / 100; + local coolt_02 = coolt_01 * 3 * cooltime_Balance / 100; + + if(obj.getVar("eclipsehive_select").getBool(0) == false){ + local decreaseRate = 0; + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 36) > 0) decreaseRate = decreaseRate - 10; + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 37) > 0) decreaseRate = decreaseRate - 20; + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 38) > 0) decreaseRate = decreaseRate - 20; + if(decreaseRate < 0) coolt_01 = coolt_01 * (100 + decreaseRate) / 100; + } + + appendage.getVar("skill_1").clear_timer_vector(); + appendage.getVar("skill_1").push_timer_vector(); + local t_01 = appendage.getVar("skill_1").get_timer_vector(0); + t_01.setParameter(coolt_01, -1); + t_01.resetInstant(0); + appendage.getVar("skill_2").clear_timer_vector(); + appendage.getVar("skill_2").push_timer_vector(); + local t_02 = appendage.getVar("skill_2").get_timer_vector(0); + t_02.setParameter(coolt_02, -1); + t_02.resetInstant(0); + break; + } +} + +function createPassiveObject_k_k(obj,monsterobj,skillIndex,subtype,x,y,z,pvector1,pvector2,pvector3,pvector4,pvector5) +{ + if(!obj || !monsterobj) return; + if(pvector1 == null) pvector1 = 0; + if(pvector2 == null) pvector2 = 0; + if(pvector3 == null) pvector3 = 0; + if(pvector4 == null) pvector4 = 0; + if(pvector5 == null) pvector5 = 0; + // local bonusRate = obj.getVar("summoners_bonusRate").get_vector(0).tofloat() / 1000.0; + //print("bonusRate = "+bonusRate); + // pvector1 = (pvector1.tofloat() * bonusRate).tointeger(); + if((skillIndex == SKILL_BYKK_SUMMONRAMOS && subtype == 41) || (skillIndex == 25 && subtype == 7) || (skillIndex == 46 && subtype == 6)) pvector2 = (pvector2.tofloat() * summoners_kuk_setbonusRate(obj).tofloat() / 1000.0).tointeger(); + local destX_01 = 0; + local destY_01 = 0; + if(!isSameObject(obj, monsterobj)){ + destX_01 = monsterobj.getXPos() - obj.getXPos(); + destY_01 = monsterobj.getYPos() - obj.getYPos(); + if(monsterobj.getDirection() == ENUM_DIRECTION_LEFT) destX_01 = obj.getXPos() - monsterobj.getXPos(); + } + sq_BinaryStartWrite(); + sq_BinaryWriteDword(skillIndex); + sq_BinaryWriteDword(subtype); + sq_BinaryWriteDword(pvector1); + sq_BinaryWriteDword(pvector2); + sq_BinaryWriteDword(pvector3); + sq_BinaryWriteDword(pvector4); + sq_BinaryWriteDword(pvector5); + sq_SendCreatePassiveObjectPacket(obj, 24381, 0, destX_01 + x, destY_01 + y, z - obj.getZPos(), monsterobj.getDirection()); +} + +function summonmonster_mage_plus_Kwk(obj,monsterobj,x,y,z,substate,monsterId,summontime,level,team) +{ + if(obj.getVar("Summonnum").size_vector() == 0){ + obj.getVar("Summonnum").clear_vector(); + obj.getVar("Summonnum").push_vector(0); + } + + sq_BinaryStartWrite(); + sq_BinaryWriteByte(substate); + sq_BinaryWriteDword(monsterId); + sq_BinaryWriteWord(team); + sq_BinaryWriteWord(level); + sq_BinaryWriteWord(obj.getVar("Summonnum").get_vector(0)); + sq_BinaryWriteDword(0); + sq_BinaryWriteDword(summontime); + sq_BinaryWriteWord(1); + sq_BinaryWriteWord(1); + sq_BinaryWriteWord(1); + local destX_01 = 0; + local destY_01 = 0; + if(!isSameObject(obj, monsterobj)){ + destX_01 = monsterobj.getXPos() - obj.getXPos(); + destY_01 = monsterobj.getYPos() - obj.getYPos(); + if(monsterobj.getDirection() == ENUM_DIRECTION_LEFT) destX_01 = obj.getXPos() - monsterobj.getXPos(); + } + sq_SendCreatePassiveObjectPacket(obj, 48024, 0, destX_01 + x, destY_01 + y, z, monsterobj.getDirection()); + obj.getVar("Summonnum").set_vector(0,obj.getVar("Summonnum").get_vector(0) + 1); +} + +function monsterattack_ksk(monsterObj,attackIndex) +{ + if(!monsterObj) return; + local activeObj = sq_GetCNRDObjectToCollisionObject(monsterObj); + sq_IntVectorClear(sq_GetGlobalIntVector()); + sq_IntVectorPush(sq_GetGlobalIntVector(),attackIndex); + sq_AddSetStatePacketCollisionObject(activeObj, 8, sq_GetGlobalIntVector(), STATE_PRIORITY_USER, true); +} + + +function monsterpulled_bykkkkkkk(obj,monsterobj,x,y,z) +{ + local timer = obj.getVar("pulled").get_ct_vector(0); + if(!timer) return; + local currentT = timer.Get(); + //printp("currentT="+currentT.tostring()+"\n"); + if(currentT <= 2000) return; + timer.Reset();//嚙踝蕭嚙踝蕭嚙? + timer.Start(10000,0);//???嚙? + local objectManager = obj.getObjectManager(); + local objectNumber = objectManager.getCollisionObjectNumber(); + for(local i = 0; i < objectNumber; i++){ + local targetObj = objectManager.getCollisionObject(i); + if(targetObj && targetObj.isObjectType(OBJECTTYPE_ACTIVE) && targetObj.isEnemy(obj) && !CNSquirrelAppendage.sq_IsAppendAppendage(targetObj, "character/mage/k_k_made/appendage/aptomonster/debuff/ap_pulledmonster.nut") && sq_Abs(targetObj.getXPos() - monsterobj.getXPos() + x) <= 300 && sq_Abs(targetObj.getYPos() - monsterobj.getYPos() + y) <= 150){ + local appendagePath = "character/mage/k_k_made/appendage/aptomonster/debuff/ap_pulledmonster.nut"; + local MasterAppendage = CNSquirrelAppendage.sq_AppendAppendage(targetObj, obj, -1, false, appendagePath, true); + if(MasterAppendage){ + sq_AccelMoveToAppendageForce(targetObj, obj, monsterobj, x, y, z, 500, true, MasterAppendage, true); + local validT = MasterAppendage.getAppendageInfo() + validT.setValidTime(2000); + } + } + } +} + +function creatdrawobject_kwk(obj,path,istrue,x,y,z,drawlayerkind) +{ + local ani = sq_CreateAnimation("",path); + local pooledObj = sq_CreatePooledObject(ani,istrue); + sq_SetCurrentDirection(pooledObj, obj.getDirection()); + pooledObj.setCurrentPos(x,y,z); + pooledObj = sq_SetEnumDrawLayer(pooledObj, drawlayerkind); + sq_AddObject(obj, pooledObj, OBJECTTYPE_DRAWONLY, false); + return pooledObj; +} + +function summoners_kuk_setbonusRate(obj) +{ + local bonusRate = 1000; + if(sq_GetSkillLevel(obj, 48) > 0) bonusRate = bonusRate * (1000 + sq_GetLevelData(obj,48, 1, sq_GetSkillLevel(obj, 48))) / 1000; + print("bonusRate1 = "+bonusRate); + if(sq_GetSkillLevel(obj, 75) > 0) bonusRate = bonusRate * (1000 + sq_GetLevelData(obj,75, 3, sq_GetSkillLevel(obj, 75))) / 1000; + if(sq_GetSkillLevel(obj, 20) > 0) bonusRate = bonusRate * (1000 + sq_GetLevelData(obj,20, 18, sq_GetSkillLevel(obj, 20)) / 10) / 1000; + print("bonusRate2 = "+bonusRate); + if(sq_GetSkillLevel(obj, SKILL_BYKK_COMMUNION) > 0) bonusRate = bonusRate * (1000 + sq_GetLevelData(obj, SKILL_BYKK_COMMUNION, 0, sq_GetSkillLevel(obj, SKILL_BYKK_COMMUNION))) / 1000; + print("bonusRate3 = "+bonusRate); + //if(obj.getVar("summoners_bonusRate").getBool(0)) bonusRate = bonusRate + sq_GetLevelData(obj, 81, 5, sq_GetSkillLevel(obj, 81)); + // print("bonusRate4 = "+bonusRate); + if(obj.getVar("echeverra_buff").getBool(0)){ + local number = 0; + local monster_Name = ["SandorObj","AuxoObj","LuisObj","EcheverraObj","DarkhigherspiritObj","LighthigherspiritObj","WaterhigherspiritObj","FirehigherspiritObj","BabydragonObj","KrutaObj","HeilromObj","CassillasObj","HodorObj","RamosObj","SpiritDarkObj","SpiritFireObj","SpiritLightObj","SpiritWaterObj"]; + for(local i = 0; i < monster_Name.len(); i++){ + local monster_num = obj.getVar(monster_Name[i]).get_obj_vector_size(); + if(monster_num > 0) number = number + monster_num; + } + if(number >= 3) number = 3; + bonusRate = bonusRate * (1000 + number * 50) / 1000; + } + //print("bonusRate5 = "+bonusRate); + local monster_num = 0; + local num = 0; + local monster_Name = []; + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 23) > 0 && obj.getVar("AuxoObj").get_obj_vector_size() > 0) monster_Name = ["SandorObj","EcheverraObj","DarkhigherspiritObj","LighthigherspiritObj","WaterhigherspiritObj","FirehigherspiritObj","BabydragonObj","LuisObj","KrutaObj","HodorObj","SpiritDarkObj","SpiritFireObj","SpiritLightObj","SpiritWaterObj"]; + if(sq_GetIntData(obj, SKILL_BYKK_BLACKLUNATIC, 51) > 0 && obj.getVar("LuisObj").get_obj_vector_size() > 0) monster_Name = ["SandorObj","AuxoObj","EcheverraObj","DarkhigherspiritObj","LighthigherspiritObj","WaterhigherspiritObj","FirehigherspiritObj","BabydragonObj","KrutaObj","HodorObj","SpiritDarkObj","SpiritFireObj","SpiritLightObj","SpiritWaterObj"]; + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 26) > 0 && (obj.getVar("DarkhigherspiritObj").get_obj_vector_size() > 0 || obj.getVar("LighthigherspiritObj").get_obj_vector_size() > 0 || obj.getVar("WaterhigherspiritObj").get_obj_vector_size() > 0 || obj.getVar("FirehigherspiritObj").get_obj_vector_size() > 0 || obj.getVar("EcheverraObj").get_obj_vector_size() > 0)) monster_Name = ["SandorObj","AuxoObj","LuisObj","BabydragonObj","KrutaObj","HodorObj","SpiritDarkObj","SpiritFireObj","SpiritLightObj","SpiritWaterObj"]; + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 29) > 0 && obj.getVar("BabydragonObj").get_obj_vector_size() > 0) monster_Name = ["SandorObj","AuxoObj","LuisObj","EcheverraObj","DarkhigherspiritObj","LighthigherspiritObj","WaterhigherspiritObj","FirehigherspiritObj","KrutaObj","HodorObj","SpiritDarkObj","SpiritFireObj","SpiritLightObj","SpiritWaterObj"]; + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 32) > 0 && (obj.getVar("KrutaObj").get_obj_vector_size() > 0 || obj.getVar("HodorObj").get_obj_vector_size() > 0)) monster_Name = ["SandorObj","AuxoObj","LuisObj","EcheverraObj","DarkhigherspiritObj","LighthigherspiritObj","WaterhigherspiritObj","FirehigherspiritObj","BabydragonObj","SpiritDarkObj","SpiritFireObj","SpiritLightObj","SpiritWaterObj"]; + if((sq_GetLevelData(obj, SKILL_BYKK_SUMMONCASILLAS, 18, sq_GetSkillLevel(obj, SKILL_BYKK_SUMMONCASILLAS)) > 0 && obj.getVar("CassillasObj").get_obj_vector_size() > 0) || (sq_GetLevelData(obj, SKILL_BYKK_SUMMONRAMOS, 26, sq_GetSkillLevel(obj, SKILL_BYKK_SUMMONRAMOS)) > 0 && obj.getVar("RamosObj").get_obj_vector_size() > 0)) monster_Name = ["SandorObj","AuxoObj","LuisObj","EcheverraObj","DarkhigherspiritObj","LighthigherspiritObj","WaterhigherspiritObj","FirehigherspiritObj","BabydragonObj","KrutaObj","HodorObj","SpiritDarkObj","SpiritFireObj","SpiritLightObj","SpiritWaterObj"]; + if(monster_Name.len() > 0){ + for(local ui = 0; ui < monster_Name.len(); ui++){ + local number = obj.getVar(monster_Name[ui]).get_obj_vector_size(); + if(number > 0) num = num + number; + } + if(num < 1) bonusRate = bonusRate * (1000 + 500) / 1000; + } + //print("bonusRate6 = "+bonusRate); + if((sq_GetLevelData(obj, SKILL_BYKK_SUMMONCASILLAS, 19, sq_GetSkillLevel(obj, SKILL_BYKK_SUMMONCASILLAS)) > 0 && obj.getVar("CassillasObj").get_obj_vector_size() > 0) || (sq_GetLevelData(obj, SKILL_BYKK_SUMMONRAMOS, 27, sq_GetSkillLevel(obj, SKILL_BYKK_SUMMONRAMOS)) > 0 && obj.getVar("RamosObj").get_obj_vector_size() > 0)) monster_Name = ["SandorObj","AuxoObj","LuisObj","EcheverraObj","DarkhigherspiritObj","LighthigherspiritObj","WaterhigherspiritObj","FirehigherspiritObj","BabydragonObj","KrutaObj","HodorObj","SpiritDarkObj","SpiritFireObj","SpiritLightObj","SpiritWaterObj"]; + else monster_Name = []; + if(monster_Name.len() > 0){ + for(local ui = 0; ui < monster_Name.len(); ui++){ + local number = obj.getVar(monster_Name[ui]).get_obj_vector_size(); + if(number > 0) num = num + number; + } + if(num < 1) bonusRate = bonusRate * (1000 + 500) / 1000; + } + print("bonusRate final = "+bonusRate); + obj.getVar("setSkillBonusRate").setInt(0, bonusRate.tointeger()); +} + +function summonmonster_by_kwk(obj,skillIndex) +{ + if(!obj) return; + local state = 22; + switch(skillIndex){ + case SKILL_BYKK_SUMMONHODOR: + case SKILL_BYKK_SUMMONSANDOR: + case SKILL_BYKK_SUMMONAUXO: + case SKILL_BYKK_SUMMONLUIS: + case SKILL_BYKK_SUMMONBABYDRAGON: + case SKILL_BYKK_SUMMONCASILLAS: + case SKILL_BYKK_SUMMONKRUTA: + case SKILL_BYKK_SUMMONRAMOS: + state = 20; + break; + } + + + obj.sq_IntVectClear(); + obj.sq_IntVectPush(state); + obj.sq_IntVectPush(skillIndex); + obj.sq_AddSetStatePacket(SKILL_BYKK_RINGOFDOMINATION , STATE_PRIORITY_IGNORE_FORCE, true); + return; +} + +function onStartDungeon_summoner_bykk(obj) +{ + if(!obj) return; + local loadSlot = obj.sq_GetSkillLoad(SKILL_BYKK_MOONSHADOW); + if(loadSlot) obj.sq_RemoveSkillLoad(SKILL_BYKK_MOONSHADOW); + setEclipsehive_summoner_bykk(obj); + summoners_kuk_setbonusRate(obj); +} + +function reset_summoner_bykk(obj) +{ + local addAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/k_k_made/appendage/aptomonster/skill_ap/ap_waterhigherspirit_skill.nut"); + if(!addAppendage) return; + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/k_k_made/appendage/aptomonster/skill_ap/ap_waterhigherspirit_skill.nut"); + setEclipsehive_summoner_bykk(obj); + summoners_kuk_setbonusRate(obj); +} + +function summoner_kak_monsterSkill(obj,skillIndex,monstername,attackIndex) +{ + if(!obj.isMyControlObject()) return; + local number = obj.getVar(monstername).get_obj_vector_size(); + if(number > 0 && !sq_GetSkill(obj, skillIndex).isInCoolTime()){ + if(obj.getVar("eclipsehive_select").getBool(0) == false) number = 0; + if(skillIndex == SKILL_BYKK_SUMMONSANDOR && sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 35) > 0){ + local sub = sq_getRandom(1, 3); + local direction = sq_GetDirection(obj); + switch(sub){ + case 1: + for(local i = 0; i < number; i++){ + local monsterObj = sq_GetCNRDObjectToActiveObject(obj.getVar(monstername).get_obj_vector(i)); + if(monsterObj){ + monsterObj.getVar("teleport").setInt(10, direction); + monsterObj.getVar("teleport").setInt(11, sq_GetDistancePos(sq_GetXPos(obj), direction, 50)); + monsterObj.getVar("teleport").setInt(12, sq_GetYPos(obj)); + monsterattack_ksk(monsterObj,attackIndex); + } + } + break; + case 2: + local randomnumber = sq_getRandom(0, 90); + for(local i = 0; i < number; i++){ + local angle = 360 / number * i + randomnumber; + local x = (sq_Cos(sq_ToRadian(angle.tofloat())) * 100.0).tointeger(); + local y = (sq_Sin(sq_ToRadian(angle.tofloat())) * 50.0).tointeger(); + local monsterObj = sq_GetCNRDObjectToActiveObject(obj.getVar(monstername).get_obj_vector(i)); + if(monsterObj){ + monsterObj.getVar("teleport").setInt(10, direction); + monsterObj.getVar("teleport").setInt(11, sq_GetXPos(obj) + x); + monsterObj.getVar("teleport").setInt(12, sq_GetYPos(obj) + y); + monsterattack_ksk(monsterObj,attackIndex); + } + } + break; + case 3: + for(local i = 0; i < number; i++){ + local x = 0, y = 10 * i; + if(i % 2 == 0) y = -y; + else y = 10 * (i + 1); + if(number % 2 == 0 && number > 5) x = -40 * (i / 2); + //print(x+" && "+y); + local monsterObj = sq_GetCNRDObjectToActiveObject(obj.getVar(monstername).get_obj_vector(i)); + if(monsterObj){ + monsterObj.getVar("teleport").setInt(10, direction); + monsterObj.getVar("teleport").setInt(11, sq_GetDistancePos(sq_GetXPos(obj), direction, 100 + x)); + monsterObj.getVar("teleport").setInt(12, sq_GetYPos(obj) + y); + monsterattack_ksk(monsterObj,attackIndex); + } + } + break; + } + } + else{ + for(local i = 0; i < number; i++){ + local monsterObj = sq_GetCNRDObjectToActiveObject(obj.getVar(monstername).get_obj_vector(i)); + if(monsterObj){ + if(skillIndex == SKILL_BYKK_SUMMONKRUTA) monsterObj.getVar("skillIndex").set_vector(0, 4); + if(skillIndex == SKILL_BYKK_SUMMONSANDOR){ + monsterObj.getVar("teleport").setInt(10, obj.getDirection()); + monsterObj.getVar("teleport").setInt(11, sq_GetDistancePos(sq_GetXPos(obj), obj.getDirection(), 50)); + monsterObj.getVar("teleport").setInt(12, sq_GetYPos(obj)); + } + monsterattack_ksk(monsterObj,attackIndex); + if(((skillIndex == 80 && sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 29) > 0) || ((skillIndex == 45 || skillIndex == 46) && sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 23) > 0)) && obj.getVar("eclipsehive_select").getBool(0)){ + number = 1; + monsterObj.getVar("ronghe_bool").setBool(0, true); + break; + } + } + } + } + local state = obj.getState(); + if(state == 14 || state == 0){ + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(state, STATE_PRIORITY_IGNORE_FORCE, true); + } + // obj.startSkillCoolTime(skillIndex, sq_GetSkillLevel(obj, skillIndex), -1); + return 1; + } + return 0; +} + +function setEclipsehive_summoner_bykk(obj) +{ + local stage = sq_GetGlobaludpModuleStage(); + local mapIndex = sq_GetMapIndex(stage); + if(obj.getVar("map").getInt(10) == mapIndex || obj.getVar("map").getBool(0) == false){ + obj.getVar("map").setBool(0, true); + local skill = sq_GetSkill(obj, SKILL_BYKK_ECLIPSEHIVE), skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_ECLIPSEHIVE); + if(skill.isSealFunction()){ + obj.getVar("eclipsehive_select").setBool(0, false); + obj.getVar("eclipsehive_bonus").setInt(10, (1000 + sq_GetLevelData(obj, SKILL_BYKK_ECLIPSEHIVE, 6, skill_level)) / 10); + obj.getVar("eclipsehive_bonus").setInt(11, 100); + obj.getVar("eclipsehive_cooltime").setInt(10, 100); + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 16) > 0){ + obj.getVar("eclipsehive_bonus").setInt(10, (1000 + sq_GetLevelData(obj, SKILL_BYKK_ECLIPSEHIVE, 6, skill_level)) / 10 + 8); + } + /*local addAppendage = CNSquirrelAppendage.sq_GetAppendage(obj, "character/mage/k_k_made/appendage/aptosummoner/ap_eclipsehive.nut"); + if(addAppendage){ + local change_appendage = addAppendage.sq_getChangeStatus("eclipsehive"); + if(change_appendage) change_appendage.clearParameter(); + }*/ + local addAppendage2 = CNSquirrelAppendage.sq_GetAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut"); + if(addAppendage2){ + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut"); + //local skillLevel = sq_GetSkillLevel(obj, 2); + //local lifeTime = sq_GetLevelData(obj, 2, 0, skillLevel); + //addAppendage2.getAppendageInfo().setValidTime(lifeTime); + //addAppendage2.setAppendCauseSkill(BUFF_CAUSE_SKILL, ENUM_CHARACTERJOB_MAGE, 2, skillLevel); + } + } + else{ + obj.getVar("eclipsehive_select").setBool(0, true); + obj.getVar("eclipsehive_bonus").setInt(10, (1000 - sq_GetLevelData(obj, SKILL_BYKK_ECLIPSEHIVE, 4, skill_level)) / 10); + obj.getVar("eclipsehive_bonus").setInt(11, (1000 + sq_GetLevelData(obj, SKILL_BYKK_ECLIPSEHIVE, 2, skill_level)) / 10); + obj.getVar("eclipsehive_cooltime").setInt(10, 100 + sq_GetLevelData(obj, SKILL_BYKK_ECLIPSEHIVE, 3, skill_level)); + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 16) > 0){ + obj.getVar("eclipsehive_bonus").setInt(11, (1000 + sq_GetLevelData(obj, SKILL_BYKK_ECLIPSEHIVE, 2, skill_level)) / 10 + 15); + } + /*local addAppendage = CNSquirrelAppendage.sq_GetAppendage(obj, "character/mage/k_k_made/appendage/aptosummoner/ap_eclipsehive.nut"); + if(addAppendage){ + local skillLevel = obj.sq_GetSkillLevel(SKILL_BYKK_ECLIPSEHIVE); + local value1 = sq_GetLevelData(obj, SKILL_BYKK_ECLIPSEHIVE, 0, skillLevel); + local change_appendage = addAppendage.sq_getChangeStatus("eclipsehive"); + if(!change_appendage) change_appendage = addAppendage.sq_AddChangeStatus("eclipsehive",obj, obj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK, true, value1); + if(change_appendage){ + change_appendage.clearParameter(); + change_appendage.addParameter(CHANGE_STATUS_TYPE_COOLTIME_DECLINE, true, -value1.tofloat()); + } + }*/ + local addAppendage2 = CNSquirrelAppendage.sq_GetAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut"); + if(addAppendage2){ + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut"); + } + } + } + else obj.getVar("map").setInt(10, mapIndex); +} + +function getImmuneTypeDamageRate_appendage_sandor_protect_bykk(appendage, damageRate, attacker) +{ + //print("damageRate = "+damageRate); + local newRate = 10; + return newRate; +} + +function startSkillCoolTime_summoner_bykk(obj, skillIndex, skillLevel, currentCoolTime) +{ + local newCoolTime = 0; + switch(skillIndex){ + case 49: + if(obj.getVar("eclipsehive_select").getBool(0)){ + local decreaseRate = 0; + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 36) > 0) decreaseRate = decreaseRate - 10; + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 37) > 0) decreaseRate = decreaseRate - 10; + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 38) > 0) decreaseRate = decreaseRate - 30; + if(decreaseRate < 0){ + newCoolTime = currentCoolTime * (100 + decreaseRate) / 100; + return newCoolTime; + } + } + else return currentCoolTime; + break; + case 46: + + break; + case 2: + print("currentCoolTime ="+currentCoolTime); + if(currentCoolTime < 40000) return 40000; + break; + } +} + +function onAfterSetState_Throw_summoner_bykk(obj, state, datas, isResetTimer) +{ + + local ThrowIndex = obj.getThrowIndex(); + local ThrowState = obj.getThrowState(); + + if(ThrowIndex == 49){ + if (obj.getThrowState() == 0){ + + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 36) > 0 && obj.getVar("eclipsehive_select").getBool(0)){ + + if(obj.getHp() < obj.getHpMax() * 5 / 100){ + if (obj.isMessage()) sq_AddMessage(3599); + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + return; + } + else{ + obj.sq_SendSetHpPacket(obj.getHp() - obj.getHpMax() * 5 / 100, true, obj); + } + + local monstername = ["SpiritDarkObj","SpiritFireObj","SpiritLightObj","SpiritWaterObj"], skillIndex = [53, 51, 54, 52], bonusNum = [20, 7, 26, 15]; + local num = 0; + local totalDamage = 0; + for(local ui = 0; ui < monstername.len(); ui++){ + local number = obj.getVar(monstername[ui]).get_obj_vector_size(); + if(number > 0){ + if(sq_GetSkillLevel(obj, skillIndex[ui]) > 0) + totalDamage = totalDamage + sq_GetLevelData(obj, skillIndex[ui], 1, sq_GetSkillLevel(obj, skillIndex[ui])) * number; + else + totalDamage = totalDamage + sq_GetLevelData(obj, 49, bonusNum[ui], sq_GetSkillLevel(obj, 49)) * number; + } + num = num + number; + } + + if(num > 0){ + local sizeRate = 100, bonusRate = 0; + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 37) > 0){sizeRate = sizeRate + 10; bonusRate = bonusRate + 10;} + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 38) > 0){sizeRate = sizeRate + 20; bonusRate = bonusRate + 10;} + totalDamage = totalDamage * (100 + bonusRate) / 100; + // print("totalDamage = "+totalDamage); + createPassiveObject_k_k(obj, obj,SKILL_BYKK_SUMMONSPIRITCOMMON,2001,150,0,0,totalDamage,sizeRate,0,0,0); + } + return; + } + // print("test"); + local num = 0; + local monstername = ["SpiritDarkObj","SpiritFireObj","SpiritLightObj","SpiritWaterObj"]; + local monsternumber = [0,1,2,3]; + for(local ui = 0; ui < monstername.len(); ui++){ + local number = obj.getVar(monstername[ui]).get_obj_vector_size(); + if(number > 0){ + obj.getVar("sacrifice").setBool(monsternumber[ui], true); + for(local i = 0; i < number; i++){ + local monsterObj = sq_GetCNRDObjectToActiveObject(obj.getVar(monstername[ui]).get_obj_vector(i)); + if(monsterObj){ + monsterattack_ksk(monsterObj,3); + num = num + 1; + } + } + } + } + if(num > 0 && sq_GetLevelData(obj, 49, 31, sq_GetSkillLevel(obj, 49)) > 0){ + obj.sq_SendSetHpPacket(obj.getHp() + obj.getHpMax() * 2 / 100 * num, true, obj); + obj.sq_SendSetMpPacket(obj.getHp() + obj.getMpMax() * 2 / 100 * num, true, obj); + } + } + } + else if(ThrowIndex == 81){ + if (obj.getThrowState() == 1){ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/k_k_made/appendage/aptosummoner/ap_masterreckless.nut")) CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/k_k_made/appendage/aptosummoner/ap_masterreckless.nut"); + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, 81, false, "character/mage/k_k_made/appendage/aptosummoner/ap_masterreckless.nut", true); + local rad = sq_GetLevelData(obj, 81, 5, sq_GetSkillLevel(obj, 81)) / 10; + obj.getVar("apGetSetbyKK").setInt(0, rad); + } + } +} + + + +// setCustomData +function setCustomData_po_summoners(obj, receiveData) +{ + if(!obj) return; + + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + + local skillIndex = receiveData.readDword(); + local subtype = receiveData.readDword(); + obj.getVar("skillIndex").clear_vector(); + obj.getVar("skillIndex").push_vector(skillIndex); + obj.getVar("subtype").clear_vector(); + obj.getVar("subtype").push_vector(subtype); + + switch(skillIndex){ + case 25://hodor + switch(subtype){ + case 1://嚙踝蕭嚙踝蕭怐 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 0)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/hodor/attack1.ani"); + obj.setCurrentAnimation(ani); + break; + case 3://嚙踝蕭怐 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 1)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local level = sq_GetSkillLevel(sqrChr, 174) + 20; + local skill_level = sq_GetSkillLevel(sqrChr, 25); + local prob = sqrChr.sq_GetLevelData(25, 11, skill_level) / 10; + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_STUN, prob, level, 2000); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/hodor/chargeattack.ani"); + obj.setCurrentAnimation(ani); + break; + case 4://嚙踝蕭嚙踝蕭嚙踝蕭嚙? + case 5://3盓嚙踝蕭 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + local sub = receiveData.readDword(); + obj.getVar("custom").setInt(10, sub); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 6)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local aniPath1 = "passiveobject/madeby_k_k/animation/hodor/" + local aniPath2 = "throwstone.ani"; + if(sub > 0){ + local randomnumber = sq_getRandom(1,8); + print("subtype = "+subtype+" , randomnumber:"+randomnumber+" , sub = "+sub); + switch(randomnumber){ + case 1: aniPath2 = "throwobject/barrel1.ani"; break; + case 2: aniPath2 = "throwobject/barrel2.ani"; break; + case 3: aniPath2 = "throwobject/box.ani"; break; + case 4: aniPath2 = "throwobject/brick.ani"; break; + case 5: aniPath2 = "throwobject/ladder.ani"; break; + case 6: aniPath2 = "throwobject/nipper.ani"; break; + case 7: aniPath2 = "throwobject/pipeline.ani"; break; + case 8: aniPath2 = "throwobject/wagon.ani"; break; + } + } + local ani = sq_CreateAnimation("", aniPath1 + aniPath2); + obj.setCurrentAnimation(ani); + //?嚙踝蕭ptl + obj.sq_SetMoveParticle("particle/hodor/throwstone.ptl", 0.0, 0.0); + if(sub > 0) sq_SetSpeedToMoveParticle(obj, 2, -100); + break; + case 6://嚙踝蕭艉嚙踝蕭 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + local sub = receiveData.readDword(); + obj.getVar("custom").setInt(10, sub); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 6)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local aniPath1 = "passiveobject/madeby_k_k/animation/hodor/" + local aniPath2 = "throwstone.ani"; + if(sub > 0){ + local randomnumber = sq_getRandom(1,8); + print("subtype = "+subtype+" , randomnumber:"+randomnumber+" , sub = "+sub); + switch(randomnumber){ + case 1: aniPath2 = "throwobject/barrel1.ani"; break; + case 2: aniPath2 = "throwobject/barrel2.ani"; break; + case 3: aniPath2 = "throwobject/box.ani"; break; + case 4: aniPath2 = "throwobject/brick.ani"; break; + case 5: aniPath2 = "throwobject/ladder.ani"; break; + case 6: aniPath2 = "throwobject/nipper.ani"; break; + case 7: aniPath2 = "throwobject/pipeline.ani"; break; + case 8: aniPath2 = "throwobject/wagon.ani"; break; + } + } + local ani = sq_CreateAnimation("", aniPath1 + aniPath2); + obj.setCurrentAnimation(ani); + //?嚙踝蕭ptl + local direction = receiveData.readDword(); + switch(direction){ + case 0: obj.sq_SetMoveParticle("particle/hodor/throwstone.ptl", 0.0, 0.0); break; + case 1: obj.sq_SetMoveParticle("particle/hodor/throwstoneup1.ptl", 0.0, 0.0); break; + case 2: obj.sq_SetMoveParticle("particle/hodor/throwstoneup2.ptl", 0.0, 0.0); break; + case 3: obj.sq_SetMoveParticle("particle/hodor/throwstonedown1.ptl", 0.0, 0.0); break; + case 4: obj.sq_SetMoveParticle("particle/hodor/throwstonedown2.ptl", 0.0, 0.0); break; + } + if(sub > 0) sq_SetSpeedToMoveParticle(obj, 2, -100); + break; + case 7://嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + local totalDamage2 = receiveData.readDword(); + local moveX = receiveData.readDword(); + local moveY = receiveData.readDword(); + obj.getVar("totalDamage").clear_vector(); + obj.getVar("totalDamage").push_vector(totalDamage2); + obj.getVar("move").clear_vector(); + obj.getVar("move").push_vector(obj.getXPos()); + obj.getVar("move").push_vector(obj.getYPos()); + obj.getVar("move").push_vector(moveX); + obj.getVar("move").push_vector(moveY); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 4)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 8://旓?1?茷 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 2)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local level = sq_GetSkillLevel(sqrChr, 174) + 20; + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_STUN, 100, level, 4000); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/hodor/skilla.ani"); + obj.setCurrentAnimation(ani); + //?嚙踝蕭?? + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + local parentObj = sq_GetObject(sqrChr, group, uniqueId); + sq_moveWithParent(parentObj, obj); + break; + case 9://旓?2?茷 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 3)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local level = sq_GetSkillLevel(sqrChr, 174) + 60; + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_STUN, 100, level, 8000); + local substate = receiveData.readDword(); + switch(substate){ + case 1: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/hodor/skillb_01.ani"); + obj.setCurrentAnimation(ani); + break; + case 2: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/hodor/skillb_02.ani"); + obj.setCurrentAnimation(ani); + local sizeRate = receiveData.readDword(); + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + } + break; + } + break; + case 44://sandor + switch(subtype){ + case 1: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 80)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/newsandor/nsandorattack_nsandor_b.ani"); + obj.setCurrentAnimation(ani); + //?嚙踝蕭嚙踝蕭? + local animation = obj.getCurrentAnimation(); + local aniDelay = receiveData.readDword(); + if(aniDelay > 0){ + for(local i = 0;i < 3; i++){ + sq_SetFrameDelayTime(animation, i, aniDelay); + } + } + //?嚙踝蕭?? + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + local parentObj = sq_GetObject(sqrChr, group, uniqueId); + sq_moveWithParent(parentObj, obj); + break; + case 2: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 81)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/newsandor/nsandorpierce_nsandor_b.ani"); + obj.setCurrentAnimation(ani); + //?嚙踝蕭嚙踝蕭? + local animation = obj.getCurrentAnimation(); + local aniDelay = receiveData.readDword(); + if(aniDelay > 0){ + for(local i = 0;i < 3; i++){ + sq_SetFrameDelayTime(animation, i, aniDelay); + } + } + //?嚙踝蕭?? + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + local parentObj = sq_GetObject(sqrChr, group, uniqueId); + sq_moveWithParent(parentObj, obj); + break; + case 4: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 82)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/newsandor/skilleffa.ani"); + obj.setCurrentAnimation(ani); + //PTL + obj.sq_SetMoveParticle("particle/newsandor/swordforce.ptl", 0.0, 0.0); + local aniDelay = receiveData.readDword(); + local speed = 54 / aniDelay * 1000; + sq_SetSpeedToMoveParticle(obj,0,speed); + obj.setTimeEvent(0,600,1,false); + local sizeRate = receiveData.readDword(); + local pAni = obj.getCurrentAnimation(); + sizeRate = sizeRate.tofloat() / 100.0; + pAni.setImageRateFromOriginal(sizeRate, sizeRate);//增加ani ?度跟高度率 + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);//增加ani als附加 ani大小比例 + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate);//攻?框,x y z比率 + break; + } + break; + case 45://auxo + switch(subtype){ + case 1://嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭? + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 13)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/monsterflower/attack1.ani"); + obj.setCurrentAnimation(ani); + break; + case 2://?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭? + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 15)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/monsterflower/auxoroot.ani"); + obj.setCurrentAnimation(ani); + break; + case 3://堋?嚙踝蕭嚙踝蕭?堋? + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 16)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/monsterflower/attackbox.ani"); + obj.setCurrentAnimation(ani); + sq_CreateParticle("passiveobject/monster/monsterflower/particle/poisonbug.ptl", obj, 0, 0, 40, true, 15, 0, 40);//?嚙踝蕭 + sq_CreateParticle("passiveobject/common/particle/confusegas.ptl", obj, 0, 0, 40, false, 10, 0, 40);//嚙踝蕭??? + //?嚙踝蕭嚙踝蕭?嚙踝蕭嚙踝蕭 + local skill_level = sqrChr.sq_GetSkillLevel(45); + local level = 40 + skill_level * 2; + local poisonbug_damage = sq_GetLevelData(sqrChr, 45, 18, skill_level); + local poisonbug_prob = sq_GetLevelData(sqrChr, 45, 15, skill_level); + local poisonbug_time = sq_GetLevelData(sqrChr, 45, 17, skill_level); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_POISON, poisonbug_prob, level, poisonbug_time, poisonbug_damage); + break; + case 4://嚙踝蕭嚙踝蕭 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 14)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/monsterflower/root_1.ani"); + obj.setCurrentAnimation(ani); + sizeRate = sizeRate.tofloat() / 100.0; + local currentAni = obj.getCurrentAnimation(); + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + break; + case 5://嚙踝蕭? + case 15://嚙踝蕭? + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 11://茩嚙踝蕭嚙踝蕭 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 18)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/monsterlunaflower/ani/summonauxoawakeningrootshort_front.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-10,sq_CreateAnimation("","passiveobject/madeby_k_k/animation/monsterlunaflower/ani/summonauxoawakeningrootshort_bottom.ani"),true); + break; + case 12://?嚙踝蕭嚙踝蕭 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 18)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/monsterlunaflower/ani/summonauxoawakeningrootlong_front.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-10,sq_CreateAnimation("","passiveobject/madeby_k_k/animation/monsterlunaflower/ani/summonauxoawakeningrootlong_bottom.ani"),true); + break; + case 13://嚙踝蕭? + local totalDamage = receiveData.readDword(); + local state = receiveData.readDword(); + //local group = receiveData.readDword(); + //local uniqueId = receiveData.readDword(); + //local targetObj = sq_GetObject(sqrChr, group, uniqueId); + //if(targetObj){ + //obj.getVar("targetObj").clear_obj_vector(); + //obj.getVar("targetObj").push_obj_vector(targetObj); + //} + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 20)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.addSetStatePacket(state, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 14://?嚙踝蕭?? + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + obj.getVar().setInt(10, sizeRate); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 17)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 100://?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭? + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/monsterflower/overgrowthgrowupmonsterflower_attack.ani"); + obj.setCurrentAnimation(ani); + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 14)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + break; + } + break; + case 46://luis + switch(subtype){ + case 1://嚙踝蕭嚙踝蕭? + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 21)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/luis/attack.ani"); + obj.setCurrentAnimation(ani); + break; + case 2://???嚙踝蕭 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + local etcSub = receiveData.readDword(); + obj.getVar("custom").setInt(10, etcSub); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 23)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local level = sq_GetSkillLevel(sqrChr, 174) + 20; + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_FREEZE, 5, level, 1000); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/luis/luis_iceniddle/luisiceniddlegroup.ani"); + obj.setCurrentAnimation(ani); + if(etcSub > 0){ + local pAni = obj.getCurrentAnimation(); + pAni.setSpeedRate(200.0); + } + break; + case 3://嚙踝蕭牊 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + local etcSub = receiveData.readDword(); + obj.getVar("custom").setInt(10, etcSub); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 22)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/luis/fireball.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + local sizeRate = 1.3; + if(etcSub > 0) sizeRate = 2.6; + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + obj.setTimeEvent(0,160,1,false); + break; + case 4://嚙??嚙? + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + local etcSub = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 24)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local level = sq_GetSkillLevel(sqrChr, 174) + 20; + local attackInfo = sq_GetCurrentAttackInfo(obj); + local skill_level = sq_GetSkillLevel(sqrChr, 46); + local prob = sqrChr.sq_GetLevelData(46, 15, skill_level) / 10; + local time = sqrChr.sq_GetLevelData(46, 17, skill_level); + // sqrChr.getVar("Debug_SubState").set_vector(8,prob); + // sqrChr.getVar("Debug_SubState").set_vector(9,time); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_FREEZE, prob, level, time); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/luis/luis_icefield/icefieldnormal1.ani"); + obj.setCurrentAnimation(ani); + local pAni = obj.getCurrentAnimation(); + local speedRate = 150.0; + if(etcSub > 0) speedRate = 300.0; + pAni.setSpeedRate(speedRate); + break; + case 5://?嚙踝蕭嚙踝蕭嚙踝蕭嚙? + local totalDamage = receiveData.readDword(); + local number = receiveData.readDword(); + local etcSub = receiveData.readDword(); + local bonusRate = receiveData.readDword(); + obj.getVar("custom").setInt(11, bonusRate); + obj.getVar("custom").setInt(10, etcSub); + if(number > 1){ + obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + } + else{ + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + } + + break; + case 6://?嚙? + local totalDamage = receiveData.readDword(); + local totalDamage2 = receiveData.readDword(); + local etcSub = receiveData.readDword(); + obj.getVar().clear_vector(); + obj.getVar().push_vector(totalDamage); + obj.getVar().push_vector(totalDamage2); + obj.getVar().push_vector(etcSub); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 10: + local sub = receiveData.readDword(); + local lifeTime = receiveData.readDword(); + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + local targetObj = sq_GetObject(obj, group, uniqueId); + obj.getVar("tar").clear_obj_vector(); + obj.getVar("tar").push_obj_vector(targetObj); + obj.getVar("custom").setInt(10, sub); + local ani = sq_CreateAnimation("","character/mage/effect/animation/blacklunatic/blacklunaticwing"+sub.tostring()+"loop_00.ani"); + obj.setCurrentAnimation(ani); + obj.setTimeEvent(0, lifeTime, 1, false); + obj.setTimeEvent(1, 20, -1, true); + // sq_moveWithParent(targetObj, obj); + break; + } + break; + case 47://echeverra + switch(subtype){ + case 1: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 26)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spikeking/attack.ani"); + obj.setCurrentAnimation(ani); + break; + case 2: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 29)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spikeking/grandwave1.ani"); + obj.setCurrentAnimation(ani); + //嚙踝蕭嚙踝蕭嚙踝蕭??? + obj.setTimeEvent(0,400,-1,false); + obj.setTimeEvent(1,250,1,true); + break; + case 4: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/dummy.ani"); + obj.setCurrentAnimation(ani); + local animation = obj.getCurrentAnimation(); + sq_SetFrameDelayTime(animation, 0, 100); + sq_SetFrameDelayTime(animation, 1, 800); + obj.setTimeEvent(0,100,7,true); + break; + case 5: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 30)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spikeking/dummy2.ani"); + obj.setCurrentAnimation(ani); + //嚙踝蕭嚙踝蕭嚙踝蕭??? + local hitnumber = receiveData.readDword(); + local time = 50; + if(hitnumber > 5) time = 5; + obj.setTimeEvent(0,time,hitnumber - 0,false); + obj.setTimeEvent(2,50*hitnumber,1,false); + break; + case 8: + local totalDamage = receiveData.readDword(); + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + local targetObj = sq_GetObject(sqrChr, group, uniqueId);//嚙踝蕭嚙踝蕭?嚙踝蕭 + obj.getVar().clear_obj_vector(); + obj.getVar().push_obj_vector(targetObj); + local Delay = receiveData.readDword(); + obj.getVar("Delay").clear_vector(); + obj.getVar("Delay").push_vector(Delay); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 9: + local parentObj = obj.getParent(); + parentObj.getVar("kingsobj").clear_obj_vector(); + parentObj.getVar("kingsobj").push_obj_vector(obj); + if(sqrChr.getVar("kingsobj").get_obj_vector_size() < 1){ + sqrChr.getVar("kingsobj").clear_obj_vector(); + sqrChr.getVar("kingsobj").push_obj_vector(obj); + } + if(!sqrChr.getVar("kingsobj").is_obj_vector(obj)) sqrChr.getVar("kingsobj").push_obj_vector(obj); + local totalDamage = receiveData.readDword(); + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + local targetObj = sq_GetObject(sqrChr, group, uniqueId);//嚙踝蕭嚙踝蕭?嚙踝蕭 + obj.getVar().clear_obj_vector(); + obj.getVar().push_obj_vector(targetObj); + local Delay = receiveData.readDword(); + obj.getVar("Delay").clear_vector(); + obj.getVar("Delay").push_vector(Delay); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 41: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local eclipsehive_bonus = sqrChr.getVar("eclipsehive_bonus").getInt(10).tofloat() / 100.0; + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 47, 47, 11, eclipsehive_bonus) + 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 28)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 51: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 30)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spikeking/newlaser/uhdlaserbombmagicsquare.ani"); + obj.setCurrentAnimation(ani); + obj.setTimeEvent(0,80,7,false); + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); + break; + } + break; + case 76://spiritdarkhigher + switch(subtype){ + case 1://嚙踝蕭嚙踝蕭?嚙踝蕭?? + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 39)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/darkhigherspirit/attack1.ani"); + obj.setCurrentAnimation(ani); + break; + case 2://嚙踝蕭嚙踝蕭?嚙踝蕭嚙踝蕭? + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 40)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/darkhigherspirit/attack2.ani"); + obj.setCurrentAnimation(ani); + break; + case 3://嚙踝蕭嚙踝蕭? + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 41)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + // + local time = receiveData.readDword(); + obj.setTimeEvent(0,time,1,false); + sq_CreateParticle("passiveobject/monster/spirit/particle/belzebuite_overskill_dark_for_deadmulker.ptl", obj, 0, 0, 0, true, 200, time, 200); + obj.sq_PlaySound("KALA_THROW"); + break; + case 4://嚙踝蕭? + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 42)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/darkhigherspirit/blackfog/attackbox.ani"); + obj.setCurrentAnimation(ani); + obj.sq_PlaySound("KALA_SUMMON"); + // + local time = receiveData.readDword(); + obj.setTimeEvent(0,time,1,false); + obj.setTimeEvent(1,480,-1,false); + //嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local sub = receiveData.readDword(); + if(sub == 2){ + obj.getVar("attack").setBool(0,true); + local attackInfo = sq_GetCurrentAttackInfo(obj); + local level = sq_GetSkillLevel(sqrChr, 174) + 20; + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_STUN, 100, level, 4000); + } + createPassiveObject_k_k(sqrChr,obj,SKILL_BYKK_SUMMONSPIRITDARKHIGHER,41,-150,0,0,0,time,sub,0,0); + createPassiveObject_k_k(sqrChr,obj,SKILL_BYKK_SUMMONSPIRITDARKHIGHER,41,0,-75,0,0,time,sub,0,0); + createPassiveObject_k_k(sqrChr,obj,SKILL_BYKK_SUMMONSPIRITDARKHIGHER,41,0,0,0,0,time,sub,0,0); + createPassiveObject_k_k(sqrChr,obj,SKILL_BYKK_SUMMONSPIRITDARKHIGHER,41,0,75,0,0,time,sub,0,0); + createPassiveObject_k_k(sqrChr,obj,SKILL_BYKK_SUMMONSPIRITDARKHIGHER,41,150,0,0,0,time,sub,0,0); + break; + case 41: + local totalDamage = receiveData.readDword(); + local time = receiveData.readDword(); + obj.setTimeEvent(0,time - 280,1,false); + local sub = receiveData.readDword(); + if(sub == 2){ + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/madeby_k_k/animation/spirit/darkhigherspirit/blackfog/blackfog_00.ani",0,0,0); + } + else{ + sq_CreateParticle("passiveobject/monster/spirit/particle/belzebuite_overskill_dark_for_deadmulker.ptl", obj, 0, 0, 0, true, 200, time, 200); + } + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 61: + case 62: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 42)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + local time = receiveData.readDword(); + obj.getVar("time").clear_vector(); + obj.getVar("time").push_vector(time); + obj.setTimeEvent(0,time,1,false); + if(subtype == 61) sq_flashScreen(obj,693,time - 693,500,180, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + break; + case 63: + local totalDamage = receiveData.readDword(); + local time = receiveData.readDword(); + obj.setTimeEvent(4,time,1,false); + //?? + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + if(group != 0 || uniqueId != 0){ + local targetObj = sq_GetObject(sqrChr, group, uniqueId);//嚙踝蕭嚙踝蕭?嚙踝蕭 + obj.getVar().clear_obj_vector(); + obj.getVar().push_obj_vector(targetObj); + } + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case 77://spiritlighthigher + switch(subtype){ + case 1: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 48)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 2: + local number = receiveData.readDword(); + obj.setTimeEvent(0,100,number,true); + local animation = obj.getCurrentAnimation(); + sq_SetFrameDelayTime(animation, 0, 100); + sq_SetFrameDelayTime(animation, 1, 100 * number); + break; + case 21: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 49)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 41: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 52)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 42: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 53)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 9: + local totalDamage = receiveData.readDword(); + local number = receiveData.readDword(); + // print("number = "+number); + obj.setTimeEvent(0,100,number,true); + local animation = obj.getCurrentAnimation(); + sq_SetFrameDelayTime(animation, 0, 100); + sq_SetFrameDelayTime(animation, 1, 100 * number); + break; + case 10: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 50)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/lighthigherspirit/lightning/0_lightningbase.ani"); + obj.setCurrentAnimation(ani); + // + local level = sq_GetSkillLevel(sqrChr, 174) + 20; + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_LIGHTNING, 20, level, 4000); + obj.setTimeEvent(0,180,5,false); + break; + } + break; + case 78://spiritwaterhigher + switch(subtype){ + case 1: + obj.setTimeEvent(0,10,3,true); + local animation = obj.getCurrentAnimation(); + sq_SetFrameDelayTime(animation, 0, 100); + sq_SetFrameDelayTime(animation, 1, 300); + break; + case 2: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 58)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local level = sq_GetSkillLevel(sqrChr, 174) + 20; + local skill_level = sq_GetSkillLevel(sqrChr, 78); + local prob = sqrChr.sq_GetLevelData(78, 8, skill_level) / 10; + local time = sqrChr.sq_GetLevelData(78, 16, skill_level); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_FREEZE, prob, level, time); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/waterhigherspirit/attack2.ani"); + obj.setCurrentAnimation(ani); + local aniDelay = receiveData.readDword(); + if(aniDelay > 0){ + local animation = obj.getCurrentAnimation(); + for(local i = 0;i < 5; i++){ + sq_SetFrameDelayTime(animation, i, aniDelay); + } + } + break; + case 3: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 55));//58嚙踝蕭?? + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local level = sq_GetSkillLevel(sqrChr, 174) + 20; + local skill_level = sq_GetSkillLevel(sqrChr, 78); + local prob = sqrChr.sq_GetLevelData(78, 17, skill_level) / 10; + local time = sqrChr.sq_GetLevelData(78, 16, skill_level); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_FREEZE, prob, level, time); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 4: + obj.setTimeEvent(0,80,7,true); + local animation = obj.getCurrentAnimation(); + sq_SetFrameDelayTime(animation, 0, 100); + sq_SetFrameDelayTime(animation, 1, 600); + break; + case 11: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 56)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local time = receiveData.readDword(); + obj.setTimeEvent(1,100 * time + 300, 1, false); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 41: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 55));//58嚙踝蕭?? + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local level = sq_GetSkillLevel(sqrChr, 174) + 20; + local skill_level = sq_GetSkillLevel(sqrChr, 78); + local prob = sqrChr.sq_GetLevelData(78, 17, skill_level) / 10; + local time = sqrChr.sq_GetLevelData(78, 16, skill_level); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_FREEZE, prob, level, time); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/waterhigherspirit/icestrike/icestrikeprojectilefront_00.ani"); + obj.setCurrentAnimation(ani); + //嚙踝蕭嚙? + local sizeRate_num = receiveData.readDword(); + local sizeRate = 1.0 + 0.08 * sizeRate_num; + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/madeby_k_k/animation/spirit/waterhigherspirit/icestrike/icestrikeprojectileback_03.ani",0,0,0); + local plAni = pooledObj.getCurrentAnimation(); + plAni.setImageRateFromOriginal(sizeRate, sizeRate); + plAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + local currentAni = obj.getCurrentAnimation(); + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + break; + case 9: + local number = receiveData.readDword(); + obj.setTimeEvent(0,100,number,true); + local animation = obj.getCurrentAnimation(); + sq_SetFrameDelayTime(animation, 0, 100); + sq_SetFrameDelayTime(animation, 1, 100 * number); + break; + case 10: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 57)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local time = receiveData.readDword(); + obj.setTimeEvent(0,time, 1, false); + obj.setTimeEvent(1,300, -1, false); + obj.getVar("move").clear_vector(); + obj.getVar("move").push_vector(obj.getXPos()); + obj.getVar("move").push_vector(300); + // obj.sq_SetMoveParticle("particle/ramos/targetingmove.ptl", 0.0, 0.0); + // sq_SetSpeedToMoveParticle(obj,0,100); + local parentObj = obj.getParent(); + CNSquirrelAppendage.sq_RemoveAppendage(parentObj, "character/mage/k_k_made/appendage/aptomonster/skill_ap/ap_waterhigherspirit_skill.nut"); + obj.getVar().setBool(0,true); + obj.sq_PlaySound("BERIAS_TORNADO_LOOP"); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case 79://spiritfirehigher + switch(subtype){ + case 1: + case 2: + case 21: + case 31: + case 32: + case 33: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + local atkindex = 44; + if(subtype == 2 || subtype == 21) atkindex = 45; + if(subtype == 31 || subtype == 32 || subtype == 33) atkindex = 46; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, atkindex)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local aniPath = "passiveobject/madeby_k_k/animation/spirit/firehigherspirit/attack1.ani" + if(subtype == 2) aniPath = "passiveobject/madeby_k_k/animation/spirit/firehigherspirit/attack2.ani" + if(subtype == 21) aniPath = "passiveobject/madeby_k_k/animation/spirit/firehigherspirit/element_fire_fire_wave.ani" + if(subtype == 31) aniPath = "passiveobject/madeby_k_k/animation/spirit/firehigherspirit/attack3_1.ani" + if(subtype == 32) aniPath = "passiveobject/madeby_k_k/animation/spirit/firehigherspirit/attack3_2.ani" + if(subtype == 33) aniPath = "passiveobject/madeby_k_k/animation/spirit/firehigherspirit/attack3_3.ani" + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + //?? + if(subtype == 31 || subtype == 32 || subtype == 33){ + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + local targetObj = sq_GetObject(sqrChr, group, uniqueId);//嚙踝蕭嚙踝蕭?嚙踝蕭 + sq_moveWithParent(targetObj, obj); + } + break; + case 4: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 47)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/firehigherspirit/firestorm/firestorm_00.ani"); + obj.setCurrentAnimation(ani); + obj.setTimeEvent(0,300,-1,false); + monsterpulled_bykkkkkkk(sqrChr,obj,0,0,0); + break; + case 6: + local number = receiveData.readDword(); + obj.setTimeEvent(0,100,number,true); + local animation = obj.getCurrentAnimation(); + sq_SetFrameDelayTime(animation, 0, 100); + sq_SetFrameDelayTime(animation, 1, 100 * number); + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + local parentObj = sq_GetObject(sqrChr, group, uniqueId); + local eclipsehive_bonus = sqrChr.getVar("eclipsehive_bonus").getInt(10).tofloat() / 100.0; + + for(local i = 0; i < number; i++){ + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, 7, eclipsehive_bonus) + 100; + local group = sq_GetGroup(parentObj);//? + local uniqueId = sq_GetUniqueId(parentObj);//嚙踝蕭嚙踝蕭ID + createPassiveObject_k_k(sqrChr,obj,SKILL_BYKK_SUMMONSPIRITFIREHIGHER,61,0,0,0,totalDamage,number,i + 1,group,uniqueId); + } + break; + case 61: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 48)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local time = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, 28, 1.0) + 100; + obj.setTimeEvent(0,time, 1, false); + local sub_all = receiveData.readDword(); + local sub = receiveData.readDword(); + obj.getVar("sub").clear_vector(); + obj.getVar("sub").push_vector(sub); + obj.getVar("sub").push_vector(sub_all); + obj.setTimeEvent(1,960, -1, false); + obj.setTimeEvent(3,50, -1, false); + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + local parentObj = sq_GetObject(sqrChr, group, uniqueId); + obj.getVar("parentObj").clear_obj_vector(); + obj.getVar("parentObj").push_obj_vector(parentObj); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case 80://babydragon + switch(subtype){ + case 1://?嚙踝蕭 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 7)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/babydragon/attackbite.ani"); + obj.setCurrentAnimation(ani); + break; + case 2://?嚙踝蕭2 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 9)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/babydragon/attacknearbite.ani"); + obj.setCurrentAnimation(ani); + break; + case 3://嚙踝蕭牊 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 11)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/babydragon/serfire3_normal.ani"); + obj.setCurrentAnimation(ani); + // + local currentAni = obj.getCurrentAnimation(); + sizeRate = sizeRate.tofloat() / 100.0; + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + //?嚙踝蕭ptl + obj.sq_SetMoveParticle("particle/babydragon/fireball.ptl", 0.0, 0.0); + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 27) > 0) sq_SetSpeedToMoveParticle(obj, 0, 1400); + break; + case 4://嚙踝蕭嚙踝蕭 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 8)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/babydragon/attackfirebreath.ani"); + obj.setCurrentAnimation(ani); + break; + case 5://嚙踝蕭? + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + local etcSub = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + obj.getVar("custom").setInt(10, etcSub); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 12)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/babydragon/stone_niddle_normal.ani"); + obj.setCurrentAnimation(ani); + // + local currentAni = obj.getCurrentAnimation(); + sizeRate = sizeRate.tofloat() / 100.0; + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + //?嚙踝蕭ptl + obj.sq_SetMoveParticle("particle/babydragon/niddle.ptl", 0.0, 0.0); + if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 27) > 0) sq_SetSpeedToMoveParticle(obj, 0, 1200); + break; + case 6://旓? + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭totalDamage,delay,sizeRate,hittime + local totalDamage = receiveData.readDword(); + local delay = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local hittime = receiveData.readDword(); + obj.getVar("custom").setInt(10, hittime); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 10)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/babydragon/communionskill_body.ani"); + obj.setCurrentAnimation(ani); + // + local currentAni = obj.getCurrentAnimation(); + sizeRate = sizeRate.tofloat() / 100.0; + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + // + local speedRate = 6000.0 / delay.tofloat(); + local pAni = obj.getCurrentAnimation(); + pAni.setSpeedRate(speedRate); + local currentAni = obj.getCurrentAnimation(); + local delaySum = currentAni.getDelaySum(0, 7); + obj.setTimeEvent(10, delaySum, 1, false); + break; + case 11: + case 12: + case 13: + local totalDamage = receiveData.readDword(); + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + local targetObj = sq_GetObject(obj, group, uniqueId); + if(targetObj){ + obj.getVar("target").clear_obj_vector(); + obj.getVar("target").push_obj_vector(targetObj); + } + obj.getVar("custom").setInt(10, totalDamage); + if(subtype == 11){ + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 98)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + } + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 121: + case 131: + local totalDamage = receiveData.readDword(); + local attackIndex = 99; + if(subtype == 131) attackIndex = 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, attackIndex)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case 81://SummonMonsterReckless + local totalDamage = receiveData.readDword(); + local Delay = receiveData.readDword(); + obj.setTimeEvent(0,Delay,1,false); + break; + case 82://casillas + switch(subtype){ + case 1: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 60)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/casillas/attack1.ani"); + obj.setCurrentAnimation(ani); + break; + case 2: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 61)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/casillas/attack2.ani"); + obj.setCurrentAnimation(ani); + break; + case 3: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 62)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/casillas/attack3.ani"); + obj.setCurrentAnimation(ani); + //?嚙踝蕭?? + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + local parentObj = sq_GetObject(sqrChr, group, uniqueId); + sq_moveWithParent(parentObj, obj); + break; + case 41: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 64)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/casillas/moveslashmove.ani"); + obj.setCurrentAnimation(ani); + break; + case 42: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 64)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/casillas/moveslashafter.ani"); + obj.setCurrentAnimation(ani); + //嚙踝蕭? + local aniDelay = receiveData.readDword(); + if(aniDelay > 0){ + local animation = obj.getCurrentAnimation(); + for(local i = 0;i < 10; i++){ + sq_SetFrameDelayTime(animation, i, aniDelay); + } + } + // + obj.getVar().clear_vector(); + obj.getVar().push_vector(1); + break; + case 100: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 63)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/casillas/skill/slash.ani"); + obj.setCurrentAnimation(ani); + sq_SetCustomRotate(obj, sq_ToRadian(sq_getRandom(0,90).tofloat())); + break; + } + break; + case 118://sandorex + break; + case 119://heilrom + break; + case 120://spiritfireex + break; + case 121://kruta + switch(subtype){ + case 1://?嚙踝蕭 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 32)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/kruta/normalatk_body.ani"); + obj.setCurrentAnimation(ani); + // + sizeRate = sizeRate.tofloat() / 100.0; + local currentAni = obj.getCurrentAnimation(); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + break; + case 2://?嚙踝蕭嚙踝蕭? + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 33)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/kruta/dash02_body.ani"); + obj.setCurrentAnimation(ani); + local pAni = obj.getCurrentAnimation(); + sq_SetFrameDelayTime(pAni, 0, 600); + //?? + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + local targetObj = sq_GetObject(sqrChr, group, uniqueId);//嚙踝蕭嚙踝蕭?嚙踝蕭 + sq_moveWithParent(targetObj, obj); + //嚙踝蕭嚙踝蕭嚙踝蕭? + obj.setTimeEvent(0,150,-1,false); + local sizeRate = receiveData.readDword(); + // + sizeRate = sizeRate.tofloat() / 100.0; + local currentAni = obj.getCurrentAnimation(); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + break; + case 3://嚙踝蕭嚙踝蕭 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 34)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/kruta/cry_body.ani"); + obj.setCurrentAnimation(ani); + // + sizeRate = sizeRate.tofloat() / 100.0; + local currentAni = obj.getCurrentAnimation(); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + break; + case 41://嚙踝蕭嚙踝蕭?嚙踝蕭1 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 35)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/kruta/rage01_body.ani"); + obj.setCurrentAnimation(ani); + // + sizeRate = sizeRate.tofloat() / 100.0; + local currentAni = obj.getCurrentAnimation(); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + break; + case 42://嚙踝蕭嚙踝蕭?嚙踝蕭2 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 36)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/kruta/rage03_body.ani"); + obj.setCurrentAnimation(ani); + // + sizeRate = sizeRate.tofloat() / 100.0; + local currentAni = obj.getCurrentAnimation(); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + break; + case 51://?硉 : ?嚙踝蕭嚙踝蕭嚙踝蕭1 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 39)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/kruta/howl_body.ani"); + obj.setCurrentAnimation(ani); + // + sizeRate = sizeRate.tofloat() / 100.0; + local currentAni = obj.getCurrentAnimation(); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + break; + case 52://?硉 : ?嚙踝蕭嚙踝蕭嚙踝蕭2 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 37)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/kruta/atkaxeeffect_body.ani"); + obj.setCurrentAnimation(ani); + // + sizeRate = sizeRate.tofloat() / 100.0; + local currentAni = obj.getCurrentAnimation(); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + break; + case 53://?硉 : ?嚙踝蕭嚙踝蕭嚙踝蕭3 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 38)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/kruta/finishaxeeffect_body.ani"); + obj.setCurrentAnimation(ani); + // + sizeRate = sizeRate.tofloat() / 100.0; + local currentAni = obj.getCurrentAnimation(); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + break; + case 6://嚙踝蕭嚙踝蕭 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 38)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/kruta/kurutaattack_body.ani"); + obj.setCurrentAnimation(ani); + // + sizeRate = sizeRate.tofloat() / 100.0; + local currentAni = obj.getCurrentAnimation(); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + break; + case 10://嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","monster/character/mage/madeby_k_k/kruta/animation/talisman/krutaready_eff_00.ani"); + obj.setCurrentAnimation(ani); + local time = receiveData.readDword(); + obj.setTimeEvent(0,time,1,false); + break; + } + break; + case 122://ramos + switch(subtype){ + case 1://嚙踝蕭? + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 78)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/ramos/appearramos_04.ani"); + obj.setCurrentAnimation(ani); + break; + case 21://嚙踝蕭嚙踝蕭1 + case 32: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 66)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/ramos/punchattack1_01.ani"); + obj.setCurrentAnimation(ani); + //?嚙踝蕭嚙踝蕭? + local animation = obj.getCurrentAnimation(); + local aniDelay = receiveData.readDword(); + local aniDelay2 = receiveData.readDword(); + if(aniDelay > 0){ + for(local i = 0;i < 3; i++){ + sq_SetFrameDelayTime(animation, i, aniDelay); + } + } + if(aniDelay2 > 0) sq_SetFrameDelayTime(animation, 3, aniDelay2); + break; + case 22://嚙踝蕭嚙踝蕭2 + case 33: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 67)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/ramos/punchattack2_02.ani"); + obj.setCurrentAnimation(ani); + //?嚙踝蕭嚙踝蕭? + local animation = obj.getCurrentAnimation(); + local aniDelay = receiveData.readDword(); + local aniDelay2 = receiveData.readDword(); + local aniDelay3 = receiveData.readDword(); + if(aniDelay > 0) sq_SetFrameDelayTime(animation, 0, aniDelay); + if(aniDelay2 > 0){ + for(local i = 1;i < 4; i++){ + sq_SetFrameDelayTime(animation, i, aniDelay2); + } + } + if(aniDelay3 > 0) sq_SetFrameDelayTime(animation, 4, aniDelay3); + break; + case 31://嚙踝蕭? + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 75)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/ramos/punchmove_01.ani"); + obj.setCurrentAnimation(ani); + //?? + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + local targetObj = sq_GetObject(sqrChr, group, uniqueId);//嚙踝蕭嚙踝蕭?嚙踝蕭 + sq_moveWithParent(targetObj, obj); + //?嚙踝蕭嚙踝蕭? + local animation = obj.getCurrentAnimation(); + local aniDelay = receiveData.readDword(); + local aniDelay2 = receiveData.readDword(); + if(aniDelay > 0){ + for(local i = 0;i < 2; i++){ + sq_SetFrameDelayTime(animation, i, aniDelay); + } + } + if(aniDelay2 > 0) sq_SetFrameDelayTime(animation, 2, aniDelay2); + break; + case 41://嚙踝蕭嚙踝蕭 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + local totalDamage2 = receiveData.readDword(); + obj.getVar("bonusrate").clear_vector(); + obj.getVar("bonusrate").push_vector(totalDamage2); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 77)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local hittime = receiveData.readDword(); + local pAnidelay = receiveData.readDword(); + hittime = (pAnidelay.tofloat() / 72.0 * hittime).tointeger(); + obj.setTimeEvent(0,hittime,-1,false); + obj.getVar("delay").clear_vector(); + obj.getVar("delay").push_vector(pAnidelay); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 42://嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + local pAnidelay = receiveData.readDword(); + obj.getVar("delay").clear_vector(); + obj.getVar("delay").push_vector(pAnidelay); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 5://?嚙踝蕭 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 68)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/ramos/gatherattack_09.ani"); + obj.setCurrentAnimation(ani); + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"monster/character/mage/madeby_k_k/ramos/animation/gather/gathereffect_03.ani",0,0,0); + //sq_AddDrawOnlyAniFromParent(obj,"monster/character/mage/madeby_k_k/ramos/animation/gather/gathereffectdown_03.ani",0,0,0); + local hittime = receiveData.readDword(); + //?嚙踝蕭嚙踝蕭? + local animation = obj.getCurrentAnimation(); + local aniDelay = receiveData.readDword(); + if(aniDelay > 0){ + for(local i = 0;i < 15; i++){ + sq_SetFrameDelayTime(animation, i, aniDelay); + } + } + local pAni = pooledObj.getCurrentAnimation(); + local speedRate = 1960.0 / (aniDelay * 28).tofloat() * 100; + hittime = (aniDelay.tofloat() / 63.0 * hittime).tointeger(); + pAni.setSpeedRate(speedRate); + obj.setTimeEvent(0,hittime,-1,false); + obj.setTimeEvent(1,500,-1,false); + break; + case 6://嚙踝蕭嚙? + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 79)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/ramos/disappear_01.ani"); + obj.setCurrentAnimation(ani); + //?嚙踝蕭嚙踝蕭? + local animation = obj.getCurrentAnimation(); + local aniDelay = receiveData.readDword(); + if(aniDelay > 0){ + for(local i = 0;i < 9; i++){ + sq_SetFrameDelayTime(animation, i, aniDelay); + } + } + break; + case 71://嚙?嚙踝蕭嚙踝蕭嚙? + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 72)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/ramos/1up_08.ani"); + obj.setCurrentAnimation(ani); + local hittime = receiveData.readDword(); + //?嚙踝蕭嚙踝蕭? + local animation = obj.getCurrentAnimation(); + local aniDelay = receiveData.readDword(); + local aniDelay2 = receiveData.readDword(); + local aniDelay3 = receiveData.readDword(); + if(aniDelay > 0) sq_SetFrameDelayTime(animation, 0, aniDelay); + if(aniDelay2 > 0){ + for(local i = 1;i < 15; i++){ + sq_SetFrameDelayTime(animation, i, aniDelay2); + } + } + if(aniDelay3 > 0) sq_SetFrameDelayTime(animation, 15, aniDelay3); + hittime = (aniDelay.tofloat() / 72.0 * hittime).tointeger(); + obj.setTimeEvent(0,hittime,-1,false); + break; + case 72://嚙?嚙踝蕭?嚙踝蕭嚙踝蕭? + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 69)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/ramos/4start_46.ani"); + obj.setCurrentAnimation(ani); + local pooledObj1 = sq_CreateDrawOnlyObject(obj, "monster/character/mage/madeby_k_k/ramos/animation/meal/4start_backgound_00.ani", ENUM_DRAWLAYER_BOTTOM, true); + local pooledObj2 = sq_CreateDrawOnlyObject(obj, "monster/character/mage/madeby_k_k/ramos/animation/meal/4start_41.ani", ENUM_DRAWLAYER_COVER, true); + local hittime = receiveData.readDword(); + local aniDelay = receiveData.readDword(); + if(aniDelay > 0){ + local animation = obj.getCurrentAnimation(); + for(local i = 0;i < 8; i++){ + sq_SetFrameDelayTime(animation, i, aniDelay); + } + } + hittime = (aniDelay.tofloat() / 72.0 * hittime).tointeger(); + obj.setTimeEvent(0,hittime,-1,false); + local speedRate = (72.0 / aniDelay.tofloat() * 100.0); + local pAni1 = pooledObj1.getCurrentAnimation(); + local pAni2 = pooledObj2.getCurrentAnimation(); + pAni1.setSpeedRate(speedRate); + pAni2.setSpeedRate(speedRate); + break; + case 73://嚙?晡嚙踝蕭嚙? + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 71)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/ramos/4end_46.ani"); + obj.setCurrentAnimation(ani); + sq_CreateDrawOnlyObject(obj, "monster/character/mage/madeby_k_k/ramos/animation/meal/4end_07.ani", ENUM_DRAWLAYER_COVER, true); + sq_CreateDrawOnlyObject(obj, "monster/character/mage/madeby_k_k/ramos/animation/meal/4end_bottom_69.ani", ENUM_DRAWLAYER_BOTTOM, true); + sq_CreateDrawOnlyObject(obj, "monster/character/mage/madeby_k_k/ramos/animation/meal/4end_backgound_00.ani", ENUM_DRAWLAYER_BOTTOM, true); + local aniDelay = receiveData.readDword(); + if(aniDelay > 0){ + local animation = obj.getCurrentAnimation(); + for(local i = 0; i < 3; i++){ + sq_SetFrameDelayTime(animation, i, aniDelay); + } + } + break; + case 74: + sqrChr.getVar("RamosEffect1").clear_obj_vector(); + sqrChr.getVar("RamosEffect1").push_obj_vector(obj); + local ani = sq_CreateAnimation("","monster/character/mage/madeby_k_k/ramos/animation/meal/3background_30.ani"); + obj.setCurrentAnimation(ani); + break; + case 75: + sqrChr.getVar("RamosEffect2").clear_obj_vector(); + sqrChr.getVar("RamosEffect2").push_obj_vector(obj); + local ani = sq_CreateAnimation("","monster/character/mage/madeby_k_k/ramos/animation/meal/3front_12.ani"); + obj.setCurrentAnimation(ani); + break; + case 200: + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case SKILL_BYKK_SUMMONSPIRITCOMMON: + switch(subtype){ + case 101://嚙踝蕭1 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 85)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/spirit/dark/attack1.ani"); + obj.setCurrentAnimation(ani); + //?嚙踝蕭嚙踝蕭? + local animation = obj.getCurrentAnimation(); + local aniDelay = receiveData.readDword(); + local aniDelay2 = receiveData.readDword(); + if(aniDelay > 0) sq_SetFrameDelayTime(animation, 0, aniDelay); + if(aniDelay2 > 0) sq_SetFrameDelayTime(animation, 1, aniDelay2); + break; + case 102://嚙踝蕭2 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 86)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/spirit/dark/attack2.ani"); + obj.setCurrentAnimation(ani); + //?嚙踝蕭嚙踝蕭? + local animation = obj.getCurrentAnimation(); + local aniDelay = receiveData.readDword(); + obj.setTimeEvent(0,4 * aniDelay,-1,false); + if(aniDelay > 0){ + for(local i = 0;i < 11; i++){ + sq_SetFrameDelayTime(animation, i, aniDelay); + } + } + break; + case 201://嚙踝蕭1 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 87)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/spirit/fire/attack1.ani"); + obj.setCurrentAnimation(ani); + //?嚙踝蕭嚙踝蕭? + local animation = obj.getCurrentAnimation(); + local aniDelay = receiveData.readDword(); + if(aniDelay > 0) sq_SetFrameDelayTime(animation, 0, aniDelay); + break; + case 202://嚙踝蕭2/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 88)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/spirit/fire/attack2loop.ani"); + obj.setCurrentAnimation(ani); + // + local time = receiveData.readDword(); + obj.setTimeEvent(0,time,1,false); + obj.setTimeEvent(1,300,-1,false); + //?? + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + local targetObj = sq_GetObject(sqrChr, group, uniqueId);//嚙踝蕭嚙踝蕭?嚙踝蕭 + sq_moveWithParent(targetObj, obj); + break; + case 301://嚙踝蕭1 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 89)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/spirit/light/attack1.ani"); + obj.setCurrentAnimation(ani); + //?嚙踝蕭嚙踝蕭? + local animation = obj.getCurrentAnimation(); + local aniDelay = receiveData.readDword(); + local aniDelay2 = receiveData.readDword(); + if(aniDelay > 0){ sq_SetFrameDelayTime(animation, 0, aniDelay);sq_SetFrameDelayTime(animation, 1, aniDelay); } + if(aniDelay2 > 0){sq_SetFrameDelayTime(animation, 2, aniDelay2);sq_SetFrameDelayTime(animation, 3, aniDelay2);sq_SetFrameDelayTime(animation, 4, aniDelay2);} + break; + case 302://嚙踝蕭2 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 90)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/spirit/light/attack2.ani"); + obj.setCurrentAnimation(ani); + //?嚙踝蕭嚙踝蕭? + local animation = obj.getCurrentAnimation(); + local aniDelay = receiveData.readDword(); + obj.setTimeEvent(0,aniDelay * 5,1,false); + if(aniDelay > 0){ + for(local i = 0;i < 9; i++){ + sq_SetFrameDelayTime(animation, i, aniDelay); + } + } + break; + case 401://?1 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 91)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/spirit/water/attack1.ani"); + obj.setCurrentAnimation(ani); + //?嚙踝蕭嚙踝蕭? + local animation = obj.getCurrentAnimation(); + local aniDelay = receiveData.readDword(); + local aniDelay2 = receiveData.readDword(); + if(aniDelay > 0) sq_SetFrameDelayTime(animation, 0, aniDelay); + if(aniDelay2 > 0) sq_SetFrameDelayTime(animation, 1, aniDelay2); + break; + case 402://?2 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 92)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/spirit/water/icewave1.ani"); + obj.setCurrentAnimation(ani); + break; + case 1001://嚙踝蕭嚙踝蕭 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local sub = receiveData.readDword(); + obj.getVar("sizeRate").clear_vector(); + obj.getVar("sizeRate").push_vector(sizeRate); + obj.getVar("sizeRate").push_vector(sub); + local anipath; + switch(sub){ + case 1: + anipath = "passiveobject/common/animation/darkexplosion.ani"; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 93)); + break; + case 2: + anipath = "passiveobject/common/animation/fireexplosion.ani"; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 94)); + break; + case 3: + anipath = "passiveobject/common/animation/lightexplosion.ani"; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 95)); + break; + case 4: + anipath = "passiveobject/common/animation/icefireexplosion.ani"; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 96)); + break; + } + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("",anipath); + obj.setCurrentAnimation(ani); + //嚙踝蕭嚙? + local currentAni = obj.getCurrentAnimation();//嚙踝蕭嚙踝蕭?嚙踝蕭ani + sizeRate = sizeRate.tofloat() / 100.0; + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate);//嚙踝蕭??嚙踝蕭x y z嚙踝蕭嚙踝蕭 + obj.sq_PlaySound("B_FIRE_EXPLOSION"); + local prob = receiveData.readDword(); + local time = receiveData.readDword(); + local level = sq_GetSkillLevel(sqrChr, 174) + 20; + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo){ + switch(sub){ + case 1: + sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_CURSE, prob, level, time); + break; + case 2: + sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_BURN, prob, level, time); + break; + case 3: + sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_LIGHTNING, prob, level, time); + break; + case 4: + sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_FREEZE, prob, level, time); + break; + } + } + obj.setTimeEvent(1, 200, 2, true); + obj.setTimeEvent(2, 50, 4, true); + obj.setTimeEvent(3, 15, 8, true); + obj.setTimeEvent(4, 100, 2, true); + break; + case 1002://嚙踝蕭嚙踝蕭 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local sub = receiveData.readDword(); + obj.getVar("sizeRate").clear_vector(); + obj.getVar("sizeRate").push_vector(sizeRate); + obj.getVar("sizeRate").push_vector(sub); + local anipath; + switch(sub){ + case 1: + anipath = "passiveobject/madeby_k_k/animation/spirit/spirit/darkexplosion.ani"; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 93)); + break; + case 2: + anipath = "passiveobject/madeby_k_k/animation/spirit/spirit/fireexplosion.ani"; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 94)); + break; + case 3: + anipath = "passiveobject/madeby_k_k/animation/spirit/spirit/lightexplosion.ani"; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 95)); + break; + case 4: + anipath = "passiveobject/madeby_k_k/animation/spirit/spirit/icefireexplosion.ani"; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 96)); + break; + } + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("",anipath); + obj.setCurrentAnimation(ani); + //嚙踝蕭嚙? + local currentAni = obj.getCurrentAnimation();//嚙踝蕭嚙踝蕭?嚙踝蕭ani + sizeRate = sizeRate.tofloat() / 100.0; + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate);//嚙踝蕭??嚙踝蕭x y z嚙踝蕭嚙踝蕭 + obj.sq_PlaySound("B_FIRE_EXPLOSION"); + local prob = receiveData.readDword(); + local time = receiveData.readDword(); + local level = sq_GetSkillLevel(sqrChr, 174) + 20; + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo){ + switch(sub){ + case 1: + sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_CURSE, prob, level, time); + break; + case 2: + sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_BURN, prob, level, time); + break; + case 3: + sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_LIGHTNING, prob, level, time); + break; + case 4: + sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_FREEZE, prob, level, time); + break; + } + } + break; + case 2001: + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + print("test:" + totalDamage); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 101)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local anipath = "passiveobject/madeby_k_k/animation/spirit/spirit/allexplosion.ani"; + local ani = sq_CreateAnimation("",anipath); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + sizeRate = sizeRate.tofloat() / 100.0; + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + break; + } + break; + case SKILL_BYKK_MOONSHADOW: + switch(subtype){ + case 1://嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + local time = receiveData.readDword(); + // obj.setTimeEvent(0,time,1,false); + obj.getVar("custom").setInt(0, time); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + //?? + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + local targetObj = sq_GetObject(sqrChr, group, uniqueId);//嚙踝蕭嚙踝蕭?嚙踝蕭 + sq_moveWithParent(targetObj, obj); + obj.setMapFollowParent(sqrChr); + obj.setMapFollowType(1); + if(sqrChr.getVar("moonshadow").get_obj_vector_size() > 0){ + sqrChr.getVar("moonshadow").push_obj_vector(obj); + } + else{ + sqrChr.getVar("moonshadow").clear_obj_vector(); + sqrChr.getVar("moonshadow").push_obj_vector(obj); + } + return; + break; + case 2://嚙踝蕭嚙踝蕭 + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = receiveData.readDword(); + print("totalDamage = "+totalDamage); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 97)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/moonshadow/moonshadow_blackexplosion.ani"); + obj.setCurrentAnimation(ani); + break; + case 3: + local hitMax = receiveData.readDword(); + obj.setTimeEvent(1, 75, hitMax, false); + 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); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 102)); + } + else sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case SKILL_BYKK_BLACKLUNATIC: + switch(subtype){ + case 1://月蚀长矛103 + local totalDamage = receiveData.readDword(); + local angle = receiveData.readDword(); + local moveX = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 103)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + sq_SetCustomRotate(obj, sq_ToRadian(270.0-angle.tofloat())); + obj.getVar("custom").setInt(10, sq_GetXPos(obj)); + obj.getVar("custom").setInt(11, sq_GetZPos(obj)); + obj.getVar("custom").setInt(12, moveX); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 2://月空破碎104 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 104)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.sq_PlaySound("R_BLACK_LUNATIC_MOONBREAK"); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/luis/luis_blacklunatic/moonbrakeattack_00.ani"); + obj.setCurrentAnimation(ani); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/blacklunatic/moonbrakeattackbottom_00.ani", 0, -1, 0); + break; + case 3://月光追击105 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 105)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.sq_PlaySound("R_BLACK_LUNATIC_MOONLIGHT"); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/luis/luis_blacklunatic/moonlightattack_00.ani"); + obj.setCurrentAnimation(ani); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/blacklunatic/moonlightattackbottom_00.ani", 0, -1, 0); + break; + case 4://黑暗闪电106 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 106)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.sq_PlaySound("R_BLACK_LUNATIC_MOONLIGHT"); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/luis/luis_blacklunatic/darklightningattack_00.ani"); + obj.setCurrentAnimation(ani); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/blacklunatic/darklightningattackbottom_00.ani", 0, -1, 0); + break; + case 5://施放时蚀爆炸106 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 106)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/luis/luis_blacklunatic/darkmoonattack_00.ani"); + obj.setCurrentAnimation(ani); + local pAni = obj.getCurrentAnimation(); + print(pAni.getDelaySum(false)); + break; + } + break; + case 150: + switch(subtype){ + case 1: + local totalDamage = receiveData.readDword(); + local holdTime = receiveData.readDword(); + obj.getVar("custom").setInt(0, totalDamage); + obj.getVar("custom").setInt(1, holdTime); + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/throwstickytrap/throwglue_bottle01.ani"); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 109)); + // sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + if(sq_GetDirection(obj) == ENUM_DIRECTION_RIGHT) sq_SetVelocity(obj, 0, 800.0); + else sq_SetVelocity(obj, 0, -800.0); + break; + case 2: + local totalDamage = receiveData.readDword(); + local holdTime = receiveData.readDword(); + obj.getVar("custom").setInt(1, holdTime); + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/throwstickytrap/throwglue_explosion01.ani"); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 110)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + break; + case 3: + // + break; + } + break; + case SKILL_BYKK_HIGHESTECHEVERRA: + switch(subtype){ + case 1: + local totalDamage = receiveData.readDword(); + local hitMax = receiveData.readDword(); + local speedRate = receiveData.readDword(); + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/highestecheverra/hitdummy1.ani"); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 108)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local pAni = obj.getCurrentAnimation(); + pAni.setSpeedRate(speedRate.tofloat()); + local currentAni = obj.getCurrentAnimation(); + print("delay = "+currentAni.getDelaySum(false)); + print("hitMax = "+hitMax); + obj.setTimeEvent(1, currentAni.getDelaySum(false) / (hitMax + 2), hitMax, true); + break; + case 2: + local totalDamage = receiveData.readDword(); + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/highestecheverra/explosionbottom_08.ani"); + obj.setCurrentAnimation(ani); + local aniPath = "character/mage/animation/summoner_bykk/effect/highestecheverra/explosionfront_08.ani"; + sq_AddDrawOnlyAniFromParent(obj, aniPath, 0, 1, 0); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 108)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); + break; + case 3: + local speedRate = receiveData.readDword(); + local ani = sq_CreateAnimation("","character/mage/animation/summoner_bykk/effect/highestecheverra/highestecheverrac_08.ani"); + obj.setCurrentAnimation(ani); + local pAni = obj.getCurrentAnimation(); + pAni.addLayerAnimation(6,sq_CreateAnimation("","character/mage/animation/summoner_bykk/effect/highestecheverra/highestecheverrab_00.ani"),true); + pAni.addLayerAnimation(10,sq_CreateAnimation("","character/mage/animation/summoner_bykk/effect/highestecheverra/highestecheverrad_07.ani"),true); + pAni.setImageRateFromOriginal(0.9, 0.9); + pAni.setAutoLayerWorkAnimationAddSizeRate(0.9); + pAni.setSpeedRate(speedRate.tofloat()); + obj.sq_PlaySound("HIGHEST_ECHEVERRA_SUMMON"); + break; + } + break; + } + local element_kk_fire = sqrChr.getVar("element_kk").getInt(0); + local element_kk_water = sqrChr.getVar("element_kk").getInt(1); + local element_kk_dark = sqrChr.getVar("element_kk").getInt(2); + local element_kk_light = sqrChr.getVar("element_kk").getInt(3); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo) return; + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE) && element_kk_fire > 0) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER) && element_kk_water > 0) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK) && element_kk_dark > 0) attackInfo.setElement(ENUM_ELEMENT_DARK); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT) && element_kk_light > 0) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(sqrChr.getVar("eclipsehive_select").getBool(0) == false){ + local hitdelayRate = 100.0; + if(skillIndex > 75 && skillIndex < 80 && sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 26) > 0) hitdelayRate = 120.0; + sq_SetAttackInfoHitDelayRateDamager(attackInfo, hitdelayRate); + } +} + +function setState_po_summoners(obj, state, datas) +{ + if (!obj) return; + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").get_vector(0); + local subtype = obj.getVar("subtype").get_vector(0); + obj.getVar("state").clear_vector(); + obj.getVar("state").push_vector(state); + + switch(skillIndex){ + case 25://hodor + switch(subtype){ + case 7://嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + switch(state){ + case 20: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/hodor/bombfly.ani"); + obj.setCurrentAnimation(ani); + //?嚙踝蕭PTL + obj.sq_SetMoveParticle("particle/hodor/hodorbomb.ptl", 0.0, 0.0); + break; + case 21: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/hodor/bombland.ani"); + obj.setCurrentAnimation(ani); + local pAni = obj.getCurrentAnimation(); + pAni.setSpeedRate(300.0); + //嚙踝蕭PTL + obj.sq_RemoveMoveParticle(); + break; + case 22: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = obj.getVar("totalDamage").get_vector(0); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 5)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/hodor/bombsub.ani"); + obj.setCurrentAnimation(ani); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/madeby_k_k/animation/hodor/earthquake.ani", 0, 0, 0); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/madeby_k_k/animation/hodor/earthquakering.ani", 0, 0, 0); + sq_CreateParticle("common/hiteffect/particle/firehitparticle.ptl", obj, 0, 0, 0, true, 30, 0, 2); + sq_CreateParticle("common/hiteffect/particle/firehitparticlelight.ptl", obj, 0, 0, 0, true, 30, 0, 2); + break; + case 23: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = obj.getVar("totalDamage").get_vector(0); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 5)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/hodor/bombsub.ani"); + obj.setCurrentAnimation(ani); + sq_CreateParticle("common/hiteffect/particle/firehitparticle.ptl", obj, 0, 0, 0, true, 30, 0, 2); + sq_CreateParticle("common/hiteffect/particle/firehitparticlelight.ptl", obj, 0, 0, 0, true, 30, 0, 2); + break; + } + break; + } + break; + case 44://sandor + break; + case 45://auxo + switch(subtype){ + case 5: + case 15: + switch(state){ + case 20: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/monsterflower/overgrowthseed.ani"); + obj.setCurrentAnimation(ani); + //?嚙踝蕭PTL + obj.sq_SetMoveParticle("particle/auxo/overgrowthseed.ptl", sq_getRandom(-30,30).tofloat(), sq_getRandom(-10,10).tofloat()); + break; + case 21: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/monsterflower/overgrowthgrowupmonsterflower.ani"); + obj.setCurrentAnimation(ani); + local pAni = obj.getCurrentAnimation(); + pAni.setSpeedRate(200.0); + //嚙踝蕭PTL + obj.sq_RemoveMoveParticle(); + break; + case 22: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/monsterlunaflower/summonauxoawakeningout_body.ani"); + obj.setCurrentAnimation(ani); + //嚙踝蕭PTL + obj.sq_RemoveMoveParticle(); + break; + } + break; + case 13: + switch(state){ + case 20: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/monsterlunaflower/spit/summonauxoawakeningspit_sik.ani"); + obj.setCurrentAnimation(ani); + //?嚙踝蕭ptl + sq_SetCustomRotate(obj, sq_ToRadian(-30.0)); + obj.sq_SetMoveParticle("particle/monsterfower/monsterlunaflowerspit.ptl", 0.0, 0.0); + break; + case 21: + sq_SetCustomRotate(obj, sq_ToRadian(0.0)); + obj.sq_RemoveMoveParticle(); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/monsterlunaflower/spit/summonauxoawakeningspit_boom.ani"); + obj.setCurrentAnimation(ani); + //嚙踝蕭眳 + // local objmg = obj.getObjectManager(); //嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭庢嚙踝蕭嚙踝蕭 + // for(local i= 0; i < objmg.getCollisionObjectNumber(); i++){ + // local object = objmg.getCollisionObject(i); //嚙踝蕭嚙踝蕭嚙踝蕭嚙論橘蕭嚙踝蕭嚙? + // if(object && obj.isEnemy(object) && object.isObjectType(OBJECTTYPE_ACTIVE) && sq_Abs(object.getXPos() - obj.getXPos()) <= 400 && sq_Abs(object.getYPos() - obj.getYPos()) <= 200){ + // local activeObj = sq_GetCNRDObjectToActiveObject(object); + // sq_SendHitObjectPacket(obj,activeObj,0,0,sq_GetObjectHeight(activeObj) / 2); + // //createPassiveObject_k_k(sqrChr,obj,45,13,0,0,0,0,22,sq_GetGroup(activeObj),sq_GetUniqueId(activeObj), 0); + // } + // } + break; + case 22: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/monsterlunaflower/spit/summonauxoawakeningspit_sikloop.ani"); + obj.setCurrentAnimation(ani); + break; + case 23: + + break; + } + break; + case 14: + switch(state){ + case 20: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/monsterlunaflower/bomit/summonauxoawakeningbomit_sik.ani"); + obj.setCurrentAnimation(ani); + sq_SetCustomRotate(obj, sq_ToRadian(5.0)); + //?嚙踝蕭ptl + obj.sq_SetMoveParticle("particle/monsterfower/monsterlunaflowerbomit.ptl", 0.0, 0.0); + break; + case 21: + sq_SetCustomRotate(obj, sq_ToRadian(0.0)); + obj.sq_RemoveMoveParticle(); + // + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/monsterlunaflower/bomit/summonauxoawakeningbomit_boom.ani"); + obj.setCurrentAnimation(ani); + local sizeRate = obj.getVar().getInt(10); + sizeRate = sizeRate.tofloat() / 100.0; + local currentAni = obj.getCurrentAnimation(); + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + break; + } + break; + } + break; + case 46://luis + switch(subtype){ + case 5: + switch(state){ + case 20: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/common/animation/magictargetwarningterrible.ani"); + obj.setCurrentAnimation(ani); + local pAni = obj.getCurrentAnimation(); + local fireT = pAni.getDelaySum(false); + obj.setTimeEvent(0,fireT / 3, 1, false); + break; + case 21: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/common/animation/magictargetwarningterrible.ani"); + obj.setCurrentAnimation(ani); + local pAni = obj.getCurrentAnimation(); + local fireT = pAni.getDelaySum(false); + obj.setTimeEvent(2,fireT / 3, 1, false); + break; + case 22: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/dummy.ani"); + obj.setCurrentAnimation(ani); + break; + } + break; + case 6: + switch(state){ + case 20: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = obj.getVar().get_vector(0); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 25)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/luis/luis_meteor/luis_meteor_rock_eff01.ani"); + obj.setCurrentAnimation(ani); + //?嚙踝蕭ptl + obj.sq_SetMoveParticle("particle/luis/luis_meteor.ptl", 0.0, 0.0); + if(obj.getVar().get_vector(2) > 0){ + sq_SetSpeedToMoveParticle(obj, 0, 2400); + sq_SetSpeedToMoveParticle(obj, 2, -4800); + } + break; + case 21: + //?嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + local totalDamage = obj.getVar().get_vector(1); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 26)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //嚙踝蕭PTL + obj.sq_RemoveMoveParticle(); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/luis/luis_meteor/luis_meteor_explosion_back.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1001,sq_CreateAnimation("","passiveobject/madeby_k_k/animation/luis/luis_meteor/luis_meteor_explosion_floor01.ani"),true); + break; + } + break; + } + break; + case 47://echeverra + switch(subtype){ + case 8: + switch(state){ + case 20: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spikeking/newskill/soundshockfloor_startwave.ani"); + obj.setCurrentAnimation(ani); + local pAni = obj.getCurrentAnimation(); + local Delay = obj.getVar("Delay").get_vector(0); + local speedRate = 136000.0 / Delay.tofloat(); + pAni.setSpeedRate(speedRate); + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); + break; + case 21: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spikeking/newskill/soundshockfloor_end01.ani"); + obj.setCurrentAnimation(ani); + local pAni = obj.getCurrentAnimation(); + pAni.setSpeedRate(150.0); + break; + } + break; + case 9: + switch(state){ + case 20: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spikeking/newskill/charge_loop/sarpozanormalattackcasting_01.ani"); + obj.setCurrentAnimation(ani); + sq_setCurrentAxisPos(obj, 2, -60); + local pAni = obj.getCurrentAnimation(); + local Delay = obj.getVar("Delay").get_vector(0); + local speedRate = 148500.0 / Delay.tofloat(); + pAni.setSpeedRate(speedRate * 1.2); + obj.sq_PlaySound("SARPOZA_ELEMENTAL_STRIKE_DARK_CAST_01",1001); + break; + case 21: + obj.stopSound(1001); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spikeking/newskill/charge_end/sarpozanormalattackcasting_05.ani"); + obj.setCurrentAnimation(ani); + break; + case 22: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spikeking/newskill/tell/sarpozateleportfront_00.ani"); + obj.setCurrentAnimation(ani); + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(obj.getXPos(), obj.getDirection(), 100)); + sq_setCurrentAxisPos(obj, 2, 100); + local pAni = obj.getCurrentAnimation(); + pAni.setSpeedRate(150.0); + pAni.setImageRateFromOriginal(0.5, 0.5); + pAni.setAutoLayerWorkAnimationAddSizeRate(0.5); + obj.sq_PlaySound("R_SARPOZA_N_MAGIC_DARK_FIRING",1003); + break; + case 23: + local targetObj = sq_GetCNRDObjectToActiveObject(obj.getVar().get_obj_vector(0)); + sq_setCurrentAxisPos(obj, 0, targetObj.getXPos()); + sq_setCurrentAxisPos(obj, 1, targetObj.getYPos() + 1); + sq_setCurrentAxisPos(obj, 2, 70); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spikeking/newskill/tell/sarpozateleportfront_00.ani"); + obj.setCurrentAnimation(ani); + switch(targetObj.getCollisionObjectIndex()){ + case MONSTER_ID_DARKHIGHERSPIRIT: + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/madeby_k_k/animation/spikeking/newskill/buff_animation/end_element_00.ani",0,0,-50); + break; + case MONSTER_ID_FIREHIGHERSPIRIT: + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/madeby_k_k/animation/spikeking/newskill/buff_animation/end_red_00.ani",0,0,-50); + break; + case MONSTER_ID_LIGHTHIGHERSPIRIT: + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/madeby_k_k/animation/spikeking/newskill/buff_animation/end_green_00.ani",0,0,-50); + break; + case MONSTER_ID_WATERHIGHERSPIRIT: + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/madeby_k_k/animation/spikeking/newskill/buff_animation/end_blue_00.ani",0,0,-50); + break; + } + local pAni = obj.getCurrentAnimation(); + pAni.setSpeedRate(150.0); + pAni.setImageRateFromOriginal(0.5, 0.5); + pAni.setAutoLayerWorkAnimationAddSizeRate(0.5); + obj.sq_PlaySound("R_SARPOZA_N_MAGIC_DARK_FIRING",1003); + break; + } + break; + case 41: + switch(state){ + case 20: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spikeking/darksteellightning/magictargetwarning.ani"); + obj.setCurrentAnimation(ani); + local pAni = obj.getCurrentAnimation(); + pAni.setSpeedRate(140.0); + break; + case 21: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spikeking/darksteellightning/darksteellightning.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + local sizeRate = 1.3; + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + obj.setTimeEvent(1,200,1,false); + break; + } + break; + } + break; + case 76://spiritdarkhigher + switch(subtype){ + case 3: + switch(state){ + case 20: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/darkhigherspirit/star.ani"); + obj.setCurrentAnimation(ani); + break; + case 21: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/darkhigherspirit/loop.ani"); + obj.setCurrentAnimation(ani); + sq_CreateParticle("passiveobject/monster/spirit/particle/belzebuite_overskill_dark_for_deadmulker.ptl", obj, 0, 0, 0, true, 200, 4000, 200); + break; + case 22: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/darkhigherspirit/end.ani"); + obj.setCurrentAnimation(ani); + break; + } + break; + case 41: + switch(state){ + case 20: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/darkhigherspirit/blackfog/belzebuite_overskill_circle_of_magic_1.ani"); + obj.setCurrentAnimation(ani); + break; + case 21: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/darkhigherspirit/blackfog/belzebuite_overskill_circle_of_magic_2.ani"); + obj.setCurrentAnimation(ani); + break; + case 22: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/darkhigherspirit/blackfog/belzebuite_overskill_circle_of_magic_3.ani"); + obj.setCurrentAnimation(ani); + break; + } + break; + case 61: + switch(state){ + case 20: + sq_SetMyShake(obj,2,80); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/darkhigherspirit/darkskill/test/animation/cylinder/cylinder150/cylinderstart_01.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/darkhigherspirit/darkskill/test/animation/blackfogstart.ani"),true); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/madeby_k_k/animation/spirit/darkhigherspirit/darkskill/test/animation/circleb.ani",0,0,0); + currentAni.setSpeedRate(150.0); + obj.sq_PlaySound("DESCHAMPS_SHOCKWAVE"); + break; + case 21: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/darkhigherspirit/darkskill/test/animation/cylinder/cylinder150/cylinderloop_00.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/darkhigherspirit/darkskill/test/animation/blackfogloop.ani"),true); + local time = (obj.getVar("time").get_vector(0) - 693) / 3; + obj.setTimeEvent(2, time, 3, true); + break; + case 22: + sq_SetMyShake(obj,3,100); + obj.resetHitObjectList(); + local bonusRate = sq_GetCurrentAttackBonusRate(obj) * 2; + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), bonusRate); + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/darkhigherspirit/darkskill/test/animation/cylinder/cylinder150/cylinderend_00.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/darkhigherspirit/darkskill/test/animation/blackfogend.ani"),true); + currentAni.setSpeedRate(180.0); + obj.sq_PlaySound("DESCHAMPS_METAL_EXP"); + break; + } + break; + case 62: + switch(state){ + case 20: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/darkhigherspirit/darkskill/test/animation/circle/magiccirclestart_00.ani"); + obj.setCurrentAnimation(ani); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/madeby_k_k/animation/spirit/darkhigherspirit/darkskill/test/animation/cylinderstartbottom_01.ani",0,0,0); + break; + case 21: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/darkhigherspirit/darkskill/test/animation/circle/magiccircleloop_01.ani"); + obj.setCurrentAnimation(ani); + break; + case 22: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/darkhigherspirit/darkskill/test/animation/circle/magiccircleend_00.ani"); + obj.setCurrentAnimation(ani); + break; + } + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); + break; + case 63: + switch(state){ + case 20: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/dummy.ani"); + obj.setCurrentAnimation(ani); + break; + case 21: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/darkhigherspirit/darkskill/test/holding_start_dodge.ani"); + obj.setCurrentAnimation(ani); + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_COVER); + //?? + local activeObj = sq_GetCNRDObjectToActiveObject(obj.getVar().get_obj_vector(0)); + if(activeObj){ + //local x = activeObj.getXPos(); + //local y = activeObj.getYPos(); + //local z = activeObj.getObjectHeight()/2 + CRI_UPPER_HEIGHT; + //local dieHardAppendage = CNSquirrelAppendage.sq_GetAppendage(activeObj,"ui/ap/ap_monster.nut"); + local hp = activeObj.getHp(); + //applyNomalDamage(dieHardAppendage,hp,x+20,y,z); + activeObj.setHp(0, null, true); + sq_SetMyShake(obj,3,180); + } + break; + } + + break; + } + break; + case 77://spiritlighthigher + switch(subtype){ + case 1: + switch(state){ + case 20: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spikeking/darksteellightning/magictargetwarning.ani"); + obj.setCurrentAnimation(ani); + local pAni = obj.getCurrentAnimation(); + pAni.setSpeedRate(200.0); + break; + case 21: + case 22: + case 23: + case 24: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/lighthigherspirit/magelighthigherspiritthunder"+(state - 20).tostring()+".ani"); + obj.setCurrentAnimation(ani); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/madeby_k_k/animation/spirit/lighthigherspirit/magelighthigherspiritthundersplash.ani",0,0,0); + local pAni = obj.getCurrentAnimation(); + pAni.setSpeedRate(150.0); + break; + } + break; + case 21: + switch(state){ + case 20: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spikeking/darksteellightning/magictargetwarning.ani"); + obj.setCurrentAnimation(ani); + local pAni = obj.getCurrentAnimation(); + pAni.setSpeedRate(200.0); + break; + case 21: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/lighthigherspirit/thunderbolt.ani"); + obj.setCurrentAnimation(ani); + break; + } + break; + case 41: + switch(state){ + case 20: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/lighthigherspirit/lightsoul/thunder_warning02.ani"); + obj.setCurrentAnimation(ani); + local pAni = obj.getCurrentAnimation(); + pAni.setSpeedRate(130.0); + break; + case 21: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/lighthigherspirit/lightsoul/thunder_pang.ani"); + obj.setCurrentAnimation(ani); + monsterpulled_bykkkkkkk(sqrChr,obj,0,0,0); + break; + } + break; + case 42: + switch(state){ + case 20: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/lighthigherspirit/lightsoul/thunder_warning02.ani"); + obj.setCurrentAnimation(ani); + local pAni = obj.getCurrentAnimation(); + pAni.setSpeedRate(130.0); + break; + case 21: + //?嚙踝蕭ANI + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/lighthigherspirit/lightsoul/thunderstrike_lightning01.ani"); + obj.setCurrentAnimation(ani); + monsterpulled_bykkkkkkk(sqrChr,obj,0,0,0); + break; + } + break; + } + break; + case 78://spiritwaterhigher + switch(subtype){ + case 3: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/waterhigherspirit/summon_water_ice_spear_front_dodge.ani"); + obj.setCurrentAnimation(ani); + local pAni = obj.getCurrentAnimation(); + pAni.setSpeedRate(200.0); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/waterhigherspirit/element_water_ice_spear_dodge.ani"); + obj.setCurrentAnimation(ani); + obj.sq_SetMoveParticle("particle/spirit/water_spirit_higher_ice_spear_move.ptl", 0.0, 0.0); + break; + case 22: + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/waterhigherspirit/element_water_ice_spear_broken_normal.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/waterhigherspirit/element_water_ice_spear_broken_dodge.ani"),true); + break; + } + break; + case 11: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/waterhigherspirit/element_water_ice_appear_none.ani"); + obj.setCurrentAnimation(ani); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/waterhigherspirit/element_water_ice_normal_none.ani"); + obj.setCurrentAnimation(ani); + break; + case 22: + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/waterhigherspirit/element_water_ice_break_ldodge.ani"); + obj.setCurrentAnimation(ani); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/madeby_k_k/animation/spirit/waterhigherspirit/element_water_ice_break_none.ani"0,-1,-1); + break; + } + break; + case 10: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/waterhigherspirit/water_firewater/start/watertornado_start_04.ani"); + obj.setCurrentAnimation(ani); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/waterhigherspirit/water_firewater/loop/watertornado_loop_03.ani"); + obj.setCurrentAnimation(ani); + local parentObj = obj.getParent(); + local appendage = CNSquirrelAppendage.sq_AppendAppendage(parentObj, obj, SKILL_BYKK_SUMMONSPIRITWATERHIGHER, false, "character/mage/k_k_made/appendage/aptomonster/skill_ap/ap_waterhigherspirit_skill.nut", false); + if(appendage){ + appendage.sq_SetValidTime(3000); + CNSquirrelAppendage.sq_Append(appendage, parentObj, obj); + local auraAppendage = appendage.sq_getAuraMaster("wtornadoAura"); + if(!auraAppendage) auraAppendage = appendage.sq_AddAuraMaster("wtornadoAura",parentObj, obj, 1200, 18, 5, 0); + if(auraAppendage) auraAppendage.setAttractionInfo(300, 300, 600, 100); + } + break; + case 22: + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/waterhigherspirit/water_firewater/end/watertornado_end_03.ani"); + obj.setCurrentAnimation(ani); + break; + } + local currentAni = obj.getCurrentAnimation();//嚙踝蕭嚙踝蕭?嚙踝蕭ani + local sizeRate = 0.65;//??搣嚙踝蕭??蓱 + currentAni.setImageRateFromOriginal(sizeRate, sizeRate);//嚙踝蕭吤ani ?嚙踝蕭?嚙踝蕭嚙踝蕭嚙踝蕭 + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);//嚙踝蕭吤ani als旓吤 ani嚙踝蕭嚙踝蕭嚙踝蕭嚙? + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate);//嚙踝蕭??嚙踝蕭x y z嚙踝蕭嚙踝蕭 + break; + } + break; + case 79://spiritfirehigher + switch(subtype){ + case 61: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/firehigherspirit/fire/roulettefiretornado_start_tornadostart.ani"); + obj.setCurrentAnimation(ani); + obj.setTimeEvent(2,480,1,false); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/firehigherspirit/fire/roulettefiretornado_loop_tornadoloop.ani"); + obj.setCurrentAnimation(ani); + break; + case 22: + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/spirit/firehigherspirit/fire/roulettefiretornado_end_tornadoend.ani"); + obj.setCurrentAnimation(ani); + obj.stopTimeEvent(3); + break; + } + local currentAni = obj.getCurrentAnimation();//嚙踝蕭嚙踝蕭?嚙踝蕭ani + local sizeRate = 0.55;//??搣嚙踝蕭??蓱 + currentAni.setImageRateFromOriginal(sizeRate, sizeRate);//嚙踝蕭吤ani ?嚙踝蕭?嚙踝蕭嚙踝蕭嚙踝蕭 + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);//嚙踝蕭吤ani als旓吤 ani嚙踝蕭嚙踝蕭嚙踝蕭嚙? + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate);//嚙踝蕭??嚙踝蕭x y z嚙踝蕭嚙踝蕭 + break; + } + break; + case 80://babydragon + switch(subtype){ + case 11: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/babydragon/newskill/disaster/standing/disaster_standingbody_astrab.ani"); + obj.setCurrentAnimation(ani); + local pAni = obj.getCurrentAnimation(); + pAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/madeby_k_k/animation/babydragon/newskill/disaster/standing/disaster_standingbody_astraf.ani"),true); + sq_AddDrawOnlyAniFromParent(obj, "passiveobject/madeby_k_k/animation/babydragon/newskill/disaster/standing/disaster_standingeffectback_01.ani", 0, -1, 0); + sq_AddDrawOnlyAniFromParent(obj, "passiveobject/madeby_k_k/animation/babydragon/newskill/disaster/standing/disaster_standingeffecttop_05.ani", 0, 1, 0); + obj.sq_PlaySound("DISASTER_SUMMON"); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/babydragon/newskill/disaster/charge/disaster_charge_astrab.ani"); + obj.setCurrentAnimation(ani); + obj.setTimeEvent(1, 150, 10, true); + break; + case 22: + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/babydragon/newskill/disaster/breathstart/disaster_breathe_astrab.ani"); + obj.setCurrentAnimation(ani); + obj.sq_PlaySound("DISASTER_THUNDER_BREATH"); + break; + case 23: + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/babydragon/newskill/disaster/breathloop/disaster_breathe_astrab.ani"); + obj.setCurrentAnimation(ani); + obj.setTimeEvent(1, 150, 10, true); + break; + case 24: + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/babydragon/newskill/disaster/breathend/disaster_breathe_astrab.ani"); + obj.setCurrentAnimation(ani); + obj.sq_PlaySound("STORM_BREATH_DISAPPEAR"); + break; + } + break; + case 12: + case 13: + local aniPath1 = "passiveobject/madeby_k_k/animation/babydragon/newskill/"; + switch(state){ + case 20: + local aniPath2 = "participation/participationhowlingstartdragonback_01.ani"; + if(subtype == 13) aniPath2 = "stormbreath/start/stormbreath_start_astra_back.ani"; + local ani = sq_CreateAnimation("", aniPath1 + aniPath2); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + if(subtype == 12) currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/madeby_k_k/animation/babydragon/newskill/participation/participationhowlingstartdragonfront_01.ani"),true); + else currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/madeby_k_k/animation/babydragon/newskill/stormbreath/start/stormbreath_start_astra_front.ani"),true); + break; + case 21: + local aniPath2 = "participation/participationhowlingloop_astraback.ani"; + if(subtype == 13) aniPath2 = "stormbreath/loop/stormbreath_loop_astra_back.ani"; + local ani = sq_CreateAnimation("", aniPath1 + aniPath2); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + if(subtype == 12) currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/madeby_k_k/animation/babydragon/newskill/participation/participationhowlingloop_astrafront.ani"),true); + else currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/madeby_k_k/animation/babydragon/newskill/stormbreath/loop/stormbreath_loop_astra_front.ani"),true); + obj.setTimeEvent(2, 100, 1, true); + if(subtype == 12) obj.setTimeEvent(3, 2350, 1, false); + else obj.setTimeEvent(3, 2000, 1, false); + break; + case 22: + local aniPath2 = "participation/participationhowlingchange_01.ani"; + if(subtype == 13) aniPath2 = "stormbreath/end/stormbreath_end_small_eff07.ani"; + local ani = sq_CreateAnimation("", aniPath1 + aniPath2); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + break; + } + break; + case 121: + case 131: + local aniPath1 = "passiveobject/madeby_k_k/animation/babydragon/newskill/"; + switch(state){ + case 20: + local aniPath2 = "participation/participationhowling01_01.ani"; + if(subtype == 121){ + local ani = sq_CreateAnimation("", aniPath1 + aniPath2); + obj.setCurrentAnimation(ani); + } + else{ + aniPath2 = "stormbreath/start/stormbreath_start_breatheff02.ani"; + obj.setTimeEvent(4, 120, 1, false); + // local pooledObj = sq_AddDrawOnlyAniFromParent(obj, aniPath1 + aniPath2, -150, 0, 275); + // local pAni = pooledObj.getCurrentAnimation(); + // pAni.setSpeedRate(200.0); + } + break; + case 21: + local aniPath2 = "participation/participationhowling02_01.ani"; + if(subtype == 131) aniPath2 = "stormbreath/loop/stormbreath_loop_breatheff_a01.ani"; + local ani = sq_CreateAnimation("", aniPath1 + aniPath2); + obj.setCurrentAnimation(ani); + obj.setTimeEvent(1, 150, 10, true); + break; + case 22: + local aniPath2 = "participation/participationhowling03_02.ani"; + if(subtype == 131) aniPath2 = "stormbreath/end/stormbreath_end_breatheff03.ani"; + local ani = sq_CreateAnimation("", aniPath1 + aniPath2); + obj.setCurrentAnimation(ani); + local pAni = obj.getCurrentAnimation(); + if(subtype == 121) pAni.setSpeedRate(200.0); + else pAni.setSpeedRate(150.0); + break; + } + break; + } + break; + case 82://casillas + break; + case 118://sandorex + break; + case 119://heilrom + break; + case 120://spiritfireex + break; + case 121://kruta + break; + case 122://ramos + switch(subtype){ + case 41: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/ramos/absorb/gluttonyhand_01.ani"); + obj.setCurrentAnimation(ani); + local delay = obj.getVar("delay").get_vector(0); + local speedRate = 72.0 / delay.tofloat() * 120.0; + local pAni = obj.getCurrentAnimation(); + pAni.setSpeedRate(speedRate.tofloat()); + obj.getVar("move").clear_vector(); + obj.getVar("move").push_vector(obj.getXPos()); + obj.getVar("move").push_vector(150); + break; + case 21: + obj.stopTimeEvent(0); + local totalDamage = obj.getVar("bonusrate").get_vector(0); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 76)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/ramos/absorb/gluttonyhandattack_07.ani"); + obj.setCurrentAnimation(ani); + break; + } + break; + case 42: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/ramos/absorb/gluttonysoulmultiplehit_02.ani"); + obj.setCurrentAnimation(ani); + local delay = obj.getVar("delay").get_vector(0); + local speedRate = 72.0 / delay.tofloat() * 175.0; + local pAni = obj.getCurrentAnimation(); + pAni.setSpeedRate(speedRate.tofloat()); + break; + case 21: + local dstX = sq_GetDistancePos(obj.getXPos(), obj.getDirection(), 50); + sq_setCurrentAxisPos(obj, 0, dstX); + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/ramos/absorb/gluttonysoulsuction_02.ani"); + obj.setCurrentAnimation(ani); + local delay = obj.getVar("delay").get_vector(0); + local speedRate = 72.0 / delay.tofloat() * 120.0; + local pAni = obj.getCurrentAnimation(); + pAni.setSpeedRate(speedRate.tofloat()); + break; + } + break; + case 200: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/ramos/summon/targeting_start.ani"); + obj.setCurrentAnimation(ani); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/ramos/summon/targeting_move.ani"); + obj.setCurrentAnimation(ani); + obj.getVar("move").clear_vector(); + obj.getVar("move").push_vector(obj.getXPos()); + obj.getVar("move").push_vector(200); + break; + case 22: + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/ramos/summon/targeting_end01.ani"); + obj.setCurrentAnimation(ani); + break; + case 23: + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/dummy.ani"); + obj.setCurrentAnimation(ani); + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/madeby_k_k/animation/ramos/summon/startmoon_28.ani", 0, 0, 80 + obj.getYPos()); + obj.setTimeEvent(1, 1000, 1, false); + break; + } + break; + } + break; + case SKILL_BYKK_SUMMONSPIRITCOMMON: + break; + case SKILL_BYKK_MOONSHADOW: + switch(subtype){ + case 1: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","character/mage/effect/animation/moonshadow/moonshadow_start_falling_normal.ani"); + obj.setCurrentAnimation(ani); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/moonshadow/moonshadow_start_ground_normal.ani"); + obj.setCurrentAnimation(ani); + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); + break; + case 22: + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/moonshadow/moonshadow_loop_ground_normal.ani"); + obj.setCurrentAnimation(ani); + break; + case 23: + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/moonshadow/moonshadow_end_ground_normal.ani"); + obj.setCurrentAnimation(ani); + break; + } + local currentAni = obj.getCurrentAnimation();//嚙踝蕭嚙踝蕭?嚙踝蕭ani + local sizeRate = 0.35;//??搣嚙踝蕭??蓱 + if(state == 20) sizeRate = 0.6; + currentAni.setImageRateFromOriginal(sizeRate, sizeRate);//嚙踝蕭吤ani ?嚙踝蕭?嚙踝蕭嚙踝蕭嚙踝蕭 + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);//嚙踝蕭吤ani als旓吤 ani嚙踝蕭嚙踝蕭嚙踝蕭嚙? + return; + break; + case 2: + break; + } + break; + case SKILL_BYKK_BLACKLUNATIC: + switch(subtype){ + case 1://月蚀长矛 + switch(state){ + case 20://start + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/luis/luis_blacklunatic/eclipesspearstart_00.ani"); + obj.setCurrentAnimation(ani); + local pAni = obj.getCurrentAnimation(); + pAni.setSpeedRate(200.0); + break; + case 21://loop + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/luis/luis_blacklunatic/eclipesspearloop_00.ani"); + obj.setCurrentAnimation(ani); + obj.setTimeEvent(0, 200, 1, false); + break; + case 22://attack + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/luis/luis_blacklunatic/eclipesspearattack_00.ani"); + obj.setCurrentAnimation(ani); + obj.setTimeEvent(1, 5, 30, false); + break; + case 23://hit + local ani = sq_CreateAnimation("","passiveobject/madeby_k_k/animation/luis/luis_blacklunatic/eclipesspearhit_00.ani"); + obj.setCurrentAnimation(ani); + obj.sq_PlaySound("BLACK_LUNATIC_SPEAR_MULTIPLE"); + break; + } + break; + } + break; + } + local element_kk_fire = sqrChr.getVar("element_kk").getInt(0); + local element_kk_water = sqrChr.getVar("element_kk").getInt(1); + local element_kk_dark = sqrChr.getVar("element_kk").getInt(2); + local element_kk_light = sqrChr.getVar("element_kk").getInt(3); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo) return; + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE) && element_kk_fire > 0) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER) && element_kk_water > 0) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK) && element_kk_dark > 0) attackInfo.setElement(ENUM_ELEMENT_DARK); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT) && element_kk_light > 0) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(sqrChr.getVar("eclipsehive_select").getBool(0) == false){ + local hitdelayRate = 100.0; + if(skillIndex > 75 && skillIndex < 80 && sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 26) > 0) hitdelayRate = 120.0; + sq_SetAttackInfoHitDelayRateDamager(attackInfo, hitdelayRate); + } +} + +function onEndCurrentAni_po_summoners(obj) +{ + if(!obj) return; + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").get_vector(0); + local subtype = obj.getVar("subtype").get_vector(0); + local state = obj.getVar("state").get_vector(0); + + switch(skillIndex){ + case 25://hodor + switch(subtype){ + case 1://嚙踝蕭嚙踝蕭怐 + sq_SendDestroyPacketPassiveObject(obj); + break; + case 3://嚙踝蕭怐 + sq_SendDestroyPacketPassiveObject(obj); + break; + case 4://嚙踝蕭嚙踝蕭嚙踝蕭嚙? + break; + case 5://3盓嚙踝蕭 + break; + case 6://嚙踝蕭艉嚙踝蕭 + break; + case 7://嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + switch(state){ + case 21: + obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 22: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 8://旓?1?茷 + sq_SendDestroyPacketPassiveObject(obj); + break; + case 9://旓?2?茷 + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 44://sandor + sq_SendDestroyPacketPassiveObject(obj); + break; + case 45://auxo + switch(subtype){ + case 1: + case 2: + case 3: + case 4: + case 11: + case 12: + case 14: + case 100: + sq_SendDestroyPacketPassiveObject(obj); + break; + case 5: + switch(state){ + case 20: + obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 21: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 13: + switch(state){ + case 21: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + } + break; + case 46://luis + switch(subtype){ + case 1: + case 2: + case 3: + case 4: + sq_SendDestroyPacketPassiveObject(obj); + break; + case 5: + switch(state){ + case 20: + case 22: + sq_SendDestroyPacketPassiveObject(obj); + break; + case 21: + obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case 6: + switch(state){ + case 21: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + } + break; + case 47://echeverra + switch(subtype){ + case 1: + case 2: + case 4: + case 5: + case 51: + sq_SendDestroyPacketPassiveObject(obj); + break; + case 41: + switch(state){ + case 20: + obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 21: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 8: + switch(state){ + case 20: + obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case 9: + switch(state){ + case 22: + obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 23: + local activeObj = sq_GetCNRDObjectToActiveObject(obj.getVar().get_obj_vector(0)); + //monsterattack_ksk(activeObj,6); + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(activeObj, sqrChr, -1, false, "character/mage/k_k_made/appendage/aptomonster/skill_ap/ap_spikeking_grant.nut", true); + local monster_id = activeObj.getCollisionObjectIndex(); + AddAppendage.getVar().clear_vector(); + AddAppendage.getVar().push_vector(monster_id); + AddAppendage.sq_SetValidTime(30000); + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + } + break; + case 76://spiritdarkhigher + switch(subtype){ + case 1: + case 2: + case 63: + sq_SendDestroyPacketPassiveObject(obj); + break; + case 3: + case 41: + case 61: + case 62: + switch(state){ + case 20: + obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 22: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + } + break; + case 77://spiritlighthigher + switch(subtype){ + case 1: + switch(state){ + case 20: + case 21: + case 22: + case 23: + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 24: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 2: + case 10: + sq_SendDestroyPacketPassiveObject(obj); + break; + case 21: + case 41: + case 42: + switch(state){ + case 20: + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 21: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + } + break; + case 78://spiritwaterhigher + switch(subtype){ + case 1: + case 2: + case 4: + case 41: + case 9: + sq_SendDestroyPacketPassiveObject(obj); + break; + case 3: + case 11: + switch(state){ + case 20: + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 22: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 10: + switch(state){ + case 20: + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 22: + local parentObj = obj.getParent(); + CNSquirrelAppendage.sq_RemoveAppendage(parentObj, "character/mage/k_k_made/appendage/aptomonster/skill_ap/ap_waterhigherspirit_skill.nut"); + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + } + break; + case 79://spiritfirehigher + switch(subtype){ + case 1: + case 2: + case 21: + case 31: + case 32: + case 33: + case 4: + case 6: + sq_SendDestroyPacketPassiveObject(obj); + break; + case 61: + switch(state){ + case 20: + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 22: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + } + break; + case 80://babydragon + switch(subtype){ + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + sq_SendDestroyPacketPassiveObject(obj); + break; + case 11: + switch(state){ + case 20: + case 21: + case 22: + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 24: + local targetObj = obj.getVar("target").get_obj_vector(0); + if(targetObj){ + local activeObj = sq_GetCNRDObjectToActiveObject(targetObj); + sq_SendCreatePassiveObjectPacketPos(activeObj, 1008605, 0, 0, 0, 233); + activeObj.sendStateOnlyPacket(STATE_STAND); + sq_AddDrawOnlyAniFromParent(obj, "passiveobject/madeby_k_k/animation/babydragon/newskill/stormbreath/astractransform_endeff05.ani", 0, 0, 0); + } + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 12: + case 13: + switch(state){ + case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; + case 22: + local targetObj = obj.getVar("target").get_obj_vector(0); + if(targetObj){ + local activeObj = sq_GetCNRDObjectToActiveObject(targetObj); + sq_SendCreatePassiveObjectPacketPos(activeObj, 1008605, 0, 0, 0, 233); + activeObj.sendStateOnlyPacket(STATE_STAND); + sq_AddDrawOnlyAniFromParent(obj, "passiveobject/madeby_k_k/animation/babydragon/newskill/stormbreath/astractransform_endeff05.ani", 0, 0, -295); + } + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 121: + case 131: + switch(state){ + case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; + case 22: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + } + break; + case 82://casillas + sq_SendDestroyPacketPassiveObject(obj); + break; + case 118://sandorex + break; + case 119://heilrom + break; + case 120://spiritfireex + break; + case 121://kruta + sq_SendDestroyPacketPassiveObject(obj); + break; + case 122://ramos + switch(subtype){ + case 1: + case 21: + case 22: + case 31: + case 32: + case 33: + case 5: + case 6: + case 71: + case 72: + case 73: + case 74: + case 75: + sq_SendDestroyPacketPassiveObject(obj); + break; + case 41: + case 42: + switch(state){ + case 20: + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 21: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 200: + switch(state){ + case 20: + case 22: + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + } + break; + case SKILL_BYKK_SUMMONSPIRITCOMMON: + switch(subtype){ + case 101: + case 102: + case 201: + case 301: + case 302: + case 401: + case 402: + case 1001: + case 1002: + case 2001: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case SKILL_BYKK_MOONSHADOW: + switch(subtype){ + case 1: + switch(state){ + case 20: + case 21: + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 23: + local loadSlot = sqrChr.sq_GetSkillLoad(SKILL_BYKK_MOONSHADOW); + if(loadSlot) sqrChr.sq_RemoveSkillLoad(SKILL_BYKK_MOONSHADOW); + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 2: + sq_SendDestroyPacketPassiveObject(obj); + break; + case 3: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case SKILL_BYKK_BLACKLUNATIC: + switch(subtype){ + case 1: + switch(state){ + case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; + case 23: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + case 2: sq_SendDestroyPacketPassiveObject(obj); break; + case 3: sq_SendDestroyPacketPassiveObject(obj); break; + case 4: sq_SendDestroyPacketPassiveObject(obj); break; + case 5: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + case 150: + switch(subtype){ + case 1: + case 2: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case SKILL_BYKK_HIGHESTECHEVERRA: + if(subtype == 3){ + obj.sq_PlaySound("HIGHEST_ECHEVERRA_DISAPPEAR"); + sq_AddDrawOnlyAniFromParent(obj, "character/mage/animation/summoner_bykk/effect/highestecheverra/highestecheverra_echeverraend.ani", 0, 0, 0); + // sq_AddDrawOnlyAniFromParent(obj, "character/mage/animation/summoner_bykk/effect/highestecheverra/highestecheverrae_08.ani", 0, 0, 0); + obj.setTimeEvent(2, 500, 1, false); + break; + } + sq_SendDestroyPacketPassiveObject(obj); + break; + } +} + +function onKeyFrameFlag_po_summoners(obj, flagIndex) +{ + if (!obj) return false; + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").get_vector(0); + local subtype = obj.getVar("subtype").get_vector(0); + local state = obj.getVar("state").get_vector(0); + + switch(skillIndex){ + case 25://hodor + break; + case 44://sandor + break; + case 45://auxo + switch(subtype){ + case 5: + switch(flagIndex){ + case 1001: + local monster_level = sq_GetSkillLevel(sqrChr, 174); + local monster_time = 3600000; + // local destX_01 = obj.getXPos() - sqrChr.getXPos(); + // local destY_01 = obj.getYPos() - sqrChr.getYPos(); + // if(obj.getDirection() == ENUM_DIRECTION_LEFT) destX_01 = sqrChr.getXPos() - obj.getXPos(); + //summonmonster_mage(sqrChr,destX_01,destY_01,0,0,MONSTER_ID_AUXOOLD,monster_time,monster_level,0); + summonmonster_mage_plus_Kwk(sqrChr,obj,0,0,0,0,MONSTER_ID_AUXOOLD,monster_time,monster_level,0); + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 15: + switch(flagIndex){ + case 1001: + local monster_level = sq_GetSkillLevel(sqrChr, 174); + local monster_time = 3600000; + summonmonster_mage_plus_Kwk(sqrChr,obj,0,0,0,0,MONSTER_ID_AUXO,monster_time,monster_level,0); + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + } + break; + case 46://luis + break; + case 47://echeverra + switch(subtype){ + case 51: + local anipath = ["passiveobject/madeby_k_k/animation/spikeking/newlaser/uhdlaserbomblaiserblue_00.ani","passiveobject/madeby_k_k/animation/spikeking/newlaser/uhdlaserbomblaiserpurple_00.ani","passiveobject/madeby_k_k/animation/spikeking/newlaser/uhdlaserbomblaiserred_00.ani","passiveobject/madeby_k_k/animation/spikeking/newlaser/uhdlaserbomblaiseryellow_00.ani"]; + switch(flagIndex){ + case 101: + local pooledObj_01 = sq_AddDrawOnlyAniFromParent(obj, anipath[sq_getRandom(0,3)], 0, 10, 0); + local pooledObj_02 = sq_AddDrawOnlyAniFromParent(obj, anipath[sq_getRandom(0,3)], -140, -40, 0); + break; + case 102: + sq_SetMyShake(obj,2,800); + break; + case 103: + local pooledObj_01 = sq_AddDrawOnlyAniFromParent(obj, anipath[sq_getRandom(0,3)], -112, -70, 0); + local pooledObj_02 = sq_AddDrawOnlyAniFromParent(obj, anipath[sq_getRandom(0,3)], 28, 40, 0); + break; + case 104: + //obj.resetHitObjectList(); + break; + case 105: + local pooledObj_01 = sq_AddDrawOnlyAniFromParent(obj, anipath[sq_getRandom(0,3)], 112, 0, 0); + local pooledObj_02 = sq_AddDrawOnlyAniFromParent(obj, anipath[sq_getRandom(0,3)], 168, -60, 0); + break; + case 107: + local pooledObj_01 = sq_AddDrawOnlyAniFromParent(obj, anipath[sq_getRandom(0,3)], -28, -20, 0); + local pooledObj_02 = sq_AddDrawOnlyAniFromParent(obj, anipath[sq_getRandom(0,3)], 56, -30, 0); + break; + case 109: + local pooledObj_01 = sq_AddDrawOnlyAniFromParent(obj, anipath[sq_getRandom(0,3)], -168, 20, 0); + local pooledObj_02 = sq_AddDrawOnlyAniFromParent(obj, anipath[sq_getRandom(0,3)], 84, 70, 0); + break; + case 111: + local pooledObj_01 = sq_AddDrawOnlyAniFromParent(obj, anipath[sq_getRandom(0,3)], -56, -50, 0); + local pooledObj_02 = sq_AddDrawOnlyAniFromParent(obj, anipath[sq_getRandom(0,3)], 196, -10, 0); + break; + case 113: + local pooledObj_01 = sq_AddDrawOnlyAniFromParent(obj, anipath[sq_getRandom(0,3)], 140, 60, 0); + local pooledObj_02 = sq_AddDrawOnlyAniFromParent(obj, anipath[sq_getRandom(0,3)], -196, 30, 0); + break; + case 115: + local pooledObj_01 = sq_AddDrawOnlyAniFromParent(obj, anipath[sq_getRandom(0,3)], -84, 50, 0); + break; + } + break; + } + break; + case 76://spiritdarkhigher + switch(flagIndex){ + case 4002: + obj.resetHitObjectList(); + break; + } + break; + case 77://spiritlighthigher + switch(flagIndex){ + case 5002: + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/madeby_k_k/animation/spirit/lighthigherspirit/lightsoul/thunderstrike_floor.ani",0,0,0); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/madeby_k_k/animation/spirit/lighthigherspirit/lightsoul/thunderstrike_hit01.ani",0,0,0); + break; + case 101: + obj.resetHitObjectList(); + obj.sq_PlaySound("R_REDWITCH_LIGHTNING"); + break; + } + break; + case 78://spiritwaterhigher + break; + case 79://spiritfirehigher + break; + case 80://babydragon + switch(flagIndex){ + case 1001: obj.sq_PlaySound("STORM_BREATH_SUMMON"); break; + case 1002: obj.sq_PlaySound("YOUNGSKASA_WING");obj.sq_PlaySound("YOUNGSKASA_WIND_LOOP"); break; + case 1003: obj.sq_PlaySound("STORM_BREATH_DISAPPEAR"); break; + case 1101: obj.sq_PlaySound("PARTICIPATION_CHANGE"); break; + case 1102: obj.sq_PlaySound("PARTICIPATION_SCREAM"); break; + case 1103: obj.sq_PlaySound("PARTICIPATION_SMASH"); break; + } + break; + case 82://casillas + switch(flagIndex){ + case 1: + obj.resetHitObjectList(); + break; + case 2: + local xpos = obj.getVar().get_vector(0); + for(local i = 0; i < 4; i++){ + local zpos = 20; + if(i == 0) zpos = 60; + local pooledObj_01 = sq_AddDrawOnlyAniFromParent(obj,"monster/character/mage/madeby_k_k/casillas/animation/moveslash/slash"+(i+1).tostring()+".ani", -400 + xpos * 50, 0, zpos); + sq_SetCustomRotate(pooledObj_01, sq_ToRadian(sq_getRandom(10,45).tofloat())); + } + obj.getVar().set_vector(0,xpos + 1); + // local pooledObj_03 = sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/casillas/animation/moveslash/slash3.ani", -270, 0, 20); + // sq_SetCustomRotate(pooledObj_03, sq_ToRadian(25.0)); + // local currentAni_03 = pooledObj_03.getCurrentAnimation(); + // currentAni_03.setImageRateFromOriginal(1.3, 1.3); + // local pooledObj_02 = sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/casillas/animation/moveslash/slash2.ani", -280, 0, 20); + // local pooledObj_04 = sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/madeby_k_k/casillas/animation/moveslash/slash4.ani", -250, 0, 20); + // sq_SetCustomRotate(pooledObj_04, sq_ToRadian(25.0)); + // local currentAni_04 = pooledObj_04.getCurrentAnimation(); + // currentAni_04.setImageRateFromOriginal(1.5, 1.5); + break; + } + break; + case 118://sandorex + break; + case 119://heilrom + break; + case 120://spiritfireex + break; + case 121://kruta + break; + case 122://ramos + break; + case SKILL_BYKK_SUMMONSPIRITCOMMON: + break; + case SKILL_BYKK_MOONSHADOW: + break; + case SKILL_BYKK_BLACKLUNATIC: + switch(flagIndex){ + case 101: sq_SetMyShake(obj, 6, 350); break; + case 102: sq_SetMyShake(obj, 3, 300); break; + } + break; + } + return true; +} + +function onTimeEvent_po_summoners(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return; + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").get_vector(0); + local subtype = obj.getVar("subtype").get_vector(0); + local state = obj.getVar("state").get_vector(0); + + switch(skillIndex){ + case 25://hodor + break; + case 44://sandor + switch(timeEventIndex){ + case 0: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 45://auxo + break; + case 46://luis + switch(subtype){ + case 3: + switch(timeEventIndex){ + case 0: + //?嚙踝蕭ptl + obj.sq_SetMoveParticle("particle/luis/fireball.ptl", 0.0, 0.0); + local etcSub = obj.getVar("custom").getInt(10); + if(etcSub > 0){ + sq_SetSpeedToMoveParticle(obj, 0, 1000); + } + break; + } + break; + case 5: + switch(timeEventIndex){ + case 0: + local eclipsehive_bonus = sqrChr.getVar("eclipsehive_bonus").getInt(11).tofloat() / 100.0; + // if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 23) > 0) eclipsehive_bonus = eclipsehive_bonus + 0.5; + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 46, 46, 20, eclipsehive_bonus) + 100; + local totalDamage2 = sq_GetBonusRateWithPassive(sqrChr, 46, 46, 21, eclipsehive_bonus) + 100; + local etcSub = obj.getVar("custom").getInt(10); + local bonusRate = obj.getVar("custom").getInt(11); + if(bonusRate > 1){ + totalDamage = totalDamage * bonusRate; + totalDamage2 = totalDamage2 * bonusRate; + } + createPassiveObject_k_k(sqrChr,obj,46,6,-300,0,600,totalDamage,totalDamage2,etcSub,0,0); + break; + case 2: + obj.setTimeEvent(3,100,10,false); + break; + case 3: + local eclipsehive_bonus = sqrChr.getVar("eclipsehive_bonus").getInt(11).tofloat() / 100.0; + // if(sq_GetIntData(sqrChr, SKILL_BYKK_ECLIPSEHIVE, 23) > 0) eclipsehive_bonus = eclipsehive_bonus + 0.5; + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 46, 46, 20, 0.17*eclipsehive_bonus) + 100; + local totalDamage2 = sq_GetBonusRateWithPassive(sqrChr, 46, 46, 21, 0.17*eclipsehive_bonus) + 100; + local etcSub = obj.getVar("custom").getInt(10); + local bonusRate = obj.getVar("custom").getInt(11); + if(bonusRate > 1){ + totalDamage = totalDamage * bonusRate; + totalDamage2 = totalDamage2 * bonusRate; + } + createPassiveObject_k_k(sqrChr,obj,46,6,-300+sq_getRandom(-50,50),sq_getRandom(-40,40),600,totalDamage,totalDamage2,etcSub,0,0); + if(timeEventCount >= 10) sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 10: + switch(timeEventIndex){ + case 0: + local sub = obj.getVar("custom").getInt(10); + local pooledObj = sq_AddDrawOnlyAniFromParent(obj, "character/mage/effect/animation/blacklunatic/blacklunaticwing"+sub.tostring()+"crack_00.ani", 0, 0, 0); + local targetObj = obj.getVar("tar").get_obj_vector(0); + sq_moveWithParent(targetObj, pooledObj); + //print("sub = "+sub); + // if(sub == 3){ + // if(targetObj){ + // CNSquirrelAppendage.sq_RemoveAppendage(targetObj, BLACKLUNATIC_APDPATH); + // print("remove"); + // } + // } + sq_SendDestroyPacketPassiveObject(obj); + break; + case 1: + local targetObj = obj.getVar("tar").get_obj_vector(0); + if(targetObj){ + sq_setCurrentAxisPos(obj, 0, sq_GetXPos(targetObj)); + sq_setCurrentAxisPos(obj, 1, sq_GetYPos(targetObj) - 1); + sq_setCurrentAxisPos(obj, 2, sq_GetZPos(targetObj)); + sq_SetCurrentDirection(obj, targetObj.getDirection()); + if(!CNSquirrelAppendage.sq_IsAppendAppendage(targetObj, BLACKLUNATIC_APDPATH)) sq_SendDestroyPacketPassiveObject(obj); + } + else sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + } + break; + case 47://echeverra + switch(subtype){ + case 2: + case 5: + switch(timeEventIndex){ + case 0: + obj.resetHitObjectList(); + break; + case 1: + //?嚙踝蕭ptl + obj.sq_SetMoveParticle("particle/spikeking/grandwave.ptl", 0.0, 0.0); + break; + case 2: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 4: + switch(timeEventIndex){ + case 0: + createPassiveObject_k_k(sqrChr,obj,47,41,75 * (timeEventCount - 1),0,0,0,0,0,0,0); + break; + case 1: + obj.sq_PlaySound("SSTAR_DMG"); + break; + } + break; + case 51: + switch(timeEventIndex){ + case 0: + obj.resetHitObjectList(); + break; + } + break; + } + break; + case 76://spiritdarkhigher + switch(subtype){ + case 3: + case 41: + case 61: + case 62: + case 63: + switch(timeEventIndex){ + case 0: + obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 2: + sq_SetMyShake(obj,1,100); + obj.resetHitObjectList(); + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/madeby_k_k/animation/spirit/darkhigherspirit/darkskill/test/animation/cylindercrack_0"+(timeEventCount - 1).tostring()+".ani",0,0,0); + local pAni = pooledObj.getCurrentAnimation(); + local time = obj.getVar("time").get_vector(0) / 4; + local speedRate = 150000.0 / time.tofloat(); + pAni.setSpeedRate(speedRate); + obj.stopSound(101); + obj.sq_PlaySound("DESCHAMPS_METAL_CHAIN",101); + break; + case 4: + obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case 4: + switch(timeEventIndex){ + case 0: + sq_SendDestroyPacketPassiveObject(obj); + break; + case 1: + obj.resetHitObjectList(); + break; + } + break; + } + break; + case 77://spiritlighthigher + switch(subtype){ + case 2: + switch(timeEventIndex){ + case 0: + local eclipsehive_bonus = sqrChr.getVar("eclipsehive_bonus").getInt(10).tofloat() / 100.0; + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITLIGHTHIGHER, SKILL_BYKK_SUMMONSPIRITLIGHTHIGHER, 7, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,obj,SKILL_BYKK_SUMMONSPIRITLIGHTHIGHER,21,timeEventCount * 70,0,0,totalDamage,0,0,0,0); + break; + } + break; + case 9: + switch(timeEventIndex){ + case 0: + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITLIGHTHIGHER, SKILL_BYKK_SUMMONSPIRITLIGHTHIGHER, 28, 1.0) + 100; + createPassiveObject_k_k(sqrChr,obj,SKILL_BYKK_SUMMONSPIRITLIGHTHIGHER,10,sq_getRandom(-50,200), sq_getRandom(-35,35),0,totalDamage,0,0,0,0); + break; + } + break; + case 10: + switch(timeEventIndex){ + case 0: + //obj.resetHitObjectList(); + //"WORDSWORTH_LIGHTNING_0"+sq_getRandom(1,4).tostring()); + break; + } + break; + } + break; + case 78://spiritwaterhigher + switch(subtype){ + case 1: + case 11: + switch(timeEventIndex){ + case 0: + local eclipsehive_bonus = sqrChr.getVar("eclipsehive_bonus").getInt(10).tofloat() / 100.0; + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITWATERHIGHER, SKILL_BYKK_SUMMONSPIRITWATERHIGHER, 6, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,obj,SKILL_BYKK_SUMMONSPIRITWATERHIGHER,11,0,0,timeEventCount * 115 + 80,totalDamage,timeEventCount,0,0,0); + break; + case 1: + obj.sq_SetMoveParticle("particle/spirit/water_spirit_higher_ice_move.ptl", 0.0, 0.0); + break; + } + break; + case 4: + switch(timeEventIndex){ + case 0: + local eclipsehive_bonus = sqrChr.getVar("eclipsehive_bonus").getInt(11).tofloat() / 100.0; + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITWATERHIGHER, SKILL_BYKK_SUMMONSPIRITWATERHIGHER, 19, eclipsehive_bonus) + 100; + createPassiveObject_k_k(sqrChr,obj,SKILL_BYKK_SUMMONSPIRITWATERHIGHER,41,sq_getRandom(-50,100),sq_getRandom(-15,30),0,totalDamage,timeEventCount - 1,0,0,0); + break; + } + break; + case 9: + switch(timeEventIndex){ + case 0: + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITWATERHIGHER, SKILL_BYKK_SUMMONSPIRITWATERHIGHER, 22, 1.0) + 100; + local time = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITWATERHIGHER, SKILL_BYKK_SUMMONSPIRITWATERHIGHER, 23, 1.0) + 100; + createPassiveObject_k_k(sqrChr,obj,SKILL_BYKK_SUMMONSPIRITWATERHIGHER,10,0,0,0,totalDamage,time,timeEventCount,0,0); + break; + } + break; + case 10: + switch(timeEventIndex){ + case 0: + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 1: + obj.resetHitObjectList(); + break; + case 2: + break; + } + break; + } + break; + case 79://spiritfirehigher + switch(subtype){ + case 4: + switch(timeEventIndex){ + case 0: + obj.resetHitObjectList(); + break; + } + break; + case 61: + switch(timeEventIndex){ + case 0: + obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 1: + obj.resetHitObjectList(); + break; + case 2: + obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 3: + obj.sq_PlaySound("SASCHA_TORNADO_LOOP"); + break; + } + break; + } + break; + case 80://babydragon + switch(timeEventIndex){ + case 1: + obj.resetHitObjectList(); + if(timeEventCount >= 10) obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 2: + local totalDamage = obj.getVar("custom").getInt(10); + if(subtype == 12) createPassiveObject_k_k(sqrChr, obj, 80, 121, 85, 0, 290, totalDamage, 0, 0, 0, 0); + else createPassiveObject_k_k(sqrChr, obj, 80, 131, 265, 0, 0, totalDamage, 0, 0, 0, 0); + break; + case 3: obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); break; + case 4: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; + case 10: + local hittime = obj.getVar("custom").getInt(10); + obj.setTimeEvent(11, hittime, -1, false); + break; + case 11: obj.resetHitObjectList(); break; + } + break; + case 82://casillas + break; + case 118://sandorex + break; + case 119://heilrom + break; + case 120://spiritfireex + break; + case 121://kruta + switch(subtype){ + case 2: + switch(timeEventIndex){ + case 0: + obj.resetHitObjectList(); + break; + } + break; + case 10: + switch(timeEventIndex){ + case 0: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + } + break; + case 122://ramos + switch(subtype){ + case 41: + case 5: + case 71: + case 72: + switch(timeEventIndex){ + case 0: + obj.resetHitObjectList(); + break; + } + break; + case 200: + switch(timeEventIndex){ + case 1: + local monster_level = sq_GetSkillLevel(sqrChr, 174); + summonmonster_mage_plus_Kwk(sqrChr,obj,0,0,0,0,MONSTER_ID_RAMOS,3600000,monster_level,0); + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + } + break; + case SKILL_BYKK_SUMMONSPIRITCOMMON: + switch(subtype){ + case 202: + switch(timeEventIndex){ + case 0: + sq_SendDestroyPacketPassiveObject(obj); + break; + case 1: + obj.resetHitObjectList(); + break; + } + break; + case 102: + case 302: + switch(timeEventIndex){ + case 0: + obj.resetHitObjectList(); + break; + } + break; + case 1001: + local sizeRate = obj.getVar("sizeRate").get_vector(0).tofloat() / 100; + sizeRate = sizeRate.tofloat(); + local sub = obj.getVar("sizeRate").get_vector(1); + switch(timeEventIndex){ + case 1: + local anipath; + switch(sub){ + case 1: + anipath = "passiveobject/common/animation/darkexplosionparticle1.ani"; + break; + case 2: + anipath = "passiveobject/common/animation/fireexplosionparticle1.ani"; + break; + case 3: + anipath = "passiveobject/common/animation/lightexplosionparticle1.ani"; + break; + case 4: + anipath = "passiveobject/character/mage/animation/icefireexplosionparticle1.ani"; + break; + } + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,anipath, sq_getRandom(-10,10), sq_getRandom(-10,10), sq_getRandom(-10,10)); + local currentAni = pooledObj.getCurrentAnimation(); + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + break; + case 2: + local anipath; + switch(sub){ + case 1: + anipath = "passiveobject/common/animation/darkexplosionparticle2.ani"; + break; + case 2: + anipath = "passiveobject/common/animation/fireexplosionparticle2.ani"; + break; + case 3: + anipath = "passiveobject/common/animation/lightexplosionparticle2.ani"; + break; + case 4: + anipath = "passiveobject/character/mage/animation/icefireexplosionparticle2.ani"; + break; + } + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,anipath, 0, 2, 0); + local currentAni = pooledObj.getCurrentAnimation(); + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + break; + case 3: + local anipath; + switch(sub){ + case 1: + anipath = "passiveobject/common/animation/darkexplosionparticle3.ani"; + break; + case 2: + anipath = "passiveobject/common/animation/fireexplosionparticle3.ani"; + break; + case 3: + anipath = "passiveobject/common/animation/lightexplosionparticle3.ani"; + break; + case 4: + anipath = "passiveobject/character/mage/animation/icefireexplosionparticle3.ani"; + break; + } + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,anipath, 0, 1, 1); + local currentAni = pooledObj.getCurrentAnimation(); + local angle = sq_ToRadian(360.0 * timeEventCount / 8); + sq_SetfRotateAngle(currentAni, angle); + currentAni.setImageRateFromOriginal(sizeRate * 2.0, sizeRate * 2.0); + break; + case 4: + local anipath; + switch(sub){ + case 1: + anipath = "passiveobject/common/animation/darkexplosionparticle4.ani"; + break; + case 2: + anipath = "passiveobject/common/animation/fireexplosionparticle4.ani"; + break; + case 3: + anipath = "passiveobject/common/animation/lightexplosionparticle4.ani"; + break; + case 4: + anipath = "passiveobject/character/mage/animation/icefireexplosionparticle4.ani"; + break; + } + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,anipath, sq_getRandom(-30,30), sq_getRandom(-30,30), sq_getRandom(-30,30)); + local currentAni = pooledObj.getCurrentAnimation(); + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + break; + } + break; + } + break; + case SKILL_BYKK_MOONSHADOW: + switch(timeEventIndex){ + case 0: + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 1: + local targetObj = obj.getVar("tar").get_obj_vector(0); + if(targetObj) sq_SendHitObjectPacket(obj,targetObj,0,0,sq_GetObjectHeight(targetObj) / 2); + else sq_SendDestroyPacketPassiveObject(obj); + if(timeEventCount >= 10) sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case SKILL_BYKK_BLACKLUNATIC: + switch(subtype){ + case 1: + switch(timeEventIndex){ + case 0: obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); break; + case 1: + local srcX = obj.getVar("custom").getInt(10); + local vx = sq_GetUniformVelocity(0, obj.getVar("custom").getInt(12), timeEventCount, 30); + local vz = sq_GetUniformVelocity(obj.getVar("custom").getInt(11), 30, timeEventCount, 30); + local dstX = sq_GetDistancePos(srcX, obj.getDirection(), vx); + sq_setCurrentAxisPos(obj, 0, dstX); + sq_setCurrentAxisPos(obj, 2, vz); + if(timeEventCount >= 30) obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + } + break; + case SKILL_BYKK_HIGHESTECHEVERRA: + switch(timeEventIndex){ + case 1: obj.resetHitObjectList(); break; + case 2: + local EcheverraObj = sqrChr.getVar("EcheverraObj").get_obj_vector(0); + if(EcheverraObj && EcheverraObj.getState() != STATE_DIE){ + local monsterObj = sq_GetCNRDObjectToActiveObject(EcheverraObj); + sq_IntVectorClear(sq_GetGlobalIntVector()); + sq_AddSetStatePacketActiveObject(monsterObj, 0, sq_GetGlobalIntVector(), STATE_PRIORITY_USER); + } + break; + } + break; + } +} + +function procAppend_po_summoners(obj) +{ + if(!obj) return; + + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + if(obj.getZPos() >= 1000 && obj.getVar().getBool(0) == false){ + local parentObj = obj.getParent(); + if(!parentObj) sq_SendDestroyPacketPassiveObject(obj); + local id = parentObj.getCollisionObjectIndex(); + obj.getVar().setBool(0, true); + // print("id:" + id); + if(sq_IsMyControlObject(sqrChr)) { + sq_BinaryStartWrite(); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(id); + sq_BinaryWriteDword(sq_GetGroup(parentObj)); + sq_BinaryWriteDword(sq_GetUniqueId(parentObj)); + sq_SendChangeSkillEffectPacket(sqrChr, SKILL_BYKK_COMMUNION); + sq_SendDestroyPacketPassiveObject(obj); + } + sq_SendDestroyPacketPassiveObject(obj); + } + + local skillIndex = obj.getVar("skillIndex").get_vector(0); + local subtype = obj.getVar("subtype").get_vector(0); + local state = obj.getVar("state").get_vector(0); + + switch(skillIndex){ + case 25://hodor + switch(subtype){ + case 7://嚙踝蕭嚙踝蕭嚙踝蕭嚙踝蕭 + switch(state){ + case 20: + local pAni = obj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + local fireT = 800; + local srcX = obj.getVar("move").get_vector(0); + local srcY = obj.getVar("move").get_vector(1); + local MoveX = obj.getVar("move").get_vector(2); + local MoveY = obj.getVar("move").get_vector(3); + local vx = sq_GetUniformVelocity(0, MoveX, currentT, fireT); + local vy = sq_GetUniformVelocity(0, MoveY, currentT, fireT); + sq_setCurrentAxisPos(obj, 0, srcX + vx);//?嚙踝蕭?嚙踝蕭x嚙? + sq_setCurrentAxisPos(obj, 1, srcY + vy);//?嚙踝蕭?嚙踝蕭y嚙? + + if(obj.getZPos() <= 0){ + obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + } + break; + } + break; + } + break; + case 44://sandor + break; + case 45://auxo + switch(subtype){ + case 5: + case 15: + switch(state){ + case 20: + if(obj.getZPos() <= 0){ + if(subtype == 5) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + if(subtype == 15) obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + } + break; + } + break; + case 13: + switch(state){ + case 20: + if(obj.getZPos() <= 0){ + obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + } + break; + case 22: + local targetObj = sq_GetCNRDObjectToActiveObject(obj.getVar("targetObj").get_obj_vector(0)); + if(targetObj){ + if(sq_GetDistanceObject(obj, targetObj, false) <= 5){ + local eclipsehive_bonus = sqrChr.getVar("eclipsehive_bonus").getInt(10).tofloat() / 100.0; + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, 45, 45, 28, eclipsehive_bonus) + 100; + targetObj.getVar("auxohit").clear_vector(); + targetObj.getVar("auxohit").push_vector(1); + targetObj.getVar("auxohittime").clear_vector(); + targetObj.getVar("auxohittime").push_vector(100); + targetObj.getVar("auxohitbonus").clear_vector(); + targetObj.getVar("auxohitbonus").push_vector(totalDamage * 6); + + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(targetObj, sqrChr, 199, true, "character/mage/k_k_made/appendage/aptomonster/ap_auxoex_skillthree.nut", true); + sq_SendDestroyPacketPassiveObject(obj); + return; + } + local pAni = obj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + local fireT = pAni.getDelaySum(false); + local X1 = sq_GetUniformVelocity(obj.getXPos(), targetObj.getXPos(), currentT, fireT); + local Y1 = sq_GetUniformVelocity(obj.getYPos(), targetObj.getYPos(), currentT, fireT); + sq_setCurrentAxisPos(obj, 0, X1); + sq_setCurrentAxisPos(obj, 1, Y1); + } + else{ + sq_SendDestroyPacketPassiveObject(obj); + } + break; + } + break; + case 14: + switch(state){ + case 20: + local pAni = obj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + local fireT = pAni.getDelaySum(false); + local angle = sq_GetAccel(5, -90, currentT, fireT, true); + sq_SetCustomRotate(obj, sq_ToRadian(angle.tofloat())); + if(obj.getZPos() <= 0){ + obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + } + break; + } + break; + } + break; + case 46://luis + switch(subtype){ + case 2: + local pAni = obj.getCurrentAnimation();//嚙踝蕭嚙踝蕭ani + local currentT = sq_GetCurrentTime(pAni);//?嚙踝蕭?? + local etcSub = obj.getVar("custom").getInt(10); + local time = 3000; + if(etcSub > 0) time = 1500; + if(currentT >= time) sq_SendDestroyPacketPassiveObject(obj); + break; + case 6: + switch(state){ + case 20: + if(obj.getZPos() <= 0){ + //obj.resetHitObjectList(); + obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + } + break; + } + break; + case 10: + break; + } + break; + case 47://echeverra + switch(subtype){ + case 8: + switch(state){ + case 21: + local targetObj = sq_GetCNRDObjectToActiveObject(obj.getVar().get_obj_vector(0)); + if(targetObj){ + if(sq_GetDistanceObject(obj, targetObj, false) <= 5){ + if(obj.getVar().getBool(0) == false){ + sq_AddDrawOnlyAniFromParent(targetObj,"passiveobject/test/kcontents3/curseofbloodyfruit/buff/animation/absorb_element_01.ani",0,0,30); + obj.getVar().setBool(0,true); + } + sq_SendDestroyPacketPassiveObject(obj); + return; + } + local pAni = obj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + local fireT = 800;// pAni.getDelaySum(false); + local X1 = sq_GetAccel(obj.getXPos(), targetObj.getXPos(), currentT, fireT, false); + local Y1 = sq_GetAccel(obj.getYPos(), targetObj.getYPos(), currentT, fireT, false); + local sizeRate = sq_GetUniformVelocity(20, 2, currentT, fireT).tofloat() / 10.0; + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_setCurrentAxisPos(obj, 0, X1); + sq_setCurrentAxisPos(obj, 1, Y1); + } + else{ + sq_SendDestroyPacketPassiveObject(obj); + } + break; + } + break; + } + break; + case 76://spiritdarkhigher + break; + case 77://spiritlighthigher + break; + case 78://spiritwaterhigher + switch(subtype){ + case 11: + switch(state){ + case 20: + case 21: + if(obj.getZPos() <= 0){ + obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + } + break; + } + break; + case 10: + switch(state){ + case 21: + local currentT = sq_GetObjectTime(obj);;//?嚙踝蕭?? + local fireT = 3000;//??? + local srcX = obj.getVar("move").get_vector(0); + local MoveX = obj.getVar("move").get_vector(1); + local v = sq_GetUniformVelocity(0, MoveX, currentT, fireT); + local dstX = sq_GetDistancePos(srcX, obj.getDirection(), v); + if(sqrChr.isMovablePos(dstX, obj.getYPos())){ + sq_setCurrentAxisPos(obj, 0, dstX); + } + else{ + obj.getVar("move").set_vector(0,obj.getXPos()); + obj.getVar("move").set_vector(1,0); + } + break; + } + break; + } + break; + case 79://spiritfirehigher + switch(subtype){ + case 61: + switch(state){ + case 20: + case 21: + case 22: + local sub = obj.getVar("sub").get_vector(0); + local sub_all = obj.getVar("sub").get_vector(1); + local parentObj = sq_GetCNRDObjectToActiveObject(obj.getVar("parentObj").get_obj_vector(0)); + if(parentObj){ + local base100Angle = (36000 / sub_all) * sub; + local currentT = sq_GetObjectTime(obj); + local currentSpeedRate = 1.0; + local defaultRoundTime = 960; + local radius = 125; + local baseX = parentObj.getXPos(); + local baseZ = parentObj.getYPos(); + local current100Angle = (base100Angle + (36000 * currentSpeedRate * currentT / defaultRoundTime)) % 36000; + local angle = (current100Angle.tofloat() / 100.0); + + local disMovLen = radius * sq_CosTable(angle.tointeger()); + local mov_x = sq_GetDistancePos(baseX, ENUM_DIRECTION_LEFT, disMovLen.tointeger()); + + local axisMagnifyRate = 125 * 0.33; + local upMovLen = radius * sq_SinTable(angle.tointeger()) * axisMagnifyRate / 100; + + local mov_y = baseZ + upMovLen.tointeger(); + + sq_setCurrentAxisPos(obj, 0, mov_x); + sq_setCurrentAxisPos(obj, 1, mov_y); + //sq_setCurrentAxisPos(obj, 2, parentObj.getZPos()); + } + else{ + sq_SendDestroyPacketPassiveObject(obj); + } + break; + } + break; + } + break; + case 80://babydragon + break; + case 82://casillas + break; + case 118://sandorex + break; + case 119://heilrom + break; + case 120://spiritfireex + break; + case 121://kruta + break; + case 122://ramos + switch(subtype){ + case 41: + switch(state){ + case 20: + local pAni = obj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + local fireT = pAni.getDelaySum(false); + local srcX = obj.getVar("move").get_vector(0); + local MoveX = obj.getVar("move").get_vector(1); + local v = sq_GetAccel(0, MoveX, currentT, fireT, false); + local dstX = sq_GetDistancePos(srcX, obj.getDirection(), v); + sq_setCurrentAxisPos(obj, 0, dstX); + break; + } + break; + case 200: + switch(state){ + case 21: + local pAni = obj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + local fireT = 1000; + local srcX = obj.getVar("move").get_vector(0); + local MoveX = obj.getVar("move").get_vector(1); + local v = sq_GetAccel(0, MoveX, currentT, fireT, true); + local dstX = sq_GetDistancePos(srcX, obj.getDirection(), v); + if(sqrChr.isMovablePos(dstX,obj.getYPos())) sq_setCurrentAxisPos(obj, 0, dstX); + if(currentT > fireT) obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + } + break; + case SKILL_BYKK_SUMMONSPIRITCOMMON: + break; + case SKILL_BYKK_MOONSHADOW: + switch(subtype){ + case 1: + switch(state){ + case 20: + case 21: + case 22: + local loadSlot = sqrChr.sq_GetSkillLoad(SKILL_BYKK_MOONSHADOW); + if(loadSlot){ + local attacknumber = loadSlot.getRemainLoadNumber(); + if(attacknumber <= 0){ + obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, ""); + return; + } + } + else{ + obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, ""); + } + local time = sq_GetObjectTime(obj); + if(time >= obj.getVar("custom").getInt(0)){ + obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, ""); + return; + } + break; + } + break; + } + break; + case 150: + switch(subtype){ + case 1: + if(sq_GetObjectTime(obj) >= 5000) sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + } +} + +function onAttack_po_summoners(obj, damager, boundingBox, isStuck) +{ + if(!obj) return 0; + //enableClearDeadEnemies(obj, damager); + + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").get_vector(0); + local subtype = obj.getVar("subtype").get_vector(0); + local state = obj.getVar("state").get_vector(0); + + switch(skillIndex){ + case 25://hodor + switch(subtype){ + case 4: + case 5: + case 6: + if(obj.getVar("custom").getInt(10) < 1) sq_SendDestroyPacketPassiveObject(obj); + break; + case 7: + switch(state){ + case 20: + obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + } + break; + case 44://sandor + break; + case 45://auxo + switch(subtype){ + case 3: + local skill_level = sqrChr.sq_GetSkillLevel(45); + local level = 40 + skill_level * 2; + local prob = sq_GetLevelData(sqrChr, 45, 19, skill_level); + local time = sq_GetLevelData(sqrChr, 45, 21, skill_level); + sq_sendSetActiveStatusPacket(damager, sqrChr, ACTIVESTATUS_CONFUSE, prob.tofloat(), level.tointeger(), false, time.tointeger()); + break; + } + break; + case 46://luis + switch(subtype){ + case 3: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 47://echeverra + break; + case 76://spiritdarkhigher + switch(subtype){ + case 61: + switch(state){ + case 21: + local appendagePath = "character/mage/k_k_made/appendage/aptomonster/debuff/ap_holdedmonster.nut"; + if(!CNSquirrelAppendage.sq_IsAppendAppendage(damager, appendagePath)){ + local MasterAppendage = CNSquirrelAppendage.sq_AppendAppendage(damager, obj, 128, false, appendagePath, true); + if(MasterAppendage){ + sq_HoldAndDelayDie(damager, obj, true, false, false, 100, 500, ENUM_DIRECTION_NEUTRAL , MasterAppendage); + local validT = MasterAppendage.getAppendageInfo() + local time = obj.getVar("time").get_vector(0); + validT.setValidTime(time); + } + } + break; + } + break; + } + break; + case 77://spiritlighthigher + break; + case 78://spiritwaterhigher + switch(subtype){ + case 3: + case 11: + switch(state){ + case 20: + case 21: + obj.sq_RemoveMoveParticle(); + obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + if(subtype == 3) sq_AddDrawOnlyAniFromParent(obj,"passiveobject/madeby_k_k/animation/spirit/waterhigherspirit/element_water_ice_spear_exp_dodge.ani",0,0,0); + break; + } + break; + case 10: + if(obj.getVar().getBool(0)){ + obj.sq_RemoveMoveParticle(); + obj.sq_SetMoveParticle("particle/ramos/targetingmove.ptl", 0.0, 0.0); + sq_SetSpeedToMoveParticle(obj,0,50); + obj.getVar().setBool(0,false); + } + break; + } + break; + case 79://spiritfirehigher + switch(subtype){ + case 31: + case 32: + case 33: + local eclipsehive_bonus = sqrChr.getVar("eclipsehive_bonus").getInt(10).tofloat() / 100.0; + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, SKILL_BYKK_SUMMONSPIRITFIREHIGHER, 24, eclipsehive_bonus) + 100; + local sizeRate = 110; + sq_BinaryStartWrite(); + sq_BinaryWriteWord(sizeRate); + sq_BinaryWriteWord(totalDamage); + sq_SendCreatePassiveObjectPacketPos(sqrChr, 24281, 0, damager.getXPos(), damager.getYPos() + 1, sq_GetCenterZPos(boundingBox)); + break; + } + break; + case 80://babydragon + switch(subtype){ + case 3: + sq_CreateParticle("passiveobject/common/particle/fireexplosionparticle1.ptl", obj, 0, 0, 0, true, 30, 0, 1); + sq_CreateParticle("passiveobject/common/particle/fireexplosionparticle2.ptl", obj, 0, 0, 0, true, 30, 0, 1); + sq_CreateParticle("passiveobject/common/particle/fireexplosionparticle3.ptl", obj, 0, 0, 0, true, 30, 0, 1); + sq_CreateParticle("passiveobject/common/particle/fireexplosionparticle4.ptl", obj, 0, 0, 0, true, 30, 0, 1); + case 5: + if(obj.getVar("custom").getInt(10) > 0) break; + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 82://casillas + switch(subtype){ + case 100: + if(damager && damager.isObjectType(OBJECTTYPE_ACTIVE)){ + local activeObj = sq_GetCNRDObjectToActiveObject(damager); + local hpMax = activeObj.getHpMax(); + local hp = activeObj.getHp(); + local decrease_hp = (hpMax.tofloat() * 0.1).tointeger(); + if(sq_IsBoss(activeObj)) decrease_hp = (hp.tofloat() * 0.03).tointeger(); + else if(sq_IsNamed(activeObj)) decrease_hp = (hp.tofloat() * 0.06).tointeger(); + // print("hpMax = "+hpMax+" + hp = "+hp+" + decrease_hp = "+decrease_hp); + if(decrease_hp > hp) activeObj.setHp(0, null, true); + else activeObj.setHp(hp - decrease_hp, null, true); + } + break; + } + break; + case 118://sandorex + break; + case 119://heilrom + break; + case 120://spiritfireex + break; + case 121://kruta + switch(subtype){ + case 41: + if(!CNSquirrelAppendage.sq_IsAppendAppendage(damager, "character/mage/k_k_made/appendage/aptomonster/debuff/ap_pulledmonster.nut")){ + local appendagePath = "character/mage/k_k_made/appendage/aptomonster/debuff/ap_pulledmonster.nut"; + local MasterAppendage = CNSquirrelAppendage.sq_AppendAppendage(damager, sqrChr, -1, false, appendagePath, true); + if(MasterAppendage){ + sq_AccelMoveToAppendageForce(damager, sqrChr, obj, 325, 0, 0, 400, true, MasterAppendage, false); + local validT = MasterAppendage.getAppendageInfo() + validT.setValidTime(700); + } + } + break; + } + break; + case 122://ramos + switch(subtype){ + case 5: + if(!CNSquirrelAppendage.sq_IsAppendAppendage(damager, "character/mage/k_k_made/appendage/aptomonster/debuff/ap_pulledmonster.nut")){ + local appendagePath = "character/mage/k_k_made/appendage/aptomonster/debuff/ap_pulledmonster.nut"; + local MasterAppendage = CNSquirrelAppendage.sq_AppendAppendage(damager, sqrChr, -1, false, appendagePath, true); + if(MasterAppendage){ + sq_AccelMoveToAppendageForce(damager, sqrChr, obj, 200, 0, 0, 800, true, MasterAppendage, false); + local validT = MasterAppendage.getAppendageInfo() + validT.setValidTime(1000); + } + } + sq_AddDrawOnlyAniFromParent(damager,"monster/character/mage/madeby_k_k/ramos/animation/gather/gatherhit_03.ani",0,0,sq_GetCenterZPos(boundingBox)); + break; + } + break; + case SKILL_BYKK_SUMMONSPIRITCOMMON: + break; + case SKILL_BYKK_MOONSHADOW: + break; + case 150: + switch(subtype){ + case 1: + if(damager.isObjectType(OBJECTTYPE_ACTIVE) && damager.isInDamagableState(obj)){ + local holdTime = obj.getVar("custom").getInt(1); + if(holdTime == 0) holdTime = 3000; + local totalDamage = obj.getVar("custom").getInt(0); + createPassiveObject_k_k(obj,obj,150,2,0,0,sq_GetCenterZPos(boundingBox),totalDamage,holdTime,0,0,0); + sq_SendDestroyPacketPassiveObject(obj); + } + break; + case 2: + if(damager.isObjectType(OBJECTTYPE_ACTIVE) && damager.isInDamagableState(obj)){ + local apdPath = "character/mage/k_k_made/appendage/aptoemeny/ap_throwstickytrap_hold.nut"; + if(CNSquirrelAppendage.sq_IsAppendAppendage(damager, apdPath)) CNSquirrelAppendage.sq_RemoveAppendage(damager, apdPath); + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(damager, obj, -1, true, apdPath, true); + sq_HoldAndDelayDie(damager, obj, true, true, true, 200, 200, ENUM_DIRECTION_NEUTRAL , AddAppendage); + local holdTime = obj.getVar("custom").getInt(1); + AddAppendage.sq_SetValidTime(holdTime); + } + break; + } + break; + } + + local timer = sqrChr.getVar("time").get_ct_vector(0); + if(timer){ + local timer_t1 = timer.Get(); + if(timer_t1 > 1680){ + local loadSlot = sqrChr.sq_GetSkillLoad(SKILL_BYKK_MOONSHADOW); + if(loadSlot){ + local attacknumber = loadSlot.getRemainLoadNumber(); + if(attacknumber > 0 && skillIndex != SKILL_BYKK_MOONSHADOW && subtype != 2){ + loadSlot.decreaseLoadCount(1); + local totalDamage = sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_MOONSHADOW, -1, 10, 1.0) + 100; + createPassiveObject_k_k(sqrChr,damager,SKILL_BYKK_MOONSHADOW,2,0,0,sq_GetCenterZPos(boundingBox),totalDamage,0,0,0,0); + } + attacknumber = loadSlot.getRemainLoadNumber(); + if(attacknumber <= 0) sqrChr.sq_RemoveSkillLoad(SKILL_BYKK_MOONSHADOW); + } + } + } + return 0; +} + +function onAfterAttack_po_summoners(obj, damager, boundingBox, isStuck) +{ + if(!obj) return 0; + + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").get_vector(0); + local subtype = obj.getVar("subtype").get_vector(0); + local state = obj.getVar("state").get_vector(0); + + switch(skillIndex){ + case 25://hodor + break; + case 44://sandor + break; + case 45://auxo + break; + case 46://luis + break; + case 47://echeverra + break; + case 76://spiritdarkhigher + switch(subtype){ + case 61: + switch(state){ + case 22: + //嚙踝蕭? + if(damager && damager.isObjectType(OBJECTTYPE_ACTIVE)){// && damager.getVar().getBool(0) == false + //damager.getVar().setBool(0,true); + local activeObj = sq_GetCNRDObjectToActiveObject(damager); + local hpMax = activeObj.getHpMax(); + local hp = activeObj.getHp(); + local hp_percentage = (hp.tofloat() / hpMax.tofloat()) * 100; + local killpoint = (sq_GetBonusRateWithPassive(sqrChr, SKILL_BYKK_SUMMONSPIRITDARKHIGHER, SKILL_BYKK_SUMMONSPIRITDARKHIGHER, 24, 1.0) + 100).tofloat(); + local hide_percent = 89; + if(sq_IsBoss(activeObj)){killpoint = killpoint.tofloat() / 3.0;hide_percent = 98;} + else if(sq_IsNamed(activeObj)){killpoint = killpoint.tofloat() / 2.0;hide_percent = 94;} + if((hp_percentage <= killpoint && hp_percentage > 0) || sq_getRandom(0,99) > hide_percent){ + local group = sq_GetGroup(activeObj); + local uniqueId = sq_GetUniqueId(activeObj); + local z = activeObj.getObjectHeight(); + createPassiveObject_k_k(sqrChr,activeObj,SKILL_BYKK_SUMMONSPIRITDARKHIGHER,63,0,1,z / 4 + 1,0,500,group,uniqueId,0); + } + } + return; + break; + } + break; + } + break; + case 77://spiritlighthigher + break; + case 78://spiritwaterhigher + break; + case 79://spiritfirehigher + break; + case 80://babydragon + break; + case 82://casillas + // if(damager && damager.isObjectType(OBJECTTYPE_ACTIVE)){ + // local activeObj = sq_GetCNRDObjectToActiveObject(damager); + // if(activeObj.getHp() <= 0) activeObj.setValid(false); + // } + break; + case 118://sandorex + break; + case 119://heilrom + break; + case 120://spiritfireex + break; + case 121://kruta + break; + case 122://ramos + break; + case SKILL_BYKK_SUMMONSPIRITCOMMON: + break; + case SKILL_BYKK_MOONSHADOW: + break; + } + return 0; +} + + +//////////////////////////////////// + + +function createPassiveObjectEx_k_k(obj,monsterobj,targetObj,skillIndex,subtype,x,y,z,direction,pvector1,pvector2,pvector3,pvector4,pvector5) +{ + if(!obj || !monsterobj) return; + if(pvector1 == null) pvector1 = 0; + if(pvector2 == null) pvector2 = 0; + if(pvector3 == null) pvector3 = 0; + if(pvector4 == null) pvector4 = 0; + if(pvector5 == null) pvector5 = 0; + // local bonusRate = obj.getVar("summoners_bonusRate").get_vector(0).tofloat() / 1000.0; + //print("bonusRate = "+bonusRate); + // pvector1 = (pvector1.tofloat() * bonusRate).tointeger(); + if((skillIndex == SKILL_BYKK_SUMMONRAMOS && subtype == 41) || (skillIndex == 25 && subtype == 7) || (skillIndex == 46 && subtype == 6)) pvector2 = (pvector2.tofloat() * summoners_kuk_setbonusRate(obj).tofloat() / 1000.0).tointeger(); + local destX_01 = 0; + local destY_01 = 0; + if(!isSameObject(obj, monsterobj)){ + destX_01 = targetObj.getXPos() - obj.getXPos(); + destY_01 = targetObj.getYPos() - obj.getYPos(); + if(direction == ENUM_DIRECTION_LEFT) destX_01 = obj.getXPos() - targetObj.getXPos(); + } + sq_BinaryStartWrite(); + sq_BinaryWriteDword(skillIndex); + sq_BinaryWriteDword(subtype); + sq_BinaryWriteDword(pvector1); + sq_BinaryWriteDword(pvector2); + sq_BinaryWriteDword(pvector3); + sq_BinaryWriteDword(pvector4); + sq_BinaryWriteDword(pvector5); + sq_SendCreatePassiveObjectPacket(obj, 24381, 0, destX_01 + x, destY_01 + y, z - obj.getZPos(), direction); +} + + +function checkExecutableSkill_Blacklunatic(obj) +{ + if(!obj) return false; + + local LuisObj = obj.getVar("LuisObj").get_obj_vector_size(); + if(LuisObj > 0){ + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_BLACKLUNATIC); + if(b_useskill){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_BLACKLUNATIC, STATE_PRIORITY_USER, true); + return true; + } + } + else if(obj.isMessage()){ + sq_AddMessage(71099); + } + return false; +} + +function checkCommandEnable_Blacklunatic(obj) +{ + if(!obj) return false; + return true; +} + +function onSetState_Blacklunatic(obj, state, datas, isResetTimer) +{ + if(!obj) return; + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + obj.sq_StopMove(); + local Ani = obj.sq_GetThrowChargeAni(3); + obj.setCurrentAnimation(Ani); + local castTime = 200; + obj.getVar("caseTimE").clear_vector(); + obj.getVar("caseTimE").push_vector(castTime); + sq_StartDrawCastGauge(obj, castTime, true); + //obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED,SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + break; + case 1: + obj.sq_StopMove(); + local Ani = obj.sq_GetThrowShootAni(3); + obj.setCurrentAnimation(Ani); + obj.sq_PlaySound("R_WZ_BLACK_LUNATIC"); + obj.sq_PlaySound("BLACK_LUNATIC_START"); + local monsternum = obj.getVar("LuisObj").get_obj_vector_size(); + if(sq_GetIntData(obj, SKILL_BYKK_BLACKLUNATIC, 51) > 0 && monsternum > 2){ + for(local i = 2; i < monsternum; i++){ + local LuisObj = obj.getVar("LuisObj").get_obj_vector(i); + if(LuisObj) LuisObj.setValid(false); + } + } + if(monsternum > 0 && sq_GetIntData(obj, SKILL_BYKK_BLACKLUNATIC, 51) < 1) monsternum = 1; + if(monsternum > 0){ + local totalDamage = sq_GetBonusRateWithPassive(obj, SKILL_BYKK_BLACKLUNATIC, -1, 0, 1.0) + 100; + createPassiveObject_k_k(obj,obj,SKILL_BYKK_BLACKLUNATIC,5,100,0,0,totalDamage,0,0,0,0); + } + for(local i = 0; i < monsternum; i++){ + local monsterObj = sq_GetCNRDObjectToActiveObject(obj.getVar("LuisObj").get_obj_vector(i)); + if(monsterObj){ + //monsterObj.getVar("skill").setBool(0,true); + local yPos = obj.getYPos(); + local xPos = sq_GetDistancePos(obj.getXPos(), obj.getDirection(), 100); + sq_MoveToNearMovablePos(monsterObj, xPos, yPos, sq_GetZPos(monsterObj), xPos, yPos, sq_GetZPos(monsterObj), 100, -1, 5); + sq_SetCurrentDirection(monsterObj, obj.getDirection()); + monsterattack_ksk(monsterObj,11); + + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(monsterObj, obj, 220, false, BLACKLUNATIC_APDPATH, true); + print("load");//" + local monsterAppendage = CNSquirrelAppendage.sq_GetAppendage(monsterObj, "character/mage/k_k_made/appendage/aptomonster/ap_luis.nut"); + if(monsterAppendage){ + local coolTime_01 = sq_GetIntData(obj, SKILL_BYKK_BLACKLUNATIC, 22); + local coolTime_02 = sq_GetIntData(obj, SKILL_BYKK_BLACKLUNATIC, 24); + local coolTime_03 = sq_GetIntData(obj, SKILL_BYKK_BLACKLUNATIC, 23); + + if(obj.getVar("eclipsehive_select").getBool(0) == false){ + if(sq_GetIntData(obj, SKILL_BYKK_BLACKLUNATIC, 51) > 0){ + coolTime_01 = coolTime_01 * 50 / 100; + coolTime_02 = coolTime_02 * 50 / 100; + coolTime_03 = coolTime_03 * 50 / 100; + } + } + print("coolTime_01 = "+coolTime_01+" ,coolTime_02 = "+coolTime_02+" ,coolTime_03 = "+coolTime_03); + + monsterAppendage.getVar("skill_10").clear_timer_vector(); + monsterAppendage.getVar("skill_10").push_timer_vector(); + local t_02 = monsterAppendage.getVar("skill_10").get_timer_vector(0); + t_02.setParameter(coolTime_01, -1); + t_02.resetInstant(0); + monsterAppendage.getVar("skill_11").clear_timer_vector(); + monsterAppendage.getVar("skill_11").push_timer_vector(); + local t_03 = monsterAppendage.getVar("skill_11").get_timer_vector(0); + t_03.setParameter(coolTime_02, -1); + t_03.resetInstant(0); + monsterAppendage.getVar("skill_12").clear_timer_vector(); + monsterAppendage.getVar("skill_12").push_timer_vector(); + local t_04 = monsterAppendage.getVar("skill_12").get_timer_vector(0); + t_04.setParameter(coolTime_03, -1); + t_04.resetInstant(0); + } + } + } + break; + } +} + +function onEndCurrentAni_Blacklunatic(obj) +{ + if(!obj) return; + local substate = obj.getSkillSubState(); + obj.setSkillSubState(substate); + switch(substate){ + case 1: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onEndState_Blacklunatic(obj, new_state) +{ + if(!obj) return; + if(new_state != 139) sq_EndDrawCastGauge(obj); +} + +function onProcCon_Blacklunatic(obj) +{ + if(!obj) return; + local substate = obj.getSkillSubState(); + local casttime = obj.getVar("caseTimE").get_vector(0); + if(substate == 0){ + if(obj.sq_GetStateTimer() >= casttime){ + sq_EndDrawCastGauge(obj); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_BLACKLUNATIC, STATE_PRIORITY_USER, true); + } + } +} + +function procAppend_Summoner_bykk(obj) +{ + // if(!sq_GetSkill(obj, SKILL_BYKK_BLACKLUNATIC).isInCoolTime() && obj.getVar("LuisObj").get_obj_vector_size() > 0 && obj.isMyControlObject()){ + // local monsternum = obj.getVar("LuisObj").get_obj_vector_size(); + // if(sq_GetIntData(obj, SKILL_BYKK_BLACKLUNATIC, 51) > 0 && monsternum > 2){ + // for(local i = 2; i < monsternum; i++){ + // local LuisObj = obj.getVar("LuisObj").get_obj_vector(i); + // if(LuisObj) LuisObj.setValid(false); + // } + // } + // if(monsternum > 0 && false) monsternum = 1; + // if(monsternum > 0){ + // local totalDamage = sq_GetBonusRateWithPassive(obj, SKILL_BYKK_BLACKLUNATIC, -1, 0, 1.0) + 100; + // local LuisObj = obj.getVar("LuisObj").get_obj_vector(0); + // createPassiveObject_k_k(obj,LuisObj,SKILL_BYKK_BLACKLUNATIC,5,0,0,0,totalDamage,0,0,0,0); + // } + // for(local i = 0; i < monsternum; i++){ + // local monsterObj = sq_GetCNRDObjectToActiveObject(obj.getVar("LuisObj").get_obj_vector(i)); + // if(monsterObj){ + // //monsterObj.getVar("skill").setBool(0,true); + // // local yPos = obj.getYPos(); + // // local xPos = sq_GetDistancePos(obj.getXPos(), obj.getDirection(), 100); + // // sq_MoveToNearMovablePos(monsterObj, xPos, yPos, sq_GetZPos(monsterObj), xPos, yPos, sq_GetZPos(monsterObj), 100, -1, 5); + // // sq_SetCurrentDirection(monsterObj, obj.getDirection()); + // monsterattack_ksk(monsterObj,11); + + // local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(monsterObj, obj, 220, false, BLACKLUNATIC_APDPATH, true); + // print("load");//" + // local monsterAppendage = CNSquirrelAppendage.sq_GetAppendage(monsterObj, "character/mage/k_k_made/appendage/aptomonster/ap_luis.nut"); + // if(monsterAppendage){ + // local coolTime_01 = sq_GetIntData(obj, SKILL_BYKK_BLACKLUNATIC, 22); + // local coolTime_02 = sq_GetIntData(obj, SKILL_BYKK_BLACKLUNATIC, 24); + // local coolTime_03 = sq_GetIntData(obj, SKILL_BYKK_BLACKLUNATIC, 23); + + // if(obj.getVar("eclipsehive_select").getBool(0) == false){ + // if(sq_GetIntData(obj, SKILL_BYKK_BLACKLUNATIC, 51) > 0){ + // coolTime_01 = coolTime_01 * 70 / 100; + // coolTime_02 = coolTime_02 * 70 / 100; + // coolTime_03 = coolTime_03 * 70 / 100; + // } + // } + // print("coolTime_01 = "+coolTime_01+" ,coolTime_02 = "+coolTime_02+" ,coolTime_03 = "+coolTime_03); + + // monsterAppendage.getVar("skill_10").clear_timer_vector(); + // monsterAppendage.getVar("skill_10").push_timer_vector(); + // local t_02 = monsterAppendage.getVar("skill_10").get_timer_vector(0); + // t_02.setParameter(coolTime_01, -1); + // t_02.resetInstant(0); + // monsterAppendage.getVar("skill_11").clear_timer_vector(); + // monsterAppendage.getVar("skill_11").push_timer_vector(); + // local t_03 = monsterAppendage.getVar("skill_11").get_timer_vector(0); + // t_03.setParameter(coolTime_02, -1); + // t_03.resetInstant(0); + // monsterAppendage.getVar("skill_12").clear_timer_vector(); + // monsterAppendage.getVar("skill_12").push_timer_vector(); + // local t_04 = monsterAppendage.getVar("skill_12").get_timer_vector(0); + // t_04.setParameter(coolTime_03, -1); + // t_04.resetInstant(0); + // t_04.setEventOnStart(true); + // } + // } + // } + // obj.startSkillCoolTime(SKILL_BYKK_BLACKLUNATIC, sq_GetSkillLevel(obj, SKILL_BYKK_BLACKLUNATIC), -1); + // } +} + + +function onStart_appendage_luis_blacklunatic(appendage) +{ + if (!appendage) return; + local parentObj = appendage.getParent(); + local sqrChr = appendage.getSource(); + sqrChr = sq_GetCNRDObjectToSQRCharacter(sqrChr); + if (!parentObj || parentObj.getState() == STATE_DIE) { + appendage.setValid(false); + return; + } + + local group = sq_GetGroup(parentObj);//组 + local uniqueId = sq_GetUniqueId(parentObj);//唯一ID + local skillLevel = sq_GetSkillLevel(sqrChr, 220); + local lifeTime = sq_GetIntData(sqrChr, 220, 2); + if(sq_GetIntData(sqrChr, 220, 51) > 0 && sq_GetIntData(sqrChr, 220, 52) > 0) lifeTime = lifeTime + 5000; + appendage.sq_SetValidTime(lifeTime + 1100); + + if(sq_GetIntData(sqrChr, SKILL_BYKK_BLACKLUNATIC, 53) > 0){ + local ap = sq_CreateChangeStatus(CHANGE_STATUS_TYPE_ATTACK_SPEED, true, sq_GetIntData(sqrChr, SKILL_BYKK_BLACKLUNATIC, 53).tofloat() , 0); + if (ap){ + ap.getAppendageInfo().setValidTime(lifeTime); + ap.sq_Append(parentObj, sqrChr); + } + } + + sqrChr.sq_SetSuperArmorUntilTime(parentObj, lifeTime + 1100); + local subliftTime_01 = lifeTime - lifeTime / 5 * (4); + local subliftTime_02 = lifeTime - lifeTime / 5 * (3); + local subliftTime_03 = lifeTime - lifeTime / 5 * (0); + local subliftTime_04 = lifeTime - lifeTime / 5 * (1); + local subliftTime_05 = lifeTime - lifeTime / 5 * (2); + local subliftTime = [0,subliftTime_01,subliftTime_02,subliftTime_03,subliftTime_04,subliftTime_05]; + for(local i = 1; i < 6; i++){ + createPassiveObject_k_k(sqrChr,parentObj,SKILL_BYKK_SUMMONLUIS,10,0,-1,20,i,subliftTime[i],group,uniqueId,0); + } +} + +function onEnd_appendage_luis_blacklunatic(appendage) +{ + if (!appendage) return; +} + +function onDamageParent_appendage_luis_blacklunatic(appendage ,attacker, boundingBox, isStuck) +{ + if (!appendage) return; +} + +function drawAppend_appendage_luis_blacklunatic(appendage, isOver, x, y, isFlip) +{ + if (!appendage) return; + local parentObj = appendage.getParent(); + if (!parentObj || parentObj.getState() == STATE_DIE) { + appendage.setValid(false); + return; + } +} + + + +//至高精灵王 +function checkExecutableSkill_HighestEcheverra(obj) +{ + if (!obj) return false; + local monsternum = obj.getVar("EcheverraObj").get_obj_vector_size(); + if(monsternum <= 0){ + if(obj.isMessage()) sq_AddMessage(71099); + return false; + } + local isUse = obj.sq_IsUseSkill(SKILL_BYKK_HIGHESTECHEVERRA); + if (isUse){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_HIGHESTECHEVERRA, STATE_PRIORITY_IGNORE_FORCE, true); + return true; + } + return false; +} + +function checkCommandEnable_HighestEcheverra(obj) +{ + if (!obj) return false; + return true; +} + +function onSetState_HighestEcheverra(obj, state, datas, isResetTimer) +{ + if(!obj) return; + local subState = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(subState); + obj.sq_StopMove(); + switch(subState){ + case 0: obj.sq_SetCurrentAnimation(299); break; + case 1: obj.sq_SetCurrentAnimation(300); break; + } + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + local currentAni = obj.getCurrentAnimation(); + local speedRate = 5000 / currentAni.getDelaySum(0, 0); + if(subState == 1) speedRate = 4000 / currentAni.getDelaySum(0, 0); + print("speedRate = "+speedRate); + if(speedRate >= 150) currentAni.setSpeedRate(150.0); +} + +function onEndCurrentAni_HighestEcheverra(obj) +{ + if(!obj) return; + local subState = obj.getSkillSubState(); + switch(subState){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_HIGHESTECHEVERRA, STATE_PRIORITY_AUTO, true); + break; + case 1: + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_AUTO, true); + break; + } +} + +function onProcCon_HighestEcheverra(obj) +{ + if(!obj) return; +} + +function onKeyFrameFlag_HighestEcheverra(obj, flagIndex) +{ + if(!obj) return false; + switch(flagIndex){ + case 1010: + sq_SetMyShake(obj, 5, 150); + //`camera move` + local currentAni = obj.getCurrentAnimation(); + local delay = currentAni.getDelaySum(10, 14); + obj.sq_SetXScrollStart(300, delay); + break; + case 1011: + local EcheverraObj = obj.getVar("EcheverraObj").get_obj_vector(0); + if(EcheverraObj && EcheverraObj.getState() != STATE_DIE){ + local monsterObj = sq_GetCNRDObjectToActiveObject(EcheverraObj); + monsterObj.getVar("teleport").setInt(10, obj.getDirection()); + monsterObj.getVar("teleport").setInt(11, sq_GetDistancePos(sq_GetXPos(obj), obj.getDirection(), 50)); + monsterObj.getVar("teleport").setInt(12, sq_GetYPos(obj)); + monsterObj.getVar("isHighestEcheverra").setBool(0, true); + monsterattack_ksk(monsterObj,5); + } + //`hide` + local currentAni = obj.getCurrentAnimation(); + local speedRate = 5000 / currentAni.getDelaySum(0, 0); + print("speedRate2 = "+speedRate); + createPassiveObject_k_k(obj,obj,SKILL_BYKK_HIGHESTECHEVERRA,3,0,20,20,speedRate,0,0,0,0); + break; + case 2002://`laser` + local currentAni = obj.getCurrentAnimation(); + local speedRate = 4000 / currentAni.getDelaySum(0, 0); + local offset = [[-100,-5,180,60,100],[-31,5,271,45,100],[-33,1,358,80,100],[20,0,250,45,100],[54,-3,308,50,100],[110,-2,300,55,100],[100,1,425,70,100]]; + local angle = [2303,4581,2794,3666,4582,3714,4212]; + local aniPath = "character/mage/animation/summoner_bykk/effect/highestecheverra/laser/laser_body_1.ani"; + local direction = sq_GetDirection(obj), xPos = sq_GetXPos(obj), yPos = sq_GetYPos(obj); + local alsName = [10002, 10004, 10006, 10007, 10010]; + for(local i = 0; i < 7; i++){ + local offsetX = sq_GetDistancePos(xPos, direction, offset[i][0] + 100); + local pooledObj = createOnlyDrawObjectEX_HighestEcheverra_bykk(obj,aniPath,true,direction, offsetX, yPos + offset[i][1], offset[i][2],ENUM_DRAWLAYER_NORMAL,100,100); + sq_SetCustomRotate(pooledObj, sq_ToRadian(-angle[i].tofloat() / 100.0)); + local pAni = pooledObj.getCurrentAnimation(); + pAni.setSpeedRate(speedRate.tofloat()); + for(local ui = 0; ui < 10; ui++){ + local aniPath = "character/mage/animation/summoner_bykk/effect/highestecheverra/laser/laser_0"+(ui+1).tostring()+".ani"; + if(ui == 9) aniPath = "character/mage/animation/summoner_bykk/effect/highestecheverra/laser/laser_"+(ui+1).tostring()+".ani"; + local pooledObj = createOnlyDrawObjectEX_HighestEcheverra_bykk(obj,aniPath,true,direction, offsetX, yPos + offset[i][1] + ui + 1, offset[i][2] + ui + 1,ENUM_DRAWLAYER_NORMAL,offset[i][3],offset[i][4]); + sq_SetCustomRotate(pooledObj, sq_ToRadian(-angle[i].tofloat() / 100.0)); + local pAni = pooledObj.getCurrentAnimation(); + pAni.setSpeedRate(speedRate.tofloat()); + } + } + local aniPath = "character/mage/animation/summoner_bykk/effect/highestecheverra/lasersik/bottom/highestecheverra_floorsik.ani"; + local baseX = 50; + local offset = [[350,-5],[300,20],[400,0],[250,18],[325,20],[500,20],[550,15]]; + for(local i = 0; i < offset.len(); i++){ + local pooledObj = sq_AddDrawOnlyAniFromParent(obj, aniPath, offset[i][0] + baseX, offset[i][1], 0); + local pAni = pooledObj.getCurrentAnimation(); + pAni.setSpeedRate(speedRate.tofloat()); + } + break; + case 2005://`laserAttackStart` + local currentAni = obj.getCurrentAnimation(); + local speedRate = 4000 / currentAni.getDelaySum(0, 0); + local totalDamage = sq_GetBonusRateWithPassive(obj, SKILL_BYKK_HIGHESTECHEVERRA, -1, 0, 1.0); + local hitMax = sq_GetIntData(obj, SKILL_BYKK_HIGHESTECHEVERRA, 1); + createPassiveObject_k_k(obj,obj,SKILL_BYKK_HIGHESTECHEVERRA,1,150,0,0,totalDamage,hitMax,speedRate,0,0); + break; + case 2015:// + sq_SetMyShake(obj, 20, 450); + //`explosion` + obj.sq_PlaySound("HIGHEST_ECHEVERRA_EXP"); + obj.sq_PlaySound("WZ_HIGHEST_ECHEVERRA_01_3"); + local totalDamage = sq_GetBonusRateWithPassive(obj, SKILL_BYKK_HIGHESTECHEVERRA, -1, 1, 1.0); + createPassiveObject_k_k(obj,obj,SKILL_BYKK_HIGHESTECHEVERRA,2,450,0,0,totalDamage,0,0,0,0); + break; + } + return true; +} + +function onTimeEvent_HighestEcheverra(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; +} + +function onEndState_HighestEcheverra(obj, new_state) +{ + if(!obj) return; + if(new_state != SKILL_BYKK_HIGHESTECHEVERRA){ + obj.sq_SetXScrollStop(500); + } +} + +function createOnlyDrawObjectEX_HighestEcheverra_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 checkExecutableSkill_ThrowStickyTrap(obj) +{ + if (!obj) return false; + local isUse = obj.sq_IsUseSkill(150); + if (isUse){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(150, STATE_PRIORITY_IGNORE_FORCE, true); + return true; + } + return false; +} + +function checkCommandEnable_ThrowStickyTrap(obj) +{ + if (!obj) return false; + return true; +} + +function onSetState_ThrowStickyTrap(obj, state, datas, isResetTimer) +{ + if(!obj) return; + local subState = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(subState); + obj.sq_StopMove(); + switch(subState){ + case 0: + obj.sq_SetCurrentAnimation(301); + break; + case 1: + obj.sq_SetCurrentAnimation(302); + // obj.sq_PlaySound("R_WZ_THROWST"); + break; + } + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); +} + +function onEndCurrentAni_ThrowStickyTrap(obj) +{ + if(!obj) return; + local subState = obj.getSkillSubState(); + switch(subState){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(150, STATE_PRIORITY_AUTO, true); + break; + case 1: + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_AUTO, true); + break; + } +} + +function onProcCon_ThrowStickyTrap(obj) +{ + if(!obj) return; +} + +function onKeyFrameFlag_ThrowStickyTrap(obj, flagIndex) +{ + if(!obj) return false; + switch(flagIndex){ + case 1: + obj.sq_PlaySound("WZ_STICKY"); + obj.sq_PlaySound("STICKY_READY"); + break; + case 2: + local totalDamage = sq_GetBonusRateWithPassive(obj, 150, -1, 0, 1.0); + local holdTime = sq_GetBonusRateWithPassive(obj, 150, -1, 1, 1.0) + 100; + createPassiveObject_k_k(obj,obj,150,1,100,0,70,totalDamage,holdTime,0,0,0); + break; + } + return true; +} + +function onTimeEvent_ThrowStickyTrap(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; +} + +function onEndState_ThrowStickyTrap(obj, new_state) +{ + if(!obj) return; +} + +function drawAppend_appendage_throwstickytrap_hold(appendage, isOver, x, y, isFlip) +{ + local var = appendage.getVar(); + local parentObj = appendage.getParent(); + if(!parentObj || parentObj.getState() == STATE_DIE){ + appendage.setValid(false); + return; + } + //自定义ani + local Ani = var.GetAnimationMap("throwstickytrap_hold", "character/mage/animation/summoner_bykk/effect/throwstickytrap/throwglue_glueloop01.ani"); + sq_AnimationProc(Ani); + sq_drawCurrentFrame(Ani, x, y - 60, isFlip); +} + + +//////////////////////////////////// +function checkExecutableSkill_SummonHodor(obj) +{ + if(!obj) return false; + if(!obj.isMyControlObject()) return false; + if(sq_getGrowType(obj) == 2){ + local isTrue = summoner_kak_monsterSkill(obj,SKILL_BYKK_SUMMONHODOR,"HodorObj",10); + if(isTrue == 1) return false; + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_SUMMONHODOR); + if(b_useskill){ + summonmonster_by_kwk(obj,SKILL_BYKK_SUMMONHODOR); + return true; + } + } + return false; +} + +function checkExecutableSkill_SummonSandor(obj) +{ + if(!obj) return false; + if(!obj.isMyControlObject()) return false; + local isTrue = summoner_kak_monsterSkill(obj,SKILL_BYKK_SUMMONSANDOR,"SandorObj",6); + if(isTrue == 1) return false; + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_SUMMONSANDOR); + if(b_useskill){ + summonmonster_by_kwk(obj,SKILL_BYKK_SUMMONSANDOR); + } + return false; +} + +function checkExecutableSkill_SummonAuxo(obj) +{ + if(!obj) return false; + if(!obj.isMyControlObject()) return false; + local isTrue = summoner_kak_monsterSkill(obj,SKILL_BYKK_SUMMONAUXO,"AuxoObj",5); + if(isTrue == 1) return false; + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_SUMMONAUXO); + if(b_useskill){ + summonmonster_by_kwk(obj,SKILL_BYKK_SUMMONAUXO); + } + return false; +} + +function checkExecutableSkill_SummonLuis(obj) +{ + if(!obj) return false; + if(!obj.isMyControlObject()) return false; + local isTrue = summoner_kak_monsterSkill(obj,SKILL_BYKK_SUMMONLUIS,"LuisObj",6); + if(isTrue == 1) return false; + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_SUMMONLUIS); + if(b_useskill){ + summonmonster_by_kwk(obj,SKILL_BYKK_SUMMONLUIS); + } + return false; +} + +function checkExecutableSkill_SummonEcheverra(obj) +{ + if(!obj) return false; + if(!obj.isMyControlObject()) return false; + local isTrue = summoner_kak_monsterSkill(obj,SKILL_BYKK_SUMMONECHEVERRA,"EcheverraObj",5); + if(isTrue == 1) return false; + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_SUMMONECHEVERRA); + if(b_useskill){ + summonmonster_by_kwk(obj,SKILL_BYKK_SUMMONECHEVERRA); + } + return false; +} + +function checkExecutableSkill_SummonSpiritDarkHigher(obj) +{ + if(!obj) return false; + if(!obj.isMyControlObject()) return false; + local isTrue = summoner_kak_monsterSkill(obj,SKILL_BYKK_SUMMONSPIRITDARKHIGHER,"DarkhigherspiritObj",4); + if(isTrue == 1) return false; + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_SUMMONSPIRITDARKHIGHER); + if(b_useskill){ + summonmonster_by_kwk(obj,SKILL_BYKK_SUMMONSPIRITDARKHIGHER); + } + return false; +} + +function checkExecutableSkill_SummonSpiritLightHigher(obj) +{ + if(!obj) return false; + if(!obj.isMyControlObject()) return false; + local isTrue = summoner_kak_monsterSkill(obj,SKILL_BYKK_SUMMONSPIRITLIGHTHIGHER,"LighthigherspiritObj",4); + if(isTrue == 1) return false; + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_SUMMONSPIRITLIGHTHIGHER); + if(b_useskill){ + summonmonster_by_kwk(obj,SKILL_BYKK_SUMMONSPIRITLIGHTHIGHER); + } + return false; +} + +function checkExecutableSkill_SummonSpiritWaterHigher(obj) +{ + if(!obj) return false; + if(!obj.isMyControlObject()) return false; + local isTrue = summoner_kak_monsterSkill(obj,SKILL_BYKK_SUMMONSPIRITWATERHIGHER,"WaterhigherspiritObj",4); + if(isTrue == 1) return false; + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_SUMMONSPIRITWATERHIGHER); + if(b_useskill){ + summonmonster_by_kwk(obj,SKILL_BYKK_SUMMONSPIRITWATERHIGHER); + } + return false; +} + +function checkExecutableSkill_SummonSpiritFireHigher(obj) +{ + if(!obj) return false; + if(!obj.isMyControlObject()) return false; + local isTrue = summoner_kak_monsterSkill(obj,SKILL_BYKK_SUMMONSPIRITFIREHIGHER,"FirehigherspiritObj",4); + if(isTrue == 1) return false; + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_SUMMONSPIRITFIREHIGHER); + if(b_useskill){ + summonmonster_by_kwk(obj,SKILL_BYKK_SUMMONSPIRITFIREHIGHER); + } + return false; +} + +function checkExecutableSkill_SummonBabyDragon(obj) +{ + if(!obj) return false; + if(!obj.isMyControlObject()) return false; + local isTrue = summoner_kak_monsterSkill(obj,SKILL_BYKK_SUMMONBABYDRAGON,"BabydragonObj",7); + if(isTrue == 1) return false; + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_SUMMONBABYDRAGON); + if(b_useskill){ + summonmonster_by_kwk(obj,SKILL_BYKK_SUMMONBABYDRAGON); + } + return false; +} + +function checkExecutableSkill_SummonCasillas(obj) +{ + if(!obj) return false; + if(!obj.isMyControlObject()) return false; + local isTrue = summoner_kak_monsterSkill(obj,SKILL_BYKK_SUMMONCASILLAS,"CassillasObj",4); + if(isTrue == 1) return false; + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_SUMMONCASILLAS); + if(b_useskill){ + summonmonster_by_kwk(obj,SKILL_BYKK_SUMMONCASILLAS); + } + return false; +} + +function checkExecutableSkill_SummonSandorEx(obj) +{ + if(!obj) return false; + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_SUMMONSANDOREX); + if(b_useskill){ + // summoner_monsterskill_bykk(obj,"SandorexObj",4,SKILL_BYKK_SUMMONSANDOREX,1); + return true; + } + return false; +} + +function checkExecutableSkill_SummonHeilrom(obj) +{ + if(!obj) return false; + if(!obj.isMyControlObject()) return false; + local isTrue = summoner_kak_monsterSkill(obj,SKILL_BYKK_SUMMONHEILROM,"HeilromObj",0); + if(isTrue == 1) return false; + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_SUMMONHEILROM); + if(b_useskill){ + summonmonster_by_kwk(obj,SKILL_BYKK_SUMMONHEILROM); + } + return false; +} + +function checkExecutableSkill_SummonSpiritFireEx(obj) +{ + if(!obj) return false; + if(!obj.isMyControlObject()) return false; + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_SUMMONSPIRITFIREEX); + if(b_useskill){ + summonmonster_by_kwk(obj,SKILL_BYKK_SUMMONSPIRITFIREEX); + } + return false; +} + +function checkExecutableSkill_SummonKruta(obj) +{ + if(!obj) return false; + if(!obj.isMyControlObject()) return false; + local isTrue = summoner_kak_monsterSkill(obj,SKILL_BYKK_SUMMONKRUTA,"KrutaObj", 13); + if(isTrue == 1) return false; + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_SUMMONKRUTA); + if(b_useskill){ + summonmonster_by_kwk(obj,SKILL_BYKK_SUMMONKRUTA); + } + return false; +} + +function checkExecutableSkill_SummonRamos(obj) +{ + if(!obj) return false; + if(!obj.isMyControlObject()) return false; + local isTrue = summoner_kak_monsterSkill(obj,SKILL_BYKK_SUMMONRAMOS,"RamosObj",17); + if(isTrue == 1) return false; + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_SUMMONRAMOS); + if(b_useskill){ + summonmonster_by_kwk(obj,SKILL_BYKK_SUMMONRAMOS); + } + return false; +} + +function checkExecutableSkill_SummonSpiritFire(obj) +{ + if(!obj) return false; + if(!obj.isMyControlObject()) return false; + local monsternum = obj.getVar("SpiritFireObj").get_obj_vector_size(); + if(monsternum > 0){ + local state = obj.getState(); + if(state == 14 || state == 0){ + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(state, STATE_PRIORITY_IGNORE_FORCE, true); + } + obj.startCantUseSkillWarning(); + if (obj.isMessage()) sq_AddMessage(2); + return true; + } + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_SUMMONSPIRITFIRE); + if(b_useskill){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(22); + obj.sq_IntVectPush(SKILL_BYKK_SUMMONSPIRITFIRE); + obj.sq_AddSetStatePacket(SKILL_BYKK_RINGOFDOMINATION , STATE_PRIORITY_IGNORE_FORCE, true); + return true; + } + return false; +} + +function checkExecutableSkill_SummonSpiritWater(obj) +{ + if(!obj) return false; + if(!obj.isMyControlObject()) return false; + local monsternum = obj.getVar("SpiritWaterObj").get_obj_vector_size(); + if(monsternum > 0){ + local state = obj.getState(); + if(state == 14 || state == 0){ + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(state, STATE_PRIORITY_IGNORE_FORCE, true); + } + obj.startCantUseSkillWarning(); + if (obj.isMessage()) sq_AddMessage(2); + return true; + } + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_SUMMONSPIRITWATER); + if(b_useskill){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(22); + obj.sq_IntVectPush(SKILL_BYKK_SUMMONSPIRITWATER); + obj.sq_AddSetStatePacket(SKILL_BYKK_RINGOFDOMINATION , STATE_PRIORITY_IGNORE_FORCE, true); + return true; + } + return false; +} + +function checkExecutableSkill_SummonSpiritDark(obj) +{ + if(!obj) return false; + if(!obj.isMyControlObject()) return false; + local monsternum = obj.getVar("SpiritDarkObj").get_obj_vector_size(); + if(monsternum > 0){ + local state = obj.getState(); + if(state == 14 || state == 0){ + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(state, STATE_PRIORITY_IGNORE_FORCE, true); + } + obj.startCantUseSkillWarning(); + if (obj.isMessage()) sq_AddMessage(2); + return true; + } + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_SUMMONSPIRITDARK); + if(b_useskill){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(22); + obj.sq_IntVectPush(SKILL_BYKK_SUMMONSPIRITDARK); + obj.sq_AddSetStatePacket(SKILL_BYKK_RINGOFDOMINATION , STATE_PRIORITY_IGNORE_FORCE, true); + return true; + } + return false; +} + +function checkExecutableSkill_SummonSpiritLight(obj) +{ + if(!obj) return false; + if(!obj.isMyControlObject()) return false; + local monsternum = obj.getVar("SpiritLightObj").get_obj_vector_size(); + if(monsternum > 0){ + local state = obj.getState(); + if(state == 14 || state == 0){ + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(state, STATE_PRIORITY_IGNORE_FORCE, true); + } + obj.startCantUseSkillWarning(); + if (obj.isMessage()) sq_AddMessage(2); + return true; + } + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_SUMMONSPIRITLIGHT); + if(b_useskill){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(22); + obj.sq_IntVectPush(SKILL_BYKK_SUMMONSPIRITLIGHT); + obj.sq_AddSetStatePacket(SKILL_BYKK_RINGOFDOMINATION , STATE_PRIORITY_IGNORE_FORCE, true); + return true; + } + return false; +} + +function checkExecutableSkill_RingOfDomination(obj) +{ + if (!obj) return false; + if(!obj.isMyControlObject()) return false; + local isUse = obj.sq_IsUseSkill(SKILL_BYKK_RINGOFDOMINATION); + if (isUse){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_RINGOFDOMINATION , STATE_PRIORITY_USER, true); + return true; + } + return false; +} + +function checkCommandEnable_RingOfDomination(obj) +{ + if (!obj) return false; + local state = obj.sq_GetState(); + if (state == STATE_STAND) return true; + if(state == STATE_ATTACK){ + return obj.sq_IsCommandEnable(SKILL_BYKK_RINGOFDOMINATION); + } + return true; +} + +function onSetState_RingOfDomination(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + local direction = obj.getDirection();//嚙踝蕭嚙踝蕭菾嚙踝蕭 + local xpos = sq_GetDistancePos(obj.getXPos(), direction, 185);//嚙踝蕭嚙踝蕭菾嚙踝蕭嚙踝蕭pos + local ypos = obj.getYPos(); + onAddPooledObj_RingOfDomination(obj, "passiveobject/madeby_k_k/animation/ringofdomination/start/rodstarta_p01.ani", xpos, ypos, ENUM_DRAWLAYER_NORMAL); + onAddPooledObj_RingOfDomination(obj, "passiveobject/madeby_k_k/animation/ringofdomination/start/rodstartringa_01.ani", xpos, ypos, ENUM_DRAWLAYER_NORMAL); + onAddPooledObj_RingOfDomination(obj, "passiveobject/madeby_k_k/animation/ringofdomination/start/rodstartringb_01.ani", xpos, ypos, ENUM_DRAWLAYER_NORMAL); + sq_SetCustomDamageType(obj, true, 1); + local Ani = obj.sq_GetThrowChargeAni(2); + obj.setCurrentAnimation(Ani); + obj.getVar("monster_enum").clear_vector(); + obj.getVar("monster_enum").push_vector(0); + obj.setTimeEvent(1001,900,1,false); + obj.sq_PlaySound("R_RING_DOMINATION_01"); + obj.getVar("map").setBool(0, false); + setEclipsehive_summoner_bykk(obj); + break; + case 1: + obj.sq_SetCurrentAnimation(68); + obj.setTimeEvent(1002,900,1,false); + break; + case 2: + RemoveAllAni_RingOfDomination(obj); + local direction = obj.getDirection();//嚙踝蕭嚙踝蕭菾嚙踝蕭 + local xpos = sq_GetDistancePos(obj.getXPos(), direction, 185);//嚙踝蕭嚙踝蕭菾嚙踝蕭嚙踝蕭pos + local ypos = obj.getYPos(); + onAddPooledObj_RingOfDomination(obj, "passiveobject/madeby_k_k/animation/ringofdomination/end/rodendringa_01.ani", xpos, ypos, ENUM_DRAWLAYER_NORMAL); + onAddPooledObj_RingOfDomination(obj, "passiveobject/madeby_k_k/animation/ringofdomination/end/rodendringb_01.ani", xpos, ypos, ENUM_DRAWLAYER_NORMAL); + local Ani = obj.sq_GetThrowShootAni(1); + obj.setCurrentAnimation(Ani); + obj.sq_PlaySound("WZ_RING_DOMINATION_02"); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED,SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + break; + case 20://嚙踝蕭?嚙?1 + local skillIndex = sq_GetVectorData(datas, 1); + obj.getVar("sm_skindex").clear_vector(); + obj.getVar("sm_skindex").push_vector(skillIndex); + local Ani = obj.sq_GetThrowChargeAni(2); + obj.setCurrentAnimation(Ani); + switch(skillIndex){ + case SKILL_BYKK_SUMMONAUXO: + obj.sq_PlaySound("WZ_INVOKE_AUXO"); + break; + case SKILL_BYKK_SUMMONHODOR: + obj.sq_PlaySound("WZ_INVOKE"); + break; + case SKILL_BYKK_SUMMONSANDOR: + obj.sq_PlaySound("WZ_INVOKE_SANDOR"); + break; + case SKILL_BYKK_SUMMONLUIS: + obj.sq_PlaySound("WZ_INVOKE_LUIS"); + break; + case SKILL_BYKK_SUMMONBABYDRAGON: + obj.sq_PlaySound("WZ_INVOKE_FREET"); + break; + case SKILL_BYKK_SUMMONKRUTA: + obj.sq_PlaySound("WZ_SUMMON_KRUTA"); + break; + case SKILL_BYKK_SUMMONCASILLAS: + obj.sq_PlaySound("WZ_CASILLAS"); + break; + case SKILL_BYKK_SUMMONRAMOS: + obj.sq_PlaySound("WZ_RAMOS"); + break; + } + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT,SPEED_VALUE_DEFAULT, 1.0, 1.0); + break; + case 21://嚙踝蕭?嚙?2 + local Ani = obj.sq_GetThrowShootAni(2); + obj.setCurrentAnimation(Ani); + local monster_level = sq_GetSkillLevel(obj, 174); + local monster_time = 3600000; + local skillIndex = obj.getVar("sm_skindex").get_vector(0); + switch(skillIndex){ + case SKILL_BYKK_SUMMONAUXO: + local skill = sq_GetSkill(obj, SKILL_BYKK_SUMMONAUXO); + local montser_id = MONSTER_ID_AUXO; + local subtype = 15; + if(skill.isSealFunction()){montser_id = MONSTER_ID_AUXOOLD; subtype = 5;} + local seedNumber = sq_GetLevelData(obj, SKILL_BYKK_SUMMONAUXO, 8, sq_GetSkillLevel(obj, SKILL_BYKK_SUMMONAUXO)); + summonmonster_mage_plus_Kwk(obj,obj,100,0,0,0,montser_id,monster_time,monster_level,0); + if(seedNumber > 0) createPassiveObject_k_k(obj,obj,45,subtype,100,0,70,0,0,0,0,0); + if(sq_GetLevelData(obj, SKILL_BYKK_SUMMONAUXO, 2, sq_GetSkillLevel(obj, SKILL_BYKK_SUMMONAUXO)) > 1){ + local num_max = sq_GetLevelData(obj, SKILL_BYKK_SUMMONAUXO, 2, sq_GetSkillLevel(obj, SKILL_BYKK_SUMMONAUXO)) - 1 + for(local i = 0; i < num_max; i++){ + local angle = 360 / num_max * (i + 1); + local x = (sq_Cos(sq_ToRadian(angle.tofloat())) * 100.0).tointeger(); + local y = (sq_Sin(sq_ToRadian(angle.tofloat())) * 50.0).tointeger(); + summonmonster_mage_plus_Kwk(obj,obj,x,y,0,0,montser_id,monster_time,monster_level,0); + if(seedNumber > 0) createPassiveObject_k_k(obj,obj,45,subtype,x,y,70,0,0,0,0,0); + } + } + // local skill02 = sq_GetSkill(obj, 45); + // local prob = obj.sq_GetIntData(45, 10); + // if(sq_getRandom(0,99) >= 100 - prob){ + // local subtype = 5; + // if(!skill02.isSealFunction()) subtype = 15; + // for(local i = 0; i < 6; i++){ + // createPassiveObject_k_k(obj,obj,45,subtype,100,0,70,0,0,0,0,0); + // } + // } + break; + case SKILL_BYKK_SUMMONHODOR: + summonmonster_mage_plus_Kwk(obj,obj,100,0,0,0,MONSTER_ID_HODOR,monster_time,monster_level,0); + if(sq_GetLevelData(obj, SKILL_BYKK_SUMMONHODOR, 2, sq_GetSkillLevel(obj, SKILL_BYKK_SUMMONHODOR)) > 1){ + local num_max = sq_GetLevelData(obj, SKILL_BYKK_SUMMONHODOR, 2, sq_GetSkillLevel(obj, SKILL_BYKK_SUMMONHODOR)) - 1 + for(local i = 0; i < num_max; i++){ + local angle = 360 / num_max * (i + 1); + local x = (sq_Cos(sq_ToRadian(angle.tofloat())) * 100.0).tointeger(); + local y = (sq_Sin(sq_ToRadian(angle.tofloat())) * 50.0).tointeger(); + summonmonster_mage_plus_Kwk(obj,obj,x,y,0,0,MONSTER_ID_HODOR,monster_time,monster_level,0); + } + } + break; + case SKILL_BYKK_SUMMONSANDOR: + summonmonster_mage_plus_Kwk(obj,obj,100,0,0,0,MONSTER_ID_SANDOR,monster_time,monster_level,0); + if(sq_GetLevelData(obj, SKILL_BYKK_SUMMONSANDOR, 2, sq_GetSkillLevel(obj, SKILL_BYKK_SUMMONSANDOR)) > 1){ + local num_max = sq_GetLevelData(obj, SKILL_BYKK_SUMMONSANDOR, 2, sq_GetSkillLevel(obj, SKILL_BYKK_SUMMONSANDOR)) - 1 + for(local i = 0; i < num_max; i++){ + local angle = 360 / num_max * (i + 1); + local x = (sq_Cos(sq_ToRadian(angle.tofloat())) * 100.0).tointeger(); + local y = (sq_Sin(sq_ToRadian(angle.tofloat())) * 50.0).tointeger(); + summonmonster_mage_plus_Kwk(obj,obj,x,y,0,0,MONSTER_ID_SANDOR,monster_time,monster_level,0); + } + } + break; + case SKILL_BYKK_SUMMONLUIS: + summonmonster_mage_plus_Kwk(obj,obj,100,0,0,0,MONSTER_ID_LUIS,monster_time,monster_level,0); + if(sq_GetIntData(obj, SKILL_BYKK_BLACKLUNATIC, 50) > 0){ + summonmonster_mage_plus_Kwk(obj,obj,145,0,0,0,MONSTER_ID_LUIS,monster_time,monster_level,0); + break; + } + if(sq_GetLevelData(obj, SKILL_BYKK_SUMMONLUIS, 2, sq_GetSkillLevel(obj, SKILL_BYKK_SUMMONLUIS)) > 1){ + local num_max = sq_GetLevelData(obj, SKILL_BYKK_SUMMONLUIS, 2, sq_GetSkillLevel(obj, SKILL_BYKK_SUMMONLUIS)) - 1 + for(local i = 0; i < num_max; i++){ + local angle = 360 / num_max * (i + 1); + local x = (sq_Cos(sq_ToRadian(angle.tofloat())) * 100.0).tointeger(); + local y = (sq_Sin(sq_ToRadian(angle.tofloat())) * 50.0).tointeger(); + summonmonster_mage_plus_Kwk(obj,obj,145 + i * 45,y,0,0,MONSTER_ID_LUIS,monster_time,monster_level,0); + } + } + break; + case SKILL_BYKK_SUMMONBABYDRAGON: + summonmonster_mage_plus_Kwk(obj,obj,100,0,0,0,MONSTER_ID_BABYDRAGON,monster_time,monster_level,0); + if(sq_GetLevelData(obj, SKILL_BYKK_SUMMONBABYDRAGON, 2, sq_GetSkillLevel(obj, SKILL_BYKK_SUMMONBABYDRAGON)) > 1){ + local num_max = sq_GetLevelData(obj, SKILL_BYKK_SUMMONBABYDRAGON, 2, sq_GetSkillLevel(obj, SKILL_BYKK_SUMMONBABYDRAGON)) - 1 + for(local i = 0; i < num_max; i++){ + local angle = 360 / num_max * (i + 1); + local x = (sq_Cos(sq_ToRadian(angle.tofloat())) * 100.0).tointeger(); + local y = (sq_Sin(sq_ToRadian(angle.tofloat())) * 50.0).tointeger(); + summonmonster_mage_plus_Kwk(obj,obj,x,y,0,0,MONSTER_ID_BABYDRAGON,monster_time,monster_level,0); + } + } + break; + case SKILL_BYKK_SUMMONKRUTA: + summonmonster_mage_plus_Kwk(obj,obj,100,0,0,0,MONSTER_ID_KRUTA,monster_time,monster_level,0); + //print(sq_GetLevelData(obj, SKILL_BYKK_SUMMONKRUTA, 2, sq_GetSkillLevel(obj, SKILL_BYKK_SUMMONKRUTA))); + if(sq_GetLevelData(obj, SKILL_BYKK_SUMMONKRUTA, 2, sq_GetSkillLevel(obj, SKILL_BYKK_SUMMONKRUTA)) > 1){ + local num_max = sq_GetLevelData(obj, SKILL_BYKK_SUMMONKRUTA, 2, sq_GetSkillLevel(obj, SKILL_BYKK_SUMMONKRUTA)) - 1 + for(local i = 0; i < num_max; i++){ + local angle = 360 / num_max * (i + 1); + local x = (sq_Cos(sq_ToRadian(angle.tofloat())) * 100.0).tointeger(); + local y = (sq_Sin(sq_ToRadian(angle.tofloat())) * 50.0).tointeger(); + summonmonster_mage_plus_Kwk(obj,obj,x,y,0,0,MONSTER_ID_KRUTA,monster_time,monster_level,0); + } + } + break; + case SKILL_BYKK_SUMMONCASILLAS: + summonmonster_mage_plus_Kwk(obj,obj,100,0,0,6,MONSTER_ID_CASILLAS,monster_time,monster_level,0); + if(sq_GetLevelData(obj, SKILL_BYKK_SUMMONCASILLAS, 2, sq_GetSkillLevel(obj, SKILL_BYKK_SUMMONCASILLAS)) > 1){ + for(local i = 0; i < sq_GetLevelData(obj, SKILL_BYKK_SUMMONCASILLAS, 2, sq_GetSkillLevel(obj, SKILL_BYKK_SUMMONCASILLAS)) - 1; i++){ + summonmonster_mage_plus_Kwk(obj,obj,145 + i * 45,0,0,0,MONSTER_ID_CASILLAS,monster_time,monster_level,0); + } + } + break; + case SKILL_BYKK_SUMMONRAMOS: + createPassiveObject_k_k(obj,obj,SKILL_BYKK_SUMMONRAMOS,200,100,0,0,0,0,0,0,0); + break; + } + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT,SPEED_VALUE_DEFAULT, 2.0, 2.0); + break; + case 22://嚙踝蕭?嚙?1 + local skillIndex = sq_GetVectorData(datas, 1); + obj.getVar("sm_skindex").clear_vector(); + obj.getVar("sm_skindex").push_vector(skillIndex); + local Ani = obj.sq_GetThrowChargeAni(3); + obj.setCurrentAnimation(Ani); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT,SPEED_VALUE_DEFAULT, 2.0, 2.0); + break; + case 23://嚙踝蕭?嚙?2 + local Ani = obj.sq_GetThrowShootAni(3); + obj.setCurrentAnimation(Ani); + local skillIndex = obj.getVar("sm_skindex").get_vector(0); + local monster_level = sq_GetSkillLevel(obj, 174); + local monster_time = 3600000; + local montser_id = MONSTER_ID_ECHEVERRA; + local summonsub = 0; + switch(skillIndex){ + case SKILL_BYKK_SUMMONECHEVERRA: + obj.sq_PlaySound("WZ_INVOKE_ECHEVERRA"); + break; + case SKILL_BYKK_SUMMONSPIRITDARKHIGHER: + obj.sq_PlaySound("WZ_SUMMON_DMURKER"); + montser_id = MONSTER_ID_DARKHIGHERSPIRIT; + break; + case SKILL_BYKK_SUMMONSPIRITFIREHIGHER: + obj.sq_PlaySound("WZ_SUMMON_FHULK"); + montser_id = MONSTER_ID_FIREHIGHERSPIRIT; + break; + case SKILL_BYKK_SUMMONSPIRITLIGHTHIGHER: + obj.sq_PlaySound("WZ_SUMMON_GLARINE"); + montser_id = MONSTER_ID_LIGHTHIGHERSPIRIT; + break; + case SKILL_BYKK_SUMMONSPIRITWATERHIGHER: + obj.sq_PlaySound("WZ_SUMMON_AQUARESS"); + montser_id = MONSTER_ID_WATERHIGHERSPIRIT; + break; + case SKILL_BYKK_SUMMONHEILROM: + obj.sq_PlaySound("WZ_SUMMON_HEILROM"); + montser_id = MONSTER_ID_HEILROM; + break; + case SKILL_BYKK_SUMMONSPIRITFIRE: + obj.sq_PlaySound("WZ_SUMMON_ADOR"); + montser_id = MONSTER_ID_SPIRITFIRE; + summonsub = 1; + break; + case SKILL_BYKK_SUMMONSPIRITWATER: + obj.sq_PlaySound("WZ_SUMMON_NIAS"); + montser_id = MONSTER_ID_SPIRITWATER; + summonsub = 2; + break; + case SKILL_BYKK_SUMMONSPIRITDARK: + obj.sq_PlaySound("WZ_SUMMON_STALKER"); + montser_id = MONSTER_ID_SPIRITDARK; + summonsub = 3; + break; + case SKILL_BYKK_SUMMONSPIRITLIGHT: + obj.sq_PlaySound("WZ_SUMMON_WISP"); + montser_id = MONSTER_ID_SPIRITLIGHT; + summonsub = 4; + break; + } + local sizeRate = obj.sq_GetIntData(skillIndex, 5).tofloat() / 490.0; + for(local i = 1; i < 5; i++){ + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/summonspirit"+i.tostring()+".ani", 0, -1, -1); + local currentAni = pooledObj.getCurrentAnimation(); + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + } + summonmonster_mage_plus_Kwk(obj,obj,100,0,0,summonsub,montser_id,monster_time,monster_level,0); + + switch(skillIndex){ + case SKILL_BYKK_SUMMONECHEVERRA: + case SKILL_BYKK_SUMMONSPIRITDARKHIGHER: + case SKILL_BYKK_SUMMONSPIRITFIREHIGHER: + case SKILL_BYKK_SUMMONSPIRITLIGHTHIGHER: + case SKILL_BYKK_SUMMONSPIRITWATERHIGHER: + local skill_level = sq_GetSkillLevel(obj, skillIndex); + if(sq_GetLevelData(obj, skillIndex, 2, skill_level) > 1){ + local num_max = sq_GetLevelData(obj, skillIndex, 2, skill_level) - 1 + for(local i = 0; i < num_max; i++){ + local angle = 360 / num_max * (i + 1); + local x = (sq_Cos(sq_ToRadian(angle.tofloat())) * 100.0).tointeger(); + local y = (sq_Sin(sq_ToRadian(angle.tofloat())) * 50.0).tointeger(); + summonmonster_mage_plus_Kwk(obj,obj,x,y,0,0,montser_id,monster_time,monster_level,0); + } + } + break; + case SKILL_BYKK_SUMMONSPIRITFIRE: + local skill_level1 = sq_GetSkillLevel(obj, 51); + local skill_level2 = sq_GetSkillLevel(obj, SKILL_BYKK_SUMMONSPIRITFIRE); + local number = sq_GetLevelData(obj, 51, 9, skill_level1); + local min_level = sq_GetLevelData(obj, 51, 10, skill_level1); + if(skill_level2 >= min_level){ + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 36) < 1){ + for(local i = 0; i < number; i++){ + summonmonster_mage_plus_Kwk(obj,obj,100 + (i + 1) * 40,0,0,summonsub,montser_id,monster_time,monster_level,0); + } + } + } + local skill_level = sq_GetSkillLevel(obj, skillIndex); + local add_number = sq_GetLevelData(obj, skillIndex, 2, skill_level); + if(add_number > 1){ + for(local i = 0; i < add_number - 1; i++){ + local angle = 360 / add_number * (i + 1); + local x = (sq_Cos(sq_ToRadian(angle.tofloat())) * 100.0).tointeger(); + local y = (sq_Sin(sq_ToRadian(angle.tofloat())) * 50.0).tointeger(); + summonmonster_mage_plus_Kwk(obj,obj,x,y,0,summonsub,montser_id,monster_time,monster_level,0); + } + } + break; + case SKILL_BYKK_SUMMONSPIRITWATER: + local skill_level1 = sq_GetSkillLevel(obj, 52); + local skill_level2 = sq_GetSkillLevel(obj, SKILL_BYKK_SUMMONSPIRITWATER); + local number = sq_GetLevelData(obj, 52, 5, skill_level1); + local min_level = sq_GetLevelData(obj, 52, 6, skill_level1); + if(skill_level2 >= min_level){ + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 36) < 1){ + for(local i = 0; i < number; i++){ + summonmonster_mage_plus_Kwk(obj,obj,100 + (i + 1) * 40,0,0,summonsub,montser_id,monster_time,monster_level,0); + } + } + } + local skill_level = sq_GetSkillLevel(obj, skillIndex); + local add_number = sq_GetLevelData(obj, skillIndex, 2, skill_level); + if(add_number > 1){ + for(local i = 0; i < add_number - 1; i++){ + local angle = 360 / add_number * (i + 1); + local x = (sq_Cos(sq_ToRadian(angle.tofloat())) * 100.0).tointeger(); + local y = (sq_Sin(sq_ToRadian(angle.tofloat())) * 50.0).tointeger(); + summonmonster_mage_plus_Kwk(obj,obj,x,y,0,summonsub,montser_id,monster_time,monster_level,0); + } + } + break; + case SKILL_BYKK_SUMMONSPIRITDARK: + local skill_level1 = sq_GetSkillLevel(obj, 53); + local skill_level2 = sq_GetSkillLevel(obj, SKILL_BYKK_SUMMONSPIRITDARK); + local number = sq_GetLevelData(obj, 53, 6, skill_level1); + local min_level = sq_GetLevelData(obj, 53, 7, skill_level1); + if(skill_level2 >= min_level){ + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 36) < 1){ + for(local i = 0; i < number; i++){ + summonmonster_mage_plus_Kwk(obj,obj,100 + (i + 1) * 40,0,0,summonsub,montser_id,monster_time,monster_level,0); + } + } + } + local skill_level = sq_GetSkillLevel(obj, skillIndex); + local add_number = sq_GetLevelData(obj, skillIndex, 2, skill_level); + if(add_number > 1){ + for(local i = 0; i < add_number - 1; i++){ + local angle = 360 / add_number * (i + 1); + local x = (sq_Cos(sq_ToRadian(angle.tofloat())) * 100.0).tointeger(); + local y = (sq_Sin(sq_ToRadian(angle.tofloat())) * 50.0).tointeger(); + summonmonster_mage_plus_Kwk(obj,obj,x,y,0,summonsub,montser_id,monster_time,monster_level,0); + } + } + break; + case SKILL_BYKK_SUMMONSPIRITLIGHT: + local skill_level1 = sq_GetSkillLevel(obj, 54); + local skill_level2 = sq_GetSkillLevel(obj, SKILL_BYKK_SUMMONSPIRITLIGHT); + local number = sq_GetLevelData(obj, 54, 6, skill_level1); + local min_level = sq_GetLevelData(obj, 54, 7, skill_level1); + if(skill_level2 >= min_level){ + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 36) < 1){ + for(local i = 0; i < number; i++){ + summonmonster_mage_plus_Kwk(obj,obj,100 + (i + 1) * 40,0,0,summonsub,montser_id,monster_time,monster_level,0); + } + } + } + local skill_level = sq_GetSkillLevel(obj, skillIndex); + local add_number = sq_GetLevelData(obj, skillIndex, 2, skill_level); + if(add_number > 1){ + for(local i = 0; i < add_number - 1; i++){ + local angle = 360 / add_number * (i + 1); + local x = (sq_Cos(sq_ToRadian(angle.tofloat())) * 100.0).tointeger(); + local y = (sq_Sin(sq_ToRadian(angle.tofloat())) * 50.0).tointeger(); + summonmonster_mage_plus_Kwk(obj,obj,x,y,0,summonsub,montser_id,monster_time,monster_level,0); + } + } + break; + } + break; + case 31: + local Ani = obj.sq_GetThrowChargeAni(3); + obj.setCurrentAnimation(Ani); + break; + case 32: + local Ani = obj.sq_GetThrowShootAni(3); + obj.setCurrentAnimation(Ani); + break; + } +} + +function onProcCon_RingOfDomination(obj) +{ + if(!obj) return; + + local substate = obj.getSkillSubState(); + if(substate <= 1){ + if(sq_IsKeyDown(OPTION_HOTKEY_JUMP, ENUM_SUBKEY_TYPE_ALL)){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(SKILL_BYKK_RINGOFDOMINATION, STATE_PRIORITY_IGNORE_FORCE, true); + } + } +} + +function onEndCurrentAni_RingOfDomination(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_RINGOFDOMINATION, STATE_PRIORITY_USER, true); + break; + case 1: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(SKILL_BYKK_RINGOFDOMINATION, STATE_PRIORITY_USER, true); + break; + case 2: + sq_SetCustomDamageType(obj, true, 0); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + case 20: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(21); + obj.sq_AddSetStatePacket(SKILL_BYKK_RINGOFDOMINATION, STATE_PRIORITY_USER, true); + break; + case 21: + case 23: + case 32: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + case 22: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(23); + obj.sq_AddSetStatePacket(SKILL_BYKK_RINGOFDOMINATION, STATE_PRIORITY_USER, true); + break; + case 31: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(32); + obj.sq_AddSetStatePacket(SKILL_BYKK_RINGOFDOMINATION, STATE_PRIORITY_USER, true); + break; + } +} + +function onEndState_RingOfDomination(obj, new_state) +{ + if(!obj) return; + if(new_state != SKILL_BYKK_RINGOFDOMINATION){ + RemoveAllAni_RingOfDomination(obj); + sq_SetCustomDamageType(obj, true, 0); + } +} + +function onTimeEvent_RingOfDomination(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + + if(!obj.isMyControlObject()) return false; + + if(timeEventIndex == 1001){ + local direction = obj.getDirection();//嚙踝蕭嚙踝蕭菾嚙踝蕭 + local xpos = sq_GetDistancePos(obj.getXPos(), direction, 185);//嚙踝蕭嚙踝蕭菾嚙踝蕭嚙踝蕭pos + local ypos = obj.getYPos(); + local pooledobj_01 = onAddPooledObj_RingOfDomination(obj, "passiveobject/madeby_k_k/animation/ringofdomination/loop/rodloopringa_01.ani", xpos, ypos, ENUM_DRAWLAYER_COVER); + local pooledobj_02 = onAddPooledObj_RingOfDomination(obj, "passiveobject/madeby_k_k/animation/ringofdomination/loop/rodloopringb_01.ani", xpos, ypos, ENUM_DRAWLAYER_NORMAL); + local pooledobj_03 = onAddPooledObj_RingOfDomination(obj, "passiveobject/madeby_k_k/animation/ringofdomination/loop/rodsummoneffa_01.ani", xpos, ypos, ENUM_DRAWLAYER_NORMAL); + local pooledobj_04 = onAddPooledObj_RingOfDomination(obj, "passiveobject/madeby_k_k/animation/ringofdomination/loop/rodsummoneffb_01.ani", xpos, ypos, ENUM_DRAWLAYER_NORMAL); + local pooledobj_05 = onAddPooledObj_RingOfDomination(obj, "passiveobject/madeby_k_k/animation/ringofdomination/loop/rodsummonefffloor_01.ani", xpos, ypos, ENUM_DRAWLAYER_NORMAL); + obj.getVar("aniobj").clear_obj_vector(); + obj.getVar("aniobj").push_obj_vector(pooledobj_01); + obj.getVar("aniobj").push_obj_vector(pooledobj_02); + obj.getVar("aniobj").push_obj_vector(pooledobj_03); + obj.getVar("aniobj").push_obj_vector(pooledobj_04); + obj.getVar("aniobj").push_obj_vector(pooledobj_05); + + local skill_Id = [44,45,46,47,76,77,78,79,80,121,119,82,25,122,23,21,24,22]; + local monster_Id = [MONSTER_ID_SANDOR,MONSTER_ID_AUXO,MONSTER_ID_LUIS,MONSTER_ID_ECHEVERRA,MONSTER_ID_DARKHIGHERSPIRIT,MONSTER_ID_LIGHTHIGHERSPIRIT,MONSTER_ID_WATERHIGHERSPIRIT,MONSTER_ID_FIREHIGHERSPIRIT,MONSTER_ID_BABYDRAGON,MONSTER_ID_KRUTA,MONSTER_ID_HEILROM,MONSTER_ID_CASILLAS,MONSTER_ID_HODOR,MONSTER_ID_RAMOS,MONSTER_ID_SPIRITDARK,MONSTER_ID_SPIRITFIRE,MONSTER_ID_SPIRITLIGHT,MONSTER_ID_SPIRITWATER]; + local monster_Name = ["SandorObj","AuxoObj","LuisObj","EcheverraObj","DarkhigherspiritObj","LighthigherspiritObj","WaterhigherspiritObj","FirehigherspiritObj","BabydragonObj","KrutaObj","HeilromObj","CassillasObj","HodorObj","RamosObj","SpiritDarkObj","SpiritFireObj","SpiritLightObj","SpiritWaterObj"]; + if(sq_GetLevelData(obj, 45, 8, sq_GetSkillLevel(obj, 45)) > 0){ + local monster_Name = ["AuxoObj","LuisObj","HeilromObj","CassillasObj","RamosObj"]; + } + + for(local i = 0;i < monster_Id.len(); i++){ + local skill_level = sq_GetSkillLevel(obj, skill_Id[i]); + //print(monster_Name[i]+",level = "+skill_level); + local limit_level = sq_GetLevelData(obj, SKILL_BYKK_RINGOFDOMINATION, 2, sq_GetSkillLevel(obj, SKILL_BYKK_RINGOFDOMINATION)); + if(skill_Id[i] == 122) limit_level = 0; + if(skill_level > limit_level){ + local subtype = 15; + if(skill_Id[i] == 45 && sq_GetSkill(obj, 45).isSealFunction()){monster_Id[i] = MONSTER_ID_AUXOOLD; subtype = 5;} + local obj_Monster = obj.getVar(monster_Name[i]).get_obj_vector(0); + if(!obj_Monster){ + local monster_level = sq_GetSkillLevel(obj, 174); + local monster_time = 3600000; + local monster_Num = obj.sq_GetLevelData(skill_Id[i], 2, skill_level); + if(skill_Id[i] == 122) monster_Num = 1; + else if(skill_Id[i] == 47 && sq_GetLevelData(obj,SKILL_BYKK_SUMMONECHEVERRA, 0, skill_level) > 0 && monster_Num == 1) monster_Num = 2; + else if(skill_Id[i] == 46 && sq_GetIntData(obj, SKILL_BYKK_BLACKLUNATIC, 50) > 0) monster_Num = 2; + else if(skill_Id[i] == 23 && sq_GetSkillLevel(obj, 53) > 0 && sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 36) < 1) monster_Num = 3; + else if(skill_Id[i] == 21 && sq_GetSkillLevel(obj, 51) > 0 && sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 36) < 1) monster_Num = 3; + else if(skill_Id[i] == 24 && sq_GetSkillLevel(obj, 54) > 0 && sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 36) < 1) monster_Num = 3; + else if(skill_Id[i] == 22 && sq_GetSkillLevel(obj, 52) > 0 && sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 36) < 1) monster_Num = 3; + + // if((skill_Id[i] == 21 || skill_Id[i] == 22 || skill_Id[i] == 23 || skill_Id[i] == 24) && sq_GetLevelData(obj, skill_Id[i], 2, sq_GetSkillLevel(obj, skill_Id[i])) > 1){ + // monster_Num = monster_Num + sq_GetLevelData(obj, skill_Id[i], 2, sq_GetSkillLevel(obj, skill_Id[i])) - 1; + // print(monster_Num); + // } + local seedNumber = sq_GetLevelData(obj, SKILL_BYKK_SUMMONAUXO, 8, sq_GetSkillLevel(obj, SKILL_BYKK_SUMMONAUXO)); + summonmonster_mage_plus_Kwk(obj,obj,190,0,0,0,monster_Id[i],monster_time,monster_level,0); + if(monster_Num >= 2){ + for(local ac = 0;ac < monster_Num - 1; ac++){ + summonmonster_mage_plus_Kwk(obj,obj,190 + (ac + 1) * 40,0,0,0,monster_Id[i],monster_time,monster_level,0); + if(skill_Id[i] == 45){ + if(seedNumber > 0) createPassiveObject_k_k(obj,obj,45,subtype,190 + (ac + 1) * 40,0,70,0,0,0,0,0); + } + } + } + } + } + } + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 26) > 0){ + summonmonster_mage_plus_Kwk(obj,obj,190,0,0,0,MONSTER_ID_DARKHIGHERSPIRIT + sq_getRandom(0, 3),3600000,sq_GetSkillLevel(obj, 174),0); + } + } + + if(timeEventIndex == 1002){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(SKILL_BYKK_RINGOFDOMINATION, STATE_PRIORITY_USER, true); + } + return true; +} + +function onAddPooledObj_RingOfDomination(obj, aniPath, x, y, abc) +{ + local ani = sq_CreateAnimation("",aniPath); + local pooledObj = sq_CreatePooledObject(ani,true); + sq_SetCurrentDirection(pooledObj, obj.getDirection()); + pooledObj.setCurrentPos(x,y,0); + pooledObj = sq_SetEnumDrawLayer(pooledObj, abc); + sq_AddObject(obj, pooledObj, OBJECTTYPE_DRAWONLY, false); + + return pooledObj; +} + +function RemoveAllAni_RingOfDomination(obj) +{ + local objVar = obj.getVar("aniobj"); + local size = objVar.get_obj_vector_size(); + for(local i=0;i 0) obj_kruta.getVar("skillIndex").set_vector(0,11); + else obj_kruta.getVar("skillIndex").set_vector(0, 7); + monsterattack_ksk(obj_kruta,13); + } + } + break; + } +} + +function checkExecutableSkill_MoonShadow(obj) +{ + if(!obj) return false; + if(sq_GetIntData(obj, SKILL_BYKK_ECLIPSEHIVE, 16) > 0) return true; + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_MOONSHADOW); + if(b_useskill){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_MOONSHADOW, STATE_PRIORITY_USER, true); + return true; + } + return false; +} + +function checkCommandEnable_MoonShadow(obj) +{ + if(!obj) return false; + local state = obj.sq_GetState(); + if(state == STATE_STAND) return true; + if(state == STATE_ATTACK){ + return obj.sq_IsCommandEnable(SKILL_BYKK_MOONSHADOW); + } + return true; +} + +function onSetState_MoonShadow(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + local Ani = obj.sq_GetThrowChargeAni(2); + obj.setCurrentAnimation(Ani); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_MOONSHADOW); + local castTime = sq_GetCastTime(obj, SKILL_BYKK_MOONSHADOW, skill_level); + sq_StartDrawCastGauge(obj, castTime, true); + break; + case 1: + local Ani = obj.sq_GetThrowShootAni(2); + obj.setCurrentAnimation(Ani); + obj.sq_PlaySound("WZ_MOONSHADOW"); + local skill_level = sq_GetSkillLevel(obj,SKILL_BYKK_MOONSHADOW); + local attacknumber = sq_GetIntData(obj, SKILL_BYKK_MOONSHADOW, 7); + local time = sq_GetLevelData(obj,SKILL_BYKK_MOONSHADOW, 1, skill_level); + // obj.getVar("moonshadow").clear_vector(); + // obj.getVar("moonshadow").push_vector(attacknumber); + local monsternumber = 0; + obj.sq_AddSkillLoad(SKILL_BYKK_MOONSHADOW, 139, attacknumber, time); + local monster_Name = ["SandorObj","AuxoObj","LuisObj","EcheverraObj","DarkhigherspiritObj","LighthigherspiritObj","WaterhigherspiritObj","FirehigherspiritObj","BabydragonObj","KrutaObj","HeilromObj","CassillasObj","HodorObj","RamosObj","SpiritDarkObj","SpiritFireObj","SpiritLightObj","SpiritWaterObj"]; + for(local ui = 0; ui < monster_Name.len(); ui++){ + local number = obj.getVar(monster_Name[ui]).get_obj_vector_size(); + // print(monster_Name[ui]+" = "+number); + if(number > 0){ + for(local pi = 0; pi < number; pi++){ + local monsterObj = sq_GetCNRDObjectToActiveObject(obj.getVar(monster_Name[ui]).get_obj_vector(pi)); + if(monsterObj){ + local group = sq_GetGroup(monsterObj); + local uniqueId = sq_GetUniqueId(monsterObj); + createPassiveObject_k_k(obj,monsterObj,SKILL_BYKK_MOONSHADOW,1,0,0,0,0,time,group,uniqueId,0); + } + } + monsternumber = monsternumber + number; + } + } + // print("monsternumber = "+monsternumber); + if(monsternumber > 0) obj.sq_PlaySound("MOONSHADOW"); + if(monsternumber <= 0) obj.sq_RemoveSkillLoad(SKILL_BYKK_MOONSHADOW); + obj.getVar("time").clear_ct_vector(); + obj.getVar("time").push_ct_vector(); + local timer = obj.getVar("time").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); + break; + } +} + +function onEndCurrentAni_MoonShadow(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_MOONSHADOW, STATE_PRIORITY_USER, true); + break; + case 1: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onEndState_MoonShadow(obj, new_state) +{ + if(!obj) return; + if(new_state != SKILL_BYKK_MOONSHADOW){ + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + } +} + +function checkExecutableSkill_MassTeleport(obj) +{ + if (!obj) return false; + local isUse = obj.sq_IsUseSkill(SKILL_BYKK_MASSTELEPORT); + if (isUse){ + obj.sq_AddSetStatePacket(SKILL_BYKK_MASSTELEPORT , STATE_PRIORITY_USER, false); + return true; + } + + return false; +} + + +function checkCommandEnable_MassTeleport(obj) +{ + if (!obj) return false; + local state = obj.sq_GetState(); + if (state == STATE_STAND) + return true; + if(state == STATE_ATTACK){ + return obj.sq_IsCommandEnable(SKILL_BYKK_MASSTELEPORT); + } + return true; +} + + +function onSetState_MassTeleport(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + obj.sq_SetCurrentAnimation(68);//68 + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED,SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + local monster_Name = ["SandorObj","AuxoObj","LuisObj","EcheverraObj","DarkhigherspiritObj","LighthigherspiritObj","WaterhigherspiritObj","FirehigherspiritObj","BabydragonObj","KrutaObj","HeilromObj","CassillasObj","HodorObj","RamosObj","SpiritDarkObj","SpiritFireObj","SpiritLightObj","SpiritWaterObj"]; + + for(local i = 0;i < monster_Name.len(); i++){ + local number = obj.getVar(monster_Name[i]).get_obj_vector_size(); + if(number > 0){ + for(local ui = 0; ui < number; ui++){ + local monsterObj = sq_GetCNRDObjectToActiveObject(obj.getVar(monster_Name[i]).get_obj_vector(ui)); + if(monsterObj){ + local yPos = obj.getYPos(); + local xPos = sq_GetDistancePos(obj.getXPos(), obj.getDirection(), 100); + sq_MoveToNearMovablePos(monsterObj, xPos, yPos, 0, xPos, yPos, 0, 100, -1, 5); + } + } + } + } +} + +function onEndCurrentAni_MassTeleport(obj) +{ + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); +} + +function checkExecutableSkill_BugFall(obj) +{ + if(!obj) return false; + + local RamosObj = obj.getVar("RamosObj").get_obj_vector_size(); + if(RamosObj > 0){ + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_BUGFALL); + if(b_useskill){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_BUGFALL, STATE_PRIORITY_USER, true); + return true; + } + } + else if(obj.isMessage()){ + sq_AddMessage(71099); + } + return false; +} + +function checkCommandEnable_BugFall(obj) +{ + if(!obj) return false; + local state = obj.sq_GetState(); + if(state == STATE_STAND) return true; + if(state == STATE_ATTACK){ + return obj.sq_IsCommandEnable(SKILL_BYKK_BUGFALL); + } + return true; +} + +function onSetState_BugFall(obj, state, datas, isResetTimer) +{ + if(!obj) return; + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + obj.sq_StopMove(); + local Ani = obj.sq_GetThrowChargeAni(3); + obj.setCurrentAnimation(Ani); + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_BUGFALL); + local castTime = sq_GetCastTime(obj, SKILL_BYKK_BUGFALL, skill_level); + obj.getVar("caseTimE").clear_vector(); + obj.getVar("caseTimE").push_vector(castTime); + sq_StartDrawCastGauge(obj, castTime, true); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED,SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + break; + case 1: + obj.sq_StopMove(); + local Ani = obj.sq_GetThrowShootAni(3); + obj.setCurrentAnimation(Ani); + local monsternum = obj.getVar("RamosObj").get_obj_vector_size(); + for(local i = 0; i < monsternum; i++){ + local monsterObj = sq_GetCNRDObjectToActiveObject(obj.getVar("RamosObj").get_obj_vector(i)); + if(monsterObj){ + monsterObj.getVar("skill").setBool(0,true); + monsterattack_ksk(monsterObj,17); + } + } + break; + } +} + +function onEndCurrentAni_BugFall(obj) +{ + if(!obj) return; + local substate = obj.getSkillSubState(); + obj.setSkillSubState(substate); + switch(substate){ + case 1: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onEndState_BugFall(obj, new_state) +{ + if(!obj) return; + if(new_state != 139) + sq_EndDrawCastGauge(obj); +} + +function onProcCon_BugFall(obj) +{ + if(!obj) return; + local substate = obj.getSkillSubState(); + local casttime = obj.getVar("caseTimE").get_vector(0); + if(substate == 0){ + if(obj.sq_GetStateTimer() >= casttime){ + sq_EndDrawCastGauge(obj); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_BUGFALL, STATE_PRIORITY_USER, true); + } + } +} + + + +//種花人 +function procSkill_zhonghuaren(obj) +{ + if(sq_GetLevelData(obj, 45, 8, sq_GetSkillLevel(obj, 45)) < 1) return; + obj.setSkillCommandEnable(137, false); + obj.setSkillCommandEnable(80, false); + obj.setSkillCommandEnable(47, false); + obj.setSkillCommandEnable(25, false); + obj.setSkillCommandEnable(121, false); + obj.setSkillCommandEnable(44, false); + obj.setSkillCommandEnable(118, false); + obj.setSkillCommandEnable(21, false); + obj.setSkillCommandEnable(22, false); + obj.setSkillCommandEnable(23, false); + obj.setSkillCommandEnable(24, false); + obj.setSkillCommandEnable(76, false); + obj.setSkillCommandEnable(77, false); + obj.setSkillCommandEnable(78, false); + obj.setSkillCommandEnable(79, false); +} + +/////////////////////////summoner_end + + +/////////////////////////witch + + +function cearteSkillPassive_Witch_bykk(obj,passiveObj,objnum,x,y,z,direction,skillIndex,subtype,pushv1,pushv2,pushv3,pushv4,pushv5,pushv6,pushv7,pushv8,bonusnum) +{ + if(!obj || !passiveObj) return; + if(pushv1 == null) pushv1 = 0; + if(pushv2 == null) pushv2 = 0; + if(pushv3 == null) pushv3 = 0; + if(pushv4 == null) pushv4 = 0; + if(pushv5 == null) pushv5 = 0; + if(pushv6 == null) pushv6 = 0; + if(pushv7 == null) pushv7 = 0; + if(pushv8 == null) pushv8 = 0; + if(bonusnum > 0){ + local bonusRate = 1.0;//obj.getVar("witchs_bonusRate").get_vector(0).tofloat() / 1000.0; + // print("bonusRate1 = "+bonusRate); + local homunculus_level = sq_GetSkillLevel(obj, SKILL_BYKK_HOMUNCULUS); + if(homunculus_level > 0){ + local bonusrate2 = sq_GetLevelData(obj, SKILL_BYKK_HOMUNCULUS, 6, homunculus_level); + local bonus_skillIndex = [SKILL_BYKK_ENHANCEDMAGICMISSILE,SKILL_BYKK_BLACKMANTLE,SKILL_BYKK_TRANSFORMFLAPPER,SKILL_BYKK_TRANSFORMFLAPPEREX,SKILL_BYKK_LOLLIPOPCRUSH,SKILL_BYKK_UROBOROS,SKILL_BYKK_ELECTRICRABBIT,SKILL_BYKK_JACKFROSTICEWATER,SKILL_BYKK_JACKOHALLOWEEN]; + for(local i = 0; i < bonus_skillIndex.len(); i++){ + if(skillIndex == bonus_skillIndex[i]){bonusRate = bonusRate + bonusrate2.tofloat() / 1000;break;} + } + } + // print("bonusRate2 = "+bonusRate); + local lapisphilosophorum_level = sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM); + if(lapisphilosophorum_level > 0){ + local bonusrate3 = sq_GetLevelData(obj, SKILL_BYKK_LAPISPHILOSOPHORUM, 16, lapisphilosophorum_level); + local bonus_skillIndex2 = [SKILL_BYKK_ACIDCLOUD,SKILL_BYKK_ANTIGRAVITYSTARTER,SKILL_BYKK_ELECTRICRABBIT,SKILL_BYKK_ENHANCEDMAGICMISSILE,SKILL_BYKK_FLUORECOLLIDER,SKILL_BYKK_HEATINGFURNACE,SKILL_BYKK_LAVAPOTION,SKILL_BYKK_MEGADRILL,SKILL_BYKK_TRANSFORMFLAPPER,SKILL_BYKK_TRANSFORMFLAPPEREX]; + local success_num = [pushv4,pushv3,pushv1,pushv2,pushv3,pushv2,pushv5,pushv1,pushv6,pushv3]; + for(local i = 0; i < bonus_skillIndex2.len(); i++){ + if(skillIndex == bonus_skillIndex2[i]){ + if(bonus_skillIndex2[i] == SKILL_BYKK_ACIDCLOUD && sq_GetSkillLevel(obj, SKILL_BYKK_REDCANDY) > 0){bonusRate = bonusRate + bonusrate3.tofloat() / 1000;break;} + if(success_num[i] >= 1){bonusRate = bonusRate + bonusrate3.tofloat() / 1000;break;} + } + } + } + // print("bonusRate3 = "+bonusRate); + switch (bonusnum) { + case 1: pushv1 = (pushv1.tofloat() * bonusRate).tointeger(); break; + case 2: pushv2 = (pushv2.tofloat() * bonusRate).tointeger(); break; + case 3: pushv3 = (pushv3.tofloat() * bonusRate).tointeger(); break; + case 4: pushv4 = (pushv4.tofloat() * bonusRate).tointeger(); break; + case 5: pushv5 = (pushv5.tofloat() * bonusRate).tointeger(); break; + case 6: pushv6 = (pushv6.tofloat() * bonusRate).tointeger(); break; + case 7: pushv7 = (pushv7.tofloat() * bonusRate).tointeger(); break; + case 8: pushv8 = (pushv8.tofloat() * bonusRate).tointeger(); break; + } + } + local destX_01 = 0; + local destY_01 = 0; + if(!isSameObject(obj, passiveObj)){ + destX_01 = passiveObj.getXPos() - obj.getXPos(); + destY_01 = passiveObj.getYPos() - obj.getYPos(); + z = z - obj.getZPos(); + if(direction == ENUM_DIRECTION_LEFT) destX_01 = obj.getXPos() - passiveObj.getXPos(); + } + sq_BinaryStartWrite(); + 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); +} + +function bonus_witch_bykk(obj) +{ + return 0; + local bonusRate = 0; + local skill_level1 = sq_GetSkillLevel(obj, SKILL_BYKK_FRIENDLYFAMILIAR); + local skill_level2 = sq_GetSkillLevel(obj, SKILL_BYKK_REDCANDY); + if(skill_level1 > 0) bonusRate = bonusRate + sq_GetLevelData(obj,SKILL_BYKK_FRIENDLYFAMILIAR, 9, skill_level1); + if(skill_level2 > 0) bonusRate = bonusRate + sq_GetLevelData(obj,SKILL_BYKK_REDCANDY, 0, skill_level2); + if(obj.getVar("mpregenrateup_buff").getBool(0)){ + local skill_level3 = sq_GetSkillLevel(obj, 41); + local add_Rate41 = sq_GetLevelData(obj, 41, 4, skill_level3); + bonusRate = bonusRate + add_Rate41; + } + + return bonusRate; +} + +function setDamageRate_Witch_bykk(obj) +{ + local bonusRate = 1000; + if(sq_GetSkillLevel(obj, SKILL_BYKK_FRIENDLYFAMILIAR) > 0) bonusRate = bonusRate * (1000 + sq_GetLevelData(obj, SKILL_BYKK_FRIENDLYFAMILIAR, 9, sq_GetSkillLevel(obj, SKILL_BYKK_FRIENDLYFAMILIAR))) / 1000; + print("bonusRate1 = "+bonusRate); + if(sq_GetSkillLevel(obj, SKILL_BYKK_REDCANDY) > 0) bonusRate = bonusRate * (1000 + sq_GetLevelData(obj, SKILL_BYKK_REDCANDY, 0, sq_GetSkillLevel(obj, SKILL_BYKK_REDCANDY))) / 1000; + print("bonusRate2 = "+bonusRate); + if(sq_GetSkillLevel(obj, SKILL_BYKK_SWEETCANDYBAR) > 0) bonusRate = bonusRate * (1000 + sq_GetLevelData(obj, SKILL_BYKK_SWEETCANDYBAR, 4, sq_GetSkillLevel(obj, SKILL_BYKK_SWEETCANDYBAR))) / 1000; + print("bonusRate3 = "+bonusRate); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/witch_skill_bykk/passiveskill/ap_mpregenrateup.nut")) bonusRate = bonusRate * (1000 + sq_GetLevelData(obj, 41, 4, sq_GetSkillLevel(obj, 41))) / 1000; + print("bonusRate4 = "+bonusRate); + obj.getVar("setSkillBonusRate").setInt(0, bonusRate.tointeger()); + //sq_SetSkillAttackBonus(obj, bonusRate); +} + +function onAfterSetState_Throw_witch_bykk(obj, state, datas, isResetTimer) +{ + local skillIndex = obj.getThrowIndex(); + switch (skillIndex) { + case SKILL_BYKK_ACIDCLOUD: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_ACIDCLOUD, STATE_PRIORITY_IGNORE_FORCE, true); + break; + case SKILL_BYKK_ENHANCEDMAGICMISSILE: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(10); + obj.sq_AddSetStatePacket(SKILL_BYKK_BLACKMANTLE, STATE_PRIORITY_IGNORE_FORCE, true); + break; + case SKILL_BYKK_LAVAPOTION: + local skill_level = sq_GetSkillLevel(obj,SKILL_BYKK_BITTERSCANDYBAR); + if(skill_level > 0){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(10); + obj.sq_AddSetStatePacket(SKILL_BYKK_LAVAPOTION, STATE_PRIORITY_IGNORE_FORCE, true); + } + else{ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_LAVAPOTION, STATE_PRIORITY_IGNORE_FORCE, true); + } + break; + case SKILL_BYKK_MEGADRILL: + local skill_level = sq_GetSkillLevel(obj,SKILL_BYKK_BITTERSCANDYBAR); + if(skill_level > 0){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(10); + obj.sq_AddSetStatePacket(SKILL_BYKK_MEGADRILL, STATE_PRIORITY_IGNORE_FORCE, true); + } + else{ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_MEGADRILL, STATE_PRIORITY_IGNORE_FORCE, true); + } + break; + case 41: + if(sq_getGrowType(obj) == 4){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(21); + obj.sq_AddSetStatePacket(SKILL_BYKK_BLACKMANTLE, STATE_PRIORITY_IGNORE_FORCE, true); + } + break; + } +} + +function setState_Mage_witch_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + if(state == 39){ + local homunculus_level = sq_GetSkillLevel(obj, SKILL_BYKK_HOMUNCULUS),homunculus_skill = sq_GetSkill(obj, SKILL_BYKK_HOMUNCULUS); + if(homunculus_level > 0 && !homunculus_skill.isSealFunction()){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_ANTIGRAVITYSTARTER, STATE_PRIORITY_IGNORE_FORCE, true); + } + else{ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_ANTIGRAVITYSTARTER, STATE_PRIORITY_IGNORE_FORCE, true); + } + } + else if(state == 35){ + local skill = sq_GetSkill(obj, SKILL_BYKK_HOMUNCULUS); + local redcandy_level = sq_GetSkillLevel(obj, SKILL_BYKK_REDCANDY); + if(redcandy_level > 0 && !skill.isSealFunction()){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_BLACKMANTLE, STATE_PRIORITY_IGNORE_FORCE, true); + } + else{ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_BLACKMANTLE, STATE_PRIORITY_IGNORE_FORCE, true); + } + } + else if(state == 36){ + if(sq_GetLevelData(obj, SKILL_BYKK_TRANSFORMFLAPPER, 12, sq_GetSkillLevel(obj, SKILL_BYKK_TRANSFORMFLAPPER)) > 0) obj.getVar("transBool").setBool(0, true); + else obj.getVar("transBool").setBool(0, false); + obj.sq_IntVectClear(); + if(sq_GetZPos(obj) > 0) obj.sq_IntVectPush(1); + else obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_TRANSFORMFLAPPER, STATE_PRIORITY_IGNORE_FORCE, true); + // obj.sq_IntVectPush(0); + // obj.sq_AddSetStatePacket(SKILL_BYKK_UROBOROS, STATE_PRIORITY_IGNORE_FORCE, true); + } + else if(state == 41){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_FLUORECOLLIDER, STATE_PRIORITY_IGNORE_FORCE, true); + } + else if(state == 43){ + local skill_level = sq_GetSkillLevel(obj,SKILL_BYKK_BITTERSCANDYBAR); + if(skill_level > 0){ + obj.sq_IsEnterSkillLastKeyUnits(SKILL_BYKK_HEATINGFURNACE); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(10); + obj.sq_AddSetStatePacket(SKILL_BYKK_HEATINGFURNACE, STATE_PRIORITY_IGNORE_FORCE, true); + } + else{ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_HEATINGFURNACE, STATE_PRIORITY_IGNORE_FORCE, true); + } + } + else if(state == 49){ + if(sq_GetLevelData(obj, SKILL_BYKK_TRANSFORMFLAPPEREX, 12, sq_GetSkillLevel(obj, SKILL_BYKK_TRANSFORMFLAPPEREX)) > 0) obj.getVar("transBoolex").setBool(0, true); + else obj.getVar("transBoolex").setBool(0, false); + obj.sq_IntVectClear(); + if(sq_GetZPos(obj) > 0) obj.sq_IntVectPush(1); + else obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_TRANSFORMFLAPPEREX, STATE_PRIORITY_IGNORE_FORCE, true); + } + else if(state == 17){ + if(sq_GetVectorData(datas, 0) == 2 && sq_getGrowType(obj) == 4){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(22); + obj.sq_AddSetStatePacket(SKILL_BYKK_BLACKMANTLE, STATE_PRIORITY_IGNORE_FORCE, true); + } + } +} + +function getSuccessType_bykk(obj,skillIndex) +{ + local winRate = sq_GetIntData(obj, skillIndex, 1); + local bigwinRate = sq_GetIntData(obj, skillIndex, 2); + local loseRate = 1000 - winRate - bigwinRate; + local skllevel1 = sq_GetSkillLevel(obj, SKILL_BYKK_SWEETCANDYBAR);//幸运棒棒糖 + local skllevel2 = sq_GetSkillLevel(obj, SKILL_BYKK_SUCCESSPREMONITION);//成功预感 + local skllevel3 = sq_GetSkillLevel(obj, SKILL_BYKK_FRIENDLYFAMILIAR);//亲和法米利尔 + local win_addRate1 = sq_GetLevelData(obj,SKILL_BYKK_SWEETCANDYBAR, 2, skllevel1); + local bigwin_addRate1 = sq_GetLevelData(obj,SKILL_BYKK_SWEETCANDYBAR, 3, skllevel1); + local win_addRate2 = sq_GetLevelData(obj,SKILL_BYKK_SUCCESSPREMONITION, 1, skllevel2); + local bigwin_addRate2 = sq_GetLevelData(obj,SKILL_BYKK_SUCCESSPREMONITION, 2, skllevel2); + local win_addRate3 = sq_GetLevelData(obj,SKILL_BYKK_FRIENDLYFAMILIAR, 1, skllevel3); + local bigwin_addRate3 = sq_GetLevelData(obj,SKILL_BYKK_FRIENDLYFAMILIAR, 2, skllevel3); + if(skllevel3 > 0){winRate= winRate + win_addRate3;bigwinRate= bigwinRate + bigwin_addRate3;} + if(obj.getVar("successpremonition").getBool(0)){ + obj.getVar("successpremonition").setBool(0, false); + winRate = winRate + win_addRate2 ; + bigwinRate = bigwinRate + bigwin_addRate2; + } + if(skllevel1 > 0){ + winRate = (winRate.tofloat() * (1000.0 + win_addRate1.tofloat()) / 1000.0).tointeger(); + bigwinRate = (bigwinRate.tofloat() * (1000.0 + bigwin_addRate1.tofloat()) / 1000.0).tointeger(); + } + if(winRate + bigwinRate >= 1000){ + winRate = 1000 - bigwinRate; + loseRate = 0; + } + else{ + loseRate = 1000 - winRate - bigwinRate; + } + // print("bigwinRate = "+bigwinRate+" && winRate = "+winRate+" && loseRate = "+loseRate); + local ramdon_number = sq_getRandom(1,1000); + if(ramdon_number > loseRate && ramdon_number <= (loseRate + winRate)){ + return 1; + } + if(ramdon_number > (loseRate + winRate) && ramdon_number <= (loseRate + winRate + bigwinRate)){ + return 2; + } + return 0; +} + +function proc_appendage_antigravity_bykk(appendage) +{ + if (!appendage) return; + +} + +function onCreateObject_Throw(obj, createObject) +{ + if(createObject.isObjectType(OBJECTTYPE_PASSIVE)){ + local colObj = sq_GetCNRDObjectToCollisionObject(createObject); + if(colObj.getCollisionObjectIndex() == 23043){ + local bonusRate = sq_GetCurrentAttackBonusRate(colObj); + local attackInfo = sq_GetCurrentAttackInfo(colObj); + if(attackInfo){ + sq_SetCurrentAttackPower(attackInfo, 0); + sq_SetCurrentAttackBonusRate(attackInfo, 10000); + } + print(sq_GetCurrentAttackBonusRate(colObj)); + } + } +} + +function createOnlyDrawObject_witch_bykk(obj,aniPath,isTrue,direction,x,y,z,drawlayer) +{ + local ani = sq_CreateAnimation("",aniPath);//创建ani + local pooledObj = sq_CreatePooledObject(ani,isTrue);//创建绘画对象 参数2:应该是ani结束时true 就销毁反之false不销毁 + sq_SetCurrentDirection(pooledObj, direction);//设置方向 + pooledObj.setCurrentPos(x,y,z);//设置pos + pooledObj = sq_SetEnumDrawLayer(pooledObj, drawlayer);//设置图层 + sq_AddObject(obj, pooledObj, OBJECTTYPE_DRAWONLY, false);//增加对象 + return pooledObj; +} + +function setLightning_witch_bykk(obj, drawObj, targetObj) +{ + if(!obj) return; + //if(!pTargetChr) return; + + local X = drawObj.getXPos(); + local Y = drawObj.getYPos(); + local Z = drawObj.getZPos(); + + + local pAni = drawObj.getCurrentAnimation(); + local frameIndex = pAni.GetCurrentFrameIndex(); + + local posX = targetObj.getXPos(); + local posY = targetObj.getYPos() + 1; + local posZ = targetObj.getZPos() + (sq_GetObjectHeight(targetObj) / 2); + + if(posX == -1) return; + + local offset = posX - X; + + if(offset < 0) drawObj.setCurrentDirection(ENUM_DIRECTION_LEFT); + else drawObj.setCurrentDirection(ENUM_DIRECTION_RIGHT); + + local distance = sq_GetDistance( X, Y - Z, posX, posY - posZ, true); + local w = posX - X; + if(w < 0) w = -w; + local h = (posY - posZ) - (Y - Z); + local width = sq_Abs(posX - X); + local angle = sq_Atan2( h.tofloat(), width.tofloat()); + if((posY - posZ) > (Y - Z)) angle = -angle; + local nRevision = distance; + local cos = nRevision.tofloat() * sq_Cos(angle); + local sin = nRevision.tofloat() * sq_Sin(angle); + local nX = sq_Abs( cos.tointeger() ); + local nY = sq_Abs( sin.tointeger() ); + sq_SetfRotateAngle(pAni, angle); + pAni.setImageRate(1.0, 1.0); + local dis = 246; + local cos_x = dis.tofloat() * sq_Cos(angle); + local sin_y = dis.tofloat() * sq_Sin(angle); + local nW = sq_Abs( cos_x.tointeger() ); + local nH = sq_Abs( sin_y.tointeger() ); + local wRate = width.tofloat() / nW.tofloat(); + local hRate = h.tofloat() / nH.tofloat(); + pAni.setImageRate(wRate.tofloat(), hRate.tofloat()); +} + +function setUroLightning_witch_bykk(obj, drawObj, targetObj) +{ + if(!obj) return; + //if(!pTargetChr) return; + + local X = drawObj.getXPos(); + local Y = drawObj.getYPos(); + local Z = drawObj.getZPos(); + + local pAni = drawObj.getCurrentAnimation(); + + local posX = targetObj.getXPos(); + local posY = targetObj.getYPos() + 1; + local posZ = 90; + + if(posX == -1) return; + + local offset = posX - X; + + if(offset < 0) drawObj.setCurrentDirection(ENUM_DIRECTION_LEFT); + else drawObj.setCurrentDirection(ENUM_DIRECTION_RIGHT); + + local distance = sq_GetDistance( X, Y - Z, posX, posY - posZ, true); + local w = posX - X; + if(w < 0) w = -w; + local h = (posY - posZ) - (Y - Z); + local width = sq_Abs(posX - X); + local angle = sq_Atan2( h.tofloat(), width.tofloat()); + if((posY - posZ) > (Y - Z)) angle = -angle; + local nRevision = distance; + local cos = nRevision.tofloat() * sq_Cos(angle); + local sin = nRevision.tofloat() * sq_Sin(angle); + local nX = sq_Abs( cos.tointeger() ); + local nY = sq_Abs( sin.tointeger() ); + sq_SetCustomRotate(drawObj, angle); + pAni.setImageRate(1.0, 1.0); + local dis = 185; + local cos_x = dis.tofloat() * sq_Cos(angle); + local sin_y = dis.tofloat() * sq_Sin(angle); + local nW = sq_Abs( cos_x.tointeger() ); + local nH = sq_Abs( sin_y.tointeger() ); + local wRate = width.tofloat() / nW.tofloat(); + local hRate = h.tofloat() / nH.tofloat(); + pAni.setImageRate(wRate.tofloat(), hRate.tofloat()); +} + +function onStartMap_Witch_bykk(obj) +{ + local effectObj = obj.getVar("megadrill").get_obj_vector(0); + if(effectObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(effectObj); + if(colObj.getDirection() != obj.getDirection()) sq_SetCurrentDirection(colObj, sq_GetOppositeDirection(sq_GetDirection(colObj))); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_MEGADRILL,4,50,0,0,0,0,0,0,0,0); + } + if(obj.getVar("jackohalloween_pumpkin").get_obj_vector_size() > 0){ + local colObj = sq_GetCNRDObjectToCollisionObject(obj.getVar("jackohalloween_pumpkin").get_obj_vector(0)); + if(colObj && colObj.getState() <= 24){ + colObj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + local colObj2 = sq_GetCNRDObjectToCollisionObject(colObj.getVar("jackohalloween_lava").get_obj_vector(0)); + if(colObj2) colObj2.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + } + else obj.getVar("jackohalloween_pumpkin").clear_obj_vector(); + } + local attackObj = obj.getVar("uroboros").get_obj_vector(0); + if(attackObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(attackObj); + if(colObj.getDirection() != obj.getDirection()) sq_SetCurrentDirection(colObj, sq_GetOppositeDirection(sq_GetDirection(colObj))); + obj.getVar("uroboros").setBool(0, true); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_UROBOROS,4,50,0,0,0,0,0,0,0,0); + } +} + +function onStartDungeon_Witch_bykk(obj) +{ + // bonus_witch_bykk(obj); + if(sq_GetSkillLevel(obj,SKILL_BYKK_LOLLIPOPCRUSH) > 0){ + obj.getVar("whitecandy_num").clear_vector(); + obj.getVar("blackcandy_num").clear_vector(); + obj.getVar("bosscandy_num").clear_vector(); + obj.getVar("whitecandy_num").push_vector(0); + obj.getVar("blackcandy_num").push_vector(0); + obj.getVar("bosscandy_num").push_vector(0); + } + if(sq_GetSkillLevel(obj, SKILL_BYKK_SWEETCANDYBAR) > 0){ + local appendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, SKILL_BYKK_SWEETCANDYBAR, false, "character/mage/witch_skill_bykk/passiveskill/ap_sweetcandybar.nut", true); + } + obj.getVar("countofhomunculus").setInt(11, 0); + setDamageRate_Witch_bykk(obj); +} + +//人物复活 +function reset_witch_bykk(obj) +{ + if(!obj) return; + if(!CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/witch_skill_bykk/passiveskill/ap_mpregenrateup.nut")){ + obj.getVar("mpregenrateup_buff").setBool(0,false); + // bonus_witch_bykk(obj); + } + setDamageRate_Witch_bykk(obj); +} + +function summonmonster_witch_bykk(obj,monsterobj,x,y,z,substate,monsterId,summontime,level,team) +{ + if(obj.getVar("Summonnum").size_vector() == 0){ + obj.getVar("Summonnum").clear_vector(); + obj.getVar("Summonnum").push_vector(0); + } + + sq_BinaryStartWrite(); + sq_BinaryWriteByte(substate); + sq_BinaryWriteDword(monsterId); + sq_BinaryWriteWord(team); + sq_BinaryWriteWord(level); + sq_BinaryWriteWord(obj.getVar("Summonnum").get_vector(0)); + sq_BinaryWriteDword(0); + sq_BinaryWriteDword(summontime); + sq_BinaryWriteWord(1); + sq_BinaryWriteWord(1); + sq_BinaryWriteWord(1); + local destX_01 = 0; + local destY_01 = 0; + if(!isSameObject(obj, monsterobj)){ + destX_01 = monsterobj.getXPos() - obj.getXPos(); + destY_01 = monsterobj.getYPos() - obj.getYPos(); + if(monsterobj.getDirection() == ENUM_DIRECTION_LEFT) destX_01 = obj.getXPos() - monsterobj.getXPos(); + } + sq_SendCreatePassiveObjectPacket(obj, 48024, 0, destX_01 + x, destY_01 + y, z, monsterobj.getDirection()); + obj.getVar("Summonnum").set_vector(0,obj.getVar("Summonnum").get_vector(0) + 1); +} + +function changeskilleffect_witch_bykk(obj, skillIndex, reciveData) +{ + switch(skillIndex){ + case SKILL_BYKK_TRANSFORMFLAPPER: + local id = reciveData.readDword(); + local monster_obj = sq_GetCNRDObjectToActiveObject(sq_GetObject(obj, reciveData.readDword(), reciveData.readDword())); + + monster_obj.setMapFollowParent(obj); + monster_obj.setMapFollowType(1); + + switch(id){ + case TAU_BYKK_ID: + setMonsterAppendage_witch_bykk(obj, monster_obj, "character/mage/witch_skill_bykk/ap/ap_kk_tau.nut", "TAU", SKILL_BYKK_TRANSFORMFLAPPER); + break; + case GOBLIN_BYKK_ID: + setMonsterAppendage_witch_bykk(obj, monster_obj, "character/mage/witch_skill_bykk/ap/ap_kk_goblin.nut", "GOBLIN", SKILL_BYKK_TRANSFORMFLAPPER); + break; + case FLUORE_BYKK_ID: + setMonsterAppendage_witch_bykk(obj, monster_obj, "character/mage/witch_skill_bykk/ap/ap_kk_homunculus_fluore.nut", "FLUORE", SKILL_BYKK_HOMUNCULUS); + break; + case FLUTO_BYKK_ID: + setMonsterAppendage_witch_bykk(obj, monster_obj, "character/mage/witch_skill_bykk/ap/ap_kk_homunculus_fluto.nut", "FLUTO", SKILL_BYKK_HOMUNCULUS); + break; + case LANTERN_BYKK_ID: + setMonsterAppendage_witch_bykk(obj, monster_obj, "character/mage/witch_skill_bykk/ap/ap_kk_homunculus_lantern.nut", "LANTERN", SKILL_BYKK_HOMUNCULUS); + break; + case JACKFROST_BYKK_ID: + setMonsterAppendage_witch_bykk(obj, monster_obj, "character/mage/witch_skill_bykk/ap/ap_kk_homunculus_jackfrost.nut", "JACKFROST", SKILL_BYKK_HOMUNCULUS); + break; + case LANTERNRUNNER_BYKK_ID: + setMonsterAppendage_witch_bykk(obj, monster_obj, "character/mage/witch_skill_bykk/ap/ap_kk_homunculus_lanternrunner.nut", "LANTERNRUNNER", SKILL_BYKK_HOMUNCULUS); + break; + } + break; + } +} + + + +function setMonsterAppendage_witch_bykk(obj, monster_obj, appendagepath, monstername, skill_index) +{ + if(!obj) return; + if(!monster_obj) return; + if(appendagepath == null || monstername == null || skill_index == null) return; + appendagepath = appendagepath.tostring(); + monstername = monstername.tostring(); + local monster_obj = sq_GetCNRDObjectToActiveObject(monster_obj); + if(!CNSquirrelAppendage.sq_IsAppendAppendage(monster_obj, appendagepath)){ + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(monster_obj, monster_obj, skill_index, false, appendagepath, true); + AddAppendage.getVar("sqrChr").clear_obj_vector(); + AddAppendage.getVar("sqrChr").push_obj_vector(obj); + setMonsterInfo_witch_byKK(obj, monster_obj, skill_index, AddAppendage); + local monsternum = obj.getVar(monstername).get_obj_vector_size(); + if(monsternum > 0){ + obj.getVar(monstername).push_obj_vector(monster_obj); + } + else{ + obj.getVar(monstername).clear_obj_vector(); + obj.getVar(monstername).push_obj_vector(monster_obj); + } + } +} + +function setMonsterInfo_witch_byKK(obj, monster_obj, skill_index, appendage) +{ + if(!obj) return; + + local monster_id = monster_obj.getCollisionObjectIndex(); + switch(monster_id){ + case FLUORE_BYKK_ID: + case FLUTO_BYKK_ID: + case JACKFROST_BYKK_ID: + case LANTERN_BYKK_ID: + if(sq_GetIntData(obj, SKILL_BYKK_HOMUNCULUS, 43) > 0){ + local speedRate = sq_GetIntData(obj, SKILL_BYKK_HOMUNCULUS, 43); + local ap = sq_CreateChangeStatus(CHANGE_STATUS_TYPE_ATTACK_SPEED, true, speedRate.tofloat() , 0); + if(ap) ap.sq_Append(monster_obj, obj); + local speedRate2 = sq_GetIntData(obj, SKILL_BYKK_HOMUNCULUS, 44); + local ap2 = sq_CreateChangeStatus(CHANGE_STATUS_TYPE_MOVE_SPEED, true, speedRate2.tofloat() , 0); + if(ap2) ap2.sq_Append(monster_obj, obj); + } + + local coolt01 = 2000, coolt02 = 5000; + if(monster_id == LANTERN_BYKK_ID){coolt01 = 1000; coolt02 = 15000;} + appendage.getVar("skill_1").clear_timer_vector(); + appendage.getVar("skill_1").push_timer_vector(); + local t_01 = appendage.getVar("skill_1").get_timer_vector(0); + t_01.setParameter(2000, -1); + t_01.resetInstant(0); + appendage.getVar("skill_2").clear_timer_vector(); + appendage.getVar("skill_2").push_timer_vector(); + local t_02 = appendage.getVar("skill_2").get_timer_vector(0); + t_02.setParameter(5000, -1); + t_02.resetInstant(0); + appendage.getVar().clear_ct_vector(); + appendage.getVar().push_ct_vector(); + appendage.getVar("atktime").clear_ct_vector(); + appendage.getVar("atktime").push_ct_vector(); + local timer = appendage.getVar("atktime").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); + break; + } +} + +function monsterattack_witch_ksk(monsterObj,attackIndex) +{ + if(!monsterObj) return; + local pIntVec = sq_GetGlobalIntVector(); + sq_IntVectorClear(pIntVec); + sq_IntVectorPush(pIntVec, attackIndex); + sq_AddSetStatePacketActiveObject(monsterObj, 8, pIntVec, STATE_PRIORITY_USER); +} + +function proc_appendage_kak_tau(appendage) +{ + if (!appendage) return; + local parentObj = sq_GetCNRDObjectToActiveObject(appendage.getParent()); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if(!parentObj){appendage.setValid(false);return;} + if(!sqrChr || sqrChr.getState() == STATE_DIE){appendage.setValid(false);return;} +} + +function onSourceKeyFrameFlag_appendage_kak_tau(appendage,flagIndex) +{ + if (!appendage) return; + local parentObj = sq_GetCNRDObjectToActiveObject(appendage.getParent()); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + + if(!parentObj){appendage.setValid(false);return;} + + if(!sqrChr || sqrChr.getState() == STATE_DIE){appendage.setValid(false);return;} + + switch(flagIndex){ + case 1: + local skill_level = sq_GetSkillLevel(sqrChr, SKILL_BYKK_TRANSFORMFLAPPER); + cearteSkillPassive_Witch_bykk(sqrChr,parentObj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,parentObj.getDirection(),SKILL_BYKK_TRANSFORMFLAPPER,10,200+skill_level*10,0,0,0,0,0,0,0,1); + break; + case 2: + local skill_level = sq_GetSkillLevel(sqrChr, SKILL_BYKK_TRANSFORMFLAPPER); + cearteSkillPassive_Witch_bykk(sqrChr,parentObj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,parentObj.getDirection(),SKILL_BYKK_TRANSFORMFLAPPER,11,500+skill_level*25,0,0,0,0,0,0,0,1); + break; + case 3: + local skill_level = sq_GetSkillLevel(sqrChr, SKILL_BYKK_TRANSFORMFLAPPER); + local group = sq_GetGroup(parentObj); + local uniqueId = sq_GetUniqueId(parentObj); + cearteSkillPassive_Witch_bykk(sqrChr,parentObj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,parentObj.getDirection(),SKILL_BYKK_TRANSFORMFLAPPER,12,800+skill_level*40,group,uniqueId,0,0,0,0,0,1); + break; + case 4: + local skill_level = sq_GetSkillLevel(sqrChr, SKILL_BYKK_TRANSFORMFLAPPER); + cearteSkillPassive_Witch_bykk(sqrChr,parentObj,PASSIVEOBJECT_BYKK_WITCH,200,0,0,parentObj.getDirection(),SKILL_BYKK_TRANSFORMFLAPPER,13,300+skill_level*15,0,0,0,0,0,0,0,1); + break; + } +} + +function proc_appendage_kak_goblin(appendage) +{ + if (!appendage) return; + local parentObj = sq_GetCNRDObjectToActiveObject(appendage.getParent()); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if(!parentObj){appendage.setValid(false);return;} + if(!sqrChr || sqrChr.getState() == STATE_DIE){appendage.setValid(false);return;} +} + +function onSourceKeyFrameFlag_appendage_kak_goblin(appendage,flagIndex) +{ + if (!appendage) return; + local parentObj = sq_GetCNRDObjectToActiveObject(appendage.getParent()); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + + if(!parentObj){appendage.setValid(false);return;} + + if(!sqrChr || sqrChr.getState() == STATE_DIE){appendage.setValid(false);return;} + + switch(flagIndex){ + case 1: + local skill_level = sq_GetSkillLevel(sqrChr, SKILL_BYKK_TRANSFORMFLAPPER); + cearteSkillPassive_Witch_bykk(sqrChr,parentObj,PASSIVEOBJECT_BYKK_WITCH,40,0,50,parentObj.getDirection(),SKILL_BYKK_TRANSFORMFLAPPER,14,400+skill_level*20,0,0,0,0,0,0,0,1); + break; + case 2: + local skill_level = sq_GetSkillLevel(sqrChr, SKILL_BYKK_TRANSFORMFLAPPER); + for(local i = 0; i < 3; i++){ + cearteSkillPassive_Witch_bykk(sqrChr,parentObj,PASSIVEOBJECT_BYKK_WITCH,40,0,50,parentObj.getDirection(),SKILL_BYKK_TRANSFORMFLAPPER,15,600+skill_level*30,i,0,0,0,0,0,0,1); + } + break; + } +} + +function proc_appendage_kak_homunculus_fluore(appendage) +{ + if (!appendage) return; + local parentObj = sq_GetCNRDObjectToActiveObject(appendage.getParent()); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if(!parentObj){appendage.setValid(false);return;} + if(!sqrChr || sqrChr.getState() == STATE_DIE){appendage.setValid(false);return;} + if(!sq_IsMyControlObject(sqrChr)) return; + + local t_01 = appendage.getVar("skill_1").get_timer_vector(0); + local t_02 = appendage.getVar("skill_2").get_timer_vector(0); + local currentT = appendage.getTimer().Get(); + + local state = parentObj.getState(); + local attackIndex = parentObj.getAttackIndex(); + + switch(state){ + case STATE_STAND: + local timer = appendage.getVar("atktime").get_ct_vector(0); + local currentTT = timer.Get(); + if(currentTT < ATK_TIME_WITCH) return; + timer.Reset(); + timer.Start(10000,0); + local targetObj = sq_FindTarget( parentObj, 0, 1000, 800, 350); + if(targetObj){ + parentObj.getVar("targetObj").clear_obj_vector(); + parentObj.getVar("targetObj").push_obj_vector(targetObj); + local skillt = [t_02,t_01]; + local attackIndex = [3,0]; + local distanceX = [100,500]; + local distanceXmin = [0,0]; + local distanceY = [30,300]; + for(local i = 0;i < skillt.len(); i++){ + if(skillt[i] && skillt[i].isOnEvent(currentT)){ + if(sq_IsMyControlObject(parentObj)){ + if(sq_Abs(targetObj.getXPos() - parentObj.getXPos()) <= distanceX[i] && sq_Abs(targetObj.getXPos() - parentObj.getXPos()) >= distanceXmin[i] && sq_Abs(targetObj.getYPos() - parentObj.getYPos()) <= distanceY[i]){ + monsterattack_witch_ksk(parentObj,attackIndex[i]); + return; + } + } + } + } + } + else{ + if(sq_FindTarget( parentObj, -1000, 1000, 800, 350)) sq_SetCurrentDirection(parentObj, sq_GetOppositeDirection(sq_GetDirection(parentObj))); + } + break; + case STATE_ATTACK: + switch(attackIndex){ + case 1: + local timer = appendage.getVar().get_ct_vector(0); + local currentT1 = timer.Get(); + local hitMax = sq_GetLevelData(sqrChr,SKILL_BYKK_HOMUNCULUS,9,sq_GetSkillLevel(sqrChr,SKILL_BYKK_HOMUNCULUS)); + if(currentT1 >= hitMax * 150) monsterattack_witch_ksk(parentObj,2); + break; + case 4: + local timer = appendage.getVar().get_ct_vector(0); + local currentT1 = timer.Get(); + local hitMax = sq_GetLevelData(sqrChr,SKILL_BYKK_HOMUNCULUS,12,sq_GetSkillLevel(sqrChr,SKILL_BYKK_HOMUNCULUS)); + if(currentT1 >= hitMax * 300) parentObj.sendStateOnlyPacket(STATE_STAND); + break; + } + break; + } +} + +function onSourceKeyFrameFlag_appendage_kak_homunculus_fluore(appendage,flagIndex) +{ + if (!appendage) return; + local parentObj = sq_GetCNRDObjectToActiveObject(appendage.getParent()); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + + if(!parentObj){appendage.setValid(false);return;} + if(!sqrChr || sqrChr.getState() == STATE_DIE){appendage.setValid(false);return;} + + switch(flagIndex){ + case 11: + local timer = appendage.getVar().get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); + local hitMax = sq_GetLevelData(sqrChr,SKILL_BYKK_HOMUNCULUS,9,sq_GetSkillLevel(sqrChr,SKILL_BYKK_HOMUNCULUS)); + local totalDamage = sqrChr.sq_GetBonusRateWithPassive(SKILL_BYKK_HOMUNCULUS, SKILL_BYKK_HOMUNCULUS, 7, 1.0) + 100; + local targetObj = sq_GetCNRDObjectToActiveObject(parentObj.getVar("targetObj").get_obj_vector(0)); + local group = sq_GetGroup(targetObj); + local uniqueId = sq_GetUniqueId(targetObj); + cearteSkillPassive_Witch_bykk(sqrChr,parentObj,PASSIVEOBJECT_BYKK_WITCH,25,0,50,parentObj.getDirection(),SKILL_BYKK_HOMUNCULUS,11,totalDamage,hitMax,group,uniqueId,0,0,0,0,1); + monsterattack_witch_ksk(parentObj,1); + break; + case 21: + local hitMax = sq_GetLevelData(sqrChr,SKILL_BYKK_HOMUNCULUS,12,sq_GetSkillLevel(sqrChr,SKILL_BYKK_HOMUNCULUS)); + local totalDamage = sqrChr.sq_GetBonusRateWithPassive(SKILL_BYKK_HOMUNCULUS, SKILL_BYKK_HOMUNCULUS, 10, 1.0) + 100; + local skill_level = sq_GetSkillLevel(sqrChr,SKILL_BYKK_HOMUNCULUS); + local prob = sq_GetLevelData(sqrChr,SKILL_BYKK_HOMUNCULUS,14,skill_level); + local level = sq_GetLevelData(sqrChr,SKILL_BYKK_HOMUNCULUS,15,skill_level); + local time = sq_GetLevelData(sqrChr,SKILL_BYKK_HOMUNCULUS,16,skill_level); + local damage = sq_GetLevelData(sqrChr,SKILL_BYKK_HOMUNCULUS,17,skill_level); + cearteSkillPassive_Witch_bykk(sqrChr,parentObj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,parentObj.getDirection(),SKILL_BYKK_HOMUNCULUS,12,totalDamage,hitMax,prob,level,time,damage,0,0,1); + monsterattack_witch_ksk(parentObj,4); + break; + } +} + +function proc_appendage_kak_homunculus_fluto(appendage) +{ + if (!appendage) return; + local parentObj = sq_GetCNRDObjectToActiveObject(appendage.getParent()); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if(!parentObj){appendage.setValid(false);return;} + if(!sqrChr || sqrChr.getState() == STATE_DIE){appendage.setValid(false);return;} + if(!sq_IsMyControlObject(sqrChr)) return; + + local t_01 = appendage.getVar("skill_1").get_timer_vector(0); + local t_02 = appendage.getVar("skill_2").get_timer_vector(0); + local currentT = appendage.getTimer().Get(); + + local state = parentObj.getState(); + local attackIndex = parentObj.getAttackIndex(); + + switch(state){ + case STATE_STAND: + local timer = appendage.getVar("atktime").get_ct_vector(0); + local currentTT = timer.Get(); + if(currentTT < ATK_TIME_WITCH) return; + timer.Reset(); + timer.Start(10000,0); + local targetObj = sq_FindTarget( parentObj, 0, 1000, 800, 350); + if(targetObj){ + parentObj.getVar("targetObj").clear_obj_vector(); + parentObj.getVar("targetObj").push_obj_vector(targetObj); + local skillt = [t_02,t_01]; + local attackIndex = [6,0]; + local distanceX = [200,200]; + local distanceXmin = [0,0]; + local distanceY = [50,200]; + for(local i = 0;i < skillt.len(); i++){ + if(skillt[i] && skillt[i].isOnEvent(currentT)){ + if(sq_IsMyControlObject(parentObj)){ + if(sq_Abs(targetObj.getXPos() - parentObj.getXPos()) <= distanceX[i] && sq_Abs(targetObj.getXPos() - parentObj.getXPos()) >= distanceXmin[i] && sq_Abs(targetObj.getYPos() - parentObj.getYPos()) <= distanceY[i]){ + monsterattack_witch_ksk(parentObj,attackIndex[i]); + return; + } + } + } + } + } + else{ + if(sq_FindTarget( parentObj, -1000, 1000, 800, 350)) sq_SetCurrentDirection(parentObj, sq_GetOppositeDirection(sq_GetDirection(parentObj))); + } + break; + case STATE_ATTACK: + switch(attackIndex){ + case 0://移动 + local targetObj = sq_GetCNRDObjectToActiveObject(parentObj.getVar("targetObj").get_obj_vector(0)); + if(targetObj){ + local pAni = parentObj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + local fireT = pAni.getDelaySum(false); + local X1 = sq_GetAccel(parentObj.getXPos(), targetObj.getXPos(), currentT, fireT, true); + local Y1 = sq_GetAccel(parentObj.getYPos(), targetObj.getYPos(), currentT, fireT, true); + if(parentObj.isMovablePos(X1, Y1)){ + sq_setCurrentAxisPos(parentObj, 0, X1); + sq_setCurrentAxisPos(parentObj, 1, Y1); + } + else{ + monsterattack_witch_ksk(parentObj,1); + } + } + break; + } + break; + } +} + +function onSourceKeyFrameFlag_appendage_kak_homunculus_fluto(appendage,flagIndex) +{ + if (!appendage) return; + local parentObj = sq_GetCNRDObjectToActiveObject(appendage.getParent()); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + + if(!parentObj){appendage.setValid(false);return;} + if(!sqrChr || sqrChr.getState() == STATE_DIE){appendage.setValid(false);return;} + + switch(flagIndex){ + case 11: + monsterattack_witch_ksk(parentObj,1); + break; + case 12: + local totalDamage = sqrChr.sq_GetBonusRateWithPassive(SKILL_BYKK_HOMUNCULUS, SKILL_BYKK_HOMUNCULUS, 34, 1.0) + 100; + cearteSkillPassive_Witch_bykk(sqrChr,parentObj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,parentObj.getDirection(),SKILL_BYKK_HOMUNCULUS,21,totalDamage,0,0,0,0,0,0,0,1); + monsterattack_witch_ksk(parentObj,2); + break; + case 13: + monsterattack_witch_ksk(parentObj,3); + break; + case 14: + monsterattack_witch_ksk(parentObj,4); + break; + case 15: + monsterattack_witch_ksk(parentObj,5); + break; + case 16: + local totalDamage = sqrChr.sq_GetBonusRateWithPassive(SKILL_BYKK_HOMUNCULUS, SKILL_BYKK_HOMUNCULUS, 33, 1.0) + 100; + local group = sq_GetGroup(parentObj); + local uniqueId = sq_GetUniqueId(parentObj); + cearteSkillPassive_Witch_bykk(sqrChr,parentObj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,parentObj.getDirection(),SKILL_BYKK_HOMUNCULUS,24,totalDamage,group,uniqueId,0,0,0,0,0,1); + break; + case 17: + local totalDamage = sqrChr.sq_GetBonusRateWithPassive(SKILL_BYKK_HOMUNCULUS, SKILL_BYKK_HOMUNCULUS, 35, 1.0) + 100; + cearteSkillPassive_Witch_bykk(sqrChr,parentObj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,parentObj.getDirection(),SKILL_BYKK_HOMUNCULUS,22,totalDamage,0,0,0,0,0,0,0,1); + break; + case 21://OBJ + local totalDamage = sqrChr.sq_GetBonusRateWithPassive(SKILL_BYKK_HOMUNCULUS, SKILL_BYKK_HOMUNCULUS, 36, 1.0) + 100; + local skill_level = sq_GetSkillLevel(sqrChr,SKILL_BYKK_HOMUNCULUS); + local prob = sq_GetLevelData(sqrChr,SKILL_BYKK_HOMUNCULUS,40,skill_level); + local level = sq_GetLevelData(sqrChr,SKILL_BYKK_HOMUNCULUS,38,skill_level); + local time = sq_GetLevelData(sqrChr,SKILL_BYKK_HOMUNCULUS,39,skill_level); + cearteSkillPassive_Witch_bykk(sqrChr,parentObj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,parentObj.getDirection(),SKILL_BYKK_HOMUNCULUS,23,totalDamage,prob,level,time,0,0,0,0,1); + sq_AddDrawOnlyAniFromParent(parentObj,"monster/character/mage/witch_bykk/fluto/animation/b/hit_target-normal.ani",0,0,0); + break; + } +} + +function proc_appendage_kak_homunculus_jackfrost(appendage) +{ + if (!appendage) return; + local parentObj = sq_GetCNRDObjectToActiveObject(appendage.getParent()); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if(!parentObj){appendage.setValid(false);return;} + if(!sqrChr || sqrChr.getState() == STATE_DIE){appendage.setValid(false);return;} + if(!sq_IsMyControlObject(sqrChr)) return; + + local t_01 = appendage.getVar("skill_1").get_timer_vector(0); + local t_02 = appendage.getVar("skill_2").get_timer_vector(0); + local currentT = appendage.getTimer().Get(); + + local state = parentObj.getState(); + local attackIndex = parentObj.getAttackIndex(); + + switch(state){ + case STATE_STAND: + local timer = appendage.getVar("atktime").get_ct_vector(0); + local currentTT = timer.Get(); + if(currentTT < ATK_TIME_WITCH) return; + timer.Reset(); + timer.Start(10000,0); + local targetObj = sq_FindTarget( parentObj, 0, 1000, 800, 350); + if(targetObj){ + parentObj.getVar("targetObj").clear_obj_vector(); + parentObj.getVar("targetObj").push_obj_vector(targetObj); + local skillt = [t_02,t_01]; + local attackIndex = [1,0]; + local distanceX = [200,150]; + local distanceXmin = [0,0]; + local distanceY = [30,50]; + for(local i = 0;i < skillt.len(); i++){ + if(skillt[i] && skillt[i].isOnEvent(currentT)){ + if(sq_IsMyControlObject(parentObj)){ + if(sq_Abs(targetObj.getXPos() - parentObj.getXPos()) <= distanceX[i] && sq_Abs(targetObj.getXPos() - parentObj.getXPos()) >= distanceXmin[i] && sq_Abs(targetObj.getYPos() - parentObj.getYPos()) <= distanceY[i]){ + monsterattack_witch_ksk(parentObj,attackIndex[i]); + return; + } + } + } + } + } + else{ + if(sq_FindTarget( parentObj, -1000, 1000, 800, 350)) sq_SetCurrentDirection(parentObj, sq_GetOppositeDirection(sq_GetDirection(parentObj))); + } + break; + } +} + +function onSourceKeyFrameFlag_appendage_kak_homunculus_jackfrost(appendage,flagIndex) +{ + if (!appendage) return; + local parentObj = sq_GetCNRDObjectToActiveObject(appendage.getParent()); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + + if(!parentObj){appendage.setValid(false);return;} + if(!sqrChr || sqrChr.getState() == STATE_DIE){appendage.setValid(false);return;} + + switch(flagIndex){ + case 11://OBJ + local totalDamage = sqrChr.sq_GetBonusRateWithPassive(SKILL_BYKK_HOMUNCULUS, SKILL_BYKK_HOMUNCULUS, 23, 1.0) + 100; + local hitMax = sq_GetLevelData(sqrChr,SKILL_BYKK_HOMUNCULUS,25,sq_GetSkillLevel(sqrChr,SKILL_BYKK_HOMUNCULUS)); + cearteSkillPassive_Witch_bykk(sqrChr,parentObj,PASSIVEOBJECT_BYKK_WITCH,50,0,200,parentObj.getDirection(),SKILL_BYKK_HOMUNCULUS,31,totalDamage,hitMax,0,0,0,0,0,0,1); + break; + case 21://OBJ + local timer = appendage.getVar().get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); + local totalDamage = sqrChr.sq_GetBonusRateWithPassive(SKILL_BYKK_HOMUNCULUS, SKILL_BYKK_HOMUNCULUS, 26, 1.0) + 100; + local skill_level = sq_GetSkillLevel(sqrChr,SKILL_BYKK_HOMUNCULUS); + local hitMax = sq_GetLevelData(sqrChr,SKILL_BYKK_HOMUNCULUS,28,skill_level); + local prob = sq_GetLevelData(sqrChr,SKILL_BYKK_HOMUNCULUS,30,skill_level); + local level = sq_GetLevelData(sqrChr,SKILL_BYKK_HOMUNCULUS,31,skill_level); + local time = sq_GetLevelData(sqrChr,SKILL_BYKK_HOMUNCULUS,32,skill_level); + local group = sq_GetGroup(parentObj); + local uniqueId = sq_GetUniqueId(parentObj); + cearteSkillPassive_Witch_bykk(sqrChr,parentObj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,parentObj.getDirection(),SKILL_BYKK_HOMUNCULUS,32,totalDamage,hitMax,prob,level,time,group,uniqueId,0,1); + monsterattack_witch_ksk(parentObj,2); + break; + case 22: + if(parentObj.getDirection() == ENUM_DIRECTION_LEFT) sq_SetVelocity(parentObj, 0, -50.0); + else sq_SetVelocity(parentObj, 0, 50.0); + break; + case 23: + monsterattack_witch_ksk(parentObj,3); + break; + } +} + +function proc_appendage_kak_homunculus_lantern(appendage) +{ + if (!appendage) return; + local parentObj = sq_GetCNRDObjectToActiveObject(appendage.getParent()); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if(!parentObj){appendage.setValid(false);return;} + if(!sqrChr || sqrChr.getState() == STATE_DIE){appendage.setValid(false);return;} + if(!sq_IsMyControlObject(sqrChr)) return; + + local timer = appendage.getVar().get_ct_vector(0); + if(timer){ + local currentT1 = timer.Get(); + if(currentT1 == 0){ + timer.Reset(); + timer.Start(10000,0); + monsterattack_witch_ksk(parentObj,0); + } + if(currentT1 >= 29000){ + appendage.getVar().clear_ct_vector(); + monsterattack_witch_ksk(parentObj,sq_getRandom(2,3)); + } + } + + local t_01 = appendage.getVar("skill_1").get_timer_vector(0); + local t_02 = appendage.getVar("skill_2").get_timer_vector(0); + local currentT = appendage.getTimer().Get(); + + local state = parentObj.getState(); + local attackIndex = parentObj.getAttackIndex(); + + switch(state){ + case STATE_STAND: + local timer = appendage.getVar("atktime").get_ct_vector(0); + local currentTT = timer.Get(); + if(currentTT < ATK_TIME_WITCH) return; + timer.Reset(); + timer.Start(10000,0); + local targetObj = sq_FindTarget( parentObj, 0, 1000, 800, 350); + if(targetObj){ + parentObj.getVar("targetObj").clear_obj_vector(); + parentObj.getVar("targetObj").push_obj_vector(targetObj); + local skillt = [t_02,t_01]; + local attackIndex = [sq_getRandom(2,3),1]; + local distanceX = [20,200]; + local distanceXmin = [0,0]; + local distanceY = [20,20]; + for(local i = 0;i < skillt.len(); i++){ + if(skillt[i] && skillt[i].isOnEvent(currentT)){ + if(sq_IsMyControlObject(parentObj)){ + if(sq_Abs(targetObj.getXPos() - parentObj.getXPos()) <= distanceX[i] && sq_Abs(targetObj.getXPos() - parentObj.getXPos()) >= distanceXmin[i] && sq_Abs(targetObj.getYPos() - parentObj.getYPos()) <= distanceY[i]){ + monsterattack_witch_ksk(parentObj,attackIndex[i]); + return; + } + } + } + } + } + else{ + if(sq_FindTarget( parentObj, -1000, 1000, 800, 350)) sq_SetCurrentDirection(parentObj, sq_GetOppositeDirection(sq_GetDirection(parentObj))); + } + break; + case STATE_ATTACK: + switch(attackIndex){ + case 2: + // + break; + } + break; + } +} + +function onSourceKeyFrameFlag_appendage_kak_homunculus_lantern(appendage,flagIndex) +{ + if (!appendage) return; + local parentObj = sq_GetCNRDObjectToActiveObject(appendage.getParent()); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + + if(!parentObj){appendage.setValid(false);return;} + if(!sqrChr || sqrChr.getState() == STATE_DIE){appendage.setValid(false);return;} + + switch(flagIndex){ + case 11://AP + if(appendage.getVar().getBool(0) == false) appendage.getVar().setBool(0,true); + break; + case 21://OBJ + local totalDamage = sqrChr.sq_GetBonusRateWithPassive(SKILL_BYKK_HOMUNCULUS, SKILL_BYKK_HOMUNCULUS, 22, 1.0) + 100; + cearteSkillPassive_Witch_bykk(sqrChr,parentObj,PASSIVEOBJECT_BYKK_WITCH,15,0,45,parentObj.getDirection(),SKILL_BYKK_HOMUNCULUS,41,totalDamage,0,0,0,0,0,0,0,1); + break; + case 31: + parentObj.sendDestroyPacket(true); + break; + case 32://OBJ + local totalDamage = sqrChr.sq_GetBonusRateWithPassive(SKILL_BYKK_HOMUNCULUS, SKILL_BYKK_HOMUNCULUS, 19, 1.0) + 100; + cearteSkillPassive_Witch_bykk(sqrChr,parentObj,PASSIVEOBJECT_BYKK_WITCH,0,0,45,parentObj.getDirection(),SKILL_BYKK_HOMUNCULUS,42,totalDamage,0,0,0,0,0,0,0,1); + break; + case 41://summon + local monsterlevel = sq_GetSkillLevel(sqrChr,174); + local num = sqrChr.sq_GetBonusRateWithPassive(SKILL_BYKK_HOMUNCULUS, SKILL_BYKK_HOMUNCULUS, 20, 1.0) + 100; + for(local i = 0; i < num; i++){ + summonmonster_witch_bykk(sqrChr,parentObj,0,0,-sq_GetZPos(sqrChr),0,LANTERNRUNNER_BYKK_ID,10000,monsterlevel,0); + } + parentObj.sendDestroyPacket(true); + break; + } +} + +function drawAppend_appendage_kk_homunculus_lantern_bykk(appendage, isOver, x, y, isFlip) +{ + local parentObj = sq_GetCNRDObjectToActiveObject(appendage.getParent()); + if(appendage.getVar().getBool(0)){ + local var = appendage.getVar(); + local Ani_01 = var.GetAnimationMap("animation_01", "monster/character/mage/witch_bykk/homunculuslantern/animation/a/lantern_aloop_groundauraloop.ani"); + local hight = parentObj.getZPos(); + if(Ani_01 && !isOver){ + sq_AnimationProc(Ani_01); + sq_drawCurrentFrame(Ani_01, x, y + hight, isFlip); + } + } +} + +function onSourceKeyFrameFlag_appendage_kak_homunculus_lanternrunner(appendage,flagIndex) +{ + if (!appendage) return; + local parentObj = sq_GetCNRDObjectToActiveObject(appendage.getParent()); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + + if(!parentObj){appendage.setValid(false);return;} + if(!sqrChr || sqrChr.getState() == STATE_DIE){appendage.setValid(false);return;} + + switch(flagIndex){ + case 11://OBJ + local totalDamage = sqrChr.sq_GetBonusRateWithPassive(SKILL_BYKK_HOMUNCULUS, SKILL_BYKK_HOMUNCULUS, 19, 1.0) + 100; + cearteSkillPassive_Witch_bykk(sqrChr,parentObj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,parentObj.getDirection(),SKILL_BYKK_HEATINGFURNACE,4,totalDamage,2,120,0,0,0,0,0,1); + parentObj.sendDestroyPacket(true); + break; + } +} + +function onEnd_appendage_kk_goblin_bykk(appendage) +{ + local sqrChr = sq_GetCNRDObjectToSQRCharacter(appendage.getVar("sqrChr").get_obj_vector(0)); + if(!sqrChr || sqrChr.getState() == STATE_DIE) return; + if(sqrChr.getVar("countofhomunculus").getInt(11) < 1) return; + sqrChr.getVar("countofhomunculus").setInt(11, sqrChr.getVar("countofhomunculus").getInt(11) - 1); + print("number = "+sqrChr.getVar("countofhomunculus").getInt(11)); +} + +function drawAppend_appendage_sweetcandybar_bykk(appendage, isOver, x, y, isFlip) +{ + local obj = appendage.getParent(); + if (!obj) { + appendage.setValid(false); + return; + } + local var = appendage.getVar(); + local Ani = var.GetAnimationMap("candynormal", "character/mage/effect/animation/witch_bykk/sweetcandybar/candy-normal.ani"); + if (Ani && isOver) { + sq_AnimationProc(Ani); + sq_drawCurrentFrame(Ani, x, y - 140, isFlip); + } +} + +function onStart_appendage_friendlyfamiliar_bykk(appendage) +{ + local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent()); + if(!parentObj || parentObj.getState() == STATE_DIE){appendage.setValid(false);return;} + + local skillLevel = parentObj.sq_GetSkillLevel(SKILL_BYKK_FRIENDLYFAMILIAR); + local value1 = sq_GetLevelData(parentObj, SKILL_BYKK_FRIENDLYFAMILIAR, 9, skillLevel); + local change_appendage = appendage.sq_getChangeStatus("friendlyfamiliar"); + if(!change_appendage) change_appendage = appendage.sq_AddChangeStatus("friendlyfamiliar",parentObj, parentObj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK, true, value1); + if(change_appendage){ + change_appendage.clearParameter(); + change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_MAGICAL_ATTACK, true, (value1 * 0.1).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_PHYSICAL_ATTACK, true, (value1 * 0.1).tofloat()); + } +} + +function onStart_appendage_homunculus_bykk(appendage) +{ + // +} + +function onStart_appendage_lapisphilosophorum_bykk(appendage) +{ + // +} + +function onStart_appendage_redcandy_bykk(appendage) +{ + local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent()); + if(!parentObj || parentObj.getState() == STATE_DIE){appendage.setValid(false);return;} + + local skillLevel = parentObj.sq_GetSkillLevel(SKILL_BYKK_REDCANDY); + local value1 = sq_GetLevelData(parentObj, SKILL_BYKK_REDCANDY, 0, skillLevel); + local change_appendage = appendage.sq_getChangeStatus("redcandy"); + if(!change_appendage) change_appendage = appendage.sq_AddChangeStatus("redcandy",parentObj, parentObj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK, true, value1); + if(change_appendage){ + change_appendage.clearParameter(); + change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_MAGICAL_ATTACK, true, (value1 * 0.1).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_PHYSICAL_ATTACK, true, (value1 * 0.1).tofloat()); + } +} + +function onStart_appendage_successpremonition_bykk(appendage) +{ + local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent()); + if(!parentObj || parentObj.getState() == STATE_DIE){appendage.setValid(false);return;} + + local skillLevel = parentObj.sq_GetSkillLevel(SKILL_BYKK_SUCCESSPREMONITION); + local value1 = sq_GetLevelData(parentObj, SKILL_BYKK_SUCCESSPREMONITION, 4, skillLevel); + local value2 = sq_GetLevelData(parentObj, SKILL_BYKK_SUCCESSPREMONITION, 5, skillLevel); + local change_appendage = appendage.sq_getChangeStatus("successpremonition"); + if(!change_appendage) change_appendage = appendage.sq_AddChangeStatus("successpremonition",parentObj, parentObj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK, true, value1); + if(change_appendage){ + change_appendage.clearParameter(); + change_appendage.addParameter(CHANGE_STATUS_TYPE_MAGICAL_CRITICAL_HIT_RATE, false, (value1 * 0.1).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_MAGICAL_CRITICAL_DAMAGE_RATE, true, (value2 / 0.667).tofloat()); + } +} + +function onStart_appendage_mpregenrateup_bykk(appendage) +{ + local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent()); + if(!parentObj || parentObj.getState() == STATE_DIE){appendage.setValid(false);return;} + + local skillLevel = parentObj.sq_GetSkillLevel(41); + + appendage.setAppendCauseSkill(BUFF_CAUSE_SKILL, ENUM_CHARACTERJOB_MAGE, 41, skillLevel); + appendage.setEnableIsBuff(true); + appendage.setBuffIconImage(29); //sprite_common_commoneffect + + setDamageRate_Witch_bykk(parentObj); +} + +function procSkill_Witch_bykk(obj) +{ + //obj.setSkillCommandEnable(SKILL_BYKK_JACKOHALLOWEEN, false); + if(sq_GetIntData(obj, SKILL_BYKK_HOMUNCULUS, 12) > 0) obj.setSkillCommandEnable(109, false); + if(sq_GetLevelData(obj, SKILL_BYKK_MEGADRILL, 9, sq_GetSkillLevel(obj, SKILL_BYKK_MEGADRILL)) > 0) obj.setSkillCommandEnable(SKILL_BYKK_JACKOHALLOWEEN, false); + if(sq_GetLevelData(obj, SKILL_BYKK_MEGADRILL, 10, sq_GetSkillLevel(obj, SKILL_BYKK_MEGADRILL)) > 0) obj.setSkillCommandEnable(SKILL_BYKK_UROBOROS, false); +} + + + + +function setCustomData_po_witch_bykk_kak(obj, receiveData) +{ + if(!obj) return; + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + if(!sqrChr) return; + local skillIndex = receiveData.readDword(); + local subtype = receiveData.readDword(); + + obj.getVar("skillIndex").clear_vector(); + obj.getVar("skillIndex").push_vector(skillIndex); + obj.getVar("subtype").clear_vector(); + obj.getVar("subtype").push_vector(subtype); + + switch(skillIndex){ + case SKILL_BYKK_ACIDCLOUD://魔道酸雨雲 + switch(subtype){ + case 1://雲 + local totalDamage = receiveData.readDword(); + local lifeTime = receiveData.readDword(); + local hitTime = receiveData.readDword(); + local successType = receiveData.readDword(); + local totalDamage2 = receiveData.readDword(); + local sizeRate = 100 + sq_GetLevelData(sqrChr, SKILL_BYKK_ACIDCLOUD, 6, sq_GetSkillLevel(sqrChr, SKILL_BYKK_ACIDCLOUD)); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(successType); + obj.getVar("custom").push_vector(lifeTime); + local lightningtime = sq_GetLevelData(sqrChr, SKILL_BYKK_ACIDCLOUD, 9, sq_GetSkillLevel(sqrChr, SKILL_BYKK_ACIDCLOUD)); + if(successType >= 3){ + local speedRate = sq_GetLevelData(sqrChr, SKILL_BYKK_LAPISPHILOSOPHORUM, 3, sq_GetSkillLevel(sqrChr, SKILL_BYKK_LAPISPHILOSOPHORUM)); + lightningtime = (lightningtime.tofloat() * (1000.0 - speedRate.tofloat()) / 1000.0).tointeger(); + } + obj.getVar("custom").push_vector(lightningtime); + obj.getVar("custom").push_vector(sizeRate); + obj.getVar("custom").push_vector(totalDamage2); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 0)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.setTimeEvent(0,lifeTime,1,false); + if(successType >= 1) obj.setTimeEvent(1,hitTime,-1,false); + else obj.setTimeEvent(1,hitTime * 2,-1,false); + obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 2://冰雨雲 + local totalDamage = receiveData.readDword(); + local lifeTime = receiveData.readDword(); + local hitTime = receiveData.readDword(); + local successType = receiveData.readDword(); + local prob = receiveData.readDword();0 + local level = receiveData.readDword(); + local time = receiveData.readDword(); + local damageRate = receiveData.readDword(); + local totalDamage2 = totalDamage * damageRate / 100; + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(lifeTime); + obj.getVar("custom").push_vector(0); + obj.getVar("custom").push_vector(totalDamage2); + obj.getVar("custom").push_vector(prob); + obj.getVar("custom").push_vector(level); + obj.getVar("custom").push_vector(time); + obj.getVar("custom").push_vector(totalDamage); + obj.getVar("custom").push_vector(hitTime); + if(sq_GetLevelData(sqrChr, SKILL_BYKK_ACIDCLOUD, 8, sq_GetSkillLevel(sqrChr, SKILL_BYKK_ACIDCLOUD)) > 0) obj.getVar("custom").push_vector(1); + //obj.setTimeEvent(0,lifeTime,1,false); + obj.setTimeEvent(1,hitTime,-1,false); + obj.setMapFollowParent(obj.getParent()); + obj.setMapFollowType(1); + sq_SetCurrentDirection(obj, ENUM_DIRECTION_RIGHT); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 3://雷電 + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 3)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/acidcloud/thunder.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + sizeRate = sizeRate.tofloat() / 100.0; + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + break; + case 4: + case 5: + case 6: + case 7: + if(subtype == 7){ + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 2)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + } + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(obj.getZPos()); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case SKILL_BYKK_ANTIGRAVITYSTARTER://反重力裝置 + switch(subtype){ + case 1: + local totalDamage = receiveData.readDword(); + local range = receiveData.readDword(); + local successType = receiveData.readDword(); + local totalDamage2 = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(range); + obj.getVar("custom").push_vector(successType); + obj.getVar("custom").push_vector(totalDamage2); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 6)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + obj.setTimeEvent(1,333,1,false); + obj.setTimeEvent(2,800,1,false); + break; + case 2: + local range = receiveData.readDword(); + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/magiccircle.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(10002,sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/magiccircle-aura-up1.ani"),true); + currentAni.addLayerAnimation(10002,sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/magiccircle-aura-up2.ani"),true); + currentAni.addLayerAnimation(10002,sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/magiccircle-aura-up3.ani"),true); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/magiccircle-aura-down1.ani"),true); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/magiccircle-aura-down2.ani"),true); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/magiccircle-aura-down3.ani"),true); + + local sizeRate = range.tofloat() / 400.0; + currentAni.setImageRateFromOriginal(sizeRate, sizeRate);//增加ani 寬度跟高度率 + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);//增加ani als附加 ani大小比例 + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); + break; + case 3: + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 7)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/antigravitystartersub.ani"); + obj.setCurrentAnimation(ani); + break; + case 4: + local successType = receiveData.readDword(); + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/tube-normal.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + switch(successType){ + case 0: + currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/tube-failed.ani"),true); + break; + case 1: + currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/tube-success.ani"),true); + break; + case 2: + case 3: + currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/tube-success.ani"),true); + currentAni.addLayerAnimation(0,sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/tube-great.ani"),true); + break; + } + sq_SetCurrentDirection(obj, ENUM_DIRECTION_RIGHT); + break; + } + break; + case SKILL_BYKK_BLACKMANTLE://暗影鬥篷 + switch(subtype){ + case 1: + local ani = sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/blackmantle/001_down_n.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/blackmantle/001_up_d.ani"),true); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/blackmantle/002_up_n.ani",0,-1,-1); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/blackmantle/002_down_d.ani",0,-1,-1); + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_COVER); + break; + case 2: + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 8)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local lifeTime = receiveData.readDword(); + local prob = receiveData.readDword(); + local level = receiveData.readDword(); + local time = receiveData.readDword(); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_BLIND, prob, level, time); + obj.setTimeEvent(0,lifeTime,1,false); + obj.setTimeEvent(1,lifeTime - 1500,1,false); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 3: + local lifeTime = receiveData.readDword(); + obj.setTimeEvent(3,lifeTime + 480,1,false); + local totalDamage = receiveData.readDword(); + local prob = receiveData.readDword(); + local level = receiveData.readDword(); + local time = receiveData.readDword(); + local speedRate = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(totalDamage); + obj.getVar("custom").push_vector(prob); + obj.getVar("custom").push_vector(level); + obj.getVar("custom").push_vector(time); + obj.getVar("custom").push_vector(lifeTime); + obj.getVar("custom").push_vector(speedRate); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case SKILL_BYKK_BROOMSPIN://旋轉掃把 + switch(subtype){ + case 1: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/dummy.ani"); + obj.setCurrentAnimation(ani); + local time = receiveData.readDword(); + obj.setTimeEvent(0,time,1,false); + obj.setTimeEvent(1,50,-1,false); + sqrChr.getVar("broomspinObj").clear_obj_vector(); + sqrChr.getVar("broomspinObj").push_obj_vector(obj); + local parentObj = obj.getParent(); + local appendage = CNSquirrelAppendage.sq_AppendAppendage(parentObj, obj, SKILL_BYKK_BROOMSPIN, false,"Appendage/Character/ap_common_suck.nut", false); + if(appendage){ + appendage.sq_SetValidTime(time); + CNSquirrelAppendage.sq_Append(appendage, parentObj, obj); + local auraAppendage = appendage.sq_getAuraMaster("broonspinAura"); + if(!auraAppendage) auraAppendage = appendage.sq_AddAuraMaster("broonspinAura",parentObj, obj, 1200, 18, 5, 0); + if(auraAppendage) auraAppendage.setAttractionInfo(450, 450, 100, 100); + } + break; + case 2: + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 9)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/broomspincrash/floor.ani"); + obj.setCurrentAnimation(ani); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/broomspincrash/crash.ani",0,0,0); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/broomspincrash/over.ani",0,0,0); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/broomspincrash/under.ani",0,0,0); + break; + } + break; + case SKILL_BYKK_ELECTRICRABBIT://光電兔 + switch(subtype){ + case 1: + case 4: + local successType = receiveData.readDword(); + local totalDamage = receiveData.readDword(); + local prob = receiveData.readDword(); + local time = receiveData.readDword(); + local damage = receiveData.readDword(); + local level = receiveData.readDword(); + local damageRate = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(successType); + obj.getVar("custom").push_vector(totalDamage); + obj.getVar("custom").push_vector(prob); + obj.getVar("custom").push_vector(time); + obj.getVar("custom").push_vector(damage); + obj.getVar("custom").push_vector(level); + obj.getVar("custom").push_vector(damageRate); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 2: + local successType = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(successType); + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 3: + local sub = receiveData.readDword(); + local totalDamage = receiveData.readDword(); + local aniPath = "passiveobject/witch_bykk/animation/elecrabbit/explosion/explosion_dodge.ani"; + if(sub >= 1) aniPath = "passiveobject/witch_bykk/animation/elecrabbit/talisman/explosion/explosion_dodge.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 10)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.sq_AddObjectParticleCreater("particle/electricrabbitdestroy1.ptl"); + obj.sq_AddObjectParticleCreater("particle/electricrabbitdestroy2.ptl"); + obj.sq_AddObjectParticleCreater("particle/electricrabbitdestroy3.ptl"); + obj.sq_AddObjectParticleCreater("particle/electricrabbitdestroy4.ptl"); + obj.sq_AddObjectParticleCreater("particle/electricrabbitdestroy5.ptl"); + obj.sq_AddObjectParticleCreater("particle/electricrabbitdestroy6.ptl"); + obj.sq_SetObjectParticlePos(0, 0, 50); + obj.sq_PlaySound("ELETRIC_RABBIT_EXP"); + break; + } + break; + case SKILL_BYKK_ENHANCEDMAGICMISSILE://改良魔法星彈 + switch(subtype){ + case 1: + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 12)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local successType = receiveData.readDword(); + local prob = receiveData.readDword(); + local time = receiveData.readDword(); + local damage = receiveData.readDword(); + local damageRate = receiveData.readDword(); + local level = receiveData.readDword(); + local sub = sq_GetIntData(sqrChr, SKILL_BYKK_ENHANCEDMAGICMISSILE, 11); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(successType); + obj.getVar("custom").push_vector(prob); + obj.getVar("custom").push_vector(time); + obj.getVar("custom").push_vector(damage); + obj.getVar("custom").push_vector(damageRate); + obj.getVar("custom").push_vector(level); + if(sub > 0){ + obj.getVar("custom").push_vector(2); + obj.getVar("custom").push_vector(1); + } + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case SKILL_BYKK_FLUORECOLLIDER://電鳗碰撞機 + switch(subtype){ + case 1: + sqrChr.getVar("fluorecollider").clear_obj_vector(); + sqrChr.getVar("fluorecollider").push_obj_vector(obj); + local sub = receiveData.readDword(); + local lifeTime = receiveData.readDword(); + local successType = receiveData.readDword(); + local hitTime = receiveData.readDword(); + local totalDamage = receiveData.readDword(); + local damageRate = receiveData.readDword(); + local range = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(successType); + obj.getVar("custom").push_vector(range); + obj.getVar("custom").push_vector(sub); + local totalDamage2 = (totalDamage.tofloat() * damageRate.tofloat() / 100.0).tointeger(); + obj.getVar("custom").push_vector(totalDamage2); + obj.getVar("custom").push_vector(lifeTime); + local friendlyfa_level = sq_GetSkillLevel(sqrChr, SKILL_BYKK_FRIENDLYFAMILIAR); + if(friendlyfa_level > 0){ + local speedRate = sq_GetLevelData(sqrChr, SKILL_BYKK_FRIENDLYFAMILIAR, 8, friendlyfa_level); + obj.getVar("custom").push_vector(speedRate); + } + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 13)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + if(successType >= 2){ + local skill_level = sq_GetSkillLevel(sqrChr, SKILL_BYKK_FLUORECOLLIDER); + local level = sq_GetSkillLevel(sqrChr, 174) + 20; + local prob = sq_GetLevelData(sqrChr,SKILL_BYKK_FLUORECOLLIDER, 6, skill_level) / 10; + local time = sq_GetLevelData(sqrChr,SKILL_BYKK_FLUORECOLLIDER, 8, skill_level); + local damage = sq_GetLevelData(sqrChr,SKILL_BYKK_FLUORECOLLIDER, 9, skill_level); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_LIGHTNING, prob, level, time,damage); + } + obj.setTimeEvent(1,hitTime / 2,-1,false); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case SKILL_BYKK_FUSIONCRAFT://技藝融合 + break; + case SKILL_BYKK_HEATINGFURNACE://爆炎加熱爐 + switch(subtype){ + case 1: + sqrChr.getVar("heatingfurnace").clear_obj_vector(); + sqrChr.getVar("heatingfurnace").push_obj_vector(obj); + obj.getVar("custom").clear_vector(); + for(local i = 0;i < 10; i++){ + obj.getVar("custom").push_vector(0); + } + local Delay = receiveData.readDword(); + local successType = receiveData.readDword(); + local homunculus = receiveData.readDword(); + obj.getVar("custom").set_vector(0,Delay); + obj.getVar("custom").set_vector(1,successType); + obj.getVar("custom").set_vector(2,homunculus); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 2://失敗 + local aniPath = "passiveobject/witch_bykk/animation/heatingfurnace/fail_new/";// + local ani = sq_CreateAnimation("",aniPath + "heatingfurnacenewnew_39.ani"); + obj.setCurrentAnimation(ani);// + local pooledObj = createOnlyDrawObject_witch_bykk(obj,aniPath + "heatingfurnacenewnew_33.ani",true,obj.getDirection(),sq_GetXPos(obj),sq_GetYPos(obj) + 1,70,ENUM_DRAWLAYER_NORMAL); + obj.setTimeEvent(0,720,1,false); + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 19)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local add_hitMax = receiveData.readDword(); + obj.getVar("custom").setInt(10, add_hitMax); + break; + case 3://石塊 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 24)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local successType = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(successType); + local aniPath1 = "passiveobject/character/mage/animation/heatingfurnace/stone_piece_collision.ani"; + if(successType >= 1) aniPath1 = "passiveobject/character/mage/animation/heatingfurnace/stone_piece_none.ani"; + local ani = sq_CreateAnimation("",aniPath1); + obj.setCurrentAnimation(ani);// + local currentAni = obj.getCurrentAnimation(); + local aniPath = "passiveobject/character/mage/animation/heatingfurnace/"; + switch(successType){//根據生成類型附加效果 + case 0: + if(sq_getRandom(1,100) >= 50) currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "stone_piece_failed1.ani"),true); + else currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "stone_piece_failed2.ani"),true); + break; + case 1: + if(sq_getRandom(1,100) >= 50){ + currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "stone_piece_failed1.ani"),true); + currentAni.addLayerAnimation(2,sq_CreateAnimation("",aniPath + "stone_piece_normal1.ani"),true); + } + else{ + currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "stone_piece_failed2.ani"),true); + currentAni.addLayerAnimation(2,sq_CreateAnimation("",aniPath + "stone_piece_normal2.ani"),true); + } + break; + case 2: + case 3: + if(sq_getRandom(1,100) >= 50){ + currentAni.addLayerAnimation(2,sq_CreateAnimation("",aniPath + "stone_piece_great1.ani"),true); + currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "stone_piece_normal1.ani"),true); + } + else{ + currentAni.addLayerAnimation(2,sq_CreateAnimation("",aniPath + "stone_piece_great2.ani"),true); + currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "stone_piece_normal2.ani"),true); + } + break; + } + local angle = receiveData.readDword(); + local angleMax = receiveData.readDword(); + local sub = receiveData.readDword(); + local damageRate = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local totalDamage2 = (totalDamage.tofloat() * damageRate.tofloat() / 100.0).tointeger(); + obj.getVar("custom").push_vector(totalDamage2); + obj.getVar("custom").push_vector(sizeRate); + obj.getVar("custom").push_vector(angle); + obj.getVar("custom").push_vector(angleMax); + obj.getVar("custom").push_vector(sub); + local anglea = 360 / angleMax * angle; + local speed_X = 110 + sq_getRandom(0,40); + local speed_Z = 250 + sq_getRandom(0,100); + local direction = obj.getDirection(); + local tiaozheng = 0; + local tiaozheng2 = angleMax * 5; + if(sub > 0){ + switch(sub){ + case 1: anglea = 45;if(angle > angleMax / 4 * 3) tiaozheng = 100; break; + case 2: anglea = 90;if(angle > angleMax / 2) tiaozheng = 100; break; + case 3: anglea = 135;if(angle > angleMax / 2 && angle < angleMax / 4 * 3) tiaozheng = 100; break; + case 4: anglea = 0;if(angle < angleMax / 2 || angle > angleMax / 4 * 3) tiaozheng = 100; break; + case 6: anglea = 180;if(angle > angleMax / 2 && angle < angleMax / 4 * 3) tiaozheng = 100; break; + case 7: anglea = -45;if(angle < angleMax / 4) tiaozheng = 100; break; + case 8: anglea = -90;if(angle < angleMax / 2) tiaozheng = 100; break; + case 9: anglea = -135;if(angle > angleMax / 4 && angle < angleMax / 2) tiaozheng = 100; break; + } + } + + // obj.getVar("custom").push_vector(anglea); + // obj.getVar("custom").push_vector(speed_X); + // obj.getVar("custom").push_vector(speed_Z); + // obj.getVar("custom").push_vector(sq_GetXPos(obj)); + // obj.getVar("custom").push_vector(sq_GetYPos(obj)); + // obj.getVar("custom").push_vector(sq_GetZPos(obj)); + obj.sq_SetMoveParticle("particle/heatingfurnace_stone.ptl", (anglea).tofloat(), 0.0); + sq_SetSpeedToMoveParticle(obj,0,speed_X + tiaozheng + tiaozheng2); + sq_SetSpeedToMoveParticle(obj,1,tiaozheng * 15 / 10); + sq_SetSpeedToMoveParticle(obj,2,speed_Z); + // obj.setTimeEvent(0,10,4,false); + break; + case 4://爆炸 + local ani = sq_CreateAnimation("","passiveobject/common/animation/fireexplosion.ani"); + obj.setCurrentAnimation(ani); + local totalDamage = receiveData.readDword(); + local successType = receiveData.readDword(); + obj.sq_PlaySound("B_FIRE_EXPLOSION"); + local currentAni = obj.getCurrentAnimation();//得到當前ani + local sizeRate = receiveData.readDword(); + local angle = receiveData.readDword(); + local angleMax = receiveData.readDword(); + local sub = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(sizeRate); + if(sub > 0){ + if(angle == 0){ + if(successType >= 1) sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 25)); + else sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 26)); + totalDamage = totalDamage * angleMax; + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.setTimeEvent(1, 200, 1, true); + obj.setTimeEvent(2, 50, 1, true); + obj.setTimeEvent(3, 15, 2, true); + obj.setTimeEvent(4, 100, 1, true); + } + else{ + sq_SetFrameDelayTime(currentAni, 0, 50); + } + } + else if(sub == 0){ + if(successType >= 1) sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 25)); + else sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 26)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.setTimeEvent(1, 200, 1, true); + if(successType <= 1) obj.setTimeEvent(2, 50, 1, true); + if(successType <= 1) obj.setTimeEvent(3, 15, 1, true); + if(successType <= 2) obj.setTimeEvent(4, 100, 1, true); + } + sizeRate = sizeRate.tofloat() / 100.0; + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate);//攻擊框,x y z比率 + break; + case 5://尾巴 + local anglea = receiveData.readDword(); + local speed_X = receiveData.readDword(); + local speed_Z = receiveData.readDword(); + local sub = receiveData.readDword(); + local aniPath1 = "passiveobject/witch_bykk/animation/heatingfurnace/",aniPath2 = "stone_tail1.ani"; + switch(sub){ + case 2:aniPath2 = "stone_tail2.ani"; break; + case 3:aniPath2 = "stone_tail3.ani"; break; + case 4:aniPath2 = "stone_tail4.ani"; break; + } + local ani = sq_CreateAnimation("",aniPath1 + aniPath2); + obj.setCurrentAnimation(ani); + obj.sq_SetMoveParticle("particle/heatingfurnace_stone_effcet.ptl", (anglea).tofloat(), 0.0); + sq_SetSpeedToMoveParticle(obj,0,speed_X); + sq_SetSpeedToMoveParticle(obj,2,speed_Z); + break; + case 6://護石爆炸 + local totalDamage = receiveData.readDword(); + totalDamage = totalDamage / 8; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 20)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/heatingfurnace/heatburst/mk2heatburstfront_01.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/heatingfurnace/heatburst/mk2heatburstback_01.ani"),true); + obj.setTimeEvent(0,180,1,false); + break; + case 7://護石爆炸 + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local number_max = receiveData.readDword(); + local speedRate = receiveData.readDword(); + obj.getVar("custom").setInt(10, number_max); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 20)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/heatingfurnace/heatburst/mk2heatburstfront_01.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/heatingfurnace/heatburst/mk2heatburstback_01.ani"),true); + obj.setTimeEvent(0,180 / speedRate * 100,1,false); + local pAni = obj.getCurrentAnimation(); + sizeRate = sizeRate.tofloat() / 100.0; + pAni.setImageRateFromOriginal(sizeRate, sizeRate);//增加ani 宽度跟高度率 + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);//增加ani als附加 ani大小比例 + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate);//攻击框,x y z比率 + pAni.setSpeedRate(speedRate.tofloat()); + break; + } + break; + case SKILL_BYKK_HOMUNCULUS://魔道學助手 + switch(subtype){ + case 11://光電鳗電1 + local totalDamage = receiveData.readDword(); + local hitMax = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 48)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + local targetObj = sq_GetObject(sqrChr, group, uniqueId); + obj.getVar().clear_obj_vector(); + obj.getVar().push_obj_vector(targetObj); + obj.setTimeEvent(0,50,hitMax,true); + break; + case 12://光電鳗電2 + local totalDamage = receiveData.readDword(); + local hitMax = receiveData.readDword(); + local prob = receiveData.readDword(); + local level = receiveData.readDword(); + local time = receiveData.readDword(); + local damage = receiveData.readDword(); + obj.getVar().clear_vector(); + obj.getVar().push_vector(totalDamage); + obj.getVar().push_vector(prob); + obj.getVar().push_vector(level); + obj.getVar().push_vector(time); + obj.getVar().push_vector(damage); + obj.setTimeEvent(1,150,hitMax,true); + break; + case 13://光電鳗電3 + local ani = sq_CreateAnimation("","monster/character/mage/witch_bykk/fluore/animation/b/fluore_blightning"+sq_getRandom(1,3).tostring()+".ani"); + obj.setCurrentAnimation(ani); + local totalDamage = receiveData.readDword(); + local prob = receiveData.readDword(); + local level = receiveData.readDword(); + local time = receiveData.readDword(); + local damage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 48)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_LIGHTNING, prob, level, time, damage); + break; + case 21://暗影夜貓攻擊1 + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/fluto/skilla_attackloop_fluto.ani"); + obj.setCurrentAnimation(ani); + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 49)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.setTimeEvent(2,50,3,false); + break; + case 22://暗影夜貓攻擊2 + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/fluto/skilla_lastattack_fluto.ani"); + obj.setCurrentAnimation(ani); + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 50)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + break; + case 23://暗影夜貓攻擊3 + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/fluto/skillb_pluto.ani"); + obj.setCurrentAnimation(ani); + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 52)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local prob = receiveData.readDword(); + local level = receiveData.readDword(); + local time = receiveData.readDword(); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_HOLD, prob, level, time); + break; + case 24: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/fluto/skilla_attackloop_fluto.ani"); + obj.setCurrentAnimation(ani); + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 49)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.setTimeEvent(2,120,-1,false); + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + local targetObj = sq_GetObject(sqrChr, group, uniqueId); + sq_moveWithParent(targetObj, obj); + break; + case 31://冰霜雪人雲 + local totalDamage = receiveData.readDword(); + local hitMax = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(hitMax); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 53)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 32://冰霜雪人風暴 + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/jackfrostaskill/skillbloop_11.ani"); + obj.setCurrentAnimation(ani); + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 54)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local hitMax = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(hitMax); + local prob = receiveData.readDword(); + local level = receiveData.readDword(); + local time = receiveData.readDword(); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_FREEZE, prob, level, time); + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + local targetObj = sq_GetObject(sqrChr, group, uniqueId); + sq_moveWithParent(targetObj, obj); + obj.setTimeEvent(2,100,-1,false); + break; + case 41://傑克爆彈 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 55)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 42: + local ani = sq_CreateAnimation("","passiveobject/common/animation/fireexplosion.ani"); + obj.setCurrentAnimation(ani); + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 55)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local currentAni = obj.getCurrentAnimation(); + sq_SetAttackBoundingBoxSizeRate(currentAni, 1.5, 1.5, 1.5); + break; + } + break; + case SKILL_BYKK_JACKFROSTICEWATER://雪人刨冰 + switch(subtype){ + case 1: + local totalDamage = receiveData.readDword(); + local damageRate = receiveData.readDword(); + local damageRate2 = receiveData.readDword(); + local sub = receiveData.readDword(); + local totalDamage2 = (totalDamage.tofloat() * damageRate.tofloat() / 100.0).tointeger(); + local totalDamage3 = (totalDamage.tofloat() * damageRate2.tofloat() / 100.0).tointeger(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(totalDamage2); + obj.getVar("custom").push_vector(totalDamage3); + obj.getVar("custom").push_vector(sub); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 27)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 2: + local totalDamage = receiveData.readDword(); + local sub = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(0); + obj.getVar("custom").push_vector(0); + obj.getVar("custom").push_vector(sub); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 29)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case SKILL_BYKK_JACKOHALLOWEEN://搗蛋傑克 + switch(subtype){ + case 1: + local castTime = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(castTime); + sqrChr.getVar("jackohalloween_pumpkin").clear_obj_vector(); + sqrChr.getVar("jackohalloween_pumpkin").push_obj_vector(obj); + // obj.setMapFollowParent(sqrChr); + // obj.setMapFollowType(1); + local totalDamage = receiveData.readDword(); + local hitTime = receiveData.readDword(); + local lifeTime = receiveData.readDword(); + local hitMax = receiveData.readDword(); + obj.getVar("custom").setInt(11, lifeTime); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,0,1,0,obj.getDirection(),SKILL_BYKK_JACKOHALLOWEEN,2,totalDamage,hitTime,hitMax,0,0,0,0,0,0); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 2: + local parentObj = obj.getParent(); + parentObj.getVar("jackohalloween_lava").clear_obj_vector(); + parentObj.getVar("jackohalloween_lava").push_obj_vector(obj); + sq_moveWithParent(parentObj, obj); + // obj.setMapFollowParent(sqrChr); + // obj.setMapFollowType(1); + local totalDamage = receiveData.readDword(); + local hitTime = receiveData.readDword(); + local hitMax = receiveData.readDword(); + obj.sq_SetMaxHitCounterPerObject(hitMax); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(totalDamage); + obj.getVar("custom").push_vector(hitTime); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case SKILL_BYKK_LAVAPOTION://熔岩藥瓶 + switch(subtype){ + case 1://石塊 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 33)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/lapisphilosophorumexplosion.ani"); + obj.setCurrentAnimation(ani); + local sizeRate_rec = receiveData.readDword(); + local currentAni = obj.getCurrentAnimation(); + local sizeRate = sizeRate_rec.tofloat() / 100.0 * 1.35; + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + break; + case 2://必定失敗爆炸 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 33)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.setTimeEvent(1,240,1,false); + break; + case 3://成功 + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 32)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local lifeTime = receiveData.readDword(); + local hitTime = receiveData.readDword(); + obj.setTimeEvent(2,lifeTime,1,false); + obj.setTimeEvent(3,hitTime,-1,false); + local skill_level = sq_GetSkillLevel(sqrChr, SKILL_BYKK_LAVAPOTION); + local totalDamage2 = sq_GetLevelData(sqrChr,SKILL_BYKK_LAVAPOTION, 13, skill_level); + local prob = sq_GetLevelData(sqrChr,SKILL_BYKK_LAVAPOTION, 4, skill_level) / 10; + local time = sq_GetLevelData(sqrChr,SKILL_BYKK_LAVAPOTION, 6, skill_level); + local damage = sq_GetLevelData(sqrChr,SKILL_BYKK_LAVAPOTION, 7, skill_level); + local speedRate = sq_GetLevelData(sqrChr,SKILL_BYKK_LAVAPOTION, 11, skill_level); + local jumpRate = sq_GetLevelData(sqrChr,SKILL_BYKK_LAVAPOTION, 12, skill_level); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_BURN, prob, sq_GetSkillLevel(sqrChr, 174), time,damage); + local sizeRate = receiveData.readDword(); + local successType = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(sizeRate); + obj.getVar("custom").push_vector(successType); + obj.getVar("custom").push_vector(speedRate); + obj.getVar("custom").push_vector(jumpRate); + obj.getVar("custom").push_vector(totalDamage2); + obj.getVar("targetObj").clear_obj_vector(); + if(sq_GetZPos(obj) > 0){ + obj.getVar("move").clear_vector(); + obj.getVar("move").push_vector(sq_GetXPos(obj)); + obj.getVar("move").push_vector(sq_GetZPos(obj)); + obj.getVar("move").push_vector(100); + } + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 4: + obj.getVar("move").clear_vector(); + obj.getVar("move").push_vector(sq_GetXPos(obj)); + obj.getVar("move").push_vector(sq_GetYPos(obj)); + obj.getVar("move").push_vector(sq_GetZPos(obj)); + obj.getVar("move").push_vector(sq_getRandom(0,180)); + obj.getVar("move").push_vector(sq_getRandom(0,30)); + obj.getVar("move").push_vector(sq_getRandom(70,150)); + obj.getVar("move").push_vector(sq_getRandom(0,1)); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case SKILL_BYKK_LOLLIPOPCRUSH://超級棒棒糖 + switch(subtype){ + case 0: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/lollipopcrush/lollipopcrush.ani"); + obj.setCurrentAnimation(ani); + obj.setTimeEvent(0,200,1,false); + break; + case 1: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/lollipopcrush/lollipopcrushaircast_body.ani"); + obj.setCurrentAnimation(ani); + break; + case 9: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/lollipopcrush/lollipopcrushtalismanlandattack_body.ani"); + obj.setCurrentAnimation(ani); + break; + case 10: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/lollipopcrush/lollipopcrushtalismanready_body.ani"); + obj.setCurrentAnimation(ani); + obj.setTimeEvent(0,100,1,false); + break; + case 11: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/lollipopcrush/lollipopcrushtalismanattack_body.ani"); + obj.setCurrentAnimation(ani); + break; + case 20: + local sub = receiveData.readDword(); + local totalDamage = receiveData.readDword(); + local level = receiveData.readDword(); + local prob = receiveData.readDword(); + local time = receiveData.readDword(); + local damage = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(sub); + obj.getVar("custom").push_vector(totalDamage); + obj.getVar("custom").push_vector(level); + obj.getVar("custom").push_vector(prob); + obj.getVar("custom").push_vector(time); + obj.getVar("custom").push_vector(damage); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + if(subtype == 0 || subtype == 1 || subtype == 9 || subtype == 10 || subtype == 11){ + local delayTime = receiveData.readDword(); + local speedRate = 12000.0 / delayTime.tofloat(); + if(subtype == 1) speedRate = 6000.0 / delayTime.tofloat(); + if(subtype == 9) speedRate = 12000.0 / delayTime.tofloat(); + if(subtype == 10) speedRate = 5000.0 / delayTime.tofloat(); + if(subtype == 11) speedRate = 12000.0 / delayTime.tofloat(); + local currentAni = obj.getCurrentAnimation(); + currentAni.setSpeedRate(speedRate); + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 56)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local extra_num = receiveData.readDword(); + local damageRate = receiveData.readDword(); + local damageRate2 = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + print(sizeRate); + local totalDamage2 = (totalDamage.tofloat() * damageRate.tofloat() / 100.0).tointeger(); + local totalDamage3 = (totalDamage.tofloat() * damageRate2.tofloat() / 100.0).tointeger(); + local skill_level = sq_GetSkillLevel(sqrChr,SKILL_BYKK_LOLLIPOPCRUSH); + local blind_prob = sq_GetLevelData(sqrChr,SKILL_BYKK_LOLLIPOPCRUSH,4,skill_level); + local blind_level = sq_GetLevelData(sqrChr,SKILL_BYKK_LOLLIPOPCRUSH,5,skill_level); + local blind_time = sq_GetLevelData(sqrChr,SKILL_BYKK_LOLLIPOPCRUSH,6,skill_level); + local blind_stuckrate = sq_GetLevelData(sqrChr,SKILL_BYKK_LOLLIPOPCRUSH,8,skill_level); + local lightning_prob = sq_GetLevelData(sqrChr,SKILL_BYKK_LOLLIPOPCRUSH,10,skill_level); + local lightning_time = sq_GetLevelData(sqrChr,SKILL_BYKK_LOLLIPOPCRUSH,11,skill_level); + local lightning_damage = sq_GetLevelData(sqrChr,SKILL_BYKK_LOLLIPOPCRUSH,12,skill_level); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(extra_num); + obj.getVar("custom").push_vector(totalDamage2); + obj.getVar("custom").push_vector(totalDamage3); + obj.getVar("custom").push_vector(blind_prob); + obj.getVar("custom").push_vector(blind_level); + obj.getVar("custom").push_vector(blind_time); + obj.getVar("custom").push_vector(blind_stuckrate); + obj.getVar("custom").push_vector(lightning_prob); + obj.getVar("custom").push_vector(lightning_time); + obj.getVar("custom").push_vector(lightning_damage); + local currentAni = obj.getCurrentAnimation(); + sizeRate = sizeRate.tofloat() / 100.0; + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + } + break; + case SKILL_BYKK_MEGADRILL://冰霜鑽孔車 + switch(subtype){ + case 1://失敗形態 + local totalDamage = receiveData.readDword(); + local damageRate = receiveData.readDword(); + local sub = receiveData.readDword(); + local totalDamage2 = totalDamage * damageRate / 100; + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(totalDamage); + obj.getVar("custom").push_vector(totalDamage2); + obj.getVar("custom").push_vector(sub); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 2://普通形態 + case 12://普通形態 + local successType = receiveData.readDword(); + local moveX = receiveData.readDword(); + local totalDamage = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(successType); + obj.getVar("custom").push_vector(sq_GetXPos(obj)); + obj.getVar("custom").push_vector(sq_GetZPos(obj)); + obj.getVar("custom").push_vector(moveX); + obj.getVar("custom").push_vector(totalDamage); + sqrChr.getVar("megadrill").clear_obj_vector(); + sqrChr.getVar("megadrill").push_obj_vector(obj); + obj.setMapFollowParent(sqrChr); + obj.setMapFollowType(1); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 3://震蕩波 + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/crashfloor.ani"); + obj.setCurrentAnimation(ani); + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 34)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); + local sub = receiveData.readDword(); + if(sub > 1){ + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/crashcrash.ani"),true); + currentAni.addLayerAnimation(0,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/crashdust.ani"),true); + } + break; + case 4: + local Delay = receiveData.readDword(); + obj.setTimeEvent(0,Delay,1,false); + break; + } + break; + case SKILL_BYKK_TRANSFORMFLAPPER://變異蒼蠅拍 + switch(subtype){ + case 1: + local ani = sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/transformflapper/flyflap_d1.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/transformflapper/flyflap_n1.ani"),true); + local delayTime = receiveData.readDword(); + for(local i = 0; i < 11; i++){ + sq_SetFrameDelayTime(currentAni, i, delayTime); + } + return; + break; + case 2: + local ani = sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/transformflapper/flyflap_d2.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/transformflapper/flyflap_n2.ani"),true); + local delayTime = receiveData.readDword(); + for(local i = 0; i < 4; i++){ + sq_SetFrameDelayTime(currentAni, i, delayTime); + } + return; + break; + case 3: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/transformflapperex/transformflapper.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + local delayTime = receiveData.readDword(); + for(local i = 0; i < 11; i++){ + sq_SetFrameDelayTime(currentAni, i, delayTime); + } + sq_moveWithParent(sqrChr, obj); + break; + case 4: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/transformflapperex/transformflapperjump.ani"); + obj.setCurrentAnimation(ani); + local delayTime = receiveData.readDword(); + local currentAni = obj.getCurrentAnimation(); + for(local i = 0; i < 4; i++){ + sq_SetFrameDelayTime(currentAni, i, delayTime); + } + sq_moveWithParent(sqrChr, obj); + break; + case 10: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/summonmonster_tau/attack1.ani"); + obj.setCurrentAnimation(ani); + local delayTime = receiveData.readDword(); + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 42)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + return; + break; + case 11: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/summonmonster_tau/attack2.ani"); + obj.setCurrentAnimation(ani); + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 43)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + return; + break; + case 12: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/summonmonster_tau/tacklerun.ani"); + obj.setCurrentAnimation(ani); + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 44)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + local targetObj = sq_GetObject(sqrChr, group, uniqueId); + sq_moveWithParent(targetObj, obj); + obj.setTimeEvent(0,1000,1,false); + obj.setTimeEvent(1,300,-1,false); + return; + break; + case 13: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/summonmonster_tau/earthbreakout.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(0,sq_CreateAnimation("","passiveobject/witch_bykk/animation/summonmonster_tau/earthbreakout1.ani"),true); + currentAni.addLayerAnimation(0,sq_CreateAnimation("","passiveobject/witch_bykk/animation/summonmonster_tau/earthbreakout2.ani"),true); + currentAni.addLayerAnimation(0,sq_CreateAnimation("","passiveobject/witch_bykk/animation/summonmonster_tau/earthbreakout3.ani"),true); + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 45)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + return; + break; + case 14: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/summonmonster_goblin/goblin_arrow10.ani"); + obj.setCurrentAnimation(ani); + obj.sq_SetMoveParticle("particle/goblin_fastthrowstone.ptl", 0.0, 0.0); + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 46)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + return; + break; + case 15: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/summonmonster_goblin/dark_effect1.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-17,sq_CreateAnimation("","passiveobject/witch_bykk/animation/summonmonster_goblin/dark_effect2.ani"),true); + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 47)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local sub = receiveData.readDword(); + switch(sub){ + case 0: obj.sq_SetMoveParticle("particle/goblin_dagger.ptl", 0.0, 0.0); break; + case 1: obj.sq_SetMoveParticle("particle/goblin_daggerdown.ptl", 0.0, 0.0); break; + case 2: obj.sq_SetMoveParticle("particle/goblin_daggerup.ptl", 0.0, 0.0); break; + } + return; + break; + } + local totalDamage = receiveData.readDword(); + local prob = receiveData.readDword(); + local level = receiveData.readDword(); + local time = receiveData.readDword(); + local successType = receiveData.readDword(); + local isSeal = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(prob); + obj.getVar("custom").push_vector(level); + obj.getVar("custom").push_vector(time); + obj.getVar("custom").push_vector(successType); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 41)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_CURSE, prob, level, time); + local pAni = obj.getCurrentAnimation(); + local sizeSet = (1.0+successType*0.1)*(100.0+sizeRate.tofloat())/100.0; + sq_SetAttackBoundingBoxSizeRate(pAni, sizeSet, sizeSet, sizeSet); + local skill_level = sq_GetSkillLevel(sqrChr,SKILL_BYKK_TRANSFORMFLAPPER); + local monsterprob = sq_GetLevelData(sqrChr,SKILL_BYKK_TRANSFORMFLAPPER,5,skill_level); + local monstertime = sq_GetLevelData(sqrChr,SKILL_BYKK_TRANSFORMFLAPPER,7,skill_level); + local sub_number1 = sq_GetLevelData(sqrChr,SKILL_BYKK_TRANSFORMFLAPPER,9,skill_level); + local sub_number2 = sq_GetLevelData(sqrChr,SKILL_BYKK_TRANSFORMFLAPPER,10,skill_level); + local monsterlevel = sq_GetSkillLevel(sqrChr, 174); + obj.getVar("custom").push_vector(monsterprob); + obj.getVar("custom").push_vector(monstertime); + obj.getVar("custom").push_vector(monsterlevel); + obj.getVar("custom").push_vector(isSeal); + obj.getVar("custom").push_vector(sub_number1); + obj.getVar("custom").push_vector(sub_number2); + obj.getVar("custom").push_vector(0); + break; + case SKILL_BYKK_TRANSFORMFLAPPEREX://超級蒼蠅拍 + switch(subtype){ + case 1: + local ani = sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/transformflapperex/flyflapex_landn.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/transformflapperex/flyflapex_landd.ani"),true); + break; + case 2: + local ani = sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/transformflapperex/flyflapex_jumpn.ani"); + obj.setCurrentAnimation(ani); + // local currentAni = obj.getCurrentAnimation(); + // currentAni.addLayerAnimation(-1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/transformflapperex/flyflapex_jumpd.ani"),true); + break; + case 3: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/transformflapperex/transformflapperex.ani"); + obj.setCurrentAnimation(ani); + sq_moveWithParent(sqrChr, obj); + break; + case 4: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/transformflapperex/transformflapperjumpex.ani"); + obj.setCurrentAnimation(ani); + sq_moveWithParent(sqrChr, obj); + break; + case 5: + local totalDamage = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(totalDamage); + obj.setTimeEvent(0,50,5,true); + local currentAni = obj.getCurrentAnimation(); + sq_SetFrameDelayTime(currentAni, 0, 100); + sq_SetFrameDelayTime(currentAni, 1, 300); + return; + break; + case 6: + local totalDamage = receiveData.readDword(); + //sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 41)); + //sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/transformflapperex/flyflapex_land_ground_crack.ani"); + obj.setCurrentAnimation(ani); + local sizeRate = receiveData.readDword(); + sizeRate = sizeRate.tofloat() / 100.0; + local currentAni = obj.getCurrentAnimation(); + sq_ClearAttackBox(currentAni); + currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/transformflapperex/flyflapex_land_front.ani"),true); + currentAni.setImageRateFromOriginal(sizeRate, sizeRate);//增加ani 寬度跟高度率 + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);//增加ani als附加 ani大小比例 + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + return; + break; + case 7: + local totalDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 41)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/transformflapperex/flyflapex_land_ground_crack_dummy.ani"); + obj.setCurrentAnimation(ani); + return; + break; + } + local delayTime = receiveData.readDword(); + local totalDamage = receiveData.readDword(); + local successType = receiveData.readDword(); + local isSeal = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(0); + obj.getVar("custom").push_vector(0); + obj.getVar("custom").push_vector(0); + obj.getVar("custom").push_vector(successType); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 41)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local pAni = obj.getCurrentAnimation(); + local speedRate = 98000.0 / delayTime.tofloat(); + if(subtype == 2) speedRate = 36000.0 / delayTime.tofloat(); + pAni.setSpeedRate(speedRate); + local sizeSet = (1.0+successType*0.1)*(100.0+sizeRate.tofloat())/100.0; + sq_SetAttackBoundingBoxSizeRate(pAni, sizeSet, sizeSet, sizeSet); + local skill_level = sq_GetSkillLevel(sqrChr,SKILL_BYKK_TRANSFORMFLAPPER); + local monsterprob = sq_GetLevelData(sqrChr,SKILL_BYKK_TRANSFORMFLAPPER,5,skill_level); + local monstertime = sq_GetLevelData(sqrChr,SKILL_BYKK_TRANSFORMFLAPPER,7,skill_level); + local sub_number1 = sq_GetLevelData(sqrChr,SKILL_BYKK_TRANSFORMFLAPPER,9,skill_level); + local sub_number2 = sq_GetLevelData(sqrChr,SKILL_BYKK_TRANSFORMFLAPPER,10,skill_level); + local monstertime = sq_GetLevelData(sqrChr,SKILL_BYKK_TRANSFORMFLAPPER,7,skill_level); + local monsterlevel = sq_GetSkillLevel(sqrChr, 174); + obj.getVar("custom").push_vector(monsterprob); + obj.getVar("custom").push_vector(monstertime); + obj.getVar("custom").push_vector(monsterlevel); + obj.getVar("custom").push_vector(isSeal); + obj.getVar("custom").push_vector(sub_number1); + obj.getVar("custom").push_vector(sub_number2); + obj.getVar("custom").push_vector(0); + break; + case SKILL_BYKK_UROBOROS://二覺 + switch(subtype){ + case 1://結束爆炸 + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/uroboros/explosion/disappear_body_front01.ani",0,-1,-1); + local pAni = pooledObj.getCurrentAnimation(); + pAni.setSpeedRate(400.0); + obj.setTimeEvent(0,210,1,false); + local totalDamage = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(totalDamage); + break; + case 2: + local ani = sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/uroboros/attack/attackset02_center.ani"); + obj.setCurrentAnimation(ani); + sqrChr.getVar("uroboros").clear_obj_vector(); + sqrChr.getVar("uroboros").push_obj_vector(obj); + sq_moveWithParent(sqrChr, obj); + obj.setMapFollowParent(sqrChr); + obj.setMapFollowType(1); + local totalDamage = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(totalDamage); + local hitTime = receiveData.readDword(); + obj.setTimeEvent(1,hitTime,-1,false); + break; + case 3: + local sub = receiveData.readDword(); + local aniPath = "passiveobject/witch_bykk/animation/uroboros/explosion_dark_dodge.ani"; + if(sub == 2) aniPath = "passiveobject/witch_bykk/animation/uroboros/explosion_fire_dodge.ani"; + if(sub == 3) aniPath = "passiveobject/witch_bykk/animation/uroboros/explosion_ice_dodge.ani"; + if(sub == 0) aniPath = "passiveobject/witch_bykk/animation/uroboros/explosion_light_dodge.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + local totalDamage = receiveData.readDword(); + print("totalDamage1111 = "+totalDamage); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 40)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.sq_PlaySound("R_UROBOROS_SPARK_EXP"); + break; + case 4: + local Delay = receiveData.readDword(); + obj.setTimeEvent(2,Delay,1,false); + break; + } + break; + } + + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo){ + local element_kk_fire = sqrChr.getVar("element_kk").getInt(0); + local element_kk_water = sqrChr.getVar("element_kk").getInt(1); + local element_kk_dark = sqrChr.getVar("element_kk").getInt(2); + local element_kk_light = sqrChr.getVar("element_kk").getInt(3); + //print(element_kk_fire+","+element_kk_water+","+element_kk_dark+","+element_kk_light); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE) && element_kk_fire > 0) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER) && element_kk_water > 0) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK) && element_kk_dark > 0) attackInfo.setElement(ENUM_ELEMENT_DARK); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT) && element_kk_light > 0) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + } +} + +function setState_po_witch_bykk_kak(obj, state, datas) +{ + if(!obj) return; + + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").get_vector(0); + local subtype = obj.getVar("subtype").get_vector(0); + obj.getVar("state").clear_vector(); + obj.getVar("state").push_vector(state); + + switch(skillIndex){ + case SKILL_BYKK_ACIDCLOUD://魔道酸雨雲 + switch(subtype){ + case 1: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/acidcloud/start_cloud.ani"); + obj.setCurrentAnimation(ani); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/acidcloud/cloud.ani"); + obj.setCurrentAnimation(ani); + local successType = obj.getVar("custom").get_vector(0); + local lifeTime = obj.getVar("custom").get_vector(1) - 480; + switch(successType){ + case 0://失敗 + sq_CreateParticle("passiveobject/witch_bykk/particle/acidrain.ptl", obj, 0, 0, 0, true, 80, 0, lifeTime / 80); + obj.setTimeEvent(3,800,1,false); + break; + case 1://成功 + case 2://大成功 + sq_CreateParticle("passiveobject/witch_bykk/particle/acidrain.ptl", obj, 0, 0, 0, true, 20, 0, lifeTime / 20); + obj.setTimeEvent(3,800,1,false); + if(successType >= 2) obj.setTimeEvent(2,obj.getVar("custom").get_vector(2),-1,false); + break; + } + local sizeRate = obj.getVar("custom").get_vector(3); + local currentAni = obj.getCurrentAnimation(); + sizeRate = sizeRate.tofloat() / 100.0; + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + break; + case 22: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/acidcloud/start.ani"); + obj.setCurrentAnimation(ani); + obj.sq_PlaySound("ACIDCLOUD_CREATE"); + break; + } + break; + case 2: + //sqrChr.getVar("Debug_SubState").set_vector(9,state); + switch(state){ + case 20://開始 + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/acidcloud/redcandy/acidcloudstart_body.ani"); + obj.setCurrentAnimation(ani); + obj.sq_PlaySound("ACIDCLOUD_CREATE"); + if(obj.getVar("custom").get_vector(7) > 0) obj.setTimeEvent(6, obj.getVar("custom").get_vector(0), 1, false); + break; + case 21://靜止 + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/acidcloud/redcandy/acidcloudstay_body.ani"); + obj.setCurrentAnimation(ani); + obj.setTimeEvent(2,100,-1,false); + break; + case 22://右移動 + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/acidcloud/redcandy/acidcloudmovea_body.ani"); + obj.setCurrentAnimation(ani); + obj.setTimeEvent(3,35,-1,false); + break; + case 23://左移動 + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/acidcloud/redcandy/acidcloudmoveb_body.ani"); + obj.setCurrentAnimation(ani); + obj.setTimeEvent(3,35,-1,false); + break; + case 24://開始攻擊 + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/acidcloud/redcandy/acidcloudattackstart_body.ani"); + obj.setCurrentAnimation(ani); + obj.setTimeEvent(5,obj.getVar("custom").get_vector(7) * 3,-1,false); + obj.setTimeEvent(7, obj.getVar("custom").get_vector(7), -1, false); + break; + case 25://持續攻擊 + local totalDamage = obj.getVar("custom").get_vector(6); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 1)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/acidcloud/redcandy/hailloop_00.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(10002,sq_CreateAnimation("","passiveobject/witch_bykk/animation/acidcloud/redcandy/acidcloudattackloop_body.ani"),true); + //obj.setTimeEvent(4,100,-1,false); + local prob = obj.getVar("custom").get_vector(3); + local level = obj.getVar("custom").get_vector(4); + local time = obj.getVar("custom").get_vector(5); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_FREEZE, prob, level, time); + if(obj.getVar("custom").get_vector(7) > 0) return; + local timer = obj.getVar().get_ct_vector(0); + if(!timer){ + obj.getVar().clear_ct_vector(); + obj.getVar().push_ct_vector(); + timer = obj.getVar().get_ct_vector(0); + } + timer.Reset();//初始化 + timer.Start(10000,0);//計時開始 + break; + case 26://結束攻擊 + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/acidcloud/redcandy/acidcloudattackend_body.ani"); + obj.setCurrentAnimation(ani); + obj.stopTimeEvent(5); + obj.stopTimeEvent(7); + if(obj.getVar("custom").get_vector(7) > 0) return; + local timer = obj.getVar().get_ct_vector(0); + if(timer){ + local currentT = timer.Get(); + local savetime = obj.getVar("custom").get_vector(1); + obj.getVar("custom").set_vector(1, savetime + currentT); + } + break; + case 27://結束 + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/acidcloud/redcandy/acidcloudend_body.ani"); + obj.setCurrentAnimation(ani); + obj.sq_PlaySound("ACIDCLOUD_DISAPPEARANCE"); + break; + } + break; + case 4: + case 5: + case 6: + case 7: + switch(state){ + case 20: + local aniPath = "character/mage/effect/animation/witch_bykk/acidcloud/redcandy/hailobjecta_00.ani"; + if(subtype == 5) aniPath = "character/mage/effect/animation/witch_bykk/acidcloud/redcandy/hailobjectb_00.ani"; + if(subtype == 6) aniPath = "character/mage/effect/animation/witch_bykk/acidcloud/redcandy/hailobjectc_00.ani"; + if(subtype == 7) aniPath = "passiveobject/witch_bykk/animation/acidcloud/redcandy/hailstoneattack.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + if(subtype == 7){ + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(10002,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/acidcloud/redcandy/icefrag_00.ani"),true); + } + obj.setTimeEvent(1, 10, 35, true); + break; + case 21: + local aniPath = "character/mage/effect/animation/witch_bykk/acidcloud/redcandy/hailobjectgrounda_00.ani"; + if(subtype == 5) aniPath = "character/mage/effect/animation/witch_bykk/acidcloud/redcandy/hailobjectgroundb_00.ani"; + if(subtype == 6) aniPath = "character/mage/effect/animation/witch_bykk/acidcloud/redcandy/hailobjectgroundc_00.ani"; + if(subtype == 7) aniPath = "character/mage/effect/animation/witch_bykk/acidcloud/redcandy/iceexplosion_01.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + if(subtype == 4 || subtype == 5 || subtype == 6) sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/acidcloud/redcandy/hailobjectbottom_00.ani",0,-1,-1); + if(subtype == 7) sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/acidcloud/redcandy/iceexplosionbottom_00.ani",0,-1,-1); + break; + } + break; + } + break; + case SKILL_BYKK_ANTIGRAVITYSTARTER://反重力裝置 + switch(subtype){ + case 1: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/pluto.ani"); + obj.setCurrentAnimation(ani); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/antigravity/pluto-eye.ani",0,1,1); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/antigravity/pluto-light.ani",0,1,1); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/antigravity/pluto-spark.ani",0,1,1); + obj.setTimeEvent(0,800,1,false); + local range = obj.getVar("custom").get_vector(0); + local sizeRate = range.tofloat() / 600.0; + local pAni = obj.getCurrentAnimation(); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, 1.0); + pAni.setSpeedRate(150.0); + break; + case 21: + // obj.sq_PlaySound("ANTIGRAVITY_EXP"); + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/antigravity/endpluto_06.ani"); + obj.setCurrentAnimation(ani); + local pAni = obj.getCurrentAnimation(); + pAni.setSpeedRate(150.0); + // obj.sq_AddObjectParticleCreater("particle/antigravitystarterparticle-1.ptl"); + // obj.sq_AddObjectParticleCreater("particle/antigravitystarterparticle-2.ptl"); + break; + } + break; + } + break; + case SKILL_BYKK_BLACKMANTLE://暗影鬥篷 + switch(subtype){ + case 2: + switch(state){ + case 20://開始 + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/blackmantle/redcandy/blackmantleneofront_neonewcapefrontnormal.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/blackmantle/redcandy/blackmantleneoback_neonewcapebacknormal.ani"),true); + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_COVER); + break; + case 21://持續 + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/blackmantle/redcandy/blackmantleneofrontloop_neonewcapefrontnormal.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/blackmantle/redcandy/blackmantleneobackloop_neonewcapebacknormal.ani"),true); + break; + case 22://結束 + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/blackmantle/redcandy/blackmantleneoendfrontfail_neonewcapefrontnormal.ani"); + if(obj.getVar().getBool(0)) ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/blackmantle/redcandy/blackmantleneoendfrontsuccess_neonewcapefrontnormal.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + if(obj.getVar().getBool(0)) currentAni.addLayerAnimation(-1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/blackmantle/redcandy/blackmantleneoendbacksuccess_neonewcapebacknormal_02.ani"),true); + else currentAni.addLayerAnimation(-1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/blackmantle/redcandy/blackmantleneoendbackfail_neonewcapebacknormal_01.ani"),true); + break; + case 23://持續 + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/blackmantle/redcandy/blackmantleneofrontloop_neonewcapefrontnormal.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + sq_ClearAttackBox(currentAni); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/blackmantle/redcandy/blackmantleneobackloop_neonewcapebacknormal.ani"),true); + break; + } + break; + case 3: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/blackmantle/redcandy/homunculus/blackmantleneohomonclouscast_fluto.ani"); + obj.setCurrentAnimation(ani); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/blackmantle/redcandy/homunculus/blackmantleneohomonclousstart_fluto.ani"); + obj.setCurrentAnimation(ani); + local totalDamage = obj.getVar("custom").get_vector(0); + local prob = obj.getVar("custom").get_vector(1); + local level = obj.getVar("custom").get_vector(2); + local time = obj.getVar("custom").get_vector(3); + local lifeTime = obj.getVar("custom").get_vector(4); + cearteSkillPassive_Witch_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_BLACKMANTLE,2,totalDamage,lifeTime,prob,level,time,0,0,0,1); + break; + case 22: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/blackmantle/redcandy/homunculus/blackmantleneohomonclousloop_fluto.ani"); + obj.setCurrentAnimation(ani); + break; + case 23: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/blackmantle/redcandy/homunculus/blackmantleneohomonclousend_newsparkle.ani"); + obj.setCurrentAnimation(ani); + break; + case 24: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/blackmantle/redcandy/homunculus/blackmantleneohomonclousdisappear_fluto.ani"); + obj.setCurrentAnimation(ani); + break; + } + local pAni = obj.getCurrentAnimation(); + local speedRate = obj.getVar("custom").get_vector(5); + pAni.setSpeedRate(speedRate.tofloat()); + break; + } + break; + case SKILL_BYKK_BROOMSPIN://旋轉掃把 + break; + case SKILL_BYKK_ELECTRICRABBIT://光電兔 + switch(subtype){ + case 1: + switch(state){ + case 20: + local aniPath1 = "passiveobject/witch_bykk/animation/elecrabbit/start/"; + local successType = obj.getVar("custom").get_vector(0); + local aniPath2 = "fail_start_elecrabbit.ani" + if(successType == 1) aniPath2 = "success_start_elecrabbit.ani"; + if(successType >= 2) aniPath2 = "great_start_elecrabbit.ani"; + local ani = sq_CreateAnimation("",aniPath1 + aniPath2); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + if(successType >= 1){ + switch(successType){ + case 1: currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath1 + "success_thunder_02.ani"),true); break; + case 2: currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath1 + "great_thunder_02.ani"),true); break; + } + } + break; + case 21: + local aniPath1 = "passiveobject/witch_bykk/animation/elecrabbit/loop/"; + local successType = obj.getVar("custom").get_vector(0); + local aniPath2 = "fail_loop_elecrabbit.ani" + if(successType == 1) aniPath2 = "success_loop_elecrabbit.ani"; + if(successType >= 2) aniPath2 = "great_loop_elecrabbit.ani"; + local ani = sq_CreateAnimation("",aniPath1 + aniPath2); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + switch(successType){ + case 0: currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath1 + "fail_thunder_01.ani"),true); break; + case 1: currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath1 + "success_thunder_01.ani"),true); break; + case 2: currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath1 + "great_thunder_01.ani"),true); break; + } + local totalDamage = obj.getVar("custom").get_vector(1); + local prob = obj.getVar("custom").get_vector(2); + local time = obj.getVar("custom").get_vector(3); + local damage = obj.getVar("custom").get_vector(4); + local level = obj.getVar("custom").get_vector(5); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 9)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_LIGHTNING, prob, level, time, damage); + obj.setTimeEvent(0,200,3,false); + obj.sq_PlaySound("ELETRIC_RABBIT_SHOCK"); + break; + case 22: + local aniPath1 = "passiveobject/witch_bykk/animation/elecrabbit/end/"; + local successType = obj.getVar("custom").get_vector(0); + local aniPath2 = "fail_elecrabbit.ani" + if(successType == 1) aniPath2 = "success_elecrabbit.ani"; + if(successType >= 2) aniPath2 = "great_elecrabbit.ani"; + local ani = sq_CreateAnimation("",aniPath1 + aniPath2); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + switch(successType){ + case 0: currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath1 + "fail_thunder_03.ani"),true); break; + case 1: currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath1 + "success_thunder_03.ani"),true); break; + case 2: currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath1 + "great_thunder_03.ani"),true); break; + } + break; + } + break; + case 2: + switch(state){ + case 20: + local aniPath1 = "passiveobject/witch_bykk/animation/elecrabbit/start/"; + local successType = obj.getVar("custom").get_vector(0); + local aniPath2 = "fail_ground_03.ani" + if(successType == 1) aniPath2 = "success_ground_03.ani"; + if(successType >= 2) aniPath2 = "great_ground_03.ani"; + local ani = sq_CreateAnimation("",aniPath1 + aniPath2); + obj.setCurrentAnimation(ani); + break; + case 21: + local aniPath1 = "passiveobject/witch_bykk/animation/elecrabbit/loop/"; + local successType = obj.getVar("custom").get_vector(0); + local aniPath2 = "fail_ground_01.ani" + if(successType == 1) aniPath2 = "success_ground_01.ani"; + if(successType >= 2) aniPath2 = "great_ground_01.ani"; + local ani = sq_CreateAnimation("",aniPath1 + aniPath2); + obj.setCurrentAnimation(ani); + break; + case 22: + local aniPath1 = "passiveobject/witch_bykk/animation/elecrabbit/end/"; + local successType = obj.getVar("custom").get_vector(0); + local aniPath2 = "fail_ground_02.ani" + if(successType == 1) aniPath2 = "success_ground_02.ani"; + if(successType >= 2) aniPath2 = "great_ground_02.ani"; + local ani = sq_CreateAnimation("",aniPath1 + aniPath2); + obj.setCurrentAnimation(ani); + break; + } + break; + case 4: + switch(state){ + case 20: + local aniPath1 = "passiveobject/witch_bykk/animation/elecrabbit/talisman/start/"; + local successType = obj.getVar("custom").get_vector(0); + local ani = sq_CreateAnimation("",aniPath1 + "success_start_elecrabbit.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath1 + "success_thunder_02.ani"),true); + break; + case 21: + local aniPath1 = "passiveobject/witch_bykk/animation/elecrabbit/talisman/loop/"; + local successType = obj.getVar("custom").get_vector(0); + local ani = sq_CreateAnimation("",aniPath1 + "success_loop_elecrabbit.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath1 + "success_thunder_01.ani"),true); + local totalDamage = obj.getVar("custom").get_vector(1); + local prob = obj.getVar("custom").get_vector(2); + local time = obj.getVar("custom").get_vector(3); + local damage = obj.getVar("custom").get_vector(4); + local level = obj.getVar("custom").get_vector(5); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 9)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_LIGHTNING, prob, level, time, damage); + obj.setTimeEvent(0,200,3,false); + obj.sq_PlaySound("ELETRIC_RABBIT_SHOCK"); + break; + case 22: + local aniPath1 = "passiveobject/witch_bykk/animation/elecrabbit/talisman/end/"; + local successType = obj.getVar("custom").get_vector(0); + local ani = sq_CreateAnimation("",aniPath1 + "success_elecrabbit.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath1 + "success_thunder_03.ani"),true); + break; + } + break; + } + break; + case SKILL_BYKK_ENHANCEDMAGICMISSILE://改良魔法星彈 + switch(subtype){ + case 1: + switch(state){ + case 20: + local aniPath = "passiveobject/witch_bykk/animation/enhancedmagicmissile/new/success_n.ani"; + if(obj.getVar("custom").get_vector(0) >= 2) aniPath = "passiveobject/witch_bykk/animation/enhancedmagicmissile/new/great_n.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + if(obj.getVar("custom").get_vector(0) >= 2)obj.getVar("targetObj").clear_obj_vector(); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/enhancedmagicmissile/new/dummy.ani"); + obj.setCurrentAnimation(ani); + local sub = obj.getVar("custom").get_vector(6); + obj.setTimeEvent(0,150 * (2 / (sub + 2)),2 + sub,false); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/enhancedmagicmissile/new/bluelight_dodge0.ani",10,0,0); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/enhancedmagicmissile/new/bluelight_dodge1.ani",10,0,0); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/enhancedmagicmissile/new/bluelight_dodge2.ani",10,0,0); + if(obj.getVar("custom").get_vector(0) >= 2){ + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/enhancedmagicmissile/new/bluelight_dodge3.ani",10,0,0); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/enhancedmagicmissile/new/bluelight_dodge4.ani",10,0,0); + } + break; + case 22: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/enhancedmagicmissile/new/dummy.ani"); + obj.setCurrentAnimation(ani); + sq_SetCustomRotate(obj, sq_ToRadian(71.08)); + break; + case 23: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/enhancedmagicmissile/familiar/endfamiliar_03.ani"); + obj.setCurrentAnimation(ani); + local totalDamage = sq_GetCurrentAttackBonusRate(obj); + local prob = obj.getVar("custom").get_vector(1); + local time = obj.getVar("custom").get_vector(2); + local damage = obj.getVar("custom").get_vector(3); + local damageRate = obj.getVar("custom").get_vector(4); + local level = obj.getVar("custom").get_vector(5); + totalDamage = totalDamage * damageRate / 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 12)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_LIGHTNING, prob, level, time,damage); + sq_SetCustomRotate(obj, sq_ToRadian(0.0)); + local sub = obj.getVar("custom").get_vector(7); + obj.setTimeEvent(1,200 * (2/ (2 + sub)),2 + sub,false); + break; + case 24: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/enhancedmagicmissile/familiar/fail_n.ani"); + obj.setCurrentAnimation(ani); + sq_SetCustomRotate(obj, sq_ToRadian(0.0)); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/enhancedmagicmissile/familiar/fail_d.ani"),true); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/enhancedmagicmissile/familiar/fail1.ani",0,0,0); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/enhancedmagicmissile/familiar/fail2.ani",0,0,0); + break; + } + break; + } + break; + case SKILL_BYKK_FLUORECOLLIDER://電鳗碰撞機 + switch(subtype){ + case 1: + local aniPath = "passiveobject/witch_bykk/animation/fluorecollider/"; + switch(state){ + case 20://start + local ani = sq_CreateAnimation("",aniPath + "create_body.ani"); + obj.setCurrentAnimation(ani);// + local speedRate = obj.getVar("custom").get_vector(5); + local pooledObj = createOnlyDrawObject_witch_bykk(obj,aniPath + "create_area.ani",false,obj.getDirection(),sq_GetXPos(obj),sq_GetYPos(obj),0,ENUM_DRAWLAYER_BOTTOM); + local range = obj.getVar("custom").get_vector(1); + local pAni = pooledObj.getCurrentAnimation(); + local sizeRate = range.tofloat() / 300.0; + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + obj.getVar("effect").clear_obj_vector(); + obj.getVar("effect").push_obj_vector(pooledObj); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "create_body_glow.ani"),true); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("",aniPath + "create_wheel.ani"),true); + + if(speedRate > 0) currentAni.setSpeedRate(100000.0 / (1000.0 - speedRate.tofloat())); + break; + case 21://loop + local ani = sq_CreateAnimation("",aniPath + "stay_body.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "stay_body_glow.ani"),true); + local successType = obj.getVar("custom").get_vector(0); + local sub = obj.getVar("custom").get_vector(2); + if(sub >= 1) currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/fluorecollider/stay_wheel_under.ani"),true); + else currentAni.addLayerAnimation(-1,sq_CreateAnimation("",aniPath + "stay_wheel_under.ani"),true); + currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "stay_wheel_over1.ani"),true); + currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "stay_wheel_over2.ani"),true); + currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "stay_wheel_spark1.ani"),true); + currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "stay_wheel_spark2.ani"),true); + currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "stay_needle1.ani"),true); + currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "stay_needle2.ani"),true); + currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "stay_needle3.ani"),true); + currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "stay_needle4.ani"),true); + currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "stay_lightning_rod.ani"),true); + currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "stay_electric.ani"),true); + switch(successType){ + case 0: + if(sub == 0){ + local pooledObj = createOnlyDrawObject_witch_bykk(obj,aniPath + "shock.ani",false,obj.getDirection(),sq_GetDistancePos(sq_GetXPos(obj),obj.getDirection(),-70),sq_GetYPos(obj) + 2,32,ENUM_DRAWLAYER_NORMAL); + obj.getVar("effect").push_obj_vector(pooledObj); + } + break; + case 2: + case 3: + currentAni.addLayerAnimation(2,sq_CreateAnimation("",aniPath + "stay_bulb_great.ani"),true); + currentAni.addLayerAnimation(2,sq_CreateAnimation("",aniPath + "stay_electric_great.ani"),true); + case 1: + currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "stay_bulb_success1.ani"),true); + currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "stay_bulb_success2.ani"),true); + currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "stay_electric_success.ani"),true); + break; + } + local pooledObj = createOnlyDrawObject_witch_bykk(obj,aniPath + "thunder_spark.ani",false,obj.getDirection(),sq_GetDistancePos(sq_GetXPos(obj),obj.getDirection(),10),sq_GetYPos(obj) + 1,195,ENUM_DRAWLAYER_NORMAL); + obj.getVar("effect").push_obj_vector(pooledObj); + local lifeTime = obj.getVar("custom").get_vector(4); + obj.setTimeEvent(0,lifeTime,1,false); + obj.getVar("targetObj").clear_obj_vector(); + obj.setTimeEvent(2,180,-1,false); + local range = obj.getVar("custom").get_vector(1); + local sizeRate = range.tofloat() / 300.0; + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + break; + case 22://end + obj.stopTimeEvent(1); + obj.stopTimeEvent(2); + local ani = sq_CreateAnimation("",aniPath + "exp.ani"); + obj.setCurrentAnimation(ani); + local totalDamage = obj.getVar("custom").get_vector(3); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 14)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.sq_AddObjectParticleCreater("particle/fluorecolliderdestroy1.ptl"); + obj.sq_AddObjectParticleCreater("particle/fluorecolliderdestroy2.ptl"); + obj.sq_AddObjectParticleCreater("particle/fluorecolliderdestroy3.ptl"); + obj.sq_SetObjectParticlePos(0, 1, 50); + local size = obj.getVar("effect").get_obj_vector_size(); + for(local i = 0; i < size; i++){ + local pooledObj = obj.getVar("effect").get_obj_vector(i); + if(pooledObj) pooledObj.setValid(false); + } + sq_CreateParticle("passiveobject/common/particle/lightexplosionparticle1.ptl", obj, 0, -1, 50, true, 5, 0, 2); + sq_CreateParticle("passiveobject/common/particle/lightexplosionparticle2.ptl", obj, 0, -1, 50, true, 20, 0, 4); + sq_CreateParticle("passiveobject/common/particle/lightexplosionparticle3.ptl", obj, 0, -1, 50, true, 100, 0, 16); + sq_CreateParticle("passiveobject/common/particle/lightexplosionparticle4.ptl", obj, 0, -1, 50, true, 10, 0, 2); + break; + } + break; + } + break; + case SKILL_BYKK_FUSIONCRAFT://技藝融合 + break; + case SKILL_BYKK_HEATINGFURNACE://爆炎加熱爐 + switch(subtype){ + case 1: + local aniPath = "passiveobject/witch_bykk/animation/heatingfurnace/"; + switch(state){ + case 20://cast + local ani = sq_CreateAnimation("",aniPath + "body_n_startup.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "foot_n_startup.ani"),true); + if(true) currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "homunculus/foot_n_startup.ani"),true); + local Delay = obj.getVar("custom").get_vector(0); + local speedRate = 800.0 / Delay.tofloat() * 100.0; + currentAni.setSpeedRate(200.0); + break; + case 21://loop + local ani = sq_CreateAnimation("",aniPath + "body_n_loop.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "eye_n_loop.ani"),true); + currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "normal_d_up.ani"),true); + currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "foot_n_loop.ani"),true); + currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "dust.ani"),true); + if(obj.getVar("custom").get_vector(2) > 0){//助手鼓風機 + currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "homunculus/foot_n_loop.ani"),true); + currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "homunculus/lanternjump.ani"),true); + } + local successType = obj.getVar("custom").get_vector(1); + if(successType >= 2){//大成功、超大成功時 + currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "great_bulb.ani"),true); + currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "great_d_up_fire.ani"),true); + currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath + "great_d_up.ani"),true); + } + // obj.getVar("effect").clear_obj_vector(); + // for(local i = 1; i < 5; i++){ + // local pooledObj = createOnlyDrawObject_witch_bykk(obj,aniPath + "smoke"+i.tostring()+".ani",true,obj.getDirection(),sq_GetXPos(obj),sq_GetYPos(obj),0,ENUM_DRAWLAYER_NORMAL); + // obj.getVar("effect").push_obj_vector(pooledObj); + // } + //obj.setTimeEvent(0,6000,1,false); + break; + case 22://end + local ani = sq_CreateAnimation("","passiveobject/common/animation/fireexplosion.ani"); + obj.setCurrentAnimation(ani);// + obj.sq_AddObjectParticleCreater("particle/heatingfurnacefail1.ptl"); + obj.sq_AddObjectParticleCreater("particle/heatingfurnacefail2.ptl"); + obj.sq_AddObjectParticleCreater("particle/heatingfurnacefail3.ptl"); + obj.sq_SetObjectParticlePos(0, 1, 50); + // local size = obj.getVar("effect").get_obj_vector_size(); + // for(local i = 0; i < size; i++){ + // local pooledObj = obj.getVar("effect").get_obj_vector(i); + // if(pooledObj) pooledObj.setValid(false); + // } + break; + } + break; + } + break; + case SKILL_BYKK_HOMUNCULUS://魔道學助手 + switch(subtype){ + case 31: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/jackfrostaskill/start_cloud.ani"); + obj.setCurrentAnimation(ani); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/jackfrostaskill/cloud.ani"); + obj.setCurrentAnimation(ani); + local hitMax = obj.getVar("custom").get_vector(0); + obj.setTimeEvent(2,150,hitMax,true); + obj.setTimeEvent(3,150*hitMax+100,1,false); + sq_CreateParticle("passiveobject/witch_bykk/particle/acidrain.ptl", obj, 0, 0, 0, true, 80, 0, (150*hitMax+100) / 80); + obj.setTimeEvent(4,800,1,false); + break; + } + break; + case 41: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/lantern/launchjolstart.ani"); + obj.setCurrentAnimation(ani); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/homonculous/lantern/launchjolfirestart.ani",0,0,0); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/lantern/launchjolmove.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/lantern/launchjolfiremove.ani"),true); + obj.sq_SetMoveParticle("particle/goblin_fastthrowstone.ptl", 0.0, 0.0); + break; + } + break; + } + break; + case SKILL_BYKK_JACKFROSTICEWATER://雪人刨冰 + local aniPath = "passiveobject/witch_bykk/animation/jackfrosticewater/"; + local effect_aniPath = "character/mage/effect/animation/witch_bykk/jackfrosticewater/"; + switch(subtype){ + case 1: + switch(state){ + case 20: + local aniPath1 = "start/jackfrosticewaterstartback_03.ani"; + if(obj.getVar("custom").get_vector(2) > 0) aniPath1 = "start/talisman/jackfrosticewaterstartback_03.ani"; + local ani = sq_CreateAnimation("",aniPath + aniPath1); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + if(obj.getVar("custom").get_vector(2) > 0){ + currentAni.addLayerAnimation(-1,sq_CreateAnimation("",effect_aniPath + "start/talisman/jackfrosticewaterstartfloor_03.ani"),true); + currentAni.addLayerAnimation(-2,sq_CreateAnimation("",effect_aniPath + "start/talisman/jackfrosticewaterstartfloortwister_01.ani"),true); + } + else{ + currentAni.addLayerAnimation(-1,sq_CreateAnimation("",effect_aniPath + "start/jackfrosticewaterstartfloor_03.ani"),true); + currentAni.addLayerAnimation(-2,sq_CreateAnimation("",effect_aniPath + "start/jackfrosticewaterstartfloortwister_01.ani"),true); + } + obj.setTimeEvent(3,150,1,false); + obj.sq_PlaySound("JACKFROST_ICEWATER_START"); + break; + case 21: + local aniPath1 = "loop/jackfrosticewaterloopback_01.ani"; + if(obj.getVar("custom").get_vector(2) > 0) aniPath1 = "loop/talisman/jackfrosticewaterloopback_01.ani"; + local ani = sq_CreateAnimation("",aniPath + aniPath1); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("",effect_aniPath + "loop/jackfrosticewaterloopfloor_01.ani"),true); + if(obj.getVar("custom").get_vector(2) > 0){ + currentAni.addLayerAnimation(-2,sq_CreateAnimation("",effect_aniPath + "loop/talisman/jackfrosticewaterloopfloortwister_01.ani"),true); + currentAni.addLayerAnimation(1001,sq_CreateAnimation("",effect_aniPath + "loop/talisman/jackfrosticewaterloopfront_06.ani"),true); + } + else{ + currentAni.addLayerAnimation(-2,sq_CreateAnimation("",effect_aniPath + "loop/jackfrosticewaterloopfloortwister_01.ani"),true); + currentAni.addLayerAnimation(1001,sq_CreateAnimation("",effect_aniPath + "loop/jackfrosticewaterloopfront_06.ani"),true); + } + obj.setTimeEvent(0,5000,1,false); + if(obj.getVar("custom").get_vector(2) > 0) obj.setTimeEvent(4,250,-1,false); + else obj.setTimeEvent(4,500,-1,false); + break; + case 22: + obj.removeAllTimeEvent(); + local totalDamage = obj.getVar("custom").get_vector(1); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 28)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local aniPath1 = "end/jackfrosticewaterendback_03.ani"; + if(obj.getVar("custom").get_vector(2) > 0) aniPath1 = "end/talisman/jackfrosticewaterendback_03.ani"; + local ani = sq_CreateAnimation("",aniPath + aniPath1); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("",effect_aniPath + "end/jackfrosticewaterendfloor_01.ani"),true); + currentAni.addLayerAnimation(-2,sq_CreateAnimation("",effect_aniPath + "end/jackfrosticewaterendfloortwister_01.ani"),true); + currentAni.addLayerAnimation(1001,sq_CreateAnimation("",effect_aniPath + "end/jackfrosticewaterendfront_10.ani"),true); + local parentObj = obj.getParent(); + if(!parentObj) break; + CNSquirrelAppendage.sq_RemoveAppendage(parentObj, "appendage/character/ap_common_suck.nut"); + //obj.sq_PlaySound("JACKFROST_ICEWATER_EXP"); + break; + } + break; + case 2: + switch(state){ + case 20: + local aniPath1 = "start/jackfrosticewaterstartparticle_08.ani"; + if(obj.getVar("custom").get_vector(2) > 0) aniPath1 = "start/talisman/jackfrosticewaterstartparticle_08.ani"; + local ani = sq_CreateAnimation("",aniPath + aniPath1); + obj.setCurrentAnimation(ani); + obj.setTimeEvent(3,150,1,false); + local currentAni = obj.getCurrentAnimation(); + break; + case 21: + local aniPath1 = "loop/jackfrosticewaterloopparticle_01.ani"; + if(obj.getVar("custom").get_vector(2) > 0) aniPath1 = "loop/talisman/jackfrosticewaterloopparticle_01.ani"; + local ani = sq_CreateAnimation("",aniPath + aniPath1); + obj.setCurrentAnimation(ani); + obj.setTimeEvent(0,4500,1,false); + local currentAni = obj.getCurrentAnimation(); + break; + case 22: + local aniPath1 = "end/jackfrosticewaterendparticle_12.ani"; + if(obj.getVar("custom").get_vector(2) > 0) aniPath1 = "end/talisman/jackfrosticewaterendparticle_12.ani"; + local ani = sq_CreateAnimation("",aniPath + aniPath1); + obj.setCurrentAnimation(ani); + break; + } + break; + } + break; + case SKILL_BYKK_JACKOHALLOWEEN://搗蛋傑克 + local aniPath = "passiveobject/witch_bykk/animation/jackohalloween/"; + local effect_aniPath = "character/mage/effect/animation/witch_bykk/jackohalloween/"; + switch(subtype){ + case 1: + switch(state){ + case 20: + local ani = sq_CreateAnimation("",aniPath + "jackohalloweenready.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + local castAniTime = currentAni.getDelaySum(false); + local castTime = obj.getVar("custom").get_vector(0); + local speedRate = castAniTime.tofloat() / castTime.tofloat() * 100.0; + //print(speedRate); + currentAni.setSpeedRate(speedRate); + break; + case 21: + if(obj.isExistTimeEvent(3)) obj.stopTimeEvent(3); + local ani = sq_CreateAnimation("",aniPath + "jackohalloweenstart_12.ani"); + obj.setCurrentAnimation(ani); + sq_AddDrawOnlyAniFromParent(obj,aniPath + "jackohalloweenstart_00.ani",0,-1,0); + sq_AddDrawOnlyAniFromParent(obj,aniPath + "jackohalloweenstart_13.ani",0,1,0); + sq_AddDrawOnlyAniFromParent(obj,aniPath + "jackohalloweenstart_14.ani",0,1,0); + sq_AddDrawOnlyAniFromParent(obj,aniPath + "jackohalloweenstart_20.ani",0,1,0); + sq_AddDrawOnlyAniFromParent(obj,aniPath + "jackohalloweenstart_21.ani",0,1,0); + sq_AddDrawOnlyAniFromParent(obj,aniPath + "jackohalloweenstart_30.ani",0,1,0); + sq_AddDrawOnlyAniFromParent(obj,aniPath + "jackohalloweenstart_31.ani",0,1,0); + sq_AddDrawOnlyAniFromParent(obj,aniPath + "jackohalloweenstart_32.ani",0,1,0); + sq_AddDrawOnlyAniFromParent(obj,aniPath + "jackohalloweenstart_33.ani",0,1,0); + sq_AddDrawOnlyAniFromParent(obj,aniPath + "jackohalloweenstart_37.ani",0,1,0); + sq_AddDrawOnlyAniFromParent(obj,aniPath + "jackohalloweenstart_38.ani",0,1,0); + break; + case 22: + local ani = sq_CreateAnimation("",aniPath + "jackohalloweenlavaspitstarta_jackohollween.ani"); + obj.setCurrentAnimation(ani); + obj.setTimeEvent(0, obj.getVar("custom").getInt(11), 1, false); + if(obj.getVar().getBool(0)){ + local lava_Obj = obj.getVar("jackohalloween_lava").get_obj_vector(0); + if(lava_Obj){ + local colObj = sq_GetCNRDObjectToCollisionObject(lava_Obj); + colObj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + } + } + break; + case 23: + local ani = sq_CreateAnimation("",aniPath + "jackohalloweenlavaspitstartb_jackohollween.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "jackohalloweenlavaspitstartb_fire015_01.ani"),true); + local lava_Obj = obj.getVar("jackohalloween_lava").get_obj_vector(0); + if(lava_Obj){ + local colObj = sq_GetCNRDObjectToCollisionObject(lava_Obj); + colObj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + } + break; + case 24: + local ani = sq_CreateAnimation("",aniPath + "jackohalloweenlavaspitloop_00.ani"); + obj.setCurrentAnimation(ani); + obj.setTimeEvent(3,1000,1,false); + break; + case 25: + if(obj.isExistTimeEvent(3)) obj.stopTimeEvent(3); + local ani = sq_CreateAnimation("",aniPath + "jackohalloweenlavaspitend_jackohollween.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(1,sq_CreateAnimation("",aniPath + "jackohalloweenlavaspitend_fire015_01.ani"),true); + local lava_Obj = obj.getVar("jackohalloween_lava").get_obj_vector(0); + if(lava_Obj){ + local colObj = sq_GetCNRDObjectToCollisionObject(lava_Obj); + colObj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, ""); + } + break; + case 26: + local ani = sq_CreateAnimation("",aniPath + "jackoholloweenend_jackohollween.ani"); + obj.setCurrentAnimation(ani); + break; + } + break; + case 2: + switch(state){ + case 20://wait + obj.removeAllTimeEvent(); + local ani = sq_CreateAnimation("",aniPath + "magma/jackohalloweenlava_wait.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.setLoop(true); + local parentObj = obj.getParent(); + sq_SetCurrentDirection(obj, parentObj.getDirection()); + sq_setCurrentAxisPos(obj, 1, sq_GetYPos(parentObj)); + obj.sq_PlaySound("JACKOHALLOWEEN_FIRE"); + break; + case 21://start + local ani = sq_CreateAnimation("",aniPath + "magma/jackohalloweenlava_start.ani"); + obj.setCurrentAnimation(ani); + obj.setTimeEvent(1,300,1,false); + local totalDamage = obj.getVar("custom").get_vector(0); + local hitTime = obj.getVar("custom").get_vector(1); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 30)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.setTimeEvent(4,hitTime,-1,false); + obj.sq_PlaySound("JACKOHALLOWEEN_FIRE_LOOP_START"); + break; + case 22://loop + local ani = sq_CreateAnimation("",aniPath + "magma/jackohalloweenlava_loop.ani"); + obj.setCurrentAnimation(ani); + obj.setTimeEvent(5,500,-1,true); + break; + case 23://end + obj.removeAllTimeEvent(); + local ani = sq_CreateAnimation("",aniPath + "magma/jackohalloweenlava_end.ani"); + obj.setCurrentAnimation(ani); + obj.sq_PlaySound("JACKOHALLOWEEN_FIRE_LOOP_END"); + break; + } + break; + } + break; + case SKILL_BYKK_LAVAPOTION://熔岩藥瓶 + switch(subtype){ + case 4: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/heatingfurnace/stone_piece_normal2.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(2,sq_CreateAnimation("","passiveobject/witch_bykk/animation/heatingfurnace/stone_piece_great2.ani"),true); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/heatingfurnace/stone_piece_normal2.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(2,sq_CreateAnimation("","passiveobject/witch_bykk/animation/heatingfurnace/stone_piece_great2.ani"),true); + break; + case 22: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/heatingfurnace/stone_piece_normal_break.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(2,sq_CreateAnimation("","passiveobject/witch_bykk/animation/heatingfurnace/stone_piece_great_break.ani"),true); + sq_CreateParticle("passiveobject/character/mage/particle/lavapotionfireexplosionparticle1.ptl", obj, 0, 1, 1, true, 5, 0, 2); + sq_CreateParticle("passiveobject/character/mage/particle/lavapotionfireexplosionparticle2.ptl", obj, 0, 1, 1, true, 20, 0, 4); + sq_CreateParticle("passiveobject/character/mage/particle/lavapotionfireexplosionparticle3.ptl", obj, 0, 1, 1, true, 100, 0, 16); + sq_CreateParticle("passiveobject/character/mage/particle/lavapotionfireexplosionparticle4.ptl", obj, 0, 1, 1, true, 10, 0, 2); + break; + } + break; + case 3: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/lavapotionair_fall.ani"); + obj.setCurrentAnimation(ani); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/start_d_up.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/start_n_down.ani"),true); + currentAni.addLayerAnimation(0,sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/02_d_up.ani"),false); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/02_n_down.ani"),false); + break; + case 22: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/loop_n_down.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/loop_d_up.ani"),true); + currentAni.addLayerAnimation(0,sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/loop_02_d_up.ani"),true); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/loop_02_n_down.ani"),true); + if(obj.getVar("custom").get_vector(1) >= 3) obj.setTimeEvent(4,300,-1,false); + break; + case 23: + if(obj.isExistTimeEvent(4)) obj.stopTimeEvent(4); + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/end_d_up.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/end_n_down.ani"),true); + currentAni.addLayerAnimation(0,sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/end_02_d_up.ani"),true); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/end_02_n_down.ani"),true); + break; + } + if(state != 20){ + local currentAni = obj.getCurrentAnimation(); + local tiaozheng = 1.0; + if(obj.getVar("custom").get_vector(1) >= 2) tiaozheng = 1.35 + local sizeRate = obj.getVar("custom").get_vector(0).tofloat() / 100.0 * tiaozheng; + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + } + break; + } + break; + case SKILL_BYKK_MEGADRILL://冰霜鑽孔車 + switch(subtype){ + case 1://失敗形態 + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/dummy.ani"); + obj.setCurrentAnimation(ani); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/megadrill/familiar/fail_n.ani",-150,0,180); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/megadrill/familiar/fail_d.ani",-150,-1,179); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/megadrill/familiar/fail1.ani",-150,2,182); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/megadrill/familiar/fail2.ani",-150,1,181); + local currentAni = obj.getCurrentAnimation(); + sq_SetFrameDelayTime(currentAni, 0, 230); + sq_SetFrameDelayTime(currentAni, 1, 230); + break; + case 21://35 + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/fail/megadrillfailstart_57.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/fail/megadrillfailstart_48.ani"),true); + // print(currentAni.getDelaySum(false)); + local totalDamage = obj.getVar("custom").get_vector(0); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 35)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.setTimeEvent(0,1400,1,false); + obj.setTimeEvent(1,500,1,false); + obj.setTimeEvent(2,50,-1,false); + obj.setTimeEvent(3,300,1,false); + break; + case 22://36 + obj.stopTimeEvent(2); + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/fail/megadrillfailend_07.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/fail/megadrillfailendbttom_01.ani"),true); + local totalDamage = obj.getVar("custom").get_vector(1); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 36)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + if(obj.getVar("custom").get_vector(2) > 0){ + local parentObj = obj.getParent(); + if(!parentObj) break; + CNSquirrelAppendage.sq_RemoveAppendage(parentObj, "appendage/character/ap_common_suck.nut"); + } + break; + } + break; + case 2://普通形態 + switch(state){ + case 20://動畫 + local successType = obj.getVar("custom").get_vector(0); + local aniPath = "passiveobject/witch_bykk/animation/megadrill/familiar/success_n.ani"; + if(successType >= 2) aniPath = "passiveobject/witch_bykk/animation/megadrill/familiar/great_n.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + if(successType == 1) currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/familiar/success_d.ani"),true); + else{ + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/familiar/great_d.ani"),true); + currentAni.addLayerAnimation(2,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/familiar/great1.ani"),true); + currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/familiar/great2.ani"),true); + } + break; + case 21://生成 + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/appear.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + local successType = obj.getVar("custom").get_vector(0); + switch(successType){ + case 1: + currentAni.addLayerAnimation(0,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/appeardrillsuccess.ani"),true); + currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/appearglowsuccess.ani"),true); + break; + case 2: + currentAni.addLayerAnimation(0,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/appeardrillgreat.ani"),true); + currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/appearglowgreat.ani"),true); + break; + } + break; + case 22://停止狀態 + case 23://前進狀態 + case 24://後退狀態 + obj.getVar().setBool(0,false); + obj.sq_PlaySound("MEGA_DRILL_LOOP",1001); + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/move.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.setLoop(true); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/body.ani"),true); + currentAni.addLayerAnimation(10,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/bodycover.ani"),true); + local successType = obj.getVar("custom").get_vector(0); + switch(successType){ + case 1: + currentAni.addLayerAnimation(1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/drillsuccess.ani"),true); + currentAni.addLayerAnimation(1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/pistonsuccess.ani"),true); + currentAni.addLayerAnimation(3,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/glowsuccess.ani"),true); + break; + case 2: + currentAni.addLayerAnimation(1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/drillgreat1.ani"),true); + currentAni.addLayerAnimation(2,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/drillgreat2.ani"),true); + currentAni.addLayerAnimation(3,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/drillgreat3.ani"),true); + currentAni.addLayerAnimation(1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/pistongreat.ani"),true); + currentAni.addLayerAnimation(3,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/glowgreat.ani"),true); + break; + } + switch(state){ + case 22: + currentAni.addLayerAnimation(10001,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/stop_wheel1.ani"),true); + currentAni.addLayerAnimation(10002,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/stop_wheel2.ani"),true); + currentAni.addLayerAnimation(10001,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/stop_wheel3.ani"),true); + obj.stopTimeEvent(0); + break; + case 23: + currentAni.addLayerAnimation(10001,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/wheel1.ani"),true); + currentAni.addLayerAnimation(10002,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/wheel2.ani"),true); + currentAni.addLayerAnimation(10001,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/wheel3.ani"),true); + obj.setTimeEvent(0,400,-1,true); + break; + case 24: + currentAni.addLayerAnimation(10001,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/backwheel1.ani"),true); + currentAni.addLayerAnimation(10002,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/backwheel2.ani"),true); + currentAni.addLayerAnimation(10001,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/backwheel3.ani"),true); + obj.setTimeEvent(0,400,-1,true); + break; + } + break; + case 25://爆炸 + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/explosion.ani"); + obj.setCurrentAnimation(ani); + obj.removeAllTimeEvent(); + obj.stopSound(1001); + obj.sq_PlaySound("MEGA_DRILL_ICEEXP"); + local totalDamage = obj.getVar("custom").get_vector(4); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 37)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.setTimeEvent(3,80,2,false); + obj.setTimeEvent(4,80,1,true); + obj.setTimeEvent(5,80,1,true); + obj.setTimeEvent(6,80,1,true); + obj.setTimeEvent(7,80,1,true); + sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy0.ptl", obj, -50,0,20, true, 30, 0, 1); + sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy1.ptl", obj, 0,0,50, true, 30, 0, 1); + sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy2.ptl", obj, 0,0,50, true, 30, 0, 1); + sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy3.ptl", obj, 0,0,50, true, 30, 0, 1); + sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy4.ptl", obj, 0,0,50, true, 30, 0, 1); + sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy5.ptl", obj, 0,0,50, true, 30, 0, 2); + sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy6.ptl", obj, 0,0,50, true, 30, 0, 2); + break; + } + break; + case 12://助手形態 + switch(state){ + case 20://動畫 + local successType = obj.getVar("custom").get_vector(0); + local aniPath = "passiveobject/witch_bykk/animation/megadrill/familiar/success_n.ani"; + if(successType >= 2) aniPath = "passiveobject/witch_bykk/animation/megadrill/familiar/great_n.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + if(successType == 1) currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/familiar/success_d.ani"),true); + else{ + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/familiar/great_d.ani"),true); + currentAni.addLayerAnimation(2,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/familiar/great1.ani"),true); + currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/familiar/great2.ani"),true); + } + break; + case 21://生成 + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/appear.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + local successType = obj.getVar("custom").get_vector(0); + switch(successType){ + case 1: + currentAni.addLayerAnimation(0,sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/appeardrillsuccess.ani"),true); + currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/appearglowsuccess.ani"),true); + break; + case 2: + currentAni.addLayerAnimation(0,sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/appeardrillgreat.ani"),true); + currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/homonculous/appearglowgreat.ani"),true); + break; + } + obj.setTimeEvent(1,500,-1,false); + break; + case 22://停止狀態 + case 23://前進狀態 + case 24://後退狀態 + obj.getVar().setBool(0,false); + obj.sq_PlaySound("MEGA_DRILL_LOOP",1001); + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/move.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.setLoop(true); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/body.ani"),true); + currentAni.addLayerAnimation(10,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/bodycover.ani"),true); + // + local successType = obj.getVar("custom").get_vector(0); + switch(successType){ + case 1: + currentAni.addLayerAnimation(1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/drillsuccess.ani"),true); + currentAni.addLayerAnimation(1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/pistonsuccess.ani"),true); + currentAni.addLayerAnimation(3,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/glowsuccess.ani"),true); + break; + case 2: + currentAni.addLayerAnimation(1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/drillgreat1.ani"),true); + currentAni.addLayerAnimation(2,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/drillgreat2.ani"),true); + currentAni.addLayerAnimation(3,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/drillgreat3.ani"),true); + currentAni.addLayerAnimation(1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/pistongreat.ani"),true); + currentAni.addLayerAnimation(3,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/glowgreat.ani"),true); + currentAni.addLayerAnimation(4,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/lightgreat1.ani"),true); + currentAni.addLayerAnimation(5,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/lightgreat2.ani"),true); + break; + } + switch(state){ + case 22: + currentAni.addLayerAnimation(10001,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/stop_wheel1.ani"),true); + currentAni.addLayerAnimation(10002,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/stop_wheel2.ani"),true); + currentAni.addLayerAnimation(10001,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/stop_wheel3.ani"),true); + obj.stopTimeEvent(0); + break; + case 23: + currentAni.addLayerAnimation(10001,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/wheel1.ani"),true); + currentAni.addLayerAnimation(10002,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/wheel2.ani"),true); + currentAni.addLayerAnimation(10001,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/wheel3.ani"),true); + obj.setTimeEvent(0,400,-1,true); + break; + case 24: + currentAni.addLayerAnimation(10001,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/backwheel1.ani"),true); + currentAni.addLayerAnimation(10002,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/backwheel2.ani"),true); + currentAni.addLayerAnimation(10001,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/homonculous/megadrill/backwheel3.ani"),true); + obj.setTimeEvent(0,400,-1,true); + break; + } + break; + case 25://爆炸 + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/megadrill/explosion.ani"); + obj.setCurrentAnimation(ani); + obj.removeAllTimeEvent(); + obj.stopSound(1001); + obj.sq_PlaySound("MEGA_DRILL_ICEEXP"); + local totalDamage = obj.getVar("custom").get_vector(4); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 37)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.setTimeEvent(3,80,2,false); + obj.setTimeEvent(4,80,1,true); + obj.setTimeEvent(5,80,1,true); + obj.setTimeEvent(6,80,1,true); + obj.setTimeEvent(7,80,1,true); + sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy0.ptl", obj, -50,0,20, true, 30, 0, 1); + sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy1.ptl", obj, 0,0,50, true, 30, 0, 1); + sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy2.ptl", obj, 0,0,50, true, 30, 0, 1); + sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy3.ptl", obj, 0,0,50, true, 30, 0, 1); + sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy4.ptl", obj, 0,0,50, true, 30, 0, 1); + sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy5.ptl", obj, 0,0,50, true, 30, 0, 2); + sq_CreateParticle("passiveobject/witch_bykk/particle/megadrilldestroy6.ptl", obj, 0,0,50, true, 30, 0, 2); + sq_CreateParticle("character/mage/effect/animation/witch_bykk/homonculous/megadrill/jackfrost/megadrilldestroy0.ptl", obj, 0,0,75, true, 30, 0, 1); + break; + } + break; + } + break; + case SKILL_BYKK_UROBOROS://二覺 + break; + case SKILL_BYKK_LOLLIPOPCRUSH://超級棒棒糖 + switch(subtype){ + case 20: + switch(state){ + case 20: + local aniPath1 = "passiveobject/witch_bykk/animation/lollipopcrush/"; + local aniPath2 = "whitestart_dw_start.ani"; + local sub = obj.getVar("custom").get_vector(0); + if(sub == 1) aniPath2 = "blackstart_d_start.ani"; + else if(sub == 2) aniPath2 = "bosestart_start.ani"; + local ani = sq_CreateAnimation("",aniPath1 + aniPath2); + obj.setCurrentAnimation(ani); + break; + case 21: + local aniPath1 = "passiveobject/witch_bykk/animation/lollipopcrush/"; + local aniPath2 = "whiteloop_dw_body.ani"; + local sub = obj.getVar("custom").get_vector(0); + if(sub == 1) aniPath2 = "blackloop_db_body.ani"; + else if(sub == 2) aniPath2 = "boseloop_body.ani"; + local ani = sq_CreateAnimation("",aniPath1 + aniPath2); + obj.setCurrentAnimation(ani); + obj.setTimeEvent(0,1000,1,false); + obj.setTimeEvent(1,500,1,false); + break; + case 22: + obj.stopTimeEvent(0); + local aniPath1 = "passiveobject/witch_bykk/animation/lollipopcrush/"; + local aniPath2 = "whiteend_dw_boom.ani",attackIndex = 57; + local sub = obj.getVar("custom").get_vector(0); + if(sub == 1){aniPath2 = "blackend_db_boomback.ani";attackIndex = 58;} + else if(sub == 2){aniPath2 = "boseend_back.ani";attackIndex = 58;} + local ani = sq_CreateAnimation("",aniPath1 + aniPath2); + obj.setCurrentAnimation(ani); + local totalDamage = obj.getVar("custom").get_vector(1); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, attackIndex)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local level = obj.getVar("custom").get_vector(2); + local prob = obj.getVar("custom").get_vector(3); + local time = obj.getVar("custom").get_vector(4); + local damage = obj.getVar("custom").get_vector(5); + switch(sub){ + case 0: + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_LIGHTNING, prob, level, time, damage); + break; + case 1: + case 2: + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_BLIND, prob, level, time); + break; + } + break; + } + break; + } + break; + } + + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo){ + local element_kk_fire = sqrChr.getVar("element_kk").getInt(0); + local element_kk_water = sqrChr.getVar("element_kk").getInt(1); + local element_kk_dark = sqrChr.getVar("element_kk").getInt(2); + local element_kk_light = sqrChr.getVar("element_kk").getInt(3); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE) && element_kk_fire > 0) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER) && element_kk_water > 0) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK) && element_kk_dark > 0) attackInfo.setElement(ENUM_ELEMENT_DARK); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT) && element_kk_light > 0) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + } +} + +function onEndCurrentAni_po_witch_bykk_kak(obj) +{ + if(!obj) return; + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").get_vector(0); + local subtype = obj.getVar("subtype").get_vector(0); + local state = obj.getVar("state").get_vector(0); + + switch(skillIndex){ + case SKILL_BYKK_ACIDCLOUD://魔道酸雨雲 + switch(subtype){ + case 1: + switch(state){ + case 20: + obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 22: + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case 2: + switch(state){ + case 20: + case 24: + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 26: + if(obj.getVar().getBool(0)) obj.addSetStatePacket(27, null, STATE_PRIORITY_AUTO, false, ""); + else obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 27: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 3: + sq_SendDestroyPacketPassiveObject(obj); + break; + case 4: + case 5: + case 6: + case 7: + switch(state){ + case 21: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + } + break; + case SKILL_BYKK_ANTIGRAVITYSTARTER://反重力裝置 + switch(subtype){ + case 1: + switch(state){ + case 20: + obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 21: + obj.removeAllTimeEvent(); + local size = obj.getVar("targetObj").get_obj_vector_size(); + for(local i = 0; i < size; i++){ + local damager = sq_GetCNRDObjectToActiveObject(obj.getVar("targetObj").get_obj_vector(i)); + if(damager || damager.getState() != STATE_DIE) damager.getVar("anti").setBool(0,false); + } + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 2: + case 3: + case 4: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case SKILL_BYKK_BLACKMANTLE://暗影鬥篷 + switch(subtype){ + case 1: + sq_SendDestroyPacketPassiveObject(obj); + break; + case 2: + switch(state){ + case 20: + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 22: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 3: + switch(state){ + case 20: + case 21: + case 23: + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 24: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + } + break; + case SKILL_BYKK_BROOMSPIN://旋轉掃把 + break; + case SKILL_BYKK_ELECTRICRABBIT://光電兔 + switch(subtype){ + case 1: + case 4: + switch(state){ + case 20: + case 21: + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 22: + local totalDamage = obj.getVar("custom").get_vector(1); + local damageRate = obj.getVar("custom").get_vector(6); + totalDamage = (totalDamage.tofloat() * damageRate.tofloat() / 100.0).tointeger(); + if(subtype == 1) cearteSkillPassive_Witch_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_ELECTRICRABBIT,3,0,totalDamage,0,0,0,0,0,0,2); + if(subtype == 4) cearteSkillPassive_Witch_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_ELECTRICRABBIT,3,1,totalDamage,0,0,0,0,0,0,2); + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 2: + switch(state){ + case 20: + case 21: + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 22: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + } + break; + case SKILL_BYKK_ENHANCEDMAGICMISSILE://改良魔法星彈 + switch(subtype){ + case 1: + switch(state){ + case 20: + case 22: + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 21: + if(obj.getVar("custom").get_vector(0) >= 2){ + if(obj.getVar("targetObj").get_obj_vector_size() > 0){ + obj.getVar("move").clear_vector(); + obj.getVar("move").push_vector(sq_GetXPos(obj)); + obj.getVar("move").push_vector(sq_GetZPos(obj)); + obj.getVar("move").push_vector(100); + obj.getVar("move").push_vector(300); + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + } + else obj.addSetStatePacket(24, null, STATE_PRIORITY_AUTO, false, ""); + } + else sq_SendDestroyPacketPassiveObject(obj); + break; + case 23: + case 24: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + } + break; + case SKILL_BYKK_FLUORECOLLIDER://電鳗碰撞機 + switch(subtype){ + case 1: + switch(state){ + case 20: + obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 22: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + } + break; + case SKILL_BYKK_FUSIONCRAFT://技藝融合 + break; + case SKILL_BYKK_HEATINGFURNACE://爆炎加熱爐 + switch(subtype){ + case 1: + switch(state){ + case 20: + obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 22: + case 23: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 2: + case 4: + case 6: + case 7: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case SKILL_BYKK_HOMUNCULUS://魔道學助手 + if((subtype == 31 && state == 20) || (subtype == 41 && state == 20)){obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");return;} + sq_SendDestroyPacketPassiveObject(obj); + break; + case SKILL_BYKK_JACKFROSTICEWATER://雪人刨冰 + switch(subtype){ + case 1: + case 2: + switch(state){ + case 20: + obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 22: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + } + break; + case SKILL_BYKK_JACKOHALLOWEEN://搗蛋傑克 + switch(subtype){ + case 1: + switch(state){ + case 20: + case 21: + case 22: + case 23: + case 25: + // if(state == 21){ + // obj.getVar().clear_ct_vector(); + // obj.getVar().push_ct_vector(); + // local timer = obj.getVar().get_ct_vector(0); + // timer.Reset(); + // timer.Start(10000,0); + // } + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 26: + sqrChr.getVar("jackohalloween_pumpkin").clear_obj_vector(); + local lava_Obj = obj.getVar("jackohalloween_lava").get_obj_vector(0); + if(lava_Obj){ + local colObj = sq_GetCNRDObjectToCollisionObject(lava_Obj); + sq_SendDestroyPacketPassiveObject(colObj); + } + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 2: + switch(state){ + case 21: + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 23: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + } + break; + case SKILL_BYKK_LAVAPOTION://熔岩藥瓶 + switch(subtype){ + case 4: + if(state == 22) sq_SendDestroyPacketPassiveObject(obj); + break; + case 1: + case 2: + sq_SendDestroyPacketPassiveObject(obj); + break; + case 3: + if(state == 21) obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + else if(state == 23){ + local size = obj.getVar("targetObj").get_obj_vector_size(); + for(local i = 0; i < size; i++){ + local targetObj = sq_GetCNRDObjectToActiveObject(obj.getVar("targetObj").get_obj_vector(i)); + if(targetObj || targetObj.getState() != STATE_DIE) targetObj.getVar("lavapotion").setBool(0,false); + } + sq_SendDestroyPacketPassiveObject(obj); + } + break; + } + break; + case SKILL_BYKK_MEGADRILL://冰霜鑽孔車 + switch(subtype){ + case 1: + switch(state){ + case 20: + obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 21: + obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 22: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 2: + case 12: + switch(state){ + case 20: + case 21: + if(state == 20) obj.sq_PlaySound("MEGA_DRILL_STARTING"); + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 25: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 3: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case SKILL_BYKK_UROBOROS://二覺 + break; + case SKILL_BYKK_LOLLIPOPCRUSH://超級棒棒糖 + if(subtype == 0 || subtype == 1 || subtype == 9 || subtype == 10 || subtype == 11) sq_SendDestroyPacketPassiveObject(obj); + if(subtype == 20){ + if(state == 20) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + else if(state == 22) sq_SendDestroyPacketPassiveObject(obj); + } + break; + case SKILL_BYKK_TRANSFORMFLAPPER://變異蒼蠅拍 + case SKILL_BYKK_TRANSFORMFLAPPEREX://超級蒼蠅拍 + switch(subtype){ + case 3: + case 4: + if(!sqrChr || sqrChr.getState() == STATE_DIE) break; + if(sq_GetLevelData(sqrChr, SKILL_BYKK_TRANSFORMFLAPPER, 11, sq_GetSkillLevel(sqrChr, SKILL_BYKK_TRANSFORMFLAPPER)) > 0) break; + if(obj.getVar("custom").get_vector(10) < 1){ + local isSeal = obj.getVar("custom").get_vector(7); + if(isSeal == 1){ + local monsterId = [GOBLIN_BYKK_ID,TAU_BYKK_ID]; + local homunculus_skill = sq_GetSkill(sqrChr, SKILL_BYKK_HOMUNCULUS) + if(sq_GetSkillLevel(sqrChr, SKILL_BYKK_HOMUNCULUS) > 0 && !homunculus_skill.isSealFunction()) monsterId = [LANTERN_BYKK_ID,FLUORE_BYKK_ID,FLUTO_BYKK_ID,JACKFROST_BYKK_ID]; + local monstertime = obj.getVar("custom").get_vector(5); + local monsterlevel = obj.getVar("custom").get_vector(6); + for(local i = 0; i < obj.getVar("custom").get_vector(9); i++){ + if(sqrChr.getVar("countofhomunculus").getInt(11) < sq_GetIntData(sqrChr, SKILL_BYKK_HOMUNCULUS, 45)){ + summonmonster_witch_bykk(sqrChr,sqrChr,200,0,-sq_GetZPos(sqrChr),0,monsterId[sq_getRandom(0,(monsterId.len()-1))],monstertime,monsterlevel,0); + sqrChr.getVar("countofhomunculus").setInt(11, sqrChr.getVar("countofhomunculus").getInt(11) + 1); + print("number = "+sqrChr.getVar("countofhomunculus").getInt(11)); + } + } + } + } + break; + } + sq_SendDestroyPacketPassiveObject(obj); + break; + } +} + +function onTimeEvent_po_witch_bykk_kak(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return; + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").get_vector(0); + local subtype = obj.getVar("subtype").get_vector(0); + local state = obj.getVar("state").get_vector(0); + + switch(skillIndex){ + case SKILL_BYKK_ACIDCLOUD://魔道酸雨雲 + switch(subtype){ + case 1: + switch(timeEventIndex){ + case 0: + obj.sq_PlaySound("ACIDCLOUD_DISAPPEARANCE"); + sq_SendDestroyPacketPassiveObject(obj); + break; + case 1: + obj.resetHitObjectList(); + break; + case 2://leidian + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/acidcloud/cloudspark"+(timeEventCount % 3 + 1).tostring()+".ani",sq_getRandom(-75,75),0,0); + local targetObj = obj.sq_FindFirstTarget(-120, 120, 60, 400); + if(targetObj){ + local totalDamage = obj.getVar("custom").get_vector(4); + local sizeRate = obj.getVar("custom").get_vector(3); + cearteSkillPassive_Witch_bykk(sqrChr,targetObj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_ACIDCLOUD,3,totalDamage,sizeRate,0,0,0,0,0,0,1); + } + break; + case 3: + local lifeTime = obj.getVar("custom").get_vector(1) - 480; + local successType = obj.getVar("custom").get_vector(0); + if(successType == 0) sq_CreateParticle("passiveobject/witch_bykk/particle/acidraindrop.ptl", obj, 0, 0, 0 - obj.getZPos(), true, 40, 0, lifeTime / 40); + else sq_CreateParticle("passiveobject/witch_bykk/particle/acidraindrop.ptl", obj, 0, 0, 0 - obj.getZPos(), true, 10, 0, lifeTime / 10); + break; + } + break; + case 2: + switch(timeEventIndex){ + case 0: + obj.removeAllTimeEvent(); + obj.addSetStatePacket(27, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 1: + obj.resetHitObjectList(); + break; + case 2: + local targetObj; + obj.getVar("targetObj").clear_obj_vector(); + local targetObj_num = -1; + local objectManager = obj.getObjectManager();//得到對象管理器 + local objectNumber = objectManager.getCollisionObjectNumber();//總數 + for(local i = 0; i < objectNumber; i++){ + local object = objectManager.getCollisionObject(i);//得到控制類對象 + if(object && object.isObjectType(OBJECTTYPE_ACTIVE) && sqrChr.isEnemy(object) && sq_Abs(sq_GetXPos(object) - sq_GetXPos(obj)) <= 800 && sq_Abs(sq_GetYPos(object) - sq_GetYPos(obj)) <= 400){ + local activeObj = sq_GetCNRDObjectToActiveObject(object); + if(sq_IsBoss(activeObj) || sq_IsNamed(activeObj)) obj.getVar("targetObj").push_obj_vector(object); + } + } + if(obj.getVar("targetObj").get_obj_vector_size() > 0) targetObj = obj.getVar("targetObj").get_obj_vector(0); + else targetObj = obj.sq_FindFirstTarget(-9999, 19998, 9999, 9999); + if(targetObj && targetObj.getState() != STATE_DIE){ + local activeObj = sq_GetCNRDObjectToActiveObject(targetObj); + obj.getVar("targetObj").clear_obj_vector(); + obj.getVar("targetObj").push_obj_vector(activeObj); + obj.stopTimeEvent(2); + if(sq_GetXPos(obj) > sq_GetXPos(activeObj)) obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, ""); + else obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + return; + } + break; + case 3: + local targetObj = obj.getVar("targetObj").get_obj_vector(0); + if(targetObj){ + local activeObj = sq_GetCNRDObjectToActiveObject(targetObj); + local disX = sq_Abs(sq_GetXPos(obj) - sq_GetXPos(activeObj)); + local disY = sq_Abs(sq_GetYPos(obj) - sq_GetYPos(activeObj)); + if(disX > 50){ + local baseM = 20; + if(obj.getVar("custom").get_vector(7) > 0) baseM = 14; + local moveX = disX / baseM + 1; + if(sq_GetXPos(obj) > sq_GetXPos(activeObj)) sq_setCurrentAxisPos(obj, 0, sq_GetXPos(obj) - moveX); + else sq_setCurrentAxisPos(obj, 0, sq_GetXPos(obj) + moveX); + } + if(disY > 30){ + local baseM = 20; + if(obj.getVar("custom").get_vector(7) > 0) baseM = 14; + local moveY = disY / baseM + 1; + if(sq_GetYPos(obj) > sq_GetYPos(activeObj)) sq_setCurrentAxisPos(obj, 1, sq_GetYPos(obj) - moveY); + else sq_setCurrentAxisPos(obj, 1, sq_GetYPos(obj) + moveY); + } + if(disX <= 50 && disY <= 30){ + obj.stopTimeEvent(3); + obj.setTimeEvent(4,100,-1,false); + if(obj.getState() != 24) obj.addSetStatePacket(24, null, STATE_PRIORITY_AUTO, false, ""); + } + } + else{ + obj.stopTimeEvent(3); + obj.setTimeEvent(4,100,-1,false); + if(obj.getState() != 21) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + } + break; + case 4: + local targetObj = obj.getVar("targetObj").get_obj_vector(0); + if(!targetObj || targetObj.getState() == STATE_DIE){ + obj.stopTimeEvent(4); + obj.setTimeEvent(3,35,-1,false); + if(obj.getState() != 26) obj.addSetStatePacket(26, null, STATE_PRIORITY_AUTO, false, ""); + } + else{ + local activeObj = sq_GetCNRDObjectToActiveObject(targetObj); + local disX = sq_Abs(sq_GetXPos(obj) - sq_GetXPos(activeObj)); + local disY = sq_Abs(sq_GetYPos(obj) - sq_GetYPos(activeObj)); + if(disX > 50 && disY > 30){ + obj.stopTimeEvent(4); + obj.setTimeEvent(3,35,-1,false); + //if(obj.getState() != 26) obj.addSetStatePacket(26, null, STATE_PRIORITY_AUTO, false, ""); + } + } + break; + case 5: + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,sq_getRandom(-100,100),sq_getRandom(-10,0)-1,-40,obj.getDirection(),SKILL_BYKK_ACIDCLOUD,sq_getRandom(4,6),0,0,0,0,0,0,0,0,0); + break; + case 6: + obj.removeAllTimeEvent(); + obj.addSetStatePacket(27, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 7: + if(sq_getRandom(1,100) < 75) break; + local totalDamage = obj.getVar("custom").get_vector(2); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,sq_getRandom(-100,100),sq_getRandom(-10,0)-1,-80,obj.getDirection(),SKILL_BYKK_ACIDCLOUD,7,totalDamage,0,0,0,0,0,0,0,0); + break; + } + break; + case 4: + case 5: + case 6: + case 7: + switch(timeEventIndex){ + case 1: + // local pAni = obj.getCurrentAnimation();//得到ani + // local currentT = sq_GetCurrentTime(pAni);//當前時間 + //local fireT = 350;//總時間 + local hight = obj.getVar("custom").get_vector(0); + local v = sq_GetUniformVelocity(hight, 0, timeEventCount, 35); + sq_setCurrentAxisPos(obj, 2, v); + if(timeEventCount >= 35) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + } + break; + case SKILL_BYKK_ANTIGRAVITYSTARTER://反重力裝置 + switch(timeEventIndex){ + case 0: + local size = obj.getVar("targetObj").get_obj_vector_size(); + for(local i = 0; i < size; i++){ + local damager = sq_GetCNRDObjectToActiveObject(obj.getVar("targetObj").get_obj_vector(i)); + if(damager || damager.getState() != STATE_DIE){ + if(damager.getZPos() <= 5 && damager.getVar("anti").getBool(0) == false){ + damager.getVar("anti").setBool(0,true); + local totalDamage = obj.getVar("custom").get_vector(2); + cearteSkillPassive_Witch_bykk(sqrChr,damager,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_ANTIGRAVITYSTARTER,3,totalDamage,0,0,0,0,0,0,0,1); + } + } + } + break; + case 1: + local successType = obj.getVar("custom").get_vector(1); + cearteSkillPassive_Witch_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_WITCH,155,8,0,obj.getDirection(),SKILL_BYKK_ANTIGRAVITYSTARTER,4,successType,0,0,0,0,0,0,0,0); + cearteSkillPassive_Witch_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_WITCH,30,50,0,obj.getDirection(),SKILL_BYKK_ANTIGRAVITYSTARTER,4,successType,0,0,0,0,0,0,0,0); + cearteSkillPassive_Witch_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_WITCH,-40,-40,0,obj.getDirection(),SKILL_BYKK_ANTIGRAVITYSTARTER,4,successType,0,0,0,0,0,0,0,0); + cearteSkillPassive_Witch_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_WITCH,-155,5,0,obj.getDirection(),SKILL_BYKK_ANTIGRAVITYSTARTER,4,successType,0,0,0,0,0,0,0,0); + break; + case 2: + obj.sq_PlaySound("ANTIGRAVITY_STEAM"); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/antigravity/smoke1.ani",-25,0,120); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/antigravity/smoke2.ani",15,0,50); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/antigravity/smoke3.ani",-15,0,50); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/antigravity/smoke4.ani",0,0,30); + break; + } + break; + case SKILL_BYKK_BLACKMANTLE://暗影鬥篷 + switch(timeEventIndex){ + case 0: + obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 1: + local targetObj_num = 0; + obj.getVar("targetObj").clear_obj_vector(); + local objectManager = obj.getObjectManager();//得到對象管理器 + local objectNumber = objectManager.getCollisionObjectNumber();//總數 + for(local i = 0; i < objectNumber; i++){ + local object = objectManager.getCollisionObject(i);//得到控制類對象 + if(object && object.isObjectType(OBJECTTYPE_ACTIVE) && sqrChr.isEnemy(object)){ + local activeObj = sq_GetCNRDObjectToActiveObject(object); + if(sq_Abs(sq_GetXPos(obj) - sq_GetXPos(activeObj)) <= 200 && sq_Abs(sq_GetYPos(obj) - sq_GetYPos(activeObj)) <= 100 && sq_GetZPos(activeObj) <= 50 && sq_Abs(sq_GetXPos(obj) - sq_GetXPos(activeObj)) > 0 && sq_Abs(sq_GetYPos(obj) - sq_GetYPos(activeObj)) > 0){ + targetObj_num = targetObj_num + 1; + obj.getVar("targetObj").push_obj_vector(activeObj); + } + } + } + if(targetObj_num > 0){ + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/blackmantle/redcandy/blackmantleneohandfront_handfront_01_01.ani",0,1,1); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/blackmantle/redcandy/blackmantleneohandback_handback.ani",0,-1,-1); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/blackmantle/redcandy/blackmantleneohandfront_wind01.ani",0,0,0); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/blackmantle/redcandy/blackmantleneohandfloor_focus03.ani",0,0,0); + obj.getVar().setBool(0,true); + obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, ""); + obj.setTimeEvent(2,300,1,false); + } + break; + case 2: + obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + local size = obj.getVar("targetObj").get_obj_vector_size(); + for(local i = 0; i < size; i++){ + local activeObj = sq_GetCNRDObjectToActiveObject(obj.getVar("targetObj").get_obj_vector(i)); + if(activeObj){ + local AddAppendage = CNSquirrelAppendage.sq_GetAppendage(activeObj,"character/mage/witch_skill_bykk/ap/ap_blackmantle.nut"); + if(AddAppendage) continue; + AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(activeObj, obj, SKILL_BYKK_BLACKMANTLE, false, "character/mage/witch_skill_bykk/ap/ap_blackmantle.nut", true); + if(AddAppendage){ + sq_MoveToAppendageForce(activeObj, obj, obj, 0, 0, activeObj.getZPos() - obj.getZPos(), 100, true, AddAppendage); + sq_HoldAndDelayDie(activeObj, obj, true, true, true, 10, 200, ENUM_DIRECTION_NEUTRAL , AddAppendage); + AddAppendage.sq_SetValidTime(500); + } + } + } + break; + case 3: + obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case SKILL_BYKK_BROOMSPIN://旋轉掃把 + switch(timeEventIndex){ + case 0: + local parentObj = obj.getParent(); + CNSquirrelAppendage.sq_RemoveAppendage(parentObj, "Appendage/Character/ap_common_suck.nut"); + sq_SendDestroyPacketPassiveObject(obj); + break; + case 1: + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sqrChr.getXPos(), sqrChr.getDirection(), 50)); + sq_setCurrentAxisPos(obj, 1, sqrChr.getYPos()); + break; + } + break; + case SKILL_BYKK_ELECTRICRABBIT://光電兔 + switch(timeEventIndex){ + case 0: + obj.resetHitObjectList(); + break; + } + break; + case SKILL_BYKK_ENHANCEDMAGICMISSILE://改良魔法星彈 + switch(timeEventIndex){ + case 0: + obj.resetHitObjectList(); + local sub = obj.getVar("custom").get_vector(6); + if(obj.getVar("custom").get_vector(0) >= 2 && timeEventCount >= 2 + sub) obj.setTimeEvent(2,100,1,false); + break; + case 1: + local size = obj.getVar("targetObj").get_obj_vector_size(); + if(size <= 0) break; + for(local i = 0; i < size; i++){ + local targetObj = obj.getVar("targetObj").get_obj_vector(i); + if(targetObj){ + local activeObj = sq_GetCNRDObjectToActiveObject(targetObj); + local drawObj = createOnlyDrawObject_witch_bykk(obj,"passiveobject/witch_bykk/animation/enhancedmagicmissile/linkelectric.ani",true,obj.getDirection(),sq_GetXPos(obj),sq_GetYPos(obj) - 1,sq_GetZPos(obj),ENUM_DRAWLAYER_NORMAL); + setLightning_witch_bykk(obj, drawObj, targetObj); + sq_SendHitObjectPacket(obj,activeObj,0,0,sq_GetObjectHeight(targetObj) / 2); + } + } + break; + case 2: + if(obj.getVar("targetObj").get_obj_vector_size() > 0){ + obj.getVar("move").clear_vector(); + obj.getVar("move").push_vector(sq_GetXPos(obj)); + obj.getVar("move").push_vector(sq_GetZPos(obj)); + obj.getVar("move").push_vector(100); + obj.getVar("move").push_vector(300); + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + } + else obj.addSetStatePacket(24, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case SKILL_BYKK_FLUORECOLLIDER://電鳗碰撞機 + switch(timeEventIndex){ + case 0: + obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 1: + obj.resetHitObjectList(); + break; + case 2: + local size = obj.getVar("targetObj").get_obj_vector_size(); + for(local i = 0; i < size; i++){ + local targetObj = obj.getVar("targetObj").get_obj_vector(i); + if(targetObj){ + local activeObj = sq_GetCNRDObjectToActiveObject(targetObj); + local aniPath = "passiveobject/witch_bykk/animation/fluorecollider/thunder7.ani"; + local aniPath2 = "passiveobject/witch_bykk/animation/fluorecollider/thunder"+sq_getRandom(1,6).tostring()+".ani"; + local drawObj = createOnlyDrawObject_witch_bykk(obj,aniPath,true,obj.getDirection(),sq_GetDistancePos(sq_GetXPos(obj),obj.getDirection(),10),sq_GetYPos(obj),195,ENUM_DRAWLAYER_NORMAL); + local drawObj2 = createOnlyDrawObject_witch_bykk(obj,aniPath2,true,obj.getDirection(),sq_GetDistancePos(sq_GetXPos(obj),obj.getDirection(),10),sq_GetYPos(obj),195,ENUM_DRAWLAYER_NORMAL); + setLightning_witch_bykk(obj, drawObj, activeObj); + setLightning_witch_bykk(obj, drawObj2, activeObj); + } + } + break; + } + break; + case SKILL_BYKK_FUSIONCRAFT://技藝融合 + break; + case SKILL_BYKK_HEATINGFURNACE://爆炎加熱爐 + switch(subtype){ + case 1: + switch(timeEventIndex){ + case 0: + if(true) obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, "");//超大成功時 + else obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case 2: + switch(timeEventIndex){ + case 0: + local hitMax = 15 + obj.getVar("custom").getInt(10); + local time = 750; + obj.setTimeEvent(1, time / (hitMax + 1), hitMax, false); + break; + case 1: + obj.resetHitObjectList(); + break; + } + break; + case 3: + switch(timeEventIndex){ + case 0: + // local successType = obj.getVar("custom").get_vector(0); + // if(successType >= 1){ + // local anglea = obj.getVar("custom").get_vector(1); + // local speed_X = obj.getVar("custom").get_vector(2); + // local speed_Z = obj.getVar("custom").get_vector(3); + // local Xpos = obj.getVar("custom").get_vector(4); + // local Ypos = obj.getVar("custom").get_vector(5); + // local Zpos = obj.getVar("custom").get_vector(6); + // sq_BinaryStartWrite(); + // sq_BinaryWriteDword(SKILL_BYKK_HEATINGFURNACE); + // sq_BinaryWriteDword(5); + // sq_BinaryWriteDword(anglea); + // sq_BinaryWriteDword(speed_X); + // sq_BinaryWriteDword(speed_Z); + // sq_BinaryWriteDword(timeEventCount); + // sq_SendCreatePassiveObjectPacketPos(obj, PASSIVEOBJECT_BYKK_WITCH, 0, Xpos, Ypos - timeEventCount, Zpos - timeEventCount); + // } + break; + } + break; + case 4: + local sizeRate = obj.getVar("custom").get_vector(0); + sizeRate = sizeRate.tofloat() / 100.0; + switch(timeEventIndex){ + case 1: + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/common/animation/fireexplosionparticle1.ani", sq_getRandom(-10,10), sq_getRandom(-10,10), sq_getRandom(-10,10)); + local currentAni = pooledObj.getCurrentAnimation(); + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + break; + case 2: + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/common/animation/fireexplosionparticle2.ani", 0, 2, 0); + local currentAni = pooledObj.getCurrentAnimation(); + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + break; + case 3: + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/common/animation/fireexplosionparticle3.ani", 0, 1, 1); + local currentAni = pooledObj.getCurrentAnimation(); + local angle = sq_ToRadian(360.0 * timeEventCount / 16); + sq_SetfRotateAngle(currentAni, angle); + currentAni.setImageRateFromOriginal(sizeRate * 2.0, sizeRate * 2.0); + break; + case 4: + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/common/animation/fireexplosionparticle4.ani", sq_getRandom(-30,30), sq_getRandom(-30,30), sq_getRandom(-30,30)); + local currentAni = pooledObj.getCurrentAnimation(); + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + break; + } + break; + case 6: + switch(timeEventIndex){ + case 0: + obj.setTimeEvent(1,80,8,false); + break; + case 1: + obj.resetHitObjectList(); + break; + } + break; + case 7: + switch(timeEventIndex){ + case 0: + local number_max = obj.getVar("custom").getInt(10); + local pAni = obj.getCurrentAnimation(); + local delaysum = pAni.getDelaySum(3, 17); + obj.setTimeEvent(1,delaysum / (number_max + 1),number_max, true); + break; + case 1: + obj.resetHitObjectList(); + break; + } + break; + } + break; + case SKILL_BYKK_HOMUNCULUS://魔道學助手 + switch(timeEventIndex){ + case 0: + local targetObj = sq_GetCNRDObjectToActiveObject(obj.getVar().get_obj_vector(0)); + if(targetObj){ + local aniPath = "monster/character/mage/witch_bykk/fluore/animation/a/fluore_athunder7.ani"; + local aniPath2 = "monster/character/mage/witch_bykk/fluore/animation/a/fluore_athunder"+sq_getRandom(1,6).tostring()+".ani"; + local drawObj = createOnlyDrawObject_witch_bykk(obj,aniPath,true,obj.getDirection(),sq_GetXPos(obj),sq_GetYPos(obj) + 1,sq_GetZPos(obj),ENUM_DRAWLAYER_NORMAL); + local drawObj2 = createOnlyDrawObject_witch_bykk(obj,aniPath,true,obj.getDirection(),sq_GetXPos(obj),sq_GetYPos(obj) + 1,sq_GetZPos(obj),ENUM_DRAWLAYER_NORMAL); + setLightning_witch_bykk(obj, drawObj, targetObj); + setLightning_witch_bykk(obj, drawObj2, targetObj); + sq_SendHitObjectPacket(obj,targetObj,0,0,sq_GetObjectHeight(obj) / 2); + } + else sq_SendDestroyPacketPassiveObject(obj); + break; + case 1: + local totalDamage = obj.getVar("custom").get_vector(0); + local prob = obj.getVar("custom").get_vector(1); + local level = obj.getVar("custom").get_vector(2); + local time = obj.getVar("custom").get_vector(3); + local damage = obj.getVar("custom").get_vector(4); + cearteSkillPassive_Witch_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_WITCH,sq_getRandom(-100,100),sq_getRandom(-50,50),0,obj.getDirection(),SKILL_BYKK_HOMUNCULUS,13,totalDamage,prob,level,time,damage,0,0,0,0); + break; + case 2: + obj.resetHitObjectList(); + break; + case 3: + sq_SendDestroyPacketPassiveObject(obj); + break; + case 4: + local hitMax = obj.getVar("custom").get_vector(0); + sq_CreateParticle("passiveobject/witch_bykk/particle/acidraindrop.ptl", obj, 0, 0, 0 - obj.getZPos(), true, 10, 0, (150*hitMax+100) / 10); + break; + } + break; + case SKILL_BYKK_JACKFROSTICEWATER://雪人刨冰 + switch(timeEventIndex){ + case 0: + obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 1: + obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 2: + local totalDamage = obj.getVar("custom").get_vector(0); + local sub = obj.getVar("custom").get_vector(2); + cearteSkillPassive_Witch_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_JACKFROSTICEWATER,2,totalDamage,sub,0,0,0,0,0,0,0); + break; + case 3: + if(obj.getVar().getBool(0)){obj.resetHitObjectList();break;}; + local inputConut = sqrChr.getRapidInputFrequency(); + inputConut = inputConut.tointeger(); + local inputMax = 10; + if(inputConut > inputMax){ + obj.setTimeEvent(3,75,-1,false); + obj.getVar().setBool(0,true); + local currentAni = obj.getCurrentAnimation(); + currentAni.setSpeedRate(150.0); + } + else obj.setTimeEvent(3,150,1,false); + + obj.resetHitObjectList(); + break; + case 4: + obj.stopSound(2333); + obj.sq_PlaySound("JACKFROST_ICEWATER_ROLL_LOOP",2333); + break; + } + break; + case SKILL_BYKK_JACKOHALLOWEEN://搗蛋傑克 + switch(timeEventIndex){ + case 0: + obj.addSetStatePacket(25, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 1: + obj.setTimeEvent(2,600,-1,true); + break; + case 2: + local offset_x = sq_GetDistancePos(sq_GetXPos(obj),obj.getDirection(),450); + local offset_y = sq_GetYPos(obj); + local offset_z = sq_GetZPos(obj); + local path1 = "character/mage/effect/animation/witch_bykk/jackohalloween/jackohalloweenlavafloorbottom_lavafloor.ani"; + local path2 = "character/mage/effect/animation/witch_bykk/jackohalloween/jackohalloweenlavafloortop_circle.ani"; + createOnlyDrawObject_witch_bykk(obj,path1,true,obj.getDirection(),offset_x,offset_y,offset_z,ENUM_DRAWLAYER_BOTTOM); + createOnlyDrawObject_witch_bykk(obj,path2,true,obj.getDirection(),offset_x,offset_y,offset_z,ENUM_DRAWLAYER_NORMAL); + break; + case 3: + if(sqrChr){ + local sqrChr_offset_X = sq_GetDistancePos(sq_GetXPos(sqrChr),obj.getDirection(),-50); + local disX = sq_Abs(sq_GetXPos(obj) - sqrChr_offset_X); + local disY = sq_Abs(sq_GetYPos(obj) - sq_GetYPos(sqrChr)); + if(disX > 30){ + local moveX = disX / 20 + 1; + if(sq_GetXPos(obj) > sqrChr_offset_X) sq_setCurrentAxisPos(obj, 0, sq_GetXPos(obj) - moveX); + else sq_setCurrentAxisPos(obj, 0, sq_GetXPos(obj) + moveX); + } + if(disY > 10){ + local moveY = disY / 20 + 1; + if(sq_GetYPos(obj) > sq_GetYPos(sqrChr)) sq_setCurrentAxisPos(obj, 1, sq_GetYPos(obj) - moveY); + else sq_setCurrentAxisPos(obj, 1, sq_GetYPos(obj) + moveY); + } + if(disX > 30 || disY > 10) obj.setTimeEvent(3,30,1,false); + else obj.setTimeEvent(3,1000,1,false); + } + break; + case 4: + obj.resetHitObjectList(); + break; + case 5: + obj.stopSound(1103); + if(timeEventCount % 2 == 1) obj.sq_PlaySound("JACKOHALLOWEEN_FIRE_LOOP",1103); + else obj.sq_PlaySound("JACKOHALLOWEEN_FIRE_LOOP_02",1103); + break; + } + break; + case SKILL_BYKK_LAVAPOTION://熔岩藥瓶 + switch(timeEventIndex){ + case 0: + sq_SendDestroyPacketPassiveObject(obj); + break; + case 1: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/lavapotionfail_22.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/witch_bykk/animation/lavapotion/lavapotionfailbottom_01.ani"),true); + break; + case 2: + obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 3: + obj.resetHitObjectList(); + break; + case 4: + if(timeEventCount % 2 == 0){ + obj.stopSound(7701); + obj.sq_PlaySound("FIRE_EXPLOSION_CREATE",7701); + local sizeRate = obj.getVar("custom").get_vector(0); + local totalDamage = obj.getVar("custom").get_vector(4); + local successType = obj.getVar("custom").get_vector(1); + cearteSkillPassive_Witch_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_LAVAPOTION,1,totalDamage,sizeRate,0,0,successType,0,0,0,1); + } + local sizeRate = obj.getVar("custom").get_vector(0).tofloat() / 100.0 * 1.35; + local offset_x = (30.0 * sizeRate).tointeger(); + local offset_y = (5.0 * sizeRate).tointeger(); + local setx = sq_getRandom(-offset_x,offset_x); + local sety = sq_getRandom(-offset_y,offset_y); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/lavapotion/lavapotionfire.ani",setx,sety,0); + cearteSkillPassive_Witch_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_WITCH,setx,sety + 1,0,obj.getDirection(),SKILL_BYKK_LAVAPOTION,4,0,0,0,0,0,0,0,0,0); + break; + } + break; + case SKILL_BYKK_MEGADRILL://冰霜鑽孔車 + switch(subtype){ + case 1: + switch(timeEventIndex){ + case 0: + obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 1: + createOnlyDrawObject_witch_bykk(obj,"passiveobject/witch_bykk/animation/megadrill/fail/megadrillfailstartbottom.ani",true,obj.getDirection(),sq_GetXPos(obj),sq_GetYPos(obj),sq_GetZPos(obj),ENUM_DRAWLAYER_BOTTOM) + break; + case 2: + obj.resetHitObjectList(); + break; + case 3: + if(obj.getVar("custom").get_vector(2) > 0){ + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(0,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/newmegadrilltwist_01.ani"),true); + local parentObj = obj.getParent(); + if(!parentObj) break; + local appendage = CNSquirrelAppendage.sq_AppendAppendage(parentObj, obj, -1, false, "appendage/character/ap_common_suck.nut", false); + if(appendage){ + CNSquirrelAppendage.sq_Append(appendage, parentObj, obj); + local auraAppendage = appendage.sq_getAuraMaster("auraMaster"); + if(!auraAppendage) auraAppendage = appendage.sq_AddAuraMaster("auraMaster", parentObj, obj, 1200, 18, 5, 0); + if(auraAppendage) auraAppendage.setAttractionInfo(800, 800, 300, 100); + } + } + break; + } + break; + case 2: + case 12: + switch(timeEventIndex){ + case 0: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/megadrill/fluore2_dust"+sq_getRandom(1,3).tostring()+".ani",0,-1,-1); + break; + case 1: + // obj.setTimeEvent(2,50,-1,false); + break; + case 2: + // local parentObj = obj.getParent(); + // if(parentObj){ + // if(timeEventCount % 2 == 1){ + // sq_setCurrentAxisPos(obj, 0, sq_GetXPos(parentObj)); + // sq_setCurrentAxisPos(obj, 2, sq_GetZPos(parentObj)); + // } + // else{ + // sq_setCurrentAxisPos(obj, 0, sq_GetXPos(parentObj) + 5); + // sq_setCurrentAxisPos(obj, 2, sq_GetZPos(parentObj) + 5); + // } + // } + if(timeEventCount % 2 == 1) sq_setCurrentAxisPos(obj, 2, sq_GetZPos(obj) + 1); + else sq_setCurrentAxisPos(obj, 2, sq_GetZPos(obj)); + break; + case 3: + obj.resetHitObjectList(); + break; + case 4: + case 5: + case 6: + case 7: + local sizeRate = 1.5; + local pooledObj1 = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/character/mage/animation/icefireexplosionparticle"+(timeEventIndex-3).tostring()+".ani",50,0,50); + local pooledObj2 = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/character/mage/animation/icefireexplosionparticle"+(timeEventIndex-3).tostring()+".ani",-46,0,40); + local pooledObj3 = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/character/mage/animation/icefireexplosionparticle"+(timeEventIndex-3).tostring()+".ani",-36,0,100); + local aniA = [pooledObj1,pooledObj2,pooledObj3]; + for(local i = 0; i < 3; i++){ + local pAni = aniA[i].getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + } + break; + } + break; + case 4: + if(timeEventIndex == 0){ + sqrChr.sq_IntVectClear(); + sqrChr.sq_IntVectPush(2); + sqrChr.sq_AddSetStatePacket(SKILL_BYKK_MEGADRILL , STATE_PRIORITY_USER, true); + sq_SendDestroyPacketPassiveObject(obj); + } + break; + } + break; + case SKILL_BYKK_UROBOROS://二覺 + switch(timeEventIndex){ + case 0: + local ani = sq_CreateAnimation("","passiveobject/witch_bykk/animation/uroboros/explosion_dodge.ani"); + obj.setCurrentAnimation(ani); + local totalDamage = obj.getVar("custom").get_vector(0); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 39)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + sq_CreateParticle("character/mage/effect/animation/witch_bykk/uroboros/particle/uroborossub.ptl", obj, 0, 0, 100, true, 1, 0, 1); + obj.sq_PlaySound("UROBOROS_EXP"); + break; + case 1: + local aniPath = "passiveobject/witch_bykk/animation/uroboros/attackset03_dark.ani"; + local aniPath2 = "passiveobject/witch_bykk/animation/uroboros/attackset01_dark.ani"; + if(timeEventCount % 4 == 2){aniPath = "passiveobject/witch_bykk/animation/uroboros/attackset03_fire.ani";aniPath2 = "passiveobject/witch_bykk/animation/uroboros/attackset01_fire.ani";} + if(timeEventCount % 4 == 3){aniPath = "passiveobject/witch_bykk/animation/uroboros/attackset03_ice.ani";aniPath2 = "passiveobject/witch_bykk/animation/uroboros/attackset01_ice.ani";} + if(timeEventCount % 4 == 0){aniPath = "passiveobject/witch_bykk/animation/uroboros/attackset03_light.ani";aniPath2 = "passiveobject/witch_bykk/animation/uroboros/attackset01_light.ani";} + local totalDamage = obj.getVar("custom").get_vector(0); + local targetObj = obj.sq_FindFirstTarget(-300, 600, 100, 600); + if(targetObj){ + sq_AddDrawOnlyAniFromParent(obj,aniPath2,0,1,1); + local activeObj = sq_GetCNRDObjectToActiveObject(targetObj); + local drawObj = createOnlyDrawObject_witch_bykk(obj,aniPath,true,obj.getDirection(),sq_GetXPos(obj),sq_GetYPos(obj),sq_GetZPos(obj) + 20,ENUM_DRAWLAYER_NORMAL); + obj.sq_PlaySound("R_UROBOROS_SPARK"); + setUroLightning_witch_bykk(obj, drawObj, activeObj); + cearteSkillPassive_Witch_bykk(sqrChr,activeObj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_UROBOROS,3,timeEventCount % 4,totalDamage,0,0,0,0,0,0,1); + local targetObj2 = obj.sq_FindNextTarget(targetObj, 200, 100); + if(targetObj2){ + local activeObj2 = sq_GetCNRDObjectToActiveObject(targetObj2); + local drawObj2 = createOnlyDrawObject_witch_bykk(obj,aniPath,true,obj.getDirection(),sq_GetXPos(obj),sq_GetYPos(obj),sq_GetZPos(obj) + 20,ENUM_DRAWLAYER_NORMAL); + obj.sq_PlaySound("R_UROBOROS_SPARK"); + setUroLightning_witch_bykk(obj, drawObj2, activeObj2); + cearteSkillPassive_Witch_bykk(sqrChr,activeObj2,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_UROBOROS,3,timeEventCount % 4,totalDamage,0,0,0,0,0,0,1); + } + } + break; + case 2: + sqrChr.sq_IntVectClear(); + sqrChr.sq_IntVectPush(2); + sqrChr.sq_AddSetStatePacket(SKILL_BYKK_UROBOROS , STATE_PRIORITY_USER, true); + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case SKILL_BYKK_LOLLIPOPCRUSH://超級棒棒糖 + switch(timeEventIndex){ + case 0: + obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 1: + if(!sqrChr) return; + local targetObj; + if(sqrChr.getVar("Lollipopcrush_Boss").get_obj_vector_size() > 0){ + targetObj = sqrChr.getVar("Lollipopcrush_Boss").get_obj_vector(0); + } + else if(sqrChr.getVar("Lollipopcrush_Named").get_obj_vector_size() > 0){ + targetObj = sqrChr.getVar("Lollipopcrush_Named").get_obj_vector(0); + } + else{ + targetObj = obj.sq_FindFirstTarget(-9999, 19998, 9999, 9999); + } + if(!targetObj){ + if(sq_GetIntData(sqrChr, SKILL_BYKK_LOLLIPOPCRUSH, 16) > 0){ + targetObj = sqrChr; + local sub = obj.getVar("custom").get_vector(0); + local whitecandy_num = sqrChr.getVar("whitecandy_num").get_vector(0); + local blackcandy_num = sqrChr.getVar("blackcandy_num").get_vector(0); + local bosscandy_num = sqrChr.getVar("bosscandy_num").get_vector(0); + switch(sub){ + case 0: + sqrChr.getVar("whitecandy_num").set_vector(0,whitecandy_num+1); + break; + case 1: + sqrChr.getVar("blackcandy_num").set_vector(0,blackcandy_num+1); + break; + case 2: + sqrChr.getVar("bosscandy_num").set_vector(0,bosscandy_num+1); + break; + } + } + else return; + } + obj.getVar("targetObj").clear_obj_vector(); + obj.getVar("targetObj").push_obj_vector(targetObj); + obj.getVar().setBool(0,true); + break; + } + break; + case SKILL_BYKK_TRANSFORMFLAPPER://變異蒼蠅拍 + switch(timeEventIndex){ + case 0: + sq_SendDestroyPacketPassiveObject(obj); + break; + case 1: + obj.resetHitObjectList(); + break; + } + break; + case SKILL_BYKK_TRANSFORMFLAPPEREX://超級蒼蠅拍 + switch(timeEventIndex){ + case 0: + local offset_x = [125,125,-125,-125,210,210,-210,-210,275,275,-275,-275,310,310,-310,-310,315,315,-310,-310]; + local offset_y = [-35,35,35,-35,-60,60,60,-60,-80,80,80,-80,-95,95,95,-95,-105,105,105,-105]; + local sizeRate = [100,75,50,35,20]; + local basea = (timeEventCount-1)*4; + local totalDamage = obj.getVar("custom").get_vector(0) / timeEventCount; + for(local i = 0; i < 4; i++){ + cearteSkillPassive_Witch_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_WITCH,offset_x[basea + i],offset_y[basea + i],0,obj.getDirection(),SKILL_BYKK_TRANSFORMFLAPPEREX,6,totalDamage*sizeRate[timeEventCount - 1]/100,sizeRate[timeEventCount - 1],0,0,0,0,0,0,1); + } + break; + } + break; + } +} + +function onAttack_po_witch_bykk_kak(obj, damager, boundingBox, isStuck) +{ + if(!obj) return; + //enableClearDeadEnemies(obj, damager); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").get_vector(0); + local subtype = obj.getVar("subtype").get_vector(0); + local state = obj.getVar("state").get_vector(0); + + switch(skillIndex){ + case SKILL_BYKK_ACIDCLOUD://魔道酸雨雲 + break; + case SKILL_BYKK_ANTIGRAVITYSTARTER://反重力裝置 + switch(subtype){ + case 1: + if(obj.getVar("targetObj").get_obj_vector_size() <= 0) obj.getVar("targetObj").clear_obj_vector(); + if(damager.isObjectType(OBJECTTYPE_ACTIVE)) obj.getVar("targetObj").push_obj_vector(damager); + else return; + local successType = obj.getVar("custom").get_vector(1); + local holdandup = 0; + if(successType >= 1) holdandup = 300;// + if(CNSquirrelAppendage.sq_IsAppendAppendage(damager, "appendage/character/hearthings.nut")){ + CNSquirrelAppendage.sq_RemoveAppendage(damager, "appendage/character/hearthings.nut"); + } + if(CNSquirrelAppendage.sq_IsAppendAppendage(damager, "character/mage/witch_skill_bykk/passiveobj/ap_antigravity.nut")){ + CNSquirrelAppendage.sq_RemoveAppendage(damager, "character/mage/witch_skill_bykk/passiveobj/ap_antigravity.nut"); + } + CNSquirrelAppendage.sq_AppendAppendage(damager, obj, -1, false, "appendage/character/hearthings.nut", true); + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(damager, obj, SKILL_BYKK_ANTIGRAVITYSTARTER, false, "appendage/character/hearthings.nut", true); + if(AddAppendage){ + AddAppendage.getAppendageInfo().setValidTime(100); + sq_HoldAndDelayDie(damager, obj, true, true, true, 0, holdandup, ENUM_DIRECTION_NEUTRAL , AddAppendage); + if(successType >= 2) obj.setTimeEvent(0,80,-1,false); + } + break; + } + break; + case SKILL_BYKK_BLACKMANTLE://暗影鬥篷 + switch(subtype){ + case 2: + if(damager.isObjectType(OBJECTTYPE_ACTIVE) && obj.isExistTimeEvent(1)){ + local AddAppendage = CNSquirrelAppendage.sq_GetAppendage(damager,"character/mage/witch_skill_bykk/ap/ap_blackmantle.nut"); + if(AddAppendage) CNSquirrelAppendage.sq_RemoveAppendage(damager, "character/mage/witch_skill_bykk/ap/ap_blackmantle.nut"); + AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(damager, obj, SKILL_BYKK_BLACKMANTLE, false, "character/mage/witch_skill_bykk/ap/ap_blackmantle.nut", true); + if(AddAppendage){ + sq_MoveToAppendageForce(damager, obj, obj, 0, 0, damager.getZPos() - obj.getZPos(), 100, true, AddAppendage); + sq_HoldAndDelayDie(damager, obj, true, true, true, 10, 200, ENUM_DIRECTION_NEUTRAL , AddAppendage); + AddAppendage.sq_SetValidTime(3000); + } + } + break; + } + break; + case SKILL_BYKK_BROOMSPIN://旋轉掃把 + break; + case SKILL_BYKK_ELECTRICRABBIT://光電兔 + break; + case SKILL_BYKK_ENHANCEDMAGICMISSILE://改良魔法星彈 + switch(subtype){ + case 1: + if(obj.getVar("custom").get_vector(0) >= 2){ + if(damager.isObjectType(OBJECTTYPE_ACTIVE)){ + sq_AddDrawOnlyAniFromParent(damager,"passiveobject/witch_bykk/animation/enhancedmagicmissile/endelectric.ani",0,0, sq_GetCenterZPos(boundingBox)); + obj.getVar("targetObj").push_obj_vector(damager); + } + } + break; + } + break; + case SKILL_BYKK_FLUORECOLLIDER://電鳗碰撞機 + switch(subtype){ + case 1: + switch(state){ + case 21: + if(damager.isObjectType(OBJECTTYPE_ACTIVE) && damager.getState() != STATE_DIE){ + obj.getVar("targetObj").push_obj_vector(damager); + local activeObj = sq_GetCNRDObjectToActiveObject(damager); + if(obj.getVar("custom").get_vector(0) >= 2){ + if(!CNSquirrelAppendage.sq_IsAppendAppendage(activeObj, "character/mage/witch_skill_bykk/passiveobj/ap_fluorecollider.nut")){ + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(activeObj, obj, -1, false,"character/mage/witch_skill_bykk/passiveobj/ap_fluorecollider.nut", true); + AddAppendage.sq_SetValidTime(1000); + sq_HoldAndDelayDie(activeObj, obj, true, false, false, 200, 200, ENUM_DIRECTION_NEUTRAL , AddAppendage); + } + } + } + break; + } + break; + } + break; + case SKILL_BYKK_FUSIONCRAFT://技藝融合 + break; + case SKILL_BYKK_HEATINGFURNACE://爆炎加熱爐 + break; + case SKILL_BYKK_HOMUNCULUS://魔道學助手 + if(subtype == 41) sq_SendDestroyPacketPassiveObject(obj); + break; + case SKILL_BYKK_JACKFROSTICEWATER://雪人刨冰 + break; + case SKILL_BYKK_JACKOHALLOWEEN://搗蛋傑克 + break; + case SKILL_BYKK_LAVAPOTION://熔岩藥瓶 + switch(subtype){ + case 3: + if(damager.getVar("lavapotion").getBool(0) == false && damager.isObjectType(OBJECTTYPE_ACTIVE)){ + damager.getVar("lavapotion").setBool(0,true); + obj.getVar("targetObj").push_obj_vector(damager); + local speedRate = obj.getVar("custom").get_vector(2); + local jumpRate = obj.getVar("custom").get_vector(3); + local ap = sq_CreateChangeStatus(CHANGE_STATUS_TYPE_MOVE_SPEED, true, -speedRate.tofloat(), 5000); + if(ap){ + ap.getAppendageInfo().setValidTime(10000);//設置有效時間 + ap.sq_Append(damager, obj);//設置屬性的父對象 + } + local ap2 = sq_CreateChangeStatus(CHANGE_STATUS_TYPE_JUMP_POWER, true, -jumpRate.tofloat(), 5000); + if(ap2){ + ap2.getAppendageInfo().setValidTime(10000);//設置有效時間 + ap2.sq_Append(damager, obj);//設置屬性的父對象 + } + } + break; + } + break; + case SKILL_BYKK_MEGADRILL://冰霜鑽孔車 + break; + case SKILL_BYKK_UROBOROS://二覺 + if(damager.isObjectType(OBJECTTYPE_ACTIVE)){ + if(!sqrChr.getVar("uroborosTar").is_obj_vector(damager)){ + sqrChr.getVar("uroborosTar").push_obj_vector(damager); + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(damager, sqrChr, -1, false, "appendage/character/ap_common_hold.nut", true); + sq_HoldAndDelayDie(damager, sqrChr, true, true, true, 200, 200, ENUM_DIRECTION_NEUTRAL , AddAppendage); + } + } + break; + case SKILL_BYKK_LOLLIPOPCRUSH://超級棒棒糖 + switch(subtype){ + case 0: + case 1: + case 9: + case 10: + case 11: + local candy_num = sqrChr.getVar("candynumber").get_vector(0); + local candy_max = sqrChr.getVar("candynumber").get_vector(1); + local bosscandy_num = sqrChr.getVar("candynumber").get_vector(2); + local bosscandy_max = sqrChr.getVar("candynumber").get_vector(3); + local totalDamage = obj.getVar("custom").get_vector(1); + local totalDamage2 = obj.getVar("custom").get_vector(2); + if(candy_num < candy_max){ + if(damager.isObjectType(OBJECTTYPE_ACTIVE)){ + if(bosscandy_num < bosscandy_max && sq_getRandom(1,100) > 70){ + sqrChr.getVar("candynumber").set_vector(2,bosscandy_num + 1); + local level = obj.getVar("custom").get_vector(3); + local prob = obj.getVar("custom").get_vector(4); + local time = obj.getVar("custom").get_vector(5); + local damage = obj.getVar("custom").get_vector(6); + cearteSkillPassive_Witch_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_WITCH,sq_getRandom(0,350),sq_getRandom(-150,150),10,obj.getDirection(),SKILL_BYKK_LOLLIPOPCRUSH,20,2,totalDamage2,level,prob,time,damage,0,0,2); + } + else{ + sqrChr.getVar("candynumber").set_vector(0,candy_num + 1); + local sub = sq_getRandom(0,1); + switch(sub){ + case 0: + local level = obj.getVar("custom").get_vector(4); + local prob = obj.getVar("custom").get_vector(7); + local time = obj.getVar("custom").get_vector(8); + local damage = obj.getVar("custom").get_vector(9); + cearteSkillPassive_Witch_bykk(sqrChr,damager,PASSIVEOBJECT_BYKK_WITCH,sq_getRandom(-150,350),sq_getRandom(-150,150),10,obj.getDirection(),SKILL_BYKK_LOLLIPOPCRUSH,20,sub,totalDamage,level,prob,time,damage,0,0,2); + break; + case 1: + local level = obj.getVar("custom").get_vector(3); + local prob = obj.getVar("custom").get_vector(4); + local time = obj.getVar("custom").get_vector(5); + local damage = obj.getVar("custom").get_vector(6); + cearteSkillPassive_Witch_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_WITCH,sq_getRandom(0,350),sq_getRandom(-150,150),10,obj.getDirection(),SKILL_BYKK_LOLLIPOPCRUSH,20,sub,totalDamage,level,prob,time,damage,0,0,2); + break; + } + } + } + } + break; + case 20: + local sub = obj.getVar("custom").get_vector(0); + if(sub >= 1 && damager.isObjectType(OBJECTTYPE_ACTIVE)){ + local blind_stuckrate = obj.getVar("custom").get_vector(5); + local blind_time = obj.getVar("custom").get_vector(4); + local ap = sq_CreateChangeStatus(CHANGE_STATUS_TYPE_STUCK , true, -blind_stuckrate.tofloat(), 0); + if (ap){ + ap.getAppendageInfo().setValidTime(blind_time); + ap.sq_Append(damager, obj); + } + } + break; + } + break; + case SKILL_BYKK_TRANSFORMFLAPPER://變異蒼蠅拍 + switch(subtype){ + case 3: + case 4: + if(!sqrChr || sqrChr.getState() == STATE_DIE) break; + local prob = obj.getVar("custom").get_vector(0); + local level = obj.getVar("custom").get_vector(1); + local time = obj.getVar("custom").get_vector(2); + if(damager.isObjectType(OBJECTTYPE_ACTIVE)){ + sq_sendSetActiveStatusPacket(damager, obj, ACTIVESTATUS_BLIND, prob.tofloat(), level, false, time); + if(sq_GetLevelData(sqrChr, SKILL_BYKK_TRANSFORMFLAPPER, 11, sq_GetSkillLevel(sqrChr, SKILL_BYKK_TRANSFORMFLAPPER)) > 0) break; + local activeObj = sq_GetCNRDObjectToActiveObject(damager); + local sub_number1 = obj.getVar("custom").get_vector(8); + local isSeal = obj.getVar("custom").get_vector(7); + local mon_number = obj.getVar("custom").get_vector(10); + if(sub_number1 > 0 && !isStuck && isSeal == 1){ + obj.getVar("custom").set_vector(10, mon_number + 1); + local monsterId = [GOBLIN_BYKK_ID,TAU_BYKK_ID]; + local homunculus_skill = sq_GetSkill(sqrChr, SKILL_BYKK_HOMUNCULUS) + if(sq_GetSkillLevel(sqrChr, SKILL_BYKK_HOMUNCULUS) > 0 && !homunculus_skill.isSealFunction()) monsterId = [LANTERN_BYKK_ID,FLUORE_BYKK_ID,FLUTO_BYKK_ID,JACKFROST_BYKK_ID]; + local monstertime = obj.getVar("custom").get_vector(5); + local monsterlevel = obj.getVar("custom").get_vector(6); + for(local i = 0; i < sub_number1; i++){ + if(sqrChr.getVar("countofhomunculus").getInt(11) < sq_GetIntData(sqrChr, SKILL_BYKK_HOMUNCULUS, 45)){ + summonmonster_witch_bykk(sqrChr,activeObj,0,0,-sq_GetZPos(sqrChr),0,monsterId[sq_getRandom(0,(monsterId.len()-1))],monstertime,monsterlevel,0); + sqrChr.getVar("countofhomunculus").setInt(11, sqrChr.getVar("countofhomunculus").getInt(11) + 1); + print("number = "+sqrChr.getVar("countofhomunculus").getInt(11)); + } + + } + } + } + break; + case 14: + case 15: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case SKILL_BYKK_TRANSFORMFLAPPEREX://超級蒼蠅拍 + switch(subtype){ + case 3: + case 4: + if(!sqrChr || sqrChr.getState() == STATE_DIE) break; + if(sq_GetLevelData(sqrChr, SKILL_BYKK_TRANSFORMFLAPPER, 11, sq_GetSkillLevel(sqrChr, SKILL_BYKK_TRANSFORMFLAPPER)) > 0) break; + local sub_number1 = obj.getVar("custom").get_vector(8); + local isSeal = obj.getVar("custom").get_vector(7); + local mon_number = obj.getVar("custom").get_vector(10); + if(sub_number1 > 0 && !isStuck && isSeal == 1 && damager.isObjectType(OBJECTTYPE_ACTIVE)){ + local activeObj = sq_GetCNRDObjectToActiveObject(damager); + obj.getVar("custom").set_vector(10, mon_number + 1); + local monsterId = [GOBLIN_BYKK_ID,TAU_BYKK_ID]; + local homunculus_skill = sq_GetSkill(sqrChr, SKILL_BYKK_HOMUNCULUS) + if(sq_GetSkillLevel(sqrChr, SKILL_BYKK_HOMUNCULUS) > 0 && !homunculus_skill.isSealFunction()) monsterId = [LANTERN_BYKK_ID,FLUORE_BYKK_ID,FLUTO_BYKK_ID,JACKFROST_BYKK_ID]; + local monstertime = obj.getVar("custom").get_vector(5); + local monsterlevel = obj.getVar("custom").get_vector(6); + for(local i = 0; i < sub_number1; i++){ + if(sqrChr.getVar("countofhomunculus").getInt(11) < sq_GetIntData(sqrChr, SKILL_BYKK_HOMUNCULUS, 45)){ + summonmonster_witch_bykk(sqrChr,activeObj,0,0,-sq_GetZPos(sqrChr),0,monsterId[sq_getRandom(0,(monsterId.len()-1))],monstertime,monsterlevel,0); + sqrChr.getVar("countofhomunculus").setInt(11, sqrChr.getVar("countofhomunculus").getInt(11) + 1); + print("number = "+sqrChr.getVar("countofhomunculus").getInt(11)); + } + } + } + break; + } + break; + } +} + +function onKeyFrameFlag_po_witch_bykk_kak(obj, flagIndex) +{ + if(!obj) return; + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").get_vector(0); + local subtype = obj.getVar("subtype").get_vector(0); + local state = obj.getVar("state").get_vector(0); + + switch(skillIndex){ + case SKILL_BYKK_ACIDCLOUD://魔道酸雨雲 + break; + case SKILL_BYKK_ANTIGRAVITYSTARTER://反重力裝置 + break; + case SKILL_BYKK_BLACKMANTLE://暗影鬥篷 + break; + case SKILL_BYKK_BROOMSPIN://旋轉掃把 + break; + case SKILL_BYKK_ELECTRICRABBIT://光電兔 + break; + case SKILL_BYKK_ENHANCEDMAGICMISSILE://改良魔法星彈 + break; + case SKILL_BYKK_FLUORECOLLIDER://電鳗碰撞機 + break; + case SKILL_BYKK_FUSIONCRAFT://技藝融合 + break; + case SKILL_BYKK_HEATINGFURNACE://爆炎加熱爐 + break; + case SKILL_BYKK_HOMUNCULUS://魔道學助手 + break; + case SKILL_BYKK_JACKFROSTICEWATER://雪人刨冰 + local effect_aniPath = "character/mage/effect/animation/witch_bykk/jackfrosticewater/"; + switch(subtype){ + case 1: + switch(flagIndex){ + case 1: + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(1001,sq_CreateAnimation("",effect_aniPath + "start/jackfrosticewaterstartfront_14.ani"),true); + obj.setTimeEvent(1,400,1,false); + obj.setTimeEvent(2,200,1,false); + local parentObj = obj.getParent(); + if(!parentObj) break; + local appendage = CNSquirrelAppendage.sq_AppendAppendage(parentObj, obj, -1, false, "appendage/character/ap_common_suck.nut", false); + if(appendage){ + CNSquirrelAppendage.sq_Append(appendage, parentObj, obj); + local auraAppendage = appendage.sq_getAuraMaster("auraMaster"); + if(!auraAppendage) auraAppendage = appendage.sq_AddAuraMaster("auraMaster", parentObj, obj, 1200, 18, 5, 0); + if(auraAppendage) auraAppendage.setAttractionInfo(200, 200, 300, 100);//300,300,150,100 + } + break; + } + break; + } + break; + case SKILL_BYKK_JACKOHALLOWEEN://搗蛋傑克 + switch(subtype){ + case 1: + switch(flagIndex){ + case 1: + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(obj),obj.getDirection(),-50)); + break; + } + break; + } + break; + case SKILL_BYKK_LAVAPOTION://熔岩藥瓶 + break; + case SKILL_BYKK_MEGADRILL://冰霜鑽孔車 + switch(subtype){ + case 2: + case 12: + switch(flagIndex){ + case 1: + //生成OBJ + local totalDamage = 10000; + cearteSkillPassive_Witch_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_MEGADRILL,3,totalDamage,1,0,0,0,0,0,0,1); + break; + case 2: + break; + } + break; + } + break; + case SKILL_BYKK_UROBOROS://二覺 + break; + case SKILL_BYKK_LOLLIPOPCRUSH://超級棒棒糖 + break; + case SKILL_BYKK_TRANSFORMFLAPPER://變異蒼蠅拍 + switch(subtype){ + case 1: + switch(flagIndex){ + case 1: + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),75)); + sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr) + 85); + break; + case 2: + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),-45)); + sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr) + 50); + break; + case 3: + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),-55)); + sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr) + 40); + break; + case 4: + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),-60)); + sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr) + 25); + break; + case 5: + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),75)); + sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr) + 20); + break; + case 6: + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),80)); + sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr) + 15); + break; + case 7: + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),85)); + sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr) + 10); + break; + } + break; + case 2: + switch(flagIndex){ + case 1: + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),-60)); + sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr) + 40); + break; + case 2: + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),-53)); + sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr) + 14); + break; + case 3: + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),75)); + sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr) + 25); + break; + case 4: + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),55)); + sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr)); + break; + } + break; + case 11: + if(flagIndex == 1) obj.resetHitObjectList(); + break; + } + break; + case SKILL_BYKK_TRANSFORMFLAPPEREX://超級蒼蠅拍 + switch(subtype){ + case 1: + switch(flagIndex){ + case 1: + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),55)); + sq_setCurrentAxisPos(obj, 2, 110); + break; + case 2: + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),-72)); + sq_setCurrentAxisPos(obj, 2, 30); + break; + case 3: + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),-90)); + sq_setCurrentAxisPos(obj, 2, 22); + break;dd + case 4: + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),-70)); + sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr)*0 - 22); + break; + case 5: + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),130)); + sq_setCurrentAxisPos(obj, 2, 0); + break; + case 6: + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),122)); + sq_setCurrentAxisPos(obj, 2, -25); + break; + case 7: + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),125)); + sq_setCurrentAxisPos(obj, 2, -10); + break; + case 8: + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),125)); + sq_setCurrentAxisPos(obj, 2,-10); + break; + } + break; + case 2: + switch(flagIndex){ + case 1: + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),-39)); + sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr) + 25); + break; + case 2: + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),-40)); + sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr) + 15); + break; + case 3: + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),-33)); + sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr) + 23); + break; + case 4: + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(sqrChr),sqrChr.getDirection(),-42)); + sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr) + 30); + break; + } + break; + } + break; + } +} + +function procAppend_po_witch_bykk_kak(obj) +{ + if(!obj) return; + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").get_vector(0); + local subtype = obj.getVar("subtype").get_vector(0); + local state = obj.getVar("state").get_vector(0); + + switch(skillIndex){ + case SKILL_BYKK_ACIDCLOUD://魔道酸雨雲 + switch(subtype){ + case 2: + switch(state){ + case 25: + if(obj.getVar("custom").get_vector(7) > 0) return; + local timer = obj.getVar().get_ct_vector(0); + if(timer){ + local settime = obj.getVar("custom").get_vector(1); + local currentT = timer.Get(); + local fireT = obj.getVar("custom").get_vector(0); + if(currentT + settime >= fireT){ + obj.removeAllTimeEvent(); + obj.getVar().setBool(0,true); + obj.addSetStatePacket(26, null, STATE_PRIORITY_AUTO, false, ""); + } + } + break; + } + break; + case 4: + case 5: + case 6: + case 7: + // switch(state){ + // case 20: + // local pAni = obj.getCurrentAnimation();//得到ani + // local currentT = sq_GetCurrentTime(pAni);//當前時間 + // local fireT = 350;//總時間 + // local hight = obj.getVar("custom").get_vector(0); + // local v = sq_GetUniformVelocity(hight, 0, currentT, fireT); + // sq_setCurrentAxisPos(obj, 2, v); + // if(obj.getZPos() <= 0) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + // break; + // } + break; + } + break; + case SKILL_BYKK_ANTIGRAVITYSTARTER://反重力裝置 + break; + case SKILL_BYKK_BLACKMANTLE://暗影鬥篷 + break; + case SKILL_BYKK_BROOMSPIN://旋轉掃把 + break; + case SKILL_BYKK_ELECTRICRABBIT://光電兔 + break; + case SKILL_BYKK_ENHANCEDMAGICMISSILE://改良魔法星彈 + switch(subtype){ + case 1: + switch(state){ + case 22: + local pAni = obj.getCurrentAnimation();//得到ani + local currentT = sq_GetCurrentTime(pAni);//當前時間 + local fireT = 150;//總時間 + local srcX = obj.getVar("move").get_vector(0);//初始x坐標 + local srcZ = obj.getVar("move").get_vector(1);//初始z坐標 + local MoveX = obj.getVar("move").get_vector(2);//移動多少x距離 + local MoveZ = obj.getVar("move").get_vector(3);//移動多少z距離 + local vx = sq_GetUniformVelocity(0, MoveX, currentT, fireT); + local vz = sq_GetUniformVelocity(0, MoveZ, currentT, fireT); + local dstX = sq_GetDistancePos(srcX, obj.getDirection(), vx);//根據方向運算當前數值 + sq_setCurrentAxisPos(obj, 0, dstX);//設置當前x坐標 + sq_setCurrentAxisPos(obj, 2, srcZ + vz);//設置當前z坐標 + if(currentT >= fireT) obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + } + break; + case SKILL_BYKK_FLUORECOLLIDER://電鳗碰撞機 + break; + case SKILL_BYKK_FUSIONCRAFT://技藝融合 + break; + case SKILL_BYKK_HEATINGFURNACE://爆炎加熱爐 + switch(subtype){ + case 3: + if(sq_GetZPos(obj) <= 15 && obj.getVar().getBool(0) == false){ + obj.getVar().setBool(0,true); + local totalDamage = obj.getVar("custom").get_vector(1); + local successType = obj.getVar("custom").get_vector(0); + local sizeRate = obj.getVar("custom").get_vector(2); + local angle = obj.getVar("custom").get_vector(3); + local angleMax = obj.getVar("custom").get_vector(4); + local sub = obj.getVar("custom").get_vector(5); + if(successType >= 1) cearteSkillPassive_Witch_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_WITCH,0,1,50,obj.getDirection(),SKILL_BYKK_HEATINGFURNACE,4,totalDamage,successType,sizeRate,angle,angleMax,sub,0,0,1); + switch(successType){ + case 0: + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/heatingfurnace/stone_piece_failed_break.ani",0,0,-20); + break; + case 1: + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/heatingfurnace/stone_piece_failed_break.ani",0,0,-20); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/heatingfurnace/stone_piece_normal_break.ani",0,1,-19); + break; + case 2: + case 3: + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/heatingfurnace/stone_piece_great_break.ani",0,0,-20); + break; + } + sq_SendDestroyPacketPassiveObject(obj); + } + break; + } + break; + case SKILL_BYKK_HOMUNCULUS://魔道學助手 + break; + case SKILL_BYKK_JACKFROSTICEWATER://雪人刨冰 + break; + case SKILL_BYKK_JACKOHALLOWEEN://搗蛋傑克 + switch(subtype){ + case 1: + switch(state){ + case 22: + if(obj.getVar().getBool(0)){ + local pAni = obj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + local fireT = pAni.getDelaySum(false); + local srcX = obj.getVar("move").get_vector(0); + local MoveX = obj.getVar("move").get_vector(1); + local v = sq_GetUniformVelocity(0, -MoveX, currentT, fireT); + local dstX = sq_GetDistancePos(srcX, obj.getDirection(), v); + sq_setCurrentAxisPos(obj, 0, dstX); + if(currentT >= fireT) obj.getVar().setBool(0,false); + } + break; + } + + local time = sq_GetObjectTime(obj); + if(time >= obj.getVar("custom").getInt(11) * 15 / 10 && state < 25){ + obj.addSetStatePacket(25, null, STATE_PRIORITY_AUTO, false, ""); + } + break; + } + break; + case SKILL_BYKK_LAVAPOTION://熔岩藥瓶 + switch(subtype){ + case 4: + switch(state){ + case 20: + local pAni = obj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + local fireT = 300;//總時間 + local srcX = obj.getVar("move").get_vector(0); + local srcY = obj.getVar("move").get_vector(1); + local srcZ = obj.getVar("move").get_vector(2); + local MoveX = obj.getVar("move").get_vector(3) / 2; + local MoveY = obj.getVar("move").get_vector(4) / 2; + local MoveZ = obj.getVar("move").get_vector(5); + local direction = obj.getVar("move").get_vector(6); + local obj_direction = obj.getDirection(); + if(direction != obj_direction){ + MoveX = -MoveX; + MoveY = -MoveY; + } + local vx = sq_GetUniformVelocity(0, MoveX, currentT, fireT); + local vy = sq_GetUniformVelocity(0, MoveY, currentT, fireT); + local vz = sq_GetAccel(0, MoveZ, currentT, fireT,true); + local dstX = sq_GetDistancePos(srcX, obj.getDirection(), vx); + sq_setCurrentAxisPos(obj, 0, dstX); + sq_setCurrentAxisPos(obj, 1, srcY + vy); + sq_setCurrentAxisPos(obj, 2, srcZ + vz); + if(currentT >= fireT){ + obj.getVar("move").set_vector(0,sq_GetXPos(obj)); + obj.getVar("move").set_vector(1,sq_GetYPos(obj)); + obj.getVar("move").set_vector(2,sq_GetZPos(obj)); + obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + } + break; + case 21: + local pAni = obj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + local fireT = 300;//總時間 + local srcX = obj.getVar("move").get_vector(0); + local srcY = obj.getVar("move").get_vector(1); + local srcZ = obj.getVar("move").get_vector(2); + local MoveX = obj.getVar("move").get_vector(3) / 2; + local MoveY = obj.getVar("move").get_vector(4) / 2; + local direction = obj.getVar("move").get_vector(6); + local obj_direction = obj.getDirection(); + if(direction != obj_direction){ + MoveX = -MoveX; + MoveY = -MoveY; + } + local vx = sq_GetUniformVelocity(0, MoveX, currentT, fireT); + local vy = sq_GetUniformVelocity(0, MoveY, currentT, fireT); + local vz = sq_GetAccel(srcZ, 0, currentT, fireT,false); + local dstX = sq_GetDistancePos(srcX, obj.getDirection(), vx); + sq_setCurrentAxisPos(obj, 0, dstX); + sq_setCurrentAxisPos(obj, 1, srcY + vy); + sq_setCurrentAxisPos(obj, 2, vz); + if(sq_GetZPos(obj) <= 0) obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case 3: + switch(state){ + case 20: + if(obj.getVar("move").size_vector() > 0){ + local pAni = obj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + local fireT = 240;//總時間 + local srcX = obj.getVar("move").get_vector(0); + local srcZ = obj.getVar("move").get_vector(1); + local MoveX = obj.getVar("move").get_vector(2); + local vx = sq_GetUniformVelocity(0, MoveX, currentT, fireT); + local vz = sq_GetUniformVelocity(srcZ, 0, currentT, fireT); + local dstX = sq_GetDistancePos(srcX, obj.getDirection(), vx); + sq_setCurrentAxisPos(obj, 0, dstX); + sq_setCurrentAxisPos(obj, 2, vz); + if(sq_GetZPos(obj) <= 0) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + } + break; + } + break; + } + break; + case SKILL_BYKK_MEGADRILL://冰霜鑽孔車 + switch(subtype){ + case 2: + case 12: + switch(state){ + case 21: + local pAni = obj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + local fireT = pAni.getDelaySum(0, 4); + if(currentT >= fireT) return; + local srcX = obj.getVar("custom").get_vector(1); + local srcZ = obj.getVar("custom").get_vector(2); + local MoveX = obj.getVar("custom").get_vector(3); + local vx = sq_GetUniformVelocity(0, MoveX, currentT, fireT); + local vz = sq_GetUniformVelocity(srcZ, 0, currentT, fireT); + local dstX = sq_GetDistancePos(srcX, obj.getDirection(), vx); + sq_setCurrentAxisPos(obj, 0, dstX); + sq_setCurrentAxisPos(obj, 2, vz); + break; + } + break; + } + break; + case SKILL_BYKK_UROBOROS://二覺 + break; + case SKILL_BYKK_LOLLIPOPCRUSH://超級棒棒糖 + switch(subtype){ + case 20: + switch(state){ + case 21: + if(obj.getVar().getBool(0)){ + local targetObj = sq_GetCNRDObjectToActiveObject(obj.getVar("targetObj").get_obj_vector(0)); + if(targetObj){ + local pAni = obj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni) - 500; + local fireT = 500; + if(sq_GetDistanceObject(obj, targetObj, false) < 20){ + obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + } + local X1 = sq_GetAccel(obj.getXPos(), targetObj.getXPos(), currentT, fireT, true); + local Y1 = sq_GetAccel(obj.getYPos(), targetObj.getYPos(), currentT, fireT, true); + local Z1 = sq_GetAccel(obj.getZPos(), targetObj.getZPos() + sq_GetObjectHeight(targetObj) / 2, currentT, fireT, true); + sq_setCurrentAxisPos(obj, 0, X1); + sq_setCurrentAxisPos(obj, 1, Y1); + sq_setCurrentAxisPos(obj, 2, Z1); + if(sq_GetXPos(targetObj) > sq_GetXPos(obj)) sq_SetCurrentDirection(obj, 0); + else sq_SetCurrentDirection(obj, 1); + } + } + break; + } + break; + } + break; + } + + if(obj.getZPos() >= 6000){ + local parentObj = obj.getParent(); + local pChr = obj.getTopCharacter(); + local id = parentObj.getCollisionObjectIndex(); + if(!id || !pChr) return; + if(pChr.isMyControlObject()) { + sq_BinaryStartWrite(); + sq_BinaryWriteDword(id); + sq_BinaryWriteDword(sq_GetGroup(parentObj)); + sq_BinaryWriteDword(sq_GetUniqueId(parentObj)); + sq_SendChangeSkillEffectPacket(pChr, SKILL_BYKK_TRANSFORMFLAPPER); + sq_SendDestroyPacketPassiveObject(obj); + } + sq_SendDestroyPacketPassiveObject(obj); + } +} + +function onAfterAttack_po_witch_bykk(obj, damager, boundingBox, isStuck) +{ + if (!obj) return 0; + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").get_vector(0); + local subtype = obj.getVar("subtype").get_vector(0); + local state = obj.getVar("state").get_vector(0); + switch(skillIndex){ + case SKILL_BYKK_TRANSFORMFLAPPER://變異蒼蠅拍 + case SKILL_BYKK_TRANSFORMFLAPPEREX://超級蒼蠅拍 + switch(subtype){ + case 3: + case 4: + if(!sqrChr || sqrChr.getState() == STATE_DIE) break; + if(sq_GetLevelData(sqrChr, SKILL_BYKK_TRANSFORMFLAPPER, 11, sq_GetSkillLevel(sqrChr, SKILL_BYKK_TRANSFORMFLAPPER)) > 0) break; + local isSeal = obj.getVar("custom").get_vector(7); + if(isSeal == 1){ + if(damager.isObjectType(OBJECTTYPE_ACTIVE)){ + local activeObj = sq_GetCNRDObjectToActiveObject(damager); + local successType = obj.getVar("custom").get_vector(3); + if(successType >= 1){ + local monsterId = [GOBLIN_BYKK_ID,TAU_BYKK_ID]; + local homunculus_skill = sq_GetSkill(sqrChr, SKILL_BYKK_HOMUNCULUS) + if(sq_GetSkillLevel(sqrChr, SKILL_BYKK_HOMUNCULUS) > 0 && !homunculus_skill.isSealFunction()) monsterId = [LANTERN_BYKK_ID,FLUORE_BYKK_ID,FLUTO_BYKK_ID,JACKFROST_BYKK_ID]; + if(activeObj.getHp() <= 0){ + local monsterprob = obj.getVar("custom").get_vector(4); + if(sq_getRandom(1,1000) > (1000 - monsterprob)){ + local monstertime = obj.getVar("custom").get_vector(5); + local monsterlevel = obj.getVar("custom").get_vector(6); + if(sqrChr.getVar("countofhomunculus").getInt(11) < sq_GetIntData(sqrChr, SKILL_BYKK_HOMUNCULUS, 45)){ + summonmonster_witch_bykk(sqrChr,activeObj,0,0,-sq_GetZPos(sqrChr),0,monsterId[sq_getRandom(0,(monsterId.len()-1))],monstertime,monsterlevel,0);// + sqrChr.getVar("countofhomunculus").setInt(11, sqrChr.getVar("countofhomunculus").getInt(11) + 1); + print("number = "+sqrChr.getVar("countofhomunculus").getInt(11)); + } + } + } + } + } + } + break; + } + break; + case SKILL_BYKK_LOLLIPOPCRUSH: + switch(subtype){ + case 0: + case 1: + case 9: + case 10: + case 11: + local extra_num = obj.getVar("custom").get_vector(0); + local totalDamage = obj.getVar("custom").get_vector(1); + if(extra_num > 0){ + if(damager.isObjectType(OBJECTTYPE_ACTIVE)){ + local activeObj = sq_GetCNRDObjectToActiveObject(damager); + if(activeObj.getHp() <= 0){ + local sub = sq_getRandom(0,1); + if(sq_getRandom(1,100) > 70) sub = 2,totalDamage = obj.getVar("custom").get_vector(2); + switch(sub){ + case 0: + local level = obj.getVar("custom").get_vector(4); + local prob = obj.getVar("custom").get_vector(7); + local time = obj.getVar("custom").get_vector(8); + local damage = obj.getVar("custom").get_vector(9); + for(local i = 0; i < extra_num; i++){ + cearteSkillPassive_Witch_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_WITCH,sq_getRandom(0,350),sq_getRandom(-150,150),10,obj.getDirection(),SKILL_BYKK_LOLLIPOPCRUSH,20,sub,totalDamage,level,prob,time,damage,0,0,2); + } + break; + case 1: + case 2: + local level = obj.getVar("custom").get_vector(3); + local prob = obj.getVar("custom").get_vector(4); + local time = obj.getVar("custom").get_vector(5); + local damage = obj.getVar("custom").get_vector(6); + for(local i = 0; i < extra_num; i++){ + cearteSkillPassive_Witch_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_WITCH,sq_getRandom(0,350),sq_getRandom(-150,150),10,obj.getDirection(),SKILL_BYKK_LOLLIPOPCRUSH,20,sub,totalDamage,0,0,0,0,0,0,2); + } + break; + } + } + } + } + break; + } + break; + } + return 0; +} + + + + + +function checkExecutableSkill_AcidCloud_bykk(obj) +{ + local state = obj.getState(); + if(state == 6 && !sq_GetSkill(obj, SKILL_BYKK_ACIDCLOUD).isInCoolTime()){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(3); + obj.sq_AddSetStatePacket(SKILL_BYKK_ACIDCLOUD, STATE_PRIORITY_IGNORE_FORCE, true); + return 1; + } + return 0; +} + + +function onSetState_AcidCloud_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + local Ani = obj.sq_GetThrowChargeAni(2); + obj.setCurrentAnimation(Ani); + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_ACIDCLOUD); + local castTime = sq_GetCastTime(obj, SKILL_BYKK_ACIDCLOUD, skill_level); + sq_StartDrawCastGauge(obj, castTime, true); + local animation = sq_GetCurrentAnimation(obj); + local startTime = sq_GetDelaySum(animation); + local speedRate = startTime.tofloat() / castTime.tofloat(); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED,SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, speedRate, speedRate); + break; + case 1: + obj.sq_PlaySound("WZ_ACID_CLOUD"); + local Ani = obj.sq_GetThrowShootAni(2); + obj.setCurrentAnimation(Ani); + local ani = obj.getCurrentAnimation(); + local delay = ani.getDelaySum(0,4); + obj.setTimeEvent(0,240,1,false); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + break; + case 3: + obj.sq_ZStop(); + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_LAVAPOTIONAIR_BODY); + break; + case 4: + obj.sq_SetCurrentAnimation(ANIMATION_ATTACK_SETCUSTOM); + local attackInfo = sq_GetCustomAttackInfo(obj, 1); + sq_SetCurrentAttackInfo(obj, attackInfo); + break; + } +} + +function onEndCurrentAni_AcidCloud_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_ACIDCLOUD, STATE_PRIORITY_USER, true); + break; + case 1: + case 4: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + case 3: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_IntVectPush(0); + obj.sq_IntVectPush(3); + obj.sq_AddSetStatePacket(STATE_JUMP, STATE_PRIORITY_IGNORE_FORCE, true); + break; + } +} + +function onProcCon_AcidCloud_bykk(obj) +{ + if(!obj) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + local stateTime = obj.sq_GetStateTimer(); + local castTime = obj.getVar("custom_bykk").get_vector(0); + if(stateTime >= castTime){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_ACIDCLOUD, STATE_PRIORITY_USER, true); + } + break; + } +} + +function onKeyFrameFlag_AcidCloud_bykk(obj, flagIndex) +{ + if(!obj) return false; + local substate = obj.getSkillSubState(); + switch(substate){ + case 3: + if(flagIndex == 1){ + local skllevel0 = sq_GetSkillLevel(obj, SKILL_BYKK_ACIDCLOUD); + local leftTime = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 0, skllevel0); + local hitTime = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 5, skllevel0); + local skllevel1 = sq_GetSkillLevel(obj, SKILL_BYKK_REDCANDY); + if(skllevel1 > 0){ + if(sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 8, skllevel0) > 0) leftTime = leftTime + 5000; + local totalDamage = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 4, skllevel0); + local totalDamage2 = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 1, skllevel0); + local damageRate = (totalDamage2.tofloat() / totalDamage.tofloat() * 100.0).tointeger(); + local prob = sq_GetLevelData(obj,SKILL_BYKK_REDCANDY, 1, skllevel1); + local level = sq_GetSkillLevel(obj, 174) + sq_GetIntData(obj, SKILL_BYKK_REDCANDY, 13); + local time = sq_GetIntData(obj, SKILL_BYKK_REDCANDY, 14); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,150,0,280 - sq_GetZPos(obj),obj.getDirection(),SKILL_BYKK_ACIDCLOUD,2,totalDamage,leftTime,hitTime,0,prob,level,time,damageRate,1); + if(sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 8, skllevel0) > 0) cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,75,0,280 - sq_GetZPos(obj),obj.getDirection(),SKILL_BYKK_ACIDCLOUD,2,totalDamage,leftTime,hitTime,0,prob,level,time,damageRate,1); + } + else{ + local successType = getSuccessType_bykk(obj,SKILL_BYKK_ACIDCLOUD); + if(successType == 2 && sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM) > 0 && sq_getRandom(0,100) >= (100 - sq_GetIntData(obj, SKILL_BYKK_LAPISPHILOSOPHORUM, 21))) successType = 3; + switch(successType){ + case 0: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/acidcloud/fail_n.ani",0,2,152); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/acidcloud/fail_d.ani",0,1,151); + break; + case 1: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/acidcloud/success_n.ani",0,2,152); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/acidcloud/success_d.ani",0,1,151); + break; + case 2: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/acidcloud/great_d.ani",0,2,152); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/acidcloud/great_n.ani",0,1,151); + break; + } + local totalDamage = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 2, skllevel0); + if(successType == 1) totalDamage = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 3, skllevel0); + if(successType >= 2) totalDamage = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 4, skllevel0); + local totalDamage2 = 0; + if(successType >= 2) totalDamage2 = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 1, skllevel0); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,150,0,200 - sq_GetZPos(obj),obj.getDirection(),SKILL_BYKK_ACIDCLOUD,1,totalDamage,leftTime,hitTime,successType,totalDamage2,0,0,0,1); + } + + local skllevel2 = sq_GetSkillLevel(obj, SKILL_BYKK_SUCCESSPREMONITION); + local nextskillprob = sq_GetLevelData(obj,SKILL_BYKK_SUCCESSPREMONITION, 0, skllevel2); + if(skllevel2 > 0){ + if(sq_getRandom(0,99) > (1000 - nextskillprob) / 10){ + obj.getVar("successpremonition").setBool(0,true); + } + } + } + break; + } +} + +function onTimeEvent_AcidCloud_bykk(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + switch (timeEventIndex) { + case 0: + local skllevel0 = sq_GetSkillLevel(obj, SKILL_BYKK_ACIDCLOUD); + local leftTime = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 0, skllevel0); + local hitTime = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 5, skllevel0); + local skllevel1 = sq_GetSkillLevel(obj, SKILL_BYKK_REDCANDY); + if(skllevel1 > 0){ + if(sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 8, skllevel0) > 0) leftTime = leftTime + 3000; + local totalDamage = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 4, skllevel0); + local totalDamage2 = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 1, skllevel0); + local damageRate = (totalDamage2.tofloat() / totalDamage.tofloat() * 100.0).tointeger(); + local prob = sq_GetLevelData(obj,SKILL_BYKK_REDCANDY, 1, skllevel1); + local level = sq_GetSkillLevel(obj, 174) + sq_GetIntData(obj, SKILL_BYKK_REDCANDY, 13); + local time = sq_GetIntData(obj, SKILL_BYKK_REDCANDY, 14); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,150,0,280,obj.getDirection(),SKILL_BYKK_ACIDCLOUD,2,totalDamage,leftTime,hitTime,0,prob,level,time,damageRate,1); + if(sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 8, skllevel0) > 0) cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,75,0,280,obj.getDirection(),SKILL_BYKK_ACIDCLOUD,2,totalDamage,leftTime,hitTime,0,prob,level,time,damageRate,1); + } + else{ + local successType = getSuccessType_bykk(obj,SKILL_BYKK_ACIDCLOUD); + if(successType == 2 && sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM) > 0 && sq_getRandom(0,100) >= (100 - sq_GetIntData(obj, SKILL_BYKK_LAPISPHILOSOPHORUM, 21))) successType = 3; + switch(successType){ + case 0: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/acidcloud/fail_n.ani",0,2,152); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/acidcloud/fail_d.ani",0,1,151); + break; + case 1: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/acidcloud/success_n.ani",0,2,152); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/acidcloud/success_d.ani",0,1,151); + break; + case 2: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/acidcloud/great_d.ani",0,2,152); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/acidcloud/great_n.ani",0,1,151); + break; + } + local totalDamage = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 2, skllevel0); + if(successType == 1) totalDamage = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 3, skllevel0); + if(successType >= 2) totalDamage = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 4, skllevel0); + local totalDamage2 = 0; + if(successType >= 2) totalDamage2 = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 1, skllevel0); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,150,0,200,obj.getDirection(),SKILL_BYKK_ACIDCLOUD,1,totalDamage,leftTime,hitTime,successType,totalDamage2,0,0,0,1); + } + + local skllevel2 = sq_GetSkillLevel(obj, SKILL_BYKK_SUCCESSPREMONITION); + local nextskillprob = sq_GetLevelData(obj,SKILL_BYKK_SUCCESSPREMONITION, 0, skllevel2); + if(skllevel2 > 0){ + if(sq_getRandom(0,99) > (1000 - nextskillprob) / 10){ + obj.getVar("successpremonition").setBool(0,true); + } + } + break; + } +} + +function onEndState_AcidCloud_bykk(obj, new_state) +{ + if(!obj) return; + if(new_state != SKILL_BYKK_ACIDCLOUD){ + sq_EndDrawCastGauge(obj); + } +} + +function checkExecutableSkill_AntiGravityStarter_bykk(obj) +{ + //print("AntiGravityStarter > true"); + local state = obj.getState(); + local homunculus_level = sq_GetSkillLevel(obj,SKILL_BYKK_HOMUNCULUS); + if(state == 6 && homunculus_level > 0 && !sq_GetSkill(obj, SKILL_BYKK_ANTIGRAVITYSTARTER).isInCoolTime()){ + obj.startSkillCoolTime(SKILL_BYKK_ANTIGRAVITYSTARTER, sq_GetSkillLevel(obj, SKILL_BYKK_ANTIGRAVITYSTARTER), -1); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(3); + obj.sq_AddSetStatePacket(SKILL_BYKK_ANTIGRAVITYSTARTER, STATE_PRIORITY_IGNORE_FORCE, true); + return 1; + } + return 0; +} + +function onSetState_AntiGravityStarter_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + obj.sq_SetCurrentAnimation(40); + local range = sq_GetIntData(obj, SKILL_BYKK_ANTIGRAVITYSTARTER, 6); + local successType = getSuccessType_bykk(obj,SKILL_BYKK_ANTIGRAVITYSTARTER); + if(successType == 2 && sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM) > 0 && sq_getRandom(0,99) >= (100 - sq_GetIntData(obj, SKILL_BYKK_LAPISPHILOSOPHORUM, 21))) successType = 3; + if(successType == 3){ + local sizeRate = sq_GetLevelData(obj,SKILL_BYKK_LAPISPHILOSOPHORUM, 14, sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM)); + range = (range.tofloat() * (100.0 + sizeRate.tofloat()) / 100.0).tointeger(); + } + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ANTIGRAVITYSTARTER, SKILL_BYKK_ANTIGRAVITYSTARTER, 0, 1.0) + 100; + local totalDamage2 = 0; + if(successType == 1) totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ANTIGRAVITYSTARTER, SKILL_BYKK_ANTIGRAVITYSTARTER, 1, 1.0) + 100; + if(successType >= 2){ + totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ANTIGRAVITYSTARTER, SKILL_BYKK_ANTIGRAVITYSTARTER, 2, 1.0) + 100; + totalDamage2 = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ANTIGRAVITYSTARTER, SKILL_BYKK_ANTIGRAVITYSTARTER, 4, 1.0) + 100; + } + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,150,0,0,obj.getDirection(),SKILL_BYKK_ANTIGRAVITYSTARTER,1,totalDamage,range,successType,totalDamage2,0,0,0,0,1); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,150,0,0,obj.getDirection(),SKILL_BYKK_ANTIGRAVITYSTARTER,2,range,0,0,0,0,0,0,0,0); + break; + case 1: + local Ani = obj.sq_GetThrowChargeAni(3); + obj.setCurrentAnimation(Ani); + obj.setTimeEvent(1,100,1,false); + break; + case 2: + local Ani = obj.sq_GetThrowShootAni(2); + obj.setCurrentAnimation(Ani); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/homonculous/antigravity/plutocast.ani",100,0,0); + obj.setTimeEvent(0,150,1,false); + break; + case 3: + obj.sq_ZStop(); + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_LAVAPOTIONAIR_BODY); + break; + } + + local skllevel2 = sq_GetSkillLevel(obj, SKILL_BYKK_SUCCESSPREMONITION); + local nextskillprob = sq_GetLevelData(obj,SKILL_BYKK_SUCCESSPREMONITION, 0, skllevel2); + if(skllevel2 > 0 && (substate == 2 || substate == 3)){ + if(sq_getRandom(0,99) > (1000 - nextskillprob) / 10){ + obj.getVar("successpremonition").setBool(0,true); + } + } +} + +function onEndCurrentAni_AntiGravityStarter_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + case 2: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + case 1: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(SKILL_BYKK_ANTIGRAVITYSTARTER, STATE_PRIORITY_USER, true); + break; + case 3: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_IntVectPush(0); + obj.sq_IntVectPush(3); + obj.sq_AddSetStatePacket(STATE_JUMP, STATE_PRIORITY_USER, true); + break; + } +} + +function onProcCon_AntiGravityStarter_bykk(obj) +{ + if(!obj) return; +} + +function onKeyFrameFlag_AntiGravityStarter_bykk(obj, flagIndex) +{ + if(!obj) return false; + local substate = obj.getSkillSubState(); + switch(substate){ + case 3: + if(flagIndex == 1){ + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/homonculous/antigravity/plutocast.ani",150,0,0 - sq_GetZPos(obj)); + local range = sq_GetIntData(obj, SKILL_BYKK_ANTIGRAVITYSTARTER, 6); + local successType = getSuccessType_bykk(obj,SKILL_BYKK_ANTIGRAVITYSTARTER); + if(successType == 2 && sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM) > 0 && sq_getRandom(0,99) >= (100 - sq_GetIntData(obj, SKILL_BYKK_LAPISPHILOSOPHORUM, 21))) successType = 3; + if(successType == 3){ + local sizeRate = sq_GetLevelData(obj,SKILL_BYKK_LAPISPHILOSOPHORUM, 14, sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM)); + range = (range.tofloat() * (100.0 + sizeRate.tofloat()) / 100.0).tointeger(); + } + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ANTIGRAVITYSTARTER, SKILL_BYKK_ANTIGRAVITYSTARTER, 0, 1.0) + 100; + local totalDamage2 = 0; + if(successType == 1) totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ANTIGRAVITYSTARTER, SKILL_BYKK_ANTIGRAVITYSTARTER, 1, 1.0) + 100; + if(successType >= 2){ + totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ANTIGRAVITYSTARTER, SKILL_BYKK_ANTIGRAVITYSTARTER, 2, 1.0) + 100; + totalDamage2 = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ANTIGRAVITYSTARTER, SKILL_BYKK_ANTIGRAVITYSTARTER, 4, 1.0) + 100; + } + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,200,0,0 - sq_GetZPos(obj),obj.getDirection(),SKILL_BYKK_ANTIGRAVITYSTARTER,1,totalDamage,range,successType,totalDamage2,0,0,0,0,1); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,200,0,0 - sq_GetZPos(obj),obj.getDirection(),SKILL_BYKK_ANTIGRAVITYSTARTER,2,range,0,0,0,0,0,0,0,0); + } + break; + } + return true; +} + +function onTimeEvent_AntiGravityStarter_bykk(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + if(timeEventIndex == 0){ + local range = 600; + local successType = getSuccessType_bykk(obj,SKILL_BYKK_ANTIGRAVITYSTARTER); + if(successType == 2 && sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM) > 0 && sq_getRandom(0,99) >= (100 - sq_GetIntData(obj, SKILL_BYKK_LAPISPHILOSOPHORUM, 21))) successType = 3; + if(successType == 3){ + local sizeRate = sq_GetLevelData(obj,SKILL_BYKK_LAPISPHILOSOPHORUM, 14, sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM)); + range = (range.tofloat() * (100.0 + sizeRate.tofloat()) / 100.0).tointeger(); + } + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ANTIGRAVITYSTARTER, SKILL_BYKK_ANTIGRAVITYSTARTER, 0, 1.0) + 100; + local totalDamage2 = 0; + if(successType == 1) totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ANTIGRAVITYSTARTER, SKILL_BYKK_ANTIGRAVITYSTARTER, 1, 1.0) + 100; + if(successType >= 2){ + totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ANTIGRAVITYSTARTER, SKILL_BYKK_ANTIGRAVITYSTARTER, 2, 1.0) + 100; + totalDamage2 = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ANTIGRAVITYSTARTER, SKILL_BYKK_ANTIGRAVITYSTARTER, 4, 1.0) + 100; + } + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,150,0,0,obj.getDirection(),SKILL_BYKK_ANTIGRAVITYSTARTER,1,totalDamage,range,successType,totalDamage2,0,0,0,0,1); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,150,0,0,obj.getDirection(),SKILL_BYKK_ANTIGRAVITYSTARTER,2,range,0,0,0,0,0,0,0,0); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + } + else if(timeEventIndex == 1){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(SKILL_BYKK_ANTIGRAVITYSTARTER, STATE_PRIORITY_USER, true); + } +} + +function onEndState_AntiGravityStarter_bykk(obj, new_state) +{ + if(!obj) return; +} + +function checkExecutableSkill_BlackMantle_bykk(obj) +{ + //print("BlackMantle > true"); + return 0; +} + +function onSetState_BlackMantle_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_BLACKMANTLE); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_BLACKMANTLE, SKILL_BYKK_BLACKMANTLE, 0, 1.0) + 100; + local bonusRate = 1.0;//obj.getVar("witchs_bonusRate").get_vector(0).tofloat() / 1000.0; + local homunculus_level = sq_GetSkillLevel(obj, SKILL_BYKK_HOMUNCULUS); + if(homunculus_level > 0){ + local bonusrate2 = sq_GetLevelData(obj, SKILL_BYKK_HOMUNCULUS, 6, homunculus_level); + bonusRate = bonusRate + bonusrate2.tofloat() / 1000; + } + totalDamage = (totalDamage.tofloat() * bonusRate).tointeger(); + local attackInfo = sq_GetCustomAttackInfo(obj, 25); + sq_SetCurrentAttackInfo(obj, attackInfo); + sq_SetCurrentAttackBonusRate(attackInfo, totalDamage); + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_BLACKMANTLE); + local prob = sq_GetLevelData(obj,SKILL_BYKK_BLACKMANTLE, 1, skill_level); + local level = sq_GetLevelData(obj,SKILL_BYKK_BLACKMANTLE, 2, skill_level); + local time = sq_GetLevelData(obj,SKILL_BYKK_BLACKMANTLE, 3, skill_level); + local speedRate = sq_GetLevelData(obj,SKILL_BYKK_BLACKMANTLE, 7, skill_level) + 100; + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_BLIND, prob, level, time); + local pAni = obj.getCurrentAnimation(); + pAni.setSpeedRate(200.0); + break; + case 1: + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_BLACKMANTLEHOMUNCULUS); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED,SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + break; + case 10: + // + local Ani = obj.sq_GetThrowChargeAni(0); + obj.setCurrentAnimation(Ani); + break; + case 11: + // obj.sq_PlaySound("WZ_ACID_CLOUD"); + local Ani = obj.sq_GetThrowShootAni(0); + obj.setCurrentAnimation(Ani); + + //local AddAppendage = CNSquirrelAppendage.sq_GetAppendage(obj, "ui/ap/ap_character.nut"); + //if(AddAppendage) print(1); + //else CNSquirrelAppendage.sq_AppendAppendage(obj, obj, -1, false, "ui/ap/ap_character.nut", true); + + local successType = getSuccessType_bykk(obj,SKILL_BYKK_ENHANCEDMAGICMISSILE); + if(successType == 0) successType = 1; + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ENHANCEDMAGICMISSILE, SKILL_BYKK_ENHANCEDMAGICMISSILE, 0, 1.0) + 100; + if(successType == 1) totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ENHANCEDMAGICMISSILE, SKILL_BYKK_ENHANCEDMAGICMISSILE, 1, 1.0) + 100; + local totalDamage2 = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ENHANCEDMAGICMISSILE, SKILL_BYKK_ENHANCEDMAGICMISSILE, 6, 1.0) + 100; + local damageRate = ((totalDamage2.tofloat() / totalDamage.tofloat()) * 100.0).tointeger(); + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_ENHANCEDMAGICMISSILE); + local prob = sq_GetLevelData(obj,SKILL_BYKK_ENHANCEDMAGICMISSILE, 2, skill_level); + local level = sq_GetSkillLevel(obj, 174) + 20; + local time = sq_GetLevelData(obj,SKILL_BYKK_ENHANCEDMAGICMISSILE, 4, skill_level); + local damage = sq_GetLevelData(obj,SKILL_BYKK_ENHANCEDMAGICMISSILE, 5, skill_level); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,50,0,70,obj.getDirection(),SKILL_BYKK_ENHANCEDMAGICMISSILE,1,totalDamage,successType,prob,time,damage,damageRate,level,0,1); + break; + case 12: + obj.sq_ZStop(); + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_ENHANCEDMAGICMISSILEAIR_BODY); + break; + case 21: + local Ani = obj.sq_GetThrowChargeAni(3); + obj.setCurrentAnimation(Ani); + local skill_level = sq_GetSkillLevel(obj, 41);//技能等级 + local castTime = sq_GetCastTime(obj, 41, skill_level);//得到技能里面的施放时间 + local animation = sq_GetCurrentAnimation(obj); + local startTime = sq_GetDelaySum(animation); + local speedRate = startTime.tofloat() / castTime.tofloat(); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED,SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, speedRate, speedRate); + local currentAni = obj.getCurrentAnimation(); + local delaySum = currentAni.getDelaySum(false); + sq_StartDrawCastGauge(obj, delaySum, true); + obj.setTimeEvent(1,delaySum,1,false); + break; + case 22: + local Ani = obj.sq_GetThrowChargeAni(3); + obj.setCurrentAnimation(Ani); + local skill_level = sq_GetSkillLevel(obj, 41);//技能等级 + local castTime = sq_GetCastTime(obj, 41, skill_level);//得到技能里面的施放时间 + if(castTime > 1000) castTime = 1000; + local animation = obj.getCurrentAnimation(); + sq_SetFrameDelayTime(animation, 1, castTime); + sq_StartDrawCastGauge(obj, castTime, true); + obj.setTimeEvent(2,castTime,1,false); + break; + case 23: + local Ani = obj.sq_GetThrowShootAni(3); + obj.setCurrentAnimation(Ani); + break; + } + + if(substate != 10 && substate != 21 && substate != 22){ + local skllevel2 = sq_GetSkillLevel(obj, SKILL_BYKK_SUCCESSPREMONITION); + local nextskillprob = sq_GetLevelData(obj,SKILL_BYKK_SUCCESSPREMONITION, 0, skllevel2); + if(skllevel2 > 0){ + if(sq_getRandom(0,99) > (1000 - nextskillprob) / 10){ + obj.getVar("successpremonition").setBool(0,true); + } + } + } +} + +function onEndCurrentAni_BlackMantle_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + case 1: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + case 10: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(11); + obj.sq_AddSetStatePacket(SKILL_BYKK_BLACKMANTLE, STATE_PRIORITY_USER, true); + break; + case 11: + case 23: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + case 12: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_IntVectPush(0); + obj.sq_IntVectPush(3); + obj.sq_AddSetStatePacket(STATE_JUMP, STATE_PRIORITY_USER, true); + break; + } +} + +function onProcCon_BlackMantle_bykk(obj) +{ + if(!obj) return; +} + +function onKeyFrameFlag_BlackMantle_bykk(obj, flagIndex) +{ + if(!obj) return false; + switch(flagIndex){ + case 1: + local subState = obj.getSkillSubState(); + switch(subState){ + case 0: + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,120,0,30,obj.getDirection(),SKILL_BYKK_BLACKMANTLE,1,2,0,0,0,0,0,0,0,0); + break; + case 1: + local currentAni = obj.getCurrentAnimation(); + local delay = currentAni.getDelaySum(3,3); + local speedRate = 3000 / delay; + print("speedRate = "+speedRate); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_BLACKMANTLE, SKILL_BYKK_BLACKMANTLE, 0, 1.0) + 100; + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_BLACKMANTLE); + local prob = sq_GetLevelData(obj,SKILL_BYKK_BLACKMANTLE, 1, skill_level) / 10; + local level = sq_GetLevelData(obj,SKILL_BYKK_BLACKMANTLE, 2, skill_level); + local time = sq_GetLevelData(obj,SKILL_BYKK_BLACKMANTLE, 3, skill_level); + local leftTime = 2000,homunculus_level = sq_GetSkillLevel(obj, SKILL_BYKK_HOMUNCULUS),homunculus_skill = sq_GetSkill(obj, SKILL_BYKK_HOMUNCULUS); + if(homunculus_level > 0 && !homunculus_skill.isSealFunction()){ + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,100,0,30,obj.getDirection(),SKILL_BYKK_BLACKMANTLE,3,leftTime,totalDamage,prob,level,time,speedRate,0,0,0); + obj.setTimeEvent(0,480 / speedRate * 100,1,false); + } + else cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,130,0,30,obj.getDirection(),SKILL_BYKK_BLACKMANTLE,2,totalDamage,leftTime,prob,level,time,speedRate,0,0,1); + break; + case 12: + local successType = getSuccessType_bykk(obj,SKILL_BYKK_ENHANCEDMAGICMISSILE); + if(successType == 0) successType = 1; + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ENHANCEDMAGICMISSILE, SKILL_BYKK_ENHANCEDMAGICMISSILE, 0, 1.0) + 100; + if(successType == 1) totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ENHANCEDMAGICMISSILE, SKILL_BYKK_ENHANCEDMAGICMISSILE, 1, 1.0) + 100; + local totalDamage2 = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ENHANCEDMAGICMISSILE, SKILL_BYKK_ENHANCEDMAGICMISSILE, 6, 1.0) + 100; + local damageRate = ((totalDamage2.tofloat() / totalDamage.tofloat()) * 100.0).tointeger(); + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_ENHANCEDMAGICMISSILE); + local prob = sq_GetLevelData(obj,SKILL_BYKK_ENHANCEDMAGICMISSILE, 2, skill_level) / 10; + local level = sq_GetSkillLevel(obj, 174) + 20; + local time = sq_GetLevelData(obj,SKILL_BYKK_ENHANCEDMAGICMISSILE, 4, skill_level); + local damage = sq_GetLevelData(obj,SKILL_BYKK_ENHANCEDMAGICMISSILE, 5, skill_level); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,44,0,-10,obj.getDirection(),SKILL_BYKK_ENHANCEDMAGICMISSILE,1,totalDamage,successType,prob,time,damage,damageRate,level,0,1); + break; + } + break; + case 2: + break; + case 3: + break; + case 4: + break; + } +} + +function onTimeEvent_BlackMantle_bykk(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + if(timeEventIndex == 0) obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + else if(timeEventIndex == 1){ + local addAppendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, 41, false, "character/mage/witch_skill_bykk/passiveskill/ap_mpregenrateup.nut", true); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(23); + obj.sq_AddSetStatePacket(SKILL_BYKK_BLACKMANTLE, STATE_PRIORITY_USER, true); + } + else if(timeEventIndex == 2){ + local addAppendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, 41, false, "character/mage/witch_skill_bykk/passiveskill/ap_magicaltempoup.nut", true); + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM) + if(skill_level <= 0){ + local lifeTime = sq_GetLevelData(obj, 2, 0, sq_GetSkillLevel(obj, 2)); + addAppendage.sq_SetValidTime(lifeTime); + } + obj.sq_IntVectClear(); + obj.sq_IntVectPush(23); + obj.sq_AddSetStatePacket(SKILL_BYKK_BLACKMANTLE, STATE_PRIORITY_USER, true); + } +} + +function onEndState_BlackMantle_bykk(obj, new_state) +{ + if(!obj) return; +} + +function onCreateObject_BlackMantle_bykk(obj, createObject) +{ + if(!obj) return; + // local sq_var = obj.getVar(); + // if(createObject.isObjectType(OBJECTTYPE_PASSIVE)){ + // local colObj = sq_GetCNRDObjectToCollisionObject(createObject); + // if(colObj.getCollisionObjectIndex() == PASSIVEOBJECT_BYKK_WITCH){ + // obj.getVar("blackmantle").clear_obj_vector(); + // obj.getVar("blackmantle").push_obj_vector(colObj); + // } + // } +} + +function onAttack_BlackMantle_bykk(obj, damager, boundingBox, isStuck) +{ + if(!obj) return; + local subState = obj.getSkillSubState(); + switch(subState){ + case 0: + if(damager.isObjectType(OBJECTTYPE_ACTIVE)){ + local AddAppendage = CNSquirrelAppendage.sq_GetAppendage(damager,"character/mage/witch_skill_bykk/ap/ap_blackmantle.nut"); + if(AddAppendage) CNSquirrelAppendage.sq_RemoveAppendage(damager, "character/mage/witch_skill_bykk/ap/ap_blackmantle.nut"); + AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(damager, obj, SKILL_BYKK_BLACKMANTLE, false, "character/mage/witch_skill_bykk/ap/ap_blackmantle.nut", true); + if(AddAppendage){ + sq_MoveToAppendageForce(damager, obj, obj, 120, 0, damager.getZPos(), 100, true, AddAppendage); + sq_HoldAndDelayDie(damager, obj, true, true, true, 10, 200, ENUM_DIRECTION_NEUTRAL , AddAppendage); + AddAppendage.sq_SetValidTime(1000); + } + } + break; + } +} + + + + +function checkExecutableSkill_BroomSpin_bykk(obj) +{ + // print("BroomSpin > true"); + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_BROOMSPIN); + if(b_useskill){ + local state = obj.getState(); + if(state == 0 || state == 14 || state == 8){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_BROOMSPIN, STATE_PRIORITY_IGNORE_FORCE, true); + } + else if(state == 6){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(10); + obj.sq_AddSetStatePacket(SKILL_BYKK_BROOMSPIN, STATE_PRIORITY_IGNORE_FORCE, true); + return 0; + } + return 1; + } + return 0; +} + +function onSetState_BroomSpin_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + //以下平地状态 + case 0: + obj.sq_StopMove(); + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_BROOMSPINNEWREADY_BODY); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/broomspin/broomspinnewready_01.ani",0,0,0); + local attackInfo = sq_GetCustomAttackInfo(obj, 26); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_BROOMSPIN, SKILL_BYKK_BROOMSPIN, 5, 1.0) + 100; + local bonusRate = 1.0;//obj.getVar("witchs_bonusRate").get_vector(0).tofloat() / 1000.0; + totalDamage = (totalDamage.tofloat() * bonusRate).tointeger(); + sq_SetCurrentAttackInfo(obj, attackInfo); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.sq_PlaySound("WZ_BROOM_SPIN"); + break; + case 1: + obj.sq_StopMove(); + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_BROOMSPINNEWA_BODY); + break; + case 2: + obj.sq_StopMove(); + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_BROOMSPINNEWB_BODY); + break; + case 3: + local appendage = obj.getVar("BroomSpinAp").getAppendage(0); + if(appendage) appendage.setValid(false); + obj.removeAllTimeEvent(); + obj.sq_StopMove(); + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_BROOMSPINNEWC_BODY); + obj.sq_PlaySound("WZ_BROOM_SPIN_LANDING"); + local attackInfo = sq_GetCustomAttackInfo(obj, 26); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_BROOMSPIN, SKILL_BYKK_BROOMSPIN, 6, 1.0) + 100; + sq_SetCurrentAttackInfo(obj, attackInfo); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + break; + case 4: + local appendage = obj.getVar("BroomSpinAp").getAppendage(0); + if(appendage) appendage.setValid(false); + obj.removeAllTimeEvent(); + obj.sq_StopMove(); + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_BROOMSPINQUICKSTAND); + break; + //以下空中状态 + case 10: + obj.sq_StopMove(); + obj.sq_ZStop(); + obj.sq_SetCurrentAnimation(34); + obj.sq_PlaySound("WZ_BROOM_SPIN"); + local currentAni = obj.getCurrentAnimation(); + local size = sq_AniLayerListSize(currentAni); + for(local i = 0; i < size; i++){ + local pAniL = sq_getAniLayerListObject(currentAni, i); + if(pAniL) currentAni.removeLayerAnimation(pAniL); + } + currentAni.addLayerAnimation(0,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/broomspin/ready.ani"),true); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_BROOMSPIN, SKILL_BYKK_BROOMSPIN, 0, 1.0) + 100; + local bonusRate = 1.0;//obj.getVar("witchs_bonusRate").get_vector(0).tofloat() / 1000.0; + totalDamage = (totalDamage.tofloat() * bonusRate).tointeger(); + local attackInfo = sq_GetCustomAttackInfo(obj, 26); + sq_SetCurrentAttackInfo(obj, attackInfo); + sq_SetCurrentAttackBonusRate(attackInfo, totalDamage); + local hight = obj.getZPos(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(hight); + local time = hight / 3; + obj.setTimeEvent(1,time,-1,false); + break; + case 11: + obj.sq_StopMove(); + obj.sq_ZStop(); + obj.sq_SetCurrentAnimation(35); + local currentAni = obj.getCurrentAnimation(); + local size = sq_AniLayerListSize(currentAni); + for(local i = 0; i < size; i++){ + local pAniL = sq_getAniLayerListObject(currentAni, i); + if(pAniL) currentAni.removeLayerAnimation(pAniL); + } + currentAni.addLayerAnimation(10002,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/broomspin/attack.ani"),true); + obj.setTimeEvent(2,20,-1,false); + obj.setTimeEvent(4,200,1,false); + break; + case 12: + obj.sq_StopMove(); + obj.sq_SetCurrentAnimation(36); + if(obj.isExistTimeEvent(4)) obj.stopTimeEvent(4); + local currentAni = obj.getCurrentAnimation(); + local size = sq_AniLayerListSize(currentAni); + for(local i = 0; i < size; i++){ + local pAniL = sq_getAniLayerListObject(currentAni, i); + if(pAniL) currentAni.removeLayerAnimation(pAniL); + } + currentAni.addLayerAnimation(10002,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/broomspin/delay.ani"),true); + local pAni = obj.getCurrentAnimation(); + local Delay = pAni.getDelaySum(false); + obj.setTimeEvent(0,Delay,1,false); + break; + case 13: + obj.removeAllTimeEvent(); + obj.sq_StopMove(); + obj.sq_SetCurrentAnimation(37); + local hight = obj.getVar("custom").get_vector(0); + if(hight >= 120){ + obj.sq_PlaySound("WZ_BROOM_SPIN_LANDING"); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_BROOMSPIN, SKILL_BYKK_BROOMSPIN, 1, 1.0) + 100; + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_BROOMSPIN,2,100,0,0,0,0,0,0,0,1); + } + break; + } + + if((substate == 3 || substate == 4 || substate == 12) && obj.getVar("broomspin").getBool(1)){ + obj.getVar("broomspin").setBool(1, false); + local skillIndex = obj.getVar("custom").get_vector(0); + switch(skillIndex){ + case SKILL_BYKK_ACIDCLOUD: + local skllevel0 = sq_GetSkillLevel(obj, SKILL_BYKK_ACIDCLOUD); + local leftTime = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 0, skllevel0); + local hitTime = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 5, skllevel0); + local skllevel1 = sq_GetSkillLevel(obj, SKILL_BYKK_REDCANDY); + if(skllevel1 > 0){ + local totalDamage = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 4, skllevel0); + local prob = sq_GetLevelData(obj,SKILL_BYKK_REDCANDY, 1, skllevel1); + local level = sq_GetSkillLevel(obj, 174) + sq_GetIntData(obj, SKILL_BYKK_REDCANDY, 13); + local time = sq_GetIntData(obj, SKILL_BYKK_REDCANDY, 14); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,150,0,280,obj.getDirection(),SKILL_BYKK_ACIDCLOUD,2,totalDamage,leftTime,hitTime,0,prob,level,time,0,1); + } + else{ + local successType = getSuccessType_bykk(obj,SKILL_BYKK_ACIDCLOUD); + if(successType == 2 && sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM) > 0 && sq_getRandom(0,99) >= 49) successType = 3; + local totalDamage = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 2, skllevel0); + if(successType == 1) totalDamage = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 3, skllevel0); + if(successType >= 2) totalDamage = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 4, skllevel0); + local totalDamage2 = 0; + if(successType >= 2) totalDamage2 = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 1, skllevel0); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,150,0,200,obj.getDirection(),SKILL_BYKK_ACIDCLOUD,1,totalDamage,leftTime,hitTime,successType,totalDamage2,0,0,0,1); + } + break; + case SKILL_BYKK_LAVAPOTION: + local successType = getSuccessType_bykk(obj,SKILL_BYKK_LAVAPOTION); + if(successType == 2 && sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM) > 0 && sq_getRandom(0,99) >= 49) successType = 3; + local sizeRate = sq_GetIntData(obj,SKILL_BYKK_LAVAPOTION,8); + local hitTime = sq_GetIntData(obj,SKILL_BYKK_LAVAPOTION,6); + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_LAVAPOTION); + local lifeTime = sq_GetLevelData(obj,SKILL_BYKK_LAVAPOTION, 0, skill_level); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_LAVAPOTION, SKILL_BYKK_LAVAPOTION, 1, 1.0) + 100; + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,50,0,70,obj.getDirection(),SKILL_BYKK_LAVAPOTION,3,totalDamage,lifeTime,hitTime,sizeRate,successType,0,0,0,1); + break; + case SKILL_BYKK_ANTIGRAVITYSTARTER: + local range = sq_GetIntData(obj, SKILL_BYKK_ANTIGRAVITYSTARTER, 6); + local successType = getSuccessType_bykk(obj,SKILL_BYKK_ANTIGRAVITYSTARTER); + if(successType == 2 && sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM) > 0 && sq_getRandom(0,99) >= 49) successType = 3; + if(successType == 3){ + local sizeRate = sq_GetLevelData(obj,SKILL_BYKK_LAPISPHILOSOPHORUM, 14, sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM)); + range = (range.tofloat() * (100.0 + sizeRate.tofloat()) / 100.0).tointeger(); + } + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ANTIGRAVITYSTARTER, SKILL_BYKK_ANTIGRAVITYSTARTER, 0, 1.0) + 100; + local totalDamage2 = 0; + if(successType == 1) totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ANTIGRAVITYSTARTER, SKILL_BYKK_ANTIGRAVITYSTARTER, 1, 1.0) + 100; + if(successType >= 2){ + totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ANTIGRAVITYSTARTER, SKILL_BYKK_ANTIGRAVITYSTARTER, 2, 1.0) + 100; + totalDamage2 = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ANTIGRAVITYSTARTER, SKILL_BYKK_ANTIGRAVITYSTARTER, 4, 1.0) + 100; + } + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,150,0,0,obj.getDirection(),SKILL_BYKK_ANTIGRAVITYSTARTER,1,totalDamage,range,successType,totalDamage2,0,0,0,0,1); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,150,0,0,obj.getDirection(),SKILL_BYKK_ANTIGRAVITYSTARTER,2,range,0,0,0,0,0,0,0,0); + break; + case SKILL_BYKK_ENHANCEDMAGICMISSILE: + local successType = getSuccessType_bykk(obj,SKILL_BYKK_ENHANCEDMAGICMISSILE); + if(successType == 0) successType = 1; + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ENHANCEDMAGICMISSILE, SKILL_BYKK_ENHANCEDMAGICMISSILE, 0, 1.0) + 100; + if(successType == 1) totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ENHANCEDMAGICMISSILE, SKILL_BYKK_ENHANCEDMAGICMISSILE, 1, 1.0) + 100; + local totalDamage2 = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ENHANCEDMAGICMISSILE, SKILL_BYKK_ENHANCEDMAGICMISSILE, 6, 1.0) + 100; + local damageRate = ((totalDamage2.tofloat() / totalDamage.tofloat()) * 100.0).tointeger(); + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_ENHANCEDMAGICMISSILE); + local prob = sq_GetLevelData(obj,SKILL_BYKK_ENHANCEDMAGICMISSILE, 2, skill_level); + local level = sq_GetSkillLevel(obj, 174) + 20; + local time = sq_GetLevelData(obj,SKILL_BYKK_ENHANCEDMAGICMISSILE, 4, skill_level); + local damage = sq_GetLevelData(obj,SKILL_BYKK_ENHANCEDMAGICMISSILE, 5, skill_level); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,50,0,70,obj.getDirection(),SKILL_BYKK_ENHANCEDMAGICMISSILE,1,totalDamage,successType,prob,time,damage,damageRate,level,0,1); + break; + case SKILL_BYKK_JACKOHALLOWEEN: + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_JACKOHALLOWEEN, SKILL_BYKK_JACKOHALLOWEEN, 0, 1.0) + 100; + local hitTime = sq_GetIntData(obj,SKILL_BYKK_JACKOHALLOWEEN,5); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_JACKOHALLOWEEN,1,120,totalDamage,hitTime,0,0,0,0,0,2); + break; + } + obj.startSkillCoolTime(skillIndex, sq_GetSkillLevel(obj, skillIndex), -1); + } +} + +function onEndCurrentAni_BroomSpin_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + obj.setTimeEvent(2,20,-1,false); + obj.setTimeEvent(4,200, 1,false); + obj.getVar("Witch_BroomSpin").clear_ct_vector(); + obj.getVar("Witch_BroomSpin").push_ct_vector(); + local timer = obj.getVar("Witch_BroomSpin").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); + local appendage = sq_AttractToMe(obj, 200, 120, 300); + obj.getVar("BroomSpinAp").setAppendage(0,appendage); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_BROOMSPIN, STATE_PRIORITY_USER, true); + break; + case 1: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(SKILL_BYKK_BROOMSPIN, STATE_PRIORITY_USER, true); + break; + case 2: + obj.sq_IntVectClear(); + local timer = obj.getVar("Witch_BroomSpin").get_ct_vector(0); + if(timer){ + local currentT = timer.Get(); + local lifeTime = sq_GetIntData(obj, SKILL_BYKK_BROOMSPIN, 5) - 1000; + if(currentT <= lifeTime) obj.sq_IntVectPush(1); + else{ + obj.getVar("Witch_BroomSpin").clear_ct_vector(); + if(obj.getVar("broomspin").getBool(0)) obj.sq_IntVectPush(3); + else obj.sq_IntVectPush(4); + } + } + obj.sq_AddSetStatePacket(SKILL_BYKK_BROOMSPIN, STATE_PRIORITY_USER, true); + break; + case 3: + case 4: + obj.getVar("broomspin").setBool(0,false); + local appendage = obj.getVar("BroomSpinAp").getAppendage(0); + if(appendage) appendage.setValid(false); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + case 10: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(11); + obj.sq_AddSetStatePacket(SKILL_BYKK_BROOMSPIN, STATE_PRIORITY_USER, true); + break; + case 11: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(12); + obj.sq_AddSetStatePacket(SKILL_BYKK_BROOMSPIN, STATE_PRIORITY_USER, true); + break; + case 12: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(13); + obj.sq_AddSetStatePacket(SKILL_BYKK_BROOMSPIN, STATE_PRIORITY_USER, true); + break; + case 13: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_BroomSpin_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 1: + case 2: + sq_SetKeyxEnable(obj, E_ATTACK_COMMAND, true); + if(sq_IsEnterCommand(obj, E_ATTACK_COMMAND)) obj.addRapidInput(); + + sq_SetKeyxEnable(obj, E_JUMP_COMMAND, true); + if(sq_IsEnterCommand(obj, E_JUMP_COMMAND)){ + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + } + + break; + case 11: + sq_SetKeyxEnable(obj, E_ATTACK_COMMAND, true); + if(sq_IsEnterCommand(obj, E_ATTACK_COMMAND)) obj.addRapidInput(); + + sq_SetKeyxEnable(obj, E_JUMP_COMMAND, true); + if(sq_IsEnterCommand(obj, E_JUMP_COMMAND)){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_IntVectPush(0); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(STATE_JUMP, STATE_PRIORITY_USER, true); + } + + local stateTime = obj.sq_GetStateTimer(); + local hight = obj.getVar("custom").get_vector(0); + local fireT = hight * 7; + local v = sq_GetUniformVelocity(hight, 20, stateTime, fireT); + sq_setCurrentAxisPos(obj, 2, v); + + if(obj.getZPos() <= 20){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(12); + obj.sq_AddSetStatePacket(SKILL_BYKK_BROOMSPIN, STATE_PRIORITY_USER, true); + } + + break; + } + if((substate == 1 || substate == 2 || substate == 11) && obj.getVar("broomspin").getBool(1) == false){ + local skillIndex = [SKILL_BYKK_ACIDCLOUD,SKILL_BYKK_LAVAPOTION,SKILL_BYKK_ANTIGRAVITYSTARTER,SKILL_BYKK_ENHANCEDMAGICMISSILE,SKILL_BYKK_JACKOHALLOWEEN]; + for(local i = 0; i < skillIndex.len(); i++){ + obj.setSkillCommandEnable(skillIndex[i],true); + local b_useskill = obj.sq_IsEnterSkill(skillIndex[i]); + if(b_useskill != -1){ + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(skillIndex[i]); + obj.getVar("broomspin").setBool(1, true); + } + } + } +} + +function onKeyFrameFlag_BroomSpin_bykk(obj, flagIndex) +{ + if(!obj) return false; + local substate = obj.getSkillSubState(); + switch(substate){ + case 1: + if(sq_GetCurrentFrameIndex(obj) <= 1) sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/broomspin/broomspinnewsmoke.ani",-111,0,3); + else sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/broomspin/broomspinnewsmoke.ani",67,0,11); + break; + case 2: + switch(flagIndex){ + case 1: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/broomspin/broomspinnewsmoke.ani",-109,0,0); + break; + case 2: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/broomspin/broomspinnewsmoke.ani",0,0,18); + break; + case 3: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/broomspin/broomspinnewsmoke.ani",127,0,0); + break; + case 4: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/broomspin/broomspinnewsmoke.ani",0,0,-18); + break; + } + break; + case 3: + switch(flagIndex){ + case 1: + sq_flashScreen(obj,10,20,20,76, sq_RGB(255,255,255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + break; + case 2://shock wave + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_BROOMSPIN, SKILL_BYKK_BROOMSPIN, 1, 1.0) + 100; + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_BROOMSPIN,2,totalDamage,0,0,0,0,0,0,0,1); + break; + case 3: + sq_SetMyShake(obj,2,80); + break; + } + break; + } +} + +function onTimeEvent_BroomSpin_bykk(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + switch (timeEventIndex) { + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(13); + obj.sq_AddSetStatePacket(SKILL_BYKK_BROOMSPIN, STATE_PRIORITY_USER, true); + break; + case 1: + obj.resetHitObjectList(); + break; + case 2://移动 + if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_LEFT, ENUM_SUBKEY_TYPE_ALL)){ + if(obj.isMovablePos(obj.getXPos() - 6,obj.getYPos())) sq_setCurrentAxisPos(obj, 0, obj.getXPos() - 6); + if(obj.getDirection() == ENUM_DIRECTION_RIGHT) obj.setDirection(ENUM_DIRECTION_LEFT); + } + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_RIGHT, ENUM_SUBKEY_TYPE_ALL)){ + if(obj.isMovablePos(obj.getXPos() + 6,obj.getYPos())) sq_setCurrentAxisPos(obj, 0, obj.getXPos() + 6); + if(obj.getDirection() == ENUM_DIRECTION_LEFT) obj.setDirection(ENUM_DIRECTION_RIGHT); + } + else{ + local moveX = sq_GetDistancePos(sq_GetXPos(obj),obj.getDirection(),1); + if(obj.isMovablePos(moveX,sq_GetYPos(obj))) sq_setCurrentAxisPos(obj, 0, moveX); + } + if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_UP, ENUM_SUBKEY_TYPE_ALL)){ + if(obj.isMovablePos(obj.getXPos(),obj.getYPos() - 3)) sq_setCurrentAxisPos(obj, 1, obj.getYPos() - 3); + } + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_DOWN, ENUM_SUBKEY_TYPE_ALL)){ + if(obj.isMovablePos(obj.getXPos(),obj.getYPos() + 3)) sq_setCurrentAxisPos(obj, 1, obj.getYPos() + 3); + } + break; + case 3: + local moveX = sq_GetDistancePos(sq_GetXPos(obj),obj.getDirection(),2); + if(obj.isMovablePos(moveX,sq_GetYPos(obj))) sq_setCurrentAxisPos(obj, 0, moveX); + break; + case 4://加快 + local inputConut = obj.getRapidInputFrequency(); + inputConut = inputConut.tointeger(); + + local inputMax = 4; + local gapByInputMin = sq_GetIntData(obj,SKILL_BYKK_BROOMSPIN,2); + local gapByInputMax = sq_GetIntData(obj,SKILL_BYKK_BROOMSPIN,1); + + local currentAni = obj.getCurrentAnimation(); + if(inputConut >= inputMax){ + obj.setTimeEvent(4, gapByInputMin, 1,false); + currentAni.setSpeedRate(300.0); + if(obj.getVar("broomspin").getBool(0) == false) obj.getVar("broomspin").setBool(0, true); + } + else{ + obj.setTimeEvent(4, gapByInputMax, 1,false); + currentAni.setSpeedRate(100.0); + } + + obj.resetHitObjectList(); + break; + } +} + +function onEndState_BroomSpin_bykk(obj, new_state) +{ + if(!obj) return; + if(new_state != SKILL_BYKK_BROOMSPIN){ + local appendage = obj.getVar("BroomSpinAp").getAppendage(0); + if(appendage) appendage.setValid(false); + } +} + + + + + +function checkExecutableSkill_Electricrabbit_bykk(obj) +{ + if (!obj) return false; + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_ELECTRICRABBIT); + if(b_useskill){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_ELECTRICRABBIT, STATE_PRIORITY_USER, true); + return 1; + } + return 0; +} + +function onSetState_Electricrabbit_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0://set + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_FLUORECOLLIDERCAST); + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_ELECTRICRABBIT); + local castTime = sq_GetCastTime(obj, SKILL_BYKK_ELECTRICRABBIT, skill_level); + local currentAni = obj.getCurrentAnimation(); + local castAniTime = currentAni.getDelaySum(false); + local speedRate = castAniTime.tofloat() / castTime.tofloat(); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, speedRate, speedRate); + sq_StartDrawCastGauge(obj, castAniTime, true); + obj.sq_PlaySound("WZ_ELETRIC_RABBIT_CAST"); + obj.getVar("electricrabbit").clear_obj_vector(); + break; + case 1://start + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_ELECRABBITSTART); + local successType = getSuccessType_bykk(obj,SKILL_BYKK_ELECTRICRABBIT); + print("successType = "+successType); + obj.getVar("electricrabbit").clear_vector(); + obj.getVar("electricrabbit").push_vector(successType); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ELECTRICRABBIT, SKILL_BYKK_ELECTRICRABBIT, 0, 1.0) + 100; + local totalDamage2 = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ELECTRICRABBIT, SKILL_BYKK_ELECTRICRABBIT, 7, 1.0) + 100; + if(successType == 1){totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ELECTRICRABBIT, SKILL_BYKK_ELECTRICRABBIT, 1, 1.0) + 100;totalDamage2 = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ELECTRICRABBIT, SKILL_BYKK_ELECTRICRABBIT, 8, 1.0) + 100;} + if(successType >= 2){totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ELECTRICRABBIT, SKILL_BYKK_ELECTRICRABBIT, 2, 1.0) + 100;totalDamage2 = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ELECTRICRABBIT, SKILL_BYKK_ELECTRICRABBIT, 9, 1.0) + 100;} + local damageRate = (totalDamage2.tofloat() / totalDamage.tofloat() * 100.0).tointeger(); + local skill_level = sq_GetSkillLevel(obj,SKILL_BYKK_ELECTRICRABBIT); + local prob = sq_GetLevelData(obj,SKILL_BYKK_ELECTRICRABBIT, 3, skill_level); + local damage = sq_GetLevelData(obj,SKILL_BYKK_ELECTRICRABBIT, 4, skill_level); + local time = sq_GetLevelData(obj,SKILL_BYKK_ELECTRICRABBIT, 6, skill_level); + local level = sq_GetSkillLevel(obj,174) + 20; + if(sq_GetIntData(obj, SKILL_BYKK_ELECTRICRABBIT, 12) > 0){ + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,115,0,0,obj.getDirection(),SKILL_BYKK_ELECTRICRABBIT,4,successType,totalDamage,prob,time,damage,level,damageRate,0,2); + obj.setTimeEvent(1,100,1,false); + } + else cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,115,0,0,obj.getDirection(),SKILL_BYKK_ELECTRICRABBIT,1,successType,totalDamage,prob,time,damage,level,damageRate,0,2); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,115,0,0,obj.getDirection(),SKILL_BYKK_ELECTRICRABBIT,2,successType,0,0,0,0,0,0,0,0); + obj.sq_PlaySound("R_WZ_ELETRIC_RABBIT"); + + local skllevel2 = sq_GetSkillLevel(obj, SKILL_BYKK_SUCCESSPREMONITION); + local nextskillprob = sq_GetLevelData(obj,SKILL_BYKK_SUCCESSPREMONITION, 0, skllevel2); + if(skllevel2 > 0){ + if(sq_getRandom(0,99) > (1000 - nextskillprob) / 10){ + obj.getVar("successpremonition").setBool(0,true); + } + } + break; + case 2://loop + local successType = obj.getVar("electricrabbit").get_vector(0); + switch(successType){ + case 0: + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_ELECRABBITLOOPFAIL); + break; + case 1: + case 2: + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_ELECRABBITLOOP); + break; + } + break; + case 3://end + local successType = obj.getVar("electricrabbit").get_vector(0); + switch(successType){ + case 0: + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_ELECRABBITENDFAIL); + break; + case 1: + case 2: + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_ELECRABBITEND); + break; + } + local sub = obj.sq_GetVectorData(datas, 1); + if(sub > 0){ + local size = obj.getVar("electricrabbit").get_obj_vector_size(); + if(size > 0){ + for(local i = 0; i < size; i++){ + local colObj = sq_GetCNRDObjectToCollisionObject(obj.getVar("electricrabbit").get_obj_vector(i)); + if(colObj) colObj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + } + } + } + break; + } +} + +function onEndCurrentAni_Electricrabbit_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + case 1: + case 2: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(substate + 1); + obj.sq_AddSetStatePacket(SKILL_BYKK_ELECTRICRABBIT, STATE_PRIORITY_USER, true); + break; + case 3: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_Electricrabbit_bykk(obj) +{ + if(!obj) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 2: + if(sq_GetSkillLevel(obj, SKILL_BYKK_EMERGENCYESCAPE) > 0){ + sq_SetKeyxEnable(obj, E_JUMP_COMMAND, true); + if(sq_IsEnterCommand(obj, E_JUMP_COMMAND)){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(3); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_ELECTRICRABBIT, STATE_PRIORITY_USER, true); + return; + } + } + break; + } +} + +function onKeyFrameFlag_Electricrabbit_bykk(obj, flagIndex) +{ + if(!obj) return false; +} + +function onTimeEvent_Electricrabbit_bykk(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + switch(timeEventIndex){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(3); + obj.sq_AddSetStatePacket(SKILL_BYKK_ELECTRICRABBIT, STATE_PRIORITY_USER, true); + break; + case 1: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onEndState_Electricrabbit_bykk(obj, new_state) +{ + if(!obj) return; + if(new_state != SKILL_BYKK_ELECTRICRABBIT){ + sq_EndDrawCastGauge(obj); + } +} + +function onCreateObject_Electricrabbit_bykk(obj, createObject) +{ + if(createObject.isObjectType(OBJECTTYPE_PASSIVE)){ + local colObj = sq_GetCNRDObjectToCollisionObject(createObject); + if(colObj.getCollisionObjectIndex() == PASSIVEOBJECT_BYKK_WITCH){ + obj.getVar("electricrabbit").push_obj_vector(colObj); + } + } +} + +function checkExecutableSkill_Emergencyescape_bykk(obj) +{ + if (!obj) return false; + return 0; +} + +function onSetState_Emergencyescape_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; +} + +function onEndCurrentAni_Emergencyescape_bykk(obj) +{ + if(!obj) return; +} + +function onProcCon_Emergencyescape_bykk(obj) +{ + if(!obj) return; +} + +function onKeyFrameFlag_Emergencyescape_bykk(obj, flagIndex) +{ + if(!obj) return false; +} + +function onTimeEvent_Emergencyescape_bykk(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; +} + +function onEndState_Emergencyescape_bykk(obj, new_state) +{ + if(!obj) return; +} + +function checkExecutableSkill_EnhancedMagicMissile_bykk(obj) +{ + //print("EnhancedMagicMissile > true"); + local state = obj.getState(); + if(!sq_GetSkill(obj, SKILL_BYKK_ENHANCEDMAGICMISSILE).isInCoolTime()){ + obj.sq_IntVectClear(); + if(state == 6) obj.sq_IntVectPush(12); + else if(state == 0 || state == 8 || state == 14) obj.sq_IntVectPush(10); + obj.sq_AddSetStatePacket(SKILL_BYKK_BLACKMANTLE, STATE_PRIORITY_IGNORE_FORCE, true); + return 1; + } + return 0; +} + +function onSetState_EnhancedMagicMissile_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + // + local Ani = obj.sq_GetThrowChargeAni(2); + obj.setCurrentAnimation(Ani); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + break; + case 1: + // obj.sq_PlaySound("WZ_ACID_CLOUD"); + local Ani = obj.sq_GetThrowShootAni(2); + obj.setCurrentAnimation(Ani); + // local ani = obj.getCurrentAnimation(); + // local delay = ani.getDelaySum(0,4); + // obj.setTimeEvent(0,240,1,false); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + break; + } +} + +function onEndCurrentAni_EnhancedMagicMissile_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_ENHANCEDMAGICMISSILE, STATE_PRIORITY_USER, true); + break; + case 1: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_EnhancedMagicMissile_bykk(obj) +{ + if(!obj) return; +} + +function onKeyFrameFlag_EnhancedMagicMissile_bykk(obj, flagIndex) +{ + if(!obj) return false; +} + +function onTimeEvent_EnhancedMagicMissile_bykk(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; +} + +function onEndState_EnhancedMagicMissile_bykk(obj, new_state) +{ + if(!obj) return; +} + +function checkExecutableSkill_FluoreCollider_bykk(obj) +{ + //print("FluoreCollider > true"); + return 0; +} + +function onSetState_FluoreCollider_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0://释放读条 + obj.sq_SetCurrentAnimation(43); + sq_SetCustomDamageType(obj, true, 1); + break; + case 1://老形态-出现 + obj.sq_SetCurrentAnimation(44); + local animation = obj.getCurrentAnimation(); + local friendlyfa_level = sq_GetSkillLevel(obj, SKILL_BYKK_FRIENDLYFAMILIAR); + local setDelay = 910; + if(friendlyfa_level > 0){ + local speedRate = (1000 - sq_GetLevelData(obj, SKILL_BYKK_FRIENDLYFAMILIAR, 8, friendlyfa_level)); + setDelay = (setDelay.tofloat() * speedRate.tofloat() / 1000.0).tointeger(); + } + sq_SetFrameDelayTime(animation, 0, setDelay); + local successType = getSuccessType_bykk(obj,SKILL_BYKK_FLUORECOLLIDER); + if(successType == 2 && sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM) > 0 && sq_getRandom(0,99) >= (100 - sq_GetIntData(obj, SKILL_BYKK_LAPISPHILOSOPHORUM, 21))) successType = 3; + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_FLUORECOLLIDER, SKILL_BYKK_FLUORECOLLIDER, 2, 1.0) + 100; + if(successType == 1) totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_FLUORECOLLIDER, SKILL_BYKK_FLUORECOLLIDER, 3, 1.0) + 100; + if(successType >= 2) totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_FLUORECOLLIDER, SKILL_BYKK_FLUORECOLLIDER, 4, 1.0) + 100; + local totalDamage2 = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_FLUORECOLLIDER, SKILL_BYKK_FLUORECOLLIDER, 5, 1.0) + 100; + local damageRate = (totalDamage2.tofloat() / totalDamage.tofloat() * 100.0).tointeger(); + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_FLUORECOLLIDER); + local lifeTime = sq_GetLevelData(obj,SKILL_BYKK_FLUORECOLLIDER, 0, skill_level); + local hitTime = sq_GetIntData(obj, SKILL_BYKK_FLUORECOLLIDER, 6); + local range = sq_GetIntData(obj, SKILL_BYKK_FLUORECOLLIDER, 13); + local homunculus_level = sq_GetSkillLevel(obj, SKILL_BYKK_HOMUNCULUS); + if(homunculus_level > 0){ + local add_Rate = sq_GetIntData(obj, SKILL_BYKK_HOMUNCULUS, 4); + lifeTime = (lifeTime.tofloat() * (1000.0 + add_Rate.tofloat()) / 1000.0).tointeger(); + } + if(successType == 3 && sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM) > 0){ + local decr_Rate = sq_GetLevelData(obj,SKILL_BYKK_LAPISPHILOSOPHORUM, 9, sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM)); + hitTime = hitTime * (1000 - decr_Rate) / 1000; + } + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,70,-1,0,obj.getDirection(),SKILL_BYKK_FLUORECOLLIDER,1,0,lifeTime,successType,hitTime,totalDamage,damageRate,range,0,5); + break; + case 2://老形态-成功运行 + obj.sq_SetCurrentAnimation(45); + sq_setCurrentAxisPos(obj, 2, 30); + obj.sq_ZStop(); + obj.setTimeEvent(2,400,1,false); + break; + case 3://老形态-失败运行 + obj.sq_SetCurrentAnimation(46); + sq_setCurrentAxisPos(obj, 2, 30); + obj.sq_ZStop(); + break; + case 4://老形态-运行结束 + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_BROOMSPINNEWC_BODY); + local passiveObj = obj.getVar("fluorecollider").get_obj_vector(0); + if(passiveObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(passiveObj); + colObj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + } + break; + case 5://新形态 + // obj.sq_SetCurrentAnimation(ANIMATION_BYKK_LAVAPOTIONAIR_BODY); + local Ani = obj.sq_GetThrowShootAni(2); + obj.setCurrentAnimation(Ani); + obj.setTimeEvent(1,100,1,false); + break; + } + + if(substate != 0 && substate != 1 && substate != 4){ + local skllevel2 = sq_GetSkillLevel(obj, SKILL_BYKK_SUCCESSPREMONITION); + local nextskillprob = sq_GetLevelData(obj,SKILL_BYKK_SUCCESSPREMONITION, 0, skllevel2); + if(skllevel2 > 0){ + if(sq_getRandom(0,99) > (1000 - nextskillprob) / 10){ + obj.getVar("successpremonition").setBool(0,true); + } + } + } +} + +function onEndCurrentAni_FluoreCollider_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + local homunculus_level = sq_GetSkillLevel(obj, SKILL_BYKK_HOMUNCULUS), homunculus = sq_GetSkill(obj, SKILL_BYKK_HOMUNCULUS); + if(homunculus_level > 0 && !homunculus.isSealFunction()){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(5); + obj.sq_AddSetStatePacket(SKILL_BYKK_FLUORECOLLIDER, STATE_PRIORITY_USER, true); + } + else{ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_FLUORECOLLIDER, STATE_PRIORITY_USER, true); + } + break; + case 1: + sq_SetCustomDamageType(obj, true, 0); + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_FLUORECOLLIDER); + local lifeTime = sq_GetLevelData(obj,SKILL_BYKK_FLUORECOLLIDER, 0, skill_level); + obj.setTimeEvent(0,lifeTime,1,false); + local successType = getSuccessType_bykk(obj,SKILL_BYKK_FLUORECOLLIDER); + if(successType >= 1){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_IntVectPush(successType); + obj.sq_AddSetStatePacket(SKILL_BYKK_FLUORECOLLIDER, STATE_PRIORITY_USER, true); + } + else{ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(3); + obj.sq_AddSetStatePacket(SKILL_BYKK_FLUORECOLLIDER, STATE_PRIORITY_USER, true); + } + break; + case 4: + case 5: + sq_SetCustomDamageType(obj, true, 0); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_FluoreCollider_bykk(obj) +{ + if(!obj) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 2: + case 3: + sq_SetKeyxEnable(obj, E_ATTACK_COMMAND, true); + if(sq_IsEnterCommand(obj, E_ATTACK_COMMAND)) obj.addRapidInput(); + + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_HOMUNCULUS); + if(skill_level > 0){ + if(sq_IsKeyDown(OPTION_HOTKEY_JUMP, ENUM_SUBKEY_TYPE_ALL)){ + local passiveObj = obj.getVar("fluorecollider").get_obj_vector(0); + if(passiveObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(passiveObj); + colObj.getVar("custom").set_vector(2,1); + colObj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + } + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_IntVectPush(1); + obj.sq_IntVectPush(3); + obj.sq_AddSetStatePacket(STATE_JUMP, STATE_PRIORITY_IGNORE_FORCE, true); + } + } + else{ + if(sq_IsKeyDown(OPTION_HOTKEY_JUMP, ENUM_SUBKEY_TYPE_ALL)){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(4); + obj.sq_AddSetStatePacket(SKILL_BYKK_FLUORECOLLIDER, STATE_PRIORITY_IGNORE_FORCE, true); + } + } + break; + } +} + +function onKeyFrameFlag_FluoreCollider_bykk(obj, flagIndex) +{ + if(!obj) return false; +} + +function onTimeEvent_FluoreCollider_bykk(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + if(timeEventIndex == 0){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(4); + obj.sq_AddSetStatePacket(SKILL_BYKK_FLUORECOLLIDER, STATE_PRIORITY_USER, true); + } + else if(timeEventIndex == 1){ + local successType = getSuccessType_bykk(obj,SKILL_BYKK_FLUORECOLLIDER); + if(successType == 2 && sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM) > 0 && sq_getRandom(0,99) >= (100 - sq_GetIntData(obj, SKILL_BYKK_LAPISPHILOSOPHORUM, 21))) successType = 3; + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_FLUORECOLLIDER, SKILL_BYKK_FLUORECOLLIDER, 2, 1.0) + 100; + if(successType == 1) totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_FLUORECOLLIDER, SKILL_BYKK_FLUORECOLLIDER, 3, 1.0) + 100; + if(successType >= 2) totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_FLUORECOLLIDER, SKILL_BYKK_FLUORECOLLIDER, 4, 1.0) + 100; + local totalDamage2 = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_FLUORECOLLIDER, SKILL_BYKK_FLUORECOLLIDER, 5, 1.0) + 100; + local damageRate = (totalDamage2.tofloat() / totalDamage.tofloat() * 100.0).tointeger(); + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_FLUORECOLLIDER); + local lifeTime = sq_GetLevelData(obj,SKILL_BYKK_FLUORECOLLIDER, 0, skill_level); + local hitTime = sq_GetIntData(obj, SKILL_BYKK_FLUORECOLLIDER, 6) / 2; + local range = sq_GetIntData(obj, SKILL_BYKK_FLUORECOLLIDER, 13); + local homunculus_level = sq_GetSkillLevel(obj, SKILL_BYKK_HOMUNCULUS); + if(homunculus_level > 0){ + local decr_Rate = sq_GetIntData(obj, SKILL_BYKK_HOMUNCULUS, 3); + lifeTime = (lifeTime.tofloat() * (1000.0 - decr_Rate.tofloat()) / 1000.0).tointeger(); + } + if(successType == 3 && sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM) > 0){ + local decr_Rate = sq_GetLevelData(obj,SKILL_BYKK_LAPISPHILOSOPHORUM, 9, sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM)); + hitTime = hitTime * (1000 - decr_Rate) / 1000; + } + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,70,-1,0,obj.getDirection(),SKILL_BYKK_FLUORECOLLIDER,1,1,lifeTime,successType,hitTime,totalDamage,damageRate,range,0,5); + } + else if(timeEventIndex == 2){ + local inputConut = obj.getRapidInputFrequency(); + inputConut = inputConut.tointeger(); + + local inputMax = 4; + local gapByInputMin = sq_GetIntData(obj,SKILL_BYKK_FLUORECOLLIDER,6) / 2; + local gapByInputMax = sq_GetIntData(obj,SKILL_BYKK_FLUORECOLLIDER,6); + + local currentAni = obj.getCurrentAnimation(); + if(inputConut >= inputMax){ + obj.setTimeEvent(2, gapByInputMin, 1,false); + currentAni.setSpeedRate(200.0); + local passiveObj = obj.getVar("fluorecollider").get_obj_vector(0); + if(passiveObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(passiveObj); + local pAni = colObj.getCurrentAnimation(); + pAni.setSpeedRate(200.0); + colObj.stopTimeEvent(2); + colObj.setTimeEvent(2,gapByInputMin,1,false); + } + } + else{ + obj.setTimeEvent(2, gapByInputMax, 1,false); + currentAni.setSpeedRate(100.0); + local passiveObj = obj.getVar("fluorecollider").get_obj_vector(0); + if(passiveObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(passiveObj); + local pAni = colObj.getCurrentAnimation(); + pAni.setSpeedRate(100.0); + colObj.stopTimeEvent(2); + colObj.setTimeEvent(2,gapByInputMax,1,false); + } + } + } +} + +function onEndState_FluoreCollider_bykk(obj, new_state) +{ + if(!obj) return; +} + +function checkExecutableSkill_FusionCraft_bykk(obj) +{ + print("FusionCraft > true"); + return 0; +} + +function onSetState_FusionCraft_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; +} + +function onEndCurrentAni_FusionCraft_bykk(obj) +{ + if(!obj) return; +} + +function onProcCon_FusionCraft_bykk(obj) +{ + if(!obj) return; +} + +function onKeyFrameFlag_FusionCraft_bykk(obj, flagIndex) +{ + if(!obj) return false; +} + +function onTimeEvent_FusionCraft_bykk(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; +} + +function onEndState_FusionCraft_bykk(obj, new_state) +{ + if(!obj) return; +} + +function checkExecutableSkill_HeatingFurnace_bykk(obj) +{ + // print("HeatingFurnace > true"); + return 0; +} + +function onSetState_HeatingFurnace_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0://cast + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_HEATINGFURNACECAST); + local successType = getSuccessType_bykk(obj,SKILL_BYKK_HEATINGFURNACE); + if(successType == 2 && sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM) > 0 && sq_getRandom(0,99) >= (100 - sq_GetIntData(obj, SKILL_BYKK_LAPISPHILOSOPHORUM, 21))) successType = 3; + if(successType == 0 && sq_GetSkillLevel(obj,SKILL_BYKK_BITTERSCANDYBAR) > 0){ + obj.setTimeEvent(3,100,1,false); + break; + } + switch(successType){ + case 1: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/heatingfurnace/success_d.ani",50,1,-20); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/heatingfurnace/success_n.ani",50,1,-20); + break; + case 2: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/heatingfurnace/great_d.ani",50,1,-30); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/heatingfurnace/great_n.ani",50,1,-30); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/heatingfurnace/great_n+.ani",50,1,-30); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/heatingfurnace/great1.ani",50,1,-30); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/heatingfurnace/great2.ani",50,1,-30); + break; + case 3: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/heatingfurnace/bigsuccess_familier01.ani",100,1,50); + break; + } + + obj.getVar("heatingfurnace").clear_vector(); + obj.getVar("heatingfurnace").push_vector(successType); + obj.getVar("heatingfurnace").push_vector(0); + local stone_Max = sq_GetIntData(obj,SKILL_BYKK_HEATINGFURNACE,6); + obj.getVar("heatingfurnace").push_vector(stone_Max); + + obj.setTimeEvent(0,200,1,false); + sq_SetCustomDamageType(obj, true, 1); + break; + case 1://loop + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_HEATINGFURNACEJUMP); + local skill_level = sq_GetSkillLevel(obj,SKILL_BYKK_HEATINGFURNACE); + local lifeTime = sq_GetLevelData(obj,SKILL_BYKK_HEATINGFURNACE, 0, skill_level); + obj.setTimeEvent(1,lifeTime,1,false); + obj.setTimeEvent(2,150,1,false); + break; + case 2://end + obj.removeAllTimeEvent(); + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_HEATINGFURNACENEWBODY); + local passiveObj = obj.getVar("heatingfurnace").get_obj_vector(0); + if(passiveObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(passiveObj); + colObj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + } + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_HEATINGFURNACE, SKILL_BYKK_HEATINGFURNACE, 1, 1.0); + local successType = obj.getVar("heatingfurnace").get_vector(0); + local sizeRate = sq_GetIntData(obj,SKILL_BYKK_HEATINGFURNACE,12); + if(successType >= 2){sizeRate = sq_GetIntData(obj,SKILL_BYKK_HEATINGFURNACE,13);totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_HEATINGFURNACE, SKILL_BYKK_HEATINGFURNACE, 5, 1.0);} + // if(sq_GetLevelData(obj, SKILL_BYKK_HEATINGFURNACE, 6, sq_GetSkillLevel(obj, SKILL_BYKK_HEATINGFURNACE)) > 0) cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,100,0,0,obj.getDirection(),SKILL_BYKK_HEATINGFURNACE,6,totalDamage,0,0,0,0,0,0,0,1); + // else + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,100,0,50,obj.getDirection(),SKILL_BYKK_HEATINGFURNACE,4,totalDamage,successType,sizeRate,0,0,0,0,0,1); + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/witch_skill_bykk/ap/ap_heatingfurnace.nut"); + break; + case 10: + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_HEATINGFURNACECAST); + break; + case 50: + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_HEATINGFURNACECAST); + local bitterscandy_level = sq_GetSkillLevel(obj,SKILL_BYKK_BITTERSCANDYBAR); + local add_Rate = sq_GetLevelData(obj,SKILL_BYKK_BITTERSCANDYBAR,1,bitterscandy_level); + add_Rate = (1000.0 + add_Rate.tofloat()) / 1000.0; + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_HEATINGFURNACE, SKILL_BYKK_HEATINGFURNACE, 4, 1.0) + 100; + totalDamage = (totalDamage.tofloat() * add_Rate).tointeger(); + local skill_level2 = sq_GetSkillLevel(obj,SKILL_BYKK_HOMUNCULUS); + local add_Rate2 = sq_GetLevelData(obj,SKILL_BYKK_HOMUNCULUS, 0, skill_level2); + if(skill_level2 > 0) totalDamage = (totalDamage.tofloat() * (1000.0 + add_Rate2.tofloat()) / 1000.0).tointeger(); + local add_hitMax = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_HEATINGFURNACE, SKILL_BYKK_HEATINGFURNACE, 7, 1.0) + 100; + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,100,-1,0,obj.getDirection(),SKILL_BYKK_HEATINGFURNACE,2,totalDamage,add_hitMax,0,0,0,0,0,0,1); + obj.setTimeEvent(4,150,1,false); + sq_SetCustomDamageType(obj, true, 1); + break; + case 51: + sq_setCurrentAxisPos(obj, 2, 20); + obj.sq_ZStop(); + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_HEATINGFURNACENEWBODY); + obj.setTimeEvent(5,400,1,false); + break; + } + + if(substate == 1 || substate == 50){ + local skllevel2 = sq_GetSkillLevel(obj, SKILL_BYKK_SUCCESSPREMONITION); + local nextskillprob = sq_GetLevelData(obj,SKILL_BYKK_SUCCESSPREMONITION, 0, skllevel2); + if(skllevel2 > 0){ + if(sq_getRandom(0,99) > (1000 - nextskillprob) / 10){ + obj.getVar("successpremonition").setBool(0,true); + } + } + } +} + +function onEndCurrentAni_HeatingFurnace_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 2: + case 51: + sq_SetCustomDamageType(obj, true, 0); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + case 50: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(51); + obj.sq_AddSetStatePacket(SKILL_BYKK_HEATINGFURNACE , STATE_PRIORITY_USER, true); + break; + } +} + +function onProcCon_HeatingFurnace_bykk(obj) +{ + if(!obj) return; + if(!obj.isMyControlObject()) return; + + local substate = obj.getSkillSubState(); + switch(substate){ + case 10: + local stateTime = obj.sq_GetStateTimer(); + if(stateTime < 50) return; + local maxTime = sq_GetIntData(obj,SKILL_BYKK_BITTERSCANDYBAR,0); + local bDownKey = obj.isDownSkillLastKey(); + if(stateTime >= maxTime){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(50); + obj.sq_AddSetStatePacket(SKILL_BYKK_HEATINGFURNACE , STATE_PRIORITY_USER, true); + return; + } + if(!bDownKey){ + if(stateTime < maxTime){//成功 + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_HEATINGFURNACE , STATE_PRIORITY_USER, true); + return; + } + else{//失败 + obj.sq_IntVectClear(); + obj.sq_IntVectPush(50); + obj.sq_AddSetStatePacket(SKILL_BYKK_HEATINGFURNACE , STATE_PRIORITY_USER, true); + return; + } + } + break; + case 1: + //按C后判断: + //2、是否有引爆试验,有则引爆。 + if(sq_GetSkillLevel(obj, SKILL_BYKK_EMERGENCYESCAPE) > 0){ + sq_SetKeyxEnable(obj, E_JUMP_COMMAND, true); + if(sq_IsEnterCommand(obj, E_JUMP_COMMAND)){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(SKILL_BYKK_HEATINGFURNACE, STATE_PRIORITY_USER, true); + return; + } + } + case 0: + //加快 + sq_SetKeyxEnable(obj, E_ATTACK_COMMAND, true); + if(sq_IsEnterCommand(obj, E_ATTACK_COMMAND)) obj.addRapidInput(); + break; + case 51: + local pAni = obj.getCurrentAnimation();//得到ani + local currentT = sq_GetCurrentTime(pAni);//当前时间 + local fireT = pAni.getDelaySum(false);//总时间 + local srcZ = sq_GetZPos(obj);//初始x坐标 + local v = sq_GetUniformVelocity(srcZ, 0, currentT, fireT); + if(currentT >= 700) sq_setCurrentAxisPos(obj, 2, v); + break; + } +} + +function onKeyFrameFlag_HeatingFurnace_bykk(obj, flagIndex) +{ + if(!obj) return false; +} + +function onTimeEvent_HeatingFurnace_bykk(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + switch(timeEventIndex){ + case 0: + CNSquirrelAppendage.sq_AppendAppendage(obj, obj, SKILL_BYKK_HEATINGFURNACE, false, "character/mage/witch_skill_bykk/ap/ap_heatingfurnace.nut", true); + local castTime = sq_GetIntData(obj,SKILL_BYKK_HEATINGFURNACE,6); + local friendlyfa_level = sq_GetSkillLevel(obj,SKILL_BYKK_FRIENDLYFAMILIAR); + if(friendlyfa_level > 0){ + local speedRate = sq_GetLevelData(obj,SKILL_BYKK_FRIENDLYFAMILIAR, 7, friendlyfa_level); + castTime = castTime * (1000 - speedRate) / 1000; + } + obj.setTimeEvent(6,castTime,1,false); + + local successType = obj.getVar("heatingfurnace").get_vector(0); + local homunculus = 0; + if(sq_GetSkillLevel(obj,SKILL_BYKK_HOMUNCULUS) > 0) homunculus = 1; + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,100,-1,0,obj.getDirection(),SKILL_BYKK_HEATINGFURNACE,1,castTime,successType,homunculus,0,0,0,0,0,0); + break; + case 1: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(SKILL_BYKK_HEATINGFURNACE, STATE_PRIORITY_USER, true); + break; + case 2: + local stone_Max = obj.getVar("heatingfurnace").get_vector(2); + local count = obj.getVar("heatingfurnace").get_vector(1); + if(count < stone_Max){ + local inputConut = obj.getRapidInputFrequency(); + inputConut = inputConut.tointeger(); + + local inputMax = 2; + local gapByInputMin = sq_GetIntData(obj,SKILL_BYKK_HEATINGFURNACE,10); + local gapByInputMax = sq_GetIntData(obj,SKILL_BYKK_HEATINGFURNACE,11); + local successType = obj.getVar("heatingfurnace").get_vector(0); + if(successType == 3){ + local lapi_level = sq_GetSkillLevel(obj,SKILL_BYKK_LAPISPHILOSOPHORUM); + local speedRate = sq_GetLevelData(obj, SKILL_BYKK_LAPISPHILOSOPHORUM, 4, lapi_level); + gapByInputMin = gapByInputMin * (1000 - speedRate) / 1000; + gapByInputMax = gapByInputMax * (1000 - speedRate) / 1000; + } + + if(inputConut >= inputMax){ + obj.setTimeEvent(2, gapByInputMin, 1,false); + local currentAni = obj.getCurrentAnimation(); + currentAni.setSpeedRate(200.0); + local passiveObj = obj.getVar("heatingfurnace").get_obj_vector(0); + if(passiveObj){ + local pAni = passiveObj.getCurrentAnimation(); + pAni.setSpeedRate(200.0); + } + } + else{ + obj.setTimeEvent(2, gapByInputMax, 1,false); + local currentAni = obj.getCurrentAnimation(); + currentAni.setSpeedRate(100.0); + local passiveObj = obj.getVar("heatingfurnace").get_obj_vector(0); + if(passiveObj){ + local pAni = passiveObj.getCurrentAnimation(); + pAni.setSpeedRate(100.0); + } + } + + if(!sq_GetSkill(obj, SKILL_BYKK_HEATINGFURNACE).isSealFunction() || sq_GetIntData(obj, SKILL_BYKK_HEATINGFURNACE, 20) > 0){ + local number_max = sq_GetIntData(obj,SKILL_BYKK_HEATINGFURNACE,3); + if(successType == 1) number_max = sq_GetIntData(obj,SKILL_BYKK_HEATINGFURNACE,4); + if(successType >= 2) number_max = sq_GetIntData(obj,SKILL_BYKK_HEATINGFURNACE,5); + if(successType == 3){ + local lapi_level = sq_GetSkillLevel(obj,SKILL_BYKK_LAPISPHILOSOPHORUM) + number_max = number_max + sq_GetLevelData(obj,SKILL_BYKK_LAPISPHILOSOPHORUM,11,lapi_level); + } + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_HEATINGFURNACE, SKILL_BYKK_HEATINGFURNACE, 2, 0.8) + 100; + local sizeRate = 75; + if(successType == 1){ + totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_HEATINGFURNACE, SKILL_BYKK_HEATINGFURNACE, 2, 1.0) + 100; + sizeRate = sq_GetIntData(obj,SKILL_BYKK_HEATINGFURNACE,12); + } + if(successType >= 2){ + totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_HEATINGFURNACE, SKILL_BYKK_HEATINGFURNACE, 3, 1.0) + 100; + sizeRate = sq_GetIntData(obj,SKILL_BYKK_HEATINGFURNACE,13); + if(successType == 3) sizeRate = sizeRate + sq_GetLevelData(obj, SKILL_BYKK_HEATINGFURNACE, 8, sq_GetSkillLevel(obj, SKILL_BYKK_HEATINGFURNACE)); + } + local speedRate = 100; + if(inputConut >= inputMax) speedRate = 300; + totalDamage = totalDamage * 4; + number_max = number_max / 4; + sizeRate = sizeRate / 3; + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,100,0,0,obj.getDirection(),SKILL_BYKK_HEATINGFURNACE,7,totalDamage,sizeRate,number_max,speedRate,0,0,0,0,1); + return; + } + + count = count + 1; + obj.getVar("heatingfurnace").set_vector(1,count); + + local sub = 0; + if(obj.isMyControlObject()){ + if(obj.getDirection() == ENUM_DIRECTION_LEFT){ + if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_LEFT, ENUM_SUBKEY_TYPE_ALL)){ + if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_UP, ENUM_SUBKEY_TYPE_ALL)) sub = 7; + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_DOWN, ENUM_SUBKEY_TYPE_ALL)) sub = 1; + else sub = 4; + } + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_RIGHT, ENUM_SUBKEY_TYPE_ALL)){ + if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_UP, ENUM_SUBKEY_TYPE_ALL)) sub = 9; + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_DOWN, ENUM_SUBKEY_TYPE_ALL)) sub = 3; + else sub = 6; + } + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_UP, ENUM_SUBKEY_TYPE_ALL)) sub = 8; + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_DOWN, ENUM_SUBKEY_TYPE_ALL)) sub = 2; + } + else if(obj.getDirection() == ENUM_DIRECTION_RIGHT){ + if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_LEFT, ENUM_SUBKEY_TYPE_ALL)){ + if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_UP, ENUM_SUBKEY_TYPE_ALL)) sub = 9; + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_DOWN, ENUM_SUBKEY_TYPE_ALL)) sub = 3; + else sub = 6; + } + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_RIGHT, ENUM_SUBKEY_TYPE_ALL)){ + if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_UP, ENUM_SUBKEY_TYPE_ALL)) sub = 7; + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_DOWN, ENUM_SUBKEY_TYPE_ALL)) sub = 1; + else sub = 4; + } + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_UP, ENUM_SUBKEY_TYPE_ALL)) sub = 8; + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_DOWN, ENUM_SUBKEY_TYPE_ALL)) sub = 2; + } + } + + local number_max = sq_GetIntData(obj,SKILL_BYKK_HEATINGFURNACE,3); + if(successType == 1) number_max = sq_GetIntData(obj,SKILL_BYKK_HEATINGFURNACE,4); + if(successType >= 2) number_max = sq_GetIntData(obj,SKILL_BYKK_HEATINGFURNACE,5); + if(successType == 3){ + local lapi_level = sq_GetSkillLevel(obj,SKILL_BYKK_LAPISPHILOSOPHORUM) + number_max = number_max + sq_GetLevelData(obj,SKILL_BYKK_LAPISPHILOSOPHORUM,11,lapi_level); + } + local baseangle = sq_getRandom(1,8) * 10; + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_HEATINGFURNACE, SKILL_BYKK_HEATINGFURNACE, 2, 0.8) + 100; + local totalDamage2 = 0; + local damageRate = 100; + local sizeRate = 100; + if(successType == 1){ + totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_HEATINGFURNACE, SKILL_BYKK_HEATINGFURNACE, 2, 1.0) + 100; + sizeRate = sq_GetIntData(obj,SKILL_BYKK_HEATINGFURNACE,12); + } + if(successType >= 2){ + totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_HEATINGFURNACE, SKILL_BYKK_HEATINGFURNACE, 3, 1.0) + 100; + sizeRate = sq_GetIntData(obj,SKILL_BYKK_HEATINGFURNACE,13); + if(successType == 3) sizeRate = sizeRate + sq_GetLevelData(obj, SKILL_BYKK_HEATINGFURNACE, 8, sq_GetSkillLevel(obj, SKILL_BYKK_HEATINGFURNACE)); + } + // print(sizeRate); + // if(number_max % 4 == 0){number_max = number_max / 4; totalDamage = totalDamage * 4;} + // else if(number_max % 3 == 0){number_max = number_max / 3; totalDamage = totalDamage * 3;} + // else + if(number_max % 2 == 0){number_max = number_max / 2; totalDamage = totalDamage * 2;sizeRate = sizeRate * 120 / 100;} + for(local i = 0; i < number_max; i++){ + local angle = 360 / number_max * i + baseangle; + local x = (sq_Cos(sq_ToRadian(angle.tofloat())) * 20.0).tointeger() + sq_getRandom(-5,5); + local y = (sq_Sin(sq_ToRadian(angle.tofloat())) * 20.0).tointeger(); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,100 + x,y,120,obj.getDirection(),SKILL_BYKK_HEATINGFURNACE,3,totalDamage,successType,i,number_max,sub,damageRate,sizeRate,0,1); + } + } + else{ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(SKILL_BYKK_HEATINGFURNACE, STATE_PRIORITY_USER, true); + } + break; + case 3: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(50); + obj.sq_AddSetStatePacket(SKILL_BYKK_HEATINGFURNACE, STATE_PRIORITY_USER, true); + break; + case 4: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(51); + obj.sq_AddSetStatePacket(SKILL_BYKK_HEATINGFURNACE, STATE_PRIORITY_USER, true); + break; + case 5: + if(!sq_GetSkill(obj, SKILL_BYKK_HEATINGFURNACE).isSealFunction() || sq_GetIntData(obj, SKILL_BYKK_HEATINGFURNACE, 20) > 0){ + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_HEATINGFURNACE, SKILL_BYKK_HEATINGFURNACE, 4, 0.5); + local bitterscandy_level = sq_GetSkillLevel(obj,SKILL_BYKK_BITTERSCANDYBAR); + local add_Rate = sq_GetLevelData(obj,SKILL_BYKK_BITTERSCANDYBAR,1,bitterscandy_level); + add_Rate = (1000.0 + add_Rate.tofloat()) / 1000.0; + if(bitterscandy_level > 0) add_Rate = add_Rate * 1.19; + totalDamage = (totalDamage.tofloat() * add_Rate).tointeger(); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,100,0,0,obj.getDirection(),SKILL_BYKK_HEATINGFURNACE,6,totalDamage,0,0,0,0,0,0,0,1); + } + break; + case 6: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_HEATINGFURNACE, STATE_PRIORITY_USER, true); + break; + } +} + +function onEndState_HeatingFurnace_bykk(obj, new_state) +{ + if(!obj) return; + if(new_state != SKILL_BYKK_HEATINGFURNACE){ + local passiveObj = obj.getVar("heatingfurnace").get_obj_vector(0); + if(passiveObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(passiveObj); + colObj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + } + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/witch_skill_bykk/ap/ap_heatingfurnace.nut"); + } +} + + +function checkExecutableSkill_Jackfrosticewater_bykk(obj) +{ + if (!obj) return false; + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_JACKFROSTICEWATER); + if(b_useskill){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_JACKFROSTICEWATER, STATE_PRIORITY_USER, true); + return 1; + } + return 0; +} + +function onSetState_Jackfrosticewater_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_JACKFROSTICEWATERCAST_BODY); + local offset_x = 175; + for(local i = 0; i < 175; i++){ + if(obj.isMovablePos(sq_GetDistancePos(obj.getXPos(), obj.getDirection(), offset_x), sq_GetYPos(obj))) break; + else offset_x = offset_x - 1; + } + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_JACKFROSTICEWATER, SKILL_BYKK_JACKFROSTICEWATER, 2, 1.0) + 100; + local totalDamage2 = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_JACKFROSTICEWATER, SKILL_BYKK_JACKFROSTICEWATER, 3, 1.0) + 100; + local totalDamage3 = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_JACKFROSTICEWATER, SKILL_BYKK_JACKFROSTICEWATER, 4, 1.0) + 100; + local damageRate = (totalDamage2.tofloat() / totalDamage.tofloat() * 100.0).tointeger(); + local damageRate2 = (totalDamage3.tofloat() / totalDamage.tofloat() * 100.0).tointeger(); + local sub = 0; + if(sq_GetIntData(obj, SKILL_BYKK_JACKFROSTICEWATER, 9) > 0) sub = 1; + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,offset_x,-1,0,obj.getDirection(),SKILL_BYKK_JACKFROSTICEWATER,1,totalDamage,damageRate,damageRate2,sub,0,0,0,0,1); + obj.getVar("jackfrosticewater").clear_obj_vector(); + obj.getVar("jackfrosticewater").clear_vector(); + obj.getVar("jackfrosticewater").push_vector(offset_x); + break; + case 1: + sq_setCurrentAxisPos(obj, 2, 200); + obj.sq_ZStop(); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/jackfrosticewater/start/jackfrosticewatercast_smoke.ani",0,0,0); + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_JACKFROSTICEWATERSTARTBACK_BODY); + if(sq_GetIntData(obj, SKILL_BYKK_JACKFROSTICEWATER, 9) > 0){ + local currentAni = obj.getCurrentAnimation(); + currentAni.setSpeedRate(500.0); + } + break; + case 2: + sq_setCurrentAxisPos(obj, 2, 200); + obj.sq_ZStop(); + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_JACKFROSTICEWATERLOOPBACK_BODY); + if(sq_GetIntData(obj, SKILL_BYKK_JACKFROSTICEWATER, 9) > 0){ + obj.setTimeEvent(2,192,1,false); + local currentAni = obj.getCurrentAnimation(); + currentAni.setSpeedRate(500.0); + } + else obj.setTimeEvent(2,960,1,false); + break; + case 3: + obj.stopTimeEvent(2); + sq_setCurrentAxisPos(obj, 2, 200); + obj.sq_ZStop(); + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_JACKFROSTICEWATERLOOPBACKBOUNCE01A_BODY); + local sub = obj.sq_GetVectorData(datas, 1); + if(sub > 0){ + local size = obj.getVar("jackfrosticewater").get_obj_vector_size(); + if(size > 0){ + for(local i = 0; i < size; i++){ + local colObj = sq_GetCNRDObjectToCollisionObject(obj.getVar("jackfrosticewater").get_obj_vector(i)); + if(colObj) colObj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + } + } + } + break; + case 4: + //obj.sq_ZStop(); + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_JACKFROSTICEWATERLOOPBACKBOUNCE02_BODY); + break; + } + + if(substate == 3){ + local skllevel2 = sq_GetSkillLevel(obj, SKILL_BYKK_SUCCESSPREMONITION); + local nextskillprob = sq_GetLevelData(obj,SKILL_BYKK_SUCCESSPREMONITION, 0, skllevel2); + if(skllevel2 > 0){ + if(sq_getRandom(0,99) > (1000 - nextskillprob) / 10){ + obj.getVar("successpremonition").setBool(0,true); + } + } + } +} + +function onEndCurrentAni_Jackfrosticewater_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + if(sq_GetLevelData(obj, SKILL_BYKK_JACKFROSTICEWATER, 5, sq_GetSkillLevel(obj, SKILL_BYKK_JACKFROSTICEWATER)) > 0){ + obj.setTimeEvent(3,300,1,false); + } + else{ + obj.setTimeEvent(0,100,1,true); + obj.setTimeEvent(1,300,1,false); + } + break; + case 1: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(substate + 1); + obj.sq_AddSetStatePacket(SKILL_BYKK_JACKFROSTICEWATER, STATE_PRIORITY_USER, true); + break; + case 4: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_Jackfrosticewater_bykk(obj) +{ + if(!obj) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 1: + case 2: + sq_SetKeyxEnable(obj, E_ATTACK_COMMAND, true); + if(sq_IsEnterCommand(obj, E_ATTACK_COMMAND)) obj.addRapidInput(); + + if(sq_GetSkillLevel(obj, SKILL_BYKK_EMERGENCYESCAPE) > 0){ + sq_SetKeyxEnable(obj, E_JUMP_COMMAND, true); + if(sq_IsEnterCommand(obj, E_JUMP_COMMAND)){ + obj.getVar().clear_vector(); + obj.getVar().push_vector(sq_GetXPos(obj)); + obj.getVar().push_vector(200); + obj.getVar().push_vector(275); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(3); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_JACKFROSTICEWATER, STATE_PRIORITY_USER, true); + return; + } + } + break; + case 3: + local stateTime = obj.sq_GetStateTimer(); + local fireT = 500; + local srcX = obj.getVar().get_vector(0); + local srcZ = obj.getVar().get_vector(1); + local moveX = obj.getVar().get_vector(2); + if(moveX > 0) moveX = -moveX; + local vx = sq_GetAccel(0, moveX, stateTime, fireT, true); + local vz = sq_GetUniformVelocity(srcZ, 0, stateTime, fireT); + local dstX = sq_GetDistancePos(srcX, obj.getDirection(), vx); + if(obj.isMovablePos(dstX, sq_GetYPos(obj))) sq_setCurrentAxisPos(obj, 0, dstX); + else{obj.getVar().set_vector(0,sq_GetXPos(obj));obj.getVar().set_vector(2,0);} + sq_setCurrentAxisPos(obj, 2, vz); + if(sq_GetZPos(obj) <= 15){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(4); + obj.sq_AddSetStatePacket(SKILL_BYKK_JACKFROSTICEWATER, STATE_PRIORITY_USER, true); + } + break; + } +} + +function onKeyFrameFlag_Jackfrosticewater_bykk(obj, flagIndex) +{ + if(!obj) return false; +} + +function onTimeEvent_Jackfrosticewater_bykk(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + switch(timeEventIndex){ + case 0: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/jackfrosticewater/start/jackfrosticewatercast_smoke.ani",0,0,0); + sq_setCurrentAxisPos(obj, 2, 500); + obj.sq_ZStop(); + break; + case 1: + local offset_x = obj.getVar("jackfrosticewater").get_vector(0); + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(obj.getXPos(), obj.getDirection(), offset_x)); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_JACKFROSTICEWATER, STATE_PRIORITY_USER, true); + break; + case 2: + obj.getVar().clear_vector(); + obj.getVar().push_vector(sq_GetXPos(obj)); + obj.getVar().push_vector(200); + obj.getVar().push_vector(275); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(3); + obj.sq_AddSetStatePacket(SKILL_BYKK_JACKFROSTICEWATER, STATE_PRIORITY_USER, true); + break; + case 3: + local size = obj.getVar("jackfrosticewater").get_obj_vector_size(); + if(size > 0){ + for(local i = 0; i < size; i++){ + local colObj = sq_GetCNRDObjectToCollisionObject(obj.getVar("jackfrosticewater").get_obj_vector(i)); + if(colObj) colObj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + } + } + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onEndState_Jackfrosticewater_bykk(obj, new_state) +{ + if(!obj) return; +} + + +function onCreateObject_Jackfrosticewater_bykk(obj, createObject) +{ + if(createObject.isObjectType(OBJECTTYPE_PASSIVE)){ + local colObj = sq_GetCNRDObjectToCollisionObject(createObject); + if(colObj.getCollisionObjectIndex() == PASSIVEOBJECT_BYKK_WITCH){ + obj.getVar("jackfrosticewater").push_obj_vector(colObj); + } + } +} + + + +function checkExecutableSkill_Jackohalloween_bykk(obj) +{ + if (!obj) return false; + local pumpkinObj = obj.getVar("jackohalloween_pumpkin").get_obj_vector(0); + if(pumpkinObj){ + if(pumpkinObj.getState() <= 24){ + local colObj = sq_GetCNRDObjectToCollisionObject(pumpkinObj); + sq_SetCurrentDirection(colObj, sq_GetOppositeDirection(sq_GetDirection(colObj))); + colObj.getVar("move").clear_vector(); + colObj.getVar("move").push_vector(sq_GetXPos(colObj)); + colObj.getVar("move").push_vector(100); + colObj.getVar().setBool(0,true); + colObj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + return 1; + } + else{obj.getVar("jackohalloween_pumpkin").clear_obj_vector();} + } + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_JACKOHALLOWEEN); + if(b_useskill){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_JACKOHALLOWEEN, STATE_PRIORITY_USER, true); + return 1; + } + return 0; +} + +function onSetState_Jackohalloween_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_JACKOHALLOWEENBODY_CAST); + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_JACKOHALLOWEEN); + local castTime = sq_GetCastTime(obj, SKILL_BYKK_JACKOHALLOWEEN, skill_level); + local currentAni = obj.getCurrentAnimation(); + local castAniTime = currentAni.getDelaySum(false); + local speedRate = castAniTime.tofloat() / castTime.tofloat(); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, speedRate, speedRate); + sq_StartDrawCastGauge(obj, castAniTime, true); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/jackohalloween/jackohalloweenready_01.ani",0,0,0); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_JACKOHALLOWEEN, SKILL_BYKK_JACKOHALLOWEEN, 0, 1.0) + 100; + local hitTime = sq_GetIntData(obj,SKILL_BYKK_JACKOHALLOWEEN,5); + local lifeTime = sq_GetIntData(obj,SKILL_BYKK_JACKOHALLOWEEN,6); + local hitMax = sq_GetIntData(obj,SKILL_BYKK_JACKOHALLOWEEN,0); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_JACKOHALLOWEEN,1,castTime,totalDamage,hitTime,lifeTime,hitMax,0,0,0,2); + obj.sq_PlaySound("R_WZ_JACKOHALLOWEEN"); + break; + case 1: + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_JACKOHALLOWEENBODY_SHOOT); + obj.sq_PlaySound("JACKOHALLOWEEN_CRUSH"); + local skllevel2 = sq_GetSkillLevel(obj, SKILL_BYKK_SUCCESSPREMONITION); + local nextskillprob = sq_GetLevelData(obj,SKILL_BYKK_SUCCESSPREMONITION, 0, skllevel2); + if(skllevel2 > 0){ + if(sq_getRandom(0,99) > (1000 - nextskillprob) / 10){ + obj.getVar("successpremonition").setBool(0,true); + } + } + break; + } +} + +function onEndCurrentAni_Jackohalloween_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_JACKOHALLOWEEN, STATE_PRIORITY_USER, true); + break; + case 1: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_Jackohalloween_bykk(obj) +{ + if(!obj) return; +} + +function onKeyFrameFlag_Jackohalloween_bykk(obj, flagIndex) +{ + if(!obj) return false; +} + +function onTimeEvent_Jackohalloween_bykk(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; +} + +function onEndState_Jackohalloween_bykk(obj, new_state) +{ + if(!obj) return; +} + +function onCreateObject_Jackohalloween_bykk(obj, createObject) +{ + // if(createObject.isObjectType(OBJECTTYPE_PASSIVE)){ + // local colObj = sq_GetCNRDObjectToCollisionObject(createObject); + // if(colObj.getCollisionObjectIndex() == PASSIVEOBJECT_BYKK_WITCH){ + // obj.getVar("jackohalloween").push_obj_vector(colObj); + // } + // } +} + + + + +function checkExecutableSkill_LavaPotion_bykk(obj) +{ + // print("LavaPotion > true"); + local state = obj.getState(); + if(state == 6 && !sq_GetSkill(obj, SKILL_BYKK_LAVAPOTION).isInCoolTime()){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(3); + obj.sq_AddSetStatePacket(SKILL_BYKK_LAVAPOTION, STATE_PRIORITY_IGNORE_FORCE, true); + return 1; + } + return 0; +} + +function onSetState_LavaPotion_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + // print("substate = "+substate); + obj.setSkillSubState(substate); + switch(substate){ + case 0://地面施放讀條 + local Ani = obj.sq_GetThrowChargeAni(0); + obj.setCurrentAnimation(Ani); + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_LAVAPOTION); + local castTime = sq_GetCastTime(obj, SKILL_BYKK_LAVAPOTION, skill_level); + sq_StartDrawCastGauge(obj, castTime, true); + local animation = sq_GetCurrentAnimation(obj); + local startTime = sq_GetDelaySum(animation); + local speedRate = startTime.tofloat() / castTime.tofloat(); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED,SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, speedRate, speedRate); + break; + case 1://地面施放完成 + sq_EndDrawCastGauge(obj); + local Ani = obj.sq_GetThrowShootAni(0); + obj.setCurrentAnimation(Ani); + local successType = obj.sq_GetVectorData(datas, 1); + if(successType == 2 && sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM) > 0 && sq_getRandom(0,100) >= (100 - sq_GetIntData(obj, SKILL_BYKK_LAPISPHILOSOPHORUM, 21))) successType = 3; + // print("successType = "+successType); + print(sq_GetIntData(obj, SKILL_BYKK_LAPISPHILOSOPHORUM, 21)); + local sizeRate = sq_GetIntData(obj,SKILL_BYKK_LAVAPOTION,8); + local hitTime = sq_GetIntData(obj,SKILL_BYKK_LAVAPOTION,6); + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_LAVAPOTION); + local lifeTime = sq_GetLevelData(obj,SKILL_BYKK_LAVAPOTION, 0, skill_level); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_LAVAPOTION, SKILL_BYKK_LAVAPOTION, 1, 1.0) + 100; + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,50,0,70,obj.getDirection(),SKILL_BYKK_LAVAPOTION,3,totalDamage,lifeTime,hitTime,sizeRate,successType,0,0,0,1); + break; + case 2://苦糖失敗形態 + sq_EndDrawCastGauge(obj); + local Ani = obj.sq_GetThrowShootAni(0); + obj.setCurrentAnimation(Ani); + local animation = sq_GetCurrentAnimation(obj); + local aniTime = sq_GetDelaySum(animation); + sq_SetBodyEffect(obj, obj, true, sq_RGB(0,0,0), 480, aniTime + 2000, 0, sq_ALPHA(255)); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/lavapotion/lava_potion_throw_d_up.ani",0,0,0); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/witch_bykk/animation/lavapotion/lava_potion_throw_n_down.ani",0,0,0); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_LAVAPOTION, SKILL_BYKK_LAVAPOTION, 2, 1.0) + 100; + local skill_level = sq_GetSkillLevel(obj,SKILL_BYKK_BITTERSCANDYBAR); + local add_Rate = sq_GetLevelData(obj,SKILL_BYKK_BITTERSCANDYBAR, 0, skill_level); + if(skill_level > 0) totalDamage = (totalDamage.tofloat() * (1000.0 + add_Rate.tofloat()) / 1000.0).tointeger(); + local skill_level2 = sq_GetSkillLevel(obj,SKILL_BYKK_HOMUNCULUS); + local add_Rate2 = sq_GetLevelData(obj,SKILL_BYKK_HOMUNCULUS, 0, skill_level2); + if(skill_level2 > 0) totalDamage = (totalDamage.tofloat() * (1000.0 + add_Rate2.tofloat()) / 1000.0).tointeger(); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,150,0,0,obj.getDirection(),SKILL_BYKK_LAVAPOTION,2,totalDamage,0,0,0,0,0,0,0,1); + // cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,150,0,0,obj.getDirection(),SKILL_BYKK_LAVAPOTION,4,0,0,0,0,0,0,0,0,0); + break; + case 3: + obj.sq_ZStop(); + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_LAVAPOTIONAIR_BODY); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/lavapotion/lavapotionair_potion.ani",50,0,0); + break; + case 10: + obj.sq_IsEnterSkillLastKeyUnits(SKILL_BYKK_LAVAPOTION); + local Ani = obj.sq_GetThrowChargeAni(0); + obj.setCurrentAnimation(Ani); + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_LAVAPOTION); + local castTime = sq_GetCastTime(obj, SKILL_BYKK_LAVAPOTION, skill_level); + sq_StartDrawCastGauge(obj, castTime, true); + break; + } + + if(substate != 0 || substate != 10){ + local skllevel2 = sq_GetSkillLevel(obj, SKILL_BYKK_SUCCESSPREMONITION); + local nextskillprob = sq_GetLevelData(obj,SKILL_BYKK_SUCCESSPREMONITION, 0, skllevel2); + if(skllevel2 > 0){ + if(sq_getRandom(0,99) > (1000 - nextskillprob) / 10){ + obj.getVar("successpremonition").setBool(0,true); + } + } + } +} + +function onEndCurrentAni_LavaPotion_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_LAVAPOTION, STATE_PRIORITY_USER, true); + break; + case 1: + case 2: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + case 3: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_IntVectPush(0); + obj.sq_IntVectPush(3); + obj.sq_AddSetStatePacket(STATE_JUMP, STATE_PRIORITY_USER, true); + break; + } +} + +function onProcCon_LavaPotion_bykk(obj) +{ + if(!obj) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 10: + local maxTime = sq_GetIntData(obj,SKILL_BYKK_BITTERSCANDYBAR,0); + local stateTime = obj.sq_GetStateTimer(); + local bDownKey = obj.isDownSkillLastKey(); + local animation = sq_GetCurrentAnimation(obj); + local startTime = sq_GetDelaySum(animation); + if(stateTime >= startTime){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(SKILL_BYKK_LAVAPOTION , STATE_PRIORITY_USER, true); + return; + } + if(!bDownKey){ + if(stateTime < maxTime){//成功 + local successType = getSuccessType_bykk(obj,SKILL_BYKK_LAVAPOTION); + if(successType >= 1){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_IntVectPush(successType); + obj.sq_AddSetStatePacket(SKILL_BYKK_LAVAPOTION , STATE_PRIORITY_USER, true); + return; + } + else{ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(SKILL_BYKK_LAVAPOTION , STATE_PRIORITY_USER, true); + return; + } + } + else{//失败 + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(SKILL_BYKK_LAVAPOTION , STATE_PRIORITY_USER, true); + return; + } + } + break; + } +} + +function onKeyFrameFlag_LavaPotion_bykk(obj, flagIndex) +{ + if(!obj) return false; + local substate = obj.getSkillSubState(); + switch(substate){ + case 3: + if(flagIndex == 1){ + //`Create Potion` 10 0 79 + local successType = getSuccessType_bykk(obj,SKILL_BYKK_LAVAPOTION); + if(successType == 0) successType = 1; + if(successType == 2 && sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM) > 0 && sq_getRandom(0,100) >= (100 - sq_GetIntData(obj, SKILL_BYKK_LAPISPHILOSOPHORUM, 21))) successType = 3; + // print("successType = "+successType); + local sizeRate = sq_GetIntData(obj,SKILL_BYKK_LAVAPOTION,8); + local hitTime = sq_GetIntData(obj,SKILL_BYKK_LAVAPOTION,6); + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_LAVAPOTION); + local lifeTime = sq_GetLevelData(obj,SKILL_BYKK_LAVAPOTION, 0, skill_level); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_LAVAPOTION, SKILL_BYKK_LAVAPOTION, 1, 1.0) + 100; + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,10,0,79,obj.getDirection(),SKILL_BYKK_LAVAPOTION,3,totalDamage,lifeTime,hitTime,sizeRate,successType,0,0,0,1); + } + break; + } +} + +function onTimeEvent_LavaPotion_bykk(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; +} + +function onEndState_LavaPotion_bykk(obj, new_state) +{ + if(!obj) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + case 10: + if(new_state != SKILL_BYKK_LAVAPOTION) sq_EndDrawCastGauge(obj); + break; + } +} + +function checkExecutableSkill_Lollipopcrush_bykk(obj) +{ + if (!obj) return false; + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_LOLLIPOPCRUSH); + if(b_useskill){ + local state = obj.getState(); + if(state == 6){ + obj.sq_IntVectClear(); + if(sq_GetIntData(obj, SKILL_BYKK_LOLLIPOPCRUSH, 16) > 0 && sq_GetZPos(obj) <= 40) obj.sq_IntVectPush(9); + else obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_LOLLIPOPCRUSH, STATE_PRIORITY_USER, true); + } + else{ + obj.sq_IntVectClear(); + if(sq_GetIntData(obj, SKILL_BYKK_LOLLIPOPCRUSH, 16) > 0) obj.sq_IntVectPush(10); + else obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_LOLLIPOPCRUSH, STATE_PRIORITY_USER, true); + } + return 1; + } + return 0; +} + +function onSetState_Lollipopcrush_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_LOLLIPOPCRUSH); + break; + case 1: + obj.sq_ZStop(); + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_LOLLIPOPCRUSHAIRCAST_BODY); + break; + case 9: + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_LOLLIPOPCRUSHTALISMANLANDATTACK_BODY); + break; + case 10: + obj.sq_ZStop(); + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_LOLLIPOPCRUSHTALISMANREADY_BODY); + break; + case 11: + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_LOLLIPOPCRUSHTALISMANATTACK_BODY); + break; + } + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + if(substate != 10){ + obj.getVar("Lollipopcrush_Boss").clear_obj_vector(); + obj.getVar("Lollipopcrush_Named").clear_obj_vector(); + local objectManager = obj.getObjectManager(); + local objectNumber = objectManager.getCollisionObjectNumber(); + for(local i = 0; i < objectNumber; i++){ + local object = objectManager.getCollisionObject(i); + if(object && object.isObjectType(OBJECTTYPE_ACTIVE) && obj.isEnemy(object)){ + local activeObj = sq_GetCNRDObjectToActiveObject(object); + if(sq_IsBoss(activeObj)) obj.getVar("Lollipopcrush_Boss").push_obj_vector(object); + else if(sq_IsNamed(activeObj)) obj.getVar("Lollipopcrush_Named").push_obj_vector(object); + } + } + // print("boss:"+obj.getVar("Lollipopcrush_Boss").get_obj_vector_size()); + // print("named:"+obj.getVar("Lollipopcrush_Named").get_obj_vector_size()); + local candy_max = sq_GetIntData(obj, SKILL_BYKK_LOLLIPOPCRUSH, 12); + local bosscandy_max = sq_GetIntData(obj, SKILL_BYKK_LOLLIPOPCRUSH, 11); + obj.getVar("candynumber").clear_vector(); + obj.getVar("candynumber").push_vector(0); + obj.getVar("candynumber").push_vector(candy_max); + obj.getVar("candynumber").push_vector(0); + obj.getVar("candynumber").push_vector(bosscandy_max); + local skllevel2 = sq_GetSkillLevel(obj, SKILL_BYKK_SUCCESSPREMONITION); + local nextskillprob = sq_GetLevelData(obj,SKILL_BYKK_SUCCESSPREMONITION, 0, skllevel2); + if(skllevel2 > 0){ + if(sq_getRandom(0,99) > (1000 - nextskillprob) / 10){ + obj.getVar("successpremonition").setBool(0,true); + } + } + } +} + +function onEndCurrentAni_Lollipopcrush_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + case 1: + case 9: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_IntVectPush(0); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(STATE_JUMP, STATE_PRIORITY_USER, true); + break; + case 10: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(11); + obj.sq_AddSetStatePacket(SKILL_BYKK_LOLLIPOPCRUSH, STATE_PRIORITY_USER, true); + break; + case 11: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_Lollipopcrush_bykk(obj) +{ + if(!obj) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + local pAni = obj.getCurrentAnimation();//得到ani + local currentT = sq_GetCurrentTime(pAni);//当前时间 + local fireT = pAni.getDelaySum(0, 5);//总时间 + local vz = sq_GetUniformVelocity(0, 20, currentT, fireT); + sq_setCurrentAxisPos(obj, 2, vz);//设置当前z坐标 + break; + } +} + +function onKeyFrameFlag_Lollipopcrush_bykk(obj, flagIndex) +{ + if(!obj) return false; + local substate = obj.getSkillSubState(); + switch(flagIndex){ + case 1: + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_LOLLIPOPCRUSH, SKILL_BYKK_LOLLIPOPCRUSH, 0, 1.0) + 100; + local totalDamage2 = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_LOLLIPOPCRUSH, SKILL_BYKK_LOLLIPOPCRUSH, 3, 1.0) + 100; + local totalDamage3 = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_LOLLIPOPCRUSH, SKILL_BYKK_LOLLIPOPCRUSH, 13, 1.0) + 100; + local damageRate = (totalDamage2.tofloat() / totalDamage.tofloat() * 100.0).tointeger(); + local damageRate2 = (totalDamage3.tofloat() / totalDamage.tofloat() * 100.0).tointeger(); + local extra_num = sq_GetIntData(obj,SKILL_BYKK_LOLLIPOPCRUSH,8); + local currentAni = obj.getCurrentAnimation(),delayTime = 0; + switch(substate){ + case 0: + delayTime = currentAni.getDelaySum(16,16);//120 + sq_SetMyShake(obj,5,700); + break; + case 1: + delayTime = currentAni.getDelaySum(12,12);//60 + break; + case 9: + delayTime = currentAni.getDelaySum(1,1);//120 + sq_SetMyShake(obj,5,700); + local offset_x = 175; + if(obj.getDirection() == ENUM_DIRECTION_LEFT) offset_x = -175; + sq_CreateParticle("passiveobject/witch_bykk/particle/lollipopcrushcandy.ptl", obj, offset_x, 0, 10, true, 1, 0, 7); + sq_CreateParticle("passiveobject/witch_bykk/particle/lollipopcrushcandy2.ptl", obj, offset_x, 0, 10, true, 1, 0, 7); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/lollipopcrush/lollipopcrushfloor_floor.ani",175,0,0); + create_lollipopcandy_bykk(obj); + break; + case 10: + delayTime = currentAni.getDelaySum(12,12);//50 + break; + case 11: + delayTime = currentAni.getDelaySum(1,1);//120 + sq_SetMyShake(obj,5,700); + local speedRate = 12000.0 / delayTime.tofloat(); + local aniPath1 = "character/mage/effect/animation/witch_bykk/lollipopcrush/talisman/lollipopcrush_"; + local aniPath2 = ["candy_back_attack.ani","candy_body_attack.ani","c_hit_attack.ani","c_line_attack.ani","c_boom_attack.ani","c_hit2_attack.ani"]; + for(local i = 0; i < aniPath2.len(); i++){ + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,aniPath1 + aniPath2[i],0,(i+1),0); + local pAni = pooledObj.getCurrentAnimation(); + pAni.setSpeedRate(speedRate); + } + break; + } + local sizeRate = 100 + obj.sq_GetBonusRateWithPassive(SKILL_BYKK_LOLLIPOPCRUSH, -1, 15, 1.0) + 100; + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_LOLLIPOPCRUSH,substate,delayTime,totalDamage,extra_num,damageRate,damageRate2,sizeRate,0,0,2); + + break; + case 2: + switch(substate){ + case 0: + sq_flashScreen(obj, 20, 80, 10, 204, sq_RGB(255, 255, 255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + break; + case 1: + sq_SetMyShake(obj,1,60); + break; + case 10: + sq_flashScreen(obj, 20, 80, 10, 204, sq_RGB(255, 255, 255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + break; + case 11: + local offset_x = 175; + if(obj.getDirection() == ENUM_DIRECTION_LEFT) offset_x = -175; + sq_CreateParticle("passiveobject/witch_bykk/particle/lollipopcrushcandy.ptl", obj, offset_x, 0, 10, true, 1, 0, 7); + sq_CreateParticle("passiveobject/witch_bykk/particle/lollipopcrushcandy2.ptl", obj, offset_x, 0, 10, true, 1, 0, 7); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/lollipopcrush/lollipopcrushfloor_floor.ani",175,0,0); + create_lollipopcandy_bykk(obj); + break; + } + break; + case 3: + switch(substate){ + case 0: + local offset_x = 175; + if(obj.getDirection() == ENUM_DIRECTION_LEFT) offset_x = -175; + sq_CreateParticle("passiveobject/witch_bykk/particle/lollipopcrushcandy.ptl", obj, offset_x, 0, 10, true, 1, 0, 7); + sq_CreateParticle("passiveobject/witch_bykk/particle/lollipopcrushcandy2.ptl", obj, offset_x, 0, 10, true, 1, 0, 7); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/lollipopcrush/lollipopcrushfloor_floor.ani",175,0,0); + create_lollipopcandy_bykk(obj); + break; + case 1: + local currentAni = obj.getCurrentAnimation(),delayTime = currentAni.getDelaySum(11,11),speedRate = 6000.0 / delayTime.tofloat(); + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/lollipopcrush/lollipopcrushairattack_04.ani",0,0,0); + local pAni = pooledObj.getCurrentAnimation(); + pAni.setSpeedRate(speedRate); + create_lollipopcandy_bykk(obj); + break; + } + break; + case 4: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/lollipopcrush/lollipopcrushairattack_06.ani",0,0,0); + break; + } +} + +function onTimeEvent_Lollipopcrush_bykk(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + switch(timeEventIndex){ + case 0: + sq_CreateParticle("passiveobject/witch_bykk/particle/lollipopcrushcandy.ptl", obj, -50, 0, 0, true, 10, 0, 7); + sq_CreateParticle("passiveobject/witch_bykk/particle/lollipopcrushcandy2.ptl", obj, -50, 0, 0, true, 10, 0, 7); + break; + } +} + +function onEndState_Lollipopcrush_bykk(obj, new_state) +{ + if(!obj) return; +} + +function create_lollipopcandy_bykk(obj) +{ + local whitecandy_num = obj.getVar("whitecandy_num").get_vector(0); + local blackcandy_num = obj.getVar("blackcandy_num").get_vector(0); + local bosscandy_num = obj.getVar("bosscandy_num").get_vector(0); + // print("whitecandy_num = "+whitecandy_num+" && blackcandy_num = "+blackcandy_num+" && bosscandy_num = "+bosscandy_num); + local skill_level = sq_GetSkillLevel(obj,SKILL_BYKK_LOLLIPOPCRUSH); + local blind_prob = sq_GetLevelData(obj,SKILL_BYKK_LOLLIPOPCRUSH,4,skill_level); + local blind_level = sq_GetLevelData(obj,SKILL_BYKK_LOLLIPOPCRUSH,5,skill_level); + local blind_time = sq_GetLevelData(obj,SKILL_BYKK_LOLLIPOPCRUSH,6,skill_level); + local blind_stuckrate = sq_GetLevelData(obj,SKILL_BYKK_LOLLIPOPCRUSH,8,skill_level); + local lightning_prob = sq_GetLevelData(obj,SKILL_BYKK_LOLLIPOPCRUSH,10,skill_level); + local lightning_time = sq_GetLevelData(obj,SKILL_BYKK_LOLLIPOPCRUSH,11,skill_level); + local lightning_damage = sq_GetLevelData(obj,SKILL_BYKK_LOLLIPOPCRUSH,12,skill_level); + local totalDamage2 = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_LOLLIPOPCRUSH, SKILL_BYKK_LOLLIPOPCRUSH, 3, 1.0) + 100; + local totalDamage3 = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_LOLLIPOPCRUSH, SKILL_BYKK_LOLLIPOPCRUSH, 13, 1.0) + 100; + if(whitecandy_num > 0){ + for(local i = 0; i < whitecandy_num; i++){ + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,sq_getRandom(0,350),sq_getRandom(-150,150),10,obj.getDirection(),SKILL_BYKK_LOLLIPOPCRUSH,20,0,totalDamage2,blind_level,lightning_prob,lightning_time,lightning_damage,0,0,2); + } + obj.getVar("whitecandy_num").set_vector(0,0); + } + if(blackcandy_num > 0){ + for(local i = 0; i < blackcandy_num; i++){ + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,sq_getRandom(0,350),sq_getRandom(-150,150),10,obj.getDirection(),SKILL_BYKK_LOLLIPOPCRUSH,20,1,totalDamage2,blind_level,blind_prob,blind_time,blind_stuckrate,0,0,2); + } + obj.getVar("blackcandy_num").set_vector(0,0); + } + if(bosscandy_num > 0){ + for(local i = 0; i < bosscandy_num; i++){ + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,sq_getRandom(0,350),sq_getRandom(-150,150),10,obj.getDirection(),SKILL_BYKK_LOLLIPOPCRUSH,20,2,totalDamage3,blind_level,blind_prob,blind_time,blind_stuckrate,0,0,2); + } + obj.getVar("bosscandy_num").set_vector(0,0); + } +} + + + +function checkExecutableSkill_MegaDrill_bykk(obj) +{ + //print("MegaDrill > true"); + local state = obj.getState(); + if(state == 6 && !sq_GetSkill(obj, SKILL_BYKK_MEGADRILL).isInCoolTime()){ + if(sq_GetIntData(obj, SKILL_BYKK_MEGADRILL, 2) > 500) return 0; + obj.sq_IntVectClear(); + obj.sq_IntVectPush(20); + obj.sq_AddSetStatePacket(SKILL_BYKK_MEGADRILL, STATE_PRIORITY_IGNORE_FORCE, true); + return 1; + } + return 0; +} + +function onSetState_MegaDrill_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0://地面召唤-开始读条 + local Ani = obj.sq_GetThrowChargeAni(1); + obj.setCurrentAnimation(Ani); + sq_SetCustomDamageType(obj, true, 1); + break; + case 1://地面召唤-召唤 + local Ani = obj.sq_GetThrowShootAni(1); + obj.setCurrentAnimation(Ani); + local successType = obj.getVar("megadrill").get_vector(0); + local offset_x = 150; + if(!obj.isMovablePos(sq_GetDistancePos(obj.getXPos(), obj.getDirection(), 150),sq_GetYPos(obj))) offset_x = 0; + obj.getVar("megadrill").set_vector(1,offset_x); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_MEGADRILL, SKILL_BYKK_MEGADRILL, 5, 1.0) + 100; + local skill = sq_GetSkill(obj, SKILL_BYKK_HOMUNCULUS); + if(sq_GetSkillLevel(obj,SKILL_BYKK_HOMUNCULUS) > 0 && !skill.isSealFunction()) cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,0,-1,180,obj.getDirection(),SKILL_BYKK_MEGADRILL,12,successType,offset_x,totalDamage,0,0,0,0,0,3); + else cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,0,-1,180,obj.getDirection(),SKILL_BYKK_MEGADRILL,2,successType,offset_x,totalDamage,0,0,0,0,0,3); + break; + case 2://驾驶 + local successType = obj.getVar("megadrill").get_vector(0); + //sq_SetCustomDamageType(obj, true, 1); + local attackInfo = sq_GetCustomAttackInfo(obj, 52); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_MEGADRILL, SKILL_BYKK_MEGADRILL, 3, 1.0) + 100; + if(obj.getVar("megadrill").get_vector(0) >= 2) totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_MEGADRILL, SKILL_BYKK_MEGADRILL, 4, 1.0) + 100; + local bonusRate = 1.0;//obj.getVar("witchs_bonusRate").get_vector(0).tofloat() / 1000.0; + local lapisphilosophorum_level = sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM); + if(lapisphilosophorum_level > 0){ + local bonusrate3 = sq_GetLevelData(obj, SKILL_BYKK_LAPISPHILOSOPHORUM, 16, lapisphilosophorum_level); + bonusRate = bonusRate + bonusrate3.tofloat() / 1000; + } + totalDamage = (totalDamage.tofloat() * bonusRate).tointeger(); + sq_SetCurrentAttackInfo(obj, attackInfo); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_MEGADRILLSUCCESSB); + obj.sq_AddStateLayerAnimation(10001,obj.sq_CreateCNRDAnimation("effect/animation/witch_bykk/megadrill/bodycover.ani"), 0, 0); + if(successType >= 2){ + obj.sq_AddStateLayerAnimation(10002,obj.sq_CreateCNRDAnimation("effect/animation/witch_bykk/megadrill/lightgreat1.ani"), -50, 25); + } + local currentAni = obj.getCurrentAnimation(); + sq_ClearAttackBox(currentAni); + switch(successType){ + case 1: + sq_AddAttackBox(currentAni, -10, -25, 0, 140, 50, 75); + break; + case 2: + case 3: + sq_AddAttackBox(currentAni, -20, -50, 0, 280, 100, 100); + break; + } + obj.setTimeEvent(2,20,-1,false); + obj.setTimeEvent(3,100,1,false); + obj.setTimeEvent(5,100,1,false); + break; + case 3://结束 + obj.stopTimeEvent(2); + obj.stopTimeEvent(3); + obj.stopTimeEvent(5); + local appendage = obj.getVar().getAppendage(0); + if(appendage) appendage.setValid(false); + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_BROOMSPINNEWC_BODY); + local effectObj = obj.getVar("megadrill").get_obj_vector(0); + if(effectObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(effectObj); + colObj.addSetStatePacket(25, null, STATE_PRIORITY_AUTO, false, ""); + } + break; + case 4://跳跃 + local successType = obj.getVar("megadrill").get_vector(0); + switch(successType){ + case 1: + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_MEGADRILLSUCCESS); + break; + case 2: + case 3: + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_MEGADRILLGREAT); + break; + } + local currentAni = obj.getCurrentAnimation(); + currentAni.setLoop(true); + break; + case 10://蓄力 + local Ani = obj.sq_GetThrowChargeAni(1); + obj.setCurrentAnimation(Ani); + break; + case 11://失败释放 + local Ani = obj.sq_GetThrowShootAni(1); + obj.setCurrentAnimation(Ani); + obj.setTimeEvent(0,1000,1,true); + break; + case 20://空中释放 + obj.sq_ZStop(); + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_LAVAPOTIONAIR_BODY); + break; + } + + if(substate == 1 || substate == 11 || substate == 20){ + local skllevel2 = sq_GetSkillLevel(obj, SKILL_BYKK_SUCCESSPREMONITION); + local nextskillprob = sq_GetLevelData(obj,SKILL_BYKK_SUCCESSPREMONITION, 0, skllevel2); + if(skllevel2 > 0){ + if(sq_getRandom(0,99) > (1000 - nextskillprob) / 10){ + obj.getVar("successpremonition").setBool(0,true); + } + } + } +} + +function onEndCurrentAni_MegaDrill_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + //sq_SetCustomDamageType(obj, true, 0); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_MEGADRILL, STATE_PRIORITY_USER, true); + break; + case 1: + obj.setTimeEvent(4,860,1,false); + obj.setTimeEvent(6,400,1,false); + break; + case 3: + case 11: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + case 20: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_IntVectPush(0); + obj.sq_IntVectPush(3); + obj.sq_AddSetStatePacket(STATE_JUMP, STATE_PRIORITY_USER, true); + break; + } +} + +function onProcCon_MegaDrill_bykk(obj) +{ + if(!obj) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 10: + local stateTime = obj.sq_GetStateTimer(); + local maxTime = sq_GetIntData(obj,SKILL_BYKK_BITTERSCANDYBAR,0); + local bDownKey = obj.isDownSkillLastKey(); + if(stateTime >= maxTime){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(11); + obj.sq_AddSetStatePacket(SKILL_BYKK_MEGADRILL , STATE_PRIORITY_USER, true); + return; + } + if(!bDownKey){ + if(stateTime < maxTime){//成功 + local successType = getSuccessType_bykk(obj,SKILL_BYKK_MEGADRILL); + if(successType == 0){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(11); + obj.sq_AddSetStatePacket(SKILL_BYKK_MEGADRILL , STATE_PRIORITY_USER, true); + return; + } + else{ + obj.getVar("megadrill").clear_vector(); + obj.getVar("megadrill").push_vector(successType); + obj.getVar("megadrill").push_vector(0); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_MEGADRILL , STATE_PRIORITY_USER, true); + return; + } + } + else{//失败 + obj.sq_IntVectClear(); + obj.sq_IntVectPush(11); + obj.sq_AddSetStatePacket(SKILL_BYKK_MEGADRILL , STATE_PRIORITY_USER, true); + return; + } + } + break; + case 2: + case 4: + local timer = obj.getVar("Witch_MegaDrill").get_ct_vector(0); + if(timer){ + local skill_level = sq_GetSkillLevel(obj,SKILL_BYKK_MEGADRILL); + local lifeTime = sq_GetLevelData(obj,SKILL_BYKK_MEGADRILL,1,skill_level); + local currentT = timer.Get(); + //print("currentT = "+currentT); + if(currentT >= lifeTime){ + sq_setCurrentAxisPos(obj, 2, 50); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_IntVectPush(1); + obj.sq_IntVectPush(3); + obj.sq_AddSetStatePacket(STATE_JUMP, STATE_PRIORITY_USER, true); + return; + } + else if(!sq_GetSkill(obj, SKILL_BYKK_MEGADRILL).isInCoolTime()){ + obj.setSkillCommandEnable(SKILL_BYKK_MEGADRILL,true); + local b_useskill = obj.sq_IsEnterSkill(SKILL_BYKK_MEGADRILL); + if(b_useskill != -1){ + timer.Reset(); + timer.Start(10000,0); + obj.startSkillCoolTime(SKILL_BYKK_MEGADRILL, sq_GetSkillLevel(obj, SKILL_BYKK_MEGADRILL), -1); + } + } + } + + if(sq_GetLevelData(obj, SKILL_BYKK_MEGADRILL, 13, sq_GetSkillLevel(obj, SKILL_BYKK_MEGADRILL)) > 0 && substate == 2){ + local skillIndex = [SKILL_BYKK_ACIDCLOUD,SKILL_BYKK_ANTIGRAVITYSTARTER,SKILL_BYKK_ENHANCEDMAGICMISSILE,SKILL_BYKK_FLUORECOLLIDER,SKILL_BYKK_LAVAPOTION]; + for(local i = 0; i < skillIndex.len(); i++){ + if(!sq_GetSkill(obj, skillIndex[i]).isInCoolTime()){ + obj.setSkillCommandEnable(skillIndex[i],true); + local b_useskill = obj.sq_IsEnterSkill(skillIndex[i]); + if(b_useskill != -1){ + obj.startSkillCoolTime(skillIndex[i], sq_GetSkillLevel(obj, skillIndex[i]), -1); + switch(skillIndex[i]){ + case SKILL_BYKK_ACIDCLOUD: + local skllevel0 = sq_GetSkillLevel(obj, SKILL_BYKK_ACIDCLOUD); + local leftTime = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 0, skllevel0); + local hitTime = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 5, skllevel0); + local skllevel1 = sq_GetSkillLevel(obj, SKILL_BYKK_REDCANDY); + if(skllevel1 > 0){ + if(sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 8, skllevel0) > 0) leftTime = leftTime + 3000; + local totalDamage = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 4, skllevel0); + local totalDamage2 = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 1, skllevel0); + local damageRate = (totalDamage2.tofloat() / totalDamage.tofloat() * 100.0).tointeger(); + local prob = sq_GetLevelData(obj,SKILL_BYKK_REDCANDY, 1, skllevel1); + local level = sq_GetSkillLevel(obj, 174) + sq_GetIntData(obj, SKILL_BYKK_REDCANDY, 13); + local time = sq_GetIntData(obj, SKILL_BYKK_REDCANDY, 14); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,150,0,280,obj.getDirection(),SKILL_BYKK_ACIDCLOUD,2,totalDamage,leftTime,hitTime,0,prob,level,time,damageRate,1); + if(sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 8, skllevel0) > 0) cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,75,0,280,obj.getDirection(),SKILL_BYKK_ACIDCLOUD,2,totalDamage,leftTime,hitTime,0,prob,level,time,damageRate,1); + } + else{ + local successType = getSuccessType_bykk(obj,SKILL_BYKK_ACIDCLOUD); + if(successType == 2 && sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM) > 0 && sq_getRandom(0,100) >= (100 - sq_GetIntData(obj, SKILL_BYKK_LAPISPHILOSOPHORUM, 21))) successType = 3; + switch(successType){ + case 0: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/acidcloud/fail_n.ani",0,2,152); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/acidcloud/fail_d.ani",0,1,151); + break; + case 1: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/acidcloud/success_n.ani",0,2,152); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/acidcloud/success_d.ani",0,1,151); + break; + case 2: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/acidcloud/great_d.ani",0,2,152); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/acidcloud/great_n.ani",0,1,151); + break; + } + local totalDamage = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 2, skllevel0); + if(successType == 1) totalDamage = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 3, skllevel0); + if(successType >= 2) totalDamage = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 4, skllevel0); + local totalDamage2 = 0; + if(successType >= 2) totalDamage2 = sq_GetLevelData(obj,SKILL_BYKK_ACIDCLOUD, 1, skllevel0); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,150,0,200,obj.getDirection(),SKILL_BYKK_ACIDCLOUD,1,totalDamage,leftTime,hitTime,successType,totalDamage2,0,0,0,1); + } + break; + case SKILL_BYKK_ANTIGRAVITYSTARTER: + local range = sq_GetIntData(obj, SKILL_BYKK_ANTIGRAVITYSTARTER, 6); + local successType = getSuccessType_bykk(obj,SKILL_BYKK_ANTIGRAVITYSTARTER); + if(successType == 2 && sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM) > 0 && sq_getRandom(0,99) >= (100 - sq_GetIntData(obj, SKILL_BYKK_LAPISPHILOSOPHORUM, 21))) successType = 3; + if(successType == 3){ + local sizeRate = sq_GetLevelData(obj,SKILL_BYKK_LAPISPHILOSOPHORUM, 14, sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM)); + range = (range.tofloat() * (100.0 + sizeRate.tofloat()) / 100.0).tointeger(); + } + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ANTIGRAVITYSTARTER, SKILL_BYKK_ANTIGRAVITYSTARTER, 0, 1.0) + 100; + local totalDamage2 = 0; + if(successType == 1) totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ANTIGRAVITYSTARTER, SKILL_BYKK_ANTIGRAVITYSTARTER, 1, 1.0) + 100; + if(successType >= 2){ + totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ANTIGRAVITYSTARTER, SKILL_BYKK_ANTIGRAVITYSTARTER, 2, 1.0) + 100; + totalDamage2 = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ANTIGRAVITYSTARTER, SKILL_BYKK_ANTIGRAVITYSTARTER, 4, 1.0) + 100; + } + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,200,0,0 - sq_GetZPos(obj),obj.getDirection(),SKILL_BYKK_ANTIGRAVITYSTARTER,1,totalDamage,range,successType,totalDamage2,0,0,0,0,1); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,200,0,0 - sq_GetZPos(obj),obj.getDirection(),SKILL_BYKK_ANTIGRAVITYSTARTER,2,range,0,0,0,0,0,0,0,0); + break; + case SKILL_BYKK_ENHANCEDMAGICMISSILE: + local successType = getSuccessType_bykk(obj,SKILL_BYKK_ENHANCEDMAGICMISSILE); + if(successType == 0) successType = 1; + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ENHANCEDMAGICMISSILE, SKILL_BYKK_ENHANCEDMAGICMISSILE, 0, 1.0) + 100; + if(successType == 1) totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ENHANCEDMAGICMISSILE, SKILL_BYKK_ENHANCEDMAGICMISSILE, 1, 1.0) + 100; + local totalDamage2 = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_ENHANCEDMAGICMISSILE, SKILL_BYKK_ENHANCEDMAGICMISSILE, 6, 1.0) + 100; + local damageRate = ((totalDamage2.tofloat() / totalDamage.tofloat()) * 100.0).tointeger(); + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_ENHANCEDMAGICMISSILE); + local prob = sq_GetLevelData(obj,SKILL_BYKK_ENHANCEDMAGICMISSILE, 2, skill_level); + local level = sq_GetSkillLevel(obj, 174) + 20; + local time = sq_GetLevelData(obj,SKILL_BYKK_ENHANCEDMAGICMISSILE, 4, skill_level); + local damage = sq_GetLevelData(obj,SKILL_BYKK_ENHANCEDMAGICMISSILE, 5, skill_level); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,50,0,70,obj.getDirection(),SKILL_BYKK_ENHANCEDMAGICMISSILE,1,totalDamage,successType,prob,time,damage,damageRate,level,0,1); + break; + case SKILL_BYKK_FLUORECOLLIDER: + local successType = getSuccessType_bykk(obj,SKILL_BYKK_FLUORECOLLIDER); + if(successType == 2 && sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM) > 0 && sq_getRandom(0,99) >= (100 - sq_GetIntData(obj, SKILL_BYKK_LAPISPHILOSOPHORUM, 21))) successType = 3; + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_FLUORECOLLIDER, SKILL_BYKK_FLUORECOLLIDER, 2, 1.0) + 100; + if(successType == 1) totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_FLUORECOLLIDER, SKILL_BYKK_FLUORECOLLIDER, 3, 1.0) + 100; + if(successType >= 2) totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_FLUORECOLLIDER, SKILL_BYKK_FLUORECOLLIDER, 4, 1.0) + 100; + local totalDamage2 = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_FLUORECOLLIDER, SKILL_BYKK_FLUORECOLLIDER, 5, 1.0) + 100; + local damageRate = (totalDamage2.tofloat() / totalDamage.tofloat() * 100.0).tointeger(); + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_FLUORECOLLIDER); + local lifeTime = sq_GetLevelData(obj,SKILL_BYKK_FLUORECOLLIDER, 0, skill_level); + local hitTime = sq_GetIntData(obj, SKILL_BYKK_FLUORECOLLIDER, 6) / 2; + local range = sq_GetIntData(obj, SKILL_BYKK_FLUORECOLLIDER, 13); + local homunculus_level = sq_GetSkillLevel(obj, SKILL_BYKK_HOMUNCULUS); + if(homunculus_level > 0){ + local decr_Rate = sq_GetIntData(obj, SKILL_BYKK_HOMUNCULUS, 3); + lifeTime = (lifeTime.tofloat() * (1000.0 - decr_Rate.tofloat()) / 1000.0).tointeger(); + } + if(successType == 3 && sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM) > 0){ + local decr_Rate = sq_GetLevelData(obj,SKILL_BYKK_LAPISPHILOSOPHORUM, 9, sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM)); + hitTime = hitTime * (1000 - decr_Rate) / 1000; + } + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,70,-1,0,obj.getDirection(),SKILL_BYKK_FLUORECOLLIDER,1,1,lifeTime,successType,hitTime,totalDamage,damageRate,range,0,5); + break; + case SKILL_BYKK_LAVAPOTION: + local successType = getSuccessType_bykk(obj,SKILL_BYKK_LAVAPOTION); + if(successType == 0) successType = 1; + if(successType == 2 && sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM) > 0 && sq_getRandom(0,100) >= (100 - sq_GetIntData(obj, SKILL_BYKK_LAPISPHILOSOPHORUM, 21))) successType = 3; + local sizeRate = sq_GetIntData(obj,SKILL_BYKK_LAVAPOTION,8); + local hitTime = sq_GetIntData(obj,SKILL_BYKK_LAVAPOTION,6); + local skill_level = sq_GetSkillLevel(obj, SKILL_BYKK_LAVAPOTION); + local lifeTime = sq_GetLevelData(obj,SKILL_BYKK_LAVAPOTION, 0, skill_level); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_LAVAPOTION, SKILL_BYKK_LAVAPOTION, 1, 1.0) + 100; + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,50,0,70,obj.getDirection(),SKILL_BYKK_LAVAPOTION,3,totalDamage,lifeTime,hitTime,sizeRate,successType,0,0,0,1); + break; + } + obj.sq_IntVectClear(); + obj.sq_IntVectPush(4); + obj.sq_AddSetStatePacket(SKILL_BYKK_MEGADRILL, STATE_PRIORITY_USER, true); + } + } + } + } + + if(sq_GetSkillLevel(obj, SKILL_BYKK_EMERGENCYESCAPE) > 0){ + sq_SetKeyxEnable(obj, E_JUMP_COMMAND, true); + if(sq_IsEnterCommand(obj, E_JUMP_COMMAND)){ + sq_setCurrentAxisPos(obj, 2, 50); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_IntVectPush(1); + obj.sq_IntVectPush(3); + obj.sq_AddSetStatePacket(STATE_JUMP, STATE_PRIORITY_USER, true); + return; + } + } + sq_SetKeyxEnable(obj, E_SKILL_COMMAND, true); + if(sq_IsEnterCommand(obj, E_SKILL_COMMAND)){ + sq_SetCurrentDirection(obj, sq_GetOppositeDirection(sq_GetDirection(obj))); + local effectObj = obj.getVar("megadrill").get_obj_vector(0); + if(effectObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(effectObj); + sq_SetCurrentDirection(colObj, sq_GetOppositeDirection(sq_GetDirection(colObj))); + } + } + + //加快 + sq_SetKeyxEnable(obj, E_ATTACK_COMMAND, true); + if(sq_IsEnterCommand(obj, E_ATTACK_COMMAND)) obj.addRapidInput(); + + if(substate == 2){// && sq_GetLevelData(obj, SKILL_BYKK_MEGADRILL, 6, sq_GetSkillLevel(obj, SKILL_BYKK_MEGADRILL)) > 0 + sq_SetKeyxEnable(obj, E_BUFF_COMMAND, true); + if(sq_IsEnterCommand(obj, E_BUFF_COMMAND)){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(4); + obj.sq_AddSetStatePacket(SKILL_BYKK_MEGADRILL, STATE_PRIORITY_USER, true); + } + } + + if(substate == 4){ + local currentT = obj.sq_GetStateTimer(); + if(currentT <= 300){ + local fireT = 300;//总时间 + local v = sq_GetAccel(0, 100, currentT, fireT, true); + sq_setCurrentAxisPos(obj, 2, v); + } + else{ + local currentT1 = currentT - 300 + local fireT = 300;//总时间 + local v = sq_GetAccel(100, 0, currentT1, fireT, false); + sq_setCurrentAxisPos(obj, 2, v); + } + if(currentT >= 600){ + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_MEGADRILL, SKILL_BYKK_MEGADRILL, 3, 1.5); + if(obj.getVar("megadrill").get_vector(0) >= 2) totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_MEGADRILL, SKILL_BYKK_MEGADRILL, 4, 1.5); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_MEGADRILL,3,totalDamage,0,0,0,0,0,0,0,1); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(SKILL_BYKK_MEGADRILL, STATE_PRIORITY_USER, true); + } + } + break; + } +} + +function onKeyFrameFlag_MegaDrill_bykk(obj, flagIndex) +{ + if(!obj) return false; + local substate = obj.getSkillSubState(); + switch(substate){ + case 20: + if(flagIndex == 1){ + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_MEGADRILL, SKILL_BYKK_MEGADRILL, 7, 1.0); + local totalDamage2 = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_MEGADRILL, SKILL_BYKK_MEGADRILL, 2, 1.0); + local damageRate = (totalDamage2.tofloat() / totalDamage.tofloat() * 100.0).tointeger(); + local sub = 1; + if(sq_GetLevelData(obj, SKILL_BYKK_MEGADRILL, 8, sq_GetSkillLevel(obj, SKILL_BYKK_MEGADRILL)) > 0) sub = 0; + local bitterscandy_level = sq_GetSkillLevel(obj,SKILL_BYKK_BITTERSCANDYBAR); + local add_Rate = sq_GetLevelData(obj,SKILL_BYKK_BITTERSCANDYBAR,2,bitterscandy_level); + add_Rate = (1000.0 + add_Rate.tofloat()) / 1000.0; + totalDamage = (totalDamage.tofloat() * add_Rate).tointeger(); + local skill_level2 = sq_GetSkillLevel(obj,SKILL_BYKK_HOMUNCULUS); + local add_Rate2 = sq_GetLevelData(obj,SKILL_BYKK_HOMUNCULUS, 0, skill_level2); + if(skill_level2 > 0) totalDamage = (totalDamage.tofloat() * (1000.0 + add_Rate2.tofloat()) / 1000.0).tointeger(); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,150,0,0 - obj.getZPos(),obj.getDirection(),SKILL_BYKK_MEGADRILL,1,totalDamage,damageRate,sub,0,0,0,0,0,1); + } + break; + } +} + +function onTimeEvent_MegaDrill_bykk(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + switch(timeEventIndex){ + case 0: + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_MEGADRILL, SKILL_BYKK_MEGADRILL, 7, 1.0); + local totalDamage2 = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_MEGADRILL, SKILL_BYKK_MEGADRILL, 2, 1.0); + local damageRate = (totalDamage2.tofloat() / totalDamage.tofloat() * 100.0).tointeger(); + local sub = 1; + if(sq_GetLevelData(obj, SKILL_BYKK_MEGADRILL, 8, sq_GetSkillLevel(obj, SKILL_BYKK_MEGADRILL)) > 0) sub = 0; + local bitterscandy_level = sq_GetSkillLevel(obj,SKILL_BYKK_BITTERSCANDYBAR); + local add_Rate = sq_GetLevelData(obj,SKILL_BYKK_BITTERSCANDYBAR,2,bitterscandy_level); + add_Rate = (1000.0 + add_Rate.tofloat()) / 1000.0; + totalDamage = (totalDamage.tofloat() * add_Rate).tointeger(); + local skill_level2 = sq_GetSkillLevel(obj,SKILL_BYKK_HOMUNCULUS); + local add_Rate2 = sq_GetLevelData(obj,SKILL_BYKK_HOMUNCULUS, 0, skill_level2); + if(skill_level2 > 0) totalDamage = (totalDamage.tofloat() * (1000.0 + add_Rate2.tofloat()) / 1000.0).tointeger(); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,150,0,0,obj.getDirection(),SKILL_BYKK_MEGADRILL,1,totalDamage,damageRate,sub,0,0,0,0,0,1); + break; + case 1: + sq_setCurrentAxisPos(obj, 2, 50); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_IntVectPush(1); + obj.sq_IntVectPush(3); + obj.sq_AddSetStatePacket(STATE_JUMP , STATE_PRIORITY_USER, true); + break; + case 2://移动 + local effectObj = obj.getVar("megadrill").get_obj_vector(0); + local speed01 = 2, speed02 = 4; + if(sq_GetLevelData(obj, SKILL_BYKK_MEGADRILL, 12, sq_GetSkillLevel(obj, SKILL_BYKK_MEGADRILL)) > 0){ + speed01 = speed01 * (100 + sq_GetLevelData(obj, SKILL_BYKK_MEGADRILL, 12, sq_GetSkillLevel(obj, SKILL_BYKK_MEGADRILL))) / 100; + speed02 = speed02 * (100 + sq_GetLevelData(obj, SKILL_BYKK_MEGADRILL, 12, sq_GetSkillLevel(obj, SKILL_BYKK_MEGADRILL))) / 100; + } + if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_UP, ENUM_SUBKEY_TYPE_ALL)){ + if(obj.isMovablePos(obj.getXPos(),obj.getYPos() - speed01)) sq_setCurrentAxisPos(obj, 1, obj.getYPos() - speed01); + if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_LEFT, ENUM_SUBKEY_TYPE_ALL)){ + if(obj.isMovablePos(obj.getXPos() - speed02,obj.getYPos())) sq_setCurrentAxisPos(obj, 0, obj.getXPos() - speed02); + if(effectObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(effectObj); + if(obj.getDirection() == ENUM_DIRECTION_LEFT){if(colObj.getState() != 23) colObj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, "");} + else{if(colObj.getState() != 24) colObj.addSetStatePacket(24, null, STATE_PRIORITY_AUTO, false, "");} + } + return; + } + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_RIGHT, ENUM_SUBKEY_TYPE_ALL)){ + if(obj.isMovablePos(obj.getXPos() + speed02,obj.getYPos())) sq_setCurrentAxisPos(obj, 0, obj.getXPos() + speed02); + if(effectObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(effectObj); + if(obj.getDirection() == ENUM_DIRECTION_RIGHT){if(colObj.getState() != 23) colObj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, "");} + else{if(colObj.getState() != 24) colObj.addSetStatePacket(24, null, STATE_PRIORITY_AUTO, false, "");} + } + return; + } + else{ + if(effectObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(effectObj); + if(colObj.getState() != 23) colObj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, ""); + return; + } + } + } + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_DOWN, ENUM_SUBKEY_TYPE_ALL)){ + if(obj.isMovablePos(obj.getXPos(),obj.getYPos() + speed01)) sq_setCurrentAxisPos(obj, 1, obj.getYPos() + speed01); + if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_LEFT, ENUM_SUBKEY_TYPE_ALL)){ + if(obj.isMovablePos(obj.getXPos() - speed02,obj.getYPos())) sq_setCurrentAxisPos(obj, 0, obj.getXPos() - speed02); + if(effectObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(effectObj); + if(obj.getDirection() == ENUM_DIRECTION_LEFT){if(colObj.getState() != 23) colObj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, "");} + else{if(colObj.getState() != 24) colObj.addSetStatePacket(24, null, STATE_PRIORITY_AUTO, false, "");} + } + return; + } + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_RIGHT, ENUM_SUBKEY_TYPE_ALL)){ + if(obj.isMovablePos(obj.getXPos() + speed02,obj.getYPos())) sq_setCurrentAxisPos(obj, 0, obj.getXPos() + speed02); + if(effectObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(effectObj); + if(obj.getDirection() == ENUM_DIRECTION_RIGHT){if(colObj.getState() != 23) colObj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, "");} + else{if(colObj.getState() != 24) colObj.addSetStatePacket(24, null, STATE_PRIORITY_AUTO, false, "");} + } + return; + } + else{ + if(effectObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(effectObj); + if(colObj.getState() != 23) colObj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, ""); + return; + } + } + } + if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_LEFT, ENUM_SUBKEY_TYPE_ALL)){ + if(obj.isMovablePos(obj.getXPos() - speed02,obj.getYPos())) sq_setCurrentAxisPos(obj, 0, obj.getXPos() - speed02); + if(effectObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(effectObj); + if(obj.getDirection() == ENUM_DIRECTION_LEFT){if(colObj.getState() != 23) colObj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, "");} + else{if(colObj.getState() != 24) colObj.addSetStatePacket(24, null, STATE_PRIORITY_AUTO, false, "");} + } + return; + } + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_RIGHT, ENUM_SUBKEY_TYPE_ALL)){ + if(obj.isMovablePos(obj.getXPos() + speed02,obj.getYPos())) sq_setCurrentAxisPos(obj, 0, obj.getXPos() + speed02); + if(effectObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(effectObj); + if(obj.getDirection() == ENUM_DIRECTION_RIGHT){if(colObj.getState() != 23) colObj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, "");} + else{if(colObj.getState() != 24) colObj.addSetStatePacket(24, null, STATE_PRIORITY_AUTO, false, "");} + } + return; + } + if(effectObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(effectObj); + if(colObj.getState() != 22) colObj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + } + break; + case 3://攻击加快 + local inputConut = obj.getRapidInputFrequency(); + inputConut = inputConut.tointeger(); + + local inputMax = 2; + local gapByInputMin = sq_GetIntData(obj,SKILL_BYKK_MEGADRILL,11); + local gapByInputMax = sq_GetIntData(obj,SKILL_BYKK_MEGADRILL,10); + + if(inputConut >= inputMax){ + obj.setTimeEvent(3, gapByInputMin, 1,false); + local effectObj = obj.getVar("megadrill").get_obj_vector(0); + if(effectObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(effectObj); + local pAni = colObj.getCurrentAnimation(); + pAni.setSpeedRate(300.0); + if(colObj.getVar().getBool(0) == false && obj.getVar("megadrill").get_vector(0) >= 2){ + colObj.getVar().setBool(0,true); + pAni.addLayerAnimation(-1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/attract1back.ani"),true); + pAni.addLayerAnimation(3,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/attract1front.ani"),true); + pAni.addLayerAnimation(-1,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/attract2back.ani"),true); + pAni.addLayerAnimation(3,sq_CreateAnimation("","character/mage/effect/animation/witch_bykk/megadrill/attract2front.ani"),true); + } + } + if(obj.getVar("megadrill").get_vector(0) >= 2 && !obj.getVar("attract").getAppendage(0)){ + local range = 100 * (100 + sq_GetLevelData(obj, SKILL_BYKK_MEGADRILL, 11, sq_GetSkillLevel(obj, SKILL_BYKK_MEGADRILL))) / 100; + local appendage = sq_AttractToMe(obj, range, 80, 1000); + obj.getVar("attract").setAppendage(0,appendage); + } + } + else{ + obj.setTimeEvent(3, gapByInputMax, 1,false); + local effectObj = obj.getVar("megadrill").get_obj_vector(0); + if(effectObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(effectObj); + colObj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + local pAni = colObj.getCurrentAnimation(); + pAni.setSpeedRate(100.0); + } + local appendage = obj.getVar("attract").getAppendage(0); + if(appendage) appendage.setValid(false); + } + + obj.resetHitObjectList(); + break; + case 4: + local offset_x = obj.getVar("megadrill").get_vector(1); + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(obj),obj.getDirection(),offset_x)); + sq_setCurrentAxisPos(obj, 2, 0); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/blackmantle/cloud.ani",0,0,-sq_GetZPos(obj)); + CNSquirrelAppendage.sq_AppendAppendage(obj, obj, SKILL_BYKK_MEGADRILL, false, "character/mage/witch_skill_bykk/ap/ap_megadrill.nut", true); + local effectObj = obj.getVar("megadrill").get_obj_vector(0); + if(effectObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(effectObj); + sq_setCurrentAxisPos(colObj, 2, sq_GetZPos(obj)-5); + sq_moveWithParent(obj, colObj); + } + obj.getVar("Witch_MegaDrill").clear_ct_vector(); + obj.getVar("Witch_MegaDrill").push_ct_vector(); + local timer = obj.getVar("Witch_MegaDrill").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(SKILL_BYKK_MEGADRILL, STATE_PRIORITY_USER, true); + break; + case 5: + local inputConut = obj.getRapidInputFrequency(); + inputConut = inputConut.tointeger(); + + local inputMax = 2; + local gapByInputMin = 600; + local gapByInputMax = 1200; + + if(inputConut >= inputMax) obj.setTimeEvent(5,gapByInputMin,1,false); + else obj.setTimeEvent(5,gapByInputMax,1,false); + + local pooledObj; + if(sq_getRandom(1,100) >= 30) pooledObj = sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/megadrill/smoke"+sq_getRandom(1,2).tostring()+".ani",-85,0,100); + else pooledObj = sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/megadrill/smoke"+sq_getRandom(1,2).tostring()+".ani",-100,0,50); + sq_moveWithParent(obj, pooledObj); + local pooledObj2 = sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/megadrill/smoke"+sq_getRandom(1,2).tostring()+".ani",50,0,75); + local pAni = pooledObj2.getCurrentAnimation(); + pAni.setImageRateFromOriginal(-1.0, 1.0); + sq_moveWithParent(obj, pooledObj2); + break; + case 6: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/blackmantle/cloud.ani",0,0,-sq_GetZPos(obj)); + sq_setCurrentAxisPos(obj, 2, 500); + obj.sq_ZStop(); + break; + } +} + +function onEndState_MegaDrill_bykk(obj, new_state) +{ + if(!obj) return; + if(new_state != SKILL_BYKK_MEGADRILL){ + sq_SetCustomDamageType(obj, true, 0); + local effectObj = obj.getVar("megadrill").get_obj_vector(0); + if(effectObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(effectObj); + colObj.addSetStatePacket(25, null, STATE_PRIORITY_AUTO, false, ""); + } + local appendage = obj.getVar("attract").getAppendage(0); + if(appendage) appendage.setValid(false); + obj.getVar("megadrill").setBool(0,false); + local apdPath = "character/mage/witch_skill_bykk/ap/ap_megadrill.nut"; + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, apdPath)) CNSquirrelAppendage.sq_RemoveAppendage(obj, apdPath); + } +} + + + + +function checkExecutableSkill_TransformFlapper_bykk(obj) +{ + //print("TransformFlapper > true"); + return 0; +} + +function onSetState_TransformFlapper_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + obj.sq_SetCurrentAnimation(38); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + local successType = getSuccessType_bykk(obj,SKILL_BYKK_TRANSFORMFLAPPER); + if(successType == 2 && sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM) > 0 && sq_getRandom(0,99) >= 49) successType = 3; + obj.getVar("transformflapper").clear_vector(); + obj.getVar("transformflapper").push_vector(successType); + switch(successType){ + case 0: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/fail_n.ani",100,0,75); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/fail_d.ani",100,-1,74); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/cloud.ani",100,-2,73); + break; + case 1: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/success_n.ani",100,0,75); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/success_d.ani",100,-1,74); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/cloud.ani",100,-2,73); + break; + case 2: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/great_n.ani",100,0,75); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/great_d.ani",100,-1,74); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/cloud.ani",100,-2,73); + break; + case 3: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/bigsuccess_familier01.ani",100,0,75); + break; + } + local currentAni = obj.getCurrentAnimation(); + sq_ClearAttackBox(currentAni); + local delayTime = currentAni.getDelaySum(1, 1); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_TRANSFORMFLAPPER, SKILL_BYKK_TRANSFORMFLAPPER, 0, 1.0) + 100; + local skill_level = sq_GetSkillLevel(obj,SKILL_BYKK_TRANSFORMFLAPPER); + local prob = sq_GetLevelData(obj,SKILL_BYKK_TRANSFORMFLAPPER,1,skill_level); + local level = sq_GetLevelData(obj,SKILL_BYKK_TRANSFORMFLAPPER,2,skill_level); + local time = sq_GetLevelData(obj,SKILL_BYKK_TRANSFORMFLAPPER,3,skill_level); + local transformflapper_skill = sq_GetSkill(obj,SKILL_BYKK_TRANSFORMFLAPPER); + local sizeRate = sq_GetLevelData(obj,SKILL_BYKK_TRANSFORMFLAPPER,8,skill_level); + local isSeal = 1; + if(transformflapper_skill.isSealFunction()) isSeal = 0; + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_TRANSFORMFLAPPER,1,delayTime,0,0,0,0,0,0,0,0); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_TRANSFORMFLAPPER,3,delayTime,totalDamage,prob,level,time,successType,isSeal,sizeRate,2); + obj.setTimeEvent(1,currentAni.getDelaySum(0,7),1,false); + break; + case 1: + obj.sq_ZStop(); + obj.sq_SetCurrentAnimation(39); + local successType = getSuccessType_bykk(obj,SKILL_BYKK_TRANSFORMFLAPPER); + local currentAni = obj.getCurrentAnimation(); + local delayTime = currentAni.getDelaySum(1, 1); + sq_ClearAttackBox(currentAni); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_TRANSFORMFLAPPER, SKILL_BYKK_TRANSFORMFLAPPER, 0, 1.0) + 100; + local skill_level = sq_GetSkillLevel(obj,SKILL_BYKK_TRANSFORMFLAPPER); + local prob = sq_GetLevelData(obj,SKILL_BYKK_TRANSFORMFLAPPER,1,skill_level); + local level = sq_GetLevelData(obj,SKILL_BYKK_TRANSFORMFLAPPER,2,skill_level); + local time = sq_GetLevelData(obj,SKILL_BYKK_TRANSFORMFLAPPER,3,skill_level); + local transformflapper_skill = sq_GetSkill(obj,SKILL_BYKK_TRANSFORMFLAPPER); + local sizeRate = sq_GetLevelData(obj,SKILL_BYKK_TRANSFORMFLAPPER,8,skill_level); + local isSeal = 1; + if(transformflapper_skill.isSealFunction()) isSeal = 0; + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_TRANSFORMFLAPPER,2,delayTime,0,0,0,0,0,0,0,0); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_TRANSFORMFLAPPER,4,delayTime,totalDamage,prob,level,time,successType,isSeal,sizeRate,2); + break; + } + + local skllevel2 = sq_GetSkillLevel(obj, SKILL_BYKK_SUCCESSPREMONITION); + local nextskillprob = sq_GetLevelData(obj,SKILL_BYKK_SUCCESSPREMONITION, 0, skllevel2); + if(skllevel2 > 0){ + if(sq_getRandom(0,99) > (1000 - nextskillprob) / 10){ + obj.getVar("successpremonition").setBool(0,true); + } + } +} + +function onEndCurrentAni_TransformFlapper_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + case 1: + local successType = obj.getVar("transformflapper").get_vector(0); + switch(successType){ + case 0: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/finish_fail_d.ani",75,0,10); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/finish_fail_n.ani",75,-1,9); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/cloud.ani",75,-2,8); + break; + case 1: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/finish_success_d.ani",75,0,10); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/finish_success_n.ani",75,-1,9); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/cloud.ani",75,-2,8); + break; + case 2: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/finish_great_d.ani",75,0,10); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/finish_great_n.ani",75,-1,9); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/cloud.ani",75,-2,8); + break; + case 3: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/finish_great_d.ani",75,0,10); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/finish_great_n.ani",75,-1,9); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/cloud.ani",75,-2,8); + break; + } + if(obj.getVar("transBool").getBool(0)){ + obj.getVar("transBool").setBool(0, false); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_TRANSFORMFLAPPER, STATE_PRIORITY_USER, true); + } + else{ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_IntVectPush(0); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(STATE_JUMP, STATE_PRIORITY_USER, true); + } + break; + } +} + +function onProcCon_TransformFlapper_bykk(obj) +{ + if(!obj) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + local pAni = obj.getCurrentAnimation();//得到ani + local currentT = sq_GetCurrentTime(pAni);//当前时间 + local fireT = pAni.getDelaySum(0, 5);//总时间 + local vz = sq_GetUniformVelocity(0, 20, currentT, fireT); + sq_setCurrentAxisPos(obj, 2, vz);//设置当前z坐标 + // if(currentT >= fireT) obj.sq_ZStop(); + break; + } +} + +function onKeyFrameFlag_TransformFlapper_bykk(obj, flagIndex) +{ + if(!obj) return false; +} + +function onTimeEvent_TransformFlapper_bykk(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + switch(timeEventIndex){ + case 0: + break; + case 1: + local successType = obj.getVar("transformflapper").get_vector(0); + local aniPath = ["character/mage/effect/animation/witch_bykk/transformflapper/flyflap_groundwave.ani","character/mage/effect/animation/witch_bykk/transformflapper/bottom_down.ani","character/mage/effect/animation/witch_bykk/transformflapper/bottom_up.ani"]; + for(local i = 0; i < 3; i++){ + local effectObj = createOnlyDrawObject_witch_bykk(obj,aniPath[i],true,obj.getDirection(),sq_GetDistancePos(sq_GetXPos(obj),obj.getDirection(),100+successType*15),sq_GetYPos(obj) + i,0 + i,ENUM_DRAWLAYER_BOTTOM); + local pAni = effectObj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(1.0+successType*0.2, 1.0+successType*0.2); + } + break; + } +} + +function onEndState_TransformFlapper_bykk(obj, new_state) +{ + if(!obj) return; +} + +function onAttack_TransformFlapper_bykk(obj, damager, boundingBox, isStuck) +{ + if(!obj) return; + local skill_level = sq_GetSkillLevel(obj,SKILL_BYKK_TRANSFORMFLAPPER); + local prob = sq_GetLevelData(obj,SKILL_BYKK_TRANSFORMFLAPPER,1,skill_level); + local level = sq_GetLevelData(obj,SKILL_BYKK_TRANSFORMFLAPPER,2,skill_level); + local time = sq_GetLevelData(obj,SKILL_BYKK_TRANSFORMFLAPPER,3,skill_level); + if(damager.isObjectType(OBJECTTYPE_ACTIVE)){ + sq_sendSetActiveStatusPacket(damager, obj, ACTIVESTATUS_BLIND, prob.tofloat(), level, false, time); + } +} + +function onAfterAttack_TransformFlapper_bykk(obj,damager,boundingBox,isStuck) +{ + if(!obj) return 0; + if(damager.isObjectType(OBJECTTYPE_ACTIVE)){ + local activeObj = sq_GetCNRDObjectToActiveObject(damager); + if(activeObj.getHp() <= 0){ + print("DEAD"); + print("X = "+sq_GetXPos(activeObj)+"&& Y = "+sq_GetYPos(activeObj)); + } + } + return 1; +} + +function checkExecutableSkill_TransformFlapperEx_bykk(obj) +{ + //print("TransformFlapperEx > true"); + return 0; +} + +function onSetState_TransformFlapperEx_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + obj.sq_SetCurrentAnimation(61); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + local successType = getSuccessType_bykk(obj,SKILL_BYKK_TRANSFORMFLAPPEREX); + if(successType == 2 && sq_GetSkillLevel(obj, SKILL_BYKK_LAPISPHILOSOPHORUM) > 0 && sq_getRandom(0,99) >= 49) successType = 3; + obj.getVar("transformflapper").clear_vector(); + obj.getVar("transformflapper").push_vector(successType); + switch(successType){ + case 0: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/fail_n.ani",75,0,75); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/fail_d.ani",75,-1,74); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/cloud.ani",75,-2,73); + break; + case 1: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/success_n.ani",75,0,75); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/success_d.ani",75,-1,74); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/cloud.ani",75,-2,73); + break; + case 2: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/great_n.ani",75,0,75); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/great_d.ani",75,-1,74); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/cloud.ani",75,-2,73); + break; + case 3: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/bigsuccess_familier01.ani",75,0,75); + break; + } + local currentAni = obj.getCurrentAnimation(); + sq_ClearAttackBox(currentAni); + local delayTime = currentAni.getDelaySum(false); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_TRANSFORMFLAPPEREX, SKILL_BYKK_TRANSFORMFLAPPEREX, 0, 1.0) + 100; + local transformflapper_skill = sq_GetSkill(obj,SKILL_BYKK_TRANSFORMFLAPPER); + local sizeRate = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_TRANSFORMFLAPPEREX, SKILL_BYKK_TRANSFORMFLAPPEREX, 8, 1.0) + 100; + local isSeal = 1; + if(transformflapper_skill.isSealFunction()) isSeal = 0; + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_TRANSFORMFLAPPEREX,1,delayTime,0,0,0,0,0,0,0,0); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_TRANSFORMFLAPPEREX,3,delayTime,totalDamage,successType,isSeal,sizeRate,0,0,0,2); + if(sq_GetIntData(obj, SKILL_BYKK_TRANSFORMFLAPPEREX, 3) > 0) obj.setTimeEvent(2,currentAni.getDelaySum(0,9),1,false); + else obj.setTimeEvent(1,currentAni.getDelaySum(0,7),1,false); + break; + case 1: + obj.sq_ZStop(); + obj.sq_SetCurrentAnimation(62); + local successType = getSuccessType_bykk(obj,SKILL_BYKK_TRANSFORMFLAPPER); + local currentAni = obj.getCurrentAnimation(); + local delayTime = currentAni.getDelaySum(false); + sq_ClearAttackBox(currentAni); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_TRANSFORMFLAPPEREX, SKILL_BYKK_TRANSFORMFLAPPEREX, 0, 1.0) + 100; + local transformflapper_skill = sq_GetSkill(obj,SKILL_BYKK_TRANSFORMFLAPPER); + local sizeRate = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_TRANSFORMFLAPPEREX, SKILL_BYKK_TRANSFORMFLAPPEREX, 8, 1.0) + 100; + local isSeal = 1; + if(transformflapper_skill.isSealFunction()) isSeal = 0; + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_TRANSFORMFLAPPEREX,2,delayTime,0,0,0,0,0,0,0,0); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,0,0,0,obj.getDirection(),SKILL_BYKK_TRANSFORMFLAPPEREX,4,delayTime,totalDamage,successType,isSeal,sizeRate,0,0,0,2); + if(sq_GetIntData(obj, SKILL_BYKK_TRANSFORMFLAPPEREX, 3) > 0) obj.setTimeEvent(2,currentAni.getDelaySum(0,2),1,false); + break; + } + + local skllevel2 = sq_GetSkillLevel(obj, SKILL_BYKK_SUCCESSPREMONITION); + local nextskillprob = sq_GetLevelData(obj,SKILL_BYKK_SUCCESSPREMONITION, 0, skllevel2); + if(skllevel2 > 0){ + if(sq_getRandom(0,99) > (1000 - nextskillprob) / 10){ + obj.getVar("successpremonition").setBool(0,true); + } + } +} + +function onEndCurrentAni_TransformFlapperEx_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + // obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + // break; + case 1: + local successType = obj.getVar("transformflapper").get_vector(0); + switch(successType){ + case 0: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/finish_fail_d.ani",75,0,10); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/finish_fail_n.ani",75,-1,9); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/cloud.ani",75,-2,8); + break; + case 1: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/finish_success_d.ani",75,0,10); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/finish_success_n.ani",75,-1,9); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/cloud.ani",75,-2,8); + break; + case 2: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/finish_great_d.ani",75,0,10); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/finish_great_n.ani",75,-1,9); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/cloud.ani",75,-2,8); + break; + case 3: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/finish_great_d.ani",75,0,10); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/finish_great_n.ani",75,-1,9); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/witch_bykk/transformflapper/cloud.ani",75,-2,8); + break; + } + if(obj.getVar("transBoolex").getBool(0)){ + obj.getVar("transBoolex").setBool(0, false); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(SKILL_BYKK_TRANSFORMFLAPPEREX, STATE_PRIORITY_USER, true); + } + else{ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_IntVectPush(0); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(STATE_JUMP, STATE_PRIORITY_USER, true); + } + break; + } +} + +function onProcCon_TransformFlapperEx_bykk(obj) +{ + if(!obj) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + local pAni = obj.getCurrentAnimation();//得到ani + local currentT = sq_GetCurrentTime(pAni);//当前时间 + local fireT = pAni.getDelaySum(0, 5);//总时间 + local vz = sq_GetUniformVelocity(0, 20, currentT, fireT); + sq_setCurrentAxisPos(obj, 2, vz);//设置当前z坐标 + break; + } +} + +function onKeyFrameFlag_TransformFlapperEx_bykk(obj, flagIndex) +{ + if(!obj) return false; +} + +function onTimeEvent_TransformFlapperEx_bykk(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + switch(timeEventIndex){ + case 0: + break; + case 1: + local successType = obj.getVar("transformflapper").get_vector(0); + local aniPath1 = "character/mage/effect/animation/witch_bykk/transformflapperex/land/"; + local aniPath2 = ["flyflapex_land_ground_crack.ani","flyflapex_land_front.ani"]; + for(local i = 0; i < 2; i++){ + local effectObj = createOnlyDrawObject_witch_bykk(obj,aniPath1 + aniPath2[i],true,obj.getDirection(),sq_GetDistancePos(sq_GetXPos(obj),obj.getDirection(),150+successType*15),sq_GetYPos(obj) + i,0 + i,ENUM_DRAWLAYER_BOTTOM); + local pAni = effectObj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(1.0+successType*0.1, 1.0+successType*0.1); + } + break; + case 2: + local totalDamage = (obj.sq_GetBonusRateWithPassive(SKILL_BYKK_TRANSFORMFLAPPEREX, SKILL_BYKK_TRANSFORMFLAPPEREX, 0, 1.0) + 100) * 33 / 100; + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,150,0,0,obj.getDirection(),SKILL_BYKK_TRANSFORMFLAPPEREX,5,0,0,0,0,0,0,0,0,0); + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,150,0,0,obj.getDirection(),SKILL_BYKK_TRANSFORMFLAPPEREX,7,totalDamage,0,0,0,0,0,0,0,0); + break; + } +} + +function onEndState_TransformFlapperEx_bykk(obj, new_state) +{ + if(!obj) return; +} + + + +function checkExecutableSkill_Uroboros_bykk(obj) +{ + if (!obj) return false; + local b_useskill = obj.sq_IsUseSkill(SKILL_BYKK_UROBOROS); + if(b_useskill){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(SKILL_BYKK_UROBOROS, STATE_PRIORITY_USER, true); + return 1; + } + return 0; +} + +function onSetState_Uroboros_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + local timer = obj.getVar("uroboros").get_ct_vector(0); + if(timer) obj.getVar("uroboros").clear_ct_vector(); + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_UROBOROSSTART); + local attackInfo = sq_GetCustomAttackInfo(obj, 50); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_UROBOROS, SKILL_BYKK_UROBOROS, 0, 1.0) + 100; + sq_SetCurrentAttackInfo(obj, attackInfo); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.getVar("uroboros_move").clear_vector(); + obj.getVar("uroboros_move").push_vector(sq_GetXPos(obj)); + obj.sq_PlaySound("WZ_UROBOROS"); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + break; + case 1: + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_UROBOROSREADY); + obj.sq_PlaySound("WZ_UROBOROS_RIDE"); + local hitTime = sq_GetIntData(obj, SKILL_BYKK_UROBOROS, 3) * (100 - UROBOROS_TIAOZHENG4) / 100; + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_UROBOROS, SKILL_BYKK_UROBOROS, 1, 1.0) + 100; + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,0,1,185,obj.getDirection(),SKILL_BYKK_UROBOROS,2,totalDamage,hitTime,0,0,0,0,0,0,0); + obj.setTimeEvent(2,20,-1,true); + obj.setTimeEvent(3,2000,-1,true); + obj.setTimeEvent(4,700,-1,true); + local appendage = sq_AttractToMe(obj, 600, 100, 1200); + obj.getVar("uroborosSet").setAppendage(0,appendage); + obj.getVar("uroborosTar").clear_obj_vector(); + break; + case 2: + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_UROBOROSIDLE); + if(obj.getVar("uroboros").getBool(0)){ + obj.getVar("uroboros").setBool(0, false); + local attackInfo = sq_GetCustomAttackInfo(obj, 51); + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_UROBOROS, SKILL_BYKK_UROBOROS, 0, 1.0) + 100; + local bonusRate = 1; + local homunculus_level = sq_GetSkillLevel(obj, SKILL_BYKK_HOMUNCULUS); + if(homunculus_level > 0){ + local bonusrate2 = sq_GetLevelData(obj, SKILL_BYKK_HOMUNCULUS, 6, homunculus_level); + bonusRate = bonusRate + bonusrate2.tofloat() / 1000; + } + totalDamage = (totalDamage.tofloat() * bonusRate).tointeger(); + sq_SetCurrentAttackInfo(obj, attackInfo); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + if(!obj.isExistTimeEvent(1)) obj.setTimeEvent(1,100,-1,false); + if(!obj.isExistTimeEvent(2)) obj.setTimeEvent(2,20,-1,true); + if(!obj.isExistTimeEvent(3)) obj.setTimeEvent(3,2000,-1,true); + if(!obj.isExistTimeEvent(4)) obj.setTimeEvent(4,700,-1,true); + } + break; + case 3: + obj.sq_SetCurrentAnimation(ANIMATION_BYKK_UROBOROSENERGETIC); + local currentAni = obj.getCurrentAnimation(); + currentAni.setSpeedRate(150.0); + local skllevel2 = sq_GetSkillLevel(obj, SKILL_BYKK_SUCCESSPREMONITION); + local nextskillprob = sq_GetLevelData(obj,SKILL_BYKK_SUCCESSPREMONITION, 0, skllevel2); + if(skllevel2 > 0){ + if(sq_getRandom(0,99) > (1000 - nextskillprob) / 10){ + obj.getVar("successpremonition").setBool(0,true); + } + } + break; + case 100: + obj.sq_SetCurrentAnimation(205); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 1)); + + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) obj.getVar("element_kk").setInt(0, 100); + else obj.getVar("element_kk").setInt(0, 0); + if(attackInfo.isValidElement(ENUM_ELEMENT_WATER)) obj.getVar("element_kk").setInt(1, 100); + else obj.getVar("element_kk").setInt(1, 0); + if(attackInfo.isValidElement(ENUM_ELEMENT_DARK)) obj.getVar("element_kk").setInt(2, 100); + else obj.getVar("element_kk").setInt(2, 0); + if(attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) obj.getVar("element_kk").setInt(3, 100); + else obj.getVar("element_kk").setInt(3, 0); + break; + } + +} + +function onEndCurrentAni_Uroboros_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + case 1: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(substate + 1); + obj.sq_AddSetStatePacket(SKILL_BYKK_UROBOROS, STATE_PRIORITY_USER, true); + if(substate == 0){ + obj.getVar("uroboros").clear_ct_vector(); + obj.getVar("uroboros").push_ct_vector(); + local timer = obj.getVar("uroboros").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); + obj.getVar("uroboros").setBool(0, true); + } + else if(substate == 1) obj.setTimeEvent(1,100,1,false); + break; + case 100: + obj.sq_IntVectClear(); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, true); + break; + } +} + +function onProcCon_Uroboros_bykk(obj) +{ + if(!obj) return; + //加快 + sq_SetKeyxEnable(obj, E_ATTACK_COMMAND, true); + if(sq_IsEnterCommand(obj, E_ATTACK_COMMAND)) obj.addRapidInput(); + + local timer = obj.getVar("uroboros").get_ct_vector(0); + if(timer){ + local lifeTime = sq_GetIntData(obj, SKILL_BYKK_UROBOROS, 0) + UROBOROS_TIAOZHENG3; + local currentT = timer.Get(); + if(currentT >= lifeTime){ + obj.stopSound(4399); + local attackObj = obj.getVar("uroboros").get_obj_vector(0); + if(attackObj){attackObj = sq_GetCNRDObjectToCollisionObject(attackObj);attackObj.setValid(false);} + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_UROBOROS, SKILL_BYKK_UROBOROS, 3, 1.0) + 100; + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,0,1,0,obj.getDirection(),SKILL_BYKK_UROBOROS,1,totalDamage,0,0,0,0,0,0,0,1); + obj.getVar("uroboros").setBool(0, false); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + return; + } + } + + + local substate = obj.getSkillSubState(); + switch(substate){ + case 2: + case 3: + if(sq_GetSkillLevel(obj, SKILL_BYKK_EMERGENCYESCAPE) > 0){ + sq_SetKeyxEnable(obj, E_JUMP_COMMAND, true); + if(sq_IsEnterCommand(obj, E_JUMP_COMMAND)){ + obj.stopSound(4399); + local attackObj = obj.getVar("uroboros").get_obj_vector(0); + if(attackObj){attackObj = sq_GetCNRDObjectToCollisionObject(attackObj);attackObj.setValid(false);} + local totalDamage = obj.sq_GetBonusRateWithPassive(SKILL_BYKK_UROBOROS, SKILL_BYKK_UROBOROS, 3, 1.0) + 100; + cearteSkillPassive_Witch_bykk(obj,obj,PASSIVEOBJECT_BYKK_WITCH,0,1,0,obj.getDirection(),SKILL_BYKK_UROBOROS,1,totalDamage,0,0,0,0,0,0,0,1); + obj.getVar("uroboros").setBool(0, false); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + return; + } + } + break; + } +} + +function onKeyFrameFlag_Uroboros_bykk(obj, flagIndex) +{ + if(!obj) return false; +} + +function onTimeEvent_Uroboros_bykk(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return false; + switch(timeEventIndex){ + case 0: + break; + case 1: + local inputConut = obj.getRapidInputFrequency(); + inputConut = inputConut.tointeger(); + + local inputMax = 2; + local gapByInputMin = sq_GetIntData(obj,SKILL_BYKK_UROBOROS,4) * UROBOROS_TIAOZHENG1 / 100; + local gapByInputMax = sq_GetIntData(obj,SKILL_BYKK_UROBOROS,2) * UROBOROS_TIAOZHENG2 / 100; + + if(inputConut >= inputMax){ + obj.setTimeEvent(1, gapByInputMin, 1,false); + if(obj.getSkillSubState() != 3){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(3); + obj.sq_AddSetStatePacket(SKILL_BYKK_UROBOROS, STATE_PRIORITY_USER, true); + } + } + else{ + obj.setTimeEvent(1, gapByInputMax, 1,false); + if(obj.getSkillSubState() != 2){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(SKILL_BYKK_UROBOROS, STATE_PRIORITY_USER, true); + } + } + + obj.resetHitObjectList(); + break; + case 2: + if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_LEFT, ENUM_SUBKEY_TYPE_ALL)){ + if(obj.isMovablePos(obj.getXPos() - 5,obj.getYPos())) sq_setCurrentAxisPos(obj, 0, obj.getXPos() - 5); + } + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_RIGHT, ENUM_SUBKEY_TYPE_ALL)){ + if(obj.isMovablePos(obj.getXPos() + 5,obj.getYPos())) sq_setCurrentAxisPos(obj, 0, obj.getXPos() + 5); + } + if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_UP, ENUM_SUBKEY_TYPE_ALL)){ + if(obj.isMovablePos(obj.getXPos(),obj.getYPos() - 3)) sq_setCurrentAxisPos(obj, 1, obj.getYPos() - 3); + obj.getVar("uroboros").setBool(0, true); + } + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_DOWN, ENUM_SUBKEY_TYPE_ALL)){ + if(obj.isMovablePos(obj.getXPos(),obj.getYPos() + 3)) sq_setCurrentAxisPos(obj, 1, obj.getYPos() + 3); + obj.getVar("uroboros").setBool(0, true); + } + break; + case 3: + obj.stopSound(4399); + obj.sq_PlaySound("UROBOROS_ROTATE_LOOP",4399); + break; + case 4: + local save_posX = obj.getVar("uroboros_move").get_vector(0); + local base_X = sq_GetXPos(obj); + local aniPath = ["character/mage/effect/animation/witch_bykk/uroboros/move/movedust_01.ani", "character/mage/effect/animation/witch_bykk/uroboros/move/movedustbig_01.ani"]; + if(base_X != save_posX){ + if(base_X > save_posX) createOnlyDrawObject_witch_bykk(obj,aniPath[sq_getRandom(0,1)],true,ENUM_DIRECTION_RIGHT,sq_GetDistancePos(sq_GetXPos(obj),obj.getDirection(),-80),sq_GetYPos(obj),sq_GetZPos(obj),ENUM_DRAWLAYER_NORMAL); + else createOnlyDrawObject_witch_bykk(obj,aniPath[sq_getRandom(0,1)],true,ENUM_DIRECTION_LEFT,sq_GetDistancePos(sq_GetXPos(obj),obj.getDirection(), 80),sq_GetYPos(obj),sq_GetZPos(obj),ENUM_DRAWLAYER_NORMAL); + obj.getVar("uroboros_move").set_vector(0, sq_GetXPos(obj)); + } + break; + } +} + +function onEndState_Uroboros_bykk(obj, new_state) +{ + if(!obj) return; + if(new_state != SKILL_BYKK_UROBOROS){ + local appendage = obj.getVar("uroborosSet").getAppendage(0); + if(appendage) appendage.setValid(false); + local size = obj.getVar("uroborosTar").get_obj_vector_size(); + if(size > 0){ + for(local i = 0; i < size; i++){ + local targetObj = obj.getVar("uroborosTar").get_obj_vector(i); + if(targetObj) CNSquirrelAppendage.sq_RemoveAppendage(targetObj, "appendage/character/ap_common_hold.nut"); + } + } + } +} + + +function procSkill_Witch(obj) +{ + procSkill_Witch_bykk(obj); +} + +/////////////////////////witch_end + + + + diff --git a/user/116.205.165.25/config b/user/116.205.165.25/config new file mode 100644 index 0000000..0b84726 --- /dev/null +++ b/user/116.205.165.25/config @@ -0,0 +1,2 @@ +test1.nut +test2.nut \ No newline at end of file diff --git a/user/116.205.165.25/test1.nut b/user/116.205.165.25/test1.nut new file mode 100644 index 0000000..b0ae7a4 --- /dev/null +++ b/user/116.205.165.25/test1.nut @@ -0,0 +1,3009 @@ + + +/////////////////////////elementalmaster////////////////////// + + +function setState_elementalmaster_bykk(obj, state, datas, isResetTimer) +{ + if(state == 17 && sq_GetVectorData(datas, 0) == 29){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_ELEMENTALCHAIN, STATE_PRIORITY_IGNORE_FORCE, true); + } + else if(state == 17 && sq_GetVectorData(datas, 0) == 2){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ASSIMILATE, STATE_PRIORITY_IGNORE_FORCE, true); + } +} + +function onAfterSetState_Throw_elementalmaster_bykk(obj, state, datas, isResetTimer) +{ + local ThrowIndex = obj.getThrowIndex(); + local throwState = obj.getThrowState(); + + local Mightyrune_T = + {//light,ice,fire,dark + [15] = [0,0,1,0], + [16] = [0,1,0,0], + [18] = [0,0,0,1], + [17] = [1,0,0,0], + [57] = [0,0,1,0], + [56] = [0,1,0,0], + [26] = [0,0,0,1], + [31] = [1,0,0,0], + [27] = [0,0,1,0], + [59] = [0,1,0,0], + [55] = [1,0,0,0], + [58] = [0,0,0,1] + } + + if(throwState == 0 && Mightyrune_T.rawin(ThrowIndex)){ + switch(ThrowIndex){ + case 15: + case 26: + case 58: + case 59: + case 27: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(10); + obj.sq_IntVectPush(ThrowIndex); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_ELEMENTALCHAIN, STATE_PRIORITY_IGNORE_FORCE, true); + break; + case 16: + case 31: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(20); + obj.sq_IntVectPush(ThrowIndex); + obj.sq_IntVectPush(3); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_ELEMENTALCHAIN, STATE_PRIORITY_IGNORE_FORCE, true); + break; + case 17: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(30); + obj.sq_IntVectPush(ThrowIndex); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_ELEMENTALCHAIN, STATE_PRIORITY_IGNORE_FORCE, true); + break; + case 18: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(40); + obj.sq_IntVectPush(ThrowIndex); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_ELEMENTALCHAIN, STATE_PRIORITY_IGNORE_FORCE, true); + break; + case 57: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_FLAMESTRIKE, STATE_PRIORITY_IGNORE_FORCE, true); + break; + case 55: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_THUNDERCALLING, STATE_PRIORITY_IGNORE_FORCE, true); + break; + } + return; + } + + if(throwState == 1 && Mightyrune_T.rawin(ThrowIndex)){ + sq_BinaryStartWrite(); + foreach(elsement in Mightyrune_T[ThrowIndex]){ + sq_BinaryWriteDword(elsement); + } + sq_SendChangeSkillEffectPacket(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN); + if(ThrowIndex == 56){ + elementalmaster_setelementSkillBonusRate(obj, 56); + } + else if(ThrowIndex == 74){ + elementalmaster_setelementSkillBonusRate(obj, 74); + } + } +} + +function onEndCurrentAni_Mage_Throw_elementalmaster(obj) +{ +} + +function reset_elementalmaster_bykk(obj) +{ + local addAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"appendage/character/ap_common_suck.nut"); + if(!addAppendage) return; + CNSquirrelAppendage.sq_RemoveAppendage(obj, "appendage/character/ap_common_suck.nut"); + local size = obj.getVar("blackhole").get_obj_vector_size(); + if(size > 0){ + for(local i = 0; i < size; i++){ + local bhObj = obj.getVar("blackhole").get_obj_vector(i); + if(bhObj) bhObj.setValid(false); + } + } + obj.getVar("blackhole").clear_obj_vector(); +} + +function onChangeSkillEffect_Mage_elementalmaster(obj, skillIndex, reciveData) +{ + switch(skillIndex){ + case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN: + local addAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut"); + if(!addAppendage) return; + local pushstate = 22; + if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_MIGHTYRUNE) > 0) pushstate = 25; + local assimilate_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ASSIMILATE); + local buff1 = reciveData.readDword(); + local buff2 = reciveData.readDword(); + local buff3 = reciveData.readDword(); + local buff4 = reciveData.readDword(); + local buffnum = []; + local buffname = ["","light","ice","fire","dark"]; + if(buff1 > 0) buffnum.push(1); + if(buff2 > 0) buffnum.push(2); + if(buff3 > 0) buffnum.push(3); + if(buff4 > 0) buffnum.push(4); + for(local i = 0; i < buffnum.len(); i++){ + local anum = buffnum[i]; + addAppendage.getVar().setBool(anum, true); + local effectObj = obj.getVar("elementalchain_"+buffname[anum]).get_obj_vector(0); + if(effectObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(effectObj); + if(assimilate_level > 0){ + local pooledObj = createOnlyDrawObject_elementalmaster_bykk(obj,"character/mage/effect/animation/elementalmaster_bykk/mightyrune/lv95assimilate/"+buffname[anum]+"activate_00.ani",true,colObj.getDirection(),sq_GetXPos(colObj),sq_GetYPos(colObj) + 1,sq_GetZPos(colObj) + 1,ENUM_DRAWLAYER_NORMAL); + sq_moveWithParent(colObj, pooledObj); + } + else colObj.addSetStatePacket(pushstate, null, STATE_PRIORITY_AUTO, false, ""); + } + } + setElementalChainBuff_bykk(obj,skillIndex,addAppendage); + break; + } +} + +function onStartDungeon_Elementalmaster_bykk(obj) +{ + local loadSlot = obj.sq_GetSkillLoad(ELEMENTALMASTER_SKILL_ELEMENTMASTERY); + if(loadSlot) obj.sq_RemoveSkillLoad(ELEMENTALMASTER_SKILL_ELEMENTMASTERY); + local addAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut"); + if(!addAppendage) return; + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut"); + local addAppendage2 = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_moveoncast.nut"); + if(!addAppendage2) return; + addAppendage2.getVar().setBool(0, false); +} + +function setElementalChainBuff_bykk(obj,skillIndex,addAppendage) +{ + return; + // local skillLevel = sq_GetSkillLevel(obj, skillIndex); + // local buff_num = []; + // if(addAppendage.getVar().getBool(1)) buff_num.push(1); + // if(addAppendage.getVar().getBool(2)) buff_num.push(1); + // if(addAppendage.getVar().getBool(3)) buff_num.push(1); + // if(addAppendage.getVar().getBool(4)) buff_num.push(1); + // local value1 = 0; + // switch(buff_num.len()){ + // case 1: value1 = sq_GetLevelData(obj, skillIndex, 6, skillLevel); break; + // case 2: value1 = sq_GetLevelData(obj, skillIndex, 7, skillLevel); break; + // case 3: value1 = sq_GetLevelData(obj, skillIndex, 8, skillLevel); break; + // case 4: value1 = sq_GetLevelData(obj, skillIndex, 9, skillLevel); break; + // } + // local change_appendage = addAppendage.sq_getChangeStatus("elementalchain"); + // if(!change_appendage) change_appendage = addAppendage.sq_AddChangeStatus("elementalchain",obj, obj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK,true, value1); + // if(change_appendage){ + // change_appendage.clearParameter(); + // if(value1 > 0){ + // change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_MAGICAL_ATTACK, true, (value1 * 0.01).tofloat()); + // change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_PHYSICAL_ATTACK, true, (value1 * 0.01).tofloat()); + // } + // } +} + +function onStart_appendage_elementmastery_bykk(appendage) +{ + local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent()); + if(!parentObj || parentObj.getState() == STATE_DIE){appendage.setValid(false);return;} + + local skillLevel = parentObj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_ELEMENTMASTERY); + local value1 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTMASTERY, 4, skillLevel); + local value2 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTMASTERY, 5, skillLevel); + local mightyrune_level = parentObj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_MIGHTYRUNE); + if(mightyrune_level > 0){ + local add_Rate = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_MIGHTYRUNE, 3, mightyrune_level); + value1 = value1 * (1000 + add_Rate) / 1000; + } + local change_appendage = appendage.sq_getChangeStatus("elementmastery"); + if(!change_appendage) change_appendage = appendage.sq_AddChangeStatus("elementmastery",parentObj, parentObj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK, true, value1); + if(change_appendage){ + change_appendage.clearParameter(); + //change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_MAGICAL_ATTACK, true, (value1 * 0.1).tofloat()); + //change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_PHYSICAL_ATTACK, true, (value1 * 0.1).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_ELEMENT_TOLERANCE_ALL, false, (value2).tofloat()); + } +} + +function onStart_appendage_assimilate_bykk(appendage) +{ + local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent()); + if(!parentObj || parentObj.getState() == STATE_DIE){appendage.setValid(false);return;} + + // local skillLevel = parentObj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_ASSIMILATE); + // local value1 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ASSIMILATE, 0, skillLevel); + // local change_appendage = appendage.sq_getChangeStatus("assimilate"); + // if(!change_appendage) change_appendage = appendage.sq_AddChangeStatus("assimilate",parentObj, parentObj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK, true, value1); + // if(change_appendage){ + // change_appendage.clearParameter(); + // change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_MAGICAL_ATTACK, true, (value1 * 0.1).tofloat()); + // change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_PHYSICAL_ATTACK, true, (value1 * 0.1).tofloat()); + // } +} + +function onStart_appendage_elementalpotential_bykk(appendage) +{ + local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent()); + if(!parentObj || parentObj.getState() == STATE_DIE){appendage.setValid(false);return;} + + local skillLevel = parentObj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL); + local value1 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 7, skillLevel); + local change_appendage = appendage.sq_getChangeStatus("elementalpotential"); + if(!change_appendage) change_appendage = appendage.sq_AddChangeStatus("elementalpotential",parentObj, parentObj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK, true, value1); + if(change_appendage){ + change_appendage.clearParameter(); + change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_MAGICAL_ATTACK, true, (value1 * 0.1).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_PHYSICAL_ATTACK, true, (value1 * 0.1).tofloat()); + } +} + +function onStart_appendage_elementalweak_bykk(appendage) +{ + local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent()); + if(!parentObj || parentObj.getState() == STATE_DIE){appendage.setValid(false);return;} + + local skillLevel = parentObj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_ELEMENTALWEAK); + local value1 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTALWEAK, 5, skillLevel); + local value2 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTALWEAK, 6, skillLevel); + local mightyrune_level = parentObj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_MIGHTYRUNE); + if(mightyrune_level > 0){ + local add_Rate = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_MIGHTYRUNE, 2, mightyrune_level); + value2 = value2 * (1000 + add_Rate) / 1000; + } + local change_appendage = appendage.sq_getChangeStatus("elementalweak"); + if(!change_appendage) change_appendage = appendage.sq_AddChangeStatus("elementalweak",parentObj, parentObj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK, true, value1); + if(change_appendage){ + change_appendage.clearParameter(); + change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_MAGICAL_ATTACK, true, (value1 * 0.1).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_PHYSICAL_ATTACK, true, (value1 * 0.1).tofloat()); + change_appendage.addParameter(CHANGE_STATUS_TYPE_MAGICAL_CRITICAL_HIT_RATE, false, (value2 * 0.1).tofloat()); + } +} + +function onAttackParent_appendage_elementalweak(appendage, realAttacker, damager, boundingBox, isStuck) +{ + if(!appendage) return; + return; + if(isStuck) return; + local parentObj = appendage.getParent(); + local obj = sq_GetCNRDObjectToSQRCharacter(parentObj); + if(!obj || obj.getState() == STATE_DIE) return; + if(!damager.isObjectType(OBJECTTYPE_ACTIVE)) return; + local activeObj = sq_GetCNRDObjectToActiveObject(damager); + local maxLoad = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALWEAK, 0); + local skillLevel = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALWEAK); + local decrease = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALWEAK, 0, skillLevel); + local time = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALWEAK, 2, skillLevel); + local attackInfo = sq_GetCurrentAttackInfo(realAttacker); + local element = [ENUM_ELEMENT_FIRE,ENUM_ELEMENT_WATER,ENUM_ELEMENT_DARK,ENUM_ELEMENT_LIGHT]; + local element2 = ["attack_fire","attack_ice","attack_dark","attack_light"]; + for(local i = 0; i < 4; i++){ + if(attackInfo.isValidElement(element[i])){ + local addAppendage = CNSquirrelAppendage.sq_GetAppendage(activeObj, ELEMENTALWEAKDEBUFF_APDPATH); + if(!addAppendage){ + addAppendage = CNSquirrelAppendage.sq_AppendAppendage(activeObj, obj, -1, false, ELEMENTALWEAKDEBUFF_APDPATH, true); + addAppendage.getVar("custom").setInt(10, maxLoad); + addAppendage.getVar("custom").setInt(11, decrease); + addAppendage.getVar("custom").setInt(12, time); + } + for(local ui = 10; ui < 10 + maxLoad; ui++){ + if(addAppendage.getVar(element2[i]).getBool(ui) == false){ + addAppendage.getVar(element2[i]).setBool(ui, true); + } + } + } + } +} + +function proc_appendage_elementalweakdebuff(appendage) +{ + if(!appendage) return; + local targetObj = appendage.getParent(); + local sqrChr = appendage.getSource(); + targetObj = sq_GetCNRDObjectToActiveObject(targetObj); + sqrChr = sq_GetCNRDObjectToSQRCharacter(sqrChr); + if(!targetObj || targetObj.getState() == STATE_DIE){ + appendage.setValid(false); + return; + } + + local maxLoad = appendage.getVar("custom").getInt(10); + local decrease = appendage.getVar("custom").getInt(11); + local time = appendage.getVar("custom").getInt(12); + + local element = ["attack_fire","attack_ice","attack_dark","attack_light"]; + for(local i = 0; i < element.len(); i++){ + local timer = appendage.getVar(element[i]).get_ct_vector(0); + if(!timer){ + appendage.getVar(element[i]).clear_ct_vector(); + appendage.getVar(element[i]).push_ct_vector(); + timer = appendage.getVar(element[i]).get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); + } + local currentT = timer.Get(); + if(currentT >= time){ + for(local oi = 0; oi < maxLoad; oi++){ + appendage.getVar(element[i]).setBool(10 + oi, false); + appendage.getVar(element[i]).setBool(20 + oi, false); + } + timer.Reset(); + timer.Start(10000,0); + } + for(local ui = 0; ui < maxLoad; ui++){ + if(appendage.getVar(element[i]).getBool(10 + ui) && appendage.getVar(element[i]).getBool(20 + ui) == false){ + appendage.getVar(element[i]).setBool(20 + ui, true); + local ap = sq_CreateChangeStatus(20 + i, false, -decrease.tofloat() , 0); + if (ap){ + ap.getAppendageInfo().setValidTime(time); + ap.sq_Append(targetObj, sqrChr); + } + } + } + } + + +} + +function useSkill_before_Mage_elementalmaster_bykk(obj, skillIndex, consumeMp, consumeItem, oldSkillMpRate) +{ + //printp(" consumpMp:" + consumeMp + " oldSkillMpRate:" + oldSkillMpRate); + local skillLevel = obj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_ELEMENTMASTERY); + if(skillLevel > 0){ + local mpComsumeRate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTMASTERY, 3, skillLevel); + if(oldSkillMpRate != 1.0) oldSkillMpRate = 1.0; + local newMpRate = oldSkillMpRate.tofloat() * (100 - mpComsumeRate.tofloat()) / 100; + // print(" newMpRate:" + newMpRate); + obj.setSkillMpRate(skillIndex, newMpRate.tofloat()); + } + //print(" now consumpMp:" + obj.getSkillMpRate(skillIndex)); + return true; +} + +function cearteSkillPassive_Elementalmaster_bykk(obj,passiveObj,objnum,x,y,z,direction,skillIndex,subtype,pushv1,pushv2,pushv3,pushv4,pushv5,pushv6,pushv7,pushv8,bonusnum,powernum) +{ + if(!obj || !passiveObj) return; + if(pushv1 == null) pushv1 = 0; + if(pushv2 == null) pushv2 = 0; + if(pushv3 == null) pushv3 = 0; + if(pushv4 == null) pushv4 = 0; + if(pushv5 == null) pushv5 = 0; + if(pushv6 == null) pushv6 = 0; + if(pushv7 == null) pushv7 = 0; + if(pushv8 == null) pushv8 = 0; + if(bonusnum > 0){ + local bonusRate = 1.0;//obj.getVar("witchs_bonusRate").get_vector(0).tofloat() / 1000.0; + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL); + if(skill_level > 0){ + local add_Rate = 0.0; + switch(skillIndex){ + case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN: add_Rate = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 7, skill_level); + case ELEMENTALMASTER_SKILL_FLAMESTRIKE: + case ELEMENTALMASTER_SKILL_VOID: + case ELEMENTALMASTER_SKILL_SUNBURST: + add_Rate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 8, skill_level); + break; + case ELEMENTALMASTER_SKILL_THUNDERCALLING: add_Rate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 12, skill_level); break; + case ELEMENTALMASTER_SKILL_ARCTICPISTE: add_Rate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 15, skill_level); break; + case ELEMENTALMASTER_SKILL_BLACKHOLE: add_Rate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 14, skill_level); break; + case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER: add_Rate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 13, skill_level); break; + case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND: + case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN: + case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE: + case ELEMENTALMASTER_SKILL_THEGATE: + case ELEMENTALMASTER_SKILL_SESTOELEMENTO: + case ELEMENTALMASTER_SKILL_THUNDERRAGE: + add_Rate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 16, skill_level); + break; + } + bonusRate += add_Rate.tofloat() / 1000.0; + } + switch (bonusnum) { + case 1: pushv1 = (pushv1.tofloat() * bonusRate).tointeger(); break; + case 2: pushv2 = (pushv2.tofloat() * bonusRate).tointeger(); break; + case 3: pushv3 = (pushv3.tofloat() * bonusRate).tointeger(); break; + case 4: pushv4 = (pushv4.tofloat() * bonusRate).tointeger(); break; + case 5: pushv5 = (pushv5.tofloat() * bonusRate).tointeger(); break; + case 6: pushv6 = (pushv6.tofloat() * bonusRate).tointeger(); break; + case 7: pushv7 = (pushv7.tofloat() * bonusRate).tointeger(); break; + case 8: pushv8 = (pushv8.tofloat() * bonusRate).tointeger(); break; + } + } + if(powernum > 0){ + local bonusRate = 1.0;//obj.getVar("witchs_bonusRate").get_vector(0).tofloat() / 1000.0; + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL); + if(skill_level > 0){ + local add_Rate = 0.0; + if(skillIndex == ELEMENTALMASTER_SKILL_ELEMENTALCHAIN) add_Rate = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 7, skill_level); + bonusRate += add_Rate.tofloat() / 1000.0; + } + switch (powernum) { + case 1: pushv1 = (pushv1.tofloat() * bonusRate).tointeger(); break; + case 2: pushv2 = (pushv2.tofloat() * bonusRate).tointeger(); break; + case 3: pushv3 = (pushv3.tofloat() * bonusRate).tointeger(); break; + case 4: pushv4 = (pushv4.tofloat() * bonusRate).tointeger(); break; + case 5: pushv5 = (pushv5.tofloat() * bonusRate).tointeger(); break; + case 6: pushv6 = (pushv6.tofloat() * bonusRate).tointeger(); break; + case 7: pushv7 = (pushv7.tofloat() * bonusRate).tointeger(); break; + case 8: pushv8 = (pushv8.tofloat() * bonusRate).tointeger(); break; + } + } + + local destX_01 = 0; + local destY_01 = 0; + if(!isSameObject(obj, passiveObj)){ + destX_01 = passiveObj.getXPos() - obj.getXPos(); + destY_01 = passiveObj.getYPos() - obj.getYPos(); + z = z - obj.getZPos(); + if(direction == ENUM_DIRECTION_LEFT) destX_01 = obj.getXPos() - passiveObj.getXPos(); + } + sq_BinaryStartWrite(); + 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); +} + +function createOnlyDrawObject_elementalmaster_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 onStart_appendage_elementalchain_bykk(appendage) +{ + local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent()); + + local skillLevel = sq_GetSkillLevel(parentObj,ELEMENTALMASTER_SKILL_ELEMENTALCHAIN); + local lightTime = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, 1, skillLevel); + + appendage.setAppendCauseSkill(BUFF_CAUSE_SKILL, ENUM_CHARACTERJOB_MAGE, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, skillLevel); + appendage.setEnableIsBuff(true); + appendage.setBuffIconImage(28); + + local value0 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, 6, skillLevel) + local value1 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, 7, skillLevel); + local value2 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, 8, skillLevel); + local value3 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, 9, skillLevel); + appendage.getVar("custom").setInt(0, value0); + appendage.getVar("custom").setInt(1, value1); + appendage.getVar("custom").setInt(2, value2); + appendage.getVar("custom").setInt(3, value3); + + appendage.getVar().setBool(1,false); + appendage.getVar().setBool(2,false); + appendage.getVar().setBool(3,false); + appendage.getVar().setBool(4,false); + + local offset_x = [35,35,-35,-35]; + local offset_y = [-20,20,20,-20]; + local offset_z = [23,30,30,30]; + local sub = 0; + local mightyrune_level = sq_GetSkillLevel(parentObj, ELEMENTALMASTER_SKILL_MIGHTYRUNE); + if(mightyrune_level > 0){ + sub = 1; + offset_z = [30,30,30,30]; + lightTime = lightTime * (1000 + sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_MIGHTYRUNE, 0, mightyrune_level)) / 1000; + } + local assimilate_level = sq_GetSkillLevel(parentObj, ELEMENTALMASTER_SKILL_ASSIMILATE); + if(assimilate_level > 0){ + sub = 2; + offset_z = [30,30,30,30]; + appendage.getVar().setBool(1,true); + appendage.getVar().setBool(2,true); + appendage.getVar().setBool(3,true); + appendage.getVar().setBool(4,true); + setElementalChainBuff_bykk(parentObj,ELEMENTALMASTER_SKILL_ELEMENTALCHAIN,appendage); + } + for(local i = 1; i < 5; i++){ + cearteSkillPassive_Elementalmaster_bykk(parentObj,parentObj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,offset_x[i-1],offset_y[i-1],offset_z[i-1],ENUM_DIRECTION_RIGHT,ELEMENTALMASTER_SKILL_ELEMENTALCHAIN,i,lightTime,sub,0,0,0,0,0,0,0,0); + } +} + +function onEnd_appendage_elementalchain_bykk(appendage) +{ + local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent()); + local name = ["elementalchain_light","elementalchain_ice","elementalchain_fire","elementalchain_dark"]; + for(local i = 0; i < name.len(); i++){ + local size = parentObj.getVar(name[i]).get_obj_vector_size(); + for(local ui = 0; ui < size; ui++){ + local effectObj = parentObj.getVar(name[i]).get_obj_vector(ui); + if(effectObj) effectObj.setValid(false); + } + } +} + +function onStart_appendage_magicaltempoup_bykk(appendage) +{ + local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent()); + + local skillLevel = sq_GetSkillLevel(parentObj,ELEMENTALMASTER_SKILL_MAGICALTEMPOUP); + appendage.setAppendCauseSkill(BUFF_CAUSE_SKILL, ENUM_CHARACTERJOB_MAGE, ELEMENTALMASTER_SKILL_MAGICALTEMPOUP, skillLevel); + appendage.setEnableIsBuff(true); + appendage.setBuffIconImage(34); + + local lifeTime = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_MAGICALTEMPOUP, 0, skillLevel); + local value1 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_MAGICALTEMPOUP, 1, skillLevel); + local value2 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_MAGICALTEMPOUP, 2, skillLevel); + local mightyrune_level = parentObj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_MIGHTYRUNE); + if(mightyrune_level > 0){ + appendage.getAppendageInfo().setValidTime(0); + local add_Rate = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_MIGHTYRUNE, 4, mightyrune_level); + value1 = value1 * (1000 + add_Rate) / 1000; + value2 = value2 * (1000 + add_Rate) / 1000; + } + else if((sq_getGrowType(parentObj) == 4 && sq_GetSkillLevel(parentObj, SKILL_BYKK_LAPISPHILOSOPHORUM) > 0) || (sq_getGrowType(parentObj) == 2 && parentObj.getVar("eclipsehive_select").getBool(0))){ + appendage.getAppendageInfo().setValidTime(0); + } + else appendage.getAppendageInfo().setValidTime(lifeTime); + + local change_appendage = appendage.sq_getChangeStatus("magicaltempoup"); + if(!change_appendage) change_appendage = appendage.sq_AddChangeStatus("magicaltempoup",parentObj, parentObj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK, true, value1); + if(change_appendage){ + change_appendage.clearParameter(); + change_appendage.addParameter(CHANGE_STATUS_TYPE_CAST_SPEED, false, (value2 * 1).tofloat()); + } +} + +function onStart_appendage_mightyrune_bykk(appendage) +{ + local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent()); + + local skillLevel = sq_GetSkillLevel(parentObj,ELEMENTALMASTER_SKILL_MIGHTYRUNE); + appendage.setAppendCauseSkill(BUFF_CAUSE_SKILL, ENUM_CHARACTERJOB_MAGE, ELEMENTALMASTER_SKILL_MIGHTYRUNE, skillLevel); +} + +function onStart_appendage_moveoncast_bykk(appendage) +{ + // +} + +function proc_appendage_moveoncast_bykk(appendage) +{ + if(!appendage) return; + local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent()); + + if(parentObj.getState() == 13 && parentObj.getThrowIndex() == 74){ + sq_SetKeyxEnable(parentObj, E_JUMP_COMMAND, true); + if(sq_IsEnterCommand(parentObj, E_JUMP_COMMAND)){ + parentObj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + } + } + + if(appendage.getVar().getBool(0)){ + for(local i = 1; i < 255; i++){ + parentObj.setSkillCommandEnable(i, false); + } + if(parentObj.getState() == 0 || parentObj.getState() == 14){ + local bDownKey = parentObj.isDownSkillLastKey(); + if(!bDownKey){ + appendage.getVar().setBool(0, false); + if(appendage.getVar().getInt(1) == ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN){ + parentObj.sq_IntVectClear(); + parentObj.sq_IntVectPush(1); + parentObj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, STATE_PRIORITY_USER, true); + return; + } + else if(appendage.getVar().getInt(1) == ELEMENTALMASTER_SKILL_ELEMENTALQUAKE){ + parentObj.sq_IntVectClear(); + parentObj.sq_IntVectPush(1); + parentObj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, STATE_PRIORITY_USER, true); + return; + } + else if(appendage.getVar().getInt(1) == ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND){ + parentObj.sq_IntVectClear(); + parentObj.sq_IntVectPush(1); + parentObj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND, STATE_PRIORITY_USER, true); + return; + } + else if(appendage.getVar().getInt(1) == ELEMENTALMASTER_SKILL_THUNDERRAGE){ + parentObj.sq_IntVectClear(); + parentObj.sq_IntVectPush(2); + parentObj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_THUNDERRAGE, STATE_PRIORITY_USER, true); + return; + } + else if(appendage.getVar().getInt(1) == ELEMENTALMASTER_SKILL_SESTOELEMENTO){ + parentObj.sq_IntVectClear(); + parentObj.sq_IntVectPush(0); + parentObj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_SESTOELEMENTO, STATE_PRIORITY_USER, true); + return; + } + parentObj.sq_IntVectClear(); + parentObj.sq_IntVectPush(appendage.getVar().getInt(3) + 1); + parentObj.sq_IntVectPush(appendage.getVar().getInt(1)); + parentObj.sq_IntVectPush(appendage.getVar().getInt(2)); + // print(appendage.getVar().getInt(3)+" && "+appendage.getVar().getInt(1)+" && "+appendage.getVar().getInt(2)); + parentObj.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_ELEMENTALCHAIN, STATE_PRIORITY_USER, true); + } + } + } +} + +function onEnd_appendage_moveoncast_bykk(appendage) +{ + // +} + +function monsterpulled_elementalmaster_bykk(obj,monsterobj,x,y,z,time,range) +{ + if(!obj.isMovablePos(sq_GetXPos(monsterobj), sq_GetYPos(monsterobj))) return; + local objectManager = obj.getObjectManager(); + local objectNumber = objectManager.getCollisionObjectNumber(); + for(local i = 0; i < objectNumber; i++){ + local targetObj = objectManager.getCollisionObject(i); + if(targetObj && targetObj.isObjectType(OBJECTTYPE_ACTIVE) && targetObj.isEnemy(obj) && !CNSquirrelAppendage.sq_IsAppendAppendage(targetObj, "character/mage/k_k_made/appendage/aptomonster/debuff/ap_pulledmonster.nut") && sq_GetDistanceObject(monsterobj, targetObj, true) <= range){ + local appendagePath = "character/mage/k_k_made/appendage/aptomonster/debuff/ap_pulledmonster.nut"; + local MasterAppendage = CNSquirrelAppendage.sq_AppendAppendage(targetObj, obj, -1, false, appendagePath, true); + if(MasterAppendage){ + sq_AccelMoveToAppendageForce(targetObj, obj, monsterobj, x, y, z, time, true, MasterAppendage, true); + local validT = MasterAppendage.getAppendageInfo() + validT.setValidTime(2000); + } + } + } +} + +function elementalmaster_setbonusRate(obj) +{ + local bonusRate = 1000; + if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ASSIMILATE) > 0) bonusRate = bonusRate * (1000 + sq_GetLevelData(obj,ELEMENTALMASTER_SKILL_ASSIMILATE, 0, sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ASSIMILATE))) / 1000; + if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALWEAK) > 0) bonusRate = bonusRate * (1000 + sq_GetLevelData(obj,ELEMENTALMASTER_SKILL_ELEMENTALWEAK, 5, sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALWEAK))) / 1000; + if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTMASTERY) > 0) bonusRate = bonusRate * (1000 + sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTMASTERY, 4, sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTMASTERY))) / 1000; + if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL) > 0){ + if(obj.sq_GetState() == 13){ + switch(obj.getThrowIndex()){ + case 56: + bonusRate = bonusRate * (1000 + sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 8, sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL))) / 1000; + break; + case 74: + bonusRate = bonusRate * (1000 + sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 16, sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL))) / 1000; + break; + } + } + } + + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, APDPATH_ELEMENTMASTERYBUFF)){ + local addAppendage = CNSquirrelAppendage.sq_GetAppendage(obj, APDPATH_ELEMENTMASTERYBUFF); + if(!addAppendage){ + obj.getVar("setSkillBonusRate").setInt(0, bonusRate.tointeger()); + return; + } + local addRate = addAppendage.getVar("custom").getInt(10); + bonusRate = bonusRate * (1000 + addRate) / 1000; + } + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut")){ + local addAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut"); + if(!addAppendage){ + obj.getVar("setSkillBonusRate").setInt(0, bonusRate.tointeger()); + return; + } + local skillLevel = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN); + local buff_num = []; + if(addAppendage.getVar().getBool(1)) buff_num.push(1); + if(addAppendage.getVar().getBool(2)) buff_num.push(1); + if(addAppendage.getVar().getBool(3)) buff_num.push(1); + if(addAppendage.getVar().getBool(4)) buff_num.push(1); + local value1 = 0; + switch(buff_num.len()){ + case 1: value1 = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, 6, skillLevel); break; + case 2: value1 = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, 7, skillLevel); break; + case 3: value1 = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, 8, skillLevel); break; + case 4: value1 = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, 9, skillLevel); break; + } + bonusRate = bonusRate * (10000 + value1) / 10000; + } + obj.getVar("setSkillBonusRate").setInt(0, bonusRate.tointeger()); +} + +function getElementalMaster_RestAni(obj) +{ + local animation = obj.sq_GetRestAni(); + if(obj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_ASSIMILATE) > 0) animation = obj.sq_GetCustomAni(ANIMATION_ELEMENTALMASTER_ELEMENTALMASTER_3RD_BODY); + return animation; +} + + + +function elementalmaster_setelementSkillBonusRate(obj, skillIndex) +{ + if(sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTMASTERY, 10, sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTMASTERY)) > 0){ + local AddAppendage; + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, APDPATH_ELEMENTMASTERYBUFF)){ + AddAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,APDPATH_ELEMENTMASTERYBUFF); + AddAppendage.sq_SetValidTime(8000); + AddAppendage.setAppendCauseSkill(BUFF_CAUSE_SKILL, sq_getJob(obj), ELEMENTALMASTER_SKILL_ELEMENTMASTERY, sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTMASTERY)); + CNSquirrelAppendage.sq_Append(AddAppendage, obj, obj, true); + } + else{ + AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, -1, false, APDPATH_ELEMENTMASTERYBUFF, true); + AddAppendage.getVar("custom").setInt(10, 0); + obj.sq_AddSkillLoad(ELEMENTALMASTER_SKILL_ELEMENTMASTERY, 64, 0, 500); + } + local now_BonusRate = AddAppendage.getVar("custom").getInt(10); + local new_BonusRate = 0; + switch(skillIndex){ + case 15: + case 16: + case 17: + case 18: + new_BonusRate = now_BonusRate + 30; + break; + case ELEMENTALMASTER_SKILL_VOID: + case ELEMENTALMASTER_SKILL_SUNBURST: + case ELEMENTALMASTER_SKILL_WALLOFICE: + case ELEMENTALMASTER_SKILL_FLAMESTRIKE: + new_BonusRate = now_BonusRate + 30; + break; + case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER: + case ELEMENTALMASTER_SKILL_BLACKHOLE: + case ELEMENTALMASTER_SKILL_THUNDERCALLING: + case ELEMENTALMASTER_SKILL_ARCTICPISTE: + new_BonusRate = now_BonusRate + 50; + break; + case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER: + case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE: + case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN: + case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND: + case ELEMENTALMASTER_SKILL_THEGATE: + case ELEMENTALMASTER_SKILL_SESTOELEMENTO: + case ELEMENTALMASTER_SKILL_THUNDERRAGE: + new_BonusRate = now_BonusRate + 80; + break; + } + if(new_BonusRate > 500) new_BonusRate = 500; + AddAppendage.getVar("custom").setInt(10, new_BonusRate); + local loadSlot = obj.sq_GetSkillLoad(ELEMENTALMASTER_SKILL_ELEMENTMASTERY); + if(loadSlot){ + local getload = loadSlot.getRemainLoadNumber(); + if(new_BonusRate / 10 + getload > 50) loadSlot.increaseLoadCount(50 - getload); + else loadSlot.increaseLoadCount(new_BonusRate / 10); + } + } + else{ + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, APDPATH_ELEMENTMASTERYBUFF)) CNSquirrelAppendage.sq_RemoveAppendage(obj, APDPATH_ELEMENTMASTERYBUFF); + } +} + +function onEnd_appendage_elementmastery_buff(appendage) +{ + if(!appendage) return; +} + + +function proc_appendage_elementmastery_buff(appendage) +{ + if(!appendage) return; + if(!appendage.isValid()) return; + local parentObj = appendage.getParent(); + if(!parentObj || parentObj.getState() == STATE_DIE){ + appendage.setValid(false); + return; + } +} + +function onStart_appendage_elementmastery_buff(appendage) +{ + if(!appendage) return; +} + +function onVaildTimeEnd_appendage_elementmastery_buff(appendage) +{ + if(!appendage) return; + local parentObj = appendage.getParent(); + if(!parentObj || parentObj.getState() == STATE_DIE){ + appendage.setValid(false); + return; + } + local obj = sq_GetCNRDObjectToSQRCharacter(parentObj); + local loadSlot = obj.sq_GetSkillLoad(ELEMENTALMASTER_SKILL_ELEMENTMASTERY); + if(loadSlot) obj.sq_RemoveSkillLoad(ELEMENTALMASTER_SKILL_ELEMENTMASTERY); +} + + +function setCustomData_po_elementalmaster_bykk_kak(obj, receiveData) +{ + if(!obj) return; + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + if(!sqrChr) return; + local skillIndex = receiveData.readDword(); + local subtype = receiveData.readDword(); + + obj.getVar("skillIndex").clear_vector(); + obj.getVar("skillIndex").push_vector(skillIndex); + obj.getVar("subtype").clear_vector(); + obj.getVar("subtype").push_vector(subtype); + + switch(skillIndex){ + case ELEMENTALMASTER_SKILL_ARCTICPISTE://極冰綻放 + switch(subtype){ + case 1: + case 2://totalDamage,sizeRate,hitMax,hitTime,speedRate + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local hitMax = receiveData.readDword(); + local hitTime = receiveData.readDword(); + local speedRate = receiveData.readDword(); + local sub = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(sizeRate); + obj.getVar("custom").push_vector(hitMax); + obj.getVar("custom").push_vector(hitTime); + obj.getVar("custom").push_vector(speedRate); + obj.getVar("custom").push_vector(sub); + local attackIndex = 20; + if(subtype == 2) attackIndex = 8; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, attackIndex)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + if(subtype == 2){ + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + } + local skill_level = sq_GetSkillLevel(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE); + local prob = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 5, skill_level); + local level = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 6, skill_level); + local time = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 7, skill_level); + local minus_Rate = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 4, skill_level); + obj.getVar("custom").push_vector(minus_Rate); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_FREEZE, prob, level, time); + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 3: + case 4: + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local speedRate = receiveData.readDword(); + local isBig = receiveData.readDword(); + obj.getVar("custom").setInt(10, sizeRate); + + local aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/new/icearea_att_3.ani"; + if(sq_getRandom(1, 100) > 50) aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/new/icearea_att2_3.ani"; + if(subtype == 3){ + aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/new/icefieldnormal1.ani"; + if(sq_getRandom(1, 100) > 50) aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/new/icefieldnormal2.ani"; + } + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + if(isBig > 300) sizeRate = sizeRate * 2.0; + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + pAni.setSpeedRate(speedRate.tofloat()); + + local attackIndex = 20; + if(subtype == 2) attackIndex = 8; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, attackIndex)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + if(subtype == 2){ + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + } + local skill_level = sq_GetSkillLevel(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE); + local prob = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 5, skill_level); + local level = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 6, skill_level); + local time = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 7, skill_level); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_FREEZE, prob, level, time); + break; + } + break; + case ELEMENTALMASTER_SKILL_BLACKHOLE://黑洞 + if(sqrChr.getVar("blackhole").get_obj_vector_size() < 1){ + sqrChr.getVar("blackhole").clear_obj_vector(); + sqrChr.getVar("blackhole").push_obj_vector(obj); + } + if(!sqrChr.getVar("blackhole").is_obj_vector(obj)) sqrChr.getVar("blackhole").push_obj_vector(obj); + switch(subtype){ + case 1: + case 2://totalDamage,sizeRate,lifeTime,damageRate,attractPower,hitTime + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local lifeTime = receiveData.readDword(); + local damageRate = receiveData.readDword(); + local attractPower = receiveData.readDword(); + local range = receiveData.readDword(); + local sub = receiveData.readDword(); + local hitTime = receiveData.readDword(); + local totalDamage2 = totalDamage * damageRate / 100; + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(sizeRate); + obj.getVar("custom").push_vector(attractPower); + obj.getVar("custom").push_vector(range); + obj.getVar("custom").push_vector(totalDamage2); + obj.getVar("custom").push_vector(lifeTime); + obj.getVar("custom").push_vector(totalDamage); + obj.getVar("custom").push_vector(sub); + obj.getVar("custom").push_vector(hitTime); + local attackIndex = 37; + if(subtype == 2) attackIndex = 38; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, attackIndex)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + if(subtype == 2){ + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + } + if(sq_GetLevelData(sqrChr, 58, 10, sq_GetSkillLevel(sqrChr, 58)) < 1) obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + else obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 3: + local lifeTime = receiveData.readDword(); + local sub = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/normal/shockwave1_dodge.ani"; + if(sub == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/elementalpotential/shockwave2_dodge.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + obj.setTimeEvent(0,lifeTime,1,false); + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); + break; + } + break; + case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND://聖靈水晶 + switch(subtype){ + case 1: + if(sqrChr.getVar("crystal").get_obj_vector_size() > 0) sqrChr.getVar("crystal").push_obj_vector(obj); + else{ + sqrChr.getVar("crystal").clear_obj_vector(); + sqrChr.getVar("crystal").push_obj_vector(obj); + } + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local sub = receiveData.readDword(); + obj.getVar("custom").setInt(1,sizeRate); + obj.getVar("custom").setInt(2,totalDamage); + if(sub > 0){ + obj.setTimeEvent(2, 2600, 1, false); + obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, ""); + } + else obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 2: + case 3: + case 4: + if(sqrChr.getVar("crystal_effect" + subtype.tostring()).get_obj_vector_size() > 0) sqrChr.getVar("crystal_effect" + subtype.tostring()).push_obj_vector(obj); + else{ + sqrChr.getVar("crystal_effect" + subtype.tostring()).clear_obj_vector(); + sqrChr.getVar("crystal_effect" + subtype.tostring()).push_obj_vector(obj); + } + local sizeRate = receiveData.readDword(); + obj.getVar("custom").setInt(1,sizeRate); + if(subtype == 4){sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM);}//obj.setTimeEvent(1,3300,1,false); + // else{obj.setTimeEvent(1,3000,1,false);} + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN://元素點燃 + switch(subtype){ + case 1: + sqrChr.getVar("elementalchain_light").clear_obj_vector();sqrChr.getVar("elementalchain_light").push_obj_vector(obj); + case 2: + sqrChr.getVar("elementalchain_ice").clear_obj_vector();sqrChr.getVar("elementalchain_ice").push_obj_vector(obj); + case 3: + sqrChr.getVar("elementalchain_fire").clear_obj_vector();sqrChr.getVar("elementalchain_fire").push_obj_vector(obj); + case 4: + if(subtype == 4){sqrChr.getVar("elementalchain_dark").clear_obj_vector();sqrChr.getVar("elementalchain_dark").push_obj_vector(obj);} + local lightTime = receiveData.readDword(); + local sub = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(lightTime); + obj.getVar("custom").push_vector(sub); + obj.setDirection(ENUM_DIRECTION_RIGHT); + obj.setMapFollowParent(sqrChr); + obj.setMapFollowType(1); + if(sub <= 1) sq_moveWithParent(sqrChr, obj); + if(sub == 1) obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, ""); + else if(sub == 2) obj.addSetStatePacket(28, null, STATE_PRIORITY_AUTO, false, ""); + else obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 15: + local totalDamage = receiveData.readDword(); + local powerDamage = receiveData.readDword(); + local normal_rate = receiveData.readDword(); + local exp_rate = receiveData.readDword(); + local shoot_range = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(normal_rate); + obj.getVar("custom").push_vector(exp_rate); + obj.getVar("custom").push_vector(shoot_range); + obj.getVar("custom").push_vector(sq_GetXPos(obj)); + obj.getVar("custom").push_vector(totalDamage); + obj.getVar("custom").push_vector(powerDamage); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 24)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + sq_SetCurrentAttackPower(sq_GetCurrentAttackInfo(obj), powerDamage); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 150: + local ani = sq_CreateAnimation("","passiveobject/common/animation/fireexplosion.ani"); + obj.setCurrentAnimation(ani); + local totalDamage = receiveData.readDword(); + local powerDamage = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 14)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + sq_SetCurrentAttackPower(sq_GetCurrentAttackInfo(obj), powerDamage); + local currentAni = obj.getCurrentAnimation();//得到當前ani + local sizeRate = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(sizeRate); + sizeRate = sizeRate.tofloat() / 1000.0; + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + obj.setTimeEvent(1, 200, 2, true); + obj.setTimeEvent(2, 50, 2, true); + obj.setTimeEvent(3, 15, 4, true); + obj.setTimeEvent(4, 100, 2, true); + break; + case 16: + local totalDamage = receiveData.readDword(); + local powerDamage = receiveData.readDword(); + local normal_rate = receiveData.readDword(); + local lifeTime = receiveData.readDword(); + obj.setTimeEvent(0,lifeTime,1,false); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(normal_rate); + obj.getVar("custom").push_vector(sq_GetXPos(obj)); + obj.getVar("custom").push_vector(sq_GetYPos(obj)); + obj.getVar("custom").push_vector(sq_GetZPos(obj)); + obj.getVar("custom").push_vector(80); + obj.getVar("custom").push_vector(0); + obj.getVar("custom").push_vector(0); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 23)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + sq_SetCurrentAttackPower(sq_GetCurrentAttackInfo(obj), powerDamage); + local skill_level = sq_GetSkillLevel(sqrChr, 16); + local prob = sq_GetLevelData(sqrChr, 16, 11, skill_level); + local level = sq_GetLevelData(sqrChr, 16, 12, skill_level); + local time = sq_GetLevelData(sqrChr, 16, 13, skill_level); + local speed_level = sq_GetLevelData(sqrChr, 16, 7, skill_level); + local speed_time = sq_GetLevelData(sqrChr, 16, 8, skill_level); + local movespeed_rate = sq_GetLevelData(sqrChr, 16, 9, skill_level); + local attackspeed_rate = sq_GetLevelData(sqrChr, 16, 10, skill_level); + obj.getVar("custom").push_vector(speed_level); + obj.getVar("custom").push_vector(speed_time); + obj.getVar("custom").push_vector(movespeed_rate); + obj.getVar("custom").push_vector(attackspeed_rate); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_FREEZE, prob, level, time); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 17: + local totalDamage = receiveData.readDword(); + local powerDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local lifeTime = receiveData.readDword(); + local angle = receiveData.readDword(); + local baseX = receiveData.readDword(); + local baseY = receiveData.readDword(); + obj.setTimeEvent(0,lifeTime,1,false); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(angle); + obj.getVar("custom").push_vector(baseX); + obj.getVar("custom").push_vector(baseY); + local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchfluorescent1.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchfluorescent2.ani"),true); + currentAni.addLayerAnimation(3,sq_CreateAnimation("","passiveobject/character/mage/animation/launchfluorescent3.ani"),true); + currentAni.addLayerAnimation(2,sq_CreateAnimation("","passiveobject/character/mage/animation/launchfluorescent4.ani"),true); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 22)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + sq_SetCurrentAttackPower(sq_GetCurrentAttackInfo(obj), powerDamage); + sizeRate = sizeRate.tofloat() / 1000.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + case 18: + local totalDamage = receiveData.readDword(); + local powerDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local speed_rate = receiveData.readDword(); + local shoot_range = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(sizeRate); + obj.getVar("custom").push_vector(speed_rate); + obj.getVar("custom").push_vector(shoot_range); + obj.getVar("custom").push_vector(sq_GetXPos(obj)); + obj.getVar("custom").push_vector(sq_GetZPos(obj)); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 21)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + sq_SetCurrentAttackPower(sq_GetCurrentAttackInfo(obj), powerDamage); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN://元素之幕 + local sizeRate = 100; + switch(subtype){ + case 1: + //totalDamage,sizeRate,lifeTime,damageRate,hitTime,hitMax + local totalDamage = receiveData.readDword(); + sizeRate = receiveData.readDword(); + local lifeTime = receiveData.readDword(); + local damageRate = receiveData.readDword(); + local hitTime = receiveData.readDword(); + local hitMax = receiveData.readDword(); + local istalisman = receiveData.readDword(); + local totalDamage2 = totalDamage * damageRate / 100; + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(sizeRate); + obj.getVar("custom").push_vector(totalDamage2); + obj.getVar("custom").push_vector(hitMax); + obj.getVar("custom").push_vector(totalDamage); + obj.getVar("custom").push_vector(istalisman); + obj.getVar("target").clear_obj_vector(); + + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalcurtain/blankwallhorizonbottom.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(10001,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalcurtain/elementalcurtain_aurora.ani"),true); + currentAni.addLayerAnimation(-1000,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalcurtain/elementalcurtain_aurorabehind_aurora1.ani"),true); + + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 3)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + + obj.setTimeEvent(0,hitTime,-1,true); + obj.setTimeEvent(1,lifeTime,1,false); + + cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj) + 400,obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN,2,lifeTime,sizeRate,0,0,0,0,0,0,0,0); + cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj),obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN,3,lifeTime,sizeRate,0,0,0,0,0,0,0,0); + break; + case 2: + local lifeTime = receiveData.readDword(); + sizeRate = receiveData.readDword(); + obj.setTimeEvent(1,lifeTime + 300,1,false); + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalcurtain/elementalcurtain_aurorafront_sky1.ani"); + obj.setCurrentAnimation(ani); + break; + case 3: + local lifeTime = receiveData.readDword(); + sizeRate = receiveData.readDword(); + obj.setTimeEvent(1,lifeTime + 300,1,false); + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalcurtain/elementalcurtain_groundcircle.ani"); + obj.setCurrentAnimation(ani); + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); + break; + case 4: + local totalDamage = receiveData.readDword(); + sizeRate = receiveData.readDword(); + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalcurtain/elementalcurtain_auroraend_broken.ani"); + obj.setCurrentAnimation(ani); + + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 4)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + + sq_flashScreen(obj,720,0,200,51, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + obj.setTimeEvent(1,1000,1,false); + break; + } + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + case ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL://元素奧義 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE://元素震蕩 + switch(subtype){ + case 1: + local totalDamage = receiveData.readDword(); + local damageRate = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local istalisman = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(totalDamage); + obj.getVar("custom").push_vector(damageRate); + obj.getVar("custom").push_vector(sizeRate); + obj.getVar("custom").push_vector(istalisman); + sizeRate = sizeRate.tofloat() / 100.0; + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalquake/magiccircle.ani",0,0,0); + local pooledObj2 = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalquake/quake_glowbeam.ani",0,0,0); + local effectObj = [pooledObj,pooledObj2]; + for(local i = 0; i < effectObj.len(); i++){ + local pAni = effectObj[i].getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + } + obj.setTimeEvent(1,400,1,false); + if(istalisman > 0) obj.setTimeEvent(2,120,20,false); + break; + case 2: + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalquake/elementalquakefireexpdummy.ani"); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 13)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setLoop(false); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + local randomnumber = sq_getRandom(1,100); + local pooledObj; + if(randomnumber > 67) pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalquake/flamestrike_blast_front02.ani",sq_getRandom(-350,350),sq_getRandom(-40,40),0); + else if(randomnumber > 33 && randomnumber <= 67) pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalquake/flamestrike_blast_front02.ani",sq_getRandom(-233,233),sq_getRandom(-80,80),0); + else pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalquake/flamestrike_blast_front02.ani",sq_getRandom(-115,115),sq_getRandom(-120,120),0); + local currentAni = pooledObj.getCurrentAnimation(); + currentAni.setImageRateFromOriginal(0.4, 0.4); + currentAni.setAutoLayerWorkAnimationAddSizeRate(0.4); + break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER://隕星幻滅 + switch(subtype){ + case 1: + local totalDamage = receiveData.readDword(); + local totalDamage2 = receiveData.readDword(); + obj.getVar("custom").setInt(10, totalDamage2); + local randomnumber = sq_getRandom(1, 4); + obj.getVar("custom").setInt(11, randomnumber); + obj.getVar("custom").setInt(12, sq_GetZPos(obj)); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 41)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case ELEMENTALMASTER_SKILL_FLAMESTRIKE://烈焰沖擊 + switch(subtype){ + case 1: + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 15)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(sizeRate); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 2: + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local etcTime = receiveData.readDword(); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 15)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/flamestrike/lv95assimilate/flamestrikebottoma_00.ani"); + obj.setCurrentAnimation(ani); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(sizeRate); + obj.getVar("custom").push_vector(totalDamage); + obj.getVar("custom").push_vector(etcTime); + local sizeRate = obj.getVar("custom").get_vector(0); + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + obj.getVar("targetObj").clear_obj_vector(); + obj.setTimeEvent(0,600,1,false); + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); + break; + case 3: + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(sizeRate); + obj.getVar("custom").push_vector(group); + obj.getVar("custom").push_vector(uniqueId); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 15)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER://傑克降臨 + switch(subtype){ + case 0: + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local sizeRate2 = receiveData.readDword(); + local damageRate = receiveData.readDword(); + local sub = receiveData.readDword(); + local typesub = receiveData.readDword(); + local number = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(sizeRate); + obj.getVar("custom").push_vector(sizeRate2); + obj.getVar("custom").push_vector(damageRate); + obj.getVar("custom").push_vector(totalDamage); + obj.getVar("custom").push_vector(sub); + obj.getVar("custom").push_vector(typesub); + obj.getVar("custom").push_vector(number); + obj.setTimeEvent(3,1000+220 * number,1,false); + obj.setTimeEvent(4,800,1,false); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalpotential/magictargetwarningterrible.ani",0,0,0); + break; + case 1: + case 2: + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local sizeRate2 = receiveData.readDword(); + local damageRate = receiveData.readDword(); + local sub = receiveData.readDword(); + print("sub = "+sub); + local totalDamage2 = totalDamage * damageRate / 100; + if(sub > 0){sizeRate = sizeRate * 166 / 100;sizeRate2 = sizeRate2 * 166 / 100;totalDamage = totalDamage * 10 / 100;totalDamage2 = totalDamage2 * 154 / 100;} + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(sizeRate); + obj.getVar("custom").push_vector(sizeRate2); + obj.getVar("custom").push_vector(totalDamage2); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 18)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + if(subtype == 2){ + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + } + local time = 1000; + if(sub > 0) time = 1500; + local speedRate = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_HALLOWEENBUSTER, 8, sq_GetSkillLevel(sqrChr, ELEMENTALMASTER_SKILL_HALLOWEENBUSTER)); + if(speedRate > 0){ + time = time / (100 + speedRate) * 100; + } + obj.getVar("move").setInt(10, sq_GetXPos(obj)); + obj.getVar("move").setInt(11, sq_GetZPos(obj)); + obj.setTimeEvent(5, time / 40, 40, true); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case ELEMENTALMASTER_SKILL_MIGHTYRUNE://聖靈符文 + break; + case ELEMENTALMASTER_SKILL_SESTOELEMENTO://第六元素 + switch(subtype){ + case 1: + local totalDamage = receiveData.readDword(); + local hitMax = receiveData.readDword(); + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/sestoelemento/start_main.ani"); + obj.setCurrentAnimation(ani); + obj.sq_PlaySound("SESTOELEMENTO"); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 26)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + obj.setTimeEvent(1,3000/(hitMax+1),hitMax,true); + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); + local appendage = CNSquirrelAppendage.sq_AppendAppendage(sqrChr, obj, -1, false, "appendage/character/ap_common_suck.nut", false); + if(appendage){ + CNSquirrelAppendage.sq_Append(appendage, sqrChr, obj); + local auraAppendage = appendage.sq_getAuraMaster("auraMaster"); + if(!auraAppendage) auraAppendage = appendage.sq_AddAuraMaster("auraMaster", sqrChr, obj, 1200, 18, 5, 0); + if(auraAppendage) auraAppendage.setAttractionInfo(600, 600, 800, 100); + } + break; + case 2: + local totalDamage = receiveData.readDword(); + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/sestoelemento/explosion_main.ani"); + obj.setCurrentAnimation(ani); + obj.sq_PlaySound("SESTOELEMENTO_EXP"); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 25)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); + if(!sqrChr) break; + CNSquirrelAppendage.sq_RemoveAppendage(sqrChr, "appendage/character/ap_common_suck.nut"); + break; + } + break; + case ELEMENTALMASTER_SKILL_SUNBURST://雷旋 + switch(subtype){ + case 1:// + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/sunburst/sunburst.ani"); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 27)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + case 2: + local time = receiveData.readDword(); + obj.setTimeEvent(1, time, 1, false); + break; + } + break; + case ELEMENTALMASTER_SKILL_THEGATE://元素之門 + switch(subtype){ + case 1: + local totalDamage = receiveData.readDword(); + local create_number = receiveData.readDword(); + local create_time = receiveData.readDword(); + local sub = receiveData.readDword(); + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + local targetObj = sq_GetObject(obj, group, uniqueId); + sq_moveWithParent(targetObj, obj); + obj.getVar().clear_obj_vector(); + obj.getVar().push_obj_vector(targetObj); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(totalDamage); + obj.getVar("custom").push_vector(create_number); + obj.getVar("custom").push_vector(create_time); + obj.getVar("custom").push_vector(sub); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 2: + local totalDamage = receiveData.readDword(); + local sub = receiveData.readDword(); + local aniPath1 = "passiveobject/elementalmaster_bykk/animation/thegate/"; + local aniPath2 = "light"; + switch(sub){ + case 2: aniPath2 = "ice"; break; + case 3: aniPath2 = "fire"; break; + case 4: aniPath2 = "dark"; break; + } + local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/" + aniPath2 + "_crystal.ani"); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 28)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + sq_CreateParticle("passiveobject/elementalmaster_bykk/particle/thegate"+aniPath2+"tail.ptl", obj, 0, 0, 0, true, 10, 0, 3); + + local attackInfo = sq_GetCurrentAttackInfo(obj); + switch(sub){ + case 1: if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); break; + case 2: if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); break; + case 3: if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); break; + case 4: if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); break; + } + + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(sq_GetZPos(obj)); + obj.getVar("custom").push_vector(sub); + break; + case 10: + local totalDamage = receiveData.readDword(); + local sub = receiveData.readDword(); + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + local targetObj = sq_GetObject(obj, group, uniqueId); + if(targetObj){ + obj.getVar("custom").setInt(0, totalDamage); + obj.getVar("custom").setInt(1, sub); + obj.getVar("custom").setInt(2, group); + obj.getVar("custom").setInt(3, uniqueId); + local aniPath0 = "passiveobject/elementalmaster_bykk/animation/thegate/talisman/"; + local aniPath1 = ["magiccircleblue","magiccirclepurple","magiccirclered","magiccircleyellow"]; + local aniPath2 = [["/magiccircleblue_01.ani","/magiccirclepurple_01.ani","/magiccirclered_01.ani","/magiccircleyellow_01.ani"], + ["/magiccircleblue_line_00.ani","/magiccirclepurple_line_00.ani","/magiccirclered_line_00.ani","/magiccircleyellow_line_00.ani"]]; + local ani = sq_CreateAnimation("",aniPath0 + aniPath1[sub] + aniPath2[0][sub]); + obj.setCurrentAnimation(ani); + local pAni = obj.getCurrentAnimation(); + pAni.addLayerAnimation(-1,sq_CreateAnimation("",aniPath0 + aniPath1[sub] + aniPath2[1][sub]),true); + local activeObj = sq_GetCNRDObjectToActiveObject(targetObj); + if(!CNSquirrelAppendage.sq_IsAppendAppendage(activeObj, "character/mage/elementalmaster_bykk/ap_mage_hold.nut")){ + CNSquirrelAppendage.sq_RemoveAppendage(activeObj, "character/mage/elementalmaster_bykk/ap_mage_hold.nut"); + } + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(activeObj, obj, -1, false, "character/mage/elementalmaster_bykk/ap_mage_hold.nut", true); + sq_HoldAndDelayDie(activeObj, obj, true, true, true, 200, 200, ENUM_DIRECTION_NEUTRAL , AddAppendage); + } + else sq_SendDestroyPacketPassiveObject(obj); + break; + case 11: + local totalDamage = receiveData.readDword(); + local sub = receiveData.readDword(); + local group = receiveData.readDword(); + local uniqueId = receiveData.readDword(); + local targetObj = sq_GetObject(obj, group, uniqueId); + if(targetObj){ + obj.getVar("tar").clear_obj_vector(); + obj.getVar("tar").push_obj_vector(targetObj); + local aniPath0 = "passiveobject/elementalmaster_bykk/animation/thegate/talisman/"; + local aniPath1 = ["magiccircleblue","magiccirclepurple","magiccirclered","magiccircleyellow"]; + local aniPath2 = ["/explosionblue_04.ani","/explosionpurple_05.ani","/explosionred_04.ani","/explosionyellow_04.ani"]; + // print("path = "+aniPath0 + aniPath1[sub] + aniPath2[sub]); + local ani = sq_CreateAnimation("",aniPath0 + aniPath1[sub] + aniPath2[sub]); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 28)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + attackInfo.setElement(ENUM_ELEMENT_FIRE); + attackInfo.setElement(ENUM_ELEMENT_WATER); + attackInfo.setElement(ENUM_ELEMENT_DARK); + attackInfo.setElement(ENUM_ELEMENT_LIGHT); + obj.setTimeEvent(2,50,1,false); + sq_SetShake(obj, 15, 300); + } + else sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case ELEMENTALMASTER_SKILL_THUNDERCALLING://天雷 + switch(subtype){ + case 0://totalDamage,sizeRate,countMax,hitTime,range,2 + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local countMax = receiveData.readDword(); + local hitTime = receiveData.readDword(); + local range = receiveData.readDword(); + local sub = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(totalDamage); + obj.getVar("custom").push_vector(sizeRate); + obj.getVar("custom").push_vector(countMax); + obj.getVar("custom").push_vector(range); + obj.getVar("custom").push_vector(sub); + obj.getVar("custom").push_vector(hitTime); + local skill_level = sq_GetSkillLevel(sqrChr, ELEMENTALMASTER_SKILL_THUNDERCALLING); + local prob = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_THUNDERCALLING, 4, skill_level); + local level = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_THUNDERCALLING, 5, skill_level); + local time = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_THUNDERCALLING, 6, skill_level); + obj.getVar("custom").push_vector(prob); + obj.getVar("custom").push_vector(level); + obj.getVar("custom").push_vector(time); + if((countMax * hitTime) > 4000){ + local pAni = obj.getCurrentAnimation(); + sq_SetFrameDelayTime(pAni, 0, countMax * hitTime); + } + obj.setTimeEvent(3,1000+(hitTime + 20) * countMax,1,false); + obj.setTimeEvent(4,800,1,false); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalpotential/magictargetwarningterrible.ani",0,0,0); + break; + case 1: + case 2: + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local range = receiveData.readDword(); + local prob = receiveData.readDword(); + local level = receiveData.readDword(); + local time = receiveData.readDword(); + local aniPath = "passiveobject/elementalmaster_bykk/animation/thunderstrike/thunderstrike_lightning01.ani"; + if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalpotential/thunderstrike/epthunderstrike_lightning01.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + local attackIndex = 29; + if(subtype == 2) attackIndex = 11; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, attackIndex)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_STUN, prob, level, time); + if(subtype == 1){ + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/thunderstrike/thunderstrike_hit01.ani",0,0,0); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/thunderstrike/thunderstrike_floor.ani",0,0,0); + } + else if(subtype == 2){ + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalpotential/thunderstrike/epthunderstrike_hit01.ani",0,0,0); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + } + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + obj.sq_PlaySound("THUNDERC_LIGHTNING"); + obj.setTimeEvent(1,200,1,false); + break; + case 3: + local totalDamage = receiveData.readDword(); + print("totalDamage = "+totalDamage); + local aniPath = "passiveobject/character/mage/animation/thunderstrike.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + sq_AddDrawOnlyAniFromParent(obj, "passiveobject/character/mage/animation/thunderstrikeeffect.ani", 0, -1, 0); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 29)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + break; + } + break; + case ELEMENTALMASTER_SKILL_THUNDERRAGE://光與暗的交響 + switch(subtype){ + case 1: + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local hitMax = receiveData.readDword(); + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/thunderrage/thunderrage_cast_end_shot_back_05.ani"); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 30)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + + sizeRate = sizeRate.tofloat() / 1000.0; + local pAni = obj.getCurrentAnimation(); + local delaySum = pAni.getDelaySum(0,13); + obj.setTimeEvent(1,delaySum/(hitMax + 1),hitMax,true); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + } + break; + case ELEMENTALMASTER_SKILL_VOID://虛無之球 + switch(subtype){ + case 1: + local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local shoot_range = receiveData.readDword(); + local hittime = receiveData.readDword(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(shoot_range); + obj.getVar("custom").push_vector(sq_GetXPos(obj)); + obj.getVar("custom").push_vector(sizeRate); + obj.setTimeEvent(0,hittime,-1,false); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 31)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + obj.sq_SetMoveParticle("particle/void.ptl", 0.0, 0.0); + // sq_SetSpeedToMoveParticle(obj,0,speed); + obj.setTimeEvent(1,20,-1,false); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 2: + local totalDamage = receiveData.readDword(); + local hittime = receiveData.readDword(); + local timeMax = receiveData.readDword(); + local damageRate = receiveData.readDword(); + local damageRate2 = receiveData.readDword(); + local sizeRate = receiveData.readDword(); + local isExp = receiveData.readDword(); + local totalDamage2 = (totalDamage.tofloat() * damageRate.tofloat() / 100.0).tointeger(); + local totalDamage3 = (totalDamage.tofloat() * damageRate2.tofloat() / 100.0).tointeger(); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(hittime); + obj.getVar("custom").push_vector(timeMax); + obj.getVar("custom").push_vector(totalDamage3); + obj.getVar("custom").push_vector(sizeRate); + obj.getVar("custom").push_vector(isExp); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 32)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage2); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case ELEMENTALMASTER_SKILL_WALLOFICE://冰牆 + break; + case 38://移動施法 + sqrChr.getVar("moveoncast").clear_obj_vector(); + sqrChr.getVar("moveoncast").push_obj_vector(obj); + local chargeTime = receiveData.readDword(); + local sub = receiveData.readDword(); + local fullcharge = receiveData.readDword(); + obj.setTimeEvent(0,chargeTime,1,false); + obj.getVar("custom").clear_vector(); + obj.getVar("custom").push_vector(sub); + obj.setMapFollowParent(obj.getParent()); + obj.setMapFollowType(1); + sq_moveWithParent(sqrChr, obj); + if(fullcharge > 0) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + else obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo){ + local element_kk_fire = sqrChr.getVar("element_kk").getInt(0); + local element_kk_water = sqrChr.getVar("element_kk").getInt(1); + local element_kk_dark = sqrChr.getVar("element_kk").getInt(2); + local element_kk_light = sqrChr.getVar("element_kk").getInt(3); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE) && element_kk_fire > 0) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER) && element_kk_water > 0) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK) && element_kk_dark > 0) attackInfo.setElement(ENUM_ELEMENT_DARK); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT) && element_kk_light > 0) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + } +} + +function setState_po_elementalmaster_bykk_kak(obj, state, datas) +{ + if(!obj) return; + + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").get_vector(0); + local subtype = obj.getVar("subtype").get_vector(0); + obj.getVar("state").clear_vector(); + obj.getVar("state").push_vector(state); + + switch(skillIndex){ + case ELEMENTALMASTER_SKILL_ARCTICPISTE://極冰綻放 + switch(subtype){ + case 1: + case 2: + switch(state){ + case 20: + local aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/icefieldfloorappear.ani"; + if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/field2floorappear.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + local speedRate = obj.getVar("custom").get_vector(3); + local pAni = obj.getCurrentAnimation(); + sq_SetFrameDelayTime(pAni, 0, 300); + pAni.setSpeedRate(speedRate.tofloat()); + break; + case 21: + local aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/icefield.ani"; + if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/field2.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + local hitTime = obj.getVar("custom").get_vector(2); + local sub = obj.getVar("custom").get_vector(4); + obj.setTimeEvent(1,hitTime,-1,false); + if(sub == 0) obj.setTimeEvent(2,hitTime / 2,-1,false); + else if(sub == 1) obj.setTimeEvent(3,900,-1,true); + break; + case 22: + obj.stopTimeEvent(1); + local aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/icefieldfloordisappear.ani"; + if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/field2disappear.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + break; + } + local sizeRate = obj.getVar("custom").get_vector(0); + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + } + break; + case ELEMENTALMASTER_SKILL_BLACKHOLE://黑洞 + switch(subtype){ + case 1: + case 2: + switch(state){ + case 20: + local aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/normal/nighthollow1_start_dodge.ani"; + if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/elementalpotential/nighthollow2_start_dodge.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + obj.sq_PlaySound("NIGHTH_IN") + break; + case 21: + local aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/normal/nighthollow1_loop_dodge.ani"; + if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/elementalpotential/nighthollow2_loop_dodge.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + local lifeTime = obj.getVar("custom").get_vector(4); + local sizeRate = obj.getVar("custom").get_vector(0); + cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,0,obj.getDirection(),ELEMENTALMASTER_SKILL_BLACKHOLE,3,lifeTime,subtype,sizeRate,0,0,0,0,0,0,0); + local hitTime = obj.getVar("custom").get_vector(7); + obj.setTimeEvent(1,hitTime,-1,false); + obj.setTimeEvent(0,lifeTime,1,false); + obj.setTimeEvent(3,1800,-1,true); + if(!sqrChr) break; + local attractPower = obj.getVar("custom").get_vector(1); + local range = obj.getVar("custom").get_vector(2); + if(CNSquirrelAppendage.sq_IsAppendAppendage(sqrChr, "appendage/character/ap_common_suck.nut")) CNSquirrelAppendage.sq_RemoveAppendage(sqrChr, "appendage/character/ap_common_suck.nut"); + local appendage = CNSquirrelAppendage.sq_AppendAppendage(sqrChr, obj, -1, false, "appendage/character/ap_common_suck.nut", false); + if(appendage){ + CNSquirrelAppendage.sq_Append(appendage, sqrChr, obj); + local auraAppendage = appendage.sq_getAuraMaster("auraMaster"); + if(!auraAppendage) auraAppendage = appendage.sq_AddAuraMaster("auraMaster", sqrChr, obj, 1200, 18, 5, 0); + if(auraAppendage) auraAppendage.setAttractionInfo(attractPower, attractPower, range, 100); + } + break; + case 22: + obj.stopTimeEvent(1); + obj.stopTimeEvent(3); + local aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/normal/nighthollow1_exp_dodge.ani"; + if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/elementalpotential/nighthollow2_exp_dodge.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + obj.sq_PlaySound("NIGHTH_OUT"); + obj.setTimeEvent(2,400,1,false); + local totalDamage = obj.getVar("custom").get_vector(3); + local attackIndex = 40; + if(subtype == 2) attackIndex = 39; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, attackIndex)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + if(subtype == 2){ + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + } + if(!sqrChr) break; + CNSquirrelAppendage.sq_RemoveAppendage(sqrChr, "appendage/character/ap_common_suck.nut"); + break; + } + local sizeRate = obj.getVar("custom").get_vector(0); + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + } + break; + case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND://聖靈水晶 + switch(subtype){ + case 1: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/crystalofovermind/crystalofovermind_grow01_loop.ani");// + obj.setCurrentAnimation(ani); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/groweffect/crystalofovermind_grow01_start.ani",0,0,50); + obj.setTimeEvent(2,650,4,false); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/crystalofovermind/crystalofovermind_grow02_loop.ani");// + obj.setCurrentAnimation(ani); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/groweffect/crystalofovermind_grow02_start.ani",0,0,50); + break; + case 22: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/crystalofovermind/crystalofovermind_grow03_loop.ani");// + obj.setCurrentAnimation(ani); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/groweffect/crystalofovermind_grow03_start.ani",0,0,50); + break; + case 23: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/crystalofovermind/crystalofovermind_grow04_loop.ani");// + obj.setCurrentAnimation(ani); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/groweffect/crystalofovermind_grow04_start_back.ani",0,0,50); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/groweffect/crystalofovermind_grow04_start.ani",0,0,50); + break; + case 24: + obj.stopTimeEvent(2); + local effectObj2 = sqrChr.getVar("crystal_effect2").get_obj_vector(0); + if(effectObj2){local colObj = sq_GetCNRDObjectToCollisionObject(effectObj2);colObj.setTimeEvent(1,100,1,true);} + local effectObj3 = sqrChr.getVar("crystal_effect3").get_obj_vector(0); + if(effectObj3){local colObj = sq_GetCNRDObjectToCollisionObject(effectObj3);colObj.setTimeEvent(1,100,1,true);} + local effectObj4 = sqrChr.getVar("crystal_effect4").get_obj_vector(0); + if(effectObj4){local colObj = sq_GetCNRDObjectToCollisionObject(effectObj4);colObj.setTimeEvent(1,500,1,false);} + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/crystalofovermind/finish/front/crystalofovermind_finish_front_00.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/crystalofovermind/finish/back/crystalofovermind_finish_back_00.ani"),true); + local totalDamage = obj.getVar("custom").getInt(2); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 2)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + break; + } + local sizeRate = obj.getVar("custom").getInt(1); + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + case 2: + case 3: + case 4: + local aniPath1 = "character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/"; + switch(state){ + case 20: + local aniPath2 = "crystalofmind_side_back01_start.ani"; + if(subtype == 3) aniPath2 = "crystalofmind_side_front_start.ani"; + if(subtype == 4) aniPath2 = "crystalofovermind_background_01.ani"; + local ani = sq_CreateAnimation("",aniPath1 + "start/" + aniPath2); + obj.setCurrentAnimation(ani); + break; + case 21: + local aniPath2 = "crystalofmind_side_back01.ani"; + if(subtype == 3) aniPath2 = "crystalofmind_side_front_loop01.ani"; + if(subtype == 4) aniPath2 = "crystalofovermind_background_01.ani"; + local ani = sq_CreateAnimation("",aniPath1 + "loop/" + aniPath2); + obj.setCurrentAnimation(ani); + break; + case 22: + local aniPath2 = "crystalofmind_side_back01_finish.ani"; + if(subtype == 3) aniPath2 = "crystalofmind_side_front_finish.ani"; + if(subtype == 4) {sq_SendDestroyPacketPassiveObject(obj);return;} + local ani = sq_CreateAnimation("",aniPath1 + "end/" + aniPath2); + obj.setCurrentAnimation(ani); + break; + } + local sizeRate = obj.getVar("custom").getInt(1); + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN://元素點燃 + switch(subtype){ + case 1: + case 2: + case 3: + case 4: + local aniPath1 = "character/mage/effect/animation/elementalmaster_bykk/elementalchain/mark"; + local aniPath2 = "light"; + if(subtype == 2) aniPath2 = "ice"; + if(subtype == 3) aniPath2 = "fire"; + if(subtype == 4) aniPath2 = "dark"; + if(obj.getVar("custom").get_vector(1) == 1) aniPath1 = "character/mage/effect/animation/elementalmaster_bykk/mightyrune/"; + if(obj.getVar("custom").get_vector(1) == 2) aniPath1 = "character/mage/effect/animation/elementalmaster_bykk/mightyrune/lv95assimilate/"; + switch(state){ + case 20: + local ani = sq_CreateAnimation("",aniPath1 + "appear_" + aniPath2 + "_1.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("",aniPath1 + "appear_" + aniPath2 + "_2.ani"),true); + break; + case 21: + local ani = sq_CreateAnimation("",aniPath1 + "stay_" + aniPath2 + "_1.ani"); + obj.setCurrentAnimation(ani); + if(subtype == 1) sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr) + 23); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("",aniPath1 + "stay_" + aniPath2 + "_2.ani"),true); + break; + case 22: + if(obj.isExistTimeEvent(1)) obj.stopTimeEvent(1); + local ani = sq_CreateAnimation("",aniPath1 + "activate_" + aniPath2 + "_1.ani"); + obj.setCurrentAnimation(ani); + local lifeTime = obj.getVar("custom").get_vector(0); + obj.setTimeEvent(1,lifeTime,1,false); + if(subtype == 1) sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr) + 30); + if(subtype == 4) sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr) + 35); + break; + case 23: + local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/rune" + aniPath2 + "cast.ani"); + obj.setCurrentAnimation(ani); + break; + case 24: + local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/rune" + aniPath2 + "off_02.ani"); + obj.setCurrentAnimation(ani); + break; + case 25: + local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/rune" + aniPath2 + "changeon_02.ani"); + obj.setCurrentAnimation(ani); + break; + case 26: + if(obj.isExistTimeEvent(2)) obj.stopTimeEvent(2); + local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/rune" + aniPath2 + "on_02.ani"); + obj.setCurrentAnimation(ani); + local lightTime = obj.getVar("custom").get_vector(0); + obj.setTimeEvent(1,lightTime,1,false); + break; + case 27: + local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/rune" + aniPath2 + "changeoff.ani"); + obj.setCurrentAnimation(ani); + break; + case 28: + local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "spherestart_00.ani "); + obj.setCurrentAnimation(ani); + break; + case 29: + local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "sphereloop_00.ani"); + obj.setCurrentAnimation(ani); + break; + } + break; + case 15: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchjolstart.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchjolfirestart.ani"),true); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchjolmove.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchjolfiremove.ani"),true); + break; + } + local sizeRate = obj.getVar("custom").get_vector(0); + sizeRate = sizeRate.tofloat() / 1000.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + case 16: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchfrosthead.ani"); + obj.setCurrentAnimation(ani); + local pAni = obj.getCurrentAnimation(); + pAni.setLoop(true); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchfrostheadjump.ani"); + obj.setCurrentAnimation(ani); + obj.getVar("custom").set_vector(1,sq_GetXPos(obj)); + obj.getVar("custom").set_vector(2,sq_GetYPos(obj)); + obj.getVar("custom").set_vector(3,sq_GetZPos(obj)); + local targetObj = obj.sq_FindFirstTarget(-9999, 19998, 9999, 9999); + if(targetObj){ + local targetObj_y = sq_GetYPos(targetObj) - sq_GetYPos(obj); + obj.getVar("custom").set_vector(5,targetObj_y); + if(sq_GetXPos(targetObj) > sq_GetXPos(obj) && obj.getDirection() == ENUM_DIRECTION_LEFT) sq_SetCurrentDirection(obj, ENUM_DIRECTION_RIGHT); + else if(sq_GetXPos(targetObj) < sq_GetXPos(obj) && obj.getDirection() == ENUM_DIRECTION_RIGHT) sq_SetCurrentDirection(obj, ENUM_DIRECTION_LEFT); + } + obj.getVar("custom").set_vector(6,130); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/character/mage/animation/launchfrostheadjumpeffect.ani",0,-1,-1); + break; + case 22: + local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchfrostheadhit.ani"); + obj.setCurrentAnimation(ani); + break; + case 23: + local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchfrostheaddisappear.ani"); + obj.setCurrentAnimation(ani); + break; + } + local sizeRate = obj.getVar("custom").get_vector(0); + sizeRate = sizeRate.tofloat() / 1000.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + case 18: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatshoot1.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatshoot2.ani"),true); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatmovego1.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatmovego2.ani"),true); + break; + case 22: + local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatturn1.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatturn2.ani"),true); + obj.getVar("custom").set_vector(3,sq_GetXPos(obj)); + break; + case 23: + local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatmovereturn1.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatmovereturn2.ani"),true); + obj.resetHitObjectList(); + break; + case 24: + local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatreturn1.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatreturn2.ani"),true); + break; + } + local sizeRate = obj.getVar("custom").get_vector(0); + sizeRate = sizeRate.tofloat() / 1000.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN://元素之幕 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL://元素奧義 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE://元素震蕩 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER://隕星幻滅 + switch(subtype){ + case 1: + switch(state){ + case 20: + local randomnumber = obj.getVar("custom").getInt(11); + local aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/darkdrop.ani"; + if(randomnumber == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/firedrop.ani"; + if(randomnumber == 3) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/lightdrop.ani"; + if(randomnumber == 4) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/waterdrop.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + local pAni = obj.getCurrentAnimation(); + sq_SetFrameDelayTime(pAni, 0, 100); + local sizeRate = 2.5; + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + obj.setTimeEvent(1, 10, 13, true); + obj.sq_PlaySound("COLORLESS_CHASER"); + break; + case 21: + local randomnumber = obj.getVar("custom").getInt(11); + local aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/darkexp.ani"; + if(randomnumber == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/fireexp.ani"; + if(randomnumber == 3) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/lightexp.ani"; + if(randomnumber == 4) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/waterexp.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + switch(randomnumber){ + case 1: currentAni.addLayerAnimation(6,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalshower/darkexplayer.ani"),true); obj.sq_PlaySound("DARK_BOMB"); break; + case 2: currentAni.addLayerAnimation(6,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalshower/fireexplayer.ani"),true); obj.sq_PlaySound("FIRE_BOMB"); break; + case 3: currentAni.addLayerAnimation(6,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalshower/lightexplayer.ani"),true); obj.sq_PlaySound("LIGHT_BOMB"); break; + case 4: currentAni.addLayerAnimation(6,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalshower/waterexplayer.ani"),true); obj.sq_PlaySound("WATER_BOMB"); break; + } + local sizeRate = 2.5; + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + local totalDamage = obj.getVar("custom").getInt(10); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 42)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + //obj.sq_PlaySound("CHASER_EXPLOSION"); + break; + } + break; + } + break; + case ELEMENTALMASTER_SKILL_FLAMESTRIKE://烈焰沖擊 + switch(subtype){ + case 1: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/flamestrike/new/flamestrike_start_floor01.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(10001,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/flamestrike/new/flamestrike_start_floor03.ani"),true); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/flamestrike/new/flamestrike_blast_front02.ani"); + obj.setCurrentAnimation(ani); + sq_CreateParticle("passiveobject/character/mage/particle/flamestrikeparticle-1.ptl", obj, 0, 0, 0, true, 1, 0, 1); + sq_CreateParticle("passiveobject/character/mage/particle/flamestrikeparticle-2.ptl", obj, 0, 0, 0, true, 1, 0, 1); + sq_SetMyShake(obj, 10, 150); + break; + } + local sizeRate = obj.getVar("custom").get_vector(0); + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + case 3: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/flamestrike/lv95assimilate/flamestrikea_00.ani"); + obj.setCurrentAnimation(ani); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/flamestrike/lv95assimilate/flamestrikeb_02.ani"); + obj.setCurrentAnimation(ani); + local group = obj.getVar("custom").get_vector(1); + local uniqueId = obj.getVar("custom").get_vector(2); + local targetObj = sq_GetObject(obj, group, uniqueId); + if(targetObj) sq_SendHitObjectPacket(obj,targetObj,0,0,0); + sq_CreateParticle("passiveobject/elementalmaster_bykk/particle/flamestrikeparticlenew1.ptl", obj, 0, 0, 0, true, 1, 0, 1); + sq_CreateParticle("passiveobject/elementalmaster_bykk/particle/flamestrikeparticlenew2.ptl", obj, 0, 0, 0, true, 1, 0, 1); + sq_SetMyShake(obj, 10, 150); + break; + } + local sizeRate = obj.getVar("custom").get_vector(0); + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + } + break; + case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER://傑克降臨 + switch(subtype){ + case 1: + case 2: + switch(state){ + case 20: + local aniPath = "passiveobject/elementalmaster_bykk/animation/halloweenbuster/halloweenbustera_meteor_base01.ani"; + if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalpotential/halloweenbuster/ep_halloweenbustera_meteor_base01.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + if(subtype == 2){ + sq_CreateParticle("passiveobject/elementalmaster_bykk/particle/elementalpotentialhalloweenbursterexp.ptl", obj, 0, 0, 0, true, 30, 0, 1); + sq_CreateParticle("passiveobject/elementalmaster_bykk/particle/elementalpotentialhalloweenbursterexpsmoke.ptl", obj, 0, 0, 0, true, 10, 0, 1); + } + break; + case 21: + obj.sq_RemoveMoveParticle(); + obj.stopTimeEvent(0); + obj.stopTimeEvent(1); + local aniPath = "passiveobject/elementalmaster_bykk/animation/halloweenbuster/halloweenbuster_explosion_04.ani"; + if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalpotential/halloweenbuster/ep_halloweenbuster_explosion_04.ani"; + local ani = sq_CreateAnimation("",aniPath); + obj.setCurrentAnimation(ani); + local totalDamage = obj.getVar("custom").get_vector(2); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 19)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + if(subtype == 2){ + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/character/mage/animation/elementalpotential/halloweenbuster/ep_halloweenbuster_particle01.ani",0,0,0); + } + break; + } + local sizeRate = obj.getVar("custom").get_vector(0); + if(state == 21) sizeRate = obj.getVar("custom").get_vector(1); + sizeRate = sizeRate.tofloat() / 1000.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + } + break; + case ELEMENTALMASTER_SKILL_MIGHTYRUNE://聖靈符文 + break; + case ELEMENTALMASTER_SKILL_SESTOELEMENTO://第六元素 + break; + case ELEMENTALMASTER_SKILL_SUNBURST://雷旋 + break; + case ELEMENTALMASTER_SKILL_THEGATE://元素之門 + switch(subtype){ + case 1: + local aniPath1 = "passiveobject/elementalmaster_bykk/animation/thegate/"; + local aniPath2 = "light"; + switch(obj.getVar("custom").get_vector(3)){ + case 2: aniPath2 = "ice"; break; + case 3: aniPath2 = "fire"; break; + case 4: aniPath2 = "dark"; break; + } + switch(state){ + case 20: + local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/start/" + aniPath2 + "_magic.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath1 + aniPath2 + "/start/" + aniPath2 + "_aura.ani"),true); + local pAni = obj.getCurrentAnimation(); + pAni.setSpeedRate(200.0); + break; + case 21: + local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/loop/" + aniPath2 + "_magic.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath1 + aniPath2 + "/loop/" + aniPath2 + "_aura.ani"),true); + local create_time = obj.getVar("custom").get_vector(2); + obj.setTimeEvent(1,create_time,-1,true); + break; + case 22: + obj.stopTimeEvent(1); + local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/end/" + aniPath2 + "_magic.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath1 + aniPath2 + "/end/" + aniPath2 + "_aura.ani"),true); + break; + } + break; + } + break; + case ELEMENTALMASTER_SKILL_THUNDERCALLING://天雷 + break; + case ELEMENTALMASTER_SKILL_THUNDERRAGE://光與暗的交響 + break; + case ELEMENTALMASTER_SKILL_VOID://虛無之球 + switch(subtype){ + case 1: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/void/void1_start.ani"); + obj.setCurrentAnimation(ani); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/void/void1_loop.ani"); + obj.setCurrentAnimation(ani); + break; + case 22: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/void/void1_end.ani"); + obj.setCurrentAnimation(ani); + break; + } + local sizeRate = obj.getVar("custom").get_vector(2); + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + case 2: + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/void/lv95assimilate/start_00.ani"); + obj.setCurrentAnimation(ani); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/void/lv95assimilate/start_06.ani",0,0,0); + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/void/lv95assimilate/start_07.ani",0,0,0); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/void/lv95assimilate/loop_00.ani"); + obj.setCurrentAnimation(ani); + local timeMax = obj.getVar("custom").get_vector(1); + print("timemax = "+timeMax); + obj.setTimeEvent(1, timeMax, 1, false); + break; + case 22: + obj.stopTimeEvent(0); + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/void/lv95assimilate/end_04.ani"); + obj.setCurrentAnimation(ani); + local totalDamage = obj.getVar("custom").get_vector(2); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 33)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + break; + } + local sizeRate = obj.getVar("custom").get_vector(3); + sizeRate = sizeRate.tofloat() / 230.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + break; + } + break; + case ELEMENTALMASTER_SKILL_WALLOFICE://冰牆 + break; + case 38://移動施法 + local aniPath1 = "character/mage/effect/animation/magic"; + local sub = obj.getVar("custom").get_vector(0); + if(sub == 4){ + switch(state){ + case 20: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/magiconcharge2_1.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/magiconcharge2_2.ani"),true); + break; + case 21: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/magicfullcharge2_1.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/magicfullcharge22_1.ani"),true); + break; + } + return; + } + switch(state){ + case 20: + local ani = sq_CreateAnimation("",aniPath1 + "oncharge" + sub.tostring() + "1.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("",aniPath1 + "oncharge" + sub.tostring() + "2.ani"),true); + break; + case 21: + local ani = sq_CreateAnimation("",aniPath1 + "fullcharge" + sub + "1.ani"); + obj.setCurrentAnimation(ani); + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(-1,sq_CreateAnimation("",aniPath1 + "oncharge" + sub.tostring() + "2.ani"),true); + break; + } + break; + } + + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(attackInfo){ + local element_kk_fire = sqrChr.getVar("element_kk").getInt(0); + local element_kk_water = sqrChr.getVar("element_kk").getInt(1); + local element_kk_dark = sqrChr.getVar("element_kk").getInt(2); + local element_kk_light = sqrChr.getVar("element_kk").getInt(3); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE) && element_kk_fire > 0) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER) && element_kk_water > 0) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK) && element_kk_dark > 0) attackInfo.setElement(ENUM_ELEMENT_DARK); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT) && element_kk_light > 0) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + } +} + +function onEndCurrentAni_po_elementalmaster_bykk_kak(obj) +{ + if(!obj) return; + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").get_vector(0); + local subtype = obj.getVar("subtype").get_vector(0); + local state = obj.getVar("state").get_vector(0); + + switch(skillIndex){ + case ELEMENTALMASTER_SKILL_ARCTICPISTE://極冰綻放 + switch(subtype){ + case 1: + case 2: + switch(state){ + case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; + case 22: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + case 3: + case 4: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case ELEMENTALMASTER_SKILL_BLACKHOLE://黑洞 + switch(subtype){ + case 1: + case 2: + switch(state){ + case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; + case 22: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + } + break; + case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND://聖靈水晶 + switch(subtype){ + case 1: + switch(state){ + case 20: + case 21: + case 22: + case 23: + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 24: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 2: + case 3: + case 4: + switch(state){ + case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; + case 22: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN://元素點燃 + switch(subtype){ + case 1: + case 2: + case 3: + case 4: + switch(state){ + case 20: + case 22: + obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 23: + case 25: + case 28: + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 27: + obj.addSetStatePacket(24, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case 15: + if(state == 20) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 150: + sq_SendDestroyPacketPassiveObject(obj); + break; + case 16: + if(state == 21) obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); + else if(state == 22 || state == 23) sq_SendDestroyPacketPassiveObject(obj); + break; + case 18: + switch(state){ + case 20: + case 21: + case 22: + case 23: + obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 24: sq_SendDestroyPacketPassiveObject(obj); break + } + break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN://元素之幕 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL://元素奧義 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE://元素震蕩 + switch(subtype){ + case 1: sq_SendDestroyPacketPassiveObject(obj); break; + case 2: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER://隕星幻滅 + switch(subtype){ + case 1: + switch(state){ + case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; + case 21: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + } + break; + case ELEMENTALMASTER_SKILL_FLAMESTRIKE://烈焰沖擊 + switch(subtype){ + case 1: + case 3: + if(state == 20) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + else sq_SendDestroyPacketPassiveObject(obj); + break; + case 2: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER://傑克降臨 + if(subtype == 0 || state == 21) sq_SendDestroyPacketPassiveObject(obj); + break; + case ELEMENTALMASTER_SKILL_MIGHTYRUNE://聖靈符文 + break; + case ELEMENTALMASTER_SKILL_SESTOELEMENTO://第六元素 + sq_SendDestroyPacketPassiveObject(obj); + break; + case ELEMENTALMASTER_SKILL_SUNBURST://雷旋 + sq_SendDestroyPacketPassiveObject(obj); + break; + case ELEMENTALMASTER_SKILL_THEGATE://元素之門 + switch(subtype){ + case 1: + switch(state){ + case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; + case 22: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + case 2: sq_SendDestroyPacketPassiveObject(obj); break; + case 10: sq_SendDestroyPacketPassiveObject(obj); break; + case 11: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + case ELEMENTALMASTER_SKILL_THUNDERCALLING://天雷 + sq_SendDestroyPacketPassiveObject(obj); + break; + case ELEMENTALMASTER_SKILL_THUNDERRAGE://光與暗的交響 + sq_SendDestroyPacketPassiveObject(obj); + break; + case ELEMENTALMASTER_SKILL_VOID://虛無之球 + switch(subtype){ + case 1: + case 2: + switch(state){ + case 20: + if(obj.getVar("custom").get_vector(4) > 0) obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + else obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 22: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + } + break; + case ELEMENTALMASTER_SKILL_WALLOFICE://冰牆 + break; + case 38://移動施法 + if(state == 21) sq_SendDestroyPacketPassiveObject(obj); + break; + } + +} + +function onTimeEvent_po_elementalmaster_bykk_kak(obj, timeEventIndex, timeEventCount) +{ + if(!obj) return; + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").get_vector(0); + local subtype = obj.getVar("subtype").get_vector(0); + local state = obj.getVar("state").get_vector(0); + + switch(skillIndex){ + case ELEMENTALMASTER_SKILL_ARCTICPISTE://極冰綻放 + switch(timeEventIndex){ + case 1: + if(timeEventCount >= obj.getVar("custom").get_vector(1)){ + obj.stopTimeEvent(1); + obj.stopTimeEvent(2); + obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + return; + } + obj.resetHitObjectList(); + obj.sq_PlaySound("ARCTICF_MCIRCLE"); + break; + case 2: + local aniPath = ["passiveobject/elementalmaster_bykk/animation/icefield/icefieldnormal1.ani","passiveobject/elementalmaster_bykk/animation/icefield/icefieldnormal2.ani"]; + if(subtype == 2) aniPath = ["passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/icearea_att_3.ani","passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/icearea_att2_3.ani"]; + local sizeRate = obj.getVar("custom").get_vector(0); + local sizeRate_balance = 120; + local randomnumber = sq_getRandom(1,100); + if(randomnumber > 75) sq_AddDrawOnlyAniFromParent(obj,aniPath[sq_getRandom(0,1)],sq_getRandom(-113,113)*sizeRate/sizeRate_balance,sq_getRandom(-71,71)*sizeRate/sizeRate_balance,0); + else if(randomnumber <= 75 && randomnumber > 50) sq_AddDrawOnlyAniFromParent(obj,aniPath[sq_getRandom(0,1)],sq_getRandom(-250,250)*sizeRate/sizeRate_balance,sq_getRandom(-20,20)*sizeRate/sizeRate_balance,0); + else if(randomnumber <= 50 && randomnumber > 25) sq_AddDrawOnlyAniFromParent(obj,aniPath[sq_getRandom(0,1)],sq_getRandom(-172,172)*sizeRate/sizeRate_balance,sq_getRandom(-30,30)*sizeRate/sizeRate_balance,0); + else sq_AddDrawOnlyAniFromParent(obj,aniPath[sq_getRandom(0,1)],sq_getRandom(-217,217)*sizeRate/sizeRate_balance,sq_getRandom(-43,43)*sizeRate/sizeRate_balance,0); + obj.sq_PlaySound("ARCTICF_ICE_OUT"); + break; + case 3: + local pooledObj = createOnlyDrawObject_elementalmaster_bykk(obj,"passiveobject/elementalmaster_bykk/animation/flamestrike/lv95assimilate/flamestrikebottoma_00.ani",true,obj.getDirection(),sq_GetXPos(obj),sq_GetYPos(obj),sq_GetZPos(obj),ENUM_DRAWLAYER_BOTTOM); + local sizeRate = obj.getVar("custom").get_vector(0); + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = pooledObj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + break; + } + break; + case ELEMENTALMASTER_SKILL_BLACKHOLE://黑洞 + switch(timeEventIndex){ + case 0: + switch(subtype){ + case 1: + case 2: + obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 3: sq_SendDestroyPacketPassiveObject(obj); break; + } + break; + case 1: obj.resetHitObjectList(); break; + case 2: + local sub = obj.getVar("custom").get_vector(6); + if(sub > 0){ + local sizeRate = obj.getVar("custom").get_vector(0) / 2; + local attractPower = obj.getVar("custom").get_vector(1) * 150 / 100; + local range = obj.getVar("custom").get_vector(2); + local totalDamage2 = obj.getVar("custom").get_vector(3) * 25 / 100; + local lifeTime = obj.getVar("custom").get_vector(4) / 2; + local totalDamage = obj.getVar("custom").get_vector(5) * 25 / 100; + local hitTime = obj.getVar("custom").get_vector(7); + local damageRate = totalDamage2 / totalDamage * 100; + cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj),obj.getDirection(),ELEMENTALMASTER_SKILL_BLACKHOLE,subtype,totalDamage,sizeRate,lifeTime,damageRate,attractPower,range,0,hitTime,0,0); + } + break; + case 3: + obj.stopSound(20); + obj.sq_PlaySound("NIGHTH_LOOP",20); + break; + } + break; + case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND://聖靈水晶 + switch(timeEventIndex){ + case 1: obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); break; + case 2: obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN://元素點燃 + switch(subtype){ + case 1: + case 2: + case 3: + case 4: + switch(timeEventIndex){ + case 0: + sqrChr.getVar("elementalchain").setBool(0, false); + sq_SendDestroyPacketPassiveObject(obj); + break; + case 1: + local addAppendage = CNSquirrelAppendage.sq_GetAppendage(sqrChr,"character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut"); + if(!addAppendage) return; + addAppendage.getVar().setBool(subtype, false); + setElementalChainBuff_bykk(sqrChr,ELEMENTALMASTER_SKILL_ELEMENTALCHAIN,addAppendage); + if(obj.getVar("custom").get_vector(1) > 0) obj.addSetStatePacket(27, null, STATE_PRIORITY_AUTO, false, ""); + else obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case 150: + local sizeRate = obj.getVar("custom").get_vector(0); + sizeRate = sizeRate.tofloat() / 1000.0; + switch(timeEventIndex){ + case 1: + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/common/animation/fireexplosionparticle1.ani", sq_getRandom(-10,10), sq_getRandom(-10,10), sq_getRandom(-10,10)); + local currentAni = pooledObj.getCurrentAnimation(); + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + break; + case 2: + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/common/animation/fireexplosionparticle2.ani", 0, 2, 0); + local currentAni = pooledObj.getCurrentAnimation(); + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + break; + case 3: + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/common/animation/fireexplosionparticle3.ani", 0, 1, 1); + local currentAni = pooledObj.getCurrentAnimation(); + local angle = sq_ToRadian(360.0 * timeEventCount / 16); + sq_SetfRotateAngle(currentAni, angle); + currentAni.setImageRateFromOriginal(sizeRate * 2.0, sizeRate * 2.0); + break; + case 4: + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/common/animation/fireexplosionparticle4.ani", sq_getRandom(-30,30), sq_getRandom(-30,30), sq_getRandom(-30,30)); + local currentAni = pooledObj.getCurrentAnimation(); + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + break; + } + break; + case 16: + switch(timeEventIndex){ + case 0: obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, ""); break; + case 1: obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); break; + } + break; + case 17: + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN://元素之幕 + switch(timeEventIndex){ + case 0: + local hitMax = obj.getVar("custom").get_vector(2); + if(timeEventCount >= hitMax - 2 && obj.getVar().getBool(0) == false){ + obj.getVar().setBool(0,true); + local totalDamage = obj.getVar("custom").get_vector(1); + local sizeRate = obj.getVar("custom").get_vector(0); + cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj),obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN,4,totalDamage,sizeRate,0,0,0,0,0,0,0,0); + } + if(timeEventCount >= hitMax){obj.stopTimeEvent(0);return;} + obj.resetHitObjectList(); + break; + case 1: + if(subtype == 1 && obj.getVar("custom").get_vector(4) > 0){ + local size = obj.getVar("targetObj").get_obj_vector_size(); + if(size > 0){ + for(local i = 0; i < size; i++){ + local targetObj = obj.getVar("targetObj").get_obj_vector(i); + if(targetObj){ + local activeObj = sq_GetCNRDObjectToActiveObject(targetObj); + if(activeObj.getVar("elementalcurtain").getBool(0) == true) activeObj.getVar("elementalcurtain").setBool(0, false); + } + } + } + } + if(subtype == 1){ + local size = obj.getVar("target").get_obj_vector_size(); + if(size > 0){ + for(local i = 0; i < size; i++){ + local targetObj = obj.getVar("target").get_obj_vector(i); + if(targetObj) CNSquirrelAppendage.sq_RemoveAppendage(targetObj, "character/mage/elementalmaster_bykk/ap/ap_elementalcurtain.nut"); + } + } + } + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL://元素奧義 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE://元素震蕩 + switch(timeEventIndex){ + case 1: + local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalquake/quakebottom_crack.ani"); + obj.setCurrentAnimation(ani); + local totalDamage = obj.getVar("custom").get_vector(0); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 12)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + local attackInfo = sq_GetCurrentAttackInfo(obj); + if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); + if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); + if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); + if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); + local sizeRate = obj.getVar("custom").get_vector(2); + sizeRate = sizeRate.tofloat() / 100.0; + local pAni = obj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate); + sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM); + break; + case 2: + local totalDamage = obj.getVar("custom").get_vector(0) * 10 / 100; + local sizeRate = obj.getVar("custom").get_vector(2); + cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj),obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALQUAKE,2,totalDamage,sizeRate,0,0,0,0,0,0,0,0); + break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER://隕星幻滅 + switch(timeEventIndex){ + case 1: + local baseZ = obj.getVar("custom").getInt(12); + local MoveZ = sq_GetUniformVelocity(baseZ, 0, timeEventCount, 13); + sq_setCurrentAxisPos(obj, 2, MoveZ); + if(timeEventCount >= 13){ + sq_SetMyShake(obj, 20, 200); + local randomnumber = obj.getVar("custom").getInt(11); + switch(randomnumber){ + case 1: obj.sq_PlaySound("DARK_CHASER"); break; + case 1: obj.sq_PlaySound("FIRE_CHASER"); break; + case 1: obj.sq_PlaySound("LIGHT_CHASER"); break; + case 1: obj.sq_PlaySound("WATER_CHASER"); break; + } + } + break; + } + break; + case ELEMENTALMASTER_SKILL_FLAMESTRIKE://烈焰沖擊 + break; + case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER://傑克降臨 + switch(timeEventIndex){ + case 0: obj.resetHitObjectList(); break; + case 1: if(sq_GetZPos(obj) <= 0) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break; + case 2: + local sizeRate = obj.getVar("custom").get_vector(0); + local sizeRate2 = obj.getVar("custom").get_vector(1); + local damageRate = obj.getVar("custom").get_vector(2); + local totalDamage = obj.getVar("custom").get_vector(3); + local sub = obj.getVar("custom").get_vector(4); + local typesub = obj.getVar("custom").get_vector(5); + cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,-500,0,sq_GetZPos(obj) + 400,obj.getDirection(),ELEMENTALMASTER_SKILL_HALLOWEENBUSTER,typesub,totalDamage,sizeRate,sizeRate2,damageRate,sub,0,0,0,0,0); + break; + case 3: sq_SendDestroyPacketPassiveObject(obj); break; + case 4: obj.setTimeEvent(2,200,obj.getVar("custom").get_vector(6),true); break; + case 5: + local x = sq_GetUniformVelocity(0, 500, timeEventCount, 40); + local moveX = sq_GetDistancePos(obj.getVar("move").getInt(10), obj.getDirection(), x); + local moveZ = sq_GetUniformVelocity(obj.getVar("move").getInt(11), 0, timeEventCount, 40); + sq_setCurrentAxisPos(obj, 0, moveX); + sq_setCurrentAxisPos(obj, 2, moveZ); + if(timeEventCount >= 40) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case ELEMENTALMASTER_SKILL_MIGHTYRUNE://聖靈符文 + break; + case ELEMENTALMASTER_SKILL_SESTOELEMENTO://第六元素 + if(timeEventIndex == 1) obj.resetHitObjectList(); + break; + case ELEMENTALMASTER_SKILL_SUNBURST://雷旋 + switch(timeEventIndex){ + case 1: + sqrChr.sq_IntVectClear(); + sqrChr.sq_IntVectPush(21); + sqrChr.sq_IntVectPush(31); + sqrChr.sq_IntVectPush(3); + sqrChr.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_ELEMENTALCHAIN, STATE_PRIORITY_IGNORE_FORCE, true); + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case ELEMENTALMASTER_SKILL_THEGATE://元素之門 + switch(timeEventIndex){ + case 1: + local create_number = obj.getVar("custom").get_vector(1); + local totalDamage = obj.getVar("custom").get_vector(0); + local sub = obj.getVar("custom").get_vector(3); + cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj) - 20,obj.getDirection(),ELEMENTALMASTER_SKILL_THEGATE,2,totalDamage,sub,0,0,0,0,0,0,0,0); + if(timeEventCount >= create_number){ + obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + return; + } + break; + case 2: + local targetObj = obj.getVar("tar").get_obj_vector(0); + if(targetObj) sq_SendHitObjectPacket(obj,targetObj,0,0,33); + break; + } + break; + case ELEMENTALMASTER_SKILL_THUNDERCALLING://天雷 + switch(timeEventIndex){ + case 0: break; + case 1: sq_SetMyShake(obj,2,100); break; + case 2: + local totalDamage = obj.getVar("custom").get_vector(0); + local sizeRate = obj.getVar("custom").get_vector(1); + local range = obj.getVar("custom").get_vector(3); + local sub = obj.getVar("custom").get_vector(4); + local prob = obj.getVar("custom").get_vector(6); + local level = obj.getVar("custom").get_vector(7); + local time = obj.getVar("custom").get_vector(8); + cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj),obj.getDirection(),ELEMENTALMASTER_SKILL_THUNDERCALLING,sub,totalDamage,sizeRate,range,prob,level,time,0,0,0,0); + if(obj.getVar().getBool(0) == false && sub == 2){ + if(range <= 0) return; + monsterpulled_elementalmaster_bykk(sqrChr,obj,0,0,0,200,range); + } + break; + case 3: sq_SendDestroyPacketPassiveObject(obj); break; + case 4: + local hitTime = obj.getVar("custom").get_vector(5); + local countMax = obj.getVar("custom").get_vector(2); + obj.setTimeEvent(2,hitTime,countMax,true); + break; + } + break; + case ELEMENTALMASTER_SKILL_THUNDERRAGE://光與暗的交響 + if(timeEventIndex == 1) obj.resetHitObjectList(); + break; + case ELEMENTALMASTER_SKILL_VOID://虛無之球 + switch(subtype){ + case 1: + switch(timeEventIndex){ + case 0: obj.resetHitObjectList(); break; + case 1: + local shoot_range = obj.getVar("custom").get_vector(0); + local baseX = obj.getVar("custom").get_vector(1); + if(sq_Abs(sq_GetXPos(obj) - baseX) > shoot_range){ + obj.stopTimeEvent(0); + sq_SendDestroyPacketPassiveObject(obj); + } + break; + } + break; + case 2: + if(timeEventIndex == 0) obj.resetHitObjectList(); + else if(timeEventIndex == 1) obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case ELEMENTALMASTER_SKILL_WALLOFICE://冰牆 + break; + case 38://移動施法 + if(timeEventIndex == 0) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + +} diff --git a/user/116.205.165.25/test2.nut b/user/116.205.165.25/test2.nut new file mode 100644 index 0000000..3e15023 --- /dev/null +++ b/user/116.205.165.25/test2.nut @@ -0,0 +1,2679 @@ + +function onAttack_po_elementalmaster_bykk_kak(obj, damager, boundingBox, isStuck) +{ + if(!obj) return; + //enableClearDeadEnemies(obj, damager); + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").get_vector(0); + local subtype = obj.getVar("subtype").get_vector(0); + local state = obj.getVar("state").get_vector(0); + + switch(skillIndex){ + case ELEMENTALMASTER_SKILL_ARCTICPISTE://極冰綻放 + if(damager.isObjectType(OBJECTTYPE_ACTIVE) && damager.getState() != STATE_DIE){ + local activeObj = sq_GetCNRDObjectToActiveObject(damager); + local minus_Rate = obj.getVar("custom").get_vector(4); + if(!sq_IsFixture(activeObj) && activeObj.getVar().getInt(100) < 1){ + activeObj.getVar().setInt(100,100); + local ap = sq_CreateChangeStatus(CHANGE_STATUS_TYPE_MOVE_SPEED, true, -minus_Rate.tofloat(), 0); + if(ap){ + ap.getAppendageInfo().setValidTime(3000); + ap.sq_Append(activeObj, obj); + } + } + } + break; + case ELEMENTALMASTER_SKILL_BLACKHOLE://黑洞 + break; + case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND://聖靈水晶 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN://元素點燃 + switch(subtype){ + case 15: + switch(state){ + case 21: + local totalDamage = obj.getVar("custom").get_vector(4); + local powerDamage = obj.getVar("custom").get_vector(5); + local sizeRate = obj.getVar("custom").get_vector(1); + cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj),obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALCHAIN,150,totalDamage,powerDamage,sizeRate,0,0,0,0,0,0,0); + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 16: + obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 17: + local speed_time = obj.getVar("custom").get_vector(8); + local movespeed_rate = obj.getVar("custom").get_vector(9); + local attackspeed_rate = obj.getVar("custom").get_vector(10); + local ap = sq_CreateChangeStatus(CHANGE_STATUS_TYPE_MOVE_SPEED, true, -(movespeed_rate * 0.1).tofloat(), speed_time); + local ap2 = sq_CreateChangeStatus(CHANGE_STATUS_TYPE_ATTACK_SPEED, true, -(attackspeed_rate * 0.1).tofloat(), speed_time); + if(ap && damager.getVar().getBool(0) == false) {damager.getVar().setBool(0,true);ap.sq_Append(damager, obj);} + if(ap2 && damager.getVar().getBool(1) == false) {damager.getVar().setBool(1,true);ap2.sq_Append(damager, obj);} + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN://元素之幕 + if(damager.isObjectType(OBJECTTYPE_ACTIVE)){ + damager = sq_GetCNRDObjectToActiveObject(damager); + if(damager.getState() == STATE_DIE) return; + switch(subtype){ + case 1: + sq_AddDrawOnlyAniFromParent(damager,"passiveobject/elementalmaster_bykk/animation/elementalcurtain/elementalcurtain_hit.ani",0,0,sq_GetCenterZPos(boundingBox)); + if(damager.getVar("elementalcurtain").getBool(0) == false && obj.getVar("custom").get_vector(4) > 0){ + damager.getVar("elementalcurtain").setBool(0, true); + obj.getVar("targetObj").push_obj_vector(damager); + local totalDamage = obj.getVar("custom").get_vector(3) * 45 / 100; + cearteSkillPassive_Elementalmaster_bykk(sqrChr,damager,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj) + 380,obj.getDirection(),ELEMENTALMASTER_SKILL_THEGATE,1,totalDamage,20,100,sq_getRandom(1,4),sq_GetGroup(damager),sq_GetUniqueId(damager),0,0,0,0); + } + if(damager.isObjectType(OBJECTTYPE_ACTIVE) && !CNSquirrelAppendage.sq_IsAppendAppendage(damager, "character/mage/elementalmaster_bykk/ap/ap_elementalcurtain.nut")){ + obj.getVar("target").push_obj_vector(damager); + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(damager, obj, -1, false, "character/mage/elementalmaster_bykk/ap/ap_elementalcurtain.nut", true); + sq_HoldAndDelayDie(damager, obj, true, false, false, 200, 200, ENUM_DIRECTION_NEUTRAL , AddAppendage); + } + break; + case 2: + sq_AddDrawOnlyAniFromParent(damager,"passiveobject/elementalmaster_bykk/animation/elementalcurtain/elementalcurtain_finishhit.ani",0,0,sq_GetCenterZPos(boundingBox)); + break; + } + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL://元素奧義 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE://元素震蕩 + if(damager.isObjectType(OBJECTTYPE_ACTIVE)){ + if(!CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/elementalmaster_bykk/skillnut/ap_elementalquake.nut")){ + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(damager, obj, -1, false, "character/mage/elementalmaster_bykk/skillnut/ap_elementalquake.nut", true); + sq_HoldAndDelayDie(damager, obj, true, true, true, 200, 200, ENUM_DIRECTION_NEUTRAL , AddAppendage); + } + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER://隕星幻滅 + break; + case ELEMENTALMASTER_SKILL_FLAMESTRIKE://烈焰沖擊 + switch(subtype){ + case 2: + if(damager.isObjectType(OBJECTTYPE_ACTIVE)){ + damager = sq_GetCNRDObjectToActiveObject(damager); + if(CNSquirrelAppendage.sq_IsAppendAppendage(damager, "character/mage/elementalmaster_bykk/ap/ap_flamestrike.nut")) CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_flamestrike.nut"); + local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(damager, obj, -1, false, "character/mage/elementalmaster_bykk/ap/ap_flamestrike.nut", true); + local time = 600 + obj.getVar("custom").get_vector(2); + AddAppendage.sq_SetValidTime(time); + sq_HoldAndDelayDie(damager, obj, true, true, true, 50, 300, ENUM_DIRECTION_NEUTRAL , AddAppendage); + local sizeRate = obj.getVar("custom").get_vector(0); + local totalDamage = obj.getVar("custom").get_vector(1); + local group = sq_GetGroup(damager); + local uniqueId = sq_GetUniqueId(damager); + cearteSkillPassive_Elementalmaster_bykk(sqrChr,damager,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj),ENUM_DIRECTION_RIGHT,ELEMENTALMASTER_SKILL_FLAMESTRIKE,3,totalDamage,sizeRate,group,uniqueId,0,0,0,0,0,0); + } + break; + } + break; + case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER://傑克降臨 + break; + case ELEMENTALMASTER_SKILL_MIGHTYRUNE://聖靈符文 + break; + case ELEMENTALMASTER_SKILL_SESTOELEMENTO://第六元素 + break; + case ELEMENTALMASTER_SKILL_SUNBURST://雷旋 + break; + case ELEMENTALMASTER_SKILL_THEGATE://元素之門 + switch(subtype){ + case 2: + local sub = obj.getVar("custom").get_vector(1); + local aniPath2 = "light"; + switch(sub){ + case 2: aniPath2 = "ice"; break; + case 3: aniPath2 = "fire"; break; + case 4: aniPath2 = "dark"; break; + } + sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/thegate/"+aniPath2+"/"+aniPath2+"_shock.ani",0,0,0); + sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case ELEMENTALMASTER_SKILL_THUNDERCALLING://天雷 + break; + case ELEMENTALMASTER_SKILL_THUNDERRAGE://光與暗的交響 + break; + case ELEMENTALMASTER_SKILL_VOID://虛無之球 + break; + case ELEMENTALMASTER_SKILL_WALLOFICE://冰牆 + break; + case 38://移動施法 + break; + } + +} + +function onKeyFrameFlag_po_elementalmaster_bykk_kak(obj, flagIndex) +{ + if(!obj) return; + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").get_vector(0); + local subtype = obj.getVar("subtype").get_vector(0); + local state = obj.getVar("state").get_vector(0); + + switch(skillIndex){ + case ELEMENTALMASTER_SKILL_ARCTICPISTE://極冰綻放 + if(flagIndex == 1){ + local sizeRate = obj.getVar("custom").getInt(10); + sizeRate = sizeRate.tofloat() / 100.0; + local pooledObj = sq_AddDrawOnlyAniFromParent(obj, "passiveobject/elementalmaster_bykk/animation/icefield/new/icefielddisappear1.ani", 0, 0, 0); + local pAni = pooledObj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + } + break; + case ELEMENTALMASTER_SKILL_BLACKHOLE://黑洞 + break; + case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND://聖靈水晶 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN://元素點燃 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN://元素之幕 + switch(flagIndex){ + case 1: sq_SetMyShake(obj,8,200); break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL://元素奧義 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE://元素震蕩 + switch(flagIndex){ + case 1: + sq_flashScreen(obj,0, 50, 150, 51, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + sq_SetMyShake(obj,6,360); + break; + case 2: + obj.resetHitObjectList(); + break; + case 3: + sq_flashScreen(obj,0, 50, 200, 76, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + sq_SetMyShake(obj,7,360); + break; + case 4: + sq_flashScreen(obj,0, 300, 300, 102, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + sq_SetMyShake(obj,8,500); + break; + case 5: + local totalDamage = obj.getVar("custom").get_vector(0); + local damageRate = obj.getVar("custom").get_vector(1); + totalDamage = totalDamage * damageRate / 100; + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 12)); + sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + if(obj.getVar("custom").get_vector(3) < 1){ + if(sqrChr){ + sqrChr.sq_IntVectClear(); + sqrChr.sq_IntVectPush(3); + sqrChr.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, STATE_PRIORITY_USER, true); + } + } + break; + case 6: + sq_flashScreen(obj,0, 60, 500, 127, sq_RGB(255,255,255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + sq_SetMyShake(obj,10,500); + break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER://隕星幻滅 + break; + case ELEMENTALMASTER_SKILL_FLAMESTRIKE://烈焰沖擊 + break; + case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER://傑克降臨 + break; + case ELEMENTALMASTER_SKILL_MIGHTYRUNE://聖靈符文 + break; + case ELEMENTALMASTER_SKILL_SESTOELEMENTO://第六元素 + break; + case ELEMENTALMASTER_SKILL_SUNBURST://雷旋 + break; + case ELEMENTALMASTER_SKILL_THEGATE://元素之門 + switch(flagIndex){ + case 25: + local totalDamage = obj.getVar("custom").getInt(0); + local sub = obj.getVar("custom").getInt(1); + local group = obj.getVar("custom").getInt(2); + local uniqueId = obj.getVar("custom").getInt(3); + local targetObj = sq_GetObject(obj, group, uniqueId); + if(targetObj && targetObj.getState() != STATE_DIE){ + cearteSkillPassive_Elementalmaster_bykk(obj,targetObj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,0,obj.getDirection(),ELEMENTALMASTER_SKILL_THEGATE,11,totalDamage,sub,group,uniqueId,0,0,0,0,0,0); + } + break; + } + break; + case ELEMENTALMASTER_SKILL_THUNDERCALLING://天雷 + break; + case ELEMENTALMASTER_SKILL_THUNDERRAGE://光與暗的交響 + break; + case ELEMENTALMASTER_SKILL_VOID://虛無之球 + if(subtype == 1 && flagIndex == 1){ + local currentAni = obj.getCurrentAnimation(); + currentAni.addLayerAnimation(3,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/void/void4.ani"),true); + } + if(subtype == 2 && flagIndex == 1){ + local hitTime = obj.getVar("custom").get_vector(0); + print("hittime = "+hitTime); + obj.setTimeEvent(0,hitTime,-1,false); + } + break; + case ELEMENTALMASTER_SKILL_WALLOFICE://冰牆 + break; + case 38://移動施法 + break; + } + +} + +function procAppend_po_elementalmaster_bykk_kak(obj) +{ + if(!obj) return; + local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter()); + local skillIndex = obj.getVar("skillIndex").get_vector(0); + local subtype = obj.getVar("subtype").get_vector(0); + local state = obj.getVar("state").get_vector(0); + + switch(skillIndex){ + case ELEMENTALMASTER_SKILL_ARCTICPISTE://極冰綻放 + break; + case ELEMENTALMASTER_SKILL_BLACKHOLE://黑洞 + break; + case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND://聖靈水晶 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN://元素點燃 + switch(subtype){ + case 1: + case 2: + case 3: + case 4: + if(!sqrChr || sqrChr.getState() == STATE_DIE){sq_SendDestroyPacketPassiveObject(obj); break;} + switch(state){ + case 28: + case 29: + local currentT = sq_GetObjectTime(obj); + local currentSpeedRate = 1.0 ; + local defaultRoundTime = 5120; + + local radius = 50; + local base100Angle = 0; + switch(subtype){ + case 1: base100Angle = 4500; break; + case 2: base100Angle = 13500; break; + case 3: base100Angle = 22500; break; + case 4: base100Angle = 31500; break; + } + local baseX = sqrChr.getXPos(); + local baseY = sqrChr.getYPos(); + local current100Angle = (base100Angle + (36000 * currentSpeedRate * currentT / defaultRoundTime)) % 36000; + local angle = (current100Angle.tofloat() / 100.0); + + local disMovLen = radius * sq_CosTable(angle.tointeger()); + local mov_x = sq_GetDistancePos(baseX, ENUM_DIRECTION_LEFT, disMovLen.tointeger()); + + local axisMagnifyRate = 50 * 0.5; + local upMovLen = radius * sq_SinTable(angle.tointeger()) * axisMagnifyRate / 100; + + local mov_y = baseY + upMovLen.tointeger(); + local mov_z = sq_GetZPos(sqrChr) + 35; + local offset_z = 13; + if(subtype == 2 || subtype == 4) offset_z = -13; + if(currentT % defaultRoundTime <= 1280 && currentT % defaultRoundTime > 0) mov_z = mov_z + sq_GetUniformVelocity(0, offset_z, currentT % defaultRoundTime, 1280); + else if(currentT % defaultRoundTime <= 2560 && currentT % defaultRoundTime > 1280) mov_z = mov_z + sq_GetUniformVelocity(offset_z, 0, currentT % defaultRoundTime - 1280, 1280); + else if(currentT % defaultRoundTime <= 3840 && currentT % defaultRoundTime > 2560) mov_z = mov_z + sq_GetUniformVelocity(0, -offset_z, currentT % defaultRoundTime - 2560, 1280); + else if(currentT % defaultRoundTime <= 5120 && currentT % defaultRoundTime > 3840) mov_z = mov_z + sq_GetUniformVelocity(-offset_z, 0, currentT % defaultRoundTime - 3840, 1280); + + sq_setCurrentAxisPos(obj, 0, mov_x); + sq_setCurrentAxisPos(obj, 1, mov_y); + sq_setCurrentAxisPos(obj, 2, mov_z);//sqrChr.getZPos() + 30); + break; + } + break; + case 15: + switch(state){ + case 21: + local pAni = obj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + local fireT = 800; + local srcX = obj.getVar("custom").get_vector(3); + local MoveX = obj.getVar("custom").get_vector(2) * 4 / 10; + local v = sq_GetUniformVelocity(0, MoveX, currentT, fireT); + local dstX = sq_GetDistancePos(srcX, obj.getDirection(), v); + sq_setCurrentAxisPos(obj, 0, dstX); + if(currentT > fireT) sq_SendDestroyPacketPassiveObject(obj); + break; + } + break; + case 16: + switch(state){ + case 20: + local pAni = obj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + local fireT = 500; + local srcX = obj.getVar("custom").get_vector(1); + local srcY = obj.getVar("custom").get_vector(2); + local srcZ = obj.getVar("custom").get_vector(3); + local MoveX = obj.getVar("custom").get_vector(4); + local MoveY = obj.getVar("custom").get_vector(5); + local MoveZ = obj.getVar("custom").get_vector(6); + if(MoveY != 0){ + if(MoveY > 8) MoveY = 8; + else if(MoveY < -8) MoveY = -8; + local vy = sq_GetUniformVelocity(0, MoveY, currentT, fireT); + sq_setCurrentAxisPos(obj, 1, srcY + vy); + } + local vx = sq_GetUniformVelocity(0, MoveX, currentT, fireT); + local dstX = sq_GetDistancePos(srcX, obj.getDirection(), vx);//根據方向運算當前數值 + sq_setCurrentAxisPos(obj, 0, dstX);//設置當前x坐標 + local vz = 0; + if(MoveZ > 0){ + vz = sq_GetAccel(0, MoveZ, currentT, fireT, true); + if(currentT > 250) vz = sq_GetAccel(MoveZ, 0, currentT, fireT, false); + } + else{ + vz = sq_GetAccel(sq_GetZPos(obj), 0, currentT, fireT, false); + currentT = currentT + 250; + } + sq_setCurrentAxisPos(obj, 2, vz);//設置當前x坐標 + if(currentT >= fireT) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case 17: + local currentT = sq_GetObjectTime(obj); + local currentSpeedRate = 1.0 ; + local defaultRoundTime = 1200; + + local radius = 65; + local base100Angle = obj.getVar("custom").get_vector(0) * 100; + + local baseX = obj.getVar("custom").get_vector(1); + local baseY = obj.getVar("custom").get_vector(2); + local current100Angle = (base100Angle + (36000 * currentSpeedRate * currentT / defaultRoundTime)) % 36000; + local angle = (current100Angle.tofloat() / 100.0); + + local disMovLen = radius * sq_CosTable(angle.tointeger()); + local mov_x = sq_GetDistancePos(baseX, ENUM_DIRECTION_LEFT, disMovLen.tointeger()); + + local axisMagnifyRate = radius * 0.5; + local upMovLen = radius * sq_SinTable(angle.tointeger()) * axisMagnifyRate / 100; + + local mov_y = baseY + upMovLen.tointeger(); + + sq_setCurrentAxisPos(obj, 0, mov_x); + sq_setCurrentAxisPos(obj, 1, mov_y); + break; + case 18: + switch(state){ + case 21: + local pAni = obj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + local fireT = 300; + local speed_rate = obj.getVar("custom").get_vector(1); + if(speed_rate > 0) fireT = fireT * (1000 - speed_rate) / 1000; + local srcX = obj.getVar("custom").get_vector(3); + local srcZ = obj.getVar("custom").get_vector(4); + local MoveX = obj.getVar("custom").get_vector(2); + local v = sq_GetUniformVelocity(0, MoveX, currentT, fireT); + local vz = sq_GetUniformVelocity(srcZ, 0, currentT, fireT); + local dstX = sq_GetDistancePos(srcX, obj.getDirection(), v); + sq_setCurrentAxisPos(obj, 0, dstX); + sq_setCurrentAxisPos(obj, 2, vz); + if(currentT > fireT) obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + case 23: + if(!sqrChr) sq_SendDestroyPacketPassiveObject(obj); + local pAni = obj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + local fireT = 400; + local speed_rate = obj.getVar("custom").get_vector(1); + if(speed_rate > 0) fireT = fireT * (1000 - speed_rate) / 1000; + if(sq_GetDistanceObject(obj, sqrChr, false) < 20){ + obj.addSetStatePacket(24, null, STATE_PRIORITY_AUTO, false, ""); + } + local srcZ = obj.getVar("custom").get_vector(4); + local X1 = sq_GetAccel(obj.getXPos(), sqrChr.getXPos(), currentT, fireT, true); + local Y1 = sq_GetAccel(obj.getYPos(), sqrChr.getYPos(), currentT, fireT, true); + local vz = sq_GetAccel(0, srcZ * 2, currentT, fireT, true); + sq_setCurrentAxisPos(obj, 0, X1); + sq_setCurrentAxisPos(obj, 1, Y1); + sq_setCurrentAxisPos(obj, 2, vz); + break; + } + break; + } + break; + case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN://元素之幕 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL://元素奧義 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE://元素震蕩 + break; + case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER://隕星幻滅 + break; + case ELEMENTALMASTER_SKILL_FLAMESTRIKE://烈焰沖擊 + break; + case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER://傑克降臨 + break; + case ELEMENTALMASTER_SKILL_MIGHTYRUNE://聖靈符文 + break; + case ELEMENTALMASTER_SKILL_SESTOELEMENTO://第六元素 + break; + case ELEMENTALMASTER_SKILL_SUNBURST://雷旋 + break; + case ELEMENTALMASTER_SKILL_THEGATE://元素之門 + switch(subtype){ + case 1: + switch(state){ + case 20: + case 21: + local targetObj = obj.getVar().get_obj_vector(0); + if(!targetObj || targetObj.getState() == STATE_DIE) obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + break; + } + break; + case 2: + local pAni = obj.getCurrentAnimation(); + local currentT = sq_GetCurrentTime(pAni); + local fireT = pAni.getDelaySum(false); + local srcZ = obj.getVar("custom").get_vector(0); + local v = sq_GetUniformVelocity(srcZ, 0, currentT, fireT); + sq_setCurrentAxisPos(obj, 2, v); + break; + } + break; + case ELEMENTALMASTER_SKILL_THUNDERCALLING://天雷 + break; + case ELEMENTALMASTER_SKILL_THUNDERRAGE://光與暗的交響 + break; + case ELEMENTALMASTER_SKILL_VOID://虛無之球 + break; + case ELEMENTALMASTER_SKILL_WALLOFICE://冰牆 + break; + case 38://移動施法 + break; + } +} + +function proc_appendage_elementalquake_bykk(appendage) +{ + local sourceObj = appendage.getSource(); + if(!sourceObj){ + appendage.setValid(false); + return; + } +} + +function checkExecutableSkill_Arcticpiste_bykk(obj) +{ + // print("test Arcticpiste"); + return 1; +} + +function onSetState_Arcticpiste_bykk(obj, state, datas, isResetTimer) +{ +} + +function onEndCurrentAni_Arcticpiste_bykk(obj) +{ +} + +function onProcCon_Arcticpiste_bykk(obj) +{ +} + +function onKeyFrameFlag_Arcticpiste_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_Arcticpiste_bykk(obj, timeEventIndex, timeEventCount) +{ +} + +function onEndState_Arcticpiste_bykk(obj, new_state) +{ +} + +function checkExecutableSkill_BlackHole_bykk(obj) +{ + // print("test BlackHole"); + return 1; +} + +function onSetState_BlackHole_bykk(obj, state, datas, isResetTimer) +{ +} + +function onEndCurrentAni_BlackHole_bykk(obj) +{ +} + +function onProcCon_BlackHole_bykk(obj) +{ +} + +function onKeyFrameFlag_BlackHole_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_BlackHole_bykk(obj, timeEventIndex, timeEventCount) +{ +} + +function onEndState_BlackHole_bykk(obj, new_state) +{ +} + +function checkExecutableSkill_Crystalofovermind_bykk(obj) +{ + // print("test Crystalofovermind"); + local istalisman = obj.getVar("crystal_talisman").getInt(0); + if(istalisman > 0){ + local crystalObj = obj.getVar("crystal").get_obj_vector(0); + if(crystalObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(crystalObj); + local state = colObj.getState(); + if(state <= 23){ + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND); + local totalDamage = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND, 0, skill_level); + switch(state){ + case 20: totalDamage = totalDamage * 80 / 100; break; + case 21: totalDamage = totalDamage * 90 / 100; break; + case 22: totalDamage = totalDamage * 100 / 100; break; + case 23: totalDamage = totalDamage * 125 / 100; break; + } + colObj.getVar("custom").setInt(2,totalDamage); + colObj.addSetStatePacket(24, null, STATE_PRIORITY_AUTO, false, ""); + obj.getVar("crystal_talisman").setInt(0,0); + } + } + } + local b_useskill = obj.sq_IsUseSkill(ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND); + if(b_useskill){ + obj.sq_IsEnterSkillLastKeyUnits(ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND, STATE_PRIORITY_USER, true); + return 1; + } + return 0; +} + +function onSetState_Crystalofovermind_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + local Ani = obj.sq_GetThrowChargeAni(1); + obj.setCurrentAnimation(Ani); + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND); + local castTime = sq_GetCastTime(obj, ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND, skill_level); + if(castTime > 1000){local pAni = obj.getCurrentAnimation();sq_SetFrameDelayTime(pAni, 1, castTime);} + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + local pAni = obj.getCurrentAnimation(); + local delaySum = pAni.getDelaySum(false); + sq_StartDrawCastGauge(obj, delaySum, true); + obj.getVar("crystal").setInt(1,delaySum); + //音效 + if(sq_getRandom(1,100) > 50) obj.sq_PlaySound("WZ_CRYSTALOVERMIND_01_1"); + else obj.sq_PlaySound("WZ_CRYSTALOVERMIND_01_2"); + //设置效果 + sq_SetBodyEffect(obj, obj, true, sq_RGB(255, 255, 255), 100, 200, 999000, sq_ALPHA(100)); + //蓄气时钟开启 + obj.getVar("Crystalofovermind").clear_ct_vector(); + obj.getVar("Crystalofovermind").push_ct_vector(); + local timer = obj.getVar("Crystalofovermind").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); + //获取蓄气上限 + local energycharge_Max = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND, 3); + local minus_Rate = 0,minus_Rate2 = 0,minus_Rate3 = 0; + local memorize_level = sq_GetSkillLevel(obj, 19); + if(memorize_level > 0){ + minus_Rate = sq_GetLevelData(obj, 19, 1, memorize_level); + } + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut")){ + local magicaltempoup_level = sq_GetSkillLevel(obj, 2); + minus_Rate3 = sq_GetLevelData(obj, 2, 3, magicaltempoup_level); + } + local minus_Rate4 = 1000 - minus_Rate - minus_Rate3; + local fullcharge = 0; + if(minus_Rate4 > 0) energycharge_Max = energycharge_Max * minus_Rate4 / 1000; + else fullcharge = 1; + obj.getVar("moveoncast").setInt(2,energycharge_Max); + + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,80,obj.getDirection(),38,1,energycharge_Max,4,fullcharge,0,0,0,0,0,0,0); + break; + case 1: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_ELEMENTALQUAKE_CASTINGLOOPA_BODY); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/crystalofovermind_summon_body_front.ani",0,0,0); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/crystalofovermind_side_front_start01.ani",250,0,0); + obj.stopSound(18); + //设置效果 + sq_SetBodyEffect(obj, obj, true, sq_RGB(255, 255, 255), 100, 100, 0, sq_ALPHA(100)); + //声音 + if(sq_getRandom(1,100) > 50) obj.sq_PlaySound("WZ_CRYSTALOVERMIND_02_1"); + else obj.sq_PlaySound("WZ_CRYSTALOVERMIND_02_2"); + + local charge_obj = obj.getVar("moveoncast").get_obj_vector(0); + if(charge_obj) charge_obj.setValid(false); + + local timer = obj.getVar("Crystalofovermind").get_ct_vector(0); + local currentT = 0; + if(timer) currentT = timer.Get(); + local energycharge_Max = obj.getVar("moveoncast").getInt(2); + + local xiuzheng = 1; + if(currentT > energycharge_Max) xiuzheng = 0; + + sq_BinaryStartWrite(); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(1); + sq_SendChangeSkillEffectPacket(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN); + + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND); + local totalDamage = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND, 0, skill_level); + local sizeRate = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND, 3 - xiuzheng); + local istalisman = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND, 9); + + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,300,0,0,obj.getDirection(),ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND,1,totalDamage,sizeRate,istalisman,0,0,0,0,0,1,0); + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,300,0,0,obj.getDirection(),ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND,2,sizeRate,0,0,0,0,0,0,0,0,0); + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,300,0,0,obj.getDirection(),ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND,3,sizeRate,0,0,0,0,0,0,0,0,0); + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,300,0,0,obj.getDirection(),ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND,4,sizeRate,0,0,0,0,0,0,0,0,0); + obj.getVar("crystal_talisman").setInt(0,istalisman); + elementalmaster_setelementSkillBonusRate(obj, ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND); + break; + } +} + +function onEndCurrentAni_Crystalofovermind_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 1: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_Crystalofovermind_bykk(obj) +{ + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + local stateTime = obj.sq_GetStateTimer(); + if(stateTime < obj.getVar("crystal").getInt(1)) return; + local bDownKey = obj.isDownSkillLastKey(); + if(!bDownKey){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND, STATE_PRIORITY_USER, true); + } + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_UP, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_DOWN, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_LEFT, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_RIGHT, ENUM_SUBKEY_TYPE_ALL)){ + //移动施法技能大于0时,获取人物身上移动施法AP,push技能子状态及技能编号等 + if(sq_GetSkillLevel(obj, 38) > 0){ + local mocAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_moveoncast.nut"); + if(mocAppendage){ + mocAppendage.getVar().setInt(1, ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND); + mocAppendage.getVar().setBool(0, true); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + } + } + } + break; + } +} + +function onKeyFrameFlag_Crystalofovermind_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_Crystalofovermind_bykk(obj, timeEventIndex, timeEventCount) +{ +} + +function onEndState_Crystalofovermind_bykk(obj, new_state) +{ + if(!obj) return; + if(new_state != ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN){ + sq_EndDrawCastGauge(obj); + } + if(new_state == STATE_DIE || new_state == STATE_DAMAGE || new_state == STATE_DOWN || new_state == STATE_HOLD){ + if(sq_GetSkillLevel(obj, 38) > 0){ + local mocAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_moveoncast.nut"); + if(mocAppendage) mocAppendage.getVar().setBool(0, false); + } + } +} + +function checkExecutableSkill_ElementalChain_bykk(obj) +{ + return 0; +} + +function onSetState_ElementalChain_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + local Ani = obj.sq_GetThrowChargeAni(3); + obj.setCurrentAnimation(Ani); + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN); + local castTime = sq_GetCastTime(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, skill_level); + if(castTime > 800){local pAni = obj.getCurrentAnimation();sq_SetFrameDelayTime(pAni, 1, castTime);} + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + local pAni = obj.getCurrentAnimation(); + local delaySum = pAni.getDelaySum(false); + sq_StartDrawCastGauge(obj, castTime, true); + break; + case 1: + local Ani = obj.sq_GetThrowShootAni(3); + obj.setCurrentAnimation(Ani); + createOnlyDrawObject_elementalmaster_bykk(obj,"character/mage/effect/animation/elementalmaster_bykk/elementalchain/start.ani",true,obj.getDirection(),sq_GetXPos(obj),sq_GetYPos(obj),sq_GetZPos(obj) + 40,ENUM_DRAWLAYER_NORMAL); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut")) + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut"); + local addAppendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, false, "character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut", true); + break; + case 10: + case 20: + case 30: + case 40: + local skillIndex = obj.sq_GetVectorData(datas, 1); + local sub = obj.sq_GetVectorData(datas, 2); + local Ani = obj.sq_GetThrowChargeAni(sub); + obj.setCurrentAnimation(Ani); + obj.getVar("moveoncast").setInt(0,skillIndex); + obj.getVar("moveoncast").setInt(1,sub); + //移動施法技能大于0時,獲取人物身上移動施法AP,push技能子狀態及技能編號等 + if(sq_GetSkillLevel(obj, 38) > 0){ + obj.sq_IsEnterSkillLastKeyUnits(skillIndex); + local mocAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_moveoncast.nut"); + if(mocAppendage){ + mocAppendage.getVar().setInt(3, obj.sq_GetVectorData(datas, 0)); + mocAppendage.getVar().setInt(1, skillIndex); + mocAppendage.getVar().setInt(2, sub); + mocAppendage.getVar().setBool(0, true); + } + } + if(skillIndex == 31) obj.getVar("sunburst_bool").setBool(0, false); + //蓄氣時鍾開啓 + obj.getVar("ElementalChain").clear_ct_vector(); + obj.getVar("ElementalChain").push_ct_vector(); + local timer = obj.getVar("ElementalChain").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); + //設置效果 + sq_SetBodyEffect(obj, obj, true, sq_RGB(255, 255, 255), 100, 200, 999000, sq_ALPHA(100)); + //獲取蓄氣上限 + local energycharge_Max = 0; + switch(skillIndex){ + case 15: energycharge_Max = sq_GetIntData(obj, skillIndex, 1); break;//傑克爆彈 + case 16: energycharge_Max = sq_GetIntData(obj, skillIndex, 5); break;//冰霜雪人 + case 17: energycharge_Max = sq_GetIntData(obj, skillIndex, 2); break;//光電鳗 + case 18: energycharge_Max = sq_GetIntData(obj, skillIndex, 1); break;//暗影夜貓 + case 26: energycharge_Max = sq_GetIntData(obj, skillIndex, 2); break;//虛無之球 + case 27: energycharge_Max = sq_GetIntData(obj, skillIndex, 2); break;//傑克降臨 + case 31: energycharge_Max = sq_GetIntData(obj, skillIndex, 0); break;//雷旋 + case 58: energycharge_Max = sq_GetIntData(obj, skillIndex, 0); break;//黑洞 + case 59: energycharge_Max = sq_GetIntData(obj, skillIndex, 3); break;//極冰盛宴 + } + local minus_Rate = 0,minus_Rate2 = 0,minus_Rate3 = 0; + local memorize_level = sq_GetSkillLevel(obj, 19); + if(memorize_level > 0){ + minus_Rate = sq_GetLevelData(obj, 19, 1, memorize_level); + minus_Rate2 = sq_GetLevelData(obj, 19, 2, memorize_level); + } + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut")){ + local magicaltempoup_level = sq_GetSkillLevel(obj, 2); + minus_Rate3 = sq_GetLevelData(obj, 2, 3, magicaltempoup_level); + } + local minus_Rate4 = 1000 - minus_Rate - minus_Rate3; + local minus_Rate5 = 1000 - minus_Rate - minus_Rate2 - minus_Rate3; + local fullcharge = 0; + if(minus_Rate5 > 0 && skillIndex <= 20) energycharge_Max = energycharge_Max * minus_Rate5 / 1000; + else if(minus_Rate5 < 0 && skillIndex <= 20){energycharge_Max = 0;fullcharge = 1;} + else if(minus_Rate4 > 0) energycharge_Max = energycharge_Max * minus_Rate4 / 1000; + else fullcharge = 1; + obj.getVar("moveoncast").setInt(2,energycharge_Max); + + if(skillIndex > 20 && sq_GetSkillLevel(obj,ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL) > 0){ + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,80,obj.getDirection(),38,1,energycharge_Max,4,fullcharge,0,0,0,0,0,0,0); + return; + } + + switch(skillIndex){ + case 15: + case 27: + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,80,obj.getDirection(),38,1,energycharge_Max,0,fullcharge,0,0,0,0,0,0,0); + break; + case 16: + case 59: + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,80,obj.getDirection(),38,1,energycharge_Max,1,fullcharge,0,0,0,0,0,0,0); + break; + case 26: + case 18: + case 58: + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,80,obj.getDirection(),38,1,energycharge_Max,2,fullcharge,0,0,0,0,0,0,0); + break; + case 17: + case 31: + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,80,obj.getDirection(),38,1,energycharge_Max,3,fullcharge,0,0,0,0,0,0,0); + if(skillIndex == 31){ + local aniPath = ["character/mage/effect/animation/sunburstcast1.ani","character/mage/effect/animation/sunburstcast2.ani","character/mage/effect/animation/sunburstcast3.ani","character/mage/effect/animation/sunburstfloor1.ani","character/mage/effect/animation/sunburstfloor2.ani"]; + local drawlayer = [ENUM_DRAWLAYER_NORMAL,ENUM_DRAWLAYER_NORMAL,ENUM_DRAWLAYER_NORMAL,ENUM_DRAWLAYER_BOTTOM,ENUM_DRAWLAYER_BOTTOM]; + for(local i = 0; i < aniPath.len(); i++){ + createOnlyDrawObject_elementalmaster_bykk(obj,aniPath[i],true,obj.getDirection(),sq_GetXPos(obj),sq_GetYPos(obj),sq_GetZPos(obj),drawlayer[i]); + } + } + break; + } + break; + case 11: + case 21: + case 31: + case 41: + local skillIndex = obj.sq_GetVectorData(datas, 1); + obj.getVar("skillIndex").setInt(100, skillIndex); + local sub = obj.sq_GetVectorData(datas, 2); + local Ani = obj.sq_GetThrowShootAni(sub); + obj.setCurrentAnimation(Ani); + obj.stopSound(18); + //設置效果 + sq_SetBodyEffect(obj, obj, true, sq_RGB(255, 255, 255), 100, 100, 0, sq_ALPHA(100)); + //聲音 + switch(skillIndex){ + case 26: obj.sq_PlaySound("WZ_VOID"); break; + case 31: obj.sq_PlaySound("WZ_SUNBURST"); break; + case 15: obj.sq_PlaySound("WZ_LANTERN_FIRE"); break; + case 16: obj.sq_PlaySound("WZ_FROSTHEAD"); break; + case 17: obj.sq_PlaySound("WZ_FLUORE"); break; + case 18: obj.sq_PlaySound("WZ_LAUNCH_PLUTO"); break; + case 27: obj.sq_PlaySound("R_WZ_SHOOTING_STAR"); break; + case 58: obj.sq_PlaySound("WZ_NIGHTH_02"); break; + case 59: obj.sq_PlaySound("WZ_MAGIC_MISSILE"); break; + } + local timer = obj.getVar("ElementalChain").get_ct_vector(0); + local currentT = 0; + if(timer) currentT = timer.Get(); + local energycharge_Max = obj.getVar("moveoncast").getInt(2); + obj.getVar("ElementalChain").clear_ct_vector(); + local skill_level = sq_GetSkillLevel(obj, skillIndex); + + local Mightyrune_T = + {//light,ice,fire,dark + [15] = [0,0,1,0], + [16] = [0,1,0,0], + [18] = [0,0,0,1], + [17] = [1,0,0,0], + [26] = [0,0,0,1], + [31] = [1,0,0,0], + [27] = [0,0,1,0], + [59] = [0,1,0,0], + [55] = [1,0,0,0], + [58] = [0,0,0,1] + } + + if(Mightyrune_T.rawin(skillIndex)){ + sq_BinaryStartWrite(); + foreach(elsement in Mightyrune_T[skillIndex]){ + sq_BinaryWriteDword(elsement); + } + sq_SendChangeSkillEffectPacket(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN); + } + + local charge_obj = obj.getVar("moveoncast").get_obj_vector(0); + if(charge_obj) charge_obj.setValid(false); + + local xiuzheng = 1; + if(currentT > energycharge_Max) xiuzheng = 0; + switch(skillIndex){//滿蓄力 + case 15://傑克爆彈 + local totalDamage = sq_GetLevelData(obj, skillIndex, 1 - xiuzheng, skill_level); + local powerDamage = sq_GetLevelData(obj, skillIndex, 9 - xiuzheng, skill_level); + local nurmal_rate = sq_GetLevelData(obj, skillIndex, 5 - xiuzheng, skill_level) * 130 /100; + local exp_rate = sq_GetLevelData(obj, skillIndex, 7 - xiuzheng, skill_level) * 130 /100; + local shoot_range = sq_GetLevelData(obj, skillIndex, 3 - xiuzheng, skill_level); + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,75,0,50,obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALCHAIN,15,totalDamage,powerDamage,nurmal_rate,exp_rate,shoot_range,0,0,0,1,2); + break; + case 16://冰霜雪人 + local totalDamage = sq_GetLevelData(obj, skillIndex, 1 - xiuzheng, skill_level); + local powerDamage = sq_GetLevelData(obj, skillIndex, 15 - xiuzheng, skill_level); + local nurmal_rate = sq_GetLevelData(obj, skillIndex, 6 - xiuzheng, skill_level) * 150 /100; + local lifeTime = sq_GetLevelData(obj, skillIndex, 3 - xiuzheng, skill_level); + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,50,0,80,obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALCHAIN,16,totalDamage,powerDamage,nurmal_rate,lifeTime,0,0,0,0,1,2); + local size = sq_GetLevelData(obj, skillIndex, 20, skill_level); + if(size > 0){ + for(local i = 0; i < size; i++){ + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,50,0,80 + 10 * (i + 1),obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALCHAIN,16,totalDamage,powerDamage,nurmal_rate,lifeTime,0,0,0,0,1,2); + } + } + break; + case 17://光電鳗 + local number = sq_GetIntData(obj, skillIndex, 1); + local totalDamage = sq_GetLevelData(obj, skillIndex, 1 - xiuzheng, skill_level); + local powerDamage = sq_GetLevelData(obj, skillIndex, 7 - xiuzheng, skill_level); + local nurmal_rate = sq_GetLevelData(obj, skillIndex, 5 - xiuzheng, skill_level) * 150 /100; + local lifeTime = sq_GetLevelData(obj, skillIndex, 3 - xiuzheng, skill_level); + for(local i = 0; i < number; i++){ + local angle = 360 / number * i; + local x = (sq_Cos(sq_ToRadian(angle.tofloat())) * 65.0).tointeger(); + local y = (sq_Sin(sq_ToRadian(angle.tofloat())) * 65.0).tointeger(); + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,x,y,40,obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALCHAIN,17,totalDamage,powerDamage,nurmal_rate,lifeTime,angle,sq_GetXPos(obj),sq_GetYPos(obj),0,1,2); + } + break; + case 18://暗影夜貓 + local totalDamage = sq_GetLevelData(obj, skillIndex, 1 - xiuzheng, skill_level); + local powerDamage = sq_GetLevelData(obj, skillIndex, 9 - xiuzheng, skill_level); + local sizeRate = sq_GetLevelData(obj, skillIndex, 7 - xiuzheng, skill_level) * 130 /100; + local speed_rate = sq_GetLevelData(obj, skillIndex, 3 - xiuzheng, skill_level); + local shoot_range = sq_GetLevelData(obj, skillIndex, 5 - xiuzheng, skill_level); + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,75,0,50,obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALCHAIN,18,totalDamage,powerDamage,sizeRate,speed_rate,shoot_range,0,0,0,1,2); + break; + case 26://虛無之球 + local totalDamage = sq_GetLevelData(obj, skillIndex, 1 - xiuzheng, skill_level); + local sizeRate = sq_GetIntData(obj, skillIndex, 7 - xiuzheng) * 230 / 100; + if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_VOIDEX) > 0){ + local prob = 100 - sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_VOIDEX) * 8 - sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_VOID, 9, sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_VOID)); + if(sq_getRandom(1, 100) > prob) sizeRate = sizeRate * 250 / 100; + } + local shoot_range = sq_GetLevelData(obj, skillIndex, 3 - xiuzheng, skill_level) / 20; + local hittime = sq_GetIntData(obj, skillIndex, 1); + if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ASSIMILATE) > 0){ + hittime = hittime / 2; + local timeMax = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ASSIMILATE, 2); + local damageRate = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ASSIMILATE, 4); + local damageRate2 = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ASSIMILATE, 5); + local isExp = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ASSIMILATE, 16); + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,120,0,60,obj.getDirection(),ELEMENTALMASTER_SKILL_VOID,2,totalDamage,hittime,timeMax,damageRate,damageRate2,sizeRate,isExp,0,1,0); + } + else cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,75,0,50,obj.getDirection(),ELEMENTALMASTER_SKILL_VOID,1,totalDamage,sizeRate,shoot_range,hittime,0,0,0,0,1,0); + break; + case 27://傑克降臨 + local sub = sq_GetIntData(obj, skillIndex, 6); + local totalDamage = sq_GetLevelData(obj, skillIndex, 1 - xiuzheng, skill_level); + local totalDamage2 = sq_GetLevelData(obj, skillIndex, 3 - xiuzheng, skill_level); + local sizeRate = sq_GetLevelData(obj, skillIndex, 7 - xiuzheng, skill_level) * 110 / 100; + local sizeRate2 = sq_GetLevelData(obj, skillIndex, 5 - xiuzheng, skill_level) * 110 / 100; + local damageRate = (totalDamage2.tofloat() / totalDamage.tofloat() * 100.0).tointeger(); + local number = sq_GetIntData(obj, skillIndex, 3) + 1; + local x = 150, y = 0, z = 0, targetObj = obj; + if(sq_GetIntData(obj, ELEMENTALMASTER_SKILL_HALLOWEENBUSTER, 4) > 0){ + local bhObj = obj.getVar("blackhole").get_obj_vector(0); + if(bhObj){x = 0; y = 0;targetObj = bhObj;} + else{ + local totalDamage = 100; + local totalDamage2 = 100; + local sizeRate = 40; + local lifeTime = 1200; + local attractPower = 600; + local range = 400; + local damageRate = (totalDamage2.tofloat() / totalDamage.tofloat() * 100.0).tointeger(); + local hitTime = 2000; + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,x,y,80,obj.getDirection(),ELEMENTALMASTER_SKILL_BLACKHOLE,1,totalDamage,sizeRate,lifeTime,damageRate,attractPower,range,0,hitTime,0,0); + } + } + if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL) > 0 && !sq_GetSkill(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL).isSealFunction()){ + local elementalpotential_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL); + local add_sizeRate = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 8); + // local add_damageRate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 13, elementalpotential_level); + // totalDamage = totalDamage * (1000 + add_damageRate) / 1000; + sizeRate = sizeRate * (100 + add_sizeRate) / 100; + sizeRate2 = sizeRate2 * (100 + add_sizeRate) / 100; + cearteSkillPassive_Elementalmaster_bykk(obj,targetObj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,x,y,z,obj.getDirection(),ELEMENTALMASTER_SKILL_HALLOWEENBUSTER,0,totalDamage,sizeRate,sizeRate2,damageRate,sub,2,number,0,1,0); + } + else{ + cearteSkillPassive_Elementalmaster_bykk(obj,targetObj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,x,y,z,obj.getDirection(),ELEMENTALMASTER_SKILL_HALLOWEENBUSTER,0,totalDamage,sizeRate,sizeRate2,damageRate,sub,1,number,0,1,0); + } + break; + case 31://雷旋 + local totalDamage = sq_GetLevelData(obj, skillIndex, 1 - xiuzheng, skill_level); + local sizeRate = sq_GetIntData(obj, skillIndex, 2 - xiuzheng) * 230 /100; + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,50,obj.getDirection(),ELEMENTALMASTER_SKILL_SUNBURST,1,totalDamage,sizeRate,0,0,0,0,0,0,1,0); + + local aniPath = ["passiveobject/elementalmaster_bykk/animation/sunburst/sunburstlayer2.ani","passiveobject/elementalmaster_bykk/animation/sunburst/sunburstlayer1.ani"]; + local offset_y = [1,-1]; + sizeRate = sizeRate.tofloat() / 100.0; + for(local i = 0; i < aniPath.len(); i++){ + local pooledObj = sq_AddDrawOnlyAniFromParent(obj,aniPath[i],0,offset_y[i],50 + offset_y[i]); + local pAni = pooledObj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); + pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + } + break; + case 58://黑洞 + local size = obj.getVar("blackhole").get_obj_vector_size(); + if(size > 0){ + for(local i = 0; i < size; i++){ + local bhObj = obj.getVar("blackhole").get_obj_vector(i); + if(bhObj){ + local colObj = sq_GetCNRDObjectToCollisionObject(bhObj); + colObj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); + } + } + } + local sub = sq_GetIntData(obj, skillIndex, 6); + local totalDamage = sq_GetLevelData(obj, skillIndex, 7 - xiuzheng, skill_level); + local totalDamage2 = sq_GetLevelData(obj, skillIndex, 9 - xiuzheng, skill_level); + local sizeRate = 100 + sq_GetIntData(obj, skillIndex, 5); + local lifeTime = sq_GetLevelData(obj, skillIndex, 5 - xiuzheng, skill_level); + local attractPower = sq_GetLevelData(obj, skillIndex, 1 - xiuzheng, skill_level); + local range = sq_GetIntData(obj, skillIndex, 2 + xiuzheng); + local damageRate = (totalDamage2.tofloat() / totalDamage.tofloat() * 100.0).tointeger(); + local hitTime = 300; + if(sub > 0){ + lifeTime = lifeTime / 2; + hitTime = hitTime / 3; + } + if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL) > 0 && !sq_GetSkill(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL).isSealFunction()){ + local elementalpotential_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL); + local add_sizeRate = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 0); + local minus_Rate = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 2); + // local add_damageRate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 14, elementalpotential_level); + // totalDamage = totalDamage * (1000 + add_damageRate) / 1000; + sizeRate = sizeRate * (100 + add_sizeRate) / 100; + hitTime = hitTime * (100 - minus_Rate) / 100; + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,150,0,120,obj.getDirection(),ELEMENTALMASTER_SKILL_BLACKHOLE,2,totalDamage,sizeRate,lifeTime,damageRate,attractPower,range,sub,hitTime,1,0); + } + else{ + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,150,0,100,obj.getDirection(),ELEMENTALMASTER_SKILL_BLACKHOLE,1,totalDamage,sizeRate,lifeTime,damageRate,attractPower,range,sub,hitTime,1,0); + } + break; + case 59://極冰盛宴 + local totalDamage = sq_GetLevelData(obj, skillIndex, 1 - xiuzheng, skill_level); + local sizeRate = sq_GetLevelData(obj, skillIndex, 9 - xiuzheng, skill_level) * 160 / 100; + local hitMax = sq_GetIntData(obj, skillIndex, 5); + local hitTime = sq_GetIntData(obj, skillIndex, 2 - xiuzheng); + local offset_x = sq_GetIntData(obj, skillIndex, 4); + local speedRate = 30000 / sq_GetIntData(obj, skillIndex, 0); + if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL) > 0 && !sq_GetSkill(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL).isSealFunction()){ + local elementalpotential_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL); + local speed_rate = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 2); + hitMax = hitMax + sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 16, elementalpotential_level); + // local add_damageRate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 15, elementalpotential_level); + // totalDamage = totalDamage * (1000 + add_damageRate) / 1000; + hitTime = hitTime * (100 - speed_rate) / 100; + local sub = 0; + local isBig = sq_GetLevelData(obj, skillIndex, 11, skill_level); + if(isBig > 0){sub = 2;offset_x = offset_x - 150;} + else if(sq_GetLevelData(obj, skillIndex, 10, skill_level) > 0) sub = 1; + if(sub == 2) cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,offset_x,0,0,obj.getDirection(),ELEMENTALMASTER_SKILL_ARCTICPISTE,4,totalDamage * hitMax,sizeRate * 15 / 10, speedRate, isBig,0,0,0,0,1,0); + else cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,offset_x,0,0,obj.getDirection(),ELEMENTALMASTER_SKILL_ARCTICPISTE,2,totalDamage,sizeRate,hitMax,hitTime,speedRate,sub,0,0,1,0); + obj.setTimeEvent(100,50,1,false); + } + else{ + local sub = 0; + local isBig = sq_GetLevelData(obj, skillIndex, 11, skill_level); + if(isBig > 0){sub = 2;offset_x = offset_x - 150;} + else if(sq_GetLevelData(obj, skillIndex, 10, skill_level) > 0) sub = 1; + if(sub == 2) cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,offset_x,0,0,obj.getDirection(),ELEMENTALMASTER_SKILL_ARCTICPISTE,3,totalDamage * hitMax,sizeRate * 15 / 10, speedRate, isBig,0,0,0,0,1,0); + else cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,offset_x,0,0,obj.getDirection(),ELEMENTALMASTER_SKILL_ARCTICPISTE,1,totalDamage,sizeRate,hitMax,hitTime,speedRate,sub,0,0,1,0); + } + break; + } + elementalmaster_setelementSkillBonusRate(obj, skillIndex); + break; + } +} + +function onEndCurrentAni_ElementalChain_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_ELEMENTALCHAIN, STATE_PRIORITY_USER, true); + break; + case 1: + case 11: + case 21: + case 31: + case 41: + if(obj.getVar("skillIndex").getInt(100) == 31 && sq_GetLevelData(obj, 31, 4, sq_GetSkillLevel(obj, 31)) > 0 && obj.getVar("sunburst_bool").getBool(0) == false){ + if(sq_getRandom(1, 99) > 100 - sq_GetLevelData(obj, 31, 4, sq_GetSkillLevel(obj, 31))){ + obj.getVar("sunburst_bool").setBool(0, true); + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,50,obj.getDirection(),ELEMENTALMASTER_SKILL_SUNBURST,2,200,0,0,0,0,0,0,0,0,0); + } + } + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_ElementalChain_bykk(obj) +{ + if(!obj) return; + + local substate = obj.getSkillSubState(); + switch(substate){ + case 10: + case 20: + case 30: + case 40: + local bDownKey = obj.isDownSkillLastKey(); + if(!bDownKey){ + local mocAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_moveoncast.nut"); + if(mocAppendage) mocAppendage.getVar().setBool(0, false); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(substate + 1); + obj.sq_IntVectPush(obj.getVar("moveoncast").getInt(0)); + obj.sq_IntVectPush(obj.getVar("moveoncast").getInt(1)); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_ELEMENTALCHAIN, STATE_PRIORITY_USER, true); + } + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_UP, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_DOWN, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_LEFT, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_RIGHT, ENUM_SUBKEY_TYPE_ALL)){ + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + } + break; + } +} + +function onKeyFrameFlag_ElementalChain_bykk(obj, flagIndex) +{} + +function onTimeEvent_ElementalChain_bykk(obj, timeEventIndex, timeEventCount) +{ + switch(timeEventIndex){ + case 100: obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); break; + } +} + +function onEndState_ElementalChain_bykk(obj, new_state) +{ + if(!obj) return; + if(new_state != ELEMENTALMASTER_SKILL_ELEMENTALCHAIN){ + sq_EndDrawCastGauge(obj); + } + if(new_state == STATE_DIE || new_state == STATE_DAMAGE || new_state == STATE_DOWN || new_state == STATE_HOLD){ + if(sq_GetSkillLevel(obj, 38) > 0){ + local mocAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_moveoncast.nut"); + if(mocAppendage) mocAppendage.getVar().setBool(0, false); + } + } +} + +function onCreateObject_ElementalChain_bykk(obj, createObject) +{} + +function checkExecutableSkill_Elementalcurtain_bykk(obj) +{ + //print("test Elementalcurtain"); + local b_useskill = obj.sq_IsUseSkill(ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN); + if(b_useskill){ + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN); + obj.startSkillCoolTime(ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, skill_level, -1); + obj.sq_IsEnterSkillLastKeyUnits(ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, STATE_PRIORITY_USER, true); + return 1; + } + return 0; +} + +function onSetState_Elementalcurtain_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_ELEMENTALCURTAIN_CAST_BODY); + obj.getVar("moveoncast").setInt(0,ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN); + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN); + local castTime = sq_GetCastTime(obj, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, skill_level); + if(castTime > 1000){local pAni = obj.getCurrentAnimation();sq_SetFrameDelayTime(pAni, 4, castTime);} + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + local pAni = obj.getCurrentAnimation(); + local delaySum = pAni.getDelaySum(false); + sq_StartDrawCastGauge(obj, delaySum, true); + obj.getVar("elementalcurtain").setInt(1,delaySum); + //音效 + obj.sq_PlaySound("WZ_ELEMENTALCURTAIN_01_1",18);//WZ_ELEMENTALCURTAIN_01_2 + //设置效果 + sq_SetBodyEffect(obj, obj, true, sq_RGB(255, 255, 255), 100, 200, 999000, sq_ALPHA(100)); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/elementalcurtain/elementalcurtain_cast_effect.ani",0,0,0); + + //蓄气时钟开启 + obj.getVar("ElementalChain").clear_ct_vector(); + obj.getVar("ElementalChain").push_ct_vector(); + local timer = obj.getVar("ElementalChain").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); + //获取蓄气上限 + local energycharge_Max = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, 4); + local minus_Rate = 0,minus_Rate2 = 0,minus_Rate3 = 0; + local memorize_level = sq_GetSkillLevel(obj, 19); + if(memorize_level > 0){ + minus_Rate = sq_GetLevelData(obj, 19, 1, memorize_level); + } + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut")){ + local magicaltempoup_level = sq_GetSkillLevel(obj, 2); + minus_Rate3 = sq_GetLevelData(obj, 2, 3, magicaltempoup_level); + } + local minus_Rate4 = 1000 - minus_Rate - minus_Rate3; + local fullcharge = 0; + if(minus_Rate4 > 0) energycharge_Max = energycharge_Max * minus_Rate4 / 1000; + else fullcharge = 1; + obj.getVar("moveoncast").setInt(2,energycharge_Max); + + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,80,obj.getDirection(),38,1,energycharge_Max,4,fullcharge,0,0,0,0,0,0,0); + break; + case 1: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_ELEMENTALCURTAIN_SHOOT_BODY); + obj.stopSound(18); + //设置效果 + sq_SetBodyEffect(obj, obj, true, sq_RGB(255, 255, 255), 100, 100, 0, sq_ALPHA(100)); + //声音 + obj.sq_PlaySound("WZ_ELEMENTALCURTAIN_02_1");//WZ_ELEMENTALCURTAIN_02_2 + + local charge_obj = obj.getVar("moveoncast").get_obj_vector(0); + if(charge_obj) charge_obj.setValid(false); + + local timer = obj.getVar("ElementalChain").get_ct_vector(0); + local currentT = 0; + if(timer) currentT = timer.Get(); + local energycharge_Max = obj.getVar("moveoncast").getInt(2); + + local xiuzheng = 1; + if(currentT > energycharge_Max) xiuzheng = 0; + + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN); + local istalisman = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, 8) + 1; + local totalDamage = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, 0, skill_level); + local totalDamage2 = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, 1, skill_level); + local damageRate = (totalDamage2.tofloat() / totalDamage.tofloat() * 100.0).tointeger(); + local sizeRate = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, 1 - xiuzheng); + local lifeTime = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, 2); + local hitTime = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, 3); + local hitMax = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, 7); + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,300,0,0,obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN,1,totalDamage,sizeRate,lifeTime,damageRate,hitTime,hitMax,istalisman,0,1,0); + + if(istalisman > 0) obj.setTimeEvent(2,660,1,false); + + sq_BinaryStartWrite(); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(1); + sq_SendChangeSkillEffectPacket(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN); + elementalmaster_setelementSkillBonusRate(obj, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN); + break; + } +} + +function onEndCurrentAni_Elementalcurtain_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 1: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_Elementalcurtain_bykk(obj) +{ + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + local stateTime = obj.sq_GetStateTimer(); + if(stateTime < obj.getVar("elementalcurtain").getInt(1)) return; + local bDownKey = obj.isDownSkillLastKey(); + if(!bDownKey){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, STATE_PRIORITY_USER, true); + } + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_UP, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_DOWN, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_LEFT, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_RIGHT, ENUM_SUBKEY_TYPE_ALL)){ + //移动施法技能大于0时,获取人物身上移动施法AP,push技能子状态及技能编号等 + if(sq_GetSkillLevel(obj, 38) > 0){ + local mocAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_moveoncast.nut"); + if(mocAppendage){ + mocAppendage.getVar().setInt(1, ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN); + mocAppendage.getVar().setBool(0, true); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + } + } + } + break; + } +} + +function onKeyFrameFlag_Elementalcurtain_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_Elementalcurtain_bykk(obj, timeEventIndex, timeEventCount) +{ + switch(timeEventIndex){ + case 1: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, STATE_PRIORITY_USER, true); + break; + case 2: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onEndState_Elementalcurtain_bykk(obj, new_state) +{ + if(!obj) return; + if(new_state != ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN){ + sq_EndDrawCastGauge(obj); + } + if(new_state == STATE_DIE || new_state == STATE_DAMAGE || new_state == STATE_DOWN || new_state == STATE_HOLD){ + if(sq_GetSkillLevel(obj, 38) > 0){ + local mocAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_moveoncast.nut"); + if(mocAppendage) mocAppendage.getVar().setBool(0, false); + } + } +} + +function onCreateObject_Elementalcurtain_bykk(obj, createObject) +{ +} + + +function checkExecutableSkill_Elementalquake_bykk(obj) +{ + // print("test Elementalquake"); + local b_useskill = obj.sq_IsUseSkill(ELEMENTALMASTER_SKILL_ELEMENTALQUAKE); + if(b_useskill){ + // local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALQUAKE); + // obj.startSkillCoolTime(ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, skill_level, -1); + obj.sq_IsEnterSkillLastKeyUnits(ELEMENTALMASTER_SKILL_ELEMENTALQUAKE); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, STATE_PRIORITY_USER, true); + return 1; + } + return 0; +} + +function onSetState_Elementalquake_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_ELEMENTALQUAKE_CASTINGSTART_BODY); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/elementalquake/castingstart_crack.ani",0,0,0); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/elementalquake/castingstarteffect_stone.ani",0,0,0); + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALQUAKE); + local castTime = sq_GetCastTime(obj, ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, skill_level); + if(castTime > 1000){local pAni = obj.getCurrentAnimation();sq_SetFrameDelayTime(pAni, 1, castTime);} + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + local pAni = obj.getCurrentAnimation(); + local delaySum = pAni.getDelaySum(false); + sq_StartDrawCastGauge(obj, delaySum, true); + obj.getVar("elementalquake").setInt(1,delaySum); + //音效 + if(sq_getRandom(1,100) > 50) obj.sq_PlaySound("WZ_ELEMENTALQUAKE_01_1"); + else obj.sq_PlaySound("WZ_ELEMENTALQUAKE_01_2"); + //设置效果 + sq_SetBodyEffect(obj, obj, true, sq_RGB(255, 255, 255), 100, 200, 999000, sq_ALPHA(100)); + //蓄气时钟开启 + obj.getVar("Elementalquake").clear_ct_vector(); + obj.getVar("Elementalquake").push_ct_vector(); + local timer = obj.getVar("Elementalquake").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); + //获取蓄气上限 + local energycharge_Max = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, 3); + local minus_Rate = 0,minus_Rate2 = 0,minus_Rate3 = 0; + local memorize_level = sq_GetSkillLevel(obj, 19); + if(memorize_level > 0){ + minus_Rate = sq_GetLevelData(obj, 19, 1, memorize_level); + } + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut")){ + local magicaltempoup_level = sq_GetSkillLevel(obj, 2); + minus_Rate3 = sq_GetLevelData(obj, 2, 3, magicaltempoup_level); + } + local minus_Rate4 = 1000 - minus_Rate - minus_Rate3; + local fullcharge = 0; + if(minus_Rate4 > 0) energycharge_Max = energycharge_Max * minus_Rate4 / 1000; + else fullcharge = 1; + obj.getVar("moveoncast").setInt(2,energycharge_Max); + + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,80,obj.getDirection(),38,1,energycharge_Max,4,fullcharge,0,0,0,0,0,0,0); + break; + case 1: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_ELEMENTALQUAKE_CASTINGLOOPA_BODY); + obj.stopSound(18); + //设置效果 + sq_SetBodyEffect(obj, obj, true, sq_RGB(255, 255, 255), 100, 100, 0, sq_ALPHA(100)); + //声音 + if(sq_getRandom(1,100) > 50) obj.sq_PlaySound("WZ_ELEMENTALQUAKE_02_1"); + else obj.sq_PlaySound("WZ_ELEMENTALQUAKE_02_2"); + + local charge_obj = obj.getVar("moveoncast").get_obj_vector(0); + if(charge_obj) charge_obj.setValid(false); + + local timer = obj.getVar("Elementalquake").get_ct_vector(0); + local currentT = 0; + if(timer) currentT = timer.Get(); + local energycharge_Max = obj.getVar("moveoncast").getInt(2); + + local xiuzheng = 1; + if(currentT > energycharge_Max) xiuzheng = 0; + + sq_BinaryStartWrite(); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(1); + sq_SendChangeSkillEffectPacket(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN); + + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALQUAKE); + local totalDamage = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, 0, skill_level); + local totalDamage2 = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, 1, skill_level); + local damageRate = (totalDamage2.tofloat() / totalDamage.tofloat() * 100.0).tointeger(); + local sizeRate = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, 8 - xiuzheng); + local istalisman = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, 9) + 1; + + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,300,0,0,obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALQUAKE,1,totalDamage,damageRate,sizeRate,istalisman,0,0,0,0,1,0); + obj.getVar("elementalquake_talisman").setInt(0,istalisman); + elementalmaster_setelementSkillBonusRate(obj, ELEMENTALMASTER_SKILL_ELEMENTALQUAKE); + break; + case 2: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_ELEMENTALQUAKE_CASTINGLOOPB_BODY); + if(obj.getVar("elementalquake_talisman").getInt(0) > 0) obj.setTimeEvent(1,500,1,false); + break; + case 3: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_ELEMENTALQUAKE_CASTINGEND_BODY); + break; + } +} + +function onEndCurrentAni_Elementalquake_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + // obj.sq_IntVectClear(); + // obj.sq_IntVectPush(1); + // obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, STATE_PRIORITY_USER, true); + break; + case 1: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, STATE_PRIORITY_USER, true); + break; + case 3: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_Elementalquake_bykk(obj) +{ + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + local stateTime = obj.sq_GetStateTimer(); + if(stateTime < obj.getVar("elementalquake").getInt(1)) return; + local bDownKey = obj.isDownSkillLastKey(); + if(!bDownKey){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, STATE_PRIORITY_USER, true); + } + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_UP, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_DOWN, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_LEFT, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_RIGHT, ENUM_SUBKEY_TYPE_ALL)){ + //移动施法技能大于0时,获取人物身上移动施法AP,push技能子状态及技能编号等 + if(sq_GetSkillLevel(obj, 38) > 0){ + local mocAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_moveoncast.nut"); + if(mocAppendage){ + mocAppendage.getVar().setInt(1, ELEMENTALMASTER_SKILL_ELEMENTALQUAKE); + mocAppendage.getVar().setBool(0, true); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + } + } + } + break; + } +} + +function onKeyFrameFlag_Elementalquake_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_Elementalquake_bykk(obj, timeEventIndex, timeEventCount) +{ + switch(timeEventIndex){ + case 1: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(3); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, STATE_PRIORITY_USER, true); + break; + } +} + +function onEndState_Elementalquake_bykk(obj, new_state) +{ + if(!obj) return; + if(new_state != ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN){ + sq_EndDrawCastGauge(obj); + } + if(new_state == STATE_DIE || new_state == STATE_DAMAGE || new_state == STATE_DOWN || new_state == STATE_HOLD){ + if(sq_GetSkillLevel(obj, 38) > 0){ + local mocAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_moveoncast.nut"); + if(mocAppendage) mocAppendage.getVar().setBool(0, false); + } + } +} + +function checkExecutableSkill_ElementalShower_bykk(obj) +{ + //print("test ElementalShower"); + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALSHOWER); + if(sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALSHOWER, 9, skill_level) > 0){ + local b_useskill = obj.sq_IsUseSkill(ELEMENTALMASTER_SKILL_ELEMENTALSHOWER); + if(b_useskill){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALSHOWER, STATE_PRIORITY_IGNORE_FORCE, true); + return 1; + } + } +} + +function onSetState_ElementalShower_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + obj.sq_StopMove(); + switch(substate){ + case 0: + local Ani = obj.sq_GetThrowChargeAni(2); + obj.setCurrentAnimation(Ani); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + // local currentAni = obj.getCurrentAnimation(); + // currentAni.setSpeedRate(80.0); + // local delaySum = currentAni.getDelaySum(false); + // obj.sq_SetXScrollStart(200, delaySum); + //obj.sq_PlaySound("WZ_SHOOTING_STAR_READY", 2000); + break; + case 1: + local Ani = obj.sq_GetThrowShootAni(2); + obj.setCurrentAnimation(Ani); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + // local currentAni = obj.getCurrentAnimation(); + // local delaySum = currentAni.getDelaySum(false); + obj.stopSound(2000); + obj.sq_PlaySound("WZ_SHOOTING_STAR"); + + local skillLevel = sq_GetSkillLevel(obj, 74); + local totalDamage = sq_GetLevelData(obj, 74, 3, skillLevel); + local totalDamage2 = sq_GetLevelData(obj, 74, 4, skillLevel); + local number = sq_GetIntData(obj, 74, 10); + local baseangle = sq_getRandom(0, 90); + for(local i = 0; i < number; i++){ + local angle = 360 / number * i + baseangle; + local x = (sq_Cos(sq_ToRadian(angle.tofloat())) * 130.0).tointeger(); + local y = (sq_Sin(sq_ToRadian(angle.tofloat())) * 65.0).tointeger(); + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,225 + x, y, 300, obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALSHOWER,1,totalDamage,totalDamage2,0,0,0,0,0,0,1,0); + } + elementalmaster_setelementSkillBonusRate(obj, ELEMENTALMASTER_SKILL_ELEMENTALSHOWER); + break; + } +} + +function onEndCurrentAni_ElementalShower_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALSHOWER, STATE_PRIORITY_USER, true); + break; + case 1: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_ElementalShower_bykk(obj) +{ +} + +function onKeyFrameFlag_ElementalShower_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_ElementalShower_bykk(obj, timeEventIndex, timeEventCount) +{ +} + +function onEndState_ElementalShower_bykk(obj, new_state) +{ + if(!obj) return; + if(new_state != ELEMENTALMASTER_SKILL_ELEMENTALCHAIN){ + obj.sq_SetXScrollStop(100); + } +} + + +function checkExecutableSkill_FlameStrike_bykk(obj) +{ + //print("test FlameStrike"); + return 0; +} + +function onSetState_FlameStrike_bykk(obj, state, datas, isResetTimer) +{ + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + obj.sq_RemoveAimPointMark(); + local Ani = obj.sq_GetThrowChargeAni(1); + obj.setCurrentAnimation(Ani); + sq_StartDrawCastGauge(obj, 200, true); + obj.setTimeEvent(0,100,1,true); + break; + case 1: + obj.sq_RemoveAimPointMark(); + local Ani = obj.sq_GetThrowShootAni(1); + obj.setCurrentAnimation(Ani); + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_FLAMESTRIKE); + local totalDamage = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_FLAMESTRIKE, 0, skill_level); + local sizeRate = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_FLAMESTRIKE, 5) * 125 /100; + local etcTime = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_FLAMESTRIKE, 3, skill_level); + local aimPosX = obj.sq_GetVectorData(datas, 1) - sq_GetXPos(obj); + local aimPosY = obj.sq_GetVectorData(datas, 2) - sq_GetYPos(obj); + if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ASSIMILATE) > 0){ + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,aimPosX.tointeger(),aimPosY.tointeger(),0,ENUM_DIRECTION_RIGHT,ELEMENTALMASTER_SKILL_FLAMESTRIKE,2,totalDamage,sizeRate,etcTime,0,0,0,0,0,1,0); + } + else{ + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,aimPosX.tointeger(),aimPosY.tointeger(),0,ENUM_DIRECTION_RIGHT,ELEMENTALMASTER_SKILL_FLAMESTRIKE,1,totalDamage,sizeRate,0,0,0,0,0,0,1,0);} + + // [56] = [0,1,0,0], + + sq_BinaryStartWrite(); + sq_BinaryWriteDword(0); + sq_BinaryWriteDword(0); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(0); + sq_SendChangeSkillEffectPacket(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN); + break; + } + +} + +function onEndCurrentAni_FlameStrike_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + // obj.sq_IntVectClear(); + // obj.sq_IntVectPush(1); + // obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_FLAMESTRIKE, STATE_PRIORITY_USER, true); + break; + case 1: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_FlameStrike_bykk(obj) +{ + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + local stateTime = obj.sq_GetStateTimer(); + if(stateTime <= 200) return; + local bDownKey = obj.isDownSkillLastKey(); + + local posX = obj.getXPos(); + local posY = obj.getYPos(); + + if(!bDownKey || stateTime >= 1000){ + local aimPosX = obj.sq_GetAimPosX(posX, posY, false); + local aimPosY = obj.sq_GetAimPosY(posX, posY, false); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_IntVectPush(aimPosX); + obj.sq_IntVectPush(aimPosY); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_FLAMESTRIKE, STATE_PRIORITY_USER, true); + } + break; + } +} + +function onKeyFrameFlag_FlameStrike_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_FlameStrike_bykk(obj, timeEventIndex, timeEventCount) +{ + switch(timeEventIndex){ + case 0: + local posX = obj.getXPos(); + local posY = obj.getYPos(); + local posZ = obj.getZPos(); + + local offsetX = 150; + offsetX = obj.sq_GetDistancePos(posX, obj.sq_GetDirection(), offsetX); + + local vX = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_FLAMESTRIKE, 2) * 2; + local vY = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_FLAMESTRIKE, 3) * 2; + + obj.sq_AddAimPointMark(offsetX, posY, vX, vY); + break; + } +} + +function onEndState_FlameStrike_bykk(obj, new_state) +{ + if(new_state != ELEMENTALMASTER_SKILL_FLAMESTRIKE) obj.sq_RemoveAimPointMark(); +} + +function checkExecutableSkill_HalloweenBuster_bykk(obj) +{ + // print("test HalloweenBuster"); +} + +function onSetState_HalloweenBuster_bykk(obj, state, datas, isResetTimer) +{ +} + +function onEndCurrentAni_HalloweenBuster_bykk(obj) +{ +} + +function onProcCon_HalloweenBuster_bykk(obj) +{ +} + +function onKeyFrameFlag_HalloweenBuster_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_HalloweenBuster_bykk(obj, timeEventIndex, timeEventCount) +{ +} + +function onEndState_HalloweenBuster_bykk(obj, new_state) +{ +} + + +function checkExecutableSkill_MagicalTempoUp_bykk(obj) +{ + print("test MagicalTempoUp"); +} + +function onSetState_MagicalTempoUp_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + local Ani = obj.sq_GetThrowChargeAni(3); + obj.setCurrentAnimation(Ani); + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_MAGICALTEMPOUP); + local castTime = sq_GetCastTime(obj, ELEMENTALMASTER_SKILL_MAGICALTEMPOUP, skill_level); + if(castTime > 800){local pAni = obj.getCurrentAnimation();sq_SetFrameDelayTime(pAni, 1, castTime);} + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + sq_StartDrawCastGauge(obj, castTime, true); + local pAni = obj.getCurrentAnimation(); + print(pAni.getDelaySum(false)); + break; + case 1: + local Ani = obj.sq_GetThrowShootAni(3); + obj.setCurrentAnimation(Ani); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut")) + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut"); + local addAppendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, ELEMENTALMASTER_SKILL_MAGICALTEMPOUP, false, "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut", true); + break; + } +} + +function onEndCurrentAni_MagicalTempoUp_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ASSIMILATE, STATE_PRIORITY_USER, true); + break; + case 1: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_MagicalTempoUp_bykk(obj) +{ +} + +function onKeyFrameFlag_MagicalTempoUp_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_MagicalTempoUp_bykk(obj, timeEventIndex, timeEventCount) +{ +} + +function onEndState_MagicalTempoUp_bykk(obj, new_state) +{ + if(!obj) return; + if(new_state != ELEMENTALMASTER_SKILL_ASSIMILATE) sq_EndDrawCastGauge(obj); +} + +function checkExecutableSkill_Mightyrune_bykk(obj) +{ + // print("test Mightyrune"); + // if(obj.getVar("elementalchain_light").get_obj_vector_size() > 0){ + // local name = ["elementalchain_light","elementalchain_ice","elementalchain_fire","elementalchain_dark"]; + // for(local i = 0; i < 4; i++){ + // local effectObj = obj.getVar(name[i]).get_obj_vector(0); + // if(effectObj){local colObj = sq_GetCNRDObjectToCollisionObject(effectObj);colObj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, "");} + // } + // } + local b_useskill = obj.sq_IsUseSkill(ELEMENTALMASTER_SKILL_MIGHTYRUNE); + if(b_useskill){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_MIGHTYRUNE, STATE_PRIORITY_USER, true); + return 1; + } + return 0; +} + +function onSetState_Mightyrune_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + local Ani = obj.sq_GetThrowChargeAni(3); + obj.setCurrentAnimation(Ani); + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN); + local castTime = sq_GetCastTime(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, skill_level); + if(castTime > 800){local pAni = obj.getCurrentAnimation();sq_SetFrameDelayTime(pAni, 1, castTime);} + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + local pAni = obj.getCurrentAnimation(); + local delaySum = pAni.getDelaySum(false); + sq_StartDrawCastGauge(obj, delaySum, true); + break; + case 1: + local Ani = obj.sq_GetThrowShootAni(3); + obj.setCurrentAnimation(Ani); + obj.sq_PlaySound("WZ_MIGHTYRUNE"); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/mightyrune/runecast_01.ani",0,0,0); + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut")) + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut"); + CNSquirrelAppendage.sq_AppendAppendage(obj, obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, false, "character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut", true); + + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut")) + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut"); + CNSquirrelAppendage.sq_AppendAppendage(obj, obj, ELEMENTALMASTER_SKILL_MAGICALTEMPOUP, false, "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut", true); + + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_mightyrune.nut")) + CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_mightyrune.nut"); + CNSquirrelAppendage.sq_AppendAppendage(obj, obj, ELEMENTALMASTER_SKILL_MIGHTYRUNE, false, "character/mage/elementalmaster_bykk/ap/ap_mightyrune.nut", true); + break; + } +} + +function onEndCurrentAni_Mightyrune_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_MIGHTYRUNE, STATE_PRIORITY_USER, true); + break; + case 1: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_Mightyrune_bykk(obj) +{ +} + +function onKeyFrameFlag_Mightyrune_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_Mightyrune_bykk(obj, timeEventIndex, timeEventCount) +{ +} + +function onEndState_Mightyrune_bykk(obj, new_state) +{ + if(!obj) return; + if(new_state != ELEMENTALMASTER_SKILL_ELEMENTALCHAIN) sq_EndDrawCastGauge(obj); +} + + +function checkExecutableSkill_Sestoelemento_bykk(obj) +{ + // print("test Sestoelemento"); + local b_useskill = obj.sq_IsUseSkill(ELEMENTALMASTER_SKILL_SESTOELEMENTO); + if(b_useskill){ + obj.sq_IsEnterSkillLastKeyUnits(ELEMENTALMASTER_SKILL_SESTOELEMENTO); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(10); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_SESTOELEMENTO, STATE_PRIORITY_USER, true); + return 1; + } + return 0; +} + +function onSetState_Sestoelemento_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_SESTOELEMENTOCAST); + obj.setTimeEvent(1,2500,1,false); + // local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/sestoelemento/start_main.ani",350,-1,150); + sq_SetBodyEffect(obj, obj, true, sq_RGB(255, 255, 255), 100, 100, 0, sq_ALPHA(100)); + sq_flashScreen(obj,1000,3500,300,255, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM); + obj.sq_SetXScroll(350, 300, 3000, 100); + local totalDamage = obj.sq_GetBonusRateWithPassive(ELEMENTALMASTER_SKILL_SESTOELEMENTO, ELEMENTALMASTER_SKILL_SESTOELEMENTO, 0, 1.0) + 100; + local hitMax = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_SESTOELEMENTO, 0); + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,350,0,150,obj.getDirection(),ELEMENTALMASTER_SKILL_SESTOELEMENTO,1,totalDamage,hitMax,0,0,0,0,0,0,1,0); + sq_SendMessage(obj, 0, 1, 0); + elementalmaster_setelementSkillBonusRate(obj, ELEMENTALMASTER_SKILL_SESTOELEMENTO); + break; + case 1: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_SESTOELEMENTOREADY); + break; + case 2: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_SESTOELEMENTOCHARGE); + break; + case 3: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_SESTOELEMENTOEXP); + obj.sq_PlaySound("WZ_SESTOELEMENTO"); + // sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/sestoelemento/explosion_main.ani",350,-1,150); + local totalDamage = obj.sq_GetBonusRateWithPassive(ELEMENTALMASTER_SKILL_SESTOELEMENTO, ELEMENTALMASTER_SKILL_SESTOELEMENTO, 1, 1.0) + 100; + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,350,0,150,obj.getDirection(),ELEMENTALMASTER_SKILL_SESTOELEMENTO,2,totalDamage,0,0,0,0,0,0,0,1,0); + break; + case 10: + local Ani = obj.sq_GetThrowChargeAni(1); + obj.setCurrentAnimation(Ani); + obj.sq_PlaySound("WZ_SESTOELEMENTO_CAST"); + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_SESTOELEMENTO); + local castTime = sq_GetCastTime(obj, ELEMENTALMASTER_SKILL_SESTOELEMENTO, skill_level); + if(castTime > 300){local pAni = obj.getCurrentAnimation();sq_SetFrameDelayTime(pAni, 2, castTime - 200);} + local pAni = obj.getCurrentAnimation(); + local delaySum = pAni.getDelaySum(false); + sq_StartDrawCastGauge(obj, delaySum, true); + obj.sq_IsEnterSkillLastKeyUnits(ELEMENTALMASTER_SKILL_SESTOELEMENTO); + sq_SetBodyEffect(obj, obj, true, sq_RGB(255, 255, 255), 100, 200, 999000, sq_ALPHA(100)); + break; + } +} + +function onEndCurrentAni_Sestoelemento_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_SESTOELEMENTO, STATE_PRIORITY_USER, true); + break; + case 1: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_SESTOELEMENTO, STATE_PRIORITY_USER, true); + break; + case 2: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(3); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_SESTOELEMENTO, STATE_PRIORITY_USER, true); + break; + case 3: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + // case 10: + // obj.sq_IntVectClear(); + // obj.sq_IntVectPush(0); + // obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_SESTOELEMENTO, STATE_PRIORITY_USER, true); + // break; + } +} + +function onProcCon_Sestoelemento_bykk(obj) +{ + local substate = obj.getSkillSubState(); + switch(substate){ + case 10: + local stateTime = obj.sq_GetStateTimer(); + if(stateTime < 200) return; + local bDownKey = obj.isDownSkillLastKey(); + if(!bDownKey){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_SESTOELEMENTO, STATE_PRIORITY_USER, true); + } + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_UP, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_DOWN, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_LEFT, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_RIGHT, ENUM_SUBKEY_TYPE_ALL)){ + //移动施法技能大于0时,获取人物身上移动施法AP,push技能子状态及技能编号等 + if(sq_GetSkillLevel(obj, 38) > 0){ + local mocAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_moveoncast.nut"); + if(mocAppendage){ + mocAppendage.getVar().setInt(1, ELEMENTALMASTER_SKILL_SESTOELEMENTO); + mocAppendage.getVar().setBool(0, true); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + } + } + } + break; + } +} + +function onKeyFrameFlag_Sestoelemento_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_Sestoelemento_bykk(obj, timeEventIndex, timeEventCount) +{ + switch(timeEventIndex){ + case 1: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_SESTOELEMENTO, STATE_PRIORITY_USER, true); + break; + } +} + +function onEndState_Sestoelemento_bykk(obj, new_state) +{ + sq_SendMessage(obj, 0, 0, 0); +} + +function onCreateObject_Sestoelemento_bykk(obj, createObject) +{ +} + +function checkExecutableSkill_SunBurst_bykk(obj) +{ + // print("test SunBurst"); + return 1; +} + +function onSetState_SunBurst_bykk(obj, state, datas, isResetTimer) +{ +} + +function onEndCurrentAni_SunBurst_bykk(obj) +{ +} + +function onProcCon_SunBurst_bykk(obj) +{ +} + +function onKeyFrameFlag_SunBurst_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_SunBurst_bykk(obj, timeEventIndex, timeEventCount) +{ +} + +function onEndState_SunBurst_bykk(obj, new_state) +{ +} + +function checkExecutableSkill_Thegate_bykk(obj) +{ + // print("test Thegate"); + local b_useskill = obj.sq_IsUseSkill(ELEMENTALMASTER_SKILL_THEGATE); + if(b_useskill){ + obj.sq_IsEnterSkillLastKeyUnits(ELEMENTALMASTER_SKILL_THEGATE); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_THEGATE, STATE_PRIORITY_USER, true); + return 1; + } + return 0; +} + +function onSetState_Thegate_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + local Ani = obj.sq_GetThrowChargeAni(1); + obj.setCurrentAnimation(Ani); + break; + case 1: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_THEGATECAST_BODY); + break; + } +} + +function onEndCurrentAni_Thegate_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_THEGATE, STATE_PRIORITY_USER, true); + break; + case 1: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_Thegate_bykk(obj) +{ +} + +function onKeyFrameFlag_Thegate_bykk(obj, flagIndex) +{ + switch(flagIndex){ + case 1: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/thegate/cast_start_maincircle.ani",75,0,60); + break; + case 2: + local target_number = 0; + local target_Max = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_THEGATE, 0); + local create_time = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_THEGATE, 2); + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_THEGATE); + local create_number = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_THEGATE, 0, skill_level); + local totalDamage = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_THEGATE, 1, skill_level); + print("totalDamage = "+totalDamage); + local damageRate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_THEGATE, 2, skill_level); + obj.getVar("thegate_target").clear_obj_vector(); + local objectManager = obj.getObjectManager();//得到对象管理器 + local objectNumber = objectManager.getCollisionObjectNumber();//总数 + for (local i = 0; i < objectNumber; i++){ + local object = objectManager.getCollisionObject(i);//得到控制类对象 + if(object.isObjectType(OBJECTTYPE_ACTIVE) && obj.isEnemy(object) && object.isInDamagableState(obj)){ + target_number = target_number + 1; + obj.getVar("thegate_target").push_obj_vector(object); + } + } + + if(target_number > 0){ + if(target_number.tofloat() / target_Max.tofloat() <= 0.5) totalDamage = totalDamage * damageRate / 100; + print("totalDamage count: "+totalDamage); + //local skill = sq_GetSkill(obj, ELEMENTALMASTER_SKILL_THEGATE); + local sub = sq_getRandom(0,3), isSeal = false; + if(sq_GetIntData(obj, ELEMENTALMASTER_SKILL_THEGATE, 12) > 0){ + isSeal = true; + totalDamage = totalDamage * 15; + print("totalDamage on: "+totalDamage); + } + for(local i = 0; i < target_number; i++){ + local targetObj = obj.getVar("thegate_target").get_obj_vector(i); + if(targetObj){ + local activeObj = sq_GetCNRDObjectToActiveObject(targetObj); + if(isSeal == true){ + cearteSkillPassive_Elementalmaster_bykk(obj,activeObj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,380,obj.getDirection(),ELEMENTALMASTER_SKILL_THEGATE,10,totalDamage,sub,sq_GetGroup(activeObj),sq_GetUniqueId(activeObj),0,0,0,0,1,0); + } + else cearteSkillPassive_Elementalmaster_bykk(obj,activeObj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,380,obj.getDirection(),ELEMENTALMASTER_SKILL_THEGATE,1,totalDamage,create_number,create_time,sq_getRandom(1,4),sq_GetGroup(activeObj),sq_GetUniqueId(activeObj),0,0,1,0); + } + } + } + elementalmaster_setelementSkillBonusRate(obj, ELEMENTALMASTER_SKILL_THEGATE); + break; + case 3: + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/thegate/cast_end_maincircle.ani",75,0,60); + break; + } +} + +function onTimeEvent_Thegate_bykk(obj, timeEventIndex, timeEventCount) +{ +} + +function onEndState_Thegate_bykk(obj, new_state) +{ +} + +function onCreateObject_Thegate_bykk(obj, createObject) +{ +} + + +function checkExecutableSkill_ThunderCalling_bykk(obj) +{ + // print("test ThunderCalling"); +} + +function onSetState_ThunderCalling_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + obj.sq_RemoveAimPointMark(); + obj.sq_IsEnterSkillLastKeyUnits(ELEMENTALMASTER_SKILL_THUNDERCALLING); + local Ani = obj.sq_GetThrowChargeAni(3); + obj.setCurrentAnimation(Ani); + obj.setTimeEvent(0,200,1,false); + sq_StartDrawCastGauge(obj, 200, true); + // obj.sq_PlaySound("WZ_THUNDERC_01"); + break; + case 1: + obj.sq_RemoveAimPointMark(); + local Ani = obj.sq_GetThrowShootAni(3); + obj.setCurrentAnimation(Ani); + obj.sq_PlaySound("WZ_THUNDERC_02"); + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_THUNDERCALLING); + local totalDamage = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_THUNDERCALLING, 3, skill_level); + local countMax = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_THUNDERCALLING, 0, skill_level); + if(sq_GetIntData(obj, ELEMENTALMASTER_SKILL_THUNDERCALLING, 11) > 0) countMax = 1; + local sizeRate = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_THUNDERCALLING, 10) * 125 /100; + local hitTime = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_THUNDERCALLING, 2); + local aimPosX = obj.sq_GetVectorData(datas, 1) - sq_GetXPos(obj); + local aimPosY = obj.sq_GetVectorData(datas, 2) - sq_GetYPos(obj); + local thunderstrikeEx_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_THUNDERSTRIKEEX) + if(thunderstrikeEx_level > 0){ + local add_Rate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_THUNDERSTRIKEEX, 0, thunderstrikeEx_level); + totalDamage = totalDamage * (1000 + add_Rate) / 1000; + hitTime = hitTime / 2; + } + if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL) > 0 && !sq_GetSkill(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL).isSealFunction()){ + local range = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 3, sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL)); + local minus_Rate = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 1); + hitTime = hitTime * (100 - minus_Rate) / 100; + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,aimPosX.tointeger(),aimPosY.tointeger(),0,ENUM_DIRECTION_RIGHT,ELEMENTALMASTER_SKILL_THUNDERCALLING,0,totalDamage,sizeRate,countMax,hitTime,range,2,0,0,1,0); + } + else{ + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,aimPosX.tointeger(),aimPosY.tointeger(),0,ENUM_DIRECTION_RIGHT,ELEMENTALMASTER_SKILL_THUNDERCALLING,0,totalDamage,sizeRate,countMax,hitTime,0,1,0,0,1,0); + } + + if(sq_GetIntData(obj, ELEMENTALMASTER_SKILL_THUNDERCALLING, 12) > 1000){ + local objectManager = obj.getObjectManager(); + local objectNumber = objectManager.getCollisionObjectNumber(); + local damage = totalDamage * 33 / 100; + for (local i = 0; i < objectNumber; i++){ + local object = objectManager.getCollisionObject(i); + if(object.isObjectType(OBJECTTYPE_ACTIVE) && obj.isEnemy(object) && object.isInDamagableState(obj) && sq_Abs(sq_GetXPos(obj) - sq_GetXPos(object)) <= 650 && sq_Abs(sq_GetYPos(obj) - sq_GetYPos(object)) <= 325){ + local activeObj = sq_GetCNRDObjectToActiveObject(object); + cearteSkillPassive_Elementalmaster_bykk(obj,activeObj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,0,ENUM_DIRECTION_RIGHT,ELEMENTALMASTER_SKILL_THUNDERCALLING,3,damage,0,0,0,0,0,0,0,1,0); + } + } + } + + + sq_BinaryStartWrite(); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(0); + sq_BinaryWriteDword(0); + sq_BinaryWriteDword(0); + sq_SendChangeSkillEffectPacket(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN); + elementalmaster_setelementSkillBonusRate(obj, ELEMENTALMASTER_SKILL_THUNDERCALLING); + break; + } +} + + +function onEndCurrentAni_ThunderCalling_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 1: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_ThunderCalling_bykk(obj) +{ + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + local stateTime = obj.sq_GetStateTimer(); + if(stateTime <= 200) return; + local bDownKey = obj.isDownSkillLastKey(); + + local posX = obj.getXPos(); + local posY = obj.getYPos(); + + if(!bDownKey || stateTime >= 1200){ + local aimPosX = obj.sq_GetAimPosX(posX, posY, false); + local aimPosY = obj.sq_GetAimPosY(posX, posY, false); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_IntVectPush(aimPosX); + obj.sq_IntVectPush(aimPosY); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_THUNDERCALLING, STATE_PRIORITY_USER, true); + } + break; + } +} + +function onKeyFrameFlag_ThunderCalling_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_ThunderCalling_bykk(obj, timeEventIndex, timeEventCount) +{ + switch(timeEventIndex){ + case 0: + local posX = obj.getXPos(); + local posY = obj.getYPos(); + local posZ = obj.getZPos(); + + local offsetX = 150; + offsetX = obj.sq_GetDistancePos(posX, obj.sq_GetDirection(), offsetX); + + local vX = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_THUNDERCALLING, 5); + local vY = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_THUNDERCALLING, 6); + + // local thunderstrikeEx_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_THUNDERSTRIKEEX) + // if(thunderstrikeEx_level > 0){vX = vX * 2;vY = vY * 2;} + + obj.sq_AddAimPointMark(offsetX, posY, vX, vY); + break; + } +} + +function onEndState_ThunderCalling_bykk(obj, new_state) +{ + if(new_state != ELEMENTALMASTER_SKILL_FLAMESTRIKE) obj.sq_RemoveAimPointMark(); +} + +function checkExecutableSkill_Thunderrage_bykk(obj) +{ + // print("test Thunderrage"); + local b_useskill = obj.sq_IsUseSkill(ELEMENTALMASTER_SKILL_THUNDERRAGE); + if(b_useskill){ + obj.sq_IsEnterSkillLastKeyUnits(ELEMENTALMASTER_SKILL_THUNDERRAGE); + obj.sq_IntVectClear(); + obj.sq_IntVectPush(0); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_THUNDERRAGE, STATE_PRIORITY_USER, true); + return 1; + } + return 0; +} + +function onSetState_Thunderrage_bykk(obj, state, datas, isResetTimer) +{ + if(!obj) return; + obj.sq_StopMove(); + local substate = obj.sq_GetVectorData(datas, 0); + obj.setSkillSubState(substate); + switch(substate){ + case 0: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_THUNDERRAGE_CAST_START_00); + + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_THUNDERRAGE); + local castTime = sq_GetCastTime(obj, ELEMENTALMASTER_SKILL_THUNDERRAGE, skill_level); + obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0); + local pAni = obj.getCurrentAnimation(); + local delaySum = pAni.getDelaySum(false); + sq_StartDrawCastGauge(obj, delaySum, true); + obj.getVar("thunderrage").setInt(1,delaySum); + //音效 + obj.sq_PlaySound("R_WZ_THUNDER_RAGE_01_1",18); + // else obj.sq_PlaySound("WZ_CRYSTALOVERMIND_01_2"); + //设置效果 + sq_SetBodyEffect(obj, obj, true, sq_RGB(255, 255, 255), 100, 200, 999000, sq_ALPHA(100)); + //蓄气时钟开启 + obj.getVar("Thunderrage").clear_ct_vector(); + obj.getVar("Thunderrage").push_ct_vector(); + local timer = obj.getVar("Thunderrage").get_ct_vector(0); + timer.Reset(); + timer.Start(10000,0); + //获取蓄气上限 + local energycharge_Max = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_THUNDERRAGE, 4); + local minus_Rate = 0,minus_Rate2 = 0,minus_Rate3 = 0; + local memorize_level = sq_GetSkillLevel(obj, 19); + if(memorize_level > 0){ + minus_Rate = sq_GetLevelData(obj, 19, 1, memorize_level); + } + if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_magicaltempoup.nut")){ + local magicaltempoup_level = sq_GetSkillLevel(obj, 2); + minus_Rate3 = sq_GetLevelData(obj, 2, 3, magicaltempoup_level); + } + local minus_Rate4 = 1000 - minus_Rate - minus_Rate3; + local fullcharge = 0; + if(minus_Rate4 > 0) energycharge_Max = energycharge_Max * minus_Rate4 / 1000; + else fullcharge = 1; + obj.getVar("moveoncast").setInt(2,energycharge_Max); + + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,80,obj.getDirection(),38,1,energycharge_Max,4,fullcharge,0,0,0,0,0,0,0); + break; + case 1: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_THUNDERRAGE_CAST_LOOP_00); + + break; + case 2: + obj.sq_SetCurrentAnimation(ANIMATION_ELEMENTALMASTER_THUNDERRAGE_CAST_END_BODY); + sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/thunderrage/thunderrage_cast_end_shot_front_00.ani",45,0,55); + obj.stopSound(18); + //设置效果 + sq_SetBodyEffect(obj, obj, true, sq_RGB(255, 255, 255), 100, 100, 0, sq_ALPHA(100)); + //声音 + obj.sq_PlaySound("R_WZ_THUNDER_RAGE_01_2"); + // else obj.sq_PlaySound("WZ_CRYSTALOVERMIND_02_2"); + + local charge_obj = obj.getVar("moveoncast").get_obj_vector(0); + if(charge_obj) charge_obj.setValid(false); + + local timer = obj.getVar("Thunderrage").get_ct_vector(0); + local currentT = 0; + if(timer) currentT = timer.Get(); + local energycharge_Max = obj.getVar("moveoncast").getInt(2); + + local xiuzheng = 100; + if(currentT > energycharge_Max) xiuzheng = 120; + + sq_BinaryStartWrite(); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(1); + sq_BinaryWriteDword(1); + sq_SendChangeSkillEffectPacket(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN); + + local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_THUNDERRAGE); + local totalDamage = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_THUNDERRAGE, 0, skill_level) * xiuzheng / 100; + local hitMax = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_THUNDERRAGE, 0); + local sizeRate = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_THUNDERRAGE, 2); + if(xiuzheng > 100) sizeRate = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_THUNDERRAGE, 3); + + cearteSkillPassive_Elementalmaster_bykk(obj,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,45,0,55,obj.getDirection(),ELEMENTALMASTER_SKILL_THUNDERRAGE,1,totalDamage,sizeRate,hitMax,0,0,0,0,0,1,0); + elementalmaster_setelementSkillBonusRate(obj, ELEMENTALMASTER_SKILL_THUNDERRAGE); + break; + } +} + +function onEndCurrentAni_Thunderrage_bykk(obj) +{ + if(!obj) return; + if(!obj.sq_IsMyControlObject()) return; + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + obj.sq_IntVectClear(); + obj.sq_IntVectPush(1); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_THUNDERRAGE, STATE_PRIORITY_USER, true); + break; + case 2: + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + break; + } +} + +function onProcCon_Thunderrage_bykk(obj) +{ + local substate = obj.getSkillSubState(); + switch(substate){ + case 0: + case 1: + local timer = obj.getVar("Thunderrage").get_ct_vector(0); + if(!timer) return; + local currentT = timer.Get(); + if(currentT < obj.getVar("thunderrage").getInt(1)) return; + local bDownKey = obj.isDownSkillLastKey(); + if(!bDownKey){ + obj.sq_IntVectClear(); + obj.sq_IntVectPush(2); + obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_THUNDERRAGE, STATE_PRIORITY_USER, true); + } + else if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_UP, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_DOWN, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_LEFT, ENUM_SUBKEY_TYPE_ALL) || sq_IsKeyDown(OPTION_HOTKEY_MOVE_RIGHT, ENUM_SUBKEY_TYPE_ALL)){ + //移动施法技能大于0时,获取人物身上移动施法AP,push技能子状态及技能编号等 + if(sq_GetSkillLevel(obj, 38) > 0){ + local mocAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_moveoncast.nut"); + if(mocAppendage){ + mocAppendage.getVar().setInt(1, ELEMENTALMASTER_SKILL_THUNDERRAGE); + mocAppendage.getVar().setBool(0, true); + obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false); + } + } + } + break; + } +} + +function onKeyFrameFlag_Thunderrage_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_Thunderrage_bykk(obj, timeEventIndex, timeEventCount) +{ +} + +function onEndState_Thunderrage_bykk(obj, new_state) +{ + if(!obj) return; + if(new_state != ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN){ + sq_EndDrawCastGauge(obj); + } + if(new_state == STATE_DIE || new_state == STATE_DAMAGE || new_state == STATE_DOWN || new_state == STATE_HOLD){ + if(sq_GetSkillLevel(obj, 38) > 0){ + local mocAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_moveoncast.nut"); + if(mocAppendage) mocAppendage.getVar().setBool(0, false); + } + } +} + +function checkExecutableSkill_Void_bykk(obj) +{ + // print("test Void"); + return 1; +} + +function onSetState_Void_bykk(obj, state, datas, isResetTimer) +{ +} + +function onEndCurrentAni_Void_bykk(obj) +{ +} + +function onProcCon_Void_bykk(obj) +{ +} + +function onKeyFrameFlag_Void_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_Void_bykk(obj, timeEventIndex, timeEventCount) +{ +} + +function onEndState_Void_bykk(obj, new_state) +{ +} + +function checkExecutableSkill_WallOfIce_bykk(obj) +{ + // print("test WallOfIce"); + return 1; +} + +function onSetState_WallOfIce_bykk(obj, state, datas, isResetTimer) +{ +} + +function onEndCurrentAni_WallOfIce_bykk(obj) +{ +} + +function onProcCon_WallOfIce_bykk(obj) +{ +} + +function onKeyFrameFlag_WallOfIce_bykk(obj, flagIndex) +{ +} + +function onTimeEvent_WallOfIce_bykk(obj, timeEventIndex, timeEventCount) +{ +} + +function onEndState_WallOfIce_bykk(obj, new_state) +{ +} + + +//聖靈符文 +function procSkill_Mightyrue(obj) +{ + if(sq_GetSkillLevel(obj, 34) < 1) return; + obj.setSkillCommandEnable(2 , false); + obj.setSkillCommandEnable(29 , false); +} + + +/////////////////////////elementalmaster_end////////////////////// + diff --git a/user/43.249.195.64/a.nut b/user/43.249.195.64/a.nut new file mode 100644 index 0000000..e69de29 diff --git a/user/43.249.195.64/config b/user/43.249.195.64/config new file mode 100644 index 0000000..37d6154 --- /dev/null +++ b/user/43.249.195.64/config @@ -0,0 +1 @@ +a.nut \ No newline at end of file