コード例 #1
0
 public OwnerData(NpcRecord owner, Global global, Faction faction, int rank)
 {
     this.owner   = owner;
     this.global  = global;
     this.faction = faction;
     this.rank    = rank;
 }
コード例 #2
0
    public void Initialize(NpcRecord npcRecord)
    {
        greetDistanceMultiplier = GameSetting.Get("iGreetDistanceMultiplier").IntValue;
        greetDistanceReset      = GameSetting.Get("fGreetDistanceReset").FloatValue;
        voiceIdleOdds           = GameSetting.Get("fVoiceIdleOdds").FloatValue;

        this.npcRecord = npcRecord;
    }
コード例 #3
0
    public void Initialize(NpcRecord npcRecord)
    {
        this.npcData = npcRecord;
        if (npcRecord.Faction != null)
        {
            Factions.Add(npcRecord.Faction, new FactionRankReputationPair(npcRecord.NpcSubData.Rank, 0));
        }

        // Initialize various things
        attributeMods = new byte[Enum.GetNames(typeof(CharacterAttribute)).Length];
        skillMods     = new byte[Enum.GetNames(typeof(CharacterSkill)).Length];
        spells        = new List <SpellRecord>(npcRecord.Spells);

        fatigue = MaxFatigue;
        health  = MaxHealth;
        magicka = MaxMagicka;
    }
コード例 #4
0
        public static void NpcReplyList(WorldClient client, string[] args)
        {
            if (args.Length < 2)
            {
                client.Character.Reply("Get NPC's available replies.");
                client.Character.Reply(".npc replies|r $NpcId");
                client.Character.Reply(" - $NpcId ⇒ ID of the NPC template (not spawn id).");

                return;
            }

            ushort npcTemplateId = ushort.Parse(args[1]);

            NpcRecord      npcRecord     = NpcRecord.GetNpc(npcTemplateId);
            CSVDoubleArray messagesArray = npcRecord.Replies;

            client.Character.Reply($"Replies for npc {npcRecord.Id} ({messagesArray.Values.Length}): ");

            foreach (uint[] tuple in messagesArray.Values)
            {
                uint msgId = tuple[0];
                client.Character.Reply($" - {msgId}");
            }
        }
コード例 #5
0
	public ReferenceData(System.IO.BinaryReader reader)
	{
		var index = reader.ReadInt32();

		while (true)
		{
			var type = (SubRecordType)reader.ReadInt32();
			var size = reader.ReadInt32();

			switch (type)
			{
				case SubRecordType.Id:
					target = Record.GetRecord<CreatableRecord>(reader.ReadString(size));
					break;
				case SubRecordType.Scale:
					scale = reader.ReadSingle();
					break;
				case SubRecordType.DoorData:
					doorData = DoorExitData.Create(reader);
					break;
				case SubRecordType.DoorName:
					loadCell = reader.ReadString(size);
					break;
				case SubRecordType.FloatValue:
					lockLevel = reader.ReadInt32();
					break;
				case SubRecordType.KeyName:
					key = Record.GetRecord<MiscItemRecord>(reader.ReadString(size));
					break;
				case SubRecordType.Trapname:
					trap = Record.GetRecord<SpellRecord>(reader.ReadString(size));
					break;
				case SubRecordType.ReferenceBlocked:
					referenceBlocked = reader.ReadByte() != 0;
					break;
				case SubRecordType.OwnerName:
					owner = Record.GetRecord<NpcRecord>(reader.ReadString(size));
					break;
				case SubRecordType.BodyName:
					global = Record.GetRecord<Global>(reader.ReadString(size));
					break;
				case SubRecordType.IntValue:
					health = reader.ReadInt32(); // Health remaining? Also charge for lights
					break;
				case SubRecordType.Name9:
					quantity = reader.ReadInt32(); //0, 1, 5, 10, 25, 100. Definitely value override  or object count
					break;
				case SubRecordType.SoulName:
					soul = Record.GetRecord<CreatureRecord>(reader.ReadString(size));
					break;
				case SubRecordType.Data:
					transformData = new TransformData(reader);
					break;
				case SubRecordType.CreatureName:
					faction = Record.GetRecord<Faction>(reader.ReadString(size));
					break;
				case SubRecordType.Index:
					rank = reader.ReadInt32();
					break;
				case SubRecordType.SoulCharge:
					charge = reader.ReadSingle();
					break;
				default:
					reader.BaseStream.Position -= 8;
					return;
			}
		}
	}