茶服更新脚本

This commit is contained in:
2025-11-25 20:53:54 +08:00
parent 31dfb5fa1d
commit f0ffd40753
4 changed files with 287 additions and 114 deletions

View File

@@ -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);
}
}
}