Ejemplo n.º 1
0
 public void SpawnRequest(string ModID, int ID, Player player)
 {
     RequestModID = ModID;
     RequestID    = ID;
     Base         = RequestContainer.GetRequest(ID, ModID);
     if (Base == null)
     {
         SetRequestOnCooldown(true);
         return;
     }
     ObjectiveCount    = 0;
     MaxObjectiveCount = Base.GetRequestObjectiveCount(RequestGiver.FriendshipLevel);
     Failed            = false;
     state             = RequestState.WaitingAccept;
     RequestTimeLeft   = Main.rand.Next(72 * 3600, 120 * 3600);
     GenerateRewards(player);
 }
Ejemplo n.º 2
0
 public void Load(Terraria.ModLoader.IO.TagCompound writer, string UniqueID, int ModVersion)
 {
     RequestID         = writer.GetInt(UniqueID + "_ID");
     RequestModID      = writer.GetString(UniqueID + "_ModID");
     state             = (RequestState)writer.GetByte(UniqueID + "_State");
     ObjectiveCount    = writer.GetInt(UniqueID + "_ObjectiveCount");
     MaxObjectiveCount = writer.GetInt(UniqueID + "_MaxObjectiveCount");
     RequestTimeLeft   = writer.GetInt(UniqueID + "_TimeLeft");
     for (byte i = 0; i < 3; i++)
     {
         string            RewardID = UniqueID + "_rwi" + i;
         ThisRequestReward reward   = Rewards[i];
         reward.item  = writer.Get <Item>(RewardID + "_item");
         reward.value = writer.GetInt(RewardID + "_value");
     }
     if (state != RequestState.Cooldown)
     {
         Base = RequestContainer.GetRequest(RequestID, RequestModID);
     }
 }