找回密码
 点一下
查看: 2591|回复: 18

应某人的创意做的一个技能【风行步】【2-13更新】

  [复制链接]
发表于 2008-2-12 22:40:26 | 显示全部楼层 |阅读模式
RT,基本做到了某某的要求,不过有一点,至少凭个人能力还做不到。
就是,不能让技能的CD从移动开始,只能从打开技能开始算CD,
至于附加伤害,加速等都算完美吧

2-13更新
修正了技能得一个BUG,当单位存在其他加速技能时,单位得加速度会变得不正确。
在造成额外伤害时会显示数值。

2-13更新2
修改了特效


补充截图
额外伤害.jpg
加速中.jpg
隐身效果.jpg

windstep.w3x

25 KB, 下载次数: 50

评分

参与人数 1威望 +5 收起 理由
sxlrose + 5 感谢上传

查看全部评分

 楼主| 发表于 2008-2-12 23:07:50 | 显示全部楼层
原贴在此http://www.islga.org/bbs/read.php?tid=10391
技能:风行者
效果:开启之后在移动的同时移动速度不断加快并消耗魔法值(速度越快消耗越大,加速时魔法耗尽或暂停移动将恢复初始移动速度),在速度增加到极限(522)时转化为隐形状态并持续消耗魔法值(魔法耗尽将自动解除隐形状态但暂停移动不会解除隐形状态),隐形状态下攻击将获得2*主属性点的额外伤害加成并解除隐形状态,该技能每10秒内最多加速一次。
回复

使用道具 举报

发表于 2008-2-12 23:09:48 | 显示全部楼层
``嗯`!闪灵``我要了``
回复

使用道具 举报

发表于 2008-2-12 23:16:37 | 显示全部楼层
呃~LZ也做了一个出来~



下次希望最好能在原贴回贴补充演示~方便合并~

PS:LS头像很暴力
回复

使用道具 举报

 楼主| 发表于 2008-2-12 23:25:59 | 显示全部楼层
这个技能就值5分,50分都不止..........
无T.....60分,有J........5分....................
郁闷...........不过我随便多少分都可以啦,反正都不够买个投影  
回复

使用道具 举报

发表于 2008-2-12 23:29:41 | 显示全部楼层
恐怖事件。。。我的机器。。。再一次。。。
不过值得欣慰的是总算看到一些了
但是更加恐怖。。。
12121.PNG
回复

使用道具 举报

 楼主| 发表于 2008-2-12 23:35:39 | 显示全部楼层
那个不是我的,我的单位移动速度是用J做到的
我的文件名是windstep.w3x
回复

使用道具 举报

发表于 2008-2-12 23:39:10 | 显示全部楼层
纯J。。。我不用研究了。。。不过还是鼓励一下。
掌声~啪啪啪————!啪啪
回复

使用道具 举报

 楼主| 发表于 2008-2-12 23:40:31 | 显示全部楼层
也不是啦,我写了很多注释,你完全可以修改得。仅仅是修改几个技能ID和参数。
回复

使用道具 举报

发表于 2008-2-12 23:43:13 | 显示全部楼层
无T的那个贴 里是6个原创类技能 所以就60分了~

LZ这类属互助贴~~本该与原求助贴合并的~所以就按回复贴的5分加了~请谅解

希望LZ多发原创技能~小弟绝对不吝啬手中这些积分~~
回复

使用道具 举报

 楼主| 发表于 2008-2-12 23:46:14 | 显示全部楼层
代码我贴出来吧
[jass]
//需要在WE中创建缓存 GameCache 以及一个触发器 Wind Step (注意中间空格)
function H2I takes handle h returns integer
    return h
    return 0
endfunction

function H2S takes handle h returns string
    return I2S(H2I(h))
endfunction


function I2TG takes integer i returns trigger
    return i
    return null
endfunction

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

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

function I2TA takes integer i returns triggeraction
    return i
    return null
endfunction

function I2TT takes integer i returns texttag
    return i
    return null
endfunction

function InitCache takes nothing returns nothing
    if udg_GameCache == null then
        set udg_GameCache = InitGameCache("windstep.w3v")
    endif
endfunction

function TagOnUnitDestroy takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local texttag ttg = I2TT(GetStoredInteger(udg_GameCache,H2S(t),"ttg"))
    local integer i = GetStoredInteger(udg_GameCache,H2S(t),"times")
    if i<8 then
        call SetTextTagColor(ttg,192,0,0,32*(i+1))
        call StoreInteger(udg_GameCache,H2S(t),"times",i+1)
    else
        call PauseTimer(t)
        call DestroyTimer(t)
        call DestroyTextTag(ttg)
        call FlushStoredMission(udg_GameCache,H2S(t))
    endif
    set t = null
    set ttg = null
endfunction

function TagOnUnit takes string s,unit u returns nothing
    local texttag ttg= CreateTextTag()
    local timer t = CreateTimer()
    call SetTextTagText(ttg,s,0.024)
    call SetTextTagColor(ttg,128,0,0,0)
    call SetTextTagPos(ttg,GetUnitX(u),GetUnitY(u),128)
    call SetTextTagVelocity( ttg, 0.00, 0.15 )
    call StoreInteger(udg_GameCache,H2S(t),"ttg",H2I(ttg))
    call StoreInteger(udg_GameCache,H2S(t),"times",0)
    call TimerStart(t,0.1,true,function TagOnUnitDestroy)
endfunction

//-----------------------------以上是自定义脚本-------------------------------
//*移植的时候请创建一个  Wind Step  得触发器(注意中间的空格)
//*将这部分代码粘贴到自定义文本框中

function WindStepFirstHitCond takes nothing returns boolean
    return GetUnitAbilityLevel(GetAttacker(),'A001')>0//移植技能的时候请修改此处的ID
endfunction

function WindStepFirstHitDmg takes nothing returns nothing
    local trigger t = GetTriggeringTrigger()
    local unit target = GetTriggerUnit()
    local unit u = GetEventDamageSource()
    local real dmg = GetEventDamage()
    if dmg>0 and H2I(u)==GetStoredInteger(udg_GameCache,H2S(t),"u") then
        call TriggerRemoveAction(t,I2TA(GetStoredInteger(udg_GameCache,H2S(t),"ta")))
        call DestroyTrigger(t)
        set dmg = I2R( IMaxBJ(IMaxBJ(GetHeroInt(u,true),GetHeroStr(u,true)),GetHeroAgi(u,true)))*3
        call UnitDamageTarget(u,target,dmg,true,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_DEFENSIVE,WEAPON_TYPE_WHOKNOWS)
        call TagOnUnit(I2S(R2I(dmg))+"!",target)//显示数值
        call UnitRemoveAbility(u,'A001')//移植技能的时候请修改此处的ID
        call DestroyEffect(AddSpecialEffectTarget("Abilities\\\\Spells\\\\Orc\\\\FeralSpirit\\\\feralspiritdone.mdl",target,"origin"))
    endif
    set t=null
    set target = null
    set u=null
endfunction

function WindStepFirstHit takes nothing returns nothing
    local unit u = GetAttacker()
    local unit target = GetTriggerUnit()
    local trigger t = CreateTrigger()
    local triggeraction ta = TriggerAddAction(t,function WindStepFirstHitDmg )
    call TriggerRegisterUnitEvent(t,target,EVENT_UNIT_DAMAGED)
    call StoreInteger(udg_GameCache,H2S(t),"u",H2I(u))
    call StoreInteger(udg_GameCache,H2S(t),"ta",H2I(ta))
    set u = null
    set target = null
    set t = null
    set ta = null
endfunction

function WindStepResetReaccable takes nothing returns nothing
    local timer tm2 = GetExpiredTimer()
    local timer tm = I2TM(GetStoredInteger(udg_GameCache,H2S(tm2),"timer"))
    call StoreBoolean(udg_GameCache,H2S(tm),"reaccable",true)
    call BJDebugMsg("can reaccable")
endfunction

function WindStepLoop takes nothing returns nothing
    local timer tm = GetExpiredTimer()
    local string tkey = H2S(tm)
    local unit u = I2U(GetStoredInteger(udg_GameCache,tkey,"unit"))
    local real x = GetUnitX(u)
    local real y = GetUnitY(u)
    local real oldx=GetStoredReal(udg_GameCache,tkey,"oldx")
    local real oldy=GetStoredReal(udg_GameCache,tkey,"oldy")
    local real olderx = GetStoredReal(udg_GameCache,tkey,"olderx")
    local real oldery = GetStoredReal(udg_GameCache,tkey,"oldery")
    local real acc = GetStoredReal(udg_GameCache,tkey,"acc")
    local real m = GetStoredReal(udg_GameCache,tkey,"m")
    local real times = GetStoredReal(udg_GameCache,tkey,"times")
    local real speed = GetStoredReal(udg_GameCache,tkey,"speed")
    local real mana = GetUnitState(u,UNIT_STATE_MANA)
    local integer buffid = GetStoredInteger(udg_GameCache,tkey,"buffid")
   
//下面的变量用以完成加速的间隔,当开始加速后,accing设为true accable设为false ,10秒后变为true   
    local boolean accing = GetStoredBoolean(udg_GameCache,tkey,"accing")
    local boolean reaccable= GetStoredBoolean(udg_GameCache,tkey,"reaccable")//是否可以重新加速   
    local timer tm2=I2TM(GetStoredInteger(udg_GameCache,H2S(u),"tm2"))//用来在10秒后改变accble的计时器
   
    //call BJDebugMsg(R2S(speed))
    if GetUnitAbilityLevel(u,buffid)>0 then//判断是否有buff
        if x!=oldx or x!=olderx or y!=oldy or y!=oldery then      //判断单位是否移动  
            if mana>=m*speed then       //是否有足够的魔法值
                if speed +times*acc>= 522 then //是否达到速度极限
                    call UnitAddAbility(u,'A001')//增加隐身效果  移植技能的时候请修改此处的ID
                endif
            
                if accing or reaccable then //如果正在加速,或者允许加速
                    if times*acc+speed<522 then
                        call StoreReal(udg_GameCache,tkey,"times",times+1)
                    endif                       
                    call SetUnitMoveSpeed(u,RMinBJ(speed+acc*times,522))//加速
                endif
               
                call SetUnitState(u,UNIT_STATE_MANA,mana - m * speed )//消耗魔法
               
                if accing==false then //若此次为满足条件,则说明单位刚刚加速
                    call StoreBoolean(udg_GameCache,tkey,"accing",true)//保存处于加速的状态
                    call StoreBoolean(udg_GameCache,tkey,"reaccable",false)
                    call TimerStart(tm2,10,false,function WindStepResetReaccable)//10秒后才允许再次加速
                endif
            else
                call SetUnitMoveSpeed(u,GetUnitDefaultMoveSpeed(u))//取消减速效果
                call UnitRemoveAbility(u,'A001')//取消隐身效果
                call StoreBoolean(udg_GameCache,tkey,"accing",false)//不处于加速状态
                call IssueImmediateOrder(u,"manashieldoff")//强制关闭魔法
                call StoreReal(udg_GameCache,tkey,"times",0)
                call PauseTimer(tm)//停止计时
            endif
            call StoreReal(udg_GameCache,tkey,"oldx",x)
            call StoreReal(udg_GameCache,tkey,"oldy",y)
            call StoreReal(udg_GameCache,tkey,"olderx",oldx)
            call StoreReal(udg_GameCache,tkey,"oldery",oldy)
        else
            call SetUnitMoveSpeed(u,GetUnitDefaultMoveSpeed(u))//取消加速效果
            call StoreBoolean(udg_GameCache,tkey,"accing",false)//更新状态
            call StoreReal(udg_GameCache,tkey,"times",0)  
        endif
    else
        call SetUnitMoveSpeed(u,GetUnitDefaultMoveSpeed(u))//去除加速
        call UnitRemoveAbility(u,'A001')//取消隐身效果,移植技能的时候请修改此处的ID
        call StoreReal(udg_GameCache,tkey,"times",0)
        call PauseTimer(tm)
        call StoreBoolean(udg_GameCache,tkey,"accing",false)//更新状态
    endif
endfunction

function IsWindStep takes nothing returns boolean
    return GetSpellAbilityId() == 'A000' //移植技能的时候请修改此处的ID
endfunction

function StartWindStep takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local timer tm = I2TM(GetStoredInteger(udg_GameCache,H2S(u),"timer"))
    local string tkey = H2S(tm)
    local trigger firsthit = CreateTrigger()
   
    call StoreReal(udg_GameCache,tkey,"oldx",GetUnitX(u))
    call StoreReal(udg_GameCache,tkey,"oldy",GetUnitY(u))
    call StoreReal(udg_GameCache,tkey,"olderx",GetUnitX(u))
    call StoreReal(udg_GameCache,tkey,"oldery",GetUnitY(u))
    call StoreReal(udg_GameCache,tkey,"speed",GetUnitMoveSpeed(u))
    call StoreReal(udg_GameCache,tkey,"times",0)
   
    call TimerStart(tm,0.05,true,function WindStepLoop)
endfunction

function RegisterWindStepEffect takes unit u returns nothing
//注册风行步效果
//一个单位只需要注册一次,多次也不会有事
//注册后,当单位使用风行步技能时,触发效果
    local trigger tg
    local trigger firsthit
    local timer tm
    local timer tm2
    local string tkey
    local string key = H2S(u)
    //请在此修改技能参数
    local integer buffid='B000'     //魔法效果ID  移植技能的时候请修改此处的ID
    local real acc=50              //加速度 码/秒
    local real m=0.075                //魔法消耗因子,消耗平均移动速度的0.1倍
   
    call InitCache()
   
    if HaveStoredInteger(udg_GameCache,key,"trigger") then
    //已经注册过,则取得计时器句柄
        set tkey = I2S(GetStoredInteger(udg_GameCache,key,"timer"))
    else
    //未注册,创建实例
        set tg = CreateTrigger()
        set firsthit=CreateTrigger()
        set tm = CreateTimer()
        set tm2 = CreateTimer()
        set tkey = H2S(tm)
        call TriggerRegisterUnitEvent(tg,u,EVENT_UNIT_SPELL_EFFECT)
        call TriggerAddAction(tg,function StartWindStep)
        call TriggerAddCondition(tg,Condition(function IsWindStep))
        call TriggerRegisterAnyUnitEventBJ(firsthit,EVENT_PLAYER_UNIT_ATTACKED)
        call TriggerAddCondition(firsthit,Condition(function WindStepFirstHitCond))
        call TriggerAddAction(firsthit,function WindStepFirstHit)
        call StoreInteger(udg_GameCache,tkey,"unit",H2I(u))
        call StoreInteger(udg_GameCache,key,"trigger",H2I(tg))
        call StoreInteger(udg_GameCache,key,"firsthit",H2I(tg))
        call StoreInteger(udg_GameCache,key,"timer",H2I(tm))
        call StoreInteger(udg_GameCache,key,"timer2",H2I(tm2))
        call StoreInteger(udg_GameCache,H2S(tm2),"timer",H2I(tm))
    endif
   
    //初始化数据
    call StoreInteger(udg_GameCache,tkey,"buffid",buffid)
    call StoreReal(udg_GameCache,tkey,"acc",acc/20)
    call StoreReal(udg_GameCache,tkey,"m",m/200)
   
    call StoreBoolean(udg_GameCache,key,"accing",false)
    call StoreBoolean(udg_GameCache,key,"reaccable",true)
        
endfunction

function Trig_Wind_Step_Actions takes nothing returns nothing
    call RegisterWindStepEffect(GetTriggerUnit())
endfunction

function Trig_Wind_Step_Conditions takes nothing returns boolean
    return GetLearnedSkill() == 'A000'  //移植技能的时候请修改此处的ID
endfunction

//===========================================================================
function InitTrig_Wind_Step takes nothing returns nothing
    set gg_trg_Wind_Step = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Wind_Step, EVENT_PLAYER_HERO_SKILL )
    call TriggerAddCondition( gg_trg_Wind_Step, Condition( function Trig_Wind_Step_Conditions ) )
    call TriggerAddAction( gg_trg_Wind_Step, function Trig_Wind_Step_Actions )
endfunction


[/jass]
回复

使用道具 举报

发表于 2008-2-12 23:47:40 | 显示全部楼层
哎,说了半天,像我们这些原创意知识份子什么都米有,我抗议,强烈要求精华创意加分!
           
回复

使用道具 举报

 楼主| 发表于 2008-2-12 23:48:06 | 显示全部楼层
引用第9楼sxlrose于2008-02-12 23:43发表的  :
无T的那个贴 里是6个原创类技能 所以就60分了~

LZ这类属互助贴~~本该与原求助贴合并的~所以就按回复贴的5分加了~请谅解

希望LZ多发原创技能~小弟绝对不吝啬手中这些积分~~
原来如此,只是说笑而已,每当真的。
回复

使用道具 举报

发表于 2008-2-13 13:57:04 | 显示全部楼层
我发现LZ做的容易移植。。。
回复

使用道具 举报

 楼主| 发表于 2008-2-13 18:17:52 | 显示全部楼层
恩,修正版已经出来了,先前有个问题是当单位获得额外的加速技能后,单位的加速度将会出错,其实光玩游戏也很难看出这个BUG来呢。附件还是放一楼。
回复

使用道具 举报

发表于 2008-2-13 18:29:47 | 显示全部楼层
你学我
回复

使用道具 举报

 楼主| 发表于 2008-2-13 19:38:02 | 显示全部楼层
不是学你,只不过我得比你后发一个小时而已,而且我和你技能的实现方式是不一样的
~恩恩~,本人更倾向于用纯J来写技能。
回复

使用道具 举报

 楼主| 发表于 2008-2-13 19:45:33 | 显示全部楼层
貌似还有另一个版本的风行步呢
回复

使用道具 举报

发表于 2008-2-13 21:14:51 | 显示全部楼层
大家的想象无限大. 偶尔有撞车的时候.
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-9-27 11:07 , Processed in 0.115529 second(s), 23 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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