魔兽地图编辑器JASS代码运行错误
今天刚学JASS,这是处女作,,运行后发动技能,创建出了一个单位,然后游戏就自动关闭了,,,不明原因,求高人指点!~~globalshashtableCF_hash=In...
今天刚学JASS, 这是处女作,, 运行后发动技能,创建出了一个单位,然后游戏就自动关闭了,,,不明原因, 求高人指点!~~
globals
hashtable CF_hash = InitHashtable()
endglobals
function daodan_move takes nothing returns nothing
local integer pk = 1
local unit triggerunit = LoadUnitHandle(CF_hash, pk, 1)
if ((IsUnitAliveBJ(triggerunit) == true)) then //如果触发单位存活
call ForGroupBJ( GetUnitsInRangeOfLocAll(30.00, GetUnitLoc(triggerunit)), function daodan_move)//选取单位
if ((IsUnitEnemy(GetEnumUnit(), GetOwningPlayer(triggerunit)) == true)) then//如果选取单位是敌对的
call SetUnitPositionLoc( triggerunit, GetUnitLoc(GetEnumUnit()) )//移动触发单位
call UnitDamageTargetBJ( triggerunit, GetEnumUnit(), 200.00, ATTACK_TYPE_MELEE, DAMAGE_TYPE_NORMAL )//命令伤害
call KillUnit(triggerunit)//杀死触发单位
else
call SetUnitPositionLoc( triggerunit, PolarProjectionBJ(GetUnitLoc(triggerunit), 10.00, GetUnitFacing(triggerunit)) )
endif
else
endif
endfunction
function Trig____________________001_______uConditions takes nothing returns boolean
return ((GetSpellAbilityId() == 'A000'))
endfunction
function Trig____________________001_______uActions takes nothing returns nothing
local unit lastunit = null
local timer time = CreateTimer()
local integer pk = 1
call CreateNUnitsAtLocFacingLocBJ( 1, 'e000', GetOwningPlayer(GetTriggerUnit()), GetUnitLoc(GetTriggerUnit()), GetSpellTargetLoc() )
set lastunit = GetLastCreatedUnit()
call UnitApplyTimedLifeBJ( 10.00, 'BTLF', lastunit )
call SaveUnitHandle(CF_hash,pk,1,lastunit)
call TimerStart(time,1, true, function daodan_move)
endfunction
//===========================================================================
function InitTrig____________________001_______u takes nothing returns nothing
set gg_trg____________________001_______u = CreateTrigger()
#ifdef DEBUG
call YDWESaveTriggerName(gg_trg____________________001_______u, "未命名触发器 001 复制")
#endif
call TriggerRegisterAnyUnitEventBJ( gg_trg____________________001_______u, EVENT_PLAYER_UNIT_SPELL_FINISH )
call TriggerAddCondition(gg_trg____________________001_______u, Condition(function Trig____________________001_______uConditions))
call TriggerAddAction(gg_trg____________________001_______u, function Trig____________________001_______uActions)
endfunction 展开
globals
hashtable CF_hash = InitHashtable()
endglobals
function daodan_move takes nothing returns nothing
local integer pk = 1
local unit triggerunit = LoadUnitHandle(CF_hash, pk, 1)
if ((IsUnitAliveBJ(triggerunit) == true)) then //如果触发单位存活
call ForGroupBJ( GetUnitsInRangeOfLocAll(30.00, GetUnitLoc(triggerunit)), function daodan_move)//选取单位
if ((IsUnitEnemy(GetEnumUnit(), GetOwningPlayer(triggerunit)) == true)) then//如果选取单位是敌对的
call SetUnitPositionLoc( triggerunit, GetUnitLoc(GetEnumUnit()) )//移动触发单位
call UnitDamageTargetBJ( triggerunit, GetEnumUnit(), 200.00, ATTACK_TYPE_MELEE, DAMAGE_TYPE_NORMAL )//命令伤害
call KillUnit(triggerunit)//杀死触发单位
else
call SetUnitPositionLoc( triggerunit, PolarProjectionBJ(GetUnitLoc(triggerunit), 10.00, GetUnitFacing(triggerunit)) )
endif
else
endif
endfunction
function Trig____________________001_______uConditions takes nothing returns boolean
return ((GetSpellAbilityId() == 'A000'))
endfunction
function Trig____________________001_______uActions takes nothing returns nothing
local unit lastunit = null
local timer time = CreateTimer()
local integer pk = 1
call CreateNUnitsAtLocFacingLocBJ( 1, 'e000', GetOwningPlayer(GetTriggerUnit()), GetUnitLoc(GetTriggerUnit()), GetSpellTargetLoc() )
set lastunit = GetLastCreatedUnit()
call UnitApplyTimedLifeBJ( 10.00, 'BTLF', lastunit )
call SaveUnitHandle(CF_hash,pk,1,lastunit)
call TimerStart(time,1, true, function daodan_move)
endfunction
//===========================================================================
function InitTrig____________________001_______u takes nothing returns nothing
set gg_trg____________________001_______u = CreateTrigger()
#ifdef DEBUG
call YDWESaveTriggerName(gg_trg____________________001_______u, "未命名触发器 001 复制")
#endif
call TriggerRegisterAnyUnitEventBJ( gg_trg____________________001_______u, EVENT_PLAYER_UNIT_SPELL_FINISH )
call TriggerAddCondition(gg_trg____________________001_______u, Condition(function Trig____________________001_______uConditions))
call TriggerAddAction(gg_trg____________________001_______u, function Trig____________________001_______uActions)
endfunction 展开
2个回答
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询