function checkExecutableSkill_WindStrike(obj)
{
if (!obj) return false;
local isUse = obj.sq_IsUseSkill(SKILL_WIND_STRIKE);
if (isUse) {
obj.getVar("state").clear_vector();
obj.getVar("state").push_vector(0);
obj.sq_AddSetStatePacket(STATE_WIND_STRIKE , STATE_PRIORITY_USER, false);
return true;
}
return false;
}
function checkCommandEnable_WindStrike(obj)
{
return true;
}
function onSetState_WindStrike(obj, state, datas, isResetTimer)
{
if(!obj) return;
obj.sq_StopMove();
local state = obj.getVar("state").get_vector(0);
obj.sq_StopMove();
if(state == 0)
{
obj.sq_SetCurrentAnimation(CUSTOM_ANI_WIND_STRIKE);
obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED,
SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0);
}
else if(state == 1)
{
obj.sq_SetCurrentAnimation(CUSTOM_ANI_WindMasterUpperB_Body);
obj.sq_SetCurrentAttackInfo(CUSTOM_ATTACK_INFO_WindMasterWindStrikeUpper);
local ani = obj.sq_GetCurrentAni();
local delay = 0;
if(ani)
delay = ani.getDelaySum(false);
local multiHit = obj.sq_GetIntData(SKILL_WIND_STRIKE, 2);
print(" multiHit:" + multiHit + " delay:" + delay);
print(delay / multiHit);
obj.sq_timer_.setParameter(delay / multiHit, multiHit - 1);
obj.sq_timer_.resetInstant(0);
obj.getVar("flag").clear_vector();
obj.getVar("flag").push_vector(delay);
local rate = obj.sq_GetIntData(SKILL_WIND_STRIKE, 1);
local lastRate = (100 + rate).tofloat() / 100.0;
local attackBonusRate = obj.sq_GetBonusRateWithPassive(SKILL_WIND_STRIKE, STATE_WIND_STRIKE, SKL_LVL_COLUMN_IDX_0, lastRate);
local power = obj.sq_GetPowerWithPassive(SKILL_WIND_STRIKE, STATE_WIND_STRIKE, SKL_LVL_COLUMN_IDX_1, SKL_LVL_COLUMN_IDX_0, lastRate);
local upForce = obj.sq_GetLevelData(2);
local attackInfo = sq_GetCurrentAttackInfo(obj);
sq_SetCurrentAttackBonusRate(attackInfo, attackBonusRate);
sq_SetCurrentAttackPower(attackInfo, power);
sq_SetCurrentAttacknUpForce(attackInfo, upForce);
obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED,
SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0);
}
}
function onProc_WindStrike(obj)
{
local state = obj.getVar("state").get_vector(0);
local pAni = obj.sq_GetCurrentAni();
local currentT = sq_GetCurrentTime(pAni);
if (state == 0)
{
if (obj.sq_GetSkillLevel(SKILL_WINDMASTER) > 0)
{
local pAni = obj.sq_GetCurrentAni();
local frmIndex = obj.sq_GetCurrentFrameIndex(pAni);
local currentT = sq_GetCurrentTime(pAni);
if (frmIndex >= 4)
{
obj.setSkillCommandEnable(SKILL_WIND_STRIKE, true);
local iEnterSkill = obj.sq_IsEnterSkill(SKILL_WIND_STRIKE);
if (iEnterSkill != -1 || sq_IsKeyDown(OPTION_HOTKEY_ATTACK, ENUM_SUBKEY_TYPE_ALL))
{
obj.getVar("state").clear_vector();
obj.getVar("state").push_vector(1);
obj.sq_AddSetStatePacket(STATE_WIND_STRIKE , STATE_PRIORITY_USER, false);
}
}
}
}
else if (state == 1)
{
if (obj.sq_timer_.isOnEvent(currentT) == true)
obj.resetHitObjectList();
}
}
function onEndCurrentAni_WindStrike(obj)
{
obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false);
}
function onKeyFrameFlag_WindStrike(obj,flagIndex)
{
if(!obj)
return false;
local isMyControlObject = obj.sq_IsMyControlObject();
local state = obj.getVar("state").get_vector(0);
if (state == 0)
{
if (isMyControlObject && flagIndex == 1)
{
local attackBonusRate = obj.sq_GetBonusRateWithPassive(SKILL_WIND_STRIKE, STATE_WIND_STRIKE, SKL_LVL_COLUMN_IDX_0, 1.0);
local power = obj.sq_GetPowerWithPassive(SKILL_WIND_STRIKE, STATE_WIND_STRIKE, SKL_LVL_COLUMN_IDX_1, SKL_LVL_COLUMN_IDX_0, 1.0);
local upForce = obj.sq_GetLevelData(2);
obj.sq_StartWrite();
obj.sq_WriteDword(attackBonusRate);// attackBonusRate
obj.sq_WriteDword(power);// power
obj.sq_WriteWord(upForce);// upForce
obj.sq_SendCreatePassiveObjectPacket(24201, 0, 120, 1, 0);
}
return true;
}
}