- Joined
- Nov 3, 2006
- Messages
- 8,102
JASS:
//! externalblock extension=lua ObjectMerger $FILENAME$
//! i setobjecttype("abilities")
//! i
//! i function GetHotkey(x,y)
//! i if y==0 then
//! i if x==0 then return "Q"
//! i elseif x==1 then return "W"
//! i elseif x==2 then return "E"
//! i elseif x==3 then return "R"
//! i end
//! i elseif y==1 then
//! i if x==0 then return "A"
//! i elseif x==1 then return "S"
//! i elseif x==2 then return "D"
//! i elseif x==3 then return "F"
//! i end
//! i elseif y==2 then
//! i if x==0 then return "Z"
//! i elseif x==1 then return "X"
//! i elseif x==2 then return "C"
//! i elseif x==3 then return "V"
//! i end
//! i end
//! i end
//! i
//! i function FixValue(s)
//! i if not s == "" then
//! i tempstring = string.sub(s,1,1)
//! i if tempstring == "P" then return string.sub(s,2).."%"
//! i elseif tempstring == "S" then return string.sub(s,2).." seconds"
//! i elseif tempstring == "_" then return string.sub(s,2)
//! i else return s
//! i end
//! i else
//! i return s
//! i end
//! i end
// TALENTS
//! i talentcount = 0
//! i talentchar = "T"
//! i talentstring = "00"
//! i function CreateTalent(type, name, level, only, cost, order, x, y, icon, desc)
//! i if talentcount > 9 then
//! i talentstring = talentchar + "0"
//! i elseif talentcount > 99 then
//! i talentstring = talentchar
//! i end
//! i createobject("AAns",talentchar..talentstring..talentcount)
//! i makechange(current, "aart", "ReplaceableTextures\\CommandButtons\\BTN"..icon..".blp")
//! i makechange(current, "Ans5", order)
//! i makechange(current, "Ndt1", "0")
//! i makechange(current, "Ndt2", cost)
//! i makechange(current, "arac", "other")
//! i makechange(current, "ahky", GetHotkey(x,y))
//! i
//! i if only == 0 then
//! i makechange(current, "anam", "Talent - "..type.." - "..name.." ("..level..")")
//! i makechange(current, "atp1", "Learn |cffffcc00"..name.."|r - ".."Level "..level.." [|cffffcc00"..GetHotkey(x,y).."|r]")
//! i else
//! i makechange(current, "anam", "Talent - "..type.." - "..name)
//! i makechange(current, "atp1", "Learn |cffffcc00"..name.."|r [|cffffcc00"..GetHotkey(x,y).."|r]")
//! i end
//! i
//! i makechange(current, "aub1", desc)
//! i talentcount = talentcount + 1
//! i end
//! i
//! i function AddTalent1(type, name, cost, order, x, y, icon, desc, f1, v1, f2, v2, f3, v3, f4, v4)
//! i desc = "|cffffcc00Description|r: "..desc
//! i if not f1 == "" then desc = desc.."|n|n|cffffcc00"..f1.."|r: "..FixValue(v1) end
//! i if not f2 == "" then desc = desc.."|n|cffffcc00"..f2.."|r: "..FixValue(v2) end
//! i if not f3 == "" then desc = desc.."|n|cffffcc00"..f3.."|r: "..FixValue(v3) end
//! i if not f4 == "" then desc = desc.."|n|cffffcc00"..f4.."|r: "..FixValue(v4) end
//! i CreateTalent(type, name, 0, 1, cost, order, x, y, icon, desc)
//! i end
////////[ACTUAL SETUP]////////////////////////////////////////////
// TYPE NAME COST LVL ORDERSTRING X Y ICON DESCRIPTION Field1 VAL Field2 VAL Field3 VAL Field4 VAL
//! i AddTalent1("Combat", "Block", 1, "defend", 0,1,"Defend", "Gives a percentage of chance of blocking an attack, reducing damage by a percentage.", "Chance","P10", "Reduction","P50","", "", "", "" )
//! endexternalblock