I like the use of hashtable and the minimal globals/function main section here. Especially having no locals in the main section.
Some minor code feedback
Code:
if Command == "str" or Command == "agi" or Command == "int" then
if Command == "str" then
call SetHeroStr( LoadUnit( "nzUnitSys" ), Value, true )
elseif Command == "agi" then
call SetHeroAgi( LoadUnit( "nzUnitSys" ), Value, true )
elseif Command == "int" then
call SetHeroInt( LoadUnit( "nzUnitSys" ), Value, true )
endif
endif
The top-level condition here seems pointless to me, there's no common code between the str/agi/int sections. Also could probably be simplified to SetHeroStat if desired
Code:
set pcolor[0]="|cFFff0303"
set pcolor[1]="|cFF0041ff"
set pcolor[2]="|cFF1ce6b9"
set pcolor[3]="|cFF540081"
set pcolor[4]="|cFFfffc00"
set pcolor[5]="|cFFfe8a0e"
set pcolor[6]="|cFF20c000"
set pcolor[7]="|cFFde5bb0"
set pcolor[8]="|cFF959697"
set pcolor[9]="|cFF7ebff1"
set pcolor[10]="|cFF106246"
set pcolor[11]="|cFF4e2a04"
if (bj_MAX_PLAYER_SLOTS > 12) then
set pcolor[12]="|cFF9b0000"
set pcolor[13]="|cFF0000c3"
set pcolor[14]="|cFF00eaff"
set pcolor[15]="|cFFbe00fe"
set pcolor[16]="|cFFebcd87"
set pcolor[17]="|cFFf8a48b"
set pcolor[18]="|cFFdcb9eb"
set pcolor[19]="|cFFbfff80"
set pcolor[20]="|cFF282828"
set pcolor[21]="|cFFebf0ff"
set pcolor[22]="|cFF00781e"
set pcolor[23]="|cFFa46f33"
endif
It seems like this could be set up in the hashtable in order to not remake this array every time this method is used
Code:
pcolor[ GetHandleId( GetPlayerColor( p ) ) ]
This is a cool way of ensuring the cheatpack works properly even when the players colors are changed
Code:
function New_Item_ID takes string Item_ID returns string
local integer i = 0
local integer Pos_1 = 0
local integer Pos_2 = 0
local integer Pos_3 = 0
local integer Pos_4 = 0
...
This method can probably be shorter if there's a local integer array pos[0]-pos[3] instead