581 lines
25 KiB
Plaintext
581 lines
25 KiB
Plaintext
/*
|
|
文件名:Sawblade.nut
|
|
路径:character/ATGunner/Ranger/Sawblade.nut
|
|
创建日期:2022-09-09 19:17
|
|
文件用途:技能-枪刃改良(女漫游二觉被动)
|
|
*/
|
|
if (!getroottable().rawin("ATGunner_Sawblade_Skill")) ATGunner_Sawblade_Skill <- {}
|
|
|
|
|
|
function Sawblade_PassiveSkill(obj, Index, Level) {
|
|
//Sout("被动技能触发");
|
|
}
|
|
|
|
|
|
if (getroottable().rawin("ProcPassiveSkill_ATGunner_Table"))
|
|
ProcPassiveSkill_ATGunner_Table.rawset(235, Sawblade_PassiveSkill);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
function ProcAppend_Sawblade_6(obj) {
|
|
if (sq_GetSkillLevel(obj, 235) < 1) return;
|
|
local CoolTime = obj.sq_GetIntData(235, 0);
|
|
local CoolTimer = TimeSTL("SawbladeCoolTime_DC", CoolTime);
|
|
// 按键C 高度小于100 高度大于10(判断是否已经跳起来了) 冷却未开始计算 或者 不处于冷却状态
|
|
if (KeyPress.isKeyPress(5) && obj.getZPos() <= 100 && obj.getZPos() >= 10 && (CoolTimer.Get() == false || CoolTimer.Get() == CoolTime)) {
|
|
local pIntVec = sq_GetGlobalIntVector();
|
|
sq_IntVectorClear(pIntVec);
|
|
sq_IntVectorPush(pIntVec, 67);
|
|
sq_IntVectorPush(pIntVec, 67);
|
|
obj.addSetStatePacket(13, pIntVec, STATE_PRIORITY_USER, false, "");
|
|
CoolTimer.Reset();
|
|
CoolTimer.Start();
|
|
}
|
|
CoolTime = obj.sq_GetIntData(235, 1);
|
|
CoolTimer = TimeSTL("SawbladeCoolTime_KZ", CoolTime);
|
|
// 空中Z
|
|
if (KeyPress.isKeyPress(6) && obj.getZPos() >= 20 && (CoolTimer.Get() == false || CoolTimer.Get() == CoolTime)) {
|
|
local pIntVec = sq_GetGlobalIntVector();
|
|
sq_IntVectorClear(pIntVec);
|
|
sq_IntVectorPush(pIntVec, 69);
|
|
sq_IntVectorPush(pIntVec, 69);
|
|
obj.addSetStatePacket(13, pIntVec, STATE_PRIORITY_USER, false, "");
|
|
CoolTimer.Reset();
|
|
CoolTimer.Start();
|
|
}
|
|
}
|
|
|
|
//6号状态 枪刃改良proc声明
|
|
if (getroottable().rawin("procAppend_ATGunner_Table"))
|
|
System.InsertArrayInTable(procAppend_ATGunner_Table, 6, "Sawblade", ProcAppend_Sawblade_6);
|
|
}
|
|
|
|
|
|
|
|
{
|
|
function ProcAppend_Sawblade_15(obj) {
|
|
if (sq_GetSkillLevel(obj, 235) < 1) return;
|
|
local CoolTime = obj.sq_GetIntData(235, 2);
|
|
local CoolTimer = TimeSTL("SawbladeCoolTime_HC", CoolTime);
|
|
// 按键C 高度小于100 高度大于10(判断是否已经跳起来了) 冷却未开始计算 或者 不处于冷却状态
|
|
if (KeyPress.isKeyPress(6) && (CoolTimer.Get() == false || CoolTimer.Get() == CoolTime)) {
|
|
local pIntVec = sq_GetGlobalIntVector();
|
|
sq_IntVectorClear(pIntVec);
|
|
sq_IntVectorPush(pIntVec, 68);
|
|
sq_IntVectorPush(pIntVec, 68);
|
|
obj.addSetStatePacket(13, pIntVec, STATE_PRIORITY_USER, false, "");
|
|
CoolTimer.Reset();
|
|
CoolTimer.Start();
|
|
}
|
|
}
|
|
|
|
//15号状态 枪刃改良proc声明
|
|
if (getroottable().rawin("procAppend_ATGunner_Table"))
|
|
System.InsertArrayInTable(procAppend_ATGunner_Table, 15, "Sawblade", ProcAppend_Sawblade_15);
|
|
}
|
|
|
|
|
|
{
|
|
function ProcAppend_Sawblade_19(obj) {
|
|
if (sq_GetSkillLevel(obj, 235) < 1) return;
|
|
local CoolTime = obj.sq_GetIntData(235, 3);
|
|
local CoolTimer = TimeSTL("SawbladeCoolTime_LQ", CoolTime);
|
|
// 按键C 高度小于100 高度大于10(判断是否已经跳起来了) 冷却未开始计算 或者 不处于冷却状态
|
|
if (KeyPress.isKeyPress(6) && (CoolTimer.Get() == false || CoolTimer.Get() == CoolTime)) {
|
|
local pIntVec = sq_GetGlobalIntVector();
|
|
sq_IntVectorClear(pIntVec);
|
|
sq_IntVectorPush(pIntVec, 70);
|
|
sq_IntVectorPush(pIntVec, 70);
|
|
obj.addSetStatePacket(13, pIntVec, STATE_PRIORITY_USER, false, "");
|
|
CoolTimer.Reset();
|
|
CoolTimer.Start();
|
|
}
|
|
}
|
|
|
|
//19号状态 枪刃改良proc声明
|
|
if (getroottable().rawin("procAppend_ATGunner_Table"))
|
|
System.InsertArrayInTable(procAppend_ATGunner_Table, 19, "Sawblade", ProcAppend_Sawblade_19);
|
|
}
|
|
|
|
|
|
{
|
|
function ProcAppend_Sawblade_13(obj) {
|
|
|
|
local pAni = obj.sq_GetCurrentAni(); //当前播放的Ani
|
|
local currentT = sq_GetCurrentTime(pAni); //Ani的当前时间
|
|
local fireT = pAni.getDelaySum(false); //总时间
|
|
local srcX = ATGunner_Sawblade_Skill["Xpos"]; // X的起始位置
|
|
local srcZ = ATGunner_Sawblade_Skill["Zpos"]; // Z的起始位置
|
|
|
|
{ //双C
|
|
if (Chr_State_Table[0] == 67 && Chr_State_Table[1] == 67) {
|
|
local vz = sq_GetAccel(0, 100, currentT, 300, true);
|
|
local vx = GameC.getQuadraticFunction(obj, 0 + sq_GetAccel(0, 36, currentT, 300, true), 240, 100).tointeger();
|
|
//local vz = getQuadraticFunction(obj, 0 + ccz, 40, 100).tointeger();
|
|
local dstX = srcX + sq_GetDistancePos(0, obj.getDirection(), vx); //这是要 X 位移随时变动的值
|
|
if (obj.isMovablePos(dstX, obj.getYPos())) sq_setCurrentAxisPos(obj, 0, dstX); //这是判断这个值能不能到达 也就是会不会卡墙里 不会 在进行位移
|
|
sq_setCurrentAxisPos(obj, 2, srcZ + vz); //这是位移Z轴
|
|
}
|
|
}
|
|
|
|
{ //空Z
|
|
if (Chr_State_Table[0] == 691 && Chr_State_Table[1] == 691 /*&& ccc.getInt(0) == 1*/ ) {
|
|
local Zpos = srcZ;
|
|
local MoveX = Zpos; //移动多少x距离
|
|
local MoveZ = Zpos; //移动多少Z距离
|
|
local v = sq_GetUniformVelocity(0, MoveX, currentT, Zpos);
|
|
local v2 = sq_GetUniformVelocity(0, MoveZ, currentT, Zpos);
|
|
local dstX = sq_GetDistancePos(srcX, obj.getDirection(), v);
|
|
local dstZ = sq_GetDistancePos(Zpos, 0, v2);
|
|
if (obj.isMovablePos(dstX, obj.getYPos())) sq_setCurrentAxisPos(obj, 0, dstX); //设置当前x坐标
|
|
sq_setCurrentAxisPos(obj, 2, dstZ); //设置当前z坐标
|
|
if (obj.getZPos() <= 1) {
|
|
local frame = sq_GetAnimationFrameIndex(pAni);
|
|
switch (frame) {
|
|
case 0:
|
|
pAni.setCurrentFrameWithChildLayer(1);
|
|
break;
|
|
case 1:
|
|
return;
|
|
break;
|
|
default:
|
|
return;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
{ //滑铲
|
|
local MoveXPos = 50;
|
|
//滑铲抬手
|
|
if (Chr_State_Table[0] == 68 && Chr_State_Table[1] == 68) {
|
|
local MoveX = MoveXPos; //移动多少x距离
|
|
local v = sq_GetUniformVelocity(0, MoveX, currentT, fireT); //计算平均移动值
|
|
local dstX = sq_GetDistancePos(srcX, obj.getDirection(), v); //计算出的X坐标
|
|
if (obj.isMovablePos(dstX, obj.getYPos())) sq_setCurrentAxisPos(obj, 0, dstX); //设置当前x坐标
|
|
}
|
|
//滑铲冲刺
|
|
if (Chr_State_Table[0] == 681 && Chr_State_Table[1] == 681) {
|
|
local MoveX = MoveXPos * 4; //移动多少x距离
|
|
local v = sq_GetUniformVelocity(0, MoveX, currentT, fireT); //计算平均移动值
|
|
local dstX = sq_GetDistancePos(srcX, obj.getDirection(), v); //计算出的X坐标
|
|
if (obj.isMovablePos(dstX, obj.getYPos())) sq_setCurrentAxisPos(obj, 0, dstX); //设置当前x坐标
|
|
}
|
|
}
|
|
|
|
{ //拉起
|
|
if (Chr_State_Table[0] == 701 && Chr_State_Table[1] == 701) {
|
|
|
|
local MoveZ = 80; //移动多少Z距离
|
|
local v2 = sq_GetUniformVelocity(0, MoveZ, currentT, fireT);
|
|
//local dstZ = sq_GetDistancePos(srcZ, 0, v2);
|
|
sq_setCurrentAxisPos(obj, 2, v2); //设置当前z坐标
|
|
}
|
|
}
|
|
}
|
|
|
|
//13号状态 枪刃改良proc声明
|
|
if (getroottable().rawin("procAppend_ATGunner_Table"))
|
|
System.InsertArrayInTable(procAppend_ATGunner_Table, 13, "Sawblade", ProcAppend_Sawblade_13);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
//设置状态时
|
|
function onSetState_Sawblade(obj, state, datas, isResetTimer) {
|
|
ATGunner_Sawblade_Skill.rawset("Zpos", obj.getZPos());
|
|
ATGunner_Sawblade_Skill.rawset("Xpos", obj.getXPos());
|
|
|
|
//双C
|
|
{
|
|
if (Chr_State_Table[0] == 67 && Chr_State_Table[1] == 67) {
|
|
obj.sq_SetCurrentAnimation(104);
|
|
obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0);
|
|
|
|
}
|
|
}
|
|
|
|
//空Z
|
|
{
|
|
//如果子状态为设定的69号状态 空中z抬手
|
|
if (Chr_State_Table[0] == 69 && Chr_State_Table[1] == 69) {
|
|
//设定ani
|
|
obj.sq_SetCurrentAnimation(109);
|
|
obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 6.0, 6.0);
|
|
}
|
|
//空中z 下落
|
|
if (Chr_State_Table[0] == 691 && Chr_State_Table[1] == 691) {
|
|
//设定ani
|
|
obj.sq_SetCurrentAnimation(110);
|
|
obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.5, 1.5);
|
|
obj.sq_SetCurrentAttackInfo(27);
|
|
}
|
|
}
|
|
|
|
{ //滑铲
|
|
//滑铲起手
|
|
if (Chr_State_Table[0] == 68 && Chr_State_Table[1] == 68) {
|
|
|
|
obj.sq_SetCurrentAnimation(105);
|
|
obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0);
|
|
|
|
}
|
|
//滑铲冲刺
|
|
if (Chr_State_Table[0] == 681 && Chr_State_Table[1] == 681) {
|
|
obj.sq_SetCurrentAnimation(106);
|
|
obj.sq_SetStaticSpeedInfo(SPEED_TYPE_MOVE_SPEED, SPEED_TYPE_MOVE_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 2.1, 2.1);
|
|
obj.sq_SetCurrentAttackInfo(26);
|
|
}
|
|
}
|
|
|
|
{ //拉起
|
|
//拉起第一段
|
|
if (Chr_State_Table[0] == 70 && Chr_State_Table[1] == 70) {
|
|
//设定ani
|
|
obj.sq_SetCurrentAnimation(107);
|
|
obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0);
|
|
}
|
|
//拉起第二段
|
|
if (Chr_State_Table[0] == 701 && Chr_State_Table[1] == 701) {
|
|
//设定ani
|
|
obj.sq_SetCurrentAnimation(108);
|
|
obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0);
|
|
obj.sq_SetCurrentAttackInfo(28);
|
|
}
|
|
}
|
|
}
|
|
|
|
//13号状态 枪刃改良proc声明
|
|
if (getroottable().rawin("onSetState_ATGunner13State_Table"))
|
|
onSetState_ATGunner13State_Table.rawset("Sawblade", onSetState_Sawblade);
|
|
}
|
|
|
|
|
|
//多重爆头
|
|
{
|
|
function setState_Sawblade_multiheadshot(obj, state, datas, isResetTimer) {
|
|
|
|
|
|
if (Chr_State_Table[1] == 1) {
|
|
local ShootDct = Chr_State_Table[2];
|
|
if (obj.getDirection() == 0) {
|
|
if (ShootDct == 0) ShootDct = 1;
|
|
else if (ShootDct == 1) ShootDct = 0;
|
|
}
|
|
local montab = GameC.findRoundNearAllEnemyRect(obj, 340, 80, ShootDct);
|
|
if (montab.len() > 0) {
|
|
local AtkRate = obj.sq_GetLevelData(72, 0, sq_GetSkillLevel(obj, 72));
|
|
local ap = sq_getNewAttackInfoPacket();
|
|
ap.hitStunTimeAttackerDamager = 600; //僵直时间
|
|
ap.powerRate = AtkRate; //百分比
|
|
ap.useWeapon = true; //是否吃武器伤害
|
|
ap.eType = ATTACKTYPE_PHYSICAL; //攻击类型 魔法还是物理
|
|
ap.backForce = 50; //推开距离
|
|
ap.upForce = 50; //打击高度
|
|
|
|
//local ballCount = obj.getMyPassiveObjectCount(24233);
|
|
//local magicBall = obj.getMyPassiveObject(24233, i)
|
|
foreach(Object in montab) {
|
|
sq_SendHitObjectPacketByAttackInfo(obj, Object, ap); //以新的攻击包发送攻击
|
|
//sq_SendHitObjectPacket(obj, Object, 0, 0, sq_GetObjectHeight(Object) / 2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//13号状态 枪刃改良proc声明
|
|
if (getroottable().rawin("setState_ATGunner_Table"))
|
|
System.InsertArrayInTable(setState_ATGunner_Table, 37, "Sawblade", setState_Sawblade_multiheadshot);
|
|
|
|
}
|
|
|
|
|
|
//走射
|
|
{
|
|
//ATGunner_Sawblade_Skill.rawset("shoot", 0);
|
|
|
|
function ProcAppend_Sawblade_walkshoot(obj) {
|
|
//GameC.DestroyPassiveObject(obj,22001);
|
|
/*
|
|
if ((obj.isCurrentCutomAniIndex(28) || obj.isCurrentCutomAniIndex(29) || obj.isCurrentCutomAniIndex(30))) {
|
|
if (ATGunner_Sawblade_Skill["shoot"] == 0) {
|
|
local DamageRate = obj.sq_GetBonusRateWithPassive(15, 27, 0, 1.0);
|
|
obj.sq_StartWrite(); //开始写入
|
|
obj.sq_WriteDword(671); //写入 4 字节数 技能ID
|
|
//obj.sq_WriteDword(WeaponType); //写入 4 字节数 武器类型
|
|
//obj.sq_WriteDword(flagIndex); //写入 4 字节数 关键帧
|
|
obj.sq_WriteDword(DamageRate); //写入 4 字节数 伤害率
|
|
obj.sq_SendCreatePassiveObjectPacket(24371, 0, 0, -10, 20);
|
|
|
|
ATGunner_Sawblade_Skill.rawset("shoot", 1);
|
|
}
|
|
} else if ((obj.isCurrentCutomAniIndex(31) || obj.isCurrentCutomAniIndex(32) || obj.isCurrentCutomAniIndex(33))) {
|
|
if (ATGunner_Sawblade_Skill["shoot"] == 0) {
|
|
local DamageRate = obj.sq_GetBonusRateWithPassive(15, 27, 0, 1.0);
|
|
obj.sq_StartWrite(); //开始写入
|
|
obj.sq_WriteDword(671); //写入 4 字节数 技能ID
|
|
//obj.sq_WriteDword(WeaponType); //写入 4 字节数 武器类型
|
|
//obj.sq_WriteDword(flagIndex); //写入 4 字节数 关键帧
|
|
obj.sq_WriteDword(DamageRate); //写入 4 字节数 伤害率
|
|
obj.sq_SendCreatePassiveObjectPacket(24371, 0, 0, 10, 20);
|
|
|
|
ATGunner_Sawblade_Skill.rawset("shoot", 1);
|
|
}
|
|
} else {
|
|
ATGunner_Sawblade_Skill.rawset("shoot", 0);
|
|
}
|
|
*/
|
|
}
|
|
//27号状态 枪刃改良proc声明
|
|
if (getroottable().rawin("procAppend_ATGunner_Table"))
|
|
System.InsertArrayInTable(procAppend_ATGunner_Table, 27, "Sawblade", ProcAppend_Sawblade_walkshoot);
|
|
|
|
}
|
|
|
|
|
|
//动画结束时
|
|
{
|
|
function onEndCurrentAni_Sawblade(obj) {
|
|
|
|
{ //双C的结束
|
|
if (Chr_State_Table[0] == 67 && Chr_State_Table[1] == 67) {
|
|
local pIntVec = sq_GetGlobalIntVector();
|
|
sq_IntVectorClear(pIntVec);
|
|
sq_IntVectorPush(pIntVec, 1);
|
|
sq_IntVectorPush(pIntVec, 0);
|
|
sq_IntVectorPush(pIntVec, 1);
|
|
obj.addSetStatePacket(6, pIntVec, STATE_PRIORITY_USER, false, "");
|
|
}
|
|
}
|
|
|
|
{ //空Z
|
|
if (Chr_State_Table[0] == 69 && Chr_State_Table[1] == 69) {
|
|
local pIntVec = sq_GetGlobalIntVector();
|
|
sq_IntVectorClear(pIntVec);
|
|
sq_IntVectorPush(pIntVec, 691);
|
|
sq_IntVectorPush(pIntVec, 691);
|
|
obj.addSetStatePacket(13, pIntVec, STATE_PRIORITY_USER, false, "");
|
|
}
|
|
|
|
if (Chr_State_Table[0] == 691 && Chr_State_Table[1] == 691) {
|
|
local pIntVec = sq_GetGlobalIntVector();
|
|
sq_IntVectorClear(pIntVec);
|
|
sq_IntVectorPush(pIntVec, 0);
|
|
sq_IntVectorPush(pIntVec, 0);
|
|
sq_IntVectorPush(pIntVec, 0);
|
|
obj.addSetStatePacket(0, pIntVec, STATE_PRIORITY_USER, false, "");
|
|
}
|
|
}
|
|
|
|
{ //滑铲
|
|
if (Chr_State_Table[0] == 68 && Chr_State_Table[1] == 68) {
|
|
local pIntVec = sq_GetGlobalIntVector();
|
|
sq_IntVectorClear(pIntVec);
|
|
sq_IntVectorPush(pIntVec, 681);
|
|
sq_IntVectorPush(pIntVec, 681);
|
|
obj.addSetStatePacket(13, pIntVec, STATE_PRIORITY_USER, false, "");
|
|
}
|
|
|
|
if (Chr_State_Table[0] == 681 && Chr_State_Table[1] == 681) {
|
|
local pIntVec = sq_GetGlobalIntVector();
|
|
sq_IntVectorClear(pIntVec);
|
|
sq_IntVectorPush(pIntVec, 0);
|
|
sq_IntVectorPush(pIntVec, 0);
|
|
sq_IntVectorPush(pIntVec, 0);
|
|
obj.addSetStatePacket(0, pIntVec, STATE_PRIORITY_USER, false, "");
|
|
}
|
|
}
|
|
|
|
{ //拉起
|
|
if (Chr_State_Table[0] == 70 && Chr_State_Table[1] == 70) {
|
|
local pIntVec = sq_GetGlobalIntVector();
|
|
sq_IntVectorClear(pIntVec);
|
|
sq_IntVectorPush(pIntVec, 701);
|
|
sq_IntVectorPush(pIntVec, 701);
|
|
obj.addSetStatePacket(13, pIntVec, STATE_PRIORITY_USER, false, "");
|
|
}
|
|
|
|
if (Chr_State_Table[0] == 701 && Chr_State_Table[1] == 701) {
|
|
local pIntVec = sq_GetGlobalIntVector();
|
|
sq_IntVectorClear(pIntVec);
|
|
sq_IntVectorPush(pIntVec, 1);
|
|
sq_IntVectorPush(pIntVec, 0);
|
|
sq_IntVectorPush(pIntVec, 200);
|
|
obj.addSetStatePacket(6, pIntVec, STATE_PRIORITY_USER, false, "");
|
|
}
|
|
}
|
|
}
|
|
if (getroottable().rawin("onEndCurrentAni_ATGunner13State_Table"))
|
|
onEndCurrentAni_ATGunner13State_Table.rawset("Sawblade", onEndCurrentAni_Sawblade);
|
|
}
|
|
|
|
|
|
|
|
//关键帧时
|
|
{
|
|
function onKeyFrameFlag_Sawblade(obj, flagIndex) {
|
|
local WeaponType = obj.getWeaponSubType();
|
|
local DamageRate = obj.sq_GetBonusRateWithPassive(235, 13, 0, 3.0);
|
|
//0左轮 1自动手枪 2步枪 3手炮 4手弩
|
|
obj.sq_StartWrite(); //开始写入
|
|
obj.sq_WriteDword(670); //写入 4 字节数 技能ID
|
|
obj.sq_WriteDword(WeaponType); //写入 4 字节数 武器类型
|
|
obj.sq_WriteDword(flagIndex); //写入 4 字节数 关键帧
|
|
obj.sq_WriteDword(DamageRate); //写入 4 字节数 伤害率
|
|
obj.sq_SendCreatePassiveObjectPacket(24371, 0, 40, 0, 20);
|
|
|
|
obj.sq_StartWrite(); //开始写入
|
|
obj.sq_WriteDword(670); //写入 4 字节数 技能ID
|
|
obj.sq_WriteDword(WeaponType); //写入 4 字节数 武器类型
|
|
obj.sq_WriteDword(flagIndex); //写入 4 字节数 关键帧
|
|
obj.sq_WriteDword(DamageRate); //写入 4 字节数 伤害率
|
|
obj.sq_SendCreatePassiveObjectPacket(24371, 0, 70, 0, 40);
|
|
|
|
if (WeaponType != 3 && WeaponType != 4) {
|
|
obj.sq_StartWrite(); //开始写入
|
|
obj.sq_WriteDword(670); //写入 4 字节数 技能ID
|
|
obj.sq_WriteDword(8); //写入 4 字节数 武器类型
|
|
obj.sq_WriteDword(flagIndex); //写入 4 字节数 关键帧
|
|
obj.sq_WriteDword(DamageRate); //写入 4 字节数 伤害率
|
|
obj.sq_SendCreatePassiveObjectPacket(24371, 0, 40, 0, 50);
|
|
|
|
obj.sq_StartWrite(); //开始写入
|
|
obj.sq_WriteDword(670); //写入 4 字节数 技能ID
|
|
obj.sq_WriteDword(8); //写入 4 字节数 武器类型
|
|
obj.sq_WriteDword(flagIndex); //写入 4 字节数 关键帧
|
|
obj.sq_WriteDword(DamageRate); //写入 4 字节数 伤害率
|
|
obj.sq_SendCreatePassiveObjectPacket(24371, 0, 70, 0, 70);
|
|
}
|
|
}
|
|
if (getroottable().rawin("onKeyFrameFlag_ATGunner13State_Table"))
|
|
onKeyFrameFlag_ATGunner13State_Table.rawset("Sawblade", onKeyFrameFlag_Sawblade);
|
|
}
|
|
|
|
|
|
|
|
|
|
//特效 设置自定义特效时
|
|
{
|
|
function setCustomData_po_atgunner_Sawblade(obj, receiveData) {
|
|
local WeaponType = receiveData.readDword();
|
|
obj.getVar("Type").clear_vector();
|
|
obj.getVar("Type").push_vector(WeaponType);
|
|
|
|
local flagIndex = receiveData.readDword();
|
|
local DamageRate = receiveData.readDword();
|
|
|
|
local ani;
|
|
switch (WeaponType) {
|
|
case 0:
|
|
ani = obj.getVar().GetAnimationMap("zuolun", "passiveobject/sqr_po/atgunner/animation/suncha/bulletpistol.ani");
|
|
break;
|
|
case 1:
|
|
ani = obj.getVar().GetAnimationMap("buqiang", "passiveobject/sqr_po/atgunner/animation/suncha/bulletmusket.ani");
|
|
break;
|
|
case 2:
|
|
ani = obj.getVar().GetAnimationMap("zidong", "passiveobject/sqr_po/atgunner/animation/suncha/bulletautomatic_31439.ani");
|
|
break;
|
|
case 3:
|
|
ani = obj.getVar().GetAnimationMap("cannon", "passiveobject/sqr_po/atgunner/animation/suncha/cannon/attack.ani");
|
|
break;
|
|
case 4:
|
|
ani = obj.getVar().GetAnimationMap("shounu", "passiveobject/sqr_po/atgunner/animation/suncha/bulletbowgun.ani");
|
|
break;
|
|
case 8:
|
|
ani = obj.getVar().GetAnimationMap("EFFCT", "passiveobject/sqr_po/atgunner/animation/suncha/headshotgunner.ani");
|
|
break;
|
|
default:
|
|
return;
|
|
break;
|
|
}
|
|
|
|
switch (flagIndex) {
|
|
case 111:
|
|
sq_SetCustomRotate(obj, sq_ToRadian(-80.0));
|
|
break;
|
|
case 222:
|
|
sq_SetCustomRotate(obj, sq_ToRadian(-85.0));
|
|
break;
|
|
case 333:
|
|
sq_SetCustomRotate(obj, sq_ToRadian(-100.0));
|
|
break;
|
|
}
|
|
|
|
obj.setCurrentAnimation(ani);
|
|
local attackInfo = sq_GetCustomAttackInfo(obj, 0); //设置 特效 使用0号位atk
|
|
sq_SetCurrentAttackBonusRate(attackInfo, DamageRate); //给攻击信息设置百分比值
|
|
sq_SetCurrentAttackInfo(obj, attackInfo); //设置 当前攻击信息
|
|
|
|
}
|
|
if (getroottable().rawin("setCustomData_po_atgunner_po_Table"))
|
|
setCustomData_po_atgunner_po_Table.rawset(670, setCustomData_po_atgunner_Sawblade);
|
|
|
|
|
|
function setCustomData_po_atgunner_Sawblade_walkshoot(obj, receiveData) {
|
|
local DamageRate = receiveData.readDword();
|
|
local ani = obj.getVar().GetAnimationMap("Sawblade_walkshoot", "passiveobject/sqr_po/atgunner/animation/suncha/walkshootgun.ani");
|
|
|
|
obj.setCurrentAnimation(ani);
|
|
local attackInfo = sq_GetCustomAttackInfo(obj, 0); //设置 特效 使用0号位atk
|
|
sq_SetCurrentAttackBonusRate(attackInfo, DamageRate); //给攻击信息设置百分比值
|
|
sq_SetCurrentAttackInfo(obj, attackInfo); //设置 当前攻击信息
|
|
|
|
}
|
|
if (getroottable().rawin("setCustomData_po_atgunner_po_Table"))
|
|
setCustomData_po_atgunner_po_Table.rawset(671, setCustomData_po_atgunner_Sawblade_walkshoot);
|
|
}
|
|
|
|
|
|
//特效 Ani播放完成时
|
|
{
|
|
function onEndCurrentAni_po_atgunner_Sawblade(obj) {
|
|
sq_SendDestroyPacketPassiveObject(obj);
|
|
}
|
|
|
|
if (getroottable().rawin("onEndCurrentAni_po_atgunner_po_Table"))
|
|
onEndCurrentAni_po_atgunner_po_Table.rawset(670, onEndCurrentAni_po_atgunner_Sawblade);
|
|
|
|
if (getroottable().rawin("onEndCurrentAni_po_atgunner_po_Table"))
|
|
onEndCurrentAni_po_atgunner_po_Table.rawset(671, onEndCurrentAni_po_atgunner_Sawblade);
|
|
}
|
|
|
|
|
|
|
|
//特效 Proc中
|
|
{
|
|
function procAppend_po_atgunner_Sawblade(obj) {
|
|
local Type = obj.getVar("Type").get_vector(0);
|
|
|
|
if (Type == 3 || Type == 8) return;
|
|
|
|
local pAni = obj.getCurrentAnimation();
|
|
local index = sq_GetAnimationFrameIndex(pAni);
|
|
|
|
local currentT = sq_GetCurrentTime(pAni);
|
|
local fireT = pAni.getDelaySum(false); //总时间
|
|
|
|
local MoveZ = obj.getZPos(); //移动多少Z距离
|
|
|
|
if (MoveZ <= 3) {
|
|
sq_SendDestroyPacketPassiveObject(obj);
|
|
}
|
|
|
|
|
|
local v2 = sq_GetUniformVelocity(MoveZ, 0, currentT, MoveZ * 10);
|
|
local dstZ = sq_GetDistancePos(0, -MoveZ, v2);
|
|
|
|
sq_setCurrentAxisPos(obj, 2, dstZ); //设置当前z坐标
|
|
|
|
}
|
|
if (getroottable().rawin("procAppend_po_atgunner_po_Table"))
|
|
procAppend_po_atgunner_po_Table.rawset(670, procAppend_po_atgunner_Sawblade);
|
|
} |