3010 lines
141 KiB
Plaintext
3010 lines
141 KiB
Plaintext
|
|
|
||
|
|
|
||
|
|
/////////////////////////elementalmaster//////////////////////
|
||
|
|
|
||
|
|
|
||
|
|
function setState_elementalmaster_bykk(obj, state, datas, isResetTimer)
|
||
|
|
{
|
||
|
|
if(state == 17 && sq_GetVectorData(datas, 0) == 29){
|
||
|
|
obj.sq_IntVectClear();
|
||
|
|
obj.sq_IntVectPush(0);
|
||
|
|
obj.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_ELEMENTALCHAIN, STATE_PRIORITY_IGNORE_FORCE, true);
|
||
|
|
}
|
||
|
|
else if(state == 17 && sq_GetVectorData(datas, 0) == 2){
|
||
|
|
obj.sq_IntVectClear();
|
||
|
|
obj.sq_IntVectPush(0);
|
||
|
|
obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ASSIMILATE, STATE_PRIORITY_IGNORE_FORCE, true);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function onAfterSetState_Throw_elementalmaster_bykk(obj, state, datas, isResetTimer)
|
||
|
|
{
|
||
|
|
local ThrowIndex = obj.getThrowIndex();
|
||
|
|
local throwState = obj.getThrowState();
|
||
|
|
|
||
|
|
local Mightyrune_T =
|
||
|
|
{//light,ice,fire,dark
|
||
|
|
[15] = [0,0,1,0],
|
||
|
|
[16] = [0,1,0,0],
|
||
|
|
[18] = [0,0,0,1],
|
||
|
|
[17] = [1,0,0,0],
|
||
|
|
[57] = [0,0,1,0],
|
||
|
|
[56] = [0,1,0,0],
|
||
|
|
[26] = [0,0,0,1],
|
||
|
|
[31] = [1,0,0,0],
|
||
|
|
[27] = [0,0,1,0],
|
||
|
|
[59] = [0,1,0,0],
|
||
|
|
[55] = [1,0,0,0],
|
||
|
|
[58] = [0,0,0,1]
|
||
|
|
}
|
||
|
|
|
||
|
|
if(throwState == 0 && Mightyrune_T.rawin(ThrowIndex)){
|
||
|
|
switch(ThrowIndex){
|
||
|
|
case 15:
|
||
|
|
case 26:
|
||
|
|
case 58:
|
||
|
|
case 59:
|
||
|
|
case 27:
|
||
|
|
obj.sq_IntVectClear();
|
||
|
|
obj.sq_IntVectPush(10);
|
||
|
|
obj.sq_IntVectPush(ThrowIndex);
|
||
|
|
obj.sq_IntVectPush(1);
|
||
|
|
obj.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_ELEMENTALCHAIN, STATE_PRIORITY_IGNORE_FORCE, true);
|
||
|
|
break;
|
||
|
|
case 16:
|
||
|
|
case 31:
|
||
|
|
obj.sq_IntVectClear();
|
||
|
|
obj.sq_IntVectPush(20);
|
||
|
|
obj.sq_IntVectPush(ThrowIndex);
|
||
|
|
obj.sq_IntVectPush(3);
|
||
|
|
obj.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_ELEMENTALCHAIN, STATE_PRIORITY_IGNORE_FORCE, true);
|
||
|
|
break;
|
||
|
|
case 17:
|
||
|
|
obj.sq_IntVectClear();
|
||
|
|
obj.sq_IntVectPush(30);
|
||
|
|
obj.sq_IntVectPush(ThrowIndex);
|
||
|
|
obj.sq_IntVectPush(2);
|
||
|
|
obj.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_ELEMENTALCHAIN, STATE_PRIORITY_IGNORE_FORCE, true);
|
||
|
|
break;
|
||
|
|
case 18:
|
||
|
|
obj.sq_IntVectClear();
|
||
|
|
obj.sq_IntVectPush(40);
|
||
|
|
obj.sq_IntVectPush(ThrowIndex);
|
||
|
|
obj.sq_IntVectPush(0);
|
||
|
|
obj.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_ELEMENTALCHAIN, STATE_PRIORITY_IGNORE_FORCE, true);
|
||
|
|
break;
|
||
|
|
case 57:
|
||
|
|
obj.sq_IntVectClear();
|
||
|
|
obj.sq_IntVectPush(0);
|
||
|
|
obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_FLAMESTRIKE, STATE_PRIORITY_IGNORE_FORCE, true);
|
||
|
|
break;
|
||
|
|
case 55:
|
||
|
|
obj.sq_IntVectClear();
|
||
|
|
obj.sq_IntVectPush(0);
|
||
|
|
obj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_THUNDERCALLING, STATE_PRIORITY_IGNORE_FORCE, true);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
if(throwState == 1 && Mightyrune_T.rawin(ThrowIndex)){
|
||
|
|
sq_BinaryStartWrite();
|
||
|
|
foreach(elsement in Mightyrune_T[ThrowIndex]){
|
||
|
|
sq_BinaryWriteDword(elsement);
|
||
|
|
}
|
||
|
|
sq_SendChangeSkillEffectPacket(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN);
|
||
|
|
if(ThrowIndex == 56){
|
||
|
|
elementalmaster_setelementSkillBonusRate(obj, 56);
|
||
|
|
}
|
||
|
|
else if(ThrowIndex == 74){
|
||
|
|
elementalmaster_setelementSkillBonusRate(obj, 74);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function onEndCurrentAni_Mage_Throw_elementalmaster(obj)
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
function reset_elementalmaster_bykk(obj)
|
||
|
|
{
|
||
|
|
local addAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"appendage/character/ap_common_suck.nut");
|
||
|
|
if(!addAppendage) return;
|
||
|
|
CNSquirrelAppendage.sq_RemoveAppendage(obj, "appendage/character/ap_common_suck.nut");
|
||
|
|
local size = obj.getVar("blackhole").get_obj_vector_size();
|
||
|
|
if(size > 0){
|
||
|
|
for(local i = 0; i < size; i++){
|
||
|
|
local bhObj = obj.getVar("blackhole").get_obj_vector(i);
|
||
|
|
if(bhObj) bhObj.setValid(false);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
obj.getVar("blackhole").clear_obj_vector();
|
||
|
|
}
|
||
|
|
|
||
|
|
function onChangeSkillEffect_Mage_elementalmaster(obj, skillIndex, reciveData)
|
||
|
|
{
|
||
|
|
switch(skillIndex){
|
||
|
|
case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN:
|
||
|
|
local addAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut");
|
||
|
|
if(!addAppendage) return;
|
||
|
|
local pushstate = 22;
|
||
|
|
if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_MIGHTYRUNE) > 0) pushstate = 25;
|
||
|
|
local assimilate_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ASSIMILATE);
|
||
|
|
local buff1 = reciveData.readDword();
|
||
|
|
local buff2 = reciveData.readDword();
|
||
|
|
local buff3 = reciveData.readDword();
|
||
|
|
local buff4 = reciveData.readDword();
|
||
|
|
local buffnum = [];
|
||
|
|
local buffname = ["","light","ice","fire","dark"];
|
||
|
|
if(buff1 > 0) buffnum.push(1);
|
||
|
|
if(buff2 > 0) buffnum.push(2);
|
||
|
|
if(buff3 > 0) buffnum.push(3);
|
||
|
|
if(buff4 > 0) buffnum.push(4);
|
||
|
|
for(local i = 0; i < buffnum.len(); i++){
|
||
|
|
local anum = buffnum[i];
|
||
|
|
addAppendage.getVar().setBool(anum, true);
|
||
|
|
local effectObj = obj.getVar("elementalchain_"+buffname[anum]).get_obj_vector(0);
|
||
|
|
if(effectObj){
|
||
|
|
local colObj = sq_GetCNRDObjectToCollisionObject(effectObj);
|
||
|
|
if(assimilate_level > 0){
|
||
|
|
local pooledObj = createOnlyDrawObject_elementalmaster_bykk(obj,"character/mage/effect/animation/elementalmaster_bykk/mightyrune/lv95assimilate/"+buffname[anum]+"activate_00.ani",true,colObj.getDirection(),sq_GetXPos(colObj),sq_GetYPos(colObj) + 1,sq_GetZPos(colObj) + 1,ENUM_DRAWLAYER_NORMAL);
|
||
|
|
sq_moveWithParent(colObj, pooledObj);
|
||
|
|
}
|
||
|
|
else colObj.addSetStatePacket(pushstate, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
setElementalChainBuff_bykk(obj,skillIndex,addAppendage);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function onStartDungeon_Elementalmaster_bykk(obj)
|
||
|
|
{
|
||
|
|
local loadSlot = obj.sq_GetSkillLoad(ELEMENTALMASTER_SKILL_ELEMENTMASTERY);
|
||
|
|
if(loadSlot) obj.sq_RemoveSkillLoad(ELEMENTALMASTER_SKILL_ELEMENTMASTERY);
|
||
|
|
local addAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut");
|
||
|
|
if(!addAppendage) return;
|
||
|
|
CNSquirrelAppendage.sq_RemoveAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut");
|
||
|
|
local addAppendage2 = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_moveoncast.nut");
|
||
|
|
if(!addAppendage2) return;
|
||
|
|
addAppendage2.getVar().setBool(0, false);
|
||
|
|
}
|
||
|
|
|
||
|
|
function setElementalChainBuff_bykk(obj,skillIndex,addAppendage)
|
||
|
|
{
|
||
|
|
return;
|
||
|
|
// local skillLevel = sq_GetSkillLevel(obj, skillIndex);
|
||
|
|
// local buff_num = [];
|
||
|
|
// if(addAppendage.getVar().getBool(1)) buff_num.push(1);
|
||
|
|
// if(addAppendage.getVar().getBool(2)) buff_num.push(1);
|
||
|
|
// if(addAppendage.getVar().getBool(3)) buff_num.push(1);
|
||
|
|
// if(addAppendage.getVar().getBool(4)) buff_num.push(1);
|
||
|
|
// local value1 = 0;
|
||
|
|
// switch(buff_num.len()){
|
||
|
|
// case 1: value1 = sq_GetLevelData(obj, skillIndex, 6, skillLevel); break;
|
||
|
|
// case 2: value1 = sq_GetLevelData(obj, skillIndex, 7, skillLevel); break;
|
||
|
|
// case 3: value1 = sq_GetLevelData(obj, skillIndex, 8, skillLevel); break;
|
||
|
|
// case 4: value1 = sq_GetLevelData(obj, skillIndex, 9, skillLevel); break;
|
||
|
|
// }
|
||
|
|
// local change_appendage = addAppendage.sq_getChangeStatus("elementalchain");
|
||
|
|
// if(!change_appendage) change_appendage = addAppendage.sq_AddChangeStatus("elementalchain",obj, obj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK,true, value1);
|
||
|
|
// if(change_appendage){
|
||
|
|
// change_appendage.clearParameter();
|
||
|
|
// if(value1 > 0){
|
||
|
|
// change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_MAGICAL_ATTACK, true, (value1 * 0.01).tofloat());
|
||
|
|
// change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_PHYSICAL_ATTACK, true, (value1 * 0.01).tofloat());
|
||
|
|
// }
|
||
|
|
// }
|
||
|
|
}
|
||
|
|
|
||
|
|
function onStart_appendage_elementmastery_bykk(appendage)
|
||
|
|
{
|
||
|
|
local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent());
|
||
|
|
if(!parentObj || parentObj.getState() == STATE_DIE){appendage.setValid(false);return;}
|
||
|
|
|
||
|
|
local skillLevel = parentObj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_ELEMENTMASTERY);
|
||
|
|
local value1 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTMASTERY, 4, skillLevel);
|
||
|
|
local value2 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTMASTERY, 5, skillLevel);
|
||
|
|
local mightyrune_level = parentObj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_MIGHTYRUNE);
|
||
|
|
if(mightyrune_level > 0){
|
||
|
|
local add_Rate = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_MIGHTYRUNE, 3, mightyrune_level);
|
||
|
|
value1 = value1 * (1000 + add_Rate) / 1000;
|
||
|
|
}
|
||
|
|
local change_appendage = appendage.sq_getChangeStatus("elementmastery");
|
||
|
|
if(!change_appendage) change_appendage = appendage.sq_AddChangeStatus("elementmastery",parentObj, parentObj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK, true, value1);
|
||
|
|
if(change_appendage){
|
||
|
|
change_appendage.clearParameter();
|
||
|
|
//change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_MAGICAL_ATTACK, true, (value1 * 0.1).tofloat());
|
||
|
|
//change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_PHYSICAL_ATTACK, true, (value1 * 0.1).tofloat());
|
||
|
|
change_appendage.addParameter(CHANGE_STATUS_TYPE_ELEMENT_TOLERANCE_ALL, false, (value2).tofloat());
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function onStart_appendage_assimilate_bykk(appendage)
|
||
|
|
{
|
||
|
|
local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent());
|
||
|
|
if(!parentObj || parentObj.getState() == STATE_DIE){appendage.setValid(false);return;}
|
||
|
|
|
||
|
|
// local skillLevel = parentObj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_ASSIMILATE);
|
||
|
|
// local value1 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ASSIMILATE, 0, skillLevel);
|
||
|
|
// local change_appendage = appendage.sq_getChangeStatus("assimilate");
|
||
|
|
// if(!change_appendage) change_appendage = appendage.sq_AddChangeStatus("assimilate",parentObj, parentObj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK, true, value1);
|
||
|
|
// if(change_appendage){
|
||
|
|
// change_appendage.clearParameter();
|
||
|
|
// change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_MAGICAL_ATTACK, true, (value1 * 0.1).tofloat());
|
||
|
|
// change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_PHYSICAL_ATTACK, true, (value1 * 0.1).tofloat());
|
||
|
|
// }
|
||
|
|
}
|
||
|
|
|
||
|
|
function onStart_appendage_elementalpotential_bykk(appendage)
|
||
|
|
{
|
||
|
|
local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent());
|
||
|
|
if(!parentObj || parentObj.getState() == STATE_DIE){appendage.setValid(false);return;}
|
||
|
|
|
||
|
|
local skillLevel = parentObj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL);
|
||
|
|
local value1 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 7, skillLevel);
|
||
|
|
local change_appendage = appendage.sq_getChangeStatus("elementalpotential");
|
||
|
|
if(!change_appendage) change_appendage = appendage.sq_AddChangeStatus("elementalpotential",parentObj, parentObj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK, true, value1);
|
||
|
|
if(change_appendage){
|
||
|
|
change_appendage.clearParameter();
|
||
|
|
change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_MAGICAL_ATTACK, true, (value1 * 0.1).tofloat());
|
||
|
|
change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_PHYSICAL_ATTACK, true, (value1 * 0.1).tofloat());
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function onStart_appendage_elementalweak_bykk(appendage)
|
||
|
|
{
|
||
|
|
local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent());
|
||
|
|
if(!parentObj || parentObj.getState() == STATE_DIE){appendage.setValid(false);return;}
|
||
|
|
|
||
|
|
local skillLevel = parentObj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_ELEMENTALWEAK);
|
||
|
|
local value1 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTALWEAK, 5, skillLevel);
|
||
|
|
local value2 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTALWEAK, 6, skillLevel);
|
||
|
|
local mightyrune_level = parentObj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_MIGHTYRUNE);
|
||
|
|
if(mightyrune_level > 0){
|
||
|
|
local add_Rate = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_MIGHTYRUNE, 2, mightyrune_level);
|
||
|
|
value2 = value2 * (1000 + add_Rate) / 1000;
|
||
|
|
}
|
||
|
|
local change_appendage = appendage.sq_getChangeStatus("elementalweak");
|
||
|
|
if(!change_appendage) change_appendage = appendage.sq_AddChangeStatus("elementalweak",parentObj, parentObj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK, true, value1);
|
||
|
|
if(change_appendage){
|
||
|
|
change_appendage.clearParameter();
|
||
|
|
change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_MAGICAL_ATTACK, true, (value1 * 0.1).tofloat());
|
||
|
|
change_appendage.addParameter(CHANGE_STATUS_TYPE_EQUIPMENT_PHYSICAL_ATTACK, true, (value1 * 0.1).tofloat());
|
||
|
|
change_appendage.addParameter(CHANGE_STATUS_TYPE_MAGICAL_CRITICAL_HIT_RATE, false, (value2 * 0.1).tofloat());
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function onAttackParent_appendage_elementalweak(appendage, realAttacker, damager, boundingBox, isStuck)
|
||
|
|
{
|
||
|
|
if(!appendage) return;
|
||
|
|
return;
|
||
|
|
if(isStuck) return;
|
||
|
|
local parentObj = appendage.getParent();
|
||
|
|
local obj = sq_GetCNRDObjectToSQRCharacter(parentObj);
|
||
|
|
if(!obj || obj.getState() == STATE_DIE) return;
|
||
|
|
if(!damager.isObjectType(OBJECTTYPE_ACTIVE)) return;
|
||
|
|
local activeObj = sq_GetCNRDObjectToActiveObject(damager);
|
||
|
|
local maxLoad = sq_GetIntData(obj, ELEMENTALMASTER_SKILL_ELEMENTALWEAK, 0);
|
||
|
|
local skillLevel = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALWEAK);
|
||
|
|
local decrease = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALWEAK, 0, skillLevel);
|
||
|
|
local time = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALWEAK, 2, skillLevel);
|
||
|
|
local attackInfo = sq_GetCurrentAttackInfo(realAttacker);
|
||
|
|
local element = [ENUM_ELEMENT_FIRE,ENUM_ELEMENT_WATER,ENUM_ELEMENT_DARK,ENUM_ELEMENT_LIGHT];
|
||
|
|
local element2 = ["attack_fire","attack_ice","attack_dark","attack_light"];
|
||
|
|
for(local i = 0; i < 4; i++){
|
||
|
|
if(attackInfo.isValidElement(element[i])){
|
||
|
|
local addAppendage = CNSquirrelAppendage.sq_GetAppendage(activeObj, ELEMENTALWEAKDEBUFF_APDPATH);
|
||
|
|
if(!addAppendage){
|
||
|
|
addAppendage = CNSquirrelAppendage.sq_AppendAppendage(activeObj, obj, -1, false, ELEMENTALWEAKDEBUFF_APDPATH, true);
|
||
|
|
addAppendage.getVar("custom").setInt(10, maxLoad);
|
||
|
|
addAppendage.getVar("custom").setInt(11, decrease);
|
||
|
|
addAppendage.getVar("custom").setInt(12, time);
|
||
|
|
}
|
||
|
|
for(local ui = 10; ui < 10 + maxLoad; ui++){
|
||
|
|
if(addAppendage.getVar(element2[i]).getBool(ui) == false){
|
||
|
|
addAppendage.getVar(element2[i]).setBool(ui, true);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function proc_appendage_elementalweakdebuff(appendage)
|
||
|
|
{
|
||
|
|
if(!appendage) return;
|
||
|
|
local targetObj = appendage.getParent();
|
||
|
|
local sqrChr = appendage.getSource();
|
||
|
|
targetObj = sq_GetCNRDObjectToActiveObject(targetObj);
|
||
|
|
sqrChr = sq_GetCNRDObjectToSQRCharacter(sqrChr);
|
||
|
|
if(!targetObj || targetObj.getState() == STATE_DIE){
|
||
|
|
appendage.setValid(false);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
local maxLoad = appendage.getVar("custom").getInt(10);
|
||
|
|
local decrease = appendage.getVar("custom").getInt(11);
|
||
|
|
local time = appendage.getVar("custom").getInt(12);
|
||
|
|
|
||
|
|
local element = ["attack_fire","attack_ice","attack_dark","attack_light"];
|
||
|
|
for(local i = 0; i < element.len(); i++){
|
||
|
|
local timer = appendage.getVar(element[i]).get_ct_vector(0);
|
||
|
|
if(!timer){
|
||
|
|
appendage.getVar(element[i]).clear_ct_vector();
|
||
|
|
appendage.getVar(element[i]).push_ct_vector();
|
||
|
|
timer = appendage.getVar(element[i]).get_ct_vector(0);
|
||
|
|
timer.Reset();
|
||
|
|
timer.Start(10000,0);
|
||
|
|
}
|
||
|
|
local currentT = timer.Get();
|
||
|
|
if(currentT >= time){
|
||
|
|
for(local oi = 0; oi < maxLoad; oi++){
|
||
|
|
appendage.getVar(element[i]).setBool(10 + oi, false);
|
||
|
|
appendage.getVar(element[i]).setBool(20 + oi, false);
|
||
|
|
}
|
||
|
|
timer.Reset();
|
||
|
|
timer.Start(10000,0);
|
||
|
|
}
|
||
|
|
for(local ui = 0; ui < maxLoad; ui++){
|
||
|
|
if(appendage.getVar(element[i]).getBool(10 + ui) && appendage.getVar(element[i]).getBool(20 + ui) == false){
|
||
|
|
appendage.getVar(element[i]).setBool(20 + ui, true);
|
||
|
|
local ap = sq_CreateChangeStatus(20 + i, false, -decrease.tofloat() , 0);
|
||
|
|
if (ap){
|
||
|
|
ap.getAppendageInfo().setValidTime(time);
|
||
|
|
ap.sq_Append(targetObj, sqrChr);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
function useSkill_before_Mage_elementalmaster_bykk(obj, skillIndex, consumeMp, consumeItem, oldSkillMpRate)
|
||
|
|
{
|
||
|
|
//printp(" consumpMp:" + consumeMp + " oldSkillMpRate:" + oldSkillMpRate);
|
||
|
|
local skillLevel = obj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_ELEMENTMASTERY);
|
||
|
|
if(skillLevel > 0){
|
||
|
|
local mpComsumeRate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTMASTERY, 3, skillLevel);
|
||
|
|
if(oldSkillMpRate != 1.0) oldSkillMpRate = 1.0;
|
||
|
|
local newMpRate = oldSkillMpRate.tofloat() * (100 - mpComsumeRate.tofloat()) / 100;
|
||
|
|
// print(" newMpRate:" + newMpRate);
|
||
|
|
obj.setSkillMpRate(skillIndex, newMpRate.tofloat());
|
||
|
|
}
|
||
|
|
//print(" now consumpMp:" + obj.getSkillMpRate(skillIndex));
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
|
||
|
|
function cearteSkillPassive_Elementalmaster_bykk(obj,passiveObj,objnum,x,y,z,direction,skillIndex,subtype,pushv1,pushv2,pushv3,pushv4,pushv5,pushv6,pushv7,pushv8,bonusnum,powernum)
|
||
|
|
{
|
||
|
|
if(!obj || !passiveObj) return;
|
||
|
|
if(pushv1 == null) pushv1 = 0;
|
||
|
|
if(pushv2 == null) pushv2 = 0;
|
||
|
|
if(pushv3 == null) pushv3 = 0;
|
||
|
|
if(pushv4 == null) pushv4 = 0;
|
||
|
|
if(pushv5 == null) pushv5 = 0;
|
||
|
|
if(pushv6 == null) pushv6 = 0;
|
||
|
|
if(pushv7 == null) pushv7 = 0;
|
||
|
|
if(pushv8 == null) pushv8 = 0;
|
||
|
|
if(bonusnum > 0){
|
||
|
|
local bonusRate = 1.0;//obj.getVar("witchs_bonusRate").get_vector(0).tofloat() / 1000.0;
|
||
|
|
local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL);
|
||
|
|
if(skill_level > 0){
|
||
|
|
local add_Rate = 0.0;
|
||
|
|
switch(skillIndex){
|
||
|
|
case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN: add_Rate = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 7, skill_level);
|
||
|
|
case ELEMENTALMASTER_SKILL_FLAMESTRIKE:
|
||
|
|
case ELEMENTALMASTER_SKILL_VOID:
|
||
|
|
case ELEMENTALMASTER_SKILL_SUNBURST:
|
||
|
|
add_Rate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 8, skill_level);
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_THUNDERCALLING: add_Rate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 12, skill_level); break;
|
||
|
|
case ELEMENTALMASTER_SKILL_ARCTICPISTE: add_Rate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 15, skill_level); break;
|
||
|
|
case ELEMENTALMASTER_SKILL_BLACKHOLE: add_Rate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 14, skill_level); break;
|
||
|
|
case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER: add_Rate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 13, skill_level); break;
|
||
|
|
case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND:
|
||
|
|
case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN:
|
||
|
|
case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE:
|
||
|
|
case ELEMENTALMASTER_SKILL_THEGATE:
|
||
|
|
case ELEMENTALMASTER_SKILL_SESTOELEMENTO:
|
||
|
|
case ELEMENTALMASTER_SKILL_THUNDERRAGE:
|
||
|
|
add_Rate = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 16, skill_level);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
bonusRate += add_Rate.tofloat() / 1000.0;
|
||
|
|
}
|
||
|
|
switch (bonusnum) {
|
||
|
|
case 1: pushv1 = (pushv1.tofloat() * bonusRate).tointeger(); break;
|
||
|
|
case 2: pushv2 = (pushv2.tofloat() * bonusRate).tointeger(); break;
|
||
|
|
case 3: pushv3 = (pushv3.tofloat() * bonusRate).tointeger(); break;
|
||
|
|
case 4: pushv4 = (pushv4.tofloat() * bonusRate).tointeger(); break;
|
||
|
|
case 5: pushv5 = (pushv5.tofloat() * bonusRate).tointeger(); break;
|
||
|
|
case 6: pushv6 = (pushv6.tofloat() * bonusRate).tointeger(); break;
|
||
|
|
case 7: pushv7 = (pushv7.tofloat() * bonusRate).tointeger(); break;
|
||
|
|
case 8: pushv8 = (pushv8.tofloat() * bonusRate).tointeger(); break;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if(powernum > 0){
|
||
|
|
local bonusRate = 1.0;//obj.getVar("witchs_bonusRate").get_vector(0).tofloat() / 1000.0;
|
||
|
|
local skill_level = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL);
|
||
|
|
if(skill_level > 0){
|
||
|
|
local add_Rate = 0.0;
|
||
|
|
if(skillIndex == ELEMENTALMASTER_SKILL_ELEMENTALCHAIN) add_Rate = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 7, skill_level);
|
||
|
|
bonusRate += add_Rate.tofloat() / 1000.0;
|
||
|
|
}
|
||
|
|
switch (powernum) {
|
||
|
|
case 1: pushv1 = (pushv1.tofloat() * bonusRate).tointeger(); break;
|
||
|
|
case 2: pushv2 = (pushv2.tofloat() * bonusRate).tointeger(); break;
|
||
|
|
case 3: pushv3 = (pushv3.tofloat() * bonusRate).tointeger(); break;
|
||
|
|
case 4: pushv4 = (pushv4.tofloat() * bonusRate).tointeger(); break;
|
||
|
|
case 5: pushv5 = (pushv5.tofloat() * bonusRate).tointeger(); break;
|
||
|
|
case 6: pushv6 = (pushv6.tofloat() * bonusRate).tointeger(); break;
|
||
|
|
case 7: pushv7 = (pushv7.tofloat() * bonusRate).tointeger(); break;
|
||
|
|
case 8: pushv8 = (pushv8.tofloat() * bonusRate).tointeger(); break;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
local destX_01 = 0;
|
||
|
|
local destY_01 = 0;
|
||
|
|
if(!isSameObject(obj, passiveObj)){
|
||
|
|
destX_01 = passiveObj.getXPos() - obj.getXPos();
|
||
|
|
destY_01 = passiveObj.getYPos() - obj.getYPos();
|
||
|
|
z = z - obj.getZPos();
|
||
|
|
if(direction == ENUM_DIRECTION_LEFT) destX_01 = obj.getXPos() - passiveObj.getXPos();
|
||
|
|
}
|
||
|
|
sq_BinaryStartWrite();
|
||
|
|
sq_BinaryWriteDword(skillIndex);
|
||
|
|
sq_BinaryWriteDword(subtype);
|
||
|
|
sq_BinaryWriteDword(pushv1);
|
||
|
|
sq_BinaryWriteDword(pushv2);
|
||
|
|
sq_BinaryWriteDword(pushv3);
|
||
|
|
sq_BinaryWriteDword(pushv4);
|
||
|
|
sq_BinaryWriteDword(pushv5);
|
||
|
|
sq_BinaryWriteDword(pushv6);
|
||
|
|
sq_BinaryWriteDword(pushv7);
|
||
|
|
sq_BinaryWriteDword(pushv8);
|
||
|
|
sq_SendCreatePassiveObjectPacket(obj, objnum, 0, destX_01 + x, destY_01 + y, z, direction);
|
||
|
|
}
|
||
|
|
|
||
|
|
function createOnlyDrawObject_elementalmaster_bykk(obj,aniPath,isTrue,direction,x,y,z,drawlayer)
|
||
|
|
{
|
||
|
|
local ani = sq_CreateAnimation("",aniPath);
|
||
|
|
local pooledObj = sq_CreatePooledObject(ani,isTrue);
|
||
|
|
sq_SetCurrentDirection(pooledObj, direction);
|
||
|
|
pooledObj.setCurrentPos(x,y,z);
|
||
|
|
pooledObj = sq_SetEnumDrawLayer(pooledObj, drawlayer);
|
||
|
|
sq_AddObject(obj, pooledObj, OBJECTTYPE_DRAWONLY, false);
|
||
|
|
return pooledObj;
|
||
|
|
}
|
||
|
|
|
||
|
|
function onStart_appendage_elementalchain_bykk(appendage)
|
||
|
|
{
|
||
|
|
local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent());
|
||
|
|
|
||
|
|
local skillLevel = sq_GetSkillLevel(parentObj,ELEMENTALMASTER_SKILL_ELEMENTALCHAIN);
|
||
|
|
local lightTime = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, 1, skillLevel);
|
||
|
|
|
||
|
|
appendage.setAppendCauseSkill(BUFF_CAUSE_SKILL, ENUM_CHARACTERJOB_MAGE, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, skillLevel);
|
||
|
|
appendage.setEnableIsBuff(true);
|
||
|
|
appendage.setBuffIconImage(28);
|
||
|
|
|
||
|
|
local value0 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, 6, skillLevel)
|
||
|
|
local value1 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, 7, skillLevel);
|
||
|
|
local value2 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, 8, skillLevel);
|
||
|
|
local value3 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, 9, skillLevel);
|
||
|
|
appendage.getVar("custom").setInt(0, value0);
|
||
|
|
appendage.getVar("custom").setInt(1, value1);
|
||
|
|
appendage.getVar("custom").setInt(2, value2);
|
||
|
|
appendage.getVar("custom").setInt(3, value3);
|
||
|
|
|
||
|
|
appendage.getVar().setBool(1,false);
|
||
|
|
appendage.getVar().setBool(2,false);
|
||
|
|
appendage.getVar().setBool(3,false);
|
||
|
|
appendage.getVar().setBool(4,false);
|
||
|
|
|
||
|
|
local offset_x = [35,35,-35,-35];
|
||
|
|
local offset_y = [-20,20,20,-20];
|
||
|
|
local offset_z = [23,30,30,30];
|
||
|
|
local sub = 0;
|
||
|
|
local mightyrune_level = sq_GetSkillLevel(parentObj, ELEMENTALMASTER_SKILL_MIGHTYRUNE);
|
||
|
|
if(mightyrune_level > 0){
|
||
|
|
sub = 1;
|
||
|
|
offset_z = [30,30,30,30];
|
||
|
|
lightTime = lightTime * (1000 + sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_MIGHTYRUNE, 0, mightyrune_level)) / 1000;
|
||
|
|
}
|
||
|
|
local assimilate_level = sq_GetSkillLevel(parentObj, ELEMENTALMASTER_SKILL_ASSIMILATE);
|
||
|
|
if(assimilate_level > 0){
|
||
|
|
sub = 2;
|
||
|
|
offset_z = [30,30,30,30];
|
||
|
|
appendage.getVar().setBool(1,true);
|
||
|
|
appendage.getVar().setBool(2,true);
|
||
|
|
appendage.getVar().setBool(3,true);
|
||
|
|
appendage.getVar().setBool(4,true);
|
||
|
|
setElementalChainBuff_bykk(parentObj,ELEMENTALMASTER_SKILL_ELEMENTALCHAIN,appendage);
|
||
|
|
}
|
||
|
|
for(local i = 1; i < 5; i++){
|
||
|
|
cearteSkillPassive_Elementalmaster_bykk(parentObj,parentObj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,offset_x[i-1],offset_y[i-1],offset_z[i-1],ENUM_DIRECTION_RIGHT,ELEMENTALMASTER_SKILL_ELEMENTALCHAIN,i,lightTime,sub,0,0,0,0,0,0,0,0);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function onEnd_appendage_elementalchain_bykk(appendage)
|
||
|
|
{
|
||
|
|
local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent());
|
||
|
|
local name = ["elementalchain_light","elementalchain_ice","elementalchain_fire","elementalchain_dark"];
|
||
|
|
for(local i = 0; i < name.len(); i++){
|
||
|
|
local size = parentObj.getVar(name[i]).get_obj_vector_size();
|
||
|
|
for(local ui = 0; ui < size; ui++){
|
||
|
|
local effectObj = parentObj.getVar(name[i]).get_obj_vector(ui);
|
||
|
|
if(effectObj) effectObj.setValid(false);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function onStart_appendage_magicaltempoup_bykk(appendage)
|
||
|
|
{
|
||
|
|
local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent());
|
||
|
|
|
||
|
|
local skillLevel = sq_GetSkillLevel(parentObj,ELEMENTALMASTER_SKILL_MAGICALTEMPOUP);
|
||
|
|
appendage.setAppendCauseSkill(BUFF_CAUSE_SKILL, ENUM_CHARACTERJOB_MAGE, ELEMENTALMASTER_SKILL_MAGICALTEMPOUP, skillLevel);
|
||
|
|
appendage.setEnableIsBuff(true);
|
||
|
|
appendage.setBuffIconImage(34);
|
||
|
|
|
||
|
|
local lifeTime = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_MAGICALTEMPOUP, 0, skillLevel);
|
||
|
|
local value1 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_MAGICALTEMPOUP, 1, skillLevel);
|
||
|
|
local value2 = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_MAGICALTEMPOUP, 2, skillLevel);
|
||
|
|
local mightyrune_level = parentObj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_MIGHTYRUNE);
|
||
|
|
if(mightyrune_level > 0){
|
||
|
|
appendage.getAppendageInfo().setValidTime(0);
|
||
|
|
local add_Rate = sq_GetLevelData(parentObj, ELEMENTALMASTER_SKILL_MIGHTYRUNE, 4, mightyrune_level);
|
||
|
|
value1 = value1 * (1000 + add_Rate) / 1000;
|
||
|
|
value2 = value2 * (1000 + add_Rate) / 1000;
|
||
|
|
}
|
||
|
|
else if((sq_getGrowType(parentObj) == 4 && sq_GetSkillLevel(parentObj, SKILL_BYKK_LAPISPHILOSOPHORUM) > 0) || (sq_getGrowType(parentObj) == 2 && parentObj.getVar("eclipsehive_select").getBool(0))){
|
||
|
|
appendage.getAppendageInfo().setValidTime(0);
|
||
|
|
}
|
||
|
|
else appendage.getAppendageInfo().setValidTime(lifeTime);
|
||
|
|
|
||
|
|
local change_appendage = appendage.sq_getChangeStatus("magicaltempoup");
|
||
|
|
if(!change_appendage) change_appendage = appendage.sq_AddChangeStatus("magicaltempoup",parentObj, parentObj, 0, CHANGE_STATUS_TYPE_PHYSICAL_ATTACK, true, value1);
|
||
|
|
if(change_appendage){
|
||
|
|
change_appendage.clearParameter();
|
||
|
|
change_appendage.addParameter(CHANGE_STATUS_TYPE_CAST_SPEED, false, (value2 * 1).tofloat());
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function onStart_appendage_mightyrune_bykk(appendage)
|
||
|
|
{
|
||
|
|
local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent());
|
||
|
|
|
||
|
|
local skillLevel = sq_GetSkillLevel(parentObj,ELEMENTALMASTER_SKILL_MIGHTYRUNE);
|
||
|
|
appendage.setAppendCauseSkill(BUFF_CAUSE_SKILL, ENUM_CHARACTERJOB_MAGE, ELEMENTALMASTER_SKILL_MIGHTYRUNE, skillLevel);
|
||
|
|
}
|
||
|
|
|
||
|
|
function onStart_appendage_moveoncast_bykk(appendage)
|
||
|
|
{
|
||
|
|
//
|
||
|
|
}
|
||
|
|
|
||
|
|
function proc_appendage_moveoncast_bykk(appendage)
|
||
|
|
{
|
||
|
|
if(!appendage) return;
|
||
|
|
local parentObj = sq_GetCNRDObjectToSQRCharacter(appendage.getParent());
|
||
|
|
|
||
|
|
if(parentObj.getState() == 13 && parentObj.getThrowIndex() == 74){
|
||
|
|
sq_SetKeyxEnable(parentObj, E_JUMP_COMMAND, true);
|
||
|
|
if(sq_IsEnterCommand(parentObj, E_JUMP_COMMAND)){
|
||
|
|
parentObj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
if(appendage.getVar().getBool(0)){
|
||
|
|
for(local i = 1; i < 255; i++){
|
||
|
|
parentObj.setSkillCommandEnable(i, false);
|
||
|
|
}
|
||
|
|
if(parentObj.getState() == 0 || parentObj.getState() == 14){
|
||
|
|
local bDownKey = parentObj.isDownSkillLastKey();
|
||
|
|
if(!bDownKey){
|
||
|
|
appendage.getVar().setBool(0, false);
|
||
|
|
if(appendage.getVar().getInt(1) == ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN){
|
||
|
|
parentObj.sq_IntVectClear();
|
||
|
|
parentObj.sq_IntVectPush(1);
|
||
|
|
parentObj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN, STATE_PRIORITY_USER, true);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
else if(appendage.getVar().getInt(1) == ELEMENTALMASTER_SKILL_ELEMENTALQUAKE){
|
||
|
|
parentObj.sq_IntVectClear();
|
||
|
|
parentObj.sq_IntVectPush(1);
|
||
|
|
parentObj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_ELEMENTALQUAKE, STATE_PRIORITY_USER, true);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
else if(appendage.getVar().getInt(1) == ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND){
|
||
|
|
parentObj.sq_IntVectClear();
|
||
|
|
parentObj.sq_IntVectPush(1);
|
||
|
|
parentObj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND, STATE_PRIORITY_USER, true);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
else if(appendage.getVar().getInt(1) == ELEMENTALMASTER_SKILL_THUNDERRAGE){
|
||
|
|
parentObj.sq_IntVectClear();
|
||
|
|
parentObj.sq_IntVectPush(2);
|
||
|
|
parentObj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_THUNDERRAGE, STATE_PRIORITY_USER, true);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
else if(appendage.getVar().getInt(1) == ELEMENTALMASTER_SKILL_SESTOELEMENTO){
|
||
|
|
parentObj.sq_IntVectClear();
|
||
|
|
parentObj.sq_IntVectPush(0);
|
||
|
|
parentObj.sq_AddSetStatePacket(ELEMENTALMASTER_SKILL_SESTOELEMENTO, STATE_PRIORITY_USER, true);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
parentObj.sq_IntVectClear();
|
||
|
|
parentObj.sq_IntVectPush(appendage.getVar().getInt(3) + 1);
|
||
|
|
parentObj.sq_IntVectPush(appendage.getVar().getInt(1));
|
||
|
|
parentObj.sq_IntVectPush(appendage.getVar().getInt(2));
|
||
|
|
// print(appendage.getVar().getInt(3)+" && "+appendage.getVar().getInt(1)+" && "+appendage.getVar().getInt(2));
|
||
|
|
parentObj.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_ELEMENTALCHAIN, STATE_PRIORITY_USER, true);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function onEnd_appendage_moveoncast_bykk(appendage)
|
||
|
|
{
|
||
|
|
//
|
||
|
|
}
|
||
|
|
|
||
|
|
function monsterpulled_elementalmaster_bykk(obj,monsterobj,x,y,z,time,range)
|
||
|
|
{
|
||
|
|
if(!obj.isMovablePos(sq_GetXPos(monsterobj), sq_GetYPos(monsterobj))) return;
|
||
|
|
local objectManager = obj.getObjectManager();
|
||
|
|
local objectNumber = objectManager.getCollisionObjectNumber();
|
||
|
|
for(local i = 0; i < objectNumber; i++){
|
||
|
|
local targetObj = objectManager.getCollisionObject(i);
|
||
|
|
if(targetObj && targetObj.isObjectType(OBJECTTYPE_ACTIVE) && targetObj.isEnemy(obj) && !CNSquirrelAppendage.sq_IsAppendAppendage(targetObj, "character/mage/k_k_made/appendage/aptomonster/debuff/ap_pulledmonster.nut") && sq_GetDistanceObject(monsterobj, targetObj, true) <= range){
|
||
|
|
local appendagePath = "character/mage/k_k_made/appendage/aptomonster/debuff/ap_pulledmonster.nut";
|
||
|
|
local MasterAppendage = CNSquirrelAppendage.sq_AppendAppendage(targetObj, obj, -1, false, appendagePath, true);
|
||
|
|
if(MasterAppendage){
|
||
|
|
sq_AccelMoveToAppendageForce(targetObj, obj, monsterobj, x, y, z, time, true, MasterAppendage, true);
|
||
|
|
local validT = MasterAppendage.getAppendageInfo()
|
||
|
|
validT.setValidTime(2000);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function elementalmaster_setbonusRate(obj)
|
||
|
|
{
|
||
|
|
local bonusRate = 1000;
|
||
|
|
if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ASSIMILATE) > 0) bonusRate = bonusRate * (1000 + sq_GetLevelData(obj,ELEMENTALMASTER_SKILL_ASSIMILATE, 0, sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ASSIMILATE))) / 1000;
|
||
|
|
if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALWEAK) > 0) bonusRate = bonusRate * (1000 + sq_GetLevelData(obj,ELEMENTALMASTER_SKILL_ELEMENTALWEAK, 5, sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALWEAK))) / 1000;
|
||
|
|
if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTMASTERY) > 0) bonusRate = bonusRate * (1000 + sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTMASTERY, 4, sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTMASTERY))) / 1000;
|
||
|
|
if(sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL) > 0){
|
||
|
|
if(obj.sq_GetState() == 13){
|
||
|
|
switch(obj.getThrowIndex()){
|
||
|
|
case 56:
|
||
|
|
bonusRate = bonusRate * (1000 + sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 8, sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL))) / 1000;
|
||
|
|
break;
|
||
|
|
case 74:
|
||
|
|
bonusRate = bonusRate * (1000 + sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL, 16, sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL))) / 1000;
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, APDPATH_ELEMENTMASTERYBUFF)){
|
||
|
|
local addAppendage = CNSquirrelAppendage.sq_GetAppendage(obj, APDPATH_ELEMENTMASTERYBUFF);
|
||
|
|
if(!addAppendage){
|
||
|
|
obj.getVar("setSkillBonusRate").setInt(0, bonusRate.tointeger());
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
local addRate = addAppendage.getVar("custom").getInt(10);
|
||
|
|
bonusRate = bonusRate * (1000 + addRate) / 1000;
|
||
|
|
}
|
||
|
|
if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut")){
|
||
|
|
local addAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,"character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut");
|
||
|
|
if(!addAppendage){
|
||
|
|
obj.getVar("setSkillBonusRate").setInt(0, bonusRate.tointeger());
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
local skillLevel = sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN);
|
||
|
|
local buff_num = [];
|
||
|
|
if(addAppendage.getVar().getBool(1)) buff_num.push(1);
|
||
|
|
if(addAppendage.getVar().getBool(2)) buff_num.push(1);
|
||
|
|
if(addAppendage.getVar().getBool(3)) buff_num.push(1);
|
||
|
|
if(addAppendage.getVar().getBool(4)) buff_num.push(1);
|
||
|
|
local value1 = 0;
|
||
|
|
switch(buff_num.len()){
|
||
|
|
case 1: value1 = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, 6, skillLevel); break;
|
||
|
|
case 2: value1 = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, 7, skillLevel); break;
|
||
|
|
case 3: value1 = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, 8, skillLevel); break;
|
||
|
|
case 4: value1 = sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTALCHAIN, 9, skillLevel); break;
|
||
|
|
}
|
||
|
|
bonusRate = bonusRate * (10000 + value1) / 10000;
|
||
|
|
}
|
||
|
|
obj.getVar("setSkillBonusRate").setInt(0, bonusRate.tointeger());
|
||
|
|
}
|
||
|
|
|
||
|
|
function getElementalMaster_RestAni(obj)
|
||
|
|
{
|
||
|
|
local animation = obj.sq_GetRestAni();
|
||
|
|
if(obj.sq_GetSkillLevel(ELEMENTALMASTER_SKILL_ASSIMILATE) > 0) animation = obj.sq_GetCustomAni(ANIMATION_ELEMENTALMASTER_ELEMENTALMASTER_3RD_BODY);
|
||
|
|
return animation;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
function elementalmaster_setelementSkillBonusRate(obj, skillIndex)
|
||
|
|
{
|
||
|
|
if(sq_GetLevelData(obj, ELEMENTALMASTER_SKILL_ELEMENTMASTERY, 10, sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTMASTERY)) > 0){
|
||
|
|
local AddAppendage;
|
||
|
|
if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, APDPATH_ELEMENTMASTERYBUFF)){
|
||
|
|
AddAppendage = CNSquirrelAppendage.sq_GetAppendage(obj,APDPATH_ELEMENTMASTERYBUFF);
|
||
|
|
AddAppendage.sq_SetValidTime(8000);
|
||
|
|
AddAppendage.setAppendCauseSkill(BUFF_CAUSE_SKILL, sq_getJob(obj), ELEMENTALMASTER_SKILL_ELEMENTMASTERY, sq_GetSkillLevel(obj, ELEMENTALMASTER_SKILL_ELEMENTMASTERY));
|
||
|
|
CNSquirrelAppendage.sq_Append(AddAppendage, obj, obj, true);
|
||
|
|
}
|
||
|
|
else{
|
||
|
|
AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, -1, false, APDPATH_ELEMENTMASTERYBUFF, true);
|
||
|
|
AddAppendage.getVar("custom").setInt(10, 0);
|
||
|
|
obj.sq_AddSkillLoad(ELEMENTALMASTER_SKILL_ELEMENTMASTERY, 64, 0, 500);
|
||
|
|
}
|
||
|
|
local now_BonusRate = AddAppendage.getVar("custom").getInt(10);
|
||
|
|
local new_BonusRate = 0;
|
||
|
|
switch(skillIndex){
|
||
|
|
case 15:
|
||
|
|
case 16:
|
||
|
|
case 17:
|
||
|
|
case 18:
|
||
|
|
new_BonusRate = now_BonusRate + 30;
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_VOID:
|
||
|
|
case ELEMENTALMASTER_SKILL_SUNBURST:
|
||
|
|
case ELEMENTALMASTER_SKILL_WALLOFICE:
|
||
|
|
case ELEMENTALMASTER_SKILL_FLAMESTRIKE:
|
||
|
|
new_BonusRate = now_BonusRate + 30;
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER:
|
||
|
|
case ELEMENTALMASTER_SKILL_BLACKHOLE:
|
||
|
|
case ELEMENTALMASTER_SKILL_THUNDERCALLING:
|
||
|
|
case ELEMENTALMASTER_SKILL_ARCTICPISTE:
|
||
|
|
new_BonusRate = now_BonusRate + 50;
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER:
|
||
|
|
case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE:
|
||
|
|
case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN:
|
||
|
|
case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND:
|
||
|
|
case ELEMENTALMASTER_SKILL_THEGATE:
|
||
|
|
case ELEMENTALMASTER_SKILL_SESTOELEMENTO:
|
||
|
|
case ELEMENTALMASTER_SKILL_THUNDERRAGE:
|
||
|
|
new_BonusRate = now_BonusRate + 80;
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
if(new_BonusRate > 500) new_BonusRate = 500;
|
||
|
|
AddAppendage.getVar("custom").setInt(10, new_BonusRate);
|
||
|
|
local loadSlot = obj.sq_GetSkillLoad(ELEMENTALMASTER_SKILL_ELEMENTMASTERY);
|
||
|
|
if(loadSlot){
|
||
|
|
local getload = loadSlot.getRemainLoadNumber();
|
||
|
|
if(new_BonusRate / 10 + getload > 50) loadSlot.increaseLoadCount(50 - getload);
|
||
|
|
else loadSlot.increaseLoadCount(new_BonusRate / 10);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
else{
|
||
|
|
if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, APDPATH_ELEMENTMASTERYBUFF)) CNSquirrelAppendage.sq_RemoveAppendage(obj, APDPATH_ELEMENTMASTERYBUFF);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function onEnd_appendage_elementmastery_buff(appendage)
|
||
|
|
{
|
||
|
|
if(!appendage) return;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
function proc_appendage_elementmastery_buff(appendage)
|
||
|
|
{
|
||
|
|
if(!appendage) return;
|
||
|
|
if(!appendage.isValid()) return;
|
||
|
|
local parentObj = appendage.getParent();
|
||
|
|
if(!parentObj || parentObj.getState() == STATE_DIE){
|
||
|
|
appendage.setValid(false);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function onStart_appendage_elementmastery_buff(appendage)
|
||
|
|
{
|
||
|
|
if(!appendage) return;
|
||
|
|
}
|
||
|
|
|
||
|
|
function onVaildTimeEnd_appendage_elementmastery_buff(appendage)
|
||
|
|
{
|
||
|
|
if(!appendage) return;
|
||
|
|
local parentObj = appendage.getParent();
|
||
|
|
if(!parentObj || parentObj.getState() == STATE_DIE){
|
||
|
|
appendage.setValid(false);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
local obj = sq_GetCNRDObjectToSQRCharacter(parentObj);
|
||
|
|
local loadSlot = obj.sq_GetSkillLoad(ELEMENTALMASTER_SKILL_ELEMENTMASTERY);
|
||
|
|
if(loadSlot) obj.sq_RemoveSkillLoad(ELEMENTALMASTER_SKILL_ELEMENTMASTERY);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
function setCustomData_po_elementalmaster_bykk_kak(obj, receiveData)
|
||
|
|
{
|
||
|
|
if(!obj) return;
|
||
|
|
local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter());
|
||
|
|
if(!sqrChr) return;
|
||
|
|
local skillIndex = receiveData.readDword();
|
||
|
|
local subtype = receiveData.readDword();
|
||
|
|
|
||
|
|
obj.getVar("skillIndex").clear_vector();
|
||
|
|
obj.getVar("skillIndex").push_vector(skillIndex);
|
||
|
|
obj.getVar("subtype").clear_vector();
|
||
|
|
obj.getVar("subtype").push_vector(subtype);
|
||
|
|
|
||
|
|
switch(skillIndex){
|
||
|
|
case ELEMENTALMASTER_SKILL_ARCTICPISTE://極冰綻放
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
case 2://totalDamage,sizeRate,hitMax,hitTime,speedRate
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local sizeRate = receiveData.readDword();
|
||
|
|
local hitMax = receiveData.readDword();
|
||
|
|
local hitTime = receiveData.readDword();
|
||
|
|
local speedRate = receiveData.readDword();
|
||
|
|
local sub = receiveData.readDword();
|
||
|
|
obj.getVar("custom").clear_vector();
|
||
|
|
obj.getVar("custom").push_vector(sizeRate);
|
||
|
|
obj.getVar("custom").push_vector(hitMax);
|
||
|
|
obj.getVar("custom").push_vector(hitTime);
|
||
|
|
obj.getVar("custom").push_vector(speedRate);
|
||
|
|
obj.getVar("custom").push_vector(sub);
|
||
|
|
local attackIndex = 20;
|
||
|
|
if(subtype == 2) attackIndex = 8;
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, attackIndex));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
if(subtype == 2){
|
||
|
|
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK);
|
||
|
|
}
|
||
|
|
local skill_level = sq_GetSkillLevel(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE);
|
||
|
|
local prob = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 5, skill_level);
|
||
|
|
local level = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 6, skill_level);
|
||
|
|
local time = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 7, skill_level);
|
||
|
|
local minus_Rate = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 4, skill_level);
|
||
|
|
obj.getVar("custom").push_vector(minus_Rate);
|
||
|
|
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
|
|
if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_FREEZE, prob, level, time);
|
||
|
|
sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM);
|
||
|
|
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
case 3:
|
||
|
|
case 4:
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local sizeRate = receiveData.readDword();
|
||
|
|
local speedRate = receiveData.readDword();
|
||
|
|
local isBig = receiveData.readDword();
|
||
|
|
obj.getVar("custom").setInt(10, sizeRate);
|
||
|
|
|
||
|
|
local aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/new/icearea_att_3.ani";
|
||
|
|
if(sq_getRandom(1, 100) > 50) aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/new/icearea_att2_3.ani";
|
||
|
|
if(subtype == 3){
|
||
|
|
aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/new/icefieldnormal1.ani";
|
||
|
|
if(sq_getRandom(1, 100) > 50) aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/new/icefieldnormal2.ani";
|
||
|
|
}
|
||
|
|
local ani = sq_CreateAnimation("",aniPath);
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
sizeRate = sizeRate.tofloat() / 100.0;
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
pAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
|
|
pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
|
||
|
|
if(isBig > 300) sizeRate = sizeRate * 2.0;
|
||
|
|
sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate);
|
||
|
|
pAni.setSpeedRate(speedRate.tofloat());
|
||
|
|
|
||
|
|
local attackIndex = 20;
|
||
|
|
if(subtype == 2) attackIndex = 8;
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, attackIndex));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
if(subtype == 2){
|
||
|
|
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK);
|
||
|
|
}
|
||
|
|
local skill_level = sq_GetSkillLevel(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE);
|
||
|
|
local prob = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 5, skill_level);
|
||
|
|
local level = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 6, skill_level);
|
||
|
|
local time = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_ARCTICPISTE, 7, skill_level);
|
||
|
|
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
|
|
if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_FREEZE, prob, level, time);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_BLACKHOLE://黑洞
|
||
|
|
if(sqrChr.getVar("blackhole").get_obj_vector_size() < 1){
|
||
|
|
sqrChr.getVar("blackhole").clear_obj_vector();
|
||
|
|
sqrChr.getVar("blackhole").push_obj_vector(obj);
|
||
|
|
}
|
||
|
|
if(!sqrChr.getVar("blackhole").is_obj_vector(obj)) sqrChr.getVar("blackhole").push_obj_vector(obj);
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
case 2://totalDamage,sizeRate,lifeTime,damageRate,attractPower,hitTime
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local sizeRate = receiveData.readDword();
|
||
|
|
local lifeTime = receiveData.readDword();
|
||
|
|
local damageRate = receiveData.readDword();
|
||
|
|
local attractPower = receiveData.readDword();
|
||
|
|
local range = receiveData.readDword();
|
||
|
|
local sub = receiveData.readDword();
|
||
|
|
local hitTime = receiveData.readDword();
|
||
|
|
local totalDamage2 = totalDamage * damageRate / 100;
|
||
|
|
obj.getVar("custom").clear_vector();
|
||
|
|
obj.getVar("custom").push_vector(sizeRate);
|
||
|
|
obj.getVar("custom").push_vector(attractPower);
|
||
|
|
obj.getVar("custom").push_vector(range);
|
||
|
|
obj.getVar("custom").push_vector(totalDamage2);
|
||
|
|
obj.getVar("custom").push_vector(lifeTime);
|
||
|
|
obj.getVar("custom").push_vector(totalDamage);
|
||
|
|
obj.getVar("custom").push_vector(sub);
|
||
|
|
obj.getVar("custom").push_vector(hitTime);
|
||
|
|
local attackIndex = 37;
|
||
|
|
if(subtype == 2) attackIndex = 38;
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, attackIndex));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
if(subtype == 2){
|
||
|
|
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK);
|
||
|
|
}
|
||
|
|
if(sq_GetLevelData(sqrChr, 58, 10, sq_GetSkillLevel(sqrChr, 58)) < 1) obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
else obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
case 3:
|
||
|
|
local lifeTime = receiveData.readDword();
|
||
|
|
local sub = receiveData.readDword();
|
||
|
|
local sizeRate = receiveData.readDword();
|
||
|
|
local aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/normal/shockwave1_dodge.ani";
|
||
|
|
if(sub == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/elementalpotential/shockwave2_dodge.ani";
|
||
|
|
local ani = sq_CreateAnimation("",aniPath);
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
obj.setTimeEvent(0,lifeTime,1,false);
|
||
|
|
sizeRate = sizeRate.tofloat() / 100.0;
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
pAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
|
|
pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
|
||
|
|
sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND://聖靈水晶
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
if(sqrChr.getVar("crystal").get_obj_vector_size() > 0) sqrChr.getVar("crystal").push_obj_vector(obj);
|
||
|
|
else{
|
||
|
|
sqrChr.getVar("crystal").clear_obj_vector();
|
||
|
|
sqrChr.getVar("crystal").push_obj_vector(obj);
|
||
|
|
}
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local sizeRate = receiveData.readDword();
|
||
|
|
local sub = receiveData.readDword();
|
||
|
|
obj.getVar("custom").setInt(1,sizeRate);
|
||
|
|
obj.getVar("custom").setInt(2,totalDamage);
|
||
|
|
if(sub > 0){
|
||
|
|
obj.setTimeEvent(2, 2600, 1, false);
|
||
|
|
obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
}
|
||
|
|
else obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
case 2:
|
||
|
|
case 3:
|
||
|
|
case 4:
|
||
|
|
if(sqrChr.getVar("crystal_effect" + subtype.tostring()).get_obj_vector_size() > 0) sqrChr.getVar("crystal_effect" + subtype.tostring()).push_obj_vector(obj);
|
||
|
|
else{
|
||
|
|
sqrChr.getVar("crystal_effect" + subtype.tostring()).clear_obj_vector();
|
||
|
|
sqrChr.getVar("crystal_effect" + subtype.tostring()).push_obj_vector(obj);
|
||
|
|
}
|
||
|
|
local sizeRate = receiveData.readDword();
|
||
|
|
obj.getVar("custom").setInt(1,sizeRate);
|
||
|
|
if(subtype == 4){sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM);}//obj.setTimeEvent(1,3300,1,false);
|
||
|
|
// else{obj.setTimeEvent(1,3000,1,false);}
|
||
|
|
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN://元素點燃
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
sqrChr.getVar("elementalchain_light").clear_obj_vector();sqrChr.getVar("elementalchain_light").push_obj_vector(obj);
|
||
|
|
case 2:
|
||
|
|
sqrChr.getVar("elementalchain_ice").clear_obj_vector();sqrChr.getVar("elementalchain_ice").push_obj_vector(obj);
|
||
|
|
case 3:
|
||
|
|
sqrChr.getVar("elementalchain_fire").clear_obj_vector();sqrChr.getVar("elementalchain_fire").push_obj_vector(obj);
|
||
|
|
case 4:
|
||
|
|
if(subtype == 4){sqrChr.getVar("elementalchain_dark").clear_obj_vector();sqrChr.getVar("elementalchain_dark").push_obj_vector(obj);}
|
||
|
|
local lightTime = receiveData.readDword();
|
||
|
|
local sub = receiveData.readDword();
|
||
|
|
obj.getVar("custom").clear_vector();
|
||
|
|
obj.getVar("custom").push_vector(lightTime);
|
||
|
|
obj.getVar("custom").push_vector(sub);
|
||
|
|
obj.setDirection(ENUM_DIRECTION_RIGHT);
|
||
|
|
obj.setMapFollowParent(sqrChr);
|
||
|
|
obj.setMapFollowType(1);
|
||
|
|
if(sub <= 1) sq_moveWithParent(sqrChr, obj);
|
||
|
|
if(sub == 1) obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
else if(sub == 2) obj.addSetStatePacket(28, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
else obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
case 15:
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local powerDamage = receiveData.readDword();
|
||
|
|
local normal_rate = receiveData.readDword();
|
||
|
|
local exp_rate = receiveData.readDword();
|
||
|
|
local shoot_range = receiveData.readDword();
|
||
|
|
obj.getVar("custom").clear_vector();
|
||
|
|
obj.getVar("custom").push_vector(normal_rate);
|
||
|
|
obj.getVar("custom").push_vector(exp_rate);
|
||
|
|
obj.getVar("custom").push_vector(shoot_range);
|
||
|
|
obj.getVar("custom").push_vector(sq_GetXPos(obj));
|
||
|
|
obj.getVar("custom").push_vector(totalDamage);
|
||
|
|
obj.getVar("custom").push_vector(powerDamage);
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 24));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
sq_SetCurrentAttackPower(sq_GetCurrentAttackInfo(obj), powerDamage);
|
||
|
|
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
case 150:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/common/animation/fireexplosion.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local powerDamage = receiveData.readDword();
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 14));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
sq_SetCurrentAttackPower(sq_GetCurrentAttackInfo(obj), powerDamage);
|
||
|
|
local currentAni = obj.getCurrentAnimation();//得到當前ani
|
||
|
|
local sizeRate = receiveData.readDword();
|
||
|
|
obj.getVar("custom").clear_vector();
|
||
|
|
obj.getVar("custom").push_vector(sizeRate);
|
||
|
|
sizeRate = sizeRate.tofloat() / 1000.0;
|
||
|
|
sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate);
|
||
|
|
obj.setTimeEvent(1, 200, 2, true);
|
||
|
|
obj.setTimeEvent(2, 50, 2, true);
|
||
|
|
obj.setTimeEvent(3, 15, 4, true);
|
||
|
|
obj.setTimeEvent(4, 100, 2, true);
|
||
|
|
break;
|
||
|
|
case 16:
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local powerDamage = receiveData.readDword();
|
||
|
|
local normal_rate = receiveData.readDword();
|
||
|
|
local lifeTime = receiveData.readDword();
|
||
|
|
obj.setTimeEvent(0,lifeTime,1,false);
|
||
|
|
obj.getVar("custom").clear_vector();
|
||
|
|
obj.getVar("custom").push_vector(normal_rate);
|
||
|
|
obj.getVar("custom").push_vector(sq_GetXPos(obj));
|
||
|
|
obj.getVar("custom").push_vector(sq_GetYPos(obj));
|
||
|
|
obj.getVar("custom").push_vector(sq_GetZPos(obj));
|
||
|
|
obj.getVar("custom").push_vector(80);
|
||
|
|
obj.getVar("custom").push_vector(0);
|
||
|
|
obj.getVar("custom").push_vector(0);
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 23));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
sq_SetCurrentAttackPower(sq_GetCurrentAttackInfo(obj), powerDamage);
|
||
|
|
local skill_level = sq_GetSkillLevel(sqrChr, 16);
|
||
|
|
local prob = sq_GetLevelData(sqrChr, 16, 11, skill_level);
|
||
|
|
local level = sq_GetLevelData(sqrChr, 16, 12, skill_level);
|
||
|
|
local time = sq_GetLevelData(sqrChr, 16, 13, skill_level);
|
||
|
|
local speed_level = sq_GetLevelData(sqrChr, 16, 7, skill_level);
|
||
|
|
local speed_time = sq_GetLevelData(sqrChr, 16, 8, skill_level);
|
||
|
|
local movespeed_rate = sq_GetLevelData(sqrChr, 16, 9, skill_level);
|
||
|
|
local attackspeed_rate = sq_GetLevelData(sqrChr, 16, 10, skill_level);
|
||
|
|
obj.getVar("custom").push_vector(speed_level);
|
||
|
|
obj.getVar("custom").push_vector(speed_time);
|
||
|
|
obj.getVar("custom").push_vector(movespeed_rate);
|
||
|
|
obj.getVar("custom").push_vector(attackspeed_rate);
|
||
|
|
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
|
|
if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_FREEZE, prob, level, time);
|
||
|
|
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
case 17:
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local powerDamage = receiveData.readDword();
|
||
|
|
local sizeRate = receiveData.readDword();
|
||
|
|
local lifeTime = receiveData.readDword();
|
||
|
|
local angle = receiveData.readDword();
|
||
|
|
local baseX = receiveData.readDword();
|
||
|
|
local baseY = receiveData.readDword();
|
||
|
|
obj.setTimeEvent(0,lifeTime,1,false);
|
||
|
|
obj.getVar("custom").clear_vector();
|
||
|
|
obj.getVar("custom").push_vector(angle);
|
||
|
|
obj.getVar("custom").push_vector(baseX);
|
||
|
|
obj.getVar("custom").push_vector(baseY);
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchfluorescent1.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local currentAni = obj.getCurrentAnimation();
|
||
|
|
currentAni.addLayerAnimation(1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchfluorescent2.ani"),true);
|
||
|
|
currentAni.addLayerAnimation(3,sq_CreateAnimation("","passiveobject/character/mage/animation/launchfluorescent3.ani"),true);
|
||
|
|
currentAni.addLayerAnimation(2,sq_CreateAnimation("","passiveobject/character/mage/animation/launchfluorescent4.ani"),true);
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 22));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
sq_SetCurrentAttackPower(sq_GetCurrentAttackInfo(obj), powerDamage);
|
||
|
|
sizeRate = sizeRate.tofloat() / 1000.0;
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
pAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
|
|
pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
|
||
|
|
sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate);
|
||
|
|
break;
|
||
|
|
case 18:
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local powerDamage = receiveData.readDword();
|
||
|
|
local sizeRate = receiveData.readDword();
|
||
|
|
local speed_rate = receiveData.readDword();
|
||
|
|
local shoot_range = receiveData.readDword();
|
||
|
|
obj.getVar("custom").clear_vector();
|
||
|
|
obj.getVar("custom").push_vector(sizeRate);
|
||
|
|
obj.getVar("custom").push_vector(speed_rate);
|
||
|
|
obj.getVar("custom").push_vector(shoot_range);
|
||
|
|
obj.getVar("custom").push_vector(sq_GetXPos(obj));
|
||
|
|
obj.getVar("custom").push_vector(sq_GetZPos(obj));
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 21));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
sq_SetCurrentAttackPower(sq_GetCurrentAttackInfo(obj), powerDamage);
|
||
|
|
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN://元素之幕
|
||
|
|
local sizeRate = 100;
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
//totalDamage,sizeRate,lifeTime,damageRate,hitTime,hitMax
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
sizeRate = receiveData.readDword();
|
||
|
|
local lifeTime = receiveData.readDword();
|
||
|
|
local damageRate = receiveData.readDword();
|
||
|
|
local hitTime = receiveData.readDword();
|
||
|
|
local hitMax = receiveData.readDword();
|
||
|
|
local istalisman = receiveData.readDword();
|
||
|
|
local totalDamage2 = totalDamage * damageRate / 100;
|
||
|
|
obj.getVar("custom").clear_vector();
|
||
|
|
obj.getVar("custom").push_vector(sizeRate);
|
||
|
|
obj.getVar("custom").push_vector(totalDamage2);
|
||
|
|
obj.getVar("custom").push_vector(hitMax);
|
||
|
|
obj.getVar("custom").push_vector(totalDamage);
|
||
|
|
obj.getVar("custom").push_vector(istalisman);
|
||
|
|
obj.getVar("target").clear_obj_vector();
|
||
|
|
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalcurtain/blankwallhorizonbottom.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local currentAni = obj.getCurrentAnimation();
|
||
|
|
currentAni.addLayerAnimation(10001,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalcurtain/elementalcurtain_aurora.ani"),true);
|
||
|
|
currentAni.addLayerAnimation(-1000,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalcurtain/elementalcurtain_aurorabehind_aurora1.ani"),true);
|
||
|
|
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 3));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK);
|
||
|
|
|
||
|
|
obj.setTimeEvent(0,hitTime,-1,true);
|
||
|
|
obj.setTimeEvent(1,lifeTime,1,false);
|
||
|
|
|
||
|
|
cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj) + 400,obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN,2,lifeTime,sizeRate,0,0,0,0,0,0,0,0);
|
||
|
|
cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj),obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN,3,lifeTime,sizeRate,0,0,0,0,0,0,0,0);
|
||
|
|
break;
|
||
|
|
case 2:
|
||
|
|
local lifeTime = receiveData.readDword();
|
||
|
|
sizeRate = receiveData.readDword();
|
||
|
|
obj.setTimeEvent(1,lifeTime + 300,1,false);
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalcurtain/elementalcurtain_aurorafront_sky1.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
break;
|
||
|
|
case 3:
|
||
|
|
local lifeTime = receiveData.readDword();
|
||
|
|
sizeRate = receiveData.readDword();
|
||
|
|
obj.setTimeEvent(1,lifeTime + 300,1,false);
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalcurtain/elementalcurtain_groundcircle.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM);
|
||
|
|
break;
|
||
|
|
case 4:
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
sizeRate = receiveData.readDword();
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalcurtain/elementalcurtain_auroraend_broken.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 4));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK);
|
||
|
|
|
||
|
|
sq_flashScreen(obj,720,0,200,51, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM);
|
||
|
|
obj.setTimeEvent(1,1000,1,false);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
sizeRate = sizeRate.tofloat() / 100.0;
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
pAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
|
|
pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
|
||
|
|
sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate);
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL://元素奧義
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE://元素震蕩
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local damageRate = receiveData.readDword();
|
||
|
|
local sizeRate = receiveData.readDword();
|
||
|
|
local istalisman = receiveData.readDword();
|
||
|
|
obj.getVar("custom").clear_vector();
|
||
|
|
obj.getVar("custom").push_vector(totalDamage);
|
||
|
|
obj.getVar("custom").push_vector(damageRate);
|
||
|
|
obj.getVar("custom").push_vector(sizeRate);
|
||
|
|
obj.getVar("custom").push_vector(istalisman);
|
||
|
|
sizeRate = sizeRate.tofloat() / 100.0;
|
||
|
|
local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalquake/magiccircle.ani",0,0,0);
|
||
|
|
local pooledObj2 = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalquake/quake_glowbeam.ani",0,0,0);
|
||
|
|
local effectObj = [pooledObj,pooledObj2];
|
||
|
|
for(local i = 0; i < effectObj.len(); i++){
|
||
|
|
local pAni = effectObj[i].getCurrentAnimation();
|
||
|
|
pAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
|
|
pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
|
||
|
|
}
|
||
|
|
obj.setTimeEvent(1,400,1,false);
|
||
|
|
if(istalisman > 0) obj.setTimeEvent(2,120,20,false);
|
||
|
|
break;
|
||
|
|
case 2:
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local sizeRate = receiveData.readDword();
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalquake/elementalquakefireexpdummy.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 13));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK);
|
||
|
|
sizeRate = sizeRate.tofloat() / 100.0;
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
pAni.setLoop(false);
|
||
|
|
sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate);
|
||
|
|
local randomnumber = sq_getRandom(1,100);
|
||
|
|
local pooledObj;
|
||
|
|
if(randomnumber > 67) pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalquake/flamestrike_blast_front02.ani",sq_getRandom(-350,350),sq_getRandom(-40,40),0);
|
||
|
|
else if(randomnumber > 33 && randomnumber <= 67) pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalquake/flamestrike_blast_front02.ani",sq_getRandom(-233,233),sq_getRandom(-80,80),0);
|
||
|
|
else pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalquake/flamestrike_blast_front02.ani",sq_getRandom(-115,115),sq_getRandom(-120,120),0);
|
||
|
|
local currentAni = pooledObj.getCurrentAnimation();
|
||
|
|
currentAni.setImageRateFromOriginal(0.4, 0.4);
|
||
|
|
currentAni.setAutoLayerWorkAnimationAddSizeRate(0.4);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER://隕星幻滅
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local totalDamage2 = receiveData.readDword();
|
||
|
|
obj.getVar("custom").setInt(10, totalDamage2);
|
||
|
|
local randomnumber = sq_getRandom(1, 4);
|
||
|
|
obj.getVar("custom").setInt(11, randomnumber);
|
||
|
|
obj.getVar("custom").setInt(12, sq_GetZPos(obj));
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 41));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_FLAMESTRIKE://烈焰沖擊
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local sizeRate = receiveData.readDword();
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 15));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
obj.getVar("custom").clear_vector();
|
||
|
|
obj.getVar("custom").push_vector(sizeRate);
|
||
|
|
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
case 2:
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local sizeRate = receiveData.readDword();
|
||
|
|
local etcTime = receiveData.readDword();
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 15));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE);
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/flamestrike/lv95assimilate/flamestrikebottoma_00.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
obj.getVar("custom").clear_vector();
|
||
|
|
obj.getVar("custom").push_vector(sizeRate);
|
||
|
|
obj.getVar("custom").push_vector(totalDamage);
|
||
|
|
obj.getVar("custom").push_vector(etcTime);
|
||
|
|
local sizeRate = obj.getVar("custom").get_vector(0);
|
||
|
|
sizeRate = sizeRate.tofloat() / 100.0;
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
pAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
|
|
pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
|
||
|
|
sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate);
|
||
|
|
obj.getVar("targetObj").clear_obj_vector();
|
||
|
|
obj.setTimeEvent(0,600,1,false);
|
||
|
|
sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM);
|
||
|
|
break;
|
||
|
|
case 3:
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local sizeRate = receiveData.readDword();
|
||
|
|
local group = receiveData.readDword();
|
||
|
|
local uniqueId = receiveData.readDword();
|
||
|
|
obj.getVar("custom").clear_vector();
|
||
|
|
obj.getVar("custom").push_vector(sizeRate);
|
||
|
|
obj.getVar("custom").push_vector(group);
|
||
|
|
obj.getVar("custom").push_vector(uniqueId);
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 15));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE);
|
||
|
|
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER://傑克降臨
|
||
|
|
switch(subtype){
|
||
|
|
case 0:
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local sizeRate = receiveData.readDword();
|
||
|
|
local sizeRate2 = receiveData.readDword();
|
||
|
|
local damageRate = receiveData.readDword();
|
||
|
|
local sub = receiveData.readDword();
|
||
|
|
local typesub = receiveData.readDword();
|
||
|
|
local number = receiveData.readDword();
|
||
|
|
obj.getVar("custom").clear_vector();
|
||
|
|
obj.getVar("custom").push_vector(sizeRate);
|
||
|
|
obj.getVar("custom").push_vector(sizeRate2);
|
||
|
|
obj.getVar("custom").push_vector(damageRate);
|
||
|
|
obj.getVar("custom").push_vector(totalDamage);
|
||
|
|
obj.getVar("custom").push_vector(sub);
|
||
|
|
obj.getVar("custom").push_vector(typesub);
|
||
|
|
obj.getVar("custom").push_vector(number);
|
||
|
|
obj.setTimeEvent(3,1000+220 * number,1,false);
|
||
|
|
obj.setTimeEvent(4,800,1,false);
|
||
|
|
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalpotential/magictargetwarningterrible.ani",0,0,0);
|
||
|
|
break;
|
||
|
|
case 1:
|
||
|
|
case 2:
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local sizeRate = receiveData.readDword();
|
||
|
|
local sizeRate2 = receiveData.readDword();
|
||
|
|
local damageRate = receiveData.readDword();
|
||
|
|
local sub = receiveData.readDword();
|
||
|
|
print("sub = "+sub);
|
||
|
|
local totalDamage2 = totalDamage * damageRate / 100;
|
||
|
|
if(sub > 0){sizeRate = sizeRate * 166 / 100;sizeRate2 = sizeRate2 * 166 / 100;totalDamage = totalDamage * 10 / 100;totalDamage2 = totalDamage2 * 154 / 100;}
|
||
|
|
obj.getVar("custom").clear_vector();
|
||
|
|
obj.getVar("custom").push_vector(sizeRate);
|
||
|
|
obj.getVar("custom").push_vector(sizeRate2);
|
||
|
|
obj.getVar("custom").push_vector(totalDamage2);
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 18));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
if(subtype == 2){
|
||
|
|
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK);
|
||
|
|
}
|
||
|
|
local time = 1000;
|
||
|
|
if(sub > 0) time = 1500;
|
||
|
|
local speedRate = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_HALLOWEENBUSTER, 8, sq_GetSkillLevel(sqrChr, ELEMENTALMASTER_SKILL_HALLOWEENBUSTER));
|
||
|
|
if(speedRate > 0){
|
||
|
|
time = time / (100 + speedRate) * 100;
|
||
|
|
}
|
||
|
|
obj.getVar("move").setInt(10, sq_GetXPos(obj));
|
||
|
|
obj.getVar("move").setInt(11, sq_GetZPos(obj));
|
||
|
|
obj.setTimeEvent(5, time / 40, 40, true);
|
||
|
|
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_MIGHTYRUNE://聖靈符文
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_SESTOELEMENTO://第六元素
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local hitMax = receiveData.readDword();
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/sestoelemento/start_main.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
obj.sq_PlaySound("SESTOELEMENTO");
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 26));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK);
|
||
|
|
obj.setTimeEvent(1,3000/(hitMax+1),hitMax,true);
|
||
|
|
sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM);
|
||
|
|
local appendage = CNSquirrelAppendage.sq_AppendAppendage(sqrChr, obj, -1, false, "appendage/character/ap_common_suck.nut", false);
|
||
|
|
if(appendage){
|
||
|
|
CNSquirrelAppendage.sq_Append(appendage, sqrChr, obj);
|
||
|
|
local auraAppendage = appendage.sq_getAuraMaster("auraMaster");
|
||
|
|
if(!auraAppendage) auraAppendage = appendage.sq_AddAuraMaster("auraMaster", sqrChr, obj, 1200, 18, 5, 0);
|
||
|
|
if(auraAppendage) auraAppendage.setAttractionInfo(600, 600, 800, 100);
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case 2:
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/sestoelemento/explosion_main.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
obj.sq_PlaySound("SESTOELEMENTO_EXP");
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 25));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK);
|
||
|
|
sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM);
|
||
|
|
if(!sqrChr) break;
|
||
|
|
CNSquirrelAppendage.sq_RemoveAppendage(sqrChr, "appendage/character/ap_common_suck.nut");
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_SUNBURST://雷旋
|
||
|
|
switch(subtype){
|
||
|
|
case 1://
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local sizeRate = receiveData.readDword();
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/sunburst/sunburst.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 27));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
|
||
|
|
sizeRate = sizeRate.tofloat() / 100.0;
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate);
|
||
|
|
break;
|
||
|
|
case 2:
|
||
|
|
local time = receiveData.readDword();
|
||
|
|
obj.setTimeEvent(1, time, 1, false);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_THEGATE://元素之門
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local create_number = receiveData.readDword();
|
||
|
|
local create_time = receiveData.readDword();
|
||
|
|
local sub = receiveData.readDword();
|
||
|
|
local group = receiveData.readDword();
|
||
|
|
local uniqueId = receiveData.readDword();
|
||
|
|
local targetObj = sq_GetObject(obj, group, uniqueId);
|
||
|
|
sq_moveWithParent(targetObj, obj);
|
||
|
|
obj.getVar().clear_obj_vector();
|
||
|
|
obj.getVar().push_obj_vector(targetObj);
|
||
|
|
obj.getVar("custom").clear_vector();
|
||
|
|
obj.getVar("custom").push_vector(totalDamage);
|
||
|
|
obj.getVar("custom").push_vector(create_number);
|
||
|
|
obj.getVar("custom").push_vector(create_time);
|
||
|
|
obj.getVar("custom").push_vector(sub);
|
||
|
|
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
case 2:
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local sub = receiveData.readDword();
|
||
|
|
local aniPath1 = "passiveobject/elementalmaster_bykk/animation/thegate/";
|
||
|
|
local aniPath2 = "light";
|
||
|
|
switch(sub){
|
||
|
|
case 2: aniPath2 = "ice"; break;
|
||
|
|
case 3: aniPath2 = "fire"; break;
|
||
|
|
case 4: aniPath2 = "dark"; break;
|
||
|
|
}
|
||
|
|
local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/" + aniPath2 + "_crystal.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 28));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
sq_CreateParticle("passiveobject/elementalmaster_bykk/particle/thegate"+aniPath2+"tail.ptl", obj, 0, 0, 0, true, 10, 0, 3);
|
||
|
|
|
||
|
|
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
|
|
switch(sub){
|
||
|
|
case 1: if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT); break;
|
||
|
|
case 2: if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER); break;
|
||
|
|
case 3: if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE); break;
|
||
|
|
case 4: if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK); break;
|
||
|
|
}
|
||
|
|
|
||
|
|
obj.getVar("custom").clear_vector();
|
||
|
|
obj.getVar("custom").push_vector(sq_GetZPos(obj));
|
||
|
|
obj.getVar("custom").push_vector(sub);
|
||
|
|
break;
|
||
|
|
case 10:
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local sub = receiveData.readDword();
|
||
|
|
local group = receiveData.readDword();
|
||
|
|
local uniqueId = receiveData.readDword();
|
||
|
|
local targetObj = sq_GetObject(obj, group, uniqueId);
|
||
|
|
if(targetObj){
|
||
|
|
obj.getVar("custom").setInt(0, totalDamage);
|
||
|
|
obj.getVar("custom").setInt(1, sub);
|
||
|
|
obj.getVar("custom").setInt(2, group);
|
||
|
|
obj.getVar("custom").setInt(3, uniqueId);
|
||
|
|
local aniPath0 = "passiveobject/elementalmaster_bykk/animation/thegate/talisman/";
|
||
|
|
local aniPath1 = ["magiccircleblue","magiccirclepurple","magiccirclered","magiccircleyellow"];
|
||
|
|
local aniPath2 = [["/magiccircleblue_01.ani","/magiccirclepurple_01.ani","/magiccirclered_01.ani","/magiccircleyellow_01.ani"],
|
||
|
|
["/magiccircleblue_line_00.ani","/magiccirclepurple_line_00.ani","/magiccirclered_line_00.ani","/magiccircleyellow_line_00.ani"]];
|
||
|
|
local ani = sq_CreateAnimation("",aniPath0 + aniPath1[sub] + aniPath2[0][sub]);
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
pAni.addLayerAnimation(-1,sq_CreateAnimation("",aniPath0 + aniPath1[sub] + aniPath2[1][sub]),true);
|
||
|
|
local activeObj = sq_GetCNRDObjectToActiveObject(targetObj);
|
||
|
|
if(!CNSquirrelAppendage.sq_IsAppendAppendage(activeObj, "character/mage/elementalmaster_bykk/ap_mage_hold.nut")){
|
||
|
|
CNSquirrelAppendage.sq_RemoveAppendage(activeObj, "character/mage/elementalmaster_bykk/ap_mage_hold.nut");
|
||
|
|
}
|
||
|
|
local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(activeObj, obj, -1, false, "character/mage/elementalmaster_bykk/ap_mage_hold.nut", true);
|
||
|
|
sq_HoldAndDelayDie(activeObj, obj, true, true, true, 200, 200, ENUM_DIRECTION_NEUTRAL , AddAppendage);
|
||
|
|
}
|
||
|
|
else sq_SendDestroyPacketPassiveObject(obj);
|
||
|
|
break;
|
||
|
|
case 11:
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local sub = receiveData.readDword();
|
||
|
|
local group = receiveData.readDword();
|
||
|
|
local uniqueId = receiveData.readDword();
|
||
|
|
local targetObj = sq_GetObject(obj, group, uniqueId);
|
||
|
|
if(targetObj){
|
||
|
|
obj.getVar("tar").clear_obj_vector();
|
||
|
|
obj.getVar("tar").push_obj_vector(targetObj);
|
||
|
|
local aniPath0 = "passiveobject/elementalmaster_bykk/animation/thegate/talisman/";
|
||
|
|
local aniPath1 = ["magiccircleblue","magiccirclepurple","magiccirclered","magiccircleyellow"];
|
||
|
|
local aniPath2 = ["/explosionblue_04.ani","/explosionpurple_05.ani","/explosionred_04.ani","/explosionyellow_04.ani"];
|
||
|
|
// print("path = "+aniPath0 + aniPath1[sub] + aniPath2[sub]);
|
||
|
|
local ani = sq_CreateAnimation("",aniPath0 + aniPath1[sub] + aniPath2[sub]);
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 28));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
|
|
attackInfo.setElement(ENUM_ELEMENT_FIRE);
|
||
|
|
attackInfo.setElement(ENUM_ELEMENT_WATER);
|
||
|
|
attackInfo.setElement(ENUM_ELEMENT_DARK);
|
||
|
|
attackInfo.setElement(ENUM_ELEMENT_LIGHT);
|
||
|
|
obj.setTimeEvent(2,50,1,false);
|
||
|
|
sq_SetShake(obj, 15, 300);
|
||
|
|
}
|
||
|
|
else sq_SendDestroyPacketPassiveObject(obj);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_THUNDERCALLING://天雷
|
||
|
|
switch(subtype){
|
||
|
|
case 0://totalDamage,sizeRate,countMax,hitTime,range,2
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local sizeRate = receiveData.readDword();
|
||
|
|
local countMax = receiveData.readDword();
|
||
|
|
local hitTime = receiveData.readDword();
|
||
|
|
local range = receiveData.readDword();
|
||
|
|
local sub = receiveData.readDword();
|
||
|
|
obj.getVar("custom").clear_vector();
|
||
|
|
obj.getVar("custom").push_vector(totalDamage);
|
||
|
|
obj.getVar("custom").push_vector(sizeRate);
|
||
|
|
obj.getVar("custom").push_vector(countMax);
|
||
|
|
obj.getVar("custom").push_vector(range);
|
||
|
|
obj.getVar("custom").push_vector(sub);
|
||
|
|
obj.getVar("custom").push_vector(hitTime);
|
||
|
|
local skill_level = sq_GetSkillLevel(sqrChr, ELEMENTALMASTER_SKILL_THUNDERCALLING);
|
||
|
|
local prob = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_THUNDERCALLING, 4, skill_level);
|
||
|
|
local level = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_THUNDERCALLING, 5, skill_level);
|
||
|
|
local time = sq_GetLevelData(sqrChr, ELEMENTALMASTER_SKILL_THUNDERCALLING, 6, skill_level);
|
||
|
|
obj.getVar("custom").push_vector(prob);
|
||
|
|
obj.getVar("custom").push_vector(level);
|
||
|
|
obj.getVar("custom").push_vector(time);
|
||
|
|
if((countMax * hitTime) > 4000){
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
sq_SetFrameDelayTime(pAni, 0, countMax * hitTime);
|
||
|
|
}
|
||
|
|
obj.setTimeEvent(3,1000+(hitTime + 20) * countMax,1,false);
|
||
|
|
obj.setTimeEvent(4,800,1,false);
|
||
|
|
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalpotential/magictargetwarningterrible.ani",0,0,0);
|
||
|
|
break;
|
||
|
|
case 1:
|
||
|
|
case 2:
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local sizeRate = receiveData.readDword();
|
||
|
|
local range = receiveData.readDword();
|
||
|
|
local prob = receiveData.readDword();
|
||
|
|
local level = receiveData.readDword();
|
||
|
|
local time = receiveData.readDword();
|
||
|
|
local aniPath = "passiveobject/elementalmaster_bykk/animation/thunderstrike/thunderstrike_lightning01.ani";
|
||
|
|
if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalpotential/thunderstrike/epthunderstrike_lightning01.ani";
|
||
|
|
local ani = sq_CreateAnimation("",aniPath);
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local attackIndex = 29;
|
||
|
|
if(subtype == 2) attackIndex = 11;
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, attackIndex));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
|
|
if(attackInfo) sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_STUN, prob, level, time);
|
||
|
|
if(subtype == 1){
|
||
|
|
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/thunderstrike/thunderstrike_hit01.ani",0,0,0);
|
||
|
|
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/thunderstrike/thunderstrike_floor.ani",0,0,0);
|
||
|
|
}
|
||
|
|
else if(subtype == 2){
|
||
|
|
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/elementalpotential/thunderstrike/epthunderstrike_hit01.ani",0,0,0);
|
||
|
|
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK);
|
||
|
|
}
|
||
|
|
sizeRate = sizeRate.tofloat() / 100.0;
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
pAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
|
|
pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
|
||
|
|
sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate);
|
||
|
|
obj.sq_PlaySound("THUNDERC_LIGHTNING");
|
||
|
|
obj.setTimeEvent(1,200,1,false);
|
||
|
|
break;
|
||
|
|
case 3:
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
print("totalDamage = "+totalDamage);
|
||
|
|
local aniPath = "passiveobject/character/mage/animation/thunderstrike.ani";
|
||
|
|
local ani = sq_CreateAnimation("",aniPath);
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
sq_AddDrawOnlyAniFromParent(obj, "passiveobject/character/mage/animation/thunderstrikeeffect.ani", 0, -1, 0);
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 29));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_THUNDERRAGE://光與暗的交響
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local sizeRate = receiveData.readDword();
|
||
|
|
local hitMax = receiveData.readDword();
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/thunderrage/thunderrage_cast_end_shot_back_05.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 30));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
|
||
|
|
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK);
|
||
|
|
|
||
|
|
sizeRate = sizeRate.tofloat() / 1000.0;
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
local delaySum = pAni.getDelaySum(0,13);
|
||
|
|
obj.setTimeEvent(1,delaySum/(hitMax + 1),hitMax,true);
|
||
|
|
pAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
|
|
pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
|
||
|
|
sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_VOID://虛無之球
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local sizeRate = receiveData.readDword();
|
||
|
|
local shoot_range = receiveData.readDword();
|
||
|
|
local hittime = receiveData.readDword();
|
||
|
|
obj.getVar("custom").clear_vector();
|
||
|
|
obj.getVar("custom").push_vector(shoot_range);
|
||
|
|
obj.getVar("custom").push_vector(sq_GetXPos(obj));
|
||
|
|
obj.getVar("custom").push_vector(sizeRate);
|
||
|
|
obj.setTimeEvent(0,hittime,-1,false);
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 31));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
obj.sq_SetMoveParticle("particle/void.ptl", 0.0, 0.0);
|
||
|
|
// sq_SetSpeedToMoveParticle(obj,0,speed);
|
||
|
|
obj.setTimeEvent(1,20,-1,false);
|
||
|
|
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
case 2:
|
||
|
|
local totalDamage = receiveData.readDword();
|
||
|
|
local hittime = receiveData.readDword();
|
||
|
|
local timeMax = receiveData.readDword();
|
||
|
|
local damageRate = receiveData.readDword();
|
||
|
|
local damageRate2 = receiveData.readDword();
|
||
|
|
local sizeRate = receiveData.readDword();
|
||
|
|
local isExp = receiveData.readDword();
|
||
|
|
local totalDamage2 = (totalDamage.tofloat() * damageRate.tofloat() / 100.0).tointeger();
|
||
|
|
local totalDamage3 = (totalDamage.tofloat() * damageRate2.tofloat() / 100.0).tointeger();
|
||
|
|
obj.getVar("custom").clear_vector();
|
||
|
|
obj.getVar("custom").push_vector(hittime);
|
||
|
|
obj.getVar("custom").push_vector(timeMax);
|
||
|
|
obj.getVar("custom").push_vector(totalDamage3);
|
||
|
|
obj.getVar("custom").push_vector(sizeRate);
|
||
|
|
obj.getVar("custom").push_vector(isExp);
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 32));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage2);
|
||
|
|
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK);
|
||
|
|
obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_WALLOFICE://冰牆
|
||
|
|
break;
|
||
|
|
case 38://移動施法
|
||
|
|
sqrChr.getVar("moveoncast").clear_obj_vector();
|
||
|
|
sqrChr.getVar("moveoncast").push_obj_vector(obj);
|
||
|
|
local chargeTime = receiveData.readDword();
|
||
|
|
local sub = receiveData.readDword();
|
||
|
|
local fullcharge = receiveData.readDword();
|
||
|
|
obj.setTimeEvent(0,chargeTime,1,false);
|
||
|
|
obj.getVar("custom").clear_vector();
|
||
|
|
obj.getVar("custom").push_vector(sub);
|
||
|
|
obj.setMapFollowParent(obj.getParent());
|
||
|
|
obj.setMapFollowType(1);
|
||
|
|
sq_moveWithParent(sqrChr, obj);
|
||
|
|
if(fullcharge > 0) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
else obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
|
||
|
|
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
|
|
if(attackInfo){
|
||
|
|
local element_kk_fire = sqrChr.getVar("element_kk").getInt(0);
|
||
|
|
local element_kk_water = sqrChr.getVar("element_kk").getInt(1);
|
||
|
|
local element_kk_dark = sqrChr.getVar("element_kk").getInt(2);
|
||
|
|
local element_kk_light = sqrChr.getVar("element_kk").getInt(3);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE) && element_kk_fire > 0) attackInfo.setElement(ENUM_ELEMENT_FIRE);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER) && element_kk_water > 0) attackInfo.setElement(ENUM_ELEMENT_WATER);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK) && element_kk_dark > 0) attackInfo.setElement(ENUM_ELEMENT_DARK);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT) && element_kk_light > 0) attackInfo.setElement(ENUM_ELEMENT_LIGHT);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function setState_po_elementalmaster_bykk_kak(obj, state, datas)
|
||
|
|
{
|
||
|
|
if(!obj) return;
|
||
|
|
|
||
|
|
local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter());
|
||
|
|
local skillIndex = obj.getVar("skillIndex").get_vector(0);
|
||
|
|
local subtype = obj.getVar("subtype").get_vector(0);
|
||
|
|
obj.getVar("state").clear_vector();
|
||
|
|
obj.getVar("state").push_vector(state);
|
||
|
|
|
||
|
|
switch(skillIndex){
|
||
|
|
case ELEMENTALMASTER_SKILL_ARCTICPISTE://極冰綻放
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
case 2:
|
||
|
|
switch(state){
|
||
|
|
case 20:
|
||
|
|
local aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/icefieldfloorappear.ani";
|
||
|
|
if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/field2floorappear.ani";
|
||
|
|
local ani = sq_CreateAnimation("",aniPath);
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local speedRate = obj.getVar("custom").get_vector(3);
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
sq_SetFrameDelayTime(pAni, 0, 300);
|
||
|
|
pAni.setSpeedRate(speedRate.tofloat());
|
||
|
|
break;
|
||
|
|
case 21:
|
||
|
|
local aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/icefield.ani";
|
||
|
|
if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/field2.ani";
|
||
|
|
local ani = sq_CreateAnimation("",aniPath);
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local hitTime = obj.getVar("custom").get_vector(2);
|
||
|
|
local sub = obj.getVar("custom").get_vector(4);
|
||
|
|
obj.setTimeEvent(1,hitTime,-1,false);
|
||
|
|
if(sub == 0) obj.setTimeEvent(2,hitTime / 2,-1,false);
|
||
|
|
else if(sub == 1) obj.setTimeEvent(3,900,-1,true);
|
||
|
|
break;
|
||
|
|
case 22:
|
||
|
|
obj.stopTimeEvent(1);
|
||
|
|
local aniPath = "passiveobject/elementalmaster_bykk/animation/icefield/icefieldfloordisappear.ani";
|
||
|
|
if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/field2disappear.ani";
|
||
|
|
local ani = sq_CreateAnimation("",aniPath);
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
local sizeRate = obj.getVar("custom").get_vector(0);
|
||
|
|
sizeRate = sizeRate.tofloat() / 100.0;
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
pAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
|
|
pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
|
||
|
|
sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_BLACKHOLE://黑洞
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
case 2:
|
||
|
|
switch(state){
|
||
|
|
case 20:
|
||
|
|
local aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/normal/nighthollow1_start_dodge.ani";
|
||
|
|
if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/elementalpotential/nighthollow2_start_dodge.ani";
|
||
|
|
local ani = sq_CreateAnimation("",aniPath);
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
obj.sq_PlaySound("NIGHTH_IN")
|
||
|
|
break;
|
||
|
|
case 21:
|
||
|
|
local aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/normal/nighthollow1_loop_dodge.ani";
|
||
|
|
if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/elementalpotential/nighthollow2_loop_dodge.ani";
|
||
|
|
local ani = sq_CreateAnimation("",aniPath);
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local lifeTime = obj.getVar("custom").get_vector(4);
|
||
|
|
local sizeRate = obj.getVar("custom").get_vector(0);
|
||
|
|
cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,0,obj.getDirection(),ELEMENTALMASTER_SKILL_BLACKHOLE,3,lifeTime,subtype,sizeRate,0,0,0,0,0,0,0);
|
||
|
|
local hitTime = obj.getVar("custom").get_vector(7);
|
||
|
|
obj.setTimeEvent(1,hitTime,-1,false);
|
||
|
|
obj.setTimeEvent(0,lifeTime,1,false);
|
||
|
|
obj.setTimeEvent(3,1800,-1,true);
|
||
|
|
if(!sqrChr) break;
|
||
|
|
local attractPower = obj.getVar("custom").get_vector(1);
|
||
|
|
local range = obj.getVar("custom").get_vector(2);
|
||
|
|
if(CNSquirrelAppendage.sq_IsAppendAppendage(sqrChr, "appendage/character/ap_common_suck.nut")) CNSquirrelAppendage.sq_RemoveAppendage(sqrChr, "appendage/character/ap_common_suck.nut");
|
||
|
|
local appendage = CNSquirrelAppendage.sq_AppendAppendage(sqrChr, obj, -1, false, "appendage/character/ap_common_suck.nut", false);
|
||
|
|
if(appendage){
|
||
|
|
CNSquirrelAppendage.sq_Append(appendage, sqrChr, obj);
|
||
|
|
local auraAppendage = appendage.sq_getAuraMaster("auraMaster");
|
||
|
|
if(!auraAppendage) auraAppendage = appendage.sq_AddAuraMaster("auraMaster", sqrChr, obj, 1200, 18, 5, 0);
|
||
|
|
if(auraAppendage) auraAppendage.setAttractionInfo(attractPower, attractPower, range, 100);
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case 22:
|
||
|
|
obj.stopTimeEvent(1);
|
||
|
|
obj.stopTimeEvent(3);
|
||
|
|
local aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/normal/nighthollow1_exp_dodge.ani";
|
||
|
|
if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/nighthollow/elementalpotential/nighthollow2_exp_dodge.ani";
|
||
|
|
local ani = sq_CreateAnimation("",aniPath);
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
obj.sq_PlaySound("NIGHTH_OUT");
|
||
|
|
obj.setTimeEvent(2,400,1,false);
|
||
|
|
local totalDamage = obj.getVar("custom").get_vector(3);
|
||
|
|
local attackIndex = 40;
|
||
|
|
if(subtype == 2) attackIndex = 39;
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, attackIndex));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
if(subtype == 2){
|
||
|
|
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK);
|
||
|
|
}
|
||
|
|
if(!sqrChr) break;
|
||
|
|
CNSquirrelAppendage.sq_RemoveAppendage(sqrChr, "appendage/character/ap_common_suck.nut");
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
local sizeRate = obj.getVar("custom").get_vector(0);
|
||
|
|
sizeRate = sizeRate.tofloat() / 100.0;
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
pAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
|
|
pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
|
||
|
|
sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND://聖靈水晶
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
switch(state){
|
||
|
|
case 20:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/crystalofovermind/crystalofovermind_grow01_loop.ani");//
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/groweffect/crystalofovermind_grow01_start.ani",0,0,50);
|
||
|
|
obj.setTimeEvent(2,650,4,false);
|
||
|
|
break;
|
||
|
|
case 21:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/crystalofovermind/crystalofovermind_grow02_loop.ani");//
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/groweffect/crystalofovermind_grow02_start.ani",0,0,50);
|
||
|
|
break;
|
||
|
|
case 22:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/crystalofovermind/crystalofovermind_grow03_loop.ani");//
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/groweffect/crystalofovermind_grow03_start.ani",0,0,50);
|
||
|
|
break;
|
||
|
|
case 23:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/crystalofovermind/crystalofovermind_grow04_loop.ani");//
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/groweffect/crystalofovermind_grow04_start_back.ani",0,0,50);
|
||
|
|
sq_AddDrawOnlyAniFromParent(obj,"character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/groweffect/crystalofovermind_grow04_start.ani",0,0,50);
|
||
|
|
break;
|
||
|
|
case 24:
|
||
|
|
obj.stopTimeEvent(2);
|
||
|
|
local effectObj2 = sqrChr.getVar("crystal_effect2").get_obj_vector(0);
|
||
|
|
if(effectObj2){local colObj = sq_GetCNRDObjectToCollisionObject(effectObj2);colObj.setTimeEvent(1,100,1,true);}
|
||
|
|
local effectObj3 = sqrChr.getVar("crystal_effect3").get_obj_vector(0);
|
||
|
|
if(effectObj3){local colObj = sq_GetCNRDObjectToCollisionObject(effectObj3);colObj.setTimeEvent(1,100,1,true);}
|
||
|
|
local effectObj4 = sqrChr.getVar("crystal_effect4").get_obj_vector(0);
|
||
|
|
if(effectObj4){local colObj = sq_GetCNRDObjectToCollisionObject(effectObj4);colObj.setTimeEvent(1,500,1,false);}
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/crystalofovermind/finish/front/crystalofovermind_finish_front_00.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local currentAni = obj.getCurrentAnimation();
|
||
|
|
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/crystalofovermind/finish/back/crystalofovermind_finish_back_00.ani"),true);
|
||
|
|
local totalDamage = obj.getVar("custom").getInt(2);
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 2));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
local sizeRate = obj.getVar("custom").getInt(1);
|
||
|
|
sizeRate = sizeRate.tofloat() / 100.0;
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
pAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
|
|
pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
|
||
|
|
sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate);
|
||
|
|
break;
|
||
|
|
case 2:
|
||
|
|
case 3:
|
||
|
|
case 4:
|
||
|
|
local aniPath1 = "character/mage/effect/animation/elementalmaster_bykk/crystalofovermind/";
|
||
|
|
switch(state){
|
||
|
|
case 20:
|
||
|
|
local aniPath2 = "crystalofmind_side_back01_start.ani";
|
||
|
|
if(subtype == 3) aniPath2 = "crystalofmind_side_front_start.ani";
|
||
|
|
if(subtype == 4) aniPath2 = "crystalofovermind_background_01.ani";
|
||
|
|
local ani = sq_CreateAnimation("",aniPath1 + "start/" + aniPath2);
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
break;
|
||
|
|
case 21:
|
||
|
|
local aniPath2 = "crystalofmind_side_back01.ani";
|
||
|
|
if(subtype == 3) aniPath2 = "crystalofmind_side_front_loop01.ani";
|
||
|
|
if(subtype == 4) aniPath2 = "crystalofovermind_background_01.ani";
|
||
|
|
local ani = sq_CreateAnimation("",aniPath1 + "loop/" + aniPath2);
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
break;
|
||
|
|
case 22:
|
||
|
|
local aniPath2 = "crystalofmind_side_back01_finish.ani";
|
||
|
|
if(subtype == 3) aniPath2 = "crystalofmind_side_front_finish.ani";
|
||
|
|
if(subtype == 4) {sq_SendDestroyPacketPassiveObject(obj);return;}
|
||
|
|
local ani = sq_CreateAnimation("",aniPath1 + "end/" + aniPath2);
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
local sizeRate = obj.getVar("custom").getInt(1);
|
||
|
|
sizeRate = sizeRate.tofloat() / 100.0;
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
pAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
|
|
pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN://元素點燃
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
case 2:
|
||
|
|
case 3:
|
||
|
|
case 4:
|
||
|
|
local aniPath1 = "character/mage/effect/animation/elementalmaster_bykk/elementalchain/mark";
|
||
|
|
local aniPath2 = "light";
|
||
|
|
if(subtype == 2) aniPath2 = "ice";
|
||
|
|
if(subtype == 3) aniPath2 = "fire";
|
||
|
|
if(subtype == 4) aniPath2 = "dark";
|
||
|
|
if(obj.getVar("custom").get_vector(1) == 1) aniPath1 = "character/mage/effect/animation/elementalmaster_bykk/mightyrune/";
|
||
|
|
if(obj.getVar("custom").get_vector(1) == 2) aniPath1 = "character/mage/effect/animation/elementalmaster_bykk/mightyrune/lv95assimilate/";
|
||
|
|
switch(state){
|
||
|
|
case 20:
|
||
|
|
local ani = sq_CreateAnimation("",aniPath1 + "appear_" + aniPath2 + "_1.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local currentAni = obj.getCurrentAnimation();
|
||
|
|
currentAni.addLayerAnimation(-1,sq_CreateAnimation("",aniPath1 + "appear_" + aniPath2 + "_2.ani"),true);
|
||
|
|
break;
|
||
|
|
case 21:
|
||
|
|
local ani = sq_CreateAnimation("",aniPath1 + "stay_" + aniPath2 + "_1.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
if(subtype == 1) sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr) + 23);
|
||
|
|
local currentAni = obj.getCurrentAnimation();
|
||
|
|
currentAni.addLayerAnimation(-1,sq_CreateAnimation("",aniPath1 + "stay_" + aniPath2 + "_2.ani"),true);
|
||
|
|
break;
|
||
|
|
case 22:
|
||
|
|
if(obj.isExistTimeEvent(1)) obj.stopTimeEvent(1);
|
||
|
|
local ani = sq_CreateAnimation("",aniPath1 + "activate_" + aniPath2 + "_1.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local lifeTime = obj.getVar("custom").get_vector(0);
|
||
|
|
obj.setTimeEvent(1,lifeTime,1,false);
|
||
|
|
if(subtype == 1) sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr) + 30);
|
||
|
|
if(subtype == 4) sq_setCurrentAxisPos(obj, 2, sq_GetZPos(sqrChr) + 35);
|
||
|
|
break;
|
||
|
|
case 23:
|
||
|
|
local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/rune" + aniPath2 + "cast.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
break;
|
||
|
|
case 24:
|
||
|
|
local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/rune" + aniPath2 + "off_02.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
break;
|
||
|
|
case 25:
|
||
|
|
local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/rune" + aniPath2 + "changeon_02.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
break;
|
||
|
|
case 26:
|
||
|
|
if(obj.isExistTimeEvent(2)) obj.stopTimeEvent(2);
|
||
|
|
local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/rune" + aniPath2 + "on_02.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local lightTime = obj.getVar("custom").get_vector(0);
|
||
|
|
obj.setTimeEvent(1,lightTime,1,false);
|
||
|
|
break;
|
||
|
|
case 27:
|
||
|
|
local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/rune" + aniPath2 + "changeoff.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
break;
|
||
|
|
case 28:
|
||
|
|
local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "spherestart_00.ani ");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
break;
|
||
|
|
case 29:
|
||
|
|
local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "sphereloop_00.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case 15:
|
||
|
|
switch(state){
|
||
|
|
case 20:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchjolstart.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local currentAni = obj.getCurrentAnimation();
|
||
|
|
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchjolfirestart.ani"),true);
|
||
|
|
break;
|
||
|
|
case 21:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchjolmove.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local currentAni = obj.getCurrentAnimation();
|
||
|
|
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchjolfiremove.ani"),true);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
local sizeRate = obj.getVar("custom").get_vector(0);
|
||
|
|
sizeRate = sizeRate.tofloat() / 1000.0;
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
pAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
|
|
pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
|
||
|
|
sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate);
|
||
|
|
break;
|
||
|
|
case 16:
|
||
|
|
switch(state){
|
||
|
|
case 20:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchfrosthead.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
pAni.setLoop(true);
|
||
|
|
break;
|
||
|
|
case 21:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchfrostheadjump.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
obj.getVar("custom").set_vector(1,sq_GetXPos(obj));
|
||
|
|
obj.getVar("custom").set_vector(2,sq_GetYPos(obj));
|
||
|
|
obj.getVar("custom").set_vector(3,sq_GetZPos(obj));
|
||
|
|
local targetObj = obj.sq_FindFirstTarget(-9999, 19998, 9999, 9999);
|
||
|
|
if(targetObj){
|
||
|
|
local targetObj_y = sq_GetYPos(targetObj) - sq_GetYPos(obj);
|
||
|
|
obj.getVar("custom").set_vector(5,targetObj_y);
|
||
|
|
if(sq_GetXPos(targetObj) > sq_GetXPos(obj) && obj.getDirection() == ENUM_DIRECTION_LEFT) sq_SetCurrentDirection(obj, ENUM_DIRECTION_RIGHT);
|
||
|
|
else if(sq_GetXPos(targetObj) < sq_GetXPos(obj) && obj.getDirection() == ENUM_DIRECTION_RIGHT) sq_SetCurrentDirection(obj, ENUM_DIRECTION_LEFT);
|
||
|
|
}
|
||
|
|
obj.getVar("custom").set_vector(6,130);
|
||
|
|
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/character/mage/animation/launchfrostheadjumpeffect.ani",0,-1,-1);
|
||
|
|
break;
|
||
|
|
case 22:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchfrostheadhit.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
break;
|
||
|
|
case 23:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchfrostheaddisappear.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
local sizeRate = obj.getVar("custom").get_vector(0);
|
||
|
|
sizeRate = sizeRate.tofloat() / 1000.0;
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
pAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
|
|
pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
|
||
|
|
sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate);
|
||
|
|
break;
|
||
|
|
case 18:
|
||
|
|
switch(state){
|
||
|
|
case 20:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatshoot1.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local currentAni = obj.getCurrentAnimation();
|
||
|
|
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatshoot2.ani"),true);
|
||
|
|
break;
|
||
|
|
case 21:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatmovego1.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local currentAni = obj.getCurrentAnimation();
|
||
|
|
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatmovego2.ani"),true);
|
||
|
|
break;
|
||
|
|
case 22:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatturn1.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local currentAni = obj.getCurrentAnimation();
|
||
|
|
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatturn2.ani"),true);
|
||
|
|
obj.getVar("custom").set_vector(3,sq_GetXPos(obj));
|
||
|
|
break;
|
||
|
|
case 23:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatmovereturn1.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local currentAni = obj.getCurrentAnimation();
|
||
|
|
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatmovereturn2.ani"),true);
|
||
|
|
obj.resetHitObjectList();
|
||
|
|
break;
|
||
|
|
case 24:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatreturn1.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local currentAni = obj.getCurrentAnimation();
|
||
|
|
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/character/mage/animation/launchblackcatreturn2.ani"),true);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
local sizeRate = obj.getVar("custom").get_vector(0);
|
||
|
|
sizeRate = sizeRate.tofloat() / 1000.0;
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
pAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
|
|
pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
|
||
|
|
sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN://元素之幕
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL://元素奧義
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE://元素震蕩
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER://隕星幻滅
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
switch(state){
|
||
|
|
case 20:
|
||
|
|
local randomnumber = obj.getVar("custom").getInt(11);
|
||
|
|
local aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/darkdrop.ani";
|
||
|
|
if(randomnumber == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/firedrop.ani";
|
||
|
|
if(randomnumber == 3) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/lightdrop.ani";
|
||
|
|
if(randomnumber == 4) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/waterdrop.ani";
|
||
|
|
local ani = sq_CreateAnimation("",aniPath);
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
sq_SetFrameDelayTime(pAni, 0, 100);
|
||
|
|
local sizeRate = 2.5;
|
||
|
|
pAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
|
|
pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
|
||
|
|
sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate);
|
||
|
|
obj.setTimeEvent(1, 10, 13, true);
|
||
|
|
obj.sq_PlaySound("COLORLESS_CHASER");
|
||
|
|
break;
|
||
|
|
case 21:
|
||
|
|
local randomnumber = obj.getVar("custom").getInt(11);
|
||
|
|
local aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/darkexp.ani";
|
||
|
|
if(randomnumber == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/fireexp.ani";
|
||
|
|
if(randomnumber == 3) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/lightexp.ani";
|
||
|
|
if(randomnumber == 4) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalshower/waterexp.ani";
|
||
|
|
local ani = sq_CreateAnimation("",aniPath);
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local currentAni = obj.getCurrentAnimation();
|
||
|
|
switch(randomnumber){
|
||
|
|
case 1: currentAni.addLayerAnimation(6,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalshower/darkexplayer.ani"),true); obj.sq_PlaySound("DARK_BOMB"); break;
|
||
|
|
case 2: currentAni.addLayerAnimation(6,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalshower/fireexplayer.ani"),true); obj.sq_PlaySound("FIRE_BOMB"); break;
|
||
|
|
case 3: currentAni.addLayerAnimation(6,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalshower/lightexplayer.ani"),true); obj.sq_PlaySound("LIGHT_BOMB"); break;
|
||
|
|
case 4: currentAni.addLayerAnimation(6,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalshower/waterexplayer.ani"),true); obj.sq_PlaySound("WATER_BOMB"); break;
|
||
|
|
}
|
||
|
|
local sizeRate = 2.5;
|
||
|
|
currentAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
|
|
currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
|
||
|
|
sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate);
|
||
|
|
local totalDamage = obj.getVar("custom").getInt(10);
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 42));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
//obj.sq_PlaySound("CHASER_EXPLOSION");
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_FLAMESTRIKE://烈焰沖擊
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
switch(state){
|
||
|
|
case 20:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/flamestrike/new/flamestrike_start_floor01.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local currentAni = obj.getCurrentAnimation();
|
||
|
|
currentAni.addLayerAnimation(10001,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/flamestrike/new/flamestrike_start_floor03.ani"),true);
|
||
|
|
break;
|
||
|
|
case 21:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/flamestrike/new/flamestrike_blast_front02.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
sq_CreateParticle("passiveobject/character/mage/particle/flamestrikeparticle-1.ptl", obj, 0, 0, 0, true, 1, 0, 1);
|
||
|
|
sq_CreateParticle("passiveobject/character/mage/particle/flamestrikeparticle-2.ptl", obj, 0, 0, 0, true, 1, 0, 1);
|
||
|
|
sq_SetMyShake(obj, 10, 150);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
local sizeRate = obj.getVar("custom").get_vector(0);
|
||
|
|
sizeRate = sizeRate.tofloat() / 100.0;
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
pAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
|
|
pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
|
||
|
|
sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate);
|
||
|
|
break;
|
||
|
|
case 3:
|
||
|
|
switch(state){
|
||
|
|
case 20:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/flamestrike/lv95assimilate/flamestrikea_00.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
break;
|
||
|
|
case 21:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/flamestrike/lv95assimilate/flamestrikeb_02.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local group = obj.getVar("custom").get_vector(1);
|
||
|
|
local uniqueId = obj.getVar("custom").get_vector(2);
|
||
|
|
local targetObj = sq_GetObject(obj, group, uniqueId);
|
||
|
|
if(targetObj) sq_SendHitObjectPacket(obj,targetObj,0,0,0);
|
||
|
|
sq_CreateParticle("passiveobject/elementalmaster_bykk/particle/flamestrikeparticlenew1.ptl", obj, 0, 0, 0, true, 1, 0, 1);
|
||
|
|
sq_CreateParticle("passiveobject/elementalmaster_bykk/particle/flamestrikeparticlenew2.ptl", obj, 0, 0, 0, true, 1, 0, 1);
|
||
|
|
sq_SetMyShake(obj, 10, 150);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
local sizeRate = obj.getVar("custom").get_vector(0);
|
||
|
|
sizeRate = sizeRate.tofloat() / 100.0;
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
pAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
|
|
pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
|
||
|
|
sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER://傑克降臨
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
case 2:
|
||
|
|
switch(state){
|
||
|
|
case 20:
|
||
|
|
local aniPath = "passiveobject/elementalmaster_bykk/animation/halloweenbuster/halloweenbustera_meteor_base01.ani";
|
||
|
|
if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalpotential/halloweenbuster/ep_halloweenbustera_meteor_base01.ani";
|
||
|
|
local ani = sq_CreateAnimation("",aniPath);
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
if(subtype == 2){
|
||
|
|
sq_CreateParticle("passiveobject/elementalmaster_bykk/particle/elementalpotentialhalloweenbursterexp.ptl", obj, 0, 0, 0, true, 30, 0, 1);
|
||
|
|
sq_CreateParticle("passiveobject/elementalmaster_bykk/particle/elementalpotentialhalloweenbursterexpsmoke.ptl", obj, 0, 0, 0, true, 10, 0, 1);
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case 21:
|
||
|
|
obj.sq_RemoveMoveParticle();
|
||
|
|
obj.stopTimeEvent(0);
|
||
|
|
obj.stopTimeEvent(1);
|
||
|
|
local aniPath = "passiveobject/elementalmaster_bykk/animation/halloweenbuster/halloweenbuster_explosion_04.ani";
|
||
|
|
if(subtype == 2) aniPath = "passiveobject/elementalmaster_bykk/animation/elementalpotential/halloweenbuster/ep_halloweenbuster_explosion_04.ani";
|
||
|
|
local ani = sq_CreateAnimation("",aniPath);
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local totalDamage = obj.getVar("custom").get_vector(2);
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 19));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
if(subtype == 2){
|
||
|
|
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK);
|
||
|
|
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/character/mage/animation/elementalpotential/halloweenbuster/ep_halloweenbuster_particle01.ani",0,0,0);
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
local sizeRate = obj.getVar("custom").get_vector(0);
|
||
|
|
if(state == 21) sizeRate = obj.getVar("custom").get_vector(1);
|
||
|
|
sizeRate = sizeRate.tofloat() / 1000.0;
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
pAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
|
|
pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
|
||
|
|
sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_MIGHTYRUNE://聖靈符文
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_SESTOELEMENTO://第六元素
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_SUNBURST://雷旋
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_THEGATE://元素之門
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
local aniPath1 = "passiveobject/elementalmaster_bykk/animation/thegate/";
|
||
|
|
local aniPath2 = "light";
|
||
|
|
switch(obj.getVar("custom").get_vector(3)){
|
||
|
|
case 2: aniPath2 = "ice"; break;
|
||
|
|
case 3: aniPath2 = "fire"; break;
|
||
|
|
case 4: aniPath2 = "dark"; break;
|
||
|
|
}
|
||
|
|
switch(state){
|
||
|
|
case 20:
|
||
|
|
local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/start/" + aniPath2 + "_magic.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local currentAni = obj.getCurrentAnimation();
|
||
|
|
currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath1 + aniPath2 + "/start/" + aniPath2 + "_aura.ani"),true);
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
pAni.setSpeedRate(200.0);
|
||
|
|
break;
|
||
|
|
case 21:
|
||
|
|
local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/loop/" + aniPath2 + "_magic.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local currentAni = obj.getCurrentAnimation();
|
||
|
|
currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath1 + aniPath2 + "/loop/" + aniPath2 + "_aura.ani"),true);
|
||
|
|
local create_time = obj.getVar("custom").get_vector(2);
|
||
|
|
obj.setTimeEvent(1,create_time,-1,true);
|
||
|
|
break;
|
||
|
|
case 22:
|
||
|
|
obj.stopTimeEvent(1);
|
||
|
|
local ani = sq_CreateAnimation("",aniPath1 + aniPath2 + "/end/" + aniPath2 + "_magic.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local currentAni = obj.getCurrentAnimation();
|
||
|
|
currentAni.addLayerAnimation(0,sq_CreateAnimation("",aniPath1 + aniPath2 + "/end/" + aniPath2 + "_aura.ani"),true);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_THUNDERCALLING://天雷
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_THUNDERRAGE://光與暗的交響
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_VOID://虛無之球
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
switch(state){
|
||
|
|
case 20:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/void/void1_start.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
break;
|
||
|
|
case 21:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/void/void1_loop.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
break;
|
||
|
|
case 22:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/void/void1_end.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
local sizeRate = obj.getVar("custom").get_vector(2);
|
||
|
|
sizeRate = sizeRate.tofloat() / 100.0;
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
pAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
|
|
pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
|
||
|
|
sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate);
|
||
|
|
break;
|
||
|
|
case 2:
|
||
|
|
switch(state){
|
||
|
|
case 20:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/void/lv95assimilate/start_00.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/void/lv95assimilate/start_06.ani",0,0,0);
|
||
|
|
sq_AddDrawOnlyAniFromParent(obj,"passiveobject/elementalmaster_bykk/animation/void/lv95assimilate/start_07.ani",0,0,0);
|
||
|
|
break;
|
||
|
|
case 21:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/void/lv95assimilate/loop_00.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local timeMax = obj.getVar("custom").get_vector(1);
|
||
|
|
print("timemax = "+timeMax);
|
||
|
|
obj.setTimeEvent(1, timeMax, 1, false);
|
||
|
|
break;
|
||
|
|
case 22:
|
||
|
|
obj.stopTimeEvent(0);
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/void/lv95assimilate/end_04.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local totalDamage = obj.getVar("custom").get_vector(2);
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 33));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
local sizeRate = obj.getVar("custom").get_vector(3);
|
||
|
|
sizeRate = sizeRate.tofloat() / 230.0;
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
pAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
|
|
pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
|
||
|
|
sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_WALLOFICE://冰牆
|
||
|
|
break;
|
||
|
|
case 38://移動施法
|
||
|
|
local aniPath1 = "character/mage/effect/animation/magic";
|
||
|
|
local sub = obj.getVar("custom").get_vector(0);
|
||
|
|
if(sub == 4){
|
||
|
|
switch(state){
|
||
|
|
case 20:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/magiconcharge2_1.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local currentAni = obj.getCurrentAnimation();
|
||
|
|
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/magiconcharge2_2.ani"),true);
|
||
|
|
break;
|
||
|
|
case 21:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/magicfullcharge2_1.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local currentAni = obj.getCurrentAnimation();
|
||
|
|
currentAni.addLayerAnimation(-1,sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/magicfullcharge22_1.ani"),true);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
switch(state){
|
||
|
|
case 20:
|
||
|
|
local ani = sq_CreateAnimation("",aniPath1 + "oncharge" + sub.tostring() + "1.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local currentAni = obj.getCurrentAnimation();
|
||
|
|
currentAni.addLayerAnimation(-1,sq_CreateAnimation("",aniPath1 + "oncharge" + sub.tostring() + "2.ani"),true);
|
||
|
|
break;
|
||
|
|
case 21:
|
||
|
|
local ani = sq_CreateAnimation("",aniPath1 + "fullcharge" + sub + "1.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local currentAni = obj.getCurrentAnimation();
|
||
|
|
currentAni.addLayerAnimation(-1,sq_CreateAnimation("",aniPath1 + "oncharge" + sub.tostring() + "2.ani"),true);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
|
||
|
|
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
|
|
if(attackInfo){
|
||
|
|
local element_kk_fire = sqrChr.getVar("element_kk").getInt(0);
|
||
|
|
local element_kk_water = sqrChr.getVar("element_kk").getInt(1);
|
||
|
|
local element_kk_dark = sqrChr.getVar("element_kk").getInt(2);
|
||
|
|
local element_kk_light = sqrChr.getVar("element_kk").getInt(3);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE) && element_kk_fire > 0) attackInfo.setElement(ENUM_ELEMENT_FIRE);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER) && element_kk_water > 0) attackInfo.setElement(ENUM_ELEMENT_WATER);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK) && element_kk_dark > 0) attackInfo.setElement(ENUM_ELEMENT_DARK);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT) && element_kk_light > 0) attackInfo.setElement(ENUM_ELEMENT_LIGHT);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function onEndCurrentAni_po_elementalmaster_bykk_kak(obj)
|
||
|
|
{
|
||
|
|
if(!obj) return;
|
||
|
|
local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter());
|
||
|
|
local skillIndex = obj.getVar("skillIndex").get_vector(0);
|
||
|
|
local subtype = obj.getVar("subtype").get_vector(0);
|
||
|
|
local state = obj.getVar("state").get_vector(0);
|
||
|
|
|
||
|
|
switch(skillIndex){
|
||
|
|
case ELEMENTALMASTER_SKILL_ARCTICPISTE://極冰綻放
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
case 2:
|
||
|
|
switch(state){
|
||
|
|
case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break;
|
||
|
|
case 22: sq_SendDestroyPacketPassiveObject(obj); break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case 3:
|
||
|
|
case 4:
|
||
|
|
sq_SendDestroyPacketPassiveObject(obj);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_BLACKHOLE://黑洞
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
case 2:
|
||
|
|
switch(state){
|
||
|
|
case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break;
|
||
|
|
case 22: sq_SendDestroyPacketPassiveObject(obj); break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND://聖靈水晶
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
switch(state){
|
||
|
|
case 20:
|
||
|
|
case 21:
|
||
|
|
case 22:
|
||
|
|
case 23:
|
||
|
|
obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
case 24:
|
||
|
|
sq_SendDestroyPacketPassiveObject(obj);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case 2:
|
||
|
|
case 3:
|
||
|
|
case 4:
|
||
|
|
switch(state){
|
||
|
|
case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break;
|
||
|
|
case 22: sq_SendDestroyPacketPassiveObject(obj); break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN://元素點燃
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
case 2:
|
||
|
|
case 3:
|
||
|
|
case 4:
|
||
|
|
switch(state){
|
||
|
|
case 20:
|
||
|
|
case 22:
|
||
|
|
obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
case 23:
|
||
|
|
case 25:
|
||
|
|
case 28:
|
||
|
|
obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
case 27:
|
||
|
|
obj.addSetStatePacket(24, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case 15:
|
||
|
|
if(state == 20) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
case 150:
|
||
|
|
sq_SendDestroyPacketPassiveObject(obj);
|
||
|
|
break;
|
||
|
|
case 16:
|
||
|
|
if(state == 21) obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
else if(state == 22 || state == 23) sq_SendDestroyPacketPassiveObject(obj);
|
||
|
|
break;
|
||
|
|
case 18:
|
||
|
|
switch(state){
|
||
|
|
case 20:
|
||
|
|
case 21:
|
||
|
|
case 22:
|
||
|
|
case 23:
|
||
|
|
obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
case 24: sq_SendDestroyPacketPassiveObject(obj); break
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN://元素之幕
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL://元素奧義
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE://元素震蕩
|
||
|
|
switch(subtype){
|
||
|
|
case 1: sq_SendDestroyPacketPassiveObject(obj); break;
|
||
|
|
case 2: sq_SendDestroyPacketPassiveObject(obj); break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER://隕星幻滅
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
switch(state){
|
||
|
|
case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break;
|
||
|
|
case 21: sq_SendDestroyPacketPassiveObject(obj); break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_FLAMESTRIKE://烈焰沖擊
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
case 3:
|
||
|
|
if(state == 20) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
else sq_SendDestroyPacketPassiveObject(obj);
|
||
|
|
break;
|
||
|
|
case 2:
|
||
|
|
sq_SendDestroyPacketPassiveObject(obj);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER://傑克降臨
|
||
|
|
if(subtype == 0 || state == 21) sq_SendDestroyPacketPassiveObject(obj);
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_MIGHTYRUNE://聖靈符文
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_SESTOELEMENTO://第六元素
|
||
|
|
sq_SendDestroyPacketPassiveObject(obj);
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_SUNBURST://雷旋
|
||
|
|
sq_SendDestroyPacketPassiveObject(obj);
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_THEGATE://元素之門
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
switch(state){
|
||
|
|
case 20: obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break;
|
||
|
|
case 22: sq_SendDestroyPacketPassiveObject(obj); break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case 2: sq_SendDestroyPacketPassiveObject(obj); break;
|
||
|
|
case 10: sq_SendDestroyPacketPassiveObject(obj); break;
|
||
|
|
case 11: sq_SendDestroyPacketPassiveObject(obj); break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_THUNDERCALLING://天雷
|
||
|
|
sq_SendDestroyPacketPassiveObject(obj);
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_THUNDERRAGE://光與暗的交響
|
||
|
|
sq_SendDestroyPacketPassiveObject(obj);
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_VOID://虛無之球
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
case 2:
|
||
|
|
switch(state){
|
||
|
|
case 20:
|
||
|
|
if(obj.getVar("custom").get_vector(4) > 0) obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
else obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
case 22: sq_SendDestroyPacketPassiveObject(obj); break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_WALLOFICE://冰牆
|
||
|
|
break;
|
||
|
|
case 38://移動施法
|
||
|
|
if(state == 21) sq_SendDestroyPacketPassiveObject(obj);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
function onTimeEvent_po_elementalmaster_bykk_kak(obj, timeEventIndex, timeEventCount)
|
||
|
|
{
|
||
|
|
if(!obj) return;
|
||
|
|
local sqrChr = sq_GetCNRDObjectToSQRCharacter(obj.getTopCharacter());
|
||
|
|
local skillIndex = obj.getVar("skillIndex").get_vector(0);
|
||
|
|
local subtype = obj.getVar("subtype").get_vector(0);
|
||
|
|
local state = obj.getVar("state").get_vector(0);
|
||
|
|
|
||
|
|
switch(skillIndex){
|
||
|
|
case ELEMENTALMASTER_SKILL_ARCTICPISTE://極冰綻放
|
||
|
|
switch(timeEventIndex){
|
||
|
|
case 1:
|
||
|
|
if(timeEventCount >= obj.getVar("custom").get_vector(1)){
|
||
|
|
obj.stopTimeEvent(1);
|
||
|
|
obj.stopTimeEvent(2);
|
||
|
|
obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
obj.resetHitObjectList();
|
||
|
|
obj.sq_PlaySound("ARCTICF_MCIRCLE");
|
||
|
|
break;
|
||
|
|
case 2:
|
||
|
|
local aniPath = ["passiveobject/elementalmaster_bykk/animation/icefield/icefieldnormal1.ani","passiveobject/elementalmaster_bykk/animation/icefield/icefieldnormal2.ani"];
|
||
|
|
if(subtype == 2) aniPath = ["passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/icearea_att_3.ani","passiveobject/elementalmaster_bykk/animation/elementalpotential/icearea/icearea_att2_3.ani"];
|
||
|
|
local sizeRate = obj.getVar("custom").get_vector(0);
|
||
|
|
local sizeRate_balance = 120;
|
||
|
|
local randomnumber = sq_getRandom(1,100);
|
||
|
|
if(randomnumber > 75) sq_AddDrawOnlyAniFromParent(obj,aniPath[sq_getRandom(0,1)],sq_getRandom(-113,113)*sizeRate/sizeRate_balance,sq_getRandom(-71,71)*sizeRate/sizeRate_balance,0);
|
||
|
|
else if(randomnumber <= 75 && randomnumber > 50) sq_AddDrawOnlyAniFromParent(obj,aniPath[sq_getRandom(0,1)],sq_getRandom(-250,250)*sizeRate/sizeRate_balance,sq_getRandom(-20,20)*sizeRate/sizeRate_balance,0);
|
||
|
|
else if(randomnumber <= 50 && randomnumber > 25) sq_AddDrawOnlyAniFromParent(obj,aniPath[sq_getRandom(0,1)],sq_getRandom(-172,172)*sizeRate/sizeRate_balance,sq_getRandom(-30,30)*sizeRate/sizeRate_balance,0);
|
||
|
|
else sq_AddDrawOnlyAniFromParent(obj,aniPath[sq_getRandom(0,1)],sq_getRandom(-217,217)*sizeRate/sizeRate_balance,sq_getRandom(-43,43)*sizeRate/sizeRate_balance,0);
|
||
|
|
obj.sq_PlaySound("ARCTICF_ICE_OUT");
|
||
|
|
break;
|
||
|
|
case 3:
|
||
|
|
local pooledObj = createOnlyDrawObject_elementalmaster_bykk(obj,"passiveobject/elementalmaster_bykk/animation/flamestrike/lv95assimilate/flamestrikebottoma_00.ani",true,obj.getDirection(),sq_GetXPos(obj),sq_GetYPos(obj),sq_GetZPos(obj),ENUM_DRAWLAYER_BOTTOM);
|
||
|
|
local sizeRate = obj.getVar("custom").get_vector(0);
|
||
|
|
sizeRate = sizeRate.tofloat() / 100.0;
|
||
|
|
local pAni = pooledObj.getCurrentAnimation();
|
||
|
|
pAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
|
|
pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_BLACKHOLE://黑洞
|
||
|
|
switch(timeEventIndex){
|
||
|
|
case 0:
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
case 2:
|
||
|
|
obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
case 3: sq_SendDestroyPacketPassiveObject(obj); break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case 1: obj.resetHitObjectList(); break;
|
||
|
|
case 2:
|
||
|
|
local sub = obj.getVar("custom").get_vector(6);
|
||
|
|
if(sub > 0){
|
||
|
|
local sizeRate = obj.getVar("custom").get_vector(0) / 2;
|
||
|
|
local attractPower = obj.getVar("custom").get_vector(1) * 150 / 100;
|
||
|
|
local range = obj.getVar("custom").get_vector(2);
|
||
|
|
local totalDamage2 = obj.getVar("custom").get_vector(3) * 25 / 100;
|
||
|
|
local lifeTime = obj.getVar("custom").get_vector(4) / 2;
|
||
|
|
local totalDamage = obj.getVar("custom").get_vector(5) * 25 / 100;
|
||
|
|
local hitTime = obj.getVar("custom").get_vector(7);
|
||
|
|
local damageRate = totalDamage2 / totalDamage * 100;
|
||
|
|
cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj),obj.getDirection(),ELEMENTALMASTER_SKILL_BLACKHOLE,subtype,totalDamage,sizeRate,lifeTime,damageRate,attractPower,range,0,hitTime,0,0);
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case 3:
|
||
|
|
obj.stopSound(20);
|
||
|
|
obj.sq_PlaySound("NIGHTH_LOOP",20);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_CRYSTALOFOVERMIND://聖靈水晶
|
||
|
|
switch(timeEventIndex){
|
||
|
|
case 1: obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, ""); break;
|
||
|
|
case 2: obj.addSetStatePacket(state + 1, null, STATE_PRIORITY_AUTO, false, ""); break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_ELEMENTALCHAIN://元素點燃
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
case 2:
|
||
|
|
case 3:
|
||
|
|
case 4:
|
||
|
|
switch(timeEventIndex){
|
||
|
|
case 0:
|
||
|
|
sqrChr.getVar("elementalchain").setBool(0, false);
|
||
|
|
sq_SendDestroyPacketPassiveObject(obj);
|
||
|
|
break;
|
||
|
|
case 1:
|
||
|
|
local addAppendage = CNSquirrelAppendage.sq_GetAppendage(sqrChr,"character/mage/elementalmaster_bykk/ap/ap_elementalchain.nut");
|
||
|
|
if(!addAppendage) return;
|
||
|
|
addAppendage.getVar().setBool(subtype, false);
|
||
|
|
setElementalChainBuff_bykk(sqrChr,ELEMENTALMASTER_SKILL_ELEMENTALCHAIN,addAppendage);
|
||
|
|
if(obj.getVar("custom").get_vector(1) > 0) obj.addSetStatePacket(27, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
else obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case 150:
|
||
|
|
local sizeRate = obj.getVar("custom").get_vector(0);
|
||
|
|
sizeRate = sizeRate.tofloat() / 1000.0;
|
||
|
|
switch(timeEventIndex){
|
||
|
|
case 1:
|
||
|
|
local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/common/animation/fireexplosionparticle1.ani", sq_getRandom(-10,10), sq_getRandom(-10,10), sq_getRandom(-10,10));
|
||
|
|
local currentAni = pooledObj.getCurrentAnimation();
|
||
|
|
currentAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
|
|
break;
|
||
|
|
case 2:
|
||
|
|
local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/common/animation/fireexplosionparticle2.ani", 0, 2, 0);
|
||
|
|
local currentAni = pooledObj.getCurrentAnimation();
|
||
|
|
currentAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
|
|
break;
|
||
|
|
case 3:
|
||
|
|
local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/common/animation/fireexplosionparticle3.ani", 0, 1, 1);
|
||
|
|
local currentAni = pooledObj.getCurrentAnimation();
|
||
|
|
local angle = sq_ToRadian(360.0 * timeEventCount / 16);
|
||
|
|
sq_SetfRotateAngle(currentAni, angle);
|
||
|
|
currentAni.setImageRateFromOriginal(sizeRate * 2.0, sizeRate * 2.0);
|
||
|
|
break;
|
||
|
|
case 4:
|
||
|
|
local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"passiveobject/common/animation/fireexplosionparticle4.ani", sq_getRandom(-30,30), sq_getRandom(-30,30), sq_getRandom(-30,30));
|
||
|
|
local currentAni = pooledObj.getCurrentAnimation();
|
||
|
|
currentAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case 16:
|
||
|
|
switch(timeEventIndex){
|
||
|
|
case 0: obj.addSetStatePacket(23, null, STATE_PRIORITY_AUTO, false, ""); break;
|
||
|
|
case 1: obj.addSetStatePacket(20, null, STATE_PRIORITY_AUTO, false, ""); break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case 17:
|
||
|
|
sq_SendDestroyPacketPassiveObject(obj);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN://元素之幕
|
||
|
|
switch(timeEventIndex){
|
||
|
|
case 0:
|
||
|
|
local hitMax = obj.getVar("custom").get_vector(2);
|
||
|
|
if(timeEventCount >= hitMax - 2 && obj.getVar().getBool(0) == false){
|
||
|
|
obj.getVar().setBool(0,true);
|
||
|
|
local totalDamage = obj.getVar("custom").get_vector(1);
|
||
|
|
local sizeRate = obj.getVar("custom").get_vector(0);
|
||
|
|
cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj),obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALCURTAIN,4,totalDamage,sizeRate,0,0,0,0,0,0,0,0);
|
||
|
|
}
|
||
|
|
if(timeEventCount >= hitMax){obj.stopTimeEvent(0);return;}
|
||
|
|
obj.resetHitObjectList();
|
||
|
|
break;
|
||
|
|
case 1:
|
||
|
|
if(subtype == 1 && obj.getVar("custom").get_vector(4) > 0){
|
||
|
|
local size = obj.getVar("targetObj").get_obj_vector_size();
|
||
|
|
if(size > 0){
|
||
|
|
for(local i = 0; i < size; i++){
|
||
|
|
local targetObj = obj.getVar("targetObj").get_obj_vector(i);
|
||
|
|
if(targetObj){
|
||
|
|
local activeObj = sq_GetCNRDObjectToActiveObject(targetObj);
|
||
|
|
if(activeObj.getVar("elementalcurtain").getBool(0) == true) activeObj.getVar("elementalcurtain").setBool(0, false);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if(subtype == 1){
|
||
|
|
local size = obj.getVar("target").get_obj_vector_size();
|
||
|
|
if(size > 0){
|
||
|
|
for(local i = 0; i < size; i++){
|
||
|
|
local targetObj = obj.getVar("target").get_obj_vector(i);
|
||
|
|
if(targetObj) CNSquirrelAppendage.sq_RemoveAppendage(targetObj, "character/mage/elementalmaster_bykk/ap/ap_elementalcurtain.nut");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
sq_SendDestroyPacketPassiveObject(obj);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_ELEMENTALPOTENTIAL://元素奧義
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_ELEMENTALQUAKE://元素震蕩
|
||
|
|
switch(timeEventIndex){
|
||
|
|
case 1:
|
||
|
|
local ani = sq_CreateAnimation("","passiveobject/elementalmaster_bykk/animation/elementalquake/quakebottom_crack.ani");
|
||
|
|
obj.setCurrentAnimation(ani);
|
||
|
|
local totalDamage = obj.getVar("custom").get_vector(0);
|
||
|
|
sq_SetCurrentAttackInfo(obj, sq_GetCustomAttackInfo(obj, 12));
|
||
|
|
sq_SetCurrentAttackBonusRate(sq_GetCurrentAttackInfo(obj), totalDamage);
|
||
|
|
local attackInfo = sq_GetCurrentAttackInfo(obj);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_WATER)) attackInfo.setElement(ENUM_ELEMENT_WATER);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_FIRE)) attackInfo.setElement(ENUM_ELEMENT_FIRE);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_LIGHT)) attackInfo.setElement(ENUM_ELEMENT_LIGHT);
|
||
|
|
if(!attackInfo.isValidElement(ENUM_ELEMENT_DARK)) attackInfo.setElement(ENUM_ELEMENT_DARK);
|
||
|
|
local sizeRate = obj.getVar("custom").get_vector(2);
|
||
|
|
sizeRate = sizeRate.tofloat() / 100.0;
|
||
|
|
local pAni = obj.getCurrentAnimation();
|
||
|
|
pAni.setImageRateFromOriginal(sizeRate, sizeRate);
|
||
|
|
pAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);
|
||
|
|
sq_SetAttackBoundingBoxSizeRate(pAni, sizeRate, sizeRate, sizeRate);
|
||
|
|
sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM);
|
||
|
|
break;
|
||
|
|
case 2:
|
||
|
|
local totalDamage = obj.getVar("custom").get_vector(0) * 10 / 100;
|
||
|
|
local sizeRate = obj.getVar("custom").get_vector(2);
|
||
|
|
cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj),obj.getDirection(),ELEMENTALMASTER_SKILL_ELEMENTALQUAKE,2,totalDamage,sizeRate,0,0,0,0,0,0,0,0);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_ELEMENTALSHOWER://隕星幻滅
|
||
|
|
switch(timeEventIndex){
|
||
|
|
case 1:
|
||
|
|
local baseZ = obj.getVar("custom").getInt(12);
|
||
|
|
local MoveZ = sq_GetUniformVelocity(baseZ, 0, timeEventCount, 13);
|
||
|
|
sq_setCurrentAxisPos(obj, 2, MoveZ);
|
||
|
|
if(timeEventCount >= 13){
|
||
|
|
sq_SetMyShake(obj, 20, 200);
|
||
|
|
local randomnumber = obj.getVar("custom").getInt(11);
|
||
|
|
switch(randomnumber){
|
||
|
|
case 1: obj.sq_PlaySound("DARK_CHASER"); break;
|
||
|
|
case 1: obj.sq_PlaySound("FIRE_CHASER"); break;
|
||
|
|
case 1: obj.sq_PlaySound("LIGHT_CHASER"); break;
|
||
|
|
case 1: obj.sq_PlaySound("WATER_CHASER"); break;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_FLAMESTRIKE://烈焰沖擊
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_HALLOWEENBUSTER://傑克降臨
|
||
|
|
switch(timeEventIndex){
|
||
|
|
case 0: obj.resetHitObjectList(); break;
|
||
|
|
case 1: if(sq_GetZPos(obj) <= 0) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, ""); break;
|
||
|
|
case 2:
|
||
|
|
local sizeRate = obj.getVar("custom").get_vector(0);
|
||
|
|
local sizeRate2 = obj.getVar("custom").get_vector(1);
|
||
|
|
local damageRate = obj.getVar("custom").get_vector(2);
|
||
|
|
local totalDamage = obj.getVar("custom").get_vector(3);
|
||
|
|
local sub = obj.getVar("custom").get_vector(4);
|
||
|
|
local typesub = obj.getVar("custom").get_vector(5);
|
||
|
|
cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,-500,0,sq_GetZPos(obj) + 400,obj.getDirection(),ELEMENTALMASTER_SKILL_HALLOWEENBUSTER,typesub,totalDamage,sizeRate,sizeRate2,damageRate,sub,0,0,0,0,0);
|
||
|
|
break;
|
||
|
|
case 3: sq_SendDestroyPacketPassiveObject(obj); break;
|
||
|
|
case 4: obj.setTimeEvent(2,200,obj.getVar("custom").get_vector(6),true); break;
|
||
|
|
case 5:
|
||
|
|
local x = sq_GetUniformVelocity(0, 500, timeEventCount, 40);
|
||
|
|
local moveX = sq_GetDistancePos(obj.getVar("move").getInt(10), obj.getDirection(), x);
|
||
|
|
local moveZ = sq_GetUniformVelocity(obj.getVar("move").getInt(11), 0, timeEventCount, 40);
|
||
|
|
sq_setCurrentAxisPos(obj, 0, moveX);
|
||
|
|
sq_setCurrentAxisPos(obj, 2, moveZ);
|
||
|
|
if(timeEventCount >= 40) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_MIGHTYRUNE://聖靈符文
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_SESTOELEMENTO://第六元素
|
||
|
|
if(timeEventIndex == 1) obj.resetHitObjectList();
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_SUNBURST://雷旋
|
||
|
|
switch(timeEventIndex){
|
||
|
|
case 1:
|
||
|
|
sqrChr.sq_IntVectClear();
|
||
|
|
sqrChr.sq_IntVectPush(21);
|
||
|
|
sqrChr.sq_IntVectPush(31);
|
||
|
|
sqrChr.sq_IntVectPush(3);
|
||
|
|
sqrChr.sq_AddSetStatePacket(ELEMENTALMASTER_STATE_ELEMENTALCHAIN, STATE_PRIORITY_IGNORE_FORCE, true);
|
||
|
|
sq_SendDestroyPacketPassiveObject(obj);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_THEGATE://元素之門
|
||
|
|
switch(timeEventIndex){
|
||
|
|
case 1:
|
||
|
|
local create_number = obj.getVar("custom").get_vector(1);
|
||
|
|
local totalDamage = obj.getVar("custom").get_vector(0);
|
||
|
|
local sub = obj.getVar("custom").get_vector(3);
|
||
|
|
cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj) - 20,obj.getDirection(),ELEMENTALMASTER_SKILL_THEGATE,2,totalDamage,sub,0,0,0,0,0,0,0,0);
|
||
|
|
if(timeEventCount >= create_number){
|
||
|
|
obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case 2:
|
||
|
|
local targetObj = obj.getVar("tar").get_obj_vector(0);
|
||
|
|
if(targetObj) sq_SendHitObjectPacket(obj,targetObj,0,0,33);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_THUNDERCALLING://天雷
|
||
|
|
switch(timeEventIndex){
|
||
|
|
case 0: break;
|
||
|
|
case 1: sq_SetMyShake(obj,2,100); break;
|
||
|
|
case 2:
|
||
|
|
local totalDamage = obj.getVar("custom").get_vector(0);
|
||
|
|
local sizeRate = obj.getVar("custom").get_vector(1);
|
||
|
|
local range = obj.getVar("custom").get_vector(3);
|
||
|
|
local sub = obj.getVar("custom").get_vector(4);
|
||
|
|
local prob = obj.getVar("custom").get_vector(6);
|
||
|
|
local level = obj.getVar("custom").get_vector(7);
|
||
|
|
local time = obj.getVar("custom").get_vector(8);
|
||
|
|
cearteSkillPassive_Elementalmaster_bykk(sqrChr,obj,PASSIVEOBJECT_BYKK_ELEMENTALMASTER,0,0,sq_GetZPos(obj),obj.getDirection(),ELEMENTALMASTER_SKILL_THUNDERCALLING,sub,totalDamage,sizeRate,range,prob,level,time,0,0,0,0);
|
||
|
|
if(obj.getVar().getBool(0) == false && sub == 2){
|
||
|
|
if(range <= 0) return;
|
||
|
|
monsterpulled_elementalmaster_bykk(sqrChr,obj,0,0,0,200,range);
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case 3: sq_SendDestroyPacketPassiveObject(obj); break;
|
||
|
|
case 4:
|
||
|
|
local hitTime = obj.getVar("custom").get_vector(5);
|
||
|
|
local countMax = obj.getVar("custom").get_vector(2);
|
||
|
|
obj.setTimeEvent(2,hitTime,countMax,true);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_THUNDERRAGE://光與暗的交響
|
||
|
|
if(timeEventIndex == 1) obj.resetHitObjectList();
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_VOID://虛無之球
|
||
|
|
switch(subtype){
|
||
|
|
case 1:
|
||
|
|
switch(timeEventIndex){
|
||
|
|
case 0: obj.resetHitObjectList(); break;
|
||
|
|
case 1:
|
||
|
|
local shoot_range = obj.getVar("custom").get_vector(0);
|
||
|
|
local baseX = obj.getVar("custom").get_vector(1);
|
||
|
|
if(sq_Abs(sq_GetXPos(obj) - baseX) > shoot_range){
|
||
|
|
obj.stopTimeEvent(0);
|
||
|
|
sq_SendDestroyPacketPassiveObject(obj);
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case 2:
|
||
|
|
if(timeEventIndex == 0) obj.resetHitObjectList();
|
||
|
|
else if(timeEventIndex == 1) obj.addSetStatePacket(22, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
break;
|
||
|
|
case ELEMENTALMASTER_SKILL_WALLOFICE://冰牆
|
||
|
|
break;
|
||
|
|
case 38://移動施法
|
||
|
|
if(timeEventIndex == 0) obj.addSetStatePacket(21, null, STATE_PRIORITY_AUTO, false, "");
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|