I've tried everything but I can not find the STARTKIT to edit it
When I go to create a new chard, only have the option to create automatic Bard or Thief. Power Player Or, manually selecting both skills and stats.
My classepicker.src seems that is not working. I want to create the chard with the skills of the class starting with 90 all 8 skills, and with STARTKIT Some plates and weapons.
Someone help me please. Thank you.
C:\\Distro-099\Distro\pkg\systems\newCharacter\oncreate.scr
Code: Select all
/*
Maintened by *Edwards
2008-12-02
Last Modifications 2009-07-26
* Added CheckName()
*/
use uo;
use os;
use file;
use cfgfile;
use util;
include "include/security";
include ":attributes:attributes";
include ":attributes:attributes_ex";
include ":newcharacter:newCharacter";
include ":gumps:gumps";
include ":gumps:gumps_ex";
include ":gumps:gumpprompt";
program OnCreate( params )
var who := params[1];
var selected_skills := params[2];
params := 0; // No longer needed.
who.frozen := 1;
SysLog( "Account ("+who.acctname+") is creating character ("+who.name+")" );
// Convert skill ID numbers to attribute names.
// Core currently sends them as skill IDs!
foreach skill in ( selected_skills )
skill := AP_SkillIdToAttributeName( skill );
SleepMS(2);
endforeach
// Save the chosen skills.
NC_SetStartupSkills( who, selected_skills );
/*if( CounterCheatingProfText( who ))
var account := FindAccount( who.acctname );
account.Ban();
NotifyStaffOnline( who.name, "Account ("+who.acctname+") didn't pass CounterCheatingProfText() for character ("+who.name+") --> Account banned." );
return 0;
endif*/
var uniques := array{};
GenerateItemsForSkill( who, "All", uniques );
foreach skill in ( selected_skills )
GenerateItemsForSkill( who, skill, uniques );
SleepMS(2);
endforeach
AP_SetVital( who, HUNGER, 10 );
var script := Start_Script( ":newcharacter:moveRaceRoom", who );
if( script.errortext )
SendSysMessage( who, "Error starting script <:newcharacter:moveRaceRoom> -->"+script.errortext );
return 0;
endif
return 1;
endprogram
function CounterCheatingProfText( who )
var stat_total := 0;
foreach stat in AP_ListAttributesByType( "Stat" )
var stat_value := AP_GetStat( who, stat );
if( stat_value > 45 )
return 1;
endif
stat_total += stat_value;
SleepMS(5);
endforeach
var skill_total := 0;
foreach skill in AP_ListAttributesByType( "Skill" )
var skill_value := AP_GetSkill( who, skill );
if( skill_value > 50 )
return 1;
endif
skill_total += skill_value;
SleepMS(5);
endforeach
if( stat_total > 80 )
return 1;
elseif( skill_total > 100 )
return 1;
endif
return 0;
endfunction
function GenerateItemsForSkill( who, attribute, byref uniques )
var cfg_file := ReadConfigFile( ":newcharacter:startEquip" );
var cfg_elem := cfg_file[attribute];
CreateItemsInElem( cfg_elem, who.backpack, "All" );
foreach entry in ( GetConfigStringArray( cfg_elem, "Unique" ))
entry := ParseItemString( entry );
var objtype := GetObjTypeByName( entry.name );
if( !( objtype in uniques ))
uniques.Append( objtype );
var item := CreateItemInContainer( who.backpack, entry.name, entry.amount );
item.newbie := 1;
endif
SleepMS(2);
endforeach
foreach entry in ( GetConfigStringArray( cfg_elem, "Random" ))
entry := SplitWords( entry );
var tmp_elem := cfg_file[entry[1]];
var amount := CInt( entry[2] );
var item := CreateItemsInElem( tmp_elem, who.backpack, amount );
item.newbie := 1;
SleepMS(2);
endforeach
return 1;
endfunction
function CreateItemsInElem( cfg_elem, container, amount )
var items := GetConfigStringArray( cfg_elem, "Item" );
if( amount == "All" )
foreach entry in ( GetConfigStringArray( cfg_elem, "Item" ))
entry := ParseItemString( entry );
var item := CreateItemInContainer( container, entry.name, entry.amount );
item.newbie := 1;
SleepMS(2);
endforeach
else
for( amount; amount>0; amount-=1 )
var entry := items[RandomInt( items.Size() )+1];
entry := ParseItemString( entry );
var item := CreateItemInContainer( container, entry.name, entry.amount );
item.newbie := 1;
SleepMS(2);
endfor
endif
return 1;
endfunction
function CreateItemFromElem( who, byref cfg_elem )
var item_list := GetConfigStringArray( cfg_elem, "Item" );
var entry := item_list[RandomInt( item_list.Size() )+1];
entry := SplitWords( entry );
var item := CreateItemInBackPack( who, CInt( entry[1] ), entry[2] );
if( item.errortext )
SendSysMessage( who, "Error creating "+entry+" ->"+item.errortext );
else
item.newbie := 1;
endif
return item;
endfunction
function ParseItemString( line )
line := SplitWords( line );
var name := CStr( line[1] );
var amount := RandomDiceRoll( CStr( line[2] ));
var result := struct;
result.+name := name;
result.+amount := CInt( amount );
return result;
endfunction
Code: Select all
/*
Created by *Edwards
2010-05-28
*/
use os;
use uo;
include "include/client";
include "include/shapes";
include "include/string";
include "include/itemUtil";
include ":attributes:attributes";
include ":classes:classes";
include ":gumps:gumps";
include ":gumps:gumps_ex";
include ":gumps:yesno";
include ":security:report";
const SKILLS_AVERAGE := 75; // LEVEL 1
program use_boostStone( mobile, stone )
if( !useItem_check( mobile, stone, DEFAULT_ITEM ))
return 0;
endif
mobile.frozen := 1;
TurnLightLevel( mobile, "off" );
SendClasseSelection( mobile );
Sleep(1);
TurnLightLevel( mobile, "on" );
mobile.frozen := 0;
var move := MoveObjectToLocation( mobile, 2263, 1548, -28, "ilshenar", MOVEOBJECT_FORCELOCATION );
if( move.errortext )
SendSysMessage( mobile, "Error couldn't move to destination -->"+move.errortext );
return 0;
endif
mobile.Kill();
SendSysMessage( mobile, "Select the race you would like to be.", 3, 50 );
return 1;
endprogram
function TurnLightLevel( mobile, turn:="off" )
var i;
if( turn == "off" )
for( i:=0; i<=30; i+=1 )
mobile.SetLightLevel( i, -1 );
SleepMS(100);
endfor
else
for( i:=30; i>=1; i-=1 )
mobile.SetLightLevel( i, -1 );
SleepMS(100);
endfor
endif
Sleep(1);
return 1;
endfunction
function SendClasseSelection( mobile )
//Initialize the gump
var gump := GFCreateGump();
GFMovable( gump, 0 );
GFClosable( gump, 0 );
GFTextMid( gump, 315, 200, 220, 1720, "Select a classe" );
var classe_list := array{BARD, CRAFTER, MAGE, RANGER, THIEF, WARRIOR},
y_pos := 240;
GFPage( gump, 1 );
foreach classe in ( classe_list )
GFTextLine( gump, 280, y_pos, 2100, UCFirst( GetClasseName( classe )));
GFAddButton( gump, 510, y_pos+5, 210, 211, GF_CLOSE_BTN, _classe_iter );
y_pos += 20;
SleepMS(2);
endforeach
GFAddButton( gump, 333, y_pos+10, 2440, 2440, GF_CLOSE_BTN, 0xA1 );
GFTextMid( gump, 317, y_pos+10, 220, 1720, "Click here for infos" );
//And now we need to know the answer...
var input := GFSendGump( mobile, gump );
if( !input )
SendClasseSelection( mobile );
return 0;
elseif( input[0xA1] )
var classes_info := Start_Script( ":classes:commands/player/classeInfos", mobile );
if( classes_info.errortext )
SendSysMessage( mobile, "Error starting script <:classes:commands/player/classeInfos> -->"+classes_info.errortext );
endif
SendClasseSelection( mobile );
return 0;
endif
input := input[0];
var result := classe_list[input];
if( PlayerAccepted( mobile, result ))
return 1;
endif
return SendClasseSelection( mobile );
endfunction
function PlayerAccepted( mobile, classe_name )
var classe_skills := GetClasseSkills( classe_name );
if( !classe_skills )
SendSysMessage( mobile, "Invalid classe name" );
return 0;
elseif( !YesNo( mobile, "Are you sure you want to be classed "+UCFirst( GetClasseName( classe_name ))+" level 1?", "Yes, of course! Let's go!", "No! Please let me choose again!" ))
return 0;
endif
PlayEffect( mobile );
foreach attrib_name in AP_ListAttributesByType( "Skill" )
if( attrib_name in classe_skills )
AP_SetTrueSkill( mobile, attrib_name, 75 );
else
AP_SetTrueSkill( mobile, attrib_name, 0 );
endif
SleepMS(10);
endforeach
ReportText( mobile.name+" selected classe: "+classe_name, REPORT_SYSLOG );
return 1;
endfunction
function PlayEffect( mobile )
PlayMovingEffectXYZ( mobile.x, mobile.y, mobile.z+75, mobile.x, mobile.y-1, mobile.z, 0x373A, 7, 14, 0, mobile.realm );
PlaySoundEffect( mobile, 0x01f3 );
Sleep(1);
return 1;
endfunction
Can anyone help me? How should I do?
Thank