Moderators: Siobhan, Sebastian, Drocket
function LoadGumpLayout (character)
gumplayout := array {
"nodispose",
"page 0",
"gumppic 0 50 500",
"page 1",
"gumppic 0 50 500",
"button 356 50 502 502 0 2",
"text 50 60 1350 0",
"text 55 90 0 1",
"button 40 95 2104 2103 1 0 1",
"text 55 120 0 2",
"button 40 125 2104 2103 1 0 2",
"text 55 150 0 3",
"button 40 155 2104 2103 1 0 3",
"text 55 180 0 4",
"button 40 185 2104 2103 1 0 4",
"text 235 60 1350 5",
"text 245 90 0 6",
"button 230 95 2104 2103 1 0 5",
"text 245 120 0 7",
"button 230 125 2104 2103 1 0 6",
"text 245 150 0 8",
"button 230 155 2104 2103 1 0 7",
"text 245 180 0 9",
"button 230 185 2104 2103 1 0 8",
"text 35 215 0 10",
"text 35 235 0 11",
"button 250 235 2360 2360 1 0 9", //save changes
"text 270 230 37 14",
"page 2",
"gumppic 0 50 500",
"button 0 50 501 501 0 1",
"text 70 60 1350 12",
"text 55 100 0 13",
"button 40 105 2104 2103 1 0 9"
};
gumpdata := array {
"Primary Skills",
GetSkillName(specs[1])+" " + GetSkillValDisplay (character, specs[1]),
GetSkillName(specs[2])+" " + GetSkillValDisplay (character, specs[2]),
GetSkillName(specs[3])+" " + GetSkillValDisplay (character, specs[3]),
GetSkillName(specs[4])+" " + GetSkillValDisplay (character, specs[4]),
"Secondary Skills",
GetSkillName(specs[5])+" " + GetSkillValDisplay (character, specs[5]),
GetSkillName(specs[6])+" " + GetSkillValDisplay (character, specs[6]),
GetSkillName(specs[7])+" " + GetSkillValDisplay (character, specs[7]),
GetSkillName(specs[8])+" " + GetSkillValDisplay (character, specs[8]),
"STR/DEX/INT Caps:",
maxstr + " / " + maxdex + " / " + maxint,
"Trade skill",
GetSkillName(specs[9])+" "+ GetSkillValDisplay(character, specs[9]),
"",
"Save Changes"
};
endfunction
--- stuff ---
elseif (gump_return == 9) //Save the changes to skills
var nochanges := 1;
for i := 1 to 9
if (!specs[i] and specs[i] != 0)
SendSysMessage (character, "You must select all specializations before saving.");
return 0;
elseif (specs[i] != originalspecs[i])
nochanges := 0;
endif
endfor
if (nochanges)
SendSysMessage (character, "You haven't made any changes!");
return 0;
endif
SetObjProperty (character, "primary1", specs[1]);
SetObjProperty (character, "primary2", specs[2]);
SetObjProperty (character, "primary3", specs[3]);
SetObjProperty (character, "primary4", specs[4]);
SetObjProperty (character, "secondary1", specs[5]);
SetObjProperty (character, "secondary2", specs[6]);
SetObjProperty (character, "secondary3", specs[7]);
SetObjProperty (character, "secondary4", specs[8]);
SetObjProperty (character, "tradeskill", specs[9]);
SetMaxStats (character, 1);
SendSysMessage (character, "Changes saved!");
return 1;
else //specialize in a skill
var SkillNum := PickASkill (character);
if (SkillNum or SkillNum == 0)
var skillname := GetSkillName (skillnum);
if (gump_return == 9)
if (!IsTradeSkill (skillnum))
SendSysMessage (character, "That is not a tradeskill!");
return 0;
endif
endif
for i := 1 to 9
if (specs[i] == SkillNum)
SendSysMessage (character, "You're already specialized in that!");
return 0;
endif
endfor
specs [gump_return] := skillnum;
SetMaxStats (character, 0);
SendSysMessage (character, "You specialize in " + skillname);
return 0;
else
SendSysMessage (character, "Canceled");
return 1;
endif
endif
endfunction
function LoadSpecializations (character)
if (!GetObjProperty (character, "primary1"))
if (GetObjProperty (character, "primary1") != 0)
return {};
endif
endif
var myspecs := {};
myspecs[1] := GetObjProperty (character, "primary1");
myspecs[2] := GetObjProperty (character, "primary2");
myspecs[3] := GetObjProperty (character, "primary3");
myspecs[4] := GetObjProperty (character, "primary4");
myspecs[5] := GetObjProperty (character, "secondary1");
myspecs[6] := GetObjProperty (character, "secondary2");
myspecs[7] := GetObjProperty (character, "secondary3");
myspecs[8] := GetObjProperty (character, "secondary4");
myspecs[9] := GetObjProperty (character, "tradeskill");
return myspecs;
endfunction
function CheckIfSpecialized (character, skillid)
var myspecs := LoadSpecializations (character);
for i := 1 to 9
if (myspecs[i] == skillid)
return i;
endif
endfor
return 0;
endfunction
function GetBaseSkillCap (byref me, skillid)
if (!me.acctname)
return 0;
endif
if (skillid == GetObjProperty (me, "primary1"))
return 1000;
elseif (skillid == GetObjProperty (me, "tradeskill"))
return 1000;
elseif (skillid == GetObjProperty (me, "primary2"))
return 1000;
elseif ( skillid == GetObjProperty (me, "primary3") )
return 1000;
elseif ( skillid == GetObjProperty (me, "primary4") )
return 1000;
elseif ( skillid == GetObjProperty (me, "secondary1") )
return 800;
elseif ( skillid == GetObjProperty (me, "secondary2") )
return 800;
elseif ( skillid == GetObjProperty (me, "secondary3") )
return 800;
elseif ( skillid == GetObjProperty (me, "secondary4") )
return 800;
else
return 600;
endif
endfunction
function PracticeSpecs (byref character)
var specs := LoadSpecializations (character);
for i := 1 to 4
var skillid := specs[i];
if (skillid or skillid == 0)
AwardRawSkillPoints (character, skillid, 100);
endif
endfor
for i := 5 to 9
var skillid := specs[i];
if (skillid or skillid == 0)
AwardRawSkillPoints (character, skillid, 50);
endif
endfor
endfunction
Users browsing this forum: No registered users and 0 guests