111
This commit is contained in:
BIN
character/creatormage/ap_creatormage_disturb.nut
Normal file
BIN
character/creatormage/ap_creatormage_disturb.nut
Normal file
Binary file not shown.
112
character/creatormage/ap_creatormage_flame.nut
Normal file
112
character/creatormage/ap_creatormage_flame.nut
Normal file
@@ -0,0 +1,112 @@
|
||||
|
||||
|
||||
|
||||
function sq_AddFunctionName(appendage)
|
||||
{
|
||||
appendage.sq_AddFunctionName("proc", "proc_appendage_creator_flame")
|
||||
appendage.sq_AddFunctionName("prepareDraw", "prepareDraw_appendage_creator_flame")
|
||||
appendage.sq_AddFunctionName("onStart", "onStart_appendage_creator_flame")
|
||||
appendage.sq_AddFunctionName("onEnd", "onEnd_appendage_creator_flame")
|
||||
appendage.sq_AddFunctionName("isEnd", "isEnd_appendage_creator_flame")
|
||||
}
|
||||
|
||||
|
||||
function sq_AddEffect(appendage)
|
||||
{
|
||||
}
|
||||
|
||||
function proc_appendage_creator_flame(appendage)
|
||||
{
|
||||
if (!appendage)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
local cnt = appendage.sq_var.get_vector(I_REMAIN_COUNT);
|
||||
local isCharge = appendage.sq_var.get_vector(l_CHARGE_ON); // 醱瞪 酝樯虽 羹觼
|
||||
|
||||
|
||||
// 醱瞪赅萄塭贼..
|
||||
if (isCharge)
|
||||
{
|
||||
|
||||
// 譆渠醱瞪榆击 椭横谛怃 醱瞪击 卫霾栖棻.
|
||||
local time = appendage.getTimer().Get();
|
||||
|
||||
appendage.sq_var.set_vector(I_CURRENT_CHARGE_TIME, time);
|
||||
|
||||
local maxCnt = appendage.sq_var.get_vector(I_MAX_COUNT);
|
||||
local initRemainCnt = appendage.sq_var.get_vector(I_CHARGE_INIT_COUNT);
|
||||
local maxChargeT = appendage.sq_var.get_vector(I_CHARGE_TIME);
|
||||
local chargeTime = maxChargeT.tofloat() * ((maxCnt.tofloat() - initRemainCnt.tofloat()) / maxCnt.tofloat());
|
||||
|
||||
//print(" flame charge t:" + maxChargeT);
|
||||
|
||||
local currentCnt = sq_GetUniformVelocity(initRemainCnt, maxCnt, time, chargeTime.tointeger());
|
||||
appendage.sq_var.set_vector(I_REMAIN_COUNT, currentCnt);
|
||||
|
||||
// 棻 瓣锡棻贼 醱瞪赅萄 ?薯
|
||||
if (currentCnt >= maxCnt)
|
||||
{
|
||||
appendage.sq_var.set_vector(l_CHARGE_ON, 0);
|
||||
appendage.sq_var.set_vector(I_CHARGE_INIT_COUNT, 0);
|
||||
appendage.sq_var.set_vector(I_CURRENT_CHARGE_TIME, 0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function onStart_appendage_creator_flame(appendage)
|
||||
{
|
||||
if(!appendage) {
|
||||
return;
|
||||
}
|
||||
|
||||
local obj = appendage.getParent();
|
||||
|
||||
local sq_var = appendage.sq_var;
|
||||
sq_var.clear_timer_vector();
|
||||
sq_var.push_timer_vector();
|
||||
|
||||
local t = sq_var.get_timer_vector(0);
|
||||
|
||||
if (t)
|
||||
{
|
||||
local eventTerm = 10;
|
||||
t.setParameter(eventTerm, -1);
|
||||
t.resetInstant(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function prepareDraw_appendage_creator_flame(appendage)
|
||||
{
|
||||
if(!appendage) {
|
||||
return;
|
||||
}
|
||||
|
||||
local obj = appendage.getParent();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function onEnd_appendage_creator_flame(appendage)
|
||||
{
|
||||
if(!appendage) {
|
||||
return;
|
||||
}
|
||||
|
||||
local obj = appendage.getParent();
|
||||
}
|
||||
|
||||
|
||||
function isEnd_appendage_creator_flame(appendage)
|
||||
{
|
||||
if(!appendage) return false;
|
||||
|
||||
local T = appendage.getTimer().Get();
|
||||
|
||||
return false;
|
||||
}
|
||||
BIN
character/creatormage/ap_creatormage_guardian.nut
Normal file
BIN
character/creatormage/ap_creatormage_guardian.nut
Normal file
Binary file not shown.
BIN
character/creatormage/ap_creatormage_ice.nut
Normal file
BIN
character/creatormage/ap_creatormage_ice.nut
Normal file
Binary file not shown.
BIN
character/creatormage/ap_creatormage_state.nut
Normal file
BIN
character/creatormage/ap_creatormage_state.nut
Normal file
Binary file not shown.
109
character/creatormage/ap_creatormage_wind.nut
Normal file
109
character/creatormage/ap_creatormage_wind.nut
Normal file
@@ -0,0 +1,109 @@
|
||||
|
||||
function sq_AddFunctionName(appendage)
|
||||
{
|
||||
appendage.sq_AddFunctionName("proc", "proc_appendage_creator_wind")
|
||||
appendage.sq_AddFunctionName("prepareDraw", "prepareDraw_appendage_creator_wind")
|
||||
appendage.sq_AddFunctionName("onStart", "onStart_appendage_creator_wind")
|
||||
appendage.sq_AddFunctionName("onEnd", "onEnd_appendage_creator_wind")
|
||||
appendage.sq_AddFunctionName("isEnd", "isEnd_appendage_creator_wind")
|
||||
}
|
||||
|
||||
|
||||
function sq_AddEffect(appendage)
|
||||
{
|
||||
}
|
||||
|
||||
function proc_appendage_creator_wind(appendage)
|
||||
{
|
||||
if(!appendage) {
|
||||
return;
|
||||
}
|
||||
|
||||
local cnt = appendage.sq_var.get_vector(I_REMAIN_COUNT);
|
||||
local isCharge = appendage.sq_var.get_vector(l_CHARGE_ON); // 醱瞪 酝樯虽 羹觼
|
||||
|
||||
// 醱瞪赅萄塭贼..
|
||||
if (isCharge)
|
||||
{
|
||||
// 譆渠醱瞪榆击 椭横谛怃 醱瞪击 卫霾栖棻.
|
||||
local time = appendage.getTimer().Get();
|
||||
|
||||
appendage.sq_var.set_vector(I_CURRENT_CHARGE_TIME, time);
|
||||
|
||||
local maxCnt = appendage.sq_var.get_vector(I_MAX_COUNT);
|
||||
local initRemainCnt = appendage.sq_var.get_vector(I_CHARGE_INIT_COUNT);
|
||||
local maxChargeT = appendage.sq_var.get_vector(I_CHARGE_TIME);
|
||||
local chargeTime = maxChargeT.tofloat() * ((maxCnt.tofloat() - initRemainCnt.tofloat()) / maxCnt.tofloat());
|
||||
|
||||
//print(" wind charge t:" + maxChargeT);
|
||||
|
||||
local currentCnt = sq_GetUniformVelocity(initRemainCnt, maxCnt, time, chargeTime.tointeger());
|
||||
appendage.sq_var.set_vector(I_REMAIN_COUNT, currentCnt);
|
||||
|
||||
// 棻 瓣锡棻贼 醱瞪赅萄 ?薯
|
||||
if (currentCnt >= maxCnt)
|
||||
{
|
||||
appendage.sq_var.set_vector(l_CHARGE_ON, 0);
|
||||
appendage.sq_var.set_vector(I_CHARGE_INIT_COUNT, 0);
|
||||
appendage.sq_var.set_vector(I_CURRENT_CHARGE_TIME, 0);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function onStart_appendage_creator_wind(appendage)
|
||||
{
|
||||
if(!appendage) {
|
||||
return;
|
||||
}
|
||||
|
||||
local obj = appendage.getParent();
|
||||
|
||||
local sq_var = appendage.sq_var;
|
||||
sq_var.clear_timer_vector();
|
||||
sq_var.push_timer_vector();
|
||||
|
||||
local t = sq_var.get_timer_vector(0);
|
||||
|
||||
if (t)
|
||||
{
|
||||
local eventTerm = 10;
|
||||
t.setParameter(eventTerm, -1);
|
||||
t.resetInstant(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function prepareDraw_appendage_creator_wind(appendage)
|
||||
{
|
||||
if(!appendage) {
|
||||
return;
|
||||
}
|
||||
|
||||
local obj = appendage.getParent();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function onEnd_appendage_creator_wind(appendage)
|
||||
{
|
||||
if(!appendage) {
|
||||
return;
|
||||
}
|
||||
|
||||
local obj = appendage.getParent();
|
||||
}
|
||||
|
||||
|
||||
function isEnd_appendage_creator_wind(appendage)
|
||||
{
|
||||
if(!appendage) return false;
|
||||
|
||||
local T = appendage.getTimer().Get();
|
||||
|
||||
return false;
|
||||
}
|
||||
BIN
character/creatormage/creatordisturb/creatordisturb.nut
Normal file
BIN
character/creatormage/creatordisturb/creatordisturb.nut
Normal file
Binary file not shown.
BIN
character/creatormage/creatorflame/creatorflame.nut
Normal file
BIN
character/creatormage/creatorflame/creatorflame.nut
Normal file
Binary file not shown.
BIN
character/creatormage/creatorguardian/creatorguardian.nut
Normal file
BIN
character/creatormage/creatorguardian/creatorguardian.nut
Normal file
Binary file not shown.
BIN
character/creatormage/creatorice/creatorice.nut
Normal file
BIN
character/creatormage/creatorice/creatorice.nut
Normal file
Binary file not shown.
2015
character/creatormage/creatormage_common.nut
Normal file
2015
character/creatormage/creatormage_common.nut
Normal file
File diff suppressed because it is too large
Load Diff
BIN
character/creatormage/creatormage_header.nut
Normal file
BIN
character/creatormage/creatormage_header.nut
Normal file
Binary file not shown.
BIN
character/creatormage/creatorwind/creatorwind.nut
Normal file
BIN
character/creatormage/creatorwind/creatorwind.nut
Normal file
Binary file not shown.
317
character/creatormage/firehurricane/firehurricane.nut
Normal file
317
character/creatormage/firehurricane/firehurricane.nut
Normal file
@@ -0,0 +1,317 @@
|
||||
|
||||
SUB_STATE_FIREHURRICANE_0 <- 0
|
||||
SUB_STATE_FIREHURRICANE_1 <- 1
|
||||
|
||||
function checkExecutableSkill_FireHurricane(obj)
|
||||
{
|
||||
if (!obj) return false;
|
||||
|
||||
local b_useskill = obj.sq_IsUseSkill(SKILL_FIREHURRICANE);
|
||||
|
||||
if (b_useskill)
|
||||
{
|
||||
print(" checkExecutableSkill_FireHurricane");
|
||||
obj.sq_IntVectClear();
|
||||
obj.sq_IntVectPush(SUB_STATE_FIREHURRICANE_0); // substate撮?
|
||||
obj.sq_AddSetStatePacket(STATE_FIREHURRICANE, STATE_PRIORITY_USER, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
function checkCommandEnable_FireHurricane(obj)
|
||||
{
|
||||
if(!obj) return false;
|
||||
|
||||
local state = obj.sq_GetState();
|
||||
|
||||
local skill_level = obj.sq_GetSkillLevel(SKILL_FIREHURRICANE);
|
||||
if(state == STATE_ATTACK)
|
||||
{
|
||||
return obj.sq_IsCommandEnable(SKILL_FIREHURRICANE); // 念瘫潍缣怃朝 ?姜蝶鉴虏 警蜗桧 陛栋?栖棻. 蒙机濠:姜霞热 [2012.04.20] obj.sq_IsCommandEnable(SKILL_BROKENARROW);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function onSetState_FireHurricane(obj,state,datas,isResetTimer)
|
||||
{
|
||||
if(!obj) return;
|
||||
|
||||
local substate = obj.sq_GetVectorData(datas, 0);
|
||||
obj.setSkillSubState(substate);
|
||||
|
||||
obj.sq_StopMove();
|
||||
|
||||
local posX = obj.getXPos();
|
||||
local posY = obj.getYPos();
|
||||
local posZ = obj.getZPos();
|
||||
|
||||
obj.getVar().clear_vector();
|
||||
obj.getVar().push_vector(0);
|
||||
obj.getVar().push_vector(0);
|
||||
|
||||
print(" onSetState_FireHurricane:" + substate);
|
||||
|
||||
if (substate == SUB_STATE_FIREHURRICANE_0)
|
||||
{
|
||||
//setCreatorSkillStateSkillIndex(obj, -1);
|
||||
|
||||
local skill_level = obj.sq_GetSkillLevel(SKILL_FIREHURRICANE);
|
||||
|
||||
obj.sq_SetCurrentAnimation(CUSTOM_ANI_FIRE_HURRICANE);
|
||||
obj.sq_SetCurrentAttackInfo(CUSTOM_ATTACKINFO_FIRE_HURRICANE);
|
||||
|
||||
//local speedRate = 1.0;
|
||||
//
|
||||
//obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED,
|
||||
//SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, speedRate, speedRate);
|
||||
//
|
||||
obj.getVar("state").clear_ct_vector();
|
||||
|
||||
obj.getVar("state").push_ct_vector();
|
||||
local t = obj.getVar("state").get_ct_vector(0);
|
||||
t.Reset();
|
||||
t.Start(100000,0);
|
||||
|
||||
|
||||
local multiHitTerm = obj.sq_GetIntData(SKILL_FIREHURRICANE, 0); // 0.棻钦?? 除问
|
||||
|
||||
obj.sq_timer_.setParameter(multiHitTerm, -1);
|
||||
obj.sq_timer_.resetInstant(0);
|
||||
|
||||
local skill_level = obj.sq_GetSkillLevel(SKILL_FIREHURRICANE);
|
||||
// 1.虽楼卫除
|
||||
local attackTime = obj.sq_GetLevelData(SKILL_FIREHURRICANE, SKL_LV_1, skill_level);
|
||||
|
||||
local power = obj.sq_GetPowerWithPassive(SKILL_FIREHURRICANE, STATE_FIREHURRICANE, SKL_LV_0, -1,1.0);
|
||||
obj.sq_SetCurrentAttackPower(power);
|
||||
|
||||
|
||||
local ani = sq_GetCurrentAnimation(obj);
|
||||
|
||||
if (ani)
|
||||
{
|
||||
// 2.?葬馨樯 饵桧锷 (%) (100桧 晦狱)
|
||||
local imageRate = sq_GetLevelData(obj, SKILL_FIREHURRICANE, SKL_LV_2, skill_level);
|
||||
print(" imageRate:" + imageRate);
|
||||
ani.setImageRateFromOriginalOnlyChild(imageRate.tofloat() / 100.0, imageRate.tofloat() / 100.0);
|
||||
sq_SetAttackBoundingBoxSizeRate(ani, imageRate.tofloat() / 100.0, imageRate.tofloat() / 100.0, 1.0);
|
||||
}
|
||||
|
||||
|
||||
obj.sq_PlaySound("R_CR_HURRICANE");
|
||||
|
||||
}
|
||||
else if (substate == SUB_STATE_FIREHURRICANE_1)
|
||||
{
|
||||
local ani = sq_GetCurrentAnimation(obj);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function prepareDraw_FireHurricane(obj)
|
||||
{
|
||||
|
||||
if(!obj) return;
|
||||
|
||||
}
|
||||
|
||||
function onEnterFrame_FireHurricane(obj, frameIndex)
|
||||
{
|
||||
if (!obj)
|
||||
return;
|
||||
|
||||
local t = obj.getVar("state").get_ct_vector(0);
|
||||
local time = 0;
|
||||
|
||||
if(t)
|
||||
time = t.Get();
|
||||
|
||||
local ani = sq_GetCurrentAnimation(obj);
|
||||
|
||||
if(!ani)
|
||||
return;
|
||||
|
||||
|
||||
if (frameIndex == 2)
|
||||
{
|
||||
obj.sq_PlaySound("FIREHURRICANE_BURST");
|
||||
}
|
||||
|
||||
local loopStartFrameIndex = 15;
|
||||
local loopEndFrameIndex = loopStartFrameIndex + 3;
|
||||
local endFrameIndex = 24;
|
||||
|
||||
local frmIndex = ani.GetCurrentFrameIndex();
|
||||
|
||||
if (frmIndex > loopEndFrameIndex && frmIndex < endFrameIndex)
|
||||
{
|
||||
local skill_level = obj.sq_GetSkillLevel(SKILL_FIREHURRICANE);
|
||||
local attackTotalTime = obj.sq_GetLevelData(SKILL_FIREHURRICANE, SKL_LV_1, skill_level); // 1.虽楼卫除
|
||||
|
||||
if (time > attackTotalTime)
|
||||
{
|
||||
print(" frmIndex:" + frmIndex + " endFrameIndex:" + endFrameIndex + " Time:" + attackTotalTime);
|
||||
|
||||
if (obj.isMyControlObject())
|
||||
{
|
||||
sq_SendChangeSkillEffectPacket(obj, SKILL_FIREHURRICANE);
|
||||
//ani.setEnd(false);
|
||||
//ani.setCurrentFrameWithChildLayer(endFrameIndex + 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print(" loopStartFrameIndex:" + loopStartFrameIndex);
|
||||
ani.setEnd(false);
|
||||
ani.setCurrentFrameWithChildLayer(loopStartFrameIndex);
|
||||
sq_AnimationProc(ani);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onProc_FireHurricane(obj)
|
||||
{
|
||||
if (!obj) return;
|
||||
|
||||
local t = obj.getVar("state").get_ct_vector(0);
|
||||
local time = 0;
|
||||
|
||||
if(t)
|
||||
time = t.Get();
|
||||
|
||||
if (obj.sq_timer_.isOnEvent(time) == true)
|
||||
{
|
||||
obj.resetHitObjectList();
|
||||
}
|
||||
|
||||
//obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false);
|
||||
|
||||
|
||||
}
|
||||
|
||||
function onProcCon_FireHurricane(obj)
|
||||
{
|
||||
if(!obj) return;
|
||||
|
||||
local substate = obj.getSkillSubState();
|
||||
|
||||
if (substate == SUB_STATE_FIREHURRICANE_0)
|
||||
{
|
||||
if (sq_IsDownKey(obj, 1, true))
|
||||
{
|
||||
print(" Enter jump Command");
|
||||
sq_SendChangeSkillEffectPacket(obj, SKILL_FIREHURRICANE);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function onEndCurrentAni_FireHurricane(obj)
|
||||
{
|
||||
if (!obj.isMyControlObject())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
local substate = obj.getSkillSubState();
|
||||
|
||||
print(" endani");
|
||||
obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false);
|
||||
}
|
||||
|
||||
function onChangeSkillEffect_FireHurricane(obj, skillIndex, reciveData)
|
||||
{
|
||||
if (!obj)
|
||||
return;
|
||||
|
||||
|
||||
local substate = obj.getSkillSubState();
|
||||
|
||||
if (substate == SUB_STATE_FIREHURRICANE_0)
|
||||
{
|
||||
local endFrameIndex = 24;
|
||||
local ani = sq_GetCurrentAnimation(obj);
|
||||
|
||||
if(!ani)
|
||||
return;
|
||||
|
||||
obj.setSkillSubState(SUB_STATE_FIREHURRICANE_1);
|
||||
|
||||
ani.setEnd(false);
|
||||
ani.setCurrentFrameWithChildLayer(endFrameIndex + 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function onKeyFrameFlag_FireHurricane(obj,flagIndex)
|
||||
{
|
||||
|
||||
if(!obj) return false;
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
function onEndState_FireHurricane(obj,new_state)
|
||||
{
|
||||
|
||||
if(!obj) return;
|
||||
|
||||
}
|
||||
|
||||
function onAfterSetState_FireHurricane(obj,state,datas,isResetTimer)
|
||||
{
|
||||
|
||||
if(!obj) return;
|
||||
|
||||
}
|
||||
|
||||
function onBeforeAttack_FireHurricane(obj,damager,boundingBox,isStuck)
|
||||
{
|
||||
|
||||
if(!obj) return;
|
||||
|
||||
}
|
||||
|
||||
function onAttack_FireHurricane(obj,damager,boundingBox,isStuck)
|
||||
{
|
||||
|
||||
if(!obj) return;
|
||||
|
||||
}
|
||||
|
||||
function onAfterAttack_FireHurricane(obj,damager,boundingBox,isStuck)
|
||||
{
|
||||
|
||||
if(!obj) return 0;
|
||||
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
function onBeforeDamage_FireHurricane(obj,attacker,boundingBox,isStuck)
|
||||
{
|
||||
|
||||
if(!obj) return;
|
||||
|
||||
}
|
||||
|
||||
function onDamage_FireHurricane(obj,attacker,boundingBox)
|
||||
{
|
||||
|
||||
if(!obj) return;
|
||||
|
||||
}
|
||||
|
||||
function onAfterDamage_FireHurricane(obj,attacker,boundingBox)
|
||||
{
|
||||
|
||||
if(!obj) return;
|
||||
|
||||
}
|
||||
82
character/creatormage/firemeteo/firemeteo.nut
Normal file
82
character/creatormage/firemeteo/firemeteo.nut
Normal file
@@ -0,0 +1,82 @@
|
||||
|
||||
SUB_STATE_FIREMETEO_0 <- 0
|
||||
|
||||
|
||||
function onMouseButtonDown_FireMeteo(obj)
|
||||
{
|
||||
if (!obj) return;
|
||||
|
||||
local objectManager = obj.getObjectManager();
|
||||
local xPos = objectManager.getFieldXPos(IMouse.GetXPos(), ENUM_DRAWLAYER_NORMAL);
|
||||
local yPos = objectManager.getFieldYPos(IMouse.GetYPos(), 0, ENUM_DRAWLAYER_NORMAL);
|
||||
local zPos = 61;
|
||||
|
||||
if (yPos < TILE_FLOOR_START_Y)
|
||||
{ // 夥款桧 卫蒙?朝 y谢?塭贼..
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
local ptl = sq_GetParticleInfo(obj, "Particle/CreatorFireMeteo.ptl");
|
||||
|
||||
sq_BinaryParameterStartWrite();
|
||||
// ?塭嘐搅陛 伞鼠 号嬴 夥桧伞葬 等桧颤蒂 桧辨?栖棻.
|
||||
// x, y, z == 亿郭?卫粽螃粽薛?陛 轿溘腆 够
|
||||
// wx, wy == 唳坚?卫陛 轿溘腆 够
|
||||
// delay ControlRate 唳坚?卫暧 蝶?萄 亵瞰辨 %高
|
||||
// warningMarkIndex == 唳坚?卫暧 谦盟 : 0 寰尔歜, 1 尔鳝, 2 渠?, 3 尔鳝 (嬴捱Only), 4 渠? (嬴捱Only)
|
||||
local moveVariable1 = 500;
|
||||
local naaMoveVariable1 = -400; // -800
|
||||
local createXDistance = xPos - moveVariable1;
|
||||
local createYDistance = yPos;
|
||||
local createZDistance = -naaMoveVariable1;
|
||||
|
||||
local dir = sq_GetDirection(obj);
|
||||
if (dir == ENUM_DIRECTION_LEFT)
|
||||
{
|
||||
createXDistance = xPos + moveVariable1;
|
||||
}
|
||||
|
||||
sq_BinaryParameterWriteDword(createXDistance);
|
||||
sq_BinaryParameterWriteDword(createYDistance);
|
||||
sq_BinaryParameterWriteDword(createZDistance);
|
||||
|
||||
sq_BinaryParameterWriteDword(xPos);
|
||||
sq_BinaryParameterWriteDword(yPos);
|
||||
|
||||
sq_BinaryParameterWriteDword(ENUM_DIRECTION_NEUTRAL);
|
||||
sq_BinaryParameterWriteDword(200); // int delayControlRate
|
||||
|
||||
local markType = obj.sq_GetIntData(SKILL_FIREMETEO, 0); // 颤啪? 葆觼 谦盟(渗唳?虽 蜓匙!)
|
||||
sq_BinaryParameterWriteDword(markType); //int warningMarkIndex
|
||||
|
||||
|
||||
// 奢问溘 跷陛热纂 蒙机
|
||||
local level = sq_GetSkillLevel(obj, SKILL_CREATORFLAME);
|
||||
|
||||
// 1.奢问溘 跷陛 热纂 (%)
|
||||
local addValue = sq_GetLevelData(obj, SKILL_CREATORFLAME, SKL_LV_1, level);
|
||||
local addRate = addValue.tofloat() / 100.0;
|
||||
|
||||
print(" addRate:" + addRate);
|
||||
|
||||
local skillLevel = sq_GetSkillLevel(obj, SKILL_FIREMETEO);
|
||||
|
||||
local power = obj.sq_GetPowerWithPassive(SKILL_FIREMETEO, STATE_FIREMETEO, SKL_LV_0,-1,addRate.tofloat());
|
||||
local sizeRate = sq_GetLevelData(obj, SKILL_FIREMETEO, SKL_LV_1, skillLevel);
|
||||
|
||||
|
||||
// 诡才螃 奢问溘 ?卫
|
||||
sq_BinaryStartWrite();
|
||||
// 奢问溘 撮?
|
||||
sq_BinaryWriteDword(power);
|
||||
// size rate
|
||||
sq_BinaryWriteDword(sizeRate);
|
||||
|
||||
|
||||
local skill_level = obj.sq_GetSkillLevel(SKILL_FIREMETEO);
|
||||
sq_CreatePassiveObjectAfterWarning(obj, 23501, skill_level, ptl);
|
||||
|
||||
obj.sq_PlaySound("R_METEO_CASTING");
|
||||
}
|
||||
|
||||
68
character/creatormage/firewall/firewall.nut
Normal file
68
character/creatormage/firewall/firewall.nut
Normal file
@@ -0,0 +1,68 @@
|
||||
|
||||
SUB_STATE_FIREWALL_0 <- 0
|
||||
SUB_STATE_FIREWALL_1 <- 1
|
||||
|
||||
|
||||
function onMouseMoveCharacter_Firewall(obj, x, y)
|
||||
{
|
||||
if (!obj)
|
||||
return;
|
||||
|
||||
local objectManager = obj.getObjectManager();
|
||||
|
||||
local x1 = getCreatorBeforePosX(obj);
|
||||
local y1 = getCreatorBeforePosY(obj);
|
||||
local x2 = objectManager.getFieldXPos(x, ENUM_DRAWLAYER_NORMAL);
|
||||
local y2 = objectManager.getFieldYPos(y, 0, ENUM_DRAWLAYER_NORMAL);
|
||||
local zPos = 0;
|
||||
|
||||
|
||||
print(" x2:" + x2 + " y2:" + y2 + " TILE_FLOOR_START_Y:" + TILE_FLOOR_START_Y);
|
||||
|
||||
if (y2 < TILE_FLOOR_START_Y)
|
||||
{ // 夥款桧 卫蒙?朝 y谢?塭贼..
|
||||
return;
|
||||
}
|
||||
|
||||
local appendage = getCreatorMageAppendageByType(obj, CREATOR_TYPE_FLAME);
|
||||
|
||||
if (!appendage)
|
||||
return;
|
||||
|
||||
local dist = getDist2(x1, y1, x2, y2);
|
||||
|
||||
local term = obj.sq_GetIntData(SKILL_FIREWALL, 0); // 当撩 除问
|
||||
|
||||
local time = appendage.getTimer().Get();
|
||||
|
||||
print( " term:" + term + " dist:" + dist + " time:" + time);
|
||||
if (term <= dist || time > 100)
|
||||
{
|
||||
local consumeValue = getCreatorSkillConsumeValue(obj, SKILL_FIREWALL);
|
||||
|
||||
if (useCreatorSkill(obj, SKILL_FIREWALL, x2, y2, consumeValue))
|
||||
{
|
||||
// 奢问溘 跷陛热纂 蒙机
|
||||
local level = sq_GetSkillLevel(obj, SKILL_CREATORFLAME);
|
||||
// 1.奢问溘 跷陛 热纂 (%)
|
||||
local addValue = sq_GetLevelData(obj, SKILL_CREATORFLAME, SKL_LV_1, level);
|
||||
local addRate = addValue.tofloat() / 100.0;
|
||||
|
||||
// 0.奢问溘
|
||||
local power = obj.sq_GetPowerWithPassive(SKILL_FIREWALL, STATE_FIREWALL, SKL_LV_0,-1, addRate.tofloat());
|
||||
|
||||
local skillLevel = sq_GetSkillLevel(obj, SKILL_FIREWALL);
|
||||
// 1.?桧横错 饵桧锷
|
||||
local sizeRate = sq_GetLevelData(obj, SKILL_FIREWALL, SKL_LV_1, skillLevel);
|
||||
|
||||
sq_BinaryStartWrite();
|
||||
sq_BinaryWriteDword(power); // ?
|
||||
sq_BinaryWriteDword(sizeRate); // ?桧横错 饵桧锷
|
||||
|
||||
sq_SendCreatePassiveObjectPacketPos(obj, 23500, 0, x2, y2, zPos);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BIN
character/creatormage/iceplate/iceplate.nut
Normal file
BIN
character/creatormage/iceplate/iceplate.nut
Normal file
Binary file not shown.
41
character/creatormage/icerock/icerock.nut
Normal file
41
character/creatormage/icerock/icerock.nut
Normal file
@@ -0,0 +1,41 @@
|
||||
|
||||
SUB_STATE_ICEROCK_0 <- 0
|
||||
|
||||
|
||||
function onMouseButtonDown_IceRock(obj)
|
||||
{
|
||||
if (!obj) return;
|
||||
|
||||
local objectManager = obj.getObjectManager();
|
||||
local xPos = objectManager.getFieldXPos(IMouse.GetXPos(), ENUM_DRAWLAYER_NORMAL);
|
||||
local yPos = objectManager.getFieldYPos(IMouse.GetYPos(), 0, ENUM_DRAWLAYER_NORMAL) + 20;
|
||||
local zPos = 61;
|
||||
|
||||
|
||||
if (yPos < TILE_FLOOR_START_Y)
|
||||
{ // 夥款桧 卫蒙?朝 y谢?塭贼..
|
||||
return;
|
||||
}
|
||||
|
||||
// 0.奢问溘
|
||||
|
||||
// 奢问溘 跷陛热纂 蒙机
|
||||
local level = sq_GetSkillLevel(obj, SKILL_CREATORICE);
|
||||
|
||||
// 1.奢问溘 跷陛 热纂 (%)
|
||||
local addValue = sq_GetLevelData(obj, SKILL_CREATORICE, SKL_LV_1, level);
|
||||
local addRate = addValue.tofloat() / 100.0;
|
||||
|
||||
local power = obj.sq_GetPowerWithPassive(SKILL_ICEROCK, STATE_ICEROCK, 0,-1,addRate.tofloat());
|
||||
|
||||
// 1. 棻钦?? 除问
|
||||
local multiHitTerm = sq_GetIntData(obj, SKILL_ICEROCK, 1);
|
||||
|
||||
sq_BinaryStartWrite();
|
||||
sq_BinaryWriteDword(power); // ?
|
||||
sq_BinaryWriteDword(multiHitTerm); // 棻钦??
|
||||
sq_SendCreatePassiveObjectPacketPos(obj, 23503, 0, xPos, yPos, zPos);
|
||||
|
||||
obj.sq_PlaySound("ICESTONE_READY");
|
||||
}
|
||||
|
||||
166
character/creatormage/iceshield/iceshield.nut
Normal file
166
character/creatormage/iceshield/iceshield.nut
Normal file
@@ -0,0 +1,166 @@
|
||||
|
||||
SUB_STATE_ICESHIELD_0 <- 0
|
||||
SUB_STATE_ICESHIELD_1 <- 1
|
||||
|
||||
//STATE_ICESHIELD <- 58
|
||||
//SKILL_ICESHIELD <- 135
|
||||
|
||||
|
||||
function checkExecutableSkill_IceShield(obj)
|
||||
{
|
||||
if (!obj) return false;
|
||||
|
||||
local b_useskill = obj.sq_IsUseSkill(SKILL_ICESHIELD);
|
||||
|
||||
if (b_useskill)
|
||||
{
|
||||
obj.sq_IntVectClear();
|
||||
obj.sq_IntVectPush(SUB_STATE_ICESHIELD_0); // substate撮?
|
||||
obj.sq_AddSetStatePacket(STATE_ICESHIELD, STATE_PRIORITY_USER, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function checkCommandEnable_IceShield(obj)
|
||||
{
|
||||
if(!obj) return false;
|
||||
|
||||
local state = obj.sq_GetState();
|
||||
|
||||
local skill_level = obj.sq_GetSkillLevel(SKILL_ICESHIELD);
|
||||
if(state == STATE_ATTACK)
|
||||
{
|
||||
return obj.sq_IsCommandEnable(SKILL_ICESHIELD); // 念瘫潍缣怃朝 ?姜蝶鉴虏 警蜗桧 陛栋?栖棻. 蒙机濠:姜霞热 [2012.04.20] obj.sq_IsCommandEnable(SKILL_BROKENARROW);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function onSetState_IceShield(obj,state,datas,isResetTimer)
|
||||
{
|
||||
if(!obj) return;
|
||||
|
||||
local substate = obj.sq_GetVectorData(datas, 0);
|
||||
obj.setSkillSubState(substate);
|
||||
|
||||
obj.sq_StopMove();
|
||||
|
||||
local posX = obj.getXPos();
|
||||
local posY = obj.getYPos();
|
||||
local posZ = obj.getZPos();
|
||||
|
||||
obj.getVar().clear_vector();
|
||||
obj.getVar().push_vector(0);
|
||||
obj.getVar().push_vector(0);
|
||||
|
||||
|
||||
if (substate == SUB_STATE_ICESHIELD_0)
|
||||
{
|
||||
//setCreatorSkillStateSkillIndex(obj, -1);
|
||||
|
||||
local skill_level = obj.sq_GetSkillLevel(SKILL_ICESHIELD);
|
||||
|
||||
obj.sq_SetCurrentAnimation(CUSTOM_ANI_ICE_SHIELD);
|
||||
|
||||
local speedRate = 1.0;
|
||||
|
||||
obj.sq_SetStaticSpeedInfo(SPEED_TYPE_CAST_SPEED, SPEED_TYPE_CAST_SPEED,
|
||||
SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, speedRate, speedRate);
|
||||
|
||||
obj.getVar("state").clear_ct_vector();
|
||||
|
||||
obj.getVar("state").push_ct_vector();
|
||||
local t = obj.getVar("state").get_ct_vector(0);
|
||||
t.Reset();
|
||||
t.Start(100000,0);
|
||||
|
||||
|
||||
local multiHitTerm = obj.sq_GetIntData(SKILL_ICESHIELD, 0); // 0.棻钦?? 除问
|
||||
|
||||
obj.sq_timer_.setParameter(multiHitTerm, -1);
|
||||
obj.sq_timer_.resetInstant(0);
|
||||
|
||||
local skill_level = obj.sq_GetSkillLevel(SKILL_ICESHIELD);
|
||||
// 0.嵘虽卫除
|
||||
local attackTime = obj.sq_GetLevelData(SKILL_ICESHIELD, SKL_LV_0, skill_level);
|
||||
|
||||
obj.sq_PlaySound("R_CR_ICESHIELD");
|
||||
}
|
||||
else if (substate == SUB_STATE_ICESHIELD_1)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function onProc_IceShield(obj)
|
||||
{
|
||||
|
||||
if(!obj) return;
|
||||
|
||||
}
|
||||
|
||||
function onProcCon_IceShield(obj)
|
||||
{
|
||||
|
||||
if(!obj) return;
|
||||
|
||||
}
|
||||
|
||||
function onEndCurrentAni_IceShield(obj)
|
||||
{
|
||||
|
||||
if(!obj) return;
|
||||
|
||||
if (!obj.isMyControlObject())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
local substate = obj.getSkillSubState();
|
||||
|
||||
//if (substate == SUB_STATE_FIREHURRICANE_0)
|
||||
//{
|
||||
obj.sq_AddSetStatePacket(STATE_STAND, STATE_PRIORITY_USER, false);
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
function onKeyFrameFlag_IceShield(obj,flagIndex)
|
||||
{
|
||||
if(!obj) return false;
|
||||
|
||||
if (flagIndex == 1)
|
||||
{
|
||||
obj.sq_PlaySound("BREAKING_RUSH");
|
||||
if (obj.sq_IsMyControlObject())
|
||||
{
|
||||
local skill_level = obj.sq_GetSkillLevel(SKILL_ICESHIELD);
|
||||
// 0.嵘虽卫除
|
||||
local time = obj.sq_GetLevelData(SKILL_ICESHIELD, SKL_LV_0, skill_level);
|
||||
|
||||
obj.sq_StartWrite();
|
||||
obj.sq_WriteWord(time);
|
||||
obj.sq_SendCreatePassiveObjectPacket(23504, 0, 0, 0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
function onEndState_IceShield(obj,new_state)
|
||||
{
|
||||
|
||||
if(!obj) return;
|
||||
|
||||
}
|
||||
|
||||
function onAfterSetState_IceShield(obj,state,datas,isResetTimer)
|
||||
{
|
||||
|
||||
if(!obj) return;
|
||||
|
||||
}
|
||||
|
||||
574
character/creatormage/mgrab/mgrab.nut
Normal file
574
character/creatormage/mgrab/mgrab.nut
Normal file
@@ -0,0 +1,574 @@
|
||||
|
||||
SUB_STATE_MGRAB_0 <- 0
|
||||
SUB_STATE_MGRAB_1 <- 1
|
||||
|
||||
function setStateMouseGrab(obj)
|
||||
{
|
||||
if (!obj) return;
|
||||
|
||||
local posX = obj.getXPos();
|
||||
local posY = obj.getYPos();
|
||||
local posZ = obj.getZPos();
|
||||
//local grabNum = obj.sq_GetIntData(SKILL_MGRAB, 1); //1. 葆办蝶煎 濩击 热 毡朝 ?热
|
||||
|
||||
//obj.getVar("MouseGrab").clear_vector();
|
||||
//obj.getVar("MouseGrab").push_vector(grabNum);
|
||||
// 觼葬缣桧搅暧 蝶鉴樯策蝶蒂 撮??栖棻.
|
||||
|
||||
//setCreatorSkillStateSkillIndex(obj, SKILL_MGRAB);
|
||||
//setCreatorSkillCount(obj, grabNum);
|
||||
|
||||
releaseOutLine(obj, "grabobj");
|
||||
|
||||
|
||||
obj.getVar("mgrab").clear_vector();
|
||||
obj.getVar("mgrab").push_vector(0);
|
||||
obj.getVar("mgrab").push_vector(0);
|
||||
|
||||
obj.getVar("mgrab").clear_timer_vector();
|
||||
obj.getVar("mgrab").push_timer_vector();
|
||||
|
||||
local t = obj.getVar("mgrab").get_timer_vector(0);
|
||||
t.setParameter(100, -1);
|
||||
t.resetInstant(0);
|
||||
|
||||
obj.getVar("mgrab").clear_ct_vector();
|
||||
obj.getVar("mgrab").push_ct_vector();
|
||||
local timer = obj.getVar("mgrab").get_ct_vector(0);
|
||||
timer.Reset();
|
||||
timer.Start(10000,0);
|
||||
}
|
||||
|
||||
function grabThrowObject(obj)
|
||||
{
|
||||
local hoverEnemyObject = getOverClickableEnemyObject(obj, IMouse.GetXPos(), IMouse.GetYPos());
|
||||
|
||||
if (hoverEnemyObject)
|
||||
{
|
||||
local grabable = sq_IsGrabable(obj, hoverEnemyObject);
|
||||
|
||||
print(" grab:" + grabable + " holdable:" + sq_IsHoldable(obj, hoverEnemyObject));
|
||||
if (sq_IsHoldable(obj, hoverEnemyObject) == true && sq_IsGrabable(obj, hoverEnemyObject) == true)
|
||||
{ // 濩晦陛栋瞳桧塭贼 ?卫?栖棻.
|
||||
|
||||
// 濩擎匙桧 毡朝 唳办缣虏 啪桧虽蒂 还罹鄹栖棻.
|
||||
local consumeValue = getCreatorSkillConsumeValue(obj, SKILL_MGRAB);
|
||||
|
||||
if (!useCreatorSkill(obj, SKILL_MGRAB, 0, 0, consumeValue))
|
||||
return;
|
||||
//
|
||||
|
||||
|
||||
obj.getVar("grabobj").push_obj_vector(hoverEnemyObject); // grabobj
|
||||
|
||||
local activeobj = sq_GetCNRDObjectToActiveObject(hoverEnemyObject);
|
||||
|
||||
if (activeobj)
|
||||
{
|
||||
// ?葆葬虏 濩朝棻.
|
||||
local objListSize = obj.getVar("grabobj").get_obj_vector_size();
|
||||
|
||||
print(" objListSize:" + objListSize);
|
||||
|
||||
for (local i =0;i<objListSize;++i)
|
||||
{
|
||||
local vObj = obj.getVar("grabobj").get_obj_vector(i);
|
||||
|
||||
local act = sq_GetCNRDObjectToActiveObject(vObj);
|
||||
|
||||
if (act == null)
|
||||
continue;
|
||||
|
||||
sq_IntVectorClear(sq_GetGlobalIntVector());
|
||||
sq_IntVectorPush(sq_GetGlobalIntVector(),0);
|
||||
sq_AddSetStatePacketActiveObject(act,STATE_HOLD, sq_GetGlobalIntVector(), STATE_PRIORITY_FORCE);
|
||||
}
|
||||
}
|
||||
} //if (sq_IsHoldable(obj, hoverEnemyObject) == false && sq_IsGrabable(obj, hoverEnemyObject) == true)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function onSetState_Mgrab(obj,state,datas,isResetTimer)
|
||||
{
|
||||
}
|
||||
|
||||
function onChangeSkillEffect_Mgrab(obj, skillIndex, reciveData)
|
||||
{
|
||||
if (!obj)
|
||||
return;
|
||||
|
||||
local size = 8; // ?釭 涡 跷陛?捡?
|
||||
local data_l =[];
|
||||
|
||||
data_l.resize(size);
|
||||
|
||||
for (local i = 0; i < 8; i++)
|
||||
{
|
||||
data_l[i] = -1;
|
||||
|
||||
if (reciveData.getSize() > 0)
|
||||
{
|
||||
data_l[i] = reciveData.readDword();
|
||||
}
|
||||
}
|
||||
|
||||
local targetObj = sq_GetObject(obj, data_l[0], data_l[1]);
|
||||
|
||||
if (targetObj)
|
||||
{
|
||||
local xPos = data_l[2];
|
||||
local zPos = data_l[3];
|
||||
|
||||
if (zPos < 0)
|
||||
zPos = 0;
|
||||
|
||||
local stateTimer = obj.sq_GetStateTimer();
|
||||
|
||||
if (!obj.getVar("mgrab").get_vector(0))
|
||||
{
|
||||
obj.getVar("mgrab").set_vector(0, xPos);
|
||||
obj.getVar("mgrab").set_vector(1, zPos);
|
||||
}
|
||||
|
||||
local state = data_l[4];
|
||||
print(" on change state:" + state);
|
||||
|
||||
//if (obj.isMyControlObject())
|
||||
{
|
||||
if (state == 0)
|
||||
{
|
||||
if (targetObj.getState() != STATE_HOLD && targetObj.getState() != STATE_DOWN)
|
||||
{
|
||||
local act = sq_GetCNRDObjectToActiveObject(targetObj);
|
||||
|
||||
if (act)
|
||||
{
|
||||
sq_IntVectorClear(sq_GetGlobalIntVector());
|
||||
sq_IntVectorPush(sq_GetGlobalIntVector(),0);
|
||||
sq_AddSetStatePacketActiveObject(act, STATE_HOLD, sq_GetGlobalIntVector(), STATE_PRIORITY_FORCE);
|
||||
print(" onchange setstate hold");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (state == 1)
|
||||
{
|
||||
local act = sq_GetCNRDObjectToActiveObject(targetObj);
|
||||
|
||||
if (act)
|
||||
{
|
||||
local direction = data_l[5];
|
||||
local nX = data_l[6];
|
||||
local nY = data_l[7];
|
||||
|
||||
sq_IntVectorClear(sq_GetGlobalIntVector());
|
||||
sq_IntVectorPush(sq_GetGlobalIntVector(),direction);
|
||||
sq_IntVectorPush(sq_GetGlobalIntVector(),0);
|
||||
sq_IntVectorPush(sq_GetGlobalIntVector(),1);
|
||||
sq_IntVectorPush(sq_GetGlobalIntVector(),nX);
|
||||
sq_IntVectorPush(sq_GetGlobalIntVector(),nY);
|
||||
sq_AddSetStatePacketActiveObject(act,STATE_DOWN, sq_GetGlobalIntVector(), STATE_PRIORITY_FORCE);
|
||||
print(" onchange setstate down:");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sq_SetCurrentPos(targetObj, xPos, targetObj.getYPos(), zPos);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function prepareDraw_Mgrab(obj)
|
||||
{
|
||||
|
||||
if (!obj) return;
|
||||
|
||||
}
|
||||
|
||||
// 剪葬 桧? 颤啃击 琼嬴顶横 葬欐?朝 ?热殓栖棻.
|
||||
function pushTargetDistanceMinObject(obj, targetObj, distance)
|
||||
{
|
||||
if (!obj)
|
||||
return;
|
||||
|
||||
local objectManager = obj.getObjectManager();
|
||||
|
||||
if (objectManager == null)
|
||||
return;
|
||||
|
||||
if (!targetObj)
|
||||
return;
|
||||
|
||||
obj.getVar("mgrab").clear_obj_vector();
|
||||
|
||||
local grabObj = null;
|
||||
for (local i = 0; i < objectManager.getCollisionObjectNumber(); i+=1)
|
||||
{
|
||||
local object = objectManager.getCollisionObject(i);
|
||||
if (sq_IsHoldable(obj, object) == true && sq_IsGrabable(obj, object) == true)
|
||||
{ // 濩晦陛栋瞳桧塭贼 ?卫?栖棻.
|
||||
if (object && obj.isEnemy(object) && object.isInDamagableState(obj) && object.isObjectType(OBJECTTYPE_ACTIVE))
|
||||
{
|
||||
local isSame = isSameObject(targetObj, object);
|
||||
if (isSame)
|
||||
continue;
|
||||
|
||||
|
||||
local activeObj = sq_GetCNRDObjectToActiveObject(object);
|
||||
// 舱羲 顶缣怃 陛潍 陛梱遴 瞳击 坚艇棻
|
||||
|
||||
if (activeObj)
|
||||
{
|
||||
if (!activeObj.isDead())
|
||||
{
|
||||
local dis = sq_GetDistanceObject(targetObj, object, false);
|
||||
|
||||
if (dis < distance)
|
||||
{
|
||||
distance = dis;
|
||||
grabObj = activeObj;
|
||||
//obj.getVar("mgrab").push_obj_vector(object);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} //if (sq_IsHoldable(obj, hoverEnemyObject) == false && sq_IsGrabable(obj, hoverEnemyObject) == true)
|
||||
}
|
||||
|
||||
if (grabObj)
|
||||
{
|
||||
obj.getVar("mgrab").push_obj_vector(grabObj);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function onProc_Mgrab(obj)
|
||||
{
|
||||
|
||||
if (!obj) return;
|
||||
|
||||
if (!obj.isMyControlObject())
|
||||
return;
|
||||
|
||||
local objListSize = obj.getVar("grabobj").get_obj_vector_size();
|
||||
|
||||
if (objListSize <= 0)
|
||||
return;
|
||||
|
||||
local stage = sq_GetObjectManagerStage(obj);
|
||||
|
||||
if (!stage)
|
||||
return;
|
||||
|
||||
local control = stage.getMainControl();
|
||||
|
||||
if (control.IsRBDown())
|
||||
{
|
||||
onMouseMoveButtonDown_Mgrab(obj);
|
||||
}
|
||||
else
|
||||
{
|
||||
onMouseButtonUp_Mgrab(obj);
|
||||
}
|
||||
}
|
||||
|
||||
// 葆办蝶 帼?击 机卫俪击 阳 籀葬?捡肾朝 睡碟殓栖棻.
|
||||
function onMouseButtonUp_Mgrab(obj)
|
||||
{
|
||||
local objListSize = obj.getVar("grabobj").get_obj_vector_size();
|
||||
|
||||
print(" onMouseButtonUp_Mgrab:" + objListSize);
|
||||
for (local i = 0; i < objListSize;++i)
|
||||
{
|
||||
|
||||
local hoverEnemy = obj.getVar("grabobj").get_obj_vector(i);
|
||||
if (hoverEnemy)
|
||||
{
|
||||
local activeobj = sq_GetCNRDObjectToActiveObject(hoverEnemy);
|
||||
if (activeobj)
|
||||
{
|
||||
local srcX = obj.getVar("mgrab").get_vector(0);
|
||||
local srcY = sq_GetYPos(activeobj);
|
||||
local srcZ = obj.getVar("mgrab").get_vector(1);
|
||||
|
||||
if (srcZ < 0)
|
||||
srcZ = 0;
|
||||
|
||||
local dstX = sq_GetXPos(activeobj);
|
||||
local dstY = sq_GetYPos(activeobj);
|
||||
local dstZ = sq_GetZPos(activeobj);
|
||||
|
||||
if (dstZ < 0)
|
||||
dstZ = 0;
|
||||
|
||||
print(" sx:" + srcX + " sy:" + srcY + " sz:" + srcZ);
|
||||
print(" dx:" + dstX + " dy:" + dstY + " dz:" + dstZ);
|
||||
|
||||
local distance = sq_GetDistance( srcX, srcZ, dstX, dstZ, true);
|
||||
|
||||
local width = sq_Abs(dstX - srcX);
|
||||
local h = sq_Abs((dstZ) - (srcZ));
|
||||
|
||||
print(" h:" + h);
|
||||
|
||||
if (h <= 0)
|
||||
h = 10;
|
||||
|
||||
local angle = sq_Atan2( h.tofloat(), width.tofloat());
|
||||
|
||||
local nRevision = distance;
|
||||
|
||||
local cos = nRevision.tofloat() * sq_Cos(angle);
|
||||
local sin = nRevision.tofloat() * sq_Sin(angle);
|
||||
|
||||
local nX = sq_Abs( cos.tointeger() ) * 2;
|
||||
local nY = sq_Abs( sin.tointeger() ) * 2;
|
||||
|
||||
|
||||
local direction = sq_GetDirection(activeobj);
|
||||
|
||||
if ((dstX - srcX) < 0)
|
||||
{
|
||||
nX = -nX;
|
||||
}
|
||||
|
||||
|
||||
direction = 0;
|
||||
print(" nX:" + nX + " nY:" + nY + " offset:" + (dstX - srcX) + " direction:" + direction + " activeobj:" + activeobj);
|
||||
sq_IntVectorClear(sq_GetGlobalIntVector());
|
||||
sq_IntVectorPush(sq_GetGlobalIntVector(),direction);
|
||||
sq_IntVectorPush(sq_GetGlobalIntVector(),0);
|
||||
sq_IntVectorPush(sq_GetGlobalIntVector(),1);
|
||||
sq_IntVectorPush(sq_GetGlobalIntVector(),nX);
|
||||
sq_IntVectorPush(sq_GetGlobalIntVector(),nY);
|
||||
sq_AddSetStatePacketActiveObject(activeobj,STATE_DOWN, sq_GetGlobalIntVector(), STATE_PRIORITY_FORCE);
|
||||
print(" activeobj:" + activeobj + " setstate down:");
|
||||
|
||||
|
||||
local group = sq_GetGroup(activeobj);
|
||||
local uniqueId = sq_GetUniqueId(activeobj);
|
||||
|
||||
sq_BinaryStartWrite();
|
||||
|
||||
sq_BinaryWriteDword(group); // 0
|
||||
sq_BinaryWriteDword(uniqueId); // 1
|
||||
sq_BinaryWriteDword(dstX); // 2
|
||||
sq_BinaryWriteDword(dstZ); // 3
|
||||
// 1廓擎 state_down鼻鹧殓栖棻.
|
||||
sq_BinaryWriteDword(1); // 4
|
||||
sq_BinaryWriteDword(direction); // 5
|
||||
sq_BinaryWriteDword(nX); // 6
|
||||
sq_BinaryWriteDword(nY); // 7
|
||||
sq_SendChangeSkillEffectPacket(obj, SKILL_MGRAB);
|
||||
print(" sq_SendChangeSkillEffectPacket down");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
obj.getVar("mgrab").clear_vector();
|
||||
obj.getVar("mgrab").push_vector(0);
|
||||
obj.getVar("mgrab").push_vector(0);
|
||||
|
||||
releaseOutLine(obj, "grabobj");
|
||||
|
||||
if (objListSize)
|
||||
{
|
||||
obj.sq_PlaySound("R_THROW_MONSTER");
|
||||
}
|
||||
}
|
||||
|
||||
// 葆办蝶 帼?击 棻遴卫俪击 阳 籀葬?捡肾朝 睡碟殓栖棻.
|
||||
function onMouseMoveCharacter_Mgrab(obj)
|
||||
{
|
||||
onMouseMoveButtonDown_Mgrab(obj);
|
||||
}
|
||||
|
||||
|
||||
function onMouseMoveButtonDown_Mgrab(obj)
|
||||
{
|
||||
local hoverEnemy = obj.getVar("grabobj").get_obj_vector(0);
|
||||
|
||||
if (!hoverEnemy)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
local objectManager = obj.getObjectManager();
|
||||
|
||||
local objListSize = obj.getVar("grabobj").get_obj_vector_size();
|
||||
|
||||
local t = obj.getVar("mgrab").get_ct_vector(0);
|
||||
local time = 0;
|
||||
|
||||
if(t)
|
||||
time = t.Get();
|
||||
|
||||
local skill_level = obj.sq_GetSkillLevel(SKILL_MGRAB);
|
||||
|
||||
|
||||
local activeObj = sq_GetCNRDObjectToActiveObject(hoverEnemy);
|
||||
|
||||
if (!activeObj)
|
||||
{
|
||||
onMouseButtonUp_Mgrab(obj);
|
||||
return;
|
||||
}
|
||||
|
||||
// 跪 颤殓涤煎 濩坚毡朝 譆渠卫除桧 殖塭喂栖棻.
|
||||
// 0. 橾奁跪 濩坚 毡击阳 譆渠卫除
|
||||
// 1. 啻歜萄 濩坚 毡击阳 譆渠卫除
|
||||
// 2. 尔蝶跪 濩坚 毡击阳 譆渠卫除
|
||||
// 3. ?跨蝶搅 濩坚 毡击阳 譆渠卫除
|
||||
// 4. apc 濩坚 毡击阳 譆渠卫除
|
||||
|
||||
// 橾奁橾隆 蚝岁0
|
||||
local columnIndex = SKL_LV_0;
|
||||
if (sq_IsNamed(activeObj))
|
||||
{
|
||||
// 啻歜萄 橾隆 蚝岁1
|
||||
columnIndex = SKL_LV_1;
|
||||
}
|
||||
else if (sq_IsBoss(activeObj))
|
||||
{
|
||||
// 尔蝶 橾隆 蚝岁2
|
||||
columnIndex = SKL_LV_2;
|
||||
}
|
||||
else if (sq_IsHellMonster(activeObj))
|
||||
{
|
||||
// ?跨蝶搅 橾隆 蚝岁3
|
||||
columnIndex = SKL_LV_3;
|
||||
}
|
||||
else if (sq_IsAiCharacter(activeObj))
|
||||
{
|
||||
// apc橾隆
|
||||
columnIndex = SKL_LV_4;
|
||||
}
|
||||
|
||||
// 濩坚毡击 热 毡朝 譆渠卫除
|
||||
local maxTime = obj.sq_GetLevelData(SKILL_MGRAB, columnIndex, skill_level);
|
||||
|
||||
print(" maxTime:" + maxTime + " time:" + time);
|
||||
|
||||
if (time > maxTime)
|
||||
{
|
||||
onMouseButtonUp_Mgrab(obj);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (local i =0;i<objListSize;++i)
|
||||
{
|
||||
local vObj = obj.getVar("grabobj").get_obj_vector(i);
|
||||
|
||||
if (!vObj)
|
||||
continue;
|
||||
|
||||
local xPos = objectManager.getFieldXPos(IMouse.GetXPos(), ENUM_DRAWLAYER_NORMAL);
|
||||
local zPos = objectManager.getFieldZPos(IMouse.GetYPos(), vObj.getYPos(), ENUM_DRAWLAYER_NORMAL) - (sq_GetObjectHeight(hoverEnemy) / 2);
|
||||
|
||||
local group = sq_GetGroup(vObj);
|
||||
local uniqueId = sq_GetUniqueId(vObj);
|
||||
|
||||
sq_BinaryStartWrite();
|
||||
|
||||
sq_BinaryWriteDword(group); //
|
||||
sq_BinaryWriteDword(uniqueId); //
|
||||
sq_BinaryWriteDword(xPos);
|
||||
sq_BinaryWriteDword(zPos);
|
||||
// 0廓擎 state_hold鼻鹧殓栖棻.
|
||||
sq_BinaryWriteDword(0);
|
||||
sq_BinaryWriteDword(0);
|
||||
sq_BinaryWriteDword(0);
|
||||
sq_BinaryWriteDword(0);
|
||||
sq_SendChangeSkillEffectPacket(obj, SKILL_MGRAB);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function onProcCon_Mgrab(obj)
|
||||
{
|
||||
|
||||
if (!obj) return;
|
||||
|
||||
}
|
||||
|
||||
function onEndCurrentAni_Mgrab(obj)
|
||||
{
|
||||
|
||||
if (!obj) return;
|
||||
|
||||
}
|
||||
|
||||
function onKeyFrameFlag_Mgrab(obj,flagIndex)
|
||||
{
|
||||
|
||||
if (!obj) return false;
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
function onEndState_Mgrab(obj,new_state)
|
||||
{
|
||||
|
||||
if (!obj) return;
|
||||
|
||||
}
|
||||
|
||||
function onAfterSetState_Mgrab(obj,state,datas,isResetTimer)
|
||||
{
|
||||
|
||||
if (!obj) return;
|
||||
|
||||
}
|
||||
|
||||
function onBeforeAttack_Mgrab(obj,damager,boundingBox,isStuck)
|
||||
{
|
||||
|
||||
if (!obj) return;
|
||||
|
||||
}
|
||||
|
||||
function onAttack_Mgrab(obj,damager,boundingBox,isStuck)
|
||||
{
|
||||
|
||||
if (!obj) return;
|
||||
|
||||
}
|
||||
|
||||
function onAfterAttack_Mgrab(obj,damager,boundingBox,isStuck)
|
||||
{
|
||||
|
||||
if (!obj) return 0;
|
||||
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
function onBeforeDamage_Mgrab(obj,attacker,boundingBox,isStuck)
|
||||
{
|
||||
|
||||
if (!obj) return;
|
||||
|
||||
}
|
||||
|
||||
function onDamage_Mgrab(obj,attacker,boundingBox)
|
||||
{
|
||||
|
||||
if (!obj) return;
|
||||
|
||||
}
|
||||
|
||||
function onAfterDamage_Mgrab(obj,attacker,boundingBox)
|
||||
{
|
||||
|
||||
if (!obj) return;
|
||||
|
||||
}
|
||||
| ||||