387 lines
		
	
	
		
			15 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
			
		
		
	
	
			387 lines
		
	
	
		
			15 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
| /*
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| */
 | ||
| 
 | ||
| 
 | ||
| function checkExecutableSkill_meteorsword(obj) {
 | ||
|     if (!obj) return false;
 | ||
|     local isUse = obj.sq_IsUseSkill(235);
 | ||
|     if (isUse) {
 | ||
|         obj.sq_IsEnterSkillLastKeyUnits(235); //允许长按
 | ||
| 
 | ||
| 
 | ||
|         obj.sq_IntVectClear(); //清除人物子状态
 | ||
|         obj.sq_IntVectPush(0); //向人物子状态0号位 push 数据 0
 | ||
|         obj.sq_AddSetStatePacket(235, STATE_PRIORITY_USER, true); //将人物写入 235号 主状态
 | ||
| 
 | ||
|         return true;
 | ||
|     }
 | ||
|     return false;
 | ||
| }
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| function checkCommandEnable_meteorsword(obj) {
 | ||
|     if (!obj) return false;
 | ||
|     local chrstate = obj.sq_GetState(); //获取人物主状态
 | ||
| 
 | ||
|     if (chrstate == STATE_STAND) //if 人物主状态为站立  返回真
 | ||
|         return true;
 | ||
| 
 | ||
|     if (chrstate == STATE_ATTACK) //if 人物主状态为攻击中   state  8
 | ||
|     {
 | ||
|         return obj.sq_IsCommandEnable(235); //返回 是否允许按下235号技能按键的 布尔值
 | ||
|     }
 | ||
|     return true;
 | ||
| }
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| function onProcCon_meteorsword(obj) {
 | ||
|     local bDownKey = obj.isDownSkillLastKey();
 | ||
|     local stateTimer = obj.sq_GetStateTimer();
 | ||
|     local RootTable = getroottable();
 | ||
| 
 | ||
|     if (Chr_State_Table[0] == 0) {
 | ||
|         if (!bDownKey) {
 | ||
|             obj.sq_IntVectClear(); //清除人物子状态
 | ||
|             obj.sq_IntVectPush(3); //向人物子状态0号位 push 数据 0
 | ||
|             obj.sq_AddSetStatePacket(235, STATE_PRIORITY_USER, true); //将人物写入 235号 主状态
 | ||
|         } else if (stateTimer >= 800) {
 | ||
|             obj.sq_IntVectClear(); //清除人物子状态
 | ||
|             obj.sq_IntVectPush(2); //向人物子状态0号位 push 数据 0
 | ||
|             obj.sq_AddSetStatePacket(235, STATE_PRIORITY_USER, true); //将人物写入 235号 主状态
 | ||
|         }
 | ||
|         return;
 | ||
|     } else if (Chr_State_Table[0] == 2) {
 | ||
|         if (!bDownKey) {
 | ||
|             obj.sq_IntVectClear(); //清除人物子状态
 | ||
|             obj.sq_IntVectPush(4); //向人物子状态0号位 push 数据 0
 | ||
|             obj.sq_AddSetStatePacket(235, STATE_PRIORITY_USER, true); //将人物写入 235号 主状态
 | ||
|         }
 | ||
|     }
 | ||
| }
 | ||
| 
 | ||
| 
 | ||
| function createEff_meteorsword(obj, ani, X, Y, Z, B) {
 | ||
|     local ani = sq_CreateAnimation("", ani);
 | ||
|     local pooledObj = sq_CreatePooledObject(ani, B);
 | ||
|     pooledObj.setCurrentPos(X, Y, Z);
 | ||
|     pooledObj.setCurrentDirection(obj.getDirection());
 | ||
|     sq_AddObject(obj, pooledObj, 2, false);
 | ||
| 
 | ||
|     return pooledObj;
 | ||
| }
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| function onSetState_meteorsword(obj, state, datas, isResetTimer) {
 | ||
| 
 | ||
|     if (!obj) return;
 | ||
|     obj.sq_StopMove(); //停止移动
 | ||
| 
 | ||
|     obj.getVar("meteorsword").clear_vector();
 | ||
|     local RootTable = getroottable();
 | ||
| 
 | ||
| 
 | ||
|     if (Chr_State_Table[0] == 0) {
 | ||
|         local Direction = obj.getDirection();
 | ||
|         obj.sq_SetCurrentAnimation(124);
 | ||
| 
 | ||
|         local montab = GameC.findRoundNearAllEnemyRect(obj, 340, 80, Direction);
 | ||
|         if (montab.len() > 0) {
 | ||
|             foreach(Monobj in montab) {
 | ||
|                 if (!CNSquirrelAppendage.sq_IsAppendAppendage(Monobj, "character/swordman/weaponmaster/ap_meteorsword.nut")) {
 | ||
|                     local append = CNSquirrelAppendage.sq_AppendAppendage(Monobj, obj, -1, true, "character/swordman/weaponmaster/ap_meteorsword.nut", false);
 | ||
|                     CNSquirrelAppendage.sq_AppendAppendageID(append, Monobj, obj, 235, false);
 | ||
|                 }
 | ||
|             }
 | ||
|         }
 | ||
|     } else if (Chr_State_Table[0] == 2) {
 | ||
|         obj.sq_SetCurrentAnimation(125);
 | ||
| 
 | ||
|         GameC.RemoveObjectAppend(obj, "character/swordman/weaponmaster/ap_meteorsword.nut");
 | ||
|     } else if (Chr_State_Table[0] == 3) {
 | ||
|         obj.sq_SetCurrentAnimation(126);
 | ||
|     } else if (Chr_State_Table[0] == 4) {
 | ||
|         obj.sq_SetCurrentAnimation(126);
 | ||
| 
 | ||
|         obj.sq_SendCreatePassiveObjectPacket(2022100901, 0, 200, 1, 0);
 | ||
|         createEff_meteorsword(obj, "passiveobject/sqr_po/swordman/animation/meteorsword/up_meteorsword_shock1.ani", sq_GetDistancePos(obj.getXPos(), obj.getDirection(), 200), obj.getYPos(), obj.getZPos(), true);
 | ||
|         createEff_meteorsword(obj, "character/swordman/animation/yosin/meteorsword/up.ani", sq_GetDistancePos(obj.getXPos(), obj.getDirection(), 0), obj.getYPos(), obj.getZPos(), true);
 | ||
|         sq_SetShake(obj, 6, 1000);
 | ||
| 
 | ||
|     }
 | ||
| 
 | ||
| 
 | ||
| }
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| function onEndCurrentAni_meteorsword(obj) {
 | ||
|     if (!obj) return;
 | ||
| 
 | ||
|     if (Chr_State_Table[0] == 1) {
 | ||
|         obj.sq_IntVectClear(); //清除人物子状态
 | ||
|         obj.sq_IntVectPush(3); //向人物子状态0号位 push 数据 0
 | ||
|         obj.sq_AddSetStatePacket(235, STATE_PRIORITY_USER, true); //将人物写入 235号 主状态
 | ||
|     } else if (Chr_State_Table[0] == 3) {
 | ||
|         local attackBonusRate = obj.sq_GetBonusRateWithPassive(235, 235, 5, 2.0);
 | ||
| 
 | ||
|         obj.sq_StartWrite(); //开始写入
 | ||
|         obj.sq_WriteDword(235); //写入  4  字节数                            技能ID
 | ||
|         obj.sq_WriteDword(40); //写入  4  字节数                            掉落范围
 | ||
|         obj.sq_WriteDword(20); //写入  4  字节数                            掉落数量
 | ||
|         obj.sq_WriteDword(1); //写入  4  字节数                            当前计数
 | ||
|         obj.sq_WriteDword(attackBonusRate); //写入  4  字节数                            atk
 | ||
|         obj.sq_WriteDword(0); //写入  4  字节数                            是否满蓄力
 | ||
|         obj.sq_AddSetStatePacket(0, STATE_PRIORITY_USER, true);
 | ||
|         local POSxadd = sq_GetDistancePos(0, obj.getDirection(), 200); //设置落剑中点
 | ||
|         obj.sq_WriteDword(obj.getXPos() + POSxadd); //释放的时候的坐标
 | ||
|         obj.sq_WriteDword(obj.getYPos()); //释放的时候的坐标
 | ||
|         obj.sq_SendCreatePassiveObjectPacket(24370, 0, 200, 0, 0);
 | ||
|     } else if (Chr_State_Table[0] == 4) {
 | ||
|         local attackBonusRate = obj.sq_GetBonusRateWithPassive(235, 235, 5, 2.0);
 | ||
| 
 | ||
| 
 | ||
|         obj.sq_StartWrite(); //开始写入
 | ||
|         obj.sq_WriteDword(235); //写入  4  字节数                            技能ID
 | ||
|         obj.sq_WriteDword(40); //写入  4  字节数                            掉落范围
 | ||
|         obj.sq_WriteDword(20); //写入  4  字节数                            掉落数量
 | ||
|         obj.sq_WriteDword(1); //写入  4  字节数                            当前计数
 | ||
|         obj.sq_WriteDword(attackBonusRate); //写入  4  字节数                            atk
 | ||
|         obj.sq_WriteDword(1); //写入  4  字节数                            是否满蓄力
 | ||
|         obj.sq_AddSetStatePacket(0, STATE_PRIORITY_USER, true);
 | ||
|         local POSxadd = sq_GetDistancePos(0, obj.getDirection(), 200); //设置落剑中点
 | ||
|         obj.sq_WriteDword(obj.getXPos() + POSxadd); //释放的时候的坐标
 | ||
|         obj.sq_WriteDword(obj.getYPos()); //释放的时候的坐标
 | ||
|         obj.sq_SendCreatePassiveObjectPacket(24370, 0, 200, 0, 0);
 | ||
|     }
 | ||
| }
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| {
 | ||
|     function setCustomData_po_Swordman_meteorsword(obj, receiveData) {
 | ||
|         local px = receiveData.readDword(); //掉落范围
 | ||
|         local downnum = receiveData.readDword(); //掉落数量
 | ||
|         local nowdownnum = receiveData.readDword(); //当前计数
 | ||
|         local atk = receiveData.readDword(); //atk
 | ||
|         local BigSword = receiveData.readDword(); //是否满蓄力
 | ||
| 
 | ||
|         local Xpos = receiveData.readDword();
 | ||
|         local Ypos = receiveData.readDword();
 | ||
| 
 | ||
|         local size = 100;
 | ||
| 
 | ||
|         local SwordIndex = sq_getRandom(1, 7);
 | ||
|         local ani;
 | ||
| 
 | ||
|         if (nowdownnum > downnum) {
 | ||
|             ani = obj.getVar().GetAnimationMap("流星落蓄力一击", "passiveobject/sqr_po/swordman/animation/meteorsword/dropsword8_meteorsword_swords.ani");
 | ||
|             atk *= 5;
 | ||
|             size = 200;
 | ||
|         } else {
 | ||
|             ani = obj.getVar().GetAnimationMap("流星落", "passiveobject/sqr_po/swordman/animation/meteorsword/dropsword" + SwordIndex + "_meteorsword_swords.ani"); // 定义一下ani
 | ||
|         }
 | ||
|         obj.setCurrentAnimation(ani); //设置   特效  使用定义的   ani
 | ||
|         local attackInfo = sq_GetCustomAttackInfo(obj, 0); //设置  特效  使用6号位atk
 | ||
|         sq_SetCurrentAttackInfo(obj, attackInfo); //设置 当前攻击信息
 | ||
|         attackInfo = sq_GetCurrentAttackInfo(obj); //设置 attackInfo 为得到当前攻击信息
 | ||
| 
 | ||
|         sq_SetCurrentAttackPower(attackInfo, atk); //给当前攻击设置 百分比
 | ||
| 
 | ||
| 
 | ||
|         local currentAni = sq_GetCurrentAnimation(obj); //得到特效当前正在播放ani
 | ||
|         local sizeRate = size.tofloat() / 100.0; //转换浮点数运算
 | ||
|         currentAni.setImageRateFromOriginal(sizeRate, sizeRate); //增加ani 宽度跟高度率
 | ||
|         currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); //增加ani als附加 ani大小比例
 | ||
|         sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); //攻击框,x y z比率
 | ||
| 
 | ||
| 
 | ||
|         obj.getVar("var").clear_vector();
 | ||
|         obj.getVar("var").push_vector(px); //掉落范围
 | ||
|         obj.getVar("var").push_vector(downnum); //掉落数量
 | ||
|         obj.getVar("var").push_vector(nowdownnum); //当前计数
 | ||
|         obj.getVar("var").push_vector(atk); //atk
 | ||
|         obj.getVar("var").push_vector(BigSword); //是否满蓄力
 | ||
| 
 | ||
|         obj.getVar("var").push_vector(Xpos);
 | ||
|         obj.getVar("var").push_vector(Ypos);
 | ||
|     }
 | ||
| 
 | ||
|     setCustomData_po_swordman_po_Table.rawset(235, setCustomData_po_Swordman_meteorsword);
 | ||
| }
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| {
 | ||
|     function onKeyFrameFlag_po_swordman_meteorsword(obj, flagIndex) {
 | ||
|         local px = obj.getVar("var").get_vector(0); //掉落范围
 | ||
|         local downnum = obj.getVar("var").get_vector(1); //掉落数量
 | ||
|         local nowdownnum = obj.getVar("var").get_vector(2); //当前计数
 | ||
|         local atk = obj.getVar("var").get_vector(3); //atk
 | ||
|         local BigSword = obj.getVar("var").get_vector(4); //atk
 | ||
| 
 | ||
|         local Xpos = obj.getVar("var").get_vector(5);
 | ||
|         local Ypos = obj.getVar("var").get_vector(6);
 | ||
|         if (flagIndex == 1) {
 | ||
| 
 | ||
|             if (downnum > nowdownnum) //如果最大计数 大于当前计数
 | ||
|             {
 | ||
|                 if (!obj.isMyControlObject()) return false; //如果不是我的控制对象则返回
 | ||
| 
 | ||
|                 local posX = Xpos + sq_getRandom(-px * 2, px * 2); //得到坐标
 | ||
|                 local posY = Ypos + sq_getRandom(-px, px); //得到坐标
 | ||
| 
 | ||
|                 sq_BinaryStartWrite();
 | ||
|                 sq_BinaryWriteDword(235);
 | ||
| 
 | ||
|                 sq_BinaryWriteDword(px); //atk  百分比值
 | ||
|                 sq_BinaryWriteDword(downnum); //最大计数
 | ||
|                 sq_BinaryWriteDword(nowdownnum + 1); //当前计数
 | ||
|                 sq_BinaryWriteDword(atk); //
 | ||
|                 sq_BinaryWriteDword(BigSword);
 | ||
| 
 | ||
| 
 | ||
|                 sq_BinaryWriteDword(Xpos);
 | ||
|                 sq_BinaryWriteDword(Ypos);
 | ||
| 
 | ||
| 
 | ||
|                 sq_SendCreatePassiveObjectPacketPos(obj, 24370, 0, posX, posY, obj.getZPos()); //生成 obj特效
 | ||
|                 sq_SetMyShake(obj, 1, 100);
 | ||
|                 return true;
 | ||
|             }
 | ||
| 
 | ||
|         } else if (flagIndex == 666) {
 | ||
|             sq_SetMyShake(obj, 5, 300);
 | ||
|         }
 | ||
|         if (flagIndex == 222 && BigSword == 1 && downnum == nowdownnum) {
 | ||
|             if (!obj.isMyControlObject()) return false; //如果不是我的控制对象则返回
 | ||
| 
 | ||
|             local posX = Xpos; //得到坐标
 | ||
|             local posY = Ypos; //得到坐标
 | ||
| 
 | ||
|             sq_BinaryStartWrite();
 | ||
|             sq_BinaryWriteDword(235);
 | ||
| 
 | ||
|             sq_BinaryWriteDword(px); //atk  百分比值
 | ||
|             sq_BinaryWriteDword(downnum); //最大计数
 | ||
|             sq_BinaryWriteDword(nowdownnum + 1); //当前计数
 | ||
|             sq_BinaryWriteDword(atk); //
 | ||
|             sq_BinaryWriteDword(BigSword);
 | ||
| 
 | ||
|             sq_BinaryWriteDword(Xpos);
 | ||
|             sq_BinaryWriteDword(Ypos);
 | ||
| 
 | ||
|             sq_SendCreatePassiveObjectPacketPos(obj, 24370, 0, posX, posY, obj.getZPos()); //生成 obj特效
 | ||
|             return true;
 | ||
|         }
 | ||
|         return true;
 | ||
|     }
 | ||
|     onKeyFrameFlag_po_swordman_po_Table.rawset(235, onKeyFrameFlag_po_swordman_meteorsword);
 | ||
| }
 | ||
| 
 | ||
| {
 | ||
|     function onEndCurrentAni_po_swordman_meteorsword(obj) {
 | ||
|         sq_SendDestroyPacketPassiveObject(obj);
 | ||
|     }
 | ||
|     onEndCurrentAni_po_swordman_po_Table.rawset(235, onEndCurrentAni_po_swordman_meteorsword);
 | ||
| }
 | ||
| /*
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
| function setCustomData_po_swordman_meteorsword(obj, receiveData)
 | ||
| {
 | ||
|     local px = receiveData.readDword(); //掉落范围
 | ||
|     local downnum = receiveData.readDword(); //掉落数量
 | ||
|     local nowdownnum = receiveData.readDword(); //当前计数
 | ||
|     local atk = receiveData.readDword(); //atk
 | ||
| 
 | ||
|     local Xpos = receiveData.readDword();
 | ||
|     local Ypos = receiveData.readDword();
 | ||
|     local WeaponIndex = receiveData.readDword();
 | ||
| 
 | ||
|     local size = 100;
 | ||
| 
 | ||
|     local SwordIndex = sq_getRandom(1, 7);
 | ||
|     local ani = obj.getVar().GetAnimationMap("流星落", "passiveobject/sqr_po/swordman/animation/meteorsword/dropsword" + SwordIndex + "_meteorsword_swords.ani"); // 定义一下ani
 | ||
|     if (WeaponIndex == 80000001)
 | ||
|     {
 | ||
|         ani = obj.getVar().GetAnimationMap("克拉丽丝流星落", "passiveobject/sqr_po/swordman/animation/meteorsword/dropsword8_meteorsword_swords.ani");
 | ||
|         downnum = downnum * 2;
 | ||
|         px = px + 2;
 | ||
|     }
 | ||
|     obj.setCurrentAnimation(ani); //设置   特效  使用定义的   ani
 | ||
|     local attackInfo = sq_GetCustomAttackInfo(obj, 6); //设置  特效  使用6号位atk
 | ||
|     sq_SetCurrentAttackInfo(obj, attackInfo); //设置 当前攻击信息
 | ||
|     attackInfo = sq_GetCurrentAttackInfo(obj); //设置 attackInfo 为得到当前攻击信息
 | ||
|     sq_SetCurrentAttackPower(attackInfo, atk); //给当前攻击设置 百分比
 | ||
| 
 | ||
| 
 | ||
|     local currentAni = sq_GetCurrentAnimation(obj); //得到特效当前正在播放ani
 | ||
|     local sizeRate = size.tofloat() / 100.0; //转换浮点数运算
 | ||
|     currentAni.setImageRateFromOriginal(sizeRate, sizeRate); //增加ani 宽度跟高度率
 | ||
|     currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate); //增加ani als附加 ani大小比例
 | ||
|     sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate); //攻击框,x y z比率
 | ||
| 
 | ||
| 
 | ||
|     obj.getVar("var").clear_vector();
 | ||
|     obj.getVar("var").push_vector(px); //掉落范围
 | ||
|     obj.getVar("var").push_vector(downnum); //掉落数量
 | ||
|     obj.getVar("var").push_vector(nowdownnum); //当前计数
 | ||
|     obj.getVar("var").push_vector(atk); //atk
 | ||
| 
 | ||
|     obj.getVar("var").push_vector(Xpos);
 | ||
|     obj.getVar("var").push_vector(Ypos);
 | ||
| 
 | ||
| }
 | ||
| 
 | ||
| function onKeyFrameFlag_po_swordman_meteorsword(obj, flagIndex)
 | ||
| {
 | ||
|     if (flagIndex == 1)
 | ||
|     {
 | ||
|         local px = obj.getVar("var").get_vector(0); //掉落范围
 | ||
|         local downnum = obj.getVar("var").get_vector(1); //掉落数量
 | ||
|         local nowdownnum = obj.getVar("var").get_vector(2); //当前计数
 | ||
|         local atk = obj.getVar("var").get_vector(3); //atk
 | ||
| 
 | ||
|         local Xpos = obj.getVar("var").get_vector(4);
 | ||
|         local Ypos = obj.getVar("var").get_vector(5);
 | ||
| 
 | ||
| 
 | ||
|         if (downnum > nowdownnum) //如果最大计数 大于当前计数
 | ||
|         {
 | ||
|             if (!obj.isMyControlObject()) return false; //如果不是我的控制对象则返回
 | ||
| 
 | ||
|             local posX = Xpos + sq_getRandom(-px * 2, px * 2); //得到坐标
 | ||
|             local posY = Ypos + sq_getRandom(-px, px); //得到坐标
 | ||
| 
 | ||
|             sq_BinaryStartWrite();
 | ||
|             sq_BinaryWriteDword(235);
 | ||
| 
 | ||
|             sq_BinaryWriteDword(px); //atk  百分比值
 | ||
|             sq_BinaryWriteDword(downnum); //最大计数
 | ||
|             sq_BinaryWriteDword(nowdownnum + 1); //当前计数
 | ||
|             sq_BinaryWriteDword(atk); //
 | ||
| 
 | ||
|             sq_BinaryWriteDword(Xpos);
 | ||
|             sq_BinaryWriteDword(Ypos);
 | ||
| 
 | ||
| 
 | ||
|             sq_SendCreatePassiveObjectPacketPos(obj, 24370, 0, posX, posY, obj.getZPos()); //生成 obj特效
 | ||
|             sq_SetMyShake(obj, 1, 100);
 | ||
|             return true;
 | ||
|         }
 | ||
|     }
 | ||
|     return true;
 | ||
| }
 | ||
| */ |