diff --git a/Base/_Tool/Hacker_RegApi.nut b/Base/_Tool/Hacker_RegApi.nut index 2b861f5..8576580 100644 --- a/Base/_Tool/Hacker_RegApi.nut +++ b/Base/_Tool/Hacker_RegApi.nut @@ -194,17 +194,31 @@ class R_Utils { // return null; // }); -//绘制字符 -getroottable().DrawCodeCallBackFunc <- {}; +// //绘制字符 +// 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); +// local DrawCode = NativePointer(args[3]).readUnicodeString(); + +// if (DrawCode.find("^1^") != null) { + +// args[3] = Str_Ptr("AAAAAA"); +// args[2] = sq_RGBA(255, 0, 240, 255);; +// return args; +// } +// else if (DrawCode.find("^2^") != null) { +// print(DrawCode); + +// args[3] = Str_Ptr("BBBBBB"); +// args[2] = sq_RGBA(200, 100, 20, 255);; +// return args; +// } +// // if (DrawCode in DrawCodeCallBackFunc) +// // DrawCodeCallBackFunc[DrawCode](args); // // } // } // return null; @@ -262,9 +276,9 @@ function Sq_DiscardItem(Item) { //从exe获取字符串 getroottable()["Sq_GetExeStr_Map"] <- {}; -function Sq_GetExeStr_Event(Index) -{ - if(Index in 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; diff --git a/user/114.66.51.249/25_priest_1.c b/user/114.66.51.249/25_priest_1.c index b4d8668..aad39ef 100644 --- a/user/114.66.51.249/25_priest_1.c +++ b/user/114.66.51.249/25_priest_1.c @@ -106,6 +106,18 @@ function setCustomData_po_priest_bykk(obj, receiveData) obj.setTimeEvent(11, hitTime, -1, false); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 55)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); + + local lightLevel = sq_GetSkillLevel(sqrChr, 23); + if(lightLevel > 0 && CNSquirrelAppendage.sq_IsAppendAppendage(sqrChr, "character/priest/1crusader_bykk/ap_revengeoflight.nut")){ + local prob = sq_GetIntData(sqrChr, 23, 3); + local power = sqrChr.sq_GetPowerWithPassive(23, -1, 8, -1, 1.0); + obj.getVar("custom").setInt(7, lightLevel); + obj.getVar("custom").setInt(8, prob); + obj.getVar("custom").setInt(9, power); + } + else{ + obj.getVar("custom").setInt(7, 0); + } obj.getVar("custom").setInt(0, totalDamage); obj.getVar("custom").setInt(1, totalDamageExp); obj.getVar("custom").setInt(2, range); @@ -113,77 +125,46 @@ function setCustomData_po_priest_bykk(obj, receiveData) obj.getVar("custom").setInt(4, level); obj.getVar("custom").setInt(5, speedRate); obj.getVar("custom").setInt(6, sizeRate); - - obj.getVar("Tar_boss").clear_obj_vector(); - obj.getVar("Tar_named").clear_obj_vector(); - obj.getVar("Tar_normal").clear_obj_vector(); - obj.getVar("tar").clear_obj_vector(); - local objectManager = obj.getObjectManager();//得到對象管理器 - for (local i = 0; i < objectManager.getCollisionObjectNumber(); i++){ - local object = objectManager.getCollisionObject(i);//得到控制類對象 - if (object && object.isObjectType(OBJECTTYPE_ACTIVE) && obj.isEnemy(object)){ - local activeObj = sq_GetCNRDObjectToActiveObject(object); - if(sq_IsBoss(activeObj)){ - obj.getVar("Tar_boss").push_obj_vector(activeObj); - continue; - } - else if(sq_IsNamed(activeObj)){ - obj.getVar("Tar_named").push_obj_vector(activeObj); - continue; - } - else{ - obj.getVar("Tar_normal").push_obj_vector(activeObj); - continue; - } - } - } - local bossSize = obj.getVar("Tar_boss").get_obj_vector_size(); - local namedSize = obj.getVar("Tar_named").get_obj_vector_size(); - local normalSize = obj.getVar("Tar_normal").get_obj_vector_size(); - if(bossSize > 0){ - for(local i = 0; i < bossSize; i++){ - local targetObj = obj.getVar("Tar_boss").get_obj_vector(i); - if(targetObj) obj.getVar("tar").push_obj_vector(targetObj); - } - } - if(namedSize > 0){ - for(local i = 0; i < namedSize; i++){ - local targetObj = obj.getVar("Tar_named").get_obj_vector(i); - if(targetObj) obj.getVar("tar").push_obj_vector(targetObj); - } - } - if(normalSize > 0){ - for(local i = 0; i < normalSize; i++){ - local targetObj = obj.getVar("Tar_normal").get_obj_vector(i); - if(targetObj) obj.getVar("tar").push_obj_vector(targetObj); - } - } + findTheStrongestTarget(obj); obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); break; - case 2: + } + break; + case 108: + switch(subtype){ + case 1: local totalDamage = receiveData.readDword(); + local sizeRate = receiveData.readDword(); local range = receiveData.readDword(); local time = receiveData.readDword(); local level = receiveData.readDword(); - local sizeRate = receiveData.readDword(); - local aniPath = "passiveobject/4_priest_bykk/1crusader_bykk/animation/flashglobe/afterdodge.ani"; - local ani = sq_CreateAnimation("", aniPath); - obj.setCurrentAnimation(ani); - local currentAni = obj.getCurrentAnimation(); - currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/4_priest_bykk/1crusader_bykk/animation/flashglobe/afternormal.ani"),true); + obj.getVar("custom").setInt(0, totalDamage); + obj.getVar("custom").setInt(1, sizeRate); + obj.getVar("custom").setInt(2, range); + obj.getVar("custom").setInt(3, time); + obj.getVar("custom").setInt(4, level); sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 56)); sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); - if(sizeRate > 100){ - currentAni = obj.getCurrentAnimation(); - sizeRate = sizeRate.tofloat() / 100.0; - currentAni.setImageRateFromOriginal(sizeRate, sizeRate); - currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); - sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); - } + findTheStrongestTarget(obj); + + obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); break; } break; + case 23: + local totalDamage = receiveData.readDword(); + local aniPath = "passiveobject/character/priest/animation/talismanthunderbolt1.ani"; + switch(sq_getRandom(1, 3)){ + case 2: aniPath = "passiveobject/character/priest/animation/talismanthunderbolt2.ani"; break; + case 3: aniPath = "passiveobject/character/priest/animation/talismanthunderbolt3.ani"; break; + } + local ani = sq_CreateAnimation("", aniPath); + obj.setCurrentAnimation(ani); + sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 57)); + sq_SetCurrentAttackPower(sq_GetCurrentAttackInfo(obj), totalDamage); + sq_SetShake(obj, 1, 50); + break; } break; case 2: @@ -1578,22 +1559,103 @@ function setState_po_priest_bykk(obj, state, datas) case 1: switch(state){ case 20: - local aniPath = "passiveobject/4_priest_bykk/1crusader_bykk/animation/flashglobe/beforedodge.ani"; + local targetObj = obj.getVar("tar").get_obj_vector(0); + if(targetObj){ + local activeObj = sq_GetCNRDObjectToActiveObject(targetObj); + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(activeObj), sq_GetDirection(activeObj), 30)); + sq_setCurrentAxisPos(obj, 1, sq_GetYPos(activeObj)); + } + local speedRate = obj.getVar("custom").getInt(5); + local speed = 15 * speedRate / 100; + if(sq_GetDirection(obj) == ENUM_DIRECTION_RIGHT) sq_SetVelocity(obj, 0, speed.tofloat()); + else sq_SetVelocity(obj, 0, -speed.tofloat()); + local aniPath = "passiveobject/4_priest_bykk/1crusader_bykk/animation/flashglobe/flashglobeappear_02.ani"; local ani = sq_CreateAnimation("", aniPath); obj.setCurrentAnimation(ani); - local currentAni = obj.getCurrentAnimation(); - currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/4_priest_bykk/1crusader_bykk/animation/flashglobe/beforenormal.ani"),true); - currentAni.addLayerAnimation(-2,sq_CreateAnimation("","passiveobject/4_priest_bykk/1crusader_bykk/animation/flashglobe/floor.ani"),true); - local sizeRate = obj.getVar("custom").getInt(6); - if(sizeRate > 100){ - currentAni = obj.getCurrentAnimation(); - sizeRate = sizeRate.tofloat() / 100.0; - currentAni.setImageRateFromOriginal(sizeRate, sizeRate); - currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); - sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + break; + case 21: + local aniPath = "passiveobject/4_priest_bykk/1crusader_bykk/animation/flashglobe/flashglobeloop_01.ani"; + local ani = sq_CreateAnimation("", aniPath); + obj.setCurrentAnimation(ani); + break; + case 22: + sq_SetVelocity(obj, 0, 0.0); + local aniPath = "passiveobject/4_priest_bykk/1crusader_bykk/animation/flashglobe/flashglobedisappear_03.ani"; + local ani = sq_CreateAnimation("", aniPath); + obj.setCurrentAnimation(ani); + local range = obj.getVar("custom").getInt(2); + local time = obj.getVar("custom").getInt(3); + local level = obj.getVar("custom").getInt(4); + local xPos = sq_GetXPos(obj); + local yPos = sq_GetYPos(obj); + local objectManager = obj.getObjectManager();//得到對象管理器 + for (local i = 0; i < objectManager.getCollisionObjectNumber(); i++){ + local object = objectManager.getCollisionObject(i);//得到控制類對象 + if (object && object.isObjectType(OBJECTTYPE_ACTIVE) && obj.isEnemy(object) && sq_GetDistance(xPos, yPos, sq_GetXPos(object), sq_GetYPos(object), true) <= range){ + print("test"); + sq_sendSetActiveStatusPacket(object, obj, ACTIVESTATUS_STUN, 1000.0, level, false, time); + } } break; } + local sizeRate = obj.getVar("custom").getInt(6); + if(sizeRate > 100){ + local currentAni = obj.getCurrentAnimation(); + sizeRate = sizeRate.tofloat() / 100.0; + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + } + break; + } + break; + case 108: + switch(subtype){ + case 1: + switch(state){ + case 20: + local targetObj = obj.getVar("tar").get_obj_vector(0); + if(targetObj){ + local activeObj = sq_GetCNRDObjectToActiveObject(targetObj); + sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(activeObj), sq_GetDirection(activeObj), 30)); + sq_setCurrentAxisPos(obj, 1, sq_GetYPos(activeObj)); + } + local aniPath = "passiveobject/4_priest_bykk/1crusader_bykk/animation/flashglobeex/flashglobeexappear_17.ani"; + local ani = sq_CreateAnimation("", aniPath); + obj.setCurrentAnimation(ani); + break; + case 21: + local aniPath = "passiveobject/4_priest_bykk/1crusader_bykk/animation/flashglobeex/flashglobeexloop_14.ani"; + local ani = sq_CreateAnimation("", aniPath); + obj.setCurrentAnimation(ani); + break; + case 22: + local aniPath = "passiveobject/4_priest_bykk/1crusader_bykk/animation/flashglobeex/flashglobeexdisappear_12.ani"; + local ani = sq_CreateAnimation("", aniPath); + obj.setCurrentAnimation(ani); + local range = obj.getVar("custom").getInt(2); + local time = obj.getVar("custom").getInt(3); + local level = obj.getVar("custom").getInt(4); + local xPos = sq_GetXPos(obj); + local yPos = sq_GetYPos(obj); + local objectManager = obj.getObjectManager();//得到對象管理器 + for (local i = 0; i < objectManager.getCollisionObjectNumber(); i++){ + local object = objectManager.getCollisionObject(i);//得到控制類對象 + if (object && object.isObjectType(OBJECTTYPE_ACTIVE) && obj.isEnemy(object) && sq_GetDistance(xPos, yPos, sq_GetXPos(object), sq_GetYPos(object), true) <= range){ + print("test"); + sq_sendSetActiveStatusPacket(object, obj, ACTIVESTATUS_STUN, 1000.0, level, false, time); + } + } + break; + } + local sizeRate = obj.getVar("custom").getInt(1); + if(sizeRate > 100){ + local currentAni = obj.getCurrentAnimation(); + sizeRate = sizeRate.tofloat() / 100.0; + currentAni.setImageRateFromOriginal(sizeRate, sizeRate); + currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); + sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); + } break; } break; @@ -2202,10 +2264,16 @@ function onEndCurrentAni_po_priest_bykk(obj) switch(subtype){ case 1: switch(state){ - case 20: - obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); - return; - break; + case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); return; break; + } + break; + } + break; + case 108: + switch(subtype){ + case 1: + switch(state){ + case 20: obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); return; break; } break; } @@ -2453,17 +2521,7 @@ function onTimeEvent_po_priest_bykk(obj, timeEventIndex, timeEventCount) switch(timeEventIndex){ case 1: sq_SendDestroyPacketPassiveObject(obj); break; case 10: - local totalDamage = obj.getVar("custom").getInt(1); - local range = obj.getVar("custom").getInt(2); - local time = obj.getVar("custom").getInt(3); - local level = obj.getVar("custom").getInt(4); - local sizeRate = obj.getVar("custom").getInt(6); - local pooledObj = sq_AddDrawOnlyAniFromParent(obj, "passiveobject/character/priest/animation/flashglobe/delay.ani", 0, 0, 0); - local pAni = pooledObj.getCurrentAnimation(); - local pSize = sizeRate.tofloat() / 100.0; - pAni.setImageRateFromOriginal(pSize, pSize); - createSkillPassive_Priest_bykk(obj,obj,PASSIVEOBJECT_PRIESTBYKK,0,0,0,sq_GetDirection(obj),1,28,2,totalDamage,range,time,level,sizeRate,0,0,0); - sq_SendDestroyPacketPassiveObject(obj); + obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); break; case 11: obj.resetHitObjectList(); @@ -2578,15 +2636,19 @@ function onTimeEvent_po_priest_bykk(obj, timeEventIndex, timeEventCount) // obj.setTimeEvent(3, 130, 1, false); // } // else{ + local sizeRate = obj.getVar("custom").getInt(4); + sizeRate = sizeRate.tofloat() / 600.0; local aniPath = ["passiveobject/4_priest_bykk/3exorcist_bykk/animation/thunderbolttalisman/thunderbolt1.ani","passiveobject/4_priest_bykk/3exorcist_bykk/animation/thunderbolttalisman/thunderbolt2.ani","passiveobject/4_priest_bykk/3exorcist_bykk/animation/thunderbolttalisman/thunderbolt3.ani"]; for(local i = 0; i < 3; i++){ local pooledObj = sq_AddDrawOnlyAniFromParent(obj, aniPath[i], 0, 0, 0); sq_SetCustomRotate(pooledObj, sq_ToRadian(sq_getRandom(-10,10).tofloat())); } local pooledObj = sq_AddDrawOnlyAniFromParent(obj, "passiveobject/4_priest_bykk/3exorcist_bykk/animation/thunderbolttalisman/talisman/thunder_nova.ani", 0, 0, 0); + local pAni = pooledObj.getCurrentAnimation(); + pAni.setImageRateFromOriginal(sizeRate, sizeRate); sq_ChangeDrawLayer(pooledObj, ENUM_DRAWLAYER_BOTTOM); obj.resetHitObjectList(); - sq_SetMyShake(obj, 3, 50); + sq_SetMyShake(obj, 1, 50); obj.sq_PlaySound("THUNDER_STRIKE"); // } return; @@ -2942,3 +3004,4 @@ function onTimeEvent_po_priest_bykk(obj, timeEventIndex, timeEventCount) break; } } + diff --git a/user/114.66.51.249/25_priest_2.c b/user/114.66.51.249/25_priest_2.c index 272e1e9..a764281 100644 --- a/user/114.66.51.249/25_priest_2.c +++ b/user/114.66.51.249/25_priest_2.c @@ -58,26 +58,6 @@ function onKeyFrameFlag_po_priest_bykk(obj, flagIndex) sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage); sq_SetAddWeaponDamage(sq_GetCurrentAttackInfo(obj), true); break; - case 28: - switch(flagIndex){ - case 100: - local currentAni = obj.getCurrentAnimation(); - currentAni.setCurrentFrameWithChildLayer(2); - break; - case 101: - local targetObj = obj.getVar("tar").get_obj_vector(0); - if(targetObj){ - local activeObj = sq_GetCNRDObjectToActiveObject(targetObj); - sq_setCurrentAxisPos(obj, 0, sq_GetDistancePos(sq_GetXPos(activeObj), sq_GetDirection(activeObj), 30)); - sq_setCurrentAxisPos(obj, 1, sq_GetYPos(activeObj)); - } - local speedRate = obj.getVar("custom").getInt(5); - local speed = 15 * speedRate / 100; - if(sq_GetDirection(obj) == ENUM_DIRECTION_RIGHT) sq_SetVelocity(obj, 0, speed.tofloat()); - else sq_SetVelocity(obj, 0, -speed.tofloat()); - break; - } - break; } break; case 2: @@ -252,6 +232,23 @@ function onAttack_po_priest_bykk(obj, damager, boundingBox, isStuck) case 0: break; case 1: + switch(skillIndex){ + case 28: + if(damager.isObjectType(OBJECTTYPE_ACTIVE)){ + if(obj.getVar("custom").getInt(7) > 0){ + local prob = obj.getVar("custom").getInt(8); + if(sq_getRandom(1, 100) > 100 - prob){ + local power = obj.getVar("custom").getInt(9); + createSkillPassive_Priest_bykk(obj,damager,PASSIVEOBJECT_PRIESTBYKK,0,0,0,sq_GetDirection(obj),1,23,1,power,0,0,0,0,0,0,0); + // print("power = "+power); + // sq_BinaryStartWrite(); + // sq_BinaryWriteByte(power); + // sq_SendCreatePassiveObjectPacketPos(obj, 24012, 0, sq_GetXPos(damager), sq_GetYPos(damager), 0); + } + } + } + break; + } break; case 2: break; @@ -868,6 +865,54 @@ function procAppend_po_priest_bykk(obj) } } +function findTheStrongestTarget(obj) +{ + obj.getVar("Tar_boss").clear_obj_vector(); + obj.getVar("Tar_named").clear_obj_vector(); + obj.getVar("Tar_normal").clear_obj_vector(); + obj.getVar("tar").clear_obj_vector(); + local objectManager = obj.getObjectManager();//得到對象管理器 + for (local i = 0; i < objectManager.getCollisionObjectNumber(); i++){ + local object = objectManager.getCollisionObject(i);//得到控制類對象 + if (object && object.isObjectType(OBJECTTYPE_ACTIVE) && obj.isEnemy(object)){ + local activeObj = sq_GetCNRDObjectToActiveObject(object); + if(sq_IsBoss(activeObj)){ + obj.getVar("Tar_boss").push_obj_vector(activeObj); + continue; + } + else if(sq_IsNamed(activeObj)){ + obj.getVar("Tar_named").push_obj_vector(activeObj); + continue; + } + else{ + obj.getVar("Tar_normal").push_obj_vector(activeObj); + continue; + } + } + } + local bossSize = obj.getVar("Tar_boss").get_obj_vector_size(); + local namedSize = obj.getVar("Tar_named").get_obj_vector_size(); + local normalSize = obj.getVar("Tar_normal").get_obj_vector_size(); + if(bossSize > 0){ + for(local i = 0; i < bossSize; i++){ + local targetObj = obj.getVar("Tar_boss").get_obj_vector(i); + if(targetObj) obj.getVar("tar").push_obj_vector(targetObj); + } + } + if(namedSize > 0){ + for(local i = 0; i < namedSize; i++){ + local targetObj = obj.getVar("Tar_named").get_obj_vector(i); + if(targetObj) obj.getVar("tar").push_obj_vector(targetObj); + } + } + if(normalSize > 0){ + for(local i = 0; i < normalSize; i++){ + local targetObj = obj.getVar("Tar_normal").get_obj_vector(i); + if(targetObj) obj.getVar("tar").push_obj_vector(targetObj); + } + } +} + diff --git a/user/114.66.51.249/jiami.config b/user/114.66.51.249/jiami.config new file mode 100644 index 0000000..c028597 --- /dev/null +++ b/user/114.66.51.249/jiami.config @@ -0,0 +1,51 @@ +1_atgunner_1.c +1_atgunner_2.c +1_atgunner_3.c +1_atgunner_4.c +1_atgunner_5.c +1_atgunner_6.c +2_atpriest_1.c +2_atpriest_2.c +2_atpriest_3.c +2_atpriest_4.c +2_atpriest_5.c +2_atpriest_6.c +3_atswordman_1.c +3_atswordman_2.c +3_atswordman_3.c +3_atswordman_4.c +3_atswordman_5.c +3_atswordman_6.c +3_atswordman_7.c +3_atswordman_8.c +4_fighter_1.c +4_fighter_2.c +4_fighter_3.c +5_gunner_1.c +5_gunner_2.c +5_gunner_3.c +6_mage_1.c +6_mage_10.c +6_mage_11.c +6_mage_12.c +6_mage_13.c +6_mage_2.c +6_mage_3.c +6_mage_4.c +6_mage_5.c +6_mage_6.c +6_mage_7.c +6_mage_8.c +6_mage_9.c +7_swordman_1.c +7_swordman_2.c +7_swordman_3.c +8_thief_1.c +8_thief_2.c +8_thief_3.c +8_thief_4.c +8_thief_5.c +8_thief_6.c +25_priest_1.c +25_priest_2.c +25_priest_3.c \ No newline at end of file