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

仿DNF 崩山裂地斩

[复制链接]
发表于 2011-6-23 05:54:16 | 显示全部楼层 |阅读模式
WOSHIYIERS.gif

献丑一下

崩山裂地斩.w3x (25 KB, 下载次数: 111)
[jass]
scope Bsldz initializer Start

//*********************声明*********************
globals
    hashtable hx = InitHashtable()
endglobals

//******************* 配置区*********************
//! textmacro Random takes Name,Type
function $Name$ takes rect RECT returns real
    return GetRandomReal(GetRectMin$Type$(RECT), GetRectMax$Type$(RECT))
endfunction
//! endtextmacro
//! runtextmacro Random("RDX","X")
//! runtextmacro Random("RDY","Y")

function Distance takes real locAx,real locAy,real locBx,real locBy returns real
    local real x = locBx - locAx
    local real y=  locBy- locAy
    return SquareRoot(x * x + y * y)
endfunction

function Arc takes real y1,real y2,real x1,real x2 returns real
    return (bj_RADTODEG* Atan2(y1-y2,x1-x2 ))
endfunction

//! textmacro XY takes Name,Function
function $Name$ takes real xx,real xxx,real xxxx returns real
    return xx+xxx*$Function$/*cos*/(xxxx*bj_DEGTORAD)
endfunction
//! endtextmacro
//! runtextmacro XY("X","Cos")
//! runtextmacro XY("Y","Sin")


//******************* 技能执行*********************

function Spell_D takes nothing returns nothing
    local integer i  = GetHandleId(GetExpiredTimer())
    local unit Hero  = LoadUnitHandle(hx,i,1)
    local unit u
    local integer Loop = 0
    local real S = LoadReal(hx,i,2)
    local group g = CreateGroup()
    loop
        exitwhen Loop >30
        set u = CreateUnit(GetOwningPlayer(Hero),/*这里的ewsp是岩浆马甲,需要修改*/'ewsp',/*
        */X(RDX(RectFromCenterSizeBJ/*
        */(Location(GetUnitX(Hero), GetUnitY(Hero)), 400.00, 400.00)),250,S),/*
        */Y(RDY(RectFromCenterSizeBJ/*
        */(Location(GetUnitX(Hero), GetUnitY(Hero)), 400.00, 400.00)),250,S),0)
        call UnitApplyTimedLife( u, 'BHwe', 3 )
        call SetUnitTimeScale( u, 0.5)
        set Loop = Loop  + 1
    endloop
    set g = GetUnitsInRangeOfLocAll(400.00, Location(X(GetUnitX(Hero),150,S), Y(GetUnitY(Hero),150,S)))
    loop
        set u = FirstOfGroup(g)
        exitwhen u ==null
        if(IsUnitAliveBJ(u) == true and IsUnitEnemy(u, GetOwningPlayer(Hero)) == true )then
            call UnitDamageTarget( Hero, u, /*伤害数值100*/ 100.00, true, false, /*
            */ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS )
        endif
        call GroupRemoveUnit(g,u)
    endloop
    call DestroyGroup(g)
    call SetUnitTimeScale( Hero, 1 )
    call PauseUnit(Hero,false)
    call FlushChildHashtable(hx,i)
    call DestroyTimer(GetExpiredTimer())
    set g = null
    set u = null
    set Hero = null
endfunction

function Spell_C takes nothing returns nothing
    local integer i  = GetHandleId(GetExpiredTimer())
    local unit Hero  = LoadUnitHandle(hx,i,1)
    local timer t = CreateTimer()
    local integer i2 = GetHandleId(t)
    local real S = LoadReal(hx,i,2)
    call CameraClearNoiseForPlayer( GetOwningPlayer(Hero) )
    call SaveUnitHandle(hx,i2,1,Hero)
    call SaveReal(hx,i2,2,S)
    call TimerStart(t,1.5,false,function Spell_D)
    set t = null
    set Hero = null
    call FlushChildHashtable(hx,i)
    call DestroyTimer(GetExpiredTimer())
endfunction

function Spell_B takes nothing returns nothing
    local integer i = GetHandleId(GetExpiredTimer())
    local unit Hero = LoadUnitHandle(hx,i,1)
    local real SpellPoinx = LoadReal(hx,i,2)
    local real SpellPoiny = LoadReal(hx,i,3)
    local real D= LoadReal(hx,i,4)
    local real S = LoadReal(hx,i,5)
    local integer T = LoadInteger(hx,i,6)
    local real  Height = LoadReal(hx,i,7)
    local timer t = CreateTimer()
    local integer i2  = GetHandleId(t)
    local integer Loop = 0
    local unit u
    local group g = CreateGroup()
    if(T <=  35) then
        call PauseUnit(Hero,true)
        call SetUnitX(Hero,X(GetUnitX(Hero),D,S))
        call SetUnitY(Hero,Y(GetUnitY(Hero),D,S))
        set T = T + 1
        set Height = Height + 1
        call SetUnitFlyHeight( Hero, -1*Pow(Height, 2)+300, 0.00 )
        call SaveReal(hx,i,7,Height)
        call SaveInteger(hx,i,6,T)
    else
        call PauseTimer(GetExpiredTimer())
        call SetUnitPathing( Hero, true )
        call SetUnitFlyHeight( Hero, 0, 0.00 )
        call DestroyEffect( /*
        */AddSpecialEffect/*
        */("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl", /*
        */X(GetUnitX(Hero),90,S),Y(GetUnitY(Hero),150,S)) )
        call TerrainDeformationRippleBJ( 1.50, true, /*
        */Location(X(GetUnitX(Hero),90,S),Y(GetUnitY(Hero),150,S)),/*
        */128.00, 512.00, 64.00, 0.50, 256.00 )
        loop
            exitwhen Loop >= 4
            call DestroyEffect( /*
            */AddSpecialEffect/*
            */("Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl", /*
            */X(RDX(RectFromCenterSizeBJ/*
            */(Location(GetUnitX(Hero), GetUnitY(Hero)), 400.00, 400.00)),250,S),/*
            */Y(RDY(RectFromCenterSizeBJ/*
            */(Location(GetUnitX(Hero), GetUnitY(Hero)), 400.00, 400.00)),250,S)))
            set Loop = Loop + 1
        endloop
        set g = GetUnitsInRangeOfLocAll(400.00, Location(X(GetUnitX(Hero),150,S), Y(GetUnitY(Hero),150,S)))
        loop
            set u = FirstOfGroup(g)
            exitwhen u ==null
            if(IsUnitAliveBJ(u) == true and IsUnitEnemy(u, GetOwningPlayer(Hero)) == true )then
                call UnitDamageTarget( Hero, u, /*伤害数值200*/200.00, true, false, /*
                */ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS )
            endif
            call GroupRemoveUnit(g,u)
        endloop
        set u = CreateUnit(GetOwningPlayer(Hero),/*这里的e000为眩晕技能马甲*/'e000',X(GetUnitX(Hero),150,S), Y(GetUnitY(Hero),150,S),0)
        call UnitApplyTimedLife( u, 'BHwe', 3 )
        call IssueImmediateOrder( u, "stomp" )
        call CameraSetEQNoiseForPlayer( GetOwningPlayer(Hero), 100.00 )
        call SetUnitTimeScale( Hero, 0 )
        call SaveUnitHandle(hx,i2,1,Hero)
        call SaveReal(hx,i2,2,S)
        call TimerStart(t,0.5,false,function Spell_C)
        call FlushChildHashtable(hx,i)
        call DestroyTimer(GetExpiredTimer())
    endif
    call DestroyGroup(g)
    set g = null
    set Hero = null
endfunction

function Spell_A takes nothing returns nothing
    local timer t = CreateTimer()
    local integer i = GetHandleId(t)
    local unit u = GetTriggerUnit()
     local real x = GetLocationX(GetSpellTargetLoc())
    local real y = GetLocationY(GetSpellTargetLoc())
    local real D  = Distance(GetUnitX(u),GetUnitY(u),x,y)/42
    local real S = Arc(y,GetUnitY(u),x,GetUnitX(u))
    local real H = -20
    if  ( GetSpellAbilityId() == /*A001为主要技能ID*/'A001' )  then
        call SetUnitTimeScale( u, 0.67 )
        call SetUnitPathing( u, false )
        call UnitAddAbility( u, 'Amrf' )
        call UnitRemoveAbility( u, 'Amrf' )
        call FlushChildHashtable(hx,i)
        call SaveUnitHandle(hx,i,1,u)
        call SaveReal(hx,i,2,x)
        call SaveReal(hx,i,3,y)
        call SaveReal(hx,i,4,D)
        call SaveReal(hx,i,5,S)
        call SaveReal(hx,i,7,H)
        call TimerStart(t,0.02,true,function Spell_B)
    endif
    set t = null
    set u = null
endfunction

//******************* 初始化*********************
function Start takes nothing returns nothing
    local trigger T = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( T, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( T,  function Spell_A)
    set T = null
endfunction
endscope
[/jass]

评分

参与人数 1威望 +30 收起 理由
uoer + 30 很好的哦 尽管我看不见红色

查看全部评分

 楼主| 发表于 2011-6-23 05:58:22 | 显示全部楼层
  GA有jass高亮就是好啊
回复

使用道具 举报

发表于 2011-6-23 08:57:38 | 显示全部楼层
满给力的 挺像那么回事
回复

使用道具 举报

发表于 2011-6-23 13:59:53 | 显示全部楼层
   你也许要丢到Jass区?

   这个我觉得不考虑效率的话 = = T可以模拟。。
回复

使用道具 举报

发表于 2011-6-23 14:02:00 | 显示全部楼层
不用丢到Jass区,只要是与技能有关的帖子都可以发到技能区,只是会被怎么对待就不知道了,后面一句针对伸手党说的。
如果震动的效果是创建在四周而不是呈现出直线,并且使用逐个创建尸体特效的方法应该会更像一些。
回复

使用道具 举报

发表于 2011-6-23 14:02:56 | 显示全部楼层
   难道冒血是一瞬间?

  看不到红色
回复

使用道具 举报

发表于 2011-6-23 14:04:25 | 显示全部楼层
我看到了一堆红色,漠漠你的显示屏要是已经修复了的话,那你现在最好是去休息休息。
回复

使用道具 举报

发表于 2011-6-23 14:08:18 | 显示全部楼层
   休息 ? 我现在就在休息

   早上睡了 6 个小时呢。

  屏幕君说主机君不让我看红色~~·

    我没什么问题的说~~
  
     又上了两个小时的网了。
回复

使用道具 举报

发表于 2011-6-23 14:31:32 | 显示全部楼层
没事那就好,于是乎为了不会变成版聊,先这么说吧。
回复

使用道具 举报

 楼主| 发表于 2011-6-23 23:47:07 | 显示全部楼层

回 4楼(德鲁依) 的帖子

特效都是用随即创建的。
由于不熟悉随即创建在Jass中的写发所以就用了区域.

还有个很头疼的问题。
就是TimerStart内无法使用TriggerSleepAction  因为无法知道停止哪个触发。
但是又想停止一段时间。 所以只能再加TimerStrat 但是又太繁琐。 希望能找个解决办法
回复

使用道具 举报

发表于 2011-6-24 04:05:09 | 显示全部楼层
   圆形随机创建用随机数和极坐标移位就可以嘛

  比如是 设置Point 为 技能释放点 距离随机数 角度随机 0 - 360 就可以嘛
回复

使用道具 举报

 楼主| 发表于 2011-6-24 14:17:06 | 显示全部楼层

回 10楼(uoer) 的帖子

  原来移位也可以的
回复

使用道具 举报

发表于 2011-6-24 14:18:47 | 显示全部楼层
   当然~ 可以哦

   随机数 + 位移就是随机圆中点
回复

使用道具 举报

 楼主| 发表于 2011-6-24 14:23:09 | 显示全部楼层

回 12楼(uoer) 的帖子

孤陋寡闻了。
你的回复好快。
回复

使用道具 举报

发表于 2011-6-24 14:45:13 | 显示全部楼层
   怎么有问题么?
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-25 14:50 , Processed in 0.124831 second(s), 25 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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