450 :(NSDictionary *)dict
451{
454
455 origin = [dict objectForKey:@"origin"];
456 if ([
origin isKindOfClass:[NSNumber class]] ||
457 ([
origin respondsToSelector:@selector(intValue)] && ([
origin intValue] != 0 || [
origin isEqual:
@"0"])))
458 {
459
460 [self setOriginSystem:[origin intValue]];
461 }
462 else if ([
origin isKindOfClass:[NSString class]])
463 {
464 OOSystemID sys = [UNIVERSE findSystemFromName:origin];
465 if (sys < 0)
466 {
467 OOLogERR(
@"character.load.unknownSystem",
@"could not find a system named '%@' in this galaxy.",
origin);
468 [self setOriginSystem:(ranrot_rand() & 0xff)];
469 }
470 else
471 {
472 [self setOriginSystem:sys];
473 }
474 }
475 else
476 {
477
478 [self setOriginSystem:(ranrot_rand() & 0xff)];
479 }
480
481 if ([dict objectForKey:@"random_seed"])
482 {
484 }
485 else
486 {
493 }
494 [self setGenSeed:seed];
495 [self basicSetUp];
496
497 if ([dict oo_stringForKey:
@"role"]) [
self castInRole:[dict oo_stringForKey:
@"role"]];
498 if ([dict oo_stringForKey:
@"name"]) [
self setName:[dict oo_stringForKey:
@"name"]];
499 if ([dict oo_stringForKey:
@"short_description"]) [
self setShortDescription:[dict oo_stringForKey:
@"short_description"]];
500 if ([dict objectForKey:
@"legal_status"]) [
self setLegalStatus:[dict oo_intForKey:
@"legal_status"]];
501 if ([dict objectForKey:
@"bounty"]) [
self setLegalStatus:[dict oo_intForKey:
@"bounty"]];
502 if ([dict objectForKey:
@"insurance"]) [
self setInsuranceCredits:[dict oo_unsignedLongLongForKey:
@"insurance"]];
503 if ([dict oo_stringForKey:
@"script"]) [
self setCharacterScript:[dict oo_stringForKey:
@"script"]];
504 if ([dict oo_arrayForKey:
@"script_actions"]) [
self setLegacyScript:[dict oo_arrayForKey:
@"script_actions"]];
505
506}
#define OOLogERR(class, format,...)
Random_Seed RandomSeedFromString(NSString *abcdefString)