//挂载外部文件 #本地测试 #不用退游戏就更改源码
dofile("以客户端为根目录的路径");
//函数名事件 #人物状态 #特效 #ap #事件函数 #某一个事件达成时会运行的函数
//角色事件函数名 #角色的事件不是状态的
//被动技能 使用被动技能 #被动技能的设置
function ProcPassiveSkill_ATMage(obj, skill_index, skill_level)
{
if (skill_index == SKILL_EXPRESSION)
{
if(skill_level > 0)
{
local appendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, skill_index, false, "Character/ATMage/Expressions/ap_atmage_expression.nut", true);
print(" expression appendage:" + appendage);
if(appendage)
{
local magicalAtkChangeRate = sq_GetLevelData(obj, skill_index, SKL_LVL_COLUMN_IDX_1, skill_level);
local change_appendage = appendage.sq_getChangeStatus("expression");
if(!change_appendage) {
change_appendage = appendage.sq_AddChangeStatus("expression",obj, obj, 0, CHANGE_STATUS_TYPE_MAGICAL_ATTACK, false, magicalAtkChangeRate );
}
if(change_appendage)
{
change_appendage.clearParameter();
print(" expression attack rate:" + magicalAtkChangeRate.tofloat());
change_appendage.addParameter(CHANGE_STATUS_TYPE_MAGICAL_ATTACK, false, magicalAtkChangeRate.tofloat());
}
}
}
}
else if(skill_index == SKILL_DIEHARD)
{ // 碳餌
if(skill_level > 0)
{
local appendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, skill_index, false,
"Character/ATMage/DieHard/ap_ATMage_DieHard.nut", true);
if(appendage)
{
}
}
}
else if(skill_index == SKILL_TUNDRASOUL)
{ // 矗萄塭曖 陛
if(skill_level > 0)
{
local skill = sq_GetSkill(obj, SKILL_TUNDRASOUL);
if(!skill)
return true;
print( " passive_skill_tundrasoul");
//if(!skill.isSealFunction())
{
local appendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, skill_index, false,
"Character/ATMage/TundraSoul/ap_ATMage_TundraSoul.nut", true);
if(appendage)
{
print(" passive object isinBattle:" + obj.isInBattle());
//if(!skill.isSealFunction())
//{
//if(sq_IsInBattle())
//{
//local range = obj.sq_GetIntData(SKILL_TUNDRASOUL , 0);// 0. 綵唸 鼻鷓檜鼻縑 勘葬朝 婁彰嬪
//local AuraTundraSoulAppendage = appendage.sq_AddSquirrelAuraMaster("AuraTundraSoul",obj, obj, range, 18, 5, 0);
//}
//else
//{
//appendage.sq_DeleteAppendages();
//}
//}
//else
//{
//appendage.sq_DeleteAppendages();
//}
}
}
}
}
return true;
}
function onUseSkillPassiveSkill_ATMage(obj,skillIndex, skillLevel)
{
if(!obj)
return;
print( " onuseskill");
}
_________________________________________________________________________________________________________________________________________________________
//刷新技能按键状态时 #这里可以设置技能亮不亮
function flushCommandEnable_Avenger(obj)
{
if (!obj) return S_FLOW_NORMAL;
if (!obj.isInBattle())
{
sq_SetAllCommandEnable(obj, false); // 瞪癱醞橾隆 賅萇 蝶鑒擊 餌辨 熱 橈蝗棲棻.
return S_FLOW_RETURN;
}
if (isAvengerAwakenning(obj) == true)
{
if (obj.isMyControlObject())
sq_SetAllCommandEnable(obj, false); // 賅萇 state蒂 殘嬴場朝棻..
}
}
_________________________________________________________________________________________________________________________________________________________
//增加设置状态包时 #可以驳回状态 #且可以再次设置别的状态
function addSetStatePacket_Avenger(obj, state, datas)
{
if (!obj)
return -1;
if (isAvengerAwakenning(obj) == true)
{
switch (state)
{
case 7://發送過來的狀態是跳躍攻擊 源狀態是跳躍 則 發給覺醒狀態 來跳躍攻擊
if(obj.getState()==6)
{
obj.sq_IntVectClear();
obj.sq_IntVectPush(4); // substate撮
obj.sq_addSetStatePacket(STATE_AVENGER_AWAKENING, STATE_PRIORITY_USER, true);
return -1;
}
break;
}
}
}
_________________________________________________________________________________________________________________________________________________________
//进入副本时
function onStartDungeon_CreatorMage(obj)
{
if (!obj)
return;
if (sq_IsMyCharacter(obj))
{
lockMouse(obj);
//////////////////////////////////////////////////////
obj.getVar("lbdown").clear_timer_vector();
obj.getVar("lbdown").push_timer_vector();
obj.getVar("lbdown").push_timer_vector();
local t = obj.getVar("lbdown").get_timer_vector(0);
t.setParameter(20, -1);
t.resetInstant(0);
obj.getVar("lbdown").clear_ct_vector();
obj.getVar("lbdown").push_ct_vector();
local timer = obj.getVar("lbdown").get_ct_vector(0);
timer.Reset();
timer.Start(10000,0);
//////////////////////////////////////////////////////
// 觼溯檜攪曖 賅萇 樓撩 啪檜雖 醱瞪擊 衛濛棲棻.
onAllChargeCreatorMageGauge(obj);
}
}
_________________________________________________________________________________________________________________________________________________________
//进入map房间时
function onStartMap_CreatorMage(obj)
{
if(!obj)
return;
lockMouse(obj);
obj.getVar("dstpos").clear_vector();
// 寞檜 剩橫鬲朝等 熱 橫蛤雖陛 氈棻賊..
// 餉薯鄹棲棻.
// 棻擠寞縑憮紫 婁陛 雖樓腎晦 陽僥殮棲棻.
local appendage = CNSquirrelAppendage.sq_GetAppendage(obj, "Appendage/Character/ap_common_suck.nut");
if (appendage)
{
appendage.sq_DeleteAppendages();
CNSquirrelAppendage.sq_RemoveAppendage(obj, "Appendage/Character/ap_common_suck.nut");
}
}
_________________________________________________________________________________________________________________________________________________________
//设置状态时
function setState_ATMage(obj, state, datas, isResetTimer)
{
if(state == STATE_DIE)
obj.sq_RemoveSkillLoad(SKILL_HOLONG_LIGHT); // 避戲賊 煬碳 UI 薯剪
return 0;
}
_________________________________________________________________________________________________________________________________________________________
//被动
function procAppend_CreatorMage(obj)
{
if (!obj)
return 0;
local type = getCreatorSkillStateSkillIndex(obj);
if (type == CREATOR_TYPE_DISTURB)
{
onProc_Mgrab(obj);
}
if (!obj.isMyControlObject())
return 0;
local STATE_ACTIVE = 1;
local cashState = sq_GetStateCashShop();
local isClipCursor = sq_IsClipCursor(); // 醴憮陛 陘氈朝雖 羹觼棲棻.
if (cashState == STATE_ACTIVE)
{
// 撮塭憧檜 翮溜朝等 醴憮陛 off賅萄陛 腎橫憮朝 寰腌棲棻.
if (isClipCursor)
unLockMouse(obj);
}
else
{
// 葆辦蝶塊檜 葬雖 彊擎 唳辦 葆雖虞 湍瞪 贗葬橫鼻鷓檣雖 羹觼瑣棲棻.
if (sq_GetResultState() || sq_GetRewardState())
{
// 唸婁璽檜 釭螃朝 翕寰縑紫 鼻濠蛔擊 睡敷幗葬晦 嬪
// 檜廓縛 羲戲煎 ui撩酈蒂 援腦賊 葆辦蝶蒂 濡掬幗董棲棻.
local hotKey = sq_IsDownHotKeyCreatorCursor();
if (hotKey)
{
// ui撩酈陛 揚萼鼻鷓縑憮朝 贗董檜 溥氈棻賊..
// 棻衛 濡掬幗董棲棻.
if (!isClipCursor)
lockMouse(obj);
}
else
{
if (isClipCursor)
{
unLockMouse(obj);
}
}
return 0;
}
if (IsInBattleCreator(obj))
{ // 瞪濰醞檜塭賊..
local hotKey = sq_IsDownHotKeyCreatorCursor();
if (hotKey)
{
// ui撩 酈蒂 援艇 鼻鷓縑歙 葆辦蝶陛 濡啣朝雖 羹觼瑣棲棻.
if (isClipCursor)
{
// 葆辦蝶陛 濡啣棻賊
unLockMouse(obj);
}
}
else
{
// 營 葆辦蝶 謝陛 孺紫辦 賊寰薹縑 氈朝 羹觼棲棻.
//print(" isClipCursor:" + isClipCursor);
if (!isClipCursor)
{ // 葆辦蝶塊檜 萼 鼻鷓塭賊
//print(" isopencreator:" + sq_IsOpenCreatorControlPopupWindows());
if (!sq_IsOpenCreatorControlPopupWindows())
{
if (sq_IsMousePtInWindowRect())
{ // 葆辦蝶陛 頂睡縑 謝蒂 氈棻賊..
// ui撩 酈蒂 援艇 鼻鷓縑憮 諼睡瓣璽擊 援腦賊 橾衛瞳戲煎
// ui撩 酈陛 false煎 腎朝等 檜陽 葆辦蝶塊擊 勘橫輿賊 寰腌棲棻.
lockMouse(obj);
}
}
}
}
}
else
{
if (isClipCursor == true)
{
unLockMouse(obj);
}
}
}
return 1;
}
_________________________________________________________________________________________________________________________________________________________
//前冲被动
function procDash_ATMage(obj)
{
if(!obj)
return;
local ani = sq_GetCurrentAnimation(obj);
if(!ani)
return;
local isFlag = obj.sq_IsKeyFrameFlag(ani, 1);
local result = CNSquirrelAppendage.sq_IsAppendAppendage(obj, "Character/ATMage/IceRoad/ap_ATMage_IceRoad.nut");
if (result == true) // 嬴檜蝶煎萄蒂 麵堡擊 隆 嫦濠措模葬陛 夥荸棲棻.
{
if(isFlag)
{
obj.sq_PlaySound("R_ICE_WALK");
}
obj.sq_ClearKeyFrameFlag(ani);
}
else
{
//print(" procDash");
if (isFlag)
{
local stage = sq_GetGlobaludpModuleStage();
if(!stage)
return;
local dungeon = sq_GetDungeonByStage(stage);
if(!dungeon)
return;
local dungeonIndex = sq_GetDuegonIndex(dungeon);
local mapIndex = sq_GetMapIndex(stage);
//撲骯薹 湍瞪曖 唳辦 40廓, 撲骯曖 蹺瞳 PVP裘曖 唳辦 50019廓.
if (dungeonIndex == 40 || mapIndex == 50019)
{
obj.sq_PlaySound("R_RUN_SNOW");
}
else
{
local weight = sq_GetObjectWeight(obj);
if (sq_GetShadowTypeByAnimation() != 0)
obj.sq_PlaySound("R_RUN_FLOOR");
else if (weight < LIGHT_OBJECT_MAX_WEIGHT)
obj.sq_PlaySound("RUN_STONE");
else if (weight < MIDDLE_OBJECT_MAX_WEIGHT)
obj.sq_PlaySound("RUN_SOIL");
else
obj.sq_PlaySound("RUN_GRASS");
}
}
obj.sq_ClearKeyFrameFlag(ani);
}
}
_________________________________________________________________________________________________________________________________________________________
//被动技能
function procSkill_ATMage(obj)
{
procSkill_IceRoad(obj);
procSkill_MagicShield(obj);
}
function procSkill_IceRoad(obj)
{
local appendage = obj.GetSquirrelAppendage("Character/ATMage/IceRoad/ap_ATMage_IceRoad.nut");
if(appendage) {
local isvalid = appendage.isValid();
if(isvalid) {
local currentT = appendage.getTimer().Get();
local t = appendage.sq_var.get_timer_vector(0);
local t2 = appendage.sq_var.get_timer_vector(1); // 橡擠褻陝擊 虜萄朝匙婁 滌紫煎 縞模賅朝 棻艇顫檜該煎 給嬴陛憮 mp模賅蒂 衛霾棲棻.
if (t2.isOnEvent(currentT) == true)
{
local skill = sq_GetSkill(obj, SKILL_ICEROAD);
if(skill)
{
local skill_level = obj.sq_GetSkillLevel(SKILL_ICEROAD);
local spendMp = obj.sq_GetLevelData(SKILL_ICEROAD, SKL_LV_0, skill_level); // 0.衛除渡MP 模賅榆
if (spendMp > obj.getMp())
{
appendage.setValid(false);
skill.setSealActiveFunction(true);
return;
}
else
{
// MP陛 醱碟棻賊 橡擠曖 望 褻陝擊 虜萇棻..
print( " spendMp:" + spendMp);
obj.sendSetMpPacket(obj.getMp() - spendMp);
}
}
}
if (t.getEventTerm() == -1)
return;
if (t.isOnEvent(currentT) == true)
{
if(obj.isMyControlObject())
{
if(obj.getZPos() == 0)
{
local skill_level = sq_GetSkillLevel(obj, SKILL_ICEROAD);
local change_time = sq_GetLevelData(obj, SKILL_ICEROAD, SKL_LV_1, skill_level); // 雖樓衛除
local rate = sq_GetLevelData(obj, SKILL_ICEROAD, SKL_LV_3, skill_level); // 檜樓 徽
local movSpd = sq_GetLevelData(obj, SKILL_ICEROAD, SKL_LV_2, skill_level); //
sq_BinaryStartWrite();
sq_BinaryWriteDword(change_time); // 衛除
sq_BinaryWriteDword(rate); // 徽
sq_BinaryWriteDword(movSpd); // 馬模纂
// 嬴檜蝶 煎萄 撩 衛粽 蝶鑒擊 寡錫棻賊 蜃擎 瞳檜 綵唸 鼻鷓檜鼻縑 勘萼棻.
local skillLevel = sq_GetSkillLevel(obj, SKILL_ICEROAD_EX);
sq_BinaryWriteWord(skillLevel);
if (skillLevel > 0)
{
local prob = sq_GetLevelData(obj, SKILL_ICEROAD_EX, 4, skillLevel) / 10.0;// 鼻鷓檜鼻 綵唸曖 睦
local asLevel = sq_GetLevelData(obj, SKILL_ICEROAD_EX, 5, skillLevel); // 鼻鷓檜鼻 綵唸曖 溯漣
local validTime = sq_GetLevelData(obj, SKILL_ICEROAD_EX, 6, skillLevel); // 鼻鷓檜鼻 綵唸曖 衛除
sq_BinaryWriteFloat(prob.tofloat()); // 睦
sq_BinaryWriteWord(asLevel); // 溯漣
sq_BinaryWriteDword(validTime); // 衛除
}
sq_SendCreatePassiveObjectPacket(obj, 24243, 0, 0, 0, 0, obj.getDirection());
}
}
}
}
}
}
_________________________________________________________________________________________________________________________________________________________
//得到设置被攻击属性伤害率
function getImmuneTypeDamgeRate_ATMage(obj,damageRate, attacker)
{
// 碳晦菅 錳剪葬 奢問曖 等嘐雖蒂 N%虜躑 馬模衛酈堅, 唳霜擊 嫡雖 彊蝗棲棻.
if(obj.getVar("firepillar").size_vector() > 0)
{
if(obj.getVar("firepillar").get_vector(VECTOR_FLAG_2))
{
if(attacker)
{
print( " damageRate:" + damageRate);
local skillLevel = obj.sq_GetSkillLevel(SKILL_FIREPILLAR);
local N = obj.sq_GetLevelData(SKILL_FIREPILLAR, 0, skillLevel); // 0.錳剪葬 還罹輿朝 馬模纂(%)
// 錳剪葬 奢問檜塭賊..
damageRate = damageRate - N;
//damageRate = 10;
print( " convert damageRate:" + damageRate);
}
}
}
// 碳餌煎 犒衛縛 等嘐雖陛 2寡(1.5寡?) 菟橫除棻.
if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "Character/ATMage/DieHard/ap_ATMage_DieHardSlowHeal.nut")) //
{
//0. 問衛 嫡朝 等嘐雖 隸陛徽(%)
local increaseDamageRate = sq_GetIntData(obj, SKILL_DIEHARD, SKL_STATIC_INT_IDX_0);
//increaseDamageRate.tofloat() / 100.0;
damageRate = damageRate + increaseDamageRate;
}
return damageRate;
}
_________________________________________________________________________________________________________________________________________________________
//得到被攻击的属性
function getImmuneType_ATMage(obj,type, attacker)
{
local immuneType = type;
return immuneType;
}
_________________________________________________________________________________________________________________________________________________________
//使用技能前
function useSkill_before_ATMage(obj, skillIndex, consumeMp, consumeItem, oldSkillMpRate)
{
local bChangedMp = false;
print(" consumpMp:" + consumeMp + " oldSkillMpRate:" + oldSkillMpRate);
local appendage = obj.GetSquirrelAppendage("Character/ATMage/ManaBurst/ap_ATMage_ManaBurst.nut");
if(appendage)
{
local isvalid = appendage.isValid();
if(isvalid)
{
local skillLevel = obj.sq_GetSkillLevel(SKILL_MANABURST);
local mpComsumeRate = sq_GetLevelData(obj, SKILL_MANABURST, SKL_LVL_COLUMN_IDX_0, skillLevel);
local newMpRate = oldSkillMpRate.tofloat() * (100 + mpComsumeRate.tofloat()) / 100;
print(" newMpRate:" + newMpRate);
obj.setSkillMpRate(skillIndex, newMpRate.tofloat());
bChangedMp = true;
}
}
if(obj.sq_GetSkillLevel(SKILL_EXPRESSION) > 0)
{
local skillLevel = obj.sq_GetSkillLevel(SKILL_EXPRESSION);
local skillMpRate = obj.getSkillMpRate(skillIndex);
local mpComsumeRate = sq_GetLevelData(obj, SKILL_EXPRESSION, 0, skillLevel);
local newMpRate = skillMpRate.tofloat() * (100 - mpComsumeRate.tofloat()) / 100;
//print(" expression consumeMp oldMpRate:" + skillMpRate.tofloat() + " skillIndex:" + skillIndex);
//print(" expression consumeMp newMpRate:" + newMpRate.tofloat());
//print(" expression consumeMp mpComsumeRate:" + mpComsumeRate.tofloat());
obj.setSkillMpRate(skillIndex, newMpRate.tofloat());
}
print(" now consumpMp:" + obj.getSkillMpRate(skillIndex));
return true;
}
_________________________________________________________________________________________________________________________________________________________
//使用技能后
function useSkill_after_ATMage(obj, skillIndex, consumeMp, consumeItem, oldSkillMpRate)
{
if(!obj)
return false;
obj.setSkillMpRate(skillIndex, oldSkillMpRate.tofloat());
print(" after set consumpMp:" + oldSkillMpRate);
return true;
}
_________________________________________________________________________________________________________________________________________________________
//普攻强制施放技能
function setEnableCancelSkill_ATMage(obj, isEnable)
{
if(!obj)
return false;
if(!obj.isMyControlObject())
return false;
if(!isEnable)
return true;
obj.setSkillCommandEnable(SKILL_ICE_SWORD, isEnable);
return true;
}
_________________________________________________________________________________________________________________________________________________________
//是否是可以使用的道具 #可以获得物品栏为的物品ID
function isUsableItem_ATMage(obj, itemIndex)
{
if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "Character/ATMage/DieHard/ap_ATMage_DieHardSlowHeal.nut")) //
{ // 碳餌煎 蝸煎辦 醞檜塭賊 犒啗翮 嬴檜蠱擊 噩 熱 橈蝗棲棻.
local isRecover = sq_IsItemRecover(itemIndex);
if(isRecover == true)
{
return false;
}
if(itemIndex == 8)
{ // 溯嘐曖 槳望
return false;
}
}
//print( " is use itemIndex:" + itemIndex + " return true");
return true;
}
_________________________________________________________________________________________________________________________________________________________
//发送设置HP包
function sendSetHpPacket_ATMage(obj, hp, sendInstant)
{
if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "Character/ATMage/DieHard/ap_ATMage_DieHardSlowHeal.nut")) //
{
if(obj.getHp() < hp)
{
//print(" not send hp");
return false;
}
}
//print( " go send hp");
return true;
}
_________________________________________________________________________________________________________________________________________________________
//发送设置MP包
function sendSetMpPacket_ATMage(obj, mp, sendInstant)
{
return true;
}
_________________________________________________________________________________________________________________________________________________________
//当前技能效果 #接收技能效果包
function onChangeSkillEffect_ATMage(obj, skillIndex, reciveData)
{
if(!obj)
return;
if(skillIndex == SKILL_ICEROAD)
{
local skill = sq_GetSkill(obj, SKILL_ICEROAD);
skill.resetCurrentCoolTime();
skill.setSealActiveFunction(true);
local skill_level = sq_GetSkillLevel(obj, SKILL_ICEROAD);
obj.startSkillCoolTime(SKILL_ICEROAD, skill_level, -1);
local appendage = obj.GetSquirrelAppendage("Character/ATMage/IceRoad/ap_ATMage_IceRoad.nut");
appendage.setValid(false);
}
else if(skillIndex == SKILL_DIEHARD)
{
if(reciveData.getSize() > 0)
{
local hp = reciveData.readDword(); // 翕晦 hp
if(hp > 0)
{
print(" onchange:" + hp);
obj.setHp(hp, null, true);
}
}
}
else if (skillIndex == SKILL_ELEMENTAL_CHANGE)
{
if (reciveData.getSize() > 0)
{
local element = reciveData.readByte();
obj.setThrowElement(element);
// 爾虞撩 籀葬
local appendage = CNSquirrelAppendage.sq_GetAppendage(obj,"Character/ATMage/MagicShield/ap_MagicShield.nut");
if(appendage)
setMagicShieldType(appendage, obj, obj.getThrowElement());
}
}
else if(skillIndex == SKILL_TUNDRASOUL)
{
if (reciveData.getSize() > 0)
{
local mode = reciveData.readDword();
local auraAppendage = 0;
local appendage = CNSquirrelAppendage.sq_GetAppendage(obj, "Character/ATMage/TundraSoul/ap_ATMage_TundraSoul.nut");
if(appendage)
{
auraAppendage = appendage.sq_getSquirrelAuraMaster("AuraTundraSoul");
if(mode == 1)
{ // 氈朝匙擊 疏撿棲棻. (嬴辦塭)
appendage.sq_DeleteAppendages();
}
else if(mode == 0)
{ // 橈朝匙擊 麵撿棲棻. (嬴辦塭)
local range = obj.sq_GetIntData(SKILL_TUNDRASOUL , 0);// 0. 綵唸 鼻鷓檜鼻縑 勘葬朝 婁彰嬪
appendage.sq_AddSquirrelAuraMaster("AuraTundraSoul",obj, obj, range, 18, 5, 0);
}
}
//CNSquirrelAppendage.sq_RemoveAppendage(obj, "Character/ATMage/TundraSoul/ap_ATMage_TundraSoul.nut");
}
}
}
_________________________________________________________________________________________________________________________________________________________
//得到13状态下的子状态
function changeTrhowState_ATMage(obj, throwState)
{
if (!obj) return false;
printc("changeTrhowState_ATMage");
if (throwState == 3 &&
obj.getThrowIndex() == SKILL_ELEMENTAL_CHANGE)
{
// 陴徹餌 : 樓撩 嫦翕
obj.sq_IntVectClear();
obj.sq_IntVectPush(throwState);
obj.sq_IntVectPush(-1);
obj.sq_IntVectPush(obj.getThrowElement());
obj.sq_AddSetStatePacket(STATE_THROW, STATE_PRIORITY_USER, true);
return true;
}
return false;
}
_________________________________________________________________________________________________________________________________________________________
//设置异常状态时
function setActiveStatus_ATMage(obj, activeStatus, power)
{
if (!obj) return 0;
local state = sq_GetState(obj);
if (state == STATE_ELEMENTAL_BUSTER)
{
// 陝撩橾隆 評煎 鼻鷓檜鼻檜 勘葬雖 彊擠 (縣溯詮驍 幗蝶攪)
//printc("state : STATE_ELEMENTAL_BUSTER");
return 0;
}
return 1;
}
_________________________________________________________________________________________________________________________________________________________
//播放移动声音
function playMoveSound_ATMage(obj)
{
//obj.sq_PlaySound("R_ICE_WALK");
if(!obj)
return;
local result = CNSquirrelAppendage.sq_IsAppendAppendage(obj, "Character/ATMage/IceRoad/ap_ATMage_IceRoad.nut");
if (result == true) // 嬴檜蝶煎萄蒂 麵堡擊 隆 嫦濠措模葬陛 夥荸棲棻.
{
obj.sq_PlaySound("R_ICE_WALK_LOOP", SOUND_ID_MOVE);
}
else
{
obj.sq_PlayMoveSound();
}
}
_________________________________________________________________________________________________________________________________________________________
//播放前冲攻击声音
function playDashAttackSound_Avenger(obj) // 대쉬사운드를 세팅하는 오버라이딩된 함수입니다..
{
if(!obj) return 0;
if(!isGrowTypeAvenger(obj)) return 0; // 어벤져가 아니라면 또한 그려줄 필욘 없을겁니다..
if(isAvengerAwakenning(obj)) return 1; // 각성일땐 따로 대쉬사운드 세팅합니다..
return 0;
}
_________________________________________________________________________________________________________________________________________________________
//重置刷新时 #死亡复活 #进入下一个房间
function reset_ATMage(obj)
{
if(!obj)
return;
}
_________________________________________________________________________________________________________________________________________________________
//副本中重置状态时 #城镇中也会运行 #就相当于进入副本回到城镇都会运行
function resetDungeonStart_ATMage(obj, moduleType, resetReason, isDeadTower, isResetSkillUserCount)
{
if(!obj) return -1;
local isReset = true; // 晦獄瞳戲煩 瞪睡 葬撢殮棲棻.
if (sq_GetCurrentModuleType() == MODULE_TYPE_WARROOM || sq_GetCurrentModuleType() == MODULE_TYPE_DEAD_TOWER)
{
// 葬撢曖 檜嶸陛 避朝檜嶸陛 嬴棲塭賊..
if (resetReason != REASON_DEATH)
{
isReset = false; // 葬撢衛酈雖 彊蝗棲棻.
}
}
if(isReset)
{ // 葬撢擊 撿棻賊..
local appendage = obj.GetSquirrelAppendage("Character/ATMage/IceRoad/ap_ATMage_IceRoad.nut");
if(appendage)
{
local skill = sq_GetSkill(obj, SKILL_ICEROAD);
local isvalid = appendage.isValid();
if(skill)
{
print(" isSeal:" + skill.isSealActiveFunction());
if(!skill.isSealActiveFunction())
{
skill.setSealActiveFunction(true);
}
}
if(isvalid)
{
appendage.setValid(false);
}
}
obj.sq_RemoveSkillLoad(SKILL_HOLONG_LIGHT); // 煬碳 UI 薯剪
}
return 1;
}
_________________________________________________________________________________________________________________________________________________________
//画城镇,副本ui #城镇中和副本中都可以画 #图层较低
function drawMainCustomUI_CreatorMage(obj)
{
if (!obj)
return;
local sq_var = obj.getVar();
// 蝶鑒蝸煜
local hud_creator_b_gauge = sq_var.GetAnimationMap("hud_creator_b_gauge", "Character/Mage/CreatorAnimation/ui/hud_creator_b_gauge.ani");
local hud_creator_b_select = sq_var.GetAnimationMap("hud_creator_b_select", "Character/Mage/CreatorAnimation/ui/hud_creator_b_select.ani");
local skill_ui_index = 0;
local x = 626;
local y = 588;
local offset = 36;
// 斜葬晦
local hudCreatorAni = sq_var.GetAnimationMap("hud_creator_back", "Character/Mage/CreatorAnimation/ui/hud_creator_back.ani");
sq_DrawSpecificFrame(hudCreatorAni, x, y, false, 0, false, 1.0);
//
// 諄辦濠陛 氈擊 熱 氈戲嘎煎 檜夠縑憮 寡檣雖 嬴棋雖蒂 羹觼罹
// 寡檜 嬴棋 唳辦 醴憮諦 ui蒂 橫鄹棲棻.
if (!IsInBattleCreator(obj))
{
local isEnable = isEnableCreatorBattleInUI();
if (!isEnable)
{
unLockMouse(obj);
}
//return;
}
// 摹鷗 纔舒葬 斜葬晦
if (getCreatorSkillStateSkillIndex(obj) != -1)
{
local type = getCreatorSkillStateSkillIndex(obj);
local skillmgr = obj.getSkillManager();
local slot = -1;
if (skillmgr)
{
local index = getTypeSkillIndex(obj, type);
slot = skillmgr.getSlotindex(index);
}
if (slot != -1)
{
// 摹鷗雖 斜葬晦
sq_AnimationProc(hud_creator_b_select);
sq_drawCurrentFrame(hud_creator_b_select, x + (slot * offset), y, false);
}
}
// 啪檜雖 斜葬晦
local hud_creator_b_gauge = sq_var.GetAnimationMap("hud_creator_b_gauge", "Character/Mage/CreatorAnimation/ui/hud_creator_b_gauge.ani");
// 樓撩蝶鑒 啪檜雖 斜葬晦 睡碟殮棲棻.
local skillmgr = obj.getSkillManager();
if (!skillmgr)
return;
for (local i = CREATOR_TYPE_FLAME; i < CREATOR_TYPE_MAX; i++)
{
local slot = -1;
if (skillmgr)
{
local index = getTypeSkillIndex(obj, i);
slot = skillmgr.getSlotindex(index);
}
if (slot != -1)
{
local appendage = getCreatorMageAppendageByType(obj, i);
if (appendage)
{
local gaugeValue = 0;
local max_gaugeValue = 0;
max_gaugeValue = appendage.sq_var.get_vector(I_MAX_COUNT);
gaugeValue = appendage.sq_var.get_vector(I_REMAIN_COUNT);
local rate = gaugeValue.tofloat() / max_gaugeValue.tofloat();
local rgb = getCreatorTypeColor(obj, i);
local alpha = sq_ALPHA(255);
hud_creator_b_gauge.setImageRate(rate, 1.0);
local gaugePosX = x - 87;
sq_DrawSpecificFrameEffect_SIMPLE(hud_creator_b_gauge, gaugePosX + (slot * offset), y, 0, rgb, alpha, true);
}
}
}
}
_________________________________________________________________________________________________________________________________________________________
//画副本中的ui #只能在副本中进行画ui
function drawCustomUI_CreatorMage(obj)
{
// 葆辦蝶斜椰 籀葬
if (!obj)
return;
if (!IsInBattleCreator(obj))
{
return;
}
// 醴憮斜葬晦
// 醴憮 斜葬晦 睡碟殮棲棻.
local isLock = sq_IsClipCursor();
if (!isLock)
{
if (!sq_IsVisibleCursor())
{
sq_SetVisibleCursor(true);
}
return;
}
if (sq_IsVisibleCursor())
{
sq_SetVisibleCursor(false);
}
local ani = obj.getVar().GetAnimationMap("NORMAL",
"Character/Mage/Effect/Animation/CreatorMagicSphere/normal.ani"); // 橾奩醴憮
local usingSkillIndex = getCreatorSkillStateSkillIndex(obj);
if (usingSkillIndex == CREATOR_TYPE_DISTURB)
{
local stage = sq_GetObjectManagerStage(obj);
if (!stage)
return;
local control = stage.getMainControl();
if (control.IsRBDown())
{ // 萄煎辦橾隆 醴憮蒂 夥習棲棻.
ani = obj.getVar().GetAnimationMap("THROW",
"Character/Mage/Effect/Animation/CreatorMagicSphere/draw_cursor.ani"); //
}
else
{
ani = obj.getVar().GetAnimationMap("BLOCK",
"Character/Mage/Effect/Animation/CreatorMagicSphere/block.ani"); //
}
}
else if (usingSkillIndex == CREATOR_TYPE_GUARDIAN)
{
ani = obj.getVar().GetAnimationMap("GUARD",
"Character/Mage/Effect/Animation/CreatorMagicSphere/guard.ani"); //
}
else if (usingSkillIndex == CREATOR_TYPE_ICE)
{
ani = obj.getVar().GetAnimationMap("ICE",
"Character/Mage/Effect/Animation/CreatorMagicSphere/icesphere.ani"); //
}
else if (usingSkillIndex == CREATOR_TYPE_FLAME)
{
ani = obj.getVar().GetAnimationMap("FIRE",
"Character/Mage/Effect/Animation/CreatorMagicSphere/firesphere.ani"); //
}
else if (usingSkillIndex == CREATOR_TYPE_WIND)
{
ani = obj.getVar().GetAnimationMap("WIND",
"Character/Mage/Effect/Animation/CreatorMagicSphere/wind.ani"); //
}
local state = obj.getState();
if (state == STATE_ICESHIELD)
{
ani = obj.getVar().GetAnimationMap("SHIELD",
"Character/Mage/Effect/Animation/CreatorMagicSphere/shield_cursor_dodge.ani"); //
}
else if (state == STATE_FIREHURRICANE)
{
ani = obj.getVar().GetAnimationMap("HURRICANE",
"Character/Mage/Effect/Animation/CreatorMagicSphere/hurricane_cursor.ani"); //
}
if (ani)
{
local posX = IMouse.GetXPos();
local posY = IMouse.GetYPos();
sq_AnimationProc(ani);
sq_drawCurrentFrame(ani, posX, posY, false);
}
}
_________________________________________________________________________________________________________________________________________________________
//画人物当前图层的ui #初始坐标为人物的偏移
//isOver参数为true画身前 false画身后
function drawAppend_CreatorMage(obj, isOver, x, y)
{
if (!obj.isMyControlObject())
return 0;
return 0;
}
_________________________________________________________________________________________________________________________________________________________
//准备画
function prepareDraw_Avenger(obj)
{
if (!obj) return;
if (isAvengerAwakenning(obj) == true)
{ // isPriestFlow 葬欐高檜 true塭賊.. 陝撩檜 嬴棲堅 罹楝陛雖 褻勒檜 葬蝶 flow煎 緒螳撿 棻..
return S_FLOW_NORMAL;
}
return S_FLOW_PRIEST;
}
_________________________________________________________________________________________________________________________________________________________
//得到设置当前ani的ani
function setCurrentAnimation_Avenger(obj, animation)
{
if (!obj) return;
if (!animation) return;
if (isAvengerAwakenning(obj))
{ // 陝撩 菸蝶陛蛤樹 滲褐 塭賊 setcurrentanimation 腎朝 賅萇 animation擎 癱貲紫 褻瞰婦溼 楚斜蒂 螃衛霾棲棻..
if (animation)
{
animation.setNeverApplyAnotherPlayersEffectAlphaRate(false);
animation.setIsApplyAnotherPlayersEffectAlphaRate(false);
}
}
}
_________________________________________________________________________________________________________________________________________________________
//得到设置可攻击次数范围
function getAttackCancelStartFrameSize_Priest(obj)
{
local maxAttackNumber = obj.sq_GetAttackCancelStartFrameSize();
if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/new_priest/jupiter/ap_jupiter.nut") == true)
maxAttackNumber = 2;
return maxAttackNumber;
}
_________________________________________________________________________________________________________________________________________________________
//得到设置攻击时 在哪一帧按下键时可以进入下一个子状态
function getAttackCancelStartFrame_Priest(obj, index)
{
if(!obj) return null;
local frm = 0;
if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/new_priest/jupiter/ap_jupiter.nut") == true)
{
switch (index)
{
case 0:
frm = 7;
break;
case 1:
frm = 5;
break;
}
}else
frm = obj.sq_GetAttackCancelStartFrame(index);
return frm;
}
_________________________________________________________________________________________________________________________________________________________
//得到设置攻击ani
function getAttackAni_Priest(obj, index)
{
if (!obj) return null;
local animation = obj.sq_GetAttackAni(index);
if (CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/new_priest/jupiter/ap_jupiter.nut") == true)
animation = obj.sq_GetCustomAni(CUSTOM_ANI_PRIEST_JUPITERNORMALATKA_BODY + index);
return animation;
}
_________________________________________________________________________________________________________________________________________________________
//得到设置默认攻击信息
function getDefaultAttackInfo_Priest(obj, index)
{
if (!obj) return null;
local attackInfo = obj.sq_GetDefaultAttackInfo(index);
if (CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/new_priest/jupiter/ap_jupiter.nut") == true)
attackInfo = sq_GetCustomAttackInfo(obj, CUSTOM_ATTACK_PRIEST_JUPITERATTACK1 + index);
return attackInfo;
}
_________________________________________________________________________________________________________________________________________________________
//得到设置跳跃ani
function getJumpAni_Priest(obj)
{
if(!obj) return null;
local ani = null;
if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/new_priest/jupiter/ap_jupiter.nut") == true) {
ani = sq_GetCustomAni(obj, CUSTOM_ANI_PRIEST_JUPITER_QQ506807329_JUMP);
}
else {
ani = obj.sq_GetJumpAni();
}
return ani;
}
_________________________________________________________________________________________________________________________________________________________
//得到设置跳跃升空帧
function getJumpUpStartFrame_Avenger(obj)
{
if (!obj) return null;
local index = 0;
if (isAvengerAwakenning(obj) == true)
{
index = 2;
}
else
index = obj.sq_getJumpUpStartFrame();
return index;
}
_________________________________________________________________________________________________________________________________________________________
//得到设置跳跃下落帧
function getJumpDownStartFrame_Avenger(obj)
{
if (!obj) return null;
local index = 0;
if (isAvengerAwakenning(obj) == true)
{
index = 5;
}
else
index = obj.sq_getJumpDownStartFrame();
return index;
}
_________________________________________________________________________________________________________________________________________________________
//得到设置跳跃落地帧
function getJumpLandStartFrame_Avenger(obj)
{
if (!obj) return null;
local index = 0;
if (isAvengerAwakenning(obj) == true)
{
index = 7;
}
else
index = obj.sq_getJumpLandStartFrame();
return index;
}
_________________________________________________________________________________________________________________________________________________________
//得到设置跳跃攻击ani
function getJumpAttackAni_Priest(obj)
{
if(!obj) return null;
local ani = null;
if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/new_priest/jupiter/ap_jupiter.nut") == true) {
ani = sq_GetCustomAni(obj, CUSTOM_ANI_PRIEST_JUPITERHAMMERJUMPATK_BODY);
}
else {
ani = obj.sq_GetJumpAttackAni();
}
return ani;
}
_________________________________________________________________________________________________________________________________________________________
//得到设置跳跃攻击信息
function getJumpAttackAni_Priest(obj)
{
if(!obj) return null;
local ani = null;
if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/new_priest/jupiter/ap_jupiter.nut") == true) {
ani = sq_GetCustomAni(obj, CUSTOM_ANI_PRIEST_JUPITERHAMMERJUMPATK_BODY);
}
else {
ani = obj.sq_GetJumpAttackAni();
}
return ani;
}
_________________________________________________________________________________________________________________________________________________________
//得到设置前冲攻击ani
function getDashAttackAni_Priest(obj)
{
if(!obj) return null;
local ani = null;
if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/new_priest/jupiter/ap_jupiter.nut") == true) {
ani = sq_GetCustomAni(obj, CUSTOM_ANI_PRIEST_JUPITERHAMMERDASHATK_BODY);
}
else {
ani = obj.sq_GetDashAttackAni();
}
return ani;
}
_________________________________________________________________________________________________________________________________________________________
//得到设置前冲攻击信息
function getDashAttackInfo_Avenger(obj)
{
if (!obj) return null;
local atk = null;
if (isAvengerAwakenning(obj) == true)
{
atk = sq_GetCustomAttackInfo(obj, CUSTOM_ATTACKINFO_AW_DASHATTACK);
local state = obj.sq_GetSTATE();
local power = obj.sq_getBonusRateWithPassive(SKILL_AVENGER_AWAKENING, state, SL_DASH_MAGIC_ATK, 1.0);
obj.sq_setCurrentAttackBonusRate(power);
}
else if (CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/new_priest/metamorphosis/ap_metamorphosis.nut"))//是半魔化狀態
{
atk = sq_GetCustomAttackInfo(obj, CUSTOM_ATTACK_PRIEST_METAMORPHOSISDASHATTACK);
}
return atk;
}
_________________________________________________________________________________________________________________________________________________________
//得到设置前冲攻击停下帧
function getDashAttackSlideStopFrame_Avenger(obj)
{
if (!obj) return null;
local index = -1;
if (isAvengerAwakenning(obj) == true)
{ // 橫漸螳 陝撩賅萄塭賊
index = 15;
}
else
{
index = obj.sq_getDashAttackSlideStopFrame();
}
return index;
}
_________________________________________________________________________________________________________________________________________________________
//得到设置站立ani
function getStayAni_Priest(obj)
{
if(!obj) return null;
local ani = null;
if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/new_priest/jupiter/ap_jupiter.nut") == true) {
ani = sq_GetCustomAni(obj, CUSTOM_ANI_PRIEST_JUPITER_QQ506807329_STAY);
}
else {
ani = obj.sq_GetStayAni();
}
return ani;
}
_________________________________________________________________________________________________________________________________________________________
//得到设置行走ani
function getMoveAni_Priest(obj)
{
if(!obj) return null;
local ani = null;
if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/new_priest/jupiter/ap_jupiter.nut") == true) {
ani = sq_GetCustomAni(obj, CUSTOM_ANI_PRIEST_JUPITER_QQ506807329_MOVE);
}
else {
ani = obj.sq_GetMoveAni();
}
return ani;
}
_________________________________________________________________________________________________________________________________________________________
//得到设置死亡ani
function getSitAni_Priest(obj)
{
if(!obj) return null;
local ani = null;
if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/new_priest/jupiter/ap_jupiter.nut") == true) {
ani = sq_GetCustomAni(obj, CUSTOM_ANI_PRIEST_JUPITER_QQ506807329_SIT);
}
else {
ani = obj.sq_GetSitAni();
}
return ani;
}
_________________________________________________________________________________________________________________________________________________________
//得到被攻击伤害ani
function getDamageAni_Priest(obj, index)
{
if(!obj) return null;
local ani = null;
if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/new_priest/jupiter/ap_jupiter.nut") == true) {
if(index == 0)
ani = sq_GetCustomAni(obj, CUSTOM_ANI_PRIEST_JUPITER_QQ506807329_DAMAGE1);
else if(index == 1)
ani = sq_GetCustomAni(obj, CUSTOM_ANI_PRIEST_JUPITER_QQ506807329_DAMAGE2);
}
else {
ani = obj.sq_GetDamageAni(index);
}
return ani;
}
_________________________________________________________________________________________________________________________________________________________
//得到设置从站立到倒地时的ani
function getDownAni_Priest(obj)
{
if(!obj) return null;
local ani = null;
if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/new_priest/jupiter/ap_jupiter.nut") == true) {
ani = sq_GetCustomAni(obj, CUSTOM_ANI_PRIEST_JUPITER_QQ506807329_DOWN);
}
else {
ani = obj.sq_GetDownAni();
}
return ani;
}
_________________________________________________________________________________________________________________________________________________________
//得到设置循环倒地ani
function getOverturnAni_Priest(obj)
{
if(!obj) return null;
local ani = null;
if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/new_priest/jupiter/ap_jupiter.nut") == true) {
ani = sq_GetCustomAni(obj, CUSTOM_ANI_PRIEST_JUPITER_QQ506807329_OVERTURN);
}
else {
ani = obj.sq_GetOverturnAni();
}
return ani;
}
_________________________________________________________________________________________________________________________________________________________
//得到设置城镇站立站街动作ani
function getRestAni_Priest(obj)
{
if(!obj) return null;
local ani = null;
if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/new_priest/jupiter/ap_jupiter.nut") == true) {
ani = sq_GetCustomAni(obj, CUSTOM_ANI_PRIEST_JUPITER_QQ506807329_REST);
}
else {
ani = obj.sq_GetRestAni();
}
return ani;
}
_________________________________________________________________________________________________________________________________________________________
//得到设置13状态下的 第一蓄力第二施放ani
function getThrowChargeAni_Priest(obj, index)
{
if(!obj) return null;
local ani = null;
if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/new_priest/jupiter/ap_jupiter.nut") == true) {
switch (index)
{
case 0: ani = sq_GetCustomAni(obj, CUSTOM_ANI_PRIEST_JUPITER_QQ506807329_THROW1); break;
case 1: ani = sq_GetCustomAni(obj, CUSTOM_ANI_PRIEST_JUPITER_QQ506807329_PRAY1); break;
case 2: ani = sq_GetCustomAni(obj, CUSTOM_ANI_PRIEST_JUPITER_QQ506807329_DELIVER1); break;
case 3: ani = sq_GetCustomAni(obj, CUSTOM_ANI_PRIEST_JUPITER_QQ506807329_BLAST1); break;
}
}
else {
ani = obj.sq_GetThrowChargeAni(index);
}
return ani;
}
function getThrowShootAni_Priest(obj, index)
{
if(!obj) return null;
local ani = null;
if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/new_priest/jupiter/ap_jupiter.nut") == true) {
switch (index)
{
case 0: ani = sq_GetCustomAni(obj, CUSTOM_ANI_PRIEST_JUPITER_QQ506807329_THROW2); break;
case 1: ani = sq_GetCustomAni(obj, CUSTOM_ANI_PRIEST_JUPITER_QQ506807329_PRAY2); break;
case 2: ani = sq_GetCustomAni(obj, CUSTOM_ANI_PRIEST_JUPITER_QQ506807329_DELIVER2); break;
case 3: ani = sq_GetCustomAni(obj, CUSTOM_ANI_PRIEST_JUPITER_QQ506807329_BLAST2); break;
}
}
else {
ani = obj.sq_GetThrowShootAni(index);
}
return ani;
}
_________________________________________________________________________________________________________________________________________________________
//得到设置前冲ani
function getDashAni_Priest(obj)
{
if(!obj) return null;
local ani = null;
if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/new_priest/jupiter/ap_jupiter.nut") == true) {
ani = sq_GetCustomAni(obj, CUSTOM_ANI_PRIEST_JUPITER_QQ506807329_DASH);
}
else {
ani = obj.sq_GetDashAni();
}
return ani;
}
_________________________________________________________________________________________________________________________________________________________
//得到设置捡到物品时的ani
function getGetItemAni_Priest(obj)
{
if(!obj) return null;
local ani = null;
if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/new_priest/jupiter/ap_jupiter.nut") == true) {
ani = sq_GetCustomAni(obj, CUSTOM_ANI_PRIEST_JUPITER_QQ506807329_GETITEM);
}
else {
ani = obj.sq_GetGetItemAni();
}
return ani;
}
_________________________________________________________________________________________________________________________________________________________
//得到设置创建buff时的ani 17状态下
function getBuffAni_Priest(obj)
{
if(!obj) return null;
local ani = null;
if(CNSquirrelAppendage.sq_IsAppendAppendage(obj, "character/new_priest/jupiter/ap_jupiter.nut") == true) {
ani = sq_GetCustomAni(obj, CUSTOM_ANI_PRIEST_JUPITER_QQ506807329_BUFF);
}
else {
ani = obj.sq_GetBuffAni();
}
return ani;
}
_________________________________________________________________________________________________________________________________________________________
//角色状态的事件函数名 #俗称角色状态事件函数
//设置状态时
function onSetState_WaterCannon(obj, state, datas, isResetTimer)
{
if (!obj) return;
}
_________________________________________________________________________________________________________________________________________________________
//设置状态后
function onAfterSetState_fastmove(obj, state, datas, isResetTimer)
{
if(!obj) return;
}
_________________________________________________________________________________________________________________________________________________________
//ani的key flag标签事件
function onKeyFrameFlag_WaterCannon(obj, flagIndex)
{
if (!obj) return false;
return true;
}
_________________________________________________________________________________________________________________________________________________________
//ani当前帧函数 #缔造者
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;
}
_________________________________________________________________________________________________________________________________________________________
//当前ani播放结束时
function onEndCurrentAni_FirePillar(obj)
{
if(!obj) return;
}
_________________________________________________________________________________________________________________________________________________________
//按下技能键时
function checkExecutableSkill_FirePillar(obj)
{
if(!obj) return false;
local b_useskill = obj.sq_IsUseSkill(SKILL_FIREPILLAR);
if(b_useskill)
{
obj.sq_IntVectClear();
obj.sq_IntVectPush(SUB_STATE_FIREPILLAR_0); // substate세팅
obj.sq_AddSetStatePacket(STATE_FIREPILLAR, STATE_PRIORITY_IGNORE_FORCE, true);
return true;
}
return false;
}
_________________________________________________________________________________________________________________________________________________________
//被攻击前
//复仇者函数
function onBeforeDamage_fastmove(obj, attacker, boundingBox)
{
if(!obj) return;
}
_________________________________________________________________________________________________________________________________________________________
//其他职业函数
function onBeforeDamage_FireHurricane(obj,attacker,boundingBox,isStuck)
{
if(!obj) return;
}
_________________________________________________________________________________________________________________________________________________________
//被攻击时
//复仇者函数
function onDamage_fastmove(obj, attacker, boundingBox)
{
if(!obj) return;
}
_________________________________________________________________________________________________________________________________________________________
//其他职业函数
function onDamage_FireHurricane(obj,attacker,boundingBox)
{
if(!obj) return;
}
_________________________________________________________________________________________________________________________________________________________
//被攻击后
//复仇者函数
function onAfterDamage_fastmove(obj, attacker, boundingBox)
{
if(!obj) return;
}
_________________________________________________________________________________________________________________________________________________________
//其他职业函数
function onAfterDamage_FireHurricane(obj,attacker,boundingBox)
{
if(!obj) return;
}
_________________________________________________________________________________________________________________________________________________________
//攻击到前
//复仇者函数
function onBeforeAttack_fastmove(obj, damager, boundingBox)
{
if(!obj) return;
}
_________________________________________________________________________________________________________________________________________________________
//其他职业函数
function onBeforeAttack_FireHurricane(obj,damager,boundingBox,isStuck)
{
if(!obj) return;
}
_________________________________________________________________________________________________________________________________________________________
//攻击到时
//复仇者函数
function onAttack_fastmove(obj, damager, boundingBox)
{
if(!obj) return;
local subState = obj.getSkillSubState();
}
_________________________________________________________________________________________________________________________________________________________
//其他职业函数
function onAttack_BrokenArrow(obj, damager, boundingBox, isStuck)
{
if(!obj) return;
local subState = obj.getSkillSubState();
}
_________________________________________________________________________________________________________________________________________________________
//攻击到后
//复仇者函数
function onAfterAttack_fastmove(obj, damager, boundingBox)
{
if(!obj) return 0;
return 1;
}
_________________________________________________________________________________________________________________________________________________________
//其他职业函数
function onAfterAttack_FireHurricane(obj,damager,boundingBox,isStuck)
{
if(!obj) return 0;
return 1;
}
_________________________________________________________________________________________________________________________________________________________
//结束当前状态时
function onEndState_fastmove(obj, new_state)
{
if(!obj) return;
if(new_state != STATE_FASTMOVE)
{
}
}
_________________________________________________________________________________________________________________________________________________________
//定时时钟时间
function onTimeEvent_CrystalAttack(obj, timeEventIndex, timeEventCount)
{
if(!obj) return true;
}
_________________________________________________________________________________________________________________________________________________________
//技能效果包
function onChangeSkillEffect_FireHurricane(obj, skillIndex, reciveData)
{
if (!obj) return;
local subState = obj.getSkillSubState();
if (substate == SUB_STATE_FIREHURRICANE_0)
{
}
}
_________________________________________________________________________________________________________________________________________________________
//传递
sq_BinaryStartWrite();
sq_BinaryWriteBool();
sq_BinaryWriteFloat();
sq_BinaryWriteWord();
sq_BinaryWriteByte();
sq_BinaryWriteDword();
_________________________________________________________________________________________________________________________________________________________
//人物传递
obj.sq_StartWrite();
obj.sq_WriteBool();
obj.sq_WriteFloat();
obj.sq_WriteWord();
obj.sq_WriteByte();
obj.sq_WriteDword();
_________________________________________________________________________________________________________________________________________________________
sq_SendChangeSkillEffectPacket(obj, SKILL_ATFIGHTER_GLANCETHEHOST);//发送
_________________________________________________________________________________________________________________________________________________________
//接收
reciveData.readBool();
reciveData.readByte();
reciveData.readWord();
reciveData.readDword();
reciveData.readFloat();
_________________________________________________________________________________________________________________________________________________________
//被动 #组队双方运行
function onProc_WaterCannon(obj)
{
if (!obj) return;
}
_________________________________________________________________________________________________________________________________________________________
//被动 #组队我自己运行
function onProcCon_FireHurricane(obj)
{
if(!obj) return;
}
_________________________________________________________________________________________________________________________________________________________
//得到我创建的对象
function onCreateObject_PowerOfDarkness(obj, createObject)
{
local sq_var = obj.getVar();
local cuid = sq_GetUniqueId(createObject);
local circleIndex = sq_var.getInt(POD_VAR_CIRCLE_INDEX);
if(cuid == circleIndex) {
local group = sq_GetGroup(createObject);
local uid = sq_GetUniqueId(createObject);
sq_var.setObject(POD_VAR_CIRCLE_OBJECT, createObject);
sq_var.setInt(POD_VAR_CIRCLE_OBJECT_GROUP, group);
sq_var.setInt(POD_VAR_CIRCLE_OBJECT_UID, uid);
}
}
local circleIndex = sq_SendCreatePassiveObjectPacket(obj,24107, 0, 172, 2, 97,obj.getDirection());
_________________________________________________________________________________________________________________________________________________________
//得到设置视角坐标
function getScrollBasisPos_ElementalBuster(obj)
{
if (!obj) return;
local subState = obj.getSkillSubState();
if (obj.isMyControlObject())
{
local destX = sq_GetDistancePos(obj.getXPos(), obj.getDirection(), 300);
local xPos = obj.getXPos();
local var = obj.getVar();
local isLast = var.getBool(VAR_ELEMENTAL_BUSTER_IS_LAST);
if (subState == SUB_STATE_ELEMENTAL_BUSTER_START)
{
local stateTimer = obj.sq_GetStateTimer();
xPos = sq_GetUniformVelocity(xPos, destX, stateTimer, 300);
}
else if (isLast)
{
local stateTimer = obj.sq_GetStateTimer();
xPos = sq_GetUniformVelocity(destX, xPos, stateTimer, 300);
}
else
{
xPos = destX;
}
obj.sq_SetCameraScrollPosition(xPos, obj.getYPos(), 0);
return true;
}
return false;
}
_________________________________________________________________________________________________________________________________________________________
//结束当前map时
function onEndMap_ElementalRain(obj)
{
if (obj.sq_IsMyControlObject())
{
local ballCount = obj.getMyPassiveObjectCount(24233);
printc("ballCount" + ballCount);
for (local i = 0; i < ballCount ; ++i)
{
local magicBall = obj.getMyPassiveObject(24233,i)
if (!magicBall)
continue;
if (obj.sq_IsMyControlObject())
{
print("onEndMap_ElementalRain");
sq_SendDestroyPacketPassiveObject(magicBall);
}
}
}
}
_________________________________________________________________________________________________________________________________________________________
//po事件函数名 #特效nut的事件函数
//被创建时设置自定义数据 #可以得到传递过来的数据
function setCustomData_po_ATMagicBallLight(obj, receiveData)
{
if(!obj) return;
}
_________________________________________________________________________________________________________________________________________________________
//传递
sq_BinaryStartWrite();
sq_BinaryWriteBool();
sq_BinaryWriteFloat();
sq_BinaryWriteWord();
sq_BinaryWriteByte();
sq_BinaryWriteDword();
_________________________________________________________________________________________________________________________________________________________
//人物传递
obj.sq_StartWrite();
obj.sq_WriteBool();
obj.sq_WriteFloat();
obj.sq_WriteWord();
obj.sq_WriteByte();
obj.sq_WriteDword();
_________________________________________________________________________________________________________________________________________________________
//接收
reciveData.readBool();
reciveData.readByte();
reciveData.readWord();
reciveData.readDword();
reciveData.readFloat();
_________________________________________________________________________________________________________________________________________________________
//设置状态时
function setState_po_ATPieceOfIceCore(obj, state, datas)
{
if(!obj) return;
if(state == PIECE_OF_ICE_CORE_STATE_DAMAGE)
{
local ani = obj.getCurrentAnimation();
local var = obj.getVar();
if(ani) {
local currentIndex = sq_GetVectorData(datas, 0) + 3;
ani.setCurrentFrameWithChildLayer(currentIndex);
}
local timer = var.get_ct_vector(0);
var.setInt(PIECE_OF_ICE_CORE_VAR_SHAKE_END_TIME, timer.Get() + 50);
sq_SetMyShake(obj,2,80);
}
else if(state == PIECE_OF_ICE_CORE_STATE_END)
{
local ani = obj.getCurrentAnimation();
if(ani)
ani.setCurrentFrameWithChildLayer(10); // 마지막 프레임
}
}
_________________________________________________________________________________________________________________________________________________________
//得到传递过来的数据
sq_GetVectorData(datas, 0);
_________________________________________________________________________________________________________________________________________________________
//结束当前ani时
function onEndCurrentAni_po_ATConcentrateExpSmall(obj)
{
if (!obj) return;
if (obj.isMyControlObject()) {
sq_SendDestroyPacketPassiveObject(obj);
}
}
_________________________________________________________________________________________________________________________________________________________
//攻击到时
function onAttack_po_ATIceManMagicCircle(obj, damager, boundingBox, isStuck)
{
if(!obj)
return 0;
local pChr = obj.getTopCharacter();
if(!pChr)
return 0;
local active_damager = sq_GetCNRDObjectToActiveObject(damager);
if(!active_damager)
return 0;
local passiveState = obj.getVar("state").get_vector(0);
if(passiveState == PASSIVEOBJ_SUB_STATE_1)
{
local rand = sq_getRandom(0, 100);
local rate = obj.getVar("freezeRate").get_vector(0);
print(" rate:" + rate + " rand" + rand);
// 이속확율이 넘어가야 이속감소 어펜디지를 걸어줍니다..
if(rand <= obj.getVar("freezeRate").get_vector(0))
{
CNSquirrelAppendage.sq_AppendAppendage(damager, pChr, SKILL_ICEMAN,
true, "Character/ATMage/IceMan/ap_ATIceManMagicCircle.nut", true);
}
}
return 0;
}
_________________________________________________________________________________________________________________________________________________________
//攻击后时
function onAfterAttack_po_ATWaterCannon(obj, damager, boundingBox, isStuck)
{
if (!obj)
return 0;
if(obj.isMyControlObject())
{
sq_SendDestroyPacketPassiveObject(obj);
}
return 0;
}
_________________________________________________________________________________________________________________________________________________________
//被动
function procAppend_po_ATPieceOfIceCore(obj)
{
if(!obj) return;
local var = obj.getVar();
local timer = var.get_ct_vector(0);
local shakeEndTime = var.getInt(PIECE_OF_ICE_CORE_VAR_SHAKE_END_TIME);
local shakeValue = 0;
if(timer.Get() < shakeEndTime && obj.getState() != PIECE_OF_ICE_CORE_STATE_END)
shakeValue = (sq_GetShuttleValue(0, 6,sq_GetObjectTime(obj),100)-3);
local x = var.getInt(PIECE_OF_ICE_CORE_VAR_START_X) + shakeValue;
local y = obj.getYPos();
local z = sq_GetShuttleValue(55, 65,sq_GetObjectTime(obj),1200);
sq_SetCurrentPos(obj, x, y, z);
}
_________________________________________________________________________________________________________________________________________________________
//ani的key flag标签
function onKeyFrameFlag_po_ATPieceOfIceCore(obj, flagIndex)
{
if(!obj)
return false;
if(flagIndex == 1)
{
sq_SetMyShake(obj,3,100);
}
if(flagIndex == 2)
{
obj.sendStateOnlyPacket(PIECE_OF_ICE_CORE_STATE_END);
}
return true;
}
_________________________________________________________________________________________________________________________________________________________
//返回值应用:返回true 运行成功, 返回false 运行不成功 会多运行几次
//时钟事件
function onTimeEvent_po_ATHolongLight(obj, timeEventIndex, timeEventCount)
{
if(!obj)
return false;
if(obj.isMyControlObject() && timeEventIndex == 0)
{
if(obj.getState() == HOLONG_LIGHT_STATE_BUFF) {
obj.sendStateOnlyPacket(HOLONG_LIGHT_STATE_DESTROY);
local mage = sq_ObjectToSQRCharacter(obj.getTopCharacter());
if (mage)
mage.sq_RemoveSkillLoad(SKILL_HOLONG_LIGHT);
}
return true; // true면 콜백 중단
}
else if( timeEventIndex == 1 )
{
obj.sendStateOnlyPacket(HOLONG_LIGHT_STATE_EXPLOSION);
}
return false;
}
_________________________________________________________________________________________________________________________________________________________
//返回值的应用 :返回false 代表此时钟没有运行成功 true代表此时钟运行成功
//运行不成功可能会造成此函数一直运行
//当前技能效果
function onChangeSkillEffect_po_ATIceChakramSmallIceRing(obj, skillIndex, reciveData)
{
if(!obj) return;
if(skillIndex != SKILL_ICECHAKRAM) return;
local pChr = obj.getTopCharacter();
if(!pChr) return;
local changeAngle = reciveData.readFloat();
//print( " changeAngle:" + changeAngle);
local t = obj.getVar("sr").get_ct_vector(0);
if(!t)
return;
t.Reset();
t.Start(10000,0);
//print( " changeAngle:" + changeAngle);
//local bombingStartAngle_ = obj.getVar("sr").get_vector(1)
//local bombingChangeAngle_ = obj.getVar("sr").get_vector(0);
obj.getVar("sr").set_vector(0, changeAngle.tointeger());
local currentAng = obj.getVar("angle").get_vector(0);
obj.getVar("sr").set_vector(1, currentAng);
}
_________________________________________________________________________________________________________________________________________________________
//传递
sq_BinaryStartWrite();
sq_BinaryWriteBool();
sq_BinaryWriteFloat();
sq_BinaryWriteWord();
sq_BinaryWriteByte();
sq_BinaryWriteDword();
_________________________________________________________________________________________________________________________________________________________
//人物传递
obj.sq_StartWrite();
obj.sq_WriteBool();
obj.sq_WriteFloat();
obj.sq_WriteWord();
obj.sq_WriteByte();
obj.sq_WriteDword();
_________________________________________________________________________________________________________________________________________________________
sq_SendChangeSkillEffectPacket(obj, SKILL_ATFIGHTER_GLANCETHEHOST);//发送
_________________________________________________________________________________________________________________________________________________________
//接收
reciveData.readBool();
reciveData.readByte();
reciveData.readWord();
reciveData.readDword();
reciveData.readFloat();
_________________________________________________________________________________________________________________________________________________________
//我创建的对象被破坏时
function onDestroyObject_po_ATHolongLight(obj, destroyObj)
{
local parentObj = obj.getParent();
parentObj = sq_ObjectToSQRCharacter(parentObj);
if(!parentObj || isSameObject(parentObj,destroyObj)) { //부모 객체가 파괴되면 사라짐
obj.sendStateOnlyPacket(HOLONG_LIGHT_STATE_DESTROY);
}
}
_________________________________________________________________________________________________________________________________________________________
//攻击到时可设置攻击效果ani #不支持带als的ani
function getCustomHitEffectFileName_po_ATBrokenArrow(obj, isAttachOnDamager)
{
return "PassiveObject/Character/Mage/Animation/ATBrokenArrow/02_arrowboom_dodge.ani";
}
_________________________________________________________________________________________________________________________________________________________
//得到被攻击方向
function getHitDirection_po_ATConcentrateExpSmall(obj, damager)
{
if (!obj) return 0;
return sq_GetOppositeDirection(obj.getDirection());
}
_________________________________________________________________________________________________________________________________________________________
//我自己被破坏销毁时
function destroy_po_ATIceChakramLarge(obj)
{
sq_RemoveParticle("PassiveObject/Character/Mage/Particle/ATIceChakramDust.ptl", obj);
obj.stopSound(2711);
}
_________________________________________________________________________________________________________________________________________________________
//重置时 #没测试
function reset_po_ATDarknessMantle(obj)
{
}
_________________________________________________________________________________________________________________________________________________________
//ap事件函数名 #附加appendage的事件函数名
//ap增加效果ani
function sq_AddEffect(appendage)
{
appendage.sq_AddEffectBack("Character/Common/Animation/BusterMode/buster_loop_back_normal.ani");//背后
appendage.sq_AddEffectFront("Character/Common/Animation/BusterMode/buster_loop_front_normal.ani");//身前
}
_________________________________________________________________________________________________________________________________________________________
appendage.sq_DeleteEffectFront();//删除身前ani
appendage.sq_DeleteEffectBack();//删除身后ani
local ani = appendage.sq_GetFrontAnimation(0);//得到身前的ani
local ani = appendage.sq_GetBackAnimation(0);//得到身后的ani
_________________________________________________________________________________________________________________________________________________________
//是否是结束
local isEnd = sq_IsEnd(ani);
if(isEnd)
{
appendage.setValid(false);//销毁ap
}
_________________________________________________________________________________________________________________________________________________________
//一开始时的设置
function sq_AddFunctionName(appendage)
{
appendage.sq_AddFunctionName("onStart", "onStart_appendage_IceCrash")
}
function onStart_appendage_IceCrash(appendage)
{
if(!appendage) {
return;
}
local parentObj = appendage.getParent();
local sourceObj = appendage.getSource();
if(!sourceObj || !parentObj) {
appendage.setValid(false);
return;
}
}
_________________________________________________________________________________________________________________________________________________________
//进入下一个map时
function sq_AddFunctionName(appendage)
{
appendage.sq_AddFunctionName("onStartMap", "onStartMap_appendage_common_burster")
}
function onStartMap_appendage_common_burster(appendage)
{
if(!appendage)
return;
local obj = appendage.getParent();
if(!obj)
{
appendage.setValid(false);
return;
}
local validT = appendage.getAppendageInfo().getValidTime();
local useTime = appendage.getTimer().Get();
local remainT = validT - useTime;
print(" remain validT:" + remainT);
if (obj.isMyControlObject())
{
if (remainT > 0)
{
sq_flashScreen(obj, 0, remainT, 300, 150, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM);
}
}
}
_________________________________________________________________________________________________________________________________________________________
//ap销毁结束时
function sq_AddFunctionName(appendage)
{
appendage.sq_AddFunctionName("onEnd", "onEnd_appendage_atmage_bodyeffect")
}
function onEnd_appendage_PushOut(appendage)
{
if(!appendage) {
return;
}
local parentObj = appendage.getParent();
if(!parentObj) {
appendage.setValid(false);
return;
}
if (parentObj.getState() == STATE_HOLD) {
appendage.setValid(false);
parentObj.sendStateOnlyPacket(STATE_STAND);
}
// TODO : x축 우선 체크 할것. 지금은 y축으로 내려와 버려서 연속기가 안됨
//local ao = sq_GetCNRDObjectToActiveObject(parentObj);
//if(ao && sq_IsMyControlObject(ao) && !ao.isMovablePos(ao.getXPos(),ao.getYPos())) {
//sq_SimpleMoveToNearMovablePos(ao,100); // 이동불가 지역에 있다면 이동가능지역으로 이동
//}
}
_________________________________________________________________________________________________________________________________________________________
//ap销毁结束时判断是否可结束
function sq_AddFunctionName(appendage)
{
appendage.sq_AddFunctionName("isEnd", "isEnd_appendage_atmage_bodyeffect")
}
function isEnd_appendage_avenger_awakening(appendage)
{
local T = appendage.getTimer().Get();
if(appendage.sq_var.size_vector() != (I_AVENGER_AWAKENING_VALID + 1)) {
return true;
}
local maxT = appendage.sq_var.get_vector(I_AVENGER_AWAKENING_TIME);
local doomshp = appendage.sq_var.get_vector(I_DOOMS_HP); // 변신한 어벤져의 hp값
if(T >= maxT || doomshp <= 0) { // 시간이 다 됐거나 둠스가디언 hp가 다 닳았다면.. 끝이다..
//if(T >= maxT) {
return true;
}
return false;
}
_________________________________________________________________________________________________________________________________________________________
//在ap中进行判断才会运行 isEnd 函数
appendage.isEnd();
_________________________________________________________________________________________________________________________________________________________
//有效时间结束时
function sq_AddFunctionName(appendage)
{
appendage.sq_AddFunctionName("onVaildTimeEnd", "onVaildTimeEnd_appendage_atmage_elemental_change")
}
function onVaildTimeEnd_appendage_atmage_elemental_change(appendage)
{
if(!appendage)
return;
local parentObj = appendage.getParent();
local sourceObj = appendage.getSource();
if(!sourceObj || !parentObj) {
appendage.setValid(false);
return;
}
local mage = sq_ObjectToSQRCharacter(parentObj);
if(mage)
mage.setThrowElement(ENUM_ELEMENT_NONE);
// 보호막형성 처리
local appendage = CNSquirrelAppendage.sq_GetAppendage(mage,"Character/ATMage/MagicShield/ap_MagicShield.nut");
if(appendage)
setMagicShieldType(appendage, mage, mage.getThrowElement());
}
_________________________________________________________________________________________________________________________________________________________
//被动
function sq_AddFunctionName(appendage)
{
appendage.sq_AddFunctionName("proc", "proc_appendage_atmage_diehard")
}
function proc_appendage_atmage_diehard(appendage)
{
if(!appendage) {
return;
}
local parentObj = appendage.getParent();
if(!parentObj)
{
appendage.setValid(false);
return;
}
}
_________________________________________________________________________________________________________________________________________________________
//附加对象被攻击时
function sq_AddFunctionName(appendage)
{
appendage.sq_AddFunctionName("onDamageParent", "onDamageParent_appendage_MagicShield")
}
function onDamageParent_appendage_MagicShield(appendage ,attacker, boundingBox, isStuck)
{
if (!appendage) {
return;
}
local parentObj = appendage.getParent();
parentObj = sq_GetCNRDObjectToSQRCharacter(parentObj);
if (!parentObj) {
appendage.setValid(false);
return;
}
}
_________________________________________________________________________________________________________________________________________________________
//附加对象攻击时 #这里也包括附加对象创建的特效
function sq_AddFunctionName(appendage)
{
appendage.sq_AddFunctionName("onAttackParent", "onAttackParent_appendage_common_burster")
}
function onAttackParent_appendage_common_burster(appendage, realAttacker, damager, boundingBox, isStuck)
{
if(!appendage) {
return;
}
// 버스터모드로 쳤다면..
if (appendage.isValid())
{
local centerX = sq_GetCenterXPos(boundingBox);
local centerZ = sq_GetCenterZPos(boundingBox);
local posY = damager.getYPos();
local hitEffAni = sq_CreateAnimation("","Character/Common/Animation/BusterMode/buster_hit_back_normal1.ani");
local hitBackEffObj = sq_CreatePooledObject(hitEffAni, true);
hitBackEffObj.setCurrentPos(centerX, posY - 1, centerZ);
sq_AddObject(realAttacker, hitBackEffObj, OBJECTTYPE_DRAWONLY, false);
local hitFrontEffAni = sq_CreateAnimation("","Character/Common/Animation/BusterMode/buster_hit_front_dodge.ani");
local hitFrontEffObj = sq_CreatePooledObject(hitFrontEffAni, true);
hitFrontEffObj.setCurrentPos(centerX, posY + 1, centerZ);
sq_AddObject(realAttacker, hitFrontEffObj, OBJECTTYPE_DRAWONLY, false);
}
}
_________________________________________________________________________________________________________________________________________________________
//附加对象设置hp时
function sq_AddFunctionName(appendage)
{
appendage.sq_AddFunctionName("onSetHp", "onSetHp_appendage_avenger_awakening")
}
function onSetHp_appendage_avenger_awakening(appendage, hp, attacker)
{
local obj = appendage.getParent();
if(appendage.sq_var.size_vector() != (I_AVENGER_AWAKENING_VALID + 1)) {
return -1;
}
if(attacker && obj && obj.isEnemy(attacker))
{ // 적에 의한
local org_hp = hp;
if (org_hp <= 0) {
org_hp = 1;
appendage.sq_var.set_vector(I_DOOMS_HP, 0);
}
return org_hp;
}
return -1;
}
_________________________________________________________________________________________________________________________________________________________
//设置被攻击的伤害率
function sq_AddFunctionName(appendage)
{
appendage.sq_AddFunctionName("getImmuneTypeDamageRate", "getImmuneTypeDamageRate_appendage_MagicShield")
}
function getImmuneTypeDamageRate_appendage_MagicShield(appendage, damageRate, attacker)
{
if (!appendage)
return damageRate;
local parentObj = appendage.getParent();
parentObj = sq_GetCNRDObjectToSQRCharacter(parentObj);
if (!parentObj) {
appendage.setValid(false);
return damageRate;
}
local var = appendage.getVar();
if (!var)
return damageRate;
local type = parentObj.getThrowElement();
// 수속성 : 데미지 일정 횟수 완전 방어
if (type == ENUM_ELEMENT_WATER)
return 0;
local type = parentObj.getThrowElement();
// 레벨인포로 데미지율이 조정됨.
local skill_level = parentObj.sq_GetSkillLevel(SKILL_MAGIC_SHIELD);
local decreaseRate = parentObj.sq_GetLevelData(SKILL_MAGIC_SHIELD, 1, skill_level); // 1. 데미지 감소율(%)
damageRate = damageRate - decreaseRate;
return damageRate;
}
_________________________________________________________________________________________________________________________________________________________
//源对象的ani key flag标签
function sq_AddFunctionName(appendage)
{
appendage.sq_AddFunctionName("onSourceKeyFrameFlag", "onSourceKeyFrameFlag_appendage_mage_electricrabbit");
}
function onSourceKeyFrameFlag_appendage_mage_electricrabbit(appendage,flagIndex)
{
if(!appendage) return;
local obj = appendage.getParent();
if(obj)
{
obj = sq_GetCNRDObjectToSQRCharacter(obj);
obj.getVar("debugnew2").push_vector(flagIndex);
obj.getVar("debugnew2").push_vector(attacker.getXPos());
}
}
_________________________________________________________________________________________________________________________________________________________
//附加对象创建的对象被破坏时
function sq_AddFunctionName(appendage)
{
appendage.sq_AddFunctionName("onDestroyObject", "onDestroyObject_appendage_grab_icemagic")
}
function onDestroyObject_appendage_grab_icemagic(appendage, destroyObj)
{
if(!appendage)
return true;
if (destroyObj == appendage.sq_GetSourceChrTarget())
{
appendage.setValid(false);
}
return true;
}
_________________________________________________________________________________________________________________________________________________________
//可以画出附加对象图层的动画ani
function sq_AddFunctionName(appendage)
{
appendage.sq_AddFunctionName("drawAppend", "drawAppend_appendage_MagicShield")
}
_________________________________________________________________________________________________________________________________________________________
//参数x y为我自己的位置
//isOver参数为true画身前 false画身后
//isFlip判断是否翻转
function drawAppend_appendage_MagicShield(appendage, isOver, x, y, isFlip)
{
if (!appendage) {
return;
}
local obj = appendage.getParent();
if (!obj) {
appendage.setValid(false);
return;
}
local var = appendage.getVar();
local backAni = var.getAnimation(VAR_MAGIC_SHIELD_BACK_ANI);
local frontAni = var.getAnimation(VAR_MAGIC_SHIELD_FRONT_ANI);
if (frontAni && isOver) {
sq_AnimationProc(frontAni);
sq_drawCurrentFrame(frontAni, x, y, isFlip);
}
else if (backAni && !isOver) {
sq_AnimationProc(backAni);
sq_drawCurrentFrame(backAni, x, y, isFlip);
}
_________________________________________________________________________________________________________________________________________________________
//自定义ani
local Ani = var.GetAnimationMap("flashcutbg_01", "character/swordman/effect/animation/flashcut/flashcutbg_01.ani");
sq_AnimationProc(Ani);
sq_drawCurrentFrame(Ani, 400, y, isFlip);
}
_________________________________________________________________________________________________________________________________________________________
//画附加对象的ui图层是否继续画
function sq_AddFunctionName(appendage)
{
appendage.sq_AddFunctionName("isDrawAppend", "isDrawAppend_appendage_atmage_tundra_cs")
}
function isDrawAppend_appendage_atmage_tundra_cs(appendage)
{
local obj = appendage.getParent();
if(!obj) {
appendage.setValid(false);
return false;
}
local mode = appendage.getVar("mode").get_vector(0);
if(sq_IsValidActiveStatus(obj, ACTIVESTATUS_FREEZE) || mode == MODE_FREEZE)
{
return false;
}
return true;
}
_________________________________________________________________________________________________________________________________________________________
//ap改变状态时 #如果设置相同状态则不会运行 #只有在设置不同状态时才会运行
function sq_AddFunctionName(appendage)
{
appendage.sq_AddFunctionName("onChangeState", "onChangeState_execution");
}
function onChangeState_execution(appendage, oldState, newState, datas)
{
if(!appendage) return;
appendage.sq_var.setBool(EXC_VAR_MOVE_ACTIVE,true);
appendage.sq_var.setInt(EXC_VAR_CURRENT_STATE,newState); //현재 스테이트 : 부모의 키프레임값
// 잡기 불가적은 뒤로 던지기 전에 풀어준다.
if(newState >= 7 && !isGrabableParent(appendage))
{
appendage.setValid(false);
return;
}
setNewState_execution(appendage, oldState ,newState, false);
}
_________________________________________________________________________________________________________________________________________________________
//ap 发送状态
appendage.setState(flagIndex,sq_GetGlobalIntVector());
_________________________________________________________________________________________________________________________________________________________
//得到附加对象被攻击时的伤害数值 #就是获取被攻击时打了多少伤害但是组队会不运行
function sq_AddFunctionName(appendage)
{
appendage.sq_AddFunctionName("onApplyHpDamage", "onApplyHpDamage_appendage_atmage_tundra_cs")
}
function onApplyHpDamage_appendage_atmage_tundra_cs(appendage, newHpDamage, attacker)
{
local obj = appendage.getParent();
if(!obj)
return newHpDamage;
local damage = newHpDamage;
if(sq_IsValidActiveStatus(obj, ACTIVESTATUS_FREEZE))
{
local frozenAddDamageRate = appendage.getVar("skl").get_vector(4); // 4.얼어있는 적 추가 데미지
local addDamage = newHpDamage.tofloat() * frozenAddDamageRate.tofloat() / 100.0;
print(" addDamage:" + addDamage);
damage = damage + addDamage.tointeger();
}
return damage;
}
_________________________________________________________________________________________________________________________________________________________
//未知 #hearthings
function sq_AddFunctionName(appendage)
{
//appendage.sq_AddFunctionName("hearthings", "proc_appendage_priest_scythe_mastery")
}
_________________________________________________________________________________________________________________________________________________________
//准备画?
function sq_AddFunctionName(appendage)
{
appendage.sq_AddFunctionName("prepareDraw", "prepareDraw_appendage_atmage_darknessmantle_effect")
}
function prepareDraw_appendage_atmage_darknessmantle_effect(appendage)
{
if(!appendage) {
return;
}
local obj = appendage.getParent();
}
_________________________________________________________________________________________________________________________________________________________
//对象管理器的应用 #获取所有控制类对象 #通过map坐标的到ui坐标
//得到控制对象
//对象类
local objectManager = obj.getObjectManager();//得到对象管理器
local objectNumber = objectManager.getCollisionObjectNumber();//总数
for (local i = 0; i < objectNumber; i++)
{
local object = objectManager.getCollisionObject(i);//得到控制类对象
}
_________________________________________________________________________________________________________________________________________________________
//遍历对象,判断 是敌人 没死亡 可攻击到 在距离内
local xPos = obj.getXPos();//x
local yPos = obj.getYPos();//y
local zPos = obj.getZPos();//z
local distance = obj.getVar().get_vector(2);//距離
local objectManager = obj.getObjectManager();//得到對象管理器
for (local i = 0; i < objectManager.getCollisionObjectNumber(); i++)
{
local object = objectManager.getCollisionObject(i);//得到控制類對象
if (object
&& object.isObjectType(OBJECTTYPE_ACTIVE)
&& obj.isEnemy(object)
&& object.isInDamagableState(obj)
&& sq_GetDistance(xPos, yPos, object.getXPos(), object.getYPos(), true) <= distance
&& sq_Abs(object.getZPos() - zPos) <= 300)
{
local activeObj = sq_GetCNRDObjectToActiveObject(object);//活動類
//沒死亡
if (!activeObj.isDead())
{
sq_sendSetActiveStatusPacket(activeObj, obj, ACTIVESTATUS_STUN, stunProb.tofloat(), stunLevel, false, stunTime);//發送眩暈
}
}
}
_________________________________________________________________________________________________________________________________________________________
//遍历对象 abs绝对值判断长方形距离
local direction = obj.getDirection();//得到方向
local xPos = sq_GetDistancePos(obj.getXPos(), direction, 300);//得到方向的pos
local yPos = obj.getYPos();//y
local zPos = obj.getZPos();//z
local distanceX = 300;//X距離
local distanceY = 90;//Y距離
local distanceZ = 50;//Z距離
local objectManager = obj.getObjectManager();//得到對象管理器
for(local i = 0; i < objectManager.getCollisionObjectNumber(); i++)
{
local object = objectManager.getCollisionObject(i);//得到控制類對象
if(object
&& object.isObjectType(OBJECTTYPE_ACTIVE)
&& obj.isEnemy(object)
&& object.isInDamagableState(obj)
&& sq_Abs(object.getXPos() - xPos) <= distanceX
&& sq_Abs(object.getYPos() - yPos) <= distanceY
&& sq_Abs(object.getZPos() - zPos) <= distanceZ)
{
local activeObj = sq_GetCNRDObjectToActiveObject(object);//活動類
//沒死亡
if(!activeObj.isDead())
{
sq_sendSetActiveStatusPacket(activeObj, obj, ACTIVESTATUS_STUN, stunProb.tofloat(), stunLevel, false, stunTime);//發送眩暈
}
}
}
_________________________________________________________________________________________________________________________________________________________
OBJECTTYPE_OBJECT <- 0 // 顶层对象
OBJECTTYPE_COLLISION <- 1 // 冲突对象;(OBJECTTYPE_OBJECT的下层)
OBJECTTYPE_ACTIVE <- 17 // 能动的对象 (OBJECTTYPE_COLLISION 的下层)
OBJECTTYPE_CHARACTER <- 273 // 角色对象 (OBJECTTYPE_ACTIVE 的下层)
OBJECTTYPE_MONSTER <- 529 // 怪物对象 (OBJECTTYPE_ACTIVE 的下层)
OBJECTTYPE_RIDABLEOBJECT <- 4625 // 可以骑对象 (OBJECTTYPE_MONSTER 的下层)
OBJECTTYPE_PASSIVE <- 33 // 特效对象 (OBJECTTYPE_COLLISION 的下层)
OBJECTTYPE_ITEM <- 289 // 道具对象 (OBJECTTYPE_PASSIVE 的下层)
OBJECTTYPE_TRAP <- 545 // 트랩 오브젝트 (OBJECTTYPE_PASSIVE 하위)
OBJECTTYPE_BREAKABLE <- 1057 // 파괴 가능한 오브젝트(보물상자 겸함) (OBJECTTYPE_PASSIVE 하위)
OBJECTTYPE_PET <- 65 // 신수 (OBJCTTYPE_COLLISION 하위)
OBJECTTYPE_CREATURE <- 129 // 크리쳐 (OBJCTTYPE_COLLISION 하위)
OBJECTTYPE_DRAWONLY <- 2 // 그리기 전용 오브젝트 (OBJECTTYPE_OBJECT 하위)
OBJECTTYPE_VIRTUALCHARACTER <- 18 // 대기실에서 쓰는 가상 캐릭터 (OBJECTTYPE_DRAWONLY 하위)
OBJECTTYPE_NPC <- 34 // 대기실의 NPC (OBJECTTYPE_DRAWONLY 하위)
OBJECTTYPE_DONKEY <- 66 // 대기실의 개인상점 (OBJECTTYPE_DRAWONLY 하위)
OBJECTTYPE_VIRTUALCREATURE <- 130 // 대기실에서 쓰는 가상 크리쳐(OBJECTTYPE_DRAWONLY 하위)
OBJECTTYPE_DISJOINTSHOP <- 258 // 대기실의 해체가 해체 상점(OBJECTTYPE_DRAWONLY 하위)
OBJECTTYPE_VIRTUALMONSTER <- 514 // 대기실에서 쓰는 가상 몬스터 (OBJECTTYPE_DRAWONLEY 하위)
OBJECTTYPE_NONE_DELETE <- 1026 // 오브젝트 삭제 시 삭제되지 않는 오브젝트 (OBJECTTYPE_DRAWONLEY 하위)
OBJECTTYPE_DEFINE_END <- 61440
_________________________________________________________________________________________________________________________________________________________
//通过ui坐标得到map坐标 通过map坐标得到ui坐标
local objectManager = obj.getObjectManager();//得到对象管理器
_________________________________________________________________________________________________________________________________________________________
//得到map坐标
local xPos = objectManager.getFieldXPos(IMouse.GetXPos(), ENUM_DRAWLAYER_NORMAL);
local yPos = objectManager.getFieldYPos(IMouse.GetYPos(), 0, ENUM_DRAWLAYER_NORMAL);
local zPos = objectManager.getFieldZPos(IMouse.GetYPos(),目标y坐标, ENUM_DRAWLAYER_NORMAL);
_________________________________________________________________________________________________________________________________________________________
//得到ui坐标
local uiXPos = mapXPos - (objectManager.getFieldXPos(mapXPos, ENUM_DRAWLAYER_NORMAL) - mapXPos);
local uiYPos = mapYPos - (objectManager.getFieldYPos(mapYPos, 0, ENUM_DRAWLAYER_NORMAL) - mapYPos);
_________________________________________________________________________________________________________________________________________________________
//得到地上掉落的物品对象
local objectManager = obj.getObjectManager();//得到对象管理器
local itemObj = objMgr.getMeetItemObject(IMouse.GetXPos(), IMouse.GetYPos());
_________________________________________________________________________________________________________________________________________________________
//我的特效对象 特效总数的应用 #得到我的特效总数 #得到我的特效
obj.getMyPassiveObjectCount(24233);//得到特效总数 对象类
local magicBall = obj.getMyPassiveObject(24233,i);//得到我的特效对象
sq_GetPassiveObjectByState(obj, 24250, BrokenArrow_state_1);//通过状态得到特效
local passiveobj_cl = obj.sq_GetPassiveObject(24241);
local pole_passive_obj = sq_GetPassiveObject(obj, 24248);
_________________________________________________________________________________________________________________________________________________________
sq_SendDestroyPacketPassiveObject(magicBall);//破坏特效
_________________________________________________________________________________________________________________________________________________________
//循环获得
local count = obj.getMyPassiveObjectCount(24233);//得到特效总数
for(local i = 0; i < count; i++)
{
local magicBall = obj.getMyPassiveObject(24233, i);//得到我的特效对象
if(!magicBall)return;
}
_________________________________________________________________________________________________________________________________________________________
//得到 对象ID、组 ,得到对象
local id = sq_GetObjectId(pTargetChr);//得到ID
local object = sq_GetObjectByObjectId(obj, id);//得到对象
local group = sq_GetGroup(targetObj);//组
local uniqueId = sq_GetUniqueId(targetObj);//唯一ID
local targetObj = sq_GetObject(obj, group, uniqueId);//得到对象
_________________________________________________________________________________________________________________________________________________________
//得到对象的重量 高度 宽度
local Weight = sq_GetObjectWeight(obj);//重量
local height = sq_GetObjectHeight(pActiveTarget);//宽度
local width = sq_GetWidthObject(object);//当前宽度
local height = sq_GetHeightObject(object);//当前高度
_________________________________________________________________________________________________________________________________________________________
//得到父 源对象 #特效 #ap
local parentObj = appendage.getParent();//得到父对象
local sourceObj = appendage.getSource();//得到源对象
local attacker = appendage.sq_GetSourceChrTarget();//得到源对象的角色目标
local chr = obj.getTopCharacter();//特效类对象 得到父角色对象
_________________________________________________________________________________________________________________________________________________________
//转换对象类 #转换为别的类
local activeObj = sq_GetCNRDObjectToActiveObject(object);//转为活动类
local sqrChr = sq_GetCNRDObjectToSQRCharacter(parentObj);//转为角色类
local onlyAiChr = sq_GetCNRDObjectToAICharacter(grabChr);//转为apc类
local colObj = sq_GetCNRDObjectToCollisionObject(damager);//转为控制类
local pflashScreen = sq_GetCNRDObjectToFlashScreen(flashScreenObj);//转为闪屏类
local Monster = sq_GetCNRDObjectToMonster(object);//转为怪物类
_________________________________________________________________________________________________________________________________________________________
//对象“身上”的数组信息
//静态var 不会因为死亡 而重置
IRDSQRCharacter.getStaticVar();
obj.getStaticVar();
_________________________________________________________________________________________________________________________________________________________
//特别注意,这里的设置,全部都用的一个数组。
//如果setint 0 设置后你还要再设置别的那么就只能 setBool 1
//如果想都从0开始不冲突 那么就使用别的数组obj.getVar();或者obj.getVar("别的");
//int值
obj.getVar().setInt(0,false);//设置
obj.getVar().getInt(0);//得到
//bool值
obj.getVar().setBool(0,false);//设置
obj.getVar().getBool(0);//得到
//浮点数
obj.getVar().setFloat(0,0.001);//设置
obj.getVar().getFloat(0);//得到
//ap
obj.getVar().setAppendage(0,appendage);
local appendage = obj.getVar().getAppendage(0);
//对象
obj.getVar().setObject(0,object);
local object = obj.getVar().getObject(0);
//普通值
obj.getVar().clear_vector();//清除
obj.getVar().size_vector();//得到总数
obj.getVar().push_vector(activeObj);//加入
obj.getVar().get_vector(0);//得到第几个
obj.getVar().set_vector(0, cnt);//改变第几个
//时钟
obj.getVar().clear_timer_vector();
obj.getVar().push_timer_vector();
local t = obj.getVar().get_timer_vector(0);
t.setParameter(20, -1);//参数1:检查间隔 参数2:限制次数
t.resetInstant(0);//重置 参数未知
t.setEventOnStart(true);//为true 一开始就可以触发
t.isEnd();//判断次数是否用完
t.isOnEvent(currentT) == true//判断时间是否到达
t.getEventTerm();//得到设置时的间隔
t.getEventMaxCount();//得到设置时的最大次数
t.setEventTerm(200);//设置间隔
t.setEventMaxCount(5);//设置最大次数
//计时器
obj.getVar().clear_ct_vector();//清除
obj.getVar().push_ct_vector();//加入
local timer = obj.getVar().get_ct_vector(0);//得到
timer.Reset();//初始化
timer.Start(10000,0);//计时开始
local currentT = timer.Get();//得到时间
//以下是放入任意对象
obj.getVar().clear_obj_vector();//清除
obj.getVar().get_obj_vector_size();//得到总数
obj.getVar().push_obj_vector(activeObj);//加入
obj.getVar().get_obj_vector(0);//得到第几个
obj.getVar().set_obj_vector(0, cnt);//改变第几个
obj.getVar().remove_obj_vector(ringObj);//删除
obj.getVar().is_obj_vector(damager);//是否在其中
obj.getVar().get_obj_vector_index(damager);//得到对象当中的ID
//以下是放入ani对象
obj.getVar().clear_ani_vector();//清除
obj.getVar().push_ani_vector(activeObj);//加入
obj.getVar().get_ani_vector(0);//得到第几个
obj.getVar().set_ani_vector(0, cnt);//改变第几个
//给对象发送状态包 并且 接收传递过来的内容
//发送状态包
//转换对象类
local activeObj = sq_GetCNRDObjectToActiveObject(object);//转为活动类
local sqrChr = sq_GetCNRDObjectToSQRCharacter(parentObj);//转为角色类
local colObj = sq_GetCNRDObjectToCollisionObject(damager);//转为控制类
//这里是发送状态时 给状态定义的类型
STATE_PRIORITY_AUTO <- 0 //根据时间和条件自动完成的一切(攻击结束,发射->战场等等) 特效一般用这个
STATE_PRIORITY_USER <- 1 //根据用户的commund发布的内容(技能,攻击等) 一般是使用技能的时候
STATE_PRIORITY_HALF_FORCE < 2 / 3 /想要离开,但都比强制要低。(翻过来等)
STATE_PRIORITY_FORCE < 3 //被迫去做的事情。(坠落,伤害,死亡,拦截等) 一般给敌人发送控制状态时
STATE_PRIORITY_IGNORE_FORCE < 4 //强制变更无视的东西。(用手术刀抓住对方等) 一般是抓取敌人的时候
//下面是发送状态时 还传递数值过去
obj.sq_IntVectClear();
obj.sq_IntVectPush(SUB_STATE_BLUEDRAGONWILL_0);
obj.sq_AddSetStatePacket(STATE_BLUEDRAGONWILL, STATE_PRIORITY_USER, true);//角色类对象 发送状态
//不传值的话就这样写 更改一下最后的参数为false就行了
obj.sq_AddSetStatePacket(STATE_BLUEDRAGONWILL, STATE_PRIORITY_USER, false);//角色类对象 发送状态
//如果是复仇者 那么就要这么写 就区分一下大小写的a
obj.sq_addSetStatePacket(STATE_BLUEDRAGONWILL, STATE_PRIORITY_USER, false);//角色类对象 发送状态
//如果是特效nut中写的话就用这个
local pIntVec = sq_GetGlobalIntVector();//得到包
sq_IntVectorClear(pIntVec);//清除
sq_IntVectorPush(pIntVec, x);//加入
obj.addSetStatePacket(PASSIVEOBJ_SUB_STATE_0, pIntVec, STATE_PRIORITY_AUTO, false, "");//控制类对象 发送状态
obj.addSetStatePacket(PASSIVEOBJ_SUB_STATE_0, sq_GetGlobalIntVector(), STATE_PRIORITY_AUTO, false, "");//控制类对象 发送状态
//当然也可以 用下面的方法
obj.sendStateOnlyPacket(PASSIVEOBJ_SUB_STATE_0);//控制类对象 发送状态
obj.sendStatePacket(PASSIVEOBJ_SUB_STATE_0, 1);//控制类对象 发送状态并且传递过去了一个值
//最后可以刷新一下发送的状态包
obj.flushSetStatePacket();//刷新发送的状态包
//下面的是不常用的 区分活动类对象 或者 控制类对象
sq_IntVectorClear(sq_GetGlobalIntVector());
sq_IntVectorPush(sq_GetGlobalIntVector(),1);
sq_AddSetStatePacketActiveObject(sourceObj,8, sq_GetGlobalIntVector(), STATE_PRIORITY_USER);//活动类对象发送状态
sq_IntVectorClear(sq_GetGlobalIntVector());
sq_IntVectorPush(sq_GetGlobalIntVector(),2);
sq_AddSetStatePacketCollisionObject(sourceObj, 8, sq_GetGlobalIntVector(), STATE_PRIORITY_USER, true);//控制类对象发送状态
//这里就开始接收 传递过来的数值
//这个是特效或者技能效果包会用到这个
local x = sq_GetVectorData(datas, 0);
//这个是角色发送的状态 接收的数据
local SubState = obj.sq_GetVectorData(datas, 0);//得到傳過來的第0個值
//发送第13状态的传值介绍
# STATE_THROW
[0] Throw State (0:모으기, 1:던지기, 2:개인시전)
* Throw State 0 *
[1] 던지는 타입 (ENUM_THROW_TYPE)
[2] 던지는 대상의 인덱스 (스킬 인덱스 or 아이템 인덱스)
[3] 모으는 시간
[4] 발사 시간
[5] 던지기 애니메이션 타입 (0 or 1)
[6] 모으기 속도 타입
[7] 발사 속도 타입
[8] 모으기 속도 (안넣으면 SPEED_VALUE_DEFAULT)
[9] 발사 속도 (안넣으면 SPEED_VALUE_DEFAULT)
[10] 개인시전 범위 (안넣거나 -1이면 개인시전 안함)
* Throw State 1 *
// Throw State 2에서 넘어왔을 경우에만
[1] 개인 시전시 대상 Object Id
* Throw State 2 *
obj.sq_IntVectClear();
obj.sq_IntVectPush(0); // throwState
obj.sq_IntVectPush(0); // throwType
obj.sq_IntVectPush(SKILL_ELEMENTAL_CHANGE); // throwIndex
obj.sq_IntVectPush(500); // throwChargeTime
obj.sq_IntVectPush(500); // throwShootTime
obj.sq_IntVectPush(0); // throwAnimationIndex
obj.sq_IntVectPush(4); // chargeSpeedType
obj.sq_IntVectPush(4); // throwShootSpeedType
obj.sq_IntVectPush(1000); // chargeSpeedValue
obj.sq_IntVectPush(1000); // throwShootSpeedValue
obj.sq_IntVectPush(-1); // personalCastRange
obj.sq_AddSetStatePacket(STATE_THROW, STATE_PRIORITY_USER, true);
//得到当前状态 得到 设置 技能使用状态
local SubState = obj.getSkillSubState();//得到技能使用状态
obj.setSkillSubState(SUB_STATE_BLOODRIVEN_1);//设置技能使用状态
local state = obj.sq_GetState();//角色类 得到状态
local state = obj.getSendState();//得到发送的状态
local state = obj.getState();//对象类 得到状态
STATE_STAND <- 0 // 站立,移动
STATE_SIT <- 1 // 倒地前
STATE_SIT_FOREVER <- 2 // 倒地
STATE_DAMAGE <- 3 // 被攻击
STATE_DOWN <- 4 // 浮空
STATE_DIE <- 5 // 死亡
STATE_JUMP <- 6 // 跳跃
STATE_JUMP_ATTACK <- 7 // 跳跃攻击
STATE_ATTACK <- 8 // 攻击
STATE_HOLD <- 9 // 被控制
STATE_SUMMONSTART <- 10 // 召唤开始
STATE_SUMMONEND <- 11 // 召唤结束
STATE_UNSUMMON <- 12 // 已经被召唤过消失
STATE_THROW <- 13 // 投掷
STATE_DASH <- 14 // 前冲
STATE_DASH_ATTACK <- 15 // 前冲攻击
STATE_GET_ITEM <- 16 // 得到道具
STATE_BUFF <- 17 // buff
STATE_QUICK_STANDING <- 18 // 快速起身
STATE_CROUCH <- 19 // 蹲下
STATE_CROUCH_ATTACK <- 20 // 蹲下攻击
STATE_LOW_KICK <- 21 // 로킥, 본 크러셔, 사로킥
STATE_TRY_GRAB <- 22 // 잡기 시도
STATE_SUPLEX <- 23 // 수플렉스
STATE_JUMP_SUPLEX <- 24 // 스파이어
STATE_JUMP_SUPLEX_LARIAT <- 25 // 스파이어 회전 추가타
STATE_MOUNT_TRY <- 26 // 마운트 시도
STATE_MOUNT <- 27 // 마운트
STATE_STOMP <- 28 // 밟기
STATE_CLOSE_PUNCH <- 29 // 원인치 펀치
STATE_LIFT_UPPER <- 30 // 무즈 어퍼
STATE_GRAB_EXPLOSION <- 31 // 일발화약성
STATE_VIRTUAL_ATTACK <- 32 // 일반 공격 -> 해머킥 등을 위한 가상 STATE
STATE_SHOULDER_TACKLE <- 33 // 숄더 태클
STATE_WHIRL_WIND_KICK <- 34 // 선풍각
STATE_BLOCK_BUSTER <- 35 // 블록 버스터
STATE_TRY_LEG_SUPLEX <- 36 // 에어슈타이너 시도
STATE_LEG_SUPLEX <- 37 // 에어슈타이너 실행
STATE_LIGHTNING_DANCE <- 38 // 라이트닝 댄스
STATE_THROW_WEB <- 39 // 천라지망
STATE_HIDDEN_STING <- 40 // 바늘 장전(히든스팅)
STATE_VENOM_MINE <- 41 // 베놈마인
STATE_JUNK_SPIN <- 42 // 정크스핀
STATE_SHOULDER_CHARGE <- 43 // 철산고
STATE_SINGLE_KICK <- 44 // 해머킥
STATE_NEN_FLOWER <- 45 // 넨화
STATE_THROW_ENEMY <- 46 // 로플링
STATE_DASH_PUNCH <- 47 // 정권 찌르기
STATE_PUNCH_AFTER_RETURN <- 48 // 타격후 뒤로돌리기
STATE_RANDOM_KICK <- 49 // 백열각 난타
STATE_RISING_UPPER <- 50 // 승룡권
STATE_DASH_AFTER_DASH <- 51 // 호신연격
STATE_EARTH_BREAK <- 52 // 금강쇄
STATE_HOLD_UP <- 53 // 홀드업
STATE_WILD_CANNON_SPIKE <- 54 // 와일드 캐논 스파이크
STATE_SUPLEX_CYCLONE <- 55 // 수플렉스 사이클론
STATE_LIGHTNING_DRAGON <- 56 // 광충노도
STATE_STRONGEST_LOW_KICK <- 57 // 사상 최강의 로킥
STATE_GROUND_KICK <- 58 // 그라운드킥
STATE_FAST_DASH <- 59 // 순보
STATE_DESTROY_EARTH_SKY_DROP <- 60 // 스트리트 파이터 각성기 - 천붕지괴
STATE_TYPHOON <- 61 // 그래플러 각성기
STATE_FLAME_LEGS <- 62 // 스트라이커 각성기 - 화염의각
STATE_THROW_SAND <- 63 // 헬터스?터
STATE_ENCHANT_POISON <- 64 // 독장전
STATE_SPIRAL_NEN_SHOOT <- 65 // 나선의 넨 : 출
STATE_NEN_SPEAR_EX <- 66 // 넨 스피어(특성) proc에서 플래그1에 몸 오버레이,화면 플래쉬 플래그2 에 꽂히는 어펜디지 소환
STATE_HURRICANE_SPEAR <- 67 // 허리케인 스피어 (특성)
STATE_CRASH_ROPE <- 68 // 광폭혈사 (특성)
STATE_CHARGE_SPEAR_EX <- 69 // 차지 스피어(특성)
STATE_SPIRAL_COLUMN_EX <- 70 // 나선환(특성)
STATE_GLUEY_FRUIT_EX <- 71 // 끈적끈적 열매(특성)
STATE_CHAIN_KICK_EX <- 72 // 연환퇴 (특성)
STATE_108_STAIRS_EX <- 73 // 108계단 (특성)
STATE_INHERIT_START <- 74
STATE_MAX <- 75
//判断是否是我控制的对象
local isMyControl = obj.isMyControlObject();//是否是我控制的角色
sq_IsMyControlObject(obj);//任意对象
obj.sq_IsMyControlObject();//角色类
//时钟事件 函数 #利用onTimeEvent事件来指向延时触发的代码
//设置时钟事件
//参数1:时钟id
//参数2:延时时间
//参数3:最大次数
//参数4:false一开始不运行 true一开始就运行
obj.setTimeEvent(0,50,maxCreateCount,false);
//删除时钟事件
obj.stopTimeEvent(0);
obj.removeAllTimeEvent();//停止所有时钟事件
//判断时钟是否存在
obj.isExistTimeEvent(0);
//appendage 相关设置 #例如附加ap #增加属性等等
//得到附加对象 源对象 源角色对象
//在ap中获得的附加对象是属于 活动类
//源对象是属于控制类
local parentObj = appendage.getParent();//得到附加对象
local sourceObj = appendage.getSource();//得到源对象
local attacker = appendage.sq_GetSourceChrTarget();//得到源对象的角色目标
if(!sourceObj || !parentObj) {
appendage.setValid(false);
return;
}
//也可以
local parentObj = appendage.getAppendageInfo().parent_;//得到附加对象
local sourceObj = appendage.getAppendageInfo().source_;//得到源对象
//判断ap是否有效
appendage.isValid();
//设置 得到有效时间
local appendage = CNSquirrelAppendage.sq_GetAppendage(obj, "Character/ATMage/MagicShield/ap_MagicShield.nut");
if (!appendage)
return;
appendage.sq_SetValidTime(time);//设置有效时间
appendage.getAppendageInfo().setValidTime(time);//设置有效时间
local validT = appendage.getAppendageInfo().getValidTime();//得到设置的有效时间
//得到ap存在时间
local useTime = appendage.getTimer().Get();
//这里其实是得到的计时器 也可以有这样的操作
timer.Reset();//初始化
timer.Start(10000,0);//计时开始
local currentT = timer.Get();//得到时间
//关于ap的效果ani的得到跟删除
appendage.sq_DeleteEffectFront();//删除身前ani
appendage.sq_DeleteEffectBack();//删除身后ani
appendage.sq_AddEffectBack("Character/Common/Animation/BusterMode/buster_loop_back_normal.ani");//背后 appendage.sq_AddEffectFront("Character/Common/Animation/BusterMode/buster_loop_front_normal.ani");//身前
local ani = appendage.sq_GetFrontAnimation(0);//得到身前的ani
local ani = appendage.sq_GetBackAnimation(0);//得到身后的ani
//是否是结束
local isEnd = sq_IsEnd(ani);
if(isEnd)
{
appendage.setValid(false);//销毁ap
}
//删除ap的附属物
appendage.sq_DeleteAppendages();
//得到ap的技能ID 设置技能ID
local skillId = appendage.sq_GetSkillIndex();//得到技能ID
appendage.sq_SetSkillIndex(100);//设置技能ID
//删除ap
CNSquirrelAppendage.sq_RemoveAppendage(obj, "Character/ATMage/MagicShield/ap_MagicShield.nut");
//判断对象身上是否存在ap
CNSquirrelAppendage.sq_IsAppendAppendage(obj, "Character/ATMage/MagicShield/ap_MagicShield.nut");
//得到对象身上的ap
local dieHardAppendage = CNSquirrelAppendage.sq_GetAppendage(sqrObj, "Character/ATMage/DieHard/ap_ATMage_DieHard.nut");
//给对象附加ap
local AddAppendage = CNSquirrelAppendage.sq_AppendAppendage(damager, obj, SKILL_BLOODBOOM, true, "character/swordman/bloodboom/ap_bloodboom.nut", true);
//参数1:附加对象
//参数2:源对象
//参数3:技能ID
//参数4:叠加? 一般都为false
//参数5:路径
//参数6:暂时不知道
//增加属性状态
//属性类型常量
CHANGE_STATUS_TYPE_PHYSICAL_ATTACK <- 0 // 力量
CHANGE_STATUS_TYPE_MAGICAL_ATTACK <- 1 // 智力
CHANGE_STATUS_TYPE_MAGICAL_DEFENSE <- 2 // 精神
CHANGE_STATUS_TYPE_PHYSICAL_DEFENSE <- 3 // 体力
CHANGE_STATUS_TYPE_EQUIPMENT_PHYSICAL_ATTACK <- 4 // 装备物理攻击
CHANGE_STATUS_TYPE_EQUIPMENT_PHYSICAL_DEFENSE <- 5 // 装备物理防御
CHANGE_STATUS_TYPE_PHYSICAL_ATTACK_BONUS <- 6 // 力量增加率
CHANGE_STATUS_TYPE_MAGICAL_ATTACK_BONUS <- 7 // 智力增加率
CHANGE_STATUS_TYPE_JUMP_POWER <- 8 // 跳跃高度
CHANGE_STATUS_TYPE_JUMP_SPEED_RATE <- 9 // 跳跃速度率
CHANGE_STATUS_TYPE_ATTACK_SPEED <- 10 // 攻击速度
CHANGE_STATUS_TYPE_MOVE_SPEED <- 11 // 移动速度
CHANGE_STATUS_TYPE_CAST_SPEED <- 12 // 释放速度
CHANGE_STATUS_TYPE_HP_MAX <- 13 // HP 最大值
CHANGE_STATUS_TYPE_HP_REGEN_RATE <- 14 // HP 恢复率
CHANGE_STATUS_TYPE_PHYSICAL_CRITICAL_HIT_RATE <- 15 // 物理暴击率
CHANGE_STATUS_TYPE_MAGICAL_CRITICAL_HIT_RATE <- 16 // 魔法暴击率
CHANGE_STATUS_TYPE_PHYSICAL_BACK_ATTACK_CRITICAL <- 17 // 物理抗暴击
CHANGE_STATUS_TYPE_MAGICAL_BACK_ATTACK_CRITICAL <- 18 // 魔法抗暴击
CHANGE_STATUS_TYPE_CRITICAL_TOLERANCE_RATE <- 19 // 暴击抗性率
CHANGE_STATUS_TYPE_ELEMENT_TOLERANCE_FIRE <- 20 // 火属性抗性
CHANGE_STATUS_TYPE_ELEMENT_TOLERANCE_WATER <- 21 // 冰属性抗性
CHANGE_STATUS_TYPE_ELEMENT_TOLERANCE_DARK <- 22 // 暗属性抗性
CHANGE_STATUS_TYPE_ELEMENT_TOLERANCE_LIGHT <- 23 // 光属性抗性
CHANGE_STATUS_TYPE_ELEMENT_TOLERANCE_ALL <- 24 // 所有属性抗性
CHANGE_STATUS_TYPE_ELEMENT_TOLERANCE_ZERO <- 25 // 无属性抗性
CHANGE_STATUS_TYPE_ACTIVESTATUS_TOLERANCE_ALL <- 26 // 所有异常抗性
CHANGE_STATUS_TYPE_ACTIVEPROPERTY_STUCK <- 27 //
CHANGE_STATUS_TYPE_BACK_ATTACK_STUCK_TOLERANCE <- 28 //
CHANGE_STATUS_TYPE_MP_REGEN_RATE <- 29 // MP 恢复率
CHANGE_STATUS_TYPE_EXTRA_SPEED_RATE <- 30 // 额外速度率
CHANGE_STATUS_TYPE_EQUIPMENT_MAGICAL_ATTACK <- 31 // 装备魔法攻击
CHANGE_STATUS_TYPE_EQUIPMENT_MAGICAL_DEFENSE <- 32 // 装备魔法防御
CHANGE_STATUS_TYPE_STUCK <- 33 // 命中率
CHANGE_STATUS_TYPE_HIT_RECOVERY <- 34 // 硬直率
CHANGE_STATUS_TYPE_MELEE_HIT_DELAY <- 35 // 近战被击延时
CAHNGE_STATUS_TYPE_EQUIPMENT_ALL_STAT <- 36 // 武器所有能力值
CHANGE_STATUS_TYPE_CUSTOM <- 37
CHANGE_STATUS_TYPE_EXP_DOUBLE <- 38 // 双倍经验
CHANGE_STATUS_TYPE_EVIL_UP <- 39 // 异界抗魔 攻击力,hp,mp提升比率 实际效果是看的数值
CHANGE_STATUS_TYPE_EVIL_DOWN <- 40 // 异界抗魔 攻击力,hp,mp下降比率 实际效果看的是数值
CHANGE_STATUS_TYPE_RIGIDITY <- 41 // 僵直度 增加后 增加被敌人攻击时的僵直时间
CHANGE_STATUS_TYPE_ELEMENT_ATTACK_FIRE <- 42 // 火属性强化
CHANGE_STATUS_TYPE_ELEMENT_ATTACK_WATER <- 43 // 冰属性强化
CHANGE_STATUS_TYPE_ELEMENT_ATTACK_DARK <- 44 // 暗属性强化
CHANGE_STATUS_TYPE_ELEMENT_ATTACK_LIGHT <- 45 // 光属性强化
CHANGE_STATUS_TYPE_ELEMENT_ATTACK_ALL <- 46 // 所有属性强化
CHANGE_STATUS_TYPE_DISEASE <- 47 // 韓煽
CHANGE_STATUS_TYPE_MP_MAX <- 48 // MP最大值
CHANGE_STATUS_TYPE_COOLTIME_DECLINE <- 49 // 冷却时间减少
CHANGE_STATUS_TYPE_PHYSICAL_CRITICAL_DAMAGE_RATE <- 50 // 物理暴击伤害率
CHANGE_STATUS_TYPE_MAGICAL_CRITICAL_DAMAGE_RATE <- 51 // 魔法暴击伤害率
CHANGE_STATUS_TYPE_BLOODWAR_GROW_ABILITY <- 52 // 綰楝萄 湍瞪(癱曖鱉) 撩濰
CHANGE_STATUS_TYPE_ADDITIONAL_PHYSICAL_GENUINE_ATTACK <- 53 // 附加物理绝对伤害 独立伤害
CHANGE_STATUS_TYPE_ADDITIONAL_MAGICAL_GENUINE_ATTACK <- 54 // 附加魔法绝对伤害 独立伤害
CHANGE_STATUS_TYPE_SUMMON_SKILL_POWER_BONUS_RATE <- 55 // 召唤技能力量加成率
CHANGE_STATUS_TYPE_ANTIEVIL <- 56 // 褒薯 葆溘 熱纂 褻薑
CHANGE_STATUS_TYPE_PHYSICAL_ABSOLUTE_DAMAGE <- 57 // 物理绝对伤害
CHANGE_STATUS_GHOST_TRAIN_NO_BREATH_TIME <- 58 // 嶸滄翮離 韓衝 衛除 滲唳
CHANGE_STATUS_CHARACTER_LINK <- 59 // 議葛攪 葭觼
CHANGE_STATUS_GOLD_INCREASE <- 60 //获得的金币增加
CHANGE_STATUS_TYPE_MAX <- 61
piercing power
//创建一个属性状态
//参数1:属性类型
//参数2:false为增加数值 true为增加百分比数值
//参数3:增加的数值
//参数4:时间
local ap = sq_CreateChangeStatus(CHANGE_STATUS_TYPE_ELEMENT_TOLERANCE_FIRE, false, 1000.0 , 0);
if (ap)
{
ap.getAppendageInfo().setValidTime(10000);//设置有效时间
ap.sq_Append(obj, obj);//设置属性的父对象
}
//附加ap 并且创建可以看到图标的属性
//增加可以看到图标的属性
local appendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, SKILL_SUPPRESSINGFIRE, false, "character/gunner/suppressingfire/ap_suppressingfire.nut", false);//附加一个ap
local change_appendage = appendage.sq_getChangeStatus("changeStatus");//ap的当前状态
if(!change_appendage)
change_appendage = appendage.sq_AddChangeStatus("changeStatus",obj, obj, 500000, CHANGE_STATUS_TYPE_PHYSICAL_CRITICAL_HIT_RATE, false, 1000);//增加一个当前状态
//参数1:名
//参数2:对象
//参数3:对象
//参数4:有效时间
//参数5:增加的属性类型
//参数6:false为增加数值 true为增加百分比数值
//参数7:数值
//附加ap 创建看不到图标的属性
//增加看不到图标的属性 一般是被动技能会有一个技能图标,再用这个加上就不会有额外的icon出现 也会加属性
local change_appendage = appendage.sq_getChangeStatus("ele_atk_water");//得到当前状态
if(!change_appendage)
change_appendage = appendage.sq_AddChangeStatusAppendageID(obj, obj, 0, CHANGE_STATUS_TYPE_ELEMENT_ATTACK_WATER, false, registValue, APID_COMMON);//增加一个属性
if(change_appendage)
{
change_appendage.clearParameter();
change_appendage.addParameter(CHANGE_STATUS_TYPE_ELEMENT_ATTACK_WATER, false, registValue.tofloat());//在这里加上真实的属性
}
//参数1:增加的属性类型
//参数2:false为增加数值 true为增加百分比数值
//参数3:数值
//附加的属性设置ID 按照id 删除属性 #也可以删除所有属性
sq_RemoveChangeStatus(obj, APID_AT_MAGE_ELEMENT_SHIELD);//删除属性
local elementalType = obj.getThrowElement();
local upValue = sq_GetIntData(obj, SKILL_ELEMENTAL_SHIELD, 0);
local ap = sq_CreateChangeStatus(CHANGE_STATUS_TYPE_ELEMENT_TOLERANCE_FIRE + elementalType, false, upValue.tofloat() , 0);
if (ap)
{
ap.getAppendageInfo().setValidTime(validTime);
ap.sq_Append(obj, obj, APID_AT_MAGE_ELEMENT_SHIELD, 0, null);
}
//附加ap的append的作用 #参数的介绍
//参数1:被附加ap者 参数2:附加的源对象
ap.sq_Append(obj, obj);//設置屬性的父對象
//参数1:被附加ap者 参数2:附加的源对象 参数3:设置ap的ID 不可重复附加
ap.sq_Append(obj, obj, APID_SKILL_LIGHT_ENCHANT_WEAPON);
//参数1:被附加ap者 参数2:附加的源对象 参数3:设置ap的ID 不可重复附加 参数4:可叠加次数 参数5:不明
ap.sq_Append(object, obj, APID_AT_MAGE_ELEMENT_SHIELD, 1, null);
//参数1:设置的ap 参数2:被附加ap者 参数3:附加的源对象 参数4:是否是buff
CNSquirrelAppendage.sq_Append(ap, obj, obj, true);
//参数1:设置的ap 参数2:被附加ap者 参数3:附加的源对象 参数4:设置apID 不可重复附加 参数5:是否是buff
CNSquirrelAppendage.sq_AppendAppendageID(ap, obj, obj, APID_SKILL_LIGHT_ENCHANT_WEAPON, false);
//是否是buff 改为false 则可以带过图 改为true 则不能带过图
//增加 删除残影效果
local spectrumAppendage = appendage.sq_GetOcularSpectrum("ocularSpectrum");//得到残影
if(!spectrumAppendage)
{
spectrumAppendage = appendage.sq_AddOcularSpectrum("ocularSpectrum", obj, obj, 100);//增加残影
}
sq_SetParameterOcularSpectrum(spectrumAppendage, 800, 100, true, sq_RGBA(20, 80, 200, 255), sq_RGBA(20, 80, 200, 0), 2, 2, 2);//设置残影效果
spectrumAppendage.endCreateSpectrum();//删除残影
//附加ap时提升目标的hp或者mp上限值
local appendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, SKILL_ATFIGHTER_FIREWORKS, false, "character/atfighter/fireworks/ap_fireworks.nut", true);//附加ap
local hpmaxup_appendage = appendage.sq_getHpMaxUp("HpMaxUp");//得到
if (!hpmaxup_appendage)//不存在
hpmaxup_appendage = appendage.sq_AddHpMaxUp("HpMaxUp", obj, obj, 0, 99999, 99999);//增加
//参数1:name名称
//参数2:被附加对象
//参数3:附加对象
//参数4:持续时间 写0则无限时间
//参数5:增加的hp值
//参数6:增加的mp值
//数值需要通过运算后得到正确数值
local convert_rate = sq_GetAbilityConvertRate(obj, CONVERT_TABLE_TYPE_HP);//先得到转换率
local dooms_con_hp = dooms_hp.tofloat() * convert_rate.tofloat();//得到正确的数值
//转换常量
CONVERT_TABLE_TYPE_DAMAGE <- 0 // 等嘐雖
CONVERT_TABLE_TYPE_DEFENSE <- 1 // 寞橫溘
CONVERT_TABLE_TYPE_HP <- 2 // HP MAX
CONVERT_TABLE_TYPE_PHYSICAL_ATTACK <- 3 //
CONVERT_TABLE_TYPE_PHYSICAL_DEFENSE <- 4 // 羹溘
CONVERT_TABLE_TYPE_MAGICAL_ATTACK <- 5 // 雖棟
CONVERT_TABLE_TYPE_MAGICAL_DEFENSE <- 6 // 薑褐溘
CONVERT_TABLE_TYPE_PHYSICAL_ABSOLUTE_DAMAGE <- 7 // 僭葬 瞰渠 等嘐雖
CONVERT_TABLE_TYPE_PHYSICAL_DAMAGE_REDUCE <- 8 // 僭葬 等嘐雖 爾薑
CONVERT_TABLE_TYPE_MAGICAL_ABSOLUTE_DAMAGE <- 9 // 葆徹 瞰渠 等嘐雖
CONVERT_TABLE_TYPE_MAGICAL_DAMAGE_REDUCE <- 10 // 葆徹 等嘐雖 爾薑
CONVERT_TABLE_TYPE_ACTIVESTATUS_DAMAGE_REDUCE <- 11 // 鼻鷓檜鼻 等嘐雖 爾薑.
CONVERT_TABLE_TYPE_MP <- 12 // MP MAX
CONVERT_TABLE_TYPE_SKILL_POWER <- 13 // 蝶鑒 絮董等嘐雖
CONVERT_TABLE_TYPE_MAX <- 14
//附加ap时恢复hp血量
local appendage = CNSquirrelAppendage.sq_AppendAppendage(obj, obj, SKILL_ATFIGHTER_FIREWORKS, false, "character/atfighter/fireworks/ap_fireworks.nut", true);//附加ap
local change_appendage = appendage.sq_GetCNChangeHp("changehp");//得到hp
if (!change_appendage)
change_appendage = appendage.sq_AddCNChangeHp("changehp", obj, obj, 0, 50000.0, 5000);//恢复设置
//参数1:name名称
//参数2:被附加对象
//参数3:附加对象
//参数4:0
//参数5:增加的hp值 浮点数
//参数6:恢复总时间
//吸附ap #测试效果不好 #使用原版的代码附加ap后会一直改变y坐标 #搞不明白到底有啥用
local appendage = CNSquirrelAppendage.sq_AppendAppendage(parentObj, obj, SKILL_FROZENLAND, false, "Appendage/Character/ap_common_suck.nut", false);
local suckVel = 200;
local radiusSize = obj.getVar("radius").get_vector(1);
local range = radiusSize * 2;
if(appendage)
{
appendage.sq_SetValidTime(2000);
CNSquirrelAppendage.sq_Append(appendage, parentObj, obj);
local auraAppendage = appendage.sq_getAuraMaster("frozenAura");
if(!auraAppendage)
auraAppendage = appendage.sq_AddAuraMaster("frozenAura",parentObj, obj, 1200, 18, 5, 0);
auraAppendage.setAttractionInfo(suckVel, suckVel, range, 100);
}
//额外附加 延时死亡并控制
//参数1:附加对象
//参数2:源对象
//参数3:是否控制
//参数4:是否延时死亡
//参数5:销毁ap时是否击飞
//参数6:击飞距离
//参数7:击飞高度
//参数8:方向
//参数9:父ap (父ap销毁则控制ap也销毁)
sq_HoldAndDelayDie(damager, obj, true, true, true, 200, 200, ENUM_DIRECTION_NEUTRAL , masterAppendage);
//额外附加 均匀移动
//参数1:附加对象
//参数2:源对象
//参数3:以此对象坐标为基准
//参数4:偏移的x坐标
//参数5:偏移的y坐标
//参数6:偏移的z坐标
//参数7:到达目标时间
//参数8:没测试一般为true
//参数9:父ap (父ap销毁则控制ap也销毁)
sq_MoveToAppendageForce(ChrJob, obj, obj, 160, 0, ChrJob.getZPos(), 3000, true, masterAppendage);//强制移动
//也可以改为下面的 则有坐标到达不了就不会再移动
sq_MoveToAppendage(ChrJob, obj, obj, 160, 0, ChrJob.getZPos(), 3000, true, masterAppendage);//强制移动
//额外附加 由快到慢 由慢到快移动
//参数1:附加对象
//参数2:源对象
//参数3:以此对象坐标为基准
//参数4:偏移的x坐标
//参数5:偏移的y坐标
//参数6:偏移的z坐标
//参数7:到达目标时间
//参数8:没测试一般为true
//参数9:父ap (父ap销毁则控制ap也销毁)
//参数10:true代表由快到慢 false代表由慢到快
sq_AccelMoveToAppendageForce(aoDamager, obj, obj, x, 0, z - aoDamager.getObjectHeight()/2, liftTime, true, masterAppendage,true);//强制移动
//也可以改为下面的 则有坐标到达不了就不会再移动
sq_AccelMoveToAppendage(aoDamager, obj, obj, x, 0, z - aoDamager.getObjectHeight()/2, liftTime, true, masterAppendage,true);
//ani以及绘画对象的设置
//图层 以及 对象常量
ENUM_DRAWLAYER_CONTACT <- 0 // 前景 创建后所有的都看不到了
ENUM_DRAWLAYER_NORMAL <- 1 // 正常图层
ENUM_DRAWLAYER_BOTTOM <- 2 // 底层图层
ENUM_DRAWLAYER_CLOSEBACK <- 3 // map 地板图层
ENUM_DRAWLAYER_MIDDLEBACK <- 4 // map 远景图层 房屋之类的
ENUM_DRAWLAYER_DISTANTBACK <- 5 // map 远景图层 背景
ENUM_DRAWLAYER_COVER <- 6 // 顶层图层
ENUM_DRAWLAYER_MAX <- 7
OBJECTTYPE_OBJECT <- 0 // 顶层对象
OBJECTTYPE_COLLISION <- 1 // 冲突对象;(OBJECTTYPE_OBJECT的下层)
OBJECTTYPE_ACTIVE <- 17 // 能动的对象 (OBJECTTYPE_COLLISION 的下层)
OBJECTTYPE_CHARACTER <- 273 // 角色对象 (OBJECTTYPE_ACTIVE 的下层)
OBJECTTYPE_MONSTER <- 529 // 怪物对象 (OBJECTTYPE_ACTIVE 的下层)
OBJECTTYPE_RIDABLEOBJECT <- 4625 // 可以骑对象 (OBJECTTYPE_MONSTER 的下层)
OBJECTTYPE_PASSIVE <- 33 // 特效对象 (OBJECTTYPE_COLLISION 的下层)
OBJECTTYPE_ITEM <- 289 // 道具对象 (OBJECTTYPE_PASSIVE 的下层)
OBJECTTYPE_TRAP <- 545 // 트랩 오브젝트 (OBJECTTYPE_PASSIVE 하위)
OBJECTTYPE_BREAKABLE <- 1057 // 파괴 가능한 오브젝트(보물상자 겸함) (OBJECTTYPE_PASSIVE 하위)
OBJECTTYPE_PET <- 65 // 신수 (OBJCTTYPE_COLLISION 하위)
OBJECTTYPE_CREATURE <- 129 // 크리쳐 (OBJCTTYPE_COLLISION 하위)
OBJECTTYPE_DRAWONLY <- 2 // 그리기 전용 오브젝트 (OBJECTTYPE_OBJECT 하위)
OBJECTTYPE_VIRTUALCHARACTER <- 18 // 대기실에서 쓰는 가상 캐릭터 (OBJECTTYPE_DRAWONLY 하위)
OBJECTTYPE_NPC <- 34 // 대기실의 NPC (OBJECTTYPE_DRAWONLY 하위)
OBJECTTYPE_DONKEY <- 66 // 대기실의 개인상점 (OBJECTTYPE_DRAWONLY 하위)
OBJECTTYPE_VIRTUALCREATURE <- 130 // 대기실에서 쓰는 가상 크리쳐(OBJECTTYPE_DRAWONLY 하위)
OBJECTTYPE_DISJOINTSHOP <- 258 // 대기실의 해체가 해체 상점(OBJECTTYPE_DRAWONLY 하위)
OBJECTTYPE_VIRTUALMONSTER <- 514 // 대기실에서 쓰는 가상 몬스터 (OBJECTTYPE_DRAWONLEY 하위)
OBJECTTYPE_NONE_DELETE <- 1026 // 오브젝트 삭제 시 삭제되지 않는 오브젝트 (OBJECTTYPE_DRAWONLEY 하위)
OBJECTTYPE_DEFINE_END <- 61440
//得到rgb ALPHA
local rgba = sq_ALPHA(255,255,255,0);//rgba
local rgb = sq_RGB(255,255,255);//rgb
local a = sq_ALPHA(255);//透明度
//得到 设置 ani
//得到自定义ani
obj.sq_getCustomAni(CUSTOM_ANI_AVENGER_ATTACK_4_ROSARY);//复仇者
sq_GetCustomAni(obj, 57);//按道理是都可以用
local ani = obj.getCustomAnimation(0);//对象类
//得到当前ani
local ani = sq_GetCurrentAnimation(obj);//角色;特效;绘画对象
local ani = obj.getCurrentAnimation();//角色;特效;绘画对象
local ani = obj.sq_GetCurrentAni();//角色;
//得到默认ani
obj.getDefaultAnimation();//对象类 得到默认ani
//判断是否是默认ani
obj.isCurrentAnimationDefault();//对象类 判断是否是默认ani
//设置当前ani
obj.sq_SetCurrentAnimation(CUSTOM_ANI_CONCENTRATE_EX);//角色
setCurrentAnimationFromCutomIndex(obj, 0);//特效
obj.setCurrentAnimation(ani);//对象类
//设置ani的播放速度 人物的当前所有ani的速度
pAni.setSpeedRate(200.0);//速度率
obj.sq_SetAnimationSpeedRate(obj.sq_GetCurrentAni(),attackSpeedRate.tofloat());//设置ani的速度率
//设置静态速度的信息
//参数说明:
//1.速度类型
//2.速度类型
//3.速度值
//4.速度值
//5.速度加成率
//6.速度加成率
//一般为改最后面的两个参数可以调整速度
obj.sq_SetStaticSpeedInfo(SPEED_TYPE_ATTACK_SPEED, SPEED_TYPE_ATTACK_SPEED, SPEED_VALUE_DEFAULT, SPEED_VALUE_DEFAULT, 1.0, 1.0);
//按比例增加 不吃任何速度,固定增加速度 更改1.5的那个数值 就是增加50%的速度
obj.sq_SetStaticSpeedInfo(0, 0, 0, (1000*1.5).tointeger(), 0.0, 0.0);//设置固定速度
SPEED_TYPE_CONST <- 0
SPEED_TYPE_MOVE_SPEED <- 1 //移动速度
SPEED_TYPE_ATTACK_SPEED <- 2 //攻击速度
SPEED_TYPE_EXCEPT_WEAPON_ATTACK_SPEED <- 3 //除了攻击速度
SPEED_TYPE_CAST_SPEED <- 4 //施放速度
//改变图片大小 攻击框大小
local ani = obj.getCurrentAnimation();//得到当前ani
local sizeRate = sizeRate.tofloat() / 100.0;//转换浮点数运算
currentAni.setImageRateFromOriginal(sizeRate, sizeRate);//增加ani 宽度跟高度率
currentAni.setAutoLayerWorkAnimationAddSizeRate(sizeRate);//增加ani als附加 ani大小比例
sq_SetAttackBoundingBoxSizeRate(currentAni, sizeRate, sizeRate, sizeRate);//攻击框,x y z比率
//下面不常用
currentAni.applyBoundingBoxRate(explosionSizeRate,0,0);//攻击框
currentAni.setAttackBoundingBoxSizeRate(sizeRate,true);//攻击框
currentAni.setImageRate(1.0, 1.0);//比率
ani.resize(sizeRate);//比率
ani.resizeWithChild(size);//比率
//判断当前自定义etc的ani ID
obj.isCurrentCutomAniIndex(CUSTOM_ANI_PUSH_OUT_GRAB);
//活动类对象
//创建ani
local ani = sq_CreateAnimation("","");//创建ani
参数1: 参数2:都是路径
//根据角色类型,来取决于路径
obj.sq_CreateCNRDAnimation("Effect/Animation/ATElementalRain/Cast/1_under_dodge.ani")
local ani = obj.getVar().GetAnimationMap("Disaster1", "Character/Priest/Animation/disasterEx/Disaster1.ani");
//销毁绘画对象
aniobj.setValid(false);//销毁
//以父图层创建绘画对象 #参数中可以更改x y z坐标
local pooledObj = sq_AddDrawOnlyAniFromParent(obj,"character/swordman/effect/animation/swordofmind/charging.ani", 0, 0, 0);
//创建绘画对象 #设置图层 #可以更改ani结束时是否销毁
local pooledObj = sq_CreateDrawOnlyObject(obj, "PassiveObject/Character/Mage/Animation/ATDarknessMantle/exp/3_exp_shock_normal_1.ani", ENUM_DRAWLAYER_NORMAL, true);
//更高端的创建绘画对象 #手动创建ani #以及设置坐标图层等
local ani = sq_CreateAnimation("","");//创建ani
local pooledObj = sq_CreatePooledObject(ani,true);//创建绘画对象 参数2:应该是ani结束时true 就销毁反之false不销毁
sq_SetCurrentDirection(pooledObj, obj.getDirection());//设置方向
pooledObj.setCurrentPos(x,y,z);//设置pos
pooledObj = sq_SetEnumDrawLayer(pooledObj, ENUM_DRAWLAYER_BOTTOM);//设置图层
sq_AddObject(obj, pooledObj, OBJECTTYPE_DRAWONLY, false);//增加对象
//得到当前ani的时间 得到ani的区间或总延时
local ani = obj.getCurrentAnimation();//角色;特效;绘画对象
//得到ani当前时间
local currentT = sq_GetCurrentTime(pAni);//ani得到当前时间
//得到ani延时
local delay = ani.getDelaySum(false);//ani延时总和
local delay = ani.getDelaySum(0, 2);//第几帧到第几帧总和
local delay = ani.getDelayBySpeedRate(1);//按照速度率
obj.sq_GetDelaySum();//得到当前的ani总延时 角色类对象
local startTime = sq_GetDelaySum(animation);//得到ani总延时
//得到当前帧ID
sq_GetCurrentFrameIndex(obj);//角色;特效
sq_GetAnimationFrameIndex(pAni);//ani
obj.sq_GetCurrentFrameIndex(pAni);//角色
//设置当前帧ID
sq_SetAnimationFrameIndex( backAni, currentAniFrameIndex);
ani.setCurrentFrameWithChildLayer(11);
//设置ani帧的延时时间
sq_SetFrameDelayTime(animation, 0, castTime);
ani.setFrameDelay(4,maxTime,true);
ani.proc();
//得到ani的帧总数
local poleAniFrameNumber = sq_GetAniFrameNumber(poleAni, 0);//ani总数
//判断ani是否结束
local isEnd = sq_IsEnd(ani);//是否结束
//倒回ani #重新播放
sq_Rewind(ani);//倒回 重播
obj.sq_Rewind(animation);//倒回 重播
设置ani的rgba值 #颜色及透明度
//ani1.setRGBA(0, 78, 255, 255);
//设置ani的效果层 #在原图片图层上再增加一个图型样式
local effectType = GRAPHICEFFECT_DODGE;//图形效果类型
local rgb = sq_RGB(0, 90, 255);//rgb颜色值
local effectT = 600;
local startT = 200;
local endT = 50;
local targetV = endT;
local al = sq_GetUniformVelocity(startT, targetV, appendage.getTimer().Get(), effectT);
local alpha = sq_ALPHA(al);//获得透明度
//设置效果层 最后一个参数是 所有层ani是否也更改
pAni.setEffectLayer(true, effectType, true, rgb, alpha, true, false);
GRAPHICEFFECT_NONE <- 0 // 橈擠
GRAPHICEFFECT_DODGE <- 1 // 游雖
GRAPHICEFFECT_LINEARDODGE <- 2 // 葬棲橫 游雖
GRAPHICEFFECT_DARK <- 3 // 棻觼
GRAPHICEFFECT_XOR <- 4 // XOR
GRAPHICEFFECT_MONOCHROME <- 5 // 欽儀
GRAPHICEFFECT_SPACE_DISTORT <- 6 // 奢除諼堊
GRAPHICEFFECT_MAX <- 7
//以下是我自己实操,巡回更改颜色值
local pAni = parentObj.getCurrentAnimation();//得到当前ani
if(pAni)
{
local currentT = appendage.getTimer().Get();//当前时间
local fireT = 350;//总时间
if(currentT / fireT % 2 == 1)
{
currentT = fireT - currentT % fireT;//再次计算轮回时间
}
else
currentT = currentT % fireT;//轮回当前时间
local al = sq_GetUniformVelocity(10,100, currentT, fireT);//计算透明度
local alpha = sq_ALPHA(al);//得到透明度
local rgb = sq_RGB(255, 0, 0);//rgb 红色
pAni.setEffectLayer(true, GRAPHICEFFECT_LINEARDODGE, true, rgb, alpha, true, false);//设置效果层
//得到层ani 范围
local size = sq_AniLayerListSize(pAni);
for(local i = 0; i < size; i++)
{
local aniL = sq_getAniLayerListObject(pAni, i);//得到层ani
if(aniL)
{
local effect = aniL.GetCurrentFrame().GetGraphicEffect();//得到ani当前帧的效果
if(effect != GRAPHICEFFECT_LINEARDODGE)//不是线性减淡 那么就改变颜色
aniL.setEffectLayer(true, GRAPHICEFFECT_LINEARDODGE, true, rgb, alpha, true, false);
}
}
}
//创建特效 #ani #atk #伤害 #攻击范围 #坐标都可设置 #唯一缺点穿刺无法设置 #攻击到人立马销毁
//创建只攻击对象 ani跟atk
参数1:ani路径
参数2:atk路径
参数3:false 固伤;true 百分比
参数4:这里提供的数值 被参数3控制,固伤或百分比
参数5:攻击框比率
参数6:偏移x
参数7:偏移y
参数8:偏移z
sq_createAttackObjectWithPath(obj, "Character/Swordman/Effect/Animation/Bloodboom/finish_bloodboom_finish3.ani","passiveobject/script_sqr_nut_qq506807329/swordman/attackinfo/bloodboomfinish.atk",true,0,100,200,0,0);
//改变图层
sq_ChangeDrawLayer(obj, ENUM_DRAWLAYER_BOTTOM);//改变图层
//增加状态层ani #切换状态时会自动删除
obj.sq_AddStateLayerAnimation(1,obj.sq_CreateCNRDAnimation("Effect/Animation/ATElementalRain/Cast/1_under_dodge.ani"), 0, 0);
//增加 删除 得到层ani #ani的子ani
currentAni.addLayerAnimation(6,sq_CreateAnimation("","PassiveObject/Character/Mage/Animation/ATLightningWall/7_el-p1_dodge_1.ani"),true);//增加层ani
pAni.removeLayerAnimation(backlight_dodge);//删除层ani
local size = sq_AniLayerListSize(pAni);//得到ani层的范围
local pAniL = sq_getAniLayerListObject(pAni, i);//得到层ani
//附加ap 设置效果层
//设置效果层;参数4:到达指定颜色需要的时间 参数5:消失的多少时间 参数6:附加多长时间
sq_EffectLayerAppendage(damager,sq_RGB(0,144,255),150,0,0,240);
sq_EffectLayerAppendageOnlyBody(obj, sq_RGB(255,255,255), 255, 0, 0, 320);
sq_SetBodyEffect(obj, obj, true, sq_RGB(255, 255, 255), 0, 80, 0, sq_ALPHA(255));
//得到als中的ani
local alsSpinNormal = obj.sq_getAutoLayerWorkAnimation(pAni, "2_sn");
local aniL = obj.sq_GetAutoLayerWorkAnimation(pAni,"Dodge");//得到als层ani
//创建固定在屏幕中央的ani
sq_setFullScreenEffect(obj, "pet/falcon/animation/rest.ani");//固定在屏幕中央的效果ani
//删除ani
sq_DeleteAni(backAni);//删除ani
//清除攻击框 增加攻击框
//ani关闭攻击框
sq_ClearAttackBox(pAni);
//增加攻击框
sq_AddAttackBox(pAni,
attackPosX.tointeger() - (attackL / 2),
attackPosY.tointeger(),
-zAttackL,
attackL, attackL, (zAttackL * 2) );
//得到ani当前帧 得到帧的图形效果类型 #例如判断线性减淡等等
local frame = ani.GetCurrentFrame();//得到当前帧
local effect = aniL.GetCurrentFrame().GetGraphicEffect();//得到图形效果
GRAPHICEFFECT_NONE <- 0 // 橈擠
GRAPHICEFFECT_DODGE <- 1 // 游雖
GRAPHICEFFECT_LINEARDODGE <- 2 // 葬棲橫 游雖
GRAPHICEFFECT_DARK <- 3 // 棻觼
GRAPHICEFFECT_XOR <- 4 // XOR
GRAPHICEFFECT_MONOCHROME <- 5 // 欽儀
GRAPHICEFFECT_SPACE_DISTORT <- 6 // 奢除諼堊
GRAPHICEFFECT_MAX <- 7
//判断ani的key flag标签 或 清除
obj.sq_IsKeyFrameFlag(ani, 1);//是否是
obj.sq_ClearKeyFrameFlag(ani);//清除key
//判断是否是相同的ani
sq_IsSameAni(explosionAni,currentAni);//判断是否相同
//得到我的ani的阴影类型
sq_GetShadowTypeByAnimation()
//得到ani img的范围大小
local ani = obj.getCurrentAnimation();
local radiusSize = sq_GetAniRealImageSize(ani, 0);
local boundBox = sq_GetAttackBoundRect(ani);
local bosXSize = sq_GetBoundingBoxXSize(boundBox);
local range = bosXSize;
//atk以及攻击的设置
//得到 设置 atk
//得到自定义攻击信息
local attackInfo = sq_GetCustomAttackInfo(obj, 0);//角色;特效
//得到当前攻击信息
local attackInfo = sq_GetCurrentAttackInfo(obj);//角色;特效
//得到默认攻击信息
local attackInfo = sq_GetDefaultAttackInfo(obj);
//设置当前攻击信息
obj.sq_SetCurrentAttackInfo(CUSTOM_ATTACK_BLOODRIVENMULTIHIT);//角色
sq_SetCurrentAttackInfoFromCustomIndex(obj, 0);//特效
sq_SetCurrentAttackInfo(obj, attackInfo);//角色;特效
//得到技能
local skill = sq_GetSkill(obj, SKILL_WATER_CANNON);
//得到技能等级
local skill_level = sq_GetSkillLevel(obj, SKILL_ICEROAD);//技能等级
//得到静态 动态数据
//得到动态数据
local validTime = obj.sq_GetLevelData(SKILL_ELEMENTAL_CHAIN, 1, skill_level);//参数1:技能编号 参数2:动态第几个 参数3:技能等级
sq_GetLevelData(obj,SKILL_METEORSWORD, 0, skill_level);//参数1:对象 参数2:技能编号 参数3:动态第几个 参数4:技能等级
//得到静态数据
obj.sq_GetIntData(SKILL_WIND_STRIKE, 0);//参数1:技能编号 参数2:静态第几个
sq_GetIntData(obj, SKILL_DIEHARD, 0);//参数1:对象 参数2:技能编号 参数3:静态第几个
//得到 设置 根据人物状态加成的 固伤,百分比数值
sq_GetCurrentAttackBonusRate(obj);//得到对象身上的百分比率
//得到百分比
//参数1:技能编号 参数2:状态编号 参数3:动态数据第几个 参数4:以多少比率获取
local attackBonusRate = obj.sq_GetBonusRateWithPassive(SKILL_WIND_STRIKE, STATE_WIND_STRIKE, 0, 1.0);
//得到固伤
//参数1:技能编号 参数2:状态编号 参数3:固伤动态数据第几个 参数4:百分比率动态数据第几个 参数5:以多少比率获取
//这里参数3 跟参数4 是技能又有固伤也有百分比才这样写,好像是官方设定的一种获取伤害的计算方式
//如果只有固伤的话 参数4写 -1就行了
local power = obj.sq_GetPowerWithPassive(SKILL_WIND_STRIKE, STATE_WIND_STRIKE, 1, 0, 1.0);
//设置百分比
obj.sq_SetCurrentAttackBonusRate(power);//角色类
sq_SetCurrentAttackBonusRate(attackInfo, attackBonusRate);//给攻击信息设置百分比值
//设置固伤
obj.sq_SetCurrentAttackPower(power);//角色类
sq_SetCurrentAttackPower(attackInfo, attackPower);//给攻击信息设置固伤值
//给攻击信息设置一些属性 #例如属性类型 #是否吃物理魔法攻击之类的
attackInfo.setElement(ENUM_ELEMENT_NONE);//设置攻击属性
ENUM_ELEMENT_FIRE <- 0 /// 火属性
ENUM_ELEMENT_WATER <- 1 /// 冰属性
ENUM_ELEMENT_DARK <- 2 /// 暗属性
ENUM_ELEMENT_LIGHT <- 3 /// 光属性
ENUM_ELEMENT_NONE <- 4 /// 无属性
ENUM_ELEMENT_MAX <- 4 /// == ENUM_ELEMENT_NONE
attackInfo.isValidElement(ENUM_ELEMENT_FIRE);//判断是否是该属性
sq_SetCurrentAttackeHitStunTime(sq_GetCurrentAttackInfo(obj), 0);//设置攻击击晕时间
sq_SetAttackInfoForceHitStunTime(atk, stunTime);//强制击晕时间
local rateDamager = sq_GetAttackInfoHitDelayRateDamager(attackerInfo);//得到击中僵直率
sq_SetAttackInfoHitDelayRateDamager(attackerInfo, 0.0); //设置击中僵直率
//设置攻击反应
sq_SetCurrentAttackeDamageAct(attackInfo, 1);
//DAMAGEACT_NONE = 0, 无
//DAMAGEACT_DAMAGE = 1, 伤害
//DAMAGEACT_DOWN = 2, 倒地
//得到攻击类型 设置攻击类型
sq_ChangeAttackTypeToOpposite(attack_info);//设置相反的攻击类型
local eType = sq_GetAttackType(attack_info);//得到攻击类型
attackInfo.setAttackType(ATTACKTYPE_MAGICAL); //设置攻击类型
sq_setAttackInfoType(obj,ATTACKTYPE_MAGICAL);//设置攻击类型
ATTACKTYPE_PHYSICAL <- 0 //物理
ATTACKTYPE_MAGICAL <- 1 //魔法
ATTACKTYPE_ABSOLUTE <- 2 //无视防御
sq_SetAddWeaponDamage(attackInfo, true);//吃物理魔法攻击力 百分比伤害必加 参数2改为false代表不吃
sq_SetCurrentAttacknBackForce(pAttack, 800);//推开距离
sq_SetCurrentAttacknUpForce(pAttack, 300);//打击高度
sq_SetCurrentAttackDirection(pAttack, ATTACK_DIRECTION_UP);//攻击方向
ATTACK_DIRECTION_UP <- 0
ATTACK_DIRECTION_HORIZON <- 1
ATTACK_DIRECTION_DOWN <- 2
ATTACK_DIRECTION_MAX <- 3
//得到atk类的属性 为bool值 忽略延时死亡无敌状态 例如男魔法的复活被动
attackInfo.isIgnoreDieHard_
//atk攻击信息 设置异常状态攻击
//設置攻擊異常狀態;攻击信息,,异常类型,概率,等级,时间,伤害
sq_SetChangeStatusIntoAttackInfo(attackInfo, 0, ACTIVESTATUS_BLEEDING,bleedingrate,bleedinglevel,bleedingtime,bleedingdamage);
ACTIVESTATUS_SLOW <- 0 // 减速
ACTIVESTATUS_FREEZE <- 1 // 冰冻
ACTIVESTATUS_POISON <- 2 // 中毒
ACTIVESTATUS_STUN <- 3 // 眩晕
ACTIVESTATUS_CURSE <- 4 // 诅咒
ACTIVESTATUS_BLIND <- 5 // 失明
ACTIVESTATUS_LIGHTNING <- 6 // 感电
ACTIVESTATUS_STONE <- 7 // 石化
ACTIVESTATUS_SLEEP <- 8 // 睡眠
ACTIVESTATUS_BURN <- 9 // 燃烧
ACTIVESTATUS_WEAPON_BREAK <- 10 // 武器破甲
ACTIVESTATUS_BLEEDING <- 11 // 出血
ACTIVESTATUS_HASTE <- 12 // 加速
ACTIVESTATUS_BLESS <- 13 // 祝福
ACTIVESTATUS_ELEMENT <- 14 // 엘레먼트
ACTIVESTATUS_CONFUSE <- 15 // 混乱
ACTIVESTATUS_HOLD <- 16 // 束缚
ACTIVESTATUS_ARMOR_BREAK <- 17 // 护甲破甲
ACTIVESTATUS_MAX <- 18
//直接发送异常状态
//直接发送异常状态包;被附加对象,我自己,异常类型,概率(浮点数),等级,强制false,时间
sq_sendSetActiveStatusPacket(obj, parentObj, ACTIVESTATUS_BLIND, dark_prob.tofloat(), dark_power.tointeger(), false, dark_time.tointeger());
ACTIVESTATUS_SLOW <- 0 // 减速
ACTIVESTATUS_FREEZE <- 1 // 冰冻
ACTIVESTATUS_POISON <- 2 // 中毒
ACTIVESTATUS_STUN <- 3 // 眩晕
ACTIVESTATUS_CURSE <- 4 // 诅咒
ACTIVESTATUS_BLIND <- 5 // 失明
ACTIVESTATUS_LIGHTNING <- 6 // 感电
ACTIVESTATUS_STONE <- 7 // 石化
ACTIVESTATUS_SLEEP <- 8 // 睡眠
ACTIVESTATUS_BURN <- 9 // 燃烧
ACTIVESTATUS_WEAPON_BREAK <- 10 // 武器破甲
ACTIVESTATUS_BLEEDING <- 11 // 出血
ACTIVESTATUS_HASTE <- 12 // 加速
ACTIVESTATUS_BLESS <- 13 // 祝福
ACTIVESTATUS_ELEMENT <- 14 // 엘레먼트
ACTIVESTATUS_CONFUSE <- 15 // 混乱
ACTIVESTATUS_HOLD <- 16 // 束缚
ACTIVESTATUS_ARMOR_BREAK <- 17 // 护甲破甲
ACTIVESTATUS_MAX <- 18
//直接发送攻击包
sq_SendHitObjectPacket(obj,object,0,0,sq_GetObjectHeight(obj) / 2);//发送攻击包
sq_SendHitObjectPacketWithNoStuck(obj,damager,0,0,0);//发送不会未命中的攻击包
//按照自己的自定义攻击信息发送攻击 (这个没测试出来该怎么用 可能没有效果。。)
sq_SendHitObjectPacketByCustomAttackIndex(obj,damager,0,0,0,0);
new一个新的攻击信息包,其实是召唤特效,如果攻击次数过多不建议创建这个
//新建一个攻击包
local ap = sq_getNewAttackInfoPacket();
ap.hitStunTimeAttackerDamager = stunTime;//僵直时间
ap.sizeRate = sizeRate;//攻击大小
ap.changeStatusType = changeStatusType; //异常状态类型
ap.changeStatusProb = changeStatusProb.tofloat(); //异常状态概率
ap.changeStatusLevel = changeStatusLevel.tofloat(); //异常状态等级
ap.changeStatusDuration = changeStatusDuration;//异常状态持续时间
ap.changeStatusdamage = changeStatusdamage;//异常状态伤害
ap.power = fireDamage;//固伤
ap.powerRate = attackPower;//百分比
ap.element = ENUM_ELEMENT_FIRE;//属性
ap.useWeapon = false;//是否吃武器伤害
ap.eType = ATTACKTYPE_MAGICAL;//攻击类型 魔法还是物理
ap.stuckRate = 100.0;//命中率
ap.backForce = 100;//推开距离
ap.upForce = 100;//打击高度
ap.knockBackType = 100;//没测试过
sq_SendHitObjectPacketByAttackInfo(parentObj, attacker, ap);//以新的攻击包发送攻击
sq_createCommonElementalAttack(obj, elementalType, 0, 0, 0, explosionInfo);//待测试
//应用基本攻击 #没测试过
mage.applyBasicAttackUp(sq_GetCurrentAttackInfo(obj),mage.getState());
sq_SetCurrentAttackInfo(obj,sq_GetCurrentAttackInfo(obj));
//坐标 方向 距离 移动常用相关
//方向常量
ENUM_DIRECTION_LEFT <- 0 //左方向
ENUM_DIRECTION_RIGHT <- 1 //右方向
ENUM_DIRECTION_UP <- 2 //上方向
ENUM_DIRECTION_DOWN <- 3 //下方向
ENUM_DIRECTION_NEUTRAL <- 4 //中心
ENUM_DIRECTION_MAX <- 5
abs函数 #运算得到的结果无论如何都会得到正数结果
sq_Abs(600 - 900);
Atan2三角函数 #长度高度算出靠近高度的弧度
local atan = sq_Atan2(x.tofloat(), z.tofloat());
Degree函数 #将弧度转为角度
local angle = sq_ToDegree(atan);
Radian函数 #角度转为弧度
sq_ToRadian(angle);
Cos函数 #给角度值计算出长度距离 #一般用于圆形的长度运算
sq_Cos(angle);
sq_CosTable(angle);
Sin函数 #给角度值计算出高度比率 #一般用于弧形的高度
sq_Sin(angle);
sq_SinTable(angle);
寻找范围内的单一目标
//角色用这个
local targetObj = sq_FindTarget(obj, 80, x_range, y_range, z_range);//对象 初始x 结束x 上下y范围 z范围 也是默认找第一个找到的
//特效用这个
local targetObj = obj.sq_FindFirstTarget(start_x, start_end_x, y_range, z_range);//寻找距离近的第一个目标
local targetObj = obj.sq_FindNextTarget(pActiveTarget, next_x_range, z_range);//寻找下一个目标
//寻找射击目标
local activeObject = sq_FindShootingTarget(obj, sq_GetDistancePos(sq_GetXPos(obj),obj.getDirection(),x), sq_GetYPos(obj), sq_GetZPos(obj) + z, 0, 0, 4, 14, -1, 300, 100, 50, 100);
//按角度找目标 男魔法的函数
local targetObj = findAngleTarget(obj, distance, angle, 100);
根据时间计算的坐标模板 常用
//按照时间 来进行移动;移动较为准确
local pAni = obj.getCurrentAnimation();//得到ani
local currentT = sq_GetCurrentTime(pAni);//当前时间
local fireT = pAni.getDelaySum(0, 0);//总时间
local srcX = obj.getVar().get_vector(0);//初始x坐标
local srcY = obj.getVar().get_vector(1);//初始y坐标
local srcZ = obj.getVar().get_vector(2);//初始z坐标
local MoveX = obj.getVar().get_vector(3);//移动多少x距离
local MoveY = obj.getVar().get_vector(4);//移动多少y距离
local MoveZ = obj.getVar().get_vector(5);//移动多少z距离
local v = sq_GetUniformVelocity(0, MoveX, currentT, fireT);
local dstX = sq_GetDistancePos(srcX, obj.getDirection(), v);//根据方向运算当前数值
sq_setCurrentAxisPos(obj, 0, dstX);//设置当前x坐标
sq_setCurrentAxisPos(obj, 1, dstY);//设置当前y坐标
sq_setCurrentAxisPos(obj, 2, dstZ);//设置当前z坐标
寻找地平线 垂直角度
//得到地平线的角度
local horizonAnglez = sq_GetShootingHorizonAngle(activeObject, y, 0, searchAngleH, maxDistance);
//得到垂直角度
local verticalAnglez = sq_GetShootingVerticalAngle(activeObject, z, 0, searchAngleV, maxDistance,300);
//寻找到角度后一般都给ptl使用
得到 设置坐标pos
//对象类
obj.getXPos();//x坐标
obj.getYPos();//y坐标
obj.getZPos();//z坐标
//任意对象
sq_GetXPos();//x坐标
sq_GetYPos();//y坐标
sq_GetZPos();//z坐标
local screenX = sq_GetScreenXPos(object);//位于屏幕x坐标
local screenY = sq_GetScreenYPos(object);//位于屏幕y坐标
//玩家
local mouseX = sq_GetMouseXPos();//鼠标x坐标
local mouseY = sq_GetMouseYPos();//鼠标y坐标
//对象类
pooledObj.setCurrentPos(x,y,z);
//任意对象
sq_SetCurrentPos(obj,x,y,z);
//设置单个x或y或z坐标
sq_setCurrentAxisPos(obj, 0, dstX);//设置当前x坐标
sq_setCurrentAxisPos(obj, 1, dstY);//设置当前y坐标
sq_setCurrentAxisPos(obj, 2, mz);//设置当前z坐标
得到 设置方向
local direction = obj.getDirection();//得到方向 对象类
local direction = sq_GetDirection(obj);//得到方向
local direction = obj.sq_GetInputDirection(0);//得到输入的方向?
sq_SetCurrentDirection(pooledObj, obj.getDirection());//设置方向
obj.setDirection(ENUM_DIRECTION_RIGHT);//设置方向 对象类
sq_GetOppositeDirection(direction);//得到相反的方向
//设置相反方向
sq_SetCurrentDirection(obj, sq_GetOppositeDirection(sq_GetDirection(obj)));//设置相反方向
//根据方向得到坐标
local dstX = sq_GetDistancePos(srcX, obj.getDirection(), v);//根据方向得到坐标
//根据比率得到结果值 #根据当前时间跟总时间以及当前位置跟到达位置按照比率得到现在的数值
local v = sq_GetUniformVelocity(0, MoveX, currentT, fireT);//此函数为均匀平均的移动
local v = sq_GetAccel(0, dis_x_len, currentT, dash_t, true);//此函数为先快后慢或先慢后快移动 最后一个参数 改为true快到慢 false慢到快
参数1;为初始位置
参数2:为结束位置
参数3:当前的时间
参数4:限制的总时间
可以分两种来进行移动;不过都是在被动proc函数中进行
第一种:
可以设置移动多少距离来计算;计算完成后再加上初始坐标,就可以得出当前需要移动到哪里
第二种:
可以设置初始跟结束位置,会自动计算出结果坐标;再直接进行移动即可
//下面是找花花要的一个弧线运行的函数
function getQuadraticFunction(obj,x,b,c)
{
local a = (-b.tofloat() * 4) /( c.tofloat() * c.tofloat());
return a.tofloat()*(x.tofloat() - c.tofloat() / 2)*(x.tofloat() - c.tofloat() / 2) + b.tofloat();
}
//结果要转为整数型
//参数1:对象
//参数2:0+ 0初始百分比 36到达百分比 height高度或者距离 100总百分比
local vz = getQuadraticFunction(obj,0 + sq_GetAccel(0, 36, currentT, delayT, true) ,height,100).tointeger();
//再或者这样写 弧度运行
local h = sq_GetUniformVelocity(0, 180, currentT, fireT);//得到角度
local vZ = 高度 * sq_SinTable(h) ;//得到弧形高度
根据两个x y点得到对角线距离
local distance = sq_GetDistance( X, Y - Z, posX, posY - posZ, true);//得到对角线距离
sq_GetDistanceObject(obj, object, true);//得到距离对象
//开平方根得到距离
sqrt(
(x1-x2)*(x1-x2)+
(y1-y2)*(y1-y2)
);
单个得到x或y距离
obj.getXDistance(pChr);//对象类 得到x距离
obj.getYDistance(pChr);//对象类 得到y距离
local posX = CNRDObject.getAngleDistanceXPos(obj.getVar("pos").get_vector(0), angle, radius, ENUM_DIRECTION_RIGHT);
local posY = CNRDObject.getAngleDistanceYPos(obj.getVar("pos").get_vector(1), angle, radius, false);
//坐标是否可到达
obj.isMovablePos(dstX, dstY);//活动类 对象
人物单纯的设置移动速度
//单纯的速度移动
//参数1:0为x轴 1为y轴 2为z轴
//参数2,3:为速度区间
//参数4,true 则按键才可移动 false则不能按键移动
//参数5:为加速;如果要移动固定距离 则速度*6为加速数值 可以移动到固定地点
//参数6:true 快到慢 false慢到快
obj.sq_SetStaticMoveInfo(0, xVelocity, xVelocity, false, xAccel, true);
obj.sq_SetStaticMoveInfo(1, 0, 0, false);
obj.sq_SetMoveDirection(obj.getDirection(), ENUM_DIRECTION_NEUTRAL);//开始移动
设置z的移动速度
//已z坐标移动 正数为上 负数为下
sq_SetZVelocity(obj,100,100);
设置速度 #xyz速度
sq_SetVelocity(obj, 0, 1500.0);
//参数1:对象
//参数2:类型 0x轴 1y轴 2z轴 不吃方向
//参数3:速度值
停止移动或停止z移动
obj.sq_ZStop();//停止z移动
obj.sq_StopMove();//停止移动
常用抓取 #判断目标是否可抓取或者可控制 #并且附加控制或者移动ap
sq_IsHoldable(obj,damager);//是否可控制
sq_IsFixture(damager);//是否是固定的
sq_IsGrabable(obj,damager);//是否可以抓取
sq_SetGrabable(obj, false);//设置是否可抓取
//控制 并且 延时死亡;参数3:是否控制 参数4:是否延时死亡 参数5:销毁ap时是否击飞 参数6:击飞距离 参数7:击飞高度
sq_HoldAndDelayDie(damager, obj, true, true, true, 200, 200, ENUM_DIRECTION_NEUTRAL , masterAppendage);
//使敌人目标按照时间 自动达到指定位置
sq_MoveToAppendageForce(ChrJob, obj, obj, 160, 0, ChrJob.getZPos(), 3000, false, null);
//速度快到慢
sq_AccelMoveToAppendageForce(aoDamager, obj, obj, x, 0, z - aoDamager.getObjectHeight()/2, liftTime, true, masterAppendage,true);
//寻找一个可以移动的坐标并移动过去
sq_MoveToNearMovablePos(obj,chrx ,chry , 350, objx, objy, 350, 100, -1, 5);
//吸怪 只能附加到活动类对象,角色或怪物
//参数1:我自己 参数2:吸附范围 参数3:以我自身x轴偏移到的吸附中心点 参数4:吸附强度
local appendage = sq_AttractToMe(obj, 200, 100, attractPower);
obj.getVar().setAppendage(0,appendage);//设置ap
local appendage = obj.getVar().getAppendage(0);//得到ap
if(appendage)//为真
appendage.setValid(false);//删除ap
//这个暂时没测试 好像是直接把某个目标给拉过来
sq_AtrractionForce(obj, damager, false, 270, -1, 2000.0, 1500.0, false); // 밀어내기
跟随移动 #且可以获得跟随移动目标的状态以及技能使用状态
sq_moveWithParent(obj, pooledObj);//跟随移动 参数1:被跟随的对象 参数2:要跟随的对象
local moveParent = sq_GetMoveParent(obj);//得到跟随的对象
local parentState = obj.sq_GetParentState();//特效类 得到跟随者的状态
local subState = obj.sq_GetParentSkillSubState();//特效类 得到跟随者的技能使用状态
角色设置寻找到的新的可以移动的位置 #防止卡墙
sq_SimpleMoveToNearMovablePos(obj,200);//直接防止卡墙
//参数1:起始寻找的x坐标
//参数2:起始寻找的y坐标
//参数3:寻找的x坐标范围
//参数4:寻找的y坐标范围
//参数5:寻找的偏移?
obj.sq_SetfindNearMovablePos(obj.getXPos(),obj.getYPos(),50,1,5);
寻找一个可以移动的x或y坐标
//对象类
//参数1:起始寻找的x坐标
//参数2:起始寻找的y坐标
//参数3:结束寻找的x坐标
//参数4:结束寻找的y坐标
//参数5:偏移
damager.sq_findNearLinearMovableXPos(x, y, obj.getXPos(), y, 10);
damager.sq_findNearLinearMovableYPos(x, y, obj.getXPos(), y, 10);
男魔法的圆形移动函数算法 #圆形移动解刨
local currentT = sq_GetObjectTime(ani);//当前时间
local currentSpeedRate = 1.0;//额外计算的 速度率
local defaultRoundTime = 3000;//每隔多少秒转一圈
local radius = 100;//旋转半径 总长度 半径*2
local base100Angle = 18000;//初始角度 这里应该是角度*100 最大角度是360
local baseX = obj.getXPos()+300;//初始x坐标
local baseZ = obj.getZPos()+200; // 初始z坐标
local current100Angle = (base100Angle + (36000 * currentSpeedRate * currentT / defaultRoundTime)) % 36000;//根据当前时间跟总时间 跟初始角度计算出当前角度
local angle = (current100Angle.tofloat() / 100.0);//除以100 得到正常角度
local disMovLen = radius * sq_CosTable(angle.tointeger());//根据角度计算圆形的长度
local mov_x = sq_GetDistancePos(baseX, sq_GetOppositeDirection(obj.getDirection()), disMovLen.tointeger());//按照对象方向跟初始坐标得到 目标x坐标
local axisMagnifyRate = 100;//半径//圆形高度的比率
local upMovLen = radius * sq_SinTable(angle.tointeger()) * axisMagnifyRate / 100;//得到圆形的高度
local mov_y = baseZ + upMovLen.tointeger();//得到要移动的y坐标
//下面的判断是
//移动的x坐标 不等于 初始x坐标减去100的话就移动x坐标 不过好像每什么用
if(mov_x!=baseX-100)
sq_setCurrentAxisPos(ani, 0, mov_x);
sq_setCurrentAxisPos(ani, 2, mov_y);
按键相关 连续输入 #连续按键判断之类
按下并弹起判断
obj.setSkillCommandEnable(SKILL_MULTI_SHOT,true);//激活技能使图标变亮
local b_useskill = obj.sq_IsEnterSkill(SKILL_MULTI_SHOT);//判断是否按下技能键 返回值不等于-1代表按下
E_ATTACK_COMMAND <- 0//攻击键
E_JUMP_COMMAND <- 1//跳跃键
E_DASH_COMMANDS_1 <- 2//右方向键
E_DASH_COMMANDS_2 <- 3//左方向键
E_CREATURE_COMMAND <- 4//宠物技能键
E_BUFF_COMMAND <- 5//buff技能键
E_SKILL_COMMAND <- 6//技能键 z
E_COMMAND_COUNT <- 7//没有这个 用这个会掉线
sq_SetKeyxEnable(obj, E_ATTACK_COMMAND, true);//设置其他按键
sq_IsEnterCommand(obj, E_ATTACK_COMMAND);//为真确认按下
按下按键判断
local isVertical = sq_IsKeyDown(OPTION_HOTKEY_MOVE_DOWN, ENUM_SUBKEY_TYPE_ALL);
//按下我的前方
if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_LEFT, ENUM_SUBKEY_TYPE_ALL) && obj.getDirection()== ENUM_DIRECTION_LEFT
||sq_IsKeyDown(OPTION_HOTKEY_MOVE_RIGHT, ENUM_SUBKEY_TYPE_ALL) && obj.getDirection()== ENUM_DIRECTION_RIGHT)
//按下我的后方
if(sq_IsKeyDown(OPTION_HOTKEY_MOVE_LEFT, ENUM_SUBKEY_TYPE_ALL) && obj.getDirection()== ENUM_DIRECTION_RIGHT
||sq_IsKeyDown(OPTION_HOTKEY_MOVE_RIGHT, ENUM_SUBKEY_TYPE_ALL) && obj.getDirection()== ENUM_DIRECTION_LEFT)
OPTION_HOTKEY__UNDEFINED <- -1 // 정의되지 않음
OPTION_HOTKEY_MOVE_UP <- 0 // (Up arrow)
OPTION_HOTKEY_MOVE_LEFT <- 1 // (Left arrow)
OPTION_HOTKEY_MOVE_DOWN <- 2 // (Down arrow)
OPTION_HOTKEY_MOVE_RIGHT <- 3 // (Right arrow)
OPTION_HOTKEY_ATTACK <- 4 // (X)
OPTION_HOTKEY_JUMP <- 5 // (C)
OPTION_HOTKEY_SKILL <- 6 // (Z)
OPTION_HOTKEY_SKILL2 <- 7 // buff용 키(space)
OPTION_HOTKEY_CREATURE_SKILL <- 8 // (V)
OPTION_HOTKEY_STATUS_WINDOW <- 9 // (M)
OPTION_HOTKEY_SKILL_WINDOW <- 10 // (K)
OPTION_HOTKEY_ITEM_INVENTORY <- 11 // (I)
OPTION_HOTKEY_OPTION_WINDOW <- 12 // (O)
OPTION_HOTKEY_NORMAL_QUEST_WINDOW <- 13 // (Q)
OPTION_HOTKEY_AVATAR_INVENTORY <- 14 // (U)
OPTION_HOTKEY_CERASHOP <- 15 // (T)
OPTION_HOTKEY_MINIMAP <- 16 // 던전 미니맵(N)
OPTION_HOTKEY_CREATURE_WINDOW <- 17 // (Y)
OPTION_HOTKEY_TOOLTIP_ <- 18 // 상세보기 전환키(R)
OPTION_HOTKEY_EPIC_QUEST_WINDOW <- 19 // (W)
OPTION_HOTKEY_QUICK_SKILL1 <- 20 // 스킬 슬롯(A, S, D, F, G, H)
OPTION_HOTKEY_QUICK_SKILL2 <- 21
OPTION_HOTKEY_QUICK_SKILL3 <- 22
OPTION_HOTKEY_QUICK_SKILL4 <- 23
OPTION_HOTKEY_QUICK_SKILL5 <- 24
OPTION_HOTKEY_QUICK_SKILL6 <- 25
OPTION_HOTKEY_EXSKILL1 <- 26 // 확장스킬 슬롯(F1 - F6)
OPTION_HOTKEY_EXSKILL2 <- 27
OPTION_HOTKEY_EXSKILL3 <- 28
OPTION_HOTKEY_EXSKILL4 <- 29
OPTION_HOTKEY_EXSKILL5 <- 30
OPTION_HOTKEY_EXSKILL6 <- 31
OPTION_HOTKEY_ITEM_QUICKSLOT1 <- 32 // 아이템 퀵 슬롯(1 - 6)
OPTION_HOTKEY_ITEM_QUICKSLOT2 <- 33
OPTION_HOTKEY_ITEM_QUICKSLOT3 <- 34
OPTION_HOTKEY_ITEM_QUICKSLOT4 <- 35
OPTION_HOTKEY_ITEM_QUICKSLOT5 <- 36
OPTION_HOTKEY_ITEM_QUICKSLOT6 <- 37
OPTION_HOTKEY_TOGGLE_ITEM_NAME_IN_DUNGEON <- 38 // 던전에서 아이템 이름보기(ctrl)
OPTION_HOTKEY_HIDE_MAIN_HUD <- 39 // 인터페이스 숨기기(Tab)
OPTION_HOTKEY_TOGGLE_TITLE_ANIMATION <- 40 // 닉네임 정보 모드 변환(E)
OPTION_HOTKEY_TOGGLE_SKILL_INFORMATION <- 41 // 스킬 툴팁 설명 모드 전환(F7)
OPTION_HOTKEY_PAUSE_IN_TOWER <- 42 // 사망의 탑 일시정지
OPTION_HOTKEY_CAPTURE_MOVING_PICTURE <- 43 // 동영상 캡쳐(Pause)
OPTION_HOTKEY_MENU_MY_INFO <- 44 // 내보관함 메뉴(7)
OPTION_HOTKEY_MENU_COMMUNITY <- 45 // 커뮤니티 메뉴(8)
OPTION_HOTKEY_MENU_CONTENTS <- 46 // 컨텐츠 메뉴(9)
OPTION_HOTKEY_MENU_SERVICE <- 47 // 서비스 메뉴(0)
OPTION_HOTKEY_MENU_SYSTEM__CLOSE_ALL_WINDOW <- 48 // 모든창닫기(Esc)
OPTION_HOTKEY_PVP <- 49 // 결투장(P)
OPTION_HOTKEY_RECOMMEND_USER <- 50 // 추천동료([)
OPTION_HOTKEY_PARTY_MATCHING <- 51 // 파티매칭(])
OPTION_HOTKEY_FRIEND <- 52 // 친구(L)
OPTION_HOTKEY_GUILD <- 53 // 길드(;)
OPTION_HOTKEY_MEMBER <- 54 // 멤버(')
OPTION_HOTKEY_BLACKLIST <- 55 // 차단
OPTION_HOTKEY_PVP_BUDDY <- 56 // 결투친구
OPTION_HOTKEY_WAR_AREA_LIST <- 57 // 전쟁지역목록창(,)
OPTION_HOTKEY_AUCTION_WINDOW <- 58 // 경매장(B)
OPTION_HOTKEY_GOBLIN_PAD <- 59 // 고블린패드
OPTION_HOTKEY_HOTKEY_SETTING_WINDOW <- 60 // 단축키 설정창
OPTION_HOTKEY_WAR_AREA_INFORMATION <- 61 // 전쟁지역 정보창(End)
OPTION_HOTKEY_HELLMODE_INFORMATION <- 62 // 더 이상 사용되지 않음
OPTION_HOTKEY_FAVOR_CHECK_WINDOW <- 63 // 더 이상 사용되지 않음
OPTION_HOTKEY_EXPERT_JOB <- 64 // 전문직업 기능
OPTION_HOTKEY_EMOTION_EXPRESSION <- 65 // 감정표현 기능
OPTION_HOTKEY_EVENT <- 66 // 이벤트키(shift)
OPTION_HOTKEY_PVP_MSSION <- 67 // 미션윈도우
OPTION_HOTKEY_PVP_RECORD <- 68 // 전적보기창
OPTION_HOTKEY_QUICK_CHAT_0 <- 69
OPTION_HOTKEY_QUICK_CHAT_1 <- 70
OPTION_HOTKEY_QUICK_CHAT_2 <- 71
OPTION_HOTKEY_QUICK_CHAT_3 <- 72
OPTION_HOTKEY_QUICK_CHAT_4 <- 73
OPTION_HOTKEY_QUICK_CHAT_5 <- 74
OPTION_HOTKEY_QUICK_CHAT_6 <- 75
OPTION_HOTKEY_QUICK_CHAT_7 <- 76
OPTION_HOTKEY_QUICK_CHAT_8 <- 77
OPTION_HOTKEY_QUICK_CHAT_9 <- 78
OPTION_HOTKEY_TOGGLE_ITEMINFO_COMPARE <- 79 // 아이템 비교창 전환키 (Default: F8)
OPTION_HOTKEY_TITLEBOOK <- 80 // 칭호북
OPTION_HOTKEY_THIS_DUNGEON <- 81 // 재도전
OPTION_HOTKEY_ANOTHER_DUNGEON <- 82 // 다른 던전 도전
OPTION_HOTKEY_RETURN_TO_TOWN <- 83 // 마을로 돌아가기
OPTION_HOTKEY_MERCENARY_SYSTEM <- 84 // 용병 시스템
OPTION_HOTKEY_ITEM_DICTIONARY <- 85
OPTION_HOTKEY_QUICK_PARTY_REGISTER <- 86 // 빠른 파티 등록 요청
//蓄力
obj.sq_IsEnterSkillLastKeyUnits(SKILL_FIREPILLAR);//可以蓄力
obj.isDownSkillLastKey();//判断是否按下技能键键
//开始快速输入? #没怎么测试
//输入频率?
obj.startRapidInput();
obj.getRapidInputFrequency();
//用法一:
//每次记录按下键时 就增加一次连续输入
obj.addRapidInput();//增加连续输入记录
//用此函数可以得到按下了多少次
obj.getRapidInputFrequency();//得到连续的按键信息
//技能负载 画ui
//增加技能负载
obj.sq_AddSkillLoad(SKILL_ATGUNNER_HS12, 50, 1, 500);//技能编号,img序号,可以使用几次,冷却时间
//删除技能负载
obj.sq_RemoveSkillLoad(SKILL_ATGUNNER_HS12);//技能编号
//得到技能负载
local loadSlot = obj.sq_GetSkillLoad(SKILL_ATGUNNER_HS12);
//判断是否在冷却中
loadSlot.isCooling();
//使用几次
loadSlot.use(1);
//得到剩余装载数
loadSlot.getRemainLoadNumber();
//开始冷却
loadSlot.setStartCool();
//得到总冷却时间
loadSlot.getEndCoolTime();
//得到现在的冷却时间、
loadSlot.getCurrentCoolTime();
//得到icon ID
loadSlot.getInconIndex();
//icon图标路径 //台服最多不能超过50
sprite/character/common/customui/icon.img
//ptl设置 创建 更改相关
//特效增加 删除 设置移动ptl
obj.sq_SetMoveParticle("Particle/ATWaterCannonMove.ptl", 0.0, 0.0);//设置移动的ptl 路径是特效的路径为父路径
obj.sq_RemoveMoveParticle();//删除特效身上的移动ptl
//参数1:特效对象
//参数2:移动类型 0:x坐标 1:y坐标 2:z坐标
//参数3:速度值
sq_SetSpeedToMoveParticle(obj,0,speed);//设置移动速度
obj.sq_AddObjectParticleCreater("Particle/ATWaterCannonTail.ptl");//增加额外的ptl
obj.sq_SetObjectParticlePos(0, 1, 0);//设置创建ptl的x y z轴坐标
//增加一个以map为坐标的ptl
local particleCreater = obj.sq_var.GetparticleCreaterMap("ATWaterCannon","PassiveObject/Character/Mage/Particle/ATWaterCannonTail.ptl", obj);//得到ptl
particleCreater.Restart(0);//重置
particleCreater.SetPos(x, y, z);//设置xyz
sq_AddParticleObject(obj, particleCreater);//增加ptl对象
//创建ptl 删除ptl
//参数1:路径
//参数2:对象
//参数3:x偏移(方向为右)
//参数4:y偏移
//参数5:z偏移
//参数6:是否跟随 参数2对象移动 bool值
//参数7:创建间隔
//参数8:最长存在时间
//参数9:最大创建次数
sq_CreateParticle("Character/Priest/Effect/Particle/ExcutionStonsLarge.ptl", obj, 180, 5, 250, true, 30, 0, 2);//创建ptl
sq_RemoveParticle("PassiveObject/Character/Mage/Particle/ATIceOrbDust.ptl",obj);//删除ptl
//未知 没测试
sq_CreateParticleByGlobal(obj.getDustParticleType(LANDPARTICLE_MOVE), obj, x, 0, 0, true, 80, 120, 5);
sq_CreateParticleByGlobal(PARTICLE_CREATER_WATER_HIT_LIGHT, // ENUM_PARTICLE_CREATER
obj, // CNRDObject* master,
0, //int x,
-1, //int y,
0, //int z,
true, //bool posistionFromMaster,
30, //int timeGap,
150, //int maxTime,
5); //int maxCount
//得到鼠标,控制鼠标
//得到鼠标位置 设置鼠标位置
local Mouse = IMouse();//得到鼠标类
Mouse.GetXPos();//得到鼠标x坐标
Mouse.GetYPos();//得到鼠标x坐标
Mouse.SetXPos(400);//设置鼠标x坐标
Mouse.SetYPos(300);//设置鼠标y坐标
Mouse.SetPos(400,300);//设置鼠标x,y坐标 游戏程序一直运行 他就会一直设置鼠标坐标
Mouse.SetPosBasedOnGameWindow(400,200);//设置鼠标x,y坐标 游戏窗口获取焦点后才会改变鼠标坐标
//是否处于异常状态下 删除异常状态
sq_ReleaseActiveStatus(sqrObj, ACTIVESTATUS_POISON);//删除异常状态
//判断前先转为活动类对象
if (sq_IsValidActiveStatus(obj, ACTIVESTATUS_STUN))
{
// STUN 걸려있으면 해제시킴. STATE_STAND로 돌아가지 않게 disable시킴
obj.setEnableChangeState(false);
sq_IsSetActiveStatus(obj, ACTIVESTATUS_STUN, 0.0);
obj.setEnableChangeState(true);
}
ACTIVESTATUS_SLOW <- 0 // 减速
ACTIVESTATUS_FREEZE <- 1 // 冰冻
ACTIVESTATUS_POISON <- 2 // 中毒
ACTIVESTATUS_STUN <- 3 // 眩晕
ACTIVESTATUS_CURSE <- 4 // 诅咒
ACTIVESTATUS_BLIND <- 5 // 失明
ACTIVESTATUS_LIGHTNING <- 6 // 感电
ACTIVESTATUS_STONE <- 7 // 石化
ACTIVESTATUS_SLEEP <- 8 // 睡眠
ACTIVESTATUS_BURN <- 9 // 燃烧
ACTIVESTATUS_WEAPON_BREAK <- 10 // 武器破甲
ACTIVESTATUS_BLEEDING <- 11 // 出血
ACTIVESTATUS_HASTE <- 12 // 加速
ACTIVESTATUS_BLESS <- 13 // 祝福
ACTIVESTATUS_ELEMENT <- 14 // 엘레먼트
ACTIVESTATUS_CONFUSE <- 15 // 混乱
ACTIVESTATUS_HOLD <- 16 // 束缚
ACTIVESTATUS_ARMOR_BREAK <- 17 // 护甲破甲
ACTIVESTATUS_MAX <- 18
//得到对象,ani,状态时间
local time = sq_GetObjectTime(obj);//得到对象时间
local stateTime = obj.sq_GetStateTimer();//角色类 得到状态时间
local currentT = sq_GetCurrentTime(pAni);//ani得到当前时间
//重置攻击
obj.resetHitObjectList();//重置攻击 控制类对象
//是否处于可攻击到状态 #判断怪物是否可以被攻击到
object.isInDamagableState(obj);//控制类对象
//增加攻击对象 #把对象加入到我的攻击列表中 #代表我已攻击到
sq_AddHitObject(obj, damager);//增加攻击对象
//如果没有效果 可以转为活动类 或者 控制类对象后加入
//震动 闪屏
sq_SetMyShake(obj,8,300);//震动 只有我自己震动
sq_SetShake(obj,6,400);//震动 所有人都可以看到的震动
//闪屏
//参数说明:
//1.对象
//2.出现的时间
//3.持续的时间
//4.消失的时间
//5.透明度:255不透明 0透明看不见
//6.rgb颜色值
//7.颜色效果
//8.闪屏图层;可设置最顶层或底层
sq_flashScreen(obj,80,100,240,150, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM);//闪屏
//加入到对象后;可以清除
local flashScreenObj = sq_flashScreen(obj,80,99990,240,150, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM);
obj.getVar("flashobj").clear_obj_vector();//清除
obj.getVar("flashobj").push_obj_vector(flashScreenObj);//加入
local flashScreenObj = obj.getVar("flashobj").get_obj_vector(0);//得到
local pflashScreen = sq_GetCNRDObjectToFlashScreen(flashScreenObj);//转为闪屏类
if(pflashScreen) pflashScreen.fadeOut();//为真 销毁
local fScreen = sq_flashScreen(obj,0,80,0,80, sq_RGB(255,255,255), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM);
sq_addFlashScreen(fScreen, 0, 240, 240, 150, sq_RGB(0,0,0), GRAPHICEFFECT_NONE, ENUM_DRAWLAYER_BOTTOM);
//常量
GRAPHICEFFECT_NONE <- 0 // 橈擠
GRAPHICEFFECT_DODGE <- 1 // 游雖
GRAPHICEFFECT_LINEARDODGE <- 2 // 葬棲橫 游雖
GRAPHICEFFECT_DARK <- 3 // 棻觼
GRAPHICEFFECT_XOR <- 4 // XOR
GRAPHICEFFECT_MONOCHROME <- 5 // 欽儀
GRAPHICEFFECT_SPACE_DISTORT <- 6 // 奢除諼堊
GRAPHICEFFECT_MAX <- 7
ENUM_DRAWLAYER_CONTACT <- 0 // 蕾唳 溯檜橫
ENUM_DRAWLAYER_NORMAL <- 1 // 橾奩 溯檜橫
ENUM_DRAWLAYER_BOTTOM <- 2 // 夥款 溯檜橫
ENUM_DRAWLAYER_CLOSEBACK <- 3 // 斬唳 溯檜橫
ENUM_DRAWLAYER_MIDDLEBACK <- 4 // 醞唳 溯檜橫
ENUM_DRAWLAYER_DISTANTBACK <- 5 // 錳唳 溯檜橫
ENUM_DRAWLAYER_COVER <- 6 // 賊擊 竣朝 溯檜橫 ex : Blind
ENUM_DRAWLAYER_MAX <- 7
//播放声音
//播放声音;参数为客户端xml文件内的声音ID
obj.sq_PlaySound("SM_BLOODBOOM_02");//播放声音
//播放声音,并且赋予ID值
obj.sq_PlaySound("ICEORB_THORN_LOOP",3711);//播放循环的声音
//停止播放
obj.stopSound(3711);//停止播放
//创建特效
//角色创建特效 方向跟坐标都是以角色偏移 参数分别是:特效编号,等级,x偏移,y偏移,z偏移
obj.sq_SendCreatePassiveObjectPacket(24201, 0, 120, 1, 0);
//创建特效 参数分别是:对象,特效编号,等级,x偏移,y偏移,z偏移,方向
sq_SendCreatePassiveObjectPacket(obj, 24243, 0, 0, 0, 0, obj.getDirection());
//以map的坐标创建特效 参数分别是:对象,特效编号,等级,x坐标,y坐标,z坐标
sq_SendCreatePassiveObjectPacketPos(parentObj, 24256, 0, x, y, z);
//以父对象的坐标创建特效 参数分别是:对象,特效编号,等级,x偏移,y偏移,z偏移
sq_SendCreatePassiveObjectPacketFromPassivePos( obj, 24370, 0, 0, 0);
//还有一个没测试 是缔造者的
sq_CreatePassiveObjectAfterWarning(obj, 23505, skill_level, null);
//传递
sq_BinaryStartWrite();
sq_BinaryWriteBool();
sq_BinaryWriteFloat();
sq_BinaryWriteWord();
sq_BinaryWriteByte();
sq_BinaryWriteDword();
//人物传递
obj.sq_StartWrite();
obj.sq_WriteBool();
obj.sq_WriteFloat();
obj.sq_WriteWord();
obj.sq_WriteByte();
obj.sq_WriteDword();
//接收
receiveData.getSize();
reciveData.readBool();
reciveData.readByte();
reciveData.readWord();
reciveData.readDword();
reciveData.readFloat();
//得到角色类型 得到角色转职类型
ENUM_CHARACTERJOB_SWORDMAN <- 0 /// 鬼剑
ENUM_CHARACTERJOB_FIGHTER <- 1 /// 女格斗
ENUM_CHARACTERJOB_GUNNER <- 2 /// 男枪
ENUM_CHARACTERJOB_MAGE <- 3 /// 女魔法
ENUM_CHARACTERJOB_PRIEST <- 4 /// 圣职者
ENUM_CHARACTERJOB_AT_GUNNER <- 5 /// 女枪
ENUM_CHARACTERJOB_THIEF <- 6 /// 暗夜使者
ENUM_CHARACTERJOB_AT_FIGHTER <- 7 /// 男格斗
ENUM_CHARACTERJOB_AT_MAGE <- 8 /// 男魔法
ENUM_CHARACTERJOB_DEMONIC_SWORDMAN <- 9 /// 黑暗武士
ENUM_CHARACTERJOB_CREATOR_MAGE <- 10 /// 缔造者
ENUM_CHARACTERJOB_MAX <- 11 ///
sq_getJob(obj);//得到角色类型
sq_getGrowType(obj);//得到转职类型
//得到我的角色
local chr = sq_getMyCharacter();//得到我的角色
local chr = sq_GetMyMasterCharacter();//得到我的主人角色
//施放技能时 创建读条 以及 删除读条
local skill_level = sq_GetSkillLevel(obj, SKILL_ICEROAD);//技能等级
local castTime = sq_GetCastTime(obj, SKILL_FIRE_ROAD, skill_level);//得到技能里面的施放时间
sq_SetFrameDelayTime(animation, 0, castTime);//设置ani帧时间
sq_StartDrawCastGauge(obj, castTime, true);//开始读条
sq_EndDrawCastGauge(obj);//结束读条
//霸体 隐身 无敌
POD_VAR_ARROW_COUNT <- 1; // 已使用的箭数
POD_VAR_CIRCLE_INDEX <- 2; // 生成的具体索引
POD_VAR_CIRCLE_OBJECT_GROUP <- 3; // 创建的具体组
POD_VAR_CIRCLE_OBJECT_UID <- 4; // 创建的具体UID
POD_VAR_CIRCLE_OBJECT <- 5; // 已创建的球体
POD_VAR_SUPERARMOR <- 6; // 超级智能侦探
POD_VAR_FLASHSCREEN <- 7; // 已创建的球体
//此霸体必须在状态结束时 删除霸体,不然会一直存在 如果是复仇者的话sq_后面一个字母改为小写即可
obj.sq_SetSuperArmor(POD_VAR_SUPERARMOR);
obj.sq_RemoveSuperArmor(POD_VAR_SUPERARMOR);
obj.sq_SetSuperArmorUntilTime(obj, 1000);//霸体多长时间自动销毁
//参数3
//2无敌
DAMAGETYPE_SUPERARMOR = 1
DAMAGETYPE_NORMAL = 0
sq_SetCustomDamageType(obj, true, 1); //设置损伤类型
//设置旋转角度
obj.setCustomRotate(true, angle);//对象类
sq_SetCustomRotate(obj, 0.0);//任意对象 旋转
sq_SetfRotateAngle(pAni, angle);//给ani设置旋转
sq_AddfRotateAngle(pAni, angle);//给ani设置旋转
变量.tofloat();//转为浮点数
变量.tointeger();//转为整数型
//atan2 参数1:长度 参数2:高度//那么就会得到 靠近高度的三角形角度
//atan2 得到的就是弧度
//sq_ToDegree 得到的是角度
//sq_ToRadian 转为弧度
//转为弧度后 再给予函数进行旋转
//也可以直接给 sq_ToRadian(90.0);//那么就是得到90°的旋转弧度
local angle = sq_ToDegree(sq_Atan2(x.tofloat(), z.tofloat()));//转为角度
sq_ToRadian(angle);//将角度转化为弧度
//发送冷却未完毕的公告消息
obj.startCantUseSkillWarning();
if (obj.isMessage()) sq_AddMessage(414);//冷却未完毕
//设置 或 判断 冷却时间 或者与技能相关
//批量设置冷却
local bursterSkill = sq_GetSkill(chr, SKILL_BURSTER);//得到技能
local pIntVec = sq_GetGlobalIntVector();//包
sq_IntVectorClear(pIntVec);//清除
sq_IntVectorPush(pIntVec, SKILL_BURSTER);//加入技能ID
local size = sq_GetCustomIntDataSize(bursterSkill, chr);//得到技能的静态数据范围
for (local i = 0; i < size; i++)
{
local disableSkillIndex = sq_GetIntData(chr, SKILL_BURSTER, i);//得到静态数据
sq_IntVectorPush(pIntVec, disableSkillIndex);//加入技能ID
}
//参数1:角色
//参数2:冷却时间
//参数3:包
sq_SetStartCoolTime(chr, 0, pIntVec);//设置冷却
sq_SendMessage(parentObj, OBJECT_MESSAGE_GHOST, 1, 0);
sq_PostDelayedMessage(parentObj, OBJECT_MESSAGE_GHOST, 0, 0, 8000);
//判断技能是否处于冷却状态下
sq_GetSkill(obj, 69).isInCoolTime();//是否处于冷却
//重置冷却
local skill = sq_GetSkill(obj, SKILL_ICEROAD);//得到技能
skill.resetCurrentCoolTime();//重置冷却
使技能进入冷却
local skill_level = sq_GetSkillLevel(obj, SKILL_ICEROAD);//得到技能等级
obj.startSkillCoolTime(SKILL_ICEROAD, skill_level, -1);//开始技能冷却
//判断技能是否开启 或者 设置技能是否可使用 #就是可以更改开关的技能
local skill = sq_GetSkill(obj, SKILL_ICEROAD);
skill.isSealActiveFunction();//判断是否开启
skill.setSealActiveFunction(true);//true开启 false关闭
//判断对象类型 判断是否是相同对象 是否是敌人 是否死亡
object.isObjectType(OBJECTTYPE_ACTIVE);//控制对象类 判断对象类型
obj.isEnemy(object);//控制类对象 是否是敌人
local activeObj = sq_GetCNRDObjectToActiveObject(object);
activeObj.isDead();//活动类对象 是否死亡
isSameObject(obj, object);//判断是否是相同对象
OBJECTTYPE_OBJECT <- 0 // 譆鼻嬪 螃粽薛
OBJECTTYPE_COLLISION <- 1 // 醱給 螃粽薛 (OBJECTTYPE_OBJECT 嬪)
OBJECTTYPE_ACTIVE <- 17 // 棟翕 螃粽薛 (OBJECTTYPE_COLLISION 嬪)
OBJECTTYPE_CHARACTER <- 273 // 議葛攪 螃粽薛 (OBJECTTYPE_ACTIVE 嬪)
OBJECTTYPE_MONSTER <- 529 // 跨蝶攪 螃粽薛 (OBJECTTYPE_ACTIVE 嬪)
OBJECTTYPE_RIDABLEOBJECT <- 4625 // 驍匙 婦溼 螃粽薛 (OBJECTTYPE_MONSTER 嬪)
OBJECTTYPE_PASSIVE <- 33 // 熱翕 螃粽薛 (OBJECTTYPE_COLLISION 嬪)
OBJECTTYPE_ITEM <- 289 // 嬴檜蠱 螃粽薛 (OBJECTTYPE_PASSIVE 嬪)
OBJECTTYPE_TRAP <- 545 // 椰 螃粽薛 (OBJECTTYPE_PASSIVE 嬪)
OBJECTTYPE_BREAKABLE <- 1057 // 惚 陛棟 螃粽薛(爾僭鼻濠 售) (OBJECTTYPE_PASSIVE 嬪)
OBJECTTYPE_PET <- 65 // 褐熱 (OBJCTTYPE_COLLISION 嬪)
OBJECTTYPE_CREATURE <- 129 // 觼葬藥 (OBJCTTYPE_COLLISION 嬪)
OBJECTTYPE_DRAWONLY <- 2 // 斜葬晦 瞪辨 螃粽薛 (OBJECTTYPE_OBJECT 嬪)
OBJECTTYPE_VIRTUALCHARACTER <- 18 // 渠晦褒縑憮 噙朝 陛鼻 議葛攪 (OBJECTTYPE_DRAWONLY 嬪)
OBJECTTYPE_NPC <- 34 // 渠晦褒曖 NPC (OBJECTTYPE_DRAWONLY 嬪)
OBJECTTYPE_DONKEY <- 66 // 渠晦褒曖 偃檣鼻薄 (OBJECTTYPE_DRAWONLY 嬪)
OBJECTTYPE_VIRTUALCREATURE <- 130 // 渠晦褒縑憮 噙朝 陛鼻 觼葬藥(OBJECTTYPE_DRAWONLY 嬪)
OBJECTTYPE_DISJOINTSHOP <- 258 // 渠晦褒曖 羹陛 羹 鼻薄(OBJECTTYPE_DRAWONLY 嬪)
OBJECTTYPE_VIRTUALMONSTER <- 514 // 渠晦褒縑憮 噙朝 陛鼻 跨蝶攪 (OBJECTTYPE_DRAWONLEY 嬪)
OBJECTTYPE_NONE_DELETE <- 1026 // 螃粽薛 餉薯 衛 餉薯腎雖 彊朝 螃粽薛 (OBJECTTYPE_DRAWONLEY 嬪)
OBJECTTYPE_DEFINE_END <- 61440
//hp mp相关 #设置hp或者mp或者得到
//根据转换率得到转换后的实际hp值
数值需要通过运算后得到正确数值
local convert_rate = sq_GetAbilityConvertRate(obj, CONVERT_TABLE_TYPE_HP);//先得到转换率
local dooms_con_hp = dooms_hp.tofloat() * convert_rate.tofloat();//得到正确的数值
//转换常量
CONVERT_TABLE_TYPE_DAMAGE <- 0 // 等嘐雖
CONVERT_TABLE_TYPE_DEFENSE <- 1 // 寞橫溘
CONVERT_TABLE_TYPE_HP <- 2 // HP MAX
CONVERT_TABLE_TYPE_PHYSICAL_ATTACK <- 3 //
CONVERT_TABLE_TYPE_PHYSICAL_DEFENSE <- 4 // 羹溘
CONVERT_TABLE_TYPE_MAGICAL_ATTACK <- 5 // 雖棟
CONVERT_TABLE_TYPE_MAGICAL_DEFENSE <- 6 // 薑褐溘
CONVERT_TABLE_TYPE_PHYSICAL_ABSOLUTE_DAMAGE <- 7 // 僭葬 瞰渠 等嘐雖
CONVERT_TABLE_TYPE_PHYSICAL_DAMAGE_REDUCE <- 8 // 僭葬 等嘐雖 爾薑
CONVERT_TABLE_TYPE_MAGICAL_ABSOLUTE_DAMAGE <- 9 // 葆徹 瞰渠 等嘐雖
CONVERT_TABLE_TYPE_MAGICAL_DAMAGE_REDUCE <- 10 // 葆徹 等嘐雖 爾薑
CONVERT_TABLE_TYPE_ACTIVESTATUS_DAMAGE_REDUCE <- 11 // 鼻鷓檜鼻 等嘐雖 爾薑.
CONVERT_TABLE_TYPE_MP <- 12 // MP MAX
CONVERT_TABLE_TYPE_SKILL_POWER <- 13 // 蝶鑒 絮董等嘐雖
CONVERT_TABLE_TYPE_MAX <- 14
//得到 设置 hp mp
obj.getHpMax();//活动类 得到hp上限
obj.getHp();//活动类 得到当前hp
obj.setHp(0, null, true);//活动类 设置hp
obj.getMpMax();//活动类 得到mp上限
obj.getMp();// 活动类 得到当前mp
obj.sendSetMpPacket(obj.getMpMax());//活动类 设置mp
sqrObj.sq_SendSetHpPacket(sqrObj.getHp() + hp, true, parentObj);//角色类 设置hp
sqrObj.sq_SendSetMpPacket(sqrObj.getHp() + hp, true, parentObj);//角色类 设置mp
//移动视角
//自带比较简单的移动;会受到人物的方向所影响
obj.sq_SetXScrollStart(500, 0);//开始移动视角;1.移动距离 2.达到距离时间
obj.sq_SetXScrollStop(500);//回归视角 1.视角回归总时间
obj.sq_SetXScroll(1000, 500, 0, 500);//移动视角 1.移动距离 2.达到时间 3.等待时间 4.回归时间
//发送破坏对象包
if(!parentObj)
{
if(obj.isMyControlObject())
{
//发送摧毁包被动对象;销毁obj特效
sq_SendDestroyPacketPassiveObject(obj);
return;
}
}
obj.sendDestroyPacket(true);//对象类 发送破坏包
//得到随机数
//这个随机 只要第一个参数不为true 则取得随机数不会重复,但是会返回-1,参数2 最小值随机数不能小于0
//参数3 随机数,如果设置20,那么只会随机到19,不会随机到20
local index = sq_getRandomUnique(true, 0, ::ElementalRainCreatePos.len());
sq_getRandom(10,20);//数值随机 可以小于0
sq_getRandomFloat(0.1,0.9);//浮点数随机,没试过
//得到控制对象的lst列表的ID
obj.getCollisionObjectIndex();//控制类对象 得到lstId
//得到人物当前的技能ID
local skillIndex = obj.getCurrentSkillIndex();//活动类对象 得到技能ID
//得到当前副本 或 map的ID
ocal stage = sq_GetGlobaludpModuleStage();//得到模块
local dungeon = sq_GetDungeonByStage(stage);//得到副本模块
local dungeonIndex = sq_GetDuegonIndex(dungeon);//得到副本ID
local mapIndex = sq_GetMapIndex(stage);//得到mapID
//得到当前场景模块类型
//得到当前的场景模块类型
sq_GetCurrentModuleType();
//1是城镇 3是副本中
MODULE_TYPE_NONE <- -1
MODULE_TYPE_ENTRANCE <- 0
MODULE_TYPE_ROOM_LIST <- 1 // 마을
MODULE_TYPE_SELECT_DUNGEON <- 2 // 던전 선택화면
MODULE_TYPE_MAIN_GAME <- 3 // 일반던전(이계 포함)
MODULE_TYPE_PVP <- 4 // 결장
MODULE_TYPE_FAIR_PVP <- 5 // 공결
//MODULE_TYPE_LABYRINTH <- 7 // 사라짐
MODULE_TYPE_SELECT_CHANNEL <- 6
MODULE_TYPE_WARROOM <- 7 // 전쟁지역
//MODULE_TYPE_CHAOS <- 8
MODULE_TYPE_LOGIN <- 8
MODULE_TYPE_ASSAULT <- 9 // 싸우자
MODULE_TYPE_DEAD_TOWER <- 10 // 사탑
MODULE_TYPE_BLOOD_SYSTEM <- 11 // 무한의 제단
MODULE_TYPE_DESPAIR_TOWER <- 12 //절망의탑
// 글로벌실 컨텐츠
MODULE_TYPE_BOSS_TOWER <- 13 //심연의 투기장
MODULE_TYPE_ADVANCE_ALTAR <- 14 //진격의 제단
MODULE_TYPE_LOAD <- 15
MODULE_TYPE_TOURNAMENT <- 16
MODULE_TYPE_MAX <- 17
MODULE_TYPE_PVP_TYPE <- 18 // 결투장, 싸우자, 전쟁지역을 합쳐 지칭
MODULE_TYPE_DUNGEON_TYPE <- 19 // 던전, 사탑, 무제를 합쳐 지칭
MODULE_TYPE_ALL <- 20
//MODULE_TYPE_LOAD <- 13
//MODULE_TYPE_TOURNAMENT <- 14
//MODULE_TYPE_MAX <- 15
//MODULE_TYPE_PVP_TYPE <- 16 // 결투장, 싸우자, 전쟁지역을 합쳐 지칭
//MODULE_TYPE_DUNGEON_TYPE <- 17 // 던전, 사탑, 무제를 합쳐 지칭
//MODULE_TYPE_ALL <- 18 // 모든 모듈을 지칭
//判断是否是我提供的技能等级以上
obj.isOverSkillLevel(SKILL_AVENGER_AWAKENING, 4);//角色类
//判断对象是否处于map某个范围内
sq_IsinMapArea(obj, object, firstTargetXStartRange, firstTargetXEndRange, firstTargetYRange);
//是否是存在对象
sq_IsExistObject(parentObj, source);
//是否在pvp模块
sq_isPVPMode();
//判断副本类型 #是否是塔 #是否是古老副本
local stage = sq_GetGlobaludpModuleStage();//得到模块
local dungeon = sq_GetDungeonByStage(stage);//得到副本
local isDimensionDungeon = sq_IsDimensionDungeon(dungeon);//维度地牢
local isDespairTower = sq_IsDespairTower(dungeon);//绝望塔
local isAncientDungeon = sq_IsAncientDungeon(dungeon);//古老地牢
local isTower = sq_IsTowerDungeon();//塔
//设置边框轮廓 #描边效果
sq_SetObjectBounding(obj, jumpVelocity);
//最后一个参数是 描边像素宽度
obj.setCustomOutline(false, 0, true, 2);
obj.setCustomOutline(true, rgb, false, 1);
obj.setCustomOutline(true, sq_RGBA(255, 0, 0, 10), false, 4);
//在画ui函数中用到的函数方法 #函数drawCustomUI
//普通画动图ui
sq_AnimationProc(ani);
sq_drawCurrentFrame(ani, x, y, false);
//可以增加rgb 或者透明度
sq_AnimationProc(gauge_normal_flash);
sq_drawCurrentFrameEffect_SIMPLE(gauge_normal_flash, x, y, rgb, alpha);
//画的固定帧 坐标是取的绝对屏幕坐标
sq_DrawSpecificFrame(hudCreatorAni, x, y, false, 0, false, 1.0);
//rgba
sq_DrawSpecificFrameEffect_SIMPLE(hud_creator_b_gauge, gaugePosX + (slot * offset), y, 0, rgb, alpha, true);
//没用过这个 原版是在特效中的被动 但是被注释掉了
sq_drawCurrentFrameEffectColor(ani, GRAPHICEFFECT_MONOCHROME, true, sq_RGB(255,255,255), sq_ALPHA(255));
//画出预设弹窗文字
sq_drawToolTip(x - 35, y - 13, sq_RGB(255,255,255), 0, 1, 29003, 0, 260, true);
//数值类型转换
//转为浮点数
//变量.tofloat()
//转为整数型
//变量.tointeger()
//转为整数型
//变量.tostring()
//字符串取长度
local len = Value.len();
//分割
local son = Value.slice(i,i+1);
设置跟随过图
//设置跟随对象 控制类
obj.setMapFollowParent(obj.getParent());//设置跟随对象
//设置跟随的类型
obj.setMapFollowType(1);//设置跟随类型
//1//跟着过图 会出现在门周围
//2;//跟着过图 会出现在门周围
//3;//跟着过图 坐标会有点乱。。
//4;//跟着过图 坐标在门的前方
//5,6;//跟着过图 过图后坐标为0 0 0
//得到团队类型
parentObj.sq_GetTeam();//角色类 得到团队类型
attacker.getTeam();//控制类对象 得到团队类型
//得到当前武器sub使用类型
obj.getWeaponSubType();
//得到怪物种类 #例如精灵什么的
sq_IsInCategory(parentObj,CATEGORY_ETC_FIXTURE);
//检测怪物类型 #例如深渊或者boss之类等等
local activeObj = sq_GetCNRDObjectToActiveObject(object);//转为活动类对象
sq_IsAiCharacter(activeObj);//是否是apc人偶
sq_IsNamed(activeObj);//是否是精英怪物
sq_IsHellMonster(activeObj);//是否是深渊怪物
sq_IsBoss(activeObj);//是否是BOSS怪物
activeObj.isChampion();//是否是异常状态怪物 活动类
activeObj.isCommonChampion();//是否是常见异常怪物 活动类
activeObj.isSuperChampion();//是否是超级异常怪物 活动类
obj.isEnemy(object);//是否是敌人 控制类
//通过攻击框得出中心点坐标
local x = sq_GetCenterXPos(boundingBox);//得到边界框的x轴中心点
local y = sq_GetCenterYPos(boundingBox);//得到边界框的y轴中心点
local z = sq_GetCenterZPos(boundingBox);//得到边界框的z轴中心点
//强制掉线 #运行后游戏直接奔溃
setBreak(obj);
setBreak();
//暂停 #暂停 #让其停止
sq_SetPause(obj, PAUSETYPE_OBJECT, pauseTime);
PAUSETYPE_NONE <- 0 /// 일시정지 안함
PAUSETYPE_OBJECT <- 1 /// 只有对象是暂时中止(Appendage,状态变化,效果是继续旋转,重力未应用)
PAUSETYPE_WORLD <- 2 /// 全世界都暂停了。
local currentAni = obj.getCurrentAnimation();//当前ani
currentAni.SetPause(true);//true暂停播放 false正常播放
//特效设置最大攻击上限 #攻击一定命中一定不会再攻击
obj.sq_SetMaxHitCounterPerObject(maxHit);//设置最大攻击次数
//提供物品ID 检查该物品是否是恢复类道具
local isRecover = sq_IsItemRecover(itemIndex);
//得到buff图标数量
sq_getMyBuffInfoCount();
//得到Throw属性 设置Throw属性 #没测试
//得到元素类型
local type = parentObj.getThrowElement();
obj.setThrowElement(element);
ENUM_ELEMENT_FIRE <- 0 /// 火属性
ENUM_ELEMENT_WATER <- 1 /// 冰属性
ENUM_ELEMENT_DARK <- 2 /// 暗属性
ENUM_ELEMENT_LIGHT <- 3 /// 光属性
ENUM_ELEMENT_NONE <- 4 /// 无属性
ENUM_ELEMENT_MAX <- 4 /// == ENUM_ELEMENT_NONE
//是否处于战场
//得到父对象
local parentObject = appendage.getParent();
//得到角色对象
local parentObj = sq_ObjectToSQRCharacter(parentObject);
//检查是否处于战斗
parentObj.isInBattle();//角色类
sq_IsInBattle()
//判断是否处于技能不可使用的map房间中
obj.isInActiveSkillBlockedMap();//角色类
//判断是否处于暂停类型世界中
sq_IsPauseTypeWorld(obj)
//设置普攻时的移动信息
obj.setAttackXVelocity(250);
obj.setAttackXAccel(-1000);
obj.setAttackXVelocityFast(400);
obj.setAttackXAccelFast(-1000);
//得到攻击ID
local attackIndex = obj.getAttackIndex();//活动类
//杂乱
//无测试1
po特效
//得到角色
local chr = obj.getTopCharacter();
//如果角色不为null
if (chr)
{
local map = sq_GetMap(chr);//得到map
if (map)
{
map.recalcAStarAttributesByMovableObject(obj, false);?
}
}
//无测试2
//增加攻击对象,好像是设定 我攻击到它了
local damager = sq_GetObject(parentObj, group, id);
local colObj = sq_GetCNRDObjectToCollisionObject(damager);
if(colObj && parentObj)
sq_AddHitObject(obj, colObj);
local flashScreenObj = sq_var.getObject(POD_VAR_FLASHSCREEN);
if(flashScreenObj) { // 플래쉬 스크린 작동중이면 끔
local pflashScreen = sq_GetCNRDObjectToFlashScreen(flashScreenObj);
if(pflashScreen)
pflashScreen.fadeOut();
}
local grabChr = sq_GetCNRDObjectToSQRCharacter(vObj);
if(grabChr)
{
local cmdChecker = grabChr.getCommandChecker();
grabChr.initCommandChecker(cmdChecker, true); // 자신이 콘트롤하기 위해 커맨드체커 ai플래그 부분을 true로 바꿉니다.
grabChr.setCommandChecker(cmdChecker);
// 커맨트 체크에서 ai모드가 on인지 off인지 체크하는 플래그를 세팅하는 함수 입니다.
cmdChecker.setAIMode(true);
// 다음방으로 이용하기 위해 쓰인 플래그 입니다. 내가 ai가 콘트롤하는 오브젝트인지 체크하는 플래그 입니다 (irdsqrcharacter)
grabChr.setAIModeByControlObject(true);
local onlyAiChr = sq_GetCNRDObjectToAICharacter(grabChr);
sq_SetTargetObjectAICharacter(onlyAiChr, null, false);
local skillMgr = grabChr.getSkillManager();
if(skillMgr)
{
skillMgr.setParent(grabChr);
skillMgr.setCommandChecker(cmdChecker); // 스킬매니저와 커맨드체커를 연결
local skillTree = grabChr.getCurrentSkillTree();
skillMgr.addAllKeyCommand(skillTree);
grabChr.flushCommandEnable();
}
}
//被动增加伤害
sqrObj.sq_RemovePassiveSkillAttackBonusRate(SKILL_MANABURST);
sqrObj.sq_AddPassiveSkillAttackBonusRate(SKILL_MANABURST, SKL_LVL_COLUMN_IDX_1);
//技能密封
local skill = sq_GetSkill(parentChr, SKILL_TUNDRASOUL);
if(skill.isSealFunction())
//开关 在skl里面写个这个就行了
[seal enable]
1
© 版权声明
THE END
暂无评论内容