男魔法冰洁师冰花优化
路径:sqr/character/atmage/pieceofice/piece_of_ice.nut
优化代码:
function onKeyFrameFlag_PieceOfIce(obj, flagIndex)
{
if(!obj) return false;
local substate = obj.getSkillSubState();
local level = sq_GetSkillLevel(obj, SKILL_PIECE_OF_ICE);
if(flagIndex == 1) {
if(obj.isMyControlObject())
{
obj.sq_StartWrite();
obj.sq_WriteBool(false);
local x = sq_GetIntData(obj, SKILL_PIECE_OF_ICE, 0);
local z = sq_GetIntData(obj, SKILL_PIECE_OF_ICE, 1);
obj.sq_SendCreatePassiveObjectPacket(24224, 0, x, 0, z);
}
}
else if(flagIndex >= 2 ) {
//dofile("pieceice.c");
//doICES(obj, flagIndex);
local iceCoreObj = obj.getMyPassiveObject(24224,0);
if(iceCoreObj)
{
if(iceCoreObj.isMyControlObject()) {
iceCoreObj.sendStatePacket(PIECE_OF_ICE_CORE_STATE_DAMAGE, flagIndex);
}
local randMin = sq_GetIntData(obj, SKILL_PIECE_OF_ICE, 2);
local randMax = sq_GetIntData(obj, SKILL_PIECE_OF_ICE, 3);
local randNum = sq_getRandom(randMin, randMax);
local hAngleRange = sq_GetIntData(obj, SKILL_PIECE_OF_ICE, 5); //좌우 범위
local vAngleRange = sq_GetIntData(obj, SKILL_PIECE_OF_ICE, 6); //상하 범위
local randPin = randNum / 2;
for(local i=0;i<randNum;++i) {
//최대 플래그 인덱스 = 8 8에 가까울수록 범위가 줄어 든다.
if(obj.isMyControlObject())
{
//local hAngleRange = sq_GetIntData(obj, SKILL_PIECE_OF_ICE, 5); //좌우 범위
//local vAngleRange = sq_GetIntData(obj, SKILL_PIECE_OF_ICE, 6); //상하 범위
local hArnum = 0;
if(hAngleRange >= 360){
hAngleRange = 360;
hArnum = (i * (hAngleRange / randNum) - 90);
if(i > randPin){
hArnum = (i * (hAngleRange / randNum) + 270);
}
}else {
hArnum = sq_getRandom(0,hAngleRange) - (hAngleRange/2);
}
local horizonAngle = hArnum;
local verticalAngle = sq_getRandom(0,vAngleRange);
// 프레임이 지날수록 생성 좌표가 점점 안으로 들어가게끔
local startPosY = (40 * (8-flagIndex)/POI_MAX_KEYFRAME_INDEX) * (vAngleRange == 0 ? 1 : horizonAngle/(hAngleRange/2));
local lifeTime = sq_GetIntData(obj, SKILL_PIECE_OF_ICE, 4);
//?建???
local iceParticle = sq_CreateDrawOnlyObject(iceCoreObj, "PassiveObject/Character/Mage/Animation/ATPieceOfIce/08_ice_shard1_dodge.ani",ENUM_DRAWLAYER_NORMAL,true);
//obj.setCustomRotate(true, angle);//?象?
//sq_SetCustomRotate(obj, 0.0);//任意?象 旋?
//sq_SetfRotateAngle(pAni, angle);//?ani?置旋?
//sq_AddfRotateAngle(pAni, angle);//?ani?置旋?
//sq_ToRadian(angle); #角度??弧度
sq_SetCustomRotate(iceParticle,sq_ToRadian(-horizonAngle.tofloat()));
obj.sq_StartWrite();
obj.sq_WriteWord(sq_getRandom(0,5));
obj.sq_WriteFloat(horizonAngle.tofloat()); // 수평 범위
obj.sq_WriteFloat(verticalAngle.tofloat()); // 수직 범위
obj.sq_WriteWord(lifeTime);
//角色?建特效 方向?坐?都是以角色偏移 ??分?是:特效??,等?,x偏移,y偏移,z偏移
//obj.sq_SendCreatePassiveObjectPacket(24201, 0, 120, 1, 0);
obj.sq_SendCreatePassiveObjectPacket(24223, 0, 60, startPosY, 75);
}
}
}
}
return true;
}
路径:sqr/character/atmage/pieceofice/piece_of_ice.nut
优化代码:
function onKeyFrameFlag_PieceOfIce(obj, flagIndex)
{
if(!obj) return false;
local substate = obj.getSkillSubState();
local level = sq_GetSkillLevel(obj, SKILL_PIECE_OF_ICE);
if(flagIndex == 1) {
if(obj.isMyControlObject())
{
obj.sq_StartWrite();
obj.sq_WriteBool(false);
local x = sq_GetIntData(obj, SKILL_PIECE_OF_ICE, 0);
local z = sq_GetIntData(obj, SKILL_PIECE_OF_ICE, 1);
obj.sq_SendCreatePassiveObjectPacket(24224, 0, x, 0, z);
}
}
else if(flagIndex >= 2 ) {
//dofile("pieceice.c");
//doICES(obj, flagIndex);
local iceCoreObj = obj.getMyPassiveObject(24224,0);
if(iceCoreObj)
{
if(iceCoreObj.isMyControlObject()) {
iceCoreObj.sendStatePacket(PIECE_OF_ICE_CORE_STATE_DAMAGE, flagIndex);
}
local randMin = sq_GetIntData(obj, SKILL_PIECE_OF_ICE, 2);
local randMax = sq_GetIntData(obj, SKILL_PIECE_OF_ICE, 3);
local randNum = sq_getRandom(randMin, randMax);
local hAngleRange = sq_GetIntData(obj, SKILL_PIECE_OF_ICE, 5); //좌우 범위
local vAngleRange = sq_GetIntData(obj, SKILL_PIECE_OF_ICE, 6); //상하 범위
local randPin = randNum / 2;
for(local i=0;i<randNum;++i) {
//최대 플래그 인덱스 = 8 8에 가까울수록 범위가 줄어 든다.
if(obj.isMyControlObject())
{
//local hAngleRange = sq_GetIntData(obj, SKILL_PIECE_OF_ICE, 5); //좌우 범위
//local vAngleRange = sq_GetIntData(obj, SKILL_PIECE_OF_ICE, 6); //상하 범위
local hArnum = 0;
if(hAngleRange >= 360){
hAngleRange = 360;
hArnum = (i * (hAngleRange / randNum) - 90);
if(i > randPin){
hArnum = (i * (hAngleRange / randNum) + 270);
}
}else {
hArnum = sq_getRandom(0,hAngleRange) - (hAngleRange/2);
}
local horizonAngle = hArnum;
local verticalAngle = sq_getRandom(0,vAngleRange);
// 프레임이 지날수록 생성 좌표가 점점 안으로 들어가게끔
local startPosY = (40 * (8-flagIndex)/POI_MAX_KEYFRAME_INDEX) * (vAngleRange == 0 ? 1 : horizonAngle/(hAngleRange/2));
local lifeTime = sq_GetIntData(obj, SKILL_PIECE_OF_ICE, 4);
//?建???
local iceParticle = sq_CreateDrawOnlyObject(iceCoreObj, "PassiveObject/Character/Mage/Animation/ATPieceOfIce/08_ice_shard1_dodge.ani",ENUM_DRAWLAYER_NORMAL,true);
//obj.setCustomRotate(true, angle);//?象?
//sq_SetCustomRotate(obj, 0.0);//任意?象 旋?
//sq_SetfRotateAngle(pAni, angle);//?ani?置旋?
//sq_AddfRotateAngle(pAni, angle);//?ani?置旋?
//sq_ToRadian(angle); #角度??弧度
sq_SetCustomRotate(iceParticle,sq_ToRadian(-horizonAngle.tofloat()));
obj.sq_StartWrite();
obj.sq_WriteWord(sq_getRandom(0,5));
obj.sq_WriteFloat(horizonAngle.tofloat()); // 수평 범위
obj.sq_WriteFloat(verticalAngle.tofloat()); // 수직 범위
obj.sq_WriteWord(lifeTime);
//角色?建特效 方向?坐?都是以角色偏移 ??分?是:特效??,等?,x偏移,y偏移,z偏移
//obj.sq_SendCreatePassiveObjectPacket(24201, 0, 120, 1, 0);
obj.sq_SendCreatePassiveObjectPacket(24223, 0, 60, startPosY, 75);
}
}
}
}
return true;
}