魔兽首页最新地图防守地图对抗地图角色剧情TD塔类图标准战役ORPG地图其它地图
魔兽论坛攻略秘籍补丁工具RPG 录像制图教学制图资源魔兽战队新图试玩通魔作坊

您的位置:魔兽争霸U9网 >> 制图教学

能保留效果的双物品栏

作者:晨枫    文章来源:U9论坛    点击数:    更新时间:2006-8-30 14:52:15

对战初始化
    事件
        Map initialization
    环境
    动作
        Set NullItemId = Null
        Set ChangeBag = 切换物品栏
        Set ItemBagA = 物品栏 A
        Set ItemBagB = 物品栏 B
        Custom script:   set bj_wantDestroyGroup = true
        单位组 - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - 动作
                Set TempInt = (TempInt + 1)
                单位 - Set the custom value of (Picked unit) to TempInt
                单位 - Remove ItemBagA from (Picked unit)
                单位 - Remove ItemBagB from (Picked unit)
                单位 - Add ItemBagA to (Picked unit)
                For each (Integer A) from 1 to 6, do (Actions)
                    Loop - 动作
                        英雄 - Create Null and give it to (Picked unit)
                        Set HeroItem[((12 x TempInt) + ((Integer A) - 1))] = (Last created item)
                单位 - Add ItemBagB to (Picked unit)
ChangeBag
function Trig_ChangeBag_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == udg_ChangeBag
endfunction
function Trig_ChangeBag_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local integer data = GetUnitUserData(u)
    local integer i = 0
    loop
        exitwhen i > 5
        if UnitItemInSlot(u, i) == null then
            call UnitAddItemToSlotById( u,udg_NullItemId,i )
        endif
        set udg_HeroItem[12*data + 6+i] = UnitItemInSlot(u, i)               
        set i = i + 1
    endloop   
    call UnitRemoveAbility(u,udg_ItemBagA)
    call UnitRemoveAbility(u,udg_ItemBagB)
    call UnitAddAbility(u,udg_ItemBagA)
    set i = 0
    loop
        exitwhen i > 5
        call UnitAddItem(u,udg_HeroItem[12*data + 6+i])
        set i = i + 1
    endloop
    call UnitAddAbility(u,udg_ItemBagB)
    set i = 0
    loop
        exitwhen i > 5
        if not UnitAddItem(u,udg_HeroItem[12*data + i]) then
            call UnitAddItemToSlotById( u,udg_NullItemId,i )
        endif
        set udg_HeroItem[12*data + i] = udg_HeroItem[12*data + 6+i]
        set i = i + 1
    endloop
    set i = 0
    loop
        exitwhen i > 5
        if GetItemTypeId( UnitItemInSlot(u, i) ) == udg_NullItemId then
            call RemoveItem( UnitItemInSlot(u, i) )
        endif
        set i = i + 1
    endloop
    set u = null
endfunction
//===========================================================================
function InitTrig_ChangeBag takes nothing returns nothing
    set gg_trg_ChangeBag = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_ChangeBag, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_ChangeBag, Condition( function Trig_ChangeBag_Conditions ) )
    call TriggerAddAction( gg_trg_ChangeBag, function Trig_ChangeBag_Actions )
endfunction


附件: [[下载]能保留效果的双物品栏] 8Il1wwb3.rar (1970-1-1 08:00, 18.34 K)

责任编辑:admin
进入论坛参与针对本文章的讨论
文中部分附件请进入论坛下载
本文章地址:
  • 上一篇:【经典教程】任务的制作原理(附物品合成)
  • 下一篇:
  • 相关文章

    进入论坛参与针对本文章的讨论用户评论

    地图 攻略
    热门搜索: 仙之侠道 真三国无双 Dota Allstar

    地图专区导航

    热门地图攻略

    热门地图周排行

    最新推荐地图

    地图下载总排行

    公司简介    -    商务合作    -    加入我们    -    联系我们    -    广告服务    -    友情链接
    建议意见:玩家点击留言  商务合作:客户点击留言
    西安优久数码科技有限公司 版权所有 陕ICP证08000654号