找回密码
 点一下
查看: 3967|回复: 14

仅仅是一个吸兵技能模板

[复制链接]
发表于 2008-9-6 01:13:36 | 显示全部楼层 |阅读模式
好久没发技能了,今天就 发一个。。。

如果要移植,就先复制aa3那个 T ,再复制aa4那个 T 。记住把自定义脚本里的东西复制过去。

就 是一个往中间吸兵的技能(尸体也吸,支持多人使用),使用后你会看到步兵努力的往你面前跑,却跑不过来。很有虐的味道。

在本图里对着边缘放技能会使单位不往中间移动,这不是BUG,是和我设置的地图边缘的坐标(就是最大X,Y坐标,最小X,Y坐标)有关系,这4个值是在 T  里面改的,会  T  的都会、、、、、

如果直接使用下面的代码,那么就把下面的代码复制到自定义脚本里,使用时就直接call Xi(触发单位,释放技能点),这个可以在T里进行的。。。


记住回帖呀!!


截图:
截图.jpg

以下是代码(那个格式忘了):

[jass]function H2I takes handle h returns integer
    return h
    return 0
endfunction

function I2U takes integer i returns unit
    return i
    return null
endfunction

function I2Tm takes integer i returns timer
    return i
    return null
endfunction

function I2E takes integer e returns effect
    return e
    return null
endfunction  

function Xi_Loop2 takes nothing returns nothing
    local timer t=GetExpiredTimer()
    local unit OrderUnit=I2U(GetStoredInteger(udg_GC,I2S(H2I(t)),"OrderUnit"))
    local location loc=GetUnitLoc(GetEnumUnit())
    local real X=GetStoredReal(udg_GC,I2S(H2I(t)),"X")
    local real Y=GetStoredReal(udg_GC,I2S(H2I(t)),"Y")
    local real X_1=GetLocationX(loc)
    local real Y_1=GetLocationY(loc)
    local location loc2=Location(X,Y)
    local real X_2=X_1 + 5*Cos(AngleBetweenPoints(loc, loc2))
    local real Y_2=Y_1 + 5*Sin(AngleBetweenPoints(loc, loc2))
    if IsUnitEnemy(GetEnumUnit(), GetOwningPlayer(OrderUnit)) == true then   
    if IsUnitType(GetEnumUnit(), UNIT_TYPE_STRUCTURE) == false then   
    if GetUnitAbilityLevelSwapped('Aloc', GetEnumUnit()) == 0 then
//
//
//
//---------------------修改下面这一行代码中的数字"1"来改变伤害数值.(每0.02秒的伤害)------------------------------------------
//
        call UnitDamageTarget( OrderUnit, GetEnumUnit(), 1, true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS )
//        
//-----------------------------------------------------------------------------------------------------------------------------------        
        if  X_2 > udg_X_max then
           set X_2 = udg_X_max
        endif
        if  X_2 < udg_X_min then
           set X_2 = udg_X_min
        endif
        if  Y_2 > udg_Y_max then
           set Y_2 = udg_Y_max
        endif
        if  Y_2 < udg_Y_min then
           set Y_2 = udg_Y_min
        endif               
        call SetUnitX(GetEnumUnit(),X_2)
        call SetUnitY(GetEnumUnit(),Y_2)     
    else
        call SetUnitX(GetEnumUnit(),X)
        call SetUnitY(GetEnumUnit(),Y)
    endif
    endif
    endif
    call RemoveLocation(loc)
    call RemoveLocation(loc2)
    set loc=null
    set loc2=null
    set OrderUnit=null
    set t=null      
endfunction

function Xi_Loop1 takes nothing returns nothing
    local timer t=GetExpiredTimer()
    local real X=GetStoredReal(udg_GC,I2S(H2I(t)),"X")
    local real Y=GetStoredReal(udg_GC,I2S(H2I(t)),"Y")
    local location SpellLoc=Location(X,Y)
    local integer times=GetStoredInteger(udg_GC,I2S(H2I(t)),"times")
    local effect E=I2E(GetStoredInteger(udg_GC,I2S(H2I(t)),"E"))
    if times > 0 then
        set times=times-1
        call StoreInteger(udg_GC,I2S(H2I(t)),"times",times)
        set  bj_wantDestroyGroup = true
        call ForGroupBJ(GetUnitsInRangeOfLocAll(450, SpellLoc),function Xi_Loop2)
        call RemoveLocation(SpellLoc)
        set SpellLoc=null
    else        
        call FlushStoredMission(udg_GC,I2S(H2I(t)))
        call PauseTimerBJ( true, t )
        call DestroyTimer(t)
        call DestroyEffect(E)
        call TerrainDeformationCraterBJ( 1, true, SpellLoc, 450, -150 )
    endif
    set E=null
    set t=null   
endfunction

function Xi takes unit Orderunit , location SpellLoc returns nothing
    local timer t=CreateTimer()
    local real X=GetLocationX(SpellLoc)
    local real Y=GetLocationY(SpellLoc)              
    local integer times=1000
    local effect E=AddSpecialEffectLoc("Abilities\\Spells\\Human\\FlameStrike\\FlameStrikeTarget.mdl",SpellLoc)
    call TerrainDeformationCraterBJ( 1, true, SpellLoc, 450, 150 )
    call StoreReal(udg_GC,I2S(H2I(t)),"X",X)
    call StoreReal(udg_GC,I2S(H2I(t)),"Y",Y)
    call StoreInteger(udg_GC,I2S(H2I(t)),"E",H2I(E))
    call StoreInteger(udg_GC,I2S(H2I(t)),"Orderunit",H2I(Orderunit))
    call StoreInteger(udg_GC,I2S(H2I(t)),"times",times)
    call TimerStart(t,0.02,true,function Xi_Loop1)
    set t=null                     
endfunction[/jass]

吸兵.w3x

23 KB, 下载次数: 124

评分

参与人数 1威望 +11 收起 理由
Сynthia + 11 虽然见过类似……

查看全部评分

发表于 2008-9-6 08:31:30 | 显示全部楼层
的确是好模板 没发现泄露

既然是jass编写的  ,很少看到有人用set  bj_wantDestroyGroup = true 的
直接用DestroyGroup吧
回复

使用道具 举报

 楼主| 发表于 2008-9-6 14:28:46 | 显示全部楼层
不可能吧?居然 有类似的,,,算偶抄袭。。


偶下次就做个没有类似的来。,。,。,。
回复

使用道具 举报

发表于 2008-9-7 10:57:27 | 显示全部楼层
这个jass很强大
回复

使用道具 举报

恶声恶气 该用户已被删除
发表于 2008-9-12 16:19:40 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

恶声恶气 该用户已被删除
发表于 2008-9-12 16:23:15 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

发表于 2008-9-15 20:45:20 | 显示全部楼层
又玩J文啊,神啊   [s:202]
回复

使用道具 举报

发表于 2008-9-19 23:27:13 | 显示全部楼层
- -,!麻烦LZ给翻译成中文的好吗,!!!
回复

使用道具 举报

发表于 2008-9-19 23:29:56 | 显示全部楼层
jass代码怎么翻译成中文,真是的………………
回复

使用道具 举报

 楼主| 发表于 2008-9-30 21:27:01 | 显示全部楼层
现在没多少时间了,可能不能经常做模板了,请见谅!!
[s:186]
回复

使用道具 举报

恶声恶气 该用户已被删除
发表于 2008-10-1 16:32:23 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

发表于 2008-10-1 17:27:56 | 显示全部楼层
很久没弄过J了
都要忘记了。。。

不过。。。

[jass]
local real X=GetLocationX(SpellLoc)
local real Y=GetLocationY(SpellLoc)
[/jass]     
这里应该少了2个括号
回复

使用道具 举报

发表于 2008-10-1 19:08:43 | 显示全部楼层
没少哦。。 SpellLoc是变量啊,不用括号吧。
回复

使用道具 举报

恶声恶气 该用户已被删除
发表于 2008-10-1 21:48:42 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

发表于 2008-10-2 15:53:35 | 显示全部楼层
那个~~~~~~~~~~
好像我做的龙卷风~~~~~~
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-10-4 08:35 , Processed in 0.047973 second(s), 26 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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