|
[codes=jass]
function Trig_LearnSkill_Actions takes nothing returns nothing
local unit UniLearn=I2U(GetStoredInteger(udg_GC,I2S(H2I(GetTriggerPlayer())),"UniForget"))
local integer Skill=GetStoredInteger(udg_GC,I2S(H2I(UniLearn)),"SkiLearn")
local integer SkillA=GetStoredInteger(udg_GC,I2S(H2I(UniLearn)),"Skill1")
local integer SkillB=GetStoredInteger(udg_GC,I2S(H2I(UniLearn)),"Skill2")
local integer SkillC=GetStoredInteger(udg_GC,I2S(H2I(UniLearn)),"Skill3")
local integer SkillD=GetStoredInteger(udg_GC,I2S(H2I(UniLearn)),"Skill4")
if udg_ByeOrNotS[1]== GetClickedButtonBJ() then
call UnitRemoveAbility(UniLearn,SkillA)
call UnitAddAbility(UniLearn,Skill)
call StoreInteger(udg_GC,I2S(H2I(UniLearn)),"Skill1", Skill)
elseif udg_ByeOrNotS[2]== GetClickedButtonBJ() then
call UnitRemoveAbility(UniLearn,SkillB)
call UnitAddAbility(UniLearn,Skill)
call StoreInteger(udg_GC,I2S(H2I(UniLearn)),"Skill1", Skill)
elseif udg_ByeOrNotS[3]== GetClickedButtonBJ() then
call UnitRemoveAbility(UniLearn,SkillC)
call UnitAddAbility(UniLearn,Skill)
call StoreInteger(udg_GC,I2S(H2I(UniLearn)),"Skill1", Skill)
elseif udg_ByeOrNotS[4]== GetClickedButtonBJ() then
call UnitRemoveAbility(UniLearn,SkillD)
call UnitAddAbility(UniLearn,Skill)
call StoreInteger(udg_GC,I2S(H2I(UniLearn)),"Skill1", Skill)
else
endif
set UniLearn= null
endfunction[/codes]
以上函数事件是对话框udg_SkillFull被点击
udg_SkillFull是对话框变量,在之前的函数中call DialogDisplayBJ( true, udg_SkillFull, GetTriggerPlayer() ) |
|