找回密码
 点一下
查看: 771|回复: 3

请问跳起,和下坠动作以及计算蓄力时间怎么做

[复制链接]
发表于 2021-5-14 16:16:04 | 显示全部楼层 |阅读模式
技能:山丘之王蓄力3/6/9/12秒后跳向空中 ,3-7秒后砸向目标区域[距离越远时间越长],砸向地面后击飞周围250码内的所有敌军单位,并造成自身当前生命值10%的神圣伤害,被击飞单位落地后被击晕3秒[同时每蓄力1秒提升1%的神圣伤害 最多可提升2%/5%/8%/11%的神圣伤害] A杖效果 蓄力时可点击周围友军单位,带着这些单位一起跳,每增加一个携带单位提高1%的神圣伤害
想法 :蓄力技能感觉可以用 马甲技能等级来算 ,添加攻击之爪技能 每1秒提升1级
问题 :感觉用技能会出现很多BUG ,比如单位死亡技能未消失之类
问题2:如何做跳起 和下坠动作
问题3:如何提升伤害
问题4:如何实现带人效果
发表于 2021-6-13 14:23:06 | 显示全部楼层
冲锋绑定 计时器运行时间,飞行高度 运行一半 再降低.. 算了 刚好做了个天马彗星拳的 你移植好点

回复

使用道具 举报

发表于 2021-6-13 14:25:13 | 显示全部楼层
globals
constant hashtable hc=InitHashtable() //嘻哈表用于储存
endglobals

function GetRectQY takes real x, real y,real width,real height returns rect //以指定坐标返回矩形区域
return Rect( x - width*0.5, y - height*0.5, x + width*0.5, y + height*0.5 )
endfunction


//-------------------------两个坐标间的方向-----------------------------
function ZuoBiaoFangX takes real x1,real y1, real x,real y returns real
return Atan2(y1 - y, x1 - x)
endfunction



function IsChPd takes unit u returns boolean//用于判断单位是否存活
return(GetWidgetLife(u)>.405)
endfunction

function IsChKphPd takes destructable u returns boolean//用于判断可破坏物是否存活
return(GetWidgetLife(u)>.405)
endfunction

function BUFFbe takes unit u,integer bf returns boolean //用于判断单位是否拥有BFF
if GetUnitAbilityLevel(u,bf)>0 then
return true
endif
return false
endfunction

function IsChWd takes unit u returns boolean//用于判断单位是否无敌
if GetUnitAbilityLevel(u, 'A005') <= 0 and GetUnitAbilityLevel(u, 'A007') <= 0 and GetUnitAbilityLevel(u, 'Avul') <= 0 and GetUnitAbilityLevel(u, 'B010') <= 0 and GetUnitAbilityLevel(u, 'BHds') <= 0 then
return true
endif
return false
endfunction


function XsTianMaHuiXingQuanCs takes nothing returns boolean
return ((GetSpellAbilityId() == 'A05U'))
endfunction


function XsTianMaHuiXingQuanAsDYTimerJX takes nothing returns nothing //树木
if GetDestructableTypeId(GetEnumDestructable()) == 'ZTtc' then
call KillDestructable(GetEnumDestructable())
endif
endfunction


function XsTianMaHuiXingQuanAsDYTimer takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer id=GetHandleId(t)
local unit u0=LoadUnitHandle(hc,id,0)
local unit u1=LoadUnitHandle(hc,id,1)
local real ang=LoadReal(hc,id,2) //方向
local real Wam=LoadReal(hc,id,3)  //速率
local real com=LoadReal(hc,id,4)-1 //终结点
local real SL=LoadReal(hc,id,5)
local real x=GetUnitX(u1)+Wam*Cos(ang)
local real y=GetUnitY(u1)+Wam*Sin(ang)
local rect ct
call SaveReal(hc,id,4,com)
//---击退距离--
if(IsTerrainPathable(x, y,PATHING_TYPE_WALKABILITY) != true)then
call SetUnitPosition(u1, x, y)
//----选取树木--
set ct=GetRectQY(x, y,150.00, 150.00)
call EnumDestructablesInRect(ct,null,function XsTianMaHuiXingQuanAsDYTimerJX)
call RemoveRect(ct)
set ct=null
endif
//----击飞高度--
if com >= 17 then
set SL=SL+25
call SaveReal(hc,id,5,SL)
else
set SL=SL-25
call SaveReal(hc,id,5,SL)
endif
call SetUnitFlyHeight(u1,SL, 0)
//----终结点---
if com<=0 then
call PauseTimer(t)
call DestroyTimer(t)
call UnitDamageTarget(u0, u1, (I2R(GetHeroAgi(u0, true)) * (10.00 * I2R(GetUnitAbilityLevel(u0, 'A05U')))), true, true, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffect("conflagrateblue.mdx",GetUnitX(u1),GetUnitY(u1)))
call SetUnitFlyHeight(u1,0,0)
call FlushChildHashtable(hc,id)
endif
//----清理残留--
set t=null
set u0=null
set u1=null
endfunction

function XsTianMaHuiXingQuanAsDY takes unit u0,unit u1 returns nothing
local timer t=CreateTimer()
local integer id=GetHandleId(t)
local real x=GetUnitX(u0)
local real y=GetUnitY(u0)
local real r1=GetUnitX(u1)
local real r2=GetUnitY(u1)
local real ang=Atan2(r2 - y, r1 - x) //方向
local real Wam=100  //速率/距离
local real com=33   //最终结束点
local real SL=0//上升降落实数
local unit u2=null
if (IsUnitType(u1, UNIT_TYPE_MAGIC_IMMUNE) == true) then
call UnitDamageTarget(u0, u1, (I2R(GetHeroAgi(u0, true)) * (5.00 * I2R(GetUnitAbilityLevel(u0, 'A05U')))), true, true, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl", u1, "chest"))
call DestroyTimer(t)
else
call UnitAddAbility(u1, 'A006')
call UnitRemoveAbility(u1, 'A006')
set u2=CreateUnit(GetOwningPlayer(u0), 'h003',GetUnitX(u1),GetUnitY(u1), GetUnitFacing(u0))
call ShowUnit(u2, false)
call UnitAddAbility(u2, 'A00T')
call SetUnitAbilityLevel(u2, 'A00T',3)
call IssueTargetOrderById(u2, 852095, u1)
call UnitApplyTimedLife(u2, 'BHwe', 1.20)
//----保存--
call SaveUnitHandle(hc,id,0,u0)
call SaveUnitHandle(hc,id,1,u1)
call SaveReal(hc,id,2,ang)
call SaveReal(hc,id,3,Wam*0.03)
call SaveReal(hc,id,4,com)
call SaveReal(hc,id,5,SL)
//-----开启计时器----
call TimerStart(t,0.03,true,function XsTianMaHuiXingQuanAsDYTimer)
endif
set t=null
set u0=null
set u1=null
set u2=null
endfunction

//-------上列调用击飞——击退

function XsTianMaHuiXingQuanAsTimer takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer id=GetHandleId(t)
local unit u=LoadUnitHandle(hc,id,0)
local unit u1=LoadUnitHandle(hc,id,1)
local real ang=LoadReal(hc,id,2) //方向
local real Wam=LoadReal(hc,id,3)  //速率
local real com=LoadReal(hc,id,4)-1 //终结点
local real x=GetUnitX(u1)+Wam*Cos(ang)
local real y=GetUnitY(u1)+Wam*Sin(ang)
local unit u2=null
local group g=null
call SaveReal(hc,id,4,com)
call SetUnitPosition(u1, x, y)
//------------伤害-------------------
set g=CreateGroup()
call GroupEnumUnitsInRange(g,x,y,300.00,null)
call GroupRemoveUnit(g, u)
call GroupRemoveUnit(g, u1)
loop
set u2=FirstOfGroup(g)
exitwhen u2 == null
if IsChPd(u2) and  IsChWd(u2) and IsUnitEnemy(u2, GetOwningPlayer(u)) == true then
if (IsUnitType(u2, UNIT_TYPE_MAGIC_IMMUNE) == false) then
call XsTianMaHuiXingQuanAsDY(u,u2)
set com=0
call SaveReal(hc,id,4,com)
else
call XsTianMaHuiXingQuanAsDY(u,u2)
endif
endif
call GroupRemoveUnit(g, u2)
endloop
call GroupClear(g)
call DestroyGroup(g)
if com<=0 then
call PauseTimer(t)
call DestroyTimer(t)
call KillUnit(u1)
call FlushChildHashtable(hc,id)
endif
set t=null
set g=null
set u=null
set u1=null
set u2=null
endfunction

function XsTianMaHuiXingQuanAs takes unit u returns nothing
local timer t=CreateTimer()
local integer id=GetHandleId(t)
local real x=GetUnitX(u)
local real y=GetUnitY(u)
local real r1=GetSpellTargetX()
local real r2=GetSpellTargetY()
local real ang=Atan2(r2 - y, r1 - x) //方向
local real Wam=800  //速率/距离
local real com=33   //最终结束点
local unit u1=CreateUnit(GetOwningPlayer(u), 'h01U', x, y,GetUnitFacing(u))
//-----保存----
call SaveUnitHandle(hc,id,0,u)
call SaveUnitHandle(hc,id,1,u1)
call SaveReal(hc,id,2,ang)
call SaveReal(hc,id,3,Wam*0.03)
call SaveReal(hc,id,4,com)
//-----开启计时器----
call TimerStart(t,0.03,true,function XsTianMaHuiXingQuanAsTimer)
//-------清理残留----
set t=null
set u=null
set u1=null
endfunction
回复

使用道具 举报

发表于 2021-6-13 14:29:16 | 显示全部楼层
打开触发器 最顶端一般 就是 ,地图名字.W3X,这个东西里面 你没有自定脚本 就把这个全复制进去 ... 至于用法挺简单的,  自定义代码 call XsTianMaHuiXingQuanAs(这里是触发单位)  ok  主要是考虑到你 不会JASS 会的 随便都能修改出你要的东西
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-12-22 11:43 , Processed in 0.147743 second(s), 20 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表